@payabli/sdk-node 0.0.116 → 0.0.123

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 (271) hide show
  1. package/README.md +31 -2
  2. package/dist/cjs/BaseClient.d.ts +13 -4
  3. package/dist/cjs/BaseClient.js +59 -0
  4. package/dist/cjs/Client.d.ts +88 -88
  5. package/dist/cjs/Client.js +31 -72
  6. package/dist/cjs/api/errors/BadRequestError.js +5 -1
  7. package/dist/cjs/api/errors/ConflictError.js +5 -1
  8. package/dist/cjs/api/errors/ForbiddenError.js +5 -1
  9. package/dist/cjs/api/errors/InternalServerError.js +5 -1
  10. package/dist/cjs/api/errors/ServiceUnavailableError.js +5 -1
  11. package/dist/cjs/api/errors/UnauthorizedError.js +5 -1
  12. package/dist/cjs/api/resources/bill/client/Client.d.ts +34 -35
  13. package/dist/cjs/api/resources/bill/client/Client.js +69 -216
  14. package/dist/cjs/api/resources/boarding/client/Client.d.ts +28 -29
  15. package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
  16. package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +18 -17
  17. package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
  18. package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +8 -9
  19. package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
  20. package/dist/cjs/api/resources/cloud/client/Client.d.ts +18 -19
  21. package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
  22. package/dist/cjs/api/resources/customer/client/Client.d.ts +18 -19
  23. package/dist/cjs/api/resources/customer/client/Client.js +31 -113
  24. package/dist/cjs/api/resources/export/client/Client.d.ts +94 -91
  25. package/dist/cjs/api/resources/export/client/Client.js +205 -582
  26. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +12 -13
  27. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
  28. package/dist/cjs/api/resources/import/client/Client.d.ts +12 -13
  29. package/dist/cjs/api/resources/import/client/Client.js +19 -62
  30. package/dist/cjs/api/resources/invoice/client/Client.d.ts +37 -36
  31. package/dist/cjs/api/resources/invoice/client/Client.js +67 -212
  32. package/dist/cjs/api/resources/invoice/client/requests/AddInvoiceRequest.d.ts +5 -3
  33. package/dist/cjs/api/resources/lineItem/client/Client.d.ts +16 -17
  34. package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
  35. package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +40 -41
  36. package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
  37. package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +5 -1
  38. package/dist/cjs/api/resources/moneyIn/errors/InvalidTransStatusError.js +5 -1
  39. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +44 -28
  40. package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
  41. package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
  42. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
  43. package/dist/cjs/api/resources/notification/client/Client.d.ts +30 -18
  44. package/dist/cjs/api/resources/notification/client/Client.js +45 -101
  45. package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +14 -15
  46. package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
  47. package/dist/cjs/api/resources/ocr/client/Client.d.ts +14 -11
  48. package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
  49. package/dist/cjs/api/resources/organization/client/Client.d.ts +20 -21
  50. package/dist/cjs/api/resources/organization/client/Client.js +35 -130
  51. package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +27 -28
  52. package/dist/cjs/api/resources/paymentLink/client/Client.js +46 -167
  53. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataBill.d.ts +1 -1
  54. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.ts +1 -1
  55. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataOut.d.ts +1 -1
  56. package/dist/cjs/api/resources/paymentLink/types/PaymentPageRequestBody.d.ts +2 -2
  57. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +20 -21
  58. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
  59. package/dist/cjs/api/resources/paypoint/client/Client.d.ts +23 -24
  60. package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
  61. package/dist/cjs/api/resources/query/client/Client.d.ts +72 -73
  62. package/dist/cjs/api/resources/query/client/Client.js +137 -572
  63. package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
  64. package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
  65. package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
  66. package/dist/cjs/api/resources/statistic/client/Client.d.ts +51 -52
  67. package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
  68. package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
  69. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
  70. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
  71. package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
  72. package/dist/cjs/api/resources/statistic/types/index.js +1 -0
  73. package/dist/cjs/api/resources/subscription/client/Client.d.ts +14 -15
  74. package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
  75. package/dist/cjs/api/resources/templates/client/Client.d.ts +16 -17
  76. package/dist/cjs/api/resources/templates/client/Client.js +28 -84
  77. package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +14 -15
  78. package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
  79. package/dist/cjs/api/resources/tokenStorage/types/GetMethodResponse.d.ts +1 -1
  80. package/dist/cjs/api/resources/user/client/Client.d.ts +55 -34
  81. package/dist/cjs/api/resources/user/client/Client.js +84 -222
  82. package/dist/cjs/api/resources/vendor/client/Client.d.ts +14 -15
  83. package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
  84. package/dist/cjs/api/resources/wallet/client/Client.d.ts +14 -15
  85. package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
  86. package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
  87. package/dist/cjs/api/types/Frequency.d.ts +1 -1
  88. package/dist/cjs/api/types/Frequency.js +1 -1
  89. package/dist/cjs/api/types/FrequencyList.d.ts +1 -1
  90. package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
  91. package/dist/cjs/api/types/NotificationContent.js +1 -0
  92. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
  93. package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
  94. package/dist/cjs/api/types/PayorDataResponse.d.ts +1 -1
  95. package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
  96. package/dist/cjs/auth/HeaderAuthProvider.d.ts +16 -0
  97. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  98. package/dist/cjs/auth/index.d.ts +1 -0
  99. package/dist/cjs/auth/index.js +5 -0
  100. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  101. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  102. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  103. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  104. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  105. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  106. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  107. package/dist/cjs/core/auth/BearerToken.js +16 -0
  108. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  109. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  110. package/dist/cjs/core/auth/index.d.ts +5 -0
  111. package/dist/cjs/core/auth/index.js +9 -0
  112. package/dist/cjs/core/base64.d.ts +2 -0
  113. package/dist/cjs/core/base64.js +26 -0
  114. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  115. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
  116. package/dist/cjs/core/fetcher/Fetcher.js +42 -24
  117. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  118. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  119. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  120. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  121. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  122. package/dist/cjs/core/fetcher/signals.js +0 -12
  123. package/dist/cjs/core/index.d.ts +2 -0
  124. package/dist/cjs/core/index.js +2 -0
  125. package/dist/cjs/core/logging/logger.js +1 -1
  126. package/dist/cjs/core/runtime/runtime.js +11 -10
  127. package/dist/cjs/core/url/join.js +0 -1
  128. package/dist/cjs/errors/PayabliError.js +5 -1
  129. package/dist/cjs/errors/PayabliTimeoutError.js +5 -1
  130. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  131. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  132. package/dist/cjs/version.d.ts +1 -1
  133. package/dist/cjs/version.js +1 -1
  134. package/dist/esm/BaseClient.d.mts +13 -4
  135. package/dist/esm/BaseClient.mjs +24 -1
  136. package/dist/esm/Client.d.mts +88 -88
  137. package/dist/esm/Client.mjs +59 -67
  138. package/dist/esm/api/errors/BadRequestError.mjs +5 -1
  139. package/dist/esm/api/errors/ConflictError.mjs +5 -1
  140. package/dist/esm/api/errors/ForbiddenError.mjs +5 -1
  141. package/dist/esm/api/errors/InternalServerError.mjs +5 -1
  142. package/dist/esm/api/errors/ServiceUnavailableError.mjs +5 -1
  143. package/dist/esm/api/errors/UnauthorizedError.mjs +5 -1
  144. package/dist/esm/api/resources/bill/client/Client.d.mts +34 -35
  145. package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
  146. package/dist/esm/api/resources/boarding/client/Client.d.mts +28 -29
  147. package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
  148. package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +18 -17
  149. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
  150. package/dist/esm/api/resources/checkCapture/client/Client.d.mts +8 -9
  151. package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
  152. package/dist/esm/api/resources/cloud/client/Client.d.mts +18 -19
  153. package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
  154. package/dist/esm/api/resources/customer/client/Client.d.mts +18 -19
  155. package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
  156. package/dist/esm/api/resources/export/client/Client.d.mts +94 -91
  157. package/dist/esm/api/resources/export/client/Client.mjs +204 -581
  158. package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +12 -13
  159. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
  160. package/dist/esm/api/resources/import/client/Client.d.mts +12 -13
  161. package/dist/esm/api/resources/import/client/Client.mjs +17 -60
  162. package/dist/esm/api/resources/invoice/client/Client.d.mts +37 -36
  163. package/dist/esm/api/resources/invoice/client/Client.mjs +65 -210
  164. package/dist/esm/api/resources/invoice/client/requests/AddInvoiceRequest.d.mts +5 -3
  165. package/dist/esm/api/resources/lineItem/client/Client.d.mts +16 -17
  166. package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
  167. package/dist/esm/api/resources/moneyIn/client/Client.d.mts +40 -41
  168. package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
  169. package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +5 -1
  170. package/dist/esm/api/resources/moneyIn/errors/InvalidTransStatusError.mjs +5 -1
  171. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +44 -28
  172. package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
  173. package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
  174. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
  175. package/dist/esm/api/resources/notification/client/Client.d.mts +30 -18
  176. package/dist/esm/api/resources/notification/client/Client.mjs +44 -100
  177. package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +14 -15
  178. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
  179. package/dist/esm/api/resources/ocr/client/Client.d.mts +14 -11
  180. package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
  181. package/dist/esm/api/resources/organization/client/Client.d.mts +20 -21
  182. package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
  183. package/dist/esm/api/resources/paymentLink/client/Client.d.mts +27 -28
  184. package/dist/esm/api/resources/paymentLink/client/Client.mjs +44 -165
  185. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataBill.d.mts +1 -1
  186. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.mts +1 -1
  187. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataOut.d.mts +1 -1
  188. package/dist/esm/api/resources/paymentLink/types/PaymentPageRequestBody.d.mts +2 -2
  189. package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +20 -21
  190. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
  191. package/dist/esm/api/resources/paypoint/client/Client.d.mts +23 -24
  192. package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
  193. package/dist/esm/api/resources/query/client/Client.d.mts +72 -73
  194. package/dist/esm/api/resources/query/client/Client.mjs +136 -571
  195. package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
  196. package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
  197. package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
  198. package/dist/esm/api/resources/statistic/client/Client.d.mts +51 -52
  199. package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
  200. package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
  201. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
  202. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
  203. package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
  204. package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
  205. package/dist/esm/api/resources/subscription/client/Client.d.mts +14 -15
  206. package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
  207. package/dist/esm/api/resources/templates/client/Client.d.mts +16 -17
  208. package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
  209. package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +14 -15
  210. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
  211. package/dist/esm/api/resources/tokenStorage/types/GetMethodResponse.d.mts +1 -1
  212. package/dist/esm/api/resources/user/client/Client.d.mts +55 -34
  213. package/dist/esm/api/resources/user/client/Client.mjs +83 -221
  214. package/dist/esm/api/resources/vendor/client/Client.d.mts +14 -15
  215. package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
  216. package/dist/esm/api/resources/wallet/client/Client.d.mts +14 -15
  217. package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
  218. package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
  219. package/dist/esm/api/types/Frequency.d.mts +1 -1
  220. package/dist/esm/api/types/Frequency.mjs +1 -1
  221. package/dist/esm/api/types/FrequencyList.d.mts +1 -1
  222. package/dist/esm/api/types/NotificationContent.d.mts +1 -0
  223. package/dist/esm/api/types/NotificationContent.mjs +1 -0
  224. package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
  225. package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
  226. package/dist/esm/api/types/PayorDataResponse.d.mts +1 -1
  227. package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
  228. package/dist/esm/auth/HeaderAuthProvider.d.mts +16 -0
  229. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  230. package/dist/esm/auth/index.d.mts +1 -0
  231. package/dist/esm/auth/index.mjs +1 -0
  232. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  233. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  234. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  235. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  236. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  237. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  238. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  239. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  240. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  241. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  242. package/dist/esm/core/auth/index.d.mts +5 -0
  243. package/dist/esm/core/auth/index.mjs +3 -0
  244. package/dist/esm/core/base64.d.mts +2 -0
  245. package/dist/esm/core/base64.mjs +22 -0
  246. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  247. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
  248. package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
  249. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  250. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  251. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  252. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  253. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  254. package/dist/esm/core/fetcher/signals.mjs +0 -12
  255. package/dist/esm/core/index.d.mts +2 -0
  256. package/dist/esm/core/index.mjs +2 -0
  257. package/dist/esm/core/logging/logger.mjs +1 -1
  258. package/dist/esm/core/runtime/runtime.mjs +11 -10
  259. package/dist/esm/core/url/join.mjs +0 -1
  260. package/dist/esm/errors/PayabliError.mjs +5 -1
  261. package/dist/esm/errors/PayabliTimeoutError.mjs +5 -1
  262. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  263. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  264. package/dist/esm/version.d.mts +1 -1
  265. package/dist/esm/version.mjs +1 -1
  266. package/package.json +5 -2
  267. package/reference.md +768 -478
  268. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  269. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  270. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  271. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -43,22 +43,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Boarding = void 0;
