@arcjet/node 1.0.0-beta.4 → 1.0.0-beta.5
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.js +6 -3
- package/package.json +14 -14
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import core__default from 'arcjet';
|
|
2
2
|
export * from 'arcjet';
|
|
3
|
-
import findIP from '@arcjet/ip';
|
|
3
|
+
import findIP, { parseProxy } from '@arcjet/ip';
|
|
4
4
|
import ArcjetHeaders from '@arcjet/headers';
|
|
5
5
|
import { logLevel, isDevelopment, baseUrl, platform } from '@arcjet/env';
|
|
6
6
|
import { Logger } from '@arcjet/logger';
|
|
@@ -63,7 +63,7 @@ function createRemoteClient(options) {
|
|
|
63
63
|
// Transport is the HTTP client that the client uses to make requests.
|
|
64
64
|
const transport = createTransport(url);
|
|
65
65
|
const sdkStack = "NODEJS";
|
|
66
|
-
const sdkVersion = "1.0.0-beta.
|
|
66
|
+
const sdkVersion = "1.0.0-beta.5";
|
|
67
67
|
return createClient({
|
|
68
68
|
transport,
|
|
69
69
|
baseUrl: url,
|
|
@@ -97,6 +97,9 @@ function arcjet(options) {
|
|
|
97
97
|
: new Logger({
|
|
98
98
|
level: logLevel(env),
|
|
99
99
|
});
|
|
100
|
+
const proxies = Array.isArray(options.proxies)
|
|
101
|
+
? options.proxies.map(parseProxy)
|
|
102
|
+
: undefined;
|
|
100
103
|
if (isDevelopment(env)) {
|
|
101
104
|
log.warn("Arcjet will use 127.0.0.1 when missing public IP address in development mode");
|
|
102
105
|
}
|
|
@@ -108,7 +111,7 @@ function arcjet(options) {
|
|
|
108
111
|
let ip = findIP({
|
|
109
112
|
socket: request.socket,
|
|
110
113
|
headers,
|
|
111
|
-
}, { platform: platform(env), proxies
|
|
114
|
+
}, { platform: platform(env), proxies });
|
|
112
115
|
if (ip === "") {
|
|
113
116
|
// If the `ip` is empty but we're in development mode, we default the IP
|
|
114
117
|
// 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-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
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 --test --experimental-test-coverage"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@arcjet/env": "1.0.0-beta.
|
|
43
|
-
"@arcjet/headers": "1.0.0-beta.
|
|
44
|
-
"@arcjet/ip": "1.0.0-beta.
|
|
45
|
-
"@arcjet/logger": "1.0.0-beta.
|
|
46
|
-
"@arcjet/protocol": "1.0.0-beta.
|
|
47
|
-
"@arcjet/transport": "1.0.0-beta.
|
|
48
|
-
"@arcjet/body": "1.0.0-beta.
|
|
49
|
-
"arcjet": "1.0.0-beta.
|
|
42
|
+
"@arcjet/env": "1.0.0-beta.5",
|
|
43
|
+
"@arcjet/headers": "1.0.0-beta.5",
|
|
44
|
+
"@arcjet/ip": "1.0.0-beta.5",
|
|
45
|
+
"@arcjet/logger": "1.0.0-beta.5",
|
|
46
|
+
"@arcjet/protocol": "1.0.0-beta.5",
|
|
47
|
+
"@arcjet/transport": "1.0.0-beta.5",
|
|
48
|
+
"@arcjet/body": "1.0.0-beta.5",
|
|
49
|
+
"arcjet": "1.0.0-beta.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@arcjet/eslint-config": "1.0.0-beta.
|
|
53
|
-
"@arcjet/rollup-config": "1.0.0-beta.
|
|
54
|
-
"@arcjet/tsconfig": "1.0.0-beta.
|
|
52
|
+
"@arcjet/eslint-config": "1.0.0-beta.5",
|
|
53
|
+
"@arcjet/rollup-config": "1.0.0-beta.5",
|
|
54
|
+
"@arcjet/tsconfig": "1.0.0-beta.5",
|
|
55
55
|
"@types/node": "18.18.0",
|
|
56
|
-
"@rollup/wasm-node": "4.
|
|
57
|
-
"eslint": "9.
|
|
56
|
+
"@rollup/wasm-node": "4.37.0",
|
|
57
|
+
"eslint": "9.23.0",
|
|
58
58
|
"expect": "29.7.0",
|
|
59
59
|
"typescript": "5.8.2"
|
|
60
60
|
},
|