@arcjet/protocol
Advanced tools
| import { ArcjetContext, ArcjetDecision, ArcjetRequestDetails, ArcjetRule, ArcjetStack } from "./index.js"; | ||
| import { Transport } from "@connectrpc/connect"; | ||
| //#region src/client.d.ts | ||
| interface Client { | ||
| decide(context: ArcjetContext, details: ArcjetRequestDetails, rules: ArcjetRule[]): Promise<ArcjetDecision>; | ||
| report(context: ArcjetContext, request: ArcjetRequestDetails, decision: ArcjetDecision, rules: ArcjetRule[]): void; | ||
| } | ||
| type ClientOptions = { | ||
| transport: Transport; | ||
| baseUrl: string; | ||
| timeout: number; | ||
| sdkStack: ArcjetStack; | ||
| sdkVersion: string; | ||
| }; | ||
| /** | ||
| * Compute the timeout for a `Decide` request based on the configured rules. | ||
| * | ||
| * @internal Exported for testing only. | ||
| * @param timeout | ||
| * Base timeout in milliseconds. | ||
| * @param rules | ||
| * Rules that will be evaluated in this request. | ||
| * @returns | ||
| * Adjusted timeout in milliseconds. | ||
| */ | ||
| declare function decideTimeout(timeout: number, rules: ArcjetRule[]): number; | ||
| declare function createClient(options: ClientOptions): Client; | ||
| //#endregion | ||
| export { Client, ClientOptions, createClient, decideTimeout }; |
+129
| import "./index.js"; | ||
| import { ArcjetDecisionFromProtocol, ArcjetDecisionToProtocol, ArcjetRuleToProtocol, ArcjetStackToProtocol } from "./convert.js"; | ||
| import { create } from "@bufbuild/protobuf"; | ||
| import { createClient as createClient$1 } from "@connectrpc/connect"; | ||
| import { DecideRequestSchema, DecideService, ReportRequestSchema } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
| //#region src/client.ts | ||
| function errorMessage(err) { | ||
| if (err) { | ||
| if (typeof err === "string") return err; | ||
| if (typeof err === "object" && "message" in err && typeof err.message === "string") return err.message; | ||
| } | ||
| return "Unknown problem"; | ||
| } | ||
| /** | ||
| * Compute the timeout for a `Decide` request based on the configured rules. | ||
| * | ||
| * @internal Exported for testing only. | ||
| * @param timeout | ||
| * Base timeout in milliseconds. | ||
| * @param rules | ||
| * Rules that will be evaluated in this request. | ||
| * @returns | ||
| * Adjusted timeout in milliseconds. | ||
| */ | ||
| function decideTimeout(timeout, rules) { | ||
| let hasEmail = false; | ||
| let hasPromptInjection = false; | ||
| for (const rule of rules) { | ||
| if (rule.type === "EMAIL") hasEmail = true; | ||
| if (rule.type === "PROMPT_INJECTION_DETECTION") hasPromptInjection = true; | ||
| } | ||
| let result = hasEmail ? timeout * 2 : timeout; | ||
| if (hasPromptInjection) result = Math.max(result, 1e3); | ||
| return result; | ||
| } | ||
| function createClient(options) { | ||
| const { transport, sdkVersion, baseUrl, timeout } = options; | ||
| const sdkStack = ArcjetStackToProtocol(options.sdkStack); | ||
| const client = createClient$1(DecideService, transport); | ||
| return Object.freeze({ | ||
| async decide(context, details, rules) { | ||
| const { log } = context; | ||
| const protoRules = []; | ||
| for (const rule of rules) protoRules.push(ArcjetRuleToProtocol(rule)); | ||
| const cleanDetails = { | ||
| ip: details.ip, | ||
| method: details.method, | ||
| protocol: details.protocol, | ||
| host: details.host, | ||
| path: details.path, | ||
| headers: Object.fromEntries(details.headers.entries()), | ||
| cookies: details.cookies, | ||
| query: details.query, | ||
| extra: details.extra, | ||
| correlationId: details.correlationId ?? "" | ||
| }; | ||
| const decideRequest = create(DecideRequestSchema, { | ||
| sdkStack, | ||
| sdkVersion, | ||
| characteristics: context.characteristics, | ||
| details: typeof details.email === "string" ? { | ||
| ...cleanDetails, | ||
| email: details.email | ||
| } : cleanDetails, | ||
| rules: protoRules | ||
| }); | ||
| log.debug("Decide request to %s", baseUrl); | ||
| const decision = ArcjetDecisionFromProtocol((await client.decide(decideRequest, { | ||
| headers: { Authorization: `Bearer ${context.key}` }, | ||
| timeoutMs: decideTimeout(timeout, rules) | ||
| })).decision); | ||
| log.debug({ | ||
| id: decision.id, | ||
| fingerprint: context.fingerprint, | ||
| path: details.path, | ||
| runtime: context.runtime, | ||
| ttl: decision.ttl, | ||
| conclusion: decision.conclusion, | ||
| reason: decision.reason, | ||
| ruleResults: decision.results | ||
| }, "Decide response"); | ||
| return decision; | ||
| }, | ||
| report(context, details, decision, rules) { | ||
| const { log } = context; | ||
| const cleanDetails = { | ||
| ip: details.ip, | ||
| method: details.method, | ||
| protocol: details.protocol, | ||
| host: details.host, | ||
| path: details.path, | ||
| headers: Object.fromEntries(details.headers.entries()), | ||
| cookies: details.cookies, | ||
| query: details.query, | ||
| extra: details.extra, | ||
| correlationId: details.correlationId ?? "" | ||
| }; | ||
| const reportRequest = create(ReportRequestSchema, { | ||
| sdkStack, | ||
| sdkVersion, | ||
| characteristics: context.characteristics, | ||
| details: typeof details.email === "string" ? { | ||
| ...cleanDetails, | ||
| email: details.email | ||
| } : cleanDetails, | ||
| decision: ArcjetDecisionToProtocol(decision), | ||
| rules: rules.map(ArcjetRuleToProtocol) | ||
| }); | ||
| log.debug("Report request to %s", baseUrl); | ||
| const reportPromise = client.report(reportRequest, { | ||
| headers: { Authorization: `Bearer ${context.key}` }, | ||
| timeoutMs: 2e3 | ||
| }).then((response) => { | ||
| log.debug({ | ||
| id: decision.id, | ||
| fingerprint: context.fingerprint, | ||
| path: details.path, | ||
| runtime: context.runtime, | ||
| ttl: decision.ttl | ||
| }, "Report response"); | ||
| }).catch((err) => { | ||
| log.info("Encountered problem sending report: %s", errorMessage(err)); | ||
| }); | ||
| if (typeof context.waitUntil === "function") context.waitUntil(reportPromise); | ||
| } | ||
| }); | ||
| } | ||
| //#endregion | ||
| export { createClient, decideTimeout }; |
| import { ArcjetConclusion, ArcjetDecision, ArcjetEmailType, ArcjetIpDetails, ArcjetMode, ArcjetReason, ArcjetRule, ArcjetRuleResult, ArcjetRuleState, ArcjetStack } from "./index.js"; | ||
| import { Conclusion, Decision, EmailType, IpDetails, Mode, Reason, Rule, RuleResult, RuleState, SDKStack } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
| //#region src/convert.d.ts | ||
| declare function ArcjetModeToProtocol(mode: ArcjetMode): Mode; | ||
| declare function ArcjetEmailTypeToProtocol(emailType: ArcjetEmailType): EmailType; | ||
| declare function ArcjetEmailTypeFromProtocol(emailType: EmailType): ArcjetEmailType; | ||
| declare function ArcjetStackToProtocol(stack: ArcjetStack): SDKStack; | ||
| declare function ArcjetRuleStateToProtocol(stack: ArcjetRuleState): RuleState; | ||
| declare function ArcjetRuleStateFromProtocol(ruleState: RuleState): ArcjetRuleState; | ||
| declare function ArcjetConclusionToProtocol(conclusion: ArcjetConclusion): Conclusion; | ||
| declare function ArcjetConclusionFromProtocol(conclusion: Conclusion): ArcjetConclusion; | ||
| declare function ArcjetReasonFromProtocol(proto?: Reason): ArcjetReason; | ||
| declare function ArcjetReasonToProtocol(reason: ArcjetReason): Reason; | ||
| declare function ArcjetRuleResultToProtocol(ruleResult: ArcjetRuleResult): RuleResult; | ||
| declare function ArcjetRuleResultFromProtocol(proto: RuleResult): ArcjetRuleResult; | ||
| declare function ArcjetDecisionToProtocol(decision: ArcjetDecision): Decision; | ||
| declare function ArcjetIpDetailsFromProtocol(ipDetails?: IpDetails): ArcjetIpDetails; | ||
| declare function ArcjetDecisionFromProtocol(decision?: Decision): ArcjetDecision; | ||
| declare function ArcjetRuleToProtocol<Props extends { | ||
| [key: string]: unknown; | ||
| }>(rule: ArcjetRule<Props>): Rule; | ||
| //#endregion | ||
| export { ArcjetConclusionFromProtocol, ArcjetConclusionToProtocol, ArcjetDecisionFromProtocol, ArcjetDecisionToProtocol, ArcjetEmailTypeFromProtocol, ArcjetEmailTypeToProtocol, ArcjetIpDetailsFromProtocol, ArcjetModeToProtocol, ArcjetReasonFromProtocol, ArcjetReasonToProtocol, ArcjetRuleResultFromProtocol, ArcjetRuleResultToProtocol, ArcjetRuleStateFromProtocol, ArcjetRuleStateToProtocol, ArcjetRuleToProtocol, ArcjetStackToProtocol }; |
+465
| import { ArcjetAllowDecision, ArcjetBotReason, ArcjetChallengeDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetErrorDecision, ArcjetErrorReason, ArcjetFilterReason, ArcjetIpDetails, ArcjetPromptInjectionReason, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetSensitiveInfoReason, ArcjetShieldReason } from "./index.js"; | ||
| import { create } from "@bufbuild/protobuf"; | ||
| import { timestampDate, timestampFromDate } from "@bufbuild/protobuf/wkt"; | ||
| import { BotV2ReasonSchema, Conclusion, DecisionSchema, EdgeRuleReasonSchema, EmailReasonSchema, EmailType, ErrorReasonSchema, Mode, PromptInjectionReasonSchema, RateLimitAlgorithm, RateLimitReasonSchema, ReasonSchema, RuleResultSchema, RuleSchema, RuleState, SDKStack, SensitiveInfoReasonSchema, ShieldReasonSchema } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
| //#region src/convert.ts | ||
| function ArcjetModeToProtocol(mode) { | ||
| switch (mode) { | ||
| case "LIVE": return Mode.LIVE; | ||
| case "DRY_RUN": return Mode.DRY_RUN; | ||
| default: return Mode.UNSPECIFIED; | ||
| } | ||
| } | ||
| function ArcjetEmailTypeToProtocol(emailType) { | ||
| switch (emailType) { | ||
| case "DISPOSABLE": return EmailType.DISPOSABLE; | ||
| case "FREE": return EmailType.FREE; | ||
| case "NO_MX_RECORDS": return EmailType.NO_MX_RECORDS; | ||
| case "NO_GRAVATAR": return EmailType.NO_GRAVATAR; | ||
| case "INVALID": return EmailType.INVALID; | ||
| default: return EmailType.UNSPECIFIED; | ||
| } | ||
| } | ||
| function ArcjetEmailTypeFromProtocol(emailType) { | ||
| switch (emailType) { | ||
| case EmailType.UNSPECIFIED: throw new Error("Invalid EmailType"); | ||
| case EmailType.DISPOSABLE: return "DISPOSABLE"; | ||
| case EmailType.FREE: return "FREE"; | ||
| case EmailType.NO_MX_RECORDS: return "NO_MX_RECORDS"; | ||
| case EmailType.NO_GRAVATAR: return "NO_GRAVATAR"; | ||
| case EmailType.INVALID: return "INVALID"; | ||
| default: throw new Error("Invalid EmailType"); | ||
| } | ||
| } | ||
| function ArcjetStackToProtocol(stack) { | ||
| switch (stack) { | ||
| case "ASTRO": return SDKStack.SDK_STACK_ASTRO; | ||
| case "BUN": return SDKStack.SDK_STACK_BUN; | ||
| case "DENO": return SDKStack.SDK_STACK_DENO; | ||
| case "FASTIFY": return SDKStack.SDK_STACK_FASTIFY; | ||
| case "NEXTJS": return SDKStack.SDK_STACK_NEXTJS; | ||
| case "NODEJS": return SDKStack.SDK_STACK_NODEJS; | ||
| case "REACT_ROUTER": return SDKStack.SDK_STACK_REACT_ROUTER; | ||
| case "REMIX": return SDKStack.SDK_STACK_REMIX; | ||
| case "SVELTEKIT": return SDKStack.SDK_STACK_SVELTEKIT; | ||
| case "NESTJS": return SDKStack.SDK_STACK_NESTJS; | ||
| case "NUXT": return SDKStack.SDK_STACK_NUXT; | ||
| default: return SDKStack.SDK_STACK_UNSPECIFIED; | ||
| } | ||
| } | ||
| function ArcjetRuleStateToProtocol(stack) { | ||
| switch (stack) { | ||
| case "RUN": return RuleState.RUN; | ||
| case "NOT_RUN": return RuleState.NOT_RUN; | ||
| case "CACHED": return RuleState.CACHED; | ||
| case "DRY_RUN": return RuleState.DRY_RUN; | ||
| default: return RuleState.UNSPECIFIED; | ||
| } | ||
| } | ||
| function ArcjetRuleStateFromProtocol(ruleState) { | ||
| switch (ruleState) { | ||
| case RuleState.UNSPECIFIED: throw new Error("Invalid RuleState"); | ||
| case RuleState.RUN: return "RUN"; | ||
| case RuleState.NOT_RUN: return "NOT_RUN"; | ||
| case RuleState.DRY_RUN: return "DRY_RUN"; | ||
| case RuleState.CACHED: return "CACHED"; | ||
| default: throw new Error("Invalid RuleState"); | ||
| } | ||
| } | ||
| function ArcjetConclusionToProtocol(conclusion) { | ||
| switch (conclusion) { | ||
| case "ALLOW": return Conclusion.ALLOW; | ||
| case "DENY": return Conclusion.DENY; | ||
| case "CHALLENGE": return Conclusion.CHALLENGE; | ||
| case "ERROR": return Conclusion.ERROR; | ||
| default: return Conclusion.UNSPECIFIED; | ||
| } | ||
| } | ||
| function ArcjetConclusionFromProtocol(conclusion) { | ||
| switch (conclusion) { | ||
| case Conclusion.UNSPECIFIED: throw new Error("Invalid Conclusion"); | ||
| case Conclusion.ALLOW: return "ALLOW"; | ||
| case Conclusion.DENY: return "DENY"; | ||
| case Conclusion.CHALLENGE: return "CHALLENGE"; | ||
| case Conclusion.ERROR: return "ERROR"; | ||
| default: throw new Error("Invalid Conclusion"); | ||
| } | ||
| } | ||
| function ArcjetReasonFromProtocol(proto) { | ||
| if (typeof proto === "undefined") return new ArcjetReason(); | ||
| if (typeof proto !== "object" || typeof proto.reason !== "object") throw new Error("Invalid Reason"); | ||
| switch (proto.reason.case) { | ||
| case "rateLimit": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetRateLimitReason({ | ||
| max: reason.max, | ||
| remaining: reason.remaining, | ||
| reset: reason.resetInSeconds, | ||
| window: reason.windowInSeconds, | ||
| resetTime: reason.resetTime ? timestampDate(reason.resetTime) : void 0 | ||
| }); | ||
| } | ||
| case "botV2": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetBotReason({ | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| verified: reason.verified, | ||
| spoofed: reason.spoofed | ||
| }); | ||
| } | ||
| case "edgeRule": return new ArcjetEdgeRuleReason(); | ||
| case "shield": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetShieldReason({ shieldTriggered: reason.shieldTriggered }); | ||
| } | ||
| case "email": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetEmailReason({ emailTypes: reason.emailTypes.map(ArcjetEmailTypeFromProtocol) }); | ||
| } | ||
| case "filter": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetFilterReason({ | ||
| matchedExpressions: reason.matchedExpressions || (reason.matchedExpression ? [reason.matchedExpression] : []), | ||
| undeterminedExpressions: reason.undeterminedExpressions | ||
| }); | ||
| } | ||
| case "sensitiveInfo": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetSensitiveInfoReason({ | ||
| allowed: reason.allowed, | ||
| denied: reason.denied | ||
| }); | ||
| } | ||
| case "promptInjection": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetPromptInjectionReason({ | ||
| injectionDetected: reason.injectionDetected, | ||
| score: reason.score | ||
| }); | ||
| } | ||
| case "bot": return new ArcjetErrorReason("bot detection v1 is deprecated"); | ||
| case "error": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetErrorReason(reason.message); | ||
| } | ||
| case void 0: return new ArcjetReason(); | ||
| default: | ||
| proto.reason; | ||
| return new ArcjetReason(); | ||
| } | ||
| } | ||
| function ArcjetReasonToProtocol(reason) { | ||
| if (reason.isRateLimit()) { | ||
| const cleanOptions = { | ||
| max: reason.max, | ||
| remaining: reason.remaining, | ||
| resetInSeconds: reason.reset, | ||
| windowInSeconds: reason.window | ||
| }; | ||
| return create(ReasonSchema, { reason: { | ||
| case: "rateLimit", | ||
| value: create(RateLimitReasonSchema, reason.resetTime ? { | ||
| ...cleanOptions, | ||
| resetTime: timestampFromDate(reason.resetTime) | ||
| } : cleanOptions) | ||
| } }); | ||
| } | ||
| if (reason.isBot()) return create(ReasonSchema, { reason: { | ||
| case: "botV2", | ||
| value: create(BotV2ReasonSchema, { | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| verified: reason.verified, | ||
| spoofed: reason.spoofed | ||
| }) | ||
| } }); | ||
| if (reason.isEdgeRule()) return create(ReasonSchema, { reason: { | ||
| case: "edgeRule", | ||
| value: create(EdgeRuleReasonSchema) | ||
| } }); | ||
| if (reason.isShield()) return create(ReasonSchema, { reason: { | ||
| case: "shield", | ||
| value: create(ShieldReasonSchema, { shieldTriggered: reason.shieldTriggered }) | ||
| } }); | ||
| if (reason.isEmail()) return create(ReasonSchema, { reason: { | ||
| case: "email", | ||
| value: create(EmailReasonSchema, { emailTypes: reason.emailTypes.map(ArcjetEmailTypeToProtocol) }) | ||
| } }); | ||
| if (reason.isError()) return create(ReasonSchema, { reason: { | ||
| case: "error", | ||
| value: create(ErrorReasonSchema, { message: reason.message }) | ||
| } }); | ||
| if (reason.isFilter()) return create(ReasonSchema, { reason: { | ||
| case: "filter", | ||
| value: { | ||
| matchedExpressions: reason.matchedExpressions, | ||
| undeterminedExpressions: reason.undeterminedExpressions | ||
| } | ||
| } }); | ||
| if (reason.isSensitiveInfo()) return create(ReasonSchema, { reason: { | ||
| case: "sensitiveInfo", | ||
| value: create(SensitiveInfoReasonSchema, { | ||
| allowed: reason.allowed, | ||
| denied: reason.denied | ||
| }) | ||
| } }); | ||
| if (reason.isPromptInjection()) return create(ReasonSchema, { reason: { | ||
| case: "promptInjection", | ||
| value: create(PromptInjectionReasonSchema, { | ||
| injectionDetected: reason.injectionDetected, | ||
| score: reason.score ?? 0 | ||
| }) | ||
| } }); | ||
| return create(ReasonSchema); | ||
| } | ||
| function ArcjetRuleResultToProtocol(ruleResult) { | ||
| return create(RuleResultSchema, { | ||
| ruleId: ruleResult.ruleId, | ||
| fingerprint: ruleResult.fingerprint, | ||
| ttl: ruleResult.ttl, | ||
| state: ArcjetRuleStateToProtocol(ruleResult.state), | ||
| conclusion: ArcjetConclusionToProtocol(ruleResult.conclusion), | ||
| reason: ArcjetReasonToProtocol(ruleResult.reason) | ||
| }); | ||
| } | ||
| function ArcjetRuleResultFromProtocol(proto) { | ||
| return new ArcjetRuleResult({ | ||
| ruleId: proto.ruleId, | ||
| fingerprint: proto.fingerprint, | ||
| ttl: proto.ttl, | ||
| state: ArcjetRuleStateFromProtocol(proto.state), | ||
| conclusion: ArcjetConclusionFromProtocol(proto.conclusion), | ||
| reason: ArcjetReasonFromProtocol(proto.reason) | ||
| }); | ||
| } | ||
| function ArcjetDecisionToProtocol(decision) { | ||
| return create(DecisionSchema, { | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| conclusion: ArcjetConclusionToProtocol(decision.conclusion), | ||
| reason: ArcjetReasonToProtocol(decision.reason), | ||
| ruleResults: decision.results.map(ArcjetRuleResultToProtocol) | ||
| }); | ||
| } | ||
| function ArcjetIpDetailsFromProtocol(ipDetails) { | ||
| if (!ipDetails) return new ArcjetIpDetails(); | ||
| return new ArcjetIpDetails({ | ||
| latitude: ipDetails.latitude || ipDetails.accuracyRadius ? ipDetails.latitude : void 0, | ||
| longitude: ipDetails.longitude || ipDetails.accuracyRadius ? ipDetails.longitude : void 0, | ||
| accuracyRadius: ipDetails.longitude || ipDetails.latitude || ipDetails.accuracyRadius ? ipDetails.accuracyRadius : void 0, | ||
| timezone: ipDetails.timezone !== "" ? ipDetails.timezone : void 0, | ||
| postalCode: ipDetails.postalCode !== "" ? ipDetails.postalCode : void 0, | ||
| city: ipDetails.city !== "" ? ipDetails.city : void 0, | ||
| region: ipDetails.region !== "" ? ipDetails.region : void 0, | ||
| country: ipDetails.country !== "" ? ipDetails.country : void 0, | ||
| countryName: ipDetails.countryName !== "" ? ipDetails.countryName : void 0, | ||
| continent: ipDetails.continent !== "" ? ipDetails.continent : void 0, | ||
| continentName: ipDetails.continentName !== "" ? ipDetails.continentName : void 0, | ||
| asn: ipDetails.asn !== "" ? ipDetails.asn : void 0, | ||
| asnName: ipDetails.asnName !== "" ? ipDetails.asnName : void 0, | ||
| asnDomain: ipDetails.asnDomain !== "" ? ipDetails.asnDomain : void 0, | ||
| asnType: ipDetails.asnType !== "" ? ipDetails.asnType : void 0, | ||
| asnCountry: ipDetails.asnCountry !== "" ? ipDetails.asnCountry : void 0, | ||
| service: ipDetails.service !== "" ? ipDetails.service : void 0, | ||
| isHosting: ipDetails.isHosting, | ||
| isVpn: ipDetails.isVpn, | ||
| isProxy: ipDetails.isProxy, | ||
| isTor: ipDetails.isTor, | ||
| isRelay: ipDetails.isRelay, | ||
| isAbuser: ipDetails.isAbuser | ||
| }); | ||
| } | ||
| function ArcjetDecisionFromProtocol(decision) { | ||
| if (typeof decision === "undefined") return new ArcjetErrorDecision({ | ||
| reason: new ArcjetErrorReason("Missing Decision"), | ||
| ttl: 0, | ||
| results: [], | ||
| ip: new ArcjetIpDetails() | ||
| }); | ||
| const results = Array.isArray(decision.ruleResults) ? decision.ruleResults.map(ArcjetRuleResultFromProtocol) : []; | ||
| switch (decision.conclusion) { | ||
| case Conclusion.ALLOW: return new ArcjetAllowDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| case Conclusion.DENY: return new ArcjetDenyDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| case Conclusion.CHALLENGE: return new ArcjetChallengeDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| case Conclusion.ERROR: return new ArcjetErrorDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: new ArcjetErrorReason(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| case Conclusion.UNSPECIFIED: return new ArcjetErrorDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: new ArcjetErrorReason("Invalid Conclusion"), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| default: | ||
| decision.conclusion; | ||
| return new ArcjetErrorDecision({ | ||
| ttl: 0, | ||
| reason: new ArcjetErrorReason("Missing Conclusion"), | ||
| results: [], | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails) | ||
| }); | ||
| } | ||
| } | ||
| function isRateLimitRule(rule) { | ||
| return rule.type === "RATE_LIMIT"; | ||
| } | ||
| function isTokenBucketRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "TOKEN_BUCKET"; | ||
| } | ||
| function isFixedWindowRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "FIXED_WINDOW"; | ||
| } | ||
| function isSlidingWindowRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "SLIDING_WINDOW"; | ||
| } | ||
| function isBotRule(rule) { | ||
| return rule.type === "BOT"; | ||
| } | ||
| function isEmailRule(rule) { | ||
| return rule.type === "EMAIL"; | ||
| } | ||
| /** | ||
| * Check if a rule is a filter rule. | ||
| * | ||
| * @param rule | ||
| * Rule. | ||
| * @returns | ||
| * Whether `rule` is a filter rule. | ||
| */ | ||
| function isFilterRule(rule) { | ||
| return rule.type === "FILTER"; | ||
| } | ||
| function isShieldRule(rule) { | ||
| return rule.type === "SHIELD"; | ||
| } | ||
| function isSensitiveInfoRule(rule) { | ||
| return rule.type === "SENSITIVE_INFO"; | ||
| } | ||
| function isPromptInjectionRule(rule) { | ||
| return rule.type === "PROMPT_INJECTION_DETECTION"; | ||
| } | ||
| function ArcjetRuleToProtocol(rule) { | ||
| if (isTokenBucketRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.TOKEN_BUCKET, | ||
| refillRate: rule.refillRate, | ||
| interval: rule.interval, | ||
| capacity: rule.capacity | ||
| } | ||
| } }); | ||
| if (isFixedWindowRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.FIXED_WINDOW, | ||
| max: rule.max, | ||
| windowInSeconds: rule.window | ||
| } | ||
| } }); | ||
| if (isSlidingWindowRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.SLIDING_WINDOW, | ||
| max: rule.max, | ||
| interval: rule.interval | ||
| } | ||
| } }); | ||
| if (isEmailRule(rule)) { | ||
| const allow = Array.isArray(rule.allow) ? rule.allow.map(ArcjetEmailTypeToProtocol) : []; | ||
| const deny = Array.isArray(rule.deny) ? rule.deny.map(ArcjetEmailTypeToProtocol) : []; | ||
| return create(RuleSchema, { rule: { | ||
| case: "email", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow, | ||
| deny, | ||
| requireTopLevelDomain: rule.requireTopLevelDomain, | ||
| allowDomainLiteral: rule.allowDomainLiteral | ||
| } | ||
| } }); | ||
| } | ||
| if (isBotRule(rule)) { | ||
| const allow = Array.isArray(rule.allow) ? rule.allow : []; | ||
| const deny = Array.isArray(rule.deny) ? rule.deny : []; | ||
| return create(RuleSchema, { rule: { | ||
| case: "botV2", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow, | ||
| deny | ||
| } | ||
| } }); | ||
| } | ||
| if (isShieldRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "shield", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| autoAdded: false | ||
| } | ||
| } }); | ||
| if (isFilterRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "filter", | ||
| value: { | ||
| allow: [...rule.allow], | ||
| deny: [...rule.deny], | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| version: rule.version | ||
| } | ||
| } }); | ||
| if (isSensitiveInfoRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "sensitiveInfo", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow: rule.allow, | ||
| deny: rule.deny | ||
| } | ||
| } }); | ||
| if (isPromptInjectionRule(rule)) return create(RuleSchema, { rule: { | ||
| case: "promptInjectionDetection", | ||
| value: { | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| threshold: rule.threshold ?? .5, | ||
| version: rule.version | ||
| } | ||
| } }); | ||
| return create(RuleSchema); | ||
| } | ||
| //#endregion | ||
| export { ArcjetConclusionFromProtocol, ArcjetConclusionToProtocol, ArcjetDecisionFromProtocol, ArcjetDecisionToProtocol, ArcjetEmailTypeFromProtocol, ArcjetEmailTypeToProtocol, ArcjetIpDetailsFromProtocol, ArcjetModeToProtocol, ArcjetReasonFromProtocol, ArcjetReasonToProtocol, ArcjetRuleResultFromProtocol, ArcjetRuleResultToProtocol, ArcjetRuleStateFromProtocol, ArcjetRuleStateToProtocol, ArcjetRuleToProtocol, ArcjetStackToProtocol }; |
+1469
| import { ArcjetBotCategory, ArcjetWellKnownBot, categories } from "./well-known-bots.js"; | ||
| import { Cache } from "@arcjet/cache"; | ||
| //#region src/index.d.ts | ||
| type RequiredProps<T, K extends keyof T> = { [P in K]-?: Exclude<T[P], undefined> }; | ||
| /** | ||
| * Mode of a rule. | ||
| */ | ||
| type ArcjetMode = "LIVE" | "DRY_RUN"; | ||
| /** | ||
| * Names of different rate limit algorithms. | ||
| */ | ||
| type ArcjetRateLimitAlgorithm = "TOKEN_BUCKET" | "FIXED_WINDOW" | "SLIDING_WINDOW"; | ||
| /** | ||
| * Kinds of email addresses. | ||
| */ | ||
| type ArcjetEmailType = "DISPOSABLE" | "FREE" | "NO_MX_RECORDS" | "NO_GRAVATAR" | "INVALID"; | ||
| /** | ||
| * Sensitive info identified by Arcjet. | ||
| */ | ||
| type ArcjetIdentifiedEntity = { | ||
| /** | ||
| * Start index into value. | ||
| */ | ||
| start: number; | ||
| /** | ||
| * End index into value. | ||
| */ | ||
| end: number; | ||
| /** | ||
| * Kind of the identified entity. | ||
| */ | ||
| identifiedType: string; | ||
| }; | ||
| /** | ||
| * Names of integrations supported by Arcjet. | ||
| */ | ||
| type ArcjetStack = "ASTRO" | "BUN" | "DENO" | "FASTIFY" | "NESTJS" | "NEXTJS" | "NODEJS" | "NUXT" | "REACT_ROUTER" | "REMIX" | "SVELTEKIT"; | ||
| /** | ||
| * State of a rule after calling it. | ||
| */ | ||
| type ArcjetRuleState = "RUN" | "NOT_RUN" | "CACHED" | "DRY_RUN"; | ||
| /** | ||
| * Conclusion of a rule after calling it. | ||
| */ | ||
| type ArcjetConclusion = "ALLOW" | "DENY" | "CHALLENGE" | "ERROR"; | ||
| /** | ||
| * Kinds of sensitive info. | ||
| */ | ||
| type ArcjetSensitiveInfoType = "EMAIL" | "PHONE_NUMBER" | "IP_ADDRESS" | "CREDIT_CARD_NUMBER"; | ||
| /** | ||
| * Reason returned by a rule. | ||
| */ | ||
| declare class ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type?: "RATE_LIMIT" | "BOT" | "EDGE_RULE" | "SHIELD" | "EMAIL" | "ERROR" | "FILTER" | "SENSITIVE_INFO" | "PROMPT_INJECTION_DETECTION" | undefined; | ||
| /** | ||
| * Check if this reason is a sensitive info reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a sensitive info reason. | ||
| */ | ||
| isSensitiveInfo(): this is ArcjetSensitiveInfoReason; | ||
| /** | ||
| * Check if this reason is a rate limit reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a rate limit reason. | ||
| */ | ||
| isRateLimit(): this is ArcjetRateLimitReason; | ||
| /** | ||
| * Check if this reason is a bot reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a bot reason. | ||
| */ | ||
| isBot(): this is ArcjetBotReason; | ||
| /** | ||
| * Check if this reason is an edge rule reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an edge rule reason. | ||
| */ | ||
| isEdgeRule(): this is ArcjetEdgeRuleReason; | ||
| /** | ||
| * Check if this reason is a shield reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a shield reason. | ||
| */ | ||
| isShield(): this is ArcjetShieldReason; | ||
| /** | ||
| * Check if this reason is an email reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an email reason. | ||
| */ | ||
| isEmail(): this is ArcjetEmailReason; | ||
| /** | ||
| * Check if this reason is an error reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an error reason. | ||
| */ | ||
| isError(): this is ArcjetErrorReason; | ||
| /** | ||
| * Check if this is a filter reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a filter reason. | ||
| */ | ||
| isFilter(): this is ArcjetFilterReason; | ||
| /** | ||
| * Check if this is a prompt injection reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a prompt injection reason. | ||
| */ | ||
| isPromptInjection(): this is ArcjetPromptInjectionReason; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetFilterReason`. | ||
| */ | ||
| interface ArcjetFilterReasonInit { | ||
| /** | ||
| * Expression that matched. | ||
| */ | ||
| matchedExpressions: Array<string>; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions: Array<string>; | ||
| } | ||
| /** | ||
| * Filter reason. | ||
| */ | ||
| declare class ArcjetFilterReason extends ArcjetReason { | ||
| /** | ||
| * Expressions that matched. | ||
| */ | ||
| matchedExpressions: ArcjetFilterReasonInit["matchedExpressions"]; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "FILTER"; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions: ArcjetFilterReasonInit["undeterminedExpressions"]; | ||
| /** | ||
| * Create a filter reason. | ||
| * | ||
| * @param init | ||
| * Expression that matched. | ||
| * @returns | ||
| * Filter reason. | ||
| */ | ||
| constructor(init: ArcjetFilterReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetPromptInjectionReason`. | ||
| */ | ||
| interface ArcjetPromptInjectionReasonInit { | ||
| /** | ||
| * Whether a prompt injection attempt was detected in the input. | ||
| */ | ||
| injectionDetected?: boolean | undefined; | ||
| /** | ||
| * The prompt injection confidence score, scaled to [0, 1]. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score?: number | undefined; | ||
| } | ||
| /** | ||
| * Prompt injection reason. | ||
| */ | ||
| declare class ArcjetPromptInjectionReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * Whether a prompt injection attempt was detected. | ||
| */ | ||
| injectionDetected: boolean; | ||
| /** | ||
| * The prompt injection confidence score. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score?: number; | ||
| /** | ||
| * Create a prompt injection reason. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Prompt injection reason. | ||
| */ | ||
| constructor(init: ArcjetPromptInjectionReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetSensitiveInfoReason`. | ||
| */ | ||
| interface ArcjetSensitiveInfoReasonInit { | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied: ArcjetIdentifiedEntity[]; | ||
| } | ||
| /** | ||
| * Sensitive info reason. | ||
| */ | ||
| declare class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SENSITIVE_INFO"; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * Create an `ArcjetSensitiveInfoReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Sensitive info reason. | ||
| */ | ||
| constructor(init: ArcjetSensitiveInfoReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetRateLimitReason`. | ||
| */ | ||
| interface ArcjetRateLimitReasonInit { | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset: number; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window: number; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime?: Date | undefined; | ||
| } | ||
| /** | ||
| * Rate limit reason. | ||
| */ | ||
| declare class ArcjetRateLimitReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT"; | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset: number; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window: number; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime?: Date | undefined; | ||
| /** | ||
| * Create an `ArcjetRateLimitReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rate limit reason. | ||
| */ | ||
| constructor(init: ArcjetRateLimitReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetBotReason`. | ||
| */ | ||
| interface ArcjetBotReasonInit { | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed: Array<string>; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied: Array<string>; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed: boolean; | ||
| } | ||
| /** | ||
| * Bot reason. | ||
| */ | ||
| declare class ArcjetBotReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "BOT"; | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed: Array<string>; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied: Array<string>; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed: boolean; | ||
| /** | ||
| * Create an `ArcjetBotReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Bot reason. | ||
| */ | ||
| constructor(init: ArcjetBotReasonInit); | ||
| /** | ||
| * Check if the bot is verified. | ||
| * | ||
| * @returns | ||
| * Whether the bot is verified. | ||
| */ | ||
| isVerified(): boolean; | ||
| /** | ||
| * Check if the bot is spoofed. | ||
| * | ||
| * @returns | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| isSpoofed(): boolean; | ||
| } | ||
| /** | ||
| * Edge rule reason. | ||
| * | ||
| * @deprecated | ||
| * This reason is currently not used. | ||
| */ | ||
| declare class ArcjetEdgeRuleReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EDGE_RULE"; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetShieldReason`. | ||
| */ | ||
| interface ArcjetShieldReasonInit { | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Shield reason. | ||
| */ | ||
| declare class ArcjetShieldReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SHIELD"; | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered: boolean; | ||
| /** | ||
| * Create an `ArcjetShieldReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Shield reason. | ||
| */ | ||
| constructor(init: ArcjetShieldReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetEmailReason`. | ||
| */ | ||
| interface ArcjetEmailReasonInit { | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes?: ArcjetEmailType[] | undefined; | ||
| } | ||
| /** | ||
| * Email reason. | ||
| */ | ||
| declare class ArcjetEmailReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EMAIL"; | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes: ArcjetEmailType[]; | ||
| /** | ||
| * Create an `ArcjetEmailReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Email reason. | ||
| */ | ||
| constructor(init: ArcjetEmailReasonInit); | ||
| } | ||
| /** | ||
| * Error reason. | ||
| */ | ||
| declare class ArcjetErrorReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "ERROR"; | ||
| /** | ||
| * Error message. | ||
| */ | ||
| message: string; | ||
| /** | ||
| * Create an `ArcjetErrorReason`. | ||
| * | ||
| * @param error | ||
| * Error that occurred. | ||
| * @returns | ||
| * Error reason. | ||
| */ | ||
| constructor(error: unknown); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetRuleResult`. | ||
| */ | ||
| interface ArcjetRuleResultInit { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state: ArcjetRuleState; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Result of calling a rule. | ||
| */ | ||
| declare class ArcjetRuleResult { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state: ArcjetRuleState; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetRuleResult`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rule result. | ||
| */ | ||
| constructor(init: ArcjetRuleResultInit); | ||
| /** | ||
| * Check if the rule result is denied. | ||
| * | ||
| * @returns | ||
| * Whether the rule result is denied. | ||
| */ | ||
| isDenied(): boolean; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetIpDetails`. | ||
| */ | ||
| interface ArcjetIpDetailsInit { | ||
| latitude?: number | undefined; | ||
| longitude?: number | undefined; | ||
| accuracyRadius?: number | undefined; | ||
| timezone?: string | undefined; | ||
| postalCode?: string | undefined; | ||
| city?: string | undefined; | ||
| region?: string | undefined; | ||
| country?: string | undefined; | ||
| countryName?: string | undefined; | ||
| continent?: string | undefined; | ||
| continentName?: string | undefined; | ||
| asn?: string | undefined; | ||
| asnName?: string | undefined; | ||
| asnDomain?: string | undefined; | ||
| asnType?: string | undefined; | ||
| asnCountry?: string | undefined; | ||
| service?: string | undefined; | ||
| isHosting?: boolean | undefined; | ||
| isVpn?: boolean | undefined; | ||
| isProxy?: boolean | undefined; | ||
| isTor?: boolean | undefined; | ||
| isRelay?: boolean | undefined; | ||
| isAbuser?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Info about an IP address. | ||
| */ | ||
| declare class ArcjetIpDetails { | ||
| /** | ||
| * Estimated latitude of the IP address within the `accuracyRadius` margin | ||
| * of error. | ||
| */ | ||
| latitude?: number | undefined; | ||
| /** | ||
| * Estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| */ | ||
| longitude?: number | undefined; | ||
| /** | ||
| * Accuracy radius of the IP address location in kilometers. | ||
| */ | ||
| accuracyRadius?: number | undefined; | ||
| /** | ||
| * Timezone of the IP address. | ||
| */ | ||
| timezone?: string | undefined; | ||
| /** | ||
| * Postal code of the IP address. | ||
| */ | ||
| postalCode?: string | undefined; | ||
| /** | ||
| * City the IP address is located in. | ||
| */ | ||
| city?: string | undefined; | ||
| /** | ||
| * Region the IP address is located in. | ||
| */ | ||
| region?: string | undefined; | ||
| /** | ||
| * Country code the IP address is located in. | ||
| */ | ||
| country?: string | undefined; | ||
| /** | ||
| * Country name the IP address is located in. | ||
| */ | ||
| countryName?: string | undefined; | ||
| /** | ||
| * Continent code the IP address is located in. | ||
| */ | ||
| continent?: string | undefined; | ||
| /** | ||
| * Continent name the IP address is located in. | ||
| */ | ||
| continentName?: string | undefined; | ||
| /** | ||
| * AS number the IP address belongs to. | ||
| */ | ||
| asn?: string | undefined; | ||
| /** | ||
| * AS name the IP address belongs to. | ||
| */ | ||
| asnName?: string | undefined; | ||
| /** | ||
| * ASN domain the IP address belongs to. | ||
| */ | ||
| asnDomain?: string | undefined; | ||
| /** | ||
| * ASN type: ISP, hosting, business, or education | ||
| */ | ||
| asnType?: string | undefined; | ||
| /** | ||
| * ASN country code the IP address belongs to. | ||
| */ | ||
| asnCountry?: string | undefined; | ||
| /** | ||
| * Name of service the IP address belongs to. | ||
| */ | ||
| service?: string | undefined; | ||
| /** | ||
| * Create an `ArcjetIpDetails`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * IP details. | ||
| */ | ||
| constructor(init?: ArcjetIpDetailsInit); | ||
| /** | ||
| * Check if the IP address has geo `latitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has latitude info. | ||
| */ | ||
| hasLatitude(): this is RequiredProps<this, "latitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has geo `longitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has longitude info. | ||
| */ | ||
| hasLongitude(): this is RequiredProps<this, "longitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has geo accuracy radius info. | ||
| * This also implies that `latitude` and `longitude` are available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has accuracy info. | ||
| */ | ||
| hasAccuracyRadius(): this is RequiredProps<this, "latitude" | "longitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has timezone info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has timezone info. | ||
| */ | ||
| hasTimezone(): this is RequiredProps<this, "timezone">; | ||
| /** | ||
| * Check if the IP address has postcal code info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has postcal code info. | ||
| */ | ||
| hasPostalCode(): this is RequiredProps<this, "postalCode">; | ||
| /** | ||
| * Check if the IP address has city info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has city info. | ||
| */ | ||
| hasCity(): this is RequiredProps<this, "city">; | ||
| /** | ||
| * Check if the IP address has region info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has region info. | ||
| */ | ||
| hasRegion(): this is RequiredProps<this, "region">; | ||
| /** | ||
| * Check if the IP address has country info: | ||
| * `countryName` and `country`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has country info. | ||
| */ | ||
| hasCountry(): this is RequiredProps<this, "country" | "countryName">; | ||
| /** | ||
| * Check if the IP address has continent info: | ||
| * `continentName` and `continent`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has continent info. | ||
| */ | ||
| hasContintent(): this is RequiredProps<this, "continent" | "continentName">; | ||
| /** | ||
| * Check if the IP address has ASN info. | ||
| * | ||
| * @deprecated | ||
| * Use `hasAsn()` instead. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasASN(): this is RequiredProps<this, "asn" | "asnName" | "asnDomain" | "asnType" | "asnCountry">; | ||
| /** | ||
| * Check if the IP address has ASN info: | ||
| * `asnCountry`, `asnDomain`, `asnName`, `asnType`, and `asn` fields. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasAsn(): this is RequiredProps<this, "asn" | "asnName" | "asnDomain" | "asnType" | "asnCountry">; | ||
| /** | ||
| * Check if the IP address has a service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has a service. | ||
| */ | ||
| hasService(): this is RequiredProps<this, "service">; | ||
| /** | ||
| * Check if the IP address belongs to a hosting provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a hosting provider. | ||
| */ | ||
| isHosting(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a VPN provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a VPN provider. | ||
| */ | ||
| isVpn(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a proxy provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a proxy provider. | ||
| */ | ||
| isProxy(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a Tor node. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a Tor node. | ||
| */ | ||
| isTor(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a relay service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a relay service. | ||
| */ | ||
| isRelay(): boolean; | ||
| /** | ||
| * Check if the IP address has been flagged as an abuser. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has been flagged as an abuser. | ||
| */ | ||
| isAbuser(): boolean; | ||
| } | ||
| /** | ||
| * Configuration for the basic `ArcjetDecision`. | ||
| */ | ||
| interface ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| */ | ||
| id?: string; | ||
| /** | ||
| * List of results from calling rules. | ||
| */ | ||
| results: ArcjetRuleResult[]; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * Details about the IP address. | ||
| */ | ||
| ip?: ArcjetIpDetails; | ||
| } | ||
| /** | ||
| * Configuration for most `ArcjetDecision`s. | ||
| */ | ||
| interface ArcjetDecisionInit extends ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetErrorDecision`. | ||
| */ | ||
| interface ArcjetErrorDecisionInit extends ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| reason: ArcjetErrorReason; | ||
| } | ||
| /** | ||
| * Decision returned by the Arcjet SDK. | ||
| */ | ||
| declare abstract class ArcjetDecision { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| * This can be used to look up the decision in the Arcjet dashboard. | ||
| */ | ||
| id: string; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * List of results from calling rules. | ||
| * Can also be found by logging into the Arcjet dashboard and searching for the decision `id`. | ||
| */ | ||
| results: ArcjetRuleResult[]; | ||
| /** | ||
| * Details about the IP address that informed the `conclusion`. | ||
| */ | ||
| ip: ArcjetIpDetails; | ||
| /** | ||
| * Conclusion about the request. | ||
| */ | ||
| abstract conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| abstract reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInitAbstract); | ||
| /** | ||
| * Check if the decision is allowed. | ||
| * This considers `ERROR` decisions as allowed too. | ||
| * | ||
| * @returns | ||
| * Whether the decision is allowed. | ||
| */ | ||
| isAllowed(): this is ArcjetAllowDecision | ArcjetErrorDecision; | ||
| /** | ||
| * Check if the decision is denied. | ||
| * | ||
| * @returns | ||
| * Whether the decision is denied. | ||
| */ | ||
| isDenied(): this is ArcjetDenyDecision; | ||
| /** | ||
| * Check if the decision is challenged. | ||
| * | ||
| * @returns | ||
| * Whether the decision is challenged. | ||
| */ | ||
| isChallenged(): this is ArcjetChallengeDecision; | ||
| /** | ||
| * Check if the decision is errored. | ||
| * This does **not** consider `ALLOW` as errored. | ||
| * | ||
| * @returns | ||
| * Whether the decision is errored. | ||
| */ | ||
| isErrored(): this is ArcjetErrorDecision; | ||
| } | ||
| /** | ||
| * Allow decision. | ||
| */ | ||
| declare class ArcjetAllowDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "ALLOW"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetAllowDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Allow decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Deny decision. | ||
| */ | ||
| declare class ArcjetDenyDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "DENY"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetDenyDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Deny decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Challenge decision. | ||
| */ | ||
| declare class ArcjetChallengeDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "CHALLENGE"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetChallengeDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Challenge decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Error decision. | ||
| */ | ||
| declare class ArcjetErrorDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "ERROR"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetErrorReason; | ||
| /** | ||
| * Create an `ArcjetErrorDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Error decision. | ||
| */ | ||
| constructor(init: ArcjetErrorDecisionInit); | ||
| } | ||
| /** | ||
| * Request details. | ||
| */ | ||
| interface ArcjetRequestDetails { | ||
| /** | ||
| * IP address (IPv4 or IPv6). | ||
| */ | ||
| ip: string; | ||
| /** | ||
| * HTTP method (such as `GET`). | ||
| */ | ||
| method: string; | ||
| /** | ||
| * Protocol (such as `"http:"`). | ||
| */ | ||
| protocol: string; | ||
| /** | ||
| * Hostname (such as `"example.com"`). | ||
| */ | ||
| host: string; | ||
| /** | ||
| * Path (such as `"/path/to/resource"`). | ||
| */ | ||
| path: string; | ||
| /** | ||
| * Headers of the request. | ||
| * | ||
| * This is a [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object. | ||
| * This never includes cookies: those are stored separately. | ||
| */ | ||
| headers: Headers; | ||
| /** | ||
| * Cookies of the request (such as `"cookie1=value1; cookie2=value2"`). | ||
| */ | ||
| cookies: string; | ||
| /** | ||
| * Query string of the request (such as `"?q=alpha"`). | ||
| */ | ||
| query: string; | ||
| /** | ||
| * Extra info. | ||
| */ | ||
| extra: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * Email address of the user making the request. | ||
| */ | ||
| email?: string | undefined; | ||
| /** | ||
| * Optional, caller-supplied opaque identifier used to correlate this request | ||
| * with other `protect()` and `guard()` calls that belong to the same | ||
| * workflow, agent run, or multi-step task. | ||
| * | ||
| * It does not affect the decision and is excluded from the fingerprint (and | ||
| * therefore the decision cache key); it is stored alongside the recorded | ||
| * decision so a chain of actions can be reconstructed. | ||
| */ | ||
| correlationId?: string | undefined; | ||
| } | ||
| /** | ||
| * Arcjet rule. | ||
| * | ||
| * @template Props | ||
| * Extra properties passed to the rule. | ||
| */ | ||
| type ArcjetRule<Props extends {} = {}> = { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT" | "BOT" | "EMAIL" | "FILTER" | "SHIELD" | "SENSITIVE_INFO" | string; | ||
| /** | ||
| * Mode. | ||
| */ | ||
| mode: ArcjetMode; | ||
| /** | ||
| * Priority. | ||
| */ | ||
| priority: number; | ||
| /** | ||
| * Version of rule. | ||
| */ | ||
| version: number; | ||
| /** | ||
| * Validate locally whether the rule can run. | ||
| * | ||
| * For example, the email rule requires an `email` field and throws if it is | ||
| * not passed. | ||
| * | ||
| * @param context | ||
| * Arcjet context. | ||
| * @param details | ||
| * Request details and extra properties. | ||
| * @returns | ||
| * Nothing. | ||
| * @throws | ||
| * If the rule cannot run. | ||
| */ | ||
| validate(context: ArcjetContext, details: unknown): asserts details is ArcjetRequestDetails & Props; | ||
| /** | ||
| * Run a rule locally. | ||
| * | ||
| * The result is used if it is a `LIVE` `DENY` result. | ||
| * In other cases the server is contacted to get results. | ||
| * | ||
| * @param context | ||
| * Arcjet context. | ||
| * @param details | ||
| * Request details and extra properties. | ||
| * @returns | ||
| * Promise to a rule result. | ||
| */ | ||
| protect(context: ArcjetContext, details: ArcjetRequestDetails & Props): Promise<ArcjetRuleResult>; | ||
| }; | ||
| /** | ||
| * Abstract rate limit rule. | ||
| */ | ||
| interface ArcjetRateLimitRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT"; | ||
| /** | ||
| * Algorithm used for rate limiting. | ||
| */ | ||
| algorithm: ArcjetRateLimitAlgorithm; | ||
| /** | ||
| * Characteristics of the rule. | ||
| */ | ||
| characteristics?: string[] | undefined; | ||
| } | ||
| /** | ||
| * Token bucket rate limit rule. | ||
| */ | ||
| interface ArcjetTokenBucketRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "TOKEN_BUCKET"; | ||
| /** | ||
| * Tokens to add to the bucket at each interval. | ||
| */ | ||
| refillRate: number; | ||
| /** | ||
| * Interval in seconds to add tokens to the bucket. | ||
| */ | ||
| interval: number; | ||
| /** | ||
| * Max tokens the bucket can hold. | ||
| */ | ||
| capacity: number; | ||
| } | ||
| /** | ||
| * Fixed window rate limit rule. | ||
| */ | ||
| interface ArcjetFixedWindowRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "FIXED_WINDOW"; | ||
| /** | ||
| * Max requests allowed in the time window. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Time window in seconds the rate limit applies to. | ||
| */ | ||
| window: number; | ||
| } | ||
| /** | ||
| * Sliding window rate limit rule. | ||
| */ | ||
| interface ArcjetSlidingWindowRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "SLIDING_WINDOW"; | ||
| /** | ||
| * Max requests allowed in the time window. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Time interval in seconds for the rate limit. | ||
| */ | ||
| interval: number; | ||
| } | ||
| /** | ||
| * Email rule. | ||
| */ | ||
| interface ArcjetEmailRule<Props extends { | ||
| email: string; | ||
| }> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EMAIL"; | ||
| /** | ||
| * Email types that are allowed. | ||
| */ | ||
| allow: ArcjetEmailType[]; | ||
| /** | ||
| * Email types that are not allowed. | ||
| */ | ||
| deny: ArcjetEmailType[]; | ||
| /** | ||
| * Whether to allow email addresses that contain a single domain segment. | ||
| * Something like `foo@bar` is not allowed when `true`. | ||
| * It is allowed when `false`. | ||
| */ | ||
| requireTopLevelDomain: boolean; | ||
| /** | ||
| * Whether to allow email addresses that contain a domain literal. | ||
| * Something like `foo@[192.168.1.1]` is allowed when `true`. | ||
| * It is not allowed when `false`. | ||
| */ | ||
| allowDomainLiteral: boolean; | ||
| } | ||
| /** | ||
| * Filter rule. | ||
| */ | ||
| interface ArcjetFilterRule extends ArcjetRule<{ | ||
| filterLocal?: Record<string, string> | null | undefined; | ||
| }> { | ||
| /** | ||
| * List of expressions that allow a request when one matches and deny otherwise. | ||
| */ | ||
| allow: ReadonlyArray<string>; | ||
| /** | ||
| * List of expressions that deny a request when one matches and allow otherwise. | ||
| */ | ||
| deny: ReadonlyArray<string>; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "FILTER"; | ||
| } | ||
| /** | ||
| * Sensitive info rule. | ||
| */ | ||
| interface ArcjetSensitiveInfoRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SENSITIVE_INFO"; | ||
| /** | ||
| * Allowed entities. | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * Denied entities. | ||
| */ | ||
| deny: string[]; | ||
| } | ||
| /** | ||
| * Bot rule. | ||
| */ | ||
| interface ArcjetBotRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "BOT"; | ||
| /** | ||
| * Allowed bots. | ||
| */ | ||
| allow: Array<string>; | ||
| /** | ||
| * Denied bots. | ||
| */ | ||
| deny: Array<string>; | ||
| } | ||
| /** | ||
| * Shield rule. | ||
| */ | ||
| interface ArcjetShieldRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SHIELD"; | ||
| } | ||
| /** | ||
| * Prompt injection detection rule. | ||
| */ | ||
| interface ArcjetPromptInjectionDetectionRule extends ArcjetRule<{ | ||
| detectPromptInjectionMessage: string; | ||
| }> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * The score threshold above which a request is considered a prompt | ||
| * injection attempt. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| threshold?: number; | ||
| } | ||
| /** | ||
| * Arcjet logger interface. | ||
| * | ||
| * Some Pino-compatible functions are required but most of its interface is | ||
| * omitted. | ||
| * | ||
| * See `@arcjet/logger` for an implementation. | ||
| */ | ||
| interface ArcjetLogger { | ||
| /** | ||
| * Debug. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| debug(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Debug. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| debug(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Info. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| info(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Info. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| info(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Warn. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| warn(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Warn. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| warn(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Error. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| error(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Error. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| error(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| } | ||
| /** | ||
| * Objects that Arcjet core puts in the cache. | ||
| * | ||
| * Local results from `rule.protect` calls and remote results from | ||
| * `client.decide` are stored when they have a non-zero `ttl` and are a `DENY`. | ||
| */ | ||
| interface ArcjetCacheEntry { | ||
| /** | ||
| * Conclusion. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Arcjet context. | ||
| */ | ||
| type ArcjetContext = { | ||
| /** | ||
| * Arbitrary indexing into context is currently allowed but not typed. | ||
| */ | ||
| [key: string]: unknown; | ||
| /** | ||
| * API key. | ||
| */ | ||
| key: string; | ||
| /** | ||
| * Fingerprint of request. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Detected runtime. | ||
| */ | ||
| runtime: string; | ||
| /** | ||
| * Logger to use. | ||
| */ | ||
| log: ArcjetLogger; | ||
| /** | ||
| * Global characteristics. | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * Cache to use. | ||
| */ | ||
| cache: Cache<ArcjetCacheEntry>; | ||
| /** | ||
| * Function to use to read a request. | ||
| */ | ||
| getBody(): Promise<string>; | ||
| /** | ||
| * Function called to wait for something. | ||
| * | ||
| * @param promise | ||
| * Promise to wait for. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| waitUntil?: ((promise: Promise<unknown>) => void) | undefined; | ||
| }; | ||
| //#endregion | ||
| export { ArcjetAllowDecision, type ArcjetBotCategory, ArcjetBotReason, ArcjetBotRule, ArcjetCacheEntry, ArcjetChallengeDecision, ArcjetConclusion, ArcjetContext, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetEmailRule, ArcjetEmailType, ArcjetErrorDecision, ArcjetErrorReason, ArcjetFilterReason, ArcjetFilterRule, ArcjetFixedWindowRateLimitRule, ArcjetIdentifiedEntity, ArcjetIpDetails, ArcjetLogger, ArcjetMode, ArcjetPromptInjectionDetectionRule, ArcjetPromptInjectionReason, ArcjetRateLimitAlgorithm, ArcjetRateLimitReason, ArcjetRateLimitRule, ArcjetReason, ArcjetRequestDetails, ArcjetRule, ArcjetRuleResult, ArcjetRuleState, ArcjetSensitiveInfoReason, ArcjetSensitiveInfoRule, ArcjetSensitiveInfoType, ArcjetShieldReason, ArcjetShieldRule, ArcjetSlidingWindowRateLimitRule, ArcjetStack, ArcjetTokenBucketRateLimitRule, type ArcjetWellKnownBot, categories as botCategories, type categories }; |
+938
| import { typeid } from "./typeid.js"; | ||
| import { categories } from "./well-known-bots.js"; | ||
| import { isMessage } from "@bufbuild/protobuf"; | ||
| import { ReasonSchema } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
| //#region src/index.ts | ||
| /** | ||
| * Reason returned by a rule. | ||
| */ | ||
| var ArcjetReason = class { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type; | ||
| /** | ||
| * Check if this reason is a sensitive info reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a sensitive info reason. | ||
| */ | ||
| isSensitiveInfo() { | ||
| return this.type === "SENSITIVE_INFO"; | ||
| } | ||
| /** | ||
| * Check if this reason is a rate limit reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a rate limit reason. | ||
| */ | ||
| isRateLimit() { | ||
| return this.type === "RATE_LIMIT"; | ||
| } | ||
| /** | ||
| * Check if this reason is a bot reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a bot reason. | ||
| */ | ||
| isBot() { | ||
| return this.type === "BOT"; | ||
| } | ||
| /** | ||
| * Check if this reason is an edge rule reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an edge rule reason. | ||
| */ | ||
| isEdgeRule() { | ||
| return this.type === "EDGE_RULE"; | ||
| } | ||
| /** | ||
| * Check if this reason is a shield reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a shield reason. | ||
| */ | ||
| isShield() { | ||
| return this.type === "SHIELD"; | ||
| } | ||
| /** | ||
| * Check if this reason is an email reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an email reason. | ||
| */ | ||
| isEmail() { | ||
| return this.type === "EMAIL"; | ||
| } | ||
| /** | ||
| * Check if this reason is an error reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an error reason. | ||
| */ | ||
| isError() { | ||
| return this.type === "ERROR"; | ||
| } | ||
| /** | ||
| * Check if this is a filter reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a filter reason. | ||
| */ | ||
| isFilter() { | ||
| return this.type === "FILTER"; | ||
| } | ||
| /** | ||
| * Check if this is a prompt injection reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a prompt injection reason. | ||
| */ | ||
| isPromptInjection() { | ||
| return this.type === "PROMPT_INJECTION_DETECTION"; | ||
| } | ||
| }; | ||
| /** | ||
| * Filter reason. | ||
| */ | ||
| var ArcjetFilterReason = class extends ArcjetReason { | ||
| /** | ||
| * Expressions that matched. | ||
| */ | ||
| matchedExpressions; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "FILTER"; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions; | ||
| /** | ||
| * Create a filter reason. | ||
| * | ||
| * @param init | ||
| * Expression that matched. | ||
| * @returns | ||
| * Filter reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.matchedExpressions = init.matchedExpressions; | ||
| this.undeterminedExpressions = init.undeterminedExpressions; | ||
| } | ||
| }; | ||
| /** | ||
| * Prompt injection reason. | ||
| */ | ||
| var ArcjetPromptInjectionReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * Whether a prompt injection attempt was detected. | ||
| */ | ||
| injectionDetected; | ||
| /** | ||
| * The prompt injection confidence score. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score; | ||
| /** | ||
| * Create a prompt injection reason. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Prompt injection reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.injectionDetected = init.injectionDetected ?? false; | ||
| this.score = init.score ?? 0; | ||
| } | ||
| }; | ||
| /** | ||
| * Sensitive info reason. | ||
| */ | ||
| var ArcjetSensitiveInfoReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "SENSITIVE_INFO"; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied; | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed; | ||
| /** | ||
| * Create an `ArcjetSensitiveInfoReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Sensitive info reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.denied = init.denied; | ||
| this.allowed = init.allowed; | ||
| } | ||
| }; | ||
| /** | ||
| * Rate limit reason. | ||
| */ | ||
| var ArcjetRateLimitReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "RATE_LIMIT"; | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime; | ||
| /** | ||
| * Create an `ArcjetRateLimitReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rate limit reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.max = init.max; | ||
| this.remaining = init.remaining; | ||
| this.reset = init.reset; | ||
| this.window = init.window; | ||
| this.resetTime = init.resetTime; | ||
| } | ||
| }; | ||
| /** | ||
| * Bot reason. | ||
| */ | ||
| var ArcjetBotReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "BOT"; | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed; | ||
| /** | ||
| * Create an `ArcjetBotReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Bot reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.allowed = init.allowed; | ||
| this.denied = init.denied; | ||
| this.verified = init.verified; | ||
| this.spoofed = init.spoofed; | ||
| } | ||
| /** | ||
| * Check if the bot is verified. | ||
| * | ||
| * @returns | ||
| * Whether the bot is verified. | ||
| */ | ||
| isVerified() { | ||
| return this.verified; | ||
| } | ||
| /** | ||
| * Check if the bot is spoofed. | ||
| * | ||
| * @returns | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| isSpoofed() { | ||
| return this.spoofed; | ||
| } | ||
| }; | ||
| /** | ||
| * Edge rule reason. | ||
| * | ||
| * @deprecated | ||
| * This reason is currently not used. | ||
| */ | ||
| var ArcjetEdgeRuleReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "EDGE_RULE"; | ||
| }; | ||
| /** | ||
| * Shield reason. | ||
| */ | ||
| var ArcjetShieldReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "SHIELD"; | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered; | ||
| /** | ||
| * Create an `ArcjetShieldReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Shield reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.shieldTriggered = init.shieldTriggered ?? false; | ||
| } | ||
| }; | ||
| /** | ||
| * Email reason. | ||
| */ | ||
| var ArcjetEmailReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "EMAIL"; | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes; | ||
| /** | ||
| * Create an `ArcjetEmailReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Email reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.emailTypes = init.emailTypes ?? []; | ||
| } | ||
| }; | ||
| /** | ||
| * Error reason. | ||
| */ | ||
| var ArcjetErrorReason = class extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "ERROR"; | ||
| /** | ||
| * Error message. | ||
| */ | ||
| message; | ||
| /** | ||
| * Create an `ArcjetErrorReason`. | ||
| * | ||
| * @param error | ||
| * Error that occurred. | ||
| * @returns | ||
| * Error reason. | ||
| */ | ||
| constructor(error) { | ||
| super(); | ||
| if (isMessage(error, ReasonSchema)) { | ||
| this.message = error.reason.case === "error" ? error.reason.value.message : "Missing error reason"; | ||
| return; | ||
| } | ||
| if (error instanceof Error) { | ||
| this.message = error.message; | ||
| return; | ||
| } | ||
| if (typeof error === "string") { | ||
| this.message = error; | ||
| return; | ||
| } | ||
| this.message = "Unknown error occurred"; | ||
| } | ||
| }; | ||
| /** | ||
| * Result of calling a rule. | ||
| */ | ||
| var ArcjetRuleResult = class { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetRuleResult`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rule result. | ||
| */ | ||
| constructor(init) { | ||
| this.ruleId = init.ruleId; | ||
| this.fingerprint = init.fingerprint; | ||
| this.ttl = init.ttl; | ||
| this.state = init.state; | ||
| this.conclusion = init.conclusion; | ||
| this.reason = init.reason; | ||
| } | ||
| /** | ||
| * Check if the rule result is denied. | ||
| * | ||
| * @returns | ||
| * Whether the rule result is denied. | ||
| */ | ||
| isDenied() { | ||
| return this.conclusion === "DENY"; | ||
| } | ||
| }; | ||
| /** | ||
| * Info about an IP address. | ||
| */ | ||
| var ArcjetIpDetails = class { | ||
| /** | ||
| * Estimated latitude of the IP address within the `accuracyRadius` margin | ||
| * of error. | ||
| */ | ||
| latitude; | ||
| /** | ||
| * Estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| */ | ||
| longitude; | ||
| /** | ||
| * Accuracy radius of the IP address location in kilometers. | ||
| */ | ||
| accuracyRadius; | ||
| /** | ||
| * Timezone of the IP address. | ||
| */ | ||
| timezone; | ||
| /** | ||
| * Postal code of the IP address. | ||
| */ | ||
| postalCode; | ||
| /** | ||
| * City the IP address is located in. | ||
| */ | ||
| city; | ||
| /** | ||
| * Region the IP address is located in. | ||
| */ | ||
| region; | ||
| /** | ||
| * Country code the IP address is located in. | ||
| */ | ||
| country; | ||
| /** | ||
| * Country name the IP address is located in. | ||
| */ | ||
| countryName; | ||
| /** | ||
| * Continent code the IP address is located in. | ||
| */ | ||
| continent; | ||
| /** | ||
| * Continent name the IP address is located in. | ||
| */ | ||
| continentName; | ||
| /** | ||
| * AS number the IP address belongs to. | ||
| */ | ||
| asn; | ||
| /** | ||
| * AS name the IP address belongs to. | ||
| */ | ||
| asnName; | ||
| /** | ||
| * ASN domain the IP address belongs to. | ||
| */ | ||
| asnDomain; | ||
| /** | ||
| * ASN type: ISP, hosting, business, or education | ||
| */ | ||
| asnType; | ||
| /** | ||
| * ASN country code the IP address belongs to. | ||
| */ | ||
| asnCountry; | ||
| /** | ||
| * Name of service the IP address belongs to. | ||
| */ | ||
| service; | ||
| /** | ||
| * Create an `ArcjetIpDetails`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * IP details. | ||
| */ | ||
| constructor(init = {}) { | ||
| this.latitude = init.latitude; | ||
| this.longitude = init.longitude; | ||
| this.accuracyRadius = init.accuracyRadius; | ||
| this.timezone = init.timezone; | ||
| this.postalCode = init.postalCode; | ||
| this.city = init.city; | ||
| this.region = init.region; | ||
| this.country = init.country; | ||
| this.countryName = init.countryName; | ||
| this.continent = init.continent; | ||
| this.continentName = init.continentName; | ||
| this.asn = init.asn; | ||
| this.asnName = init.asnName; | ||
| this.asnDomain = init.asnDomain; | ||
| this.asnType = init.asnType; | ||
| this.asnCountry = init.asnCountry; | ||
| this.service = init.service; | ||
| Object.defineProperties(this, { | ||
| _isHosting: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isHosting ?? false | ||
| }, | ||
| _isVpn: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isVpn ?? false | ||
| }, | ||
| _isProxy: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isProxy ?? false | ||
| }, | ||
| _isTor: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isTor ?? false | ||
| }, | ||
| _isRelay: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isRelay ?? false | ||
| }, | ||
| _isAbuser: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isAbuser ?? false | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Check if the IP address has geo `latitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has latitude info. | ||
| */ | ||
| hasLatitude() { | ||
| return typeof this.latitude !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has geo `longitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has longitude info. | ||
| */ | ||
| hasLongitude() { | ||
| return typeof this.longitude !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has geo accuracy radius info. | ||
| * This also implies that `latitude` and `longitude` are available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has accuracy info. | ||
| */ | ||
| hasAccuracyRadius() { | ||
| return typeof this.accuracyRadius !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has timezone info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has timezone info. | ||
| */ | ||
| hasTimezone() { | ||
| return typeof this.timezone !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has postcal code info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has postcal code info. | ||
| */ | ||
| hasPostalCode() { | ||
| return typeof this.postalCode !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has city info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has city info. | ||
| */ | ||
| hasCity() { | ||
| return typeof this.city !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has region info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has region info. | ||
| */ | ||
| hasRegion() { | ||
| return typeof this.region !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has country info: | ||
| * `countryName` and `country`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has country info. | ||
| */ | ||
| hasCountry() { | ||
| return typeof this.country !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has continent info: | ||
| * `continentName` and `continent`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has continent info. | ||
| */ | ||
| hasContintent() { | ||
| return typeof this.continent !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has ASN info. | ||
| * | ||
| * @deprecated | ||
| * Use `hasAsn()` instead. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasASN() { | ||
| return this.hasAsn(); | ||
| } | ||
| /** | ||
| * Check if the IP address has ASN info: | ||
| * `asnCountry`, `asnDomain`, `asnName`, `asnType`, and `asn` fields. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasAsn() { | ||
| return typeof this.asn !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has a service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has a service. | ||
| */ | ||
| hasService() { | ||
| return typeof this.service !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a hosting provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a hosting provider. | ||
| */ | ||
| isHosting() { | ||
| return this._isHosting; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a VPN provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a VPN provider. | ||
| */ | ||
| isVpn() { | ||
| return this._isVpn; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a proxy provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a proxy provider. | ||
| */ | ||
| isProxy() { | ||
| return this._isProxy; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a Tor node. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a Tor node. | ||
| */ | ||
| isTor() { | ||
| return this._isTor; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a relay service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a relay service. | ||
| */ | ||
| isRelay() { | ||
| return this._isRelay; | ||
| } | ||
| /** | ||
| * Check if the IP address has been flagged as an abuser. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has been flagged as an abuser. | ||
| */ | ||
| isAbuser() { | ||
| return this._isAbuser; | ||
| } | ||
| }; | ||
| /** | ||
| * Decision returned by the Arcjet SDK. | ||
| */ | ||
| var ArcjetDecision = class { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| * This can be used to look up the decision in the Arcjet dashboard. | ||
| */ | ||
| id; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| */ | ||
| ttl; | ||
| /** | ||
| * List of results from calling rules. | ||
| * Can also be found by logging into the Arcjet dashboard and searching for the decision `id`. | ||
| */ | ||
| results; | ||
| /** | ||
| * Details about the IP address that informed the `conclusion`. | ||
| */ | ||
| ip; | ||
| /** | ||
| * Create an `ArcjetDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Decision. | ||
| */ | ||
| constructor(init) { | ||
| if (typeof init.id === "string") this.id = init.id; | ||
| else this.id = typeid("lreq"); | ||
| this.results = init.results; | ||
| this.ttl = init.ttl; | ||
| this.ip = init.ip ?? new ArcjetIpDetails(); | ||
| } | ||
| /** | ||
| * Check if the decision is allowed. | ||
| * This considers `ERROR` decisions as allowed too. | ||
| * | ||
| * @returns | ||
| * Whether the decision is allowed. | ||
| */ | ||
| isAllowed() { | ||
| return this.conclusion === "ALLOW" || this.conclusion === "ERROR"; | ||
| } | ||
| /** | ||
| * Check if the decision is denied. | ||
| * | ||
| * @returns | ||
| * Whether the decision is denied. | ||
| */ | ||
| isDenied() { | ||
| return this.conclusion === "DENY"; | ||
| } | ||
| /** | ||
| * Check if the decision is challenged. | ||
| * | ||
| * @returns | ||
| * Whether the decision is challenged. | ||
| */ | ||
| isChallenged() { | ||
| return this.conclusion === "CHALLENGE"; | ||
| } | ||
| /** | ||
| * Check if the decision is errored. | ||
| * This does **not** consider `ALLOW` as errored. | ||
| * | ||
| * @returns | ||
| * Whether the decision is errored. | ||
| */ | ||
| isErrored() { | ||
| return this.conclusion === "ERROR"; | ||
| } | ||
| }; | ||
| /** | ||
| * Allow decision. | ||
| */ | ||
| var ArcjetAllowDecision = class extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "ALLOW"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetAllowDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Allow decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| }; | ||
| /** | ||
| * Deny decision. | ||
| */ | ||
| var ArcjetDenyDecision = class extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "DENY"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetDenyDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Deny decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| }; | ||
| /** | ||
| * Challenge decision. | ||
| */ | ||
| var ArcjetChallengeDecision = class extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "CHALLENGE"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetChallengeDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Challenge decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| }; | ||
| /** | ||
| * Error decision. | ||
| */ | ||
| var ArcjetErrorDecision = class extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "ERROR"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetErrorDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Error decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| }; | ||
| //#endregion | ||
| export { ArcjetAllowDecision, ArcjetBotReason, ArcjetChallengeDecision, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetErrorDecision, ArcjetErrorReason, ArcjetFilterReason, ArcjetIpDetails, ArcjetPromptInjectionReason, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetSensitiveInfoReason, ArcjetShieldReason, categories as botCategories }; |
| // @generated by protoc-gen-es v2.2.0 | ||
| // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) | ||
| /* eslint-disable */ | ||
| import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; | ||
| import type { Message } from "@bufbuild/protobuf"; | ||
| import type { Timestamp } from "@bufbuild/protobuf/wkt"; | ||
| /** | ||
| * Describes the file proto/decide/v1alpha1/decide.proto. | ||
| */ | ||
| export declare const file_proto_decide_v1alpha1_decide: GenFile; | ||
| /** | ||
| * Additional information from Arcjet about the IP address associated with a | ||
| * request. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.IpDetails | ||
| */ | ||
| export declare type IpDetails = Message<"proto.decide.v1alpha1.IpDetails"> & { | ||
| /** | ||
| * The estimated latitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| * | ||
| * @generated from field: double latitude = 1; | ||
| */ | ||
| latitude: number; | ||
| /** | ||
| * The estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| * | ||
| * @generated from field: double longitude = 2; | ||
| */ | ||
| longitude: number; | ||
| /** | ||
| * The accuracy radius of the IP address location in kilometers. | ||
| * | ||
| * @generated from field: int32 accuracy_radius = 3; | ||
| */ | ||
| accuracyRadius: number; | ||
| /** | ||
| * The timezone of the IP address. | ||
| * | ||
| * @generated from field: string timezone = 4; | ||
| */ | ||
| timezone: string; | ||
| /** | ||
| * The postal code of the IP address. | ||
| * | ||
| * @generated from field: string postal_code = 5; | ||
| */ | ||
| postalCode: string; | ||
| /** | ||
| * The city the IP address is located in. | ||
| * | ||
| * @generated from field: string city = 6; | ||
| */ | ||
| city: string; | ||
| /** | ||
| * The region the IP address is located in. | ||
| * | ||
| * @generated from field: string region = 7; | ||
| */ | ||
| region: string; | ||
| /** | ||
| * The country code the IP address is located in. | ||
| * | ||
| * @generated from field: string country = 8; | ||
| */ | ||
| country: string; | ||
| /** | ||
| * The country name the IP address is located in. | ||
| * | ||
| * @generated from field: string country_name = 9; | ||
| */ | ||
| countryName: string; | ||
| /** | ||
| * The continent code the IP address is located in. | ||
| * | ||
| * @generated from field: string continent = 10; | ||
| */ | ||
| continent: string; | ||
| /** | ||
| * The continent name the IP address is located in. | ||
| * | ||
| * @generated from field: string continent_name = 11; | ||
| */ | ||
| continentName: string; | ||
| /** | ||
| * The AS number the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn = 12; | ||
| */ | ||
| asn: string; | ||
| /** | ||
| * The AS name the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_name = 13; | ||
| */ | ||
| asnName: string; | ||
| /** | ||
| * The AS domain the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_domain = 14; | ||
| */ | ||
| asnDomain: string; | ||
| /** | ||
| * The ASN type: ISP, hosting, business, or education | ||
| * | ||
| * @generated from field: string asn_type = 15; | ||
| */ | ||
| asnType: string; | ||
| /** | ||
| * The ASN country code the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_country = 16; | ||
| */ | ||
| asnCountry: string; | ||
| /** | ||
| * The name of the service the IP address belongs to. | ||
| * | ||
| * @generated from field: string service = 17; | ||
| */ | ||
| service: string; | ||
| /** | ||
| * Whether the IP address belongs to a hosting provider. | ||
| * | ||
| * @generated from field: bool is_hosting = 18; | ||
| */ | ||
| isHosting: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a VPN provider. | ||
| * | ||
| * @generated from field: bool is_vpn = 19; | ||
| */ | ||
| isVpn: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a proxy provider. | ||
| * | ||
| * @generated from field: bool is_proxy = 20; | ||
| */ | ||
| isProxy: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a Tor node. | ||
| * | ||
| * @generated from field: bool is_tor = 21; | ||
| */ | ||
| isTor: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a relay service. | ||
| * | ||
| * @generated from field: bool is_relay = 22; | ||
| */ | ||
| isRelay: boolean; | ||
| /** | ||
| * Whether the IP address has been flagged as an abuser. | ||
| * | ||
| * @generated from field: bool is_abuser = 23; | ||
| */ | ||
| isAbuser: boolean; | ||
| /** | ||
| * Bots is the list of bots that the IP address belongs to. | ||
| * | ||
| * @generated from field: map<string, string> bots = 24; | ||
| */ | ||
| bots: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IpDetails. | ||
| * Use `create(IpDetailsSchema)` to create a new message. | ||
| */ | ||
| export declare const IpDetailsSchema: GenMessage<IpDetails>; | ||
| /** | ||
| * The reason for the decision. This is populated based on the selected rules | ||
| * for deny or challenge responses. Additional details can be found in the field | ||
| * and by logging into the Arcjet Console and searching for the decision ID. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Reason | ||
| */ | ||
| export declare type Reason = Message<"proto.decide.v1alpha1.Reason"> & { | ||
| /** | ||
| * @generated from oneof proto.decide.v1alpha1.Reason.reason | ||
| */ | ||
| reason: { | ||
| /** | ||
| * Contains details about the rate limit when the decision was made | ||
| * based on a rate limit rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitReason rate_limit = 1; | ||
| */ | ||
| value: RateLimitReason; | ||
| case: "rateLimit"; | ||
| } | { | ||
| /** | ||
| * Contains details about the edge rules which were triggered when the | ||
| * decision was made based on an edge rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EdgeRuleReason edge_rule = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| value: EdgeRuleReason; | ||
| case: "edgeRule"; | ||
| } | { | ||
| /** | ||
| * Contains details about why the request was considered a bot when the | ||
| * decision was made based on a bot rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotReason bot = 3; | ||
| */ | ||
| value: BotReason; | ||
| case: "bot"; | ||
| } | { | ||
| /** | ||
| * Contains details about why Arcjet Shield was triggered. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ShieldReason shield = 4; | ||
| */ | ||
| value: ShieldReason; | ||
| case: "shield"; | ||
| } | { | ||
| /** | ||
| * Contains details about the email when the decision was made based on | ||
| * an email rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EmailReason email = 5; | ||
| */ | ||
| value: EmailReason; | ||
| case: "email"; | ||
| } | { | ||
| /** | ||
| * Contains details about the error decision when an error occurred. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ErrorReason error = 6; | ||
| */ | ||
| value: ErrorReason; | ||
| case: "error"; | ||
| } | { | ||
| /** | ||
| * Contains details about sensitive info identified in the body of the | ||
| * request if the sensitive info rule is configured. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoReason sensitive_info = 7; | ||
| */ | ||
| value: SensitiveInfoReason; | ||
| case: "sensitiveInfo"; | ||
| } | { | ||
| /** | ||
| * Contains details about why the request was considered a bot when the | ||
| * decision was made based on a bot (v2) rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotV2Reason bot_v2 = 8; | ||
| */ | ||
| value: BotV2Reason; | ||
| case: "botV2"; | ||
| } | { | ||
| /** | ||
| * Contains details about the filter rules which were triggered when the | ||
| * decision was made based on a filter rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.FilterReason filter = 9; | ||
| */ | ||
| value: FilterReason; | ||
| case: "filter"; | ||
| } | { | ||
| /** | ||
| * Contains details about the prompt injection analysis when | ||
| * the decision was made based on a prompt injection detection rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionReason prompt_injection = 10; | ||
| */ | ||
| value: PromptInjectionReason; | ||
| case: "promptInjection"; | ||
| } | { case: undefined; value?: undefined }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Reason. | ||
| * Use `create(ReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ReasonSchema: GenMessage<Reason>; | ||
| /** | ||
| * Details of a rate limit decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RateLimitReason | ||
| */ | ||
| export declare type RateLimitReason = Message<"proto.decide.v1alpha1.RateLimitReason"> & { | ||
| /** | ||
| * The configured maximum number of requests allowed in the current window. | ||
| * | ||
| * @generated from field: uint32 max = 1; | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Deprecated: Always empty. Previously, the number of requests which have | ||
| * been made in the current window. | ||
| * | ||
| * @generated from field: int32 count = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| count: number; | ||
| /** | ||
| * The number of requests remaining in the current window. | ||
| * | ||
| * @generated from field: uint32 remaining = 3; | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * The time at which the rate limit window will reset. | ||
| * | ||
| * Deprecated: Use `reset_in_seconds` instead. | ||
| * | ||
| * @generated from field: google.protobuf.Timestamp reset_time = 4 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| resetTime?: Timestamp; | ||
| /** | ||
| * The duration in seconds until this rate limit window will reset. | ||
| * | ||
| * @generated from field: uint32 reset_in_seconds = 5; | ||
| */ | ||
| resetInSeconds: number; | ||
| /** | ||
| * The time window in seconds of this rate limit. | ||
| * | ||
| * @generated from field: uint32 window_in_seconds = 6; | ||
| */ | ||
| windowInSeconds: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitReason. | ||
| * Use `create(RateLimitReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const RateLimitReasonSchema: GenMessage<RateLimitReason>; | ||
| /** | ||
| * Details of an edge rule decision. Unimplemented. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EdgeRuleReason | ||
| * @deprecated | ||
| */ | ||
| export declare type EdgeRuleReason = Message<"proto.decide.v1alpha1.EdgeRuleReason"> & { | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EdgeRuleReason. | ||
| * Use `create(EdgeRuleReasonSchema)` to create a new message. | ||
| * @deprecated | ||
| */ | ||
| export declare const EdgeRuleReasonSchema: GenMessage<EdgeRuleReason>; | ||
| /** | ||
| * Details of a bot decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotReason | ||
| */ | ||
| export declare type BotReason = Message<"proto.decide.v1alpha1.BotReason"> & { | ||
| /** | ||
| * The bot type we detected. See `BotType` for more information. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotType bot_type = 1; | ||
| */ | ||
| botType: BotType; | ||
| /** | ||
| * The bot score we calculated. Score ranges from 0 to 99 representing the | ||
| * degree of certainty. The higher the number within the type category, the | ||
| * greater the degree of certainty. See `BotType` for more information. | ||
| * | ||
| * @generated from field: int32 bot_score = 2; | ||
| */ | ||
| botScore: number; | ||
| /** | ||
| * Whether bot detection was triggered by our user agent matching. | ||
| * | ||
| * @generated from field: bool user_agent_match = 3; | ||
| */ | ||
| userAgentMatch: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a hosting provider. | ||
| * | ||
| * @generated from field: bool ip_hosting = 5; | ||
| */ | ||
| ipHosting: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a VPN provider. | ||
| * | ||
| * @generated from field: bool ip_vpn = 6; | ||
| */ | ||
| ipVpn: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a proxy provider. | ||
| * | ||
| * @generated from field: bool ip_proxy = 7; | ||
| */ | ||
| ipProxy: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a Tor node. | ||
| * | ||
| * @generated from field: bool ip_tor = 8; | ||
| */ | ||
| ipTor: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a relay service. | ||
| * | ||
| * @generated from field: bool ip_relay = 9; | ||
| */ | ||
| ipRelay: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotReason. | ||
| * Use `create(BotReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const BotReasonSchema: GenMessage<BotReason>; | ||
| /** | ||
| * Details of a bot (v2) decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotV2Reason | ||
| */ | ||
| export declare type BotV2Reason = Message<"proto.decide.v1alpha1.BotV2Reason"> & { | ||
| /** | ||
| * @generated from field: repeated string allowed = 1; | ||
| */ | ||
| allowed: string[]; | ||
| /** | ||
| * @generated from field: repeated string denied = 2; | ||
| */ | ||
| denied: string[]; | ||
| /** | ||
| * @generated from field: bool verified = 3; | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * @generated from field: bool spoofed = 4; | ||
| */ | ||
| spoofed: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Reason. | ||
| * Use `create(BotV2ReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const BotV2ReasonSchema: GenMessage<BotV2Reason>; | ||
| /** | ||
| * Details of an Arcjet Shield decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ShieldReason | ||
| */ | ||
| export declare type ShieldReason = Message<"proto.decide.v1alpha1.ShieldReason"> & { | ||
| /** | ||
| * Whether Arcjet Shield was triggered. Log into the Arcjet Console and | ||
| * search for the decision ID to find more details about which rules were | ||
| * triggered. | ||
| * | ||
| * @generated from field: bool shield_triggered = 1; | ||
| */ | ||
| shieldTriggered: boolean; | ||
| /** | ||
| * Whether the request was considered suspicious based on background | ||
| * analysis of the request | ||
| * | ||
| * @generated from field: bool suspicious = 2; | ||
| */ | ||
| suspicious: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldReason. | ||
| * Use `create(ShieldReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ShieldReasonSchema: GenMessage<ShieldReason>; | ||
| /** | ||
| * Details of an Arcjet Filter decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.FilterReason | ||
| */ | ||
| export declare type FilterReason = Message<"proto.decide.v1alpha1.FilterReason"> & { | ||
| /** | ||
| * Deprecated: Use the `matched_expressions` field instead. | ||
| * | ||
| * @generated from field: string matched_expression = 1 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| matchedExpression: string; | ||
| /** | ||
| * List of all matched expressions. | ||
| * | ||
| * @generated from field: repeated string matched_expressions = 2; | ||
| */ | ||
| matchedExpressions: string[]; | ||
| /** | ||
| * List of all undetermined expressions. | ||
| * | ||
| * @generated from field: repeated string undetermined_expressions = 3; | ||
| */ | ||
| undeterminedExpressions: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterReason. | ||
| * Use `create(FilterReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const FilterReasonSchema: GenMessage<FilterReason>; | ||
| /** | ||
| * Details of an email decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EmailReason | ||
| */ | ||
| export declare type EmailReason = Message<"proto.decide.v1alpha1.EmailReason"> & { | ||
| /** | ||
| * The types of email address we detected. This may be one or more of the | ||
| * `EmailType` values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType email_types = 1; | ||
| */ | ||
| emailTypes: EmailType[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailReason. | ||
| * Use `create(EmailReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const EmailReasonSchema: GenMessage<EmailReason>; | ||
| /** | ||
| * Details of an error decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ErrorReason | ||
| */ | ||
| export declare type ErrorReason = Message<"proto.decide.v1alpha1.ErrorReason"> & { | ||
| /** | ||
| * The error message associated with the error decision. | ||
| * | ||
| * @generated from field: string message = 1; | ||
| */ | ||
| message: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ErrorReason. | ||
| * Use `create(ErrorReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ErrorReasonSchema: GenMessage<ErrorReason>; | ||
| /** | ||
| * Details of an AI prompt injection decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.PromptInjectionReason | ||
| */ | ||
| export declare type PromptInjectionReason = Message<"proto.decide.v1alpha1.PromptInjectionReason"> & { | ||
| /** | ||
| * Whether a prompt injection attempt was detected in the input. | ||
| * | ||
| * @generated from field: bool injection_detected = 1; | ||
| */ | ||
| injectionDetected: boolean; | ||
| /** | ||
| * Deprecated: The underlying model produces a binary verdict; this field | ||
| * now returns exclusively 0.005 (benign) or 0.995 (injection) to match | ||
| * the model's hardcoded output values. Use injection_detected instead. | ||
| * | ||
| * @generated from field: double score = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| score: number; | ||
| /** | ||
| * The number of tokens processed in the input for the prompt injection | ||
| * analysis. | ||
| * | ||
| * @generated from field: uint32 total_tokens = 3; | ||
| */ | ||
| totalTokens: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionReason. | ||
| * Use `create(PromptInjectionReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const PromptInjectionReasonSchema: GenMessage<PromptInjectionReason>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.IdentifiedEntity | ||
| */ | ||
| export declare type IdentifiedEntity = Message<"proto.decide.v1alpha1.IdentifiedEntity"> & { | ||
| /** | ||
| * The type of entity that was identified | ||
| * | ||
| * @generated from field: string identified_type = 1; | ||
| */ | ||
| identifiedType: string; | ||
| /** | ||
| * The start index of the entity in the body. | ||
| * | ||
| * @generated from field: uint32 start = 2; | ||
| */ | ||
| start: number; | ||
| /** | ||
| * The end index of the entity in the body. | ||
| * | ||
| * @generated from field: uint32 end = 3; | ||
| */ | ||
| end: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IdentifiedEntity. | ||
| * Use `create(IdentifiedEntitySchema)` to create a new message. | ||
| */ | ||
| export declare const IdentifiedEntitySchema: GenMessage<IdentifiedEntity>; | ||
| /** | ||
| * Details of a sensitive info reason. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.SensitiveInfoReason | ||
| */ | ||
| export declare type SensitiveInfoReason = Message<"proto.decide.v1alpha1.SensitiveInfoReason"> & { | ||
| /** | ||
| * The allowed sensitive info types | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity allowed = 1; | ||
| */ | ||
| allowed: IdentifiedEntity[]; | ||
| /** | ||
| * The denied sensitive info types | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity denied = 2; | ||
| */ | ||
| denied: IdentifiedEntity[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoReason. | ||
| * Use `create(SensitiveInfoReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const SensitiveInfoReasonSchema: GenMessage<SensitiveInfoReason>; | ||
| /** | ||
| * The configuration for a rate limit rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RateLimitRule | ||
| */ | ||
| export declare type RateLimitRule = Message<"proto.decide.v1alpha1.RateLimitRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The request path the rate limit applies to. If not specified and Arcjet | ||
| * is running on a specific API route, it defaults to the path for that | ||
| * route. If not specified and Arcjet is running from middleware, it applies | ||
| * to all routes. | ||
| * | ||
| * @generated from field: string match = 2; | ||
| */ | ||
| match: string; | ||
| /** | ||
| * Defines how Arcjet will track rate limits. If none are specified, it will | ||
| * default to using the client IP address. If more than one characteristic | ||
| * is provided, they will be combined. For further details, see | ||
| * https://docs.arcjet.com/architecture/#fingerprinting | ||
| * | ||
| * @generated from field: repeated string characteristics = 3; | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * The time window the rate limit applies to. This is a string value with a | ||
| * sequence of decimal numbers, each with an optional fraction and a unit | ||
| * suffix e.g. 1s for 1 second, 1h45m for 1 hour and 45 minutes, 1d for 1 | ||
| * day. Valid time units are ns, us (or µs), ms, s, m, h. | ||
| * | ||
| * Deprecated: Use the window_in_seconds field instead. | ||
| * | ||
| * @generated from field: string window = 4 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| window: string; | ||
| /** | ||
| * The maximum number of requests allowed in the time period. This is a | ||
| * positive integer value e.g. 100. | ||
| * | ||
| * Required by "fixed window", "sliding window", and unspecified algorithms. | ||
| * | ||
| * @generated from field: uint32 max = 5; | ||
| */ | ||
| max: number; | ||
| /** | ||
| * How long to apply the limit before it expires and the client is allowed | ||
| * to make more requests. If not specified, this will default to the same | ||
| * value as the Window e.g. if the window is 1 hour, the client will be rate | ||
| * limited for 1 hour after they hit the limit. This is a string value with | ||
| * a sequence of decimal numbers, each with an optional fraction and a unit | ||
| * suffix e.g. 1s for 1 second, 1h45m for 1 hour and 45 minutes, 1d for 1 | ||
| * day. Valid time units are ns, us (or µs), ms, s, m, h, d, w, y. | ||
| * | ||
| * @generated from field: string timeout = 6; | ||
| */ | ||
| timeout: string; | ||
| /** | ||
| * The algorithm to use for rate limiting a request. If unspecified, we will | ||
| * fallback to the "fixed window" algorithm. The chosen algorithm will | ||
| * affect which other fields must be specified to be a valid configuration. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitAlgorithm algorithm = 7; | ||
| */ | ||
| algorithm: RateLimitAlgorithm; | ||
| /** | ||
| * The amount of tokens that are refilled at the provided interval. | ||
| * | ||
| * Required by "token bucket" algorithm. | ||
| * | ||
| * @generated from field: uint32 refill_rate = 8; | ||
| */ | ||
| refillRate: number; | ||
| /** | ||
| * The interval in which a rate limit is applied or tokens refilled. | ||
| * | ||
| * Required by "token bucket" and "sliding window" algorithms. | ||
| * | ||
| * @generated from field: uint32 interval = 9; | ||
| */ | ||
| interval: number; | ||
| /** | ||
| * The maximum number of tokens that can exist in a token bucket. | ||
| * | ||
| * Required by "token bucket" algorithm. | ||
| * | ||
| * @generated from field: uint32 capacity = 10; | ||
| */ | ||
| capacity: number; | ||
| /** | ||
| * The time window the rate limit applies to. This is an unsigned 32-bit | ||
| * integer value representing a number of seconds. | ||
| * | ||
| * Required by "fixed window" and unspecified algorithms. | ||
| * | ||
| * @generated from field: uint32 window_in_seconds = 12; | ||
| */ | ||
| windowInSeconds: number; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitRuleVersion version = 13; | ||
| */ | ||
| version: RateLimitRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitRule. | ||
| * Use `create(RateLimitRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const RateLimitRuleSchema: GenMessage<RateLimitRule>; | ||
| /** | ||
| * The configuration for a bot rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotRule | ||
| */ | ||
| export declare type BotRule = Message<"proto.decide.v1alpha1.BotRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The bot types to block. This may be one or more of the `BotType` values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.BotType block = 2; | ||
| */ | ||
| block: BotType[]; | ||
| /** | ||
| * Additional bot detection rules to add or remove from the Arcjet standard | ||
| * list. Each rule is a regular expression that matches the user agent of | ||
| * the bot plus a label to indicate what type of bot it is from the above | ||
| * `BotType`s. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotRule.Patterns patterns = 3; | ||
| */ | ||
| patterns?: BotRule_Patterns; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule. | ||
| * Use `create(BotRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const BotRuleSchema: GenMessage<BotRule>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.BotRule.Patterns | ||
| */ | ||
| export declare type BotRule_Patterns = Message<"proto.decide.v1alpha1.BotRule.Patterns"> & { | ||
| /** | ||
| * @generated from field: map<string, proto.decide.v1alpha1.BotType> add = 1; | ||
| */ | ||
| add: { [key: string]: BotType }; | ||
| /** | ||
| * @generated from field: repeated string remove = 2; | ||
| */ | ||
| remove: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule.Patterns. | ||
| * Use `create(BotRule_PatternsSchema)` to create a new message. | ||
| */ | ||
| export declare const BotRule_PatternsSchema: GenMessage<BotRule_Patterns>; | ||
| /** | ||
| * The configuration for a bot (v2) rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotV2Rule | ||
| */ | ||
| export declare type BotV2Rule = Message<"proto.decide.v1alpha1.BotV2Rule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotV2RuleVersion version = 4; | ||
| */ | ||
| version: BotV2RuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Rule. | ||
| * Use `create(BotV2RuleSchema)` to create a new message. | ||
| */ | ||
| export declare const BotV2RuleSchema: GenMessage<BotV2Rule>; | ||
| /** | ||
| * The configuration for an email rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EmailRule | ||
| */ | ||
| export declare type EmailRule = Message<"proto.decide.v1alpha1.EmailRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The email types to block. This may be one or more of the `EmailType` | ||
| * values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType block = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| block: EmailType[]; | ||
| /** | ||
| * @generated from field: bool require_top_level_domain = 3; | ||
| */ | ||
| requireTopLevelDomain: boolean; | ||
| /** | ||
| * @generated from field: bool allow_domain_literal = 4; | ||
| */ | ||
| allowDomainLiteral: boolean; | ||
| /** | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType allow = 5; | ||
| */ | ||
| allow: EmailType[]; | ||
| /** | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType deny = 6; | ||
| */ | ||
| deny: EmailType[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EmailRuleVersion version = 7; | ||
| */ | ||
| version: EmailRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailRule. | ||
| * Use `create(EmailRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const EmailRuleSchema: GenMessage<EmailRule>; | ||
| /** | ||
| * The configuration for a detect sensitive info rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.SensitiveInfoRule | ||
| */ | ||
| export declare type SensitiveInfoRule = Message<"proto.decide.v1alpha1.SensitiveInfoRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The sensitive info types to allow and deny. | ||
| * | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoRuleVersion version = 4; | ||
| */ | ||
| version: SensitiveInfoRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoRule. | ||
| * Use `create(SensitiveInfoRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const SensitiveInfoRuleSchema: GenMessage<SensitiveInfoRule>; | ||
| /** | ||
| * The configuration for a shield rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ShieldRule | ||
| */ | ||
| export declare type ShieldRule = Message<"proto.decide.v1alpha1.ShieldRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: bool auto_added = 2; | ||
| */ | ||
| autoAdded: boolean; | ||
| /** | ||
| * Defines how Arcjet will track suspicious requests. If none are specified, | ||
| * it will default to using the client IP address. If more than one | ||
| * characteristic is provided, they will be combined. For further details, | ||
| * see https://docs.arcjet.com/architecture/#fingerprinting | ||
| * | ||
| * @generated from field: repeated string characteristics = 3; | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ShieldRuleVersion version = 4; | ||
| */ | ||
| version: ShieldRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldRule. | ||
| * Use `create(ShieldRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const ShieldRuleSchema: GenMessage<ShieldRule>; | ||
| /** | ||
| * The configuration for a filter rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.FilterRule | ||
| */ | ||
| export declare type FilterRule = Message<"proto.decide.v1alpha1.FilterRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.FilterRuleVersion version = 4; | ||
| */ | ||
| version: FilterRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterRule. | ||
| * Use `create(FilterRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const FilterRuleSchema: GenMessage<FilterRule>; | ||
| /** | ||
| * The configuration for a prompt injection detection rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.PromptInjectionDetectionRule | ||
| */ | ||
| export declare type PromptInjectionDetectionRule = Message<"proto.decide.v1alpha1.PromptInjectionDetectionRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * Deprecated: The underlying model produces a binary verdict so a | ||
| * configurable threshold is not meaningful. This field is ignored; the | ||
| * decision is determined solely by the model's binary classification. | ||
| * | ||
| * @generated from field: optional double threshold = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| threshold?: number; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion version = 3; | ||
| */ | ||
| version: PromptInjectionDetectionRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionDetectionRule. | ||
| * Use `create(PromptInjectionDetectionRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const PromptInjectionDetectionRuleSchema: GenMessage<PromptInjectionDetectionRule>; | ||
| /** | ||
| * The configuration for Arcjet. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Rule | ||
| */ | ||
| export declare type Rule = Message<"proto.decide.v1alpha1.Rule"> & { | ||
| /** | ||
| * @generated from oneof proto.decide.v1alpha1.Rule.rule | ||
| */ | ||
| rule: { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitRule rate_limit = 1; | ||
| */ | ||
| value: RateLimitRule; | ||
| case: "rateLimit"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.BotRule bots = 2; | ||
| */ | ||
| value: BotRule; | ||
| case: "bots"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.EmailRule email = 3; | ||
| */ | ||
| value: EmailRule; | ||
| case: "email"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.ShieldRule shield = 4; | ||
| */ | ||
| value: ShieldRule; | ||
| case: "shield"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoRule sensitive_info = 5; | ||
| */ | ||
| value: SensitiveInfoRule; | ||
| case: "sensitiveInfo"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.BotV2Rule bot_v2 = 6; | ||
| */ | ||
| value: BotV2Rule; | ||
| case: "botV2"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.FilterRule filter = 7; | ||
| */ | ||
| value: FilterRule; | ||
| case: "filter"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionDetectionRule prompt_injection_detection = 8; | ||
| */ | ||
| value: PromptInjectionDetectionRule; | ||
| case: "promptInjectionDetection"; | ||
| } | { case: undefined; value?: undefined }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Rule. | ||
| * Use `create(RuleSchema)` to create a new message. | ||
| */ | ||
| export declare const RuleSchema: GenMessage<Rule>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.RuleResult | ||
| */ | ||
| export declare type RuleResult = Message<"proto.decide.v1alpha1.RuleResult"> & { | ||
| /** | ||
| * The stable, deterministic, and unique identifier of the rule that | ||
| * generated this result. | ||
| * | ||
| * @generated from field: string rule_id = 1; | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * The rule run state | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RuleState state = 2; | ||
| */ | ||
| state: RuleState; | ||
| /** | ||
| * The conclusion determined by the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Conclusion conclusion = 3; | ||
| */ | ||
| conclusion: Conclusion; | ||
| /** | ||
| * The reason for the conclusion. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Reason reason = 4; | ||
| */ | ||
| reason?: Reason; | ||
| /** | ||
| * The duration in seconds this result should be considered valid, also | ||
| * known as time-to-live. | ||
| * | ||
| * @generated from field: uint32 ttl = 5; | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * The fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| * | ||
| * @generated from field: string fingerprint = 6; | ||
| */ | ||
| fingerprint: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RuleResult. | ||
| * Use `create(RuleResultSchema)` to create a new message. | ||
| */ | ||
| export declare const RuleResultSchema: GenMessage<RuleResult>; | ||
| /** | ||
| * Details about a request under investigation. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RequestDetails | ||
| */ | ||
| export declare type RequestDetails = Message<"proto.decide.v1alpha1.RequestDetails"> & { | ||
| /** | ||
| * @generated from field: string ip = 1; | ||
| */ | ||
| ip: string; | ||
| /** | ||
| * @generated from field: string method = 2; | ||
| */ | ||
| method: string; | ||
| /** | ||
| * @generated from field: string protocol = 3; | ||
| */ | ||
| protocol: string; | ||
| /** | ||
| * @generated from field: string host = 4; | ||
| */ | ||
| host: string; | ||
| /** | ||
| * @generated from field: string path = 5; | ||
| */ | ||
| path: string; | ||
| /** | ||
| * @generated from field: map<string, string> headers = 6; | ||
| */ | ||
| headers: { [key: string]: string }; | ||
| /** | ||
| * @generated from field: bytes body = 7; | ||
| */ | ||
| body: Uint8Array; | ||
| /** | ||
| * @generated from field: map<string, string> extra = 8; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| /** | ||
| * @generated from field: string email = 9; | ||
| */ | ||
| email: string; | ||
| /** | ||
| * The string representing semicolon-separated Cookies for a request. | ||
| * | ||
| * @generated from field: string cookies = 10; | ||
| */ | ||
| cookies: string; | ||
| /** | ||
| * The `?`-prefixed string representing the Query for a request. Commonly | ||
| * referred to as a "querystring". | ||
| * | ||
| * @generated from field: string query = 11; | ||
| */ | ||
| query: string; | ||
| /** | ||
| * An optional, caller-supplied opaque identifier used to correlate this | ||
| * request with other protect() and guard() calls that belong to the same | ||
| * workflow, agent run, or multi-step task. It does not affect the decision | ||
| * and is excluded from fingerprinting; it is stored alongside the recorded | ||
| * decision so a chain of actions can be reconstructed. Carried on | ||
| * RequestDetails so it applies to both the Decide and Report RPCs. | ||
| * | ||
| * @generated from field: string correlation_id = 12; | ||
| */ | ||
| correlationId: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RequestDetails. | ||
| * Use `create(RequestDetailsSchema)` to create a new message. | ||
| */ | ||
| export declare const RequestDetailsSchema: GenMessage<RequestDetails>; | ||
| /** | ||
| * A decision made about the request under investigation. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Decision | ||
| */ | ||
| export declare type Decision = Message<"proto.decide.v1alpha1.Decision"> & { | ||
| /** | ||
| * The decision ID. This is a unique identifier for the decision which can | ||
| * be used to search for the request details in the Arcjet Console. | ||
| * | ||
| * @generated from field: string id = 1; | ||
| */ | ||
| id: string; | ||
| /** | ||
| * Arcjet's conclusion for the request based on our analysis. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Conclusion conclusion = 2; | ||
| */ | ||
| conclusion: Conclusion; | ||
| /** | ||
| * The reason for the decision. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Reason reason = 3; | ||
| */ | ||
| reason?: Reason; | ||
| /** | ||
| * The outcome of each rule taken into consideration for the decision. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.RuleResult rule_results = 4; | ||
| */ | ||
| ruleResults: RuleResult[]; | ||
| /** | ||
| * The duration in seconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| * | ||
| * @generated from field: uint32 ttl = 5; | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * Details about the IP address that informed our conclusion. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.IpDetails ip_details = 6; | ||
| */ | ||
| ipDetails?: IpDetails; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Decision. | ||
| * Use `create(DecisionSchema)` to create a new message. | ||
| */ | ||
| export declare const DecisionSchema: GenMessage<Decision>; | ||
| /** | ||
| * A request to the decide API. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.DecideRequest | ||
| */ | ||
| export declare type DecideRequest = Message<"proto.decide.v1alpha1.DecideRequest"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SDKStack sdk_stack = 1; | ||
| */ | ||
| sdkStack: SDKStack; | ||
| /** | ||
| * @generated from field: string sdk_version = 2; | ||
| */ | ||
| sdkVersion: string; | ||
| /** | ||
| * The information provided via an SDK about a request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RequestDetails details = 4; | ||
| */ | ||
| details?: RequestDetails; | ||
| /** | ||
| * The rules that are being considered for this request. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.Rule rules = 5; | ||
| */ | ||
| rules: Rule[]; | ||
| /** | ||
| * The characteristics that should be used for fingerprinting. | ||
| * | ||
| * @generated from field: repeated string characteristics = 6; | ||
| */ | ||
| characteristics: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideRequest. | ||
| * Use `create(DecideRequestSchema)` to create a new message. | ||
| */ | ||
| export declare const DecideRequestSchema: GenMessage<DecideRequest>; | ||
| /** | ||
| * A response from the decide API. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.DecideResponse | ||
| */ | ||
| export declare type DecideResponse = Message<"proto.decide.v1alpha1.DecideResponse"> & { | ||
| /** | ||
| * The decision made about the request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Decision decision = 1; | ||
| */ | ||
| decision?: Decision; | ||
| /** | ||
| * Any extra information returned by the Arcjet analysis. | ||
| * | ||
| * @generated from field: map<string, string> extra = 2; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideResponse. | ||
| * Use `create(DecideResponseSchema)` to create a new message. | ||
| */ | ||
| export declare const DecideResponseSchema: GenMessage<DecideResponse>; | ||
| /** | ||
| * A request to the Report RPC when SDK has already made a decision locally. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ReportRequest | ||
| */ | ||
| export declare type ReportRequest = Message<"proto.decide.v1alpha1.ReportRequest"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SDKStack sdk_stack = 1; | ||
| */ | ||
| sdkStack: SDKStack; | ||
| /** | ||
| * @generated from field: string sdk_version = 2; | ||
| */ | ||
| sdkVersion: string; | ||
| /** | ||
| * The information provided via an SDK about a request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RequestDetails details = 4; | ||
| */ | ||
| details?: RequestDetails; | ||
| /** | ||
| * The decision reported about the request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Decision decision = 5; | ||
| */ | ||
| decision?: Decision; | ||
| /** | ||
| * The rules that are were considered for this request. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.Rule rules = 6; | ||
| */ | ||
| rules: Rule[]; | ||
| /** | ||
| * The characteristics that should be used for fingerprinting. | ||
| * | ||
| * @generated from field: repeated string characteristics = 8; | ||
| */ | ||
| characteristics: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportRequest. | ||
| * Use `create(ReportRequestSchema)` to create a new message. | ||
| */ | ||
| export declare const ReportRequestSchema: GenMessage<ReportRequest>; | ||
| /** | ||
| * A response from the Report RPC. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ReportResponse | ||
| */ | ||
| export declare type ReportResponse = Message<"proto.decide.v1alpha1.ReportResponse"> & { | ||
| /** | ||
| * Any extra information returned by the Arcjet analysis. | ||
| * | ||
| * @generated from field: map<string, string> extra = 2; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportResponse. | ||
| * Use `create(ReportResponseSchema)` to create a new message. | ||
| */ | ||
| export declare const ReportResponseSchema: GenMessage<ReportResponse>; | ||
| /** | ||
| * Represents whether we think the client is a bot or not. This should be used | ||
| * alongside the bot score which represents the level of certainty of our | ||
| * detection. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.BotType | ||
| */ | ||
| export enum BotType { | ||
| /** | ||
| * The bot type is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * We could not analyze the request, perhaps because of insufficient | ||
| * information or because the bot analysis can't be executed in this | ||
| * environment. We do not recommend blocking these requests. Represented by | ||
| * a score of 0. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_NOT_ANALYZED = 1; | ||
| */ | ||
| NOT_ANALYZED = 1, | ||
| /** | ||
| * We are sure the request was made by an automated bot. We recommend | ||
| * blocking these requests for paths which are for humans only e.g. login or | ||
| * signup pages, but not blocking for API paths. Represented by a score of | ||
| * 1. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_AUTOMATED = 2; | ||
| */ | ||
| AUTOMATED = 2, | ||
| /** | ||
| * We have some evidence that the request was made by an automated bot. The | ||
| * degree of certainty is represented by a score range of 2-29. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_LIKELY_AUTOMATED = 3; | ||
| */ | ||
| LIKELY_AUTOMATED = 3, | ||
| /** | ||
| * We don't think this request was made by an automated bot. The degree of | ||
| * certainty is represented by a score range of 30-99. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_LIKELY_NOT_A_BOT = 4; | ||
| */ | ||
| LIKELY_NOT_A_BOT = 4, | ||
| /** | ||
| * We are sure the request was made by an automated bot and it is on our | ||
| * list of verified good bots. This is manually maintained by the Arcjet | ||
| * team and includes bots such as monitoring agents and friendly search | ||
| * engine crawlers. In most cases you can allow these requests on public | ||
| * pages, but you may wish to block them for internal or private paths. | ||
| * Represented by a score of 100. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_VERIFIED_BOT = 5; | ||
| */ | ||
| VERIFIED_BOT = 5, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotType. | ||
| */ | ||
| export declare const BotTypeSchema: GenEnum<BotType>; | ||
| /** | ||
| * Represents the type of email address submitted. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.EmailType | ||
| */ | ||
| export enum EmailType { | ||
| /** | ||
| * The email type is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The email address is disposable, which means it's registered to a service | ||
| * that allows throwaway email addresses. Although these are sometimes used | ||
| * for privacy, they are also often used for spam signups or fraudulent | ||
| * activity when combined with a transaction e.g. attempting to use a credit | ||
| * card. We recommend blocking these in higher risk scenarios. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_DISPOSABLE = 1; | ||
| */ | ||
| DISPOSABLE = 1, | ||
| /** | ||
| * The email address is registered to a free email service. These are very | ||
| * common, such as GMail or Yahoo Mail, so we do not recommend blocking | ||
| * these. However, you may wish to flag these for review the first time they | ||
| * attempt a transaction. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_FREE = 2; | ||
| */ | ||
| FREE = 2, | ||
| /** | ||
| * This email address is registered to a domain name which has no MX records | ||
| * configured. This means it cannot receive email. We recommend blocking | ||
| * these. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_NO_MX_RECORDS = 3; | ||
| */ | ||
| NO_MX_RECORDS = 3, | ||
| /** | ||
| * This email has no Gravatar attached to the email from | ||
| * https://gravatar.com which makes it slightly less likely to be a valid | ||
| * signup. We recommend using this as part of your own risk scoring or | ||
| * manually reviewing these signups. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_NO_GRAVATAR = 4; | ||
| */ | ||
| NO_GRAVATAR = 4, | ||
| /** | ||
| * This email was specified in an invalid format. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_INVALID = 5; | ||
| */ | ||
| INVALID = 5, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailType. | ||
| */ | ||
| export declare const EmailTypeSchema: GenEnum<EmailType>; | ||
| /** | ||
| * The mode to run in. This can be either `DRY_RUN` or `LIVE`. In `DRY_RUN` | ||
| * mode, all requests will be allowed and you can review what the action would | ||
| * have been from the Arcjet Console. In `LIVE` mode, requests will be allowed, | ||
| * challenged or blocked based on the returned decision. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Mode | ||
| */ | ||
| export enum Mode { | ||
| /** | ||
| * The mode is unspecified. This should not be used, but is here to conform | ||
| * to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: MODE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * In `DRY_RUN` mode, all requests will be allowed and you can review what | ||
| * the action would have been from the Arcjet Console. | ||
| * | ||
| * @generated from enum value: MODE_DRY_RUN = 1; | ||
| */ | ||
| DRY_RUN = 1, | ||
| /** | ||
| * In `LIVE` mode, requests will be allowed, challenged or blocked based on | ||
| * the returned decision. | ||
| * | ||
| * @generated from enum value: MODE_LIVE = 2; | ||
| */ | ||
| LIVE = 2, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Mode. | ||
| */ | ||
| export declare const ModeSchema: GenEnum<Mode>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RuleState | ||
| */ | ||
| export enum RuleState { | ||
| /** | ||
| * The mode is unspecified. This should not be used, but is here to conform | ||
| * to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: RULE_STATE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The rule was run and the outcome was taken into consideration for the end | ||
| * decision | ||
| * | ||
| * @generated from enum value: RULE_STATE_RUN = 1; | ||
| */ | ||
| RUN = 1, | ||
| /** | ||
| * The rule wasn't run | ||
| * | ||
| * @generated from enum value: RULE_STATE_NOT_RUN = 2; | ||
| */ | ||
| NOT_RUN = 2, | ||
| /** | ||
| * The rule was run but not actioned on, meaning the outcome didn't affect | ||
| * the end decision | ||
| * | ||
| * @generated from enum value: RULE_STATE_DRY_RUN = 3; | ||
| */ | ||
| DRY_RUN = 3, | ||
| /** | ||
| * The rule was not run because the reason was cached | ||
| * | ||
| * @generated from enum value: RULE_STATE_CACHED = 4; | ||
| */ | ||
| CACHED = 4, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RuleState. | ||
| */ | ||
| export declare const RuleStateSchema: GenEnum<RuleState>; | ||
| /** | ||
| * The conclusion for the request based on the Arcjet analysis and any specific | ||
| * configuration. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Conclusion | ||
| */ | ||
| export enum Conclusion { | ||
| /** | ||
| * The conclusion is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: CONCLUSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The request should be allowed. | ||
| * | ||
| * @generated from enum value: CONCLUSION_ALLOW = 1; | ||
| */ | ||
| ALLOW = 1, | ||
| /** | ||
| * The request should be blocked. | ||
| * | ||
| * @generated from enum value: CONCLUSION_DENY = 2; | ||
| */ | ||
| DENY = 2, | ||
| /** | ||
| * The request should be challenged. | ||
| * | ||
| * @generated from enum value: CONCLUSION_CHALLENGE = 3; | ||
| */ | ||
| CHALLENGE = 3, | ||
| /** | ||
| * The request errored. | ||
| * | ||
| * @generated from enum value: CONCLUSION_ERROR = 4; | ||
| */ | ||
| ERROR = 4, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Conclusion. | ||
| */ | ||
| export declare const ConclusionSchema: GenEnum<Conclusion>; | ||
| /** | ||
| * The SDK used to make the request. Used for analytics and to help us improve. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.SDKStack | ||
| */ | ||
| export enum SDKStack { | ||
| /** | ||
| * @generated from enum value: SDK_STACK_UNSPECIFIED = 0; | ||
| */ | ||
| SDK_STACK_UNSPECIFIED = 0, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NODEJS = 1; | ||
| */ | ||
| SDK_STACK_NODEJS = 1, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NEXTJS = 2; | ||
| */ | ||
| SDK_STACK_NEXTJS = 2, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_PYTHON = 3; | ||
| */ | ||
| SDK_STACK_PYTHON = 3, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_DJANGO = 4; | ||
| */ | ||
| SDK_STACK_DJANGO = 4, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_BUN = 5; | ||
| */ | ||
| SDK_STACK_BUN = 5, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_DENO = 6; | ||
| */ | ||
| SDK_STACK_DENO = 6, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_SVELTEKIT = 7; | ||
| */ | ||
| SDK_STACK_SVELTEKIT = 7, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_HONO = 8; | ||
| */ | ||
| SDK_STACK_HONO = 8, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NUXT = 9; | ||
| */ | ||
| SDK_STACK_NUXT = 9, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NESTJS = 10; | ||
| */ | ||
| SDK_STACK_NESTJS = 10, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_REMIX = 11; | ||
| */ | ||
| SDK_STACK_REMIX = 11, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_ASTRO = 12; | ||
| */ | ||
| SDK_STACK_ASTRO = 12, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_FASTIFY = 13; | ||
| */ | ||
| SDK_STACK_FASTIFY = 13, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_REACT_ROUTER = 14; | ||
| */ | ||
| SDK_STACK_REACT_ROUTER = 14, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_GO = 15; | ||
| */ | ||
| SDK_STACK_GO = 15, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SDKStack. | ||
| */ | ||
| export declare const SDKStackSchema: GenEnum<SDKStack>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm | ||
| */ | ||
| export enum RateLimitAlgorithm { | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_TOKEN_BUCKET = 1; | ||
| */ | ||
| TOKEN_BUCKET = 1, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_FIXED_WINDOW = 2; | ||
| */ | ||
| FIXED_WINDOW = 2, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_SLIDING_WINDOW = 3; | ||
| */ | ||
| SLIDING_WINDOW = 3, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitAlgorithm. | ||
| */ | ||
| export declare const RateLimitAlgorithmSchema: GenEnum<RateLimitAlgorithm>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitRuleVersion | ||
| */ | ||
| export enum RateLimitRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: RATE_LIMIT_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitRuleVersion. | ||
| */ | ||
| export declare const RateLimitRuleVersionSchema: GenEnum<RateLimitRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.BotV2RuleVersion | ||
| */ | ||
| export enum BotV2RuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: BOT_V2_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotV2RuleVersion. | ||
| */ | ||
| export declare const BotV2RuleVersionSchema: GenEnum<BotV2RuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.EmailRuleVersion | ||
| */ | ||
| export enum EmailRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: EMAIL_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailRuleVersion. | ||
| */ | ||
| export declare const EmailRuleVersionSchema: GenEnum<EmailRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.SensitiveInfoRuleVersion | ||
| */ | ||
| export enum SensitiveInfoRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: SENSITIVE_INFO_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SensitiveInfoRuleVersion. | ||
| */ | ||
| export declare const SensitiveInfoRuleVersionSchema: GenEnum<SensitiveInfoRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.ShieldRuleVersion | ||
| */ | ||
| export enum ShieldRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: SHIELD_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.ShieldRuleVersion. | ||
| */ | ||
| export declare const ShieldRuleVersionSchema: GenEnum<ShieldRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.FilterRuleVersion | ||
| */ | ||
| export enum FilterRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: FILTER_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.FilterRuleVersion. | ||
| */ | ||
| export declare const FilterRuleVersionSchema: GenEnum<FilterRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion | ||
| */ | ||
| export enum PromptInjectionDetectionRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: PROMPT_INJECTION_DETECTION_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion. | ||
| */ | ||
| export declare const PromptInjectionDetectionRuleVersionSchema: GenEnum<PromptInjectionDetectionRuleVersion>; | ||
| /** | ||
| * @generated from service proto.decide.v1alpha1.DecideService | ||
| */ | ||
| export declare const DecideService: GenService<{ | ||
| /** | ||
| * @generated from rpc proto.decide.v1alpha1.DecideService.Decide | ||
| */ | ||
| decide: { | ||
| methodKind: "unary"; | ||
| input: typeof DecideRequestSchema; | ||
| output: typeof DecideResponseSchema; | ||
| }, | ||
| /** | ||
| * @generated from rpc proto.decide.v1alpha1.DecideService.Report | ||
| */ | ||
| report: { | ||
| methodKind: "unary"; | ||
| input: typeof ReportRequestSchema; | ||
| output: typeof ReportResponseSchema; | ||
| }, | ||
| }>; | ||
| // @generated by protoc-gen-es v2.2.0 | ||
| // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) | ||
| /* eslint-disable */ | ||
| import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv1"; | ||
| import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; | ||
| /** | ||
| * Describes the file proto/decide/v1alpha1/decide.proto. | ||
| */ | ||
| export const file_proto_decide_v1alpha1_decide = /*@__PURE__*/ | ||
| fileDesc("CiJwcm90by9kZWNpZGUvdjFhbHBoYTEvZGVjaWRlLnByb3RvEhVwcm90by5kZWNpZGUudjFhbHBoYTEinQQKCUlwRGV0YWlscxIQCghsYXRpdHVkZRgBIAEoARIRCglsb25naXR1ZGUYAiABKAESFwoPYWNjdXJhY3lfcmFkaXVzGAMgASgFEhAKCHRpbWV6b25lGAQgASgJEhMKC3Bvc3RhbF9jb2RlGAUgASgJEgwKBGNpdHkYBiABKAkSDgoGcmVnaW9uGAcgASgJEg8KB2NvdW50cnkYCCABKAkSFAoMY291bnRyeV9uYW1lGAkgASgJEhEKCWNvbnRpbmVudBgKIAEoCRIWCg5jb250aW5lbnRfbmFtZRgLIAEoCRILCgNhc24YDCABKAkSEAoIYXNuX25hbWUYDSABKAkSEgoKYXNuX2RvbWFpbhgOIAEoCRIQCghhc25fdHlwZRgPIAEoCRITCgthc25fY291bnRyeRgQIAEoCRIPCgdzZXJ2aWNlGBEgASgJEhIKCmlzX2hvc3RpbmcYEiABKAgSDgoGaXNfdnBuGBMgASgIEhAKCGlzX3Byb3h5GBQgASgIEg4KBmlzX3RvchgVIAEoCBIQCghpc19yZWxheRgWIAEoCBIRCglpc19hYnVzZXIYFyABKAgSOAoEYm90cxgYIAMoCzIqLnByb3RvLmRlY2lkZS52MWFscGhhMS5JcERldGFpbHMuQm90c0VudHJ5GisKCUJvdHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIt8ECgZSZWFzb24SPAoKcmF0ZV9saW1pdBgBIAEoCzImLnByb3RvLmRlY2lkZS52MWFscGhhMS5SYXRlTGltaXRSZWFzb25IABI+CgllZGdlX3J1bGUYAiABKAsyJS5wcm90by5kZWNpZGUudjFhbHBoYTEuRWRnZVJ1bGVSZWFzb25CAhgBSAASLwoDYm90GAMgASgLMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFJlYXNvbkgAEjUKBnNoaWVsZBgEIAEoCzIjLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSZWFzb25IABIzCgVlbWFpbBgFIAEoCzIiLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFJlYXNvbkgAEjMKBWVycm9yGAYgASgLMiIucHJvdG8uZGVjaWRlLnYxYWxwaGExLkVycm9yUmVhc29uSAASRAoOc2Vuc2l0aXZlX2luZm8YByABKAsyKi5wcm90by5kZWNpZGUudjFhbHBoYTEuU2Vuc2l0aXZlSW5mb1JlYXNvbkgAEjQKBmJvdF92MhgIIAEoCzIiLnByb3RvLmRlY2lkZS52MWFscGhhMS5Cb3RWMlJlYXNvbkgAEjUKBmZpbHRlchgJIAEoCzIjLnByb3RvLmRlY2lkZS52MWFscGhhMS5GaWx0ZXJSZWFzb25IABJIChBwcm9tcHRfaW5qZWN0aW9uGAogASgLMiwucHJvdG8uZGVjaWRlLnYxYWxwaGExLlByb21wdEluamVjdGlvblJlYXNvbkgAQggKBnJlYXNvbiKtAQoPUmF0ZUxpbWl0UmVhc29uEgsKA21heBgBIAEoDRIRCgVjb3VudBgCIAEoBUICGAESEQoJcmVtYWluaW5nGAMgASgNEjIKCnJlc2V0X3RpbWUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgIYARIYChByZXNldF9pbl9zZWNvbmRzGAUgASgNEhkKEXdpbmRvd19pbl9zZWNvbmRzGAYgASgNIhQKDkVkZ2VSdWxlUmVhc29uOgIYASLCAQoJQm90UmVhc29uEjAKCGJvdF90eXBlGAEgASgOMh4ucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFR5cGUSEQoJYm90X3Njb3JlGAIgASgFEhgKEHVzZXJfYWdlbnRfbWF0Y2gYAyABKAgSEgoKaXBfaG9zdGluZxgFIAEoCBIOCgZpcF92cG4YBiABKAgSEAoIaXBfcHJveHkYByABKAgSDgoGaXBfdG9yGAggASgIEhAKCGlwX3JlbGF5GAkgASgIIlEKC0JvdFYyUmVhc29uEg8KB2FsbG93ZWQYASADKAkSDgoGZGVuaWVkGAIgAygJEhAKCHZlcmlmaWVkGAMgASgIEg8KB3Nwb29mZWQYBCABKAgiPAoMU2hpZWxkUmVhc29uEhgKEHNoaWVsZF90cmlnZ2VyZWQYASABKAgSEgoKc3VzcGljaW91cxgCIAEoCCJtCgxGaWx0ZXJSZWFzb24SHgoSbWF0Y2hlZF9leHByZXNzaW9uGAEgASgJQgIYARIbChNtYXRjaGVkX2V4cHJlc3Npb25zGAIgAygJEiAKGHVuZGV0ZXJtaW5lZF9leHByZXNzaW9ucxgDIAMoCSJECgtFbWFpbFJlYXNvbhI1CgtlbWFpbF90eXBlcxgBIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUiHgoLRXJyb3JSZWFzb24SDwoHbWVzc2FnZRgBIAEoCSJcChVQcm9tcHRJbmplY3Rpb25SZWFzb24SGgoSaW5qZWN0aW9uX2RldGVjdGVkGAEgASgIEhEKBXNjb3JlGAIgASgBQgIYARIUCgx0b3RhbF90b2tlbnMYAyABKA0iRwoQSWRlbnRpZmllZEVudGl0eRIXCg9pZGVudGlmaWVkX3R5cGUYASABKAkSDQoFc3RhcnQYAiABKA0SCwoDZW5kGAMgASgNIogBChNTZW5zaXRpdmVJbmZvUmVhc29uEjgKB2FsbG93ZWQYASADKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuSWRlbnRpZmllZEVudGl0eRI3CgZkZW5pZWQYAiADKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuSWRlbnRpZmllZEVudGl0eSL1AgoNUmF0ZUxpbWl0UnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFbWF0Y2gYAiABKAkSFwoPY2hhcmFjdGVyaXN0aWNzGAMgAygJEhIKBndpbmRvdxgEIAEoCUICGAESCwoDbWF4GAUgASgNEg8KB3RpbWVvdXQYBiABKAkSPAoJYWxnb3JpdGhtGAcgASgOMikucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJhdGVMaW1pdEFsZ29yaXRobRITCgtyZWZpbGxfcmF0ZRgIIAEoDRIQCghpbnRlcnZhbBgJIAEoDRIQCghjYXBhY2l0eRgKIAEoDRIZChF3aW5kb3dfaW5fc2Vjb25kcxgMIAEoDRI8Cgd2ZXJzaW9uGA0gASgOMisucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJhdGVMaW1pdFJ1bGVWZXJzaW9uSgQICxAMUglyZXF1ZXN0ZWQixgIKB0JvdFJ1bGUSKQoEbW9kZRgBIAEoDjIbLnByb3RvLmRlY2lkZS52MWFscGhhMS5Nb2RlEi0KBWJsb2NrGAIgAygOMh4ucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFR5cGUSOQoIcGF0dGVybnMYAyABKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90UnVsZS5QYXR0ZXJucxqlAQoIUGF0dGVybnMSPQoDYWRkGAEgAygLMjAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFJ1bGUuUGF0dGVybnMuQWRkRW50cnkSDgoGcmVtb3ZlGAIgAygJGkoKCEFkZEVudHJ5EgsKA2tleRgBIAEoCRItCgV2YWx1ZRgCIAEoDjIeLnByb3RvLmRlY2lkZS52MWFscGhhMS5Cb3RUeXBlOgI4ASKNAQoJQm90VjJSdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRINCgVhbGxvdxgCIAMoCRIMCgRkZW55GAMgAygJEjgKB3ZlcnNpb24YBCABKA4yJy5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90VjJSdWxlVmVyc2lvbiLGAgoJRW1haWxSdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRIzCgVibG9jaxgCIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGVCAhgBEiAKGHJlcXVpcmVfdG9wX2xldmVsX2RvbWFpbhgDIAEoCBIcChRhbGxvd19kb21haW5fbGl0ZXJhbBgEIAEoCBIvCgVhbGxvdxgFIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUSLgoEZGVueRgGIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUSOAoHdmVyc2lvbhgHIAEoDjInLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFJ1bGVWZXJzaW9uIp0BChFTZW5zaXRpdmVJbmZvUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFYWxsb3cYAiADKAkSDAoEZGVueRgDIAMoCRJACgd2ZXJzaW9uGAQgASgOMi8ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlNlbnNpdGl2ZUluZm9SdWxlVmVyc2lvbiKfAQoKU2hpZWxkUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSEgoKYXV0b19hZGRlZBgCIAEoCBIXCg9jaGFyYWN0ZXJpc3RpY3MYAyADKAkSOQoHdmVyc2lvbhgEIAEoDjIoLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSdWxlVmVyc2lvbiKPAQoKRmlsdGVyUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFYWxsb3cYAiADKAkSDAoEZGVueRgDIAMoCRI5Cgd2ZXJzaW9uGAQgASgOMigucHJvdG8uZGVjaWRlLnYxYWxwaGExLkZpbHRlclJ1bGVWZXJzaW9uIsABChxQcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRIaCgl0aHJlc2hvbGQYAiABKAFCAhgBSACIAQESSwoHdmVyc2lvbhgDIAEoDjI6LnByb3RvLmRlY2lkZS52MWFscGhhMS5Qcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlVmVyc2lvbkIMCgpfdGhyZXNob2xkIuoDCgRSdWxlEjoKCnJhdGVfbGltaXQYASABKAsyJC5wcm90by5kZWNpZGUudjFhbHBoYTEuUmF0ZUxpbWl0UnVsZUgAEi4KBGJvdHMYAiABKAsyHi5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90UnVsZUgAEjEKBWVtYWlsGAMgASgLMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkVtYWlsUnVsZUgAEjMKBnNoaWVsZBgEIAEoCzIhLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSdWxlSAASQgoOc2Vuc2l0aXZlX2luZm8YBSABKAsyKC5wcm90by5kZWNpZGUudjFhbHBoYTEuU2Vuc2l0aXZlSW5mb1J1bGVIABIyCgZib3RfdjIYBiABKAsyIC5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90VjJSdWxlSAASMwoGZmlsdGVyGAcgASgLMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkZpbHRlclJ1bGVIABJZChpwcm9tcHRfaW5qZWN0aW9uX2RldGVjdGlvbhgIIAEoCzIzLnByb3RvLmRlY2lkZS52MWFscGhhMS5Qcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlSABCBgoEcnVsZSLWAQoKUnVsZVJlc3VsdBIPCgdydWxlX2lkGAEgASgJEi8KBXN0YXRlGAIgASgOMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJ1bGVTdGF0ZRI1Cgpjb25jbHVzaW9uGAMgASgOMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkNvbmNsdXNpb24SLQoGcmVhc29uGAQgASgLMh0ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJlYXNvbhILCgN0dGwYBSABKA0SEwoLZmluZ2VycHJpbnQYBiABKAkikwMKDlJlcXVlc3REZXRhaWxzEgoKAmlwGAEgASgJEg4KBm1ldGhvZBgCIAEoCRIQCghwcm90b2NvbBgDIAEoCRIMCgRob3N0GAQgASgJEgwKBHBhdGgYBSABKAkSQwoHaGVhZGVycxgGIAMoCzIyLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscy5IZWFkZXJzRW50cnkSDAoEYm9keRgHIAEoDBI/CgVleHRyYRgIIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscy5FeHRyYUVudHJ5Eg0KBWVtYWlsGAkgASgJEg8KB2Nvb2tpZXMYCiABKAkSDQoFcXVlcnkYCyABKAkSFgoOY29ycmVsYXRpb25faWQYDCABKAkaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaLAoKRXh0cmFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIvgBCghEZWNpc2lvbhIKCgJpZBgBIAEoCRI1Cgpjb25jbHVzaW9uGAIgASgOMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkNvbmNsdXNpb24SLQoGcmVhc29uGAMgASgLMh0ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJlYXNvbhI3CgxydWxlX3Jlc3VsdHMYBCADKAsyIS5wcm90by5kZWNpZGUudjFhbHBoYTEuUnVsZVJlc3VsdBILCgN0dGwYBSABKA0SNAoKaXBfZGV0YWlscxgGIAEoCzIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5JcERldGFpbHMi6AEKDURlY2lkZVJlcXVlc3QSMgoJc2RrX3N0YWNrGAEgASgOMh8ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlNES1N0YWNrEhMKC3Nka192ZXJzaW9uGAIgASgJEjYKB2RldGFpbHMYBCABKAsyJS5wcm90by5kZWNpZGUudjFhbHBoYTEuUmVxdWVzdERldGFpbHMSKgoFcnVsZXMYBSADKAsyGy5wcm90by5kZWNpZGUudjFhbHBoYTEuUnVsZRIXCg9jaGFyYWN0ZXJpc3RpY3MYBiADKAlKBAgDEARSC2ZpbmdlcnByaW50IrIBCg5EZWNpZGVSZXNwb25zZRIxCghkZWNpc2lvbhgBIAEoCzIfLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpc2lvbhI/CgVleHRyYRgCIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpZGVSZXNwb25zZS5FeHRyYUVudHJ5GiwKCkV4dHJhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASKuAgoNUmVwb3J0UmVxdWVzdBIyCglzZGtfc3RhY2sYASABKA4yHy5wcm90by5kZWNpZGUudjFhbHBoYTEuU0RLU3RhY2sSEwoLc2RrX3ZlcnNpb24YAiABKAkSNgoHZGV0YWlscxgEIAEoCzIlLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscxIxCghkZWNpc2lvbhgFIAEoCzIfLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpc2lvbhIqCgVydWxlcxgGIAMoCzIbLnByb3RvLmRlY2lkZS52MWFscGhhMS5SdWxlEhcKD2NoYXJhY3RlcmlzdGljcxgIIAMoCUoECAMQBEoECAcQCFILZmluZ2VycHJpbnRSC3JlY2VpdmVkX2F0Io8BCg5SZXBvcnRSZXNwb25zZRI/CgVleHRyYRgCIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXBvcnRSZXNwb25zZS5FeHRyYUVudHJ5GiwKCkV4dHJhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUoECAEQAlIIZGVjaXNpb24qrwEKB0JvdFR5cGUSGAoUQk9UX1RZUEVfVU5TUEVDSUZJRUQQABIZChVCT1RfVFlQRV9OT1RfQU5BTFlaRUQQARIWChJCT1RfVFlQRV9BVVRPTUFURUQQAhIdChlCT1RfVFlQRV9MSUtFTFlfQVVUT01BVEVEEAMSHQoZQk9UX1RZUEVfTElLRUxZX05PVF9BX0JPVBAEEhkKFUJPVF9UWVBFX1ZFUklGSUVEX0JPVBAFKqkBCglFbWFpbFR5cGUSGgoWRU1BSUxfVFlQRV9VTlNQRUNJRklFRBAAEhkKFUVNQUlMX1RZUEVfRElTUE9TQUJMRRABEhMKD0VNQUlMX1RZUEVfRlJFRRACEhwKGEVNQUlMX1RZUEVfTk9fTVhfUkVDT1JEUxADEhoKFkVNQUlMX1RZUEVfTk9fR1JBVkFUQVIQBBIWChJFTUFJTF9UWVBFX0lOVkFMSUQQBSo9CgRNb2RlEhQKEE1PREVfVU5TUEVDSUZJRUQQABIQCgxNT0RFX0RSWV9SVU4QARINCglNT0RFX0xJVkUQAiqCAQoJUnVsZVN0YXRlEhoKFlJVTEVfU1RBVEVfVU5TUEVDSUZJRUQQABISCg5SVUxFX1NUQVRFX1JVThABEhYKElJVTEVfU1RBVEVfTk9UX1JVThACEhYKElJVTEVfU1RBVEVfRFJZX1JVThADEhUKEVJVTEVfU1RBVEVfQ0FDSEVEEAQqgwEKCkNvbmNsdXNpb24SGgoWQ09OQ0xVU0lPTl9VTlNQRUNJRklFRBAAEhQKEENPTkNMVVNJT05fQUxMT1cQARITCg9DT05DTFVTSU9OX0RFTlkQAhIYChRDT05DTFVTSU9OX0NIQUxMRU5HRRADEhQKEENPTkNMVVNJT05fRVJST1IQBCrqAgoIU0RLU3RhY2sSGQoVU0RLX1NUQUNLX1VOU1BFQ0lGSUVEEAASFAoQU0RLX1NUQUNLX05PREVKUxABEhQKEFNES19TVEFDS19ORVhUSlMQAhIUChBTREtfU1RBQ0tfUFlUSE9OEAMSFAoQU0RLX1NUQUNLX0RKQU5HTxAEEhEKDVNES19TVEFDS19CVU4QBRISCg5TREtfU1RBQ0tfREVOTxAGEhcKE1NES19TVEFDS19TVkVMVEVLSVQQBxISCg5TREtfU1RBQ0tfSE9OTxAIEhIKDlNES19TVEFDS19OVVhUEAkSFAoQU0RLX1NUQUNLX05FU1RKUxAKEhMKD1NES19TVEFDS19SRU1JWBALEhMKD1NES19TVEFDS19BU1RSTxAMEhUKEVNES19TVEFDS19GQVNUSUZZEA0SGgoWU0RLX1NUQUNLX1JFQUNUX1JPVVRFUhAOEhAKDFNES19TVEFDS19HTxAPKrEBChJSYXRlTGltaXRBbGdvcml0aG0SJAogUkFURV9MSU1JVF9BTEdPUklUSE1fVU5TUEVDSUZJRUQQABIlCiFSQVRFX0xJTUlUX0FMR09SSVRITV9UT0tFTl9CVUNLRVQQARIlCiFSQVRFX0xJTUlUX0FMR09SSVRITV9GSVhFRF9XSU5ET1cQAhInCiNSQVRFX0xJTUlUX0FMR09SSVRITV9TTElESU5HX1dJTkRPVxADKj8KFFJhdGVMaW1pdFJ1bGVWZXJzaW9uEicKI1JBVEVfTElNSVRfUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqNwoQQm90VjJSdWxlVmVyc2lvbhIjCh9CT1RfVjJfUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqNgoQRW1haWxSdWxlVmVyc2lvbhIiCh5FTUFJTF9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQACpHChhTZW5zaXRpdmVJbmZvUnVsZVZlcnNpb24SKwonU0VOU0lUSVZFX0lORk9fUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqOAoRU2hpZWxkUnVsZVZlcnNpb24SIwofU0hJRUxEX1JVTEVfVkVSU0lPTl9VTlNQRUNJRklFRBAAKjgKEUZpbHRlclJ1bGVWZXJzaW9uEiMKH0ZJTFRFUl9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQACpeCiNQcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlVmVyc2lvbhI3CjNQUk9NUFRfSU5KRUNUSU9OX0RFVEVDVElPTl9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQADK9AQoNRGVjaWRlU2VydmljZRJVCgZEZWNpZGUSJC5wcm90by5kZWNpZGUudjFhbHBoYTEuRGVjaWRlUmVxdWVzdBolLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpZGVSZXNwb25zZRJVCgZSZXBvcnQSJC5wcm90by5kZWNpZGUudjFhbHBoYTEuUmVwb3J0UmVxdWVzdBolLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXBvcnRSZXNwb25zZULKAQoZY29tLnByb3RvLmRlY2lkZS52MWFscGhhMUILRGVjaWRlUHJvdG9QAVoqYXJjamV0L2dlbi9nby9kZWNpZGUvYWxwaGExO2RlY2lkZXYxYWxwaGExogIDUERYqgIVUHJvdG8uRGVjaWRlLlYxYWxwaGExygIVUHJvdG9cRGVjaWRlXFYxYWxwaGEx4gIhUHJvdG9cRGVjaWRlXFYxYWxwaGExXEdQQk1ldGFkYXRh6gIXUHJvdG86OkRlY2lkZTo6VjFhbHBoYTFiBnByb3RvMw", [file_google_protobuf_timestamp]); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IpDetails. | ||
| * Use `create(IpDetailsSchema)` to create a new message. | ||
| */ | ||
| export const IpDetailsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 0); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Reason. | ||
| * Use `create(ReasonSchema)` to create a new message. | ||
| */ | ||
| export const ReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 1); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitReason. | ||
| * Use `create(RateLimitReasonSchema)` to create a new message. | ||
| */ | ||
| export const RateLimitReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 2); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EdgeRuleReason. | ||
| * Use `create(EdgeRuleReasonSchema)` to create a new message. | ||
| * @deprecated | ||
| */ | ||
| export const EdgeRuleReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 3); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotReason. | ||
| * Use `create(BotReasonSchema)` to create a new message. | ||
| */ | ||
| export const BotReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 4); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Reason. | ||
| * Use `create(BotV2ReasonSchema)` to create a new message. | ||
| */ | ||
| export const BotV2ReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 5); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldReason. | ||
| * Use `create(ShieldReasonSchema)` to create a new message. | ||
| */ | ||
| export const ShieldReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 6); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterReason. | ||
| * Use `create(FilterReasonSchema)` to create a new message. | ||
| */ | ||
| export const FilterReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 7); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailReason. | ||
| * Use `create(EmailReasonSchema)` to create a new message. | ||
| */ | ||
| export const EmailReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 8); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ErrorReason. | ||
| * Use `create(ErrorReasonSchema)` to create a new message. | ||
| */ | ||
| export const ErrorReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 9); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionReason. | ||
| * Use `create(PromptInjectionReasonSchema)` to create a new message. | ||
| */ | ||
| export const PromptInjectionReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 10); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IdentifiedEntity. | ||
| * Use `create(IdentifiedEntitySchema)` to create a new message. | ||
| */ | ||
| export const IdentifiedEntitySchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 11); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoReason. | ||
| * Use `create(SensitiveInfoReasonSchema)` to create a new message. | ||
| */ | ||
| export const SensitiveInfoReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 12); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitRule. | ||
| * Use `create(RateLimitRuleSchema)` to create a new message. | ||
| */ | ||
| export const RateLimitRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 13); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule. | ||
| * Use `create(BotRuleSchema)` to create a new message. | ||
| */ | ||
| export const BotRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 14); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule.Patterns. | ||
| * Use `create(BotRule_PatternsSchema)` to create a new message. | ||
| */ | ||
| export const BotRule_PatternsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 14, 0); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Rule. | ||
| * Use `create(BotV2RuleSchema)` to create a new message. | ||
| */ | ||
| export const BotV2RuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 15); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailRule. | ||
| * Use `create(EmailRuleSchema)` to create a new message. | ||
| */ | ||
| export const EmailRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 16); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoRule. | ||
| * Use `create(SensitiveInfoRuleSchema)` to create a new message. | ||
| */ | ||
| export const SensitiveInfoRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 17); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldRule. | ||
| * Use `create(ShieldRuleSchema)` to create a new message. | ||
| */ | ||
| export const ShieldRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 18); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterRule. | ||
| * Use `create(FilterRuleSchema)` to create a new message. | ||
| */ | ||
| export const FilterRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 19); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionDetectionRule. | ||
| * Use `create(PromptInjectionDetectionRuleSchema)` to create a new message. | ||
| */ | ||
| export const PromptInjectionDetectionRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 20); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Rule. | ||
| * Use `create(RuleSchema)` to create a new message. | ||
| */ | ||
| export const RuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 21); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RuleResult. | ||
| * Use `create(RuleResultSchema)` to create a new message. | ||
| */ | ||
| export const RuleResultSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 22); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RequestDetails. | ||
| * Use `create(RequestDetailsSchema)` to create a new message. | ||
| */ | ||
| export const RequestDetailsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 23); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Decision. | ||
| * Use `create(DecisionSchema)` to create a new message. | ||
| */ | ||
| export const DecisionSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 24); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideRequest. | ||
| * Use `create(DecideRequestSchema)` to create a new message. | ||
| */ | ||
| export const DecideRequestSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 25); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideResponse. | ||
| * Use `create(DecideResponseSchema)` to create a new message. | ||
| */ | ||
| export const DecideResponseSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 26); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportRequest. | ||
| * Use `create(ReportRequestSchema)` to create a new message. | ||
| */ | ||
| export const ReportRequestSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 27); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportResponse. | ||
| * Use `create(ReportResponseSchema)` to create a new message. | ||
| */ | ||
| export const ReportResponseSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 28); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotType. | ||
| */ | ||
| export const BotTypeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 0); | ||
| /** | ||
| * Represents whether we think the client is a bot or not. This should be used | ||
| * alongside the bot score which represents the level of certainty of our | ||
| * detection. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.BotType | ||
| */ | ||
| export const BotType = /*@__PURE__*/ | ||
| tsEnum(BotTypeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailType. | ||
| */ | ||
| export const EmailTypeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 1); | ||
| /** | ||
| * Represents the type of email address submitted. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.EmailType | ||
| */ | ||
| export const EmailType = /*@__PURE__*/ | ||
| tsEnum(EmailTypeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Mode. | ||
| */ | ||
| export const ModeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 2); | ||
| /** | ||
| * The mode to run in. This can be either `DRY_RUN` or `LIVE`. In `DRY_RUN` | ||
| * mode, all requests will be allowed and you can review what the action would | ||
| * have been from the Arcjet Console. In `LIVE` mode, requests will be allowed, | ||
| * challenged or blocked based on the returned decision. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Mode | ||
| */ | ||
| export const Mode = /*@__PURE__*/ | ||
| tsEnum(ModeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RuleState. | ||
| */ | ||
| export const RuleStateSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 3); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RuleState | ||
| */ | ||
| export const RuleState = /*@__PURE__*/ | ||
| tsEnum(RuleStateSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Conclusion. | ||
| */ | ||
| export const ConclusionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 4); | ||
| /** | ||
| * The conclusion for the request based on the Arcjet analysis and any specific | ||
| * configuration. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Conclusion | ||
| */ | ||
| export const Conclusion = /*@__PURE__*/ | ||
| tsEnum(ConclusionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SDKStack. | ||
| */ | ||
| export const SDKStackSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 5); | ||
| /** | ||
| * The SDK used to make the request. Used for analytics and to help us improve. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.SDKStack | ||
| */ | ||
| export const SDKStack = /*@__PURE__*/ | ||
| tsEnum(SDKStackSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitAlgorithm. | ||
| */ | ||
| export const RateLimitAlgorithmSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 6); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm | ||
| */ | ||
| export const RateLimitAlgorithm = /*@__PURE__*/ | ||
| tsEnum(RateLimitAlgorithmSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitRuleVersion. | ||
| */ | ||
| export const RateLimitRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 7); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitRuleVersion | ||
| */ | ||
| export const RateLimitRuleVersion = /*@__PURE__*/ | ||
| tsEnum(RateLimitRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotV2RuleVersion. | ||
| */ | ||
| export const BotV2RuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 8); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.BotV2RuleVersion | ||
| */ | ||
| export const BotV2RuleVersion = /*@__PURE__*/ | ||
| tsEnum(BotV2RuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailRuleVersion. | ||
| */ | ||
| export const EmailRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 9); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.EmailRuleVersion | ||
| */ | ||
| export const EmailRuleVersion = /*@__PURE__*/ | ||
| tsEnum(EmailRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SensitiveInfoRuleVersion. | ||
| */ | ||
| export const SensitiveInfoRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 10); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.SensitiveInfoRuleVersion | ||
| */ | ||
| export const SensitiveInfoRuleVersion = /*@__PURE__*/ | ||
| tsEnum(SensitiveInfoRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.ShieldRuleVersion. | ||
| */ | ||
| export const ShieldRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 11); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.ShieldRuleVersion | ||
| */ | ||
| export const ShieldRuleVersion = /*@__PURE__*/ | ||
| tsEnum(ShieldRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.FilterRuleVersion. | ||
| */ | ||
| export const FilterRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 12); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.FilterRuleVersion | ||
| */ | ||
| export const FilterRuleVersion = /*@__PURE__*/ | ||
| tsEnum(FilterRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion. | ||
| */ | ||
| export const PromptInjectionDetectionRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 13); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion | ||
| */ | ||
| export const PromptInjectionDetectionRuleVersion = /*@__PURE__*/ | ||
| tsEnum(PromptInjectionDetectionRuleVersionSchema); | ||
| /** | ||
| * @generated from service proto.decide.v1alpha1.DecideService | ||
| */ | ||
| export const DecideService = /*@__PURE__*/ | ||
| serviceDesc(file_proto_decide_v1alpha1_decide, 0); | ||
| //#region src/typeid.d.ts | ||
| /** | ||
| * Minimal, dependency-free TypeID generator for local request IDs. | ||
| * | ||
| * Replaces the external `typeid-js` package (and its transitive `uuid` | ||
| * dependency) with an inline implementation. We only ever mint new IDs with a | ||
| * fixed prefix, so this covers generation — not parsing or decoding. | ||
| * | ||
| * The suffix is the 26-character Crockford base32 encoding of a UUIDv7 | ||
| * (RFC 9562), matching the TypeID specification | ||
| * (https://github.com/jetify-com/typeid). Mirrors the vendored implementation | ||
| * in the Arcjet Python SDK so both SDKs produce identical IDs. | ||
| */ | ||
| /** Crockford base32 alphabet (lowercase, excludes `i`, `l`, `o`, `u`). */ | ||
| declare const CROCKFORD_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz"; | ||
| /** | ||
| * Generate the 16 raw bytes of a UUIDv7 (RFC 9562): a 48-bit big-endian | ||
| * millisecond timestamp, version `7`, the RFC 4122 variant (`10`), and random | ||
| * bits filling the remainder. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing; production | ||
| * callers use the defaults. | ||
| * | ||
| * @throws {RangeError} | ||
| * If `nowMs` is not an integer in the 48-bit range `[0, 2 ** 48)`, or if | ||
| * `random` is not exactly 10 bytes. Both would otherwise silently produce a | ||
| * malformed ID (a wrapped timestamp or zero-filled entropy). | ||
| */ | ||
| declare function uuidV7Bytes(nowMs?: number, random?: Uint8Array): Uint8Array; | ||
| /** | ||
| * Generate a new TypeID string — `<prefix>_<suffix>`, where the suffix is the | ||
| * Crockford base32 encoding of a freshly generated UUIDv7. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing. | ||
| */ | ||
| declare function typeid(prefix: string, nowMs?: number, random?: Uint8Array): string; | ||
| //#endregion | ||
| export { CROCKFORD_ALPHABET, typeid, uuidV7Bytes }; |
| //#region src/typeid.ts | ||
| /** | ||
| * Minimal, dependency-free TypeID generator for local request IDs. | ||
| * | ||
| * Replaces the external `typeid-js` package (and its transitive `uuid` | ||
| * dependency) with an inline implementation. We only ever mint new IDs with a | ||
| * fixed prefix, so this covers generation — not parsing or decoding. | ||
| * | ||
| * The suffix is the 26-character Crockford base32 encoding of a UUIDv7 | ||
| * (RFC 9562), matching the TypeID specification | ||
| * (https://github.com/jetify-com/typeid). Mirrors the vendored implementation | ||
| * in the Arcjet Python SDK so both SDKs produce identical IDs. | ||
| */ | ||
| /** Crockford base32 alphabet (lowercase, excludes `i`, `l`, `o`, `u`). */ | ||
| const CROCKFORD_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz"; | ||
| /** Fill a 10-byte buffer from the platform CSPRNG (Web Crypto). */ | ||
| function randomBytes() { | ||
| return crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(10)); | ||
| } | ||
| /** | ||
| * Generate the 16 raw bytes of a UUIDv7 (RFC 9562): a 48-bit big-endian | ||
| * millisecond timestamp, version `7`, the RFC 4122 variant (`10`), and random | ||
| * bits filling the remainder. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing; production | ||
| * callers use the defaults. | ||
| * | ||
| * @throws {RangeError} | ||
| * If `nowMs` is not an integer in the 48-bit range `[0, 2 ** 48)`, or if | ||
| * `random` is not exactly 10 bytes. Both would otherwise silently produce a | ||
| * malformed ID (a wrapped timestamp or zero-filled entropy). | ||
| */ | ||
| function uuidV7Bytes(nowMs = Date.now(), random = randomBytes()) { | ||
| if (!Number.isInteger(nowMs) || nowMs < 0 || nowMs >= 2 ** 48) throw new RangeError(`uuidV7Bytes: \`nowMs\` must be an integer in [0, 2 ** 48), got ${nowMs}`); | ||
| if (random.length !== 10) throw new RangeError(`uuidV7Bytes: \`random\` must be exactly 10 bytes, got ${random.length}`); | ||
| const timestampMs = BigInt(nowMs); | ||
| const randA = BigInt(random[0] << 4 | random[1] >> 4); | ||
| let randBFull = 0n; | ||
| for (let i = 2; i < 10; i++) randBFull = randBFull << 8n | BigInt(random[i]); | ||
| const randB = randBFull & (1n << 62n) - 1n; | ||
| const hi = timestampMs << 16n | 7n << 12n | randA; | ||
| const lo = 2n << 62n | randB; | ||
| const bytes = /* @__PURE__ */ new Uint8Array(16); | ||
| const view = new DataView(bytes.buffer); | ||
| view.setBigUint64(0, hi, false); | ||
| view.setBigUint64(8, lo, false); | ||
| return bytes; | ||
| } | ||
| /** | ||
| * Encode 16 bytes as a 26-character Crockford base32 string. The bytes are read | ||
| * as a big-endian 128-bit integer, most-significant character first. 26 × 5 = | ||
| * 130 bits, so the leading character carries only the top 3 bits and is always | ||
| * `0`-`7`. | ||
| */ | ||
| function encodeCrockford(bytes) { | ||
| let n = 0n; | ||
| for (const byte of bytes) n = n << 8n | BigInt(byte); | ||
| const out = new Array(26); | ||
| for (let i = 25; i >= 0; i--) { | ||
| out[i] = CROCKFORD_ALPHABET[Number(n & 31n)]; | ||
| n >>= 5n; | ||
| } | ||
| return out.join(""); | ||
| } | ||
| /** | ||
| * Generate a new TypeID string — `<prefix>_<suffix>`, where the suffix is the | ||
| * Crockford base32 encoding of a freshly generated UUIDv7. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing. | ||
| */ | ||
| function typeid(prefix, nowMs, random) { | ||
| return `${prefix}_${encodeCrockford(uuidV7Bytes(nowMs, random))}`; | ||
| } | ||
| //#endregion | ||
| export { CROCKFORD_ALPHABET, typeid, uuidV7Bytes }; |
| //#region src/well-known-bots.d.ts | ||
| /** Automatically generated - DO NOT MANUALLY EDIT */ | ||
| /** Identifiers for all Well Known Bots that Arcjet can detect */ | ||
| type ArcjetWellKnownBot = "A6CORP_CRAWLER" | "ABOUNDEX_CRAWLER" | "ACADEMICBOT_RTU" | "ACAPBOT" | "ACOON_CRAWLER" | "ADAGIO_CRAWLER" | "ADBEAT_CRAWLER" | "ADDSEARCH_CRAWLER" | "ADDTHIS_CRAWLER" | "ADMANTX_CRAWLER" | "ADSCANNER_CRAWLER" | "ADSTXTCRAWLER" | "ADVBOT_CRAWLER" | "ADYEN_WEBHOOK" | "AGENTTESLA_BOTNET" | "AHREFS_CRAWLER" | "AHREFS_SITE_AUDIT" | "AI_SEARCH_BOT" | "AI2_CRAWLER" | "AI2_CRAWLER_DOLMA" | "AIHIT_CRAWLER" | "ALEXANDRIA_CRAWLER" | "ALGOLIA_CRAWLER" | "ALPHASEOBOT_CRAWLER" | "AMADEY_BOTNET" | "AMAZON_ADBOT" | "AMAZON_ALEXA_CRAWLER" | "AMAZON_CLOUDFRONT" | "AMAZON_CRAWLER" | "AMAZON_ROUTE53_HEALTH_CHECK" | "ANDERSPINK_CRAWLER" | "ANTHROPIC_CRAWLER" | "ANTIBOT" | "APERCITE_CRAWLER" | "APPLE_CRAWLER" | "APPLE_FEEDFETCHER" | "ARA_CRAWLER" | "ARATURKA_CRAWLER" | "ARCHIVEORG_ARCHIVER" | "AROCOM_CRAWLER" | "ASK_CRAWLER" | "ASPIEGEL_CRAWLER" | "AUDISTO_CRAWLER" | "AVIRA_CRAWLER" | "AWARIO_CRAWLER" | "AWARIO_CRAWLER_RSS" | "AWARIO_CRAWLER_SMART" | "AWESOMECRAWLER" | "AZURE_APP_INSIGHTS" | "B2BBOT" | "BACKLINKTEST_CRAWLER" | "BAIDU_CLOUD_WATCH" | "BAIDU_CRAWLER" | "BANKER_BOTNET" | "BAZQUX_FEEDFETCHER" | "BETABOT" | "BETTERSTACK_MONITOR" | "BETTERUPTIME_MONITOR" | "BIDSWITCH_CRAWLER" | "BIGDATACORP_CRAWLER" | "BIGLOTRON" | "BING_ADS" | "BING_CRAWLER" | "BING_OFFICE_STORE" | "BING_PREVIEW" | "BINLAR" | "BITLY_CRAWLER" | "BITSIGHT_CRAWLER" | "BLACK_BOTNET" | "BLACKBOARD_CRAWLER" | "BLOGMURA_CRAWLER" | "BLOGTRAFFIC_FEEDFETCHER" | "BLP_BBOT" | "BNF_CRAWLER" | "BOMBORA_CRAWLER" | "BOTIFY_CRAWLER" | "BOXCAR_CRAWLER" | "BRAINOBOT" | "BRANDONMEDIA_CRAWLER" | "BRANDVERITY_CRAWLER" | "BRANDWATCH_CRAWLER" | "BRIGHTEDGE_CRAWLER" | "BUBLUP_CRAWLER" | "BUILTWITH_CRAWLER" | "BUZZSTREAM_CRAWLER" | "BYOB_BOTNET" | "BYTEDANCE_CRAWLER" | "CAPSULINK_CRAWLER" | "CAREERX_CRAWLER" | "CCBOT_CRAWLER" | "CENSYS_INSPECT" | "CENTURYBOT" | "CHANGEDETECTION_CRAWLER" | "CHECKLY_MONITOR" | "CHECKMARKNETWORK_CRAWLER" | "CHLOOE_CRAWLER" | "CINCRAWDATA_CRAWLER" | "CISPA_CRAWLER" | "CITESEERX_CRAWLER" | "CLICKAGY_CRAWLER" | "CLIQZ_CRAWLER" | "CLOUDFLARE_ARCHIVER" | "CLOUDFLARE_HEALTHCHECKS" | "CLOUDFLARE_PREFETCH" | "CLOUDFLARE_SECURITY_CENTER" | "CLOUDFLARE_SSL_DETECTOR" | "CLOUDFLARE_TRAFFIC_MANAGER" | "CLOUDSYSTEMNETWORKS_CRAWLER" | "COCCOC_CRAWLER" | "COCOLYZE_CRAWLER" | "CODA_SERVER_FETCHER" | "CODEWISE_CRAWLER" | "COGNITIVESEO_CRAWLER" | "COHERE_CRAWLER" | "COMMONCRAWL_CRAWLER" | "COMPANYBOOK_CRAWLER" | "CONDUCTOR_CRAWLER" | "CONTENT_CRAWLER_SPIDER" | "CONTEXTAD_CRAWLER" | "CONTXBOT" | "CONVERA_CRAWLER" | "COOKIEBOT_CRAWLER" | "COOKIEHUB_SCAN" | "CREATIVECOMMONS_CRAWLER" | "CRITEO_CRAWLER" | "CRYSTALSEMANTICS_CRAWLER" | "CUREBOT_CRAWLER" | "CURL" | "CUTBOT_CRAWLER" | "CXENSE_CRAWLER" | "CYBERPATROL_CRAWLER" | "DAREBOOST_CRAWLER" | "DATADOG_MONITOR_SYNTHETICS" | "DATAFEEDWATCH_CRAWLER" | "DATAFORSEO_CRAWLER" | "DATAGNION_CRAWLER" | "DATANYZE_CRAWLER" | "DATAPROVIDER_CRAWLER" | "DATENBUTLER_CRAWLER" | "DAUM_CRAWLER" | "DCRAWL" | "DEADLINKCHECKER" | "DEEPNOC_CRAWLER" | "DEUSU_CRAWLER" | "DIFFBOT_CRAWLER" | "DIGG_CRAWLER" | "DIGINCORE_CRAWLER" | "DIGITALDRAGON_CRAWLER" | "DISCORD_CRAWLER" | "DISCOVERYENGINE_CRAWLER" | "DISQUS_CRAWLER" | "DNYZ_CRAWLER" | "DOMAINCRAWLER_CRAWLER" | "DOMAINREANIMATOR_CRAWLER" | "DOMAINSBOT_CRAWLER" | "DOMAINSPROJECT_CRAWLER" | "DOMAINSTATS_CRAWLER" | "DOMAINTOOLS_CRAWLER" | "DONUTMATE_BOTNET" | "DOTNETDOTCOM_CRAWLER" | "DRAGONMETRICS_CRAWLER" | "DRIFTNET_CRAWLER" | "DUBBOT_CRAWLER" | "DUCKDUCKGO_CRAWLER" | "DUCKDUCKGO_CRAWLER_FAVICONS" | "DUEDIL_CRAWLER" | "DYNATRACE_MONITOR" | "EC2LINKFINDER" | "EDISTER_CRAWLER" | "ELISABOT" | "EMBEDLY_CRAWLER" | "ENTIREWEB_CRAWLER" | "EPFL_CRAWLER" | "EPICTIONS_CRAWLER" | "ERIGHT_CRAWLER" | "EUROPARCHIVE_CRAWLER" | "EVENTURES_CRAWLER" | "EVENTURES_CRAWLER_BATCH" | "EVERYONESOCIAL_CRAWLER" | "EXENSA_CRAWLER" | "EXPERIBOT_CRAWLER" | "EXTLINKS_CRAWLER" | "EYEOTA_CRAWLER" | "EZID_CRAWLER" | "FACEBOOK_CATALOG" | "FACEBOOK_CRAWLER" | "FACEBOOK_SHARE_CRAWLER" | "FAST_CRAWLER" | "FAST_CRAWLER_ENTERPRISE" | "FEDORAPLANET_CRAWLER" | "FEEDAFEVER_CRAWLER" | "FEEDBIN_CRAWLER" | "FEEDLY_FEEDFETCHER" | "FEEDSPOT_FEEDFETCHER" | "FEMTOSEARCH_CRAWLER" | "FINDTHATFILE_CRAWLER" | "FLAMINGOSEARCH_CRAWLER" | "FLIPBOARD_PROXY" | "FLUFFY" | "FR_CRAWLER" | "FREEWEBMONITORING_MONITOR" | "FRESHRSS_FEEDFETCHER" | "FRESHWORKS_MONITOR" | "FRIENDLYCRAWLER" | "FUELBOT" | "FYREBOT" | "G00G1E_CRAWLER" | "G2READER_CRAWLER" | "G2WEBSERVICES_CRAWLER" | "GAFGYT_BOTNET" | "GARLIK_CRAWLER" | "GEEDO_CRAWLER" | "GEEDO_CRAWLER_PRODUCTS" | "GENIEO_CRAWLER" | "GIGABLAST_CRAWLER" | "GIGABLAST_CRAWLER_OSS" | "GINGER_CRAWLER" | "GLUTENFREEPLEASURE_CRAWLER" | "GNAM_GNAM_SPIDER" | "GNOWIT_CRAWLER" | "GO_HTTP" | "GOO_CRAWLER" | "GOOGLE_ADS_CONVERSIONS" | "GOOGLE_ADSBOT" | "GOOGLE_ADSBOT_MOBILE" | "GOOGLE_ADSENSE" | "GOOGLE_ADSENSE_GOOGLEBOT" | "GOOGLE_ADWORDS" | "GOOGLE_APPENGINE" | "GOOGLE_CERTIFICATES_BRIDGE" | "GOOGLE_CRAWLER" | "GOOGLE_CRAWLER_CLOUDVERTEX" | "GOOGLE_CRAWLER_IMAGE" | "GOOGLE_CRAWLER_MOBILE" | "GOOGLE_CRAWLER_NEWS" | "GOOGLE_CRAWLER_OTHER" | "GOOGLE_CRAWLER_SAFETY" | "GOOGLE_CRAWLER_STORE" | "GOOGLE_CRAWLER_VIDEO" | "GOOGLE_FAVICON" | "GOOGLE_FEEDFETCHER" | "GOOGLE_INSPECTION_TOOL" | "GOOGLE_LIGHTHOUSE" | "GOOGLE_PHYSICAL_WEB" | "GOOGLE_PREVIEW" | "GOOGLE_PUSH_NOTIFICATIONS" | "GOOGLE_READ_ALOUD" | "GOOGLE_SITE_VERIFICATION" | "GOOGLE_STRUCTURED_DATA_TESTING_TOOL" | "GOOGLE_WEB_SNIPPET" | "GOOGLE_XRAWLER" | "GOT" | "GOWIKI_CRAWLER" | "GRAPESHOT_CRAWLER" | "GROB_CRAWLER" | "GROUPHIGH_CRAWLER" | "GROUPME_CRAWLER" | "GRUB" | "GSLFBOT" | "GULOADER_BOTNET" | "GWENE_CRAWLER" | "HAJIME_BOTNET" | "HAOSOU_CRAWLER" | "HATENA_CRAWLER" | "HEADLESS_CHROME" | "HEADLINE_CRAWLER" | "HOYER_CRAWLER" | "HTTP_GET" | "HTTRACK" | "HUBSPOT_CRAWLER" | "HYDROZEN_MONITOR" | "HYPEFACTORS_CRAWLER" | "HYPESTAT_CRAWLER" | "HYSCORE_CRAWLER" | "IA_ARCHIVER" | "IASK_CRAWLER" | "IDEASANDCODE_CRAWLER" | "IFRAMELY_PREVIEW" | "IMAGESIFT_CRAWLER" | "IMESSAGE_PREVIEW" | "IMG2DATASET" | "INDEED_CRAWLER" | "INETDEX_CRAWLER" | "INFEGY_CRAWLER" | "INFOO_CRAWLER" | "INOREADER_AGGREGATOR" | "INTEGRALADS_CRAWLER" | "INTEGROMEDB_CRAWLER" | "INTELIUM_CRAWLER" | "INTERNETARCHIVE_CRAWLER_OSS" | "IONOS_CRAWLER" | "IP_WEB_CRAWLER" | "IPIP_CRAWLER" | "IRC_ARCHIVEBOT" | "ISKANIE_CRAWLER" | "ISS_CRAWLER" | "IT2MEDIA_CRAWLER" | "ITINFLUENTIALS_CRAWLER" | "JAMIEMBROWN_CRAWLER" | "JAVA_APACHE_HTTPCLIENT" | "JAVA_ASYNCHTTPCLIENT" | "JAVA_CRAWLER4J" | "JAVA_HTTPUNIT" | "JAVA_JERSEY" | "JAVA_JETTY" | "JAVA_OKHTTP" | "JAVA_SNACKTORY" | "JAVASCRIPT_AXIOS" | "JAVASCRIPT_NODE_FETCH" | "JAVASCRIPT_PHANTOM" | "JETSLIDE_CRAWLER" | "JOBBOERSE_CRAWLER" | "JOOBLE_CRAWLER" | "JUSPROG_CRAWLER" | "JYXO_CRAWLER" | "K7COMPUTING_CRAWLER" | "KEMVI_CRAWLER" | "KEYBASE_BOT" | "KINSING_BOTNET" | "KOMODIA_CRAWLER" | "KOSMIO_CRAWLER" | "KUMA_MONITOR" | "L9EXPLORE" | "LANDAUMEDIA_CRAWLER" | "LASERLIKE_CRAWLER" | "LAW_UNIMI_CRAWLER" | "LB_SPIDER" | "LEADCRUNCH_CRAWLER" | "LEIKI_CRAWLER" | "LEIPZIG_FINDLINKS" | "LEIPZIG_LCC" | "LEMMY_CRAWLER" | "LIGHTSPEEDSYSTEMS_CRAWLER" | "LINE_CRAWLER" | "LINGUEE_CRAWLER" | "LINKAPEDIA_CRAWLER" | "LINKARCHIVER" | "LINKDEX_CRAWLER" | "LINKEDIN_CRAWLER" | "LINKFLUENCE_CRAWLER" | "LINKIS_CRAWLER" | "LIPPERHEY_CRAWLER" | "LIVELAP_CRAWLER" | "LOGLY_CRAWLER" | "LOOP_CRAWLER" | "LSSBOT" | "LSSBOT_ROCKET" | "LTX71_CRAWLER" | "LUMINATOR_CRAWLER" | "MACOCU_CRAWLER" | "MAILRU_CRAWLER" | "MAJESTIC_CRAWLER" | "MAPPYDATA_CRAWLER" | "MARGINALIA_CRAWLER" | "MASTODON_CRAWLER" | "MAUIBOT" | "MEDIATOOLKIT_CRAWLER" | "MEGAINDEX_CRAWLER" | "MELTWATER_CRAWLER" | "META_CRAWLER" | "META_CRAWLER_USER" | "META_EXTERNALADS" | "METADATALABS_CRAWLER" | "METAJOB_CRAWLER" | "METAURI_CRAWLER" | "METRICSTOOLS_CRAWLER" | "MICROSOFT_PREVIEW" | "MICROSOFT_RESEARCH_CRAWLER" | "MIGNIFY_CRAWLER" | "MIGNIFY_IMRBOT" | "MINIFLUX_FEEDFETCHER" | "MIRAI_BOTNET" | "MIXNODE_CACHE" | "MOAT_CRAWLER" | "MOJEEK_CRAWLER" | "MONITORBACKLINKS_CRAWLER" | "MONSIDO_CRAWLER" | "MOOBOT_BOTNET" | "MOODLE_CRAWLER" | "MOREOVER_CRAWLER" | "MOZ_CRAWLER" | "MOZ_SITE_AUDIT" | "MOZI_BOTNET" | "MSN_CRAWLER" | "MUCKRACK_CRAWLER" | "MULTIVIEWBOT" | "NAGIOS_CHECK_HTTP" | "NAVER_CRAWLER" | "NAVER_CRAWLER_RSS" | "NEEVA_CRAWLER" | "NERDBYNATURE_CRAWLER" | "NERDYBOT_CRAWLER" | "NETCRAFT_CRAWLER" | "NETESTATE_CRAWLER" | "NETICLE_CRAWLER" | "NETSYSTEMSRESEARCH_CRAWLER" | "NETVIBES_CRAWLER" | "NEWRELIC_MONITOR" | "NEWSBLUR_AGGREGATOR" | "NEWSHARECOUNTS_CRAWLER" | "NEWSPAPER" | "NEXTCLOUD_CRAWLER" | "NICECRAWLER_ARCHIVE" | "NICT_CRAWLER" | "NIKI_BOT" | "NING_CRAWLER" | "NINJABOT" | "NIXSTATS_CRAWLER" | "NMAP" | "NTENT_CRAWLER" | "NUTCH" | "NUZZEL_CRAWLER" | "OCARINABOT" | "OKRU_CRAWLER" | "OMGILI_CRAWLER" | "ONCRAWL" | "OPENAI_CRAWLER" | "OPENAI_CRAWLER_SEARCH" | "OPENAI_CRAWLER_USER" | "OPENGRAPHCHECK_CRAWLER" | "OPENHOSE_CRAWLER" | "OPENINDEX_CRAWLER" | "ORANGE_CRAWLER" | "ORANGE_FTGROUP_CRAWLER" | "OUTBRAIN_LINK_CHECKER" | "OUTCLICKS_CRAWLER" | "PAGE_TO_RSS" | "PAGEPEEKER_CRAWLER" | "PAGETHING_CRAWLER" | "PALOALTONETWORKS_CRAWLER" | "PANSCIENT_CRAWLER" | "PAPERLI_CRAWLER" | "PERL_LIBWWW" | "PERL_PCORE" | "PERPLEXITY_CRAWLER" | "PERPLEXITY_USER" | "PETALSEARCH_CRAWLER" | "PHP_CURLCLASS" | "PHP_PHPCRAWL" | "PHP_SIMPLE_SCRAPER" | "PHP_SIMPLEPIE" | "PHXBOT" | "PICSEARCH_CRAWLER" | "PINGDOM_CRAWLER" | "PINTEREST_CRAWLER" | "PINTREST_CRAWLER" | "PIPL_CRAWLER" | "POCKET_CRAWLER" | "POSTMAN" | "POSTRANK_CRAWLER" | "PRCY_CRAWLER" | "PRIMAL_CRAWLER" | "PRIVACORE_CRAWLER" | "PRIVACYAWARE_CRAWLER" | "PROFOUND_CRAWLER" | "PROXIMIC_CRAWLER" | "PULSEPOINT_CRAWLER" | "PURE_CRAWLER" | "PYTHON_AIOHTTP" | "PYTHON_BITBOT" | "PYTHON_HTTPX" | "PYTHON_OPENGRAPH" | "PYTHON_REQUESTS" | "PYTHON_SCRAPY" | "PYTHON_URLLIB" | "QUANTCAST_CRAWLER" | "QWANT_CRAWLER" | "RANKACTIVE_CRAWLER" | "REDDIT_CRAWLER" | "REFIND_CRAWLER" | "REMCOSRAT_BOTNET" | "RETREVO_PAGE_ANALYZER" | "RIDDER_CRAWLER" | "RIVVA_CRAWLER" | "RSSBOT_FEEDFETCHER" | "RSSING_CRAWLER" | "RSSMICRO_FEEDFETCHER" | "RUBY_METAINSPECTOR" | "RYTE_CRAWLER" | "SAFEDNS_CRAWLER" | "SBINTUITIONS_BOT" | "SCAN_INTERFAX_CRAWLER" | "SCHMORP_CRAWLER" | "SCOUTJET_CRAWLER" | "SCREAMINGFROG_CRAWLER" | "SCRIBD_CRAWLER" | "SCRITCH_CRAWLER" | "SEARCHATLAS_CRAWLER" | "SEEKBOT_CRAWLER" | "SEEKPORT_CRAWLER" | "SEEWITHKIDS_CRAWLER" | "SEMANTICAUDIENCE_CRAWLER" | "SEMANTICSCHOLAR_CRAWLER" | "SEMPITECH_CRAWLER" | "SEMRUSH_CRAWLER" | "SENTIONE_CRAWLER" | "SENTRY_CRAWLER" | "SENTRY_UPTIME_MONITOR" | "SENUTO_CRAWLER" | "SEOBILITY_CRAWLER" | "SEOKICKS_CRAWLER" | "SEOLIZER_CRAWLER" | "SEOPROFILER_CRAWLER" | "SEOSCANNERS_CRAWLER" | "SEOSTAR_CRAWLER" | "SEOZOOM_CRAWLER" | "SERENDEPUTY_CRAWLER" | "SERPSTATBOT_CRAWLER" | "SEZNAM_CRAWLER" | "SIMILARTECH_CRAWLER" | "SIMPLE_CRAWLER" | "SISTRIX_007AC9_CRAWLER" | "SISTRIX_CRAWLER" | "SITEBOT_CRAWLER" | "SITEBULB" | "SITECHECKER_CRAWLER" | "SITEEXPLORER_CRAWLER" | "SITEIMPROVE_CRAWLER" | "SKYPE_PREVIEW" | "SLACK_CRAWLER" | "SLACK_IMAGE_PROXY" | "SNAP_PREVIEW" | "SOCIALRANK_CRAWLER" | "SOFTBYTELABS_CRAWLER" | "SOGOU_CRAWLER" | "STARTME_CRAWLER" | "STATUSCAKE_MONITOR" | "STEALC_BOTNET" | "STEAM_PREVIEW" | "STORYGIZE_CRAWLER" | "STRACT_CRAWLER" | "STRIPE_CRAWLER" | "STRIPE_WEBHOOK" | "STUTTGART_CRAWLER" | "SUMMALY_CRAWLER" | "SUMMIFY_CRAWLER" | "SUPERFEEDR_CRAWLER" | "SURLY_CRAWLER" | "SWIMGBOT" | "SYNAPSE_CRAWLER" | "SYSOMOS_CRAWLER" | "T3VERSIONS_CRAWLER" | "TABOOLA_CRAWLER" | "TAGOO_CRAWLER" | "TANGIBLEE_CRAWLER" | "TELEGRAM_CRAWLER" | "TESTOMATO_CRAWLER" | "THEOLDREADER_CRAWLER" | "THINKLAB_CRAWLER" | "TIGER_CRAWLER" | "TIKTOK_CRAWLER" | "TIMPI_CRAWLER" | "TINEYE_CRAWLER" | "TISCALI_CRAWLER" | "TOMBASCRAPER_CRAWLER" | "TOPLIST_CRAWLER" | "TORUS_CRAWLER" | "TOUTIAO_CRAWLER" | "TRAACKR_CRAWLER" | "TRACEMYFILE_CRAWLER" | "TRENDICTION_CRAWLER" | "TRENDSMAP_CRAWLER" | "TROVE_CRAWLER" | "TROVIT_CRAWLER" | "TTRSS_FEEDFETCHER" | "TURNITIN_CRAWLER" | "TWEETEDTIMES_CRAWLER" | "TWEETMEMEBOT" | "TWENGA_CRAWLER" | "TWINGLY_CRAWLER" | "TWITTER_CRAWLER" | "TWOIP_CRAWLER" | "TWOIP_CRAWLER_CMS" | "TWURLY_CRAWLER" | "UBERMETRICS_CRAWLER" | "UBT_CRAWLER" | "UPFLOW_CRAWLER" | "UPTIME_MONITOR" | "UPTIMEBOT_MONITOR" | "UPTIMEROBOT_MONITOR" | "URLCLASSIFICATION_CRAWLER" | "USINE_NOUVELLE_CRAWLER" | "UTEXAS_CRAWLER" | "UTORRENT_CRAWLER" | "VEBIDOO_CRAWLER" | "VELEN_CRAWLER" | "VEOOZ_CRAWLER" | "VERCEL_CRAWLER" | "VERCEL_MONITOR_PREVIEW" | "VERISIGN_IPS_AGENT" | "VIBER_CRAWLER" | "VIGIL_CRAWLER" | "VIPNYTT_CRAWLER" | "VIRUSTOTAL_CRAWLER" | "VKROBOT_CRAWLER" | "VKSHARE_CRAWLER" | "VUHUV_CRAWLER" | "W3C_VALIDATOR_CSS" | "W3C_VALIDATOR_FEED" | "W3C_VALIDATOR_HTML" | "W3C_VALIDATOR_HTML_NU" | "W3C_VALIDATOR_I18N" | "W3C_VALIDATOR_LINKS" | "W3C_VALIDATOR_MOBILE" | "W3C_VALIDATOR_UNIFIED" | "WAREBAY_CRAWLER" | "WEBARCHIVE_CRAWLER" | "WEBCEO_CRAWLER" | "WEBCOMPANY_CRAWLER" | "WEBDATASTATS_CRAWLER" | "WEBEAVER_CRAWLER" | "WEBMEUP_CRAWLER" | "WEBMON" | "WEBPAGETEST_CRAWLER" | "WEBZIO_CRAWLER" | "WEBZIO_CRAWLER_AI" | "WELLKNOWN_CRAWLER" | "WESEE_CRAWLER" | "WGET" | "WHATSAPP_CRAWLER" | "WOCODI_CRAWLER" | "WOORANK_CRAWLER" | "WOORANK_CRAWLER_REVIEW" | "WORDPRESS_CRAWLER" | "WORDPRESS_CRAWLER_RSS" | "WORDUP_CRAWLER" | "WORIO_CRAWLER" | "WOTBOX_CRAWLER" | "XENU_CRAWLER" | "XOVIBOT_CRAWLER" | "YACY_CRAWLER" | "YAHOO_CRAWLER" | "YAHOO_CRAWLER_JAPAN" | "YAHOO_PREVIEW" | "YAMANALAB_CRAWLER" | "YANDEX_CRAWLER" | "YANDEX_CRAWLER_JAVASCRIPT" | "YANGA_CRAWLER" | "YELLOWBP_CRAWLER" | "YEXT_BOT" | "YISOU_CRAWLER" | "YOOZ_CRAWLER" | "YOU_CRAWLER" | "ZABBIX_MONITOR" | "ZGRAB" | "ZGRAT_BOTNET" | "ZOOMINFO_CRAWLER" | "ZUM_CRAWLER" | "ZUPERLIST_CRAWLER" | "ARCJET_SIGNALS"; | ||
| type ArcjetBotCategory = "CATEGORY:ACADEMIC" | "CATEGORY:ADVERTISING" | "CATEGORY:AI" | "CATEGORY:AMAZON" | "CATEGORY:APPLE" | "CATEGORY:ARCHIVE" | "CATEGORY:BOTNET" | "CATEGORY:FEEDFETCHER" | "CATEGORY:GOOGLE" | "CATEGORY:META" | "CATEGORY:MICROSOFT" | "CATEGORY:MONITOR" | "CATEGORY:OPTIMIZER" | "CATEGORY:PREVIEW" | "CATEGORY:PROGRAMMATIC" | "CATEGORY:SEARCH_ENGINE" | "CATEGORY:SLACK" | "CATEGORY:SOCIAL" | "CATEGORY:TOOL" | "CATEGORY:UNKNOWN" | "CATEGORY:VERCEL" | "CATEGORY:WEBHOOK" | "CATEGORY:YAHOO"; | ||
| declare const categories: Record<ArcjetBotCategory, readonly ArcjetWellKnownBot[]>; | ||
| //#endregion | ||
| export { ArcjetBotCategory, ArcjetWellKnownBot, categories }; |
| //#region src/well-known-bots.ts | ||
| const categories = Object.freeze({ | ||
| "CATEGORY:ACADEMIC": Object.freeze([ | ||
| "ACADEMICBOT_RTU", | ||
| "BLACKBOARD_CRAWLER", | ||
| "CISPA_CRAWLER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "DOMAINSPROJECT_CRAWLER", | ||
| "EPFL_CRAWLER", | ||
| "EZID_CRAWLER", | ||
| "LAW_UNIMI_CRAWLER", | ||
| "LEIPZIG_FINDLINKS", | ||
| "LEIPZIG_LCC", | ||
| "MACOCU_CRAWLER", | ||
| "NICT_CRAWLER", | ||
| "SEMANTICSCHOLAR_CRAWLER", | ||
| "TURNITIN_CRAWLER", | ||
| "UTEXAS_CRAWLER", | ||
| "YAMANALAB_CRAWLER" | ||
| ]), | ||
| "CATEGORY:ADVERTISING": Object.freeze([ | ||
| "ADAGIO_CRAWLER", | ||
| "AHREFS_SITE_AUDIT", | ||
| "AMAZON_ADBOT", | ||
| "BING_ADS", | ||
| "GOOGLE_ADS_CONVERSIONS", | ||
| "GOOGLE_ADSBOT", | ||
| "GOOGLE_ADSBOT_MOBILE", | ||
| "GOOGLE_ADSENSE", | ||
| "GOOGLE_ADSENSE_GOOGLEBOT", | ||
| "GOOGLE_ADWORDS", | ||
| "META_EXTERNALADS", | ||
| "MOAT_CRAWLER", | ||
| "MSN_CRAWLER", | ||
| "QUANTCAST_CRAWLER" | ||
| ]), | ||
| "CATEGORY:AI": Object.freeze([ | ||
| "AI_SEARCH_BOT", | ||
| "AI2_CRAWLER", | ||
| "AI2_CRAWLER_DOLMA", | ||
| "AIHIT_CRAWLER", | ||
| "ANTHROPIC_CRAWLER", | ||
| "BOTIFY_CRAWLER", | ||
| "BYTEDANCE_CRAWLER", | ||
| "COHERE_CRAWLER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "DIFFBOT_CRAWLER", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "FRIENDLYCRAWLER", | ||
| "GLUTENFREEPLEASURE_CRAWLER", | ||
| "GOOGLE_CRAWLER_CLOUDVERTEX", | ||
| "IASK_CRAWLER", | ||
| "IMAGESIFT_CRAWLER", | ||
| "IMG2DATASET", | ||
| "INFEGY_CRAWLER", | ||
| "INTEGRALADS_CRAWLER", | ||
| "LEADCRUNCH_CRAWLER", | ||
| "MEDIATOOLKIT_CRAWLER", | ||
| "META_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "NICT_CRAWLER", | ||
| "NTENT_CRAWLER", | ||
| "OMGILI_CRAWLER", | ||
| "OPENAI_CRAWLER", | ||
| "OPENAI_CRAWLER_SEARCH", | ||
| "OPENAI_CRAWLER_USER", | ||
| "PERPLEXITY_CRAWLER", | ||
| "PERPLEXITY_USER", | ||
| "PETALSEARCH_CRAWLER", | ||
| "PRIMAL_CRAWLER", | ||
| "PYTHON_SCRAPY", | ||
| "SAFEDNS_CRAWLER", | ||
| "SBINTUITIONS_BOT", | ||
| "SEARCHATLAS_CRAWLER", | ||
| "SEMANTICSCHOLAR_CRAWLER", | ||
| "SENTIONE_CRAWLER", | ||
| "STORYGIZE_CRAWLER", | ||
| "TIKTOK_CRAWLER", | ||
| "TIMPI_CRAWLER", | ||
| "TURNITIN_CRAWLER", | ||
| "VELEN_CRAWLER", | ||
| "WEBZIO_CRAWLER_AI", | ||
| "YOU_CRAWLER" | ||
| ]), | ||
| "CATEGORY:AMAZON": Object.freeze([ | ||
| "AMAZON_ADBOT", | ||
| "AMAZON_ALEXA_CRAWLER", | ||
| "AMAZON_CLOUDFRONT", | ||
| "AMAZON_CRAWLER", | ||
| "AMAZON_ROUTE53_HEALTH_CHECK" | ||
| ]), | ||
| "CATEGORY:APPLE": Object.freeze(["APPLE_CRAWLER", "IMESSAGE_PREVIEW"]), | ||
| "CATEGORY:ARCHIVE": Object.freeze([ | ||
| "ARCHIVEORG_ARCHIVER", | ||
| "CCBOT_CRAWLER", | ||
| "CLOUDFLARE_ARCHIVER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "EZID_CRAWLER", | ||
| "INTERNETARCHIVE_CRAWLER_OSS", | ||
| "IRC_ARCHIVEBOT", | ||
| "LINKARCHIVER", | ||
| "NICECRAWLER_ARCHIVE", | ||
| "TRENDSMAP_CRAWLER", | ||
| "WEBARCHIVE_CRAWLER" | ||
| ]), | ||
| "CATEGORY:BOTNET": Object.freeze([ | ||
| "AGENTTESLA_BOTNET", | ||
| "AMADEY_BOTNET", | ||
| "BANKER_BOTNET", | ||
| "BLACK_BOTNET", | ||
| "BYOB_BOTNET", | ||
| "DONUTMATE_BOTNET", | ||
| "GAFGYT_BOTNET", | ||
| "GULOADER_BOTNET", | ||
| "HAJIME_BOTNET", | ||
| "KINSING_BOTNET", | ||
| "MIRAI_BOTNET", | ||
| "MOOBOT_BOTNET", | ||
| "MOZI_BOTNET", | ||
| "REMCOSRAT_BOTNET", | ||
| "STEALC_BOTNET", | ||
| "ZGRAT_BOTNET" | ||
| ]), | ||
| "CATEGORY:FEEDFETCHER": Object.freeze([ | ||
| "APPLE_FEEDFETCHER", | ||
| "AWARIO_CRAWLER_RSS", | ||
| "BAZQUX_FEEDFETCHER", | ||
| "BLOGTRAFFIC_FEEDFETCHER", | ||
| "FEEDBIN_CRAWLER", | ||
| "FEEDLY_FEEDFETCHER", | ||
| "FEEDSPOT_FEEDFETCHER", | ||
| "FRESHRSS_FEEDFETCHER", | ||
| "G2READER_CRAWLER", | ||
| "GOOGLE_FEEDFETCHER", | ||
| "INOREADER_AGGREGATOR", | ||
| "MINIFLUX_FEEDFETCHER", | ||
| "NAVER_CRAWLER_RSS", | ||
| "NEWSBLUR_AGGREGATOR", | ||
| "POCKET_CRAWLER", | ||
| "REFIND_CRAWLER", | ||
| "RSSBOT_FEEDFETCHER", | ||
| "RSSING_CRAWLER", | ||
| "RSSMICRO_FEEDFETCHER", | ||
| "SERENDEPUTY_CRAWLER", | ||
| "STARTME_CRAWLER", | ||
| "SUPERFEEDR_CRAWLER", | ||
| "THEOLDREADER_CRAWLER", | ||
| "TTRSS_FEEDFETCHER", | ||
| "WORDPRESS_CRAWLER_RSS" | ||
| ]), | ||
| "CATEGORY:GOOGLE": Object.freeze([ | ||
| "GOOGLE_ADS_CONVERSIONS", | ||
| "GOOGLE_ADSBOT", | ||
| "GOOGLE_ADSBOT_MOBILE", | ||
| "GOOGLE_ADSENSE", | ||
| "GOOGLE_ADSENSE_GOOGLEBOT", | ||
| "GOOGLE_ADWORDS", | ||
| "GOOGLE_APPENGINE", | ||
| "GOOGLE_CERTIFICATES_BRIDGE", | ||
| "GOOGLE_CRAWLER", | ||
| "GOOGLE_CRAWLER_CLOUDVERTEX", | ||
| "GOOGLE_CRAWLER_IMAGE", | ||
| "GOOGLE_CRAWLER_MOBILE", | ||
| "GOOGLE_CRAWLER_NEWS", | ||
| "GOOGLE_CRAWLER_OTHER", | ||
| "GOOGLE_CRAWLER_SAFETY", | ||
| "GOOGLE_CRAWLER_STORE", | ||
| "GOOGLE_CRAWLER_VIDEO", | ||
| "GOOGLE_FAVICON", | ||
| "GOOGLE_FEEDFETCHER", | ||
| "GOOGLE_INSPECTION_TOOL", | ||
| "GOOGLE_LIGHTHOUSE", | ||
| "GOOGLE_PHYSICAL_WEB", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_PUSH_NOTIFICATIONS", | ||
| "GOOGLE_READ_ALOUD", | ||
| "GOOGLE_SITE_VERIFICATION", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "GOOGLE_XRAWLER" | ||
| ]), | ||
| "CATEGORY:META": Object.freeze([ | ||
| "FACEBOOK_CATALOG", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "META_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "META_EXTERNALADS", | ||
| "WHATSAPP_CRAWLER" | ||
| ]), | ||
| "CATEGORY:MICROSOFT": Object.freeze([ | ||
| "AZURE_APP_INSIGHTS", | ||
| "BING_ADS", | ||
| "BING_CRAWLER", | ||
| "BING_OFFICE_STORE", | ||
| "BING_PREVIEW", | ||
| "MICROSOFT_PREVIEW", | ||
| "MICROSOFT_RESEARCH_CRAWLER", | ||
| "MSN_CRAWLER", | ||
| "SKYPE_PREVIEW" | ||
| ]), | ||
| "CATEGORY:MONITOR": Object.freeze([ | ||
| "AMAZON_ROUTE53_HEALTH_CHECK", | ||
| "AZURE_APP_INSIGHTS", | ||
| "BETTERSTACK_MONITOR", | ||
| "BETTERUPTIME_MONITOR", | ||
| "BRANDVERITY_CRAWLER", | ||
| "CENSYS_INSPECT", | ||
| "CHANGEDETECTION_CRAWLER", | ||
| "CHECKLY_MONITOR", | ||
| "CLOUDFLARE_HEALTHCHECKS", | ||
| "CLOUDFLARE_SECURITY_CENTER", | ||
| "CLOUDFLARE_SSL_DETECTOR", | ||
| "CLOUDFLARE_TRAFFIC_MANAGER", | ||
| "DATADOG_MONITOR_SYNTHETICS", | ||
| "DEADLINKCHECKER", | ||
| "DISQUS_CRAWLER", | ||
| "DUBBOT_CRAWLER", | ||
| "DYNATRACE_MONITOR", | ||
| "FLIPBOARD_PROXY", | ||
| "FREEWEBMONITORING_MONITOR", | ||
| "FRESHWORKS_MONITOR", | ||
| "GOOGLE_CERTIFICATES_BRIDGE", | ||
| "GOOGLE_SITE_VERIFICATION", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "HUBSPOT_CRAWLER", | ||
| "HYDROZEN_MONITOR", | ||
| "KUMA_MONITOR", | ||
| "MONITORBACKLINKS_CRAWLER", | ||
| "NEWRELIC_MONITOR", | ||
| "NIXSTATS_CRAWLER", | ||
| "OUTBRAIN_LINK_CHECKER", | ||
| "PAGEPEEKER_CRAWLER", | ||
| "PINGDOM_CRAWLER", | ||
| "SAFEDNS_CRAWLER", | ||
| "SENTRY_CRAWLER", | ||
| "SENTRY_UPTIME_MONITOR", | ||
| "STATUSCAKE_MONITOR", | ||
| "SURLY_CRAWLER", | ||
| "TESTOMATO_CRAWLER", | ||
| "UPTIME_MONITOR", | ||
| "UPTIMEBOT_MONITOR", | ||
| "UPTIMEROBOT_MONITOR", | ||
| "VERCEL_MONITOR_PREVIEW", | ||
| "W3C_VALIDATOR_CSS", | ||
| "W3C_VALIDATOR_FEED", | ||
| "W3C_VALIDATOR_HTML", | ||
| "W3C_VALIDATOR_HTML_NU", | ||
| "W3C_VALIDATOR_I18N", | ||
| "W3C_VALIDATOR_LINKS", | ||
| "W3C_VALIDATOR_MOBILE", | ||
| "W3C_VALIDATOR_UNIFIED", | ||
| "WEBPAGETEST_CRAWLER", | ||
| "XENU_CRAWLER", | ||
| "ZABBIX_MONITOR" | ||
| ]), | ||
| "CATEGORY:OPTIMIZER": Object.freeze([ | ||
| "CLOUDFLARE_PREFETCH", | ||
| "CONDUCTOR_CRAWLER", | ||
| "DAREBOOST_CRAWLER", | ||
| "DUBBOT_CRAWLER", | ||
| "GOOGLE_LIGHTHOUSE", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "MONSIDO_CRAWLER", | ||
| "MOZ_SITE_AUDIT", | ||
| "ONCRAWL", | ||
| "SCREAMINGFROG_CRAWLER", | ||
| "SISTRIX_CRAWLER", | ||
| "SITEBULB", | ||
| "TESTOMATO_CRAWLER", | ||
| "WEBPAGETEST_CRAWLER" | ||
| ]), | ||
| "CATEGORY:PREVIEW": Object.freeze([ | ||
| "BING_PREVIEW", | ||
| "BITLY_CRAWLER", | ||
| "DISCORD_CRAWLER", | ||
| "DUCKDUCKGO_CRAWLER_FAVICONS", | ||
| "EMBEDLY_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "FLIPBOARD_PROXY", | ||
| "GOOGLE_FAVICON", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "IFRAMELY_PREVIEW", | ||
| "IMESSAGE_PREVIEW", | ||
| "KEYBASE_BOT", | ||
| "MASTODON_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "MICROSOFT_PREVIEW", | ||
| "PAGEPEEKER_CRAWLER", | ||
| "SKYPE_PREVIEW", | ||
| "SLACK_IMAGE_PROXY", | ||
| "SNAP_PREVIEW", | ||
| "STEAM_PREVIEW", | ||
| "SYNAPSE_CRAWLER", | ||
| "TELEGRAM_CRAWLER", | ||
| "TWITTER_CRAWLER", | ||
| "VERCEL_MONITOR_PREVIEW", | ||
| "VIBER_CRAWLER", | ||
| "WHATSAPP_CRAWLER", | ||
| "YAHOO_PREVIEW" | ||
| ]), | ||
| "CATEGORY:PROGRAMMATIC": Object.freeze([ | ||
| "CODA_SERVER_FETCHER", | ||
| "GIGABLAST_CRAWLER_OSS", | ||
| "GO_HTTP", | ||
| "GOOGLE_APPENGINE", | ||
| "GOWIKI_CRAWLER", | ||
| "HTTP_GET", | ||
| "JAVA_APACHE_HTTPCLIENT", | ||
| "JAVA_ASYNCHTTPCLIENT", | ||
| "JAVA_CRAWLER4J", | ||
| "JAVA_HTTPUNIT", | ||
| "JAVA_JERSEY", | ||
| "JAVA_JETTY", | ||
| "JAVA_OKHTTP", | ||
| "JAVA_SNACKTORY", | ||
| "JAVASCRIPT_AXIOS", | ||
| "JAVASCRIPT_NODE_FETCH", | ||
| "JAVASCRIPT_PHANTOM", | ||
| "PERL_LIBWWW", | ||
| "PERL_PCORE", | ||
| "PHP_CURLCLASS", | ||
| "PHP_PHPCRAWL", | ||
| "PHP_SIMPLE_SCRAPER", | ||
| "PHP_SIMPLEPIE", | ||
| "PYTHON_AIOHTTP", | ||
| "PYTHON_BITBOT", | ||
| "PYTHON_HTTPX", | ||
| "PYTHON_OPENGRAPH", | ||
| "PYTHON_REQUESTS", | ||
| "PYTHON_SCRAPY", | ||
| "PYTHON_URLLIB", | ||
| "RUBY_METAINSPECTOR", | ||
| "STRIPE_CRAWLER" | ||
| ]), | ||
| "CATEGORY:SEARCH_ENGINE": Object.freeze([ | ||
| "ADDSEARCH_CRAWLER", | ||
| "AHREFS_CRAWLER", | ||
| "ALEXANDRIA_CRAWLER", | ||
| "ALGOLIA_CRAWLER", | ||
| "APPLE_CRAWLER", | ||
| "ASK_CRAWLER", | ||
| "AVIRA_CRAWLER", | ||
| "BING_CRAWLER", | ||
| "BING_OFFICE_STORE", | ||
| "DUCKDUCKGO_CRAWLER", | ||
| "DUCKDUCKGO_CRAWLER_FAVICONS", | ||
| "ENTIREWEB_CRAWLER", | ||
| "GEEDO_CRAWLER", | ||
| "GEEDO_CRAWLER_PRODUCTS", | ||
| "GOOGLE_CRAWLER", | ||
| "GOOGLE_CRAWLER_IMAGE", | ||
| "GOOGLE_CRAWLER_MOBILE", | ||
| "GOOGLE_CRAWLER_NEWS", | ||
| "GOOGLE_CRAWLER_OTHER", | ||
| "GOOGLE_CRAWLER_STORE", | ||
| "GOOGLE_CRAWLER_VIDEO", | ||
| "GOOGLE_INSPECTION_TOOL", | ||
| "IASK_CRAWLER", | ||
| "LINGUEE_CRAWLER", | ||
| "MAJESTIC_CRAWLER", | ||
| "MARGINALIA_CRAWLER", | ||
| "MOJEEK_CRAWLER", | ||
| "NETESTATE_CRAWLER", | ||
| "OPENAI_CRAWLER_SEARCH", | ||
| "PETALSEARCH_CRAWLER", | ||
| "PIPL_CRAWLER", | ||
| "QWANT_CRAWLER", | ||
| "SEEKPORT_CRAWLER", | ||
| "STRACT_CRAWLER", | ||
| "WEBZIO_CRAWLER", | ||
| "WELLKNOWN_CRAWLER", | ||
| "YACY_CRAWLER", | ||
| "YAHOO_CRAWLER", | ||
| "YANDEX_CRAWLER", | ||
| "YANDEX_CRAWLER_JAVASCRIPT" | ||
| ]), | ||
| "CATEGORY:SLACK": Object.freeze(["SLACK_CRAWLER", "SLACK_IMAGE_PROXY"]), | ||
| "CATEGORY:SOCIAL": Object.freeze([ | ||
| "DIGG_CRAWLER", | ||
| "DISCORD_CRAWLER", | ||
| "EVERYONESOCIAL_CRAWLER", | ||
| "FACEBOOK_CATALOG", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "GROUPME_CRAWLER", | ||
| "IFRAMELY_PREVIEW", | ||
| "IMESSAGE_PREVIEW", | ||
| "IRC_ARCHIVEBOT", | ||
| "KEYBASE_BOT", | ||
| "LEMMY_CRAWLER", | ||
| "LINKARCHIVER", | ||
| "LINKEDIN_CRAWLER", | ||
| "MASTODON_CRAWLER", | ||
| "NETICLE_CRAWLER", | ||
| "PINTEREST_CRAWLER", | ||
| "PINTREST_CRAWLER", | ||
| "REDDIT_CRAWLER", | ||
| "SNAP_PREVIEW", | ||
| "STEAM_PREVIEW", | ||
| "SYNAPSE_CRAWLER", | ||
| "TELEGRAM_CRAWLER", | ||
| "TIKTOK_CRAWLER", | ||
| "TRENDSMAP_CRAWLER", | ||
| "TWEETEDTIMES_CRAWLER", | ||
| "TWITTER_CRAWLER", | ||
| "VIBER_CRAWLER", | ||
| "WHATSAPP_CRAWLER" | ||
| ]), | ||
| "CATEGORY:TOOL": Object.freeze([ | ||
| "COOKIEHUB_SCAN", | ||
| "CURL", | ||
| "DCRAWL", | ||
| "DOMAINSPROJECT_CRAWLER", | ||
| "GIGABLAST_CRAWLER_OSS", | ||
| "GOT", | ||
| "HEADLESS_CHROME", | ||
| "IMG2DATASET", | ||
| "INTERNETARCHIVE_CRAWLER_OSS", | ||
| "IPIP_CRAWLER", | ||
| "L9EXPLORE", | ||
| "LAW_UNIMI_CRAWLER", | ||
| "NAGIOS_CHECK_HTTP", | ||
| "NMAP", | ||
| "NUTCH", | ||
| "ONCRAWL", | ||
| "POSTMAN", | ||
| "SITEBULB", | ||
| "SUMMALY_CRAWLER", | ||
| "WGET", | ||
| "XENU_CRAWLER", | ||
| "YEXT_BOT", | ||
| "ZGRAB" | ||
| ]), | ||
| "CATEGORY:UNKNOWN": Object.freeze([ | ||
| "A6CORP_CRAWLER", | ||
| "ABOUNDEX_CRAWLER", | ||
| "ACAPBOT", | ||
| "ACOON_CRAWLER", | ||
| "ADBEAT_CRAWLER", | ||
| "ADDTHIS_CRAWLER", | ||
| "ADMANTX_CRAWLER", | ||
| "ADSCANNER_CRAWLER", | ||
| "ADSTXTCRAWLER", | ||
| "ADVBOT_CRAWLER", | ||
| "ALPHASEOBOT_CRAWLER", | ||
| "ANDERSPINK_CRAWLER", | ||
| "ANTIBOT", | ||
| "APERCITE_CRAWLER", | ||
| "ARA_CRAWLER", | ||
| "ARATURKA_CRAWLER", | ||
| "AROCOM_CRAWLER", | ||
| "ASPIEGEL_CRAWLER", | ||
| "AUDISTO_CRAWLER", | ||
| "AWARIO_CRAWLER", | ||
| "AWARIO_CRAWLER_SMART", | ||
| "AWESOMECRAWLER", | ||
| "B2BBOT", | ||
| "BACKLINKTEST_CRAWLER", | ||
| "BAIDU_CLOUD_WATCH", | ||
| "BAIDU_CRAWLER", | ||
| "BETABOT", | ||
| "BIDSWITCH_CRAWLER", | ||
| "BIGDATACORP_CRAWLER", | ||
| "BIGLOTRON", | ||
| "BINLAR", | ||
| "BITSIGHT_CRAWLER", | ||
| "BLOGMURA_CRAWLER", | ||
| "BLP_BBOT", | ||
| "BNF_CRAWLER", | ||
| "BOMBORA_CRAWLER", | ||
| "BOXCAR_CRAWLER", | ||
| "BRAINOBOT", | ||
| "BRANDONMEDIA_CRAWLER", | ||
| "BRANDWATCH_CRAWLER", | ||
| "BRIGHTEDGE_CRAWLER", | ||
| "BUBLUP_CRAWLER", | ||
| "BUILTWITH_CRAWLER", | ||
| "BUZZSTREAM_CRAWLER", | ||
| "CAPSULINK_CRAWLER", | ||
| "CAREERX_CRAWLER", | ||
| "CENTURYBOT", | ||
| "CHECKMARKNETWORK_CRAWLER", | ||
| "CHLOOE_CRAWLER", | ||
| "CINCRAWDATA_CRAWLER", | ||
| "CITESEERX_CRAWLER", | ||
| "CLICKAGY_CRAWLER", | ||
| "CLIQZ_CRAWLER", | ||
| "CLOUDSYSTEMNETWORKS_CRAWLER", | ||
| "COCCOC_CRAWLER", | ||
| "COCOLYZE_CRAWLER", | ||
| "CODEWISE_CRAWLER", | ||
| "COGNITIVESEO_CRAWLER", | ||
| "COMPANYBOOK_CRAWLER", | ||
| "CONTENT_CRAWLER_SPIDER", | ||
| "CONTEXTAD_CRAWLER", | ||
| "CONTXBOT", | ||
| "CONVERA_CRAWLER", | ||
| "COOKIEBOT_CRAWLER", | ||
| "CREATIVECOMMONS_CRAWLER", | ||
| "CRITEO_CRAWLER", | ||
| "CRYSTALSEMANTICS_CRAWLER", | ||
| "CUREBOT_CRAWLER", | ||
| "CUTBOT_CRAWLER", | ||
| "CXENSE_CRAWLER", | ||
| "CYBERPATROL_CRAWLER", | ||
| "DATAFEEDWATCH_CRAWLER", | ||
| "DATAFORSEO_CRAWLER", | ||
| "DATAGNION_CRAWLER", | ||
| "DATANYZE_CRAWLER", | ||
| "DATAPROVIDER_CRAWLER", | ||
| "DATENBUTLER_CRAWLER", | ||
| "DAUM_CRAWLER", | ||
| "DEEPNOC_CRAWLER", | ||
| "DEUSU_CRAWLER", | ||
| "DIGINCORE_CRAWLER", | ||
| "DIGITALDRAGON_CRAWLER", | ||
| "DISCOVERYENGINE_CRAWLER", | ||
| "DNYZ_CRAWLER", | ||
| "DOMAINCRAWLER_CRAWLER", | ||
| "DOMAINREANIMATOR_CRAWLER", | ||
| "DOMAINSBOT_CRAWLER", | ||
| "DOMAINSTATS_CRAWLER", | ||
| "DOMAINTOOLS_CRAWLER", | ||
| "DOTNETDOTCOM_CRAWLER", | ||
| "DRAGONMETRICS_CRAWLER", | ||
| "DRIFTNET_CRAWLER", | ||
| "DUEDIL_CRAWLER", | ||
| "EC2LINKFINDER", | ||
| "EDISTER_CRAWLER", | ||
| "ELISABOT", | ||
| "EPICTIONS_CRAWLER", | ||
| "ERIGHT_CRAWLER", | ||
| "EUROPARCHIVE_CRAWLER", | ||
| "EVENTURES_CRAWLER", | ||
| "EVENTURES_CRAWLER_BATCH", | ||
| "EXENSA_CRAWLER", | ||
| "EXPERIBOT_CRAWLER", | ||
| "EXTLINKS_CRAWLER", | ||
| "EYEOTA_CRAWLER", | ||
| "FAST_CRAWLER", | ||
| "FAST_CRAWLER_ENTERPRISE", | ||
| "FEDORAPLANET_CRAWLER", | ||
| "FEEDAFEVER_CRAWLER", | ||
| "FEMTOSEARCH_CRAWLER", | ||
| "FINDTHATFILE_CRAWLER", | ||
| "FLAMINGOSEARCH_CRAWLER", | ||
| "FLUFFY", | ||
| "FR_CRAWLER", | ||
| "FUELBOT", | ||
| "FYREBOT", | ||
| "G00G1E_CRAWLER", | ||
| "G2WEBSERVICES_CRAWLER", | ||
| "GARLIK_CRAWLER", | ||
| "GENIEO_CRAWLER", | ||
| "GIGABLAST_CRAWLER", | ||
| "GINGER_CRAWLER", | ||
| "GNAM_GNAM_SPIDER", | ||
| "GNOWIT_CRAWLER", | ||
| "GOO_CRAWLER", | ||
| "GRAPESHOT_CRAWLER", | ||
| "GROB_CRAWLER", | ||
| "GROUPHIGH_CRAWLER", | ||
| "GRUB", | ||
| "GSLFBOT", | ||
| "GWENE_CRAWLER", | ||
| "HAOSOU_CRAWLER", | ||
| "HATENA_CRAWLER", | ||
| "HEADLINE_CRAWLER", | ||
| "HOYER_CRAWLER", | ||
| "HTTRACK", | ||
| "HYPEFACTORS_CRAWLER", | ||
| "HYPESTAT_CRAWLER", | ||
| "HYSCORE_CRAWLER", | ||
| "IA_ARCHIVER", | ||
| "IDEASANDCODE_CRAWLER", | ||
| "INDEED_CRAWLER", | ||
| "INETDEX_CRAWLER", | ||
| "INFOO_CRAWLER", | ||
| "INTEGROMEDB_CRAWLER", | ||
| "INTELIUM_CRAWLER", | ||
| "IONOS_CRAWLER", | ||
| "IP_WEB_CRAWLER", | ||
| "ISKANIE_CRAWLER", | ||
| "ISS_CRAWLER", | ||
| "IT2MEDIA_CRAWLER", | ||
| "ITINFLUENTIALS_CRAWLER", | ||
| "JAMIEMBROWN_CRAWLER", | ||
| "JETSLIDE_CRAWLER", | ||
| "JOBBOERSE_CRAWLER", | ||
| "JOOBLE_CRAWLER", | ||
| "JUSPROG_CRAWLER", | ||
| "JYXO_CRAWLER", | ||
| "K7COMPUTING_CRAWLER", | ||
| "KEMVI_CRAWLER", | ||
| "KOMODIA_CRAWLER", | ||
| "KOSMIO_CRAWLER", | ||
| "LANDAUMEDIA_CRAWLER", | ||
| "LASERLIKE_CRAWLER", | ||
| "LB_SPIDER", | ||
| "LEIKI_CRAWLER", | ||
| "LIGHTSPEEDSYSTEMS_CRAWLER", | ||
| "LINE_CRAWLER", | ||
| "LINKAPEDIA_CRAWLER", | ||
| "LINKDEX_CRAWLER", | ||
| "LINKFLUENCE_CRAWLER", | ||
| "LINKIS_CRAWLER", | ||
| "LIPPERHEY_CRAWLER", | ||
| "LIVELAP_CRAWLER", | ||
| "LOGLY_CRAWLER", | ||
| "LOOP_CRAWLER", | ||
| "LSSBOT", | ||
| "LSSBOT_ROCKET", | ||
| "LTX71_CRAWLER", | ||
| "LUMINATOR_CRAWLER", | ||
| "MAILRU_CRAWLER", | ||
| "MAPPYDATA_CRAWLER", | ||
| "MAUIBOT", | ||
| "MEGAINDEX_CRAWLER", | ||
| "MELTWATER_CRAWLER", | ||
| "METADATALABS_CRAWLER", | ||
| "METAJOB_CRAWLER", | ||
| "METAURI_CRAWLER", | ||
| "METRICSTOOLS_CRAWLER", | ||
| "MIGNIFY_CRAWLER", | ||
| "MIGNIFY_IMRBOT", | ||
| "MIXNODE_CACHE", | ||
| "MOODLE_CRAWLER", | ||
| "MOREOVER_CRAWLER", | ||
| "MOZ_CRAWLER", | ||
| "MUCKRACK_CRAWLER", | ||
| "MULTIVIEWBOT", | ||
| "NAVER_CRAWLER", | ||
| "NEEVA_CRAWLER", | ||
| "NERDBYNATURE_CRAWLER", | ||
| "NERDYBOT_CRAWLER", | ||
| "NETCRAFT_CRAWLER", | ||
| "NETSYSTEMSRESEARCH_CRAWLER", | ||
| "NETVIBES_CRAWLER", | ||
| "NEWSHARECOUNTS_CRAWLER", | ||
| "NEWSPAPER", | ||
| "NEXTCLOUD_CRAWLER", | ||
| "NIKI_BOT", | ||
| "NING_CRAWLER", | ||
| "NINJABOT", | ||
| "NUZZEL_CRAWLER", | ||
| "OCARINABOT", | ||
| "OKRU_CRAWLER", | ||
| "OPENGRAPHCHECK_CRAWLER", | ||
| "OPENHOSE_CRAWLER", | ||
| "OPENINDEX_CRAWLER", | ||
| "ORANGE_CRAWLER", | ||
| "ORANGE_FTGROUP_CRAWLER", | ||
| "OUTCLICKS_CRAWLER", | ||
| "PAGE_TO_RSS", | ||
| "PAGETHING_CRAWLER", | ||
| "PALOALTONETWORKS_CRAWLER", | ||
| "PANSCIENT_CRAWLER", | ||
| "PAPERLI_CRAWLER", | ||
| "PHXBOT", | ||
| "PICSEARCH_CRAWLER", | ||
| "POSTRANK_CRAWLER", | ||
| "PRCY_CRAWLER", | ||
| "PRIVACORE_CRAWLER", | ||
| "PRIVACYAWARE_CRAWLER", | ||
| "PROFOUND_CRAWLER", | ||
| "PROXIMIC_CRAWLER", | ||
| "PULSEPOINT_CRAWLER", | ||
| "PURE_CRAWLER", | ||
| "RANKACTIVE_CRAWLER", | ||
| "RETREVO_PAGE_ANALYZER", | ||
| "RIDDER_CRAWLER", | ||
| "RIVVA_CRAWLER", | ||
| "RYTE_CRAWLER", | ||
| "SCAN_INTERFAX_CRAWLER", | ||
| "SCHMORP_CRAWLER", | ||
| "SCOUTJET_CRAWLER", | ||
| "SCRIBD_CRAWLER", | ||
| "SCRITCH_CRAWLER", | ||
| "SEEKBOT_CRAWLER", | ||
| "SEEWITHKIDS_CRAWLER", | ||
| "SEMANTICAUDIENCE_CRAWLER", | ||
| "SEMPITECH_CRAWLER", | ||
| "SEMRUSH_CRAWLER", | ||
| "SENUTO_CRAWLER", | ||
| "SEOBILITY_CRAWLER", | ||
| "SEOKICKS_CRAWLER", | ||
| "SEOLIZER_CRAWLER", | ||
| "SEOPROFILER_CRAWLER", | ||
| "SEOSCANNERS_CRAWLER", | ||
| "SEOSTAR_CRAWLER", | ||
| "SEOZOOM_CRAWLER", | ||
| "SERPSTATBOT_CRAWLER", | ||
| "SEZNAM_CRAWLER", | ||
| "SIMILARTECH_CRAWLER", | ||
| "SIMPLE_CRAWLER", | ||
| "SISTRIX_007AC9_CRAWLER", | ||
| "SITEBOT_CRAWLER", | ||
| "SITECHECKER_CRAWLER", | ||
| "SITEEXPLORER_CRAWLER", | ||
| "SITEIMPROVE_CRAWLER", | ||
| "SOCIALRANK_CRAWLER", | ||
| "SOFTBYTELABS_CRAWLER", | ||
| "SOGOU_CRAWLER", | ||
| "STUTTGART_CRAWLER", | ||
| "SUMMIFY_CRAWLER", | ||
| "SWIMGBOT", | ||
| "SYSOMOS_CRAWLER", | ||
| "T3VERSIONS_CRAWLER", | ||
| "TABOOLA_CRAWLER", | ||
| "TAGOO_CRAWLER", | ||
| "TANGIBLEE_CRAWLER", | ||
| "THINKLAB_CRAWLER", | ||
| "TIGER_CRAWLER", | ||
| "TINEYE_CRAWLER", | ||
| "TISCALI_CRAWLER", | ||
| "TOMBASCRAPER_CRAWLER", | ||
| "TOPLIST_CRAWLER", | ||
| "TORUS_CRAWLER", | ||
| "TOUTIAO_CRAWLER", | ||
| "TRAACKR_CRAWLER", | ||
| "TRACEMYFILE_CRAWLER", | ||
| "TRENDICTION_CRAWLER", | ||
| "TROVE_CRAWLER", | ||
| "TROVIT_CRAWLER", | ||
| "TWEETMEMEBOT", | ||
| "TWENGA_CRAWLER", | ||
| "TWINGLY_CRAWLER", | ||
| "TWOIP_CRAWLER", | ||
| "TWOIP_CRAWLER_CMS", | ||
| "TWURLY_CRAWLER", | ||
| "UBERMETRICS_CRAWLER", | ||
| "UBT_CRAWLER", | ||
| "UPFLOW_CRAWLER", | ||
| "URLCLASSIFICATION_CRAWLER", | ||
| "USINE_NOUVELLE_CRAWLER", | ||
| "UTORRENT_CRAWLER", | ||
| "VEBIDOO_CRAWLER", | ||
| "VEOOZ_CRAWLER", | ||
| "VERISIGN_IPS_AGENT", | ||
| "VIGIL_CRAWLER", | ||
| "VIPNYTT_CRAWLER", | ||
| "VIRUSTOTAL_CRAWLER", | ||
| "VKROBOT_CRAWLER", | ||
| "VKSHARE_CRAWLER", | ||
| "VUHUV_CRAWLER", | ||
| "WAREBAY_CRAWLER", | ||
| "WEBCEO_CRAWLER", | ||
| "WEBCOMPANY_CRAWLER", | ||
| "WEBDATASTATS_CRAWLER", | ||
| "WEBEAVER_CRAWLER", | ||
| "WEBMEUP_CRAWLER", | ||
| "WEBMON", | ||
| "WESEE_CRAWLER", | ||
| "WOCODI_CRAWLER", | ||
| "WOORANK_CRAWLER", | ||
| "WOORANK_CRAWLER_REVIEW", | ||
| "WORDPRESS_CRAWLER", | ||
| "WORDUP_CRAWLER", | ||
| "WORIO_CRAWLER", | ||
| "WOTBOX_CRAWLER", | ||
| "XOVIBOT_CRAWLER", | ||
| "YANGA_CRAWLER", | ||
| "YELLOWBP_CRAWLER", | ||
| "YISOU_CRAWLER", | ||
| "YOOZ_CRAWLER", | ||
| "ZOOMINFO_CRAWLER", | ||
| "ZUM_CRAWLER", | ||
| "ZUPERLIST_CRAWLER" | ||
| ]), | ||
| "CATEGORY:VERCEL": Object.freeze(["VERCEL_CRAWLER", "VERCEL_MONITOR_PREVIEW"]), | ||
| "CATEGORY:WEBHOOK": Object.freeze(["ADYEN_WEBHOOK", "STRIPE_WEBHOOK"]), | ||
| "CATEGORY:YAHOO": Object.freeze([ | ||
| "YAHOO_CRAWLER", | ||
| "YAHOO_CRAWLER_JAPAN", | ||
| "YAHOO_PREVIEW" | ||
| ]) | ||
| }); | ||
| //#endregion | ||
| export { categories }; |
+66
-39
| { | ||
| "name": "@arcjet/protocol", | ||
| "version": "1.7.0", | ||
| "version": "1.8.0-rc.0", | ||
| "description": "The TypeScript & JavaScript interface into the Arcjet protocol", | ||
| "keywords": [ | ||
| "arcjet", | ||
| "utility", | ||
| "protocol", | ||
| "util", | ||
| "protocol" | ||
| "utility" | ||
| ], | ||
| "license": "Apache-2.0", | ||
| "homepage": "https://arcjet.com", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/arcjet/arcjet-js.git", | ||
| "directory": "protocol" | ||
| }, | ||
| "bugs": { | ||
@@ -22,2 +16,3 @@ "url": "https://github.com/arcjet/arcjet-js/issues", | ||
| }, | ||
| "license": "Apache-2.0", | ||
| "author": { | ||
@@ -28,30 +23,66 @@ "name": "Arcjet", | ||
| }, | ||
| "engines": { | ||
| "node": ">=22.21.0 <23 || >=24.5.0" | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/arcjet/arcjet-js.git", | ||
| "directory": "protocol" | ||
| }, | ||
| "type": "module", | ||
| "main": "./index.js", | ||
| "types": "./index.d.ts", | ||
| "files": [ | ||
| "proto/", | ||
| "client.d.ts", | ||
| "client.js", | ||
| "convert.d.ts", | ||
| "convert.js", | ||
| "index.d.ts", | ||
| "index.js", | ||
| "typeid.d.ts", | ||
| "typeid.js", | ||
| "well-known-bots.d.ts", | ||
| "well-known-bots.js" | ||
| "dist" | ||
| ], | ||
| "type": "module", | ||
| "main": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "exports": { | ||
| ".": { | ||
| "types": "./dist/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| }, | ||
| "./client": { | ||
| "types": "./dist/client.d.ts", | ||
| "default": "./dist/client.js" | ||
| }, | ||
| "./client.js": { | ||
| "types": "./dist/client.d.ts", | ||
| "default": "./dist/client.js" | ||
| }, | ||
| "./convert": { | ||
| "types": "./dist/convert.d.ts", | ||
| "default": "./dist/convert.js" | ||
| }, | ||
| "./convert.js": { | ||
| "types": "./dist/convert.d.ts", | ||
| "default": "./dist/convert.js" | ||
| }, | ||
| "./well-known-bots": { | ||
| "types": "./dist/well-known-bots.d.ts", | ||
| "default": "./dist/well-known-bots.js" | ||
| }, | ||
| "./well-known-bots.js": { | ||
| "types": "./dist/well-known-bots.d.ts", | ||
| "default": "./dist/well-known-bots.js" | ||
| }, | ||
| "./typeid": { | ||
| "types": "./dist/typeid.d.ts", | ||
| "default": "./dist/typeid.js" | ||
| }, | ||
| "./typeid.js": { | ||
| "types": "./dist/typeid.d.ts", | ||
| "default": "./dist/typeid.js" | ||
| }, | ||
| "./proto/*": "./dist/proto/*", | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "tag": "latest" | ||
| }, | ||
| "scripts": { | ||
| "build": "rollup --config rollup.config.js", | ||
| "lint": "eslint .", | ||
| "test-api": "node --test -- test/*.test.js", | ||
| "test-coverage": "node --experimental-test-coverage --test -- test/*.test.js", | ||
| "test": "npm run build && npm run lint && npm run test-coverage" | ||
| "build": "tsdown", | ||
| "typecheck": "tsgo --noEmit", | ||
| "test-api": "node --test -- test/*.test.ts", | ||
| "test-coverage": "node --experimental-test-coverage --test -- test/*.test.ts", | ||
| "test": "npm run build && npm run test-coverage" | ||
| }, | ||
| "dependencies": { | ||
| "@arcjet/cache": "1.7.0", | ||
| "@arcjet/cache": "1.8.0-rc.0", | ||
| "@bufbuild/protobuf": "2.12.0", | ||
@@ -61,13 +92,9 @@ "@connectrpc/connect": "2.1.2" | ||
| "devDependencies": { | ||
| "@arcjet/eslint-config": "1.7.0", | ||
| "@arcjet/rollup-config": "1.7.0", | ||
| "@rollup/wasm-node": "4.62.2", | ||
| "@types/node": "22.19.21", | ||
| "eslint": "9.39.4", | ||
| "typescript": "5.9.3" | ||
| "tsdown": "0.22.3", | ||
| "typescript": "6.0.3" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "tag": "latest" | ||
| "engines": { | ||
| "node": ">=22.21.0 <23 || >=24.5.0" | ||
| } | ||
| } |
-26
| import { type Transport } from "@connectrpc/connect"; | ||
| import { type ArcjetContext, type ArcjetRequestDetails, type ArcjetRule, type ArcjetStack, ArcjetDecision } from "./index.js"; | ||
| export interface Client { | ||
| decide(context: ArcjetContext, details: ArcjetRequestDetails, rules: ArcjetRule[]): Promise<ArcjetDecision>; | ||
| report(context: ArcjetContext, request: ArcjetRequestDetails, decision: ArcjetDecision, rules: ArcjetRule[]): void; | ||
| } | ||
| export type ClientOptions = { | ||
| transport: Transport; | ||
| baseUrl: string; | ||
| timeout: number; | ||
| sdkStack: ArcjetStack; | ||
| sdkVersion: string; | ||
| }; | ||
| /** | ||
| * Compute the timeout for a `Decide` request based on the configured rules. | ||
| * | ||
| * @internal Exported for testing only. | ||
| * @param timeout | ||
| * Base timeout in milliseconds. | ||
| * @param rules | ||
| * Rules that will be evaluated in this request. | ||
| * @returns | ||
| * Adjusted timeout in milliseconds. | ||
| */ | ||
| export declare function decideTimeout(timeout: number, rules: ArcjetRule[]): number; | ||
| export declare function createClient(options: ClientOptions): Client; |
-159
| import { create } from '@bufbuild/protobuf'; | ||
| import { createClient as createClient$1 } from '@connectrpc/connect'; | ||
| import { DecideService, ReportRequestSchema, DecideRequestSchema } from './proto/decide/v1alpha1/decide_pb.js'; | ||
| import { ArcjetStackToProtocol, ArcjetRuleToProtocol, ArcjetDecisionToProtocol, ArcjetDecisionFromProtocol } from './convert.js'; | ||
| // TODO: Dedupe with `errorMessage` in core | ||
| function errorMessage(err) { | ||
| if (err) { | ||
| if (typeof err === "string") { | ||
| return err; | ||
| } | ||
| if (typeof err === "object" && | ||
| "message" in err && | ||
| typeof err.message === "string") { | ||
| return err.message; | ||
| } | ||
| } | ||
| return "Unknown problem"; | ||
| } | ||
| /** | ||
| * Compute the timeout for a `Decide` request based on the configured rules. | ||
| * | ||
| * @internal Exported for testing only. | ||
| * @param timeout | ||
| * Base timeout in milliseconds. | ||
| * @param rules | ||
| * Rules that will be evaluated in this request. | ||
| * @returns | ||
| * Adjusted timeout in milliseconds. | ||
| */ | ||
| function decideTimeout(timeout, rules) { | ||
| let hasEmail = false; | ||
| let hasPromptInjection = false; | ||
| for (const rule of rules) { | ||
| if (rule.type === "EMAIL") { | ||
| hasEmail = true; | ||
| } | ||
| if (rule.type === "PROMPT_INJECTION_DETECTION") { | ||
| hasPromptInjection = true; | ||
| } | ||
| } | ||
| // If an email rule is configured, we double the timeout. | ||
| // See https://github.com/arcjet/arcjet-js/issues/1697 | ||
| let result = hasEmail ? timeout * 2 : timeout; | ||
| if (hasPromptInjection) { | ||
| // We document the latency of this rule independently from other | ||
| // `protect` calls, so we enforce a minimum timeout of 1 second. | ||
| result = Math.max(result, 1_000); | ||
| } | ||
| return result; | ||
| } | ||
| function createClient(options) { | ||
| const { transport, sdkVersion, baseUrl, timeout } = options; | ||
| const sdkStack = ArcjetStackToProtocol(options.sdkStack); | ||
| const client = createClient$1(DecideService, transport); | ||
| return Object.freeze({ | ||
| async decide(context, details, rules) { | ||
| const { log } = context; | ||
| const protoRules = []; | ||
| for (const rule of rules) { | ||
| protoRules.push(ArcjetRuleToProtocol(rule)); | ||
| } | ||
| const cleanDetails = { | ||
| ip: details.ip, | ||
| method: details.method, | ||
| protocol: details.protocol, | ||
| host: details.host, | ||
| path: details.path, | ||
| headers: Object.fromEntries(details.headers.entries()), | ||
| cookies: details.cookies, | ||
| query: details.query, | ||
| extra: details.extra, | ||
| correlationId: details.correlationId ?? "", | ||
| }; | ||
| // Build the request object from the Protobuf generated class. | ||
| const decideRequest = create(DecideRequestSchema, { | ||
| sdkStack, | ||
| sdkVersion, | ||
| characteristics: context.characteristics, | ||
| // `email` is an optional field but not allowed to be `undefined`. | ||
| details: typeof details.email === "string" | ||
| ? { ...cleanDetails, email: details.email } | ||
| : cleanDetails, | ||
| rules: protoRules, | ||
| }); | ||
| log.debug("Decide request to %s", baseUrl); | ||
| const response = await client.decide(decideRequest, { | ||
| headers: { Authorization: `Bearer ${context.key}` }, | ||
| timeoutMs: decideTimeout(timeout, rules), | ||
| }); | ||
| const decision = ArcjetDecisionFromProtocol(response.decision); | ||
| log.debug({ | ||
| id: decision.id, | ||
| fingerprint: context.fingerprint, | ||
| path: details.path, | ||
| runtime: context.runtime, | ||
| ttl: decision.ttl, | ||
| conclusion: decision.conclusion, | ||
| reason: decision.reason, | ||
| ruleResults: decision.results, | ||
| }, "Decide response"); | ||
| return decision; | ||
| }, | ||
| report(context, details, decision, rules) { | ||
| const { log } = context; | ||
| const cleanDetails = { | ||
| ip: details.ip, | ||
| method: details.method, | ||
| protocol: details.protocol, | ||
| host: details.host, | ||
| path: details.path, | ||
| headers: Object.fromEntries(details.headers.entries()), | ||
| cookies: details.cookies, | ||
| query: details.query, | ||
| extra: details.extra, | ||
| correlationId: details.correlationId ?? "", | ||
| }; | ||
| // Build the request object from the Protobuf generated class. | ||
| const reportRequest = create(ReportRequestSchema, { | ||
| sdkStack, | ||
| sdkVersion, | ||
| characteristics: context.characteristics, | ||
| // `email` is an optional field but not allowed to be `undefined`. | ||
| details: typeof details.email === "string" | ||
| ? { ...cleanDetails, email: details.email } | ||
| : cleanDetails, | ||
| decision: ArcjetDecisionToProtocol(decision), | ||
| rules: rules.map(ArcjetRuleToProtocol), | ||
| }); | ||
| log.debug("Report request to %s", baseUrl); | ||
| // We use the promise API directly to avoid returning a promise from this | ||
| // function so execution can't be paused with `await` | ||
| const reportPromise = client | ||
| .report(reportRequest, { | ||
| headers: { Authorization: `Bearer ${context.key}` }, | ||
| // Rules don't execute during `Report` so we don't adjust the timeout | ||
| // if an email rule is configured. | ||
| timeoutMs: 2_000, // 2 seconds | ||
| }) | ||
| .then((response) => { | ||
| log.debug({ | ||
| id: decision.id, | ||
| fingerprint: context.fingerprint, | ||
| path: details.path, | ||
| runtime: context.runtime, | ||
| ttl: decision.ttl, | ||
| }, "Report response"); | ||
| }) | ||
| .catch((err) => { | ||
| log.info("Encountered problem sending report: %s", errorMessage(err)); | ||
| }); | ||
| if (typeof context.waitUntil === "function") { | ||
| context.waitUntil(reportPromise); | ||
| } | ||
| }, | ||
| }); | ||
| } | ||
| export { createClient, decideTimeout }; |
-20
| import { type Decision, type IpDetails, type Reason, type Rule, type RuleResult, Conclusion, EmailType, Mode, RuleState, SDKStack } from "./proto/decide/v1alpha1/decide_pb.js"; | ||
| import { type ArcjetConclusion, type ArcjetEmailType, type ArcjetMode, type ArcjetRuleState, type ArcjetRule, type ArcjetStack, ArcjetDecision, ArcjetIpDetails, ArcjetReason, ArcjetRuleResult } from "./index.js"; | ||
| export declare function ArcjetModeToProtocol(mode: ArcjetMode): Mode; | ||
| export declare function ArcjetEmailTypeToProtocol(emailType: ArcjetEmailType): EmailType; | ||
| export declare function ArcjetEmailTypeFromProtocol(emailType: EmailType): ArcjetEmailType; | ||
| export declare function ArcjetStackToProtocol(stack: ArcjetStack): SDKStack; | ||
| export declare function ArcjetRuleStateToProtocol(stack: ArcjetRuleState): RuleState; | ||
| export declare function ArcjetRuleStateFromProtocol(ruleState: RuleState): ArcjetRuleState; | ||
| export declare function ArcjetConclusionToProtocol(conclusion: ArcjetConclusion): Conclusion; | ||
| export declare function ArcjetConclusionFromProtocol(conclusion: Conclusion): ArcjetConclusion; | ||
| export declare function ArcjetReasonFromProtocol(proto?: Reason): ArcjetReason; | ||
| export declare function ArcjetReasonToProtocol(reason: ArcjetReason): Reason; | ||
| export declare function ArcjetRuleResultToProtocol(ruleResult: ArcjetRuleResult): RuleResult; | ||
| export declare function ArcjetRuleResultFromProtocol(proto: RuleResult): ArcjetRuleResult; | ||
| export declare function ArcjetDecisionToProtocol(decision: ArcjetDecision): Decision; | ||
| export declare function ArcjetIpDetailsFromProtocol(ipDetails?: IpDetails): ArcjetIpDetails; | ||
| export declare function ArcjetDecisionFromProtocol(decision?: Decision): ArcjetDecision; | ||
| export declare function ArcjetRuleToProtocol<Props extends { | ||
| [key: string]: unknown; | ||
| }>(rule: ArcjetRule<Props>): Rule; |
-647
| import { timestampFromDate, timestampDate } from '@bufbuild/protobuf/wkt'; | ||
| import { create } from '@bufbuild/protobuf'; | ||
| import { SDKStack, RuleSchema, RateLimitAlgorithm, DecisionSchema, Conclusion, Mode, EmailType, RuleResultSchema, ReasonSchema, RateLimitReasonSchema, BotV2ReasonSchema, EdgeRuleReasonSchema, ShieldReasonSchema, EmailReasonSchema, ErrorReasonSchema, SensitiveInfoReasonSchema, PromptInjectionReasonSchema, RuleState } from './proto/decide/v1alpha1/decide_pb.js'; | ||
| import { ArcjetErrorDecision, ArcjetIpDetails, ArcjetErrorReason, ArcjetChallengeDecision, ArcjetDenyDecision, ArcjetAllowDecision, ArcjetRuleResult, ArcjetReason, ArcjetPromptInjectionReason, ArcjetSensitiveInfoReason, ArcjetFilterReason, ArcjetEmailReason, ArcjetShieldReason, ArcjetEdgeRuleReason, ArcjetBotReason, ArcjetRateLimitReason } from './index.js'; | ||
| function ArcjetModeToProtocol(mode) { | ||
| switch (mode) { | ||
| case "LIVE": | ||
| return Mode.LIVE; | ||
| case "DRY_RUN": | ||
| return Mode.DRY_RUN; | ||
| default: { | ||
| return Mode.UNSPECIFIED; | ||
| } | ||
| } | ||
| } | ||
| function ArcjetEmailTypeToProtocol(emailType) { | ||
| switch (emailType) { | ||
| case "DISPOSABLE": | ||
| return EmailType.DISPOSABLE; | ||
| case "FREE": | ||
| return EmailType.FREE; | ||
| case "NO_MX_RECORDS": | ||
| return EmailType.NO_MX_RECORDS; | ||
| case "NO_GRAVATAR": | ||
| return EmailType.NO_GRAVATAR; | ||
| case "INVALID": | ||
| return EmailType.INVALID; | ||
| default: { | ||
| return EmailType.UNSPECIFIED; | ||
| } | ||
| } | ||
| } | ||
| function ArcjetEmailTypeFromProtocol(emailType) { | ||
| switch (emailType) { | ||
| case EmailType.UNSPECIFIED: | ||
| throw new Error("Invalid EmailType"); | ||
| case EmailType.DISPOSABLE: | ||
| return "DISPOSABLE"; | ||
| case EmailType.FREE: | ||
| return "FREE"; | ||
| case EmailType.NO_MX_RECORDS: | ||
| return "NO_MX_RECORDS"; | ||
| case EmailType.NO_GRAVATAR: | ||
| return "NO_GRAVATAR"; | ||
| case EmailType.INVALID: | ||
| return "INVALID"; | ||
| default: { | ||
| throw new Error("Invalid EmailType"); | ||
| } | ||
| } | ||
| } | ||
| function ArcjetStackToProtocol(stack) { | ||
| switch (stack) { | ||
| case "ASTRO": | ||
| return SDKStack.SDK_STACK_ASTRO; | ||
| case "BUN": | ||
| return SDKStack.SDK_STACK_BUN; | ||
| case "DENO": | ||
| return SDKStack.SDK_STACK_DENO; | ||
| case "FASTIFY": | ||
| return SDKStack.SDK_STACK_FASTIFY; | ||
| case "NEXTJS": | ||
| return SDKStack.SDK_STACK_NEXTJS; | ||
| case "NODEJS": | ||
| return SDKStack.SDK_STACK_NODEJS; | ||
| case "REACT_ROUTER": | ||
| return SDKStack.SDK_STACK_REACT_ROUTER; | ||
| case "REMIX": | ||
| return SDKStack.SDK_STACK_REMIX; | ||
| case "SVELTEKIT": | ||
| return SDKStack.SDK_STACK_SVELTEKIT; | ||
| case "NESTJS": | ||
| return SDKStack.SDK_STACK_NESTJS; | ||
| case "NUXT": | ||
| return SDKStack.SDK_STACK_NUXT; | ||
| default: { | ||
| return SDKStack.SDK_STACK_UNSPECIFIED; | ||
| } | ||
| } | ||
| } | ||
| function ArcjetRuleStateToProtocol(stack) { | ||
| switch (stack) { | ||
| case "RUN": | ||
| return RuleState.RUN; | ||
| case "NOT_RUN": | ||
| return RuleState.NOT_RUN; | ||
| case "CACHED": | ||
| return RuleState.CACHED; | ||
| case "DRY_RUN": | ||
| return RuleState.DRY_RUN; | ||
| default: { | ||
| return RuleState.UNSPECIFIED; | ||
| } | ||
| } | ||
| } | ||
| function ArcjetRuleStateFromProtocol(ruleState) { | ||
| switch (ruleState) { | ||
| case RuleState.UNSPECIFIED: | ||
| throw new Error("Invalid RuleState"); | ||
| case RuleState.RUN: | ||
| return "RUN"; | ||
| case RuleState.NOT_RUN: | ||
| return "NOT_RUN"; | ||
| case RuleState.DRY_RUN: | ||
| return "DRY_RUN"; | ||
| case RuleState.CACHED: | ||
| return "CACHED"; | ||
| default: { | ||
| throw new Error("Invalid RuleState"); | ||
| } | ||
| } | ||
| } | ||
| function ArcjetConclusionToProtocol(conclusion) { | ||
| switch (conclusion) { | ||
| case "ALLOW": | ||
| return Conclusion.ALLOW; | ||
| case "DENY": | ||
| return Conclusion.DENY; | ||
| case "CHALLENGE": | ||
| return Conclusion.CHALLENGE; | ||
| case "ERROR": | ||
| return Conclusion.ERROR; | ||
| default: { | ||
| return Conclusion.UNSPECIFIED; | ||
| } | ||
| } | ||
| } | ||
| function ArcjetConclusionFromProtocol(conclusion) { | ||
| switch (conclusion) { | ||
| case Conclusion.UNSPECIFIED: | ||
| throw new Error("Invalid Conclusion"); | ||
| case Conclusion.ALLOW: | ||
| return "ALLOW"; | ||
| case Conclusion.DENY: | ||
| return "DENY"; | ||
| case Conclusion.CHALLENGE: | ||
| return "CHALLENGE"; | ||
| case Conclusion.ERROR: | ||
| return "ERROR"; | ||
| default: { | ||
| throw new Error("Invalid Conclusion"); | ||
| } | ||
| } | ||
| } | ||
| function ArcjetReasonFromProtocol(proto) { | ||
| if (typeof proto === "undefined") { | ||
| return new ArcjetReason(); | ||
| } | ||
| if (typeof proto !== "object" || typeof proto.reason !== "object") { | ||
| throw new Error("Invalid Reason"); | ||
| } | ||
| switch (proto.reason.case) { | ||
| case "rateLimit": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetRateLimitReason({ | ||
| max: reason.max, | ||
| remaining: reason.remaining, | ||
| reset: reason.resetInSeconds, | ||
| window: reason.windowInSeconds, | ||
| resetTime: reason.resetTime | ||
| ? timestampDate(reason.resetTime) | ||
| : undefined, | ||
| }); | ||
| } | ||
| case "botV2": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetBotReason({ | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| verified: reason.verified, | ||
| spoofed: reason.spoofed, | ||
| }); | ||
| } | ||
| case "edgeRule": { | ||
| return new ArcjetEdgeRuleReason(); | ||
| } | ||
| case "shield": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetShieldReason({ | ||
| shieldTriggered: reason.shieldTriggered, | ||
| }); | ||
| } | ||
| case "email": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetEmailReason({ | ||
| emailTypes: reason.emailTypes.map(ArcjetEmailTypeFromProtocol), | ||
| }); | ||
| } | ||
| case "filter": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetFilterReason({ | ||
| matchedExpressions: reason.matchedExpressions || | ||
| (reason.matchedExpression ? [reason.matchedExpression] : []), | ||
| undeterminedExpressions: reason.undeterminedExpressions, | ||
| }); | ||
| } | ||
| case "sensitiveInfo": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetSensitiveInfoReason({ | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| }); | ||
| } | ||
| case "promptInjection": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetPromptInjectionReason({ | ||
| injectionDetected: reason.injectionDetected, | ||
| score: reason.score, | ||
| }); | ||
| } | ||
| case "bot": { | ||
| return new ArcjetErrorReason("bot detection v1 is deprecated"); | ||
| } | ||
| case "error": { | ||
| const reason = proto.reason.value; | ||
| return new ArcjetErrorReason(reason.message); | ||
| } | ||
| case undefined: { | ||
| return new ArcjetReason(); | ||
| } | ||
| default: { | ||
| proto.reason; | ||
| return new ArcjetReason(); | ||
| } | ||
| } | ||
| } | ||
| function ArcjetReasonToProtocol(reason) { | ||
| if (reason.isRateLimit()) { | ||
| const cleanOptions = { | ||
| max: reason.max, | ||
| remaining: reason.remaining, | ||
| resetInSeconds: reason.reset, | ||
| windowInSeconds: reason.window, | ||
| }; | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "rateLimit", | ||
| // `resetTime` is an optional field but not allowed to be `undefined`. | ||
| value: create(RateLimitReasonSchema, reason.resetTime | ||
| ? { | ||
| ...cleanOptions, | ||
| resetTime: timestampFromDate(reason.resetTime), | ||
| } | ||
| : cleanOptions), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isBot()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "botV2", | ||
| value: create(BotV2ReasonSchema, { | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| verified: reason.verified, | ||
| spoofed: reason.spoofed, | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isEdgeRule()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "edgeRule", | ||
| value: create(EdgeRuleReasonSchema), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isShield()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "shield", | ||
| value: create(ShieldReasonSchema, { | ||
| shieldTriggered: reason.shieldTriggered, | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isEmail()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "email", | ||
| value: create(EmailReasonSchema, { | ||
| emailTypes: reason.emailTypes.map(ArcjetEmailTypeToProtocol), | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isError()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "error", | ||
| value: create(ErrorReasonSchema, { | ||
| message: reason.message, | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isFilter()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "filter", | ||
| value: { | ||
| matchedExpressions: reason.matchedExpressions, | ||
| undeterminedExpressions: reason.undeterminedExpressions, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isSensitiveInfo()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "sensitiveInfo", | ||
| value: create(SensitiveInfoReasonSchema, { | ||
| allowed: reason.allowed, | ||
| denied: reason.denied, | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| if (reason.isPromptInjection()) { | ||
| return create(ReasonSchema, { | ||
| reason: { | ||
| case: "promptInjection", | ||
| value: create(PromptInjectionReasonSchema, { | ||
| injectionDetected: reason.injectionDetected, | ||
| score: reason.score ?? 0.0, | ||
| }), | ||
| }, | ||
| }); | ||
| } | ||
| return create(ReasonSchema); | ||
| } | ||
| function ArcjetRuleResultToProtocol(ruleResult) { | ||
| return create(RuleResultSchema, { | ||
| ruleId: ruleResult.ruleId, | ||
| fingerprint: ruleResult.fingerprint, | ||
| ttl: ruleResult.ttl, | ||
| state: ArcjetRuleStateToProtocol(ruleResult.state), | ||
| conclusion: ArcjetConclusionToProtocol(ruleResult.conclusion), | ||
| reason: ArcjetReasonToProtocol(ruleResult.reason), | ||
| }); | ||
| } | ||
| function ArcjetRuleResultFromProtocol(proto) { | ||
| return new ArcjetRuleResult({ | ||
| ruleId: proto.ruleId, | ||
| fingerprint: proto.fingerprint, | ||
| ttl: proto.ttl, | ||
| state: ArcjetRuleStateFromProtocol(proto.state), | ||
| conclusion: ArcjetConclusionFromProtocol(proto.conclusion), | ||
| reason: ArcjetReasonFromProtocol(proto.reason), | ||
| }); | ||
| } | ||
| function ArcjetDecisionToProtocol(decision) { | ||
| return create(DecisionSchema, { | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| conclusion: ArcjetConclusionToProtocol(decision.conclusion), | ||
| reason: ArcjetReasonToProtocol(decision.reason), | ||
| ruleResults: decision.results.map(ArcjetRuleResultToProtocol), | ||
| }); | ||
| } | ||
| function ArcjetIpDetailsFromProtocol(ipDetails) { | ||
| if (!ipDetails) { | ||
| return new ArcjetIpDetails(); | ||
| } | ||
| // A default value from the Decide service means we don't have data for the | ||
| // field so we translate to `undefined`. Some fields have interconnected logic | ||
| // that determines if the default value can be provided to users. | ||
| return new ArcjetIpDetails({ | ||
| // If we have a non-0 latitude, or a 0 latitude with a non-0 accuracy radius | ||
| // then we have a latitude from the Decide service | ||
| latitude: ipDetails.latitude || ipDetails.accuracyRadius | ||
| ? ipDetails.latitude | ||
| : undefined, | ||
| // If we have a non-0 longitude, or a 0 longitude with a non-0 accuracy | ||
| // radius then we have a longitude from the Decide service | ||
| longitude: ipDetails.longitude || ipDetails.accuracyRadius | ||
| ? ipDetails.longitude | ||
| : undefined, | ||
| // If we have a non-0 latitude/longitude/accuracyRadius, we assume that the | ||
| // accuracyRadius value was set | ||
| accuracyRadius: ipDetails.longitude || ipDetails.latitude || ipDetails.accuracyRadius | ||
| ? ipDetails.accuracyRadius | ||
| : undefined, | ||
| timezone: ipDetails.timezone !== "" ? ipDetails.timezone : undefined, | ||
| postalCode: ipDetails.postalCode !== "" ? ipDetails.postalCode : undefined, | ||
| city: ipDetails.city !== "" ? ipDetails.city : undefined, | ||
| region: ipDetails.region !== "" ? ipDetails.region : undefined, | ||
| country: ipDetails.country !== "" ? ipDetails.country : undefined, | ||
| countryName: ipDetails.countryName !== "" ? ipDetails.countryName : undefined, | ||
| continent: ipDetails.continent !== "" ? ipDetails.continent : undefined, | ||
| continentName: ipDetails.continentName !== "" ? ipDetails.continentName : undefined, | ||
| asn: ipDetails.asn !== "" ? ipDetails.asn : undefined, | ||
| asnName: ipDetails.asnName !== "" ? ipDetails.asnName : undefined, | ||
| asnDomain: ipDetails.asnDomain !== "" ? ipDetails.asnDomain : undefined, | ||
| asnType: ipDetails.asnType !== "" ? ipDetails.asnType : undefined, | ||
| asnCountry: ipDetails.asnCountry !== "" ? ipDetails.asnCountry : undefined, | ||
| service: ipDetails.service !== "" ? ipDetails.service : undefined, | ||
| isHosting: ipDetails.isHosting, | ||
| isVpn: ipDetails.isVpn, | ||
| isProxy: ipDetails.isProxy, | ||
| isTor: ipDetails.isTor, | ||
| isRelay: ipDetails.isRelay, | ||
| isAbuser: ipDetails.isAbuser, | ||
| }); | ||
| } | ||
| function ArcjetDecisionFromProtocol(decision) { | ||
| if (typeof decision === "undefined") { | ||
| return new ArcjetErrorDecision({ | ||
| reason: new ArcjetErrorReason("Missing Decision"), | ||
| ttl: 0, | ||
| results: [], | ||
| ip: new ArcjetIpDetails(), | ||
| }); | ||
| } | ||
| const results = Array.isArray(decision.ruleResults) | ||
| ? decision.ruleResults.map(ArcjetRuleResultFromProtocol) | ||
| : []; | ||
| switch (decision.conclusion) { | ||
| case Conclusion.ALLOW: | ||
| return new ArcjetAllowDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| case Conclusion.DENY: | ||
| return new ArcjetDenyDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| case Conclusion.CHALLENGE: | ||
| return new ArcjetChallengeDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: ArcjetReasonFromProtocol(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| case Conclusion.ERROR: | ||
| return new ArcjetErrorDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: new ArcjetErrorReason(decision.reason), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| case Conclusion.UNSPECIFIED: | ||
| return new ArcjetErrorDecision({ | ||
| id: decision.id, | ||
| ttl: decision.ttl, | ||
| reason: new ArcjetErrorReason("Invalid Conclusion"), | ||
| results, | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| default: { | ||
| decision.conclusion; | ||
| return new ArcjetErrorDecision({ | ||
| ttl: 0, | ||
| reason: new ArcjetErrorReason("Missing Conclusion"), | ||
| results: [], | ||
| ip: ArcjetIpDetailsFromProtocol(decision.ipDetails), | ||
| }); | ||
| } | ||
| } | ||
| } | ||
| function isRateLimitRule(rule) { | ||
| return rule.type === "RATE_LIMIT"; | ||
| } | ||
| function isTokenBucketRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "TOKEN_BUCKET"; | ||
| } | ||
| function isFixedWindowRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "FIXED_WINDOW"; | ||
| } | ||
| function isSlidingWindowRule(rule) { | ||
| return isRateLimitRule(rule) && rule.algorithm === "SLIDING_WINDOW"; | ||
| } | ||
| function isBotRule(rule) { | ||
| return rule.type === "BOT"; | ||
| } | ||
| function isEmailRule(rule) { | ||
| return rule.type === "EMAIL"; | ||
| } | ||
| /** | ||
| * Check if a rule is a filter rule. | ||
| * | ||
| * @param rule | ||
| * Rule. | ||
| * @returns | ||
| * Whether `rule` is a filter rule. | ||
| */ | ||
| function isFilterRule(rule) { | ||
| return rule.type === "FILTER"; | ||
| } | ||
| function isShieldRule(rule) { | ||
| return rule.type === "SHIELD"; | ||
| } | ||
| function isSensitiveInfoRule(rule) { | ||
| return rule.type === "SENSITIVE_INFO"; | ||
| } | ||
| function isPromptInjectionRule(rule) { | ||
| return rule.type === "PROMPT_INJECTION_DETECTION"; | ||
| } | ||
| function ArcjetRuleToProtocol(rule) { | ||
| if (isTokenBucketRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.TOKEN_BUCKET, | ||
| refillRate: rule.refillRate, | ||
| interval: rule.interval, | ||
| capacity: rule.capacity, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isFixedWindowRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.FIXED_WINDOW, | ||
| max: rule.max, | ||
| windowInSeconds: rule.window, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isSlidingWindowRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "rateLimit", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| characteristics: rule.characteristics || [], | ||
| algorithm: RateLimitAlgorithm.SLIDING_WINDOW, | ||
| max: rule.max, | ||
| interval: rule.interval, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isEmailRule(rule)) { | ||
| const allow = Array.isArray(rule.allow) | ||
| ? rule.allow.map(ArcjetEmailTypeToProtocol) | ||
| : []; | ||
| const deny = Array.isArray(rule.deny) | ||
| ? rule.deny.map(ArcjetEmailTypeToProtocol) | ||
| : []; | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "email", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow, | ||
| deny, | ||
| requireTopLevelDomain: rule.requireTopLevelDomain, | ||
| allowDomainLiteral: rule.allowDomainLiteral, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isBotRule(rule)) { | ||
| const allow = Array.isArray(rule.allow) ? rule.allow : []; | ||
| const deny = Array.isArray(rule.deny) ? rule.deny : []; | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "botV2", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow, | ||
| deny, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isShieldRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "shield", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| autoAdded: false, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isFilterRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "filter", | ||
| value: { | ||
| allow: [...rule.allow], | ||
| deny: [...rule.deny], | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| version: rule.version, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isSensitiveInfoRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "sensitiveInfo", | ||
| value: { | ||
| version: rule.version, | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| allow: rule.allow, | ||
| deny: rule.deny, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| if (isPromptInjectionRule(rule)) { | ||
| return create(RuleSchema, { | ||
| rule: { | ||
| case: "promptInjectionDetection", | ||
| value: { | ||
| mode: ArcjetModeToProtocol(rule.mode), | ||
| threshold: rule.threshold ?? 0.5, | ||
| version: rule.version, | ||
| }, | ||
| }, | ||
| }); | ||
| } | ||
| return create(RuleSchema); | ||
| } | ||
| export { ArcjetConclusionFromProtocol, ArcjetConclusionToProtocol, ArcjetDecisionFromProtocol, ArcjetDecisionToProtocol, ArcjetEmailTypeFromProtocol, ArcjetEmailTypeToProtocol, ArcjetIpDetailsFromProtocol, ArcjetModeToProtocol, ArcjetReasonFromProtocol, ArcjetReasonToProtocol, ArcjetRuleResultFromProtocol, ArcjetRuleResultToProtocol, ArcjetRuleStateFromProtocol, ArcjetRuleStateToProtocol, ArcjetRuleToProtocol, ArcjetStackToProtocol }; |
-1468
| import type { Cache } from "@arcjet/cache"; | ||
| export type * from "./well-known-bots.js"; | ||
| export { categories as botCategories } from "./well-known-bots.js"; | ||
| type RequiredProps<T, K extends keyof T> = { | ||
| [P in K]-?: Exclude<T[P], undefined>; | ||
| }; | ||
| /** | ||
| * Mode of a rule. | ||
| */ | ||
| export type ArcjetMode = "LIVE" | "DRY_RUN"; | ||
| /** | ||
| * Names of different rate limit algorithms. | ||
| */ | ||
| export type ArcjetRateLimitAlgorithm = "TOKEN_BUCKET" | "FIXED_WINDOW" | "SLIDING_WINDOW"; | ||
| /** | ||
| * Kinds of email addresses. | ||
| */ | ||
| export type ArcjetEmailType = "DISPOSABLE" | "FREE" | "NO_MX_RECORDS" | "NO_GRAVATAR" | "INVALID"; | ||
| /** | ||
| * Sensitive info identified by Arcjet. | ||
| */ | ||
| export type ArcjetIdentifiedEntity = { | ||
| /** | ||
| * Start index into value. | ||
| */ | ||
| start: number; | ||
| /** | ||
| * End index into value. | ||
| */ | ||
| end: number; | ||
| /** | ||
| * Kind of the identified entity. | ||
| */ | ||
| identifiedType: string; | ||
| }; | ||
| /** | ||
| * Names of integrations supported by Arcjet. | ||
| */ | ||
| export type ArcjetStack = "ASTRO" | "BUN" | "DENO" | "FASTIFY" | "NESTJS" | "NEXTJS" | "NODEJS" | "NUXT" | "REACT_ROUTER" | "REMIX" | "SVELTEKIT"; | ||
| /** | ||
| * State of a rule after calling it. | ||
| */ | ||
| export type ArcjetRuleState = "RUN" | "NOT_RUN" | "CACHED" | "DRY_RUN"; | ||
| /** | ||
| * Conclusion of a rule after calling it. | ||
| */ | ||
| export type ArcjetConclusion = "ALLOW" | "DENY" | "CHALLENGE" | "ERROR"; | ||
| /** | ||
| * Kinds of sensitive info. | ||
| */ | ||
| export type ArcjetSensitiveInfoType = "EMAIL" | "PHONE_NUMBER" | "IP_ADDRESS" | "CREDIT_CARD_NUMBER"; | ||
| /** | ||
| * Reason returned by a rule. | ||
| */ | ||
| export declare class ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type?: "RATE_LIMIT" | "BOT" | "EDGE_RULE" | "SHIELD" | "EMAIL" | "ERROR" | "FILTER" | "SENSITIVE_INFO" | "PROMPT_INJECTION_DETECTION" | undefined; | ||
| /** | ||
| * Check if this reason is a sensitive info reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a sensitive info reason. | ||
| */ | ||
| isSensitiveInfo(): this is ArcjetSensitiveInfoReason; | ||
| /** | ||
| * Check if this reason is a rate limit reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a rate limit reason. | ||
| */ | ||
| isRateLimit(): this is ArcjetRateLimitReason; | ||
| /** | ||
| * Check if this reason is a bot reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a bot reason. | ||
| */ | ||
| isBot(): this is ArcjetBotReason; | ||
| /** | ||
| * Check if this reason is an edge rule reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an edge rule reason. | ||
| */ | ||
| isEdgeRule(): this is ArcjetEdgeRuleReason; | ||
| /** | ||
| * Check if this reason is a shield reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a shield reason. | ||
| */ | ||
| isShield(): this is ArcjetShieldReason; | ||
| /** | ||
| * Check if this reason is an email reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an email reason. | ||
| */ | ||
| isEmail(): this is ArcjetEmailReason; | ||
| /** | ||
| * Check if this reason is an error reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an error reason. | ||
| */ | ||
| isError(): this is ArcjetErrorReason; | ||
| /** | ||
| * Check if this is a filter reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a filter reason. | ||
| */ | ||
| isFilter(): this is ArcjetFilterReason; | ||
| /** | ||
| * Check if this is a prompt injection reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a prompt injection reason. | ||
| */ | ||
| isPromptInjection(): this is ArcjetPromptInjectionReason; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetFilterReason`. | ||
| */ | ||
| interface ArcjetFilterReasonInit { | ||
| /** | ||
| * Expression that matched. | ||
| */ | ||
| matchedExpressions: Array<string>; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions: Array<string>; | ||
| } | ||
| /** | ||
| * Filter reason. | ||
| */ | ||
| export declare class ArcjetFilterReason extends ArcjetReason { | ||
| /** | ||
| * Expressions that matched. | ||
| */ | ||
| matchedExpressions: string[]; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "FILTER"; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions: string[]; | ||
| /** | ||
| * Create a filter reason. | ||
| * | ||
| * @param init | ||
| * Expression that matched. | ||
| * @returns | ||
| * Filter reason. | ||
| */ | ||
| constructor(init: ArcjetFilterReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetPromptInjectionReason`. | ||
| */ | ||
| interface ArcjetPromptInjectionReasonInit { | ||
| /** | ||
| * Whether a prompt injection attempt was detected in the input. | ||
| */ | ||
| injectionDetected?: boolean | undefined; | ||
| /** | ||
| * The prompt injection confidence score, scaled to [0, 1]. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score?: number | undefined; | ||
| } | ||
| /** | ||
| * Prompt injection reason. | ||
| */ | ||
| export declare class ArcjetPromptInjectionReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * Whether a prompt injection attempt was detected. | ||
| */ | ||
| injectionDetected: boolean; | ||
| /** | ||
| * The prompt injection confidence score. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score?: number; | ||
| /** | ||
| * Create a prompt injection reason. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Prompt injection reason. | ||
| */ | ||
| constructor(init: ArcjetPromptInjectionReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetSensitiveInfoReason`. | ||
| */ | ||
| interface ArcjetSensitiveInfoReasonInit { | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied: ArcjetIdentifiedEntity[]; | ||
| } | ||
| /** | ||
| * Sensitive info reason. | ||
| */ | ||
| export declare class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SENSITIVE_INFO"; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed: ArcjetIdentifiedEntity[]; | ||
| /** | ||
| * Create an `ArcjetSensitiveInfoReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Sensitive info reason. | ||
| */ | ||
| constructor(init: ArcjetSensitiveInfoReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetRateLimitReason`. | ||
| */ | ||
| interface ArcjetRateLimitReasonInit { | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset: number; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window: number; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime?: Date | undefined; | ||
| } | ||
| /** | ||
| * Rate limit reason. | ||
| */ | ||
| export declare class ArcjetRateLimitReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT"; | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset: number; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window: number; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime?: Date | undefined; | ||
| /** | ||
| * Create an `ArcjetRateLimitReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rate limit reason. | ||
| */ | ||
| constructor(init: ArcjetRateLimitReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetBotReason`. | ||
| */ | ||
| interface ArcjetBotReasonInit { | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed: Array<string>; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied: Array<string>; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed: boolean; | ||
| } | ||
| /** | ||
| * Bot reason. | ||
| */ | ||
| export declare class ArcjetBotReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "BOT"; | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed: Array<string>; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied: Array<string>; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed: boolean; | ||
| /** | ||
| * Create an `ArcjetBotReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Bot reason. | ||
| */ | ||
| constructor(init: ArcjetBotReasonInit); | ||
| /** | ||
| * Check if the bot is verified. | ||
| * | ||
| * @returns | ||
| * Whether the bot is verified. | ||
| */ | ||
| isVerified(): boolean; | ||
| /** | ||
| * Check if the bot is spoofed. | ||
| * | ||
| * @returns | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| isSpoofed(): boolean; | ||
| } | ||
| /** | ||
| * Edge rule reason. | ||
| * | ||
| * @deprecated | ||
| * This reason is currently not used. | ||
| */ | ||
| export declare class ArcjetEdgeRuleReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EDGE_RULE"; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetShieldReason`. | ||
| */ | ||
| interface ArcjetShieldReasonInit { | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Shield reason. | ||
| */ | ||
| export declare class ArcjetShieldReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SHIELD"; | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered: boolean; | ||
| /** | ||
| * Create an `ArcjetShieldReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Shield reason. | ||
| */ | ||
| constructor(init: ArcjetShieldReasonInit); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetEmailReason`. | ||
| */ | ||
| interface ArcjetEmailReasonInit { | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes?: ArcjetEmailType[] | undefined; | ||
| } | ||
| /** | ||
| * Email reason. | ||
| */ | ||
| export declare class ArcjetEmailReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EMAIL"; | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes: ArcjetEmailType[]; | ||
| /** | ||
| * Create an `ArcjetEmailReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Email reason. | ||
| */ | ||
| constructor(init: ArcjetEmailReasonInit); | ||
| } | ||
| /** | ||
| * Error reason. | ||
| */ | ||
| export declare class ArcjetErrorReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "ERROR"; | ||
| /** | ||
| * Error message. | ||
| */ | ||
| message: string; | ||
| /** | ||
| * Create an `ArcjetErrorReason`. | ||
| * | ||
| * @param error | ||
| * Error that occurred. | ||
| * @returns | ||
| * Error reason. | ||
| */ | ||
| constructor(error: unknown); | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetRuleResult`. | ||
| */ | ||
| interface ArcjetRuleResultInit { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state: ArcjetRuleState; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Result of calling a rule. | ||
| */ | ||
| export declare class ArcjetRuleResult { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state: ArcjetRuleState; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetRuleResult`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rule result. | ||
| */ | ||
| constructor(init: ArcjetRuleResultInit); | ||
| /** | ||
| * Check if the rule result is denied. | ||
| * | ||
| * @returns | ||
| * Whether the rule result is denied. | ||
| */ | ||
| isDenied(): boolean; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetIpDetails`. | ||
| */ | ||
| interface ArcjetIpDetailsInit { | ||
| latitude?: number | undefined; | ||
| longitude?: number | undefined; | ||
| accuracyRadius?: number | undefined; | ||
| timezone?: string | undefined; | ||
| postalCode?: string | undefined; | ||
| city?: string | undefined; | ||
| region?: string | undefined; | ||
| country?: string | undefined; | ||
| countryName?: string | undefined; | ||
| continent?: string | undefined; | ||
| continentName?: string | undefined; | ||
| asn?: string | undefined; | ||
| asnName?: string | undefined; | ||
| asnDomain?: string | undefined; | ||
| asnType?: string | undefined; | ||
| asnCountry?: string | undefined; | ||
| service?: string | undefined; | ||
| isHosting?: boolean | undefined; | ||
| isVpn?: boolean | undefined; | ||
| isProxy?: boolean | undefined; | ||
| isTor?: boolean | undefined; | ||
| isRelay?: boolean | undefined; | ||
| isAbuser?: boolean | undefined; | ||
| } | ||
| /** | ||
| * Info about an IP address. | ||
| */ | ||
| export declare class ArcjetIpDetails { | ||
| /** | ||
| * Estimated latitude of the IP address within the `accuracyRadius` margin | ||
| * of error. | ||
| */ | ||
| latitude?: number | undefined; | ||
| /** | ||
| * Estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| */ | ||
| longitude?: number | undefined; | ||
| /** | ||
| * Accuracy radius of the IP address location in kilometers. | ||
| */ | ||
| accuracyRadius?: number | undefined; | ||
| /** | ||
| * Timezone of the IP address. | ||
| */ | ||
| timezone?: string | undefined; | ||
| /** | ||
| * Postal code of the IP address. | ||
| */ | ||
| postalCode?: string | undefined; | ||
| /** | ||
| * City the IP address is located in. | ||
| */ | ||
| city?: string | undefined; | ||
| /** | ||
| * Region the IP address is located in. | ||
| */ | ||
| region?: string | undefined; | ||
| /** | ||
| * Country code the IP address is located in. | ||
| */ | ||
| country?: string | undefined; | ||
| /** | ||
| * Country name the IP address is located in. | ||
| */ | ||
| countryName?: string | undefined; | ||
| /** | ||
| * Continent code the IP address is located in. | ||
| */ | ||
| continent?: string | undefined; | ||
| /** | ||
| * Continent name the IP address is located in. | ||
| */ | ||
| continentName?: string | undefined; | ||
| /** | ||
| * AS number the IP address belongs to. | ||
| */ | ||
| asn?: string | undefined; | ||
| /** | ||
| * AS name the IP address belongs to. | ||
| */ | ||
| asnName?: string | undefined; | ||
| /** | ||
| * ASN domain the IP address belongs to. | ||
| */ | ||
| asnDomain?: string | undefined; | ||
| /** | ||
| * ASN type: ISP, hosting, business, or education | ||
| */ | ||
| asnType?: string | undefined; | ||
| /** | ||
| * ASN country code the IP address belongs to. | ||
| */ | ||
| asnCountry?: string | undefined; | ||
| /** | ||
| * Name of service the IP address belongs to. | ||
| */ | ||
| service?: string | undefined; | ||
| /** | ||
| * Create an `ArcjetIpDetails`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * IP details. | ||
| */ | ||
| constructor(init?: ArcjetIpDetailsInit); | ||
| /** | ||
| * Check if the IP address has geo `latitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has latitude info. | ||
| */ | ||
| hasLatitude(): this is RequiredProps<this, "latitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has geo `longitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has longitude info. | ||
| */ | ||
| hasLongitude(): this is RequiredProps<this, "longitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has geo accuracy radius info. | ||
| * This also implies that `latitude` and `longitude` are available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has accuracy info. | ||
| */ | ||
| hasAccuracyRadius(): this is RequiredProps<this, "latitude" | "longitude" | "accuracyRadius">; | ||
| /** | ||
| * Check if the IP address has timezone info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has timezone info. | ||
| */ | ||
| hasTimezone(): this is RequiredProps<this, "timezone">; | ||
| /** | ||
| * Check if the IP address has postcal code info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has postcal code info. | ||
| */ | ||
| hasPostalCode(): this is RequiredProps<this, "postalCode">; | ||
| /** | ||
| * Check if the IP address has city info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has city info. | ||
| */ | ||
| hasCity(): this is RequiredProps<this, "city">; | ||
| /** | ||
| * Check if the IP address has region info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has region info. | ||
| */ | ||
| hasRegion(): this is RequiredProps<this, "region">; | ||
| /** | ||
| * Check if the IP address has country info: | ||
| * `countryName` and `country`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has country info. | ||
| */ | ||
| hasCountry(): this is RequiredProps<this, "country" | "countryName">; | ||
| /** | ||
| * Check if the IP address has continent info: | ||
| * `continentName` and `continent`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has continent info. | ||
| */ | ||
| hasContintent(): this is RequiredProps<this, "continent" | "continentName">; | ||
| /** | ||
| * Check if the IP address has ASN info. | ||
| * | ||
| * @deprecated | ||
| * Use `hasAsn()` instead. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasASN(): this is RequiredProps<this, "asn" | "asnName" | "asnDomain" | "asnType" | "asnCountry">; | ||
| /** | ||
| * Check if the IP address has ASN info: | ||
| * `asnCountry`, `asnDomain`, `asnName`, `asnType`, and `asn` fields. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasAsn(): this is RequiredProps<this, "asn" | "asnName" | "asnDomain" | "asnType" | "asnCountry">; | ||
| /** | ||
| * Check if the IP address has a service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has a service. | ||
| */ | ||
| hasService(): this is RequiredProps<this, "service">; | ||
| /** | ||
| * Check if the IP address belongs to a hosting provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a hosting provider. | ||
| */ | ||
| isHosting(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a VPN provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a VPN provider. | ||
| */ | ||
| isVpn(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a proxy provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a proxy provider. | ||
| */ | ||
| isProxy(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a Tor node. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a Tor node. | ||
| */ | ||
| isTor(): boolean; | ||
| /** | ||
| * Check if the IP address belongs to a relay service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a relay service. | ||
| */ | ||
| isRelay(): boolean; | ||
| /** | ||
| * Check if the IP address has been flagged as an abuser. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has been flagged as an abuser. | ||
| */ | ||
| isAbuser(): boolean; | ||
| } | ||
| /** | ||
| * Configuration for the basic `ArcjetDecision`. | ||
| */ | ||
| interface ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| */ | ||
| id?: string; | ||
| /** | ||
| * List of results from calling rules. | ||
| */ | ||
| results: ArcjetRuleResult[]; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * Details about the IP address. | ||
| */ | ||
| ip?: ArcjetIpDetails; | ||
| } | ||
| /** | ||
| * Configuration for most `ArcjetDecision`s. | ||
| */ | ||
| interface ArcjetDecisionInit extends ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Configuration for `ArcjetErrorDecision`. | ||
| */ | ||
| interface ArcjetErrorDecisionInit extends ArcjetDecisionInitAbstract { | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| reason: ArcjetErrorReason; | ||
| } | ||
| /** | ||
| * Decision returned by the Arcjet SDK. | ||
| */ | ||
| export declare abstract class ArcjetDecision { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| * This can be used to look up the decision in the Arcjet dashboard. | ||
| */ | ||
| id: string; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * List of results from calling rules. | ||
| * Can also be found by logging into the Arcjet dashboard and searching for the decision `id`. | ||
| */ | ||
| results: ArcjetRuleResult[]; | ||
| /** | ||
| * Details about the IP address that informed the `conclusion`. | ||
| */ | ||
| ip: ArcjetIpDetails; | ||
| /** | ||
| * Conclusion about the request. | ||
| */ | ||
| abstract conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason for the decision. | ||
| */ | ||
| abstract reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInitAbstract); | ||
| /** | ||
| * Check if the decision is allowed. | ||
| * This considers `ERROR` decisions as allowed too. | ||
| * | ||
| * @returns | ||
| * Whether the decision is allowed. | ||
| */ | ||
| isAllowed(): this is ArcjetAllowDecision | ArcjetErrorDecision; | ||
| /** | ||
| * Check if the decision is denied. | ||
| * | ||
| * @returns | ||
| * Whether the decision is denied. | ||
| */ | ||
| isDenied(): this is ArcjetDenyDecision; | ||
| /** | ||
| * Check if the decision is challenged. | ||
| * | ||
| * @returns | ||
| * Whether the decision is challenged. | ||
| */ | ||
| isChallenged(): this is ArcjetChallengeDecision; | ||
| /** | ||
| * Check if the decision is errored. | ||
| * This does **not** consider `ALLOW` as errored. | ||
| * | ||
| * @returns | ||
| * Whether the decision is errored. | ||
| */ | ||
| isErrored(): this is ArcjetErrorDecision; | ||
| } | ||
| /** | ||
| * Allow decision. | ||
| */ | ||
| export declare class ArcjetAllowDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "ALLOW"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetAllowDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Allow decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Deny decision. | ||
| */ | ||
| export declare class ArcjetDenyDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "DENY"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetDenyDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Deny decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Challenge decision. | ||
| */ | ||
| export declare class ArcjetChallengeDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "CHALLENGE"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetReason; | ||
| /** | ||
| * Create an `ArcjetChallengeDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Challenge decision. | ||
| */ | ||
| constructor(init: ArcjetDecisionInit); | ||
| } | ||
| /** | ||
| * Error decision. | ||
| */ | ||
| export declare class ArcjetErrorDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion: "ERROR"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason: ArcjetErrorReason; | ||
| /** | ||
| * Create an `ArcjetErrorDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Error decision. | ||
| */ | ||
| constructor(init: ArcjetErrorDecisionInit); | ||
| } | ||
| /** | ||
| * Request details. | ||
| */ | ||
| export interface ArcjetRequestDetails { | ||
| /** | ||
| * IP address (IPv4 or IPv6). | ||
| */ | ||
| ip: string; | ||
| /** | ||
| * HTTP method (such as `GET`). | ||
| */ | ||
| method: string; | ||
| /** | ||
| * Protocol (such as `"http:"`). | ||
| */ | ||
| protocol: string; | ||
| /** | ||
| * Hostname (such as `"example.com"`). | ||
| */ | ||
| host: string; | ||
| /** | ||
| * Path (such as `"/path/to/resource"`). | ||
| */ | ||
| path: string; | ||
| /** | ||
| * Headers of the request. | ||
| * | ||
| * This is a [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object. | ||
| * This never includes cookies: those are stored separately. | ||
| */ | ||
| headers: Headers; | ||
| /** | ||
| * Cookies of the request (such as `"cookie1=value1; cookie2=value2"`). | ||
| */ | ||
| cookies: string; | ||
| /** | ||
| * Query string of the request (such as `"?q=alpha"`). | ||
| */ | ||
| query: string; | ||
| /** | ||
| * Extra info. | ||
| */ | ||
| extra: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * Email address of the user making the request. | ||
| */ | ||
| email?: string | undefined; | ||
| /** | ||
| * Optional, caller-supplied opaque identifier used to correlate this request | ||
| * with other `protect()` and `guard()` calls that belong to the same | ||
| * workflow, agent run, or multi-step task. | ||
| * | ||
| * It does not affect the decision and is excluded from the fingerprint (and | ||
| * therefore the decision cache key); it is stored alongside the recorded | ||
| * decision so a chain of actions can be reconstructed. | ||
| */ | ||
| correlationId?: string | undefined; | ||
| } | ||
| /** | ||
| * Arcjet rule. | ||
| * | ||
| * @template Props | ||
| * Extra properties passed to the rule. | ||
| */ | ||
| export type ArcjetRule<Props extends {} = {}> = { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT" | "BOT" | "EMAIL" | "FILTER" | "SHIELD" | "SENSITIVE_INFO" | string; | ||
| /** | ||
| * Mode. | ||
| */ | ||
| mode: ArcjetMode; | ||
| /** | ||
| * Priority. | ||
| */ | ||
| priority: number; | ||
| /** | ||
| * Version of rule. | ||
| */ | ||
| version: number; | ||
| /** | ||
| * Validate locally whether the rule can run. | ||
| * | ||
| * For example, the email rule requires an `email` field and throws if it is | ||
| * not passed. | ||
| * | ||
| * @param context | ||
| * Arcjet context. | ||
| * @param details | ||
| * Request details and extra properties. | ||
| * @returns | ||
| * Nothing. | ||
| * @throws | ||
| * If the rule cannot run. | ||
| */ | ||
| validate(context: ArcjetContext, details: unknown): asserts details is ArcjetRequestDetails & Props; | ||
| /** | ||
| * Run a rule locally. | ||
| * | ||
| * The result is used if it is a `LIVE` `DENY` result. | ||
| * In other cases the server is contacted to get results. | ||
| * | ||
| * @param context | ||
| * Arcjet context. | ||
| * @param details | ||
| * Request details and extra properties. | ||
| * @returns | ||
| * Promise to a rule result. | ||
| */ | ||
| protect(context: ArcjetContext, details: ArcjetRequestDetails & Props): Promise<ArcjetRuleResult>; | ||
| }; | ||
| /** | ||
| * Abstract rate limit rule. | ||
| */ | ||
| export interface ArcjetRateLimitRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "RATE_LIMIT"; | ||
| /** | ||
| * Algorithm used for rate limiting. | ||
| */ | ||
| algorithm: ArcjetRateLimitAlgorithm; | ||
| /** | ||
| * Characteristics of the rule. | ||
| */ | ||
| characteristics?: string[] | undefined; | ||
| } | ||
| /** | ||
| * Token bucket rate limit rule. | ||
| */ | ||
| export interface ArcjetTokenBucketRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "TOKEN_BUCKET"; | ||
| /** | ||
| * Tokens to add to the bucket at each interval. | ||
| */ | ||
| refillRate: number; | ||
| /** | ||
| * Interval in seconds to add tokens to the bucket. | ||
| */ | ||
| interval: number; | ||
| /** | ||
| * Max tokens the bucket can hold. | ||
| */ | ||
| capacity: number; | ||
| } | ||
| /** | ||
| * Fixed window rate limit rule. | ||
| */ | ||
| export interface ArcjetFixedWindowRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "FIXED_WINDOW"; | ||
| /** | ||
| * Max requests allowed in the time window. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Time window in seconds the rate limit applies to. | ||
| */ | ||
| window: number; | ||
| } | ||
| /** | ||
| * Sliding window rate limit rule. | ||
| */ | ||
| export interface ArcjetSlidingWindowRateLimitRule<Props extends {}> extends ArcjetRateLimitRule<Props> { | ||
| /** | ||
| * Algorithm kind. | ||
| */ | ||
| algorithm: "SLIDING_WINDOW"; | ||
| /** | ||
| * Max requests allowed in the time window. | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Time interval in seconds for the rate limit. | ||
| */ | ||
| interval: number; | ||
| } | ||
| /** | ||
| * Email rule. | ||
| */ | ||
| export interface ArcjetEmailRule<Props extends { | ||
| email: string; | ||
| }> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "EMAIL"; | ||
| /** | ||
| * Email types that are allowed. | ||
| */ | ||
| allow: ArcjetEmailType[]; | ||
| /** | ||
| * Email types that are not allowed. | ||
| */ | ||
| deny: ArcjetEmailType[]; | ||
| /** | ||
| * Whether to allow email addresses that contain a single domain segment. | ||
| * Something like `foo@bar` is not allowed when `true`. | ||
| * It is allowed when `false`. | ||
| */ | ||
| requireTopLevelDomain: boolean; | ||
| /** | ||
| * Whether to allow email addresses that contain a domain literal. | ||
| * Something like `foo@[192.168.1.1]` is allowed when `true`. | ||
| * It is not allowed when `false`. | ||
| */ | ||
| allowDomainLiteral: boolean; | ||
| } | ||
| /** | ||
| * Filter rule. | ||
| */ | ||
| export interface ArcjetFilterRule extends ArcjetRule<{ | ||
| filterLocal?: Record<string, string> | null | undefined; | ||
| }> { | ||
| /** | ||
| * List of expressions that allow a request when one matches and deny otherwise. | ||
| */ | ||
| allow: ReadonlyArray<string>; | ||
| /** | ||
| * List of expressions that deny a request when one matches and allow otherwise. | ||
| */ | ||
| deny: ReadonlyArray<string>; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "FILTER"; | ||
| } | ||
| /** | ||
| * Sensitive info rule. | ||
| */ | ||
| export interface ArcjetSensitiveInfoRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SENSITIVE_INFO"; | ||
| /** | ||
| * Allowed entities. | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * Denied entities. | ||
| */ | ||
| deny: string[]; | ||
| } | ||
| /** | ||
| * Bot rule. | ||
| */ | ||
| export interface ArcjetBotRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "BOT"; | ||
| /** | ||
| * Allowed bots. | ||
| */ | ||
| allow: Array<string>; | ||
| /** | ||
| * Denied bots. | ||
| */ | ||
| deny: Array<string>; | ||
| } | ||
| /** | ||
| * Shield rule. | ||
| */ | ||
| export interface ArcjetShieldRule<Props extends {}> extends ArcjetRule<Props> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "SHIELD"; | ||
| } | ||
| /** | ||
| * Prompt injection detection rule. | ||
| */ | ||
| export interface ArcjetPromptInjectionDetectionRule extends ArcjetRule<{ | ||
| detectPromptInjectionMessage: string; | ||
| }> { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type: "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * The score threshold above which a request is considered a prompt | ||
| * injection attempt. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| threshold?: number; | ||
| } | ||
| /** | ||
| * Arcjet logger interface. | ||
| * | ||
| * Some Pino-compatible functions are required but most of its interface is | ||
| * omitted. | ||
| * | ||
| * See `@arcjet/logger` for an implementation. | ||
| */ | ||
| export interface ArcjetLogger { | ||
| /** | ||
| * Debug. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| debug(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Debug. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| debug(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Info. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| info(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Info. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| info(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Warn. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| warn(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Warn. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| warn(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| /** | ||
| * Error. | ||
| * | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| error(msg: string, ...args: unknown[]): void; | ||
| /** | ||
| * Error. | ||
| * | ||
| * @param obj | ||
| * Merging object copied into the JSON log line. | ||
| * @param msg | ||
| * Template. | ||
| * @param args | ||
| * Parameters to interpolate. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| error(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void; | ||
| } | ||
| /** | ||
| * Objects that Arcjet core puts in the cache. | ||
| * | ||
| * Local results from `rule.protect` calls and remote results from | ||
| * `client.decide` are stored when they have a non-zero `ttl` and are a `DENY`. | ||
| */ | ||
| export interface ArcjetCacheEntry { | ||
| /** | ||
| * Conclusion. | ||
| */ | ||
| conclusion: ArcjetConclusion; | ||
| /** | ||
| * Reason. | ||
| */ | ||
| reason: ArcjetReason; | ||
| } | ||
| /** | ||
| * Arcjet context. | ||
| */ | ||
| export type ArcjetContext = { | ||
| /** | ||
| * Arbitrary indexing into context is currently allowed but not typed. | ||
| */ | ||
| [key: string]: unknown; | ||
| /** | ||
| * API key. | ||
| */ | ||
| key: string; | ||
| /** | ||
| * Fingerprint of request. | ||
| */ | ||
| fingerprint: string; | ||
| /** | ||
| * Detected runtime. | ||
| */ | ||
| runtime: string; | ||
| /** | ||
| * Logger to use. | ||
| */ | ||
| log: ArcjetLogger; | ||
| /** | ||
| * Global characteristics. | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * Cache to use. | ||
| */ | ||
| cache: Cache<ArcjetCacheEntry>; | ||
| /** | ||
| * Function to use to read a request. | ||
| */ | ||
| getBody(): Promise<string>; | ||
| /** | ||
| * Function called to wait for something. | ||
| * | ||
| * @param promise | ||
| * Promise to wait for. | ||
| * @returns | ||
| * Nothing. | ||
| */ | ||
| waitUntil?: ((promise: Promise<unknown>) => void) | undefined; | ||
| }; |
-961
| import { isMessage } from '@bufbuild/protobuf'; | ||
| import { ReasonSchema } from './proto/decide/v1alpha1/decide_pb.js'; | ||
| import { typeid } from './typeid.js'; | ||
| export { categories as botCategories } from './well-known-bots.js'; | ||
| /** | ||
| * Reason returned by a rule. | ||
| */ | ||
| class ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type; | ||
| /** | ||
| * Check if this reason is a sensitive info reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a sensitive info reason. | ||
| */ | ||
| isSensitiveInfo() { | ||
| return this.type === "SENSITIVE_INFO"; | ||
| } | ||
| /** | ||
| * Check if this reason is a rate limit reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a rate limit reason. | ||
| */ | ||
| isRateLimit() { | ||
| return this.type === "RATE_LIMIT"; | ||
| } | ||
| /** | ||
| * Check if this reason is a bot reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a bot reason. | ||
| */ | ||
| isBot() { | ||
| return this.type === "BOT"; | ||
| } | ||
| /** | ||
| * Check if this reason is an edge rule reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an edge rule reason. | ||
| */ | ||
| isEdgeRule() { | ||
| return this.type === "EDGE_RULE"; | ||
| } | ||
| /** | ||
| * Check if this reason is a shield reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is a shield reason. | ||
| */ | ||
| isShield() { | ||
| return this.type === "SHIELD"; | ||
| } | ||
| /** | ||
| * Check if this reason is an email reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an email reason. | ||
| */ | ||
| isEmail() { | ||
| return this.type === "EMAIL"; | ||
| } | ||
| /** | ||
| * Check if this reason is an error reason. | ||
| * | ||
| * @returns | ||
| * Whether this reason is an error reason. | ||
| */ | ||
| isError() { | ||
| return this.type === "ERROR"; | ||
| } | ||
| /** | ||
| * Check if this is a filter reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a filter reason. | ||
| */ | ||
| isFilter() { | ||
| return this.type === "FILTER"; | ||
| } | ||
| /** | ||
| * Check if this is a prompt injection reason. | ||
| * | ||
| * @returns | ||
| * Whether this is a prompt injection reason. | ||
| */ | ||
| isPromptInjection() { | ||
| return this.type === "PROMPT_INJECTION_DETECTION"; | ||
| } | ||
| } | ||
| /** | ||
| * Filter reason. | ||
| */ | ||
| class ArcjetFilterReason extends ArcjetReason { | ||
| /** | ||
| * Expressions that matched. | ||
| */ | ||
| matchedExpressions; | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "FILTER"; | ||
| /** | ||
| * Expression that could not be matched. | ||
| */ | ||
| undeterminedExpressions; | ||
| /** | ||
| * Create a filter reason. | ||
| * | ||
| * @param init | ||
| * Expression that matched. | ||
| * @returns | ||
| * Filter reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.matchedExpressions = init.matchedExpressions; | ||
| this.undeterminedExpressions = init.undeterminedExpressions; | ||
| } | ||
| } | ||
| /** | ||
| * Prompt injection reason. | ||
| */ | ||
| class ArcjetPromptInjectionReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "PROMPT_INJECTION_DETECTION"; | ||
| /** | ||
| * Whether a prompt injection attempt was detected. | ||
| */ | ||
| injectionDetected; | ||
| /** | ||
| * The prompt injection confidence score. | ||
| * | ||
| * @deprecated | ||
| * This field is no longer respected by the server and will be removed in | ||
| * a future release. | ||
| */ | ||
| score; | ||
| /** | ||
| * Create a prompt injection reason. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Prompt injection reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.injectionDetected = init.injectionDetected ?? false; | ||
| this.score = init.score ?? 0.0; | ||
| } | ||
| } | ||
| /** | ||
| * Sensitive info reason. | ||
| */ | ||
| class ArcjetSensitiveInfoReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "SENSITIVE_INFO"; | ||
| /** | ||
| * List of denied entities. | ||
| */ | ||
| denied; | ||
| /** | ||
| * List of allowed entities. | ||
| */ | ||
| allowed; | ||
| /** | ||
| * Create an `ArcjetSensitiveInfoReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Sensitive info reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.denied = init.denied; | ||
| this.allowed = init.allowed; | ||
| } | ||
| } | ||
| /** | ||
| * Rate limit reason. | ||
| */ | ||
| class ArcjetRateLimitReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "RATE_LIMIT"; | ||
| /** | ||
| * Maximum number of allowed requests. | ||
| */ | ||
| max; | ||
| /** | ||
| * Remaining number of requests. | ||
| */ | ||
| remaining; | ||
| /** | ||
| * Time in seconds until reset. | ||
| */ | ||
| reset; | ||
| /** | ||
| * Time in seconds until the window resets. | ||
| */ | ||
| window; | ||
| /** | ||
| * Time when the rate limit resets. | ||
| */ | ||
| resetTime; | ||
| /** | ||
| * Create an `ArcjetRateLimitReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rate limit reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.max = init.max; | ||
| this.remaining = init.remaining; | ||
| this.reset = init.reset; | ||
| this.window = init.window; | ||
| this.resetTime = init.resetTime; | ||
| } | ||
| } | ||
| /** | ||
| * Bot reason. | ||
| */ | ||
| class ArcjetBotReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "BOT"; | ||
| /** | ||
| * List of allowed bot identifiers. | ||
| */ | ||
| allowed; | ||
| /** | ||
| * List of denied bot identifiers. | ||
| */ | ||
| denied; | ||
| /** | ||
| * Whether the bot is verified. | ||
| */ | ||
| verified; | ||
| /** | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| spoofed; | ||
| /** | ||
| * Create an `ArcjetBotReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Bot reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.allowed = init.allowed; | ||
| this.denied = init.denied; | ||
| this.verified = init.verified; | ||
| this.spoofed = init.spoofed; | ||
| } | ||
| /** | ||
| * Check if the bot is verified. | ||
| * | ||
| * @returns | ||
| * Whether the bot is verified. | ||
| */ | ||
| isVerified() { | ||
| return this.verified; | ||
| } | ||
| /** | ||
| * Check if the bot is spoofed. | ||
| * | ||
| * @returns | ||
| * Whether the bot is spoofed. | ||
| */ | ||
| isSpoofed() { | ||
| return this.spoofed; | ||
| } | ||
| } | ||
| /** | ||
| * Edge rule reason. | ||
| * | ||
| * @deprecated | ||
| * This reason is currently not used. | ||
| */ | ||
| class ArcjetEdgeRuleReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "EDGE_RULE"; | ||
| } | ||
| /** | ||
| * Shield reason. | ||
| */ | ||
| class ArcjetShieldReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "SHIELD"; | ||
| /** | ||
| * Whether the shield was triggered. | ||
| */ | ||
| shieldTriggered; | ||
| /** | ||
| * Create an `ArcjetShieldReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Shield reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.shieldTriggered = init.shieldTriggered ?? false; | ||
| } | ||
| } | ||
| /** | ||
| * Email reason. | ||
| */ | ||
| class ArcjetEmailReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "EMAIL"; | ||
| /** | ||
| * List of email types that are allowed. | ||
| */ | ||
| emailTypes; | ||
| /** | ||
| * Create an `ArcjetEmailReason`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Email reason. | ||
| */ | ||
| constructor(init) { | ||
| super(); | ||
| this.emailTypes = init.emailTypes ?? []; | ||
| } | ||
| } | ||
| /** | ||
| * Error reason. | ||
| */ | ||
| class ArcjetErrorReason extends ArcjetReason { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| type = "ERROR"; | ||
| /** | ||
| * Error message. | ||
| */ | ||
| message; | ||
| /** | ||
| * Create an `ArcjetErrorReason`. | ||
| * | ||
| * @param error | ||
| * Error that occurred. | ||
| * @returns | ||
| * Error reason. | ||
| */ | ||
| constructor(error) { | ||
| super(); | ||
| if (isMessage(error, ReasonSchema)) { | ||
| this.message = | ||
| error.reason.case === "error" | ||
| ? error.reason.value.message | ||
| : "Missing error reason"; | ||
| return; | ||
| } | ||
| // TODO: Get rid of instanceof check | ||
| if (error instanceof Error) { | ||
| this.message = error.message; | ||
| return; | ||
| } | ||
| if (typeof error === "string") { | ||
| this.message = error; | ||
| return; | ||
| } | ||
| this.message = "Unknown error occurred"; | ||
| } | ||
| } | ||
| /** | ||
| * Result of calling a rule. | ||
| */ | ||
| class ArcjetRuleResult { | ||
| /** | ||
| * Stable, deterministic, and unique identifier of the rule that generated | ||
| * this result. | ||
| */ | ||
| ruleId; | ||
| /** | ||
| * Fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| */ | ||
| fingerprint; | ||
| /** | ||
| * Duration in seconds this result should be considered valid, also known | ||
| * as time-to-live. | ||
| */ | ||
| ttl; | ||
| /** | ||
| * State of the rule. | ||
| */ | ||
| state; | ||
| /** | ||
| * Conclusion of the rule. | ||
| */ | ||
| conclusion; | ||
| /** | ||
| * Reason for the conclusion. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetRuleResult`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Rule result. | ||
| */ | ||
| constructor(init) { | ||
| this.ruleId = init.ruleId; | ||
| this.fingerprint = init.fingerprint; | ||
| this.ttl = init.ttl; | ||
| this.state = init.state; | ||
| this.conclusion = init.conclusion; | ||
| this.reason = init.reason; | ||
| } | ||
| /** | ||
| * Check if the rule result is denied. | ||
| * | ||
| * @returns | ||
| * Whether the rule result is denied. | ||
| */ | ||
| isDenied() { | ||
| return this.conclusion === "DENY"; | ||
| } | ||
| } | ||
| /** | ||
| * Info about an IP address. | ||
| */ | ||
| class ArcjetIpDetails { | ||
| /** | ||
| * Estimated latitude of the IP address within the `accuracyRadius` margin | ||
| * of error. | ||
| */ | ||
| latitude; | ||
| /** | ||
| * Estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| */ | ||
| longitude; | ||
| /** | ||
| * Accuracy radius of the IP address location in kilometers. | ||
| */ | ||
| accuracyRadius; | ||
| /** | ||
| * Timezone of the IP address. | ||
| */ | ||
| timezone; | ||
| /** | ||
| * Postal code of the IP address. | ||
| */ | ||
| postalCode; | ||
| /** | ||
| * City the IP address is located in. | ||
| */ | ||
| city; | ||
| /** | ||
| * Region the IP address is located in. | ||
| */ | ||
| region; | ||
| /** | ||
| * Country code the IP address is located in. | ||
| */ | ||
| country; | ||
| /** | ||
| * Country name the IP address is located in. | ||
| */ | ||
| countryName; | ||
| /** | ||
| * Continent code the IP address is located in. | ||
| */ | ||
| continent; | ||
| /** | ||
| * Continent name the IP address is located in. | ||
| */ | ||
| continentName; | ||
| /** | ||
| * AS number the IP address belongs to. | ||
| */ | ||
| asn; | ||
| /** | ||
| * AS name the IP address belongs to. | ||
| */ | ||
| asnName; | ||
| /** | ||
| * ASN domain the IP address belongs to. | ||
| */ | ||
| asnDomain; | ||
| /** | ||
| * ASN type: ISP, hosting, business, or education | ||
| */ | ||
| asnType; | ||
| /** | ||
| * ASN country code the IP address belongs to. | ||
| */ | ||
| asnCountry; | ||
| /** | ||
| * Name of service the IP address belongs to. | ||
| */ | ||
| service; | ||
| /** | ||
| * Create an `ArcjetIpDetails`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * IP details. | ||
| */ | ||
| constructor(init = {}) { | ||
| this.latitude = init.latitude; | ||
| this.longitude = init.longitude; | ||
| this.accuracyRadius = init.accuracyRadius; | ||
| this.timezone = init.timezone; | ||
| this.postalCode = init.postalCode; | ||
| this.city = init.city; | ||
| this.region = init.region; | ||
| this.country = init.country; | ||
| this.countryName = init.countryName; | ||
| this.continent = init.continent; | ||
| this.continentName = init.continentName; | ||
| this.asn = init.asn; | ||
| this.asnName = init.asnName; | ||
| this.asnDomain = init.asnDomain; | ||
| this.asnType = init.asnType; | ||
| this.asnCountry = init.asnCountry; | ||
| this.service = init.service; | ||
| // TypeScript creates symbols on the class when using `private` or `#` | ||
| // identifiers for tracking these properties. We don't want to end up with | ||
| // the same issues as Next.js with private symbols so we use | ||
| // `Object.defineProperties` here and then `@ts-expect-error` when we access | ||
| // the values. This is mostly to improve the editor experience, as props | ||
| // starting with `_` are sorted to the top of autocomplete. | ||
| Object.defineProperties(this, { | ||
| _isHosting: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isHosting ?? false, | ||
| }, | ||
| _isVpn: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isVpn ?? false, | ||
| }, | ||
| _isProxy: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isProxy ?? false, | ||
| }, | ||
| _isTor: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isTor ?? false, | ||
| }, | ||
| _isRelay: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isRelay ?? false, | ||
| }, | ||
| _isAbuser: { | ||
| configurable: false, | ||
| enumerable: false, | ||
| writable: false, | ||
| value: init.isAbuser ?? false, | ||
| }, | ||
| }); | ||
| } | ||
| /** | ||
| * Check if the IP address has geo `latitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has latitude info. | ||
| */ | ||
| hasLatitude() { | ||
| return typeof this.latitude !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has geo `longitude` info. | ||
| * This also implies that `accuracyRadius` is available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has longitude info. | ||
| */ | ||
| hasLongitude() { | ||
| return typeof this.longitude !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has geo accuracy radius info. | ||
| * This also implies that `latitude` and `longitude` are available. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has accuracy info. | ||
| */ | ||
| hasAccuracyRadius() { | ||
| return typeof this.accuracyRadius !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has timezone info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has timezone info. | ||
| */ | ||
| hasTimezone() { | ||
| return typeof this.timezone !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has postcal code info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has postcal code info. | ||
| */ | ||
| hasPostalCode() { | ||
| return typeof this.postalCode !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has city info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has city info. | ||
| */ | ||
| // TODO: If we have city, what other data are we sure to have? | ||
| hasCity() { | ||
| return typeof this.city !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has region info. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has region info. | ||
| */ | ||
| // TODO: If we have region, what other data are we sure to have? | ||
| hasRegion() { | ||
| return typeof this.region !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has country info: | ||
| * `countryName` and `country`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has country info. | ||
| */ | ||
| // TODO: If we have country, should we also have continent? | ||
| hasCountry() { | ||
| return typeof this.country !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has continent info: | ||
| * `continentName` and `continent`. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has continent info. | ||
| */ | ||
| hasContintent() { | ||
| return typeof this.continent !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has ASN info. | ||
| * | ||
| * @deprecated | ||
| * Use `hasAsn()` instead. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasASN() { | ||
| return this.hasAsn(); | ||
| } | ||
| /** | ||
| * Check if the IP address has ASN info: | ||
| * `asnCountry`, `asnDomain`, `asnName`, `asnType`, and `asn` fields. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has ASN info. | ||
| */ | ||
| hasAsn() { | ||
| return typeof this.asn !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address has a service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has a service. | ||
| */ | ||
| hasService() { | ||
| return typeof this.service !== "undefined"; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a hosting provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a hosting provider. | ||
| */ | ||
| isHosting() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isHosting; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a VPN provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a VPN provider. | ||
| */ | ||
| isVpn() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isVpn; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a proxy provider. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a proxy provider. | ||
| */ | ||
| isProxy() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isProxy; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a Tor node. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a Tor node. | ||
| */ | ||
| isTor() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isTor; | ||
| } | ||
| /** | ||
| * Check if the IP address belongs to a relay service. | ||
| * | ||
| * @returns | ||
| * Whether the IP address belongs to a relay service. | ||
| */ | ||
| isRelay() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isRelay; | ||
| } | ||
| /** | ||
| * Check if the IP address has been flagged as an abuser. | ||
| * | ||
| * @returns | ||
| * Whether the IP address has been flagged as an abuser. | ||
| */ | ||
| isAbuser() { | ||
| // @ts-expect-error because we attach this with Object.defineProperties | ||
| return this._isAbuser; | ||
| } | ||
| } | ||
| /** | ||
| * Decision returned by the Arcjet SDK. | ||
| */ | ||
| class ArcjetDecision { | ||
| /** | ||
| * Unique identifier of the decision. | ||
| * This can be used to look up the decision in the Arcjet dashboard. | ||
| */ | ||
| id; | ||
| /** | ||
| * Duration in milliseconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| */ | ||
| ttl; | ||
| /** | ||
| * List of results from calling rules. | ||
| * Can also be found by logging into the Arcjet dashboard and searching for the decision `id`. | ||
| */ | ||
| results; | ||
| /** | ||
| * Details about the IP address that informed the `conclusion`. | ||
| */ | ||
| ip; | ||
| /** | ||
| * Create an `ArcjetDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Decision. | ||
| */ | ||
| constructor(init) { | ||
| if (typeof init.id === "string") { | ||
| this.id = init.id; | ||
| } | ||
| else { | ||
| this.id = typeid("lreq"); | ||
| } | ||
| this.results = init.results; | ||
| this.ttl = init.ttl; | ||
| this.ip = init.ip ?? new ArcjetIpDetails(); | ||
| } | ||
| /** | ||
| * Check if the decision is allowed. | ||
| * This considers `ERROR` decisions as allowed too. | ||
| * | ||
| * @returns | ||
| * Whether the decision is allowed. | ||
| */ | ||
| isAllowed() { | ||
| return this.conclusion === "ALLOW" || this.conclusion === "ERROR"; | ||
| } | ||
| /** | ||
| * Check if the decision is denied. | ||
| * | ||
| * @returns | ||
| * Whether the decision is denied. | ||
| */ | ||
| isDenied() { | ||
| return this.conclusion === "DENY"; | ||
| } | ||
| /** | ||
| * Check if the decision is challenged. | ||
| * | ||
| * @returns | ||
| * Whether the decision is challenged. | ||
| */ | ||
| isChallenged() { | ||
| return this.conclusion === "CHALLENGE"; | ||
| } | ||
| /** | ||
| * Check if the decision is errored. | ||
| * This does **not** consider `ALLOW` as errored. | ||
| * | ||
| * @returns | ||
| * Whether the decision is errored. | ||
| */ | ||
| isErrored() { | ||
| return this.conclusion === "ERROR"; | ||
| } | ||
| } | ||
| /** | ||
| * Allow decision. | ||
| */ | ||
| class ArcjetAllowDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "ALLOW"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetAllowDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Allow decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| } | ||
| /** | ||
| * Deny decision. | ||
| */ | ||
| class ArcjetDenyDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "DENY"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetDenyDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Deny decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| } | ||
| /** | ||
| * Challenge decision. | ||
| */ | ||
| class ArcjetChallengeDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "CHALLENGE"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetChallengeDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Challenge decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| } | ||
| /** | ||
| * Error decision. | ||
| */ | ||
| class ArcjetErrorDecision extends ArcjetDecision { | ||
| /** | ||
| * Kind. | ||
| */ | ||
| conclusion = "ERROR"; | ||
| /** | ||
| * Reason for decision. | ||
| */ | ||
| reason; | ||
| /** | ||
| * Create an `ArcjetErrorDecision`. | ||
| * | ||
| * @param init | ||
| * Configuration. | ||
| * @returns | ||
| * Error decision. | ||
| */ | ||
| constructor(init) { | ||
| super(init); | ||
| this.reason = init.reason; | ||
| } | ||
| } | ||
| export { ArcjetAllowDecision, ArcjetBotReason, ArcjetChallengeDecision, ArcjetDecision, ArcjetDenyDecision, ArcjetEdgeRuleReason, ArcjetEmailReason, ArcjetErrorDecision, ArcjetErrorReason, ArcjetFilterReason, ArcjetIpDetails, ArcjetPromptInjectionReason, ArcjetRateLimitReason, ArcjetReason, ArcjetRuleResult, ArcjetSensitiveInfoReason, ArcjetShieldReason }; |
| // @generated by protoc-gen-es v2.2.0 | ||
| // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) | ||
| /* eslint-disable */ | ||
| import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv1"; | ||
| import type { Message } from "@bufbuild/protobuf"; | ||
| import type { Timestamp } from "@bufbuild/protobuf/wkt"; | ||
| /** | ||
| * Describes the file proto/decide/v1alpha1/decide.proto. | ||
| */ | ||
| export declare const file_proto_decide_v1alpha1_decide: GenFile; | ||
| /** | ||
| * Additional information from Arcjet about the IP address associated with a | ||
| * request. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.IpDetails | ||
| */ | ||
| export declare type IpDetails = Message<"proto.decide.v1alpha1.IpDetails"> & { | ||
| /** | ||
| * The estimated latitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| * | ||
| * @generated from field: double latitude = 1; | ||
| */ | ||
| latitude: number; | ||
| /** | ||
| * The estimated longitude of the IP address - see accuracy_radius for the | ||
| * margin of error. | ||
| * | ||
| * @generated from field: double longitude = 2; | ||
| */ | ||
| longitude: number; | ||
| /** | ||
| * The accuracy radius of the IP address location in kilometers. | ||
| * | ||
| * @generated from field: int32 accuracy_radius = 3; | ||
| */ | ||
| accuracyRadius: number; | ||
| /** | ||
| * The timezone of the IP address. | ||
| * | ||
| * @generated from field: string timezone = 4; | ||
| */ | ||
| timezone: string; | ||
| /** | ||
| * The postal code of the IP address. | ||
| * | ||
| * @generated from field: string postal_code = 5; | ||
| */ | ||
| postalCode: string; | ||
| /** | ||
| * The city the IP address is located in. | ||
| * | ||
| * @generated from field: string city = 6; | ||
| */ | ||
| city: string; | ||
| /** | ||
| * The region the IP address is located in. | ||
| * | ||
| * @generated from field: string region = 7; | ||
| */ | ||
| region: string; | ||
| /** | ||
| * The country code the IP address is located in. | ||
| * | ||
| * @generated from field: string country = 8; | ||
| */ | ||
| country: string; | ||
| /** | ||
| * The country name the IP address is located in. | ||
| * | ||
| * @generated from field: string country_name = 9; | ||
| */ | ||
| countryName: string; | ||
| /** | ||
| * The continent code the IP address is located in. | ||
| * | ||
| * @generated from field: string continent = 10; | ||
| */ | ||
| continent: string; | ||
| /** | ||
| * The continent name the IP address is located in. | ||
| * | ||
| * @generated from field: string continent_name = 11; | ||
| */ | ||
| continentName: string; | ||
| /** | ||
| * The AS number the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn = 12; | ||
| */ | ||
| asn: string; | ||
| /** | ||
| * The AS name the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_name = 13; | ||
| */ | ||
| asnName: string; | ||
| /** | ||
| * The AS domain the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_domain = 14; | ||
| */ | ||
| asnDomain: string; | ||
| /** | ||
| * The ASN type: ISP, hosting, business, or education | ||
| * | ||
| * @generated from field: string asn_type = 15; | ||
| */ | ||
| asnType: string; | ||
| /** | ||
| * The ASN country code the IP address belongs to. | ||
| * | ||
| * @generated from field: string asn_country = 16; | ||
| */ | ||
| asnCountry: string; | ||
| /** | ||
| * The name of the service the IP address belongs to. | ||
| * | ||
| * @generated from field: string service = 17; | ||
| */ | ||
| service: string; | ||
| /** | ||
| * Whether the IP address belongs to a hosting provider. | ||
| * | ||
| * @generated from field: bool is_hosting = 18; | ||
| */ | ||
| isHosting: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a VPN provider. | ||
| * | ||
| * @generated from field: bool is_vpn = 19; | ||
| */ | ||
| isVpn: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a proxy provider. | ||
| * | ||
| * @generated from field: bool is_proxy = 20; | ||
| */ | ||
| isProxy: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a Tor node. | ||
| * | ||
| * @generated from field: bool is_tor = 21; | ||
| */ | ||
| isTor: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a relay service. | ||
| * | ||
| * @generated from field: bool is_relay = 22; | ||
| */ | ||
| isRelay: boolean; | ||
| /** | ||
| * Whether the IP address has been flagged as an abuser. | ||
| * | ||
| * @generated from field: bool is_abuser = 23; | ||
| */ | ||
| isAbuser: boolean; | ||
| /** | ||
| * Bots is the list of bots that the IP address belongs to. | ||
| * | ||
| * @generated from field: map<string, string> bots = 24; | ||
| */ | ||
| bots: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IpDetails. | ||
| * Use `create(IpDetailsSchema)` to create a new message. | ||
| */ | ||
| export declare const IpDetailsSchema: GenMessage<IpDetails>; | ||
| /** | ||
| * The reason for the decision. This is populated based on the selected rules | ||
| * for deny or challenge responses. Additional details can be found in the field | ||
| * and by logging into the Arcjet Console and searching for the decision ID. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Reason | ||
| */ | ||
| export declare type Reason = Message<"proto.decide.v1alpha1.Reason"> & { | ||
| /** | ||
| * @generated from oneof proto.decide.v1alpha1.Reason.reason | ||
| */ | ||
| reason: { | ||
| /** | ||
| * Contains details about the rate limit when the decision was made | ||
| * based on a rate limit rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitReason rate_limit = 1; | ||
| */ | ||
| value: RateLimitReason; | ||
| case: "rateLimit"; | ||
| } | { | ||
| /** | ||
| * Contains details about the edge rules which were triggered when the | ||
| * decision was made based on an edge rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EdgeRuleReason edge_rule = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| value: EdgeRuleReason; | ||
| case: "edgeRule"; | ||
| } | { | ||
| /** | ||
| * Contains details about why the request was considered a bot when the | ||
| * decision was made based on a bot rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotReason bot = 3; | ||
| */ | ||
| value: BotReason; | ||
| case: "bot"; | ||
| } | { | ||
| /** | ||
| * Contains details about why Arcjet Shield was triggered. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ShieldReason shield = 4; | ||
| */ | ||
| value: ShieldReason; | ||
| case: "shield"; | ||
| } | { | ||
| /** | ||
| * Contains details about the email when the decision was made based on | ||
| * an email rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EmailReason email = 5; | ||
| */ | ||
| value: EmailReason; | ||
| case: "email"; | ||
| } | { | ||
| /** | ||
| * Contains details about the error decision when an error occurred. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ErrorReason error = 6; | ||
| */ | ||
| value: ErrorReason; | ||
| case: "error"; | ||
| } | { | ||
| /** | ||
| * Contains details about sensitive info identified in the body of the | ||
| * request if the sensitive info rule is configured. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoReason sensitive_info = 7; | ||
| */ | ||
| value: SensitiveInfoReason; | ||
| case: "sensitiveInfo"; | ||
| } | { | ||
| /** | ||
| * Contains details about why the request was considered a bot when the | ||
| * decision was made based on a bot (v2) rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotV2Reason bot_v2 = 8; | ||
| */ | ||
| value: BotV2Reason; | ||
| case: "botV2"; | ||
| } | { | ||
| /** | ||
| * Contains details about the filter rules which were triggered when the | ||
| * decision was made based on a filter rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.FilterReason filter = 9; | ||
| */ | ||
| value: FilterReason; | ||
| case: "filter"; | ||
| } | { | ||
| /** | ||
| * Contains details about the prompt injection analysis when | ||
| * the decision was made based on a prompt injection detection rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionReason prompt_injection = 10; | ||
| */ | ||
| value: PromptInjectionReason; | ||
| case: "promptInjection"; | ||
| } | { case: undefined; value?: undefined }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Reason. | ||
| * Use `create(ReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ReasonSchema: GenMessage<Reason>; | ||
| /** | ||
| * Details of a rate limit decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RateLimitReason | ||
| */ | ||
| export declare type RateLimitReason = Message<"proto.decide.v1alpha1.RateLimitReason"> & { | ||
| /** | ||
| * The configured maximum number of requests allowed in the current window. | ||
| * | ||
| * @generated from field: uint32 max = 1; | ||
| */ | ||
| max: number; | ||
| /** | ||
| * Deprecated: Always empty. Previously, the number of requests which have | ||
| * been made in the current window. | ||
| * | ||
| * @generated from field: int32 count = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| count: number; | ||
| /** | ||
| * The number of requests remaining in the current window. | ||
| * | ||
| * @generated from field: uint32 remaining = 3; | ||
| */ | ||
| remaining: number; | ||
| /** | ||
| * The time at which the rate limit window will reset. | ||
| * | ||
| * Deprecated: Use `reset_in_seconds` instead. | ||
| * | ||
| * @generated from field: google.protobuf.Timestamp reset_time = 4 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| resetTime?: Timestamp; | ||
| /** | ||
| * The duration in seconds until this rate limit window will reset. | ||
| * | ||
| * @generated from field: uint32 reset_in_seconds = 5; | ||
| */ | ||
| resetInSeconds: number; | ||
| /** | ||
| * The time window in seconds of this rate limit. | ||
| * | ||
| * @generated from field: uint32 window_in_seconds = 6; | ||
| */ | ||
| windowInSeconds: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitReason. | ||
| * Use `create(RateLimitReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const RateLimitReasonSchema: GenMessage<RateLimitReason>; | ||
| /** | ||
| * Details of an edge rule decision. Unimplemented. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EdgeRuleReason | ||
| * @deprecated | ||
| */ | ||
| export declare type EdgeRuleReason = Message<"proto.decide.v1alpha1.EdgeRuleReason"> & { | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EdgeRuleReason. | ||
| * Use `create(EdgeRuleReasonSchema)` to create a new message. | ||
| * @deprecated | ||
| */ | ||
| export declare const EdgeRuleReasonSchema: GenMessage<EdgeRuleReason>; | ||
| /** | ||
| * Details of a bot decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotReason | ||
| */ | ||
| export declare type BotReason = Message<"proto.decide.v1alpha1.BotReason"> & { | ||
| /** | ||
| * The bot type we detected. See `BotType` for more information. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotType bot_type = 1; | ||
| */ | ||
| botType: BotType; | ||
| /** | ||
| * The bot score we calculated. Score ranges from 0 to 99 representing the | ||
| * degree of certainty. The higher the number within the type category, the | ||
| * greater the degree of certainty. See `BotType` for more information. | ||
| * | ||
| * @generated from field: int32 bot_score = 2; | ||
| */ | ||
| botScore: number; | ||
| /** | ||
| * Whether bot detection was triggered by our user agent matching. | ||
| * | ||
| * @generated from field: bool user_agent_match = 3; | ||
| */ | ||
| userAgentMatch: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a hosting provider. | ||
| * | ||
| * @generated from field: bool ip_hosting = 5; | ||
| */ | ||
| ipHosting: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a VPN provider. | ||
| * | ||
| * @generated from field: bool ip_vpn = 6; | ||
| */ | ||
| ipVpn: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a proxy provider. | ||
| * | ||
| * @generated from field: bool ip_proxy = 7; | ||
| */ | ||
| ipProxy: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a Tor node. | ||
| * | ||
| * @generated from field: bool ip_tor = 8; | ||
| */ | ||
| ipTor: boolean; | ||
| /** | ||
| * Whether the IP address belongs to a relay service. | ||
| * | ||
| * @generated from field: bool ip_relay = 9; | ||
| */ | ||
| ipRelay: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotReason. | ||
| * Use `create(BotReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const BotReasonSchema: GenMessage<BotReason>; | ||
| /** | ||
| * Details of a bot (v2) decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotV2Reason | ||
| */ | ||
| export declare type BotV2Reason = Message<"proto.decide.v1alpha1.BotV2Reason"> & { | ||
| /** | ||
| * @generated from field: repeated string allowed = 1; | ||
| */ | ||
| allowed: string[]; | ||
| /** | ||
| * @generated from field: repeated string denied = 2; | ||
| */ | ||
| denied: string[]; | ||
| /** | ||
| * @generated from field: bool verified = 3; | ||
| */ | ||
| verified: boolean; | ||
| /** | ||
| * @generated from field: bool spoofed = 4; | ||
| */ | ||
| spoofed: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Reason. | ||
| * Use `create(BotV2ReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const BotV2ReasonSchema: GenMessage<BotV2Reason>; | ||
| /** | ||
| * Details of an Arcjet Shield decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ShieldReason | ||
| */ | ||
| export declare type ShieldReason = Message<"proto.decide.v1alpha1.ShieldReason"> & { | ||
| /** | ||
| * Whether Arcjet Shield was triggered. Log into the Arcjet Console and | ||
| * search for the decision ID to find more details about which rules were | ||
| * triggered. | ||
| * | ||
| * @generated from field: bool shield_triggered = 1; | ||
| */ | ||
| shieldTriggered: boolean; | ||
| /** | ||
| * Whether the request was considered suspicious based on background | ||
| * analysis of the request | ||
| * | ||
| * @generated from field: bool suspicious = 2; | ||
| */ | ||
| suspicious: boolean; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldReason. | ||
| * Use `create(ShieldReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ShieldReasonSchema: GenMessage<ShieldReason>; | ||
| /** | ||
| * Details of an Arcjet Filter decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.FilterReason | ||
| */ | ||
| export declare type FilterReason = Message<"proto.decide.v1alpha1.FilterReason"> & { | ||
| /** | ||
| * Deprecated: Use the `matched_expressions` field instead. | ||
| * | ||
| * @generated from field: string matched_expression = 1 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| matchedExpression: string; | ||
| /** | ||
| * List of all matched expressions. | ||
| * | ||
| * @generated from field: repeated string matched_expressions = 2; | ||
| */ | ||
| matchedExpressions: string[]; | ||
| /** | ||
| * List of all undetermined expressions. | ||
| * | ||
| * @generated from field: repeated string undetermined_expressions = 3; | ||
| */ | ||
| undeterminedExpressions: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterReason. | ||
| * Use `create(FilterReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const FilterReasonSchema: GenMessage<FilterReason>; | ||
| /** | ||
| * Details of an email decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EmailReason | ||
| */ | ||
| export declare type EmailReason = Message<"proto.decide.v1alpha1.EmailReason"> & { | ||
| /** | ||
| * The types of email address we detected. This may be one or more of the | ||
| * `EmailType` values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType email_types = 1; | ||
| */ | ||
| emailTypes: EmailType[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailReason. | ||
| * Use `create(EmailReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const EmailReasonSchema: GenMessage<EmailReason>; | ||
| /** | ||
| * Details of an error decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ErrorReason | ||
| */ | ||
| export declare type ErrorReason = Message<"proto.decide.v1alpha1.ErrorReason"> & { | ||
| /** | ||
| * The error message associated with the error decision. | ||
| * | ||
| * @generated from field: string message = 1; | ||
| */ | ||
| message: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ErrorReason. | ||
| * Use `create(ErrorReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const ErrorReasonSchema: GenMessage<ErrorReason>; | ||
| /** | ||
| * Details of an AI prompt injection decision. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.PromptInjectionReason | ||
| */ | ||
| export declare type PromptInjectionReason = Message<"proto.decide.v1alpha1.PromptInjectionReason"> & { | ||
| /** | ||
| * Whether a prompt injection attempt was detected in the input. | ||
| * | ||
| * @generated from field: bool injection_detected = 1; | ||
| */ | ||
| injectionDetected: boolean; | ||
| /** | ||
| * Deprecated: The underlying model produces a binary verdict; this field | ||
| * now returns exclusively 0.005 (benign) or 0.995 (injection) to match | ||
| * the model's hardcoded output values. Use injection_detected instead. | ||
| * | ||
| * @generated from field: double score = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| score: number; | ||
| /** | ||
| * The number of tokens processed in the input for the prompt injection | ||
| * analysis. | ||
| * | ||
| * @generated from field: uint32 total_tokens = 3; | ||
| */ | ||
| totalTokens: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionReason. | ||
| * Use `create(PromptInjectionReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const PromptInjectionReasonSchema: GenMessage<PromptInjectionReason>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.IdentifiedEntity | ||
| */ | ||
| export declare type IdentifiedEntity = Message<"proto.decide.v1alpha1.IdentifiedEntity"> & { | ||
| /** | ||
| * The type of entity that was identified | ||
| * | ||
| * @generated from field: string identified_type = 1; | ||
| */ | ||
| identifiedType: string; | ||
| /** | ||
| * The start index of the entity in the body. | ||
| * | ||
| * @generated from field: uint32 start = 2; | ||
| */ | ||
| start: number; | ||
| /** | ||
| * The end index of the entity in the body. | ||
| * | ||
| * @generated from field: uint32 end = 3; | ||
| */ | ||
| end: number; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IdentifiedEntity. | ||
| * Use `create(IdentifiedEntitySchema)` to create a new message. | ||
| */ | ||
| export declare const IdentifiedEntitySchema: GenMessage<IdentifiedEntity>; | ||
| /** | ||
| * Details of a sensitive info reason. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.SensitiveInfoReason | ||
| */ | ||
| export declare type SensitiveInfoReason = Message<"proto.decide.v1alpha1.SensitiveInfoReason"> & { | ||
| /** | ||
| * The allowed sensitive info types | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity allowed = 1; | ||
| */ | ||
| allowed: IdentifiedEntity[]; | ||
| /** | ||
| * The denied sensitive info types | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.IdentifiedEntity denied = 2; | ||
| */ | ||
| denied: IdentifiedEntity[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoReason. | ||
| * Use `create(SensitiveInfoReasonSchema)` to create a new message. | ||
| */ | ||
| export declare const SensitiveInfoReasonSchema: GenMessage<SensitiveInfoReason>; | ||
| /** | ||
| * The configuration for a rate limit rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RateLimitRule | ||
| */ | ||
| export declare type RateLimitRule = Message<"proto.decide.v1alpha1.RateLimitRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The request path the rate limit applies to. If not specified and Arcjet | ||
| * is running on a specific API route, it defaults to the path for that | ||
| * route. If not specified and Arcjet is running from middleware, it applies | ||
| * to all routes. | ||
| * | ||
| * @generated from field: string match = 2; | ||
| */ | ||
| match: string; | ||
| /** | ||
| * Defines how Arcjet will track rate limits. If none are specified, it will | ||
| * default to using the client IP address. If more than one characteristic | ||
| * is provided, they will be combined. For further details, see | ||
| * https://docs.arcjet.com/architecture/#fingerprinting | ||
| * | ||
| * @generated from field: repeated string characteristics = 3; | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * The time window the rate limit applies to. This is a string value with a | ||
| * sequence of decimal numbers, each with an optional fraction and a unit | ||
| * suffix e.g. 1s for 1 second, 1h45m for 1 hour and 45 minutes, 1d for 1 | ||
| * day. Valid time units are ns, us (or µs), ms, s, m, h. | ||
| * | ||
| * Deprecated: Use the window_in_seconds field instead. | ||
| * | ||
| * @generated from field: string window = 4 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| window: string; | ||
| /** | ||
| * The maximum number of requests allowed in the time period. This is a | ||
| * positive integer value e.g. 100. | ||
| * | ||
| * Required by "fixed window", "sliding window", and unspecified algorithms. | ||
| * | ||
| * @generated from field: uint32 max = 5; | ||
| */ | ||
| max: number; | ||
| /** | ||
| * How long to apply the limit before it expires and the client is allowed | ||
| * to make more requests. If not specified, this will default to the same | ||
| * value as the Window e.g. if the window is 1 hour, the client will be rate | ||
| * limited for 1 hour after they hit the limit. This is a string value with | ||
| * a sequence of decimal numbers, each with an optional fraction and a unit | ||
| * suffix e.g. 1s for 1 second, 1h45m for 1 hour and 45 minutes, 1d for 1 | ||
| * day. Valid time units are ns, us (or µs), ms, s, m, h, d, w, y. | ||
| * | ||
| * @generated from field: string timeout = 6; | ||
| */ | ||
| timeout: string; | ||
| /** | ||
| * The algorithm to use for rate limiting a request. If unspecified, we will | ||
| * fallback to the "fixed window" algorithm. The chosen algorithm will | ||
| * affect which other fields must be specified to be a valid configuration. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitAlgorithm algorithm = 7; | ||
| */ | ||
| algorithm: RateLimitAlgorithm; | ||
| /** | ||
| * The amount of tokens that are refilled at the provided interval. | ||
| * | ||
| * Required by "token bucket" algorithm. | ||
| * | ||
| * @generated from field: uint32 refill_rate = 8; | ||
| */ | ||
| refillRate: number; | ||
| /** | ||
| * The interval in which a rate limit is applied or tokens refilled. | ||
| * | ||
| * Required by "token bucket" and "sliding window" algorithms. | ||
| * | ||
| * @generated from field: uint32 interval = 9; | ||
| */ | ||
| interval: number; | ||
| /** | ||
| * The maximum number of tokens that can exist in a token bucket. | ||
| * | ||
| * Required by "token bucket" algorithm. | ||
| * | ||
| * @generated from field: uint32 capacity = 10; | ||
| */ | ||
| capacity: number; | ||
| /** | ||
| * The time window the rate limit applies to. This is an unsigned 32-bit | ||
| * integer value representing a number of seconds. | ||
| * | ||
| * Required by "fixed window" and unspecified algorithms. | ||
| * | ||
| * @generated from field: uint32 window_in_seconds = 12; | ||
| */ | ||
| windowInSeconds: number; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitRuleVersion version = 13; | ||
| */ | ||
| version: RateLimitRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitRule. | ||
| * Use `create(RateLimitRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const RateLimitRuleSchema: GenMessage<RateLimitRule>; | ||
| /** | ||
| * The configuration for a bot rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotRule | ||
| */ | ||
| export declare type BotRule = Message<"proto.decide.v1alpha1.BotRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The bot types to block. This may be one or more of the `BotType` values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.BotType block = 2; | ||
| */ | ||
| block: BotType[]; | ||
| /** | ||
| * Additional bot detection rules to add or remove from the Arcjet standard | ||
| * list. Each rule is a regular expression that matches the user agent of | ||
| * the bot plus a label to indicate what type of bot it is from the above | ||
| * `BotType`s. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotRule.Patterns patterns = 3; | ||
| */ | ||
| patterns?: BotRule_Patterns; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule. | ||
| * Use `create(BotRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const BotRuleSchema: GenMessage<BotRule>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.BotRule.Patterns | ||
| */ | ||
| export declare type BotRule_Patterns = Message<"proto.decide.v1alpha1.BotRule.Patterns"> & { | ||
| /** | ||
| * @generated from field: map<string, proto.decide.v1alpha1.BotType> add = 1; | ||
| */ | ||
| add: { [key: string]: BotType }; | ||
| /** | ||
| * @generated from field: repeated string remove = 2; | ||
| */ | ||
| remove: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule.Patterns. | ||
| * Use `create(BotRule_PatternsSchema)` to create a new message. | ||
| */ | ||
| export declare const BotRule_PatternsSchema: GenMessage<BotRule_Patterns>; | ||
| /** | ||
| * The configuration for a bot (v2) rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.BotV2Rule | ||
| */ | ||
| export declare type BotV2Rule = Message<"proto.decide.v1alpha1.BotV2Rule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.BotV2RuleVersion version = 4; | ||
| */ | ||
| version: BotV2RuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Rule. | ||
| * Use `create(BotV2RuleSchema)` to create a new message. | ||
| */ | ||
| export declare const BotV2RuleSchema: GenMessage<BotV2Rule>; | ||
| /** | ||
| * The configuration for an email rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.EmailRule | ||
| */ | ||
| export declare type EmailRule = Message<"proto.decide.v1alpha1.EmailRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The email types to block. This may be one or more of the `EmailType` | ||
| * values. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType block = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| block: EmailType[]; | ||
| /** | ||
| * @generated from field: bool require_top_level_domain = 3; | ||
| */ | ||
| requireTopLevelDomain: boolean; | ||
| /** | ||
| * @generated from field: bool allow_domain_literal = 4; | ||
| */ | ||
| allowDomainLiteral: boolean; | ||
| /** | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType allow = 5; | ||
| */ | ||
| allow: EmailType[]; | ||
| /** | ||
| * @generated from field: repeated proto.decide.v1alpha1.EmailType deny = 6; | ||
| */ | ||
| deny: EmailType[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.EmailRuleVersion version = 7; | ||
| */ | ||
| version: EmailRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailRule. | ||
| * Use `create(EmailRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const EmailRuleSchema: GenMessage<EmailRule>; | ||
| /** | ||
| * The configuration for a detect sensitive info rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.SensitiveInfoRule | ||
| */ | ||
| export declare type SensitiveInfoRule = Message<"proto.decide.v1alpha1.SensitiveInfoRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * The sensitive info types to allow and deny. | ||
| * | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoRuleVersion version = 4; | ||
| */ | ||
| version: SensitiveInfoRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoRule. | ||
| * Use `create(SensitiveInfoRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const SensitiveInfoRuleSchema: GenMessage<SensitiveInfoRule>; | ||
| /** | ||
| * The configuration for a shield rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ShieldRule | ||
| */ | ||
| export declare type ShieldRule = Message<"proto.decide.v1alpha1.ShieldRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: bool auto_added = 2; | ||
| */ | ||
| autoAdded: boolean; | ||
| /** | ||
| * Defines how Arcjet will track suspicious requests. If none are specified, | ||
| * it will default to using the client IP address. If more than one | ||
| * characteristic is provided, they will be combined. For further details, | ||
| * see https://docs.arcjet.com/architecture/#fingerprinting | ||
| * | ||
| * @generated from field: repeated string characteristics = 3; | ||
| */ | ||
| characteristics: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.ShieldRuleVersion version = 4; | ||
| */ | ||
| version: ShieldRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldRule. | ||
| * Use `create(ShieldRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const ShieldRuleSchema: GenMessage<ShieldRule>; | ||
| /** | ||
| * The configuration for a filter rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.FilterRule | ||
| */ | ||
| export declare type FilterRule = Message<"proto.decide.v1alpha1.FilterRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * @generated from field: repeated string allow = 2; | ||
| */ | ||
| allow: string[]; | ||
| /** | ||
| * @generated from field: repeated string deny = 3; | ||
| */ | ||
| deny: string[]; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.FilterRuleVersion version = 4; | ||
| */ | ||
| version: FilterRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterRule. | ||
| * Use `create(FilterRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const FilterRuleSchema: GenMessage<FilterRule>; | ||
| /** | ||
| * The configuration for a prompt injection detection rule. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.PromptInjectionDetectionRule | ||
| */ | ||
| export declare type PromptInjectionDetectionRule = Message<"proto.decide.v1alpha1.PromptInjectionDetectionRule"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.Mode mode = 1; | ||
| */ | ||
| mode: Mode; | ||
| /** | ||
| * Deprecated: The underlying model produces a binary verdict so a | ||
| * configurable threshold is not meaningful. This field is ignored; the | ||
| * decision is determined solely by the model's binary classification. | ||
| * | ||
| * @generated from field: optional double threshold = 2 [deprecated = true]; | ||
| * @deprecated | ||
| */ | ||
| threshold?: number; | ||
| /** | ||
| * The version of the rule being executed. This is incremented by SDKs when | ||
| * a breaking change is made to the configuration or behavior of the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion version = 3; | ||
| */ | ||
| version: PromptInjectionDetectionRuleVersion; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionDetectionRule. | ||
| * Use `create(PromptInjectionDetectionRuleSchema)` to create a new message. | ||
| */ | ||
| export declare const PromptInjectionDetectionRuleSchema: GenMessage<PromptInjectionDetectionRule>; | ||
| /** | ||
| * The configuration for Arcjet. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Rule | ||
| */ | ||
| export declare type Rule = Message<"proto.decide.v1alpha1.Rule"> & { | ||
| /** | ||
| * @generated from oneof proto.decide.v1alpha1.Rule.rule | ||
| */ | ||
| rule: { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.RateLimitRule rate_limit = 1; | ||
| */ | ||
| value: RateLimitRule; | ||
| case: "rateLimit"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.BotRule bots = 2; | ||
| */ | ||
| value: BotRule; | ||
| case: "bots"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.EmailRule email = 3; | ||
| */ | ||
| value: EmailRule; | ||
| case: "email"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.ShieldRule shield = 4; | ||
| */ | ||
| value: ShieldRule; | ||
| case: "shield"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SensitiveInfoRule sensitive_info = 5; | ||
| */ | ||
| value: SensitiveInfoRule; | ||
| case: "sensitiveInfo"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.BotV2Rule bot_v2 = 6; | ||
| */ | ||
| value: BotV2Rule; | ||
| case: "botV2"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.FilterRule filter = 7; | ||
| */ | ||
| value: FilterRule; | ||
| case: "filter"; | ||
| } | { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.PromptInjectionDetectionRule prompt_injection_detection = 8; | ||
| */ | ||
| value: PromptInjectionDetectionRule; | ||
| case: "promptInjectionDetection"; | ||
| } | { case: undefined; value?: undefined }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Rule. | ||
| * Use `create(RuleSchema)` to create a new message. | ||
| */ | ||
| export declare const RuleSchema: GenMessage<Rule>; | ||
| /** | ||
| * @generated from message proto.decide.v1alpha1.RuleResult | ||
| */ | ||
| export declare type RuleResult = Message<"proto.decide.v1alpha1.RuleResult"> & { | ||
| /** | ||
| * The stable, deterministic, and unique identifier of the rule that | ||
| * generated this result. | ||
| * | ||
| * @generated from field: string rule_id = 1; | ||
| */ | ||
| ruleId: string; | ||
| /** | ||
| * The rule run state | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RuleState state = 2; | ||
| */ | ||
| state: RuleState; | ||
| /** | ||
| * The conclusion determined by the rule. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Conclusion conclusion = 3; | ||
| */ | ||
| conclusion: Conclusion; | ||
| /** | ||
| * The reason for the conclusion. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Reason reason = 4; | ||
| */ | ||
| reason?: Reason; | ||
| /** | ||
| * The duration in seconds this result should be considered valid, also | ||
| * known as time-to-live. | ||
| * | ||
| * @generated from field: uint32 ttl = 5; | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * The fingerprint calculated for this rule, which can be used to cache the | ||
| * result for the amount of time specified by `ttl`. | ||
| * | ||
| * @generated from field: string fingerprint = 6; | ||
| */ | ||
| fingerprint: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RuleResult. | ||
| * Use `create(RuleResultSchema)` to create a new message. | ||
| */ | ||
| export declare const RuleResultSchema: GenMessage<RuleResult>; | ||
| /** | ||
| * Details about a request under investigation. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.RequestDetails | ||
| */ | ||
| export declare type RequestDetails = Message<"proto.decide.v1alpha1.RequestDetails"> & { | ||
| /** | ||
| * @generated from field: string ip = 1; | ||
| */ | ||
| ip: string; | ||
| /** | ||
| * @generated from field: string method = 2; | ||
| */ | ||
| method: string; | ||
| /** | ||
| * @generated from field: string protocol = 3; | ||
| */ | ||
| protocol: string; | ||
| /** | ||
| * @generated from field: string host = 4; | ||
| */ | ||
| host: string; | ||
| /** | ||
| * @generated from field: string path = 5; | ||
| */ | ||
| path: string; | ||
| /** | ||
| * @generated from field: map<string, string> headers = 6; | ||
| */ | ||
| headers: { [key: string]: string }; | ||
| /** | ||
| * @generated from field: bytes body = 7; | ||
| */ | ||
| body: Uint8Array; | ||
| /** | ||
| * @generated from field: map<string, string> extra = 8; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| /** | ||
| * @generated from field: string email = 9; | ||
| */ | ||
| email: string; | ||
| /** | ||
| * The string representing semicolon-separated Cookies for a request. | ||
| * | ||
| * @generated from field: string cookies = 10; | ||
| */ | ||
| cookies: string; | ||
| /** | ||
| * The `?`-prefixed string representing the Query for a request. Commonly | ||
| * referred to as a "querystring". | ||
| * | ||
| * @generated from field: string query = 11; | ||
| */ | ||
| query: string; | ||
| /** | ||
| * An optional, caller-supplied opaque identifier used to correlate this | ||
| * request with other protect() and guard() calls that belong to the same | ||
| * workflow, agent run, or multi-step task. It does not affect the decision | ||
| * and is excluded from fingerprinting; it is stored alongside the recorded | ||
| * decision so a chain of actions can be reconstructed. Carried on | ||
| * RequestDetails so it applies to both the Decide and Report RPCs. | ||
| * | ||
| * @generated from field: string correlation_id = 12; | ||
| */ | ||
| correlationId: string; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RequestDetails. | ||
| * Use `create(RequestDetailsSchema)` to create a new message. | ||
| */ | ||
| export declare const RequestDetailsSchema: GenMessage<RequestDetails>; | ||
| /** | ||
| * A decision made about the request under investigation. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.Decision | ||
| */ | ||
| export declare type Decision = Message<"proto.decide.v1alpha1.Decision"> & { | ||
| /** | ||
| * The decision ID. This is a unique identifier for the decision which can | ||
| * be used to search for the request details in the Arcjet Console. | ||
| * | ||
| * @generated from field: string id = 1; | ||
| */ | ||
| id: string; | ||
| /** | ||
| * Arcjet's conclusion for the request based on our analysis. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Conclusion conclusion = 2; | ||
| */ | ||
| conclusion: Conclusion; | ||
| /** | ||
| * The reason for the decision. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Reason reason = 3; | ||
| */ | ||
| reason?: Reason; | ||
| /** | ||
| * The outcome of each rule taken into consideration for the decision. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.RuleResult rule_results = 4; | ||
| */ | ||
| ruleResults: RuleResult[]; | ||
| /** | ||
| * The duration in seconds this decision should be considered valid, also | ||
| * known as time-to-live. | ||
| * | ||
| * @generated from field: uint32 ttl = 5; | ||
| */ | ||
| ttl: number; | ||
| /** | ||
| * Details about the IP address that informed our conclusion. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.IpDetails ip_details = 6; | ||
| */ | ||
| ipDetails?: IpDetails; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Decision. | ||
| * Use `create(DecisionSchema)` to create a new message. | ||
| */ | ||
| export declare const DecisionSchema: GenMessage<Decision>; | ||
| /** | ||
| * A request to the decide API. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.DecideRequest | ||
| */ | ||
| export declare type DecideRequest = Message<"proto.decide.v1alpha1.DecideRequest"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SDKStack sdk_stack = 1; | ||
| */ | ||
| sdkStack: SDKStack; | ||
| /** | ||
| * @generated from field: string sdk_version = 2; | ||
| */ | ||
| sdkVersion: string; | ||
| /** | ||
| * The information provided via an SDK about a request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RequestDetails details = 4; | ||
| */ | ||
| details?: RequestDetails; | ||
| /** | ||
| * The rules that are being considered for this request. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.Rule rules = 5; | ||
| */ | ||
| rules: Rule[]; | ||
| /** | ||
| * The characteristics that should be used for fingerprinting. | ||
| * | ||
| * @generated from field: repeated string characteristics = 6; | ||
| */ | ||
| characteristics: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideRequest. | ||
| * Use `create(DecideRequestSchema)` to create a new message. | ||
| */ | ||
| export declare const DecideRequestSchema: GenMessage<DecideRequest>; | ||
| /** | ||
| * A response from the decide API. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.DecideResponse | ||
| */ | ||
| export declare type DecideResponse = Message<"proto.decide.v1alpha1.DecideResponse"> & { | ||
| /** | ||
| * The decision made about the request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Decision decision = 1; | ||
| */ | ||
| decision?: Decision; | ||
| /** | ||
| * Any extra information returned by the Arcjet analysis. | ||
| * | ||
| * @generated from field: map<string, string> extra = 2; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideResponse. | ||
| * Use `create(DecideResponseSchema)` to create a new message. | ||
| */ | ||
| export declare const DecideResponseSchema: GenMessage<DecideResponse>; | ||
| /** | ||
| * A request to the Report RPC when SDK has already made a decision locally. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ReportRequest | ||
| */ | ||
| export declare type ReportRequest = Message<"proto.decide.v1alpha1.ReportRequest"> & { | ||
| /** | ||
| * @generated from field: proto.decide.v1alpha1.SDKStack sdk_stack = 1; | ||
| */ | ||
| sdkStack: SDKStack; | ||
| /** | ||
| * @generated from field: string sdk_version = 2; | ||
| */ | ||
| sdkVersion: string; | ||
| /** | ||
| * The information provided via an SDK about a request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.RequestDetails details = 4; | ||
| */ | ||
| details?: RequestDetails; | ||
| /** | ||
| * The decision reported about the request under investigation. | ||
| * | ||
| * @generated from field: proto.decide.v1alpha1.Decision decision = 5; | ||
| */ | ||
| decision?: Decision; | ||
| /** | ||
| * The rules that are were considered for this request. | ||
| * | ||
| * @generated from field: repeated proto.decide.v1alpha1.Rule rules = 6; | ||
| */ | ||
| rules: Rule[]; | ||
| /** | ||
| * The characteristics that should be used for fingerprinting. | ||
| * | ||
| * @generated from field: repeated string characteristics = 8; | ||
| */ | ||
| characteristics: string[]; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportRequest. | ||
| * Use `create(ReportRequestSchema)` to create a new message. | ||
| */ | ||
| export declare const ReportRequestSchema: GenMessage<ReportRequest>; | ||
| /** | ||
| * A response from the Report RPC. | ||
| * | ||
| * @generated from message proto.decide.v1alpha1.ReportResponse | ||
| */ | ||
| export declare type ReportResponse = Message<"proto.decide.v1alpha1.ReportResponse"> & { | ||
| /** | ||
| * Any extra information returned by the Arcjet analysis. | ||
| * | ||
| * @generated from field: map<string, string> extra = 2; | ||
| */ | ||
| extra: { [key: string]: string }; | ||
| }; | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportResponse. | ||
| * Use `create(ReportResponseSchema)` to create a new message. | ||
| */ | ||
| export declare const ReportResponseSchema: GenMessage<ReportResponse>; | ||
| /** | ||
| * Represents whether we think the client is a bot or not. This should be used | ||
| * alongside the bot score which represents the level of certainty of our | ||
| * detection. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.BotType | ||
| */ | ||
| export enum BotType { | ||
| /** | ||
| * The bot type is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * We could not analyze the request, perhaps because of insufficient | ||
| * information or because the bot analysis can't be executed in this | ||
| * environment. We do not recommend blocking these requests. Represented by | ||
| * a score of 0. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_NOT_ANALYZED = 1; | ||
| */ | ||
| NOT_ANALYZED = 1, | ||
| /** | ||
| * We are sure the request was made by an automated bot. We recommend | ||
| * blocking these requests for paths which are for humans only e.g. login or | ||
| * signup pages, but not blocking for API paths. Represented by a score of | ||
| * 1. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_AUTOMATED = 2; | ||
| */ | ||
| AUTOMATED = 2, | ||
| /** | ||
| * We have some evidence that the request was made by an automated bot. The | ||
| * degree of certainty is represented by a score range of 2-29. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_LIKELY_AUTOMATED = 3; | ||
| */ | ||
| LIKELY_AUTOMATED = 3, | ||
| /** | ||
| * We don't think this request was made by an automated bot. The degree of | ||
| * certainty is represented by a score range of 30-99. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_LIKELY_NOT_A_BOT = 4; | ||
| */ | ||
| LIKELY_NOT_A_BOT = 4, | ||
| /** | ||
| * We are sure the request was made by an automated bot and it is on our | ||
| * list of verified good bots. This is manually maintained by the Arcjet | ||
| * team and includes bots such as monitoring agents and friendly search | ||
| * engine crawlers. In most cases you can allow these requests on public | ||
| * pages, but you may wish to block them for internal or private paths. | ||
| * Represented by a score of 100. | ||
| * | ||
| * @generated from enum value: BOT_TYPE_VERIFIED_BOT = 5; | ||
| */ | ||
| VERIFIED_BOT = 5, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotType. | ||
| */ | ||
| export declare const BotTypeSchema: GenEnum<BotType>; | ||
| /** | ||
| * Represents the type of email address submitted. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.EmailType | ||
| */ | ||
| export enum EmailType { | ||
| /** | ||
| * The email type is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The email address is disposable, which means it's registered to a service | ||
| * that allows throwaway email addresses. Although these are sometimes used | ||
| * for privacy, they are also often used for spam signups or fraudulent | ||
| * activity when combined with a transaction e.g. attempting to use a credit | ||
| * card. We recommend blocking these in higher risk scenarios. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_DISPOSABLE = 1; | ||
| */ | ||
| DISPOSABLE = 1, | ||
| /** | ||
| * The email address is registered to a free email service. These are very | ||
| * common, such as GMail or Yahoo Mail, so we do not recommend blocking | ||
| * these. However, you may wish to flag these for review the first time they | ||
| * attempt a transaction. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_FREE = 2; | ||
| */ | ||
| FREE = 2, | ||
| /** | ||
| * This email address is registered to a domain name which has no MX records | ||
| * configured. This means it cannot receive email. We recommend blocking | ||
| * these. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_NO_MX_RECORDS = 3; | ||
| */ | ||
| NO_MX_RECORDS = 3, | ||
| /** | ||
| * This email has no Gravatar attached to the email from | ||
| * https://gravatar.com which makes it slightly less likely to be a valid | ||
| * signup. We recommend using this as part of your own risk scoring or | ||
| * manually reviewing these signups. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_NO_GRAVATAR = 4; | ||
| */ | ||
| NO_GRAVATAR = 4, | ||
| /** | ||
| * This email was specified in an invalid format. | ||
| * | ||
| * @generated from enum value: EMAIL_TYPE_INVALID = 5; | ||
| */ | ||
| INVALID = 5, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailType. | ||
| */ | ||
| export declare const EmailTypeSchema: GenEnum<EmailType>; | ||
| /** | ||
| * The mode to run in. This can be either `DRY_RUN` or `LIVE`. In `DRY_RUN` | ||
| * mode, all requests will be allowed and you can review what the action would | ||
| * have been from the Arcjet Console. In `LIVE` mode, requests will be allowed, | ||
| * challenged or blocked based on the returned decision. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Mode | ||
| */ | ||
| export enum Mode { | ||
| /** | ||
| * The mode is unspecified. This should not be used, but is here to conform | ||
| * to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: MODE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * In `DRY_RUN` mode, all requests will be allowed and you can review what | ||
| * the action would have been from the Arcjet Console. | ||
| * | ||
| * @generated from enum value: MODE_DRY_RUN = 1; | ||
| */ | ||
| DRY_RUN = 1, | ||
| /** | ||
| * In `LIVE` mode, requests will be allowed, challenged or blocked based on | ||
| * the returned decision. | ||
| * | ||
| * @generated from enum value: MODE_LIVE = 2; | ||
| */ | ||
| LIVE = 2, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Mode. | ||
| */ | ||
| export declare const ModeSchema: GenEnum<Mode>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RuleState | ||
| */ | ||
| export enum RuleState { | ||
| /** | ||
| * The mode is unspecified. This should not be used, but is here to conform | ||
| * to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: RULE_STATE_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The rule was run and the outcome was taken into consideration for the end | ||
| * decision | ||
| * | ||
| * @generated from enum value: RULE_STATE_RUN = 1; | ||
| */ | ||
| RUN = 1, | ||
| /** | ||
| * The rule wasn't run | ||
| * | ||
| * @generated from enum value: RULE_STATE_NOT_RUN = 2; | ||
| */ | ||
| NOT_RUN = 2, | ||
| /** | ||
| * The rule was run but not actioned on, meaning the outcome didn't affect | ||
| * the end decision | ||
| * | ||
| * @generated from enum value: RULE_STATE_DRY_RUN = 3; | ||
| */ | ||
| DRY_RUN = 3, | ||
| /** | ||
| * The rule was not run because the reason was cached | ||
| * | ||
| * @generated from enum value: RULE_STATE_CACHED = 4; | ||
| */ | ||
| CACHED = 4, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RuleState. | ||
| */ | ||
| export declare const RuleStateSchema: GenEnum<RuleState>; | ||
| /** | ||
| * The conclusion for the request based on the Arcjet analysis and any specific | ||
| * configuration. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Conclusion | ||
| */ | ||
| export enum Conclusion { | ||
| /** | ||
| * The conclusion is unspecified. This should not be used, but is here to | ||
| * conform to the gRPC best practices. | ||
| * | ||
| * @generated from enum value: CONCLUSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * The request should be allowed. | ||
| * | ||
| * @generated from enum value: CONCLUSION_ALLOW = 1; | ||
| */ | ||
| ALLOW = 1, | ||
| /** | ||
| * The request should be blocked. | ||
| * | ||
| * @generated from enum value: CONCLUSION_DENY = 2; | ||
| */ | ||
| DENY = 2, | ||
| /** | ||
| * The request should be challenged. | ||
| * | ||
| * @generated from enum value: CONCLUSION_CHALLENGE = 3; | ||
| */ | ||
| CHALLENGE = 3, | ||
| /** | ||
| * The request errored. | ||
| * | ||
| * @generated from enum value: CONCLUSION_ERROR = 4; | ||
| */ | ||
| ERROR = 4, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Conclusion. | ||
| */ | ||
| export declare const ConclusionSchema: GenEnum<Conclusion>; | ||
| /** | ||
| * The SDK used to make the request. Used for analytics and to help us improve. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.SDKStack | ||
| */ | ||
| export enum SDKStack { | ||
| /** | ||
| * @generated from enum value: SDK_STACK_UNSPECIFIED = 0; | ||
| */ | ||
| SDK_STACK_UNSPECIFIED = 0, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NODEJS = 1; | ||
| */ | ||
| SDK_STACK_NODEJS = 1, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NEXTJS = 2; | ||
| */ | ||
| SDK_STACK_NEXTJS = 2, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_PYTHON = 3; | ||
| */ | ||
| SDK_STACK_PYTHON = 3, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_DJANGO = 4; | ||
| */ | ||
| SDK_STACK_DJANGO = 4, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_BUN = 5; | ||
| */ | ||
| SDK_STACK_BUN = 5, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_DENO = 6; | ||
| */ | ||
| SDK_STACK_DENO = 6, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_SVELTEKIT = 7; | ||
| */ | ||
| SDK_STACK_SVELTEKIT = 7, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_HONO = 8; | ||
| */ | ||
| SDK_STACK_HONO = 8, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NUXT = 9; | ||
| */ | ||
| SDK_STACK_NUXT = 9, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_NESTJS = 10; | ||
| */ | ||
| SDK_STACK_NESTJS = 10, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_REMIX = 11; | ||
| */ | ||
| SDK_STACK_REMIX = 11, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_ASTRO = 12; | ||
| */ | ||
| SDK_STACK_ASTRO = 12, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_FASTIFY = 13; | ||
| */ | ||
| SDK_STACK_FASTIFY = 13, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_REACT_ROUTER = 14; | ||
| */ | ||
| SDK_STACK_REACT_ROUTER = 14, | ||
| /** | ||
| * @generated from enum value: SDK_STACK_GO = 15; | ||
| */ | ||
| SDK_STACK_GO = 15, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SDKStack. | ||
| */ | ||
| export declare const SDKStackSchema: GenEnum<SDKStack>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm | ||
| */ | ||
| export enum RateLimitAlgorithm { | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_TOKEN_BUCKET = 1; | ||
| */ | ||
| TOKEN_BUCKET = 1, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_FIXED_WINDOW = 2; | ||
| */ | ||
| FIXED_WINDOW = 2, | ||
| /** | ||
| * @generated from enum value: RATE_LIMIT_ALGORITHM_SLIDING_WINDOW = 3; | ||
| */ | ||
| SLIDING_WINDOW = 3, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitAlgorithm. | ||
| */ | ||
| export declare const RateLimitAlgorithmSchema: GenEnum<RateLimitAlgorithm>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitRuleVersion | ||
| */ | ||
| export enum RateLimitRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: RATE_LIMIT_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitRuleVersion. | ||
| */ | ||
| export declare const RateLimitRuleVersionSchema: GenEnum<RateLimitRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.BotV2RuleVersion | ||
| */ | ||
| export enum BotV2RuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: BOT_V2_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotV2RuleVersion. | ||
| */ | ||
| export declare const BotV2RuleVersionSchema: GenEnum<BotV2RuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.EmailRuleVersion | ||
| */ | ||
| export enum EmailRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: EMAIL_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailRuleVersion. | ||
| */ | ||
| export declare const EmailRuleVersionSchema: GenEnum<EmailRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.SensitiveInfoRuleVersion | ||
| */ | ||
| export enum SensitiveInfoRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: SENSITIVE_INFO_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SensitiveInfoRuleVersion. | ||
| */ | ||
| export declare const SensitiveInfoRuleVersionSchema: GenEnum<SensitiveInfoRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.ShieldRuleVersion | ||
| */ | ||
| export enum ShieldRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: SHIELD_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.ShieldRuleVersion. | ||
| */ | ||
| export declare const ShieldRuleVersionSchema: GenEnum<ShieldRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.FilterRuleVersion | ||
| */ | ||
| export enum FilterRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: FILTER_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.FilterRuleVersion. | ||
| */ | ||
| export declare const FilterRuleVersionSchema: GenEnum<FilterRuleVersion>; | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion | ||
| */ | ||
| export enum PromptInjectionDetectionRuleVersion { | ||
| /** | ||
| * This is equivalent to V0 since rules without a version specified will | ||
| * default to this value. | ||
| * | ||
| * @generated from enum value: PROMPT_INJECTION_DETECTION_RULE_VERSION_UNSPECIFIED = 0; | ||
| */ | ||
| UNSPECIFIED = 0, | ||
| } | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion. | ||
| */ | ||
| export declare const PromptInjectionDetectionRuleVersionSchema: GenEnum<PromptInjectionDetectionRuleVersion>; | ||
| /** | ||
| * @generated from service proto.decide.v1alpha1.DecideService | ||
| */ | ||
| export declare const DecideService: GenService<{ | ||
| /** | ||
| * @generated from rpc proto.decide.v1alpha1.DecideService.Decide | ||
| */ | ||
| decide: { | ||
| methodKind: "unary"; | ||
| input: typeof DecideRequestSchema; | ||
| output: typeof DecideResponseSchema; | ||
| }, | ||
| /** | ||
| * @generated from rpc proto.decide.v1alpha1.DecideService.Report | ||
| */ | ||
| report: { | ||
| methodKind: "unary"; | ||
| input: typeof ReportRequestSchema; | ||
| output: typeof ReportResponseSchema; | ||
| }, | ||
| }>; | ||
| // @generated by protoc-gen-es v2.2.0 | ||
| // @generated from file proto/decide/v1alpha1/decide.proto (package proto.decide.v1alpha1, syntax proto3) | ||
| /* eslint-disable */ | ||
| import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv1"; | ||
| import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; | ||
| /** | ||
| * Describes the file proto/decide/v1alpha1/decide.proto. | ||
| */ | ||
| export const file_proto_decide_v1alpha1_decide = /*@__PURE__*/ | ||
| fileDesc("CiJwcm90by9kZWNpZGUvdjFhbHBoYTEvZGVjaWRlLnByb3RvEhVwcm90by5kZWNpZGUudjFhbHBoYTEinQQKCUlwRGV0YWlscxIQCghsYXRpdHVkZRgBIAEoARIRCglsb25naXR1ZGUYAiABKAESFwoPYWNjdXJhY3lfcmFkaXVzGAMgASgFEhAKCHRpbWV6b25lGAQgASgJEhMKC3Bvc3RhbF9jb2RlGAUgASgJEgwKBGNpdHkYBiABKAkSDgoGcmVnaW9uGAcgASgJEg8KB2NvdW50cnkYCCABKAkSFAoMY291bnRyeV9uYW1lGAkgASgJEhEKCWNvbnRpbmVudBgKIAEoCRIWCg5jb250aW5lbnRfbmFtZRgLIAEoCRILCgNhc24YDCABKAkSEAoIYXNuX25hbWUYDSABKAkSEgoKYXNuX2RvbWFpbhgOIAEoCRIQCghhc25fdHlwZRgPIAEoCRITCgthc25fY291bnRyeRgQIAEoCRIPCgdzZXJ2aWNlGBEgASgJEhIKCmlzX2hvc3RpbmcYEiABKAgSDgoGaXNfdnBuGBMgASgIEhAKCGlzX3Byb3h5GBQgASgIEg4KBmlzX3RvchgVIAEoCBIQCghpc19yZWxheRgWIAEoCBIRCglpc19hYnVzZXIYFyABKAgSOAoEYm90cxgYIAMoCzIqLnByb3RvLmRlY2lkZS52MWFscGhhMS5JcERldGFpbHMuQm90c0VudHJ5GisKCUJvdHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIt8ECgZSZWFzb24SPAoKcmF0ZV9saW1pdBgBIAEoCzImLnByb3RvLmRlY2lkZS52MWFscGhhMS5SYXRlTGltaXRSZWFzb25IABI+CgllZGdlX3J1bGUYAiABKAsyJS5wcm90by5kZWNpZGUudjFhbHBoYTEuRWRnZVJ1bGVSZWFzb25CAhgBSAASLwoDYm90GAMgASgLMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFJlYXNvbkgAEjUKBnNoaWVsZBgEIAEoCzIjLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSZWFzb25IABIzCgVlbWFpbBgFIAEoCzIiLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFJlYXNvbkgAEjMKBWVycm9yGAYgASgLMiIucHJvdG8uZGVjaWRlLnYxYWxwaGExLkVycm9yUmVhc29uSAASRAoOc2Vuc2l0aXZlX2luZm8YByABKAsyKi5wcm90by5kZWNpZGUudjFhbHBoYTEuU2Vuc2l0aXZlSW5mb1JlYXNvbkgAEjQKBmJvdF92MhgIIAEoCzIiLnByb3RvLmRlY2lkZS52MWFscGhhMS5Cb3RWMlJlYXNvbkgAEjUKBmZpbHRlchgJIAEoCzIjLnByb3RvLmRlY2lkZS52MWFscGhhMS5GaWx0ZXJSZWFzb25IABJIChBwcm9tcHRfaW5qZWN0aW9uGAogASgLMiwucHJvdG8uZGVjaWRlLnYxYWxwaGExLlByb21wdEluamVjdGlvblJlYXNvbkgAQggKBnJlYXNvbiKtAQoPUmF0ZUxpbWl0UmVhc29uEgsKA21heBgBIAEoDRIRCgVjb3VudBgCIAEoBUICGAESEQoJcmVtYWluaW5nGAMgASgNEjIKCnJlc2V0X3RpbWUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgIYARIYChByZXNldF9pbl9zZWNvbmRzGAUgASgNEhkKEXdpbmRvd19pbl9zZWNvbmRzGAYgASgNIhQKDkVkZ2VSdWxlUmVhc29uOgIYASLCAQoJQm90UmVhc29uEjAKCGJvdF90eXBlGAEgASgOMh4ucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFR5cGUSEQoJYm90X3Njb3JlGAIgASgFEhgKEHVzZXJfYWdlbnRfbWF0Y2gYAyABKAgSEgoKaXBfaG9zdGluZxgFIAEoCBIOCgZpcF92cG4YBiABKAgSEAoIaXBfcHJveHkYByABKAgSDgoGaXBfdG9yGAggASgIEhAKCGlwX3JlbGF5GAkgASgIIlEKC0JvdFYyUmVhc29uEg8KB2FsbG93ZWQYASADKAkSDgoGZGVuaWVkGAIgAygJEhAKCHZlcmlmaWVkGAMgASgIEg8KB3Nwb29mZWQYBCABKAgiPAoMU2hpZWxkUmVhc29uEhgKEHNoaWVsZF90cmlnZ2VyZWQYASABKAgSEgoKc3VzcGljaW91cxgCIAEoCCJtCgxGaWx0ZXJSZWFzb24SHgoSbWF0Y2hlZF9leHByZXNzaW9uGAEgASgJQgIYARIbChNtYXRjaGVkX2V4cHJlc3Npb25zGAIgAygJEiAKGHVuZGV0ZXJtaW5lZF9leHByZXNzaW9ucxgDIAMoCSJECgtFbWFpbFJlYXNvbhI1CgtlbWFpbF90eXBlcxgBIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUiHgoLRXJyb3JSZWFzb24SDwoHbWVzc2FnZRgBIAEoCSJcChVQcm9tcHRJbmplY3Rpb25SZWFzb24SGgoSaW5qZWN0aW9uX2RldGVjdGVkGAEgASgIEhEKBXNjb3JlGAIgASgBQgIYARIUCgx0b3RhbF90b2tlbnMYAyABKA0iRwoQSWRlbnRpZmllZEVudGl0eRIXCg9pZGVudGlmaWVkX3R5cGUYASABKAkSDQoFc3RhcnQYAiABKA0SCwoDZW5kGAMgASgNIogBChNTZW5zaXRpdmVJbmZvUmVhc29uEjgKB2FsbG93ZWQYASADKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuSWRlbnRpZmllZEVudGl0eRI3CgZkZW5pZWQYAiADKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuSWRlbnRpZmllZEVudGl0eSL1AgoNUmF0ZUxpbWl0UnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFbWF0Y2gYAiABKAkSFwoPY2hhcmFjdGVyaXN0aWNzGAMgAygJEhIKBndpbmRvdxgEIAEoCUICGAESCwoDbWF4GAUgASgNEg8KB3RpbWVvdXQYBiABKAkSPAoJYWxnb3JpdGhtGAcgASgOMikucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJhdGVMaW1pdEFsZ29yaXRobRITCgtyZWZpbGxfcmF0ZRgIIAEoDRIQCghpbnRlcnZhbBgJIAEoDRIQCghjYXBhY2l0eRgKIAEoDRIZChF3aW5kb3dfaW5fc2Vjb25kcxgMIAEoDRI8Cgd2ZXJzaW9uGA0gASgOMisucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJhdGVMaW1pdFJ1bGVWZXJzaW9uSgQICxAMUglyZXF1ZXN0ZWQixgIKB0JvdFJ1bGUSKQoEbW9kZRgBIAEoDjIbLnByb3RvLmRlY2lkZS52MWFscGhhMS5Nb2RlEi0KBWJsb2NrGAIgAygOMh4ucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFR5cGUSOQoIcGF0dGVybnMYAyABKAsyJy5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90UnVsZS5QYXR0ZXJucxqlAQoIUGF0dGVybnMSPQoDYWRkGAEgAygLMjAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkJvdFJ1bGUuUGF0dGVybnMuQWRkRW50cnkSDgoGcmVtb3ZlGAIgAygJGkoKCEFkZEVudHJ5EgsKA2tleRgBIAEoCRItCgV2YWx1ZRgCIAEoDjIeLnByb3RvLmRlY2lkZS52MWFscGhhMS5Cb3RUeXBlOgI4ASKNAQoJQm90VjJSdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRINCgVhbGxvdxgCIAMoCRIMCgRkZW55GAMgAygJEjgKB3ZlcnNpb24YBCABKA4yJy5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90VjJSdWxlVmVyc2lvbiLGAgoJRW1haWxSdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRIzCgVibG9jaxgCIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGVCAhgBEiAKGHJlcXVpcmVfdG9wX2xldmVsX2RvbWFpbhgDIAEoCBIcChRhbGxvd19kb21haW5fbGl0ZXJhbBgEIAEoCBIvCgVhbGxvdxgFIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUSLgoEZGVueRgGIAMoDjIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFR5cGUSOAoHdmVyc2lvbhgHIAEoDjInLnByb3RvLmRlY2lkZS52MWFscGhhMS5FbWFpbFJ1bGVWZXJzaW9uIp0BChFTZW5zaXRpdmVJbmZvUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFYWxsb3cYAiADKAkSDAoEZGVueRgDIAMoCRJACgd2ZXJzaW9uGAQgASgOMi8ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlNlbnNpdGl2ZUluZm9SdWxlVmVyc2lvbiKfAQoKU2hpZWxkUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSEgoKYXV0b19hZGRlZBgCIAEoCBIXCg9jaGFyYWN0ZXJpc3RpY3MYAyADKAkSOQoHdmVyc2lvbhgEIAEoDjIoLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSdWxlVmVyc2lvbiKPAQoKRmlsdGVyUnVsZRIpCgRtb2RlGAEgASgOMhsucHJvdG8uZGVjaWRlLnYxYWxwaGExLk1vZGUSDQoFYWxsb3cYAiADKAkSDAoEZGVueRgDIAMoCRI5Cgd2ZXJzaW9uGAQgASgOMigucHJvdG8uZGVjaWRlLnYxYWxwaGExLkZpbHRlclJ1bGVWZXJzaW9uIsABChxQcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlEikKBG1vZGUYASABKA4yGy5wcm90by5kZWNpZGUudjFhbHBoYTEuTW9kZRIaCgl0aHJlc2hvbGQYAiABKAFCAhgBSACIAQESSwoHdmVyc2lvbhgDIAEoDjI6LnByb3RvLmRlY2lkZS52MWFscGhhMS5Qcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlVmVyc2lvbkIMCgpfdGhyZXNob2xkIuoDCgRSdWxlEjoKCnJhdGVfbGltaXQYASABKAsyJC5wcm90by5kZWNpZGUudjFhbHBoYTEuUmF0ZUxpbWl0UnVsZUgAEi4KBGJvdHMYAiABKAsyHi5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90UnVsZUgAEjEKBWVtYWlsGAMgASgLMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLkVtYWlsUnVsZUgAEjMKBnNoaWVsZBgEIAEoCzIhLnByb3RvLmRlY2lkZS52MWFscGhhMS5TaGllbGRSdWxlSAASQgoOc2Vuc2l0aXZlX2luZm8YBSABKAsyKC5wcm90by5kZWNpZGUudjFhbHBoYTEuU2Vuc2l0aXZlSW5mb1J1bGVIABIyCgZib3RfdjIYBiABKAsyIC5wcm90by5kZWNpZGUudjFhbHBoYTEuQm90VjJSdWxlSAASMwoGZmlsdGVyGAcgASgLMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkZpbHRlclJ1bGVIABJZChpwcm9tcHRfaW5qZWN0aW9uX2RldGVjdGlvbhgIIAEoCzIzLnByb3RvLmRlY2lkZS52MWFscGhhMS5Qcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlSABCBgoEcnVsZSLWAQoKUnVsZVJlc3VsdBIPCgdydWxlX2lkGAEgASgJEi8KBXN0YXRlGAIgASgOMiAucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJ1bGVTdGF0ZRI1Cgpjb25jbHVzaW9uGAMgASgOMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkNvbmNsdXNpb24SLQoGcmVhc29uGAQgASgLMh0ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJlYXNvbhILCgN0dGwYBSABKA0SEwoLZmluZ2VycHJpbnQYBiABKAkikwMKDlJlcXVlc3REZXRhaWxzEgoKAmlwGAEgASgJEg4KBm1ldGhvZBgCIAEoCRIQCghwcm90b2NvbBgDIAEoCRIMCgRob3N0GAQgASgJEgwKBHBhdGgYBSABKAkSQwoHaGVhZGVycxgGIAMoCzIyLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscy5IZWFkZXJzRW50cnkSDAoEYm9keRgHIAEoDBI/CgVleHRyYRgIIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscy5FeHRyYUVudHJ5Eg0KBWVtYWlsGAkgASgJEg8KB2Nvb2tpZXMYCiABKAkSDQoFcXVlcnkYCyABKAkSFgoOY29ycmVsYXRpb25faWQYDCABKAkaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaLAoKRXh0cmFFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIvgBCghEZWNpc2lvbhIKCgJpZBgBIAEoCRI1Cgpjb25jbHVzaW9uGAIgASgOMiEucHJvdG8uZGVjaWRlLnYxYWxwaGExLkNvbmNsdXNpb24SLQoGcmVhc29uGAMgASgLMh0ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlJlYXNvbhI3CgxydWxlX3Jlc3VsdHMYBCADKAsyIS5wcm90by5kZWNpZGUudjFhbHBoYTEuUnVsZVJlc3VsdBILCgN0dGwYBSABKA0SNAoKaXBfZGV0YWlscxgGIAEoCzIgLnByb3RvLmRlY2lkZS52MWFscGhhMS5JcERldGFpbHMi6AEKDURlY2lkZVJlcXVlc3QSMgoJc2RrX3N0YWNrGAEgASgOMh8ucHJvdG8uZGVjaWRlLnYxYWxwaGExLlNES1N0YWNrEhMKC3Nka192ZXJzaW9uGAIgASgJEjYKB2RldGFpbHMYBCABKAsyJS5wcm90by5kZWNpZGUudjFhbHBoYTEuUmVxdWVzdERldGFpbHMSKgoFcnVsZXMYBSADKAsyGy5wcm90by5kZWNpZGUudjFhbHBoYTEuUnVsZRIXCg9jaGFyYWN0ZXJpc3RpY3MYBiADKAlKBAgDEARSC2ZpbmdlcnByaW50IrIBCg5EZWNpZGVSZXNwb25zZRIxCghkZWNpc2lvbhgBIAEoCzIfLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpc2lvbhI/CgVleHRyYRgCIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpZGVSZXNwb25zZS5FeHRyYUVudHJ5GiwKCkV4dHJhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASKuAgoNUmVwb3J0UmVxdWVzdBIyCglzZGtfc3RhY2sYASABKA4yHy5wcm90by5kZWNpZGUudjFhbHBoYTEuU0RLU3RhY2sSEwoLc2RrX3ZlcnNpb24YAiABKAkSNgoHZGV0YWlscxgEIAEoCzIlLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXF1ZXN0RGV0YWlscxIxCghkZWNpc2lvbhgFIAEoCzIfLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpc2lvbhIqCgVydWxlcxgGIAMoCzIbLnByb3RvLmRlY2lkZS52MWFscGhhMS5SdWxlEhcKD2NoYXJhY3RlcmlzdGljcxgIIAMoCUoECAMQBEoECAcQCFILZmluZ2VycHJpbnRSC3JlY2VpdmVkX2F0Io8BCg5SZXBvcnRSZXNwb25zZRI/CgVleHRyYRgCIAMoCzIwLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXBvcnRSZXNwb25zZS5FeHRyYUVudHJ5GiwKCkV4dHJhRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUoECAEQAlIIZGVjaXNpb24qrwEKB0JvdFR5cGUSGAoUQk9UX1RZUEVfVU5TUEVDSUZJRUQQABIZChVCT1RfVFlQRV9OT1RfQU5BTFlaRUQQARIWChJCT1RfVFlQRV9BVVRPTUFURUQQAhIdChlCT1RfVFlQRV9MSUtFTFlfQVVUT01BVEVEEAMSHQoZQk9UX1RZUEVfTElLRUxZX05PVF9BX0JPVBAEEhkKFUJPVF9UWVBFX1ZFUklGSUVEX0JPVBAFKqkBCglFbWFpbFR5cGUSGgoWRU1BSUxfVFlQRV9VTlNQRUNJRklFRBAAEhkKFUVNQUlMX1RZUEVfRElTUE9TQUJMRRABEhMKD0VNQUlMX1RZUEVfRlJFRRACEhwKGEVNQUlMX1RZUEVfTk9fTVhfUkVDT1JEUxADEhoKFkVNQUlMX1RZUEVfTk9fR1JBVkFUQVIQBBIWChJFTUFJTF9UWVBFX0lOVkFMSUQQBSo9CgRNb2RlEhQKEE1PREVfVU5TUEVDSUZJRUQQABIQCgxNT0RFX0RSWV9SVU4QARINCglNT0RFX0xJVkUQAiqCAQoJUnVsZVN0YXRlEhoKFlJVTEVfU1RBVEVfVU5TUEVDSUZJRUQQABISCg5SVUxFX1NUQVRFX1JVThABEhYKElJVTEVfU1RBVEVfTk9UX1JVThACEhYKElJVTEVfU1RBVEVfRFJZX1JVThADEhUKEVJVTEVfU1RBVEVfQ0FDSEVEEAQqgwEKCkNvbmNsdXNpb24SGgoWQ09OQ0xVU0lPTl9VTlNQRUNJRklFRBAAEhQKEENPTkNMVVNJT05fQUxMT1cQARITCg9DT05DTFVTSU9OX0RFTlkQAhIYChRDT05DTFVTSU9OX0NIQUxMRU5HRRADEhQKEENPTkNMVVNJT05fRVJST1IQBCrqAgoIU0RLU3RhY2sSGQoVU0RLX1NUQUNLX1VOU1BFQ0lGSUVEEAASFAoQU0RLX1NUQUNLX05PREVKUxABEhQKEFNES19TVEFDS19ORVhUSlMQAhIUChBTREtfU1RBQ0tfUFlUSE9OEAMSFAoQU0RLX1NUQUNLX0RKQU5HTxAEEhEKDVNES19TVEFDS19CVU4QBRISCg5TREtfU1RBQ0tfREVOTxAGEhcKE1NES19TVEFDS19TVkVMVEVLSVQQBxISCg5TREtfU1RBQ0tfSE9OTxAIEhIKDlNES19TVEFDS19OVVhUEAkSFAoQU0RLX1NUQUNLX05FU1RKUxAKEhMKD1NES19TVEFDS19SRU1JWBALEhMKD1NES19TVEFDS19BU1RSTxAMEhUKEVNES19TVEFDS19GQVNUSUZZEA0SGgoWU0RLX1NUQUNLX1JFQUNUX1JPVVRFUhAOEhAKDFNES19TVEFDS19HTxAPKrEBChJSYXRlTGltaXRBbGdvcml0aG0SJAogUkFURV9MSU1JVF9BTEdPUklUSE1fVU5TUEVDSUZJRUQQABIlCiFSQVRFX0xJTUlUX0FMR09SSVRITV9UT0tFTl9CVUNLRVQQARIlCiFSQVRFX0xJTUlUX0FMR09SSVRITV9GSVhFRF9XSU5ET1cQAhInCiNSQVRFX0xJTUlUX0FMR09SSVRITV9TTElESU5HX1dJTkRPVxADKj8KFFJhdGVMaW1pdFJ1bGVWZXJzaW9uEicKI1JBVEVfTElNSVRfUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqNwoQQm90VjJSdWxlVmVyc2lvbhIjCh9CT1RfVjJfUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqNgoQRW1haWxSdWxlVmVyc2lvbhIiCh5FTUFJTF9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQACpHChhTZW5zaXRpdmVJbmZvUnVsZVZlcnNpb24SKwonU0VOU0lUSVZFX0lORk9fUlVMRV9WRVJTSU9OX1VOU1BFQ0lGSUVEEAAqOAoRU2hpZWxkUnVsZVZlcnNpb24SIwofU0hJRUxEX1JVTEVfVkVSU0lPTl9VTlNQRUNJRklFRBAAKjgKEUZpbHRlclJ1bGVWZXJzaW9uEiMKH0ZJTFRFUl9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQACpeCiNQcm9tcHRJbmplY3Rpb25EZXRlY3Rpb25SdWxlVmVyc2lvbhI3CjNQUk9NUFRfSU5KRUNUSU9OX0RFVEVDVElPTl9SVUxFX1ZFUlNJT05fVU5TUEVDSUZJRUQQADK9AQoNRGVjaWRlU2VydmljZRJVCgZEZWNpZGUSJC5wcm90by5kZWNpZGUudjFhbHBoYTEuRGVjaWRlUmVxdWVzdBolLnByb3RvLmRlY2lkZS52MWFscGhhMS5EZWNpZGVSZXNwb25zZRJVCgZSZXBvcnQSJC5wcm90by5kZWNpZGUudjFhbHBoYTEuUmVwb3J0UmVxdWVzdBolLnByb3RvLmRlY2lkZS52MWFscGhhMS5SZXBvcnRSZXNwb25zZULKAQoZY29tLnByb3RvLmRlY2lkZS52MWFscGhhMUILRGVjaWRlUHJvdG9QAVoqYXJjamV0L2dlbi9nby9kZWNpZGUvYWxwaGExO2RlY2lkZXYxYWxwaGExogIDUERYqgIVUHJvdG8uRGVjaWRlLlYxYWxwaGExygIVUHJvdG9cRGVjaWRlXFYxYWxwaGEx4gIhUHJvdG9cRGVjaWRlXFYxYWxwaGExXEdQQk1ldGFkYXRh6gIXUHJvdG86OkRlY2lkZTo6VjFhbHBoYTFiBnByb3RvMw", [file_google_protobuf_timestamp]); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IpDetails. | ||
| * Use `create(IpDetailsSchema)` to create a new message. | ||
| */ | ||
| export const IpDetailsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 0); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Reason. | ||
| * Use `create(ReasonSchema)` to create a new message. | ||
| */ | ||
| export const ReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 1); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitReason. | ||
| * Use `create(RateLimitReasonSchema)` to create a new message. | ||
| */ | ||
| export const RateLimitReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 2); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EdgeRuleReason. | ||
| * Use `create(EdgeRuleReasonSchema)` to create a new message. | ||
| * @deprecated | ||
| */ | ||
| export const EdgeRuleReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 3); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotReason. | ||
| * Use `create(BotReasonSchema)` to create a new message. | ||
| */ | ||
| export const BotReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 4); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Reason. | ||
| * Use `create(BotV2ReasonSchema)` to create a new message. | ||
| */ | ||
| export const BotV2ReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 5); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldReason. | ||
| * Use `create(ShieldReasonSchema)` to create a new message. | ||
| */ | ||
| export const ShieldReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 6); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterReason. | ||
| * Use `create(FilterReasonSchema)` to create a new message. | ||
| */ | ||
| export const FilterReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 7); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailReason. | ||
| * Use `create(EmailReasonSchema)` to create a new message. | ||
| */ | ||
| export const EmailReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 8); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ErrorReason. | ||
| * Use `create(ErrorReasonSchema)` to create a new message. | ||
| */ | ||
| export const ErrorReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 9); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionReason. | ||
| * Use `create(PromptInjectionReasonSchema)` to create a new message. | ||
| */ | ||
| export const PromptInjectionReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 10); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.IdentifiedEntity. | ||
| * Use `create(IdentifiedEntitySchema)` to create a new message. | ||
| */ | ||
| export const IdentifiedEntitySchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 11); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoReason. | ||
| * Use `create(SensitiveInfoReasonSchema)` to create a new message. | ||
| */ | ||
| export const SensitiveInfoReasonSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 12); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RateLimitRule. | ||
| * Use `create(RateLimitRuleSchema)` to create a new message. | ||
| */ | ||
| export const RateLimitRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 13); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule. | ||
| * Use `create(BotRuleSchema)` to create a new message. | ||
| */ | ||
| export const BotRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 14); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotRule.Patterns. | ||
| * Use `create(BotRule_PatternsSchema)` to create a new message. | ||
| */ | ||
| export const BotRule_PatternsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 14, 0); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.BotV2Rule. | ||
| * Use `create(BotV2RuleSchema)` to create a new message. | ||
| */ | ||
| export const BotV2RuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 15); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.EmailRule. | ||
| * Use `create(EmailRuleSchema)` to create a new message. | ||
| */ | ||
| export const EmailRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 16); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.SensitiveInfoRule. | ||
| * Use `create(SensitiveInfoRuleSchema)` to create a new message. | ||
| */ | ||
| export const SensitiveInfoRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 17); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ShieldRule. | ||
| * Use `create(ShieldRuleSchema)` to create a new message. | ||
| */ | ||
| export const ShieldRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 18); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.FilterRule. | ||
| * Use `create(FilterRuleSchema)` to create a new message. | ||
| */ | ||
| export const FilterRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 19); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.PromptInjectionDetectionRule. | ||
| * Use `create(PromptInjectionDetectionRuleSchema)` to create a new message. | ||
| */ | ||
| export const PromptInjectionDetectionRuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 20); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Rule. | ||
| * Use `create(RuleSchema)` to create a new message. | ||
| */ | ||
| export const RuleSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 21); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RuleResult. | ||
| * Use `create(RuleResultSchema)` to create a new message. | ||
| */ | ||
| export const RuleResultSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 22); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.RequestDetails. | ||
| * Use `create(RequestDetailsSchema)` to create a new message. | ||
| */ | ||
| export const RequestDetailsSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 23); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.Decision. | ||
| * Use `create(DecisionSchema)` to create a new message. | ||
| */ | ||
| export const DecisionSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 24); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideRequest. | ||
| * Use `create(DecideRequestSchema)` to create a new message. | ||
| */ | ||
| export const DecideRequestSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 25); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.DecideResponse. | ||
| * Use `create(DecideResponseSchema)` to create a new message. | ||
| */ | ||
| export const DecideResponseSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 26); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportRequest. | ||
| * Use `create(ReportRequestSchema)` to create a new message. | ||
| */ | ||
| export const ReportRequestSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 27); | ||
| /** | ||
| * Describes the message proto.decide.v1alpha1.ReportResponse. | ||
| * Use `create(ReportResponseSchema)` to create a new message. | ||
| */ | ||
| export const ReportResponseSchema = /*@__PURE__*/ | ||
| messageDesc(file_proto_decide_v1alpha1_decide, 28); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotType. | ||
| */ | ||
| export const BotTypeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 0); | ||
| /** | ||
| * Represents whether we think the client is a bot or not. This should be used | ||
| * alongside the bot score which represents the level of certainty of our | ||
| * detection. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.BotType | ||
| */ | ||
| export const BotType = /*@__PURE__*/ | ||
| tsEnum(BotTypeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailType. | ||
| */ | ||
| export const EmailTypeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 1); | ||
| /** | ||
| * Represents the type of email address submitted. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.EmailType | ||
| */ | ||
| export const EmailType = /*@__PURE__*/ | ||
| tsEnum(EmailTypeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Mode. | ||
| */ | ||
| export const ModeSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 2); | ||
| /** | ||
| * The mode to run in. This can be either `DRY_RUN` or `LIVE`. In `DRY_RUN` | ||
| * mode, all requests will be allowed and you can review what the action would | ||
| * have been from the Arcjet Console. In `LIVE` mode, requests will be allowed, | ||
| * challenged or blocked based on the returned decision. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Mode | ||
| */ | ||
| export const Mode = /*@__PURE__*/ | ||
| tsEnum(ModeSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RuleState. | ||
| */ | ||
| export const RuleStateSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 3); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RuleState | ||
| */ | ||
| export const RuleState = /*@__PURE__*/ | ||
| tsEnum(RuleStateSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.Conclusion. | ||
| */ | ||
| export const ConclusionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 4); | ||
| /** | ||
| * The conclusion for the request based on the Arcjet analysis and any specific | ||
| * configuration. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.Conclusion | ||
| */ | ||
| export const Conclusion = /*@__PURE__*/ | ||
| tsEnum(ConclusionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SDKStack. | ||
| */ | ||
| export const SDKStackSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 5); | ||
| /** | ||
| * The SDK used to make the request. Used for analytics and to help us improve. | ||
| * | ||
| * @generated from enum proto.decide.v1alpha1.SDKStack | ||
| */ | ||
| export const SDKStack = /*@__PURE__*/ | ||
| tsEnum(SDKStackSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitAlgorithm. | ||
| */ | ||
| export const RateLimitAlgorithmSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 6); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm | ||
| */ | ||
| export const RateLimitAlgorithm = /*@__PURE__*/ | ||
| tsEnum(RateLimitAlgorithmSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.RateLimitRuleVersion. | ||
| */ | ||
| export const RateLimitRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 7); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.RateLimitRuleVersion | ||
| */ | ||
| export const RateLimitRuleVersion = /*@__PURE__*/ | ||
| tsEnum(RateLimitRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.BotV2RuleVersion. | ||
| */ | ||
| export const BotV2RuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 8); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.BotV2RuleVersion | ||
| */ | ||
| export const BotV2RuleVersion = /*@__PURE__*/ | ||
| tsEnum(BotV2RuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.EmailRuleVersion. | ||
| */ | ||
| export const EmailRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 9); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.EmailRuleVersion | ||
| */ | ||
| export const EmailRuleVersion = /*@__PURE__*/ | ||
| tsEnum(EmailRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.SensitiveInfoRuleVersion. | ||
| */ | ||
| export const SensitiveInfoRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 10); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.SensitiveInfoRuleVersion | ||
| */ | ||
| export const SensitiveInfoRuleVersion = /*@__PURE__*/ | ||
| tsEnum(SensitiveInfoRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.ShieldRuleVersion. | ||
| */ | ||
| export const ShieldRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 11); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.ShieldRuleVersion | ||
| */ | ||
| export const ShieldRuleVersion = /*@__PURE__*/ | ||
| tsEnum(ShieldRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.FilterRuleVersion. | ||
| */ | ||
| export const FilterRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 12); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.FilterRuleVersion | ||
| */ | ||
| export const FilterRuleVersion = /*@__PURE__*/ | ||
| tsEnum(FilterRuleVersionSchema); | ||
| /** | ||
| * Describes the enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion. | ||
| */ | ||
| export const PromptInjectionDetectionRuleVersionSchema = /*@__PURE__*/ | ||
| enumDesc(file_proto_decide_v1alpha1_decide, 13); | ||
| /** | ||
| * @generated from enum proto.decide.v1alpha1.PromptInjectionDetectionRuleVersion | ||
| */ | ||
| export const PromptInjectionDetectionRuleVersion = /*@__PURE__*/ | ||
| tsEnum(PromptInjectionDetectionRuleVersionSchema); | ||
| /** | ||
| * @generated from service proto.decide.v1alpha1.DecideService | ||
| */ | ||
| export const DecideService = /*@__PURE__*/ | ||
| serviceDesc(file_proto_decide_v1alpha1_decide, 0); | ||
-35
| /** | ||
| * Minimal, dependency-free TypeID generator for local request IDs. | ||
| * | ||
| * Replaces the external `typeid-js` package (and its transitive `uuid` | ||
| * dependency) with an inline implementation. We only ever mint new IDs with a | ||
| * fixed prefix, so this covers generation — not parsing or decoding. | ||
| * | ||
| * The suffix is the 26-character Crockford base32 encoding of a UUIDv7 | ||
| * (RFC 9562), matching the TypeID specification | ||
| * (https://github.com/jetify-com/typeid). Mirrors the vendored implementation | ||
| * in the Arcjet Python SDK so both SDKs produce identical IDs. | ||
| */ | ||
| /** Crockford base32 alphabet (lowercase, excludes `i`, `l`, `o`, `u`). */ | ||
| export declare const CROCKFORD_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz"; | ||
| /** | ||
| * Generate the 16 raw bytes of a UUIDv7 (RFC 9562): a 48-bit big-endian | ||
| * millisecond timestamp, version `7`, the RFC 4122 variant (`10`), and random | ||
| * bits filling the remainder. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing; production | ||
| * callers use the defaults. | ||
| * | ||
| * @throws {RangeError} | ||
| * If `nowMs` is not an integer in the 48-bit range `[0, 2 ** 48)`, or if | ||
| * `random` is not exactly 10 bytes. Both would otherwise silently produce a | ||
| * malformed ID (a wrapped timestamp or zero-filled entropy). | ||
| */ | ||
| export declare function uuidV7Bytes(nowMs?: number, random?: Uint8Array): Uint8Array; | ||
| /** | ||
| * Generate a new TypeID string — `<prefix>_<suffix>`, where the suffix is the | ||
| * Crockford base32 encoding of a freshly generated UUIDv7. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing. | ||
| */ | ||
| export declare function typeid(prefix: string, nowMs?: number, random?: Uint8Array): string; |
-82
| /** | ||
| * Minimal, dependency-free TypeID generator for local request IDs. | ||
| * | ||
| * Replaces the external `typeid-js` package (and its transitive `uuid` | ||
| * dependency) with an inline implementation. We only ever mint new IDs with a | ||
| * fixed prefix, so this covers generation — not parsing or decoding. | ||
| * | ||
| * The suffix is the 26-character Crockford base32 encoding of a UUIDv7 | ||
| * (RFC 9562), matching the TypeID specification | ||
| * (https://github.com/jetify-com/typeid). Mirrors the vendored implementation | ||
| * in the Arcjet Python SDK so both SDKs produce identical IDs. | ||
| */ | ||
| /** Crockford base32 alphabet (lowercase, excludes `i`, `l`, `o`, `u`). */ | ||
| const CROCKFORD_ALPHABET = "0123456789abcdefghjkmnpqrstvwxyz"; | ||
| /** Fill a 10-byte buffer from the platform CSPRNG (Web Crypto). */ | ||
| function randomBytes() { | ||
| return crypto.getRandomValues(new Uint8Array(10)); | ||
| } | ||
| /** | ||
| * Generate the 16 raw bytes of a UUIDv7 (RFC 9562): a 48-bit big-endian | ||
| * millisecond timestamp, version `7`, the RFC 4122 variant (`10`), and random | ||
| * bits filling the remainder. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing; production | ||
| * callers use the defaults. | ||
| * | ||
| * @throws {RangeError} | ||
| * If `nowMs` is not an integer in the 48-bit range `[0, 2 ** 48)`, or if | ||
| * `random` is not exactly 10 bytes. Both would otherwise silently produce a | ||
| * malformed ID (a wrapped timestamp or zero-filled entropy). | ||
| */ | ||
| function uuidV7Bytes(nowMs = Date.now(), random = randomBytes()) { | ||
| if (!Number.isInteger(nowMs) || nowMs < 0 || nowMs >= 2 ** 48) { | ||
| throw new RangeError(`uuidV7Bytes: \`nowMs\` must be an integer in [0, 2 ** 48), got ${nowMs}`); | ||
| } | ||
| if (random.length !== 10) { | ||
| throw new RangeError(`uuidV7Bytes: \`random\` must be exactly 10 bytes, got ${random.length}`); | ||
| } | ||
| const timestampMs = BigInt(nowMs); | ||
| const randA = BigInt((random[0] << 4) | (random[1] >> 4)); // 12 bits | ||
| let randBFull = 0n; | ||
| for (let i = 2; i < 10; i++) { | ||
| randBFull = (randBFull << 8n) | BigInt(random[i]); | ||
| } | ||
| const randB = randBFull & ((1n << 62n) - 1n); // 62 bits | ||
| const hi = (timestampMs << 16n) | (0x7n << 12n) | randA; // version 7 | ||
| const lo = (2n << 62n) | randB; // RFC 4122 variant | ||
| const bytes = new Uint8Array(16); | ||
| const view = new DataView(bytes.buffer); | ||
| view.setBigUint64(0, hi, false); // big-endian | ||
| view.setBigUint64(8, lo, false); | ||
| return bytes; | ||
| } | ||
| /** | ||
| * Encode 16 bytes as a 26-character Crockford base32 string. The bytes are read | ||
| * as a big-endian 128-bit integer, most-significant character first. 26 × 5 = | ||
| * 130 bits, so the leading character carries only the top 3 bits and is always | ||
| * `0`-`7`. | ||
| */ | ||
| function encodeCrockford(bytes) { | ||
| let n = 0n; | ||
| for (const byte of bytes) { | ||
| n = (n << 8n) | BigInt(byte); | ||
| } | ||
| const out = new Array(26); | ||
| for (let i = 25; i >= 0; i--) { | ||
| out[i] = CROCKFORD_ALPHABET[Number(n & 0x1fn)]; | ||
| n >>= 5n; | ||
| } | ||
| return out.join(""); | ||
| } | ||
| /** | ||
| * Generate a new TypeID string — `<prefix>_<suffix>`, where the suffix is the | ||
| * Crockford base32 encoding of a freshly generated UUIDv7. | ||
| * | ||
| * `nowMs` and `random` are injectable for deterministic testing. | ||
| */ | ||
| function typeid(prefix, nowMs, random) { | ||
| return `${prefix}_${encodeCrockford(uuidV7Bytes(nowMs, random))}`; | ||
| } | ||
| export { CROCKFORD_ALPHABET, typeid, uuidV7Bytes }; |
| /** Automatically generated - DO NOT MANUALLY EDIT */ | ||
| /** Identifiers for all Well Known Bots that Arcjet can detect */ | ||
| export type ArcjetWellKnownBot = "A6CORP_CRAWLER" | "ABOUNDEX_CRAWLER" | "ACADEMICBOT_RTU" | "ACAPBOT" | "ACOON_CRAWLER" | "ADAGIO_CRAWLER" | "ADBEAT_CRAWLER" | "ADDSEARCH_CRAWLER" | "ADDTHIS_CRAWLER" | "ADMANTX_CRAWLER" | "ADSCANNER_CRAWLER" | "ADSTXTCRAWLER" | "ADVBOT_CRAWLER" | "ADYEN_WEBHOOK" | "AGENTTESLA_BOTNET" | "AHREFS_CRAWLER" | "AHREFS_SITE_AUDIT" | "AI_SEARCH_BOT" | "AI2_CRAWLER" | "AI2_CRAWLER_DOLMA" | "AIHIT_CRAWLER" | "ALEXANDRIA_CRAWLER" | "ALGOLIA_CRAWLER" | "ALPHASEOBOT_CRAWLER" | "AMADEY_BOTNET" | "AMAZON_ADBOT" | "AMAZON_ALEXA_CRAWLER" | "AMAZON_CLOUDFRONT" | "AMAZON_CRAWLER" | "AMAZON_ROUTE53_HEALTH_CHECK" | "ANDERSPINK_CRAWLER" | "ANTHROPIC_CRAWLER" | "ANTIBOT" | "APERCITE_CRAWLER" | "APPLE_CRAWLER" | "APPLE_FEEDFETCHER" | "ARA_CRAWLER" | "ARATURKA_CRAWLER" | "ARCHIVEORG_ARCHIVER" | "AROCOM_CRAWLER" | "ASK_CRAWLER" | "ASPIEGEL_CRAWLER" | "AUDISTO_CRAWLER" | "AVIRA_CRAWLER" | "AWARIO_CRAWLER" | "AWARIO_CRAWLER_RSS" | "AWARIO_CRAWLER_SMART" | "AWESOMECRAWLER" | "AZURE_APP_INSIGHTS" | "B2BBOT" | "BACKLINKTEST_CRAWLER" | "BAIDU_CLOUD_WATCH" | "BAIDU_CRAWLER" | "BANKER_BOTNET" | "BAZQUX_FEEDFETCHER" | "BETABOT" | "BETTERSTACK_MONITOR" | "BETTERUPTIME_MONITOR" | "BIDSWITCH_CRAWLER" | "BIGDATACORP_CRAWLER" | "BIGLOTRON" | "BING_ADS" | "BING_CRAWLER" | "BING_OFFICE_STORE" | "BING_PREVIEW" | "BINLAR" | "BITLY_CRAWLER" | "BITSIGHT_CRAWLER" | "BLACK_BOTNET" | "BLACKBOARD_CRAWLER" | "BLOGMURA_CRAWLER" | "BLOGTRAFFIC_FEEDFETCHER" | "BLP_BBOT" | "BNF_CRAWLER" | "BOMBORA_CRAWLER" | "BOTIFY_CRAWLER" | "BOXCAR_CRAWLER" | "BRAINOBOT" | "BRANDONMEDIA_CRAWLER" | "BRANDVERITY_CRAWLER" | "BRANDWATCH_CRAWLER" | "BRIGHTEDGE_CRAWLER" | "BUBLUP_CRAWLER" | "BUILTWITH_CRAWLER" | "BUZZSTREAM_CRAWLER" | "BYOB_BOTNET" | "BYTEDANCE_CRAWLER" | "CAPSULINK_CRAWLER" | "CAREERX_CRAWLER" | "CCBOT_CRAWLER" | "CENSYS_INSPECT" | "CENTURYBOT" | "CHANGEDETECTION_CRAWLER" | "CHECKLY_MONITOR" | "CHECKMARKNETWORK_CRAWLER" | "CHLOOE_CRAWLER" | "CINCRAWDATA_CRAWLER" | "CISPA_CRAWLER" | "CITESEERX_CRAWLER" | "CLICKAGY_CRAWLER" | "CLIQZ_CRAWLER" | "CLOUDFLARE_ARCHIVER" | "CLOUDFLARE_HEALTHCHECKS" | "CLOUDFLARE_PREFETCH" | "CLOUDFLARE_SECURITY_CENTER" | "CLOUDFLARE_SSL_DETECTOR" | "CLOUDFLARE_TRAFFIC_MANAGER" | "CLOUDSYSTEMNETWORKS_CRAWLER" | "COCCOC_CRAWLER" | "COCOLYZE_CRAWLER" | "CODA_SERVER_FETCHER" | "CODEWISE_CRAWLER" | "COGNITIVESEO_CRAWLER" | "COHERE_CRAWLER" | "COMMONCRAWL_CRAWLER" | "COMPANYBOOK_CRAWLER" | "CONDUCTOR_CRAWLER" | "CONTENT_CRAWLER_SPIDER" | "CONTEXTAD_CRAWLER" | "CONTXBOT" | "CONVERA_CRAWLER" | "COOKIEBOT_CRAWLER" | "COOKIEHUB_SCAN" | "CREATIVECOMMONS_CRAWLER" | "CRITEO_CRAWLER" | "CRYSTALSEMANTICS_CRAWLER" | "CUREBOT_CRAWLER" | "CURL" | "CUTBOT_CRAWLER" | "CXENSE_CRAWLER" | "CYBERPATROL_CRAWLER" | "DAREBOOST_CRAWLER" | "DATADOG_MONITOR_SYNTHETICS" | "DATAFEEDWATCH_CRAWLER" | "DATAFORSEO_CRAWLER" | "DATAGNION_CRAWLER" | "DATANYZE_CRAWLER" | "DATAPROVIDER_CRAWLER" | "DATENBUTLER_CRAWLER" | "DAUM_CRAWLER" | "DCRAWL" | "DEADLINKCHECKER" | "DEEPNOC_CRAWLER" | "DEUSU_CRAWLER" | "DIFFBOT_CRAWLER" | "DIGG_CRAWLER" | "DIGINCORE_CRAWLER" | "DIGITALDRAGON_CRAWLER" | "DISCORD_CRAWLER" | "DISCOVERYENGINE_CRAWLER" | "DISQUS_CRAWLER" | "DNYZ_CRAWLER" | "DOMAINCRAWLER_CRAWLER" | "DOMAINREANIMATOR_CRAWLER" | "DOMAINSBOT_CRAWLER" | "DOMAINSPROJECT_CRAWLER" | "DOMAINSTATS_CRAWLER" | "DOMAINTOOLS_CRAWLER" | "DONUTMATE_BOTNET" | "DOTNETDOTCOM_CRAWLER" | "DRAGONMETRICS_CRAWLER" | "DRIFTNET_CRAWLER" | "DUBBOT_CRAWLER" | "DUCKDUCKGO_CRAWLER" | "DUCKDUCKGO_CRAWLER_FAVICONS" | "DUEDIL_CRAWLER" | "DYNATRACE_MONITOR" | "EC2LINKFINDER" | "EDISTER_CRAWLER" | "ELISABOT" | "EMBEDLY_CRAWLER" | "ENTIREWEB_CRAWLER" | "EPFL_CRAWLER" | "EPICTIONS_CRAWLER" | "ERIGHT_CRAWLER" | "EUROPARCHIVE_CRAWLER" | "EVENTURES_CRAWLER" | "EVENTURES_CRAWLER_BATCH" | "EVERYONESOCIAL_CRAWLER" | "EXENSA_CRAWLER" | "EXPERIBOT_CRAWLER" | "EXTLINKS_CRAWLER" | "EYEOTA_CRAWLER" | "EZID_CRAWLER" | "FACEBOOK_CATALOG" | "FACEBOOK_CRAWLER" | "FACEBOOK_SHARE_CRAWLER" | "FAST_CRAWLER" | "FAST_CRAWLER_ENTERPRISE" | "FEDORAPLANET_CRAWLER" | "FEEDAFEVER_CRAWLER" | "FEEDBIN_CRAWLER" | "FEEDLY_FEEDFETCHER" | "FEEDSPOT_FEEDFETCHER" | "FEMTOSEARCH_CRAWLER" | "FINDTHATFILE_CRAWLER" | "FLAMINGOSEARCH_CRAWLER" | "FLIPBOARD_PROXY" | "FLUFFY" | "FR_CRAWLER" | "FREEWEBMONITORING_MONITOR" | "FRESHRSS_FEEDFETCHER" | "FRESHWORKS_MONITOR" | "FRIENDLYCRAWLER" | "FUELBOT" | "FYREBOT" | "G00G1E_CRAWLER" | "G2READER_CRAWLER" | "G2WEBSERVICES_CRAWLER" | "GAFGYT_BOTNET" | "GARLIK_CRAWLER" | "GEEDO_CRAWLER" | "GEEDO_CRAWLER_PRODUCTS" | "GENIEO_CRAWLER" | "GIGABLAST_CRAWLER" | "GIGABLAST_CRAWLER_OSS" | "GINGER_CRAWLER" | "GLUTENFREEPLEASURE_CRAWLER" | "GNAM_GNAM_SPIDER" | "GNOWIT_CRAWLER" | "GO_HTTP" | "GOO_CRAWLER" | "GOOGLE_ADS_CONVERSIONS" | "GOOGLE_ADSBOT" | "GOOGLE_ADSBOT_MOBILE" | "GOOGLE_ADSENSE" | "GOOGLE_ADSENSE_GOOGLEBOT" | "GOOGLE_ADWORDS" | "GOOGLE_APPENGINE" | "GOOGLE_CERTIFICATES_BRIDGE" | "GOOGLE_CRAWLER" | "GOOGLE_CRAWLER_CLOUDVERTEX" | "GOOGLE_CRAWLER_IMAGE" | "GOOGLE_CRAWLER_MOBILE" | "GOOGLE_CRAWLER_NEWS" | "GOOGLE_CRAWLER_OTHER" | "GOOGLE_CRAWLER_SAFETY" | "GOOGLE_CRAWLER_STORE" | "GOOGLE_CRAWLER_VIDEO" | "GOOGLE_FAVICON" | "GOOGLE_FEEDFETCHER" | "GOOGLE_INSPECTION_TOOL" | "GOOGLE_LIGHTHOUSE" | "GOOGLE_PHYSICAL_WEB" | "GOOGLE_PREVIEW" | "GOOGLE_PUSH_NOTIFICATIONS" | "GOOGLE_READ_ALOUD" | "GOOGLE_SITE_VERIFICATION" | "GOOGLE_STRUCTURED_DATA_TESTING_TOOL" | "GOOGLE_WEB_SNIPPET" | "GOOGLE_XRAWLER" | "GOT" | "GOWIKI_CRAWLER" | "GRAPESHOT_CRAWLER" | "GROB_CRAWLER" | "GROUPHIGH_CRAWLER" | "GROUPME_CRAWLER" | "GRUB" | "GSLFBOT" | "GULOADER_BOTNET" | "GWENE_CRAWLER" | "HAJIME_BOTNET" | "HAOSOU_CRAWLER" | "HATENA_CRAWLER" | "HEADLESS_CHROME" | "HEADLINE_CRAWLER" | "HOYER_CRAWLER" | "HTTP_GET" | "HTTRACK" | "HUBSPOT_CRAWLER" | "HYDROZEN_MONITOR" | "HYPEFACTORS_CRAWLER" | "HYPESTAT_CRAWLER" | "HYSCORE_CRAWLER" | "IA_ARCHIVER" | "IASK_CRAWLER" | "IDEASANDCODE_CRAWLER" | "IFRAMELY_PREVIEW" | "IMAGESIFT_CRAWLER" | "IMESSAGE_PREVIEW" | "IMG2DATASET" | "INDEED_CRAWLER" | "INETDEX_CRAWLER" | "INFEGY_CRAWLER" | "INFOO_CRAWLER" | "INOREADER_AGGREGATOR" | "INTEGRALADS_CRAWLER" | "INTEGROMEDB_CRAWLER" | "INTELIUM_CRAWLER" | "INTERNETARCHIVE_CRAWLER_OSS" | "IONOS_CRAWLER" | "IP_WEB_CRAWLER" | "IPIP_CRAWLER" | "IRC_ARCHIVEBOT" | "ISKANIE_CRAWLER" | "ISS_CRAWLER" | "IT2MEDIA_CRAWLER" | "ITINFLUENTIALS_CRAWLER" | "JAMIEMBROWN_CRAWLER" | "JAVA_APACHE_HTTPCLIENT" | "JAVA_ASYNCHTTPCLIENT" | "JAVA_CRAWLER4J" | "JAVA_HTTPUNIT" | "JAVA_JERSEY" | "JAVA_JETTY" | "JAVA_OKHTTP" | "JAVA_SNACKTORY" | "JAVASCRIPT_AXIOS" | "JAVASCRIPT_NODE_FETCH" | "JAVASCRIPT_PHANTOM" | "JETSLIDE_CRAWLER" | "JOBBOERSE_CRAWLER" | "JOOBLE_CRAWLER" | "JUSPROG_CRAWLER" | "JYXO_CRAWLER" | "K7COMPUTING_CRAWLER" | "KEMVI_CRAWLER" | "KEYBASE_BOT" | "KINSING_BOTNET" | "KOMODIA_CRAWLER" | "KOSMIO_CRAWLER" | "KUMA_MONITOR" | "L9EXPLORE" | "LANDAUMEDIA_CRAWLER" | "LASERLIKE_CRAWLER" | "LAW_UNIMI_CRAWLER" | "LB_SPIDER" | "LEADCRUNCH_CRAWLER" | "LEIKI_CRAWLER" | "LEIPZIG_FINDLINKS" | "LEIPZIG_LCC" | "LEMMY_CRAWLER" | "LIGHTSPEEDSYSTEMS_CRAWLER" | "LINE_CRAWLER" | "LINGUEE_CRAWLER" | "LINKAPEDIA_CRAWLER" | "LINKARCHIVER" | "LINKDEX_CRAWLER" | "LINKEDIN_CRAWLER" | "LINKFLUENCE_CRAWLER" | "LINKIS_CRAWLER" | "LIPPERHEY_CRAWLER" | "LIVELAP_CRAWLER" | "LOGLY_CRAWLER" | "LOOP_CRAWLER" | "LSSBOT" | "LSSBOT_ROCKET" | "LTX71_CRAWLER" | "LUMINATOR_CRAWLER" | "MACOCU_CRAWLER" | "MAILRU_CRAWLER" | "MAJESTIC_CRAWLER" | "MAPPYDATA_CRAWLER" | "MARGINALIA_CRAWLER" | "MASTODON_CRAWLER" | "MAUIBOT" | "MEDIATOOLKIT_CRAWLER" | "MEGAINDEX_CRAWLER" | "MELTWATER_CRAWLER" | "META_CRAWLER" | "META_CRAWLER_USER" | "META_EXTERNALADS" | "METADATALABS_CRAWLER" | "METAJOB_CRAWLER" | "METAURI_CRAWLER" | "METRICSTOOLS_CRAWLER" | "MICROSOFT_PREVIEW" | "MICROSOFT_RESEARCH_CRAWLER" | "MIGNIFY_CRAWLER" | "MIGNIFY_IMRBOT" | "MINIFLUX_FEEDFETCHER" | "MIRAI_BOTNET" | "MIXNODE_CACHE" | "MOAT_CRAWLER" | "MOJEEK_CRAWLER" | "MONITORBACKLINKS_CRAWLER" | "MONSIDO_CRAWLER" | "MOOBOT_BOTNET" | "MOODLE_CRAWLER" | "MOREOVER_CRAWLER" | "MOZ_CRAWLER" | "MOZ_SITE_AUDIT" | "MOZI_BOTNET" | "MSN_CRAWLER" | "MUCKRACK_CRAWLER" | "MULTIVIEWBOT" | "NAGIOS_CHECK_HTTP" | "NAVER_CRAWLER" | "NAVER_CRAWLER_RSS" | "NEEVA_CRAWLER" | "NERDBYNATURE_CRAWLER" | "NERDYBOT_CRAWLER" | "NETCRAFT_CRAWLER" | "NETESTATE_CRAWLER" | "NETICLE_CRAWLER" | "NETSYSTEMSRESEARCH_CRAWLER" | "NETVIBES_CRAWLER" | "NEWRELIC_MONITOR" | "NEWSBLUR_AGGREGATOR" | "NEWSHARECOUNTS_CRAWLER" | "NEWSPAPER" | "NEXTCLOUD_CRAWLER" | "NICECRAWLER_ARCHIVE" | "NICT_CRAWLER" | "NIKI_BOT" | "NING_CRAWLER" | "NINJABOT" | "NIXSTATS_CRAWLER" | "NMAP" | "NTENT_CRAWLER" | "NUTCH" | "NUZZEL_CRAWLER" | "OCARINABOT" | "OKRU_CRAWLER" | "OMGILI_CRAWLER" | "ONCRAWL" | "OPENAI_CRAWLER" | "OPENAI_CRAWLER_SEARCH" | "OPENAI_CRAWLER_USER" | "OPENGRAPHCHECK_CRAWLER" | "OPENHOSE_CRAWLER" | "OPENINDEX_CRAWLER" | "ORANGE_CRAWLER" | "ORANGE_FTGROUP_CRAWLER" | "OUTBRAIN_LINK_CHECKER" | "OUTCLICKS_CRAWLER" | "PAGE_TO_RSS" | "PAGEPEEKER_CRAWLER" | "PAGETHING_CRAWLER" | "PALOALTONETWORKS_CRAWLER" | "PANSCIENT_CRAWLER" | "PAPERLI_CRAWLER" | "PERL_LIBWWW" | "PERL_PCORE" | "PERPLEXITY_CRAWLER" | "PERPLEXITY_USER" | "PETALSEARCH_CRAWLER" | "PHP_CURLCLASS" | "PHP_PHPCRAWL" | "PHP_SIMPLE_SCRAPER" | "PHP_SIMPLEPIE" | "PHXBOT" | "PICSEARCH_CRAWLER" | "PINGDOM_CRAWLER" | "PINTEREST_CRAWLER" | "PINTREST_CRAWLER" | "PIPL_CRAWLER" | "POCKET_CRAWLER" | "POSTMAN" | "POSTRANK_CRAWLER" | "PRCY_CRAWLER" | "PRIMAL_CRAWLER" | "PRIVACORE_CRAWLER" | "PRIVACYAWARE_CRAWLER" | "PROFOUND_CRAWLER" | "PROXIMIC_CRAWLER" | "PULSEPOINT_CRAWLER" | "PURE_CRAWLER" | "PYTHON_AIOHTTP" | "PYTHON_BITBOT" | "PYTHON_HTTPX" | "PYTHON_OPENGRAPH" | "PYTHON_REQUESTS" | "PYTHON_SCRAPY" | "PYTHON_URLLIB" | "QUANTCAST_CRAWLER" | "QWANT_CRAWLER" | "RANKACTIVE_CRAWLER" | "REDDIT_CRAWLER" | "REFIND_CRAWLER" | "REMCOSRAT_BOTNET" | "RETREVO_PAGE_ANALYZER" | "RIDDER_CRAWLER" | "RIVVA_CRAWLER" | "RSSBOT_FEEDFETCHER" | "RSSING_CRAWLER" | "RSSMICRO_FEEDFETCHER" | "RUBY_METAINSPECTOR" | "RYTE_CRAWLER" | "SAFEDNS_CRAWLER" | "SBINTUITIONS_BOT" | "SCAN_INTERFAX_CRAWLER" | "SCHMORP_CRAWLER" | "SCOUTJET_CRAWLER" | "SCREAMINGFROG_CRAWLER" | "SCRIBD_CRAWLER" | "SCRITCH_CRAWLER" | "SEARCHATLAS_CRAWLER" | "SEEKBOT_CRAWLER" | "SEEKPORT_CRAWLER" | "SEEWITHKIDS_CRAWLER" | "SEMANTICAUDIENCE_CRAWLER" | "SEMANTICSCHOLAR_CRAWLER" | "SEMPITECH_CRAWLER" | "SEMRUSH_CRAWLER" | "SENTIONE_CRAWLER" | "SENTRY_CRAWLER" | "SENTRY_UPTIME_MONITOR" | "SENUTO_CRAWLER" | "SEOBILITY_CRAWLER" | "SEOKICKS_CRAWLER" | "SEOLIZER_CRAWLER" | "SEOPROFILER_CRAWLER" | "SEOSCANNERS_CRAWLER" | "SEOSTAR_CRAWLER" | "SEOZOOM_CRAWLER" | "SERENDEPUTY_CRAWLER" | "SERPSTATBOT_CRAWLER" | "SEZNAM_CRAWLER" | "SIMILARTECH_CRAWLER" | "SIMPLE_CRAWLER" | "SISTRIX_007AC9_CRAWLER" | "SISTRIX_CRAWLER" | "SITEBOT_CRAWLER" | "SITEBULB" | "SITECHECKER_CRAWLER" | "SITEEXPLORER_CRAWLER" | "SITEIMPROVE_CRAWLER" | "SKYPE_PREVIEW" | "SLACK_CRAWLER" | "SLACK_IMAGE_PROXY" | "SNAP_PREVIEW" | "SOCIALRANK_CRAWLER" | "SOFTBYTELABS_CRAWLER" | "SOGOU_CRAWLER" | "STARTME_CRAWLER" | "STATUSCAKE_MONITOR" | "STEALC_BOTNET" | "STEAM_PREVIEW" | "STORYGIZE_CRAWLER" | "STRACT_CRAWLER" | "STRIPE_CRAWLER" | "STRIPE_WEBHOOK" | "STUTTGART_CRAWLER" | "SUMMALY_CRAWLER" | "SUMMIFY_CRAWLER" | "SUPERFEEDR_CRAWLER" | "SURLY_CRAWLER" | "SWIMGBOT" | "SYNAPSE_CRAWLER" | "SYSOMOS_CRAWLER" | "T3VERSIONS_CRAWLER" | "TABOOLA_CRAWLER" | "TAGOO_CRAWLER" | "TANGIBLEE_CRAWLER" | "TELEGRAM_CRAWLER" | "TESTOMATO_CRAWLER" | "THEOLDREADER_CRAWLER" | "THINKLAB_CRAWLER" | "TIGER_CRAWLER" | "TIKTOK_CRAWLER" | "TIMPI_CRAWLER" | "TINEYE_CRAWLER" | "TISCALI_CRAWLER" | "TOMBASCRAPER_CRAWLER" | "TOPLIST_CRAWLER" | "TORUS_CRAWLER" | "TOUTIAO_CRAWLER" | "TRAACKR_CRAWLER" | "TRACEMYFILE_CRAWLER" | "TRENDICTION_CRAWLER" | "TRENDSMAP_CRAWLER" | "TROVE_CRAWLER" | "TROVIT_CRAWLER" | "TTRSS_FEEDFETCHER" | "TURNITIN_CRAWLER" | "TWEETEDTIMES_CRAWLER" | "TWEETMEMEBOT" | "TWENGA_CRAWLER" | "TWINGLY_CRAWLER" | "TWITTER_CRAWLER" | "TWOIP_CRAWLER" | "TWOIP_CRAWLER_CMS" | "TWURLY_CRAWLER" | "UBERMETRICS_CRAWLER" | "UBT_CRAWLER" | "UPFLOW_CRAWLER" | "UPTIME_MONITOR" | "UPTIMEBOT_MONITOR" | "UPTIMEROBOT_MONITOR" | "URLCLASSIFICATION_CRAWLER" | "USINE_NOUVELLE_CRAWLER" | "UTEXAS_CRAWLER" | "UTORRENT_CRAWLER" | "VEBIDOO_CRAWLER" | "VELEN_CRAWLER" | "VEOOZ_CRAWLER" | "VERCEL_CRAWLER" | "VERCEL_MONITOR_PREVIEW" | "VERISIGN_IPS_AGENT" | "VIBER_CRAWLER" | "VIGIL_CRAWLER" | "VIPNYTT_CRAWLER" | "VIRUSTOTAL_CRAWLER" | "VKROBOT_CRAWLER" | "VKSHARE_CRAWLER" | "VUHUV_CRAWLER" | "W3C_VALIDATOR_CSS" | "W3C_VALIDATOR_FEED" | "W3C_VALIDATOR_HTML" | "W3C_VALIDATOR_HTML_NU" | "W3C_VALIDATOR_I18N" | "W3C_VALIDATOR_LINKS" | "W3C_VALIDATOR_MOBILE" | "W3C_VALIDATOR_UNIFIED" | "WAREBAY_CRAWLER" | "WEBARCHIVE_CRAWLER" | "WEBCEO_CRAWLER" | "WEBCOMPANY_CRAWLER" | "WEBDATASTATS_CRAWLER" | "WEBEAVER_CRAWLER" | "WEBMEUP_CRAWLER" | "WEBMON" | "WEBPAGETEST_CRAWLER" | "WEBZIO_CRAWLER" | "WEBZIO_CRAWLER_AI" | "WELLKNOWN_CRAWLER" | "WESEE_CRAWLER" | "WGET" | "WHATSAPP_CRAWLER" | "WOCODI_CRAWLER" | "WOORANK_CRAWLER" | "WOORANK_CRAWLER_REVIEW" | "WORDPRESS_CRAWLER" | "WORDPRESS_CRAWLER_RSS" | "WORDUP_CRAWLER" | "WORIO_CRAWLER" | "WOTBOX_CRAWLER" | "XENU_CRAWLER" | "XOVIBOT_CRAWLER" | "YACY_CRAWLER" | "YAHOO_CRAWLER" | "YAHOO_CRAWLER_JAPAN" | "YAHOO_PREVIEW" | "YAMANALAB_CRAWLER" | "YANDEX_CRAWLER" | "YANDEX_CRAWLER_JAVASCRIPT" | "YANGA_CRAWLER" | "YELLOWBP_CRAWLER" | "YEXT_BOT" | "YISOU_CRAWLER" | "YOOZ_CRAWLER" | "YOU_CRAWLER" | "ZABBIX_MONITOR" | "ZGRAB" | "ZGRAT_BOTNET" | "ZOOMINFO_CRAWLER" | "ZUM_CRAWLER" | "ZUPERLIST_CRAWLER" | "ARCJET_SIGNALS"; | ||
| export type ArcjetBotCategory = "CATEGORY:ACADEMIC" | "CATEGORY:ADVERTISING" | "CATEGORY:AI" | "CATEGORY:AMAZON" | "CATEGORY:APPLE" | "CATEGORY:ARCHIVE" | "CATEGORY:BOTNET" | "CATEGORY:FEEDFETCHER" | "CATEGORY:GOOGLE" | "CATEGORY:META" | "CATEGORY:MICROSOFT" | "CATEGORY:MONITOR" | "CATEGORY:OPTIMIZER" | "CATEGORY:PREVIEW" | "CATEGORY:PROGRAMMATIC" | "CATEGORY:SEARCH_ENGINE" | "CATEGORY:SLACK" | "CATEGORY:SOCIAL" | "CATEGORY:TOOL" | "CATEGORY:UNKNOWN" | "CATEGORY:VERCEL" | "CATEGORY:WEBHOOK" | "CATEGORY:YAHOO"; | ||
| export declare const categories: Record<ArcjetBotCategory, readonly ArcjetWellKnownBot[]>; |
| /** Automatically generated - DO NOT MANUALLY EDIT */ | ||
| const categories = Object.freeze({ | ||
| "CATEGORY:ACADEMIC": Object.freeze([ | ||
| "ACADEMICBOT_RTU", | ||
| "BLACKBOARD_CRAWLER", | ||
| "CISPA_CRAWLER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "DOMAINSPROJECT_CRAWLER", | ||
| "EPFL_CRAWLER", | ||
| "EZID_CRAWLER", | ||
| "LAW_UNIMI_CRAWLER", | ||
| "LEIPZIG_FINDLINKS", | ||
| "LEIPZIG_LCC", | ||
| "MACOCU_CRAWLER", | ||
| "NICT_CRAWLER", | ||
| "SEMANTICSCHOLAR_CRAWLER", | ||
| "TURNITIN_CRAWLER", | ||
| "UTEXAS_CRAWLER", | ||
| "YAMANALAB_CRAWLER", | ||
| ]), | ||
| "CATEGORY:ADVERTISING": Object.freeze([ | ||
| "ADAGIO_CRAWLER", | ||
| "AHREFS_SITE_AUDIT", | ||
| "AMAZON_ADBOT", | ||
| "BING_ADS", | ||
| "GOOGLE_ADS_CONVERSIONS", | ||
| "GOOGLE_ADSBOT", | ||
| "GOOGLE_ADSBOT_MOBILE", | ||
| "GOOGLE_ADSENSE", | ||
| "GOOGLE_ADSENSE_GOOGLEBOT", | ||
| "GOOGLE_ADWORDS", | ||
| "META_EXTERNALADS", | ||
| "MOAT_CRAWLER", | ||
| "MSN_CRAWLER", | ||
| "QUANTCAST_CRAWLER", | ||
| ]), | ||
| "CATEGORY:AI": Object.freeze([ | ||
| "AI_SEARCH_BOT", | ||
| "AI2_CRAWLER", | ||
| "AI2_CRAWLER_DOLMA", | ||
| "AIHIT_CRAWLER", | ||
| "ANTHROPIC_CRAWLER", | ||
| "BOTIFY_CRAWLER", | ||
| "BYTEDANCE_CRAWLER", | ||
| "COHERE_CRAWLER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "DIFFBOT_CRAWLER", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "FRIENDLYCRAWLER", | ||
| "GLUTENFREEPLEASURE_CRAWLER", | ||
| "GOOGLE_CRAWLER_CLOUDVERTEX", | ||
| "IASK_CRAWLER", | ||
| "IMAGESIFT_CRAWLER", | ||
| "IMG2DATASET", | ||
| "INFEGY_CRAWLER", | ||
| "INTEGRALADS_CRAWLER", | ||
| "LEADCRUNCH_CRAWLER", | ||
| "MEDIATOOLKIT_CRAWLER", | ||
| "META_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "NICT_CRAWLER", | ||
| "NTENT_CRAWLER", | ||
| "OMGILI_CRAWLER", | ||
| "OPENAI_CRAWLER", | ||
| "OPENAI_CRAWLER_SEARCH", | ||
| "OPENAI_CRAWLER_USER", | ||
| "PERPLEXITY_CRAWLER", | ||
| "PERPLEXITY_USER", | ||
| "PETALSEARCH_CRAWLER", | ||
| "PRIMAL_CRAWLER", | ||
| "PYTHON_SCRAPY", | ||
| "SAFEDNS_CRAWLER", | ||
| "SBINTUITIONS_BOT", | ||
| "SEARCHATLAS_CRAWLER", | ||
| "SEMANTICSCHOLAR_CRAWLER", | ||
| "SENTIONE_CRAWLER", | ||
| "STORYGIZE_CRAWLER", | ||
| "TIKTOK_CRAWLER", | ||
| "TIMPI_CRAWLER", | ||
| "TURNITIN_CRAWLER", | ||
| "VELEN_CRAWLER", | ||
| "WEBZIO_CRAWLER_AI", | ||
| "YOU_CRAWLER", | ||
| ]), | ||
| "CATEGORY:AMAZON": Object.freeze([ | ||
| "AMAZON_ADBOT", | ||
| "AMAZON_ALEXA_CRAWLER", | ||
| "AMAZON_CLOUDFRONT", | ||
| "AMAZON_CRAWLER", | ||
| "AMAZON_ROUTE53_HEALTH_CHECK", | ||
| ]), | ||
| "CATEGORY:APPLE": Object.freeze([ | ||
| "APPLE_CRAWLER", | ||
| "IMESSAGE_PREVIEW", | ||
| ]), | ||
| "CATEGORY:ARCHIVE": Object.freeze([ | ||
| "ARCHIVEORG_ARCHIVER", | ||
| "CCBOT_CRAWLER", | ||
| "CLOUDFLARE_ARCHIVER", | ||
| "COMMONCRAWL_CRAWLER", | ||
| "EZID_CRAWLER", | ||
| "INTERNETARCHIVE_CRAWLER_OSS", | ||
| "IRC_ARCHIVEBOT", | ||
| "LINKARCHIVER", | ||
| "NICECRAWLER_ARCHIVE", | ||
| "TRENDSMAP_CRAWLER", | ||
| "WEBARCHIVE_CRAWLER", | ||
| ]), | ||
| "CATEGORY:BOTNET": Object.freeze([ | ||
| "AGENTTESLA_BOTNET", | ||
| "AMADEY_BOTNET", | ||
| "BANKER_BOTNET", | ||
| "BLACK_BOTNET", | ||
| "BYOB_BOTNET", | ||
| "DONUTMATE_BOTNET", | ||
| "GAFGYT_BOTNET", | ||
| "GULOADER_BOTNET", | ||
| "HAJIME_BOTNET", | ||
| "KINSING_BOTNET", | ||
| "MIRAI_BOTNET", | ||
| "MOOBOT_BOTNET", | ||
| "MOZI_BOTNET", | ||
| "REMCOSRAT_BOTNET", | ||
| "STEALC_BOTNET", | ||
| "ZGRAT_BOTNET", | ||
| ]), | ||
| "CATEGORY:FEEDFETCHER": Object.freeze([ | ||
| "APPLE_FEEDFETCHER", | ||
| "AWARIO_CRAWLER_RSS", | ||
| "BAZQUX_FEEDFETCHER", | ||
| "BLOGTRAFFIC_FEEDFETCHER", | ||
| "FEEDBIN_CRAWLER", | ||
| "FEEDLY_FEEDFETCHER", | ||
| "FEEDSPOT_FEEDFETCHER", | ||
| "FRESHRSS_FEEDFETCHER", | ||
| "G2READER_CRAWLER", | ||
| "GOOGLE_FEEDFETCHER", | ||
| "INOREADER_AGGREGATOR", | ||
| "MINIFLUX_FEEDFETCHER", | ||
| "NAVER_CRAWLER_RSS", | ||
| "NEWSBLUR_AGGREGATOR", | ||
| "POCKET_CRAWLER", | ||
| "REFIND_CRAWLER", | ||
| "RSSBOT_FEEDFETCHER", | ||
| "RSSING_CRAWLER", | ||
| "RSSMICRO_FEEDFETCHER", | ||
| "SERENDEPUTY_CRAWLER", | ||
| "STARTME_CRAWLER", | ||
| "SUPERFEEDR_CRAWLER", | ||
| "THEOLDREADER_CRAWLER", | ||
| "TTRSS_FEEDFETCHER", | ||
| "WORDPRESS_CRAWLER_RSS", | ||
| ]), | ||
| "CATEGORY:GOOGLE": Object.freeze([ | ||
| "GOOGLE_ADS_CONVERSIONS", | ||
| "GOOGLE_ADSBOT", | ||
| "GOOGLE_ADSBOT_MOBILE", | ||
| "GOOGLE_ADSENSE", | ||
| "GOOGLE_ADSENSE_GOOGLEBOT", | ||
| "GOOGLE_ADWORDS", | ||
| "GOOGLE_APPENGINE", | ||
| "GOOGLE_CERTIFICATES_BRIDGE", | ||
| "GOOGLE_CRAWLER", | ||
| "GOOGLE_CRAWLER_CLOUDVERTEX", | ||
| "GOOGLE_CRAWLER_IMAGE", | ||
| "GOOGLE_CRAWLER_MOBILE", | ||
| "GOOGLE_CRAWLER_NEWS", | ||
| "GOOGLE_CRAWLER_OTHER", | ||
| "GOOGLE_CRAWLER_SAFETY", | ||
| "GOOGLE_CRAWLER_STORE", | ||
| "GOOGLE_CRAWLER_VIDEO", | ||
| "GOOGLE_FAVICON", | ||
| "GOOGLE_FEEDFETCHER", | ||
| "GOOGLE_INSPECTION_TOOL", | ||
| "GOOGLE_LIGHTHOUSE", | ||
| "GOOGLE_PHYSICAL_WEB", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_PUSH_NOTIFICATIONS", | ||
| "GOOGLE_READ_ALOUD", | ||
| "GOOGLE_SITE_VERIFICATION", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "GOOGLE_XRAWLER", | ||
| ]), | ||
| "CATEGORY:META": Object.freeze([ | ||
| "FACEBOOK_CATALOG", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "META_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "META_EXTERNALADS", | ||
| "WHATSAPP_CRAWLER", | ||
| ]), | ||
| "CATEGORY:MICROSOFT": Object.freeze([ | ||
| "AZURE_APP_INSIGHTS", | ||
| "BING_ADS", | ||
| "BING_CRAWLER", | ||
| "BING_OFFICE_STORE", | ||
| "BING_PREVIEW", | ||
| "MICROSOFT_PREVIEW", | ||
| "MICROSOFT_RESEARCH_CRAWLER", | ||
| "MSN_CRAWLER", | ||
| "SKYPE_PREVIEW", | ||
| ]), | ||
| "CATEGORY:MONITOR": Object.freeze([ | ||
| "AMAZON_ROUTE53_HEALTH_CHECK", | ||
| "AZURE_APP_INSIGHTS", | ||
| "BETTERSTACK_MONITOR", | ||
| "BETTERUPTIME_MONITOR", | ||
| "BRANDVERITY_CRAWLER", | ||
| "CENSYS_INSPECT", | ||
| "CHANGEDETECTION_CRAWLER", | ||
| "CHECKLY_MONITOR", | ||
| "CLOUDFLARE_HEALTHCHECKS", | ||
| "CLOUDFLARE_SECURITY_CENTER", | ||
| "CLOUDFLARE_SSL_DETECTOR", | ||
| "CLOUDFLARE_TRAFFIC_MANAGER", | ||
| "DATADOG_MONITOR_SYNTHETICS", | ||
| "DEADLINKCHECKER", | ||
| "DISQUS_CRAWLER", | ||
| "DUBBOT_CRAWLER", | ||
| "DYNATRACE_MONITOR", | ||
| "FLIPBOARD_PROXY", | ||
| "FREEWEBMONITORING_MONITOR", | ||
| "FRESHWORKS_MONITOR", | ||
| "GOOGLE_CERTIFICATES_BRIDGE", | ||
| "GOOGLE_SITE_VERIFICATION", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "HUBSPOT_CRAWLER", | ||
| "HYDROZEN_MONITOR", | ||
| "KUMA_MONITOR", | ||
| "MONITORBACKLINKS_CRAWLER", | ||
| "NEWRELIC_MONITOR", | ||
| "NIXSTATS_CRAWLER", | ||
| "OUTBRAIN_LINK_CHECKER", | ||
| "PAGEPEEKER_CRAWLER", | ||
| "PINGDOM_CRAWLER", | ||
| "SAFEDNS_CRAWLER", | ||
| "SENTRY_CRAWLER", | ||
| "SENTRY_UPTIME_MONITOR", | ||
| "STATUSCAKE_MONITOR", | ||
| "SURLY_CRAWLER", | ||
| "TESTOMATO_CRAWLER", | ||
| "UPTIME_MONITOR", | ||
| "UPTIMEBOT_MONITOR", | ||
| "UPTIMEROBOT_MONITOR", | ||
| "VERCEL_MONITOR_PREVIEW", | ||
| "W3C_VALIDATOR_CSS", | ||
| "W3C_VALIDATOR_FEED", | ||
| "W3C_VALIDATOR_HTML", | ||
| "W3C_VALIDATOR_HTML_NU", | ||
| "W3C_VALIDATOR_I18N", | ||
| "W3C_VALIDATOR_LINKS", | ||
| "W3C_VALIDATOR_MOBILE", | ||
| "W3C_VALIDATOR_UNIFIED", | ||
| "WEBPAGETEST_CRAWLER", | ||
| "XENU_CRAWLER", | ||
| "ZABBIX_MONITOR", | ||
| ]), | ||
| "CATEGORY:OPTIMIZER": Object.freeze([ | ||
| "CLOUDFLARE_PREFETCH", | ||
| "CONDUCTOR_CRAWLER", | ||
| "DAREBOOST_CRAWLER", | ||
| "DUBBOT_CRAWLER", | ||
| "GOOGLE_LIGHTHOUSE", | ||
| "GOOGLE_STRUCTURED_DATA_TESTING_TOOL", | ||
| "MONSIDO_CRAWLER", | ||
| "MOZ_SITE_AUDIT", | ||
| "ONCRAWL", | ||
| "SCREAMINGFROG_CRAWLER", | ||
| "SISTRIX_CRAWLER", | ||
| "SITEBULB", | ||
| "TESTOMATO_CRAWLER", | ||
| "WEBPAGETEST_CRAWLER", | ||
| ]), | ||
| "CATEGORY:PREVIEW": Object.freeze([ | ||
| "BING_PREVIEW", | ||
| "BITLY_CRAWLER", | ||
| "DISCORD_CRAWLER", | ||
| "DUCKDUCKGO_CRAWLER_FAVICONS", | ||
| "EMBEDLY_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "FLIPBOARD_PROXY", | ||
| "GOOGLE_FAVICON", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "IFRAMELY_PREVIEW", | ||
| "IMESSAGE_PREVIEW", | ||
| "KEYBASE_BOT", | ||
| "MASTODON_CRAWLER", | ||
| "META_CRAWLER_USER", | ||
| "MICROSOFT_PREVIEW", | ||
| "PAGEPEEKER_CRAWLER", | ||
| "SKYPE_PREVIEW", | ||
| "SLACK_IMAGE_PROXY", | ||
| "SNAP_PREVIEW", | ||
| "STEAM_PREVIEW", | ||
| "SYNAPSE_CRAWLER", | ||
| "TELEGRAM_CRAWLER", | ||
| "TWITTER_CRAWLER", | ||
| "VERCEL_MONITOR_PREVIEW", | ||
| "VIBER_CRAWLER", | ||
| "WHATSAPP_CRAWLER", | ||
| "YAHOO_PREVIEW", | ||
| ]), | ||
| "CATEGORY:PROGRAMMATIC": Object.freeze([ | ||
| "CODA_SERVER_FETCHER", | ||
| "GIGABLAST_CRAWLER_OSS", | ||
| "GO_HTTP", | ||
| "GOOGLE_APPENGINE", | ||
| "GOWIKI_CRAWLER", | ||
| "HTTP_GET", | ||
| "JAVA_APACHE_HTTPCLIENT", | ||
| "JAVA_ASYNCHTTPCLIENT", | ||
| "JAVA_CRAWLER4J", | ||
| "JAVA_HTTPUNIT", | ||
| "JAVA_JERSEY", | ||
| "JAVA_JETTY", | ||
| "JAVA_OKHTTP", | ||
| "JAVA_SNACKTORY", | ||
| "JAVASCRIPT_AXIOS", | ||
| "JAVASCRIPT_NODE_FETCH", | ||
| "JAVASCRIPT_PHANTOM", | ||
| "PERL_LIBWWW", | ||
| "PERL_PCORE", | ||
| "PHP_CURLCLASS", | ||
| "PHP_PHPCRAWL", | ||
| "PHP_SIMPLE_SCRAPER", | ||
| "PHP_SIMPLEPIE", | ||
| "PYTHON_AIOHTTP", | ||
| "PYTHON_BITBOT", | ||
| "PYTHON_HTTPX", | ||
| "PYTHON_OPENGRAPH", | ||
| "PYTHON_REQUESTS", | ||
| "PYTHON_SCRAPY", | ||
| "PYTHON_URLLIB", | ||
| "RUBY_METAINSPECTOR", | ||
| "STRIPE_CRAWLER", | ||
| ]), | ||
| "CATEGORY:SEARCH_ENGINE": Object.freeze([ | ||
| "ADDSEARCH_CRAWLER", | ||
| "AHREFS_CRAWLER", | ||
| "ALEXANDRIA_CRAWLER", | ||
| "ALGOLIA_CRAWLER", | ||
| "APPLE_CRAWLER", | ||
| "ASK_CRAWLER", | ||
| "AVIRA_CRAWLER", | ||
| "BING_CRAWLER", | ||
| "BING_OFFICE_STORE", | ||
| "DUCKDUCKGO_CRAWLER", | ||
| "DUCKDUCKGO_CRAWLER_FAVICONS", | ||
| "ENTIREWEB_CRAWLER", | ||
| "GEEDO_CRAWLER", | ||
| "GEEDO_CRAWLER_PRODUCTS", | ||
| "GOOGLE_CRAWLER", | ||
| "GOOGLE_CRAWLER_IMAGE", | ||
| "GOOGLE_CRAWLER_MOBILE", | ||
| "GOOGLE_CRAWLER_NEWS", | ||
| "GOOGLE_CRAWLER_OTHER", | ||
| "GOOGLE_CRAWLER_STORE", | ||
| "GOOGLE_CRAWLER_VIDEO", | ||
| "GOOGLE_INSPECTION_TOOL", | ||
| "IASK_CRAWLER", | ||
| "LINGUEE_CRAWLER", | ||
| "MAJESTIC_CRAWLER", | ||
| "MARGINALIA_CRAWLER", | ||
| "MOJEEK_CRAWLER", | ||
| "NETESTATE_CRAWLER", | ||
| "OPENAI_CRAWLER_SEARCH", | ||
| "PETALSEARCH_CRAWLER", | ||
| "PIPL_CRAWLER", | ||
| "QWANT_CRAWLER", | ||
| "SEEKPORT_CRAWLER", | ||
| "STRACT_CRAWLER", | ||
| "WEBZIO_CRAWLER", | ||
| "WELLKNOWN_CRAWLER", | ||
| "YACY_CRAWLER", | ||
| "YAHOO_CRAWLER", | ||
| "YANDEX_CRAWLER", | ||
| "YANDEX_CRAWLER_JAVASCRIPT", | ||
| ]), | ||
| "CATEGORY:SLACK": Object.freeze([ | ||
| "SLACK_CRAWLER", | ||
| "SLACK_IMAGE_PROXY", | ||
| ]), | ||
| "CATEGORY:SOCIAL": Object.freeze([ | ||
| "DIGG_CRAWLER", | ||
| "DISCORD_CRAWLER", | ||
| "EVERYONESOCIAL_CRAWLER", | ||
| "FACEBOOK_CATALOG", | ||
| "FACEBOOK_CRAWLER", | ||
| "FACEBOOK_SHARE_CRAWLER", | ||
| "GOOGLE_PREVIEW", | ||
| "GOOGLE_WEB_SNIPPET", | ||
| "GROUPME_CRAWLER", | ||
| "IFRAMELY_PREVIEW", | ||
| "IMESSAGE_PREVIEW", | ||
| "IRC_ARCHIVEBOT", | ||
| "KEYBASE_BOT", | ||
| "LEMMY_CRAWLER", | ||
| "LINKARCHIVER", | ||
| "LINKEDIN_CRAWLER", | ||
| "MASTODON_CRAWLER", | ||
| "NETICLE_CRAWLER", | ||
| "PINTEREST_CRAWLER", | ||
| "PINTREST_CRAWLER", | ||
| "REDDIT_CRAWLER", | ||
| "SNAP_PREVIEW", | ||
| "STEAM_PREVIEW", | ||
| "SYNAPSE_CRAWLER", | ||
| "TELEGRAM_CRAWLER", | ||
| "TIKTOK_CRAWLER", | ||
| "TRENDSMAP_CRAWLER", | ||
| "TWEETEDTIMES_CRAWLER", | ||
| "TWITTER_CRAWLER", | ||
| "VIBER_CRAWLER", | ||
| "WHATSAPP_CRAWLER", | ||
| ]), | ||
| "CATEGORY:TOOL": Object.freeze([ | ||
| "COOKIEHUB_SCAN", | ||
| "CURL", | ||
| "DCRAWL", | ||
| "DOMAINSPROJECT_CRAWLER", | ||
| "GIGABLAST_CRAWLER_OSS", | ||
| "GOT", | ||
| "HEADLESS_CHROME", | ||
| "IMG2DATASET", | ||
| "INTERNETARCHIVE_CRAWLER_OSS", | ||
| "IPIP_CRAWLER", | ||
| "L9EXPLORE", | ||
| "LAW_UNIMI_CRAWLER", | ||
| "NAGIOS_CHECK_HTTP", | ||
| "NMAP", | ||
| "NUTCH", | ||
| "ONCRAWL", | ||
| "POSTMAN", | ||
| "SITEBULB", | ||
| "SUMMALY_CRAWLER", | ||
| "WGET", | ||
| "XENU_CRAWLER", | ||
| "YEXT_BOT", | ||
| "ZGRAB", | ||
| ]), | ||
| "CATEGORY:UNKNOWN": Object.freeze([ | ||
| "A6CORP_CRAWLER", | ||
| "ABOUNDEX_CRAWLER", | ||
| "ACAPBOT", | ||
| "ACOON_CRAWLER", | ||
| "ADBEAT_CRAWLER", | ||
| "ADDTHIS_CRAWLER", | ||
| "ADMANTX_CRAWLER", | ||
| "ADSCANNER_CRAWLER", | ||
| "ADSTXTCRAWLER", | ||
| "ADVBOT_CRAWLER", | ||
| "ALPHASEOBOT_CRAWLER", | ||
| "ANDERSPINK_CRAWLER", | ||
| "ANTIBOT", | ||
| "APERCITE_CRAWLER", | ||
| "ARA_CRAWLER", | ||
| "ARATURKA_CRAWLER", | ||
| "AROCOM_CRAWLER", | ||
| "ASPIEGEL_CRAWLER", | ||
| "AUDISTO_CRAWLER", | ||
| "AWARIO_CRAWLER", | ||
| "AWARIO_CRAWLER_SMART", | ||
| "AWESOMECRAWLER", | ||
| "B2BBOT", | ||
| "BACKLINKTEST_CRAWLER", | ||
| "BAIDU_CLOUD_WATCH", | ||
| "BAIDU_CRAWLER", | ||
| "BETABOT", | ||
| "BIDSWITCH_CRAWLER", | ||
| "BIGDATACORP_CRAWLER", | ||
| "BIGLOTRON", | ||
| "BINLAR", | ||
| "BITSIGHT_CRAWLER", | ||
| "BLOGMURA_CRAWLER", | ||
| "BLP_BBOT", | ||
| "BNF_CRAWLER", | ||
| "BOMBORA_CRAWLER", | ||
| "BOXCAR_CRAWLER", | ||
| "BRAINOBOT", | ||
| "BRANDONMEDIA_CRAWLER", | ||
| "BRANDWATCH_CRAWLER", | ||
| "BRIGHTEDGE_CRAWLER", | ||
| "BUBLUP_CRAWLER", | ||
| "BUILTWITH_CRAWLER", | ||
| "BUZZSTREAM_CRAWLER", | ||
| "CAPSULINK_CRAWLER", | ||
| "CAREERX_CRAWLER", | ||
| "CENTURYBOT", | ||
| "CHECKMARKNETWORK_CRAWLER", | ||
| "CHLOOE_CRAWLER", | ||
| "CINCRAWDATA_CRAWLER", | ||
| "CITESEERX_CRAWLER", | ||
| "CLICKAGY_CRAWLER", | ||
| "CLIQZ_CRAWLER", | ||
| "CLOUDSYSTEMNETWORKS_CRAWLER", | ||
| "COCCOC_CRAWLER", | ||
| "COCOLYZE_CRAWLER", | ||
| "CODEWISE_CRAWLER", | ||
| "COGNITIVESEO_CRAWLER", | ||
| "COMPANYBOOK_CRAWLER", | ||
| "CONTENT_CRAWLER_SPIDER", | ||
| "CONTEXTAD_CRAWLER", | ||
| "CONTXBOT", | ||
| "CONVERA_CRAWLER", | ||
| "COOKIEBOT_CRAWLER", | ||
| "CREATIVECOMMONS_CRAWLER", | ||
| "CRITEO_CRAWLER", | ||
| "CRYSTALSEMANTICS_CRAWLER", | ||
| "CUREBOT_CRAWLER", | ||
| "CUTBOT_CRAWLER", | ||
| "CXENSE_CRAWLER", | ||
| "CYBERPATROL_CRAWLER", | ||
| "DATAFEEDWATCH_CRAWLER", | ||
| "DATAFORSEO_CRAWLER", | ||
| "DATAGNION_CRAWLER", | ||
| "DATANYZE_CRAWLER", | ||
| "DATAPROVIDER_CRAWLER", | ||
| "DATENBUTLER_CRAWLER", | ||
| "DAUM_CRAWLER", | ||
| "DEEPNOC_CRAWLER", | ||
| "DEUSU_CRAWLER", | ||
| "DIGINCORE_CRAWLER", | ||
| "DIGITALDRAGON_CRAWLER", | ||
| "DISCOVERYENGINE_CRAWLER", | ||
| "DNYZ_CRAWLER", | ||
| "DOMAINCRAWLER_CRAWLER", | ||
| "DOMAINREANIMATOR_CRAWLER", | ||
| "DOMAINSBOT_CRAWLER", | ||
| "DOMAINSTATS_CRAWLER", | ||
| "DOMAINTOOLS_CRAWLER", | ||
| "DOTNETDOTCOM_CRAWLER", | ||
| "DRAGONMETRICS_CRAWLER", | ||
| "DRIFTNET_CRAWLER", | ||
| "DUEDIL_CRAWLER", | ||
| "EC2LINKFINDER", | ||
| "EDISTER_CRAWLER", | ||
| "ELISABOT", | ||
| "EPICTIONS_CRAWLER", | ||
| "ERIGHT_CRAWLER", | ||
| "EUROPARCHIVE_CRAWLER", | ||
| "EVENTURES_CRAWLER", | ||
| "EVENTURES_CRAWLER_BATCH", | ||
| "EXENSA_CRAWLER", | ||
| "EXPERIBOT_CRAWLER", | ||
| "EXTLINKS_CRAWLER", | ||
| "EYEOTA_CRAWLER", | ||
| "FAST_CRAWLER", | ||
| "FAST_CRAWLER_ENTERPRISE", | ||
| "FEDORAPLANET_CRAWLER", | ||
| "FEEDAFEVER_CRAWLER", | ||
| "FEMTOSEARCH_CRAWLER", | ||
| "FINDTHATFILE_CRAWLER", | ||
| "FLAMINGOSEARCH_CRAWLER", | ||
| "FLUFFY", | ||
| "FR_CRAWLER", | ||
| "FUELBOT", | ||
| "FYREBOT", | ||
| "G00G1E_CRAWLER", | ||
| "G2WEBSERVICES_CRAWLER", | ||
| "GARLIK_CRAWLER", | ||
| "GENIEO_CRAWLER", | ||
| "GIGABLAST_CRAWLER", | ||
| "GINGER_CRAWLER", | ||
| "GNAM_GNAM_SPIDER", | ||
| "GNOWIT_CRAWLER", | ||
| "GOO_CRAWLER", | ||
| "GRAPESHOT_CRAWLER", | ||
| "GROB_CRAWLER", | ||
| "GROUPHIGH_CRAWLER", | ||
| "GRUB", | ||
| "GSLFBOT", | ||
| "GWENE_CRAWLER", | ||
| "HAOSOU_CRAWLER", | ||
| "HATENA_CRAWLER", | ||
| "HEADLINE_CRAWLER", | ||
| "HOYER_CRAWLER", | ||
| "HTTRACK", | ||
| "HYPEFACTORS_CRAWLER", | ||
| "HYPESTAT_CRAWLER", | ||
| "HYSCORE_CRAWLER", | ||
| "IA_ARCHIVER", | ||
| "IDEASANDCODE_CRAWLER", | ||
| "INDEED_CRAWLER", | ||
| "INETDEX_CRAWLER", | ||
| "INFOO_CRAWLER", | ||
| "INTEGROMEDB_CRAWLER", | ||
| "INTELIUM_CRAWLER", | ||
| "IONOS_CRAWLER", | ||
| "IP_WEB_CRAWLER", | ||
| "ISKANIE_CRAWLER", | ||
| "ISS_CRAWLER", | ||
| "IT2MEDIA_CRAWLER", | ||
| "ITINFLUENTIALS_CRAWLER", | ||
| "JAMIEMBROWN_CRAWLER", | ||
| "JETSLIDE_CRAWLER", | ||
| "JOBBOERSE_CRAWLER", | ||
| "JOOBLE_CRAWLER", | ||
| "JUSPROG_CRAWLER", | ||
| "JYXO_CRAWLER", | ||
| "K7COMPUTING_CRAWLER", | ||
| "KEMVI_CRAWLER", | ||
| "KOMODIA_CRAWLER", | ||
| "KOSMIO_CRAWLER", | ||
| "LANDAUMEDIA_CRAWLER", | ||
| "LASERLIKE_CRAWLER", | ||
| "LB_SPIDER", | ||
| "LEIKI_CRAWLER", | ||
| "LIGHTSPEEDSYSTEMS_CRAWLER", | ||
| "LINE_CRAWLER", | ||
| "LINKAPEDIA_CRAWLER", | ||
| "LINKDEX_CRAWLER", | ||
| "LINKFLUENCE_CRAWLER", | ||
| "LINKIS_CRAWLER", | ||
| "LIPPERHEY_CRAWLER", | ||
| "LIVELAP_CRAWLER", | ||
| "LOGLY_CRAWLER", | ||
| "LOOP_CRAWLER", | ||
| "LSSBOT", | ||
| "LSSBOT_ROCKET", | ||
| "LTX71_CRAWLER", | ||
| "LUMINATOR_CRAWLER", | ||
| "MAILRU_CRAWLER", | ||
| "MAPPYDATA_CRAWLER", | ||
| "MAUIBOT", | ||
| "MEGAINDEX_CRAWLER", | ||
| "MELTWATER_CRAWLER", | ||
| "METADATALABS_CRAWLER", | ||
| "METAJOB_CRAWLER", | ||
| "METAURI_CRAWLER", | ||
| "METRICSTOOLS_CRAWLER", | ||
| "MIGNIFY_CRAWLER", | ||
| "MIGNIFY_IMRBOT", | ||
| "MIXNODE_CACHE", | ||
| "MOODLE_CRAWLER", | ||
| "MOREOVER_CRAWLER", | ||
| "MOZ_CRAWLER", | ||
| "MUCKRACK_CRAWLER", | ||
| "MULTIVIEWBOT", | ||
| "NAVER_CRAWLER", | ||
| "NEEVA_CRAWLER", | ||
| "NERDBYNATURE_CRAWLER", | ||
| "NERDYBOT_CRAWLER", | ||
| "NETCRAFT_CRAWLER", | ||
| "NETSYSTEMSRESEARCH_CRAWLER", | ||
| "NETVIBES_CRAWLER", | ||
| "NEWSHARECOUNTS_CRAWLER", | ||
| "NEWSPAPER", | ||
| "NEXTCLOUD_CRAWLER", | ||
| "NIKI_BOT", | ||
| "NING_CRAWLER", | ||
| "NINJABOT", | ||
| "NUZZEL_CRAWLER", | ||
| "OCARINABOT", | ||
| "OKRU_CRAWLER", | ||
| "OPENGRAPHCHECK_CRAWLER", | ||
| "OPENHOSE_CRAWLER", | ||
| "OPENINDEX_CRAWLER", | ||
| "ORANGE_CRAWLER", | ||
| "ORANGE_FTGROUP_CRAWLER", | ||
| "OUTCLICKS_CRAWLER", | ||
| "PAGE_TO_RSS", | ||
| "PAGETHING_CRAWLER", | ||
| "PALOALTONETWORKS_CRAWLER", | ||
| "PANSCIENT_CRAWLER", | ||
| "PAPERLI_CRAWLER", | ||
| "PHXBOT", | ||
| "PICSEARCH_CRAWLER", | ||
| "POSTRANK_CRAWLER", | ||
| "PRCY_CRAWLER", | ||
| "PRIVACORE_CRAWLER", | ||
| "PRIVACYAWARE_CRAWLER", | ||
| "PROFOUND_CRAWLER", | ||
| "PROXIMIC_CRAWLER", | ||
| "PULSEPOINT_CRAWLER", | ||
| "PURE_CRAWLER", | ||
| "RANKACTIVE_CRAWLER", | ||
| "RETREVO_PAGE_ANALYZER", | ||
| "RIDDER_CRAWLER", | ||
| "RIVVA_CRAWLER", | ||
| "RYTE_CRAWLER", | ||
| "SCAN_INTERFAX_CRAWLER", | ||
| "SCHMORP_CRAWLER", | ||
| "SCOUTJET_CRAWLER", | ||
| "SCRIBD_CRAWLER", | ||
| "SCRITCH_CRAWLER", | ||
| "SEEKBOT_CRAWLER", | ||
| "SEEWITHKIDS_CRAWLER", | ||
| "SEMANTICAUDIENCE_CRAWLER", | ||
| "SEMPITECH_CRAWLER", | ||
| "SEMRUSH_CRAWLER", | ||
| "SENUTO_CRAWLER", | ||
| "SEOBILITY_CRAWLER", | ||
| "SEOKICKS_CRAWLER", | ||
| "SEOLIZER_CRAWLER", | ||
| "SEOPROFILER_CRAWLER", | ||
| "SEOSCANNERS_CRAWLER", | ||
| "SEOSTAR_CRAWLER", | ||
| "SEOZOOM_CRAWLER", | ||
| "SERPSTATBOT_CRAWLER", | ||
| "SEZNAM_CRAWLER", | ||
| "SIMILARTECH_CRAWLER", | ||
| "SIMPLE_CRAWLER", | ||
| "SISTRIX_007AC9_CRAWLER", | ||
| "SITEBOT_CRAWLER", | ||
| "SITECHECKER_CRAWLER", | ||
| "SITEEXPLORER_CRAWLER", | ||
| "SITEIMPROVE_CRAWLER", | ||
| "SOCIALRANK_CRAWLER", | ||
| "SOFTBYTELABS_CRAWLER", | ||
| "SOGOU_CRAWLER", | ||
| "STUTTGART_CRAWLER", | ||
| "SUMMIFY_CRAWLER", | ||
| "SWIMGBOT", | ||
| "SYSOMOS_CRAWLER", | ||
| "T3VERSIONS_CRAWLER", | ||
| "TABOOLA_CRAWLER", | ||
| "TAGOO_CRAWLER", | ||
| "TANGIBLEE_CRAWLER", | ||
| "THINKLAB_CRAWLER", | ||
| "TIGER_CRAWLER", | ||
| "TINEYE_CRAWLER", | ||
| "TISCALI_CRAWLER", | ||
| "TOMBASCRAPER_CRAWLER", | ||
| "TOPLIST_CRAWLER", | ||
| "TORUS_CRAWLER", | ||
| "TOUTIAO_CRAWLER", | ||
| "TRAACKR_CRAWLER", | ||
| "TRACEMYFILE_CRAWLER", | ||
| "TRENDICTION_CRAWLER", | ||
| "TROVE_CRAWLER", | ||
| "TROVIT_CRAWLER", | ||
| "TWEETMEMEBOT", | ||
| "TWENGA_CRAWLER", | ||
| "TWINGLY_CRAWLER", | ||
| "TWOIP_CRAWLER", | ||
| "TWOIP_CRAWLER_CMS", | ||
| "TWURLY_CRAWLER", | ||
| "UBERMETRICS_CRAWLER", | ||
| "UBT_CRAWLER", | ||
| "UPFLOW_CRAWLER", | ||
| "URLCLASSIFICATION_CRAWLER", | ||
| "USINE_NOUVELLE_CRAWLER", | ||
| "UTORRENT_CRAWLER", | ||
| "VEBIDOO_CRAWLER", | ||
| "VEOOZ_CRAWLER", | ||
| "VERISIGN_IPS_AGENT", | ||
| "VIGIL_CRAWLER", | ||
| "VIPNYTT_CRAWLER", | ||
| "VIRUSTOTAL_CRAWLER", | ||
| "VKROBOT_CRAWLER", | ||
| "VKSHARE_CRAWLER", | ||
| "VUHUV_CRAWLER", | ||
| "WAREBAY_CRAWLER", | ||
| "WEBCEO_CRAWLER", | ||
| "WEBCOMPANY_CRAWLER", | ||
| "WEBDATASTATS_CRAWLER", | ||
| "WEBEAVER_CRAWLER", | ||
| "WEBMEUP_CRAWLER", | ||
| "WEBMON", | ||
| "WESEE_CRAWLER", | ||
| "WOCODI_CRAWLER", | ||
| "WOORANK_CRAWLER", | ||
| "WOORANK_CRAWLER_REVIEW", | ||
| "WORDPRESS_CRAWLER", | ||
| "WORDUP_CRAWLER", | ||
| "WORIO_CRAWLER", | ||
| "WOTBOX_CRAWLER", | ||
| "XOVIBOT_CRAWLER", | ||
| "YANGA_CRAWLER", | ||
| "YELLOWBP_CRAWLER", | ||
| "YISOU_CRAWLER", | ||
| "YOOZ_CRAWLER", | ||
| "ZOOMINFO_CRAWLER", | ||
| "ZUM_CRAWLER", | ||
| "ZUPERLIST_CRAWLER", | ||
| ]), | ||
| "CATEGORY:VERCEL": Object.freeze([ | ||
| "VERCEL_CRAWLER", | ||
| "VERCEL_MONITOR_PREVIEW", | ||
| ]), | ||
| "CATEGORY:WEBHOOK": Object.freeze([ | ||
| "ADYEN_WEBHOOK", | ||
| "STRIPE_WEBHOOK", | ||
| ]), | ||
| "CATEGORY:YAHOO": Object.freeze([ | ||
| "YAHOO_CRAWLER", | ||
| "YAHOO_CRAWLER_JAPAN", | ||
| "YAHOO_PREVIEW", | ||
| ]), | ||
| }); | ||
| export { categories }; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
3
-50%204573
-8.73%6223
-3.7%1
Infinity%+ Added
- Removed
Updated