@xyo-network/sdk-protocol 7.2.2 → 7.2.4

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  (() => {
3
- // ../../node_modules/.pnpm/@ariestools+threads@8.1.2_@opentelemetry+api@1.9.1_observable-fns@0.6.1_zod@4.4.3/node_modules/@ariestools/threads/dist/browser/worker/worker.browser.mjs
3
+ // ../../node_modules/.pnpm/@ariestools+threads@8.1.9_@opentelemetry+api@1.9.1_observable-fns@0.6.1_supports-color@7.2.0_zod@4.4.3/node_modules/@ariestools/threads/dist/browser/worker/worker.browser.mjs
4
4
  var DefaultErrorSerializer = {
5
5
  deserialize: (message) => {
6
6
  const error = Object.create(Error.prototype);
@@ -1372,7 +1372,7 @@
1372
1372
  }
1373
1373
  };
1374
1374
 
1375
- // ../../node_modules/.pnpm/@ariestools+sdk@8.1.2_@opentelemetry+api@1.9.1_zod@4.4.3/node_modules/@ariestools/sdk/dist/browser/index.mjs
1375
+ // ../../node_modules/.pnpm/@ariestools+sdk@8.1.9_@opentelemetry+api@1.9.1_zod@4.4.3/node_modules/@ariestools/sdk/dist/browser/index.mjs
1376
1376
  var __defProp = Object.defineProperty;
1377
1377
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1378
1378
  var __decorateClass = (decorators, target, key, kind) => {
@@ -1500,6 +1500,9 @@
1500
1500
  cause: error
1501
1501
  });
1502
1502
  }
1503
+ function fetchDefault(input, init) {
1504
+ return globalThis.fetch(input, init);
1505
+ }
1503
1506
  async function gzipString(body) {
1504
1507
  const blob = new Blob([body]);
1505
1508
  const stream = blob.stream().pipeThrough(new CompressionStream("gzip"));
@@ -1507,21 +1510,25 @@
1507
1510
  return response.arrayBuffer();
1508
1511
  }
