@reclaimprotocol/attestor-core 5.1.0-dev.1 → 5.1.1

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.
@@ -8638,7 +8638,6 @@ var adapter = {
8638
8638
  };
8639
8639
 
8640
8640
  // src/providers/http/utils.ts
8641
- import RE2 from "re2";
8642
8641
  import xpath from "xpath";
8643
8642
  function extractHTMLElement(html2, xpathExpression, contentsOnly) {
8644
8643
  const { start, end } = extractHTMLElementIndex(html2, xpathExpression, contentsOnly);
@@ -8805,8 +8804,16 @@ function parseHttpResponse(buff) {
8805
8804
  parser.streamEnded();
8806
8805
  return parser.res;
8807
8806
  }
8807
+ var RE2;
8808
+ import("re2").then((m) => {
8809
+ RE2 = m.default;
8810
+ }).catch(() => {
8811
+ });
8808
8812
  function makeRegex(str) {
8809
- return RE2(str, "sgiu");
8813
+ if (RE2) {
8814
+ return RE2(str, "sgiu");
8815
+ }
8816
+ return new RegExp(str, "sgiu");
8810
8817
  }
8811
8818
  var TEMPLATE_START_CHARCODE = "{".charCodeAt(0);
8812
8819
  var TEMPLATE_END_CHARCODE = "}".charCodeAt(0);
package/lib/index.js CHANGED
@@ -6947,7 +6947,6 @@ var adapter = {
6947
6947
  };
6948
6948
 
6949
6949
  // src/providers/http/utils.ts
6950
- import RE2 from "re2";
6951
6950
  import xpath from "xpath";
6952
6951
  function extractHTMLElement(html2, xpathExpression, contentsOnly) {
6953
6952
  const { start, end } = extractHTMLElementIndex(html2, xpathExpression, contentsOnly);
@@ -7122,8 +7121,16 @@ function parseHttpResponse(buff) {
7122
7121
  parser.streamEnded();
7123
7122
  return parser.res;
7124
7123
  }
7124
+ var RE2;
7125
+ import("re2").then((m) => {
7126
+ RE2 = m.default;
7127
+ }).catch(() => {
7128
+ });
7125
7129
  function makeRegex(str) {
7126
- return RE2(str, "sgiu");
7130
+ if (RE2) {
7131
+ return RE2(str, "sgiu");
7132
+ }
7133
+ return new RegExp(str, "sgiu");
7127
7134
  }
7128
7135
  var TEMPLATE_START_CHARCODE = "{".charCodeAt(0);
7129
7136
  var TEMPLATE_END_CHARCODE = "}".charCodeAt(0);
@@ -1,5 +1,4 @@
1
1
  import '../../providers/http/patch-parse5-tree.ts';
2
- import RE2 from 're2';
3
2
  import type { ArraySlice, CompleteTLSPacket, ProviderParams, Transcript } from '../../types/index.ts';
4
3
  import type { HttpRequest, HttpResponse } from '../../utils/index.ts';
5
4
  export type JSONIndex = {
@@ -64,7 +63,7 @@ export declare function convertResponsePosToAbsolutePos(pos: number, bodyStartId
64
63
  */
65
64
  export declare function getRedactionsForChunkHeaders(from: number, to: number, chunks?: ArraySlice[]): ArraySlice[];
66
65
  export declare function parseHttpResponse(buff: Uint8Array): HttpResponse;
67
- export declare function makeRegex(str: string): RE2;
66
+ export declare function makeRegex(str: string): RegExp;
68
67
  /**
69
68
  * Try to match strings that contain templates like {{param}}
70
69
  * against redacted string that has *** instead of that param
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/attestor-core",
3
- "version": "5.1.0-dev.1",
3
+ "version": "5.1.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {
7
7
  "#src/*.ts": "./src/*.ts",
8
8
  "#src/*.js": "./lib/*.js"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/reclaimprotocol/attestor-core"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
10
17
  "exports": {
11
18
  ".": {
12
19
  "types": "./lib/index.d.ts",
@@ -23,6 +30,7 @@
23
30
  "scripts": {
24
31
  "build": "tsc -p tsconfig.build.json && tsc-alias && npm run run:tsc -- src/scripts/build-lib.ts",
25
32
  "build:browser": "sh ./src/scripts/build-browser.sh",
33
+ "prepack": "npm run download:zk-files && npm run build:browser",
26
34
  "run:tsc": "node --experimental-strip-types",
27
35
  "start": "npm run run:tsc -- src/scripts/start-server.ts",
28
36
  "prepare": "npm run build",
@@ -47,8 +55,7 @@
47
55
  "start:chain": "bash ./avs/utils/anvil/start-anvil-chain-with-el-and-avs-deployed.sh",
48
56
  "commitlint": "commitlint --edit",
49
57
  "download:zk-files": "node node_modules/@reclaimprotocol/zk-symmetric-crypto/lib/scripts/download-files",
50
- "generate:toprf-keys": "npm run run:tsc -- src/scripts/generate-toprf-keys.ts",
51
- "publish:pkg": "npm publish --access public"
58
+ "generate:toprf-keys": "npm run run:tsc -- src/scripts/generate-toprf-keys.ts"
52
59
  },
53
60
  "files": [
54
61
  "lib/*",
@@ -105,12 +112,14 @@
105
112
  "parse5": "^8.0.0",
106
113
  "parse5-htmlparser2-tree-adapter": "^8.0.0",
107
114
  "pino": "^9.14.0",
108
- "re2": "^1.24.0",
109
115
  "serve-static": "^1.16.3",
110
116
  "snarkjs": "^0.7.6",
111
117
  "ws": "^8.20.0",
112
118
  "xpath": "^0.0.34"
113
119
  },
120
+ "optionalDependencies": {
121
+ "re2": "*"
122
+ },
114
123
  "devDependencies": {
115
124
  "@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
116
125
  "@commitlint/cli": "^17.8.1",
@@ -134,6 +143,7 @@
134
143
  "tsc-alias": "^1.8.17",
135
144
  "typechain": "^8.3.2",
136
145
  "typescript": "^5.9.3",
146
+ "re2": "^1.24.0",
137
147
  "whatwg-url": "^14.2.0",
138
148
  "yaml": "^2.8.3"
139
149
  },