Skip to content

Commit

Permalink
deprecate: arcjet enum-like objects
Browse files Browse the repository at this point in the history
  • Loading branch information
e-moran committed Dec 24, 2024
1 parent 02e4435 commit 752cc8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type RequiredProps<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
type ArcjetEnum<T extends string> = { readonly [Key in T]: T };

export type ArcjetMode = "LIVE" | "DRY_RUN";
/** @deprecated */
export const ArcjetMode: ArcjetEnum<ArcjetMode> = Object.freeze({
LIVE: "LIVE",
DRY_RUN: "DRY_RUN",
Expand All @@ -21,6 +22,7 @@ export type ArcjetRateLimitAlgorithm =
| "TOKEN_BUCKET"
| "FIXED_WINDOW"
| "SLIDING_WINDOW";
/** @deprecated */
export const ArcjetRateLimitAlgorithm: ArcjetEnum<ArcjetRateLimitAlgorithm> =
Object.freeze({
TOKEN_BUCKET: "TOKEN_BUCKET",
Expand All @@ -34,6 +36,7 @@ export type ArcjetEmailType =
| "NO_MX_RECORDS"
| "NO_GRAVATAR"
| "INVALID";
/** @deprecated */
export const ArcjetEmailType: ArcjetEnum<ArcjetEmailType> = {
DISPOSABLE: "DISPOSABLE",
FREE: "FREE",
Expand All @@ -56,6 +59,7 @@ export type ArcjetStack =
| "DENO"
| "NESTJS"
| "REMIX";
/** @deprecated */
export const ArcjetStack: ArcjetEnum<ArcjetStack> = {
NODEJS: "NODEJS",
NEXTJS: "NEXTJS",
Expand All @@ -67,6 +71,7 @@ export const ArcjetStack: ArcjetEnum<ArcjetStack> = {
};

export type ArcjetRuleState = "RUN" | "NOT_RUN" | "CACHED" | "DRY_RUN";
/** @deprecated */
export const ArcjetRuleState: ArcjetEnum<ArcjetRuleState> = Object.freeze({
RUN: "RUN",
NOT_RUN: "NOT_RUN",
Expand All @@ -75,6 +80,7 @@ export const ArcjetRuleState: ArcjetEnum<ArcjetRuleState> = Object.freeze({
});

export type ArcjetConclusion = "ALLOW" | "DENY" | "CHALLENGE" | "ERROR";
/** @deprecated */
export const ArcjetConclusion: ArcjetEnum<ArcjetConclusion> = Object.freeze({
ALLOW: "ALLOW",
DENY: "DENY",
Expand All @@ -87,6 +93,7 @@ export type ArcjetSensitiveInfoType =
| "PHONE_NUMBER"
| "IP_ADDRESS"
| "CREDIT_CARD_NUMBER";
/** @deprecated */
export const ArcjetSensitiveInfoType: ArcjetEnum<ArcjetSensitiveInfoType> = {
EMAIL: "EMAIL",
PHONE_NUMBER: "PHONE_NUMBER",
Expand All @@ -95,6 +102,7 @@ export const ArcjetSensitiveInfoType: ArcjetEnum<ArcjetSensitiveInfoType> = {
};

export type ArcjetRuleType = "LOCAL" | "REMOTE";
/** @deprecated */
export const ArcjetRuleType: ArcjetEnum<ArcjetRuleType> = Object.freeze({
LOCAL: "LOCAL",
REMOTE: "REMOTE",
Expand Down

0 comments on commit 752cc8b

Please sign in to comment.