From f6147071e84ff8fb4d9c4f5c0612aa2ea31bc23b Mon Sep 17 00:00:00 2001 From: e-moran Date: Tue, 24 Dec 2024 10:02:30 +0000 Subject: [PATCH 1/2] chore: deprecate arcjet enum-like objects --- protocol/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocol/index.ts b/protocol/index.ts index d256511da..655c576e2 100644 --- a/protocol/index.ts +++ b/protocol/index.ts @@ -12,6 +12,7 @@ type RequiredProps = Required> & Omit; type ArcjetEnum = { readonly [Key in T]: T }; export type ArcjetMode = "LIVE" | "DRY_RUN"; +/** @deprecated */ export const ArcjetMode: ArcjetEnum = Object.freeze({ LIVE: "LIVE", DRY_RUN: "DRY_RUN", @@ -21,6 +22,7 @@ export type ArcjetRateLimitAlgorithm = | "TOKEN_BUCKET" | "FIXED_WINDOW" | "SLIDING_WINDOW"; +/** @deprecated */ export const ArcjetRateLimitAlgorithm: ArcjetEnum = Object.freeze({ TOKEN_BUCKET: "TOKEN_BUCKET", @@ -34,6 +36,7 @@ export type ArcjetEmailType = | "NO_MX_RECORDS" | "NO_GRAVATAR" | "INVALID"; +/** @deprecated */ export const ArcjetEmailType: ArcjetEnum = { DISPOSABLE: "DISPOSABLE", FREE: "FREE", @@ -56,6 +59,7 @@ export type ArcjetStack = | "DENO" | "NESTJS" | "REMIX"; +/** @deprecated */ export const ArcjetStack: ArcjetEnum = { NODEJS: "NODEJS", NEXTJS: "NEXTJS", @@ -67,6 +71,7 @@ export const ArcjetStack: ArcjetEnum = { }; export type ArcjetRuleState = "RUN" | "NOT_RUN" | "CACHED" | "DRY_RUN"; +/** @deprecated */ export const ArcjetRuleState: ArcjetEnum = Object.freeze({ RUN: "RUN", NOT_RUN: "NOT_RUN", @@ -75,6 +80,7 @@ export const ArcjetRuleState: ArcjetEnum = Object.freeze({ }); export type ArcjetConclusion = "ALLOW" | "DENY" | "CHALLENGE" | "ERROR"; +/** @deprecated */ export const ArcjetConclusion: ArcjetEnum = Object.freeze({ ALLOW: "ALLOW", DENY: "DENY", @@ -87,6 +93,7 @@ export type ArcjetSensitiveInfoType = | "PHONE_NUMBER" | "IP_ADDRESS" | "CREDIT_CARD_NUMBER"; +/** @deprecated */ export const ArcjetSensitiveInfoType: ArcjetEnum = { EMAIL: "EMAIL", PHONE_NUMBER: "PHONE_NUMBER", @@ -95,6 +102,7 @@ export const ArcjetSensitiveInfoType: ArcjetEnum = { }; export type ArcjetRuleType = "LOCAL" | "REMOTE"; +/** @deprecated */ export const ArcjetRuleType: ArcjetEnum = Object.freeze({ LOCAL: "LOCAL", REMOTE: "REMOTE", From 8c7e855568594d490704b3aad32684ee82675f58 Mon Sep 17 00:00:00 2001 From: e-moran Date: Fri, 3 Jan 2025 15:38:05 +0000 Subject: [PATCH 2/2] add deprecation message --- protocol/index.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/protocol/index.ts b/protocol/index.ts index 655c576e2..89b46f8da 100644 --- a/protocol/index.ts +++ b/protocol/index.ts @@ -12,7 +12,7 @@ type RequiredProps = Required> & Omit; type ArcjetEnum = { readonly [Key in T]: T }; export type ArcjetMode = "LIVE" | "DRY_RUN"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetMode: ArcjetEnum = Object.freeze({ LIVE: "LIVE", DRY_RUN: "DRY_RUN", @@ -22,7 +22,7 @@ export type ArcjetRateLimitAlgorithm = | "TOKEN_BUCKET" | "FIXED_WINDOW" | "SLIDING_WINDOW"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetRateLimitAlgorithm: ArcjetEnum = Object.freeze({ TOKEN_BUCKET: "TOKEN_BUCKET", @@ -36,7 +36,7 @@ export type ArcjetEmailType = | "NO_MX_RECORDS" | "NO_GRAVATAR" | "INVALID"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetEmailType: ArcjetEnum = { DISPOSABLE: "DISPOSABLE", FREE: "FREE", @@ -59,7 +59,7 @@ export type ArcjetStack = | "DENO" | "NESTJS" | "REMIX"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetStack: ArcjetEnum = { NODEJS: "NODEJS", NEXTJS: "NEXTJS", @@ -71,7 +71,7 @@ export const ArcjetStack: ArcjetEnum = { }; export type ArcjetRuleState = "RUN" | "NOT_RUN" | "CACHED" | "DRY_RUN"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetRuleState: ArcjetEnum = Object.freeze({ RUN: "RUN", NOT_RUN: "NOT_RUN", @@ -80,7 +80,7 @@ export const ArcjetRuleState: ArcjetEnum = Object.freeze({ }); export type ArcjetConclusion = "ALLOW" | "DENY" | "CHALLENGE" | "ERROR"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetConclusion: ArcjetEnum = Object.freeze({ ALLOW: "ALLOW", DENY: "DENY", @@ -93,7 +93,7 @@ export type ArcjetSensitiveInfoType = | "PHONE_NUMBER" | "IP_ADDRESS" | "CREDIT_CARD_NUMBER"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetSensitiveInfoType: ArcjetEnum = { EMAIL: "EMAIL", PHONE_NUMBER: "PHONE_NUMBER", @@ -102,7 +102,7 @@ export const ArcjetSensitiveInfoType: ArcjetEnum = { }; export type ArcjetRuleType = "LOCAL" | "REMOTE"; -/** @deprecated */ +/** @deprecated use equivalent string union type instead */ export const ArcjetRuleType: ArcjetEnum = Object.freeze({ LOCAL: "LOCAL", REMOTE: "REMOTE",