@payabli/sdk-node 0.0.143 → 0.0.145

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 (187) 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.d.ts +38 -0
  6. package/dist/cjs/api/resources/boarding/client/Client.js +152 -11
  7. package/dist/cjs/api/resources/boarding/types/CreateApplicationFromPaypointRequest.d.ts +15 -0
  8. package/dist/cjs/api/resources/boarding/types/CreateApplicationFromPaypointRequest.js +3 -0
  9. package/dist/cjs/api/resources/boarding/types/CreateApplicationFromPaypointResponse.d.ts +20 -0
  10. package/dist/cjs/api/resources/boarding/types/CreateApplicationFromPaypointResponse.js +3 -0
  11. package/dist/cjs/api/resources/boarding/types/index.d.ts +2 -0
  12. package/dist/cjs/api/resources/boarding/types/index.js +2 -0
  13. package/dist/cjs/api/resources/chargeBacks/client/Client.js +3 -3
  14. package/dist/cjs/api/resources/checkCapture/client/Client.js +1 -1
  15. package/dist/cjs/api/resources/cloud/client/Client.js +8 -4
  16. package/dist/cjs/api/resources/customer/client/Client.js +10 -6
  17. package/dist/cjs/api/resources/export/client/Client.js +145 -29
  18. package/dist/cjs/api/resources/ghostCard/client/Client.js +2 -2
  19. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +3 -3
  20. package/dist/cjs/api/resources/import/client/Client.js +7 -3
  21. package/dist/cjs/api/resources/invoice/client/Client.js +35 -11
  22. package/dist/cjs/api/resources/lineItem/client/Client.js +9 -5
  23. package/dist/cjs/api/resources/management/client/Client.js +1 -1
  24. package/dist/cjs/api/resources/moneyIn/client/Client.js +43 -19
  25. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +5 -1
  26. package/dist/cjs/api/resources/moneyOut/client/Client.js +25 -13
  27. package/dist/cjs/api/resources/notification/client/Client.js +5 -5
  28. package/dist/cjs/api/resources/notificationlogs/client/Client.js +8 -4
  29. package/dist/cjs/api/resources/ocr/client/Client.js +2 -2
  30. package/dist/cjs/api/resources/organization/client/Client.js +7 -7
  31. package/dist/cjs/api/resources/paymentLink/client/Client.js +31 -11
  32. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +11 -7
  33. package/dist/cjs/api/resources/payoutSubscription/client/Client.js +4 -4
  34. package/dist/cjs/api/resources/paypoint/client/Client.js +12 -8
  35. package/dist/cjs/api/resources/query/client/Client.d.ts +58 -0
  36. package/dist/cjs/api/resources/query/client/Client.js +368 -40
  37. package/dist/cjs/api/resources/query/client/requests/ListSubscriptionsOrgRequest.d.ts +1 -0
  38. package/dist/cjs/api/resources/query/client/requests/ListSubscriptionsRequest.d.ts +1 -0
  39. package/dist/cjs/api/resources/query/client/requests/ListTransactionsOrgRequest.d.ts +9 -0
  40. package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +9 -0
  41. package/dist/cjs/api/resources/query/client/requests/ListVcardsOrgRequest.d.ts +8 -6
  42. package/dist/cjs/api/resources/query/client/requests/ListVcardsRequest.d.ts +8 -6
  43. package/dist/cjs/api/resources/query/client/requests/ListVcardsTransactionsOrgRequest.d.ts +72 -0
  44. package/dist/cjs/api/resources/query/client/requests/ListVcardsTransactionsOrgRequest.js +3 -0
  45. package/dist/cjs/api/resources/query/client/requests/ListVcardsTransactionsRequest.d.ts +72 -0
  46. package/dist/cjs/api/resources/query/client/requests/ListVcardsTransactionsRequest.js +3 -0
  47. package/dist/cjs/api/resources/query/client/requests/ListVendorsOrgRequest.d.ts +1 -0
  48. package/dist/cjs/api/resources/query/client/requests/ListVendorsRequest.d.ts +1 -0
  49. package/dist/cjs/api/resources/query/client/requests/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/queryTypes/types/QueryTransferDetailResponse.d.ts +2 -0
  51. package/dist/cjs/api/resources/queryTypes/types/QueryTransferSummary.d.ts +2 -0
  52. package/dist/cjs/api/resources/queryTypes/types/VCardTransactionQueryResponse.d.ts +49 -0
  53. package/dist/cjs/api/resources/queryTypes/types/VCardTransactionQueryResponse.js +3 -0
  54. package/dist/cjs/api/resources/queryTypes/types/VCardTransactionRecord.d.ts +86 -0
  55. package/dist/cjs/api/resources/queryTypes/types/VCardTransactionRecord.js +3 -0
  56. package/dist/cjs/api/resources/queryTypes/types/index.d.ts +2 -0
  57. package/dist/cjs/api/resources/queryTypes/types/index.js +2 -0
  58. package/dist/cjs/api/resources/statistic/client/Client.js +20 -4
  59. package/dist/cjs/api/resources/subscription/client/Client.js +8 -4
  60. package/dist/cjs/api/resources/templates/client/Client.js +8 -4
  61. package/dist/cjs/api/resources/tokenStorage/client/Client.js +16 -4
  62. package/dist/cjs/api/resources/user/client/Client.js +16 -12
  63. package/dist/cjs/api/resources/v2MoneyInTypes/types/V2TransactionDetails.d.ts +1 -1
  64. package/dist/cjs/api/resources/vendor/client/Client.js +5 -5
  65. package/dist/cjs/api/resources/wallet/client/Client.js +4 -4
  66. package/dist/cjs/api/types/AutoCapture.d.ts +5 -1
  67. package/dist/cjs/api/types/CustomerQueryRecords.d.ts +10 -8
  68. package/dist/cjs/api/types/CustomerSummaryRecord.d.ts +4 -4
  69. package/dist/cjs/api/types/QueryResponseTransactions.d.ts +74 -0
  70. package/dist/cjs/api/types/SplitCount.d.ts +4 -0
  71. package/dist/cjs/api/types/SplitCount.js +3 -0
  72. package/dist/cjs/api/types/SubscriptionQueryRecords.d.ts +11 -1
  73. package/dist/cjs/api/types/TransactionQueryRecords.d.ts +2 -1
  74. package/dist/cjs/api/types/TransactionQueryRecordsCustomer.d.ts +1 -0
  75. package/dist/cjs/api/types/VCardSummary.d.ts +4 -2
  76. package/dist/cjs/api/types/VendorResponseStoredMethod.d.ts +2 -1
  77. package/dist/cjs/api/types/index.d.ts +1 -0
  78. package/dist/cjs/api/types/index.js +1 -0
  79. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -0
  80. package/dist/cjs/core/auth/AuthProvider.js +7 -0
  81. package/dist/cjs/core/auth/index.d.ts +1 -1
  82. package/dist/cjs/core/auth/index.js +3 -1
  83. package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -0
  84. package/dist/cjs/core/fetcher/Fetcher.js +9 -8
  85. package/dist/cjs/core/fetcher/requestWithRetries.js +4 -1
  86. package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
  87. package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
  88. package/dist/cjs/core/url/index.d.ts +1 -0
  89. package/dist/cjs/core/url/index.js +3 -1
  90. package/dist/cjs/core/url/qs.d.ts +2 -1
  91. package/dist/cjs/core/url/qs.js +24 -12
  92. package/dist/cjs/version.d.ts +1 -1
  93. package/dist/cjs/version.js +1 -1
  94. package/dist/esm/BaseClient.d.mts +3 -0
  95. package/dist/esm/BaseClient.mjs +17 -2
  96. package/dist/esm/api/resources/bill/client/Client.mjs +35 -11
  97. package/dist/esm/api/resources/boarding/client/Client.d.mts +38 -0
  98. package/dist/esm/api/resources/boarding/client/Client.mjs +152 -11
  99. package/dist/esm/api/resources/boarding/types/CreateApplicationFromPaypointRequest.d.mts +15 -0
  100. package/dist/esm/api/resources/boarding/types/CreateApplicationFromPaypointRequest.mjs +2 -0
  101. package/dist/esm/api/resources/boarding/types/CreateApplicationFromPaypointResponse.d.mts +20 -0
  102. package/dist/esm/api/resources/boarding/types/CreateApplicationFromPaypointResponse.mjs +2 -0
  103. package/dist/esm/api/resources/boarding/types/index.d.mts +2 -0
  104. package/dist/esm/api/resources/boarding/types/index.mjs +2 -0
  105. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +3 -3
  106. package/dist/esm/api/resources/checkCapture/client/Client.mjs +1 -1
  107. package/dist/esm/api/resources/cloud/client/Client.mjs +8 -4
  108. package/dist/esm/api/resources/customer/client/Client.mjs +10 -6
  109. package/dist/esm/api/resources/export/client/Client.mjs +145 -29
  110. package/dist/esm/api/resources/ghostCard/client/Client.mjs +2 -2
  111. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +3 -3
  112. package/dist/esm/api/resources/import/client/Client.mjs +7 -3
  113. package/dist/esm/api/resources/invoice/client/Client.mjs +35 -11
  114. package/dist/esm/api/resources/lineItem/client/Client.mjs +9 -5
  115. package/dist/esm/api/resources/management/client/Client.mjs +1 -1
  116. package/dist/esm/api/resources/moneyIn/client/Client.mjs +43 -19
  117. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +5 -1
  118. package/dist/esm/api/resources/moneyOut/client/Client.mjs +25 -13
  119. package/dist/esm/api/resources/notification/client/Client.mjs +5 -5
  120. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +8 -4
  121. package/dist/esm/api/resources/ocr/client/Client.mjs +2 -2
  122. package/dist/esm/api/resources/organization/client/Client.mjs +7 -7
  123. package/dist/esm/api/resources/paymentLink/client/Client.mjs +31 -11
  124. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +11 -7
  125. package/dist/esm/api/resources/payoutSubscription/client/Client.mjs +4 -4
  126. package/dist/esm/api/resources/paypoint/client/Client.mjs +12 -8
  127. package/dist/esm/api/resources/query/client/Client.d.mts +58 -0
  128. package/dist/esm/api/resources/query/client/Client.mjs +368 -40
  129. package/dist/esm/api/resources/query/client/requests/ListSubscriptionsOrgRequest.d.mts +1 -0
  130. package/dist/esm/api/resources/query/client/requests/ListSubscriptionsRequest.d.mts +1 -0
  131. package/dist/esm/api/resources/query/client/requests/ListTransactionsOrgRequest.d.mts +9 -0
  132. package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +9 -0
  133. package/dist/esm/api/resources/query/client/requests/ListVcardsOrgRequest.d.mts +8 -6
  134. package/dist/esm/api/resources/query/client/requests/ListVcardsRequest.d.mts +8 -6
  135. package/dist/esm/api/resources/query/client/requests/ListVcardsTransactionsOrgRequest.d.mts +72 -0
  136. package/dist/esm/api/resources/query/client/requests/ListVcardsTransactionsOrgRequest.mjs +2 -0
  137. package/dist/esm/api/resources/query/client/requests/ListVcardsTransactionsRequest.d.mts +72 -0
  138. package/dist/esm/api/resources/query/client/requests/ListVcardsTransactionsRequest.mjs +2 -0
  139. package/dist/esm/api/resources/query/client/requests/ListVendorsOrgRequest.d.mts +1 -0
  140. package/dist/esm/api/resources/query/client/requests/ListVendorsRequest.d.mts +1 -0
  141. package/dist/esm/api/resources/query/client/requests/index.d.mts +2 -0
  142. package/dist/esm/api/resources/queryTypes/types/QueryTransferDetailResponse.d.mts +2 -0
  143. package/dist/esm/api/resources/queryTypes/types/QueryTransferSummary.d.mts +2 -0
  144. package/dist/esm/api/resources/queryTypes/types/VCardTransactionQueryResponse.d.mts +49 -0
  145. package/dist/esm/api/resources/queryTypes/types/VCardTransactionQueryResponse.mjs +2 -0
  146. package/dist/esm/api/resources/queryTypes/types/VCardTransactionRecord.d.mts +86 -0
  147. package/dist/esm/api/resources/queryTypes/types/VCardTransactionRecord.mjs +2 -0
  148. package/dist/esm/api/resources/queryTypes/types/index.d.mts +2 -0
  149. package/dist/esm/api/resources/queryTypes/types/index.mjs +2 -0
  150. package/dist/esm/api/resources/statistic/client/Client.mjs +20 -4
  151. package/dist/esm/api/resources/subscription/client/Client.mjs +8 -4
  152. package/dist/esm/api/resources/templates/client/Client.mjs +8 -4
  153. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +16 -4
  154. package/dist/esm/api/resources/user/client/Client.mjs +16 -12
  155. package/dist/esm/api/resources/v2MoneyInTypes/types/V2TransactionDetails.d.mts +1 -1
  156. package/dist/esm/api/resources/vendor/client/Client.mjs +5 -5
  157. package/dist/esm/api/resources/wallet/client/Client.mjs +4 -4
  158. package/dist/esm/api/types/AutoCapture.d.mts +5 -1
  159. package/dist/esm/api/types/CustomerQueryRecords.d.mts +10 -8
  160. package/dist/esm/api/types/CustomerSummaryRecord.d.mts +4 -4
  161. package/dist/esm/api/types/QueryResponseTransactions.d.mts +74 -0
  162. package/dist/esm/api/types/SplitCount.d.mts +4 -0
  163. package/dist/esm/api/types/SplitCount.mjs +2 -0
  164. package/dist/esm/api/types/SubscriptionQueryRecords.d.mts +11 -1
  165. package/dist/esm/api/types/TransactionQueryRecords.d.mts +2 -1
  166. package/dist/esm/api/types/TransactionQueryRecordsCustomer.d.mts +1 -0
  167. package/dist/esm/api/types/VCardSummary.d.mts +4 -2
  168. package/dist/esm/api/types/VendorResponseStoredMethod.d.mts +2 -1
  169. package/dist/esm/api/types/index.d.mts +1 -0
  170. package/dist/esm/api/types/index.mjs +1 -0
  171. package/dist/esm/core/auth/AuthProvider.d.mts +1 -0
  172. package/dist/esm/core/auth/AuthProvider.mjs +6 -1
  173. package/dist/esm/core/auth/index.d.mts +1 -1
  174. package/dist/esm/core/auth/index.mjs +1 -0
  175. package/dist/esm/core/fetcher/Fetcher.d.mts +6 -0
  176. package/dist/esm/core/fetcher/Fetcher.mjs +9 -8
  177. package/dist/esm/core/fetcher/requestWithRetries.mjs +4 -1
  178. package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
  179. package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
  180. package/dist/esm/core/url/index.d.mts +1 -0
  181. package/dist/esm/core/url/index.mjs +1 -0
  182. package/dist/esm/core/url/qs.d.mts +2 -1
  183. package/dist/esm/core/url/qs.mjs +24 -12
  184. package/dist/esm/version.d.mts +1 -1
  185. package/dist/esm/version.mjs +1 -1
  186. package/package.json +1 -1
  187. package/reference.md +287 -1
