@arcjet/bun 1.0.0-alpha.33 → 1.0.0-beta.1
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/index.d.ts +11 -1
- package/index.js +2 -2
- package/package.json +16 -17
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-
|
|
36
|
+
const sdkVersion = "1.0.0-beta.1";
|
|
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-
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "Arcjet SDK for Bun.sh",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://arcjet.com",
|
|
@@ -34,27 +34,26 @@
|
|
|
34
34
|
"build": "rollup --config rollup.config.js",
|
|
35
35
|
"lint": "eslint .",
|
|
36
36
|
"pretest": "npm run build",
|
|
37
|
-
"test": "
|
|
37
|
+
"test": "node --test --experimental-test-coverage"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@arcjet/env": "1.0.0-
|
|
41
|
-
"@arcjet/headers": "1.0.0-
|
|
42
|
-
"@arcjet/ip": "1.0.0-
|
|
43
|
-
"@arcjet/logger": "1.0.0-
|
|
44
|
-
"@arcjet/protocol": "1.0.0-
|
|
45
|
-
"@arcjet/transport": "1.0.0-
|
|
46
|
-
"arcjet": "1.0.0-
|
|
40
|
+
"@arcjet/env": "1.0.0-beta.1",
|
|
41
|
+
"@arcjet/headers": "1.0.0-beta.1",
|
|
42
|
+
"@arcjet/ip": "1.0.0-beta.1",
|
|
43
|
+
"@arcjet/logger": "1.0.0-beta.1",
|
|
44
|
+
"@arcjet/protocol": "1.0.0-beta.1",
|
|
45
|
+
"@arcjet/transport": "1.0.0-beta.1",
|
|
46
|
+
"arcjet": "1.0.0-beta.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@arcjet/eslint-config": "1.0.0-
|
|
50
|
-
"@arcjet/rollup-config": "1.0.0-
|
|
51
|
-
"@arcjet/tsconfig": "1.0.0-
|
|
52
|
-
"@jest/globals": "29.7.0",
|
|
49
|
+
"@arcjet/eslint-config": "1.0.0-beta.1",
|
|
50
|
+
"@arcjet/rollup-config": "1.0.0-beta.1",
|
|
51
|
+
"@arcjet/tsconfig": "1.0.0-beta.1",
|
|
53
52
|
"@types/node": "20.12.12",
|
|
54
|
-
"@rollup/wasm-node": "4.
|
|
55
|
-
"bun-types": "1.1.
|
|
56
|
-
"
|
|
57
|
-
"typescript": "5.7.
|
|
53
|
+
"@rollup/wasm-node": "4.30.1",
|
|
54
|
+
"bun-types": "1.1.43",
|
|
55
|
+
"expect": "29.7.0",
|
|
56
|
+
"typescript": "5.7.3"
|
|
58
57
|
},
|
|
59
58
|
"publishConfig": {
|
|
60
59
|
"access": "public",
|