@arcjet/analyze 1.1.0 → 1.3.0
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 +3 -1
- package/index.js +4 -2
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -120,9 +120,11 @@ export declare function detectSensitiveInfo(context: AnalyzeContext, value: stri
|
|
|
120
120
|
* Arcjet context.
|
|
121
121
|
* @param request
|
|
122
122
|
* Request.
|
|
123
|
+
* @param localFields
|
|
124
|
+
* Fields to use as `local` in the expressions, as serialized JSON.
|
|
123
125
|
* @param expressions
|
|
124
126
|
* Filter expressions.
|
|
125
127
|
* @returns
|
|
126
128
|
* Promise to whether the filter matches the request.
|
|
127
129
|
*/
|
|
128
|
-
export declare function matchFilters(context: AnalyzeContext, request: AnalyzeRequest, expressions: ReadonlyArray<string>, allowIfMatch: boolean): Promise<FilterResult>;
|
|
130
|
+
export declare function matchFilters(context: AnalyzeContext, request: AnalyzeRequest, localFields: string, expressions: ReadonlyArray<string>, allowIfMatch: boolean): Promise<FilterResult>;
|
package/index.js
CHANGED
|
@@ -175,16 +175,18 @@ async function detectSensitiveInfo(context, value, entities, contextWindowSize,
|
|
|
175
175
|
* Arcjet context.
|
|
176
176
|
* @param request
|
|
177
177
|
* Request.
|
|
178
|
+
* @param localFields
|
|
179
|
+
* Fields to use as `local` in the expressions, as serialized JSON.
|
|
178
180
|
* @param expressions
|
|
179
181
|
* Filter expressions.
|
|
180
182
|
* @returns
|
|
181
183
|
* Promise to whether the filter matches the request.
|
|
182
184
|
*/
|
|
183
|
-
async function matchFilters(context, request, expressions, allowIfMatch) {
|
|
185
|
+
async function matchFilters(context, request, localFields, expressions, allowIfMatch) {
|
|
184
186
|
const coreImports = createCoreImports();
|
|
185
187
|
const analyze = await initializeWasm(coreImports);
|
|
186
188
|
if (typeof analyze !== "undefined") {
|
|
187
|
-
return analyze.matchFilters(JSON.stringify(request),
|
|
189
|
+
return analyze.matchFilters(JSON.stringify(request), localFields,
|
|
188
190
|
// @ts-expect-error: WebAssembly does not support readonly values.
|
|
189
191
|
expressions, allowIfMatch);
|
|
190
192
|
// Ignore the `else` branch as we test in places that have WebAssembly.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/analyze",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Arcjet local analysis engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analyze",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"test": "npm run build && npm run lint && npm run test-coverage"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@arcjet/analyze-wasm": "1.
|
|
48
|
-
"@arcjet/protocol": "1.
|
|
47
|
+
"@arcjet/analyze-wasm": "1.3.0",
|
|
48
|
+
"@arcjet/protocol": "1.3.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@arcjet/eslint-config": "1.
|
|
52
|
-
"@arcjet/rollup-config": "1.
|
|
51
|
+
"@arcjet/eslint-config": "1.3.0",
|
|
52
|
+
"@arcjet/rollup-config": "1.3.0",
|
|
53
53
|
"@bytecodealliance/jco": "1.5.0",
|
|
54
|
-
"@rollup/wasm-node": "4.57.
|
|
55
|
-
"@types/node": "
|
|
54
|
+
"@rollup/wasm-node": "4.57.1",
|
|
55
|
+
"@types/node": "24.11.0",
|
|
56
56
|
"eslint": "9.39.2",
|
|
57
57
|
"typescript": "5.9.3"
|
|
58
58
|
},
|