@payabli/sdk-node 0.0.116 → 0.0.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/README.md +31 -2
  2. package/dist/cjs/BaseClient.d.ts +13 -4
  3. package/dist/cjs/BaseClient.js +59 -0
  4. package/dist/cjs/Client.d.ts +88 -88
  5. package/dist/cjs/Client.js +31 -72
  6. package/dist/cjs/api/errors/BadRequestError.js +5 -1
  7. package/dist/cjs/api/errors/ConflictError.js +5 -1
  8. package/dist/cjs/api/errors/ForbiddenError.js +5 -1
  9. package/dist/cjs/api/errors/InternalServerError.js +5 -1
  10. package/dist/cjs/api/errors/ServiceUnavailableError.js +5 -1
  11. package/dist/cjs/api/errors/UnauthorizedError.js +5 -1
  12. package/dist/cjs/api/resources/bill/client/Client.d.ts +34 -35
  13. package/dist/cjs/api/resources/bill/client/Client.js +69 -216
  14. package/dist/cjs/api/resources/boarding/client/Client.d.ts +28 -29
  15. package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
  16. package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +18 -17
  17. package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
  18. package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +8 -9
  19. package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
  20. package/dist/cjs/api/resources/cloud/client/Client.d.ts +18 -19
  21. package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
  22. package/dist/cjs/api/resources/customer/client/Client.d.ts +18 -19
  23. package/dist/cjs/api/resources/customer/client/Client.js +31 -113
  24. package/dist/cjs/api/resources/export/client/Client.d.ts +94 -91
  25. package/dist/cjs/api/resources/export/client/Client.js +205 -582
  26. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +12 -13
  27. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
  28. package/dist/cjs/api/resources/import/client/Client.d.ts +12 -13
  29. package/dist/cjs/api/resources/import/client/Client.js +19 -62
  30. package/dist/cjs/api/resources/invoice/client/Client.d.ts +37 -36
  31. package/dist/cjs/api/resources/invoice/client/Client.js +67 -212
  32. package/dist/cjs/api/resources/invoice/client/requests/AddInvoiceRequest.d.ts +5 -3
  33. package/dist/cjs/api/resources/lineItem/client/Client.d.ts +16 -17
  34. package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
  35. package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +40 -41
  36. package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
  37. package/dist/cjs/api/resources/moneyIn/errors/CaptureError.js +5 -1
  38. package/dist/cjs/api/resources/moneyIn/errors/InvalidTransStatusError.js +5 -1
  39. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +44 -28
  40. package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
  41. package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
  42. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
  43. package/dist/cjs/api/resources/notification/client/Client.d.ts +30 -18
  44. package/dist/cjs/api/resources/notification/client/Client.js +45 -101
  45. package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +14 -15
  46. package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
  47. package/dist/cjs/api/resources/ocr/client/Client.d.ts +14 -11
  48. package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
  49. package/dist/cjs/api/resources/organization/client/Client.d.ts +20 -21
  50. package/dist/cjs/api/resources/organization/client/Client.js +35 -130
  51. package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +27 -28
  52. package/dist/cjs/api/resources/paymentLink/client/Client.js +46 -167
  53. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataBill.d.ts +1 -1
  54. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.ts +1 -1
  55. package/dist/cjs/api/resources/paymentLink/client/requests/PayLinkDataOut.d.ts +1 -1
  56. package/dist/cjs/api/resources/paymentLink/types/PaymentPageRequestBody.d.ts +2 -2
  57. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +20 -21
  58. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
  59. package/dist/cjs/api/resources/paypoint/client/Client.d.ts +23 -24
  60. package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
  61. package/dist/cjs/api/resources/query/client/Client.d.ts +72 -73
  62. package/dist/cjs/api/resources/query/client/Client.js +137 -572
  63. package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
  64. package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
  65. package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
  66. package/dist/cjs/api/resources/statistic/client/Client.d.ts +51 -52
  67. package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
  68. package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
  69. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
  70. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
  71. package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
  72. package/dist/cjs/api/resources/statistic/types/index.js +1 -0
  73. package/dist/cjs/api/resources/subscription/client/Client.d.ts +14 -15
  74. package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
  75. package/dist/cjs/api/resources/templates/client/Client.d.ts +16 -17
  76. package/dist/cjs/api/resources/templates/client/Client.js +28 -84
  77. package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +14 -15
  78. package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
  79. package/dist/cjs/api/resources/tokenStorage/types/GetMethodResponse.d.ts +1 -1
  80. package/dist/cjs/api/resources/user/client/Client.d.ts +55 -34
  81. package/dist/cjs/api/resources/user/client/Client.js +84 -222
  82. package/dist/cjs/api/resources/vendor/client/Client.d.ts +14 -15
  83. package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
  84. package/dist/cjs/api/resources/wallet/client/Client.d.ts +14 -15
  85. package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
  86. package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
  87. package/dist/cjs/api/types/Frequency.d.ts +1 -1
  88. package/dist/cjs/api/types/Frequency.js +1 -1
  89. package/dist/cjs/api/types/FrequencyList.d.ts +1 -1
  90. package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
  91. package/dist/cjs/api/types/NotificationContent.js +1 -0
  92. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
  93. package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
  94. package/dist/cjs/api/types/PayorDataResponse.d.ts +1 -1
  95. package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
  96. package/dist/cjs/auth/HeaderAuthProvider.d.ts +16 -0
  97. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  98. package/dist/cjs/auth/index.d.ts +1 -0
  99. package/dist/cjs/auth/index.js +5 -0
  100. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  101. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  102. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  103. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  104. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  105. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  106. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  107. package/dist/cjs/core/auth/BearerToken.js +16 -0
  108. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  109. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  110. package/dist/cjs/core/auth/index.d.ts +5 -0
  111. package/dist/cjs/core/auth/index.js +9 -0
  112. package/dist/cjs/core/base64.d.ts +2 -0
  113. package/dist/cjs/core/base64.js +26 -0
  114. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  115. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
  116. package/dist/cjs/core/fetcher/Fetcher.js +42 -24
  117. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  118. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  119. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  120. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  121. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  122. package/dist/cjs/core/fetcher/signals.js +0 -12
  123. package/dist/cjs/core/index.d.ts +2 -0
  124. package/dist/cjs/core/index.js +2 -0
  125. package/dist/cjs/core/logging/logger.js +1 -1
  126. package/dist/cjs/core/runtime/runtime.js +11 -10
  127. package/dist/cjs/core/url/join.js +0 -1
  128. package/dist/cjs/errors/PayabliError.js +5 -1
  129. package/dist/cjs/errors/PayabliTimeoutError.js +5 -1
  130. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  131. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  132. package/dist/cjs/version.d.ts +1 -1
  133. package/dist/cjs/version.js +1 -1
  134. package/dist/esm/BaseClient.d.mts +13 -4
  135. package/dist/esm/BaseClient.mjs +24 -1
  136. package/dist/esm/Client.d.mts +88 -88
  137. package/dist/esm/Client.mjs +59 -67
  138. package/dist/esm/api/errors/BadRequestError.mjs +5 -1
  139. package/dist/esm/api/errors/ConflictError.mjs +5 -1
  140. package/dist/esm/api/errors/ForbiddenError.mjs +5 -1
  141. package/dist/esm/api/errors/InternalServerError.mjs +5 -1
  142. package/dist/esm/api/errors/ServiceUnavailableError.mjs +5 -1
  143. package/dist/esm/api/errors/UnauthorizedError.mjs +5 -1
  144. package/dist/esm/api/resources/bill/client/Client.d.mts +34 -35
  145. package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
  146. package/dist/esm/api/resources/boarding/client/Client.d.mts +28 -29
  147. package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
  148. package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +18 -17
  149. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
  150. package/dist/esm/api/resources/checkCapture/client/Client.d.mts +8 -9
  151. package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
  152. package/dist/esm/api/resources/cloud/client/Client.d.mts +18 -19
  153. package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
  154. package/dist/esm/api/resources/customer/client/Client.d.mts +18 -19
  155. package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
  156. package/dist/esm/api/resources/export/client/Client.d.mts +94 -91
  157. package/dist/esm/api/resources/export/client/Client.mjs +204 -581
  158. package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +12 -13
  159. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
  160. package/dist/esm/api/resources/import/client/Client.d.mts +12 -13
  161. package/dist/esm/api/resources/import/client/Client.mjs +17 -60
  162. package/dist/esm/api/resources/invoice/client/Client.d.mts +37 -36
  163. package/dist/esm/api/resources/invoice/client/Client.mjs +65 -210
  164. package/dist/esm/api/resources/invoice/client/requests/AddInvoiceRequest.d.mts +5 -3
  165. package/dist/esm/api/resources/lineItem/client/Client.d.mts +16 -17
  166. package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
  167. package/dist/esm/api/resources/moneyIn/client/Client.d.mts +40 -41
  168. package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
  169. package/dist/esm/api/resources/moneyIn/errors/CaptureError.mjs +5 -1
  170. package/dist/esm/api/resources/moneyIn/errors/InvalidTransStatusError.mjs +5 -1
  171. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +44 -28
  172. package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
  173. package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
  174. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
  175. package/dist/esm/api/resources/notification/client/Client.d.mts +30 -18
  176. package/dist/esm/api/resources/notification/client/Client.mjs +44 -100
  177. package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +14 -15
  178. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
  179. package/dist/esm/api/resources/ocr/client/Client.d.mts +14 -11
  180. package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
  181. package/dist/esm/api/resources/organization/client/Client.d.mts +20 -21
  182. package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
  183. package/dist/esm/api/resources/paymentLink/client/Client.d.mts +27 -28
  184. package/dist/esm/api/resources/paymentLink/client/Client.mjs +44 -165
  185. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataBill.d.mts +1 -1
  186. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataInvoice.d.mts +1 -1
  187. package/dist/esm/api/resources/paymentLink/client/requests/PayLinkDataOut.d.mts +1 -1
  188. package/dist/esm/api/resources/paymentLink/types/PaymentPageRequestBody.d.mts +2 -2
  189. package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +20 -21
  190. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
  191. package/dist/esm/api/resources/paypoint/client/Client.d.mts +23 -24
  192. package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
  193. package/dist/esm/api/resources/query/client/Client.d.mts +72 -73
  194. package/dist/esm/api/resources/query/client/Client.mjs +136 -571
  195. package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
  196. package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
  197. package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
  198. package/dist/esm/api/resources/statistic/client/Client.d.mts +51 -52
  199. package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
  200. package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
  201. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
  202. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
  203. package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
  204. package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
  205. package/dist/esm/api/resources/subscription/client/Client.d.mts +14 -15
  206. package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
  207. package/dist/esm/api/resources/templates/client/Client.d.mts +16 -17
  208. package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
  209. package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +14 -15
  210. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
  211. package/dist/esm/api/resources/tokenStorage/types/GetMethodResponse.d.mts +1 -1
  212. package/dist/esm/api/resources/user/client/Client.d.mts +55 -34
  213. package/dist/esm/api/resources/user/client/Client.mjs +83 -221
  214. package/dist/esm/api/resources/vendor/client/Client.d.mts +14 -15
  215. package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
  216. package/dist/esm/api/resources/wallet/client/Client.d.mts +14 -15
  217. package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
  218. package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
  219. package/dist/esm/api/types/Frequency.d.mts +1 -1
  220. package/dist/esm/api/types/Frequency.mjs +1 -1
  221. package/dist/esm/api/types/FrequencyList.d.mts +1 -1
  222. package/dist/esm/api/types/NotificationContent.d.mts +1 -0
  223. package/dist/esm/api/types/NotificationContent.mjs +1 -0
  224. package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
  225. package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
  226. package/dist/esm/api/types/PayorDataResponse.d.mts +1 -1
  227. package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
  228. package/dist/esm/auth/HeaderAuthProvider.d.mts +16 -0
  229. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  230. package/dist/esm/auth/index.d.mts +1 -0
  231. package/dist/esm/auth/index.mjs +1 -0
  232. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  233. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  234. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  235. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  236. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  237. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  238. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  239. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  240. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  241. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  242. package/dist/esm/core/auth/index.d.mts +5 -0
  243. package/dist/esm/core/auth/index.mjs +3 -0
  244. package/dist/esm/core/base64.d.mts +2 -0
  245. package/dist/esm/core/base64.mjs +22 -0
  246. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  247. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
  248. package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
  249. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  250. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  251. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  252. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  253. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  254. package/dist/esm/core/fetcher/signals.mjs +0 -12
  255. package/dist/esm/core/index.d.mts +2 -0
  256. package/dist/esm/core/index.mjs +2 -0
  257. package/dist/esm/core/logging/logger.mjs +1 -1
  258. package/dist/esm/core/runtime/runtime.mjs +11 -10
  259. package/dist/esm/core/url/join.mjs +0 -1
  260. package/dist/esm/errors/PayabliError.mjs +5 -1
  261. package/dist/esm/errors/PayabliTimeoutError.mjs +5 -1
  262. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  263. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  264. package/dist/esm/version.d.mts +1 -1
  265. package/dist/esm/version.mjs +1 -1
  266. package/package.json +5 -2
  267. package/reference.md +768 -478
  268. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  269. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  270. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  271. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -43,16 +43,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.Query = void 0;
