wapi-client 0.12.0-beta.3 → 0.12.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.
Files changed (75) hide show
  1. package/dist/api/ws-client.cjs +1 -1
  2. package/dist/api/ws-client.js +1 -1
  3. package/dist/client.cjs +1 -1
  4. package/dist/client.js +1 -1
  5. package/dist/db/consts.browser.cjs +0 -2
  6. package/dist/db/consts.browser.js +0 -2
  7. package/dist/db/consts.cjs +0 -2
  8. package/dist/db/consts.d.ts +1 -1
  9. package/dist/db/consts.js +0 -2
  10. package/dist/fns/consts.enums.d.ts +1 -2
  11. package/dist/fns/export-tokens/export-tokens.browser.cjs +23 -1
  12. package/dist/fns/export-tokens/export-tokens.browser.js +27 -2
  13. package/dist/fns/export-tokens/export-tokens.cjs +23 -1
  14. package/dist/fns/export-tokens/export-tokens.js +27 -2
  15. package/dist/fns/export-transfer-groups/export-transfer-groups.browser.cjs +24 -2
  16. package/dist/fns/export-transfer-groups/export-transfer-groups.browser.js +28 -3
  17. package/dist/fns/export-transfer-groups/export-transfer-groups.cjs +24 -2
  18. package/dist/fns/export-transfer-groups/export-transfer-groups.js +28 -3
  19. package/dist/fns/export-transfers/export-transfers.browser.cjs +23 -2
  20. package/dist/fns/export-transfers/export-transfers.browser.js +27 -3
  21. package/dist/fns/export-transfers/export-transfers.cjs +23 -2
  22. package/dist/fns/export-transfers/export-transfers.js +27 -3
  23. package/dist/fns/export-wallets/export-wallets.browser.cjs +7 -15
  24. package/dist/fns/export-wallets/export-wallets.browser.js +8 -17
  25. package/dist/fns/export-wallets/export-wallets.cjs +7 -15
  26. package/dist/fns/export-wallets/export-wallets.js +8 -17
  27. package/dist/fns/find-balances/find-balances.browser.cjs +23 -1
  28. package/dist/fns/find-balances/find-balances.browser.js +27 -2
  29. package/dist/fns/find-balances/find-balances.cjs +23 -1
  30. package/dist/fns/find-balances/find-balances.js +27 -2
  31. package/dist/fns/find-tokens/find-tokens.browser.cjs +23 -1
  32. package/dist/fns/find-tokens/find-tokens.browser.js +27 -2
  33. package/dist/fns/find-tokens/find-tokens.cjs +23 -1
  34. package/dist/fns/find-tokens/find-tokens.js +27 -2
  35. package/dist/fns/find-transfer-groups/find-transfer-groups.browser.cjs +23 -1
  36. package/dist/fns/find-transfer-groups/find-transfer-groups.browser.js +27 -2
  37. package/dist/fns/find-transfer-groups/find-transfer-groups.cjs +23 -1
  38. package/dist/fns/find-transfer-groups/find-transfer-groups.js +27 -2
  39. package/dist/fns/find-transfers/find-transfers.browser.cjs +18 -28
  40. package/dist/fns/find-transfers/find-transfers.browser.js +19 -29
  41. package/dist/fns/find-transfers/find-transfers.cjs +18 -28
  42. package/dist/fns/find-transfers/find-transfers.js +19 -29
  43. package/dist/fns/find-wallets/find-wallets.browser.cjs +6 -14
  44. package/dist/fns/find-wallets/find-wallets.browser.js +7 -16
  45. package/dist/fns/find-wallets/find-wallets.cjs +6 -14
  46. package/dist/fns/find-wallets/find-wallets.js +7 -16
  47. package/dist/fns/fn-types.d.ts +43 -43
  48. package/dist/fns/list-exports/list-exports.browser.cjs +4 -2
  49. package/dist/fns/list-exports/list-exports.browser.js +5 -3
  50. package/dist/fns/list-exports/list-exports.cjs +4 -2
  51. package/dist/fns/list-exports/list-exports.js +5 -3
  52. package/dist/index.browser.cjs +2 -0
  53. package/dist/index.browser.js +2 -0
  54. package/dist/index.cjs +2 -0
  55. package/dist/index.js +2 -0
  56. package/dist/lib/polyfill.browser.cjs +43 -0
  57. package/dist/lib/polyfill.browser.js +23 -0
  58. package/dist/lib/polyfill.cjs +47 -0
  59. package/dist/lib/polyfill.d.ts +1 -0
  60. package/dist/lib/polyfill.js +23 -0
  61. package/dist/lib/ts-utils.browser.cjs +5 -1
  62. package/dist/lib/ts-utils.browser.js +5 -1
  63. package/dist/lib/ts-utils.cjs +7 -2
  64. package/dist/lib/ts-utils.d.ts +5 -0
  65. package/dist/lib/ts-utils.js +5 -1
  66. package/dist/lib/utils.browser.cjs +20 -20
  67. package/dist/lib/utils.browser.js +20 -22
  68. package/dist/lib/utils.cjs +22 -19
  69. package/dist/lib/utils.d.ts +5 -3
  70. package/dist/lib/utils.js +20 -18
  71. package/dist/txs/tx-types.d.ts +51 -51
  72. package/dist/types/index.d.ts +16 -6
  73. package/dist/wapi-client-web.iife.js +1 -1
  74. package/dist/wapi-client.iife.js +1 -1
  75. package/package.json +1 -1
