@arcjet/bun 1.0.0-alpha.33 → 1.0.0-alpha.34

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.
Files changed (3) hide show
  1. package/index.d.ts +11 -1
  2. package/index.js +2 -2
  3. package/package.json +13 -13
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ArcjetDecision, ArcjetOptions, Primitive, Product, ExtraProps, CharacteristicProps } from "arcjet";
1
+ import type { ArcjetDecision, ArcjetOptions as CoreOptions, Primitive, Product, ExtraProps, CharacteristicProps } from "arcjet";
2
2
  import type { Server } from "bun";
3
3
  export * from "arcjet";
4
4
  type Simplify<T> = {
@@ -16,6 +16,16 @@ export type RemoteClientOptions = {
16
16
  timeout?: number;
17
17
  };
18
18
  export declare function createRemoteClient(options?: RemoteClientOptions): import("@arcjet/protocol/client.js").Client;
19
+ /**
20
+ * The options used to configure an {@link ArcjetBun} client.
21
+ */
22
+ export type ArcjetOptions<Rules extends [...Array<Primitive | Product>], Characteristics extends readonly string[]> = Simplify<CoreOptions<Rules, Characteristics> & {
23
+ /**
24
+ * One or more IP Address of trusted proxies in front of the application.
25
+ * These addresses will be excluded when Arcjet detects a public IP address.
26
+ */
27
+ proxies?: Array<string>;
28
+ }>;
19
29
  /**
20
30
  * The ArcjetBun client provides a public `protect()` method to
21
31
  * make a decision about how a Bun.sh request should be handled.
package/index.js CHANGED
@@ -33,7 +33,7 @@ function createRemoteClient(options) {
33
33
  // Transport is the HTTP client that the client uses to make requests.
34
34
  const transport = createTransport(url);
35
35
  const sdkStack = "BUN";
36
- const sdkVersion = "1.0.0-alpha.33";
36
+ const sdkVersion = "1.0.0-alpha.34";
37
37
  return createClient({
38
38
  transport,
39
39
  baseUrl: url,
@@ -72,7 +72,7 @@ function arcjet(options) {
72
72
  // `Server` to lookup an IP.
73
73
  ip: ipCache.get(request),
74
74
  headers,
75
- }, { platform: platform(env) });
75
+ }, { platform: platform(env), proxies: options.proxies });
76
76
  if (ip === "") {
77
77
  // If the `ip` is empty but we're in development mode, we default the IP
78
78
  // so the request doesn't fail.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/bun",
3
- "version": "1.0.0-alpha.33",
3
+ "version": "1.0.0-alpha.34",
4
4
  "description": "Arcjet SDK for Bun.sh",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://arcjet.com",
@@ -37,22 +37,22 @@
37
37
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests"
38
38
  },
39
39
  "dependencies": {
40
- "@arcjet/env": "1.0.0-alpha.33",
41
- "@arcjet/headers": "1.0.0-alpha.33",
42
- "@arcjet/ip": "1.0.0-alpha.33",
43
- "@arcjet/logger": "1.0.0-alpha.33",
44
- "@arcjet/protocol": "1.0.0-alpha.33",
45
- "@arcjet/transport": "1.0.0-alpha.33",
46
- "arcjet": "1.0.0-alpha.33"
40
+ "@arcjet/env": "1.0.0-alpha.34",
41
+ "@arcjet/headers": "1.0.0-alpha.34",
42
+ "@arcjet/ip": "1.0.0-alpha.34",
43
+ "@arcjet/logger": "1.0.0-alpha.34",
44
+ "@arcjet/protocol": "1.0.0-alpha.34",
45
+ "@arcjet/transport": "1.0.0-alpha.34",
46
+ "arcjet": "1.0.0-alpha.34"
47
47
  },
48
48
  "devDependencies": {
49
- "@arcjet/eslint-config": "1.0.0-alpha.33",
50
- "@arcjet/rollup-config": "1.0.0-alpha.33",
51
- "@arcjet/tsconfig": "1.0.0-alpha.33",
49
+ "@arcjet/eslint-config": "1.0.0-alpha.34",
50
+ "@arcjet/rollup-config": "1.0.0-alpha.34",
51
+ "@arcjet/tsconfig": "1.0.0-alpha.34",
52
52
  "@jest/globals": "29.7.0",
53
53
  "@types/node": "20.12.12",
54
- "@rollup/wasm-node": "4.27.4",
55
- "bun-types": "1.1.37",
54
+ "@rollup/wasm-node": "4.28.0",
55
+ "bun-types": "1.1.38",
56
56
  "jest": "29.7.0",
57
57
  "typescript": "5.7.2"
58
58
  },