wapi-client 0.12.5-beta.0 → 0.12.5-beta.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 (41) hide show
  1. package/dist/api/ws-client.cjs +1 -1
  2. package/dist/api/ws-client.js +1 -1
  3. package/dist/client.browser.cjs +1 -5
  4. package/dist/client.browser.js +1 -5
  5. package/dist/client.cjs +2 -6
  6. package/dist/client.d.ts +48 -48
  7. package/dist/client.js +2 -6
  8. package/dist/db/consts.browser.cjs +600 -0
  9. package/dist/db/consts.browser.js +600 -0
  10. package/dist/db/consts.cjs +601 -0
  11. package/dist/db/consts.d.ts +1 -0
  12. package/dist/db/consts.enums.d.ts +2 -1
  13. package/dist/db/consts.js +600 -0
  14. package/dist/fns/aggregate-transfers/aggregate-transfers.d.ts +1 -1
  15. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.d.ts +9 -9
  16. package/dist/fns/get-statistics/get-statistics.browser.cjs +30 -5
  17. package/dist/fns/get-statistics/get-statistics.browser.js +33 -5
  18. package/dist/fns/get-statistics/get-statistics.cjs +30 -5
  19. package/dist/fns/get-statistics/get-statistics.d.ts +1 -1
  20. package/dist/fns/get-statistics/get-statistics.enums.d.ts +2 -2
  21. package/dist/fns/get-statistics/get-statistics.js +33 -5
  22. package/dist/fns/get-statistics/get-statistics.schema.zod.browser.cjs +4012 -5
  23. package/dist/fns/get-statistics/get-statistics.schema.zod.browser.js +4014 -7
  24. package/dist/fns/get-statistics/get-statistics.schema.zod.cjs +18 -5
  25. package/dist/fns/get-statistics/get-statistics.schema.zod.d.ts +47 -144
  26. package/dist/fns/get-statistics/get-statistics.schema.zod.js +19 -7
  27. package/dist/fns/index.d.ts +20 -133
  28. package/dist/lib/query-builder/aggregate-query-builder.d.ts +5 -5
  29. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.d.ts +21 -21
  30. package/dist/txs/consts.browser.cjs +3 -3
  31. package/dist/txs/consts.browser.js +8 -4
  32. package/dist/txs/consts.cjs +3 -3
  33. package/dist/txs/consts.d.ts +34 -34
  34. package/dist/txs/consts.enums.d.ts +2 -2
  35. package/dist/txs/consts.js +8 -4
  36. package/dist/txs/get-statistics/get-statistics.schema.zod.d.ts +12 -12
  37. package/dist/txs/index.d.ts +2 -2
  38. package/dist/types/index.d.ts +157 -365
  39. package/dist/wapi-client-web.iife.js +1 -1
  40. package/dist/wapi-client.iife.js +1 -1
  41. package/package.json +1 -1
@@ -2,7 +2,21 @@
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
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
+ };
6
20
  var __export = (target, all) => {
7
21
  for (var name in all)
8
22
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -28,14 +42,25 @@ var import_get_statistics_schema = require('./get-statistics.schema.zod.cjs');
28
42
  var zodValidator = (0, import_validation.getValidator)(import_get_statistics_schema.getStatisticsFnInputSchema);
29
43
  function getStatistics(options, input, fnOptions) {
30
44
  const { client } = options;
31
- const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
32
- return client.api.getStatistics({
45
+ const inputCopy = zodValidator.validateInputWOptions(input != null ? input : {}, fnOptions);
46
+ const timezone = inputCopy.timezone;
47
+ return client.api.getStatistics(__spreadValues({
33
48
  model: inputCopy.model || "Transfer",
34
- aggregator: inputCopy.aggregator || "count",
35
- groups: inputCopy.groups,
49
+ aggregator: "count",
36
50
  filter: inputCopy.filter,
37
51
  options: inputCopy.options
38
- });
52
+ }, inputCopy.group ? {
53
+ groups: [
54
+ {
55
+ type: "period",
56
+ field: timezone ? {
57
+ period: inputCopy.group,
58
+ timezone
59
+ } : inputCopy.group,
60
+ alias: "period"
61
+ }
62
+ ]
63
+ } : {}));
39
64
  }
40
65
  // Annotate the CommonJS export names for ESM import in node:
41
66
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  import { ClientFunctionOptions } from '../fn-consts.enums';
2
+ import { GetStatisticsFnInput, GetStatisticsFnOptions, GetStatisticsFnOutput } from './get-statistics.enums';
2
3
  import { StreamPromise } from '../../lib/stream-promise';
3
- import { GetStatisticsFnInput, GetStatisticsFnOutput, GetStatisticsFnOptions } from './get-statistics.enums';
4
4
  /**
5
5
  * @internal
6
6
  *
@@ -3,6 +3,6 @@
3
3
  */
4
4
  import z from "zod";
5
5
  import { getStatisticsFnOptionsSchema, getStatisticsFnInputSchema, getStatisticsFnOutputSchema } from "./get-statistics.schema.zod";
6
- export type GetStatisticsFnOptions = z.input<typeof getStatisticsFnOptionsSchema>;
7
- export type GetStatisticsFnInput = z.input<typeof getStatisticsFnInputSchema>;
6
+ export type GetStatisticsFnOptions = z.infer<typeof getStatisticsFnOptionsSchema>;
7
+ export type GetStatisticsFnInput = z.infer<typeof getStatisticsFnInputSchema>;
8
8
  export type GetStatisticsFnOutput = z.infer<typeof getStatisticsFnOutputSchema>;
@@ -1,17 +1,45 @@
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
+
1
18
  // src/fns/get-statistics/get-statistics.ts
2
19
  import { getValidator } from "../../lib/validation";
3
20
  import { getStatisticsFnInputSchema } from "./get-statistics.schema.zod";
4
21
  var zodValidator = getValidator(getStatisticsFnInputSchema);
5
22
  function getStatistics(options, input, fnOptions) {
6
23
  const { client } = options;
7
- const inputCopy = zodValidator.validateInputWOptions(input, fnOptions);
8
- return client.api.getStatistics({
24
+ const inputCopy = zodValidator.validateInputWOptions(input != null ? input : {}, fnOptions);
25
+ const timezone = inputCopy.timezone;
26
+ return client.api.getStatistics(__spreadValues({
9
27
  model: inputCopy.model || "Transfer",
10
- aggregator: inputCopy.aggregator || "count",
11
- groups: inputCopy.groups,
28
+ aggregator: "count",
12
29
  filter: inputCopy.filter,
13
30
  options: inputCopy.options
14
- });
31
+ }, inputCopy.group ? {
32
+ groups: [
33
+ {
34
+ type: "period",
35
+ field: timezone ? {
36
+ period: inputCopy.group,
37
+ timezone
38
+ } : inputCopy.group,
39
+ alias: "period"
40
+ }
41
+ ]
42
+ } : {}));
15
43
  }
16
44
  export {
17
45
  getStatistics