@reclaimprotocol/attestor-core 5.0.8 → 5.1.0-dev.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.
@@ -8427,22 +8427,233 @@ import {
8427
8427
  } from "esprima-next";
8428
8428
  import { JSONPath } from "jsonpath-plus";
8429
8429
  import { parse } from "parse5";
8430
- import { adapter as htmlAdapter } from "parse5-htmlparser2-tree-adapter";
8430
+
8431
+ // node_modules/parse5-htmlparser2-tree-adapter/dist/index.js
8432
+ import { html } from "parse5";
8433
+ function enquoteDoctypeId(id) {
8434
+ const quote = id.includes('"') ? "'" : '"';
8435
+ return quote + id + quote;
8436
+ }
8437
+ function serializeDoctypeContent(name, publicId, systemId) {
8438
+ let str = "!DOCTYPE ";
8439
+ if (name) {
8440
+ str += name;
8441
+ }
8442
+ if (publicId) {
8443
+ str += ` PUBLIC ${enquoteDoctypeId(publicId)}`;
8444
+ } else if (systemId) {
8445
+ str += " SYSTEM";
8446
+ }
8447
+ if (systemId) {
8448
+ str += ` ${enquoteDoctypeId(systemId)}`;
8449
+ }
8450
+ return str;
8451
+ }
8452
+ var adapter = {
8453
+ // Re-exports from domhandler
8454
+ isCommentNode: isComment,
8455
+ isElementNode: isTag2,
8456
+ isTextNode: isText,
8457
+ //Node construction
8458
+ createDocument() {
8459
+ const node = new Document([]);
8460
+ node["x-mode"] = html.DOCUMENT_MODE.NO_QUIRKS;
8461
+ return node;
8462
+ },
8463
+ createDocumentFragment() {
8464
+ return new Document([]);
8465
+ },
8466
+ createElement(tagName, namespaceURI, attrs) {
8467
+ const attribs = /* @__PURE__ */ Object.create(null);
8468
+ const attribsNamespace = /* @__PURE__ */ Object.create(null);
8469
+ const attribsPrefix = /* @__PURE__ */ Object.create(null);
8470
+ for (let i = 0; i < attrs.length; i++) {
8471
+ const attrName = attrs[i].name;
8472
+ attribs[attrName] = attrs[i].value;
8473
+ attribsNamespace[attrName] = attrs[i].namespace;
8474
+ attribsPrefix[attrName] = attrs[i].prefix;
8475
+ }
8476
+ const node = new Element(tagName, attribs, []);
8477
+ node.namespace = namespaceURI;
8478
+ node["x-attribsNamespace"] = attribsNamespace;
8479
+ node["x-attribsPrefix"] = attribsPrefix;
8480
+ return node;
8481
+ },
8482
+ createCommentNode(data) {
8483
+ return new Comment2(data);
8484
+ },
8485
+ createTextNode(value) {
8486
+ return new Text2(value);
8487
+ },
8488
+ //Tree mutation
8489
+ appendChild(parentNode, newNode) {
8490
+ const prev = parentNode.children[parentNode.children.length - 1];
8491
+ if (prev) {
8492
+ prev.next = newNode;
8493
+ newNode.prev = prev;
8494
+ }
8495
+ parentNode.children.push(newNode);
8496
+ newNode.parent = parentNode;
8497
+ },
8498
+ insertBefore(parentNode, newNode, referenceNode) {
8499
+ const insertionIdx = parentNode.children.indexOf(referenceNode);
8500
+ const { prev } = referenceNode;
8501
+ if (prev) {
8502
+ prev.next = newNode;
8503
+ newNode.prev = prev;
8504
+ }
8505
+ referenceNode.prev = newNode;
8506
+ newNode.next = referenceNode;
8507
+ parentNode.children.splice(insertionIdx, 0, newNode);
8508
+ newNode.parent = parentNode;
8509
+ },
8510
+ setTemplateContent(templateElement, contentElement) {
8511
+ adapter.appendChild(templateElement, contentElement);
8512
+ },
8513
+ getTemplateContent(templateElement) {
8514
+ return templateElement.children[0];
8515
+ },
8516
+ setDocumentType(document, name, publicId, systemId) {
8517
+ const data = serializeDoctypeContent(name, publicId, systemId);
8518
+ let doctypeNode = document.children.find((node) => isDirective(node) && node.name === "!doctype");
8519
+ if (doctypeNode) {
8520
+ doctypeNode.data = data !== null && data !== void 0 ? data : null;
8521
+ } else {
8522
+ doctypeNode = new ProcessingInstruction("!doctype", data);
8523
+ adapter.appendChild(document, doctypeNode);
8524
+ }
8525
+ doctypeNode["x-name"] = name;
8526
+ doctypeNode["x-publicId"] = publicId;
8527
+ doctypeNode["x-systemId"] = systemId;
8528
+ },
8529
+ setDocumentMode(document, mode) {
8530
+ document["x-mode"] = mode;
8531
+ },
8532
+ getDocumentMode(document) {
8533
+ return document["x-mode"];
8534
+ },
8535
+ detachNode(node) {
8536
+ if (node.parent) {
8537
+ const idx = node.parent.children.indexOf(node);
8538
+ const { prev, next } = node;
8539
+ node.prev = null;
8540
+ node.next = null;
8541
+ if (prev) {
8542
+ prev.next = next;
8543
+ }
8544
+ if (next) {
8545
+ next.prev = prev;
8546
+ }
8547
+ node.parent.children.splice(idx, 1);
8548
+ node.parent = null;
8549
+ }
8550
+ },
8551
+ insertText(parentNode, text) {
8552
+ const lastChild = parentNode.children[parentNode.children.length - 1];
8553
+ if (lastChild && isText(lastChild)) {
8554
+ lastChild.data += text;
8555
+ } else {
8556
+ adapter.appendChild(parentNode, adapter.createTextNode(text));
8557
+ }
8558
+ },
8559
+ insertTextBefore(parentNode, text, referenceNode) {
8560
+ const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
8561
+ if (prevNode && isText(prevNode)) {
8562
+ prevNode.data += text;
8563
+ } else {
8564
+ adapter.insertBefore(parentNode, adapter.createTextNode(text), referenceNode);
8565
+ }
8566
+ },
8567
+ adoptAttributes(recipient, attrs) {
8568
+ for (let i = 0; i < attrs.length; i++) {
8569
+ const attrName = attrs[i].name;
8570
+ if (recipient.attribs[attrName] === void 0) {
8571
+ recipient.attribs[attrName] = attrs[i].value;
8572
+ recipient["x-attribsNamespace"][attrName] = attrs[i].namespace;
8573
+ recipient["x-attribsPrefix"][attrName] = attrs[i].prefix;
8574
+ }
8575
+ }
8576
+ },
8577
+ //Tree traversing
8578
+ getFirstChild(node) {
8579
+ return node.children[0];
8580
+ },
8581
+ getChildNodes(node) {
8582
+ return node.children;
8583
+ },
8584
+ getParentNode(node) {
8585
+ return node.parent;
8586
+ },
8587
+ getAttrList(element) {
8588
+ return element.attributes;
8589
+ },
8590
+ //Node data
8591
+ getTagName(element) {
8592
+ return element.name;
8593
+ },
8594
+ getNamespaceURI(element) {
8595
+ return element.namespace;
8596
+ },
8597
+ getTextNodeContent(textNode) {
8598
+ return textNode.data;
8599
+ },
8600
+ getCommentNodeContent(commentNode) {
8601
+ return commentNode.data;
8602
+ },
8603
+ getDocumentTypeNodeName(doctypeNode) {
8604
+ var _a;
8605
+ return (_a = doctypeNode["x-name"]) !== null && _a !== void 0 ? _a : "";
8606
+ },
8607
+ getDocumentTypeNodePublicId(doctypeNode) {
8608
+ var _a;
8609
+ return (_a = doctypeNode["x-publicId"]) !== null && _a !== void 0 ? _a : "";
8610
+ },
8611
+ getDocumentTypeNodeSystemId(doctypeNode) {
8612
+ var _a;
8613
+ return (_a = doctypeNode["x-systemId"]) !== null && _a !== void 0 ? _a : "";
8614
+ },
8615
+ //Node types
8616
+ isDocumentTypeNode(node) {
8617
+ return isDirective(node) && node.name === "!doctype";
8618
+ },
8619
+ // Source code location
8620
+ setNodeSourceCodeLocation(node, location) {
8621
+ if (location) {
8622
+ node.startIndex = location.startOffset;
8623
+ node.endIndex = location.endOffset;
8624
+ }
8625
+ node.sourceCodeLocation = location;
8626
+ },
8627
+ getNodeSourceCodeLocation(node) {
8628
+ return node.sourceCodeLocation;
8629
+ },
8630
+ updateNodeSourceCodeLocation(node, endLocation) {
8631
+ if (endLocation.endOffset != null)
8632
+ node.endIndex = endLocation.endOffset;
8633
+ node.sourceCodeLocation = {
8634
+ ...node.sourceCodeLocation,
8635
+ ...endLocation
8636
+ };
8637
+ }
8638
+ };
8639
+
8640
+ // src/providers/http/utils.ts
8641
+ import RE2 from "re2";
8431
8642
  import xpath from "xpath";
