@arcjet/analyze-wasm 1.0.0-beta.1 → 1.0.0-beta.3
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/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 +4 -1
- package/wasm/arcjet_analyze_js_req.component.js +40 -15
- package/wasm/arcjet_analyze_js_req.component.wasm +0 -0
- package/wasm/interfaces/arcjet-js-req-bot-identifier.d.ts +4 -0
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* properly support consistent asset bundling techniques.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
const wasmBase64 = "data:application/wasm;base64,
|
|
27
|
+
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwMIBwABAgICAgAEBQFwAQcHBygIATAAAAExAAEBMgACATMAAwE0AAQBNQAFATYABggkaW1wb3J0cwEACl0HDQAgACABIAJBABEAAAsPACAAIAEgAiADQQERAQALCwAgACABQQIRAgALCwAgACABQQMRAgALCwAgACABQQQRAgALCwAgACABQQURAgALDQAgACABIAJBBhEAAAsALwlwcm9kdWNlcnMBDHByb2Nlc3NlZC1ieQENd2l0LWNvbXBvbmVudAcwLjIyNi4wALwDBG5hbWUAExJ3aXQtY29tcG9uZW50OnNoaW0BnwMHACxpbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2JvdC1pZGVudGlmaWVyLWRldGVjdAEoaW5kaXJlY3QtYXJjamV0OmpzLXJlcS92ZXJpZnktYm90LXZlcmlmeQI+aW5kaXJlY3QtYXJjamV0OmpzLXJlcS9lbWFpbC12YWxpZGF0b3Itb3ZlcnJpZGVzLWlzLWZyZWUtZW1haWwDRGluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1pcy1kaXNwb3NhYmxlLWVtYWlsBD9pbmRpcmVjdC1hcmNqZXQ6anMtcmVxL2VtYWlsLXZhbGlkYXRvci1vdmVycmlkZXMtaGFzLW14LXJlY29yZHMFPWluZGlyZWN0LWFyY2pldDpqcy1yZXEvZW1haWwtdmFsaWRhdG9yLW92ZXJyaWRlcy1oYXMtZ3JhdmF0YXIGPmluZGlyZWN0LWFyY2pldDpqcy1yZXEvc2Vuc2l0aXZlLWluZm9ybWF0aW9uLWlkZW50aWZpZXItZGV0ZWN0";
|
|
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,
|
|
27
|
+
const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABFQNgA39/fwBgBH9/f38Bf2ACf38BfwIzCAABMAAAAAExAAEAATIAAgABMwACAAE0AAIAATUAAgABNgAAAAgkaW1wb3J0cwFwAQcHCQ0BAEEACwcAAQIDBAUGAC8JcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBDXdpdC1jb21wb25lbnQHMC4yMjYuMAAcBG5hbWUAFRR3aXQtY29tcG9uZW50OmZpeHVwcw==";
|
|
28
28
|
/**
|
|
29
29
|
* Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
|
|
30
30
|
* Data URL.
|
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.3",
|
|
4
4
|
"description": "WebAssembly bindings to Arcjet's local analysis engine",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://arcjet.com",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {},
|
|
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.3",
|
|
53
|
+
"@arcjet/rollup-config": "1.0.0-beta.3",
|
|
54
|
+
"@arcjet/tsconfig": "1.0.0-beta.3",
|
|
55
55
|
"@bytecodealliance/jco": "1.5.0",
|
|
56
|
-
"@rollup/wasm-node": "4.
|
|
56
|
+
"@rollup/wasm-node": "4.34.9",
|
|
57
57
|
"@types/node": "18.18.0",
|
|
58
58
|
"expect": "29.7.0",
|
|
59
|
-
"typescript": "5.
|
|
59
|
+
"typescript": "5.8.2"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SensitiveInfoEntity } from './interfaces/arcjet-js-req-sensitive-information-identifier.js';
|
|
2
2
|
export { SensitiveInfoEntity };
|
|
3
|
+
import type { BotEntity } from './interfaces/arcjet-js-req-bot-identifier.js';
|
|
4
|
+
export { BotEntity };
|
|
3
5
|
/**
|
|
4
6
|
* # Variants
|
|
5
7
|
*
|
|
@@ -54,7 +56,6 @@ export interface SensitiveInfoResult {
|
|
|
54
56
|
allowed: Array<DetectedSensitiveInfoEntity>,
|
|
55
57
|
denied: Array<DetectedSensitiveInfoEntity>,
|
|
56
58
|
}
|
|
57
|
-
export type BotEntity = string;
|
|
58
59
|
export interface AllowedBotConfig {
|
|
59
60
|
entities: Array<BotEntity>,
|
|
60
61
|
skipCustomDetect: boolean,
|
|
@@ -78,10 +79,12 @@ export interface BotResult {
|
|
|
78
79
|
verified: boolean,
|
|
79
80
|
spoofed: boolean,
|
|
80
81
|
}
|
|
82
|
+
import { ArcjetJsReqBotIdentifier } from './interfaces/arcjet-js-req-bot-identifier.js';
|
|
81
83
|
import { ArcjetJsReqEmailValidatorOverrides } from './interfaces/arcjet-js-req-email-validator-overrides.js';
|
|
82
84
|
import { ArcjetJsReqSensitiveInformationIdentifier } from './interfaces/arcjet-js-req-sensitive-information-identifier.js';
|
|
83
85
|
import { ArcjetJsReqVerifyBot } from './interfaces/arcjet-js-req-verify-bot.js';
|
|
84
86
|
export interface ImportObject {
|
|
87
|
+
'arcjet:js-req/bot-identifier': typeof ArcjetJsReqBotIdentifier,
|
|
85
88
|
'arcjet:js-req/email-validator-overrides': typeof ArcjetJsReqEmailValidatorOverrides,
|
|
86
89
|
'arcjet:js-req/sensitive-information-identifier': typeof ArcjetJsReqSensitiveInformationIdentifier,
|
|
87
90
|
'arcjet:js-req/verify-bot': typeof ArcjetJsReqVerifyBot,
|
|
@@ -42,8 +42,9 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
42
42
|
const module1 = getCoreModule('arcjet_analyze_js_req.component.core2.wasm');
|
|
43
43
|
const module2 = getCoreModule('arcjet_analyze_js_req.component.core3.wasm');
|
|
44
44
|
|
|
45
|
+
const { detect } = imports['arcjet:js-req/bot-identifier'];
|
|
45
46
|
const { hasGravatar, hasMxRecords, isDisposableEmail, isFreeEmail } = imports['arcjet:js-req/email-validator-overrides'];
|
|
46
|
-
const { detect } = imports['arcjet:js-req/sensitive-information-identifier'];
|
|
47
|
+
const { detect: detect$1 } = imports['arcjet:js-req/sensitive-information-identifier'];
|
|
47
48
|
const { verify } = imports['arcjet:js-req/verify-bot'];
|
|
48
49
|
let gen = (function* init () {
|
|
49
50
|
let exports0;
|
|
@@ -51,7 +52,26 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
51
52
|
let memory0;
|
|
52
53
|
let realloc0;
|
|
53
54
|
|
|
54
|
-
function trampoline0(arg0, arg1, arg2
|
|
55
|
+
function trampoline0(arg0, arg1, arg2) {
|
|
56
|
+
var ptr0 = arg0;
|
|
57
|
+
var len0 = arg1;
|
|
58
|
+
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
59
|
+
const ret = detect(result0);
|
|
60
|
+
var vec2 = ret;
|
|
61
|
+
var len2 = vec2.length;
|
|
62
|
+
var result2 = realloc0(0, 0, 4, len2 * 8);
|
|
63
|
+
for (let i = 0; i < vec2.length; i++) {
|
|
64
|
+
const e = vec2[i];
|
|
65
|
+
const base = result2 + i * 8;var ptr1 = utf8Encode(e, realloc0, memory0);
|
|
66
|
+
var len1 = utf8EncodedLen;
|
|
67
|
+
dataView(memory0).setInt32(base + 4, len1, true);
|
|
68
|
+
dataView(memory0).setInt32(base + 0, ptr1, true);
|
|
69
|
+
}
|
|
70
|
+
dataView(memory0).setInt32(arg2 + 4, len2, true);
|
|
71
|
+
dataView(memory0).setInt32(arg2 + 0, result2, true);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function trampoline1(arg0, arg1, arg2, arg3) {
|
|
55
75
|
var ptr0 = arg0;
|
|
56
76
|
var len0 = arg1;
|
|
57
77
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -85,7 +105,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
85
105
|
return enum2;
|
|
86
106
|
}
|
|
87
107
|
|
|
88
|
-
function
|
|
108
|
+
function trampoline2(arg0, arg1) {
|
|
89
109
|
var ptr0 = arg0;
|
|
90
110
|
var len0 = arg1;
|
|
91
111
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -116,7 +136,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
116
136
|
return enum1;
|
|
117
137
|
}
|
|
118
138
|
|
|
119
|
-
function
|
|
139
|
+
function trampoline3(arg0, arg1) {
|
|
120
140
|
var ptr0 = arg0;
|
|
121
141
|
var len0 = arg1;
|
|
122
142
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -147,7 +167,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
147
167
|
return enum1;
|
|
148
168
|
}
|
|
149
169
|
|
|
150
|
-
function
|
|
170
|
+
function trampoline4(arg0, arg1) {
|
|
151
171
|
var ptr0 = arg0;
|
|
152
172
|
var len0 = arg1;
|
|
153
173
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -178,7 +198,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
178
198
|
return enum1;
|
|
179
199
|
}
|
|
180
200
|
|
|
181
|
-
function
|
|
201
|
+
function trampoline5(arg0, arg1) {
|
|
182
202
|
var ptr0 = arg0;
|
|
183
203
|
var len0 = arg1;
|
|
184
204
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
@@ -209,7 +229,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
209
229
|
return enum1;
|
|
210
230
|
}
|
|
211
231
|
|
|
212
|
-
function
|
|
232
|
+
function trampoline6(arg0, arg1, arg2) {
|
|
213
233
|
var len1 = arg1;
|
|
214
234
|
var base1 = arg0;
|
|
215
235
|
var result1 = [];
|
|
@@ -220,7 +240,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
220
240
|
var result0 = utf8Decoder.decode(new Uint8Array(memory0.buffer, ptr0, len0));
|
|
221
241
|
result1.push(result0);
|
|
222
242
|
}
|
|
223
|
-
const ret = detect(result1);
|
|
243
|
+
const ret = detect$1(result1);
|
|
224
244
|
var vec5 = ret;
|
|
225
245
|
var len5 = vec5.length;
|
|
226
246
|
var result5 = realloc0(0, 0, 4, len5 * 16);
|
|
@@ -268,6 +288,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
268
288
|
dataView(memory0).setInt32(arg2 + 4, len5, true);
|
|
269
289
|
dataView(memory0).setInt32(arg2 + 0, result5, true);
|
|
270
290
|
}
|
|
291
|
+
let exports2;
|
|
271
292
|
let postReturn0;
|
|
272
293
|
let postReturn1;
|
|
273
294
|
let postReturn2;
|
|
@@ -276,22 +297,25 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
276
297
|
Promise.all([module0, module1, module2]).catch(() => {});
|
|
277
298
|
({ exports: exports0 } = yield instantiateCore(yield module1));
|
|
278
299
|
({ exports: exports1 } = yield instantiateCore(yield module0, {
|
|
300
|
+
'arcjet:js-req/bot-identifier': {
|
|
301
|
+
detect: exports0['0'],
|
|
302
|
+
},
|
|
279
303
|
'arcjet:js-req/email-validator-overrides': {
|
|
280
|
-
'has-gravatar': exports0['
|
|
281
|
-
'has-mx-records': exports0['
|
|
282
|
-
'is-disposable-email': exports0['
|
|
283
|
-
'is-free-email': exports0['
|
|
304
|
+
'has-gravatar': exports0['5'],
|
|
305
|
+
'has-mx-records': exports0['4'],
|
|
306
|
+
'is-disposable-email': exports0['3'],
|
|
307
|
+
'is-free-email': exports0['2'],
|
|
284
308
|
},
|
|
285
309
|
'arcjet:js-req/sensitive-information-identifier': {
|
|
286
|
-
detect: exports0['
|
|
310
|
+
detect: exports0['6'],
|
|
287
311
|
},
|
|
288
312
|
'arcjet:js-req/verify-bot': {
|
|
289
|
-
verify: exports0['
|
|
313
|
+
verify: exports0['1'],
|
|
290
314
|
},
|
|
291
315
|
}));
|
|
292
316
|
memory0 = exports1.memory;
|
|
293
317
|
realloc0 = exports1.cabi_realloc;
|
|
294
|
-
(yield instantiateCore(yield module2, {
|
|
318
|
+
({ exports: exports2 } = yield instantiateCore(yield module2, {
|
|
295
319
|
'': {
|
|
296
320
|
$imports: exports0.$imports,
|
|
297
321
|
'0': trampoline0,
|
|
@@ -300,6 +324,7 @@ function instantiate(getCoreModule, imports, instantiateCore = WebAssembly.insta
|
|
|
300
324
|
'3': trampoline3,
|
|
301
325
|
'4': trampoline4,
|
|
302
326
|
'5': trampoline5,
|
|
327
|
+
'6': trampoline6,
|
|
303
328
|
},
|
|
304
329
|
}));
|
|
305
330
|
postReturn0 = exports1['cabi_post_detect-bot'];
|
|
Binary file
|