@arcjet/redact-wasm 1.0.0-beta.9 → 1.0.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.
@@ -24,7 +24,7 @@
24
24
  * properly support consistent asset bundling techniques.
25
25
  */
26
26
 
27
- const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwADAwIAAQQFAXABAgIHFAMBMAAAATEAAQgkaW1wb3J0cwEACiMCDQAgACABIAJBABEAAAsTACAAIAEgAiADIAQgBUEBEQEACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjI4LjAAlQEEbmFtZQATEndpdC1jb21wb25lbnQ6c2hpbQF5AgA6aW5kaXJlY3QtYXJjamV0OnJlZGFjdC9jdXN0b20tcmVkYWN0LWRldGVjdC1zZW5zaXRpdmUtaW5mbwE6aW5kaXJlY3QtYXJjamV0OnJlZGFjdC9jdXN0b20tcmVkYWN0LXJlZGFjdC1zZW5zaXRpdmUtaW5mbw==";
27
+ const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwADAwIAAQQFAXABAgIHFAMBMAAAATEAAQgkaW1wb3J0cwEACiMCDQAgACABIAJBABEAAAsTACAAIAEgAiADIAQgBUEBEQEACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjQzLjA=";
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,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwACGgMAATAAAAABMQABAAgkaW1wb3J0cwFwAQICCQgBAEEACwIAAQAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjI4LjAAHARuYW1lABUUd2l0LWNvbXBvbmVudDpmaXh1cHM=";
27
+ const wasmBase64 = "data:application/wasm;base64,AGFzbQEAAAABEAJgA39/fwBgBn9/f39/fwACGgMAATAAAAABMQABAAgkaW1wb3J0cwFwAQICCQgBAEEACwIAAQAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjQzLjA=";
28
28
  /**
29
29
  * Returns a WebAssembly.Module for an Arcjet Wasm binary, decoded from a base64
30
30
  * Data URL.
package/index.d.ts CHANGED
@@ -1,6 +1,33 @@
1
- import type { RedactedSensitiveInfoEntity, RedactSensitiveInfoConfig, SensitiveInfoEntity } from "./wasm/arcjet_analyze_bindings_redact.component.js";
2
1
  import type { ArcjetRedactCustomRedact } from "./wasm/interfaces/arcjet-redact-custom-redact.js";
2
+ /**
3
+ * Initialize the WebAssembly.
4
+ *
5
+ * @param detect
6
+ * Custom detection function.
7
+ * @param replace
8
+ * Custom replacement function.
9
+ * @returns
10
+ * Promise to the initialized WebAssembly instance.
11
+ */
3
12
  export declare function initializeWasm(detect: CustomDetect, replace: CustomRedact): Promise<import("./wasm/arcjet_analyze_bindings_redact.component.js").Root | undefined>;
13
+ /**
14
+ * Detect sensitive info.
15
+ *
16
+ * @param tokens
17
+ * Tokens to detect in.
18
+ * @returns
19
+ * Array of detected entities.
20
+ */
4
21
  type CustomDetect = typeof ArcjetRedactCustomRedact.detectSensitiveInfo;
22
+ /**
23
+ * Redact sensitive info.
24
+ *
25
+ * @param entityType
26
+ * Entity to redact.
27
+ * @param plaintext
28
+ * The plaintext string to redact.
29
+ * @returns
30
+ * Redacted string.
31
+ */
5
32
  type CustomRedact = typeof ArcjetRedactCustomRedact.redactSensitiveInfo;
6
- export { type CustomDetect, type CustomRedact, type RedactedSensitiveInfoEntity, type RedactSensitiveInfoConfig, type SensitiveInfoEntity, };
33
+ export type { RedactedSensitiveInfoEntity, RedactSensitiveInfoConfig, SensitiveInfoEntity, } from "./wasm/arcjet_analyze_bindings_redact.component.js";
package/index.js CHANGED
@@ -3,6 +3,9 @@ import { wasm } from './_virtual/arcjet_analyze_bindings_redact.component.core.j
3
3
  import { wasm as wasm$1 } from './_virtual/arcjet_analyze_bindings_redact.component.core2.js';
4
4
  import { wasm as wasm$2 } from './_virtual/arcjet_analyze_bindings_redact.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();
@@ -18,6 +21,16 @@ async function moduleFromPath(path) {
18
21
  }
19
22
  throw new Error(`Unknown path: ${path}`);
20
23
  }
24
+ /**
25
+ * Initialize the WebAssembly.
26
+ *
27
+ * @param detect
28
+ * Custom detection function.
29
+ * @param replace
30
+ * Custom replacement function.
31
+ * @returns
32
+ * Promise to the initialized WebAssembly instance.
33
+ */
21
34
  async function initializeWasm(detect, replace) {
22
35
  const coreImports = {
23
36
  "arcjet:redact/custom-redact": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/redact-wasm",
3
- "version": "1.0.0-beta.9",
3
+ "version": "1.0.0",
4
4
  "description": "Arcjet sensitive information redaction detection engine",
5
5
  "keywords": [
6
6
  "arcjet",
@@ -26,7 +26,7 @@
26
26
  "url": "https://arcjet.com"
27
27
  },
28
28
  "engines": {
29
- "node": ">=18"
29
+ "node": ">=20"
30
30
  },
31
31
  "type": "module",
32
32
  "main": "./index.js",
@@ -52,18 +52,19 @@
52
52
  "build": "npm run build:jco && npm run build:rollup",
53
53
  "lint": "eslint .",
54
54
  "prepublishOnly": "npm run build",
55
- "test": "npm run build && npm run lint"
55
+ "test-api": "node --test -- test/*.test.js",
56
+ "test-coverage": "node --experimental-test-coverage --test -- test/*.test.js",
57
+ "test": "npm run build && npm run lint && npm run test-coverage"
56
58
  },
57
59
  "dependencies": {},
58
60
  "devDependencies": {
59
- "@arcjet/eslint-config": "1.0.0-beta.9",
60
- "@arcjet/rollup-config": "1.0.0-beta.9",
61
- "@arcjet/tsconfig": "1.0.0-beta.9",
61
+ "@arcjet/eslint-config": "1.0.0",
62
+ "@arcjet/rollup-config": "1.0.0",
62
63
  "@bytecodealliance/jco": "1.5.0",
63
- "@rollup/wasm-node": "4.44.2",
64
- "@types/node": "18.18.0",
65
- "eslint": "9.30.1",
66
- "typescript": "5.8.3"
64
+ "@rollup/wasm-node": "4.55.1",
65
+ "@types/node": "25.0.8",
66
+ "eslint": "9.39.2",
67
+ "typescript": "5.9.3"
67
68
  },
68
69
  "publishConfig": {
69
70
  "access": "public",