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.
- package/dist/api/ws-client.cjs +1 -1
- package/dist/api/ws-client.js +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.js +1 -1
- package/dist/db/consts.browser.cjs +0 -2
- package/dist/db/consts.browser.js +0 -2
- package/dist/db/consts.cjs +0 -2
- package/dist/db/consts.d.ts +1 -1
- package/dist/db/consts.js +0 -2
- package/dist/fns/consts.enums.d.ts +1 -2
- package/dist/fns/export-tokens/export-tokens.browser.cjs +23 -1
- package/dist/fns/export-tokens/export-tokens.browser.js +27 -2
- package/dist/fns/export-tokens/export-tokens.cjs +23 -1
- package/dist/fns/export-tokens/export-tokens.js +27 -2
- package/dist/fns/export-transfer-groups/export-transfer-groups.browser.cjs +24 -2
- package/dist/fns/export-transfer-groups/export-transfer-groups.browser.js +28 -3
- package/dist/fns/export-transfer-groups/export-transfer-groups.cjs +24 -2
- package/dist/fns/export-transfer-groups/export-transfer-groups.js +28 -3
- package/dist/fns/export-transfers/export-transfers.browser.cjs +23 -2
- package/dist/fns/export-transfers/export-transfers.browser.js +27 -3
- package/dist/fns/export-transfers/export-transfers.cjs +23 -2
- package/dist/fns/export-transfers/export-transfers.js +27 -3
- package/dist/fns/export-wallets/export-wallets.browser.cjs +7 -15
- package/dist/fns/export-wallets/export-wallets.browser.js +8 -17
- package/dist/fns/export-wallets/export-wallets.cjs +7 -15
- package/dist/fns/export-wallets/export-wallets.js +8 -17
- package/dist/fns/find-balances/find-balances.browser.cjs +23 -1
- package/dist/fns/find-balances/find-balances.browser.js +27 -2
- package/dist/fns/find-balances/find-balances.cjs +23 -1
- package/dist/fns/find-balances/find-balances.js +27 -2
- package/dist/fns/find-tokens/find-tokens.browser.cjs +23 -1
- package/dist/fns/find-tokens/find-tokens.browser.js +27 -2
- package/dist/fns/find-tokens/find-tokens.cjs +23 -1
- package/dist/fns/find-tokens/find-tokens.js +27 -2
- package/dist/fns/find-transfer-groups/find-transfer-groups.browser.cjs +23 -1
- package/dist/fns/find-transfer-groups/find-transfer-groups.browser.js +27 -2
- package/dist/fns/find-transfer-groups/find-transfer-groups.cjs +23 -1
- package/dist/fns/find-transfer-groups/find-transfer-groups.js +27 -2
- package/dist/fns/find-transfers/find-transfers.browser.cjs +18 -28
- package/dist/fns/find-transfers/find-transfers.browser.js +19 -29
- package/dist/fns/find-transfers/find-transfers.cjs +18 -28
- package/dist/fns/find-transfers/find-transfers.js +19 -29
- package/dist/fns/find-wallets/find-wallets.browser.cjs +6 -14
- package/dist/fns/find-wallets/find-wallets.browser.js +7 -16
- package/dist/fns/find-wallets/find-wallets.cjs +6 -14
- package/dist/fns/find-wallets/find-wallets.js +7 -16
- package/dist/fns/fn-types.d.ts +43 -43
- package/dist/fns/list-exports/list-exports.browser.cjs +4 -2
- package/dist/fns/list-exports/list-exports.browser.js +5 -3
- package/dist/fns/list-exports/list-exports.cjs +4 -2
- package/dist/fns/list-exports/list-exports.js +5 -3
- package/dist/index.browser.cjs +2 -0
- package/dist/index.browser.js +2 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/polyfill.browser.cjs +43 -0
- package/dist/lib/polyfill.browser.js +23 -0
- package/dist/lib/polyfill.cjs +47 -0
- package/dist/lib/polyfill.d.ts +1 -0
- package/dist/lib/polyfill.js +23 -0
- package/dist/lib/ts-utils.browser.cjs +5 -1
- package/dist/lib/ts-utils.browser.js +5 -1
- package/dist/lib/ts-utils.cjs +7 -2
- package/dist/lib/ts-utils.d.ts +5 -0
- package/dist/lib/ts-utils.js +5 -1
- package/dist/lib/utils.browser.cjs +20 -20
- package/dist/lib/utils.browser.js +20 -22
- package/dist/lib/utils.cjs +22 -19
- package/dist/lib/utils.d.ts +5 -3
- package/dist/lib/utils.js +20 -18
- package/dist/txs/tx-types.d.ts +51 -51
- package/dist/types/index.d.ts +16 -6
- package/dist/wapi-client-web.iife.js +1 -1
- package/dist/wapi-client.iife.js +1 -1
- package/package.json +1 -1
package/dist/fns/fn-types.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
23
|
-
export * from '
|
|
24
|
-
export * from '
|
|
25
|
-
export * from '
|
|
26
|
-
export * from '
|
|
27
|
-
export * from '
|
|
28
|
-
export * from '
|
|
29
|
-
export * from '
|
|
30
|
-
export * from '
|
|
31
|
-
export * from '
|
|
32
|
-
export * from '
|
|
33
|
-
export * from '
|
|
34
|
-
export * from '
|
|
35
|
-
export * from '
|
|
36
|
-
export * from '
|
|
37
|
-
export * from '
|
|
38
|
-
export * from '
|
|
39
|
-
export * from '
|
|
40
|
-
export * from '
|
|
41
|
-
export * from '
|
|
42
|
-
export * from '
|
|
43
|
-
export * from '
|
|
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
|
-
|
|
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:
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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 {
|
|
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
|
-
|
|
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:
|
|
32
|
+
options: fnOptions
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
export {
|
package/dist/index.browser.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.browser.js
CHANGED
|
@@ -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
|
};
|
package/dist/lib/ts-utils.cjs
CHANGED
|
@@ -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
|
});
|
package/dist/lib/ts-utils.d.ts
CHANGED
|
@@ -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
|
}>;
|
package/dist/lib/ts-utils.js
CHANGED
|
@@ -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
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
-
|
|
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
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
-
|
|
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
|