@arcjet/node 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.
- package/index.d.ts +11 -1
- package/index.js +2 -2
- 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
|
export * from "arcjet";
|
|
3
3
|
type Simplify<T> = {
|
|
4
4
|
[KeyType in keyof T]: T[KeyType];
|
|
@@ -30,6 +30,16 @@ export interface ArcjetNodeRequest {
|
|
|
30
30
|
removeListener?: EventHandlerLike;
|
|
31
31
|
readable?: boolean;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The options used to configure an {@link ArcjetNode} client.
|
|
35
|
+
*/
|
|
36
|
+
export type ArcjetOptions<Rules extends [...Array<Primitive | Product>], Characteristics extends readonly string[]> = Simplify<CoreOptions<Rules, Characteristics> & {
|
|
37
|
+
/**
|
|
38
|
+
* One or more IP Address of trusted proxies in front of the application.
|
|
39
|
+
* These addresses will be excluded when Arcjet detects a public IP address.
|
|
40
|
+
*/
|
|
41
|
+
proxies?: Array<string>;
|
|
42
|
+
}>;
|
|
33
43
|
/**
|
|
34
44
|
* The ArcjetNode client provides a public `protect()` method to
|
|
35
45
|
* make a decision about how a Node.js request should be handled.
|
package/index.js
CHANGED
|
@@ -32,7 +32,7 @@ function createRemoteClient(options) {
|
|
|
32
32
|
// Transport is the HTTP client that the client uses to make requests.
|
|
33
33
|
const transport = createTransport(url);
|
|
34
34
|
const sdkStack = "NODEJS";
|
|
35
|
-
const sdkVersion = "1.0.0-alpha.
|
|
35
|
+
const sdkVersion = "1.0.0-alpha.34";
|
|
36
36
|
return createClient({
|
|
37
37
|
transport,
|
|
38
38
|
baseUrl: url,
|
|
@@ -74,7 +74,7 @@ function arcjet(options) {
|
|
|
74
74
|
let ip = findIP({
|
|
75
75
|
socket: request.socket,
|
|
76
76
|
headers,
|
|
77
|
-
}, { platform: platform(process.env) });
|
|
77
|
+
}, { platform: platform(process.env), proxies: options.proxies });
|
|
78
78
|
if (ip === "") {
|
|
79
79
|
// If the `ip` is empty but we're in development mode, we default the IP
|
|
80
80
|
// so the request doesn't fail.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/node",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.34",
|
|
4
4
|
"description": "Arcjet SDK for Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://arcjet.com",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@arcjet/env": "1.0.0-alpha.
|
|
43
|
-
"@arcjet/headers": "1.0.0-alpha.
|
|
44
|
-
"@arcjet/ip": "1.0.0-alpha.
|
|
45
|
-
"@arcjet/logger": "1.0.0-alpha.
|
|
46
|
-
"@arcjet/protocol": "1.0.0-alpha.
|
|
47
|
-
"@arcjet/transport": "1.0.0-alpha.
|
|
48
|
-
"@arcjet/body": "1.0.0-alpha.
|
|
49
|
-
"arcjet": "1.0.0-alpha.
|
|
42
|
+
"@arcjet/env": "1.0.0-alpha.34",
|
|
43
|
+
"@arcjet/headers": "1.0.0-alpha.34",
|
|
44
|
+
"@arcjet/ip": "1.0.0-alpha.34",
|
|
45
|
+
"@arcjet/logger": "1.0.0-alpha.34",
|
|
46
|
+
"@arcjet/protocol": "1.0.0-alpha.34",
|
|
47
|
+
"@arcjet/transport": "1.0.0-alpha.34",
|
|
48
|
+
"@arcjet/body": "1.0.0-alpha.34",
|
|
49
|
+
"arcjet": "1.0.0-alpha.34"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@arcjet/eslint-config": "1.0.0-alpha.
|
|
53
|
-
"@arcjet/rollup-config": "1.0.0-alpha.
|
|
54
|
-
"@arcjet/tsconfig": "1.0.0-alpha.
|
|
52
|
+
"@arcjet/eslint-config": "1.0.0-alpha.34",
|
|
53
|
+
"@arcjet/rollup-config": "1.0.0-alpha.34",
|
|
54
|
+
"@arcjet/tsconfig": "1.0.0-alpha.34",
|
|
55
55
|
"@jest/globals": "29.7.0",
|
|
56
56
|
"@types/node": "18.18.0",
|
|
57
|
-
"@rollup/wasm-node": "4.
|
|
57
|
+
"@rollup/wasm-node": "4.28.0",
|
|
58
58
|
"jest": "29.7.0",
|
|
59
59
|
"typescript": "5.7.2"
|
|
60
60
|
},
|