@payabli/sdk-node 0.0.116 → 0.0.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +24 -7
  2. package/dist/cjs/BaseClient.d.ts +10 -1
  3. package/dist/cjs/BaseClient.js +57 -0
  4. package/dist/cjs/Client.d.ts +87 -86
  5. package/dist/cjs/Client.js +31 -72
  6. package/dist/cjs/api/resources/bill/client/Client.d.ts +33 -33
  7. package/dist/cjs/api/resources/bill/client/Client.js +69 -216
  8. package/dist/cjs/api/resources/boarding/client/Client.d.ts +27 -27
  9. package/dist/cjs/api/resources/boarding/client/Client.js +51 -198
  10. package/dist/cjs/api/resources/chargeBacks/client/Client.d.ts +17 -15
  11. package/dist/cjs/api/resources/chargeBacks/client/Client.js +38 -79
  12. package/dist/cjs/api/resources/checkCapture/client/Client.d.ts +7 -7
  13. package/dist/cjs/api/resources/checkCapture/client/Client.js +11 -28
  14. package/dist/cjs/api/resources/cloud/client/Client.d.ts +17 -17
  15. package/dist/cjs/api/resources/cloud/client/Client.js +33 -89
  16. package/dist/cjs/api/resources/customer/client/Client.d.ts +17 -17
  17. package/dist/cjs/api/resources/customer/client/Client.js +31 -113
  18. package/dist/cjs/api/resources/export/client/Client.d.ts +93 -89
  19. package/dist/cjs/api/resources/export/client/Client.js +205 -582
  20. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.d.ts +11 -11
  21. package/dist/cjs/api/resources/hostedPaymentPages/client/Client.js +19 -62
  22. package/dist/cjs/api/resources/import/client/Client.d.ts +11 -11
  23. package/dist/cjs/api/resources/import/client/Client.js +19 -62
  24. package/dist/cjs/api/resources/invoice/client/Client.d.ts +31 -31
  25. package/dist/cjs/api/resources/invoice/client/Client.js +62 -209
  26. package/dist/cjs/api/resources/lineItem/client/Client.d.ts +15 -15
  27. package/dist/cjs/api/resources/lineItem/client/Client.js +27 -96
  28. package/dist/cjs/api/resources/moneyIn/client/Client.d.ts +39 -39
  29. package/dist/cjs/api/resources/moneyIn/client/Client.js +79 -249
  30. package/dist/cjs/api/resources/moneyOut/client/Client.d.ts +43 -26
  31. package/dist/cjs/api/resources/moneyOut/client/Client.js +105 -168
  32. package/dist/cjs/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.ts +2 -1
  33. package/dist/cjs/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.ts +3 -1
  34. package/dist/cjs/api/resources/notification/client/Client.d.ts +16 -16
  35. package/dist/cjs/api/resources/notification/client/Client.js +32 -101
  36. package/dist/cjs/api/resources/notificationlogs/client/Client.d.ts +13 -13
  37. package/dist/cjs/api/resources/notificationlogs/client/Client.js +23 -79
  38. package/dist/cjs/api/resources/ocr/client/Client.d.ts +13 -9
  39. package/dist/cjs/api/resources/ocr/client/Client.js +19 -45
  40. package/dist/cjs/api/resources/organization/client/Client.d.ts +19 -19
  41. package/dist/cjs/api/resources/organization/client/Client.js +35 -130
  42. package/dist/cjs/api/resources/paymentLink/client/Client.d.ts +23 -23
  43. package/dist/cjs/api/resources/paymentLink/client/Client.js +43 -164
  44. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.d.ts +19 -19
  45. package/dist/cjs/api/resources/paymentMethodDomain/client/Client.js +35 -130
  46. package/dist/cjs/api/resources/paypoint/client/Client.d.ts +22 -22
  47. package/dist/cjs/api/resources/paypoint/client/Client.js +44 -152
  48. package/dist/cjs/api/resources/query/client/Client.d.ts +71 -71
  49. package/dist/cjs/api/resources/query/client/Client.js +137 -572
  50. package/dist/cjs/api/resources/query/client/requests/ListPayoutOrgRequest.d.ts +1 -0
  51. package/dist/cjs/api/resources/query/client/requests/ListPayoutRequest.d.ts +1 -0
  52. package/dist/cjs/api/resources/query/client/requests/ListTransactionsRequest.d.ts +1 -0
  53. package/dist/cjs/api/resources/statistic/client/Client.d.ts +50 -50
  54. package/dist/cjs/api/resources/statistic/client/Client.js +80 -133
  55. package/dist/cjs/api/resources/statistic/client/requests/BasicStatsRequest.d.ts +2 -2
  56. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.ts +76 -0
  57. package/dist/cjs/api/resources/statistic/types/StatBasicExtendedQueryRecord.js +3 -0
  58. package/dist/cjs/api/resources/statistic/types/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/statistic/types/index.js +1 -0
  60. package/dist/cjs/api/resources/subscription/client/Client.d.ts +13 -13
  61. package/dist/cjs/api/resources/subscription/client/Client.js +23 -79
  62. package/dist/cjs/api/resources/templates/client/Client.d.ts +15 -15
  63. package/dist/cjs/api/resources/templates/client/Client.js +28 -84
  64. package/dist/cjs/api/resources/tokenStorage/client/Client.d.ts +13 -13
  65. package/dist/cjs/api/resources/tokenStorage/client/Client.js +23 -79
  66. package/dist/cjs/api/resources/user/client/Client.d.ts +54 -32
  67. package/dist/cjs/api/resources/user/client/Client.js +84 -222
  68. package/dist/cjs/api/resources/vendor/client/Client.d.ts +13 -13
  69. package/dist/cjs/api/resources/vendor/client/Client.js +23 -79
  70. package/dist/cjs/api/resources/wallet/client/Client.d.ts +13 -13
  71. package/dist/cjs/api/resources/wallet/client/Client.js +23 -79
  72. package/dist/cjs/api/types/ApplicationDetailsRecord.d.ts +2 -2
  73. package/dist/cjs/api/types/NotificationContent.d.ts +1 -0
  74. package/dist/cjs/api/types/NotificationContent.js +1 -0
  75. package/dist/cjs/api/types/NotificationStandardRequest.d.ts +1 -0
  76. package/dist/cjs/api/types/NotificationStandardRequest.js +1 -0
  77. package/dist/cjs/api/types/QueryResponseSettlements.d.ts +1 -1
  78. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -0
  79. package/dist/cjs/auth/HeaderAuthProvider.js +71 -0
  80. package/dist/cjs/auth/index.d.ts +1 -0
  81. package/dist/cjs/auth/index.js +5 -0
  82. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  83. package/dist/cjs/{version.js → core/auth/AuthProvider.js} +0 -2
  84. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  85. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  86. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  87. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  88. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  89. package/dist/cjs/core/auth/BearerToken.js +16 -0
  90. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  91. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  92. package/dist/cjs/core/auth/index.d.ts +5 -0
  93. package/dist/cjs/core/auth/index.js +9 -0
  94. package/dist/cjs/core/base64.d.ts +2 -0
  95. package/dist/cjs/core/base64.js +26 -0
  96. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  97. package/dist/cjs/core/fetcher/Fetcher.d.ts +5 -1
  98. package/dist/cjs/core/fetcher/Fetcher.js +42 -24
  99. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  100. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  101. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  102. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  103. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  104. package/dist/cjs/core/fetcher/signals.js +0 -12
  105. package/dist/cjs/core/index.d.ts +2 -0
  106. package/dist/cjs/core/index.js +2 -0
  107. package/dist/cjs/core/logging/logger.js +1 -1
  108. package/dist/cjs/core/runtime/runtime.js +11 -10
  109. package/dist/cjs/core/url/join.js +0 -1
  110. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  111. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  112. package/dist/esm/BaseClient.d.mts +10 -1
  113. package/dist/esm/BaseClient.mjs +22 -1
  114. package/dist/esm/Client.d.mts +87 -86
  115. package/dist/esm/Client.mjs +59 -67
  116. package/dist/esm/api/resources/bill/client/Client.d.mts +33 -33
  117. package/dist/esm/api/resources/bill/client/Client.mjs +67 -214
  118. package/dist/esm/api/resources/boarding/client/Client.d.mts +27 -27
  119. package/dist/esm/api/resources/boarding/client/Client.mjs +50 -197
  120. package/dist/esm/api/resources/chargeBacks/client/Client.d.mts +17 -15
  121. package/dist/esm/api/resources/chargeBacks/client/Client.mjs +36 -77
  122. package/dist/esm/api/resources/checkCapture/client/Client.d.mts +7 -7
  123. package/dist/esm/api/resources/checkCapture/client/Client.mjs +10 -27
  124. package/dist/esm/api/resources/cloud/client/Client.d.mts +17 -17
  125. package/dist/esm/api/resources/cloud/client/Client.mjs +31 -87
  126. package/dist/esm/api/resources/customer/client/Client.d.mts +17 -17
  127. package/dist/esm/api/resources/customer/client/Client.mjs +29 -111
  128. package/dist/esm/api/resources/export/client/Client.d.mts +93 -89
  129. package/dist/esm/api/resources/export/client/Client.mjs +204 -581
  130. package/dist/esm/api/resources/hostedPaymentPages/client/Client.d.mts +11 -11
  131. package/dist/esm/api/resources/hostedPaymentPages/client/Client.mjs +17 -60
  132. package/dist/esm/api/resources/import/client/Client.d.mts +11 -11
  133. package/dist/esm/api/resources/import/client/Client.mjs +17 -60
  134. package/dist/esm/api/resources/invoice/client/Client.d.mts +31 -31
  135. package/dist/esm/api/resources/invoice/client/Client.mjs +60 -207
  136. package/dist/esm/api/resources/lineItem/client/Client.d.mts +15 -15
  137. package/dist/esm/api/resources/lineItem/client/Client.mjs +25 -94
  138. package/dist/esm/api/resources/moneyIn/client/Client.d.mts +39 -39
  139. package/dist/esm/api/resources/moneyIn/client/Client.mjs +77 -247
  140. package/dist/esm/api/resources/moneyOut/client/Client.d.mts +43 -26
  141. package/dist/esm/api/resources/moneyOut/client/Client.mjs +103 -166
  142. package/dist/esm/api/resources/moneyOut/client/requests/MoneyOutTypesRequestOutAuthorize.d.mts +2 -1
  143. package/dist/esm/api/resources/moneyOutTypes/types/AuthorizePayoutBody.d.mts +3 -1
  144. package/dist/esm/api/resources/notification/client/Client.d.mts +16 -16
  145. package/dist/esm/api/resources/notification/client/Client.mjs +31 -100
  146. package/dist/esm/api/resources/notificationlogs/client/Client.d.mts +13 -13
  147. package/dist/esm/api/resources/notificationlogs/client/Client.mjs +22 -78
  148. package/dist/esm/api/resources/ocr/client/Client.d.mts +13 -9
  149. package/dist/esm/api/resources/ocr/client/Client.mjs +18 -44
  150. package/dist/esm/api/resources/organization/client/Client.d.mts +19 -19
  151. package/dist/esm/api/resources/organization/client/Client.mjs +33 -128
  152. package/dist/esm/api/resources/paymentLink/client/Client.d.mts +23 -23
  153. package/dist/esm/api/resources/paymentLink/client/Client.mjs +41 -162
  154. package/dist/esm/api/resources/paymentMethodDomain/client/Client.d.mts +19 -19
  155. package/dist/esm/api/resources/paymentMethodDomain/client/Client.mjs +34 -129
  156. package/dist/esm/api/resources/paypoint/client/Client.d.mts +22 -22
  157. package/dist/esm/api/resources/paypoint/client/Client.mjs +43 -151
  158. package/dist/esm/api/resources/query/client/Client.d.mts +71 -71
  159. package/dist/esm/api/resources/query/client/Client.mjs +136 -571
  160. package/dist/esm/api/resources/query/client/requests/ListPayoutOrgRequest.d.mts +1 -0
  161. package/dist/esm/api/resources/query/client/requests/ListPayoutRequest.d.mts +1 -0
  162. package/dist/esm/api/resources/query/client/requests/ListTransactionsRequest.d.mts +1 -0
  163. package/dist/esm/api/resources/statistic/client/Client.d.mts +50 -50
  164. package/dist/esm/api/resources/statistic/client/Client.mjs +79 -132
  165. package/dist/esm/api/resources/statistic/client/requests/BasicStatsRequest.d.mts +2 -2
  166. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.d.mts +76 -0
  167. package/dist/esm/api/resources/statistic/types/StatBasicExtendedQueryRecord.mjs +2 -0
  168. package/dist/esm/api/resources/statistic/types/index.d.mts +1 -0
  169. package/dist/esm/api/resources/statistic/types/index.mjs +1 -0
  170. package/dist/esm/api/resources/subscription/client/Client.d.mts +13 -13
  171. package/dist/esm/api/resources/subscription/client/Client.mjs +21 -77
  172. package/dist/esm/api/resources/templates/client/Client.d.mts +15 -15
  173. package/dist/esm/api/resources/templates/client/Client.mjs +27 -83
  174. package/dist/esm/api/resources/tokenStorage/client/Client.d.mts +13 -13
  175. package/dist/esm/api/resources/tokenStorage/client/Client.mjs +21 -77
  176. package/dist/esm/api/resources/user/client/Client.d.mts +54 -32
  177. package/dist/esm/api/resources/user/client/Client.mjs +83 -221
  178. package/dist/esm/api/resources/vendor/client/Client.d.mts +13 -13
  179. package/dist/esm/api/resources/vendor/client/Client.mjs +22 -78
  180. package/dist/esm/api/resources/wallet/client/Client.d.mts +13 -13
  181. package/dist/esm/api/resources/wallet/client/Client.mjs +22 -78
  182. package/dist/esm/api/types/ApplicationDetailsRecord.d.mts +2 -2
  183. package/dist/esm/api/types/NotificationContent.d.mts +1 -0
  184. package/dist/esm/api/types/NotificationContent.mjs +1 -0
  185. package/dist/esm/api/types/NotificationStandardRequest.d.mts +1 -0
  186. package/dist/esm/api/types/NotificationStandardRequest.mjs +1 -0
  187. package/dist/esm/api/types/QueryResponseSettlements.d.mts +1 -1
  188. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -0
  189. package/dist/esm/auth/HeaderAuthProvider.mjs +34 -0
  190. package/dist/esm/auth/index.d.mts +1 -0
  191. package/dist/esm/auth/index.mjs +1 -0
  192. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  193. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  194. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  195. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  196. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  197. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  198. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  199. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  200. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  201. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  202. package/dist/esm/core/auth/index.d.mts +5 -0
  203. package/dist/esm/core/auth/index.mjs +3 -0
  204. package/dist/esm/core/base64.d.mts +2 -0
  205. package/dist/esm/core/base64.mjs +22 -0
  206. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  207. package/dist/esm/core/fetcher/Fetcher.d.mts +5 -1
  208. package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
  209. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  210. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  211. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  212. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  213. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  214. package/dist/esm/core/fetcher/signals.mjs +0 -12
  215. package/dist/esm/core/index.d.mts +2 -0
  216. package/dist/esm/core/index.mjs +2 -0
  217. package/dist/esm/core/logging/logger.mjs +1 -1
  218. package/dist/esm/core/runtime/runtime.mjs +11 -10
  219. package/dist/esm/core/url/join.mjs +0 -1
  220. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  221. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  222. package/package.json +4 -4
  223. package/reference.md +761 -473
  224. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  225. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  226. package/dist/cjs/version.d.ts +0 -1
  227. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  228. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
  229. package/dist/esm/version.d.mts +0 -1
  230. package/dist/esm/version.mjs +0 -1
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
2
3
  import * as core from "../../../../core/index.js";
