@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
@@ -8,15 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import { toJson } from "../../../../core/json.mjs";
14
15
  import * as environments from "../../../../environments.mjs";
16
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
15
17
  import * as errors from "../../../../errors/index.mjs";
16
18
  import * as Payabli from "../../../index.mjs";
17
- export class Export {
18
- constructor(_options = {}) {
19
- this._options = _options;
19
+ export class ExportClient {
20
+ constructor(options = {}) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
20
22
  }
21
23
  /**
22
24
  * Export a list of boarding applications for an organization. Use filters to limit results.
@@ -24,7 +26,7 @@ export class Export {
24
26
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
25
27
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
26
28
  * @param {Payabli.ExportApplicationsRequest} request
27
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
29
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
28
30
  *
29
31
  * @throws {@link Payabli.BadRequestError}
30
32
  * @throws {@link Payabli.UnauthorizedError}
@@ -58,7 +60,8 @@ export class Export {
58
60
  if (parameters != null) {
59
61
  _queryParams.parameters = toJson(parameters);
60
62
  }
61
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
63
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
64
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
62
65
  const _response = yield core.fetcher({
63
66
  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, `Export/boarding/${core.url.encodePathParam(format)}/${core.url.encodePathParam(orgId)}`),
64
67
  method: "GET",
@@ -91,28 +94,16 @@ export class Export {
91
94
  });
92
95
  }
93
96
  }
94
- switch (_response.error.reason) {
95
- case "non-json":
96
- throw new errors.PayabliError({
97
- statusCode: _response.error.statusCode,
98
- body: _response.error.rawBody,
99
- rawResponse: _response.rawResponse,
100
- });
101
- case "timeout":
102
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/boarding/{format}/{orgId}.");
103
- case "unknown":
104
- throw new errors.PayabliError({
105
- message: _response.error.errorMessage,
106
- rawResponse: _response.rawResponse,
107
- });
108
- }
97
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/boarding/{format}/{orgId}");
109
98
  });
110
99
  }
111
100
  /**
112
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
101
+ * This endpoint is deprecated. Export batch details for a paypoint. Use filters to limit results.
102
+ *
113
103
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
104
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
114
105
  * @param {Payabli.ExportBatchDetailsRequest} request
115
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
106
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
116
107
  *
117
108
  * @throws {@link Payabli.BadRequestError}
118
109
  * @throws {@link Payabli.UnauthorizedError}
@@ -120,17 +111,17 @@ export class Export {
120
111
  * @throws {@link Payabli.ServiceUnavailableError}
121
112
  *
122
113
  * @example
123
- * await client.export.exportBatchDetails("8cfec329267", "csv", {
114
+ * await client.export.exportBatchDetails("csv", "8cfec329267", {
124
115
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
125
116
  * fromRecord: 251,
126
117
  * limitRecord: 1000
127
118
  * })
128
119
  */
129
- exportBatchDetails(entry, format, request = {}, requestOptions) {
130
- return core.HttpResponsePromise.fromPromise(this.__exportBatchDetails(entry, format, request, requestOptions));
120
+ exportBatchDetails(format, entry, request = {}, requestOptions) {
121
+ return core.HttpResponsePromise.fromPromise(this.__exportBatchDetails(format, entry, request, requestOptions));
131
122
  }
132
- __exportBatchDetails(entry_1, format_1) {
133
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
123
+ __exportBatchDetails(format_1, entry_1) {
124
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
134
125
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
135
126
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
136
127
  const _queryParams = {};
@@ -146,7 +137,8 @@ export class Export {
146
137
  if (parameters != null) {
147
138
  _queryParams.parameters = toJson(parameters);
148
139
  }
149
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
140
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
141
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
150
142
  const _response = yield core.fetcher({
151
143
  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, `Export/batchDetails/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
152
144
  method: "GET",
@@ -179,28 +171,16 @@ export class Export {
179
171
  });
180
172
  }
181
173
  }
182
- switch (_response.error.reason) {
183
- case "non-json":
184
- throw new errors.PayabliError({
185
- statusCode: _response.error.statusCode,
186
- body: _response.error.rawBody,
187
- rawResponse: _response.rawResponse,
188
- });
189
- case "timeout":
190
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batchDetails/{format}/{entry}.");
191
- case "unknown":
192
- throw new errors.PayabliError({
193
- message: _response.error.errorMessage,
194
- rawResponse: _response.rawResponse,
195
- });
196
- }
174
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batchDetails/{format}/{entry}");
197
175
  });
198
176
  }
199
177
  /**
178
+ * This endpoint is deprecated. Export batch details for an organization. Use filters to limit results.
179
+ *
200
180
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
201
181
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
202
182
  * @param {Payabli.ExportBatchDetailsOrgRequest} request
203
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
183
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
204
184
  *
205
185
  * @throws {@link Payabli.BadRequestError}
206
186
  * @throws {@link Payabli.UnauthorizedError}
@@ -234,7 +214,8 @@ export class Export {
234
214
  if (parameters != null) {
235
215
  _queryParams.parameters = toJson(parameters);
236
216
  }
237
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
217
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
218
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
238
219
  const _response = yield core.fetcher({
239
220
  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, `Export/batchDetails/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
240
221
  method: "GET",
@@ -267,30 +248,16 @@ export class Export {
267
248
  });
268
249
  }
269
250
  }
270
- switch (_response.error.reason) {
271
- case "non-json":
272
- throw new errors.PayabliError({
273
- statusCode: _response.error.statusCode,
274
- body: _response.error.rawBody,
275
- rawResponse: _response.rawResponse,
276
- });
277
- case "timeout":
278
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batchDetails/{format}/org/{orgId}.");
279
- case "unknown":
280
- throw new errors.PayabliError({
281
- message: _response.error.errorMessage,
282
- rawResponse: _response.rawResponse,
283
- });
284
- }
251
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batchDetails/{format}/org/{orgId}");
285
252
  });
286
253
  }
287
254
  /**
288
255
  * Export a list of batches for an entrypoint. Use filters to limit results.
289
256
  *
290
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
291
257
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
258
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
292
259
  * @param {Payabli.ExportBatchesRequest} request
293
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
260
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
294
261
  *
295
262
  * @throws {@link Payabli.BadRequestError}
296
263
  * @throws {@link Payabli.UnauthorizedError}
@@ -298,17 +265,17 @@ export class Export {
298
265
  * @throws {@link Payabli.ServiceUnavailableError}
299
266
  *
300
267
  * @example
301
- * await client.export.exportBatches("8cfec329267", "csv", {
268
+ * await client.export.exportBatches("csv", "8cfec329267", {
302
269
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
303
270
  * fromRecord: 251,
304
271
  * limitRecord: 1000
305
272
  * })
306
273
  */
307
- exportBatches(entry, format, request = {}, requestOptions) {
308
- return core.HttpResponsePromise.fromPromise(this.__exportBatches(entry, format, request, requestOptions));
274
+ exportBatches(format, entry, request = {}, requestOptions) {
275
+ return core.HttpResponsePromise.fromPromise(this.__exportBatches(format, entry, request, requestOptions));
309
276
  }
310
- __exportBatches(entry_1, format_1) {
311
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
277
+ __exportBatches(format_1, entry_1) {
278
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
312
279
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
313
280
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
314
281
  const _queryParams = {};
@@ -324,7 +291,8 @@ export class Export {
324
291
  if (parameters != null) {
325
292
  _queryParams.parameters = toJson(parameters);
326
293
  }
327
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
294
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
295
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
328
296
  const _response = yield core.fetcher({
329
297
  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, `Export/batches/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
330
298
  method: "GET",
@@ -357,21 +325,7 @@ export class Export {
357
325
  });
358
326
  }
359
327
  }
360
- switch (_response.error.reason) {
361
- case "non-json":
362
- throw new errors.PayabliError({
363
- statusCode: _response.error.statusCode,
364
- body: _response.error.rawBody,
365
- rawResponse: _response.rawResponse,
366
- });
367
- case "timeout":
368
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batches/{format}/{entry}.");
369
- case "unknown":
370
- throw new errors.PayabliError({
371
- message: _response.error.errorMessage,
372
- rawResponse: _response.rawResponse,
373
- });
374
- }
328
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batches/{format}/{entry}");
375
329
  });
376
330
  }
377
331
  /**
@@ -380,7 +334,7 @@ export class Export {
380
334
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
381
335
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
382
336
  * @param {Payabli.ExportBatchesOrgRequest} request
383
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
337
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
384
338
  *
385
339
  * @throws {@link Payabli.BadRequestError}
386
340
  * @throws {@link Payabli.UnauthorizedError}
@@ -414,7 +368,8 @@ export class Export {
414
368
  if (parameters != null) {
415
369
  _queryParams.parameters = toJson(parameters);
416
370
  }
417
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
371
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
372
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
418
373
  const _response = yield core.fetcher({
419
374
  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, `Export/batches/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
420
375
  method: "GET",
@@ -447,30 +402,16 @@ export class Export {
447
402
  });
448
403
  }
449
404
  }
450
- switch (_response.error.reason) {
451
- case "non-json":
452
- throw new errors.PayabliError({
453
- statusCode: _response.error.statusCode,
454
- body: _response.error.rawBody,
455
- rawResponse: _response.rawResponse,
456
- });
457
- case "timeout":
458
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batches/{format}/org/{orgId}.");
459
- case "unknown":
460
- throw new errors.PayabliError({
461
- message: _response.error.errorMessage,
462
- rawResponse: _response.rawResponse,
463
- });
464
- }
405
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batches/{format}/org/{orgId}");
465
406
  });
466
407
  }
467
408
  /**
468
409
  * Export a list of money out batches for a paypoint. Use filters to limit results.
469
410
  *
470
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
471
411
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
412
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
472
413
  * @param {Payabli.ExportBatchesOutRequest} request
473
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
414
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
474
415
  *
475
416
  * @throws {@link Payabli.BadRequestError}
476
417
  * @throws {@link Payabli.UnauthorizedError}
@@ -478,17 +419,17 @@ export class Export {
478
419
  * @throws {@link Payabli.ServiceUnavailableError}
479
420
  *
480
421
  * @example
481
- * await client.export.exportBatchesOut("8cfec329267", "csv", {
422
+ * await client.export.exportBatchesOut("csv", "8cfec329267", {
482
423
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
483
424
  * fromRecord: 251,
484
425
  * limitRecord: 1000
485
426
  * })
486
427
  */
487
- exportBatchesOut(entry, format, request = {}, requestOptions) {
488
- return core.HttpResponsePromise.fromPromise(this.__exportBatchesOut(entry, format, request, requestOptions));
428
+ exportBatchesOut(format, entry, request = {}, requestOptions) {
429
+ return core.HttpResponsePromise.fromPromise(this.__exportBatchesOut(format, entry, request, requestOptions));
489
430
  }
490
- __exportBatchesOut(entry_1, format_1) {
491
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
431
+ __exportBatchesOut(format_1, entry_1) {
432
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
492
433
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
493
434
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
494
435
  const _queryParams = {};
@@ -504,7 +445,8 @@ export class Export {
504
445
  if (parameters != null) {
505
446
  _queryParams.parameters = toJson(parameters);
506
447
  }
507
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
448
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
449
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
508
450
  const _response = yield core.fetcher({
509
451
  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, `Export/batchesOut/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
510
452
  method: "GET",
@@ -537,21 +479,7 @@ export class Export {
537
479
  });
538
480
  }
539
481
  }
540
- switch (_response.error.reason) {
541
- case "non-json":
542
- throw new errors.PayabliError({
543
- statusCode: _response.error.statusCode,
544
- body: _response.error.rawBody,
545
- rawResponse: _response.rawResponse,
546
- });
547
- case "timeout":
548
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batchesOut/{format}/{entry}.");
549
- case "unknown":
550
- throw new errors.PayabliError({
551
- message: _response.error.errorMessage,
552
- rawResponse: _response.rawResponse,
553
- });
554
- }
482
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batchesOut/{format}/{entry}");
555
483
  });
556
484
  }
557
485
  /**
@@ -560,7 +488,7 @@ export class Export {
560
488
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
561
489
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
562
490
  * @param {Payabli.ExportBatchesOutOrgRequest} request
563
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
491
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
564
492
  *
565
493
  * @throws {@link Payabli.BadRequestError}
566
494
  * @throws {@link Payabli.UnauthorizedError}
@@ -594,7 +522,8 @@ export class Export {
594
522
  if (parameters != null) {
595
523
  _queryParams.parameters = toJson(parameters);
596
524
  }
597
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
525
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
526
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
598
527
  const _response = yield core.fetcher({
599
528
  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, `Export/batchesOut/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
600
529
  method: "GET",
@@ -627,30 +556,16 @@ export class Export {
627
556
  });
628
557
  }
629
558
  }
630
- switch (_response.error.reason) {
631
- case "non-json":
632
- throw new errors.PayabliError({
633
- statusCode: _response.error.statusCode,
634
- body: _response.error.rawBody,
635
- rawResponse: _response.rawResponse,
636
- });
637
- case "timeout":
638
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/batchesOut/{format}/org/{orgId}.");
639
- case "unknown":
640
- throw new errors.PayabliError({
641
- message: _response.error.errorMessage,
642
- rawResponse: _response.rawResponse,
643
- });
644
- }
559
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/batchesOut/{format}/org/{orgId}");
645
560
  });
646
561
  }
647
562
  /**
648
563
  * Export a list of bills for an entrypoint. Use filters to limit results.
649
564
  *
650
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
651
565
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
566
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
652
567
  * @param {Payabli.ExportBillsRequest} request
653
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
568
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
654
569
  *
655
570
  * @throws {@link Payabli.BadRequestError}
656
571
  * @throws {@link Payabli.UnauthorizedError}
@@ -658,17 +573,17 @@ export class Export {
658
573
  * @throws {@link Payabli.ServiceUnavailableError}
659
574
  *
660
575
  * @example
661
- * await client.export.exportBills("8cfec329267", "csv", {
576
+ * await client.export.exportBills("csv", "8cfec329267", {
662
577
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
663
578
  * fromRecord: 251,
664
579
  * limitRecord: 1000
665
580
  * })
666
581
  */
667
- exportBills(entry, format, request = {}, requestOptions) {
668
- return core.HttpResponsePromise.fromPromise(this.__exportBills(entry, format, request, requestOptions));
582
+ exportBills(format, entry, request = {}, requestOptions) {
583
+ return core.HttpResponsePromise.fromPromise(this.__exportBills(format, entry, request, requestOptions));
669
584
  }
670
- __exportBills(entry_1, format_1) {
671
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
585
+ __exportBills(format_1, entry_1) {
586
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
672
587
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
673
588
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
674
589
  const _queryParams = {};
@@ -684,7 +599,8 @@ export class Export {
684
599
  if (parameters != null) {
685
600
  _queryParams.parameters = toJson(parameters);
686
601
  }
687
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
602
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
603
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
688
604
  const _response = yield core.fetcher({
689
605
  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, `Export/bills/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
690
606
  method: "GET",
@@ -717,21 +633,7 @@ export class Export {
717
633
  });
718
634
  }
719
635
  }
720
- switch (_response.error.reason) {
721
- case "non-json":
722
- throw new errors.PayabliError({
723
- statusCode: _response.error.statusCode,
724
- body: _response.error.rawBody,
725
- rawResponse: _response.rawResponse,
726
- });
727
- case "timeout":
728
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/bills/{format}/{entry}.");
729
- case "unknown":
730
- throw new errors.PayabliError({
731
- message: _response.error.errorMessage,
732
- rawResponse: _response.rawResponse,
733
- });
734
- }
636
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/bills/{format}/{entry}");
735
637
  });
736
638
  }
737
639
  /**
@@ -740,7 +642,7 @@ export class Export {
740
642
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
741
643
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
742
644
  * @param {Payabli.ExportBillsOrgRequest} request
743
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
645
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
744
646
  *
745
647
  * @throws {@link Payabli.BadRequestError}
746
648
  * @throws {@link Payabli.UnauthorizedError}
@@ -774,7 +676,8 @@ export class Export {
774
676
  if (parameters != null) {
775
677
  _queryParams.parameters = toJson(parameters);
776
678
  }
777
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
679
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
680
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
778
681
  const _response = yield core.fetcher({
779
682
  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, `Export/bills/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
780
683
  method: "GET",
@@ -807,30 +710,16 @@ export class Export {
807
710
  });
808
711
  }
809
712
  }
810
- switch (_response.error.reason) {
811
- case "non-json":
812
- throw new errors.PayabliError({
813
- statusCode: _response.error.statusCode,
814
- body: _response.error.rawBody,
815
- rawResponse: _response.rawResponse,
816
- });
817
- case "timeout":
818
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/bills/{format}/org/{orgId}.");
819
- case "unknown":
820
- throw new errors.PayabliError({
821
- message: _response.error.errorMessage,
822
- rawResponse: _response.rawResponse,
823
- });
824
- }
713
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/bills/{format}/org/{orgId}");
825
714
  });
826
715
  }
827
716
  /**
828
717
  * Export a list of chargebacks and ACH returns for an entrypoint. Use filters to limit results.
829
718
  *
830
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
831
719
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
720
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
832
721
  * @param {Payabli.ExportChargebacksRequest} request
833
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
722
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
834
723
  *
835
724
  * @throws {@link Payabli.BadRequestError}
836
725
  * @throws {@link Payabli.UnauthorizedError}
@@ -838,17 +727,17 @@ export class Export {
838
727
  * @throws {@link Payabli.ServiceUnavailableError}
839
728
  *
840
729
  * @example
841
- * await client.export.exportChargebacks("8cfec329267", "csv", {
730
+ * await client.export.exportChargebacks("csv", "8cfec329267", {
842
731
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
843
732
  * fromRecord: 251,
844
733
  * limitRecord: 1000
845
734
  * })
846
735
  */
847
- exportChargebacks(entry, format, request = {}, requestOptions) {
848
- return core.HttpResponsePromise.fromPromise(this.__exportChargebacks(entry, format, request, requestOptions));
736
+ exportChargebacks(format, entry, request = {}, requestOptions) {
737
+ return core.HttpResponsePromise.fromPromise(this.__exportChargebacks(format, entry, request, requestOptions));
849
738
  }
850
- __exportChargebacks(entry_1, format_1) {
851
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
739
+ __exportChargebacks(format_1, entry_1) {
740
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
852
741
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
853
742
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
854
743
  const _queryParams = {};
@@ -864,7 +753,8 @@ export class Export {
864
753
  if (parameters != null) {
865
754
  _queryParams.parameters = toJson(parameters);
866
755
  }
867
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
756
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
757
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
868
758
  const _response = yield core.fetcher({
869
759
  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, `Export/chargebacks/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
870
760
  method: "GET",
@@ -897,21 +787,7 @@ export class Export {
897
787
  });
898
788
  }
899
789
  }
900
- switch (_response.error.reason) {
901
- case "non-json":
902
- throw new errors.PayabliError({
903
- statusCode: _response.error.statusCode,
904
- body: _response.error.rawBody,
905
- rawResponse: _response.rawResponse,
906
- });
907
- case "timeout":
908
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/chargebacks/{format}/{entry}.");
909
- case "unknown":
910
- throw new errors.PayabliError({
911
- message: _response.error.errorMessage,
912
- rawResponse: _response.rawResponse,
913
- });
914
- }
790
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/chargebacks/{format}/{entry}");
915
791
  });
916
792
  }
917
793
  /**
@@ -920,7 +796,7 @@ export class Export {
920
796
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
921
797
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
922
798
  * @param {Payabli.ExportChargebacksOrgRequest} request
923
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
799
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
924
800
  *
925
801
  * @throws {@link Payabli.BadRequestError}
926
802
  * @throws {@link Payabli.UnauthorizedError}
@@ -954,7 +830,8 @@ export class Export {
954
830
  if (parameters != null) {
955
831
  _queryParams.parameters = toJson(parameters);
956
832
  }
957
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
833
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
834
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
958
835
  const _response = yield core.fetcher({
959
836
  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, `Export/chargebacks/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
960
837
  method: "GET",
@@ -987,30 +864,16 @@ export class Export {
987
864
  });
988
865
  }
989
866
  }
990
- switch (_response.error.reason) {
991
- case "non-json":
992
- throw new errors.PayabliError({
993
- statusCode: _response.error.statusCode,
994
- body: _response.error.rawBody,
995
- rawResponse: _response.rawResponse,
996
- });
997
- case "timeout":
998
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/chargebacks/{format}/org/{orgId}.");
999
- case "unknown":
1000
- throw new errors.PayabliError({
1001
- message: _response.error.errorMessage,
1002
- rawResponse: _response.rawResponse,
1003
- });
1004
- }
867
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/chargebacks/{format}/org/{orgId}");
1005
868
  });
1006
869
  }
1007
870
  /**
1008
871
  * Export a list of customers for an entrypoint. Use filters to limit results.
1009
872
  *
1010
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1011
873
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
874
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1012
875
  * @param {Payabli.ExportCustomersRequest} request
1013
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
876
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1014
877
  *
1015
878
  * @throws {@link Payabli.BadRequestError}
1016
879
  * @throws {@link Payabli.UnauthorizedError}
@@ -1018,17 +881,17 @@ export class Export {
1018
881
  * @throws {@link Payabli.ServiceUnavailableError}
1019
882
  *
1020
883
  * @example
1021
- * await client.export.exportCustomers("8cfec329267", "csv", {
884
+ * await client.export.exportCustomers("csv", "8cfec329267", {
1022
885
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
1023
886
  * fromRecord: 251,
1024
887
  * limitRecord: 1000
1025
888
  * })
1026
889
  */
1027
- exportCustomers(entry, format, request = {}, requestOptions) {
1028
- return core.HttpResponsePromise.fromPromise(this.__exportCustomers(entry, format, request, requestOptions));
890
+ exportCustomers(format, entry, request = {}, requestOptions) {
891
+ return core.HttpResponsePromise.fromPromise(this.__exportCustomers(format, entry, request, requestOptions));
1029
892
  }
1030
- __exportCustomers(entry_1, format_1) {
1031
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
893
+ __exportCustomers(format_1, entry_1) {
894
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
1032
895
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1033
896
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
1034
897
  const _queryParams = {};
@@ -1044,7 +907,8 @@ export class Export {
1044
907
  if (parameters != null) {
1045
908
  _queryParams.parameters = toJson(parameters);
1046
909
  }
1047
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
910
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
911
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1048
912
  const _response = yield core.fetcher({
1049
913
  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, `Export/customers/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
1050
914
  method: "GET",
@@ -1077,21 +941,7 @@ export class Export {
1077
941
  });
1078
942
  }
1079
943
  }
1080
- switch (_response.error.reason) {
1081
- case "non-json":
1082
- throw new errors.PayabliError({
1083
- statusCode: _response.error.statusCode,
1084
- body: _response.error.rawBody,
1085
- rawResponse: _response.rawResponse,
1086
- });
1087
- case "timeout":
1088
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/customers/{format}/{entry}.");
1089
- case "unknown":
1090
- throw new errors.PayabliError({
1091
- message: _response.error.errorMessage,
1092
- rawResponse: _response.rawResponse,
1093
- });
1094
- }
944
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/customers/{format}/{entry}");
1095
945
  });
1096
946
  }
1097
947
  /**
@@ -1100,7 +950,7 @@ export class Export {
1100
950
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1101
951
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1102
952
  * @param {Payabli.ExportCustomersOrgRequest} request
1103
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
953
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1104
954
  *
1105
955
  * @throws {@link Payabli.BadRequestError}
1106
956
  * @throws {@link Payabli.UnauthorizedError}
@@ -1134,7 +984,8 @@ export class Export {
1134
984
  if (parameters != null) {
1135
985
  _queryParams.parameters = toJson(parameters);
1136
986
  }
1137
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
987
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
988
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1138
989
  const _response = yield core.fetcher({
1139
990
  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, `Export/customers/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
1140
991
  method: "GET",
@@ -1167,30 +1018,16 @@ export class Export {
1167
1018
  });
1168
1019
  }
1169
1020
  }
1170
- switch (_response.error.reason) {
1171
- case "non-json":
1172
- throw new errors.PayabliError({
1173
- statusCode: _response.error.statusCode,
1174
- body: _response.error.rawBody,
1175
- rawResponse: _response.rawResponse,
1176
- });
1177
- case "timeout":
1178
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/customers/{format}/org/{orgId}.");
1179
- case "unknown":
1180
- throw new errors.PayabliError({
1181
- message: _response.error.errorMessage,
1182
- rawResponse: _response.rawResponse,
1183
- });
1184
- }
1021
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/customers/{format}/org/{orgId}");
1185
1022
  });
1186
1023
  }
1187
1024
  /**
1188
1025
  * Export list of invoices for an entrypoint. Use filters to limit results.
1189
1026
  *
1190
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1191
1027
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1028
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1192
1029
  * @param {Payabli.ExportInvoicesRequest} request
1193
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1030
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1194
1031
  *
1195
1032
  * @throws {@link Payabli.BadRequestError}
1196
1033
  * @throws {@link Payabli.UnauthorizedError}
@@ -1198,17 +1035,17 @@ export class Export {
1198
1035
  * @throws {@link Payabli.ServiceUnavailableError}
1199
1036
  *
1200
1037
  * @example
1201
- * await client.export.exportInvoices("8cfec329267", "csv", {
1038
+ * await client.export.exportInvoices("csv", "8cfec329267", {
1202
1039
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
1203
1040
  * fromRecord: 251,
1204
1041
  * limitRecord: 1000
1205
1042
  * })
1206
1043
  */
1207
- exportInvoices(entry, format, request = {}, requestOptions) {
1208
- return core.HttpResponsePromise.fromPromise(this.__exportInvoices(entry, format, request, requestOptions));
1044
+ exportInvoices(format, entry, request = {}, requestOptions) {
1045
+ return core.HttpResponsePromise.fromPromise(this.__exportInvoices(format, entry, request, requestOptions));
1209
1046
  }
1210
- __exportInvoices(entry_1, format_1) {
1211
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
1047
+ __exportInvoices(format_1, entry_1) {
1048
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
1212
1049
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1213
1050
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
1214
1051
  const _queryParams = {};
@@ -1224,7 +1061,8 @@ export class Export {
1224
1061
  if (parameters != null) {
1225
1062
  _queryParams.parameters = toJson(parameters);
1226
1063
  }
1227
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1064
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1065
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1228
1066
  const _response = yield core.fetcher({
1229
1067
  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, `Export/invoices/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
1230
1068
  method: "GET",
@@ -1257,21 +1095,7 @@ export class Export {
1257
1095
  });
1258
1096
  }
1259
1097
  }
1260
- switch (_response.error.reason) {
1261
- case "non-json":
1262
- throw new errors.PayabliError({
1263
- statusCode: _response.error.statusCode,
1264
- body: _response.error.rawBody,
1265
- rawResponse: _response.rawResponse,
1266
- });
1267
- case "timeout":
1268
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/invoices/{format}/{entry}.");
1269
- case "unknown":
1270
- throw new errors.PayabliError({
1271
- message: _response.error.errorMessage,
1272
- rawResponse: _response.rawResponse,
1273
- });
1274
- }
1098
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/invoices/{format}/{entry}");
1275
1099
  });
1276
1100
  }
1277
1101
  /**
@@ -1280,7 +1104,7 @@ export class Export {
1280
1104
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1281
1105
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1282
1106
  * @param {Payabli.ExportInvoicesOrgRequest} request
1283
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1107
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1284
1108
  *
1285
1109
  * @throws {@link Payabli.BadRequestError}
1286
1110
  * @throws {@link Payabli.UnauthorizedError}
@@ -1314,7 +1138,8 @@ export class Export {
1314
1138
  if (parameters != null) {
1315
1139
  _queryParams.parameters = toJson(parameters);
1316
1140
  }
1317
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1141
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1142
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1318
1143
  const _response = yield core.fetcher({
1319
1144
  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, `Export/invoices/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
1320
1145
  method: "GET",
@@ -1347,21 +1172,7 @@ export class Export {
1347
1172
  });
1348
1173
  }
1349
1174
  }
1350
- switch (_response.error.reason) {
1351
- case "non-json":
1352
- throw new errors.PayabliError({
1353
- statusCode: _response.error.statusCode,
1354
- body: _response.error.rawBody,
1355
- rawResponse: _response.rawResponse,
1356
- });
1357
- case "timeout":
1358
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/invoices/{format}/org/{orgId}.");
1359
- case "unknown":
1360
- throw new errors.PayabliError({
1361
- message: _response.error.errorMessage,
1362
- rawResponse: _response.rawResponse,
1363
- });
1364
- }
1175
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/invoices/{format}/org/{orgId}");
1365
1176
  });
1366
1177
  }
1367
1178
  /**
@@ -1370,7 +1181,7 @@ export class Export {
1370
1181
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1371
1182
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1372
1183
  * @param {Payabli.ExportOrganizationsRequest} request
1373
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1184
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1374
1185
  *
1375
1186
  * @throws {@link Payabli.BadRequestError}
1376
1187
  * @throws {@link Payabli.UnauthorizedError}
@@ -1404,7 +1215,8 @@ export class Export {
1404
1215
  if (parameters != null) {
1405
1216
  _queryParams.parameters = toJson(parameters);
1406
1217
  }
1407
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1218
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1219
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1408
1220
  const _response = yield core.fetcher({
1409
1221
  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, `Export/organizations/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
1410
1222
  method: "GET",
@@ -1437,30 +1249,16 @@ export class Export {
1437
1249
  });
1438
1250
  }
1439
1251
  }
1440
- switch (_response.error.reason) {
1441
- case "non-json":
1442
- throw new errors.PayabliError({
1443
- statusCode: _response.error.statusCode,
1444
- body: _response.error.rawBody,
1445
- rawResponse: _response.rawResponse,
1446
- });
1447
- case "timeout":
1448
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/organizations/{format}/org/{orgId}.");
1449
- case "unknown":
1450
- throw new errors.PayabliError({
1451
- message: _response.error.errorMessage,
1452
- rawResponse: _response.rawResponse,
1453
- });
1454
- }
1252
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/organizations/{format}/org/{orgId}");
1455
1253
  });
1456
1254
  }
1457
1255
  /**
1458
1256
  * Export a list of payouts and their statuses for an entrypoint. Use filters to limit results.
1459
1257
  *
1460
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1461
1258
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1259
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1462
1260
  * @param {Payabli.ExportPayoutRequest} request
1463
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1261
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1464
1262
  *
1465
1263
  * @throws {@link Payabli.BadRequestError}
1466
1264
  * @throws {@link Payabli.UnauthorizedError}
@@ -1468,17 +1266,17 @@ export class Export {
1468
1266
  * @throws {@link Payabli.ServiceUnavailableError}
1469
1267
  *
1470
1268
  * @example
1471
- * await client.export.exportPayout("8cfec329267", "csv", {
1269
+ * await client.export.exportPayout("csv", "8cfec329267", {
1472
1270
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
1473
1271
  * fromRecord: 251,
1474
1272
  * limitRecord: 1000
1475
1273
  * })
1476
1274
  */
1477
- exportPayout(entry, format, request = {}, requestOptions) {
1478
- return core.HttpResponsePromise.fromPromise(this.__exportPayout(entry, format, request, requestOptions));
1275
+ exportPayout(format, entry, request = {}, requestOptions) {
1276
+ return core.HttpResponsePromise.fromPromise(this.__exportPayout(format, entry, request, requestOptions));
1479
1277
  }
1480
- __exportPayout(entry_1, format_1) {
1481
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
1278
+ __exportPayout(format_1, entry_1) {
1279
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
1482
1280
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1483
1281
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
1484
1282
  const _queryParams = {};
@@ -1494,7 +1292,8 @@ export class Export {
1494
1292
  if (parameters != null) {
1495
1293
  _queryParams.parameters = toJson(parameters);
1496
1294
  }
1497
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1295
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1296
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1498
1297
  const _response = yield core.fetcher({
1499
1298
  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, `Export/payouts/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
1500
1299
  method: "GET",
@@ -1527,21 +1326,7 @@ export class Export {
1527
1326
  });
1528
1327
  }
1529
1328
  }
1530
- switch (_response.error.reason) {
1531
- case "non-json":
1532
- throw new errors.PayabliError({
1533
- statusCode: _response.error.statusCode,
1534
- body: _response.error.rawBody,
1535
- rawResponse: _response.rawResponse,
1536
- });
1537
- case "timeout":
1538
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/payouts/{format}/{entry}.");
1539
- case "unknown":
1540
- throw new errors.PayabliError({
1541
- message: _response.error.errorMessage,
1542
- rawResponse: _response.rawResponse,
1543
- });
1544
- }
1329
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/payouts/{format}/{entry}");
1545
1330
  });
1546
1331
  }
1547
1332
  /**
@@ -1550,7 +1335,7 @@ export class Export {
1550
1335
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1551
1336
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1552
1337
  * @param {Payabli.ExportPayoutOrgRequest} request
1553
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1338
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1554
1339
  *
1555
1340
  * @throws {@link Payabli.BadRequestError}
1556
1341
  * @throws {@link Payabli.UnauthorizedError}
@@ -1584,7 +1369,8 @@ export class Export {
1584
1369
  if (parameters != null) {
1585
1370
  _queryParams.parameters = toJson(parameters);
1586
1371
  }
1587
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1372
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1373
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1588
1374
  const _response = yield core.fetcher({
1589
1375
  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, `Export/payouts/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
1590
1376
  method: "GET",
@@ -1617,21 +1403,7 @@ export class Export {
1617
1403
  });
1618
1404
  }
1619
1405
  }
1620
- switch (_response.error.reason) {
1621
- case "non-json":
1622
- throw new errors.PayabliError({
1623
- statusCode: _response.error.statusCode,
1624
- body: _response.error.rawBody,
1625
- rawResponse: _response.rawResponse,
1626
- });
1627
- case "timeout":
1628
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/payouts/{format}/org/{orgId}.");
1629
- case "unknown":
1630
- throw new errors.PayabliError({
1631
- message: _response.error.errorMessage,
1632
- rawResponse: _response.rawResponse,
1633
- });
1634
- }
1406
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/payouts/{format}/org/{orgId}");
1635
1407
  });
1636
1408
  }
1637
1409
  /**
@@ -1640,7 +1412,7 @@ export class Export {
1640
1412
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1641
1413
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1642
1414
  * @param {Payabli.ExportPaypointsRequest} request
1643
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1415
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1644
1416
  *
1645
1417
  * @throws {@link Payabli.BadRequestError}
1646
1418
  * @throws {@link Payabli.UnauthorizedError}
@@ -1674,7 +1446,8 @@ export class Export {
1674
1446
  if (parameters != null) {
1675
1447
  _queryParams.parameters = toJson(parameters);
1676
1448
  }
1677
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1449
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1450
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1678
1451
  const _response = yield core.fetcher({
1679
1452
  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, `Export/paypoints/${core.url.encodePathParam(format)}/${core.url.encodePathParam(orgId)}`),
1680
1453
  method: "GET",
@@ -1707,30 +1480,16 @@ export class Export {
1707
1480
  });
1708
1481
  }
1709
1482
  }
1710
- switch (_response.error.reason) {
1711
- case "non-json":
1712
- throw new errors.PayabliError({
1713
- statusCode: _response.error.statusCode,
1714
- body: _response.error.rawBody,
1715
- rawResponse: _response.rawResponse,
1716
- });
1717
- case "timeout":
1718
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/paypoints/{format}/{orgId}.");
1719
- case "unknown":
1720
- throw new errors.PayabliError({
1721
- message: _response.error.errorMessage,
1722
- rawResponse: _response.rawResponse,
1723
- });
1724
- }
1483
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/paypoints/{format}/{orgId}");
1725
1484
  });
1726
1485
  }
1727
1486
  /**
1728
1487
  * Export a list of settled transactions for an entrypoint. Use filters to limit results.
1729
1488
  *
1730
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1731
1489
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1490
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1732
1491
  * @param {Payabli.ExportSettlementsRequest} request
1733
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1492
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1734
1493
  *
1735
1494
  * @throws {@link Payabli.BadRequestError}
1736
1495
  * @throws {@link Payabli.UnauthorizedError}
@@ -1738,17 +1497,17 @@ export class Export {
1738
1497
  * @throws {@link Payabli.ServiceUnavailableError}
1739
1498
  *
1740
1499
  * @example
1741
- * await client.export.exportSettlements("8cfec329267", "csv", {
1500
+ * await client.export.exportSettlements("csv", "8cfec329267", {
1742
1501
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
1743
1502
  * fromRecord: 251,
1744
1503
  * limitRecord: 1000
1745
1504
  * })
1746
1505
  */
1747
- exportSettlements(entry, format, request = {}, requestOptions) {
1748
- return core.HttpResponsePromise.fromPromise(this.__exportSettlements(entry, format, request, requestOptions));
1506
+ exportSettlements(format, entry, request = {}, requestOptions) {
1507
+ return core.HttpResponsePromise.fromPromise(this.__exportSettlements(format, entry, request, requestOptions));
1749
1508
  }
1750
- __exportSettlements(entry_1, format_1) {
1751
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
1509
+ __exportSettlements(format_1, entry_1) {
1510
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
1752
1511
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1753
1512
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
1754
1513
  const _queryParams = {};
@@ -1764,7 +1523,8 @@ export class Export {
1764
1523
  if (parameters != null) {
1765
1524
  _queryParams.parameters = toJson(parameters);
1766
1525
  }
1767
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1526
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1527
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1768
1528
  const _response = yield core.fetcher({
1769
1529
  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, `Export/settlements/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
1770
1530
  method: "GET",
@@ -1797,21 +1557,7 @@ export class Export {
1797
1557
  });
1798
1558
  }
1799
1559
  }
1800
- switch (_response.error.reason) {
1801
- case "non-json":
1802
- throw new errors.PayabliError({
1803
- statusCode: _response.error.statusCode,
1804
- body: _response.error.rawBody,
1805
- rawResponse: _response.rawResponse,
1806
- });
1807
- case "timeout":
1808
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/settlements/{format}/{entry}.");
1809
- case "unknown":
1810
- throw new errors.PayabliError({
1811
- message: _response.error.errorMessage,
1812
- rawResponse: _response.rawResponse,
1813
- });
1814
- }
1560
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/settlements/{format}/{entry}");
1815
1561
  });
1816
1562
  }
1817
1563
  /**
@@ -1820,7 +1566,7 @@ export class Export {
1820
1566
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1821
1567
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1822
1568
  * @param {Payabli.ExportSettlementsOrgRequest} request
1823
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1569
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1824
1570
  *
1825
1571
  * @throws {@link Payabli.BadRequestError}
1826
1572
  * @throws {@link Payabli.UnauthorizedError}
@@ -1854,7 +1600,8 @@ export class Export {
1854
1600
  if (parameters != null) {
1855
1601
  _queryParams.parameters = toJson(parameters);
1856
1602
  }
1857
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1603
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1604
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1858
1605
  const _response = yield core.fetcher({
1859
1606
  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, `Export/settlements/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
1860
1607
  method: "GET",
@@ -1887,30 +1634,16 @@ export class Export {
1887
1634
  });
1888
1635
  }
1889
1636
  }
1890
- switch (_response.error.reason) {
1891
- case "non-json":
1892
- throw new errors.PayabliError({
1893
- statusCode: _response.error.statusCode,
1894
- body: _response.error.rawBody,
1895
- rawResponse: _response.rawResponse,
1896
- });
1897
- case "timeout":
1898
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/settlements/{format}/org/{orgId}.");
1899
- case "unknown":
1900
- throw new errors.PayabliError({
1901
- message: _response.error.errorMessage,
1902
- rawResponse: _response.rawResponse,
1903
- });
1904
- }
1637
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/settlements/{format}/org/{orgId}");
1905
1638
  });
1906
1639
  }
1907
1640
  /**
1908
1641
  * Export a list of subscriptions for an entrypoint. Use filters to limit results.
1909
1642
  *
1910
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1911
1643
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1644
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
1912
1645
  * @param {Payabli.ExportSubscriptionsRequest} request
1913
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1646
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
1914
1647
  *
1915
1648
  * @throws {@link Payabli.BadRequestError}
1916
1649
  * @throws {@link Payabli.UnauthorizedError}
@@ -1918,17 +1651,17 @@ export class Export {
1918
1651
  * @throws {@link Payabli.ServiceUnavailableError}
1919
1652
  *
1920
1653
  * @example
1921
- * await client.export.exportSubscriptions("8cfec329267", "csv", {
1654
+ * await client.export.exportSubscriptions("csv", "8cfec329267", {
1922
1655
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
1923
1656
  * fromRecord: 251,
1924
1657
  * limitRecord: 1000
1925
1658
  * })
1926
1659
  */
1927
- exportSubscriptions(entry, format, request = {}, requestOptions) {
1928
- return core.HttpResponsePromise.fromPromise(this.__exportSubscriptions(entry, format, request, requestOptions));
1660
+ exportSubscriptions(format, entry, request = {}, requestOptions) {
1661
+ return core.HttpResponsePromise.fromPromise(this.__exportSubscriptions(format, entry, request, requestOptions));
1929
1662
  }
1930
- __exportSubscriptions(entry_1, format_1) {
1931
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
1663
+ __exportSubscriptions(format_1, entry_1) {
1664
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
1932
1665
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1933
1666
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
1934
1667
  const _queryParams = {};
@@ -1944,7 +1677,8 @@ export class Export {
1944
1677
  if (parameters != null) {
1945
1678
  _queryParams.parameters = toJson(parameters);
1946
1679
  }
1947
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1680
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1681
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1948
1682
  const _response = yield core.fetcher({
1949
1683
  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, `Export/subscriptions/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
1950
1684
  method: "GET",
@@ -1977,21 +1711,7 @@ export class Export {
1977
1711
  });
1978
1712
  }
1979
1713
  }
1980
- switch (_response.error.reason) {
1981
- case "non-json":
1982
- throw new errors.PayabliError({
1983
- statusCode: _response.error.statusCode,
1984
- body: _response.error.rawBody,
1985
- rawResponse: _response.rawResponse,
1986
- });
1987
- case "timeout":
1988
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/subscriptions/{format}/{entry}.");
1989
- case "unknown":
1990
- throw new errors.PayabliError({
1991
- message: _response.error.errorMessage,
1992
- rawResponse: _response.rawResponse,
1993
- });
1994
- }
1714
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/subscriptions/{format}/{entry}");
1995
1715
  });
1996
1716
  }
1997
1717
  /**
@@ -2000,7 +1720,7 @@ export class Export {
2000
1720
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
2001
1721
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2002
1722
  * @param {Payabli.ExportSubscriptionsOrgRequest} request
2003
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1723
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2004
1724
  *
2005
1725
  * @throws {@link Payabli.BadRequestError}
2006
1726
  * @throws {@link Payabli.UnauthorizedError}
@@ -2034,7 +1754,8 @@ export class Export {
2034
1754
  if (parameters != null) {
2035
1755
  _queryParams.parameters = toJson(parameters);
2036
1756
  }
2037
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1757
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1758
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2038
1759
  const _response = yield core.fetcher({
2039
1760
  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, `Export/subscriptions/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
2040
1761
  method: "GET",
@@ -2067,30 +1788,16 @@ export class Export {
2067
1788
  });
2068
1789
  }
2069
1790
  }
2070
- switch (_response.error.reason) {
2071
- case "non-json":
2072
- throw new errors.PayabliError({
2073
- statusCode: _response.error.statusCode,
2074
- body: _response.error.rawBody,
2075
- rawResponse: _response.rawResponse,
2076
- });
2077
- case "timeout":
2078
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/subscriptions/{format}/org/{orgId}.");
2079
- case "unknown":
2080
- throw new errors.PayabliError({
2081
- message: _response.error.errorMessage,
2082
- rawResponse: _response.rawResponse,
2083
- });
2084
- }
1791
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/subscriptions/{format}/org/{orgId}");
2085
1792
  });
2086
1793
  }
2087
1794
  /**
2088
1795
  * Export a list of transactions for an entrypoint in a file in XLXS or CSV format. Use filters to limit results. If you don't specify a date range in the request, the last two months of data are returned.
2089
1796
  *
2090
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2091
1797
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1798
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2092
1799
  * @param {Payabli.ExportTransactionsRequest} request
2093
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1800
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2094
1801
  *
2095
1802
  * @throws {@link Payabli.BadRequestError}
2096
1803
  * @throws {@link Payabli.UnauthorizedError}
@@ -2098,17 +1805,17 @@ export class Export {
2098
1805
  * @throws {@link Payabli.ServiceUnavailableError}
2099
1806
  *
2100
1807
  * @example
2101
- * await client.export.exportTransactions("8cfec329267", "csv", {
1808
+ * await client.export.exportTransactions("csv", "8cfec329267", {
2102
1809
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
2103
1810
  * fromRecord: 251,
2104
1811
  * limitRecord: 1000
2105
1812
  * })
2106
1813
  */
2107
- exportTransactions(entry, format, request = {}, requestOptions) {
2108
- return core.HttpResponsePromise.fromPromise(this.__exportTransactions(entry, format, request, requestOptions));
1814
+ exportTransactions(format, entry, request = {}, requestOptions) {
1815
+ return core.HttpResponsePromise.fromPromise(this.__exportTransactions(format, entry, request, requestOptions));
2109
1816
  }
2110
- __exportTransactions(entry_1, format_1) {
2111
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
1817
+ __exportTransactions(format_1, entry_1) {
1818
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
2112
1819
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2113
1820
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
2114
1821
  const _queryParams = {};
@@ -2124,7 +1831,8 @@ export class Export {
2124
1831
  if (parameters != null) {
2125
1832
  _queryParams.parameters = toJson(parameters);
2126
1833
  }
2127
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1834
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1835
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2128
1836
  const _response = yield core.fetcher({
2129
1837
  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, `Export/transactions/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
2130
1838
  method: "GET",
@@ -2157,21 +1865,7 @@ export class Export {
2157
1865
  });
2158
1866
  }
2159
1867
  }
2160
- switch (_response.error.reason) {
2161
- case "non-json":
2162
- throw new errors.PayabliError({
2163
- statusCode: _response.error.statusCode,
2164
- body: _response.error.rawBody,
2165
- rawResponse: _response.rawResponse,
2166
- });
2167
- case "timeout":
2168
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/transactions/{format}/{entry}.");
2169
- case "unknown":
2170
- throw new errors.PayabliError({
2171
- message: _response.error.errorMessage,
2172
- rawResponse: _response.rawResponse,
2173
- });
2174
- }
1868
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/transactions/{format}/{entry}");
2175
1869
  });
2176
1870
  }
2177
1871
  /**
@@ -2180,7 +1874,7 @@ export class Export {
2180
1874
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
2181
1875
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2182
1876
  * @param {Payabli.ExportTransactionsOrgRequest} request
2183
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1877
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2184
1878
  *
2185
1879
  * @throws {@link Payabli.BadRequestError}
2186
1880
  * @throws {@link Payabli.UnauthorizedError}
@@ -2214,7 +1908,8 @@ export class Export {
2214
1908
  if (parameters != null) {
2215
1909
  _queryParams.parameters = toJson(parameters);
2216
1910
  }
2217
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1911
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1912
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2218
1913
  const _response = yield core.fetcher({
2219
1914
  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, `Export/transactions/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
2220
1915
  method: "GET",
@@ -2247,31 +1942,17 @@ export class Export {
2247
1942
  });
2248
1943
  }
2249
1944
  }
2250
- switch (_response.error.reason) {
2251
- case "non-json":
2252
- throw new errors.PayabliError({
2253
- statusCode: _response.error.statusCode,
2254
- body: _response.error.rawBody,
2255
- rawResponse: _response.rawResponse,
2256
- });
2257
- case "timeout":
2258
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/transactions/{format}/org/{orgId}.");
2259
- case "unknown":
2260
- throw new errors.PayabliError({
2261
- message: _response.error.errorMessage,
2262
- rawResponse: _response.rawResponse,
2263
- });
2264
- }
1945
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/transactions/{format}/org/{orgId}");
2265
1946
  });
2266
1947
  }
2267
1948
  /**
2268
1949
  * Export a list of transfer details for an entrypoint. Use filters to limit results.
2269
1950
  *
2270
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2271
1951
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
1952
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2272
1953
  * @param {number} transferId - Transfer identifier.
2273
1954
  * @param {Payabli.ExportTransferDetailsRequest} request
2274
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
1955
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2275
1956
  *
2276
1957
  * @throws {@link Payabli.BadRequestError}
2277
1958
  * @throws {@link Payabli.UnauthorizedError}
@@ -2279,18 +1960,18 @@ export class Export {
2279
1960
  * @throws {@link Payabli.ServiceUnavailableError}
2280
1961
  *
2281
1962
  * @example
2282
- * await client.export.exportTransferDetails("8cfec329267", "csv", 1000000, {
1963
+ * await client.export.exportTransferDetails("csv", "8cfec329267", 1000000, {
2283
1964
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
2284
1965
  * fromRecord: 251,
2285
1966
  * limitRecord: 1000,
2286
1967
  * sortBy: "desc(field_name)"
2287
1968
  * })
2288
1969
  */
2289
- exportTransferDetails(entry, format, transferId, request = {}, requestOptions) {
2290
- return core.HttpResponsePromise.fromPromise(this.__exportTransferDetails(entry, format, transferId, request, requestOptions));
1970
+ exportTransferDetails(format, entry, transferId, request = {}, requestOptions) {
1971
+ return core.HttpResponsePromise.fromPromise(this.__exportTransferDetails(format, entry, transferId, request, requestOptions));
2291
1972
  }
2292
- __exportTransferDetails(entry_1, format_1, transferId_1) {
2293
- return __awaiter(this, arguments, void 0, function* (entry, format, transferId, request = {}, requestOptions) {
1973
+ __exportTransferDetails(format_1, entry_1, transferId_1) {
1974
+ return __awaiter(this, arguments, void 0, function* (format, entry, transferId, request = {}, requestOptions) {
2294
1975
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2295
1976
  const { columnsExport, fromRecord, limitRecord, parameters, sortBy } = request;
2296
1977
  const _queryParams = {};
@@ -2309,7 +1990,8 @@ export class Export {
2309
1990
  if (sortBy != null) {
2310
1991
  _queryParams.sortBy = sortBy;
2311
1992
  }
2312
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1993
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1994
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2313
1995
  const _response = yield core.fetcher({
2314
1996
  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, `Export/transferDetails/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}/${core.url.encodePathParam(transferId)}`),
2315
1997
  method: "GET",
@@ -2342,21 +2024,7 @@ export class Export {
2342
2024
  });
2343
2025
  }
2344
2026
  }
2345
- switch (_response.error.reason) {
2346
- case "non-json":
2347
- throw new errors.PayabliError({
2348
- statusCode: _response.error.statusCode,
2349
- body: _response.error.rawBody,
2350
- rawResponse: _response.rawResponse,
2351
- });
2352
- case "timeout":
2353
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/transferDetails/{format}/{entry}/{transferId}.");
2354
- case "unknown":
2355
- throw new errors.PayabliError({
2356
- message: _response.error.errorMessage,
2357
- rawResponse: _response.rawResponse,
2358
- });
2359
- }
2027
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/transferDetails/{format}/{entry}/{transferId}");
2360
2028
  });
2361
2029
  }
2362
2030
  /**
@@ -2364,7 +2032,7 @@ export class Export {
2364
2032
  *
2365
2033
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2366
2034
  * @param {Payabli.ExportTransfersRequest} request
2367
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
2035
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2368
2036
  *
2369
2037
  * @throws {@link Payabli.BadRequestError}
2370
2038
  * @throws {@link Payabli.UnauthorizedError}
@@ -2402,7 +2070,8 @@ export class Export {
2402
2070
  if (sortBy != null) {
2403
2071
  _queryParams.sortBy = sortBy;
2404
2072
  }
2405
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2073
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2074
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2406
2075
  const _response = yield core.fetcher({
2407
2076
  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, `Export/transfers/${core.url.encodePathParam(entry)}`),
2408
2077
  method: "GET",
@@ -2435,30 +2104,16 @@ export class Export {
2435
2104
  });
2436
2105
  }
2437
2106
  }
2438
- switch (_response.error.reason) {
2439
- case "non-json":
2440
- throw new errors.PayabliError({
2441
- statusCode: _response.error.statusCode,
2442
- body: _response.error.rawBody,
2443
- rawResponse: _response.rawResponse,
2444
- });
2445
- case "timeout":
2446
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/transfers/{entry}.");
2447
- case "unknown":
2448
- throw new errors.PayabliError({
2449
- message: _response.error.errorMessage,
2450
- rawResponse: _response.rawResponse,
2451
- });
2452
- }
2107
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/transfers/{entry}");
2453
2108
  });
2454
2109
  }
2455
2110
  /**
2456
2111
  * Export a list of vendors for an entrypoint. Use filters to limit results.
2457
2112
  *
2458
- * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2459
2113
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
2114
+ * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2460
2115
  * @param {Payabli.ExportVendorsRequest} request
2461
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
2116
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2462
2117
  *
2463
2118
  * @throws {@link Payabli.BadRequestError}
2464
2119
  * @throws {@link Payabli.UnauthorizedError}
@@ -2466,17 +2121,17 @@ export class Export {
2466
2121
  * @throws {@link Payabli.ServiceUnavailableError}
2467
2122
  *
2468
2123
  * @example
2469
- * await client.export.exportVendors("8cfec329267", "csv", {
2124
+ * await client.export.exportVendors("csv", "8cfec329267", {
2470
2125
  * columnsExport: "BatchDate:Batch_Date,PaypointName:Legal_name",
2471
2126
  * fromRecord: 251,
2472
2127
  * limitRecord: 1000
2473
2128
  * })
2474
2129
  */
2475
- exportVendors(entry, format, request = {}, requestOptions) {
2476
- return core.HttpResponsePromise.fromPromise(this.__exportVendors(entry, format, request, requestOptions));
2130
+ exportVendors(format, entry, request = {}, requestOptions) {
2131
+ return core.HttpResponsePromise.fromPromise(this.__exportVendors(format, entry, request, requestOptions));
2477
2132
  }
2478
- __exportVendors(entry_1, format_1) {
2479
- return __awaiter(this, arguments, void 0, function* (entry, format, request = {}, requestOptions) {
2133
+ __exportVendors(format_1, entry_1) {
2134
+ return __awaiter(this, arguments, void 0, function* (format, entry, request = {}, requestOptions) {
2480
2135
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2481
2136
  const { columnsExport, fromRecord, limitRecord, parameters } = request;
2482
2137
  const _queryParams = {};
@@ -2492,7 +2147,8 @@ export class Export {
2492
2147
  if (parameters != null) {
2493
2148
  _queryParams.parameters = toJson(parameters);
2494
2149
  }
2495
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2150
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2151
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2496
2152
  const _response = yield core.fetcher({
2497
2153
  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, `Export/vendors/${core.url.encodePathParam(format)}/${core.url.encodePathParam(entry)}`),
2498
2154
  method: "GET",
@@ -2525,21 +2181,7 @@ export class Export {
2525
2181
  });
2526
2182
  }
2527
2183
  }
2528
- switch (_response.error.reason) {
2529
- case "non-json":
2530
- throw new errors.PayabliError({
2531
- statusCode: _response.error.statusCode,
2532
- body: _response.error.rawBody,
2533
- rawResponse: _response.rawResponse,
2534
- });
2535
- case "timeout":
2536
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/vendors/{format}/{entry}.");
2537
- case "unknown":
2538
- throw new errors.PayabliError({
2539
- message: _response.error.errorMessage,
2540
- rawResponse: _response.rawResponse,
2541
- });
2542
- }
2184
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/vendors/{format}/{entry}");
2543
2185
  });
2544
2186
  }
2545
2187
  /**
@@ -2548,7 +2190,7 @@ export class Export {
2548
2190
  * @param {Payabli.ExportFormat1} format - Format for the export, either XLSX or CSV.
2549
2191
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2550
2192
  * @param {Payabli.ExportVendorsOrgRequest} request
2551
- * @param {Export.RequestOptions} requestOptions - Request-specific configuration.
2193
+ * @param {ExportClient.RequestOptions} requestOptions - Request-specific configuration.
2552
2194
  *
2553
2195
  * @throws {@link Payabli.BadRequestError}
2554
2196
  * @throws {@link Payabli.UnauthorizedError}
@@ -2582,7 +2224,8 @@ export class Export {
2582
2224
  if (parameters != null) {
2583
2225
  _queryParams.parameters = toJson(parameters);
2584
2226
  }
2585
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2227
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2228
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2586
2229
  const _response = yield core.fetcher({
2587
2230
  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, `Export/vendors/${core.url.encodePathParam(format)}/org/${core.url.encodePathParam(orgId)}`),
2588
2231
  method: "GET",
@@ -2615,27 +2258,7 @@ export class Export {
2615
2258
  });
2616
2259
  }
2617
2260
  }
2618
- switch (_response.error.reason) {
2619
- case "non-json":
2620
- throw new errors.PayabliError({
2621
- statusCode: _response.error.statusCode,
2622
- body: _response.error.rawBody,
2623
- rawResponse: _response.rawResponse,
2624
- });
2625
- case "timeout":
2626
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Export/vendors/{format}/org/{orgId}.");
2627
- case "unknown":
2628
- throw new errors.PayabliError({
2629
- message: _response.error.errorMessage,
2630
- rawResponse: _response.rawResponse,
2631
- });
2632
- }
2633
- });
2634
- }
2635
- _getCustomAuthorizationHeaders() {
2636
- return __awaiter(this, void 0, void 0, function* () {
2637
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
2638
- return { requestToken: apiKeyValue };
2261
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/Export/vendors/{format}/org/{orgId}");
2639
2262
  });
2640
2263
  }
2641
2264
  }