wapi-client 0.8.13 → 0.9.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.
Files changed (114) hide show
  1. package/dist/api/base-client.browser.cjs +21 -14
  2. package/dist/api/base-client.browser.js +22 -20
  3. package/dist/api/base-client.cjs +21 -14
  4. package/dist/api/base-client.d.ts +8 -0
  5. package/dist/api/base-client.js +22 -20
  6. package/dist/api/jsonrpc/jsonrpc.enums.d.ts +5 -4
  7. package/dist/api/ws-client.browser.cjs +3 -11
  8. package/dist/api/ws-client.browser.js +4 -16
  9. package/dist/api/ws-client.cjs +4 -12
  10. package/dist/api/ws-client.js +5 -17
  11. package/dist/client.browser.cjs +29 -5
  12. package/dist/client.browser.js +30 -6
  13. package/dist/client.cjs +30 -6
  14. package/dist/client.d.ts +26 -0
  15. package/dist/client.js +31 -7
  16. package/dist/fns/create-deposit/create-deposit.browser.cjs +1 -4
  17. package/dist/fns/create-deposit/create-deposit.browser.js +2 -5
  18. package/dist/fns/create-deposit/create-deposit.cjs +1 -4
  19. package/dist/fns/create-deposit/create-deposit.js +2 -5
  20. package/dist/fns/create-withdrawal/create-withdrawal.browser.cjs +1 -4
  21. package/dist/fns/create-withdrawal/create-withdrawal.browser.js +2 -5
  22. package/dist/fns/create-withdrawal/create-withdrawal.cjs +1 -4
  23. package/dist/fns/create-withdrawal/create-withdrawal.js +2 -5
  24. package/dist/fns/find-transfers/find-transfers.browser.cjs +8 -20
  25. package/dist/fns/find-transfers/find-transfers.browser.js +9 -21
  26. package/dist/fns/find-transfers/find-transfers.cjs +8 -20
  27. package/dist/fns/find-transfers/find-transfers.js +9 -21
  28. package/dist/fns/get-balance/get-balance.browser.cjs +2 -8
  29. package/dist/fns/get-balance/get-balance.browser.js +3 -9
  30. package/dist/fns/get-balance/get-balance.cjs +2 -8
  31. package/dist/fns/get-balance/get-balance.js +3 -9
  32. package/dist/fns/get-balance-history/get-balance-history.browser.cjs +1 -4
  33. package/dist/fns/get-balance-history/get-balance-history.browser.js +2 -5
  34. package/dist/fns/get-balance-history/get-balance-history.cjs +1 -4
  35. package/dist/fns/get-balance-history/get-balance-history.js +2 -5
  36. package/dist/fns/get-token/get-token.browser.cjs +1 -4
  37. package/dist/fns/get-token/get-token.browser.js +2 -5
  38. package/dist/fns/get-token/get-token.cjs +1 -4
  39. package/dist/fns/get-token/get-token.js +2 -5
  40. package/dist/fns/healthcheck/healthcheck.browser.cjs +56 -0
  41. package/dist/fns/healthcheck/healthcheck.browser.js +38 -0
  42. package/dist/fns/healthcheck/healthcheck.cjs +60 -0
  43. package/dist/fns/healthcheck/healthcheck.d.ts +9 -0
  44. package/dist/fns/healthcheck/healthcheck.enums.browser.cjs +17 -0
  45. package/dist/fns/healthcheck/healthcheck.enums.browser.js +0 -0
  46. package/dist/fns/healthcheck/healthcheck.enums.cjs +17 -0
  47. package/dist/fns/healthcheck/healthcheck.enums.d.ts +20 -0
  48. package/dist/fns/healthcheck/healthcheck.enums.js +0 -0
  49. package/dist/fns/healthcheck/healthcheck.guards.browser.cjs +36 -0
  50. package/dist/fns/healthcheck/healthcheck.guards.browser.js +16 -0
  51. package/dist/fns/healthcheck/healthcheck.guards.cjs +41 -0
  52. package/dist/fns/healthcheck/healthcheck.guards.d.ts +4 -0
  53. package/dist/fns/healthcheck/healthcheck.guards.js +16 -0
  54. package/dist/fns/healthcheck/healthcheck.js +38 -0
  55. package/dist/fns/healthcheck/healthcheck.schema.input.json +25 -0
  56. package/dist/fns/healthcheck/healthcheck.schema.output.json +8 -0
  57. package/dist/fns/import-data/import-data.cjs +2 -5
  58. package/dist/fns/import-data/import-data.js +3 -6
  59. package/dist/fns/import-data/import-data.node.browser.cjs +2 -5
  60. package/dist/fns/import-data/import-data.node.browser.js +3 -6
  61. package/dist/fns/import-data/import-data.node.cjs +2 -5
  62. package/dist/fns/import-data/import-data.node.js +3 -6
  63. package/dist/fns/index.browser.cjs +9 -0
  64. package/dist/fns/index.browser.js +9 -0
  65. package/dist/fns/index.cjs +12 -0
  66. package/dist/fns/index.d.ts +7 -1
  67. package/dist/fns/index.js +9 -0
  68. package/dist/fns/set-flags/set-flags.browser.cjs +3 -3
  69. package/dist/fns/set-flags/set-flags.browser.js +3 -3
  70. package/dist/fns/set-flags/set-flags.cjs +3 -3
  71. package/dist/fns/set-flags/set-flags.js +3 -3
  72. package/dist/index.browser.cjs +13 -1
  73. package/dist/index.browser.js +25 -1
  74. package/dist/index.cjs +25 -1
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.js +25 -1
  77. package/dist/lib/errors.browser.cjs +642 -214
  78. package/dist/lib/errors.browser.js +645 -214
  79. package/dist/lib/errors.cjs +652 -218
  80. package/dist/lib/errors.d.ts +1411 -342
  81. package/dist/lib/errors.js +645 -214
  82. package/dist/lib/query-builder.browser.cjs +2 -2
  83. package/dist/lib/query-builder.browser.js +2 -2
  84. package/dist/lib/query-builder.cjs +2 -2
  85. package/dist/lib/query-builder.js +2 -2
  86. package/dist/lib/stream-promise.browser.cjs +3 -4
  87. package/dist/lib/stream-promise.browser.js +4 -5
  88. package/dist/lib/stream-promise.cjs +3 -4
  89. package/dist/lib/stream-promise.js +4 -5
  90. package/dist/lib/utils.browser.cjs +9 -13
  91. package/dist/lib/utils.browser.js +9 -13
  92. package/dist/lib/utils.cjs +9 -13
  93. package/dist/lib/utils.js +9 -13
  94. package/dist/lib/validator.browser.cjs +46 -4
  95. package/dist/lib/validator.browser.js +46 -4
  96. package/dist/lib/validator.cjs +46 -4
  97. package/dist/lib/validator.d.ts +5 -1
  98. package/dist/lib/validator.js +46 -4
  99. package/dist/txs/healthcheck/healthcheck.enums.browser.cjs +17 -0
  100. package/dist/txs/healthcheck/healthcheck.enums.browser.js +0 -0
  101. package/dist/txs/healthcheck/healthcheck.enums.cjs +17 -0
  102. package/dist/txs/healthcheck/healthcheck.enums.d.ts +22 -0
  103. package/dist/txs/healthcheck/healthcheck.enums.js +0 -0
  104. package/dist/txs/healthcheck/healthcheck.schema.input.json +23 -0
  105. package/dist/txs/healthcheck/healthcheck.schema.output.json +32 -0
  106. package/dist/txs/index.browser.cjs +7 -0
  107. package/dist/txs/index.browser.js +7 -0
  108. package/dist/txs/index.cjs +9 -0
  109. package/dist/txs/index.d.ts +5 -0
  110. package/dist/txs/index.js +7 -0
  111. package/dist/types/index.d.ts +2425 -1239
  112. package/dist/wapi-client-web.iife.js +4 -4
  113. package/dist/wapi-client.iife.js +4 -4
  114. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // src/fns/get-balance-history/get-balance-history.ts