1509
1512
  async function fetchCompress(url, options = {}) {
1510
- const { compressMinLength = 1024, ...init } = options;
1513
+ const {
1514
+ compressMinLength = 1024,
1515
+ fetcher = fetchDefault,
1516
+ ...init
1517
+ } = options;
1511
1518
  try {
1512
1519
  if (init.body !== void 0 && init.body !== null) {
1513
1520
  const bodyStr = typeof init.body === "string" ? init.body : JSON.stringify(init.body);
1514
1521
  if (bodyStr.length > compressMinLength) {
1515
1522
  const headers = new Headers(init.headers);
1516
1523
  headers.set("Content-Encoding", "gzip");
1517
- return await fetch(url, {
1524
+ return await fetcher(url, {
1518
1525
  ...init,
1519
1526
  body: await gzipString(bodyStr),
1520
1527
  headers
1521
1528
  });
1522
1529
  }
1523
1530
  }
1524
- return await fetch(url, init);
1531
+ return await fetcher(url, init);
1525
1532
  } catch (error) {
1526
1533
  throw toFetchError(error, { url: url.toString(), method: init.method });
1527
1534
  }
@@ -1660,17 +1667,29 @@
1660
1667
  async request(config2) {
1661
1668
  const merged = { ...this.defaults, ...config2 };
1662
1669
  const url = buildURL(merged);
1670
+ const {
1671
+ baseURL: _baseURL,
1672
+ data: requestData,
1673
+ headers,
1674
+ method = "GET",
1675
+ params: _params,
1676
+ signal,
1677
+ timeout,
1678
+ url: _url2,
1679
+ validateStatus: validateStatusOption,
1680
+ ...requestInit
1681
+ } = merged;
1663
1682
  const init = {
1664
- method: merged.method ?? "GET",
1665
- headers: buildHeaders(merged.headers, merged.data !== void 0),
1666
- compressMinLength: merged.compressMinLength,
1667
- signal: merged.timeout !== void 0 && merged.timeout !== 0 ? AbortSignal.timeout(merged.timeout) : merged.signal
1683
+ ...requestInit,
1684
+ method,
1685
+ headers: buildHeaders(headers, requestData !== void 0),
1686
+ signal: timeout !== void 0 && timeout !== 0 ? AbortSignal.timeout(timeout) : signal
1668
1687
  };
1669
- if (merged.data !== void 0) {
1670
- init.body = JSON.stringify(merged.data);
1688
+ if (requestData !== void 0) {
1689
+ init.body = JSON.stringify(requestData);
1671
1690
  }
1672
1691
  const response = await fetchCompress(url, init);
1673
- const data = response.ok ? await parseJsonResponse(response, { url, method: merged.method }) : await tryParseJson(response);
1692
+ const data = response.ok ? await parseJsonResponse(response, { url, method }) : await tryParseJson(response);
1674
1693
  const result = {
1675
1694
  data,
1676
1695
  headers: response.headers,
@@ -1678,12 +1697,16 @@
1678
1697
  status: response.status,
1679
1698
  statusText: response.statusText
1680
1699
  };
1681
- const validateStatus = merged.validateStatus === void 0 ? (s) => s >= 200 && s < 300 : merged.validateStatus;
1700
+ const validateStatus = validateStatusOption === void 0 ? (s) => s >= 200 && s < 300 : validateStatusOption;
1682
1701
  if (validateStatus && !validateStatus(response.status)) {
1683
1702
  throw new FetchClientError(
1684
1703
  `Request failed with status ${response.status} ${response.statusText}`,
1685
1704
  result,
1686
- { ...merged, url }
1705
+ {
1706
+ ...merged,
1707
+ method,
1708
+ url
1709
+ }
1687
1710
  );
1688
1711
  }
1689
1712
  return result;
@@ -1763,7 +1786,7 @@
1763
1786
  var assertError = (value, assert, defaultMessage) => {
1764
1787
  if (!isUndefined(assert)) {
1765
1788
  const assertString = typeof assert === "string" ? assert : typeof assert === "boolean" ? defaultMessage : assert(value, defaultMessage);
1766
- if (isString(assertString) || assertString) {
1789
+ if (assertString === true || isString(assertString)) {
1767
1790
  throw new Error(assertString === true ? defaultMessage : assertString);
1768
1791
  }
1769
1792
  }
@@ -2063,6 +2086,14 @@
2063
2086
  _Base.globalInstances[baseClassName] = instanceArray;
2064
2087
  }
2065
2088
  };
2089
+ var LogLevel = Enum({
2090
+ error: 1,
2091
+ warn: 2,
2092
+ info: 3,
2093
+ log: 4,
2094
+ debug: 5,
2095
+ trace: 6
2096
+ });
2066
2097
  var defaultForgetConfig = { timeout: 3e4 };
2067
2098
  var defaultForgetNodeConfig = {
2068
2099
  ...defaultForgetConfig,
@@ -2725,12 +2756,12 @@
2725
2756
  return this.creatable.create(mergedParams);
2726
2757
  }
2727
2758
  };
2728
- function getFunctionName(depth = 2) {
2759
+ function getFunctionName2(depth = 2) {
2729
2760
  const error = new Error("Stack");
2730
2761
  let newIndex;
2731
2762
  const stackParts = error.stack?.split("\n")[depth]?.split(" ");
2732
2763
  const funcName = stackParts?.find((item, index) => {
2733
- if (item.length === 0 || item === "at") {
2764
+ if (item === "at" || item.length === 0) {
2734
2765
  return;
2735
2766
  }
2736
2767
  if (item === "new") {
@@ -2968,7 +2999,7 @@
2968
2999
  * Asserts that the given function has not been overridden in a subclass.
2969
3000
  * Used to enforce the handler pattern (override `startHandler` not `start`).
2970
3001
  */
2971
- _noOverride(functionName2 = getFunctionName(3)) {
3002
+ _noOverride(functionName2 = getFunctionName2(3)) {
2972
3003
  const thisFunc = this[functionName2];
2973
3004
  const rootFunc = getRootFunction(this, functionName2);
2974
3005
  assertEx(thisFunc === rootFunc, () => `Override not allowed for [${functionName2}] - override ${functionName2}Handler instead`);
@@ -3015,14 +3046,6 @@
3015
3046
  ], AbstractCreatableWithFactory);
3016
3047
  var d2r = Math.PI / 180;
3017
3048
  var r2d = 180 / Math.PI;
3018
- var LogLevel = Enum({
3019
- error: 1,
3020
- warn: 2,
3021
- info: 3,
3022
- log: 4,
3023
- debug: 5,
3024
- trace: 6
3025
- });
3026
3049
  var AsTypeFactory = {
3027
3050
  create: (typeCheck) => {
3028
3051
  const func = (value, assertOrConfig, config2) => {
@@ -3197,7 +3220,7 @@
3197
3220
  var toJsonObject = zodToFactory(JsonObjectZod, "toJsonObject");
3198
3221
  var subtle = globalThis.crypto?.subtle;
3199
3222
 
3200
- // ../../node_modules/.pnpm/@ariestools+threads@8.1.2_@opentelemetry+api@1.9.1_observable-fns@0.6.1_zod@4.4.3/node_modules/@ariestools/threads/dist/browser/worker/worker.browser.mjs
3223
+ // ../../node_modules/.pnpm/@ariestools+threads@8.1.9_@opentelemetry+api@1.9.1_observable-fns@0.6.1_supports-color@7.2.0_zod@4.4.3/node_modules/@ariestools/threads/dist/browser/worker/worker.browser.mjs
3201
3224
  var DefaultErrorSerializer = {
3202
3225
  deserialize: (message) => {
3203
3226
  const error = Object.create(Error.prototype);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/sdk-protocol",
3
- "version": "7.2.2",
3
+ "version": "7.2.4",
4
4
  "description": "Foundation SDK facade for XYO Protocol 2.0 (re-exports @xyo-network/sdk-protocol-core)",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -363,15 +363,15 @@
363
363
  "README.md"
364
364
  ],
365
365
  "dependencies": {
366
- "@xyo-network/sdk-protocol-core": "~7.2.2"
366
+ "@xyo-network/sdk-protocol-core": "~7.2.4"
367
367
  },
368
368
  "devDependencies": {
369
- "@ariestools/sdk": "~8.1.2",
370
- "@ariestools/toolchain": "~8.7.18",
371
- "@ariestools/tsconfig": "~8.7.18",
369
+ "@ariestools/sdk": "~8.1.9",
370
+ "@ariestools/toolchain": "~9.0.2",
371
+ "@ariestools/tsconfig": "~9.0.2",
372
372
  "@opentelemetry/api": "~1.9.1",
373
373
  "ajv": "~8.20.0",
374
- "eslint": "~10.7.0",
374
+ "eslint": "~10.8.1",
375
375
  "eslint-import-resolver-typescript": "~4.4.5",
376
376
  "ethers": "~6.17.0",
377
377
  "typescript": "~6.0.3",