@@ -1,43 +1,43 @@
1
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/aggregate-transfers/aggregate-transfers.enums';
2
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-access-token/create-access-token.enums';
3
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-contract/create-contract.enums';
4
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-deposit/create-deposit.enums';
5
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-exchange/create-exchange.enums';
6
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-token/create-token.enums';
7
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-transfer/create-transfer.enums';
8
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-transfer-group/create-transfer-group.enums';
9
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-transfers/create-transfers.enums';
10
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-wallet/create-wallet.enums';
11
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/create-withdrawal/create-withdrawal.enums';
12
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/export-balance-history/export-balance-history.enums';
13
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/export-tokens/export-tokens.enums';
14
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/export-transfer-groups/export-transfer-groups.enums';
15
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/export-transfers/export-transfers.enums';
16
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/export-wallets/export-wallets.enums';
17
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/find-balances/find-balances.enums';
18
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/find-tokens/find-tokens.enums';
19
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/find-transfer-groups/find-transfer-groups.enums';
20
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/find-transfers/find-transfers.enums';
21
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/find-wallets/find-wallets.enums';
22
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-balance/get-balance.enums';
23
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-balance-history/get-balance-history.enums';
24
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-export/get-export.enums';
25
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-flags/get-flags.enums';
26
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-statistics/get-statistics.enums';
27
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-token/get-token.enums';
28
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-transfer/get-transfer.enums';
29
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-transfer-group/get-transfer-group.enums';
30
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/get-wallet/get-wallet.enums';
31
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/healthcheck/healthcheck.enums';
32
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/import-data/import-data.enums';
33
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/list-exports/list-exports.enums';
34
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/reverse-transfer/reverse-transfer.enums';
35
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/reverse-transfer-group/reverse-transfer-group.enums';
36
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/reverse-transfers/reverse-transfers.enums';
37
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/set-flags/set-flags.enums';
38
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-token/update-token.enums';
39
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-transfer/update-transfer.enums';
40
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-transfer-group/update-transfer-group.enums';
41
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-transfer-groups/update-transfer-groups.enums';
42
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-transfers/update-transfers.enums';
43
- export * from '/Users/karl/Documents/www/wapi/wapi-client/src/fns/update-wallet/update-wallet.enums';
1
+ export * from './aggregate-transfers/aggregate-transfers.enums';
2
+ export * from './create-access-token/create-access-token.enums';
3
+ export * from './create-contract/create-contract.enums';
4
+ export * from './create-deposit/create-deposit.enums';
5
+ export * from './create-exchange/create-exchange.enums';
6
+ export * from './create-token/create-token.enums';
7
+ export * from './create-transfer/create-transfer.enums';
8
+ export * from './create-transfer-group/create-transfer-group.enums';
9
+ export * from './create-transfers/create-transfers.enums';
10
+ export * from './create-wallet/create-wallet.enums';
11
+ export * from './create-withdrawal/create-withdrawal.enums';
12
+ export * from './export-balance-history/export-balance-history.enums';
13
+ export * from './export-tokens/export-tokens.enums';
14
+ export * from './export-transfer-groups/export-transfer-groups.enums';
15
+ export * from './export-transfers/export-transfers.enums';
16
+ export * from './export-wallets/export-wallets.enums';
17
+ export * from './find-balances/find-balances.enums';
18
+ export * from './find-tokens/find-tokens.enums';
19
+ export * from './find-transfer-groups/find-transfer-groups.enums';
20
+ export * from './find-transfers/find-transfers.enums';
21
+ export * from './find-wallets/find-wallets.enums';
22
+ export * from './get-balance/get-balance.enums';
23
+ export * from './get-balance-history/get-balance-history.enums';
24
+ export * from './get-export/get-export.enums';
25
+ export * from './get-flags/get-flags.enums';
26
+ export * from './get-statistics/get-statistics.enums';
27
+ export * from './get-token/get-token.enums';
28
+ export * from './get-transfer/get-transfer.enums';
29
+ export * from './get-transfer-group/get-transfer-group.enums';
30
+ export * from './get-wallet/get-wallet.enums';
31
+ export * from './healthcheck/healthcheck.enums';
32
+ export * from './import-data/import-data.enums';
33
+ export * from './list-exports/list-exports.enums';
34
+ export * from './reverse-transfer/reverse-transfer.enums';
35
+ export * from './reverse-transfer-group/reverse-transfer-group.enums';
36
+ export * from './reverse-transfers/reverse-transfers.enums';
37
+ export * from './set-flags/set-flags.enums';
38
+ export * from './update-token/update-token.enums';
39
+ export * from './update-transfer/update-transfer.enums';
40
+ export * from './update-transfer-group/update-transfer-group.enums';
41
+ export * from './update-transfer-groups/update-transfer-groups.enums';
42
+ export * from './update-transfers/update-transfers.enums';
43
+ export * from './update-wallet/update-wallet.enums';
@@ -45,9 +45,11 @@ function listExports(options, input, fnOptions) {
45
45
  const { client } = options;
46
46
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
47
47
  const date = (0, import_utils.convertToString)(inputCopy == null ? void 0 : inputCopy.date);
48
- const txOptions = (0, import_utils.mergeFnOptionsOrderBy)(inputCopy.options);
48
+ fnOptions = (0, import_utils.checkFnOptionsOrderBy)(
49
+ fnOptions != null ? fnOptions : {}
50
+ );
49
51
  return client.api.listExportMany({
50
52
  export: __spreadValues(__spreadValues({}, date ? { date } : {}), inputCopy.type ? { type: inputCopy.type } : {}),
51
- options: txOptions
53
+ options: fnOptions
52
54
  });
53
55
  }
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
16
16
  };
