@payabli/sdk-node 0.0.146 → 0.0.147

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 (108) hide show
  1. package/README.md +10 -2
  2. package/dist/cjs/BaseClient.d.ts +3 -0
  3. package/dist/cjs/BaseClient.js +17 -2
  4. package/dist/cjs/api/resources/bill/client/Client.js +35 -11
  5. package/dist/cjs/api/resources/boarding/client/Client.js +25 -13
  6. package/dist/cjs/api/resources/chargeBacks/client/Client.js +3 -3
  7. package/dist/cjs/api/resources/checkCapture/client/Client.js +1 -1
  8. package/dist/cjs/api/resources/cloud/client/Client.js +8 -4
  9. package/dist/cjs/api/resources/customer/client/Client.js +10 -6
  10. package/dist/cjs/api/resources/export/client/Client.js +145 -29
  11. package/dist/cjs/api/resources/ghostCard/client/Client.js +2 -2
  12. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +3 -3
  13. package/dist/cjs/api/resources/import/client/Client.js +7 -3
  14. package/dist/cjs/api/resources/invoice/client/Client.js +35 -11
  15. package/dist/cjs/api/resources/lineItem/client/Client.js +9 -5
  16. package/dist/cjs/api/resources/management/client/Client.js +1 -1
  17. package/dist/cjs/api/resources/moneyIn/client/Client.js +43 -19
  18. package/dist/cjs/api/resources/moneyOut/client/Client.js +20 -12
  19. package/dist/cjs/api/resources/notification/client/Client.js +5 -5
  20. package/dist/cjs/api/resources/notificationlogs/client/Client.js +8 -4
  21. package/dist/cjs/api/resources/ocr/client/Client.js +2 -2
  22. package/dist/cjs/api/resources/organization/client/Client.js +7 -7
  23. package/dist/cjs/api/resources/paymentLink/client/Client.js +31 -11
  24. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +11 -7
  25. package/dist/cjs/api/resources/payoutSubscription/client/Client.js +4 -4
  26. package/dist/cjs/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.ts +0 -3
  27. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.ts +0 -3
  28. package/dist/cjs/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.ts +0 -3
  29. package/dist/cjs/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.ts +0 -3
  30. package/dist/cjs/api/resources/paypoint/client/Client.js +12 -8
  31. package/dist/cjs/api/resources/query/client/Client.js +210 -42
  32. package/dist/cjs/api/resources/statistic/client/Client.js +20 -4
  33. package/dist/cjs/api/resources/subscription/client/Client.js +8 -4
  34. package/dist/cjs/api/resources/templates/client/Client.js +8 -4
  35. package/dist/cjs/api/resources/tokenStorage/client/Client.js +16 -4
  36. package/dist/cjs/api/resources/user/client/Client.js +16 -12
  37. package/dist/cjs/api/resources/vendor/client/Client.js +5 -5
  38. package/dist/cjs/api/resources/wallet/client/Client.js +4 -4
  39. package/dist/cjs/api/types/GeneralEvents.d.ts +1 -1
  40. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  41. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  42. package/dist/cjs/core/auth/index.d.ts +1 -1
  43. package/dist/cjs/core/auth/index.js +3 -1
  44. package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -0
  45. package/dist/cjs/core/fetcher/Fetcher.js +9 -8
  46. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  47. package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
  48. package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
  49. package/dist/cjs/core/url/index.d.ts +1 -0
  50. package/dist/cjs/core/url/index.js +3 -1
  51. package/dist/cjs/core/url/qs.d.ts +2 -1
  52. package/dist/cjs/core/url/qs.js +24 -12
  53. package/dist/cjs/version.d.ts +1 -1
  54. package/dist/cjs/version.js +1 -1
  55. package/dist/esm/BaseClient.d.mts +3 -0
  56. package/dist/esm/BaseClient.mjs +17 -2
  57. package/dist/esm/api/resources/bill/client/Client.mjs +35 -11
  58. package/dist/esm/api/resources/boarding/client/Client.mjs +25 -13
  59. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +3 -3
  60. package/dist/esm/api/resources/checkCapture/client/Client.mjs +1 -1
  61. package/dist/esm/api/resources/cloud/client/Client.mjs +8 -4
  62. package/dist/esm/api/resources/customer/client/Client.mjs +10 -6
  63. package/dist/esm/api/resources/export/client/Client.mjs +145 -29
  64. package/dist/esm/api/resources/ghostCard/client/Client.mjs +2 -2
  65. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +3 -3
  66. package/dist/esm/api/resources/import/client/Client.mjs +7 -3
  67. package/dist/esm/api/resources/invoice/client/Client.mjs +35 -11
  68. package/dist/esm/api/resources/lineItem/client/Client.mjs +9 -5
  69. package/dist/esm/api/resources/management/client/Client.mjs +1 -1
  70. package/dist/esm/api/resources/moneyIn/client/Client.mjs +43 -19
  71. package/dist/esm/api/resources/moneyOut/client/Client.mjs +20 -12
  72. package/dist/esm/api/resources/notification/client/Client.mjs +5 -5
  73. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +8 -4
  74. package/dist/esm/api/resources/ocr/client/Client.mjs +2 -2
  75. package/dist/esm/api/resources/organization/client/Client.mjs +7 -7
  76. package/dist/esm/api/resources/paymentLink/client/Client.mjs +31 -11
  77. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +11 -7
  78. package/dist/esm/api/resources/payoutSubscription/client/Client.mjs +4 -4
  79. package/dist/esm/api/resources/payoutSubscription/types/GetPayoutSubscriptionResponse.d.mts +0 -3
  80. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecord.d.mts +0 -3
  81. package/dist/esm/api/resources/payoutSubscription/types/PayoutSubscriptionQueryRecordPascal.d.mts +0 -3
  82. package/dist/esm/api/resources/payoutSubscription/types/QueryPayoutSubscriptionResponse.d.mts +0 -3
  83. package/dist/esm/api/resources/paypoint/client/Client.mjs +12 -8
  84. package/dist/esm/api/resources/query/client/Client.mjs +210 -42
  85. package/dist/esm/api/resources/statistic/client/Client.mjs +20 -4
  86. package/dist/esm/api/resources/subscription/client/Client.mjs +8 -4
  87. package/dist/esm/api/resources/templates/client/Client.mjs +8 -4
  88. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +16 -4
  89. package/dist/esm/api/resources/user/client/Client.mjs +16 -12
  90. package/dist/esm/api/resources/vendor/client/Client.mjs +5 -5
  91. package/dist/esm/api/resources/wallet/client/Client.mjs +4 -4
  92. package/dist/esm/api/types/GeneralEvents.d.mts +1 -1
  93. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  94. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  95. package/dist/esm/core/auth/index.d.mts +1 -1
  96. package/dist/esm/core/auth/index.mjs +1 -0
  97. package/dist/esm/core/fetcher/Fetcher.d.mts +6 -0
  98. package/dist/esm/core/fetcher/Fetcher.mjs +9 -8
  99. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  100. package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
  101. package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
  102. package/dist/esm/core/url/index.d.mts +1 -0
  103. package/dist/esm/core/url/index.mjs +1 -0
  104. package/dist/esm/core/url/qs.d.mts +2 -1
  105. package/dist/esm/core/url/qs.mjs +24 -12
  106. package/dist/esm/version.d.mts +1 -1
  107. package/dist/esm/version.mjs +1 -1
  108. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ import { toQueryString } from "./qs.mjs";