3
4
  import * as Payabli from "../../../index.js";
4
- export declare namespace PaymentMethodDomain {
5
+ export declare namespace PaymentMethodDomainClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class PaymentMethodDomain {
11
- protected readonly _options: PaymentMethodDomain.Options;
12
- constructor(_options?: PaymentMethodDomain.Options);
11
+ export declare class PaymentMethodDomainClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<PaymentMethodDomainClient.Options>;
13
+ constructor(options?: PaymentMethodDomainClient.Options);
13
14
  /**
14
15
  * Add a payment method domain to an organization or paypoint.
15
16
  *
16
17
  * @param {Payabli.AddPaymentMethodDomainRequest} request
17
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link Payabli.BadRequestError}
20
21
  * @throws {@link Payabli.UnauthorizedError}
@@ -34,13 +35,13 @@ export declare class PaymentMethodDomain {
34
35
  * }
35
36
  * })
36
37
  */
37
- addPaymentMethodDomain(request?: Payabli.AddPaymentMethodDomainRequest, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.AddPaymentMethodDomainApiResponse>;
38
+ addPaymentMethodDomain(request?: Payabli.AddPaymentMethodDomainRequest, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.AddPaymentMethodDomainApiResponse>;
38
39
  private __addPaymentMethodDomain;
39
40
  /**
40
41
  * Cascades a payment method domain to all child entities. All paypoints and suborganization under this parent will inherit this domain and its settings.
41
42
  *
42
43
  * @param {string} domainId - The payment method domain's ID in Payabli.
43
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
44
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
44
45
  *
45
46
  * @throws {@link Payabli.BadRequestError}
46
47
  * @throws {@link Payabli.UnauthorizedError}
@@ -50,13 +51,13 @@ export declare class PaymentMethodDomain {
50
51
  * @example
51
52
  * await client.paymentMethodDomain.cascadePaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5")
52
53
  */
53
- cascadePaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
54
+ cascadePaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
54
55
  private __cascadePaymentMethodDomain;
55
56
  /**
56
57
  * Delete a payment method domain. You can't delete an inherited domain, you must delete a domain at the organization level.
57
58
  *
58
59
  * @param {string} domainId - The payment method domain's ID in Payabli.
59
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
60
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
60
61
  *
61
62
  * @throws {@link Payabli.BadRequestError}
62
63
  * @throws {@link Payabli.UnauthorizedError}
@@ -66,13 +67,13 @@ export declare class PaymentMethodDomain {
66
67
  * @example
67
68
  * await client.paymentMethodDomain.deletePaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5")
68
69
  */
69
- deletePaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.DeletePaymentMethodDomainResponse>;
70
+ deletePaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.DeletePaymentMethodDomainResponse>;
70
71
  private __deletePaymentMethodDomain;
71
72
  /**
72
73
  * Get the details for a payment method domain.
73
74
  *
74
75
  * @param {string} domainId - The payment method domain's ID in Payabli.
75
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
76
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
76
77
  *
77
78
  * @throws {@link Payabli.BadRequestError}
78
79
  * @throws {@link Payabli.UnauthorizedError}
@@ -82,13 +83,13 @@ export declare class PaymentMethodDomain {
82
83
  * @example
83
84
  * await client.paymentMethodDomain.getPaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5")
84
85
  */
85
- getPaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainApiResponse>;
86
+ getPaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainApiResponse>;
86
87
  private __getPaymentMethodDomain;
87
88
  /**
88
89
  * Get a list of payment method domains that belong to a PSP, organization, or paypoint.
89
90
  *
90
91
  * @param {Payabli.ListPaymentMethodDomainsRequest} request
91
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
92
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
92
93
  *
93
94
  * @throws {@link Payabli.BadRequestError}
94
95
  * @throws {@link Payabli.UnauthorizedError}
@@ -107,14 +108,14 @@ export declare class PaymentMethodDomain {
107
108
  * entityType: "organization"
108
109
  * })
109
110
  */
110
- listPaymentMethodDomains(request?: Payabli.ListPaymentMethodDomainsRequest, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.ListPaymentMethodDomainsResponse>;
111
+ listPaymentMethodDomains(request?: Payabli.ListPaymentMethodDomainsRequest, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.ListPaymentMethodDomainsResponse>;
111
112
  private __listPaymentMethodDomains;
112
113
  /**
113
114
  * Update a payment method domain's configuration values.
114
115
  *
115
116
  * @param {string} domainId - The payment method domain's ID in Payabli.
116
117
  * @param {Payabli.UpdatePaymentMethodDomainRequest} request
117
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
118
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
118
119
  *
119
120
  * @throws {@link Payabli.BadRequestError}
120
121
  * @throws {@link Payabli.UnauthorizedError}
@@ -131,13 +132,13 @@ export declare class PaymentMethodDomain {
131
132
  * }
132
133
  * })
133
134
  */
134
- updatePaymentMethodDomain(domainId: string, request?: Payabli.UpdatePaymentMethodDomainRequest, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
135
+ updatePaymentMethodDomain(domainId: string, request?: Payabli.UpdatePaymentMethodDomainRequest, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
135
136
  private __updatePaymentMethodDomain;
136
137
  /**
137
138
  * Verify a new payment method domain. If verification is successful, Apple Pay is automatically activated for the domain.
138
139
  *
139
140
  * @param {string} domainId - The payment method domain's ID in Payabli.
140
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
141
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
141
142
  *
142
143
  * @throws {@link Payabli.BadRequestError}
143
144
  * @throws {@link Payabli.UnauthorizedError}
@@ -147,7 +148,6 @@ export declare class PaymentMethodDomain {
147
148
  * @example
148
149
  * await client.paymentMethodDomain.verifyPaymentMethodDomain("pmd_b8237fa45c964d8a9ef27160cd42b8c5")
149
150
  */
150
- verifyPaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomain.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
151
+ verifyPaymentMethodDomain(domainId: string, requestOptions?: PaymentMethodDomainClient.RequestOptions): core.HttpResponsePromise<Payabli.PaymentMethodDomainGeneralResponse>;
151
152
  private __verifyPaymentMethodDomain;
152
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
153
153
  }
@@ -43,21 +43,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.PaymentMethodDomain = void 0;
46
+ exports.PaymentMethodDomainClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
47
48
  const headers_js_1 = require("../../../../core/headers.js");
48
49
  const core = __importStar(require("../../../../core/index.js"));
49
50
  const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
50
52
  const errors = __importStar(require("../../../../errors/index.js"));
51
53
  const Payabli = __importStar(require("../../../index.js"));
52
- class PaymentMethodDomain {
53
- constructor(_options = {}) {
54
- this._options = _options;
54
+ class PaymentMethodDomainClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
55
57
  }
56
58
  /**
57
59
  * Add a payment method domain to an organization or paypoint.
58
60
  *
59
61
  * @param {Payabli.AddPaymentMethodDomainRequest} request
60
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
62
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
61
63
  *
62
64
  * @throws {@link Payabli.BadRequestError}
63
65
  * @throws {@link Payabli.UnauthorizedError}
@@ -83,7 +85,8 @@ class PaymentMethodDomain {
83
85
  __addPaymentMethodDomain() {
84
86
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
85
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
86
- 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);
88
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
89
+ 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);
87
90
  const _response = yield core.fetcher({
88
91
  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, "PaymentMethodDomain"),
89
92
  method: "POST",
@@ -122,28 +125,14 @@ class PaymentMethodDomain {
122
125
  });
123
126
  }
124
127
  }
125
- switch (_response.error.reason) {
126
- case "non-json":
127
- throw new errors.PayabliError({
128
- statusCode: _response.error.statusCode,
129
- body: _response.error.rawBody,
130
- rawResponse: _response.rawResponse,
131
- });
132
- case "timeout":
133
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /PaymentMethodDomain.");
134
- case "unknown":
135
- throw new errors.PayabliError({
136
- message: _response.error.errorMessage,
137
- rawResponse: _response.rawResponse,
138
- });
139
- }
128
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/PaymentMethodDomain");
140
129
  });
141
130
  }
142
131
  /**
143
132
  * Cascades a payment method domain to all child entities. All paypoints and suborganization under this parent will inherit this domain and its settings.
144
133
  *
145
134
  * @param {string} domainId - The payment method domain's ID in Payabli.
146
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
135
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
147
136
  *
148
137
  * @throws {@link Payabli.BadRequestError}
149
138
  * @throws {@link Payabli.UnauthorizedError}
@@ -159,7 +148,8 @@ class PaymentMethodDomain {
159
148
  __cascadePaymentMethodDomain(domainId, requestOptions) {
160
149
  return __awaiter(this, void 0, void 0, function* () {
161
150
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
162
- 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);
151
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
152
+ 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);
163
153
  const _response = yield core.fetcher({
164
154
  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, `PaymentMethodDomain/${core.url.encodePathParam(domainId)}/cascade`),
165
155
  method: "POST",
@@ -195,28 +185,14 @@ class PaymentMethodDomain {
195
185
  });
196
186
  }
197
187
  }
198
- switch (_response.error.reason) {
199
- case "non-json":
200
- throw new errors.PayabliError({
201
- statusCode: _response.error.statusCode,
202
- body: _response.error.rawBody,
203
- rawResponse: _response.rawResponse,
204
- });
205
- case "timeout":
206
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /PaymentMethodDomain/{domainId}/cascade.");
207
- case "unknown":
208
- throw new errors.PayabliError({
209
- message: _response.error.errorMessage,
210
- rawResponse: _response.rawResponse,
211
- });
212
- }
188
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/PaymentMethodDomain/{domainId}/cascade");
213
189
  });
214
190
  }
215
191
  /**
216
192
  * Delete a payment method domain. You can't delete an inherited domain, you must delete a domain at the organization level.
217
193
  *
218
194
  * @param {string} domainId - The payment method domain's ID in Payabli.
219
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
195
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
220
196
  *
221
197
  * @throws {@link Payabli.BadRequestError}
222
198
  * @throws {@link Payabli.UnauthorizedError}
@@ -232,7 +208,8 @@ class PaymentMethodDomain {
232
208
  __deletePaymentMethodDomain(domainId, requestOptions) {
233
209
  return __awaiter(this, void 0, void 0, function* () {
234
210
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
235
- 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);
211
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
212
+ 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);
236
213
  const _response = yield core.fetcher({
237
214
  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, `PaymentMethodDomain/${core.url.encodePathParam(domainId)}`),
238
215
  method: "DELETE",
@@ -268,28 +245,14 @@ class PaymentMethodDomain {
268
245
  });
269
246
  }
270
247
  }
271
- switch (_response.error.reason) {
272
- case "non-json":
273
- throw new errors.PayabliError({
274
- statusCode: _response.error.statusCode,
275
- body: _response.error.rawBody,
276
- rawResponse: _response.rawResponse,
277
- });
278
- case "timeout":
279
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling DELETE /PaymentMethodDomain/{domainId}.");
280
- case "unknown":
281
- throw new errors.PayabliError({
282
- message: _response.error.errorMessage,
283
- rawResponse: _response.rawResponse,
284
- });
285
- }
248
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/PaymentMethodDomain/{domainId}");
286
249
  });
287
250
  }
288
251
  /**
289
252
  * Get the details for a payment method domain.
290
253
  *
291
254
  * @param {string} domainId - The payment method domain's ID in Payabli.
292
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
255
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
293
256
  *
294
257
  * @throws {@link Payabli.BadRequestError}
295
258
  * @throws {@link Payabli.UnauthorizedError}
@@ -305,7 +268,8 @@ class PaymentMethodDomain {
305
268
  __getPaymentMethodDomain(domainId, requestOptions) {
306
269
  return __awaiter(this, void 0, void 0, function* () {
307
270
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
308
- 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);
271
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
272
+ 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);
309
273
  const _response = yield core.fetcher({
310
274
  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, `PaymentMethodDomain/${core.url.encodePathParam(domainId)}`),
311
275
  method: "GET",
@@ -341,28 +305,14 @@ class PaymentMethodDomain {
341
305
  });
342
306
  }
343
307
  }
344
- switch (_response.error.reason) {
345
- case "non-json":
346
- throw new errors.PayabliError({
347
- statusCode: _response.error.statusCode,
348
- body: _response.error.rawBody,
349
- rawResponse: _response.rawResponse,
350
- });
351
- case "timeout":
352
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /PaymentMethodDomain/{domainId}.");
353
- case "unknown":
354
- throw new errors.PayabliError({
355
- message: _response.error.errorMessage,
356
- rawResponse: _response.rawResponse,
357
- });
358
- }
308
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/PaymentMethodDomain/{domainId}");
359
309
  });
360
310
  }
361
311
  /**
362
312
  * Get a list of payment method domains that belong to a PSP, organization, or paypoint.
363
313
  *
364
314
  * @param {Payabli.ListPaymentMethodDomainsRequest} request
365
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
315
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
366
316
  *
367
317
  * @throws {@link Payabli.BadRequestError}
368
318
  * @throws {@link Payabli.UnauthorizedError}
@@ -401,7 +351,8 @@ class PaymentMethodDomain {
401
351
  if (limitRecord != null) {
402
352
  _queryParams.limitRecord = limitRecord.toString();
403
353
  }
404
- 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);
354
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
355
+ 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);
405
356
  const _response = yield core.fetcher({
406
357
  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, "PaymentMethodDomain/list"),
407
358
  method: "GET",
@@ -437,21 +388,7 @@ class PaymentMethodDomain {
437
388
  });
438
389
  }
439
390
  }
440
- switch (_response.error.reason) {
441
- case "non-json":
442
- throw new errors.PayabliError({
443
- statusCode: _response.error.statusCode,
444
- body: _response.error.rawBody,
445
- rawResponse: _response.rawResponse,
446
- });
447
- case "timeout":
448
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling GET /PaymentMethodDomain/list.");
449
- case "unknown":
450
- throw new errors.PayabliError({
451
- message: _response.error.errorMessage,
452
- rawResponse: _response.rawResponse,
453
- });
454
- }
391
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/PaymentMethodDomain/list");
455
392
  });
456
393
  }
457
394
  /**
@@ -459,7 +396,7 @@ class PaymentMethodDomain {
459
396
  *
460
397
  * @param {string} domainId - The payment method domain's ID in Payabli.
461
398
  * @param {Payabli.UpdatePaymentMethodDomainRequest} request
462
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
399
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
463
400
  *
464
401
  * @throws {@link Payabli.BadRequestError}
465
402
  * @throws {@link Payabli.UnauthorizedError}
@@ -482,7 +419,8 @@ class PaymentMethodDomain {
482
419
  __updatePaymentMethodDomain(domainId_1) {
483
420
  return __awaiter(this, arguments, void 0, function* (domainId, request = {}, requestOptions) {
484
421
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
485
- 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);
422
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
423
+ 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);
486
424
  const _response = yield core.fetcher({
487
425
  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, `PaymentMethodDomain/${core.url.encodePathParam(domainId)}`),
488
426
  method: "PATCH",
@@ -521,28 +459,14 @@ class PaymentMethodDomain {
521
459
  });
522
460
  }
523
461
  }
524
- switch (_response.error.reason) {
525
- case "non-json":
526
- throw new errors.PayabliError({
527
- statusCode: _response.error.statusCode,
528
- body: _response.error.rawBody,
529
- rawResponse: _response.rawResponse,
530
- });
531
- case "timeout":
532
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling PATCH /PaymentMethodDomain/{domainId}.");
533
- case "unknown":
534
- throw new errors.PayabliError({
535
- message: _response.error.errorMessage,
536
- rawResponse: _response.rawResponse,
537
- });
538
- }
462
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/PaymentMethodDomain/{domainId}");
539
463
  });
540
464
  }
541
465
  /**
542
466
  * Verify a new payment method domain. If verification is successful, Apple Pay is automatically activated for the domain.
543
467
  *
544
468
  * @param {string} domainId - The payment method domain's ID in Payabli.
545
- * @param {PaymentMethodDomain.RequestOptions} requestOptions - Request-specific configuration.
469
+ * @param {PaymentMethodDomainClient.RequestOptions} requestOptions - Request-specific configuration.
546
470
  *
547
471
  * @throws {@link Payabli.BadRequestError}
548
472
  * @throws {@link Payabli.UnauthorizedError}
@@ -558,7 +482,8 @@ class PaymentMethodDomain {
558
482
  __verifyPaymentMethodDomain(domainId, requestOptions) {
559
483
  return __awaiter(this, void 0, void 0, function* () {
560
484
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
561
- 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);
485
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
486
+ 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);
562
487
  const _response = yield core.fetcher({
563
488
  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, `PaymentMethodDomain/${core.url.encodePathParam(domainId)}/verify`),
564
489
  method: "POST",
@@ -594,28 +519,8 @@ class PaymentMethodDomain {
594
519
  });
595
520
  }
596
521
  }
597
- switch (_response.error.reason) {
598
- case "non-json":
599
- throw new errors.PayabliError({
600
- statusCode: _response.error.statusCode,
601
- body: _response.error.rawBody,
602
- rawResponse: _response.rawResponse,
603
- });
604
- case "timeout":
605
- throw new errors.PayabliTimeoutError("Timeout exceeded when calling POST /PaymentMethodDomain/{domainId}/verify.");
606
- case "unknown":
607
- throw new errors.PayabliError({
608
- message: _response.error.errorMessage,
609
- rawResponse: _response.rawResponse,
610
- });
611
- }
612
- });
613
- }
614
- _getCustomAuthorizationHeaders() {
615
- return __awaiter(this, void 0, void 0, function* () {
616
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
617
- return { requestToken: apiKeyValue };
522
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/PaymentMethodDomain/{domainId}/verify");
618
523
  });
619
524
  }
620
525
  }
621
- exports.PaymentMethodDomain = PaymentMethodDomain;
526
+ exports.PaymentMethodDomainClient = PaymentMethodDomainClient;
@@ -1,20 +1,21 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
2
3
  import * as core from "../../../../core/index.js";
3
4
  import * as Payabli from "../../../index.js";
4
- export declare namespace Paypoint {
5
+ export declare namespace PaypointClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface RequestOptions extends BaseRequestOptions {
8
9
  }
9
10
  }
10
- export declare class Paypoint {
11
- protected readonly _options: Paypoint.Options;
12
- constructor(_options?: Paypoint.Options);
11
+ export declare class PaypointClient {
12
+ protected readonly _options: NormalizedClientOptionsWithAuth<PaypointClient.Options>;
13
+ constructor(options?: PaypointClient.Options);
13
14
  /**
14
15
  * Gets the basic details for a paypoint.
15
16
  *
16
17
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
17
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
18
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
18
19
  *
19
20
  * @throws {@link Payabli.BadRequestError}
20
21
  * @throws {@link Payabli.UnauthorizedError}
@@ -24,13 +25,13 @@ export declare class Paypoint {
24
25
  * @example
25
26
  * await client.paypoint.getBasicEntry("8cfec329267")
26
27
  */
27
- getBasicEntry(entry: string, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.GetBasicEntryResponse>;
28
+ getBasicEntry(entry: string, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.GetBasicEntryResponse>;
28
29
  private __getBasicEntry;
29
30
  /**
30
31
  * Retrieves the basic details for a paypoint by ID.
31
32
  *
32
- * @param {string} idPaypoint - Paypoint ID. You can find this value by querying `/api/Query/paypoints/{orgId}`
33
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
33
+ * @param {string} IdPaypoint - Paypoint ID. You can find this value by querying `/api/Query/paypoints/{orgId}`
34
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
34
35
  *
35
36
  * @throws {@link Payabli.BadRequestError}
36
37
  * @throws {@link Payabli.UnauthorizedError}
@@ -40,14 +41,14 @@ export declare class Paypoint {
40
41
  * @example
41
42
  * await client.paypoint.getBasicEntryById("198")
42
43
  */
43
- getBasicEntryById(idPaypoint: string, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.GetBasicEntryByIdResponse>;
44
+ getBasicEntryById(IdPaypoint: string, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.GetBasicEntryByIdResponse>;
44
45
  private __getBasicEntryById;
45
46
  /**
46
47
  * Gets the details for a single paypoint.
47
48
  *
48
49
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
49
50
  * @param {Payabli.GetEntryConfigRequest} request
50
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
51
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
51
52
  *
52
53
  * @throws {@link Payabli.BadRequestError}
53
54
  * @throws {@link Payabli.UnauthorizedError}
@@ -57,14 +58,14 @@ export declare class Paypoint {
57
58
  * @example
58
59
  * await client.paypoint.getEntryConfig("8cfec329267")
59
60
  */
60
- getEntryConfig(entry: string, request?: Payabli.GetEntryConfigRequest, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.GetEntryConfigResponse>;
61
+ getEntryConfig(entry: string, request?: Payabli.GetEntryConfigRequest, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.GetEntryConfigResponse>;
61
62
  private __getEntryConfig;
62
63
  /**
63
64
  * Gets the details for single payment page for a paypoint.
64
65
  *
65
66
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
66
67
  * @param {string} subdomain - Payment page identifier. The subdomain value is the last portion of the payment page URL. For example, in`https://paypages-sandbox.payabli.com/513823dc10/pay-your-fees-1`, the subdomain is `pay-your-fees-1`.
67
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
68
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
68
69
  *
69
70
  * @throws {@link Payabli.BadRequestError}
70
71
  * @throws {@link Payabli.UnauthorizedError}
@@ -74,14 +75,14 @@ export declare class Paypoint {
74
75
  * @example
75
76
  * await client.paypoint.getPage("8cfec329267", "pay-your-fees-1")
76
77
  */
77
- getPage(entry: string, subdomain: string, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.PayabliPages>;
78
+ getPage(entry: string, subdomain: string, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliPages>;
78
79
  private __getPage;
79
80
  /**
80
81
  * Deletes a payment page in a paypoint.
81
82
  *
82
83
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
83
84
  * @param {string} subdomain - Payment page identifier. The subdomain value is the last portion of the payment page URL. For example, in`https://paypages-sandbox.payabli.com/513823dc10/pay-your-fees-1`, the subdomain is `pay-your-fees-1`.
84
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
85
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
85
86
  *
86
87
  * @throws {@link Payabli.BadRequestError}
87
88
  * @throws {@link Payabli.UnauthorizedError}
@@ -91,14 +92,14 @@ export declare class Paypoint {
91
92
  * @example
92
93
  * await client.paypoint.removePage("8cfec329267", "pay-your-fees-1")
93
94
  */
94
- removePage(entry: string, subdomain: string, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseGeneric2Part>;
95
+ removePage(entry: string, subdomain: string, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponseGeneric2Part>;
95
96
  private __removePage;
96
97
  /**
97
98
  * Updates a paypoint logo.
98
99
  *
99
100
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
100
101
  * @param {Payabli.FileContent} request
101
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
102
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
102
103
  *
103
104
  * @throws {@link Payabli.BadRequestError}
104
105
  * @throws {@link Payabli.UnauthorizedError}
@@ -108,13 +109,13 @@ export declare class Paypoint {
108
109
  * @example
109
110
  * await client.paypoint.saveLogo("8cfec329267", {})
110
111
  */
111
- saveLogo(entry: string, request: Payabli.FileContent, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponse00Responsedatanonobject>;
112
+ saveLogo(entry: string, request: Payabli.FileContent, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.PayabliApiResponse00Responsedatanonobject>;
112
113
  private __saveLogo;
113
114
  /**
114
115
  * Retrieves an paypoint's basic settings like custom fields, identifiers, and invoicing settings.
115
116
  *
116
117
  * @param {string} entry - The paypoint's entrypoint identifier. [Learn more](/api-reference/api-overview#entrypoint-vs-entry)
117
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
118
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
118
119
  *
119
120
  * @throws {@link Payabli.BadRequestError}
120
121
  * @throws {@link Payabli.UnauthorizedError}
@@ -124,13 +125,13 @@ export declare class Paypoint {
124
125
  * @example
125
126
  * await client.paypoint.settingsPage("8cfec329267")
126
127
  */
127
- settingsPage(entry: string, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.SettingsQueryRecord>;
128
+ settingsPage(entry: string, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.SettingsQueryRecord>;
128
129
  private __settingsPage;
129
130
  /**
130
131
  * Migrates a paypoint to a new parent organization.
131
132
  *
132
133
  * @param {Payabli.PaypointMoveRequest} request
133
- * @param {Paypoint.RequestOptions} requestOptions - Request-specific configuration.
134
+ * @param {PaypointClient.RequestOptions} requestOptions - Request-specific configuration.
134
135
  *
135
136
  * @throws {@link Payabli.BadRequestError}
136
137
  * @throws {@link Payabli.UnauthorizedError}
@@ -150,7 +151,6 @@ export declare class Paypoint {
150
151
  * }
151
152
  * })
152
153
  */
153
- migrate(request: Payabli.PaypointMoveRequest, requestOptions?: Paypoint.RequestOptions): core.HttpResponsePromise<Payabli.MigratePaypointResponse>;
154
+ migrate(request: Payabli.PaypointMoveRequest, requestOptions?: PaypointClient.RequestOptions): core.HttpResponsePromise<Payabli.MigratePaypointResponse>;
154
155
  private __migrate;
155
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
156
156
  }