17
17
 
18
18
  // src/fns/list-exports/list-exports.ts
19
- import { convertToString, mergeFnOptionsOrderBy } from "../../lib/utils.browser.js";
19
+ import { checkFnOptionsOrderBy, convertToString } from "../../lib/utils.browser.js";
20
20
  import { getValidator } from "../../lib/validation.browser.js";
21
21
  import { listExportsFnInputSchema } from "./list-exports.schema.zod.browser.js";
22
22
  var zodValidator = getValidator(listExportsFnInputSchema);
@@ -24,10 +24,12 @@ function listExports(options, input, fnOptions) {
24
24
  const { client } = options;
25
25
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
26
26
  const date = convertToString(inputCopy == null ? void 0 : inputCopy.date);
27
- const txOptions = mergeFnOptionsOrderBy(inputCopy.options);
27
+ fnOptions = checkFnOptionsOrderBy(
28
+ fnOptions != null ? fnOptions : {}
29
+ );
28
30
  return client.api.listExportMany({
29
31
  export: __spreadValues(__spreadValues({}, date ? { date } : {}), inputCopy.type ? { type: inputCopy.type } : {}),
30
- options: txOptions
32
+ options: fnOptions
31
33
  });
32
34
  }
33
35
  export {
@@ -45,10 +45,12 @@ function listExports(options, input, fnOptions) {
45
45
  const { client } = options;
46
46
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
47
47
  const date = (0, import_utils.convertToString)(inputCopy == null ? void 0 : inputCopy.date);
48
- const txOptions = (0, import_utils.mergeFnOptionsOrderBy)(inputCopy.options);
48
+ fnOptions = (0, import_utils.checkFnOptionsOrderBy)(
49
+ fnOptions != null ? fnOptions : {}
50
+ );
49
51
  return client.api.listExportMany({
50
52
  export: __spreadValues(__spreadValues({}, date ? { date } : {}), inputCopy.type ? { type: inputCopy.type } : {}),
51
- options: txOptions
53
+ options: fnOptions
52
54
  });
53
55
  }
54
56
  // Annotate the CommonJS export names for ESM import in node:
@@ -16,7 +16,7 @@ var __spreadValues = (a, b) => {
16
16
  };
17
17
 
18
18
  // src/fns/list-exports/list-exports.ts
19
- import { convertToString, mergeFnOptionsOrderBy } from "../../lib/utils";
19
+ import { checkFnOptionsOrderBy, convertToString } from "../../lib/utils";
20
20
  import { getValidator } from "../../lib/validation";
21
21
  import { listExportsFnInputSchema } from "./list-exports.schema.zod";
22
22
  var zodValidator = getValidator(listExportsFnInputSchema);
@@ -24,10 +24,12 @@ function listExports(options, input, fnOptions) {
24
24
  const { client } = options;
25
25
  const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
26
26
  const date = convertToString(inputCopy == null ? void 0 : inputCopy.date);
27
- const txOptions = mergeFnOptionsOrderBy(inputCopy.options);
27
+ fnOptions = checkFnOptionsOrderBy(
28
+ fnOptions != null ? fnOptions : {}
29
+ );
28
30
  return client.api.listExportMany({
29
31
  export: __spreadValues(__spreadValues({}, date ? { date } : {}), inputCopy.type ? { type: inputCopy.type } : {}),
30
- options: txOptions
32
+ options: fnOptions
31
33
  });
32
34
  }
33
35
  export {
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  var import_client = require('./client.cjs');
37
37
  var import_client_options_schema = require('./client-options.schema.zod.cjs');
38
38
  var import_errors = require('./lib/errors.cjs');
39
+ var import_polyfill = require('./lib/polyfill.cjs');
39
40
  var import_stream_promise = require('./lib/stream-promise.cjs');
40
41
  var import_utils = require('./lib/utils.cjs');
41
42
  var import_validation = require('./lib/validation.cjs');
@@ -51,6 +52,7 @@ __reExport(index_exports, require('./txs/index.cjs'), module.exports);
51
52
  __reExport(index_exports, require('./txs/consts.enums.cjs'), module.exports);
52
53
  __reExport(index_exports, require('./txs/tx-types.cjs'), module.exports);
53
54
  __reExport(index_exports, require('./fns/fn-types.cjs'), module.exports);
55
+ (0, import_polyfill.initPolyfills)();
54
56
  var zodWSConnectionValidator = (0, import_validation.getValidator)(import_client_options_schema.wsConnectionSchema);
55
57
  var zodHTTPSConnectionValidator = (0, import_validation.getValidator)(import_client_options_schema.httpsConnectionSchema);
56
58
  var WapiClientType = /* @__PURE__ */ ((WapiClientType2) => {
@@ -14,6 +14,7 @@ import {
14
14
  ERROR_DESCRIPTIONS as ErrorDescription,
15
15
  ERRORS as Errors
16
16
  } from "./lib/errors.browser.js";
17
+ import { initPolyfills } from "./lib/polyfill.browser.js";
17
18
  import { StreamPromise } from "./lib/stream-promise.browser.js";
18
19
  import { getIdentifier } from "./lib/utils.browser.js";
19
20
  import { getValidator } from "./lib/validation.browser.js";
@@ -29,6 +30,7 @@ export * from "./txs/index.browser.js";
29
30
  export * from "./txs/consts.enums.browser.js";
30
31
  export * from "./txs/tx-types.browser.js";
31
32
  export * from "./fns/fn-types.browser.js";
33
+ initPolyfills();
32
34
  var zodWSConnectionValidator = getValidator(wsConnectionSchema);
33
35
  var zodHTTPSConnectionValidator = getValidator(httpsConnectionSchema);
34
36
  var WapiClientType = /* @__PURE__ */ ((WapiClientType2) => {
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  var import_client = require('./client.cjs');
37
37
  var import_client_options_schema = require('./client-options.schema.zod.cjs');
38
38
  var import_errors = require('./lib/errors.cjs');
39
+ var import_polyfill = require('./lib/polyfill.cjs');
39
40
  var import_stream_promise = require('./lib/stream-promise.cjs');
40
41
  var import_utils = require('./lib/utils.cjs');
41
42
  var import_validation = require('./lib/validation.cjs');
@@ -51,6 +52,7 @@ __reExport(index_exports, require('./txs/index.cjs'), module.exports);
51
52
  __reExport(index_exports, require('./txs/consts.enums.cjs'), module.exports);
52
53
  __reExport(index_exports, require('./txs/tx-types.cjs'), module.exports);
53
54
  __reExport(index_exports, require('./fns/fn-types.cjs'), module.exports);
55
+ (0, import_polyfill.initPolyfills)();
54
56
  var zodWSConnectionValidator = (0, import_validation.getValidator)(import_client_options_schema.wsConnectionSchema);
55
57
  var zodHTTPSConnectionValidator = (0, import_validation.getValidator)(import_client_options_schema.httpsConnectionSchema);
56
58
  var WapiClientType = /* @__PURE__ */ ((WapiClientType2) => {
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  ERROR_DESCRIPTIONS as ErrorDescription,
15
15
  ERRORS as Errors
16
16
  } from "./lib/errors";
17
+ import { initPolyfills } from "./lib/polyfill";
17
18
  import { StreamPromise } from "./lib/stream-promise";
18
19
  import { getIdentifier } from "./lib/utils";
19
20
  import { getValidator } from "./lib/validation";
@@ -29,6 +30,7 @@ export * from "./txs";
29
30
  export * from "./txs/consts.enums";
30
31
  export * from "./txs/tx-types";
31
32
  export * from "./fns/fn-types";
33
+ initPolyfills();
32
34
  var zodWSConnectionValidator = getValidator(wsConnectionSchema);
33
35
  var zodHTTPSConnectionValidator = getValidator(httpsConnectionSchema);
34
36
  var WapiClientType = /* @__PURE__ */ ((WapiClientType2) => {
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/polyfill.ts
20
+ var polyfill_exports = {};
21
+ __export(polyfill_exports, {
22
+ initPolyfills: () => initPolyfills
23
+ });
24
+ module.exports = __toCommonJS(polyfill_exports);
25
+ function initPolyfills() {
26
+ if (!("withResolvers" in Promise)) {
27
+ Object.assign(Promise, {
28
+ withResolvers: function() {
29
+ let resolve;
30
+ let reject;
31
+ const promise = new Promise((res, rej) => {
32
+ resolve = res;
33
+ reject = rej;
34
+ });
35
+ return {
36
+ promise,
37
+ resolve,
38
+ reject
39
+ };
40
+ }
41
+ });
42
+ }
43
+ }
@@ -0,0 +1,23 @@
1
+ // src/lib/polyfill.ts
2
+ function initPolyfills() {
3
+ if (!("withResolvers" in Promise)) {
4
+ Object.assign(Promise, {
5
+ withResolvers: function() {
6
+ let resolve;
7
+ let reject;
8
+ const promise = new Promise((res, rej) => {
9
+ resolve = res;
10
+ reject = rej;
11
+ });
12
+ return {
13
+ promise,
14
+ resolve,
15
+ reject
16
+ };
17
+ }
18
+ });
19
+ }
20
+ }
21
+ export {
22
+ initPolyfills
23
+ };
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/lib/polyfill.ts
20
+ var polyfill_exports = {};
21
+ __export(polyfill_exports, {
22
+ initPolyfills: () => initPolyfills
23
+ });
24
+ module.exports = __toCommonJS(polyfill_exports);
25
+ function initPolyfills() {
26
+ if (!("withResolvers" in Promise)) {
27
+ Object.assign(Promise, {
28
+ withResolvers: function() {
29
+ let resolve;
30
+ let reject;
31
+ const promise = new Promise((res, rej) => {
32
+ resolve = res;
33
+ reject = rej;
34
+ });
35
+ return {
36
+ promise,
37
+ resolve,
38
+ reject
39
+ };
40
+ }
41
+ });
42
+ }
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ initPolyfills
47
+ });
@@ -0,0 +1 @@
1
+ export declare function initPolyfills(): void;
@@ -0,0 +1,23 @@
1
+ // src/lib/polyfill.ts
2
+ function initPolyfills() {
3
+ if (!("withResolvers" in Promise)) {
4
+ Object.assign(Promise, {
5
+ withResolvers: function() {
6
+ let resolve;
7
+ let reject;
8
+ const promise = new Promise((res, rej) => {
9
+ resolve = res;
10
+ reject = rej;
11
+ });
12
+ return {
13
+ promise,
14
+ resolve,
15
+ reject
16
+ };
17
+ }
18
+ });
19
+ }
20
+ }
21
+ export {
22
+ initPolyfills
23
+ };
@@ -19,9 +19,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/lib/ts-utils.ts
20
20
  var ts_utils_exports = {};
21
21
  __export(ts_utils_exports, {
22
- createEnumFromTuple: () => createEnumFromTuple
22
+ createEnumFromTuple: () => createEnumFromTuple,
23
+ toMutable: () => toMutable
23
24
  });
24
25
  module.exports = __toCommonJS(ts_utils_exports);
26
+ function toMutable(inp) {
27
+ return inp;
28
+ }
25
29
  function createEnumFromTuple(tuple) {
26
30
  return tuple.reduce(
27
31
  (acc, key) => {
@@ -1,4 +1,7 @@
1
1
  // src/lib/ts-utils.ts
2
+ function toMutable(inp) {
3
+ return inp;
4
+ }
2
5
  function createEnumFromTuple(tuple) {
3
6
  return tuple.reduce(
4
7
  (acc, key) => {
@@ -9,5 +12,6 @@ function createEnumFromTuple(tuple) {
9
12
  );
10
13
  }
11
14
  export {
12
- createEnumFromTuple
15
+ createEnumFromTuple,
16
+ toMutable
13
17
  };
@@ -19,9 +19,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/lib/ts-utils.ts
20
20
  var ts_utils_exports = {};
21
21
  __export(ts_utils_exports, {
22
- createEnumFromTuple: () => createEnumFromTuple
22
+ createEnumFromTuple: () => createEnumFromTuple,
23
+ toMutable: () => toMutable
23
24
  });
24
25
  module.exports = __toCommonJS(ts_utils_exports);
26
+ function toMutable(inp) {
27
+ return inp;
28
+ }
25
29
  function createEnumFromTuple(tuple) {
26
30
  return tuple.reduce(
27
31
  (acc, key) => {
@@ -33,5 +37,6 @@ function createEnumFromTuple(tuple) {
33
37
  }
34
38
  // Annotate the CommonJS export names for ESM import in node:
35
39
  0 && (module.exports = {
36
- createEnumFromTuple
40
+ createEnumFromTuple,
41
+ toMutable
37
42
  });
@@ -1,3 +1,8 @@
1
+ export type Mutable<T> = {
2
+ -readonly [P in keyof T]: Mutable<T[P]>;
3
+ };
4
+ export type RemoveFromTuple<T extends unknown[], U extends unknown[]> = T extends [infer A, ...infer B] ? A extends U[number] ? RemoveFromTuple<B, U> : [A, ...RemoveFromTuple<B, U>] : [];
5
+ export declare function toMutable<T>(inp: T): Mutable<T>;
1
6
  export declare function createEnumFromTuple<T extends readonly string[]>(tuple: T): Readonly<{
2
7
  [K in T[number]]: K;
3
8
  }>;
@@ -1,4 +1,7 @@
1
1
  // src/lib/ts-utils.ts
2
+ function toMutable(inp) {
3
+ return inp;
4
+ }
2
5
  function createEnumFromTuple(tuple) {
3
6
  return tuple.reduce(
4
7
  (acc, key) => {
@@ -9,5 +12,6 @@ function createEnumFromTuple(tuple) {
9
12
  );
10
13
  }
11
14
  export {
12
- createEnumFromTuple
15
+ createEnumFromTuple,
16
+ toMutable
13
17
  };
@@ -1,21 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __objRest = (source, exclude) => {
8
- var target = {};
9
- for (var prop in source)
10
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
11
- target[prop] = source[prop];
12
- if (source != null && __getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(source)) {
14
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
15
- target[prop] = source[prop];
16
- }
17
- return target;
18
- };
19
5
  var __export = (target, all) => {
20
6
  for (var name in all)
21
7
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -34,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
34
20
  var utils_exports = {};
35
21
  __export(utils_exports, {
36
22
  checkCopyObject: () => checkCopyObject,
23
+ checkFnOptionsOrderBy: () => checkFnOptionsOrderBy,
37
24
  convertToNumber: () => convertToNumber,
38
25
  convertToString: () => convertToString,
39
26
  copyObject: () => copyObject,
@@ -48,8 +35,8 @@ __export(utils_exports, {
48
35
  isDate: () => isDate,
49
36
  isDateTime: () => isDateTime,
50
37
  isFutureDate: () => isFutureDate,
51
- mergeFnOptionsOrderBy: () => mergeFnOptionsOrderBy,
52
38
  modifyObject: () => modifyObject,
39
+ omit: () => omit,
53
40
  orderByToOrder: () => orderByToOrder,
54
41
  toQueryString: () => toQueryString,
55
42
  wait: () => wait
@@ -192,6 +179,11 @@ function checkCopyObject(input, property, value) {
192
179
  copy[property] = value;
193
180
  return copy;
194
181
  }
182
+ function omit(input, omitKey) {
183
+ const copy = copyObject(input);
184
+ delete copy[omitKey];
185
+ return copy;
186
+ }
195
187
  function getForeign(value) {
196
188
  const stringValue = inputToString(value);
197
189
  if (stringValue === void 0 || stringValue === null) {
@@ -265,12 +257,20 @@ function orderByToOrder(orderBy) {
265
257
  };
266
258
  });
267
259
  }
268
- function mergeFnOptionsOrderBy(options) {
269
- const _a = options, { order_by: orderBy } = _a, outputOptions = __objRest(_a, ["order_by"]);
270
- if (!outputOptions.order && orderBy) {
271
- outputOptions.order = orderByToOrder(orderBy);
260
+ function checkFnOptionsOrderBy(input) {
261
+ if (!input) {
262
+ return void 0;
263
+ }
264
+ if (!input.order_by) {
265
+ return input;
266
+ }
267
+ const orderBy = input.order_by;
268
+ delete input.order_by;
269
+ if (input.order) {
270
+ return input;
272
271
  }
273
- return outputOptions;
272
+ input.order = orderByToOrder(orderBy);
273
+ return input;
274
274
  }
275
275
  function convertToString(input) {
276
276
  if (input === void 0 || input === null) {
@@ -1,19 +1,3 @@
1
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
4
- var __objRest = (source, exclude) => {
5
- var target = {};
6
- for (var prop in source)
7
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
8
- target[prop] = source[prop];
9
- if (source != null && __getOwnPropSymbols)
10
- for (var prop of __getOwnPropSymbols(source)) {
11
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
12
- target[prop] = source[prop];
13
- }
14
- return target;
15
- };
16
-
17
1
  // src/lib/utils.ts
18
2
  import { InputError, ValidationError } from "./errors.browser.js";
19
3
 
@@ -152,6 +136,11 @@ function checkCopyObject(input, property, value) {
152
136
  copy[property] = value;
153
137
  return copy;
154
138
  }
139
+ function omit(input, omitKey) {
140
+ const copy = copyObject(input);
141
+ delete copy[omitKey];
142
+ return copy;
143
+ }
155
144
  function getForeign(value) {
156
145
  const stringValue = inputToString(value);
157
146
  if (stringValue === void 0 || stringValue === null) {
@@ -225,12 +214,20 @@ function orderByToOrder(orderBy) {
225
214
  };
226
215
  });
227
216
  }
228
- function mergeFnOptionsOrderBy(options) {
229
- const _a = options, { order_by: orderBy } = _a, outputOptions = __objRest(_a, ["order_by"]);
230
- if (!outputOptions.order && orderBy) {
231
- outputOptions.order = orderByToOrder(orderBy);
217
+ function checkFnOptionsOrderBy(input) {
218
+ if (!input) {
219
+ return void 0;
220
+ }
221
+ if (!input.order_by) {
222
+ return input;
223
+ }
224
+ const orderBy = input.order_by;
225
+ delete input.order_by;
226
+ if (input.order) {
227
+ return input;
232
228
  }
233
- return outputOptions;
229
+ input.order = orderByToOrder(orderBy);
230
+ return input;
234
231
  }
235
232
  function convertToString(input) {
236
233
  if (input === void 0 || input === null) {
@@ -280,6 +277,7 @@ function isDateTime(str) {
280
277
  }
281
278
  export {
282
279
  checkCopyObject,
280
+ checkFnOptionsOrderBy,
283
281
  convertToNumber,
284
282
  convertToString,
285
283
  copyObject,
@@ -294,8 +292,8 @@ export {
294
292
  isDate,
295
293
  isDateTime,
296
294
  isFutureDate,
297
- mergeFnOptionsOrderBy,
298
295
  modifyObject,
296
+ omit,
299
297
  orderByToOrder,
300
298
  toQueryString,
301
299
  wait