@arcjet/node 1.0.0-alpha.11 → 1.0.0-alpha.13

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.js +3 -2
  2. package/index.ts +3 -2
  3. package/package.json +8 -8
package/index.js CHANGED
@@ -15,7 +15,7 @@ function createNodeRemoteClient(options) {
15
15
  });
16
16
  // TODO(#223): Do we want to allow overrides to either of these? If not, we should probably define a separate type for `options`
17
17
  const sdkStack = "NODEJS";
18
- const sdkVersion = "1.0.0-alpha.11";
18
+ const sdkVersion = "1.0.0-alpha.13";
19
19
  return createRemoteClient({ ...options, transport, sdkStack, sdkVersion });
20
20
  }
21
21
  function cookiesToString(cookies) {
@@ -29,6 +29,8 @@ function cookiesToString(cookies) {
29
29
  return cookies;
30
30
  }
31
31
  function toArcjetRequest(request, props) {
32
+ // We pull the cookies from the request before wrapping them in ArcjetHeaders
33
+ const cookies = cookiesToString(request.headers?.cookie);
32
34
  // We construct an ArcjetHeaders to normalize over Headers
33
35
  const headers = new ArcjetHeaders(request.headers);
34
36
  const ip = findIP(request, headers);
@@ -61,7 +63,6 @@ function toArcjetRequest(request, props) {
61
63
  else {
62
64
  path = request.url ?? "";
63
65
  }
64
- const cookies = cookiesToString(request.headers?.cookie);
65
66
  return {
66
67
  ...props,
67
68
  ip,
package/index.ts CHANGED
@@ -139,6 +139,9 @@ function toArcjetRequest<Props extends PlainObject>(
139
139
  request: ArcjetNodeRequest,
140
140
  props: Props,
141
141
  ): ArcjetRequest<Props> {
142
+ // We pull the cookies from the request before wrapping them in ArcjetHeaders
143
+ const cookies = cookiesToString(request.headers?.cookie);
144
+
142
145
  // We construct an ArcjetHeaders to normalize over Headers
143
146
  const headers = new ArcjetHeaders(request.headers);
144
147
 
@@ -172,8 +175,6 @@ function toArcjetRequest<Props extends PlainObject>(
172
175
  path = request.url ?? "";
173
176
  }
174
177
 
175
- const cookies = cookiesToString(request.headers?.cookie);
176
-
177
178
  return {
178
179
  ...props,
179
180
  ip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/node",
3
- "version": "1.0.0-alpha.11",
3
+ "version": "1.0.0-alpha.13",
4
4
  "description": "Arcjet SDK for Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://arcjet.com",
@@ -40,19 +40,19 @@
40
40
  "test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests"
41
41
  },
42
42
  "dependencies": {
43
- "@arcjet/ip": "1.0.0-alpha.11",
43
+ "@arcjet/ip": "1.0.0-alpha.13",
44
44
  "@connectrpc/connect-node": "1.4.0",
45
- "arcjet": "1.0.0-alpha.11"
45
+ "arcjet": "1.0.0-alpha.13"
46
46
  },
47
47
  "devDependencies": {
48
- "@arcjet/eslint-config": "1.0.0-alpha.11",
49
- "@arcjet/rollup-config": "1.0.0-alpha.11",
50
- "@arcjet/tsconfig": "1.0.0-alpha.11",
48
+ "@arcjet/eslint-config": "1.0.0-alpha.13",
49
+ "@arcjet/rollup-config": "1.0.0-alpha.13",
50
+ "@arcjet/tsconfig": "1.0.0-alpha.13",
51
51
  "@jest/globals": "29.7.0",
52
52
  "@types/node": "18.18.0",
53
- "@rollup/wasm-node": "4.14.1",
53
+ "@rollup/wasm-node": "4.17.2",
54
54
  "jest": "29.7.0",
55
- "typescript": "5.4.4"
55
+ "typescript": "5.4.5"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public",