2
+ /**
3
+ * Creates a fluent builder for constructing URL query strings.
4
+ *
5
+ * Each `.add()` call serializes its value immediately (like C#'s builder),
6
+ * so no format tracking is needed — the style is applied at add-time.
7
+ *
8
+ * Usage (generated code):
9
+ *
10
+ * const qs = core.url.queryBuilder()
11
+ * .add("limit", limit)
12
+ * .add("tags", tags, { style: "comma" }) // explode: false
13
+ * .mergeAdditional(requestOptions?.queryParams)
14
+ * .build();
15
+ */
16
+ export function queryBuilder() {
17
+ return new QueryStringBuilder();
18
+ }
19
+ class QueryStringBuilder {
20
+ constructor() {
21
+ this.parts = new Map();
22
+ }
23
+ /**
24
+ * Adds a query parameter, serializing it immediately.
25
+ *
26
+ * By default arrays use "repeat" format (`key=a&key=b`).
27
+ * Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
28
+ * to get comma-separated values (`key=a,b,c`).
29
+ *
30
+ * Null / undefined values are silently skipped.
31
+ */
32
+ add(key, value, options) {
33
+ if (value === undefined || value === null) {
34
+ return this;
35
+ }
36
+ const serialized = toQueryString({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === "comma" ? "comma" : "repeat" });
37
+ if (serialized.length > 0) {
38
+ this.parts.set(key, serialized);
39
+ }
40
+ return this;
41
+ }
42
+ /**
43
+ * Adds multiple query parameters at once from a record.
44
+ * All parameters use the default "repeat" array format.
45
+ * Null / undefined values are silently skipped.
46
+ */
47
+ addMany(params) {
48
+ if (params != null) {
49
+ for (const [key, value] of Object.entries(params)) {
50
+ this.add(key, value);
51
+ }
52
+ }
53
+ return this;
54
+ }
55
+ /**
56
+ * Merges additional query parameters supplied at call-time via
57
+ * `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
58
+ */
59
+ mergeAdditional(additionalParams) {
60
+ if (additionalParams != null) {
61
+ for (const [key, value] of Object.entries(additionalParams)) {
62
+ if (value === undefined || value === null) {
63
+ continue;
64
+ }
65
+ const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" });
66
+ if (serialized.length > 0) {
67
+ this.parts.set(key, serialized);
68
+ }
69
+ }
70
+ }
71
+ return this;
72
+ }
73
+ /**
74
+ * Returns the assembled query string (without the leading `?`).
75
+ * Returns an empty string when no parameters were added.
76
+ */
77
+ build() {
78
+ return [...this.parts.values()].join("&");
79
+ }
80
+ }
@@ -1,3 +1,4 @@
1
1
  export { encodePathParam } from "./encodePathParam.mjs";