46
+ exports.BoardingClient = 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 json_js_1 = require("../../../../core/json.js");
50
51
  const environments = __importStar(require("../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
51
53
  const errors = __importStar(require("../../../../errors/index.js"));
52
54
  const Payabli = __importStar(require("../../../index.js"));
53
- class Boarding {
54
- constructor(_options = {}) {
55
- this._options = _options;
55
+ class BoardingClient {
56
+ constructor(options = {}) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
56
58
  }
57
59
  /**
58
60
  * Creates a boarding application in an organization. This endpoint requires an application API token.
59
61
  *
60
62
  * @param {Payabli.AddApplicationRequest} request
61
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
63
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
62
64
  *
63
65
  * @throws {@link Payabli.BadRequestError}
64
66
  * @throws {@link Payabli.UnauthorizedError}
@@ -546,7 +548,8 @@ class Boarding {
546
548
  __addApplication(request, requestOptions) {
547
549
  return __awaiter(this, void 0, void 0, function* () {
548
550
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
549
- 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);
551
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
552
+ 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);
550
553
  const _response = yield core.fetcher({
551
554
  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, "Boarding/app"),
552
555
  method: "POST",
@@ -585,28 +588,14 @@ class Boarding {
585
588
  });
586
589
  }
587
590
  }
588
- switch (_response.error.reason) {
589
- case "non-json":
590
- throw new errors.PayabliError({
591
- statusCode: _response.error.statusCode,
592
- body: _response.error.rawBody,
593
- rawResponse: _response.rawResponse,
594
- });
595
- case "timeout":
596
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /Boarding/app.");
597
- case "unknown":
598
- throw new errors.PayabliError({
599
- message: _response.error.errorMessage,
600
- rawResponse: _response.rawResponse,
601
- });
602
- }
591
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/Boarding/app");
603
592
  });
604
593
  }
605
594
  /**
606
595
  * Deletes a boarding application by ID.
607
596
  *
608
597
  * @param {number} appId - Boarding application ID.
609
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
598
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
610
599
  *
611
600
  * @throws {@link Payabli.BadRequestError}
612
601
  * @throws {@link Payabli.UnauthorizedError}
@@ -622,7 +611,8 @@ class Boarding {
622
611
  __deleteApplication(appId, requestOptions) {
623
612
  return __awaiter(this, void 0, void 0, function* () {
624
613
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
625
- 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);
614
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
615
+ 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);
626
616
  const _response = yield core.fetcher({
627
617
  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, `Boarding/app/${core.url.encodePathParam(appId)}`),
628
618
  method: "DELETE",
@@ -658,28 +648,14 @@ class Boarding {
658
648
  });
659
649
  }
660
650
  }
661
- switch (_response.error.reason) {
662
- case "non-json":
663
- throw new errors.PayabliError({
664
- statusCode: _response.error.statusCode,
665
- body: _response.error.rawBody,
666
- rawResponse: _response.rawResponse,
667
- });
668
- case "timeout":
669
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling DELETE /Boarding/app/{appId}.");
670
- case "unknown":
671
- throw new errors.PayabliError({
672
- message: _response.error.errorMessage,
673
- rawResponse: _response.rawResponse,
674
- });
675
- }
651
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/Boarding/app/{appId}");
676
652
  });
677
653
  }
678
654
  /**
679
655
  * Retrieves the details for a boarding application by ID.
680
656
  *
681
657
  * @param {number} appId - Boarding application ID.
682
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
658
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
683
659
  *
684
660
  * @throws {@link Payabli.BadRequestError}
685
661
  * @throws {@link Payabli.UnauthorizedError}
@@ -695,7 +671,8 @@ class Boarding {
695
671
  __getApplication(appId, requestOptions) {
696
672
  return __awaiter(this, void 0, void 0, function* () {
697
673
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
698
- 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);
674
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
675
+ 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);
699
676
  const _response = yield core.fetcher({
700
677
  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, `Boarding/read/${core.url.encodePathParam(appId)}`),
701
678
  method: "GET",
@@ -728,21 +705,7 @@ class Boarding {
728
705
  });
729
706
  }
730
707
  }
731
- switch (_response.error.reason) {
732
- case "non-json":
733
- throw new errors.PayabliError({
734
- statusCode: _response.error.statusCode,
735
- body: _response.error.rawBody,
736
- rawResponse: _response.rawResponse,
737
- });
738
- case "timeout":
739
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Boarding/read/{appId}.");
740
- case "unknown":
741
- throw new errors.PayabliError({
742
- message: _response.error.errorMessage,
743
- rawResponse: _response.rawResponse,
744
- });
745
- }
708
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Boarding/read/{appId}");
746
709
  });
747
710
  }
748
711
  /**
@@ -750,7 +713,7 @@ class Boarding {
750
713
  *
751
714
  * @param {string} xId - The application ID in Hex format. Find this at the end of the boarding link URL returned in a call to api/Boarding/applink/{appId}/{mail2}. For example in: `https://boarding-sandbox.payabli.com/boarding/externalapp/load/17E`, the xId is `17E`.
752
715
  * @param {Payabli.RequestAppByAuth} request
753
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
716
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
754
717
  *
755
718
  * @throws {@link Payabli.BadRequestError}
756
719
  * @throws {@link Payabli.UnauthorizedError}
@@ -769,7 +732,8 @@ class Boarding {
769
732
  __getApplicationByAuth(xId_1) {
770
733
  return __awaiter(this, arguments, void 0, function* (xId, request = {}, requestOptions) {
771
734
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
772
- 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);
735
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
736
+ 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);
773
737
  const _response = yield core.fetcher({
774
738
  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, `Boarding/read/${core.url.encodePathParam(xId)}`),
775
739
  method: "POST",
@@ -805,28 +769,14 @@ class Boarding {
805
769
  });
806
770
  }
807
771
  }
808
- switch (_response.error.reason) {
809
- case "non-json":
810
- throw new errors.PayabliError({
811
- statusCode: _response.error.statusCode,
812
- body: _response.error.rawBody,
813
- rawResponse: _response.rawResponse,
814
- });
815
- case "timeout":
816
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /Boarding/read/{xId}.");
817
- case "unknown":
818
- throw new errors.PayabliError({
819
- message: _response.error.errorMessage,
820
- rawResponse: _response.rawResponse,
821
- });
822
- }
772
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/Boarding/read/{xId}");
823
773
  });
824
774
  }
825
775
  /**
826
776
  * Retrieves details for a boarding link, by ID.
827
777
  *
828
778
  * @param {number} boardingLinkId - The boarding link ID. You can find this at the end of the boarding link reference name. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`. The ID is `91`.
829
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
779
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
830
780
  *
831
781
  * @throws {@link Payabli.BadRequestError}
832
782
  * @throws {@link Payabli.UnauthorizedError}
@@ -842,7 +792,8 @@ class Boarding {
842
792
  __getByIdLinkApplication(boardingLinkId, requestOptions) {
843
793
  return __awaiter(this, void 0, void 0, function* () {
844
794
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
845
- 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);
795
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
796
+ 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);
846
797
  const _response = yield core.fetcher({
847
798
  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, `Boarding/linkbyId/${core.url.encodePathParam(boardingLinkId)}`),
848
799
  method: "GET",
@@ -875,28 +826,14 @@ class Boarding {
875
826
  });
876
827
  }
877
828
  }
878
- switch (_response.error.reason) {
879
- case "non-json":
880
- throw new errors.PayabliError({
881
- statusCode: _response.error.statusCode,
882
- body: _response.error.rawBody,
883
- rawResponse: _response.rawResponse,
884
- });
885
- case "timeout":
886
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Boarding/linkbyId/{boardingLinkId}.");
887
- case "unknown":
888
- throw new errors.PayabliError({
889
- message: _response.error.errorMessage,
890
- rawResponse: _response.rawResponse,
891
- });
892
- }
829
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Boarding/linkbyId/{boardingLinkId}");
893
830
  });
894
831
  }
895
832
  /**
896
833
  * Get details for a boarding link using the boarding template ID. This endpoint requires an application API token.
897
834
  *
898
835
  * @param {number} templateId - The boarding template ID. You can find this at the end of the boarding template URL in PartnerHub. Example: `https://partner-sandbox.payabli.com/myorganization/boarding/edittemplate/80`. Here, the template ID is `80`.
899
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
836
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
900
837
  *
901
838
  * @throws {@link Payabli.BadRequestError}
902
839
  * @throws {@link Payabli.UnauthorizedError}
@@ -912,7 +849,8 @@ class Boarding {
912
849
  __getByTemplateIdLinkApplication(templateId, requestOptions) {
913
850
  return __awaiter(this, void 0, void 0, function* () {
914
851
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
915
- 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);
852
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
853
+ 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);
916
854
  const _response = yield core.fetcher({
917
855
  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, `Boarding/linkbyTemplate/${core.url.encodePathParam(templateId)}`),
918
856
  method: "GET",
@@ -945,21 +883,7 @@ class Boarding {
945
883
  });
946
884
  }
947
885
  }
948
- switch (_response.error.reason) {
949
- case "non-json":
950
- throw new errors.PayabliError({
951
- statusCode: _response.error.statusCode,
952
- body: _response.error.rawBody,
953
- rawResponse: _response.rawResponse,
954
- });
955
- case "timeout":
956
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Boarding/linkbyTemplate/{templateId}.");
957
- case "unknown":
958
- throw new errors.PayabliError({
959
- message: _response.error.errorMessage,
960
- rawResponse: _response.rawResponse,
961
- });
962
- }
886
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Boarding/linkbyTemplate/{templateId}");
963
887
  });
964
888
  }
965
889
  /**
@@ -968,7 +892,7 @@ class Boarding {
968
892
  * @param {number} appId - Boarding application ID.
969
893
  * @param {string} mail2 - Email address used to access the application. If `sendEmail` parameter is true, a link to the application is sent to this email address.
970
894
  * @param {Payabli.GetExternalApplicationRequest} request
971
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
895
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
972
896
  *
973
897
  * @throws {@link Payabli.BadRequestError}
974
898
  * @throws {@link Payabli.UnauthorizedError}
@@ -989,7 +913,8 @@ class Boarding {
989
913
  if (sendEmail != null) {
990
914
  _queryParams.sendEmail = sendEmail.toString();
991
915
  }
992
- 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);
916
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
917
+ 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);
993
918
  const _response = yield core.fetcher({
994
919
  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, `Boarding/applink/${core.url.encodePathParam(appId)}/${core.url.encodePathParam(mail2)}`),
995
920
  method: "PUT",
@@ -1022,28 +947,14 @@ class Boarding {
1022
947
  });
1023
948
  }
1024
949
  }
1025
- switch (_response.error.reason) {
1026
- case "non-json":
1027
- throw new errors.PayabliError({
1028
- statusCode: _response.error.statusCode,
1029
- body: _response.error.rawBody,
1030
- rawResponse: _response.rawResponse,
1031
- });
1032
- case "timeout":
1033
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /Boarding/applink/{appId}/{mail2}.");
1034
- case "unknown":
1035
- throw new errors.PayabliError({
1036
- message: _response.error.errorMessage,
1037
- rawResponse: _response.rawResponse,
1038
- });
1039
- }
950
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/Boarding/applink/{appId}/{mail2}");
1040
951
  });
1041
952
  }
1042
953
  /**
1043
954
  * Retrieves the details for a boarding link, by reference name. This endpoint requires an application API token.
1044
955
  *
1045
956
  * @param {string} boardingLinkReference - The boarding link reference name. You can find this at the end of the boarding link URL. For example `https://boarding.payabli.com/boarding/app/myorgaccountname-00091`
1046
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
957
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
1047
958
  *
1048
959
  * @throws {@link Payabli.BadRequestError}
1049
960
  * @throws {@link Payabli.UnauthorizedError}
@@ -1059,7 +970,8 @@ class Boarding {
1059
970
  __getLinkApplication(boardingLinkReference, requestOptions) {
1060
971
  return __awaiter(this, void 0, void 0, function* () {
1061
972
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1062
- 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);
973
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
974
+ 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);
1063
975
  const _response = yield core.fetcher({
1064
976
  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, `Boarding/link/${core.url.encodePathParam(boardingLinkReference)}`),
1065
977
  method: "GET",
@@ -1092,21 +1004,7 @@ class Boarding {
1092
1004
  });
1093
1005
  }
1094
1006
  }
1095
- switch (_response.error.reason) {
1096
- case "non-json":
1097
- throw new errors.PayabliError({
1098
- statusCode: _response.error.statusCode,
1099
- body: _response.error.rawBody,
1100
- rawResponse: _response.rawResponse,
1101
- });
1102
- case "timeout":
1103
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Boarding/link/{boardingLinkReference}.");
1104
- case "unknown":
1105
- throw new errors.PayabliError({
1106
- message: _response.error.errorMessage,
1107
- rawResponse: _response.rawResponse,
1108
- });
1109
- }
1007
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Boarding/link/{boardingLinkReference}");
1110
1008
  });
1111
1009
  }
1112
1010
  /**
@@ -1114,7 +1012,7 @@ class Boarding {
1114
1012
  *
1115
1013
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1116
1014
  * @param {Payabli.ListApplicationsRequest} request
1117
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
1015
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
1118
1016
  *
1119
1017
  * @throws {@link Payabli.BadRequestError}
1120
1018
  * @throws {@link Payabli.UnauthorizedError}
@@ -1151,7 +1049,8 @@ class Boarding {
1151
1049
  if (sortBy != null) {
1152
1050
  _queryParams.sortBy = sortBy;
1153
1051
  }
1154
- 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);
1052
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1053
+ 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);
1155
1054
  const _response = yield core.fetcher({
1156
1055
  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, `Query/boarding/${core.url.encodePathParam(orgId)}`),
1157
1056
  method: "GET",
@@ -1187,21 +1086,7 @@ class Boarding {
1187
1086
  });
1188
1087
  }
1189
1088
  }
1190
- switch (_response.error.reason) {
1191
- case "non-json":
1192
- throw new errors.PayabliError({
1193
- statusCode: _response.error.statusCode,
1194
- body: _response.error.rawBody,
1195
- rawResponse: _response.rawResponse,
1196
- });
1197
- case "timeout":
1198
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/boarding/{orgId}.");
1199
- case "unknown":
1200
- throw new errors.PayabliError({
1201
- message: _response.error.errorMessage,
1202
- rawResponse: _response.rawResponse,
1203
- });
1204
- }
1089
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/boarding/{orgId}");
1205
1090
  });
1206
1091
  }
1207
1092
  /**
@@ -1209,7 +1094,7 @@ class Boarding {
1209
1094
  *
1210
1095
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1211
1096
  * @param {Payabli.ListBoardingLinksRequest} request
1212
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
1097
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
1213
1098
  *
1214
1099
  * @throws {@link Payabli.BadRequestError}
1215
1100
  * @throws {@link Payabli.UnauthorizedError}
@@ -1243,7 +1128,8 @@ class Boarding {
1243
1128
  if (sortBy != null) {
1244
1129
  _queryParams.sortBy = sortBy;
1245
1130
  }
1246
- 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);
1131
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1132
+ 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);
1247
1133
  const _response = yield core.fetcher({
1248
1134
  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, `Query/boardinglinks/${core.url.encodePathParam(orgId)}`),
1249
1135
  method: "GET",
@@ -1276,21 +1162,7 @@ class Boarding {
1276
1162
  });
1277
1163
  }
1278
1164
  }
1279
- switch (_response.error.reason) {
1280
- case "non-json":
1281
- throw new errors.PayabliError({
1282
- statusCode: _response.error.statusCode,
1283
- body: _response.error.rawBody,
1284
- rawResponse: _response.rawResponse,
1285
- });
1286
- case "timeout":
1287
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/boardinglinks/{orgId}.");
1288
- case "unknown":
1289
- throw new errors.PayabliError({
1290
- message: _response.error.errorMessage,
1291
- rawResponse: _response.rawResponse,
1292
- });
1293
- }
1165
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/boardinglinks/{orgId}");
1294
1166
  });
1295
1167
  }
1296
1168
  /**
@@ -1298,7 +1170,7 @@ class Boarding {
1298
1170
  *
1299
1171
  * @param {number} appId - Boarding application ID.
1300
1172
  * @param {Payabli.ApplicationData} request
1301
- * @param {Boarding.RequestOptions} requestOptions - Request-specific configuration.
1173
+ * @param {BoardingClient.RequestOptions} requestOptions - Request-specific configuration.
1302
1174
  *
1303
1175
  * @throws {@link Payabli.BadRequestError}
1304
1176
  * @throws {@link Payabli.UnauthorizedError}
@@ -1314,7 +1186,8 @@ class Boarding {
1314
1186
  __updateApplication(appId, request, requestOptions) {
1315
1187
  return __awaiter(this, void 0, void 0, function* () {
1316
1188
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1317
- 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);
1189
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1190
+ 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);
1318
1191
  const _response = yield core.fetcher({
1319
1192
  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, `Boarding/app/${core.url.encodePathParam(appId)}`),
1320
1193
  method: "PUT",
@@ -1353,28 +1226,8 @@ class Boarding {
1353
1226
  });
1354
1227
  }
1355
1228
  }
1356
- switch (_response.error.reason) {
1357
- case "non-json":
1358
- throw new errors.PayabliError({
1359
- statusCode: _response.error.statusCode,
1360
- body: _response.error.rawBody,
1361
- rawResponse: _response.rawResponse,
1362
- });
1363
- case "timeout":
1364
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling PUT /Boarding/app/{appId}.");
1365
- case "unknown":
1366
- throw new errors.PayabliError({
1367
- message: _response.error.errorMessage,
1368
- rawResponse: _response.rawResponse,
1369
- });
1370
- }
1371
- });
1372
- }
1373
- _getCustomAuthorizationHeaders() {
1374
- return __awaiter(this, void 0, void 0, function* () {
1375
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
1376
- return { requestToken: apiKeyValue };
1229
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/Boarding/app/{appId}");
1377
1230
  });
1378
1231
  }
1379
1232
  }
1380
- exports.Boarding = Boarding;
1233
+ exports.BoardingClient = BoardingClient;
@@ -1,21 +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 ChargeBacks {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ export declare namespace ChargeBacksClient {
6
+ type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class ChargeBacks {
11
- protected readonly _options: ChargeBacks.Options;
12
- constructor(_options?: ChargeBacks.Options);
10
+ export declare class ChargeBacksClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ChargeBacksClient.Options>;
12
+ constructor(options?: ChargeBacksClient.Options);
13
13
  /**
14
14
  * Add a response to a chargeback or ACH return.
15
15
  *
16
- * @param {number} id - ID of the chargeback or return record.
16
+ * @param {number} Id - ID of the chargeback or return record.
17
17
  * @param {Payabli.ResponseChargeBack} request
18
- * @param {ChargeBacks.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {ChargeBacksClient.RequestOptions} requestOptions - Request-specific configuration.
19
19
  *
20
20
  * @throws {@link Payabli.BadRequestError}
21
21
  * @throws {@link Payabli.UnauthorizedError}
@@ -27,13 +27,13 @@ export declare class ChargeBacks {
27
27
  * idempotencyKey: "6B29FC40-CA47-1067-B31D-00DD010662DA"
28
28
  * })
29
29
  */
30
- addResponse(id: number, request?: Payabli.ResponseChargeBack, requestOptions?: ChargeBacks.RequestOptions): core.HttpResponsePromise<Payabli.AddResponseResponse>;
30
+ addResponse(Id: number, request?: Payabli.ResponseChargeBack, requestOptions?: ChargeBacksClient.RequestOptions): core.HttpResponsePromise<Payabli.AddResponseResponse>;
31
31
  private __addResponse;
32
32
  /**
33
33
  * Retrieves a chargeback record and its details.
34
34
  *
35
- * @param {number} id - ID of the chargeback or return record. This is returned as `chargebackId` in the [RecievedChargeback](/developers/developer-guides/webhook-payloads#receivedChargeback) and [ReceivedAchReturn](/developers/developer-guides/webhook-payloads#receivedachreturn) webhook notifications.
36
- * @param {ChargeBacks.RequestOptions} requestOptions - Request-specific configuration.
35
+ * @param {number} Id - ID of the chargeback or return record. This is returned as `chargebackId` in the [RecievedChargeback](/developers/developer-guides/webhook-payloads#receivedChargeback) and [ReceivedAchReturn](/developers/developer-guides/webhook-payloads#receivedachreturn) webhook notifications.
36
+ * @param {ChargeBacksClient.RequestOptions} requestOptions - Request-specific configuration.
37
37
  *
38
38
  * @throws {@link Payabli.BadRequestError}
39
39
  * @throws {@link Payabli.UnauthorizedError}
@@ -43,12 +43,14 @@ export declare class ChargeBacks {
43
43
  * @example
44
44
  * await client.chargeBacks.getChargeback(1000000)
45
45
  */
46
- getChargeback(id: number, requestOptions?: ChargeBacks.RequestOptions): core.HttpResponsePromise<Payabli.ChargebackQueryRecords>;
46
+ getChargeback(Id: number, requestOptions?: ChargeBacksClient.RequestOptions): core.HttpResponsePromise<Payabli.ChargebackQueryRecords>;
47
47
  private __getChargeback;
48
48
  /**
49
+ * Retrieves a chargeback attachment file by its file name.
50
+ *
51
+ * @param {number} Id - The ID of chargeback or return record.
49
52
  * @param {string} fileName - The chargeback attachment's file name.
50
- * @param {number} id - The ID of chargeback or return record.
51
- * @param {ChargeBacks.RequestOptions} requestOptions - Request-specific configuration.
53
+ * @param {ChargeBacksClient.RequestOptions} requestOptions - Request-specific configuration.
52
54
  *
53
55
  * @throws {@link Payabli.BadRequestError}
54
56
  * @throws {@link Payabli.UnauthorizedError}
@@ -56,9 +58,8 @@ export declare class ChargeBacks {
56
58
  * @throws {@link Payabli.ServiceUnavailableError}
57
59
  *
58
60
  * @example
59
- * await client.chargeBacks.getChargebackAttachment("fileName", 1000000)
61
+ * await client.chargeBacks.getChargebackAttachment(1000000, "fileName")
60
62
  */
61
- getChargebackAttachment(fileName: string, id: number, requestOptions?: ChargeBacks.RequestOptions): core.HttpResponsePromise<string>;
63
+ getChargebackAttachment(Id: number, fileName: string, requestOptions?: ChargeBacksClient.RequestOptions): core.HttpResponsePromise<string>;
62
64
  private __getChargebackAttachment;
63
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
64
65
  }