@@ -8,7 +8,13 @@ export declare namespace Fetcher {
8
8
  method: string;
9
9
  contentType?: string;
10
10
  headers?: Record<string, unknown>;
11
+ /**
12
+ * @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
13
+ * Retained for backwards compatibility with custom fetchers and callers that
14
+ * still construct request args with a query-parameter object.
15
+ */
11
16
  queryParameters?: Record<string, unknown>;
17
+ queryString?: string;
12
18
  body?: unknown;
13
19
  timeoutMs?: number;
14
20
  maxRetries?: number;
@@ -71,16 +71,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
71
71
  ]);
72
72
  function redactQueryParameters(queryParameters) {
73
73
  if (queryParameters == null) {
74
- return queryParameters;
74
+ return undefined;
75
75
  }
76
76
  const redacted = {};
77
77
  for (const [key, value] of Object.entries(queryParameters)) {
78
- if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) {
79
- redacted[key] = "[REDACTED]";
80
- }
81
- else {
82
- redacted[key] = value;
83
- }
78
+ redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
84
79
  }
85
80
  return redacted;
86
81
  }
@@ -182,7 +177,13 @@ function getHeaders(args) {
182
177
  export function fetcherImpl(args) {
183
178
  return __awaiter(this, void 0, void 0, function* () {
184
179
  var _a, _b, _c;
185
- const url = createRequestUrl(args.url, args.queryParameters);
180
+ let url = args.url;
181
+ if (args.queryString != null && args.queryString.length > 0) {
182
+ url = `${url}?${args.queryString}`;
183
+ }
184
+ else {
185
+ url = createRequestUrl(args.url, args.queryParameters);
186
+ }
186
187
  const requestBody = yield getRequestBody({
187
188
  body: args.body,
188
189
  type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
@@ -11,6 +11,9 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
11
11
  const MAX_RETRY_DELAY = 60000; // in milliseconds
12
12
  const DEFAULT_MAX_RETRIES = 2;
13
13
  const JITTER_FACTOR = 0.2; // 20% random jitter
14
+ function isRetryableStatusCode(statusCode) {
15
+ return [408, 429].includes(statusCode) || statusCode >= 500;
16
+ }
14
17
  function addPositiveJitter(delay) {
15
18
  const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
16
19
  return delay * jitterMultiplier;
@@ -50,7 +53,7 @@ export function requestWithRetries(requestFn_1) {
50
53
  return __awaiter(this, arguments, void 0, function* (requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
51
54
  let response = yield requestFn();
52
55
  for (let i = 0; i < maxRetries; ++i) {
53
- if ([408, 429].includes(response.status) || response.status >= 500) {
56
+ if (isRetryableStatusCode(response.status)) {
54
57
  const delay = getRetryDelayFromHeaders(response, i);
55
58
  yield new Promise((resolve) => setTimeout(resolve, delay));
56
59
  response = yield requestFn();
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Creates a fluent builder for constructing URL query strings.
3
+ *
4
+ * Each `.add()` call serializes its value immediately (like C#'s builder),
5
+ * so no format tracking is needed — the style is applied at add-time.
6
+ *
7
+ * Usage (generated code):
8
+ *
9
+ * const qs = core.url.queryBuilder()
10
+ * .add("limit", limit)
11
+ * .add("tags", tags, { style: "comma" }) // explode: false
12
+ * .mergeAdditional(requestOptions?.queryParams)
13
+ * .build();
14
+ */
15
+ export declare function queryBuilder(): QueryStringBuilder;
16
+ declare class QueryStringBuilder {
17
+ private parts;
18
+ /**
19
+ * Adds a query parameter, serializing it immediately.
20
+ *
21
+ * By default arrays use "repeat" format (`key=a&key=b`).
22
+ * Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
23
+ * to get comma-separated values (`key=a,b,c`).
24
+ *
25
+ * Null / undefined values are silently skipped.
26
+ */
27
+ add(key: string, value: unknown, options?: {
28
+ style?: "comma";
29
+ }): this;
30
+ /**
31
+ * Adds multiple query parameters at once from a record.
32
+ * All parameters use the default "repeat" array format.
33
+ * Null / undefined values are silently skipped.
34
+ */
35
+ addMany(params: Record<string, unknown>): this;
36
+ /**
37
+ * Merges additional query parameters supplied at call-time via
38
+ * `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
39
+ */
40
+ mergeAdditional(additionalParams?: Record<string, unknown>): this;
41
+ /**
42
+ * Returns the assembled query string (without the leading `?`).
43
+ * Returns an empty string when no parameters were added.
44
+ */
45
+ build(): string;
46
+ }
47
+ export {};
@@ -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.143";
1
+ export declare const SDK_VERSION = "0.0.145";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.143";
1
+ export const SDK_VERSION = "0.0.145";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payabli/sdk-node",
3
- "version": "0.0.143",
3
+ "version": "0.0.145",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1740,6 +1740,138 @@ await client.boarding.updateApplication(352, {});
1740
1740
  </dl>
1741
1741
 
1742
1742
 
1743
+ </dd>
1744
+ </dl>
1745
+ </details>
1746
+
1747
+ <details><summary><code>client.boarding.<a href="/src/api/resources/boarding/client/Client.ts">addServiceToPaypointFromApp</a>({ ...params }) -> Payabli.CreateApplicationFromPaypointResponse</code></summary>
1748
+ <dl>
1749
+ <dd>
1750
+
1751
+ #### 📝 Description
1752
+
1753
+ <dl>
1754
+ <dd>
1755
+
1756
+ <dl>
1757
+ <dd>
1758
+
1759
+ Creates a new boarding application linked to an existing paypoint as part of the multi-product boarding flow. Use this endpoint to add new services to a paypoint without creating a duplicate record. The system copies eligible business, contact, banking, and address data from the paypoint to the new application based on 1:1 field matching. The merchant only needs to provide fields that are specific to the new service. See the [Multi-product boarding](/guides/pay-ops-developer-boarding-multi-product) guide for the full flow.
1760
+ </dd>
1761
+ </dl>
1762
+ </dd>
1763
+ </dl>
1764
+
1765
+ #### 🔌 Usage
1766
+
1767
+ <dl>
1768
+ <dd>
1769
+
1770
+ <dl>
1771
+ <dd>
1772
+
1773
+ ```typescript
1774
+ await client.boarding.addServiceToPaypointFromApp({
1775
+ paypointId: 123,
1776
+ templateId: 456,
1777
+ recipientEmail: "merchant@example.com",
1778
+ returnBoardingAccessInfoInLine: true,
1779
+ onCreate: ["submitApplication"]
1780
+ });
1781
+
1782
+ ```
1783
+ </dd>
1784
+ </dl>
1785
+ </dd>
1786
+ </dl>
1787
+
1788
+ #### ⚙️ Parameters
1789
+
1790
+ <dl>
1791
+ <dd>
1792
+
1793
+ <dl>
1794
+ <dd>
1795
+
1796
+ **request:** `Payabli.CreateApplicationFromPaypointRequest`
1797
+
1798
+ </dd>
1799
+ </dl>
1800
+
1801
+ <dl>
1802
+ <dd>
1803
+
1804
+ **requestOptions:** `BoardingClient.RequestOptions`
1805
+
1806
+ </dd>
1807
+ </dl>
1808
+ </dd>
1809
+ </dl>
1810
+
1811
+
1812
+ </dd>
1813
+ </dl>
1814
+ </details>
1815
+
1816
+ <details><summary><code>client.boarding.<a href="/src/api/resources/boarding/client/Client.ts">getApplicationsByPaypointId</a>(paypointId) -> Payabli.QueryBoardingAppsListResponse</code></summary>
1817
+ <dl>
1818
+ <dd>
1819
+
1820
+ #### 📝 Description
1821
+
1822
+ <dl>
1823
+ <dd>
1824
+
1825
+ <dl>
1826
+ <dd>
1827
+
1828
+ Returns all boarding applications associated with a specific paypoint, including those created through the multi-product boarding flow. Use this endpoint to track underwriting progress across multiple service additions or to build reporting views. See the [Multi-product boarding](/guides/pay-ops-developer-boarding-multi-product) guide for the full flow.
1829
+ </dd>
1830
+ </dl>
1831
+ </dd>
1832
+ </dl>
1833
+
1834
+ #### 🔌 Usage
1835
+
1836
+ <dl>
1837
+ <dd>
1838
+
1839
+ <dl>
1840
+ <dd>
1841
+
1842
+ ```typescript
1843
+ await client.boarding.getApplicationsByPaypointId(12345);
1844
+
1845
+ ```
1846
+ </dd>
1847
+ </dl>
1848
+ </dd>
1849
+ </dl>
1850
+
1851
+ #### ⚙️ Parameters
1852
+
1853
+ <dl>
1854
+ <dd>
1855
+
1856
+ <dl>
1857
+ <dd>
1858
+
1859
+ **paypointId:** `number` — ID of the paypoint to retrieve applications for.
1860
+
1861
+ </dd>
1862
+ </dl>
1863
+
1864
+ <dl>
1865
+ <dd>
1866
+
1867
+ **requestOptions:** `BoardingClient.RequestOptions`
1868
+
1869
+ </dd>
1870
+ </dl>
1871
+ </dd>
1872
+ </dl>
1873
+
1874
+
1743
1875
  </dd>
1744
1876
  </dl>
1745
1877
  </details>
@@ -8507,7 +8639,11 @@ await client.moneyIn.voidv2("10-3ffa27df-b171-44e0-b251-e95fbfc7a723");
8507
8639
  <dl>
8508
8640
  <dd>
8509
8641
 
8510
- Authorizes transaction for payout. If you don't pass the `autoCapture` field with a value of `true`, authorized transactions aren't flagged for settlement until captured. Use `referenceId` returned in the response to capture the transaction.
8642
+ Authorizes a transaction for payout.
8643
+
8644
+ If you don't pass `autoCapture` with a value of `true`, authorized transactions aren't flagged for settlement until captured. Use the `referenceId` returned in the response to capture the transaction.
8645
+
8646
+ When `autoCapture` is `true`, Payabli captures the transaction asynchronously after authorization. The response confirms only that the transaction was authorized; it doesn't confirm that capture succeeded. To confirm capture, listen for the [`payout_transaction_approvedcaptured`](/developers/webhooks/payout-transaction-approved-captured) webhook event.
8511
8647
  </dd>
8512
8648
  </dl>
8513
8649
  </dd>
@@ -15928,6 +16064,156 @@ await client.query.listVcards("8cfec329267", {
15928
16064
  </dl>
15929
16065
 
15930
16066
 
16067
+ </dd>
16068
+ </dl>
16069
+ </details>
16070
+
16071
+ <details><summary><code>client.query.<a href="/src/api/resources/query/client/Client.ts">listVcardsTransactions</a>(entry, { ...params }) -> Payabli.VCardTransactionQueryResponse</code></summary>
16072
+ <dl>
16073
+ <dd>
16074
+
16075
+ #### 📝 Description
16076
+
16077
+ <dl>
16078
+ <dd>
16079
+
16080
+ <dl>
16081
+ <dd>
16082
+
16083
+ Retrieve a list of virtual card transactions for an entrypoint. Use filters to limit results.
16084
+ </dd>
16085
+ </dl>
16086
+ </dd>
16087
+ </dl>
16088
+
16089
+ #### 🔌 Usage
16090
+
16091
+ <dl>
16092
+ <dd>
16093
+
16094
+ <dl>
16095
+ <dd>
16096
+
16097
+ ```typescript
16098
+ await client.query.listVcardsTransactions("8cfec329267", {
16099
+ fromRecord: 0,
16100
+ limitRecord: 20,
16101
+ sortBy: "desc(CreatedOn)"
16102
+ });
16103
+
16104
+ ```
16105
+ </dd>
16106
+ </dl>
16107
+ </dd>
16108
+ </dl>
16109
+
16110
+ #### ⚙️ Parameters
16111
+
16112
+ <dl>
16113
+ <dd>
16114
+
16115
+ <dl>
16116
+ <dd>
16117
+
16118
+ **entry:** `Payabli.Entry`
16119
+
16120
+ </dd>
16121
+ </dl>
16122
+
16123
+ <dl>
16124
+ <dd>
16125
+
16126
+ **request:** `Payabli.ListVcardsTransactionsRequest`
16127
+
16128
+ </dd>
16129
+ </dl>
16130
+
16131
+ <dl>
16132
+ <dd>
16133
+
16134
+ **requestOptions:** `QueryClient.RequestOptions`
16135
+
16136
+ </dd>
16137
+ </dl>
16138
+ </dd>
16139
+ </dl>
16140
+
16141
+
16142
+ </dd>
16143
+ </dl>
16144
+ </details>
16145
+
16146
+ <details><summary><code>client.query.<a href="/src/api/resources/query/client/Client.ts">listVcardsTransactionsOrg</a>(orgId, { ...params }) -> Payabli.VCardTransactionQueryResponse</code></summary>
16147
+ <dl>
16148
+ <dd>
16149
+
16150
+ #### 📝 Description
16151
+
16152
+ <dl>
16153
+ <dd>
16154
+
16155
+ <dl>
16156
+ <dd>
16157
+
16158
+ Retrieve a list of virtual card transactions for an organization. Use filters to limit results.
16159
+ </dd>
16160
+ </dl>
16161
+ </dd>
16162
+ </dl>
16163
+
16164
+ #### 🔌 Usage
16165
+
16166
+ <dl>
16167
+ <dd>
16168
+
16169
+ <dl>
16170
+ <dd>
16171
+
16172
+ ```typescript
16173
+ await client.query.listVcardsTransactionsOrg(123, {
16174
+ fromRecord: 0,
16175
+ limitRecord: 20,
16176
+ sortBy: "desc(CreatedOn)"
16177
+ });
16178
+
16179
+ ```
16180
+ </dd>
16181
+ </dl>
16182
+ </dd>
16183
+ </dl>
16184
+
16185
+ #### ⚙️ Parameters
16186
+
16187
+ <dl>
16188
+ <dd>
16189
+
16190
+ <dl>
16191
+ <dd>
16192
+
16193
+ **orgId:** `number` — The numeric identifier for organization, assigned by Payabli.
16194
+
16195
+ </dd>
16196
+ </dl>
16197
+
16198
+ <dl>
16199
+ <dd>
16200
+
16201
+ **request:** `Payabli.ListVcardsTransactionsOrgRequest`
16202
+
16203
+ </dd>
16204
+ </dl>
16205
+
16206
+ <dl>
16207
+ <dd>
16208
+
16209
+ **requestOptions:** `QueryClient.RequestOptions`
16210
+
16211
+ </dd>
16212
+ </dl>
16213
+ </dd>
16214
+ </dl>
16215
+
16216
+
15931
16217
  </dd>
15932
16218
  </dl>
15933
16219
  </details>