46
+ exports.QueryClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
47
48
  const headers_js_1 = require("../../../../core/headers.js");
48
49
  const core = __importStar(require("../../../../core/index.js"));
49
50
  const json_js_1 = require("../../../../core/json.js");
50
51
  const environments = __importStar(require("../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
51
53
  const errors = __importStar(require("../../../../errors/index.js"));
52
54
  const Payabli = __importStar(require("../../../index.js"));
53
- class Query {
54
- constructor(_options = {}) {
55
- this._options = _options;
55
+ class QueryClient {
56
+ constructor(options = {}) {
57
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
56
58
  }
57
59
  /**
58
60
  * Retrieve a list of batches and their details, including settled and
@@ -60,7 +62,7 @@ class Query {
60
62
  *
61
63
  * @param {Payabli.Entry} entry
62
64
  * @param {Payabli.ListBatchDetailsRequest} request
63
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
65
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
64
66
  *
65
67
  * @throws {@link Payabli.BadRequestError}
66
68
  * @throws {@link Payabli.UnauthorizedError}
@@ -97,7 +99,8 @@ class Query {
97
99
  if (sortBy != null) {
98
100
  _queryParams.sortBy = sortBy;
99
101
  }
100
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
102
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
103
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
101
104
  const _response = yield core.fetcher({
102
105
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batchDetails/${core.url.encodePathParam(entry)}`),
103
106
  method: "GET",
@@ -130,21 +133,7 @@ class Query {
130
133
  });
131
134
  }
132
135
  }
133
- switch (_response.error.reason) {
134
- case "non-json":
135
- throw new errors.PayabliError({
136
- statusCode: _response.error.statusCode,
137
- body: _response.error.rawBody,
138
- rawResponse: _response.rawResponse,
139
- });
140
- case "timeout":
141
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batchDetails/{entry}.");
142
- case "unknown":
143
- throw new errors.PayabliError({
144
- message: _response.error.errorMessage,
145
- rawResponse: _response.rawResponse,
146
- });
147
- }
136
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batchDetails/{entry}");
148
137
  });
149
138
  }
150
139
  /**
@@ -152,7 +141,7 @@ class Query {
152
141
  *
153
142
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
154
143
  * @param {Payabli.ListBatchDetailsOrgRequest} request
155
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
144
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
156
145
  *
157
146
  * @throws {@link Payabli.BadRequestError}
158
147
  * @throws {@link Payabli.UnauthorizedError}
@@ -189,7 +178,8 @@ class Query {
189
178
  if (sortBy != null) {
190
179
  _queryParams.sortBy = sortBy;
191
180
  }
192
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
181
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
182
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
193
183
  const _response = yield core.fetcher({
194
184
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batchDetails/org/${core.url.encodePathParam(orgId)}`),
195
185
  method: "GET",
@@ -222,21 +212,7 @@ class Query {
222
212
  });
223
213
  }
224
214
  }
225
- switch (_response.error.reason) {
226
- case "non-json":
227
- throw new errors.PayabliError({
228
- statusCode: _response.error.statusCode,
229
- body: _response.error.rawBody,
230
- rawResponse: _response.rawResponse,
231
- });
232
- case "timeout":
233
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batchDetails/org/{orgId}.");
234
- case "unknown":
235
- throw new errors.PayabliError({
236
- message: _response.error.errorMessage,
237
- rawResponse: _response.rawResponse,
238
- });
239
- }
215
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batchDetails/org/{orgId}");
240
216
  });
241
217
  }
242
218
  /**
@@ -244,7 +220,7 @@ class Query {
244
220
  *
245
221
  * @param {Payabli.Entry} entry
246
222
  * @param {Payabli.ListBatchesRequest} request
247
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
223
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
248
224
  *
249
225
  * @throws {@link Payabli.BadRequestError}
250
226
  * @throws {@link Payabli.UnauthorizedError}
@@ -281,7 +257,8 @@ class Query {
281
257
  if (sortBy != null) {
282
258
  _queryParams.sortBy = sortBy;
283
259
  }
284
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
260
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
261
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
262
  const _response = yield core.fetcher({
286
263
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batches/${core.url.encodePathParam(entry)}`),
287
264
  method: "GET",
@@ -314,21 +291,7 @@ class Query {
314
291
  });
315
292
  }
316
293
  }
317
- switch (_response.error.reason) {
318
- case "non-json":
319
- throw new errors.PayabliError({
320
- statusCode: _response.error.statusCode,
321
- body: _response.error.rawBody,
322
- rawResponse: _response.rawResponse,
323
- });
324
- case "timeout":
325
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batches/{entry}.");
326
- case "unknown":
327
- throw new errors.PayabliError({
328
- message: _response.error.errorMessage,
329
- rawResponse: _response.rawResponse,
330
- });
331
- }
294
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batches/{entry}");
332
295
  });
333
296
  }
334
297
  /**
@@ -336,7 +299,7 @@ class Query {
336
299
  *
337
300
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
338
301
  * @param {Payabli.ListBatchesOrgRequest} request
339
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
302
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
340
303
  *
341
304
  * @throws {@link Payabli.BadRequestError}
342
305
  * @throws {@link Payabli.UnauthorizedError}
@@ -373,7 +336,8 @@ class Query {
373
336
  if (sortBy != null) {
374
337
  _queryParams.sortBy = sortBy;
375
338
  }
376
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
339
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
340
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
377
341
  const _response = yield core.fetcher({
378
342
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batches/org/${core.url.encodePathParam(orgId)}`),
379
343
  method: "GET",
@@ -406,21 +370,7 @@ class Query {
406
370
  });
407
371
  }
408
372
  }
409
- switch (_response.error.reason) {
410
- case "non-json":
411
- throw new errors.PayabliError({
412
- statusCode: _response.error.statusCode,
413
- body: _response.error.rawBody,
414
- rawResponse: _response.rawResponse,
415
- });
416
- case "timeout":
417
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batches/org/{orgId}.");
418
- case "unknown":
419
- throw new errors.PayabliError({
420
- message: _response.error.errorMessage,
421
- rawResponse: _response.rawResponse,
422
- });
423
- }
373
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batches/org/{orgId}");
424
374
  });
425
375
  }
426
376
  /**
@@ -428,7 +378,7 @@ class Query {
428
378
  *
429
379
  * @param {Payabli.Entry} entry
430
380
  * @param {Payabli.ListBatchesOutRequest} request
431
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
381
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
432
382
  *
433
383
  * @throws {@link Payabli.BadRequestError}
434
384
  * @throws {@link Payabli.UnauthorizedError}
@@ -465,7 +415,8 @@ class Query {
465
415
  if (sortBy != null) {
466
416
  _queryParams.sortBy = sortBy;
467
417
  }
468
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
418
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
419
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
469
420
  const _response = yield core.fetcher({
470
421
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batchesOut/${core.url.encodePathParam(entry)}`),
471
422
  method: "GET",
@@ -498,21 +449,7 @@ class Query {
498
449
  });
499
450
  }
500
451
  }
501
- switch (_response.error.reason) {
502
- case "non-json":
503
- throw new errors.PayabliError({
504
- statusCode: _response.error.statusCode,
505
- body: _response.error.rawBody,
506
- rawResponse: _response.rawResponse,
507
- });
508
- case "timeout":
509
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batchesOut/{entry}.");
510
- case "unknown":
511
- throw new errors.PayabliError({
512
- message: _response.error.errorMessage,
513
- rawResponse: _response.rawResponse,
514
- });
515
- }
452
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batchesOut/{entry}");
516
453
  });
517
454
  }
518
455
  /**
@@ -520,7 +457,7 @@ class Query {
520
457
  *
521
458
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
522
459
  * @param {Payabli.ListBatchesOutOrgRequest} request
523
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
460
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
524
461
  *
525
462
  * @throws {@link Payabli.BadRequestError}
526
463
  * @throws {@link Payabli.UnauthorizedError}
@@ -557,7 +494,8 @@ class Query {
557
494
  if (sortBy != null) {
558
495
  _queryParams.sortBy = sortBy;
559
496
  }
560
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
497
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
498
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
561
499
  const _response = yield core.fetcher({
562
500
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/batchesOut/org/${core.url.encodePathParam(orgId)}`),
563
501
  method: "GET",
@@ -590,21 +528,7 @@ class Query {
590
528
  });
591
529
  }
592
530
  }
593
- switch (_response.error.reason) {
594
- case "non-json":
595
- throw new errors.PayabliError({
596
- statusCode: _response.error.statusCode,
597
- body: _response.error.rawBody,
598
- rawResponse: _response.rawResponse,
599
- });
600
- case "timeout":
601
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/batchesOut/org/{orgId}.");
602
- case "unknown":
603
- throw new errors.PayabliError({
604
- message: _response.error.errorMessage,
605
- rawResponse: _response.rawResponse,
606
- });
607
- }
531
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/batchesOut/org/{orgId}");
608
532
  });
609
533
  }
610
534
  /**
@@ -612,7 +536,7 @@ class Query {
612
536
  *
613
537
  * @param {Payabli.Entry} entry
614
538
  * @param {Payabli.ListChargebacksRequest} request
615
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
539
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
616
540
  *
617
541
  * @throws {@link Payabli.BadRequestError}
618
542
  * @throws {@link Payabli.UnauthorizedError}
@@ -649,7 +573,8 @@ class Query {
649
573
  if (sortBy != null) {
650
574
  _queryParams.sortBy = sortBy;
651
575
  }
652
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
576
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
577
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
653
578
  const _response = yield core.fetcher({
654
579
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/chargebacks/${core.url.encodePathParam(entry)}`),
655
580
  method: "GET",
@@ -682,21 +607,7 @@ class Query {
682
607
  });
683
608
  }
684
609
  }
685
- switch (_response.error.reason) {
686
- case "non-json":
687
- throw new errors.PayabliError({
688
- statusCode: _response.error.statusCode,
689
- body: _response.error.rawBody,
690
- rawResponse: _response.rawResponse,
691
- });
692
- case "timeout":
693
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/chargebacks/{entry}.");
694
- case "unknown":
695
- throw new errors.PayabliError({
696
- message: _response.error.errorMessage,
697
- rawResponse: _response.rawResponse,
698
- });
699
- }
610
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/chargebacks/{entry}");
700
611
  });
701
612
  }
702
613
  /**
@@ -704,7 +615,7 @@ class Query {
704
615
  *
705
616
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
706
617
  * @param {Payabli.ListChargebacksOrgRequest} request
707
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
618
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
708
619
  *
709
620
  * @throws {@link Payabli.BadRequestError}
710
621
  * @throws {@link Payabli.UnauthorizedError}
@@ -741,7 +652,8 @@ class Query {
741
652
  if (sortBy != null) {
742
653
  _queryParams.sortBy = sortBy;
743
654
  }
744
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
655
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
656
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
745
657
  const _response = yield core.fetcher({
746
658
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/chargebacks/org/${core.url.encodePathParam(orgId)}`),
747
659
  method: "GET",
@@ -774,21 +686,7 @@ class Query {
774
686
  });
775
687
  }
776
688
  }
777
- switch (_response.error.reason) {
778
- case "non-json":
779
- throw new errors.PayabliError({
780
- statusCode: _response.error.statusCode,
781
- body: _response.error.rawBody,
782
- rawResponse: _response.rawResponse,
783
- });
784
- case "timeout":
785
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/chargebacks/org/{orgId}.");
786
- case "unknown":
787
- throw new errors.PayabliError({
788
- message: _response.error.errorMessage,
789
- rawResponse: _response.rawResponse,
790
- });
791
- }
689
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/chargebacks/org/{orgId}");
792
690
  });
793
691
  }
794
692
  /**
@@ -796,7 +694,7 @@ class Query {
796
694
  *
797
695
  * @param {Payabli.Entry} entry
798
696
  * @param {Payabli.ListCustomersRequest} request
799
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
697
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
800
698
  *
801
699
  * @throws {@link Payabli.BadRequestError}
802
700
  * @throws {@link Payabli.UnauthorizedError}
@@ -833,7 +731,8 @@ class Query {
833
731
  if (sortBy != null) {
834
732
  _queryParams.sortBy = sortBy;
835
733
  }
836
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
734
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
735
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
837
736
  const _response = yield core.fetcher({
838
737
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/customers/${core.url.encodePathParam(entry)}`),
839
738
  method: "GET",
@@ -866,21 +765,7 @@ class Query {
866
765
  });
867
766
  }
868
767
  }
869
- switch (_response.error.reason) {
870
- case "non-json":
871
- throw new errors.PayabliError({
872
- statusCode: _response.error.statusCode,
873
- body: _response.error.rawBody,
874
- rawResponse: _response.rawResponse,
875
- });
876
- case "timeout":
877
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/customers/{entry}.");
878
- case "unknown":
879
- throw new errors.PayabliError({
880
- message: _response.error.errorMessage,
881
- rawResponse: _response.rawResponse,
882
- });
883
- }
768
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/customers/{entry}");
884
769
  });
885
770
  }
886
771
  /**
@@ -888,7 +773,7 @@ class Query {
888
773
  *
889
774
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
890
775
  * @param {Payabli.ListCustomersOrgRequest} request
891
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
776
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
892
777
  *
893
778
  * @throws {@link Payabli.BadRequestError}
894
779
  * @throws {@link Payabli.UnauthorizedError}
@@ -925,7 +810,8 @@ class Query {
925
810
  if (sortBy != null) {
926
811
  _queryParams.sortBy = sortBy;
927
812
  }
928
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
813
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
814
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
929
815
  const _response = yield core.fetcher({
930
816
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/customers/org/${core.url.encodePathParam(orgId)}`),
931
817
  method: "GET",
@@ -958,21 +844,7 @@ class Query {
958
844
  });
959
845
  }
960
846
  }
961
- switch (_response.error.reason) {
962
- case "non-json":
963
- throw new errors.PayabliError({
964
- statusCode: _response.error.statusCode,
965
- body: _response.error.rawBody,
966
- rawResponse: _response.rawResponse,
967
- });
968
- case "timeout":
969
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/customers/org/{orgId}.");
970
- case "unknown":
971
- throw new errors.PayabliError({
972
- message: _response.error.errorMessage,
973
- rawResponse: _response.rawResponse,
974
- });
975
- }
847
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/customers/org/{orgId}");
976
848
  });
977
849
  }
978
850
  /**
@@ -980,7 +852,7 @@ class Query {
980
852
  *
981
853
  * @param {Payabli.Entry} entry
982
854
  * @param {Payabli.ListNotificationReportsRequest} request
983
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
855
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
984
856
  *
985
857
  * @throws {@link Payabli.BadRequestError}
986
858
  * @throws {@link Payabli.UnauthorizedError}
@@ -1014,7 +886,8 @@ class Query {
1014
886
  if (sortBy != null) {
1015
887
  _queryParams.sortBy = sortBy;
1016
888
  }
1017
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
889
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
890
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1018
891
  const _response = yield core.fetcher({
1019
892
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/notificationReports/${core.url.encodePathParam(entry)}`),
1020
893
  method: "GET",
@@ -1050,21 +923,7 @@ class Query {
1050
923
  });
1051
924
  }
1052
925
  }
1053
- switch (_response.error.reason) {
1054
- case "non-json":
1055
- throw new errors.PayabliError({
1056
- statusCode: _response.error.statusCode,
1057
- body: _response.error.rawBody,
1058
- rawResponse: _response.rawResponse,
1059
- });
1060
- case "timeout":
1061
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/notificationReports/{entry}.");
1062
- case "unknown":
1063
- throw new errors.PayabliError({
1064
- message: _response.error.errorMessage,
1065
- rawResponse: _response.rawResponse,
1066
- });
1067
- }
926
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/notificationReports/{entry}");
1068
927
  });
1069
928
  }
1070
929
  /**
@@ -1072,7 +931,7 @@ class Query {
1072
931
  *
1073
932
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1074
933
  * @param {Payabli.ListNotificationReportsOrgRequest} request
1075
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
934
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1076
935
  *
1077
936
  * @throws {@link Payabli.BadRequestError}
1078
937
  * @throws {@link Payabli.UnauthorizedError}
@@ -1106,7 +965,8 @@ class Query {
1106
965
  if (sortBy != null) {
1107
966
  _queryParams.sortBy = sortBy;
1108
967
  }
1109
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
968
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
969
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1110
970
  const _response = yield core.fetcher({
1111
971
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/notificationReports/org/${core.url.encodePathParam(orgId)}`),
1112
972
  method: "GET",
@@ -1142,21 +1002,7 @@ class Query {
1142
1002
  });
1143
1003
  }
1144
1004
  }
1145
- switch (_response.error.reason) {
1146
- case "non-json":
1147
- throw new errors.PayabliError({
1148
- statusCode: _response.error.statusCode,
1149
- body: _response.error.rawBody,
1150
- rawResponse: _response.rawResponse,
1151
- });
1152
- case "timeout":
1153
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/notificationReports/org/{orgId}.");
1154
- case "unknown":
1155
- throw new errors.PayabliError({
1156
- message: _response.error.errorMessage,
1157
- rawResponse: _response.rawResponse,
1158
- });
1159
- }
1005
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/notificationReports/org/{orgId}");
1160
1006
  });
1161
1007
  }
1162
1008
  /**
@@ -1164,7 +1010,7 @@ class Query {
1164
1010
  *
1165
1011
  * @param {Payabli.Entry} entry
1166
1012
  * @param {Payabli.ListNotificationsRequest} request
1167
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1013
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1168
1014
  *
1169
1015
  * @throws {@link Payabli.BadRequestError}
1170
1016
  * @throws {@link Payabli.UnauthorizedError}
@@ -1198,7 +1044,8 @@ class Query {
1198
1044
  if (sortBy != null) {
1199
1045
  _queryParams.sortBy = sortBy;
1200
1046
  }
1201
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1047
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1048
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1202
1049
  const _response = yield core.fetcher({
1203
1050
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/notifications/${core.url.encodePathParam(entry)}`),
1204
1051
  method: "GET",
@@ -1231,21 +1078,7 @@ class Query {
1231
1078
  });
1232
1079
  }
1233
1080
  }
1234
- switch (_response.error.reason) {
1235
- case "non-json":
1236
- throw new errors.PayabliError({
1237
- statusCode: _response.error.statusCode,
1238
- body: _response.error.rawBody,
1239
- rawResponse: _response.rawResponse,
1240
- });
1241
- case "timeout":
1242
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/notifications/{entry}.");
1243
- case "unknown":
1244
- throw new errors.PayabliError({
1245
- message: _response.error.errorMessage,
1246
- rawResponse: _response.rawResponse,
1247
- });
1248
- }
1081
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/notifications/{entry}");
1249
1082
  });
1250
1083
  }
1251
1084
  /**
@@ -1253,7 +1086,7 @@ class Query {
1253
1086
  *
1254
1087
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1255
1088
  * @param {Payabli.ListNotificationsOrgRequest} request
1256
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1089
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1257
1090
  *
1258
1091
  * @throws {@link Payabli.BadRequestError}
1259
1092
  * @throws {@link Payabli.UnauthorizedError}
@@ -1287,7 +1120,8 @@ class Query {
1287
1120
  if (sortBy != null) {
1288
1121
  _queryParams.sortBy = sortBy;
1289
1122
  }
1290
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1123
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1124
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1291
1125
  const _response = yield core.fetcher({
1292
1126
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/notifications/org/${core.url.encodePathParam(orgId)}`),
1293
1127
  method: "GET",
@@ -1320,21 +1154,7 @@ class Query {
1320
1154
  });
1321
1155
  }
1322
1156
  }
1323
- switch (_response.error.reason) {
1324
- case "non-json":
1325
- throw new errors.PayabliError({
1326
- statusCode: _response.error.statusCode,
1327
- body: _response.error.rawBody,
1328
- rawResponse: _response.rawResponse,
1329
- });
1330
- case "timeout":
1331
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/notifications/org/{orgId}.");
1332
- case "unknown":
1333
- throw new errors.PayabliError({
1334
- message: _response.error.errorMessage,
1335
- rawResponse: _response.rawResponse,
1336
- });
1337
- }
1157
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/notifications/org/{orgId}");
1338
1158
  });
1339
1159
  }
1340
1160
  /**
@@ -1342,7 +1162,7 @@ class Query {
1342
1162
  *
1343
1163
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1344
1164
  * @param {Payabli.ListOrganizationsRequest} request
1345
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1165
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1346
1166
  *
1347
1167
  * @throws {@link Payabli.BadRequestError}
1348
1168
  * @throws {@link Payabli.UnauthorizedError}
@@ -1379,7 +1199,8 @@ class Query {
1379
1199
  if (sortBy != null) {
1380
1200
  _queryParams.sortBy = sortBy;
1381
1201
  }
1382
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1202
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1203
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1383
1204
  const _response = yield core.fetcher({
1384
1205
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/organizations/${core.url.encodePathParam(orgId)}`),
1385
1206
  method: "GET",
@@ -1412,21 +1233,7 @@ class Query {
1412
1233
  });
1413
1234
  }
1414
1235
  }
1415
- switch (_response.error.reason) {
1416
- case "non-json":
1417
- throw new errors.PayabliError({
1418
- statusCode: _response.error.statusCode,
1419
- body: _response.error.rawBody,
1420
- rawResponse: _response.rawResponse,
1421
- });
1422
- case "timeout":
1423
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/organizations/{orgId}.");
1424
- case "unknown":
1425
- throw new errors.PayabliError({
1426
- message: _response.error.errorMessage,
1427
- rawResponse: _response.rawResponse,
1428
- });
1429
- }
1236
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/organizations/{orgId}");
1430
1237
  });
1431
1238
  }
1432
1239
  /**
@@ -1434,7 +1241,7 @@ class Query {
1434
1241
  *
1435
1242
  * @param {Payabli.Entry} entry
1436
1243
  * @param {Payabli.ListPayoutRequest} request
1437
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1244
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1438
1245
  *
1439
1246
  * @throws {@link Payabli.BadRequestError}
1440
1247
  * @throws {@link Payabli.UnauthorizedError}
@@ -1471,7 +1278,8 @@ class Query {
1471
1278
  if (sortBy != null) {
1472
1279
  _queryParams.sortBy = sortBy;
1473
1280
  }
1474
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1281
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1282
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1475
1283
  const _response = yield core.fetcher({
1476
1284
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/payouts/${core.url.encodePathParam(entry)}`),
1477
1285
  method: "GET",
@@ -1504,21 +1312,7 @@ class Query {
1504
1312
  });
1505
1313
  }
1506
1314
  }
1507
- switch (_response.error.reason) {
1508
- case "non-json":
1509
- throw new errors.PayabliError({
1510
- statusCode: _response.error.statusCode,
1511
- body: _response.error.rawBody,
1512
- rawResponse: _response.rawResponse,
1513
- });
1514
- case "timeout":
1515
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/payouts/{entry}.");
1516
- case "unknown":
1517
- throw new errors.PayabliError({
1518
- message: _response.error.errorMessage,
1519
- rawResponse: _response.rawResponse,
1520
- });
1521
- }
1315
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/payouts/{entry}");
1522
1316
  });
1523
1317
  }
1524
1318
  /**
@@ -1526,7 +1320,7 @@ class Query {
1526
1320
  *
1527
1321
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1528
1322
  * @param {Payabli.ListPayoutOrgRequest} request
1529
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1323
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1530
1324
  *
1531
1325
  * @throws {@link Payabli.BadRequestError}
1532
1326
  * @throws {@link Payabli.UnauthorizedError}
@@ -1563,7 +1357,8 @@ class Query {
1563
1357
  if (sortBy != null) {
1564
1358
  _queryParams.sortBy = sortBy;
1565
1359
  }
1566
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1360
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1361
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1567
1362
  const _response = yield core.fetcher({
1568
1363
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/payouts/org/${core.url.encodePathParam(orgId)}`),
1569
1364
  method: "GET",
@@ -1596,21 +1391,7 @@ class Query {
1596
1391
  });
1597
1392
  }
1598
1393
  }
1599
- switch (_response.error.reason) {
1600
- case "non-json":
1601
- throw new errors.PayabliError({
1602
- statusCode: _response.error.statusCode,
1603
- body: _response.error.rawBody,
1604
- rawResponse: _response.rawResponse,
1605
- });
1606
- case "timeout":
1607
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/payouts/org/{orgId}.");
1608
- case "unknown":
1609
- throw new errors.PayabliError({
1610
- message: _response.error.errorMessage,
1611
- rawResponse: _response.rawResponse,
1612
- });
1613
- }
1394
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/payouts/org/{orgId}");
1614
1395
  });
1615
1396
  }
1616
1397
  /**
@@ -1618,7 +1399,7 @@ class Query {
1618
1399
  *
1619
1400
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1620
1401
  * @param {Payabli.ListPaypointsRequest} request
1621
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1402
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1622
1403
  *
1623
1404
  * @throws {@link Payabli.BadRequestError}
1624
1405
  * @throws {@link Payabli.UnauthorizedError}
@@ -1655,7 +1436,8 @@ class Query {
1655
1436
  if (sortBy != null) {
1656
1437
  _queryParams.sortBy = sortBy;
1657
1438
  }
1658
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1439
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1440
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1659
1441
  const _response = yield core.fetcher({
1660
1442
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/paypoints/${core.url.encodePathParam(orgId)}`),
1661
1443
  method: "GET",
@@ -1688,21 +1470,7 @@ class Query {
1688
1470
  });
1689
1471
  }
1690
1472
  }
1691
- switch (_response.error.reason) {
1692
- case "non-json":
1693
- throw new errors.PayabliError({
1694
- statusCode: _response.error.statusCode,
1695
- body: _response.error.rawBody,
1696
- rawResponse: _response.rawResponse,
1697
- });
1698
- case "timeout":
1699
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/paypoints/{orgId}.");
1700
- case "unknown":
1701
- throw new errors.PayabliError({
1702
- message: _response.error.errorMessage,
1703
- rawResponse: _response.rawResponse,
1704
- });
1705
- }
1473
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/paypoints/{orgId}");
1706
1474
  });
1707
1475
  }
1708
1476
  /**
@@ -1710,7 +1478,7 @@ class Query {
1710
1478
  *
1711
1479
  * @param {Payabli.Entry} entry
1712
1480
  * @param {Payabli.ListSettlementsRequest} request
1713
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1481
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1714
1482
  *
1715
1483
  * @throws {@link Payabli.BadRequestError}
1716
1484
  * @throws {@link Payabli.UnauthorizedError}
@@ -1747,7 +1515,8 @@ class Query {
1747
1515
  if (sortBy != null) {
1748
1516
  _queryParams.sortBy = sortBy;
1749
1517
  }
1750
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1518
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1519
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1751
1520
  const _response = yield core.fetcher({
1752
1521
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/settlements/${core.url.encodePathParam(entry)}`),
1753
1522
  method: "GET",
@@ -1780,21 +1549,7 @@ class Query {
1780
1549
  });
1781
1550
  }
1782
1551
  }
1783
- switch (_response.error.reason) {
1784
- case "non-json":
1785
- throw new errors.PayabliError({
1786
- statusCode: _response.error.statusCode,
1787
- body: _response.error.rawBody,
1788
- rawResponse: _response.rawResponse,
1789
- });
1790
- case "timeout":
1791
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/settlements/{entry}.");
1792
- case "unknown":
1793
- throw new errors.PayabliError({
1794
- message: _response.error.errorMessage,
1795
- rawResponse: _response.rawResponse,
1796
- });
1797
- }
1552
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/settlements/{entry}");
1798
1553
  });
1799
1554
  }
1800
1555
  /**
@@ -1802,7 +1557,7 @@ class Query {
1802
1557
  *
1803
1558
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1804
1559
  * @param {Payabli.ListSettlementsOrgRequest} request
1805
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1560
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1806
1561
  *
1807
1562
  * @throws {@link Payabli.BadRequestError}
1808
1563
  * @throws {@link Payabli.UnauthorizedError}
@@ -1839,7 +1594,8 @@ class Query {
1839
1594
  if (sortBy != null) {
1840
1595
  _queryParams.sortBy = sortBy;
1841
1596
  }
1842
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1597
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1598
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1843
1599
  const _response = yield core.fetcher({
1844
1600
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/settlements/org/${core.url.encodePathParam(orgId)}`),
1845
1601
  method: "GET",
@@ -1872,21 +1628,7 @@ class Query {
1872
1628
  });
1873
1629
  }
1874
1630
  }
1875
- switch (_response.error.reason) {
1876
- case "non-json":
1877
- throw new errors.PayabliError({
1878
- statusCode: _response.error.statusCode,
1879
- body: _response.error.rawBody,
1880
- rawResponse: _response.rawResponse,
1881
- });
1882
- case "timeout":
1883
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/settlements/org/{orgId}.");
1884
- case "unknown":
1885
- throw new errors.PayabliError({
1886
- message: _response.error.errorMessage,
1887
- rawResponse: _response.rawResponse,
1888
- });
1889
- }
1631
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/settlements/org/{orgId}");
1890
1632
  });
1891
1633
  }
1892
1634
  /**
@@ -1894,7 +1636,7 @@ class Query {
1894
1636
  *
1895
1637
  * @param {Payabli.Entry} entry
1896
1638
  * @param {Payabli.ListSubscriptionsRequest} request
1897
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1639
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1898
1640
  *
1899
1641
  * @throws {@link Payabli.BadRequestError}
1900
1642
  * @throws {@link Payabli.UnauthorizedError}
@@ -1931,7 +1673,8 @@ class Query {
1931
1673
  if (sortBy != null) {
1932
1674
  _queryParams.sortBy = sortBy;
1933
1675
  }
1934
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1676
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1677
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1935
1678
  const _response = yield core.fetcher({
1936
1679
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/subscriptions/${core.url.encodePathParam(entry)}`),
1937
1680
  method: "GET",
@@ -1964,21 +1707,7 @@ class Query {
1964
1707
  });
1965
1708
  }
1966
1709
  }
1967
- switch (_response.error.reason) {
1968
- case "non-json":
1969
- throw new errors.PayabliError({
1970
- statusCode: _response.error.statusCode,
1971
- body: _response.error.rawBody,
1972
- rawResponse: _response.rawResponse,
1973
- });
1974
- case "timeout":
1975
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/subscriptions/{entry}.");
1976
- case "unknown":
1977
- throw new errors.PayabliError({
1978
- message: _response.error.errorMessage,
1979
- rawResponse: _response.rawResponse,
1980
- });
1981
- }
1710
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/subscriptions/{entry}");
1982
1711
  });
1983
1712
  }
1984
1713
  /**
@@ -1986,7 +1715,7 @@ class Query {
1986
1715
  *
1987
1716
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
1988
1717
  * @param {Payabli.ListSubscriptionsOrgRequest} request
1989
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1718
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
1990
1719
  *
1991
1720
  * @throws {@link Payabli.BadRequestError}
1992
1721
  * @throws {@link Payabli.UnauthorizedError}
@@ -2023,7 +1752,8 @@ class Query {
2023
1752
  if (sortBy != null) {
2024
1753
  _queryParams.sortBy = sortBy;
2025
1754
  }
2026
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1755
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1756
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2027
1757
  const _response = yield core.fetcher({
2028
1758
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/subscriptions/org/${core.url.encodePathParam(orgId)}`),
2029
1759
  method: "GET",
@@ -2056,21 +1786,7 @@ class Query {
2056
1786
  });
2057
1787
  }
2058
1788
  }
2059
- switch (_response.error.reason) {
2060
- case "non-json":
2061
- throw new errors.PayabliError({
2062
- statusCode: _response.error.statusCode,
2063
- body: _response.error.rawBody,
2064
- rawResponse: _response.rawResponse,
2065
- });
2066
- case "timeout":
2067
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/subscriptions/org/{orgId}.");
2068
- case "unknown":
2069
- throw new errors.PayabliError({
2070
- message: _response.error.errorMessage,
2071
- rawResponse: _response.rawResponse,
2072
- });
2073
- }
1789
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/subscriptions/org/{orgId}");
2074
1790
  });
2075
1791
  }
2076
1792
  /**
@@ -2085,7 +1801,7 @@ class Query {
2085
1801
  *
2086
1802
  * @param {Payabli.Entry} entry
2087
1803
  * @param {Payabli.ListTransactionsRequest} request
2088
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1804
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2089
1805
  *
2090
1806
  * @throws {@link Payabli.BadRequestError}
2091
1807
  * @throws {@link Payabli.UnauthorizedError}
@@ -2122,7 +1838,8 @@ class Query {
2122
1838
  if (sortBy != null) {
2123
1839
  _queryParams.sortBy = sortBy;
2124
1840
  }
2125
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1841
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1842
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2126
1843
  const _response = yield core.fetcher({
2127
1844
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/transactions/${core.url.encodePathParam(entry)}`),
2128
1845
  method: "GET",
@@ -2155,21 +1872,7 @@ class Query {
2155
1872
  });
2156
1873
  }
2157
1874
  }
2158
- switch (_response.error.reason) {
2159
- case "non-json":
2160
- throw new errors.PayabliError({
2161
- statusCode: _response.error.statusCode,
2162
- body: _response.error.rawBody,
2163
- rawResponse: _response.rawResponse,
2164
- });
2165
- case "timeout":
2166
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/transactions/{entry}.");
2167
- case "unknown":
2168
- throw new errors.PayabliError({
2169
- message: _response.error.errorMessage,
2170
- rawResponse: _response.rawResponse,
2171
- });
2172
- }
1875
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/transactions/{entry}");
2173
1876
  });
2174
1877
  }
2175
1878
  /**
@@ -2191,7 +1894,7 @@ class Query {
2191
1894
  *
2192
1895
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2193
1896
  * @param {Payabli.ListTransactionsOrgRequest} request
2194
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1897
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2195
1898
  *
2196
1899
  * @throws {@link Payabli.BadRequestError}
2197
1900
  * @throws {@link Payabli.UnauthorizedError}
@@ -2228,7 +1931,8 @@ class Query {
2228
1931
  if (sortBy != null) {
2229
1932
  _queryParams.sortBy = sortBy;
2230
1933
  }
2231
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1934
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1935
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2232
1936
  const _response = yield core.fetcher({
2233
1937
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/transactions/org/${core.url.encodePathParam(orgId)}`),
2234
1938
  method: "GET",
@@ -2261,21 +1965,7 @@ class Query {
2261
1965
  });
2262
1966
  }
2263
1967
  }
2264
- switch (_response.error.reason) {
2265
- case "non-json":
2266
- throw new errors.PayabliError({
2267
- statusCode: _response.error.statusCode,
2268
- body: _response.error.rawBody,
2269
- rawResponse: _response.rawResponse,
2270
- });
2271
- case "timeout":
2272
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/transactions/org/{orgId}.");
2273
- case "unknown":
2274
- throw new errors.PayabliError({
2275
- message: _response.error.errorMessage,
2276
- rawResponse: _response.rawResponse,
2277
- });
2278
- }
1968
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/transactions/org/{orgId}");
2279
1969
  });
2280
1970
  }
2281
1971
  /**
@@ -2284,7 +1974,7 @@ class Query {
2284
1974
  * @param {Payabli.Entry} entry
2285
1975
  * @param {number} transferId - The numeric identifier for the transfer, assigned by Payabli.
2286
1976
  * @param {Payabli.ListTransfersPaypointRequest} request
2287
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
1977
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2288
1978
  *
2289
1979
  * @throws {@link Payabli.BadRequestError}
2290
1980
  * @throws {@link Payabli.UnauthorizedError}
@@ -2317,7 +2007,8 @@ class Query {
2317
2007
  if (sortBy != null) {
2318
2008
  _queryParams.sortBy = sortBy;
2319
2009
  }
2320
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2010
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2011
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2321
2012
  const _response = yield core.fetcher({
2322
2013
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/transferDetails/${core.url.encodePathParam(entry)}/${core.url.encodePathParam(transferId)}`),
2323
2014
  method: "GET",
@@ -2350,21 +2041,7 @@ class Query {
2350
2041
  });
2351
2042
  }
2352
2043
  }
2353
- switch (_response.error.reason) {
2354
- case "non-json":
2355
- throw new errors.PayabliError({
2356
- statusCode: _response.error.statusCode,
2357
- body: _response.error.rawBody,
2358
- rawResponse: _response.rawResponse,
2359
- });
2360
- case "timeout":
2361
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/transferDetails/{entry}/{transferId}.");
2362
- case "unknown":
2363
- throw new errors.PayabliError({
2364
- message: _response.error.errorMessage,
2365
- rawResponse: _response.rawResponse,
2366
- });
2367
- }
2044
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/transferDetails/{entry}/{transferId}");
2368
2045
  });
2369
2046
  }
2370
2047
  /**
@@ -2372,7 +2049,7 @@ class Query {
2372
2049
  *
2373
2050
  * @param {Payabli.Entry} entry
2374
2051
  * @param {Payabli.ListTransfersRequest} request
2375
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2052
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2376
2053
  *
2377
2054
  * @throws {@link Payabli.BadRequestError}
2378
2055
  * @throws {@link Payabli.UnauthorizedError}
@@ -2408,7 +2085,7 @@ class Query {
2408
2085
  if (sortBy != null) {
2409
2086
  _queryParams.sortBy = sortBy;
2410
2087
  }
2411
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2088
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2412
2089
  const _response = yield core.fetcher({
2413
2090
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/transfers/${core.url.encodePathParam(entry)}`),
2414
2091
  method: "GET",
@@ -2441,28 +2118,14 @@ class Query {
2441
2118
  });
2442
2119
  }
2443
2120
  }
2444
- switch (_response.error.reason) {
2445
- case "non-json":
2446
- throw new errors.PayabliError({
2447
- statusCode: _response.error.statusCode,
2448
- body: _response.error.rawBody,
2449
- rawResponse: _response.rawResponse,
2450
- });
2451
- case "timeout":
2452
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/transfers/{entry}.");
2453
- case "unknown":
2454
- throw new errors.PayabliError({
2455
- message: _response.error.errorMessage,
2456
- rawResponse: _response.rawResponse,
2457
- });
2458
- }
2121
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/transfers/{entry}");
2459
2122
  });
2460
2123
  }
2461
2124
  /**
2462
2125
  * Retrieve a list of transfers for an org. Use filters to limit results. Include the `exportFormat` query parameter to return the results as a file instead of a JSON response.
2463
2126
  *
2464
2127
  * @param {Payabli.ListTransfersRequestOrg} request
2465
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2128
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2466
2129
  *
2467
2130
  * @throws {@link Payabli.BadRequestError}
2468
2131
  * @throws {@link Payabli.UnauthorizedError}
@@ -2499,7 +2162,7 @@ class Query {
2499
2162
  if (sortBy != null) {
2500
2163
  _queryParams.sortBy = sortBy;
2501
2164
  }
2502
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2165
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2503
2166
  const _response = yield core.fetcher({
2504
2167
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/transfers/org/${core.url.encodePathParam(orgId)}`),
2505
2168
  method: "GET",
@@ -2532,21 +2195,7 @@ class Query {
2532
2195
  });
2533
2196
  }
2534
2197
  }
2535
- switch (_response.error.reason) {
2536
- case "non-json":
2537
- throw new errors.PayabliError({
2538
- statusCode: _response.error.statusCode,
2539
- body: _response.error.rawBody,
2540
- rawResponse: _response.rawResponse,
2541
- });
2542
- case "timeout":
2543
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/transfers/org/{orgId}.");
2544
- case "unknown":
2545
- throw new errors.PayabliError({
2546
- message: _response.error.errorMessage,
2547
- rawResponse: _response.rawResponse,
2548
- });
2549
- }
2198
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/transfers/org/{orgId}");
2550
2199
  });
2551
2200
  }
2552
2201
  /**
@@ -2554,7 +2203,7 @@ class Query {
2554
2203
  *
2555
2204
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2556
2205
  * @param {Payabli.ListUsersOrgRequest} request
2557
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2206
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2558
2207
  *
2559
2208
  * @throws {@link Payabli.BadRequestError}
2560
2209
  * @throws {@link Payabli.UnauthorizedError}
@@ -2588,7 +2237,8 @@ class Query {
2588
2237
  if (sortBy != null) {
2589
2238
  _queryParams.sortBy = sortBy;
2590
2239
  }
2591
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2240
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2241
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2592
2242
  const _response = yield core.fetcher({
2593
2243
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/users/org/${core.url.encodePathParam(orgId)}`),
2594
2244
  method: "GET",
@@ -2621,21 +2271,7 @@ class Query {
2621
2271
  });
2622
2272
  }
2623
2273
  }
2624
- switch (_response.error.reason) {
2625
- case "non-json":
2626
- throw new errors.PayabliError({
2627
- statusCode: _response.error.statusCode,
2628
- body: _response.error.rawBody,
2629
- rawResponse: _response.rawResponse,
2630
- });
2631
- case "timeout":
2632
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/users/org/{orgId}.");
2633
- case "unknown":
2634
- throw new errors.PayabliError({
2635
- message: _response.error.errorMessage,
2636
- rawResponse: _response.rawResponse,
2637
- });
2638
- }
2274
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/users/org/{orgId}");
2639
2275
  });
2640
2276
  }
2641
2277
  /**
@@ -2643,7 +2279,7 @@ class Query {
2643
2279
  *
2644
2280
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2645
2281
  * @param {Payabli.ListUsersPaypointRequest} request
2646
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2282
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2647
2283
  *
2648
2284
  * @throws {@link Payabli.BadRequestError}
2649
2285
  * @throws {@link Payabli.UnauthorizedError}
@@ -2677,7 +2313,8 @@ class Query {
2677
2313
  if (sortBy != null) {
2678
2314
  _queryParams.sortBy = sortBy;
2679
2315
  }
2680
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2316
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2317
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2681
2318
  const _response = yield core.fetcher({
2682
2319
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/users/point/${core.url.encodePathParam(entry)}`),
2683
2320
  method: "GET",
@@ -2710,21 +2347,7 @@ class Query {
2710
2347
  });
2711
2348
  }
2712
2349
  }
2713
- switch (_response.error.reason) {
2714
- case "non-json":
2715
- throw new errors.PayabliError({
2716
- statusCode: _response.error.statusCode,
2717
- body: _response.error.rawBody,
2718
- rawResponse: _response.rawResponse,
2719
- });
2720
- case "timeout":
2721
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/users/point/{entry}.");
2722
- case "unknown":
2723
- throw new errors.PayabliError({
2724
- message: _response.error.errorMessage,
2725
- rawResponse: _response.rawResponse,
2726
- });
2727
- }
2350
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/users/point/{entry}");
2728
2351
  });
2729
2352
  }
2730
2353
  /**
@@ -2732,7 +2355,7 @@ class Query {
2732
2355
  *
2733
2356
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
2734
2357
  * @param {Payabli.ListVendorsRequest} request
2735
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2358
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2736
2359
  *
2737
2360
  * @throws {@link Payabli.BadRequestError}
2738
2361
  * @throws {@link Payabli.UnauthorizedError}
@@ -2769,7 +2392,8 @@ class Query {
2769
2392
  if (sortBy != null) {
2770
2393
  _queryParams.sortBy = sortBy;
2771
2394
  }
2772
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2395
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2396
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2773
2397
  const _response = yield core.fetcher({
2774
2398
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/vendors/${core.url.encodePathParam(entry)}`),
2775
2399
  method: "GET",
@@ -2802,21 +2426,7 @@ class Query {
2802
2426
  });
2803
2427
  }
2804
2428
  }
2805
- switch (_response.error.reason) {
2806
- case "non-json":
2807
- throw new errors.PayabliError({
2808
- statusCode: _response.error.statusCode,
2809
- body: _response.error.rawBody,
2810
- rawResponse: _response.rawResponse,
2811
- });
2812
- case "timeout":
2813
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/vendors/{entry}.");
2814
- case "unknown":
2815
- throw new errors.PayabliError({
2816
- message: _response.error.errorMessage,
2817
- rawResponse: _response.rawResponse,
2818
- });
2819
- }
2429
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/vendors/{entry}");
2820
2430
  });
2821
2431
  }
2822
2432
  /**
@@ -2824,7 +2434,7 @@ class Query {
2824
2434
  *
2825
2435
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
2826
2436
  * @param {Payabli.ListVendorsOrgRequest} request
2827
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2437
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2828
2438
  *
2829
2439
  * @throws {@link Payabli.BadRequestError}
2830
2440
  * @throws {@link Payabli.UnauthorizedError}
@@ -2861,7 +2471,8 @@ class Query {
2861
2471
  if (sortBy != null) {
2862
2472
  _queryParams.sortBy = sortBy;
2863
2473
  }
2864
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2474
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2475
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2865
2476
  const _response = yield core.fetcher({
2866
2477
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/vendors/org/${core.url.encodePathParam(orgId)}`),
2867
2478
  method: "GET",
@@ -2894,21 +2505,7 @@ class Query {
2894
2505
  });
2895
2506
  }
2896
2507
  }
2897
- switch (_response.error.reason) {
2898
- case "non-json":
2899
- throw new errors.PayabliError({
2900
- statusCode: _response.error.statusCode,
2901
- body: _response.error.rawBody,
2902
- rawResponse: _response.rawResponse,
2903
- });
2904
- case "timeout":
2905
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/vendors/org/{orgId}.");
2906
- case "unknown":
2907
- throw new errors.PayabliError({
2908
- message: _response.error.errorMessage,
2909
- rawResponse: _response.rawResponse,
2910
- });
2911
- }
2508
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/vendors/org/{orgId}");
2912
2509
  });
2913
2510
  }
2914
2511
  /**
@@ -2916,7 +2513,7 @@ class Query {
2916
2513
  *
2917
2514
  * @param {Payabli.Entry} entry
2918
2515
  * @param {Payabli.ListVcardsRequest} request
2919
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2516
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
2920
2517
  *
2921
2518
  * @throws {@link Payabli.BadRequestError}
2922
2519
  * @throws {@link Payabli.UnauthorizedError}
@@ -2953,7 +2550,8 @@ class Query {
2953
2550
  if (sortBy != null) {
2954
2551
  _queryParams.sortBy = sortBy;
2955
2552
  }
2956
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2553
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2554
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2957
2555
  const _response = yield core.fetcher({
2958
2556
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/vcards/${core.url.encodePathParam(entry)}`),
2959
2557
  method: "GET",
@@ -2986,21 +2584,7 @@ class Query {
2986
2584
  });
2987
2585
  }
2988
2586
  }
2989
- switch (_response.error.reason) {
2990
- case "non-json":
2991
- throw new errors.PayabliError({
2992
- statusCode: _response.error.statusCode,
2993
- body: _response.error.rawBody,
2994
- rawResponse: _response.rawResponse,
2995
- });
2996
- case "timeout":
2997
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/vcards/{entry}.");
2998
- case "unknown":
2999
- throw new errors.PayabliError({
3000
- message: _response.error.errorMessage,
3001
- rawResponse: _response.rawResponse,
3002
- });
3003
- }
2587
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/vcards/{entry}");
3004
2588
  });
3005
2589
  }
3006
2590
  /**
@@ -3008,7 +2592,7 @@ class Query {
3008
2592
  *
3009
2593
  * @param {number} orgId - The numeric identifier for organization, assigned by Payabli.
3010
2594
  * @param {Payabli.ListVcardsOrgRequest} request
3011
- * @param {Query.RequestOptions} requestOptions - Request-specific configuration.
2595
+ * @param {QueryClient.RequestOptions} requestOptions - Request-specific configuration.
3012
2596
  *
3013
2597
  * @throws {@link Payabli.BadRequestError}
3014
2598
  * @throws {@link Payabli.UnauthorizedError}
@@ -3045,7 +2629,8 @@ class Query {
3045
2629
  if (sortBy != null) {
3046
2630
  _queryParams.sortBy = sortBy;
3047
2631
  }
3048
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2632
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
2633
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3049
2634
  const _response = yield core.fetcher({
3050
2635
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PayabliEnvironment.Sandbox, `Query/vcards/org/${core.url.encodePathParam(orgId)}`),
3051
2636
  method: "GET",
@@ -3078,28 +2663,8 @@ class Query {
3078
2663
  });
3079
2664
  }
3080
2665
  }
3081
- switch (_response.error.reason) {
3082
- case "non-json":
3083
- throw new errors.PayabliError({
3084
- statusCode: _response.error.statusCode,
3085
- body: _response.error.rawBody,
3086
- rawResponse: _response.rawResponse,
3087
- });
3088
- case "timeout":
3089
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /Query/vcards/org/{orgId}.");
3090
- case "unknown":
3091
- throw new errors.PayabliError({
3092
- message: _response.error.errorMessage,
3093
- rawResponse: _response.rawResponse,
3094
- });
3095
- }
3096
- });
3097
- }
3098
- _getCustomAuthorizationHeaders() {
3099
- return __awaiter(this, void 0, void 0, function* () {
3100
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
3101
- return { requestToken: apiKeyValue };
2666
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/Query/vcards/org/{orgId}");
3102
2667
  });
3103
2668
  }
3104
2669
  }
3105
- exports.Query = Query;
2670
+ exports.QueryClient = QueryClient;