@rayselfs/cf-rule-engine 1.8.0 → 1.8.2

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/README.md CHANGED
@@ -136,7 +136,9 @@ setCorsHeaders({ allowedOrigins: ['https://*.viverse.com', 'https://sdk-api.vive
136
136
  setCorsHeaders({ allowedOrigins: ORIGIN_ECHO, allowCredentials: true })
137
137
  ```
138
138
 
139
- `allowedMethods` and `allowedHeaders` are optional omit to exclude those headers from the response.
139
+ `allowedMethods` accepts a `Methods[]` array (e.g. `['GET', 'POST', 'OPTIONS']`); items are joined with `, ` to form the header value.
140
+ `allowedHeaders` accepts a `string[]` array (e.g. `['Content-Type', 'Authorization']`); items are joined with `, `.
141
+ Both are optional — omit to exclude those headers from the response.
140
142
 
141
143
  ## Helpers (`@rayselfs/cf-rule-engine/helpers/index`)
142
144
 
@@ -27,7 +27,7 @@ var _chunkMRPTC74Icjs = require('../chunk-MRPTC74I.cjs');
27
27
  var _chunkCV234DQTcjs = require('../chunk-CV234DQT.cjs');
28
28
 
29
29
 
30
- var _chunkWAKA4OJDcjs = require('../chunk-WAKA4OJD.cjs');
30
+ var _chunkAEZDDJEWcjs = require('../chunk-AEZDDJEW.cjs');
31
31
 
32
32
 
33
33
  var _chunkZXS23HXAcjs = require('../chunk-ZXS23HXA.cjs');
@@ -123,4 +123,4 @@ function verifyToken(options) {
123
123
 
124
124
 
125
125
 
126
- exports.constructResponse = _chunkOSGZTNTScjs.constructResponse; exports.copyHeader = _chunkJU5WX5RUcjs.copyHeader; exports.directoryIndex = _chunkLTLBEBKLcjs.directoryIndex; exports.imageOptimize = _chunkKXC6ES3Bcjs.imageOptimize; exports.redirect = _chunkWWSRNCUPcjs.redirect; exports.removeResponseHeaders = _chunkSGEBNQR2cjs.removeResponseHeaders; exports.rewriteUri = _chunkMRPTC74Icjs.rewriteUri; exports.setCacheControl = _chunkCV234DQTcjs.setCacheControl; exports.setCorsHeaders = _chunkWAKA4OJDcjs.setCorsHeaders; exports.setCsp = _chunkZXS23HXAcjs.setCsp; exports.setRequestHeader = _chunkPPUHEL4Hcjs.setRequestHeader; exports.setResponseHeader = _chunkB4WEJSEZcjs.setResponseHeader; exports.setSecurityHeaders = _chunk3UXNXJ6Ncjs.setSecurityHeaders; exports.stripQueryParams = _chunkMSES76XKcjs.stripQueryParams; exports.verifyToken = verifyToken;
126
+ exports.constructResponse = _chunkOSGZTNTScjs.constructResponse; exports.copyHeader = _chunkJU5WX5RUcjs.copyHeader; exports.directoryIndex = _chunkLTLBEBKLcjs.directoryIndex; exports.imageOptimize = _chunkKXC6ES3Bcjs.imageOptimize; exports.redirect = _chunkWWSRNCUPcjs.redirect; exports.removeResponseHeaders = _chunkSGEBNQR2cjs.removeResponseHeaders; exports.rewriteUri = _chunkMRPTC74Icjs.rewriteUri; exports.setCacheControl = _chunkCV234DQTcjs.setCacheControl; exports.setCorsHeaders = _chunkAEZDDJEWcjs.setCorsHeaders; exports.setCsp = _chunkZXS23HXAcjs.setCsp; exports.setRequestHeader = _chunkPPUHEL4Hcjs.setRequestHeader; exports.setResponseHeader = _chunkB4WEJSEZcjs.setResponseHeader; exports.setSecurityHeaders = _chunk3UXNXJ6Ncjs.setSecurityHeaders; exports.stripQueryParams = _chunkMSES76XKcjs.stripQueryParams; exports.verifyToken = verifyToken;
@@ -27,7 +27,7 @@ import {
27
27
  } from "../chunk-ZTMSH34E.js";
28
28
  import {
29
29
  setCorsHeaders
30
- } from "../chunk-SRA2DFKG.js";
30
+ } from "../chunk-CQA2DCVF.js";
31
31
  import {
32
32
  setCsp
33
33
  } from "../chunk-XUI4Y22M.js";
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWAKA4OJDcjs = require('../chunk-WAKA4OJD.cjs');
5
+ var _chunkAEZDDJEWcjs = require('../chunk-AEZDDJEW.cjs');
6
6
  require('../chunk-75ZPJI57.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.ORIGIN_ECHO = _chunkWAKA4OJDcjs.ORIGIN_ECHO; exports.ORIGIN_WILDCARD = _chunkWAKA4OJDcjs.ORIGIN_WILDCARD; exports.setCorsHeaders = _chunkWAKA4OJDcjs.setCorsHeaders;
11
+ exports.ORIGIN_ECHO = _chunkAEZDDJEWcjs.ORIGIN_ECHO; exports.ORIGIN_WILDCARD = _chunkAEZDDJEWcjs.ORIGIN_WILDCARD; exports.setCorsHeaders = _chunkAEZDDJEWcjs.setCorsHeaders;
@@ -16,6 +16,10 @@ type Origin = `https://${string}` | `http://${string}`;
16
16
  * - `ORIGIN_ECHO` (`'echo'`) — echo any request `Origin` if present, skip if none
17
17
  */
18
18
  type OriginPolicy = OriginWildcard | Origin[] | OriginEcho;
19
+ /**
20
+ * Standard HTTP methods allowed in `Access-Control-Allow-Methods`.
21
+ */
22
+ type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
19
23
  /**
20
24
  * CORS configuration options for `setCorsHeaders` and `preflightRequest`.
21
25
  */
@@ -25,15 +29,21 @@ interface CorsOptions {
25
29
  */
26
30
  allowedOrigins: OriginPolicy;
27
31
  /**
28
- * Value for the `Access-Control-Allow-Methods` header.
32
+ * HTTP methods to include in `Access-Control-Allow-Methods`.
33
+ * Array items are joined with `, ` before being written to the header.
29
34
  * Omit to exclude the header.
35
+ *
36
+ * @example `['GET', 'POST', 'OPTIONS']`
30
37
  */
31
- allowedMethods?: string;
38
+ allowedMethods?: Methods[];
32
39
  /**
33
- * Value for the `Access-Control-Allow-Headers` header.
40
+ * Header names to include in `Access-Control-Allow-Headers`.
41
+ * Array items are joined with `, ` before being written to the header.
34
42
  * Omit to exclude the header.
43
+ *
44
+ * @example `['Content-Type', 'Authorization']`
35
45
  */
36
- allowedHeaders?: string;
46
+ allowedHeaders?: string[];
37
47
  /**
38
48
  * When `true`, sets `Access-Control-Allow-Credentials: true`.
39
49
  * Use with `ORIGIN_ECHO` or `Origin[]` — browsers reject `*` with credentials.
@@ -74,4 +84,4 @@ interface CorsOptions {
74
84
  */
75
85
  declare function setCorsHeaders(options: CorsOptions): ResponseBehaviorFn;
76
86
 
77
- export { type CorsOptions, ORIGIN_ECHO, ORIGIN_WILDCARD, type Origin, type OriginEcho, type OriginPolicy, type OriginWildcard, setCorsHeaders };
87
+ export { type CorsOptions, type Methods, ORIGIN_ECHO, ORIGIN_WILDCARD, type Origin, type OriginEcho, type OriginPolicy, type OriginWildcard, setCorsHeaders };
@@ -16,6 +16,10 @@ type Origin = `https://${string}` | `http://${string}`;
16
16
  * - `ORIGIN_ECHO` (`'echo'`) — echo any request `Origin` if present, skip if none
17
17
  */
18
18
  type OriginPolicy = OriginWildcard | Origin[] | OriginEcho;
19
+ /**
20
+ * Standard HTTP methods allowed in `Access-Control-Allow-Methods`.
21
+ */
22
+ type Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'TRACE' | 'CONNECT';
19
23
  /**
20
24
  * CORS configuration options for `setCorsHeaders` and `preflightRequest`.
21
25
  */
@@ -25,15 +29,21 @@ interface CorsOptions {
25
29
  */
26
30
  allowedOrigins: OriginPolicy;
27
31
  /**
28
- * Value for the `Access-Control-Allow-Methods` header.
32
+ * HTTP methods to include in `Access-Control-Allow-Methods`.
33
+ * Array items are joined with `, ` before being written to the header.
29
34
  * Omit to exclude the header.
35
+ *
36
+ * @example `['GET', 'POST', 'OPTIONS']`
30
37
  */
31
- allowedMethods?: string;
38
+ allowedMethods?: Methods[];
32
39
  /**
33
- * Value for the `Access-Control-Allow-Headers` header.
40
+ * Header names to include in `Access-Control-Allow-Headers`.
41
+ * Array items are joined with `, ` before being written to the header.
34
42
  * Omit to exclude the header.
43
+ *
44
+ * @example `['Content-Type', 'Authorization']`
35
45
  */
36
- allowedHeaders?: string;
46
+ allowedHeaders?: string[];
37
47
  /**
38
48
  * When `true`, sets `Access-Control-Allow-Credentials: true`.
39
49
  * Use with `ORIGIN_ECHO` or `Origin[]` — browsers reject `*` with credentials.
@@ -74,4 +84,4 @@ interface CorsOptions {
74
84
  */
75
85
  declare function setCorsHeaders(options: CorsOptions): ResponseBehaviorFn;
76
86
 
77
- export { type CorsOptions, ORIGIN_ECHO, ORIGIN_WILDCARD, type Origin, type OriginEcho, type OriginPolicy, type OriginWildcard, setCorsHeaders };
87
+ export { type CorsOptions, type Methods, ORIGIN_ECHO, ORIGIN_WILDCARD, type Origin, type OriginEcho, type OriginPolicy, type OriginWildcard, setCorsHeaders };
@@ -2,7 +2,7 @@ import {
2
2
  ORIGIN_ECHO,
3
3
  ORIGIN_WILDCARD,
4
4
  setCorsHeaders
5
- } from "../chunk-SRA2DFKG.js";
5
+ } from "../chunk-CQA2DCVF.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
8
8
  ORIGIN_ECHO,
@@ -8,7 +8,7 @@ function matchesOriginPattern(origin, pattern) {
8
8
  return new RegExp(`^${escaped}$`).test(origin);
9
9
  }
10
10
  function setCorsHeaders(options) {
11
- const { allowedOrigins } = options;
11
+ const allowedOrigins = options.allowedOrigins;
12
12
  return (request, response) => {
13
13
  let allowOrigin;
14
14
  if (allowedOrigins === ORIGIN_WILDCARD) {
@@ -26,10 +26,10 @@ function setCorsHeaders(options) {
26
26
  "access-control-allow-origin": { value: allowOrigin }
27
27
  };
28
28
  if (options.allowedMethods !== void 0) {
29
- corsHeaders["access-control-allow-methods"] = { value: options.allowedMethods };
29
+ corsHeaders["access-control-allow-methods"] = { value: options.allowedMethods.join(", ") };
30
30
  }
31
31
  if (options.allowedHeaders !== void 0) {
32
- corsHeaders["access-control-allow-headers"] = { value: options.allowedHeaders };
32
+ corsHeaders["access-control-allow-headers"] = { value: options.allowedHeaders.join(", ") };
33
33
  }
34
34
  if (options.allowCredentials) {
35
35
  corsHeaders["access-control-allow-credentials"] = { value: "true" };
@@ -8,7 +8,7 @@ function matchesOriginPattern(origin, pattern) {
8
8
  return new RegExp(`^${escaped}$`).test(origin);
9
9
  }
10
10
  function setCorsHeaders(options) {
11
- const { allowedOrigins } = options;
11
+ const allowedOrigins = options.allowedOrigins;
12
12
  return (request, response) => {
13
13
  let allowOrigin;
14
14
  if (allowedOrigins === ORIGIN_WILDCARD) {
@@ -26,10 +26,10 @@ function setCorsHeaders(options) {
26
26
  "access-control-allow-origin": { value: allowOrigin }
27
27
  };
28
28
  if (options.allowedMethods !== void 0) {
29
- corsHeaders["access-control-allow-methods"] = { value: options.allowedMethods };
29
+ corsHeaders["access-control-allow-methods"] = { value: options.allowedMethods.join(", ") };
30
30
  }
31
31
  if (options.allowedHeaders !== void 0) {
32
- corsHeaders["access-control-allow-headers"] = { value: options.allowedHeaders };
32
+ corsHeaders["access-control-allow-headers"] = { value: options.allowedHeaders.join(", ") };
33
33
  }
34
34
  if (options.allowCredentials) {
35
35
  corsHeaders["access-control-allow-credentials"] = { value: "true" };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  ORIGIN_ECHO,
6
6
  ORIGIN_WILDCARD
7
- } from "./chunk-SRA2DFKG.js";
7
+ } from "./chunk-CQA2DCVF.js";
8
8
 
9
9
  // src/helpers/preflight-request.ts
10
10
  function matchesOriginPattern(origin, pattern) {
@@ -14,9 +14,9 @@ function matchesOriginPattern(origin, pattern) {
14
14
  return new RegExp(`^${escaped}$`).test(origin);
15
15
  }
16
16
  function preflightRequest(options) {
17
- const { allowedOrigins } = options;
18
- const allowedMethods = options.allowedMethods ?? "GET, POST, OPTIONS";
19
- const allowedHeaders = options.allowedHeaders ?? "Content-Type, Cache-Control, Pragma, Range";
17
+ const allowedOrigins = options.allowedOrigins;
18
+ const allowedMethods = options.allowedMethods ?? ["GET", "POST", "OPTIONS"];
19
+ const allowedHeaders = options.allowedHeaders ?? ["Content-Type", "Cache-Control", "Pragma", "Range"];
20
20
  const allowCredentials = options.allowCredentials ?? false;
21
21
  const maxAge = options.maxAge;
22
22
  return {
@@ -35,8 +35,8 @@ function preflightRequest(options) {
35
35
  }
36
36
  const headers = {
37
37
  "cache-control": { value: "no-store" },
38
- "access-control-allow-methods": { value: allowedMethods },
39
- "access-control-allow-headers": { value: allowedHeaders }
38
+ "access-control-allow-methods": { value: allowedMethods.join(", ") },
39
+ "access-control-allow-headers": { value: allowedHeaders.join(", ") }
40
40
  };
41
41
  if (allowOrigin !== void 0) {
42
42
  headers["access-control-allow-origin"] = { value: allowOrigin };
@@ -4,7 +4,7 @@ var _chunkOTFDML3Kcjs = require('./chunk-OTFDML3K.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkWAKA4OJDcjs = require('./chunk-WAKA4OJD.cjs');
7
+ var _chunkAEZDDJEWcjs = require('./chunk-AEZDDJEW.cjs');
8
8
 
9
9
  // src/helpers/preflight-request.ts
10
10
  function matchesOriginPattern(origin, pattern) {
@@ -14,18 +14,18 @@ function matchesOriginPattern(origin, pattern) {
14
14
  return new RegExp(`^${escaped}$`).test(origin);
15
15
  }
16
16
  function preflightRequest(options) {
17
- const { allowedOrigins } = options;
18
- const allowedMethods = _nullishCoalesce(options.allowedMethods, () => ( "GET, POST, OPTIONS"));
19
- const allowedHeaders = _nullishCoalesce(options.allowedHeaders, () => ( "Content-Type, Cache-Control, Pragma, Range"));
17
+ const allowedOrigins = options.allowedOrigins;
18
+ const allowedMethods = _nullishCoalesce(options.allowedMethods, () => ( ["GET", "POST", "OPTIONS"]));
19
+ const allowedHeaders = _nullishCoalesce(options.allowedHeaders, () => ( ["Content-Type", "Cache-Control", "Pragma", "Range"]));
20
20
  const allowCredentials = _nullishCoalesce(options.allowCredentials, () => ( false));
21
21
  const maxAge = options.maxAge;
22
22
  return {
23
23
  criteria: _chunkOTFDML3Kcjs.methodIs.call(void 0, ["OPTIONS"]),
24
24
  behavior: (request) => {
25
25
  let allowOrigin;
26
- if (allowedOrigins === _chunkWAKA4OJDcjs.ORIGIN_WILDCARD) {
26
+ if (allowedOrigins === _chunkAEZDDJEWcjs.ORIGIN_WILDCARD) {
27
27
  allowOrigin = "*";
28
- } else if (allowedOrigins === _chunkWAKA4OJDcjs.ORIGIN_ECHO) {
28
+ } else if (allowedOrigins === _chunkAEZDDJEWcjs.ORIGIN_ECHO) {
29
29
  allowOrigin = _optionalChain([request, 'access', _ => _.headers, 'access', _2 => _2["origin"], 'optionalAccess', _3 => _3.value]);
30
30
  } else {
31
31
  const originHeader = _optionalChain([request, 'access', _4 => _4.headers, 'access', _5 => _5["origin"], 'optionalAccess', _6 => _6.value]);
@@ -35,8 +35,8 @@ function preflightRequest(options) {
35
35
  }
36
36
  const headers = {
37
37
  "cache-control": { value: "no-store" },
38
- "access-control-allow-methods": { value: allowedMethods },
39
- "access-control-allow-headers": { value: allowedHeaders }
38
+ "access-control-allow-methods": { value: allowedMethods.join(", ") },
39
+ "access-control-allow-headers": { value: allowedHeaders.join(", ") }
40
40
  };
41
41
  if (allowOrigin !== void 0) {
42
42
  headers["access-control-allow-origin"] = { value: allowOrigin };
@@ -1,5 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkG7JGTBTTcjs = require('../chunk-G7JGTBTT.cjs');
4
+
5
+
6
+ var _chunkMVGYPBYBcjs = require('../chunk-MVGYPBYB.cjs');
7
+
8
+
9
+ var _chunk32SMWYAFcjs = require('../chunk-32SMWYAF.cjs');
10
+
11
+
12
+ var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
13
+
14
+
3
15
  var _chunkJGJW7D2Ncjs = require('../chunk-JGJW7D2N.cjs');
4
16
 
5
17
 
@@ -14,12 +26,6 @@ var _chunkVEEOQ7TScjs = require('../chunk-VEEOQ7TS.cjs');
14
26
 
15
27
 
16
28
  var _chunkCF5PWWTFcjs = require('../chunk-CF5PWWTF.cjs');
17
-
18
-
19
- var _chunkG7JGTBTTcjs = require('../chunk-G7JGTBTT.cjs');
20
-
21
-
22
- var _chunkMVGYPBYBcjs = require('../chunk-MVGYPBYB.cjs');
23
29
  require('../chunk-IBXAK2A4.cjs');
24
30
 
25
31
 
@@ -27,12 +33,6 @@ var _chunkOSZWDCTScjs = require('../chunk-OSZWDCTS.cjs');
27
33
 
28
34
 
29
35
  var _chunkU54FZCOHcjs = require('../chunk-U54FZCOH.cjs');
30
-
31
-
32
- var _chunk32SMWYAFcjs = require('../chunk-32SMWYAF.cjs');
33
-
34
-
35
- var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
36
36
  require('../chunk-75ZPJI57.cjs');
37
37
 
38
38
 
@@ -1,3 +1,15 @@
1
+ import {
2
+ pathPrefix
3
+ } from "../chunk-XLSZ5RB7.js";
4
+ import {
5
+ userAgentMatches
6
+ } from "../chunk-S2AAATFN.js";
7
+ import {
8
+ headerContains
9
+ } from "../chunk-SRQF5UEJ.js";
10
+ import {
11
+ headerEquals
12
+ } from "../chunk-BZQJYOU2.js";
1
13
  import {
2
14
  hostnameIs
3
15
  } from "../chunk-3PVDUC5M.js";
@@ -14,12 +26,6 @@ import {
14
26
  import {
15
27
  pathMatches
16
28
  } from "../chunk-LO2BO3RU.js";
17
- import {
18
- pathPrefix
19
- } from "../chunk-XLSZ5RB7.js";
20
- import {
21
- userAgentMatches
22
- } from "../chunk-S2AAATFN.js";
23
29
  import "../chunk-2DE6WPPL.js";
24
30
  import {
25
31
  countryIs
@@ -27,12 +33,6 @@ import {
27
33
  import {
28
34
  fileExtension
29
35
  } from "../chunk-LBJUCJF2.js";
30
- import {
31
- headerContains
32
- } from "../chunk-SRQF5UEJ.js";
33
- import {
34
- headerEquals
35
- } from "../chunk-BZQJYOU2.js";
36
36
  import "../chunk-MLKGABMK.js";
37
37
  export {
38
38
  countryIs,
@@ -1,26 +1,26 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk45SNLNLRcjs = require('../chunk-45SNLNLR.cjs');
3
+ var _chunkPBR6AREGcjs = require('../chunk-PBR6AREG.cjs');
4
4
 
5
5
 
6
6
  var _chunkLSCC62CZcjs = require('../chunk-LSCC62CZ.cjs');
7
7
 
8
8
 
9
- var _chunkMO7HW25Rcjs = require('../chunk-MO7HW25R.cjs');
9
+ var _chunkT5EXFHVAcjs = require('../chunk-T5EXFHVA.cjs');
10
+ require('../chunk-MVGYPBYB.cjs');
11
+
12
+
13
+ var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
10
14
  require('../chunk-D47P7HVZ.cjs');
11
15
  require('../chunk-YVUR35RN.cjs');
12
16
  require('../chunk-OTFDML3K.cjs');
13
17
  require('../chunk-CF5PWWTF.cjs');
14
- require('../chunk-MVGYPBYB.cjs');
15
18
  require('../chunk-IBXAK2A4.cjs');
16
19
 
17
20
 
18
- var _chunkL7NBJ4JAcjs = require('../chunk-L7NBJ4JA.cjs');
19
-
20
-
21
21
  var _chunkB4WEJSEZcjs = require('../chunk-B4WEJSEZ.cjs');
22
22
  require('../chunk-WWSRNCUP.cjs');
23
- require('../chunk-WAKA4OJD.cjs');
23
+ require('../chunk-AEZDDJEW.cjs');
24
24
  require('../chunk-WKYMSRCD.cjs');
25
25
  require('../chunk-JU5WX5RU.cjs');
26
26
  require('../chunk-75ZPJI57.cjs');
@@ -40,4 +40,4 @@ function stagingIndicator() {
40
40
 
41
41
 
42
42
 
43
- exports.preflightRequest = _chunk45SNLNLRcjs.preflightRequest; exports.sendCountryCode = _chunkLSCC62CZcjs.sendCountryCode; exports.stagingIndicator = stagingIndicator; exports.whitelist = _chunkMO7HW25Rcjs.whitelist;
43
+ exports.preflightRequest = _chunkPBR6AREGcjs.preflightRequest; exports.sendCountryCode = _chunkLSCC62CZcjs.sendCountryCode; exports.stagingIndicator = stagingIndicator; exports.whitelist = _chunkT5EXFHVAcjs.whitelist;
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  preflightRequest
3
- } from "../chunk-3VYYXEER.js";
3
+ } from "../chunk-ORW3KDO5.js";
4
4
  import {
5
5
  sendCountryCode
6
6
  } from "../chunk-C32DL3EP.js";
7
7
  import {
8
8
  whitelist
9
- } from "../chunk-ER2YEZZO.js";
9
+ } from "../chunk-RL7ZETZR.js";
10
+ import "../chunk-S2AAATFN.js";
11
+ import {
12
+ headerEquals
13
+ } from "../chunk-BZQJYOU2.js";
10
14
  import "../chunk-KW5YBTSD.js";
11
15
  import "../chunk-LNQPYKGG.js";
12
16
  import "../chunk-PY3JMRDG.js";
13
17
  import "../chunk-LO2BO3RU.js";
14
- import "../chunk-S2AAATFN.js";
15
18
  import "../chunk-2DE6WPPL.js";
16
- import {
17
- headerEquals
18
- } from "../chunk-BZQJYOU2.js";
19
19
  import {
20
20
  setResponseHeader
21
21
  } from "../chunk-RBBKFG5J.js";
22
22
  import "../chunk-DSSFFJWL.js";
23
- import "../chunk-SRA2DFKG.js";
23
+ import "../chunk-CQA2DCVF.js";
24
24
  import "../chunk-Q4NP4C3B.js";
25
25
  import "../chunk-BDNPQ7AU.js";
26
26
  import "../chunk-MLKGABMK.js";
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk45SNLNLRcjs = require('../chunk-45SNLNLR.cjs');
3
+ var _chunkPBR6AREGcjs = require('../chunk-PBR6AREG.cjs');
4
4
  require('../chunk-OTFDML3K.cjs');
5
- require('../chunk-WAKA4OJD.cjs');
5
+ require('../chunk-AEZDDJEW.cjs');
6
6
  require('../chunk-75ZPJI57.cjs');
7
7
 
8
8
 
9
- exports.preflightRequest = _chunk45SNLNLRcjs.preflightRequest;
9
+ exports.preflightRequest = _chunkPBR6AREGcjs.preflightRequest;
@@ -17,8 +17,8 @@ import { CorsOptions } from '../behaviors/set-cors-headers.cjs';
17
17
  *
18
18
  * const CORS: CorsOptions = {
19
19
  * allowedOrigins: ORIGIN_WILDCARD,
20
- * allowedMethods: 'GET, POST, OPTIONS',
21
- * allowedHeaders: 'Content-Type, Cache-Control, Pragma, Range',
20
+ * allowedMethods: ['GET', 'POST', 'OPTIONS'],
21
+ * allowedHeaders: ['Content-Type', 'Cache-Control', 'Pragma', 'Range'],
22
22
  * }
23
23
  *
24
24
  * // viewer-request.ts
@@ -17,8 +17,8 @@ import { CorsOptions } from '../behaviors/set-cors-headers.js';
17
17
  *
18
18
  * const CORS: CorsOptions = {
19
19
  * allowedOrigins: ORIGIN_WILDCARD,
20
- * allowedMethods: 'GET, POST, OPTIONS',
21
- * allowedHeaders: 'Content-Type, Cache-Control, Pragma, Range',
20
+ * allowedMethods: ['GET', 'POST', 'OPTIONS'],
21
+ * allowedHeaders: ['Content-Type', 'Cache-Control', 'Pragma', 'Range'],
22
22
  * }
23
23
  *
24
24
  * // viewer-request.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  preflightRequest
3
- } from "../chunk-3VYYXEER.js";
3
+ } from "../chunk-ORW3KDO5.js";
4
4
  import "../chunk-PY3JMRDG.js";
5
- import "../chunk-SRA2DFKG.js";
5
+ import "../chunk-CQA2DCVF.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
8
8
  preflightRequest
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkMO7HW25Rcjs = require('../chunk-MO7HW25R.cjs');
3
+ var _chunkT5EXFHVAcjs = require('../chunk-T5EXFHVA.cjs');
4
+ require('../chunk-MVGYPBYB.cjs');
4
5
  require('../chunk-D47P7HVZ.cjs');
5
6
  require('../chunk-YVUR35RN.cjs');
6
7
  require('../chunk-CF5PWWTF.cjs');
7
- require('../chunk-MVGYPBYB.cjs');
8
8
  require('../chunk-IBXAK2A4.cjs');
9
9
  require('../chunk-WWSRNCUP.cjs');
10
10
  require('../chunk-WKYMSRCD.cjs');
11
11
  require('../chunk-75ZPJI57.cjs');
12
12
 
13
13
 
14
- exports.whitelist = _chunkMO7HW25Rcjs.whitelist;
14
+ exports.whitelist = _chunkT5EXFHVAcjs.whitelist;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  whitelist
3
- } from "../chunk-ER2YEZZO.js";
3
+ } from "../chunk-RL7ZETZR.js";
4
+ import "../chunk-S2AAATFN.js";
4
5
  import "../chunk-KW5YBTSD.js";
5
6
  import "../chunk-LNQPYKGG.js";
6
7
  import "../chunk-LO2BO3RU.js";
7
- import "../chunk-S2AAATFN.js";
8
8
  import "../chunk-2DE6WPPL.js";
9
9
  import "../chunk-DSSFFJWL.js";
10
10
  import "../chunk-Q4NP4C3B.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayselfs/cf-rule-engine",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "Composable, tree-shakeable CloudFront Function rules",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -1,12 +1,12 @@
1
+ import {
2
+ userAgentMatches
3
+ } from "./chunk-S2AAATFN.js";
1
4
  import {
2
5
  ipCidr
3
6
  } from "./chunk-KW5YBTSD.js";
4
7
  import {
5
8
  pathMatches
6
9
  } from "./chunk-LO2BO3RU.js";
7
- import {
8
- userAgentMatches
9
- } from "./chunk-S2AAATFN.js";
10
10
  import {
11
11
  redirect
12
12
  } from "./chunk-DSSFFJWL.js";
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkD47P7HVZcjs = require('./chunk-D47P7HVZ.cjs');
3
+ var _chunkMVGYPBYBcjs = require('./chunk-MVGYPBYB.cjs');
4
4
 
5
5
 
6
- var _chunkCF5PWWTFcjs = require('./chunk-CF5PWWTF.cjs');
6
+ var _chunkD47P7HVZcjs = require('./chunk-D47P7HVZ.cjs');
7
7
 
8
8
 
9
- var _chunkMVGYPBYBcjs = require('./chunk-MVGYPBYB.cjs');
9
+ var _chunkCF5PWWTFcjs = require('./chunk-CF5PWWTF.cjs');
10
10
 
11
11
 
12
12
  var _chunkWWSRNCUPcjs = require('./chunk-WWSRNCUP.cjs');