2
2
  export { join } from "./join.mjs";
3
+ export { queryBuilder } from "./QueryStringBuilder.mjs";
3
4
  export { toQueryString } from "./qs.mjs";
@@ -1,3 +1,4 @@
1
1
  export { encodePathParam } from "./encodePathParam.mjs";
2
2
  export { join } from "./join.mjs";
3
+ export { queryBuilder } from "./QueryStringBuilder.mjs";
3
4
  export { toQueryString } from "./qs.mjs";
@@ -1,5 +1,6 @@
1
+ type ArrayFormat = "indices" | "repeat" | "comma";
1
2
  interface QueryStringOptions {
2
- arrayFormat?: "indices" | "repeat";
3
+ arrayFormat?: ArrayFormat;
3
4
  encode?: boolean;
4
5
  }
5
6
  export declare function toQueryString(obj: unknown, options?: QueryStringOptions): string;
@@ -23,19 +23,31 @@ function stringifyObject(obj, prefix = "", options) {
23
23
  if (value.length === 0) {
24
24
  continue;
25
25
  }
26
- for (let i = 0; i < value.length; i++) {
27
- const item = value[i];
28
- if (item === undefined) {
29
- continue;
26
+ const effectiveFormat = options.arrayFormat;
27
+ if (effectiveFormat === "comma") {
28
+ const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
29
+ const encodedValues = value
30
+ .filter((item) => item !== undefined && item !== null)
31
+ .map((item) => encodeValue(item, options.encode));
32
+ if (encodedValues.length > 0) {
33
+ parts.push(`${encodedKey}=${encodedValues.join(",")}`);
30
34
  }
31
- if (typeof item === "object" && !Array.isArray(item) && item !== null) {
32
- const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
33
- parts.push(...stringifyObject(item, arrayKey, options));
34
- }
35
- else {
36
- const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
37
- const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
38
- parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
35
+ }
36
+ else {
37
+ for (let i = 0; i < value.length; i++) {
38
+ const item = value[i];
39
+ if (item === undefined) {
40
+ continue;
41
+ }
42
+ if (typeof item === "object" && !Array.isArray(item) && item !== null) {
43
+ const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
44
+ parts.push(...stringifyObject(item, arrayKey, options));
45
+ }
46
+ else {
47
+ const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
48
+ const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
49
+ parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
50
+ }
39
51
  }
40
52
  }
41
53
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.146";
1
+ export declare const SDK_VERSION = "0.0.147";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.146";
1
+ export const SDK_VERSION = "0.0.147";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payabli/sdk-node",
3
- "version": "0.0.146",
3
+ "version": "0.0.147",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",