@payabli/sdk-node 0.0.116 → 0.0.117

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 (230) hide show
  1. package/README.md +24 -7
  2. package/dist/cjs/BaseClient.d.ts +10 -1
  3. package/dist/cjs/BaseClient.js +57 -0
  4. package/dist/cjs/Client.d.ts +87 -86
  5. package/dist/cjs/Client.js +31 -72
  6. package/dist/cjs/api/resources/bill/client/Client.d.ts +33 -33
  7. package/dist/cjs/api/resources/bill/client/Client.js +69 -216
  8. package/dist/cjs/api/resources/boarding/client/Client.d.ts +27 -27
  9. package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
  10. package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +17 -15
  11. package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
  12. package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +7 -7
  13. package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
  14. package/dist/cjs/api/resources/cloud/client/Client.d.ts +17 -17
  15. package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
  16. package/dist/cjs/api/resources/customer/client/Client.d.ts +17 -17
  17. package/dist/cjs/api/resources/customer/client/Client.js +31 -113
  18. package/dist/cjs/api/resources/export/client/Client.d.ts +93 -89
  19. package/dist/cjs/api/resources/export/client/Client.js +205 -582
  20. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +11 -11
  21. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
  22. package/dist/cjs/api/resources/import/client/Client.d.ts +11 -11
  23. package/dist/cjs/api/resources/import/client/Client.js +19 -62
  24. package/dist/cjs/api/resources/invoice/client/Client.d.ts +31 -31
  25. package/dist/cjs/api/resources/invoice/client/Client.js +62 -209
  26. package/dist/cjs/api/resources/lineItem/client/Client.d.ts +15 -15
  27. package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
  28. package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +39 -39
  29. package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
  30. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +43 -26
  31. package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
  32. package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
  33. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
  34. package/dist/cjs/api/resources/notification/client/Client.d.ts +16 -16
  35. package/dist/cjs/api/resources/notification/client/Client.js +32 -101
  36. package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +13 -13
  37. package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
  38. package/dist/cjs/api/resources/ocr/client/Client.d.ts +13 -9
  39. package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
  40. package/dist/cjs/api/resources/organization/client/Client.d.ts +19 -19
  41. package/dist/cjs/api/resources/organization/client/Client.js +35 -130
  42. package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +23 -23
  43. package/dist/cjs/api/resources/paymentLink/client/Client.js +43 -164
  44. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +19 -19
  45. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
  46. package/dist/cjs/api/resources/paypoint/client/Client.d.ts +22 -22
  47. package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
  48. package/dist/cjs/api/resources/query/client/Client.d.ts +71 -71
  49. package/dist/cjs/api/resources/query/client/Client.js +137 -572
  50. package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
  51. package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
  52. package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
  53. package/dist/cjs/api/resources/statistic/client/Client.d.ts +50 -50
  54. package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
  55. package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
  56. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
  57. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
  58. package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/statistic/types/index.js +1 -0
  60. package/dist/cjs/api/resources/subscription/client/Client.d.ts +13 -13
  61. package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
  62. package/dist/cjs/api/resources/templates/client/Client.d.ts +15 -15
  63. package/dist/cjs/api/resources/templates/client/Client.js +28 -84
  64. package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +13 -13
  65. package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
  66. package/dist/cjs/api/resources/user/client/Client.d.ts +54 -32
  67. package/dist/cjs/api/resources/user/client/Client.js +84 -222
  68. package/dist/cjs/api/resources/vendor/client/Client.d.ts +13 -13
  69. package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
  70. package/dist/cjs/api/resources/wallet/client/Client.d.ts +13 -13
  71. package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
  72. package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
  73. package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
  74. package/dist/cjs/api/types/NotificationContent.js +1 -0
  75. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
  76. package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
  77. package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
  78. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -0
  79. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  80. package/dist/cjs/auth/index.d.ts +1 -0
  81. package/dist/cjs/auth/index.js +5 -0
  82. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  83. package/dist/cjs/{version.js → core/auth/AuthProvider.js} +0 -2
  84. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  85. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  86. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  87. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  88. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  89. package/dist/cjs/core/auth/BearerToken.js +16 -0
  90. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  91. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  92. package/dist/cjs/core/auth/index.d.ts +5 -0
  93. package/dist/cjs/core/auth/index.js +9 -0
  94. package/dist/cjs/core/base64.d.ts +2 -0
  95. package/dist/cjs/core/base64.js +26 -0
  96. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  97. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
  98. package/dist/cjs/core/fetcher/Fetcher.js +42 -24
  99. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  100. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  101. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  102. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  103. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  104. package/dist/cjs/core/fetcher/signals.js +0 -12
  105. package/dist/cjs/core/index.d.ts +2 -0
  106. package/dist/cjs/core/index.js +2 -0
  107. package/dist/cjs/core/logging/logger.js +1 -1
  108. package/dist/cjs/core/runtime/runtime.js +11 -10
  109. package/dist/cjs/core/url/join.js +0 -1
  110. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  111. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  112. package/dist/esm/BaseClient.d.mts +10 -1
  113. package/dist/esm/BaseClient.mjs +22 -1
  114. package/dist/esm/Client.d.mts +87 -86
  115. package/dist/esm/Client.mjs +59 -67
  116. package/dist/esm/api/resources/bill/client/Client.d.mts +33 -33
  117. package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
  118. package/dist/esm/api/resources/boarding/client/Client.d.mts +27 -27
  119. package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
  120. package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +17 -15
  121. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
  122. package/dist/esm/api/resources/checkCapture/client/Client.d.mts +7 -7
  123. package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
  124. package/dist/esm/api/resources/cloud/client/Client.d.mts +17 -17
  125. package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
  126. package/dist/esm/api/resources/customer/client/Client.d.mts +17 -17
  127. package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
  128. package/dist/esm/api/resources/export/client/Client.d.mts +93 -89
  129. package/dist/esm/api/resources/export/client/Client.mjs +204 -581
  130. package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +11 -11
  131. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
  132. package/dist/esm/api/resources/import/client/Client.d.mts +11 -11
  133. package/dist/esm/api/resources/import/client/Client.mjs +17 -60
  134. package/dist/esm/api/resources/invoice/client/Client.d.mts +31 -31
  135. package/dist/esm/api/resources/invoice/client/Client.mjs +60 -207
  136. package/dist/esm/api/resources/lineItem/client/Client.d.mts +15 -15
  137. package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
  138. package/dist/esm/api/resources/moneyIn/client/Client.d.mts +39 -39
  139. package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
  140. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +43 -26
  141. package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
  142. package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
  143. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
  144. package/dist/esm/api/resources/notification/client/Client.d.mts +16 -16
  145. package/dist/esm/api/resources/notification/client/Client.mjs +31 -100
  146. package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +13 -13
  147. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
  148. package/dist/esm/api/resources/ocr/client/Client.d.mts +13 -9
  149. package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
  150. package/dist/esm/api/resources/organization/client/Client.d.mts +19 -19
  151. package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
  152. package/dist/esm/api/resources/paymentLink/client/Client.d.mts +23 -23
  153. package/dist/esm/api/resources/paymentLink/client/Client.mjs +41 -162
  154. package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +19 -19
  155. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
  156. package/dist/esm/api/resources/paypoint/client/Client.d.mts +22 -22
  157. package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
  158. package/dist/esm/api/resources/query/client/Client.d.mts +71 -71
  159. package/dist/esm/api/resources/query/client/Client.mjs +136 -571
  160. package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
  161. package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
  162. package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
  163. package/dist/esm/api/resources/statistic/client/Client.d.mts +50 -50
  164. package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
  165. package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
  166. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
  167. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
  168. package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
  169. package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
  170. package/dist/esm/api/resources/subscription/client/Client.d.mts +13 -13
  171. package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
  172. package/dist/esm/api/resources/templates/client/Client.d.mts +15 -15
  173. package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
  174. package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +13 -13
  175. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
  176. package/dist/esm/api/resources/user/client/Client.d.mts +54 -32
  177. package/dist/esm/api/resources/user/client/Client.mjs +83 -221
  178. package/dist/esm/api/resources/vendor/client/Client.d.mts +13 -13
  179. package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
  180. package/dist/esm/api/resources/wallet/client/Client.d.mts +13 -13
  181. package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
  182. package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
  183. package/dist/esm/api/types/NotificationContent.d.mts +1 -0
  184. package/dist/esm/api/types/NotificationContent.mjs +1 -0
  185. package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
  186. package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
  187. package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
  188. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -0
  189. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  190. package/dist/esm/auth/index.d.mts +1 -0
  191. package/dist/esm/auth/index.mjs +1 -0
  192. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  193. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  194. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  195. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  196. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  197. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  198. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  199. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  200. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  201. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  202. package/dist/esm/core/auth/index.d.mts +5 -0
  203. package/dist/esm/core/auth/index.mjs +3 -0
  204. package/dist/esm/core/base64.d.mts +2 -0
  205. package/dist/esm/core/base64.mjs +22 -0
  206. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  207. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
  208. package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
  209. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  210. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  211. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  212. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  213. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  214. package/dist/esm/core/fetcher/signals.mjs +0 -12
  215. package/dist/esm/core/index.d.mts +2 -0
  216. package/dist/esm/core/index.mjs +2 -0
  217. package/dist/esm/core/logging/logger.mjs +1 -1
  218. package/dist/esm/core/runtime/runtime.mjs +11 -10
  219. package/dist/esm/core/url/join.mjs +0 -1
  220. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  221. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  222. package/package.json +4 -4
  223. package/reference.md +761 -473
  224. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  225. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  226. package/dist/cjs/version.d.ts +0 -1
  227. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  228. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
  229. package/dist/esm/version.d.mts +0 -1
  230. package/dist/esm/version.mjs +0 -1
