@arcjet/analyze-wasm 1.0.0-beta.11 → 1.0.0-beta.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.
- package/_virtual/arcjet_analyze_js_req.component.core.js +1 -1
- package/_virtual/arcjet_analyze_js_req.component.core2.js +1 -1
- package/_virtual/arcjet_analyze_js_req.component.core3.js +1 -1
- package/index.js +3 -0
- package/package.json +6 -6
- package/wasm/arcjet_analyze_js_req.component.core.wasm +0 -0
- package/wasm/arcjet_analyze_js_req.component.core2.wasm +0 -0
- package/wasm/arcjet_analyze_js_req.component.core3.wasm +0 -0
- package/wasm/arcjet_analyze_js_req.component.d.ts +3 -0
- package/wasm/arcjet_analyze_js_req.component.js +60 -24
- package/wasm/arcjet_analyze_js_req.component.wasm +0 -0
- package/wasm/interfaces/arcjet-js-req-filter-overrides.d.ts +3 -0
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* properly support consistent asset bundling techniques.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/
|
|
27
|
+
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwMJCAAAAQICAgIABAUBcAEICAcsCQEwAAABMQABATIAAgEzAAMBNAAEATUABQE2AAYBNwAHCCRpbXBvcnRzAQAKawgNACAAIAEgAkEAEQAACw0AIAAgASACQQERAAALDwAgACABIAIgA0ECEQEACwsAIAAgAUEDEQIACwsAIAAgAUEEEQIACwsAIAAgAUEFEQIACwsAIAAgAUEGEQIACw0AIAAgASACQQcRAAALAC8JcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDXdpdC1jb21wb25lbnQHMC4yMzUuMADvAwRuYW1lABMSd2l0LWNvbXBvbmVudDpzaGltAdIDCAAsaW5kaXJlY3QtYXJjamV0OmpzLXJlcS9ib3QtaWRlbnRpZmllci1kZXRlY3QBMWluZGlyZWN0LWFyY2pldDpqcy1yZXEvZmlsdGVyLW92ZXJyaWRlcy1pcC1sb29rdXACKGluZGlyZWN0LWFyY2pldDpqcy1yZXEvdmVyaWZ5LWJvdC12ZXJpZnkDPmluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1pcy1mcmVlLWVtYWlsBERpbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2VtYWlsLXZhbGlkYXRvci1vdmVycmlkZXMtaXMtZGlzcG9zYWJsZS1lbWFpbAU/aW5kaXJlY3QtYXJjamV0OmpzLXJlcS9lbWFpbC12YWxpZGF0b3Itb3ZlcnJpZGVzLWhhcy1teC1yZWNvcmRzBj1pbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2VtYWlsLXZhbGlkYXRvci1vdmVycmlkZXMtaGFzLWdyYXZhdGFyBz5pbmRpcmVjdC1hcmNqZXQ6anMtcmVxL3NlbnNpdGl2ZS1pbmZvcm1hdGlvbi1pZGVudGlmaWVyLWRldGVjdA==";
|
|
28
28
|
/**
|
|
29
29
|
* Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
|
|
30
30
|
* Data URL.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* properly support consistent asset bundling techniques.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/
|
|
27
|
+
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwI4CQABMAAAAAExAAAAATIAAQABMwACAAE0AAIAATUAAgABNgACAAE3AAAACCRpbXBvcnRzAXABCAgJDgEAQQALCAABAgMEBQYHAC8JcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDXdpdC1jb21wb25lbnQHMC4yMzUuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw==";
|
|
28
28
|
/**
|
|
29
29
|
* Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
|
|
30
30
|
* Data URL.
|
package/index.js
CHANGED
|
@@ -3,6 +3,9 @@ import { wasm } from './_virtual/arcjet_analyze_js_req.component.core.js';
|
|
|
3
3
|
import { wasm as wasm$1 } from './_virtual/arcjet_analyze_js_req.component.core2.js';
|
|
4
4
|
import { wasm as wasm$2 } from './_virtual/arcjet_analyze_js_req.component.core3.js';
|
|
5
5
|
|
|
6
|
+
// Support `?js` and such:
|
|
7
|
+
//
|
|
8
|
+
/// <reference types="./wasm.js" />
|
|
6
9
|
const componentCoreWasmPromise = wasm();
|
|
7
10
|
const componentCore2WasmPromise = wasm$1();
|
|
8
11
|
const componentCore3WasmPromise = wasm$2();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcjet/analyze-wasm",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.13",
|
|
4
4
|
"description": "WebAssembly bindings to Arcjet's local analysis engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"analyze",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@arcjet/eslint-config": "1.0.0-beta.
|
|
66
|
-
"@arcjet/rollup-config": "1.0.0-beta.
|
|
65
|
+
"@arcjet/eslint-config": "1.0.0-beta.13",
|
|
66
|
+
"@arcjet/rollup-config": "1.0.0-beta.13",
|
|
67
67
|
"@bytecodealliance/jco": "1.5.0",
|
|
68
|
-
"@rollup/wasm-node": "4.
|
|
69
|
-
"@types/node": "24.
|
|
70
|
-
"eslint": "9.
|
|
68
|
+
"@rollup/wasm-node": "4.52.3",
|
|
69
|
+
"@types/node": "24.6.0",
|
|
70
|
+
"eslint": "9.36.0",
|
|
71
71
|
"typescript": "5.9.2"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -82,14 +82,17 @@ export interface BotResult {
|
|
|
82
82
|
export interface FilterResult {
|
|
83
83
|
allowed: boolean,
|
|
84
84
|
matchedExpressions: Array<string>,
|
|
85
|
+
undeterminedExpressions: Array<string>,
|
|
85
86
|
}
|
|
86
87
|
import { ArcjetJsReqBotIdentifier } from './interfaces/arcjet-js-req-bot-identifier.js';
|
|
87
88
|
import { ArcjetJsReqEmailValidatorOverrides } from './interfaces/arcjet-js-req-email-validator-overrides.js';
|
|
89
|
+
import { ArcjetJsReqFilterOverrides } from './interfaces/arcjet-js-req-filter-overrides.js';
|
|
88
90
|
import { ArcjetJsReqSensitiveInformationIdentifier } from './interfaces/arcjet-js-req-sensitive-information-identifier.js';
|
|
89
91
|
import { ArcjetJsReqVerifyBot } from './interfaces/arcjet-js-req-verify-bot.js';
|
|
90
92
|
export interface ImportObject {
|
|
91
93
|
'arcjet:js-req/bot-identifier': typeof ArcjetJsReqBotIdentifier,
|
|
92
94
|
'arcjet:js-req/email-validator-overrides': typeof ArcjetJsReqEmailValidatorOverrides,
|
|
95
|
+
'arcjet:js-req/filter-overrides': typeof ArcjetJsReqFilterOverrides,
|
|
93
96
|
'arcjet:js-req/sensitive-information-identifier': typeof ArcjetJsReqSensitiveInformationIdentifier,
|
|
94
97
|
'arcjet:js-req/verify-bot': typeof ArcjetJsReqVerifyBot,
|
|
95
98
|
}
|
|
@@ -44,6 +44,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
44
44
|
|
|
45
45
|
const { detect } = imports['arcjet:js-req/bot-identifier'];
|
|
46
46
|
const { hasGravatar, hasMxRecords, isDisposableEmail, isFreeEmail } = imports['arcjet:js-req/email-validator-overrides'];
|
|
47
|
+
const { ipLookup } = imports['arcjet:js-req/filter-overrides'];
|
|
47
48
|
const { detect: detect$1 } = imports['arcjet:js-req/sensitive-information-identifier'];
|
|
48
49
|
const { verify } = imports['arcjet:js-req/verify-bot'];
|
|
49
50
|
let gen = (function* init () {
|
|
@@ -71,7 +72,25 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
71
72
|
dataView(memory0).setInt32(arg2 + 0, result2, true);
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
function trampoline1(arg0, arg1, arg2
|
|
75
|
+
function trampoline1(arg0, arg1, arg2) {
|
|
76
|
+
var ptr0 = arg0;
|
|
77
|
+
var len0 = arg1;
|
|
78
|
+
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
79
|
+
const ret = ipLookup(result0);
|
|
80
|
+
var variant2 = ret;
|
|
81
|
+
if (variant2 === null || variant2=== undefined) {
|
|
82
|
+
dataView(memory0).setInt8(arg2 + 0, 0, true);
|
|
83
|
+
} else {
|
|
84
|
+
const e = variant2;
|
|
85
|
+
dataView(memory0).setInt8(arg2 + 0, 1, true);
|
|
86
|
+
var ptr1 = utf8Encode(e, realloc0, memory0);
|
|
87
|
+
var len1 = utf8EncodedLen;
|
|
88
|
+
dataView(memory0).setInt32(arg2 + 8, len1, true);
|
|
89
|
+
dataView(memory0).setInt32(arg2 + 4, ptr1, true);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function trampoline2(arg0, arg1, arg2, arg3) {
|
|
75
94
|
var ptr0 = arg0;
|
|
76
95
|
var len0 = arg1;
|
|
77
96
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -105,7 +124,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
105
124
|
return enum2;
|
|
106
125
|
}
|
|
107
126
|
|
|
108
|
-
function
|
|
127
|
+
function trampoline3(arg0, arg1) {
|
|
109
128
|
var ptr0 = arg0;
|
|
110
129
|
var len0 = arg1;
|
|
111
130
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -136,7 +155,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
136
155
|
return enum1;
|
|
137
156
|
}
|
|
138
157
|
|
|
139
|
-
function
|
|
158
|
+
function trampoline4(arg0, arg1) {
|
|
140
159
|
var ptr0 = arg0;
|
|
141
160
|
var len0 = arg1;
|
|
142
161
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -167,7 +186,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
167
186
|
return enum1;
|
|
168
187
|
}
|
|
169
188
|
|
|
170
|
-
function
|
|
189
|
+
function trampoline5(arg0, arg1) {
|
|
171
190
|
var ptr0 = arg0;
|
|
172
191
|
var len0 = arg1;
|
|
173
192
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -198,7 +217,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
198
217
|
return enum1;
|
|
199
218
|
}
|
|
200
219
|
|
|
201
|
-
function
|
|
220
|
+
function trampoline6(arg0, arg1) {
|
|
202
221
|
var ptr0 = arg0;
|
|
203
222
|
var len0 = arg1;
|
|
204
223
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -229,7 +248,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
229
248
|
return enum1;
|
|
230
249
|
}
|
|
231
250
|
|
|
232
|
-
function
|
|
251
|
+
function trampoline7(arg0, arg1, arg2) {
|
|
233
252
|
var len1 = arg1;
|
|
234
253
|
var base1 = arg0;
|
|
235
254
|
var result1 = [];
|
|
@@ -294,6 +313,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
294
313
|
let postReturn2;
|
|
295
314
|
let postReturn3;
|
|
296
315
|
let postReturn4;
|
|
316
|
+
let postReturn5;
|
|
297
317
|
Promise.all([module0, module1, module2]).catch(() => {});
|
|
298
318
|
({ exports: exports0 } = yield instantiateCore(yield module1));
|
|
299
319
|
({ exports: exports1 } = yield instantiateCore(yield module0, {
|
|
@@ -301,16 +321,19 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
301
321
|
detect: exports0['0'],
|
|
302
322
|
},
|
|
303
323
|
'arcjet:js-req/email-validator-overrides': {
|
|
304
|
-
'has-gravatar': exports0['
|
|
305
|
-
'has-mx-records': exports0['
|
|
306
|
-
'is-disposable-email': exports0['
|
|
307
|
-
'is-free-email': exports0['
|
|
324
|
+
'has-gravatar': exports0['6'],
|
|
325
|
+
'has-mx-records': exports0['5'],
|
|
326
|
+
'is-disposable-email': exports0['4'],
|
|
327
|
+
'is-free-email': exports0['3'],
|
|
328
|
+
},
|
|
329
|
+
'arcjet:js-req/filter-overrides': {
|
|
330
|
+
'ip-lookup': exports0['1'],
|
|
308
331
|
},
|
|
309
332
|
'arcjet:js-req/sensitive-information-identifier': {
|
|
310
|
-
detect: exports0['
|
|
333
|
+
detect: exports0['7'],
|
|
311
334
|
},
|
|
312
335
|
'arcjet:js-req/verify-bot': {
|
|
313
|
-
verify: exports0['
|
|
336
|
+
verify: exports0['2'],
|
|
314
337
|
},
|
|
315
338
|
}));
|
|
316
339
|
memory0 = exports1.memory;
|
|
@@ -325,13 +348,15 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
325
348
|
'4': trampoline4,
|
|
326
349
|
'5': trampoline5,
|
|
327
350
|
'6': trampoline6,
|
|
351
|
+
'7': trampoline7,
|
|
328
352
|
},
|
|
329
353
|
}));
|
|
330
354
|
postReturn0 = exports1['cabi_post_detect-bot'];
|
|
331
|
-
postReturn1 = exports1['
|
|
355
|
+
postReturn1 = exports1['cabi_post_match-filters'];
|
|
332
356
|
postReturn2 = exports1['cabi_post_generate-fingerprint'];
|
|
333
357
|
postReturn3 = exports1['cabi_post_validate-characteristics'];
|
|
334
|
-
postReturn4 = exports1['
|
|
358
|
+
postReturn4 = exports1['cabi_post_is-valid-email'];
|
|
359
|
+
postReturn5 = exports1['cabi_post_detect-sensitive-info'];
|
|
335
360
|
|
|
336
361
|
function detectBot(arg0, arg1) {
|
|
337
362
|
var ptr0 = utf8Encode(arg0, realloc0, memory0);
|
|
@@ -457,7 +482,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
457
482
|
dataView(memory0).setInt32(base + 0, ptr1, true);
|
|
458
483
|
}
|
|
459
484
|
const ret = exports1['match-filters'](ptr0, len0, result2, len2, arg2 ? 1 : 0);
|
|
460
|
-
let
|
|
485
|
+
let variant9;
|
|
461
486
|
switch (dataView(memory0).getUint8(ret + 0, true)) {
|
|
462
487
|
case 0: {
|
|
463
488
|
var bool3 = dataView(memory0).getUint8(ret + 4, true);
|
|
@@ -471,22 +496,33 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
471
496
|
var result4 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr4, len4));
|
|
472
497
|
result5.push(result4);
|
|
473
498
|
}
|
|
474
|
-
|
|
499
|
+
var len7 = dataView(memory0).getInt32(ret + 20, true);
|
|
500
|
+
var base7 = dataView(memory0).getInt32(ret + 16, true);
|
|
501
|
+
var result7 = [];
|
|
502
|
+
for (let i = 0; i < len7; i++) {
|
|
503
|
+
const base = base7 + i * 8;
|
|
504
|
+
var ptr6 = dataView(memory0).getInt32(base + 0, true);
|
|
505
|
+
var len6 = dataView(memory0).getInt32(base + 4, true);
|
|
506
|
+
var result6 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr6, len6));
|
|
507
|
+
result7.push(result6);
|
|
508
|
+
}
|
|
509
|
+
variant9= {
|
|
475
510
|
tag: 'ok',
|
|
476
511
|
val: {
|
|
477
512
|
allowed: bool3 == 0 ? false : (bool3 == 1 ? true : throwInvalidBool()),
|
|
478
513
|
matchedExpressions: result5,
|
|
514
|
+
undeterminedExpressions: result7,
|
|
479
515
|
}
|
|
480
516
|
};
|
|
481
517
|
break;
|
|
482
518
|
}
|
|
483
519
|
case 1: {
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
|
|
520
|
+
var ptr8 = dataView(memory0).getInt32(ret + 4, true);
|
|
521
|
+
var len8 = dataView(memory0).getInt32(ret + 8, true);
|
|
522
|
+
var result8 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr8, len8));
|
|
523
|
+
variant9= {
|
|
488
524
|
tag: 'err',
|
|
489
|
-
val:
|
|
525
|
+
val: result8
|
|
490
526
|
};
|
|
491
527
|
break;
|
|
492
528
|
}
|
|
@@ -494,7 +530,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
494
530
|
throw new TypeError('invalid variant discriminant for expected');
|
|
495
531
|
}
|
|
496
532
|
}
|
|
497
|
-
const retVal =
|
|
533
|
+
const retVal = variant9;
|
|
498
534
|
postReturn1(ret);
|
|
499
535
|
if (typeof retVal === 'object' && retVal.tag === 'err') {
|
|
500
536
|
throw new ComponentError(retVal.val);
|
|
@@ -701,7 +737,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
701
737
|
}
|
|
702
738
|
}
|
|
703
739
|
const retVal = variant12;
|
|
704
|
-
|
|
740
|
+
postReturn4(ret);
|
|
705
741
|
if (typeof retVal === 'object' && retVal.tag === 'err') {
|
|
706
742
|
throw new ComponentError(retVal.val);
|
|
707
743
|
}
|
|
@@ -927,7 +963,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
927
963
|
allowed: result12,
|
|
928
964
|
denied: result15,
|
|
929
965
|
};
|
|
930
|
-
|
|
966
|
+
postReturn5(ret);
|
|
931
967
|
return retVal;
|
|
932
968
|
}
|
|
933
969
|
|
|
Binary file
|