8432
- function extractHTMLElement(html, xpathExpression, contentsOnly) {
8433
- const { start, end } = extractHTMLElementIndex(html, xpathExpression, contentsOnly);
8434
- return html.slice(start, end);
8643
+ function extractHTMLElement(html2, xpathExpression, contentsOnly) {
8644
+ const { start, end } = extractHTMLElementIndex(html2, xpathExpression, contentsOnly);
8645
+ return html2.slice(start, end);
8435
8646
  }
8436
- function extractHTMLElementIndex(html, xpathExpression, contentsOnly) {
8437
- return extractHTMLElementsIndexes(html, xpathExpression, contentsOnly)[0];
8647
+ function extractHTMLElementIndex(html2, xpathExpression, contentsOnly) {
8648
+ return extractHTMLElementsIndexes(html2, xpathExpression, contentsOnly)[0];
8438
8649
  }
8439
- function extractHTMLElementsIndexes(html, xpathExpression, contentsOnly) {
8440
- return extractHTMLElementIndexesParse5(html, xpathExpression, contentsOnly);
8650
+ function extractHTMLElementsIndexes(html2, xpathExpression, contentsOnly) {
8651
+ return extractHTMLElementIndexesParse5(html2, xpathExpression, contentsOnly);
8441
8652
  }
8442
- function extractHTMLElementIndexesParse5(html, xpathExpression, contentsOnly) {
8653
+ function extractHTMLElementIndexesParse5(html2, xpathExpression, contentsOnly) {
8443
8654
  const domLight = parse(
8444
- html,
8445
- { treeAdapter: htmlAdapter, sourceCodeLocationInfo: true }
8655
+ html2,
8656
+ { treeAdapter: adapter, sourceCodeLocationInfo: true }
8446
8657
  );
8447
8658
  domLight["name"] = "root";
8448
8659
  const parsedPath = xpath.parse(xpathExpression);
@@ -8594,16 +8805,8 @@ function parseHttpResponse(buff) {
8594
8805
  parser.streamEnded();
8595
8806
  return parser.res;
8596
8807
  }
8597
- var RE2;
8598
- import("re2").then((m) => {
8599
- RE2 = m.default;
8600
- }).catch(() => {
8601
- });
8602
8808
  function makeRegex(str) {
8603
- if (RE2) {
8604
- return RE2(str, "sgiu");
8605
- }
8606
- return new RegExp(str, "sgiu");
8809
+ return RE2(str, "sgiu");
8607
8810
  }
8608
8811
  var TEMPLATE_START_CHARCODE = "{".charCodeAt(0);
8609
8812
  var TEMPLATE_END_CHARCODE = "}".charCodeAt(0);
package/lib/index.js CHANGED
@@ -6736,15 +6736,241 @@ import {
6736
6736
  } from "esprima-next";
6737
6737
  import { JSONPath } from "jsonpath-plus";
6738
6738
  import { parse } from "parse5";
6739
- import { adapter as htmlAdapter } from "parse5-htmlparser2-tree-adapter";
6739
+
6740
+ // node_modules/parse5-htmlparser2-tree-adapter/dist/index.js
6741
+ import { html } from "parse5";
6742
+ function enquoteDoctypeId(id) {
6743
+ const quote = id.includes('"') ? "'" : '"';
6744
+ return quote + id + quote;
6745
+ }
6746
+ function serializeDoctypeContent(name, publicId, systemId) {
6747
+ let str = "!DOCTYPE ";
6748
+ if (name) {
6749
+ str += name;
6750
+ }
6751
+ if (publicId) {
6752
+ str += ` PUBLIC ${enquoteDoctypeId(publicId)}`;
6753
+ } else if (systemId) {
6754
+ str += " SYSTEM";
6755
+ }
6756
+ if (systemId) {
6757
+ str += ` ${enquoteDoctypeId(systemId)}`;
6758
+ }
6759
+ return str;
6760
+ }
6761
+ var adapter = {
6762
+ // Re-exports from domhandler
6763
+ isCommentNode: isComment,
6764
+ isElementNode: isTag2,
6765
+ isTextNode: isText,
6766
+ //Node construction
6767
+ createDocument() {
6768
+ const node = new Document([]);
6769
+ node["x-mode"] = html.DOCUMENT_MODE.NO_QUIRKS;
6770
+ return node;
6771
+ },
6772
+ createDocumentFragment() {
6773
+ return new Document([]);
6774
+ },
6775
+ createElement(tagName, namespaceURI, attrs) {
6776
+ const attribs = /* @__PURE__ */ Object.create(null);
6777
+ const attribsNamespace = /* @__PURE__ */ Object.create(null);
6778
+ const attribsPrefix = /* @__PURE__ */ Object.create(null);
6779
+ for (let i = 0; i < attrs.length; i++) {
6780
+ const attrName = attrs[i].name;
6781
+ attribs[attrName] = attrs[i].value;
6782
+ attribsNamespace[attrName] = attrs[i].namespace;
6783
+ attribsPrefix[attrName] = attrs[i].prefix;
6784
+ }
6785
+ const node = new Element(tagName, attribs, []);
6786
+ node.namespace = namespaceURI;
6787
+ node["x-attribsNamespace"] = attribsNamespace;
6788
+ node["x-attribsPrefix"] = attribsPrefix;
6789
+ return node;
6790
+ },
6791
+ createCommentNode(data) {
6792
+ return new Comment2(data);
6793
+ },
6794
+ createTextNode(value) {
6795
+ return new Text2(value);
6796
+ },
6797
+ //Tree mutation
6798
+ appendChild(parentNode, newNode) {
6799
+ const prev = parentNode.children[parentNode.children.length - 1];
6800
+ if (prev) {
6801
+ prev.next = newNode;
6802
+ newNode.prev = prev;
6803
+ }
6804
+ parentNode.children.push(newNode);
6805
+ newNode.parent = parentNode;
6806
+ },
6807
+ insertBefore(parentNode, newNode, referenceNode) {
6808
+ const insertionIdx = parentNode.children.indexOf(referenceNode);
6809
+ const { prev } = referenceNode;
6810
+ if (prev) {
6811
+ prev.next = newNode;
6812
+ newNode.prev = prev;
6813
+ }
6814
+ referenceNode.prev = newNode;
6815
+ newNode.next = referenceNode;
6816
+ parentNode.children.splice(insertionIdx, 0, newNode);
6817
+ newNode.parent = parentNode;
6818
+ },
6819
+ setTemplateContent(templateElement, contentElement) {
6820
+ adapter.appendChild(templateElement, contentElement);
6821
+ },
6822
+ getTemplateContent(templateElement) {
6823
+ return templateElement.children[0];
6824
+ },
6825
+ setDocumentType(document, name, publicId, systemId) {
6826
+ const data = serializeDoctypeContent(name, publicId, systemId);
6827
+ let doctypeNode = document.children.find((node) => isDirective(node) && node.name === "!doctype");
6828
+ if (doctypeNode) {
6829
+ doctypeNode.data = data !== null && data !== void 0 ? data : null;
6830
+ } else {
6831
+ doctypeNode = new ProcessingInstruction("!doctype", data);
6832
+ adapter.appendChild(document, doctypeNode);
6833
+ }
6834
+ doctypeNode["x-name"] = name;
6835
+ doctypeNode["x-publicId"] = publicId;
6836
+ doctypeNode["x-systemId"] = systemId;
6837
+ },
6838
+ setDocumentMode(document, mode) {
6839
+ document["x-mode"] = mode;
6840
+ },
6841
+ getDocumentMode(document) {
6842
+ return document["x-mode"];
6843
+ },
6844
+ detachNode(node) {
6845
+ if (node.parent) {
6846
+ const idx = node.parent.children.indexOf(node);
6847
+ const { prev, next } = node;
6848
+ node.prev = null;
6849
+ node.next = null;
6850
+ if (prev) {
6851
+ prev.next = next;
6852
+ }
6853
+ if (next) {
6854
+ next.prev = prev;
6855
+ }
6856
+ node.parent.children.splice(idx, 1);
6857
+ node.parent = null;
6858
+ }
6859
+ },
6860
+ insertText(parentNode, text) {
6861
+ const lastChild = parentNode.children[parentNode.children.length - 1];
6862
+ if (lastChild && isText(lastChild)) {
6863
+ lastChild.data += text;
6864
+ } else {
6865
+ adapter.appendChild(parentNode, adapter.createTextNode(text));
6866
+ }
6867
+ },
6868
+ insertTextBefore(parentNode, text, referenceNode) {
6869
+ const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
6870
+ if (prevNode && isText(prevNode)) {
6871
+ prevNode.data += text;
6872
+ } else {
6873
+ adapter.insertBefore(parentNode, adapter.createTextNode(text), referenceNode);
6874
+ }
6875
+ },
6876
+ adoptAttributes(recipient, attrs) {
6877
+ for (let i = 0; i < attrs.length; i++) {
6878
+ const attrName = attrs[i].name;
6879
+ if (recipient.attribs[attrName] === void 0) {
6880
+ recipient.attribs[attrName] = attrs[i].value;
6881
+ recipient["x-attribsNamespace"][attrName] = attrs[i].namespace;
6882
+ recipient["x-attribsPrefix"][attrName] = attrs[i].prefix;
6883
+ }
6884
+ }
6885
+ },
6886
+ //Tree traversing
6887
+ getFirstChild(node) {
6888
+ return node.children[0];
6889
+ },
6890
+ getChildNodes(node) {
6891
+ return node.children;
6892
+ },
6893
+ getParentNode(node) {
6894
+ return node.parent;
6895
+ },
6896
+ getAttrList(element) {
6897
+ return element.attributes;
6898
+ },
6899
+ //Node data
6900
+ getTagName(element) {
6901
+ return element.name;
6902
+ },
6903
+ getNamespaceURI(element) {
6904
+ return element.namespace;
6905
+ },
6906
+ getTextNodeContent(textNode) {
6907
+ return textNode.data;
6908
+ },
6909
+ getCommentNodeContent(commentNode) {
6910
+ return commentNode.data;
6911
+ },
6912
+ getDocumentTypeNodeName(doctypeNode) {
6913
+ var _a;
6914
+ return (_a = doctypeNode["x-name"]) !== null && _a !== void 0 ? _a : "";
6915
+ },
6916
+ getDocumentTypeNodePublicId(doctypeNode) {
6917
+ var _a;
6918
+ return (_a = doctypeNode["x-publicId"]) !== null && _a !== void 0 ? _a : "";
6919
+ },
6920
+ getDocumentTypeNodeSystemId(doctypeNode) {
6921
+ var _a;
6922
+ return (_a = doctypeNode["x-systemId"]) !== null && _a !== void 0 ? _a : "";
6923
+ },
6924
+ //Node types
6925
+ isDocumentTypeNode(node) {
6926
+ return isDirective(node) && node.name === "!doctype";
6927
+ },
6928
+ // Source code location
6929
+ setNodeSourceCodeLocation(node, location) {
6930
+ if (location) {
6931
+ node.startIndex = location.startOffset;
6932
+ node.endIndex = location.endOffset;
6933
+ }
6934
+ node.sourceCodeLocation = location;
6935
+ },
6936
+ getNodeSourceCodeLocation(node) {
6937
+ return node.sourceCodeLocation;
6938
+ },
6939
+ updateNodeSourceCodeLocation(node, endLocation) {
6940
+ if (endLocation.endOffset != null)
6941
+ node.endIndex = endLocation.endOffset;
6942
+ node.sourceCodeLocation = {
6943
+ ...node.sourceCodeLocation,
6944
+ ...endLocation
6945
+ };
6946
+ }
6947
+ };
6948
+
6949
+ // src/providers/http/utils.ts
6950
+ import RE2 from "re2";
6740
6951
  import xpath from "xpath";
6741
- function extractHTMLElementsIndexes(html, xpathExpression, contentsOnly) {
6742
- return extractHTMLElementIndexesParse5(html, xpathExpression, contentsOnly);
6952
+ function extractHTMLElement(html2, xpathExpression, contentsOnly) {
6953
+ const { start, end } = extractHTMLElementIndex(html2, xpathExpression, contentsOnly);
6954
+ return html2.slice(start, end);
6955
+ }
6956
+ function extractHTMLElements(html2, xpathExpression, contentsOnly) {
6957
+ const indexes = extractHTMLElementsIndexes(html2, xpathExpression, contentsOnly);
6958
+ const res = [];
6959
+ for (const { start, end } of indexes) {
6960
+ res.push(html2.slice(start, end));
6961
+ }
6962
+ return res;
6963
+ }
6964
+ function extractHTMLElementIndex(html2, xpathExpression, contentsOnly) {
6965
+ return extractHTMLElementsIndexes(html2, xpathExpression, contentsOnly)[0];
6966
+ }
6967
+ function extractHTMLElementsIndexes(html2, xpathExpression, contentsOnly) {
6968
+ return extractHTMLElementIndexesParse5(html2, xpathExpression, contentsOnly);
6743
6969
  }
6744
- function extractHTMLElementIndexesParse5(html, xpathExpression, contentsOnly) {
6970
+ function extractHTMLElementIndexesParse5(html2, xpathExpression, contentsOnly) {
6745
6971
  const domLight = parse(
6746
- html,
6747
- { treeAdapter: htmlAdapter, sourceCodeLocationInfo: true }
6972
+ html2,
6973
+ { treeAdapter: adapter, sourceCodeLocationInfo: true }
6748
6974
  );
6749
6975
  domLight["name"] = "root";
6750
6976
  const parsedPath = xpath.parse(xpathExpression);
@@ -6769,6 +6995,9 @@ function getNodeRange(node, contentsOnly) {
6769
6995
  end: node.lastChild.endIndex
6770
6996
  };
6771
6997
  }
6998
+ function extractJSONValueIndex(json, jsonPath) {
6999
+ return extractJSONValueIndexes(json, jsonPath)[0];
7000
+ }
6772
7001
  function extractJSONValueIndexes(json, jsonPath) {
6773
7002
  const pointers = JSONPath({
6774
7003
  path: jsonPath,
@@ -6893,16 +7122,8 @@ function parseHttpResponse(buff) {
6893
7122
  parser.streamEnded();
6894
7123
  return parser.res;
6895
7124
  }
6896
- var RE2;
6897
- import("re2").then((m) => {
6898
- RE2 = m.default;
6899
- }).catch(() => {
6900
- });
6901
7125
  function makeRegex(str) {
6902
- if (RE2) {
6903
- return RE2(str, "sgiu");
6904
- }
6905
- return new RegExp(str, "sgiu");
7126
+ return RE2(str, "sgiu");
6906
7127
  }
6907
7128
  var TEMPLATE_START_CHARCODE = "{".charCodeAt(0);
6908
7129
  var TEMPLATE_END_CHARCODE = "}".charCodeAt(0);
@@ -8394,7 +8615,13 @@ export {
8394
8615
  ethersStructToPlainObject,
8395
8616
  extractApplicationDataFromTranscript,
8396
8617
  extractArrayBufferFromWsData,
8618
+ extractHTMLElement,
8619
+ extractHTMLElementIndex,
8620
+ extractHTMLElements,
8621
+ extractHTMLElementsIndexes,
8397
8622
  extractHandshakeFromTranscript,
8623
+ extractJSONValueIndex,
8624
+ extractJSONValueIndexes,
8398
8625
  extractRequestBufferFromTranscript,
8399
8626
  findIndexInUint8Array,
8400
8627
  generateRpcMessageId,
@@ -1,4 +1,5 @@
1
1
  import '../../providers/http/patch-parse5-tree.ts';
2
+ import RE2 from 're2';
2
3
  import type { ArraySlice, CompleteTLSPacket, ProviderParams, Transcript } from '../../types/index.ts';
3
4
  import type { HttpRequest, HttpResponse } from '../../utils/index.ts';
4
5
  export type JSONIndex = {
@@ -63,7 +64,7 @@ export declare function convertResponsePosToAbsolutePos(pos: number, bodyStartId
63
64
  */
64
65
  export declare function getRedactionsForChunkHeaders(from: number, to: number, chunks?: ArraySlice[]): ArraySlice[];
65
66
  export declare function parseHttpResponse(buff: Uint8Array): HttpResponse;
66
- export declare function makeRegex(str: string): RegExp;
67
+ export declare function makeRegex(str: string): RE2;
67
68
  /**
68
69
  * Try to match strings that contain templates like {{param}}
69
70
  * against redacted string that has *** instead of that param
@@ -1,4 +1,5 @@
1
1
  import type { Provider, ProviderName } from '../types/index.ts';
2
+ export { extractHTMLElement, extractHTMLElementIndex, extractHTMLElements, extractHTMLElementsIndexes, extractJSONValueIndex, extractJSONValueIndexes, } from '../providers/http/utils.ts';
2
3
  export declare const providers: {
3
4
  [T in ProviderName]: Provider<T>;
4
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reclaimprotocol/attestor-core",
3
- "version": "5.0.8",
3
+ "version": "5.1.0-dev.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "imports": {
@@ -105,14 +105,12 @@
105
105
  "parse5": "^8.0.0",
106
106
  "parse5-htmlparser2-tree-adapter": "^8.0.0",
107
107
  "pino": "^9.14.0",
108
+ "re2": "^1.24.0",
108
109
  "serve-static": "^1.16.3",
109
110
  "snarkjs": "^0.7.6",
110
111
  "ws": "^8.20.0",
111
112
  "xpath": "^0.0.34"
112
113
  },
113
- "optionalDependencies": {
114
- "re2": "*"
115
- },
116
114
  "devDependencies": {
117
115
  "@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
118
116
  "@commitlint/cli": "^17.8.1",
@@ -136,7 +134,6 @@
136
134
  "tsc-alias": "^1.8.17",
137
135
  "typechain": "^8.3.2",
138
136
  "typescript": "^5.9.3",
139
- "re2": "^1.24.0",
140
137
  "whatwg-url": "^14.2.0",
141
138
  "yaml": "^2.8.3"
142
139
  },