@arcjet/astro 1.12.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ type IntegrationRule<Characteristics extends readonly string[]> = {
16
16
  options: FilterOptions;
17
17
  } | {
18
18
  type: "sensitiveInfo";
19
- options: SensitiveInfoOptions<undefined>;
19
+ options: SensitiveInfoOptions;
20
20
  } | {
21
21
  type: "fixedWindow";
22
22
  options: FixedWindowRateLimitOptions<Characteristics>;
@@ -39,7 +39,7 @@ type IntegrationRule<Characteristics extends readonly string[]> = {
39
39
  * @template Characteristics
40
40
  * Characteristics to track a user by.
41
41
  */
42
- type ArcjetOptions<Characteristics extends readonly string[]> = {
42
+ export type ArcjetOptions<Characteristics extends readonly string[]> = {
43
43
  /**
44
44
  * Integration rules to apply when protecting a request (required).
45
45
  *
@@ -83,7 +83,7 @@ type ArcjetOptions<Characteristics extends readonly string[]> = {
83
83
  * @returns
84
84
  * Astro integration Shield rule to provide to the SDK in the `rules` field.
85
85
  */
86
- declare function shield(options: ShieldOptions): {
86
+ export declare function shield(options: ShieldOptions): {
87
87
  readonly type: "shield";
88
88
  readonly options: ShieldOptions;
89
89
  };
@@ -107,7 +107,7 @@ declare function shield(options: ShieldOptions): {
107
107
  * @returns
108
108
  * Astro integration Bot rule to provide to the SDK in the `rules` field.
109
109
  */
110
- declare function detectBot(options: BotOptions): {
110
+ export declare function detectBot(options: BotOptions): {
111
111
  readonly type: "bot";
112
112
  readonly options: BotOptions;
113
113
  };
@@ -128,7 +128,7 @@ declare function detectBot(options: BotOptions): {
128
128
  * @returns
129
129
  * Astro integration Email rule to provide to the SDK in the `rules` field.
130
130
  */
131
- declare function validateEmail(options: EmailOptions): {
131
+ export declare function validateEmail(options: EmailOptions): {
132
132
  readonly type: "email";
133
133
  readonly options: EmailOptions;
134
134
  };
@@ -164,7 +164,7 @@ declare function validateEmail(options: EmailOptions): {
164
164
  *
165
165
  * @link https://docs.arcjet.com/filters/reference
166
166
  */
167
- declare function filter(options: FilterOptions): {
167
+ export declare function filter(options: FilterOptions): {
168
168
  readonly type: "filter";
169
169
  readonly options: FilterOptions;
170
170
  };
@@ -186,7 +186,7 @@ declare function filter(options: FilterOptions): {
186
186
  * @returns
187
187
  * Astro integration Sensitive information rule to provide to the SDK in the `rules` field.
188
188
  */
189
- declare function sensitiveInfo(options: SensitiveInfoOptions<never>): {
189
+ export declare function sensitiveInfo(options: SensitiveInfoOptions<never>): {
190
190
  readonly type: "sensitiveInfo";
191
191
  readonly options: SensitiveInfoOptions<never>;
192
192
  };
@@ -216,7 +216,7 @@ declare function sensitiveInfo(options: SensitiveInfoOptions<never>): {
216
216
  * @returns
217
217
  * Astro integration Fixed window rule to provide to the SDK in the `rules` field.
218
218
  */
219
- declare function fixedWindow<Characteristics extends readonly string[]>(options: FixedWindowRateLimitOptions<Characteristics>): {
219
+ export declare function fixedWindow<Characteristics extends readonly string[]>(options: FixedWindowRateLimitOptions<Characteristics>): {
220
220
  readonly type: "fixedWindow";
221
221
  readonly options: FixedWindowRateLimitOptions<Characteristics>;
222
222
  };
@@ -239,7 +239,7 @@ declare function fixedWindow<Characteristics extends readonly string[]>(options:
239
239
  * @returns
240
240
  * Astro integration Sliding window rule to provide to the SDK in the `rules` field.
241
241
  */
242
- declare function slidingWindow<Characteristics extends readonly string[]>(options: SlidingWindowRateLimitOptions<Characteristics>): {
242
+ export declare function slidingWindow<Characteristics extends readonly string[]>(options: SlidingWindowRateLimitOptions<Characteristics>): {
243
243
  readonly type: "slidingWindow";
244
244
  readonly options: SlidingWindowRateLimitOptions<Characteristics>;
245
245
  };
@@ -263,7 +263,7 @@ declare function slidingWindow<Characteristics extends readonly string[]>(option
263
263
  * @returns
264
264
  * Astro integration Token bucket rule to provide to the SDK in the `rules` field.
265
265
  */
266
- declare function tokenBucket<Characteristics extends readonly string[]>(options: TokenBucketRateLimitOptions<Characteristics>): {
266
+ export declare function tokenBucket<Characteristics extends readonly string[]>(options: TokenBucketRateLimitOptions<Characteristics>): {
267
267
  readonly type: "tokenBucket";
268
268
  readonly options: TokenBucketRateLimitOptions<Characteristics>;
269
269
  };
@@ -291,7 +291,7 @@ declare function tokenBucket<Characteristics extends readonly string[]>(options:
291
291
  * @returns
292
292
  * Astro integration Signup form protection rule to provide to the SDK in the `rules` field.
293
293
  */
294
- declare function protectSignup<Characteristics extends readonly string[]>(options: ProtectSignupOptions<Characteristics>): {
294
+ export declare function protectSignup<Characteristics extends readonly string[]>(options: ProtectSignupOptions<Characteristics>): {
295
295
  readonly type: "protectSignup";
296
296
  readonly options: ProtectSignupOptions<Characteristics>;
297
297
  };
@@ -309,7 +309,7 @@ declare function protectSignup<Characteristics extends readonly string[]>(option
309
309
  * @returns
310
310
  * Astro integration Prompt injection detection rule to provide to the SDK in the `rules` field.
311
311
  */
312
- declare function detectPromptInjection(options?: DetectPromptInjectionOptions): {
312
+ export declare function detectPromptInjection(options?: DetectPromptInjectionOptions): {
313
313
  readonly type: "detectPromptInjection";
314
314
  readonly options: DetectPromptInjectionOptions;
315
315
  };
@@ -319,11 +319,11 @@ declare function detectPromptInjection(options?: DetectPromptInjectionOptions):
319
319
  * @deprecated
320
320
  * Use `detectPromptInjection` instead.
321
321
  */
322
- declare const experimental_detectPromptInjection: typeof detectPromptInjection;
322
+ export declare const experimental_detectPromptInjection: typeof detectPromptInjection;
323
323
  /**
324
324
  * Configuration for {@linkcode createRemoteClient}.
325
325
  */
326
- type RemoteClientOptions = {
326
+ export type RemoteClientOptions = {
327
327
  /**
328
328
  * Base URI for HTTP requests to Decide API (optional).
329
329
  *
@@ -346,7 +346,7 @@ type RemoteClientOptions = {
346
346
  * @returns
347
347
  * Client.
348
348
  */
349
- declare function createRemoteClient(options?: RemoteClientOptions | undefined): {
349
+ export declare function createRemoteClient(options?: RemoteClientOptions): {
350
350
  readonly baseUrl: string | undefined;
351
351
  readonly timeout: number | undefined;
352
352
  };
@@ -360,6 +360,6 @@ declare function createRemoteClient(options?: RemoteClientOptions | undefined):
360
360
  * @returns
361
361
  * Astro integration of Arcjet.
362
362
  */
363
- declare function arcjet<Characteristics extends readonly string[]>(options?: ArcjetOptions<Characteristics>): AstroIntegration;
363
+ export default function arcjet<Characteristics extends readonly string[]>(options?: ArcjetOptions<Characteristics>): AstroIntegration;
364
364
  //#endregion
365
- export { ArcjetOptions, type ProxyService, RemoteClientOptions, cloudflare, createRemoteClient, arcjet as default, detectBot, detectPromptInjection, experimental_detectPromptInjection, filter, fixedWindow, protectSignup, sensitiveInfo, shield, slidingWindow, tokenBucket, validateEmail };
365
+ export { type ProxyService, cloudflare };
@@ -13,7 +13,7 @@ type MaybeProperties<T> = { [P in keyof T]?: T[P]; } extends T ? [properties?: T
13
13
  /**
14
14
  * Configuration for {@linkcode createRemoteClient}.
15
15
  */
16
- type RemoteClientOptions = {
16
+ export type RemoteClientOptions = {
17
17
  /**
18
18
  * Base URI for HTTP requests to Decide API (optional).
19
19
  *
@@ -36,7 +36,7 @@ type RemoteClientOptions = {
36
36
  * @returns
37
37
  * Client.
38
38
  */
39
- declare function createRemoteClient(options?: RemoteClientOptions): import("@arcjet/protocol/client.js").Client;
39
+ export declare function createRemoteClient(options?: RemoteClientOptions): import("@arcjet/protocol/client.js").Client;
40
40
  /**
41
41
  * Configuration for the Astro integration of Arcjet.
42
42
  *
@@ -45,7 +45,7 @@ declare function createRemoteClient(options?: RemoteClientOptions): import("@arc
45
45
  * @template Characteristics
46
46
  * Characteristics to track a user by.
47
47
  */
48
- type ArcjetOptions<Rules extends [...Array<Primitive | Product>], Characteristics extends readonly string[]> = Simplify<ArcjetOptions$1<Rules, Characteristics> & {
48
+ export type ArcjetOptions<Rules extends [...Array<Primitive | Product>], Characteristics extends readonly string[]> = Simplify<ArcjetOptions$1<Rules, Characteristics> & {
49
49
  /**
50
50
  * IP addresses and CIDR ranges of trusted load balancers and proxies
51
51
  * (optional, example: `["100.100.100.100", "100.100.100.0/24"]`).
@@ -65,7 +65,7 @@ type ArcjetOptions<Rules extends [...Array<Primitive | Product>], Characteristic
65
65
  * @template Props
66
66
  * Configuration.
67
67
  */
68
- interface ArcjetAstro<Props extends PlainObject> {
68
+ export interface ArcjetAstro<Props extends PlainObject> {
69
69
  /**
70
70
  * Make a decision about how to handle a request.
71
71
  *
@@ -113,6 +113,5 @@ interface ArcjetAstro<Props extends PlainObject> {
113
113
  * @returns
114
114
  * Astro integration of Arcjet.
115
115
  */
116
- declare function createArcjetClient<const Rules extends (Primitive | Product)[], const Characteristics extends readonly string[]>(options: ArcjetOptions<Rules, Characteristics>): ArcjetAstro<ExtraProps<Rules> & CharacteristicProps<Characteristics>>;
117
- //#endregion
118
- export { ArcjetAstro, ArcjetOptions, RemoteClientOptions, createArcjetClient, createRemoteClient };
116
+ export declare function createArcjetClient<const Rules extends (Primitive | Product)[], const Characteristics extends readonly string[]>(options: ArcjetOptions<Rules, Characteristics>): ArcjetAstro<ExtraProps<Rules> & CharacteristicProps<Characteristics>>;
117
+ //#endregion
package/dist/internal.js CHANGED
@@ -10,7 +10,7 @@ import { ARCJET_BASE_URL, ARCJET_ENV, ARCJET_KEY, ARCJET_LOG_LEVEL, FIREBASE_CON
10
10
  export * from "arcjet";
11
11
  //#region src/internal.ts
12
12
  /** SDK version. Updated by the release process. */
13
- const VERSION = "1.12.0";
13
+ const VERSION = "1.14.0";
14
14
  let warnedForAutomaticBodyRead = false;
15
15
  const ipSymbol = Symbol.for("arcjet.ip");
16
16
  const env = {
@@ -1,4 +1,3 @@
1
1
  //#region src/middleware.d.ts
2
- declare const onRequest: import("astro").MiddlewareHandler;
3
- //#endregion
4
- export { onRequest };
2
+ export declare const onRequest: import("astro").MiddlewareHandler;
3
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/astro",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Arcjet runtime security SDK for Astro — bot protection, rate limiting, prompt injection detection, PII blocking, and WAF",
5
5
  "keywords": [
6
6
  "ai",
@@ -62,18 +62,18 @@
62
62
  "test": "npm run build && npm run test-coverage"
63
63
  },
64
64
  "dependencies": {
65
- "@arcjet/body": "1.12.0",
66
- "@arcjet/env": "1.12.0",
67
- "@arcjet/headers": "1.12.0",
68
- "@arcjet/ip": "1.12.0",
69
- "@arcjet/logger": "1.12.0",
70
- "@arcjet/protocol": "1.12.0",
71
- "@arcjet/transport": "1.12.0",
72
- "arcjet": "1.12.0"
65
+ "@arcjet/body": "1.14.0",
66
+ "@arcjet/env": "1.14.0",
67
+ "@arcjet/headers": "1.14.0",
68
+ "@arcjet/ip": "1.14.0",
69
+ "@arcjet/logger": "1.14.0",
70
+ "@arcjet/protocol": "1.14.0",
71
+ "@arcjet/transport": "1.14.0",
72
+ "arcjet": "1.14.0"
73
73
  },
74
74
  "devDependencies": {
75
- "astro": "7.2.2",
76
- "tsdown": "0.22.14",
75
+ "astro": "7.3.2",
76
+ "tsdown": "0.23.0",
77
77
  "typescript": "7.0.2"
78
78
  },
79
79
  "peerDependencies": {