@@ -43,21 +43,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.MoneyOut = void 0;
46
+ exports.MoneyOutClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
47
48
  const headers_js_1 = require("../../../../core/headers.js");
48
49
  const core = __importStar(require("../../../../core/index.js"));
49
50
  const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
50
52
  const errors = __importStar(require("../../../../errors/index.js"));
51
53
  const Payabli = __importStar(require("../../../index.js"));
52
- class MoneyOut {
53
- constructor(_options = {}) {
54
- this._options = _options;
54
+ class MoneyOutClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
57
  }
56
58
  /**
57
59
  * Authorizes transaction for payout. Authorized transactions aren't flagged for settlement until captured. Use `referenceId` returned in the response to capture the transaction.
58
60
  *
59
61
  * @param {Payabli.MoneyOutTypesRequestOutAuthorize} request
60
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
62
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
61
63
  *
62
64
  * @throws {@link Payabli.BadRequestError}
63
65
  * @throws {@link Payabli.UnauthorizedError}
@@ -73,7 +75,8 @@ class MoneyOut {
73
75
  * }],
74
76
  * orderDescription: "Window Painting",
75
77
  * paymentDetails: {
76
- * totalAmount: 47
78
+ * totalAmount: 47,
79
+ * unbundled: false
77
80
  * },
78
81
  * paymentMethod: {
79
82
  * method: "managed"
@@ -200,7 +203,8 @@ class MoneyOut {
200
203
  if (forceVendorCreation != null) {
201
204
  _queryParams.forceVendorCreation = forceVendorCreation.toString();
202
205
  }
203
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
206
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
207
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
204
208
  const _response = yield core.fetcher({
205
209
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "MoneyOut/authorize"),
206
210
  method: "POST",
@@ -236,28 +240,14 @@ class MoneyOut {
236
240
  });
237
241
  }
238
242
  }
239
- switch (_response.error.reason) {
240
- case "non-json":
241
- throw new errors.PayabliError({
242
- statusCode: _response.error.statusCode,
243
- body: _response.error.rawBody,
244
- rawResponse: _response.rawResponse,
245
- });
246
- case "timeout":
247
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /MoneyOut/authorize.");
248
- case "unknown":
249
- throw new errors.PayabliError({
250
- message: _response.error.errorMessage,
251
- rawResponse: _response.rawResponse,
252
- });
253
- }
243
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/MoneyOut/authorize");
254
244
  });
255
245
  }
256
246
  /**
257
247
  * Cancels an array of payout transactions.
258
248
  *
259
249
  * @param {string[]} request
260
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
250
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
261
251
  *
262
252
  * @throws {@link Payabli.BadRequestError}
263
253
  * @throws {@link Payabli.UnauthorizedError}
@@ -273,7 +263,8 @@ class MoneyOut {
273
263
  __cancelAllOut(request, requestOptions) {
274
264
  return __awaiter(this, void 0, void 0, function* () {
275
265
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
276
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
266
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
267
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
277
268
  const _response = yield core.fetcher({
278
269
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "MoneyOut/cancelAll"),
279
270
  method: "POST",
@@ -309,28 +300,14 @@ class MoneyOut {
309
300
  });
310
301
  }
311
302
  }
312
- switch (_response.error.reason) {
313
- case "non-json":
314
- throw new errors.PayabliError({
315
- statusCode: _response.error.statusCode,
316
- body: _response.error.rawBody,
317
- rawResponse: _response.rawResponse,
318
- });
319
- case "timeout":
320
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /MoneyOut/cancelAll.");
321
- case "unknown":
322
- throw new errors.PayabliError({
323
- message: _response.error.errorMessage,
324
- rawResponse: _response.rawResponse,
325
- });
326
- }
303
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/MoneyOut/cancelAll");
327
304
  });
328
305
  }
329
306
  /**
330
307
  * Cancel a payout transaction by ID.
331
308
  *
332
309
  * @param {string} referenceId - The ID for the payout transaction.
333
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
310
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
334
311
  *
335
312
  * @throws {@link Payabli.BadRequestError}
336
313
  * @throws {@link Payabli.UnauthorizedError}
@@ -338,15 +315,16 @@ class MoneyOut {
338
315
  * @throws {@link Payabli.ServiceUnavailableError}
339
316
  *
340
317
  * @example
341
- * await client.moneyOut.cancelOut("129-219")
318
+ * await client.moneyOut.cancelOutGet("129-219")
342
319
  */
343
- cancelOut(referenceId, requestOptions) {
344
- return core.HttpResponsePromise.fromPromise(this.__cancelOut(referenceId, requestOptions));
320
+ cancelOutGet(referenceId, requestOptions) {
321
+ return core.HttpResponsePromise.fromPromise(this.__cancelOutGet(referenceId, requestOptions));
345
322
  }
346
- __cancelOut(referenceId, requestOptions) {
323
+ __cancelOutGet(referenceId, requestOptions) {
347
324
  return __awaiter(this, void 0, void 0, function* () {
348
325
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
349
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
326
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
327
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
350
328
  const _response = yield core.fetcher({
351
329
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/cancel/${core.url.encodePathParam(referenceId)}`),
352
330
  method: "GET",
@@ -379,28 +357,71 @@ class MoneyOut {
379
357
  });
380
358
  }
381
359
  }
382
- switch (_response.error.reason) {
383
- case "non-json":
384
- throw new errors.PayabliError({
385
- statusCode: _response.error.statusCode,
386
- body: _response.error.rawBody,
387
- rawResponse: _response.rawResponse,
388
- });
389
- case "timeout":
390
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /MoneyOut/cancel/{referenceId}.");
391
- case "unknown":
392
- throw new errors.PayabliError({
393
- message: _response.error.errorMessage,
394
- rawResponse: _response.rawResponse,
395
- });
360
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyOut/cancel/{referenceId}");
361
+ });
362
+ }
363
+ /**
364
+ * Cancel a payout transaction by ID.
365
+ *
366
+ * @param {string} referenceId - The ID for the payout transaction.
367
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
368
+ *
369
+ * @throws {@link Payabli.BadRequestError}
370
+ * @throws {@link Payabli.UnauthorizedError}
371
+ * @throws {@link Payabli.InternalServerError}
372
+ * @throws {@link Payabli.ServiceUnavailableError}
373
+ *
374
+ * @example
375
+ * await client.moneyOut.cancelOutDelete("129-219")
376
+ */
377
+ cancelOutDelete(referenceId, requestOptions) {
378
+ return core.HttpResponsePromise.fromPromise(this.__cancelOutDelete(referenceId, requestOptions));
379
+ }
380
+ __cancelOutDelete(referenceId, requestOptions) {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
383
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
384
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
385
+ const _response = yield core.fetcher({
386
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/cancel/${core.url.encodePathParam(referenceId)}`),
387
+ method: "DELETE",
388
+ headers: _headers,
389
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
390
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
391
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
392
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
393
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
394
+ logging: this._options.logging,
395
+ });
396
+ if (_response.ok) {
397
+ return { data: _response.body, rawResponse: _response.rawResponse };
396
398
  }
399
+ if (_response.error.reason === "status-code") {
400
+ switch (_response.error.statusCode) {
401
+ case 400:
402
+ throw new Payabli.BadRequestError(_response.error.body, _response.rawResponse);
403
+ case 401:
404
+ throw new Payabli.UnauthorizedError(_response.error.body, _response.rawResponse);
405
+ case 500:
406
+ throw new Payabli.InternalServerError(_response.error.body, _response.rawResponse);
407
+ case 503:
408
+ throw new Payabli.ServiceUnavailableError(_response.error.body, _response.rawResponse);
409
+ default:
410
+ throw new errors.PayabliError({
411
+ statusCode: _response.error.statusCode,
412
+ body: _response.error.body,
413
+ rawResponse: _response.rawResponse,
414
+ });
415
+ }
416
+ }
417
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/MoneyOut/cancel/{referenceId}");
397
418
  });
398
419
  }
399
420
  /**
400
421
  * Captures an array of authorized payout transactions for settlement. The maximum number of transactions that can be captured in a single request is 500.
401
422
  *
402
423
  * @param {Payabli.CaptureAllOutRequest} request
403
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
424
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
404
425
  *
405
426
  * @throws {@link Payabli.BadRequestError}
406
427
  * @throws {@link Payabli.UnauthorizedError}
@@ -419,7 +440,8 @@ class MoneyOut {
419
440
  return __awaiter(this, void 0, void 0, function* () {
420
441
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
421
442
  const { idempotencyKey, body: _body } = request;
422
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
443
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
444
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
423
445
  const _response = yield core.fetcher({
424
446
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "MoneyOut/captureAll"),
425
447
  method: "POST",
@@ -455,21 +477,7 @@ class MoneyOut {
455
477
  });
456
478
  }
457
479
  }
458
- switch (_response.error.reason) {
459
- case "non-json":
460
- throw new errors.PayabliError({
461
- statusCode: _response.error.statusCode,
462
- body: _response.error.rawBody,
463
- rawResponse: _response.rawResponse,
464
- });
465
- case "timeout":
466
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /MoneyOut/captureAll.");
467
- case "unknown":
468
- throw new errors.PayabliError({
469
- message: _response.error.errorMessage,
470
- rawResponse: _response.rawResponse,
471
- });
472
- }
480
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/MoneyOut/captureAll");
473
481
  });
474
482
  }
475
483
  /**
@@ -477,7 +485,7 @@ class MoneyOut {
477
485
  *
478
486
  * @param {string} referenceId - The ID for the payout transaction.
479
487
  * @param {Payabli.CaptureOutRequest} request
480
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
488
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
481
489
  *
482
490
  * @throws {@link Payabli.BadRequestError}
483
491
  * @throws {@link Payabli.UnauthorizedError}
@@ -494,7 +502,8 @@ class MoneyOut {
494
502
  return __awaiter(this, arguments, void 0, function* (referenceId, request = {}, requestOptions) {
495
503
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
496
504
  const { idempotencyKey } = request;
497
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
505
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
506
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ idempotencyKey: idempotencyKey != null ? idempotencyKey : undefined }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
498
507
  const _response = yield core.fetcher({
499
508
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/capture/${core.url.encodePathParam(referenceId)}`),
500
509
  method: "GET",
@@ -527,28 +536,14 @@ class MoneyOut {
527
536
  });
528
537
  }
529
538
  }
530
- switch (_response.error.reason) {
531
- case "non-json":
532
- throw new errors.PayabliError({
533
- statusCode: _response.error.statusCode,
534
- body: _response.error.rawBody,
535
- rawResponse: _response.rawResponse,
536
- });
537
- case "timeout":
538
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /MoneyOut/capture/{referenceId}.");
539
- case "unknown":
540
- throw new errors.PayabliError({
541
- message: _response.error.errorMessage,
542
- rawResponse: _response.rawResponse,
543
- });
544
- }
539
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyOut/capture/{referenceId}");
545
540
  });
546
541
  }
547
542
  /**
548
543
  * Returns details for a processed money out transaction.
549
544
  *
550
545
  * @param {string} transId - ReferenceId for the transaction (PaymentId).
551
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
546
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
552
547
  *
553
548
  * @throws {@link Payabli.BadRequestError}
554
549
  * @throws {@link Payabli.UnauthorizedError}
@@ -564,7 +559,8 @@ class MoneyOut {
564
559
  __payoutDetails(transId, requestOptions) {
565
560
  return __awaiter(this, void 0, void 0, function* () {
566
561
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
567
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
562
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
563
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
568
564
  const _response = yield core.fetcher({
569
565
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/details/${core.url.encodePathParam(transId)}`),
570
566
  method: "GET",
@@ -597,28 +593,14 @@ class MoneyOut {
597
593
  });
598
594
  }
599
595
  }
600
- switch (_response.error.reason) {
601
- case "non-json":
602
- throw new errors.PayabliError({
603
- statusCode: _response.error.statusCode,
604
- body: _response.error.rawBody,
605
- rawResponse: _response.rawResponse,
606
- });
607
- case "timeout":
608
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /MoneyOut/details/{transId}.");
609
- case "unknown":
610
- throw new errors.PayabliError({
611
- message: _response.error.errorMessage,
612
- rawResponse: _response.rawResponse,
613
- });
614
- }
596
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyOut/details/{transId}");
615
597
  });
616
598
  }
617
599
  /**
618
600
  * Retrieves vCard details for a single card in an entrypoint.
619
601
  *
620
602
  * @param {string} cardToken - ID for a virtual card.
621
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
603
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
622
604
  *
623
605
  * @throws {@link Payabli.BadRequestError}
624
606
  * @throws {@link Payabli.UnauthorizedError}
@@ -634,7 +616,8 @@ class MoneyOut {
634
616
  __vCardGet(cardToken, requestOptions) {
635
617
  return __awaiter(this, void 0, void 0, function* () {
636
618
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
637
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
619
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
620
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
638
621
  const _response = yield core.fetcher({
639
622
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/vcard/${core.url.encodePathParam(cardToken)}`),
640
623
  method: "GET",
@@ -667,28 +650,14 @@ class MoneyOut {
667
650
  });
668
651
  }
669
652
  }
670
- switch (_response.error.reason) {
671
- case "non-json":
672
- throw new errors.PayabliError({
673
- statusCode: _response.error.statusCode,
674
- body: _response.error.rawBody,
675
- rawResponse: _response.rawResponse,
676
- });
677
- case "timeout":
678
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /MoneyOut/vcard/{cardToken}.");
679
- case "unknown":
680
- throw new errors.PayabliError({
681
- message: _response.error.errorMessage,
682
- rawResponse: _response.rawResponse,
683
- });
684
- }
653
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyOut/vcard/{cardToken}");
685
654
  });
686
655
  }
687
656
  /**
688
657
  * Sends a virtual card link via email to the vendor associated with the `transId`.
689
658
  *
690
659
  * @param {Payabli.SendVCardLinkRequest} request
691
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
660
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
692
661
  *
693
662
  * @throws {@link Payabli.BadRequestError}
694
663
  * @throws {@link Payabli.UnauthorizedError}
@@ -706,7 +675,8 @@ class MoneyOut {
706
675
  __sendVCardLink(request, requestOptions) {
707
676
  return __awaiter(this, void 0, void 0, function* () {
708
677
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
709
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
678
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
679
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
710
680
  const _response = yield core.fetcher({
711
681
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, "vcard/send-card-link"),
712
682
  method: "POST",
@@ -742,21 +712,7 @@ class MoneyOut {
742
712
  });
743
713
  }
744
714
  }
745
- switch (_response.error.reason) {
746
- case "non-json":
747
- throw new errors.PayabliError({
748
- statusCode: _response.error.statusCode,
749
- body: _response.error.rawBody,
750
- rawResponse: _response.rawResponse,
751
- });
752
- case "timeout":
753
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /vcard/send-card-link.");
754
- case "unknown":
755
- throw new errors.PayabliError({
756
- message: _response.error.errorMessage,
757
- rawResponse: _response.rawResponse,
758
- });
759
- }
715
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/vcard/send-card-link");
760
716
  });
761
717
  }
762
718
  /**
@@ -774,7 +730,7 @@ class MoneyOut {
774
730
  * "fContent": ""
775
731
  * }
776
732
  * ```
777
- * @param {MoneyOut.RequestOptions} requestOptions - Request-specific configuration.
733
+ * @param {MoneyOutClient.RequestOptions} requestOptions - Request-specific configuration.
778
734
  *
779
735
  * @throws {@link Payabli.BadRequestError}
780
736
  * @throws {@link Payabli.UnauthorizedError}
@@ -790,7 +746,8 @@ class MoneyOut {
790
746
  __getCheckImage(assetName, requestOptions) {
791
747
  return __awaiter(this, void 0, void 0, function* () {
792
748
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
793
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
749
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
750
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
794
751
  const _response = yield core.fetcher({
795
752
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `MoneyOut/checkimage/${core.url.encodePathParam(assetName)}`),
796
753
  method: "GET",
@@ -823,28 +780,8 @@ class MoneyOut {
823
780
  });
824
781
  }
825
782
  }
826
- switch (_response.error.reason) {
827
- case "non-json":
828
- throw new errors.PayabliError({
829
- statusCode: _response.error.statusCode,
830
- body: _response.error.rawBody,
831
- rawResponse: _response.rawResponse,
832
- });
833
- case "timeout":
834
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /MoneyOut/checkimage/{assetName}.");
835
- case "unknown":
836
- throw new errors.PayabliError({
837
- message: _response.error.errorMessage,
838
- rawResponse: _response.rawResponse,
839
- });
840
- }
841
- });
842
- }
843
- _getCustomAuthorizationHeaders() {
844
- return __awaiter(this, void 0, void 0, function* () {
845
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
846
- return { requestToken: apiKeyValue };
783
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/MoneyOut/checkimage/{assetName}");
847
784
  });
848
785
  }
849
786
  }
850
- exports.MoneyOut = MoneyOut;
787
+ exports.MoneyOutClient = MoneyOutClient;
@@ -9,7 +9,8 @@ import type * as Payabli from "../../../../index.js";
9
9
  * }],
10
10
  * orderDescription: "Window Painting",
11
11
  * paymentDetails: {
12
- * totalAmount: 47
12
+ * totalAmount: 47,
13
+ * unbundled: false
13
14
  * },
14
15
  * paymentMethod: {
15
16
  * method: "managed"
@@ -21,12 +21,14 @@ export declare namespace AuthorizePayoutBody {
21
21
  */
22
22
  interface PaymentDetails {
23
23
  checkNumber?: Payabli.VendorCheckNumber;
24
- /** Currency code ISO-4217. If not code is provided the currency in the paypoint setting is taken. Default is **USD**. */
24
+ /** Currency code ISO-4217. If no code is provided, then the currency in the paypoint setting is used. Default is **USD**. */
25
25
  currency?: string;
26
26
  /** Service fee to be deducted from the total amount. This amount must be a number, percentages aren't accepted. If you are using a percentage-based fee schedule, you must calculate the value manually. */
27
27
  serviceFee?: number;
28
28
  /** Total amount to be charged. If a service fee is included, then this amount should include the service fee. */
29
29
  totalAmount?: number;
30
+ /** Indicates whether the payout should be bundled into a single transaction or processed separately. If set to `true`, each bill will be processed as a separate payout. If `false` or not provided, then multiple bills will be paid with a single payout. */
31
+ unbundled?: boolean;
30
32
  }
31
33
  /**
32
34
  * Object containing vendor data.
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
2
3
  import * as core from "../../../../core/index.js";
3
4
  import * as Payabli from "../../../index.js";
4
- export declare namespace Notification {
5
+ export declare namespace NotificationClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class Notification {
11
- protected readonly _options: Notification.Options;
12
- constructor(_options?: Notification.Options);
11
+ export declare class NotificationClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<NotificationClient.Options>;
13
+ constructor(options?: NotificationClient.Options);
13
14
  /**
14
15
  * Create a new notification or autogenerated report.
15
16
  *
16
17
  * @param {Payabli.AddNotificationRequest} request
17
- * @param {Notification.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {NotificationClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link Payabli.BadRequestError}
20
21
  * @throws {@link Payabli.UnauthorizedError}
@@ -51,13 +52,13 @@ export declare class Notification {
51
52
  * target: "admin@example.com"
52
53
  * })
53
54
  */
54
- addNotification(request: Payabli.AddNotificationRequest, requestOptions?: Notification.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
55
+ addNotification(request: Payabli.AddNotificationRequest, requestOptions?: NotificationClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
55
56
  private __addNotification;
56
57
  /**
57
58
  * Deletes a single notification or autogenerated report.
58
59
  *
59
60
  * @param {string} nId - Notification ID.
60
- * @param {Notification.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {NotificationClient.RequestOptions} requestOptions - Request-specific configuration.
61
62
  *
62
63
  * @throws {@link Payabli.BadRequestError}
63
64
  * @throws {@link Payabli.UnauthorizedError}
@@ -67,13 +68,13 @@ export declare class Notification {
67
68
  * @example
68
69
  * await client.notification.deleteNotification("1717")
69
70
  */
70
- deleteNotification(nId: string, requestOptions?: Notification.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
71
+ deleteNotification(nId: string, requestOptions?: NotificationClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
71
72
  private __deleteNotification;
72
73
  /**
73
74
  * Retrieves a single notification or autogenerated report's details.
74
75
  *
75
76
  * @param {string} nId - Notification ID.
76
- * @param {Notification.RequestOptions} requestOptions - Request-specific configuration.
77
+ * @param {NotificationClient.RequestOptions} requestOptions - Request-specific configuration.
77
78
  *
78
79
  * @throws {@link Payabli.BadRequestError}
79
80
  * @throws {@link Payabli.UnauthorizedError}
@@ -83,14 +84,14 @@ export declare class Notification {
83
84
  * @example
84
85
  * await client.notification.getNotification("1717")
85
86
  */
86
- getNotification(nId: string, requestOptions?: Notification.RequestOptions): core.HttpResponsePromise<Payabli.NotificationQueryRecord>;
87
+ getNotification(nId: string, requestOptions?: NotificationClient.RequestOptions): core.HttpResponsePromise<Payabli.NotificationQueryRecord>;
87
88
  private __getNotification;
88
89
  /**
89
90
  * Update a notification or autogenerated report.
90
91
  *
91
92
  * @param {string} nId - Notification ID.
92
93
  * @param {Payabli.UpdateNotificationRequest} request
93
- * @param {Notification.RequestOptions} requestOptions - Request-specific configuration.
94
+ * @param {NotificationClient.RequestOptions} requestOptions - Request-specific configuration.
94
95
  *
95
96
  * @throws {@link Payabli.BadRequestError}
96
97
  * @throws {@link Payabli.UnauthorizedError}
@@ -110,13 +111,13 @@ export declare class Notification {
110
111
  * target: "newemail@email.com"
111
112
  * })
112
113
  */
113
- updateNotification(nId: string, request: Payabli.UpdateNotificationRequest, requestOptions?: Notification.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
114
+ updateNotification(nId: string, request: Payabli.UpdateNotificationRequest, requestOptions?: NotificationClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseNotifications>;
114
115
  private __updateNotification;
115
116
  /**
116
117
  * Gets a copy of a generated report by ID.
117
118
  *
118
- * @param {number} id - Report ID
119
- * @param {Notification.RequestOptions} requestOptions - Request-specific configuration.
119
+ * @param {number} Id - Report ID
120
+ * @param {NotificationClient.RequestOptions} requestOptions - Request-specific configuration.
120
121
  *
121
122
  * @throws {@link Payabli.BadRequestError}
122
123
  * @throws {@link Payabli.UnauthorizedError}
@@ -126,7 +127,6 @@ export declare class Notification {
126
127
  * @example
127
128
  * await client.notification.getReportFile(1000000)
128
129
  */
129
- getReportFile(id: number, requestOptions?: Notification.RequestOptions): core.HttpResponsePromise<Payabli.File_>;
130
+ getReportFile(Id: number, requestOptions?: NotificationClient.RequestOptions): core.HttpResponsePromise<Payabli.File_>;
130
131
  private __getReportFile;
131
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
132
132
  }