2
- import { ERROR_MESSAGES, InputError } from "../../lib/errors";
2
+ import { InputError } from "../../lib/errors";
3
3
  import { getForeign, validateClientFnInput } from "../../lib/utils";
4
4
  import { getValidator, SchemaNames } from "../../lib/validator";
5
5
  var validate = getValidator(SchemaNames.GetBalanceHistoryFnInput);
@@ -15,10 +15,7 @@ function getBalanceHistory(options, input, fnOptions) {
15
15
  }
16
16
  const token = inputCopy.token || client.getConfig("token");
17
17
  if (token === void 0) {
18
- throw new InputError({
19
- message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
20
- data: input
21
- });
18
+ throw new InputError("INPUT_NEEDS_TOKEN", { input });
22
19
  }
23
20
  return client.api.getBalanceHistory({
24
21
  balance: {
@@ -44,10 +44,7 @@ function getToken(options, input = {}, fnOptions) {
44
44
  }
45
45
  const token = inputCopy.foreign || client.getConfig("token");
46
46
  if (token === void 0) {
47
- throw new import_errors.InputError({
48
- message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
49
- data: input
50
- });
47
+ throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
51
48
  }
52
49
  return client.api.getToken({
53
50
  token: (0, import_utils.getForeign)(token),
@@ -1,5 +1,5 @@
1
1
  // src/fns/get-token/get-token.ts
2
- import { ERROR_MESSAGES, InputError } from "../../lib/errors.browser.js";
2
+ import { InputError } from "../../lib/errors.browser.js";
3
3
  import {
4
4
  checkCopyObject,
5
5
  getForeign,
@@ -24,10 +24,7 @@ function getToken(options, input = {}, fnOptions) {
24
24
  }
25
25
  const token = inputCopy.foreign || client.getConfig("token");
26
26
  if (token === void 0) {
27
- throw new InputError({
28
- message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
29
- data: input
30
- });
27
+ throw new InputError("INPUT_NEEDS_TOKEN", { input });
31
28
  }
32
29
  return client.api.getToken({
33
30
  token: getForeign(token),
@@ -44,10 +44,7 @@ function getToken(options, input = {}, fnOptions) {
44
44
  }
45
45
  const token = inputCopy.foreign || client.getConfig("token");
46
46
  if (token === void 0) {
47
- throw new import_errors.InputError({
48
- message: import_errors.ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
49
- data: input
50
- });
47
+ throw new import_errors.InputError("INPUT_NEEDS_TOKEN", { input });
51
48
  }
52
49
  return client.api.getToken({
53
50
  token: (0, import_utils.getForeign)(token),
@@ -1,5 +1,5 @@
1
1
  // src/fns/get-token/get-token.ts
2
- import { ERROR_MESSAGES, InputError } from "../../lib/errors";
2
+ import { InputError } from "../../lib/errors";
3
3
  import {
4
4
  checkCopyObject,
5
5
  getForeign,
@@ -24,10 +24,7 @@ function getToken(options, input = {}, fnOptions) {
24
24
  }
25
25
  const token = inputCopy.foreign || client.getConfig("token");
26
26
  if (token === void 0) {
27
- throw new InputError({
28
- message: ERROR_MESSAGES.INPUT_NEEDS_TOKEN,
29
- data: input
30
- });
27
+ throw new InputError("INPUT_NEEDS_TOKEN", { input });
31
28
  }
32
29
  return client.api.getToken({
33
30
  token: getForeign(token),
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/fns/healthcheck/healthcheck.ts
35
+ var healthcheck_exports = {};
36
+ __export(healthcheck_exports, {
37
+ healthcheck: () => healthcheck
38
+ });
39
+ module.exports = __toCommonJS(healthcheck_exports);
40
+ var import_utils = require('../../lib/utils.cjs');
41
+ var import_validator = require('../../lib/validator.cjs');
42
+ var validate = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnInput);
43
+ function healthcheck(options, input, fnOptions) {
44
+ const { client } = options;
45
+ const { inputCopy, error } = (0, import_utils.validateClientFnInput)({
46
+ input,
47
+ options: fnOptions,
48
+ validate
49
+ });
50
+ if (error) {
51
+ throw error;
52
+ }
53
+ return client.api.healthcheck({
54
+ options: __spreadValues(__spreadValues({}, inputCopy.options), fnOptions)
55
+ });
56
+ }
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+
18
+ // src/fns/healthcheck/healthcheck.ts
19
+ import { validateClientFnInput } from "../../lib/utils.browser.js";
20
+ import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
21
+ var validate = getValidator(SchemaNames.HealthcheckFnInput);
22
+ function healthcheck(options, input, fnOptions) {
23
+ const { client } = options;
24
+ const { inputCopy, error } = validateClientFnInput({
25
+ input,
26
+ options: fnOptions,
27
+ validate
28
+ });
29
+ if (error) {
30
+ throw error;
31
+ }
32
+ return client.api.healthcheck({
33
+ options: __spreadValues(__spreadValues({}, inputCopy.options), fnOptions)
34
+ });
35
+ }
36
+ export {
37
+ healthcheck
38
+ };
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/fns/healthcheck/healthcheck.ts
35
+ var healthcheck_exports = {};
36
+ __export(healthcheck_exports, {
37
+ healthcheck: () => healthcheck
38
+ });
39
+ module.exports = __toCommonJS(healthcheck_exports);
40
+ var import_utils = require('../../lib/utils.cjs');
41
+ var import_validator = require('../../lib/validator.cjs');
42
+ var validate = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnInput);
43
+ function healthcheck(options, input, fnOptions) {
44
+ const { client } = options;
45
+ const { inputCopy, error } = (0, import_utils.validateClientFnInput)({
46
+ input,
47
+ options: fnOptions,
48
+ validate
49
+ });
50
+ if (error) {
51
+ throw error;
52
+ }
53
+ return client.api.healthcheck({
54
+ options: __spreadValues(__spreadValues({}, inputCopy.options), fnOptions)
55
+ });
56
+ }
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ healthcheck
60
+ });
@@ -0,0 +1,9 @@
1
+ import { ClientFunctionOptions } from '../fn-consts.enums';
2
+ import { StreamPromise } from '../../lib/stream-promise';
3
+ import { HealthcheckFnInput, HealthcheckFnOptions, HealthcheckFnOutput } from './healthcheck.enums';
4
+ /**
5
+ * @internal
6
+ *
7
+ * Get information about wallet
8
+ */
9
+ export declare function healthcheck(options: ClientFunctionOptions, input: HealthcheckFnInput, fnOptions?: HealthcheckFnOptions): StreamPromise<HealthcheckFnOutput>;
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/fns/healthcheck/healthcheck.enums.ts
16
+ var healthcheck_enums_exports = {};
17
+ module.exports = __toCommonJS(healthcheck_enums_exports);
@@ -0,0 +1,17 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/fns/healthcheck/healthcheck.enums.ts
16
+ var healthcheck_enums_exports = {};
17
+ module.exports = __toCommonJS(healthcheck_enums_exports);
@@ -0,0 +1,20 @@
1
+ import { HealthcheckTxOptions, HealthcheckTxOutput } from '../../txs/healthcheck/healthcheck.enums';
2
+ /**
3
+ * Optional flags for input
4
+ */
5
+ export type HealthcheckFnOptions = HealthcheckTxOptions;
6
+ /**
7
+ * Input for healthcheck
8
+ *
9
+ * @category Input
10
+ */
11
+ export interface HealthcheckFnInput {
12
+ options?: HealthcheckFnOptions;
13
+ }
14
+ /**
15
+ * Output of healthcheck
16
+ *
17
+ * @category Output
18
+ */
19
+ export interface HealthcheckFnOutput extends HealthcheckTxOutput {
20
+ }
File without changes
@@ -0,0 +1,36 @@
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/fns/healthcheck/healthcheck.guards.ts
20
+ var healthcheck_guards_exports = {};
21
+ __export(healthcheck_guards_exports, {
22
+ isHealthcheckFnInput: () => isHealthcheckFnInput,
23
+ isHealthcheckFnOutput: () => isHealthcheckFnOutput
24
+ });
25
+ module.exports = __toCommonJS(healthcheck_guards_exports);
26
+ var import_validator = require('../../lib/validator.cjs');
27
+ var inputValidator = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnInput);
28
+ function isHealthcheckFnInput(input) {
29
+ const { error } = inputValidator(input);
30
+ return error === void 0;
31
+ }
32
+ var outputValidator = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnOutput);
33
+ function isHealthcheckFnOutput(input) {
34
+ const { error } = outputValidator(input);
35
+ return error === void 0;
36
+ }
@@ -0,0 +1,16 @@
1
+ // src/fns/healthcheck/healthcheck.guards.ts
2
+ import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
3
+ var inputValidator = getValidator(SchemaNames.HealthcheckFnInput);
4
+ function isHealthcheckFnInput(input) {
5
+ const { error } = inputValidator(input);
6
+ return error === void 0;
7
+ }
8
+ var outputValidator = getValidator(SchemaNames.HealthcheckFnOutput);
9
+ function isHealthcheckFnOutput(input) {
10
+ const { error } = outputValidator(input);
11
+ return error === void 0;
12
+ }
13
+ export {
14
+ isHealthcheckFnInput,
15
+ isHealthcheckFnOutput
16
+ };
@@ -0,0 +1,41 @@
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/fns/healthcheck/healthcheck.guards.ts
20
+ var healthcheck_guards_exports = {};
21
+ __export(healthcheck_guards_exports, {
22
+ isHealthcheckFnInput: () => isHealthcheckFnInput,
23
+ isHealthcheckFnOutput: () => isHealthcheckFnOutput
24
+ });
25
+ module.exports = __toCommonJS(healthcheck_guards_exports);
26
+ var import_validator = require('../../lib/validator.cjs');
27
+ var inputValidator = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnInput);
28
+ function isHealthcheckFnInput(input) {
29
+ const { error } = inputValidator(input);
30
+ return error === void 0;
31
+ }
32
+ var outputValidator = (0, import_validator.getValidator)(import_validator.SchemaNames.HealthcheckFnOutput);
33
+ function isHealthcheckFnOutput(input) {
34
+ const { error } = outputValidator(input);
35
+ return error === void 0;
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ isHealthcheckFnInput,
40
+ isHealthcheckFnOutput
41
+ });
@@ -0,0 +1,4 @@
1
+ import { HealthcheckFnInput } from './healthcheck.enums';
2
+ export declare function isHealthcheckFnInput(input: unknown): input is HealthcheckFnInput;
3
+ import { HealthcheckFnOutput } from './healthcheck.enums';
4
+ export declare function isHealthcheckFnOutput(input: unknown): input is HealthcheckFnOutput;
@@ -0,0 +1,16 @@
1
+ // src/fns/healthcheck/healthcheck.guards.ts
2
+ import { getValidator, SchemaNames } from "../../lib/validator";
3
+ var inputValidator = getValidator(SchemaNames.HealthcheckFnInput);
4
+ function isHealthcheckFnInput(input) {
5
+ const { error } = inputValidator(input);
6
+ return error === void 0;
7
+ }
8
+ var outputValidator = getValidator(SchemaNames.HealthcheckFnOutput);
9
+ function isHealthcheckFnOutput(input) {
10
+ const { error } = outputValidator(input);
11
+ return error === void 0;
12
+ }
13
+ export {
14
+ isHealthcheckFnInput,
15
+ isHealthcheckFnOutput
16
+ };
@@ -0,0 +1,38 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+
18
+ // src/fns/healthcheck/healthcheck.ts
19
+ import { validateClientFnInput } from "../../lib/utils";
20
+ import { getValidator, SchemaNames } from "../../lib/validator";
21
+ var validate = getValidator(SchemaNames.HealthcheckFnInput);
22
+ function healthcheck(options, input, fnOptions) {
23
+ const { client } = options;
24
+ const { inputCopy, error } = validateClientFnInput({
25
+ input,
26
+ options: fnOptions,
27
+ validate
28
+ });
29
+ if (error) {
30
+ throw error;
31
+ }
32
+ return client.api.healthcheck({
33
+ options: __spreadValues(__spreadValues({}, inputCopy.options), fnOptions)
34
+ });
35
+ }
36
+ export {
37
+ healthcheck
38
+ };
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "HealthcheckFnInput",
4
+ "title": "HealthcheckFnInput",
5
+ "description": "Input for healthcheck",
6
+ "type": "object",
7
+ "properties": {
8
+ "options": {
9
+ "$ref": "#/definitions/healthcheck_fn_options"
10
+ }
11
+ },
12
+ "definitions": {
13
+ "healthcheck_fn_options": {
14
+ "description": "Optional flags for input",
15
+ "type": "object",
16
+ "allOf": [
17
+ {
18
+ "$ref": "/txs/healthcheck/healthcheck.schema.input.json#/definitions/healthcheck_tx_options"
19
+ }
20
+ ]
21
+ }
22
+ },
23
+ "required": [],
24
+ "additionalProperties": false
25
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "HealthcheckFnOutput",
4
+ "title": "HealthcheckFnOutput",
5
+ "description": "Output of healthcheck",
6
+ "type": "object",
7
+ "$ref": "/txs/healthcheck/healthcheck.schema.output.json"
8
+ }
@@ -104,11 +104,8 @@ function getTransform() {
104
104
  if (!(0, import_import_data.isImportDataFnStreamChunk)(data)) {
105
105
  const { error } = chunkValidator(data);
106
106
  throw new import_errors.ValidationError({
107
- message: import_errors.ERROR_MESSAGES.INPUT_INVALID,
108
- data: {
109
- data,
110
- error
111
- }
107
+ data,
108
+ error
112
109
  });
113
110
  }
114
111
  buffer.push(transformToTxChunk(data));
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // src/fns/import-data/import-data.ts
42
- import { ERROR_MESSAGES, ValidationError } from "../../lib/errors";
42
+ import { ValidationError } from "../../lib/errors";
43
43
  import { TransformStream } from "../../lib/isomorphic/node/streams";
44
44
  import { getForeign, validateClientFnInput } from "../../lib/utils";
45
45
  import { getValidator, SchemaNames } from "../../lib/validator";
@@ -85,11 +85,8 @@ function getTransform() {
85
85
  if (!isImportDataFnStreamChunk(data)) {
86
86
  const { error } = chunkValidator(data);
87
87
  throw new ValidationError({
88
- message: ERROR_MESSAGES.INPUT_INVALID,
89
- data: {
90
- data,
91
- error
92
- }
88
+ data,
89
+ error
93
90
  });
94
91
  }
95
92
  buffer.push(transformToTxChunk(data));
@@ -104,11 +104,8 @@ function getTransform() {
104
104
  if (!(0, import_import_data.isImportDataFnStreamChunk)(data)) {
105
105
  const { error } = chunkValidator(data);
106
106
  throw new import_errors.ValidationError({
107
- message: import_errors.ERROR_MESSAGES.INPUT_INVALID,
108
- data: {
109
- data,
110
- error
111
- }
107
+ data,
108
+ error
112
109
  });
113
110
  }
114
111
  buffer.push(transformToTxChunk(data));
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // src/fns/import-data/import-data.node.ts
42
- import { ERROR_MESSAGES, ValidationError } from "../../lib/errors.browser.js";
42
+ import { ValidationError } from "../../lib/errors.browser.js";
43
43
  import { TransformStream } from "../../lib/isomorphic/node/streams.browser.js";
44
44
  import { getForeign, validateClientFnInput } from "../../lib/utils.browser.js";
45
45
  import { getValidator, SchemaNames } from "../../lib/validator.browser.js";
@@ -85,11 +85,8 @@ function getTransform() {
85
85
  if (!isImportDataFnStreamChunk(data)) {
86
86
  const { error } = chunkValidator(data);
87
87
  throw new ValidationError({
88
- message: ERROR_MESSAGES.INPUT_INVALID,
89
- data: {
90
- data,
91
- error
92
- }
88
+ data,
89
+ error
93
90
  });
94
91
  }
95
92
  buffer.push(transformToTxChunk(data));
@@ -104,11 +104,8 @@ function getTransform() {
104
104
  if (!(0, import_import_data.isImportDataFnStreamChunk)(data)) {
105
105
  const { error } = chunkValidator(data);
106
106
  throw new import_errors.ValidationError({
107
- message: import_errors.ERROR_MESSAGES.INPUT_INVALID,
108
- data: {
109
- data,
110
- error
111
- }
107
+ data,
108
+ error
112
109
  });
113
110
  }
114
111
  buffer.push(transformToTxChunk(data));
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // src/fns/import-data/import-data.node.ts
42
- import { ERROR_MESSAGES, ValidationError } from "../../lib/errors";
42
+ import { ValidationError } from "../../lib/errors";
43
43
  import { TransformStream } from "../../lib/isomorphic/node/streams";
44
44
  import { getForeign, validateClientFnInput } from "../../lib/utils";
45
45
  import { getValidator, SchemaNames } from "../../lib/validator";
@@ -85,11 +85,8 @@ function getTransform() {
85
85
  if (!isImportDataFnStreamChunk(data)) {
86
86
  const { error } = chunkValidator(data);
87
87
  throw new ValidationError({
88
- message: ERROR_MESSAGES.INPUT_INVALID,
89
- data: {
90
- data,
91
- error
92
- }
88
+ data,
89
+ error
93
90
  });
94
91
  }
95
92
  buffer.push(transformToTxChunk(data));