@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
@@ -71,6 +71,17 @@ function evaluateRuntime() {
71
71
  version: Bun.version,
72
72
  };
73
73
  }
74
+ /**
75
+ * A constant that indicates whether the environment the code is running is in React-Native.
76
+ * This check should come before Node.js detection since React Native may have a process polyfill.
77
+ * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
78
+ */
79
+ const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
80
+ if (isReactNative) {
81
+ return {
82
+ type: "react-native",
83
+ };
84
+ }
74
85
  /**
75
86
  * A constant that indicates whether the environment the code is running is Node.JS.
76
87
  */
@@ -86,16 +97,6 @@ function evaluateRuntime() {
86
97
  parsedVersion: Number(process.versions.node.split(".")[0]),
87
98
  };
88
99
  }
89
- /**
90
- * A constant that indicates whether the environment the code is running is in React-Native.
91
- * https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
92
- */
93
- const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
94
- if (isReactNative) {
95
- return {
96
- type: "react-native",
97
- };
98
- }
99
100
  return {
100
101
  type: "unknown",
101
102
  };
@@ -14,7 +14,6 @@ function join(base, ...segments) {
14
14
  url = new URL(base);
15
15
  }
16
16
  catch (_a) {
17
- // Fallback to path joining if URL is malformed
18
17
  return joinPath(base, ...segments);
19
18
  }
20
19
  const lastSegment = segments[segments.length - 1];
@@ -6,7 +6,11 @@ const json_js_1 = require("../core/json.js");
6
6
  class PayabliError extends Error {
7
7
  constructor({ message, statusCode, body, rawResponse, }) {
8
8
  super(buildMessage({ message, statusCode, body }));
9
- Object.setPrototypeOf(this, PayabliError.prototype);
9
+ Object.setPrototypeOf(this, new.target.prototype);
10
+ if (Error.captureStackTrace) {
11
+ Error.captureStackTrace(this, this.constructor);
12
+ }
13
+ this.name = this.constructor.name;
10
14
  this.statusCode = statusCode;
11
15
  this.body = body;
12
16
  this.rawResponse = rawResponse;
@@ -5,7 +5,11 @@ exports.PayabliTimeoutError = void 0;
5
5
  class PayabliTimeoutError extends Error {
6
6
  constructor(message) {
7
7
  super(message);
8
- Object.setPrototypeOf(this, PayabliTimeoutError.prototype);
8
+ Object.setPrototypeOf(this, new.target.prototype);
9
+ if (Error.captureStackTrace) {
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
+ this.name = this.constructor.name;
9
13
  }
10
14
  }
11
15
  exports.PayabliTimeoutError = PayabliTimeoutError;
@@ -0,0 +1,2 @@
1
+ import type * as core from "../core/index.js";
2
+ export declare function handleNonStatusCodeError(error: core.Fetcher.Error, rawResponse: core.RawResponse, method: string, path: string): never;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.handleNonStatusCodeError = handleNonStatusCodeError;
38
+ const errors = __importStar(require("./index.js"));
39
+ function handleNonStatusCodeError(error, rawResponse, method, path) {
40
+ switch (error.reason) {
41
+ case "non-json":
42
+ throw new errors.PayabliError({
43
+ statusCode: error.statusCode,
44
+ body: error.rawBody,
45
+ rawResponse: rawResponse,
46
+ });
47
+ case "body-is-null":
48
+ throw new errors.PayabliError({
49
+ statusCode: error.statusCode,
50
+ rawResponse: rawResponse,
51
+ });
52
+ case "timeout":
53
+ throw new errors.PayabliTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
54
+ case "unknown":
55
+ throw new errors.PayabliError({
56
+ message: error.errorMessage,
57
+ rawResponse: rawResponse,
58
+ });
59
+ default:
60
+ throw new errors.PayabliError({
61
+ message: "Unknown error",
62
+ rawResponse: rawResponse,
63
+ });
64
+ }
65
+ }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.116";
1
+ export declare const SDK_VERSION = "0.0.123";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.116";
4
+ exports.SDK_VERSION = "0.0.123";
@@ -1,10 +1,10 @@
1
- import type * as core from "./core/index.mjs";
1
+ import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
2
+ import * as core from "./core/index.mjs";
2
3
  import type * as environments from "./environments.mjs";
3
- export interface BaseClientOptions {
4
+ export type BaseClientOptions = {
4
5
  environment?: core.Supplier<environments.PayabliEnvironment | string>;
5
6
  /** Specify a custom URL to connect the client to. */
6
7
  baseUrl?: core.Supplier<string>;
7
- apiKey?: core.Supplier<string | undefined>;
8
8
  /** Additional headers to include in requests. */
9
9
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
10
10
  /** The default maximum time to wait for a response in seconds. */
@@ -15,7 +15,7 @@ export interface BaseClientOptions {
15
15
  fetch?: typeof fetch;
16
16
  /** Configure logging for the client. */
17
17
  logging?: core.logging.LogConfig | core.logging.Logger;
18
- }
18
+ } & HeaderAuthProvider.AuthOptions;
19
19
  export interface BaseRequestOptions {
20
20
  /** The maximum time to wait for a response in seconds. */
21
21
  timeoutInSeconds?: number;
@@ -28,3 +28,12 @@ export interface BaseRequestOptions {
28
28
  /** Additional headers to include in the request. */
29
29
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
30
30
  }
31
+ export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
32
+ logging: core.logging.Logger;
33
+ authProvider?: core.AuthProvider;
34
+ };
35
+ export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
36
+ authProvider: core.AuthProvider;
37
+ };
38
+ export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
39
+ export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
@@ -1,2 +1,25 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ import { HeaderAuthProvider } from "./auth/HeaderAuthProvider.mjs";
3
+ import { mergeHeaders } from "./core/headers.mjs";
4
+ import * as core from "./core/index.mjs";
5
+ export function normalizeClientOptions(options) {
6
+ const headers = mergeHeaders({
7
+ "X-Fern-Language": "JavaScript",
8
+ "X-Fern-SDK-Name": "@payabli/sdk-node",
9
+ "X-Fern-SDK-Version": "0.0.123",
10
+ "User-Agent": "@payabli/sdk-node/0.0.123",
11
+ "X-Fern-Runtime": core.RUNTIME.type,
12
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
13
+ }, options === null || options === void 0 ? void 0 : options.headers);
14
+ return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
15
+ }
16
+ export function normalizeClientOptionsWithAuth(options) {
17
+ var _a;
18
+ const normalized = normalizeClientOptions(options);
19
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
20
+ (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new HeaderAuthProvider(normalizedWithNoOpAuthProvider));
21
+ return normalized;
22
+ }
23
+ function withNoOpAuthProvider(options) {
24
+ return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
25
+ }
@@ -1,95 +1,95 @@
1
- import { Bill } from "./api/resources/bill/client/Client.mjs";
2
- import { Boarding } from "./api/resources/boarding/client/Client.mjs";
3
- import { ChargeBacks } from "./api/resources/chargeBacks/client/Client.mjs";
4
- import { CheckCapture } from "./api/resources/checkCapture/client/Client.mjs";
5
- import { Cloud } from "./api/resources/cloud/client/Client.mjs";
6
- import { Customer } from "./api/resources/customer/client/Client.mjs";
7
- import { Export } from "./api/resources/export/client/Client.mjs";
8
- import { HostedPaymentPages } from "./api/resources/hostedPaymentPages/client/Client.mjs";
9
- import { Import } from "./api/resources/import/client/Client.mjs";
10
- import { Invoice } from "./api/resources/invoice/client/Client.mjs";
11
- import { LineItem } from "./api/resources/lineItem/client/Client.mjs";
12
- import { MoneyIn } from "./api/resources/moneyIn/client/Client.mjs";
13
- import { MoneyOut } from "./api/resources/moneyOut/client/Client.mjs";
14
- import { Notification } from "./api/resources/notification/client/Client.mjs";
15
- import { Notificationlogs } from "./api/resources/notificationlogs/client/Client.mjs";
16
- import { Ocr } from "./api/resources/ocr/client/Client.mjs";
17
- import { Organization } from "./api/resources/organization/client/Client.mjs";
18
- import { PaymentLink } from "./api/resources/paymentLink/client/Client.mjs";
19
- import { PaymentMethodDomain } from "./api/resources/paymentMethodDomain/client/Client.mjs";
20
- import { Paypoint } from "./api/resources/paypoint/client/Client.mjs";
21
- import { Query } from "./api/resources/query/client/Client.mjs";
22
- import { Statistic } from "./api/resources/statistic/client/Client.mjs";
23
- import { Subscription } from "./api/resources/subscription/client/Client.mjs";
24
- import { Templates } from "./api/resources/templates/client/Client.mjs";
25
- import { TokenStorage } from "./api/resources/tokenStorage/client/Client.mjs";
26
- import { User } from "./api/resources/user/client/Client.mjs";
27
- import { Vendor } from "./api/resources/vendor/client/Client.mjs";
28
- import { Wallet } from "./api/resources/wallet/client/Client.mjs";
1
+ import { BillClient } from "./api/resources/bill/client/Client.mjs";
2
+ import { BoardingClient } from "./api/resources/boarding/client/Client.mjs";
3
+ import { ChargeBacksClient } from "./api/resources/chargeBacks/client/Client.mjs";
4
+ import { CheckCaptureClient } from "./api/resources/checkCapture/client/Client.mjs";
5
+ import { CloudClient } from "./api/resources/cloud/client/Client.mjs";
6
+ import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
7
+ import { ExportClient } from "./api/resources/export/client/Client.mjs";
8
+ import { HostedPaymentPagesClient } from "./api/resources/hostedPaymentPages/client/Client.mjs";
9
+ import { ImportClient } from "./api/resources/import/client/Client.mjs";
10
+ import { InvoiceClient } from "./api/resources/invoice/client/Client.mjs";
11
+ import { LineItemClient } from "./api/resources/lineItem/client/Client.mjs";
12
+ import { MoneyInClient } from "./api/resources/moneyIn/client/Client.mjs";
13
+ import { MoneyOutClient } from "./api/resources/moneyOut/client/Client.mjs";
14
+ import { NotificationClient } from "./api/resources/notification/client/Client.mjs";
15
+ import { NotificationlogsClient } from "./api/resources/notificationlogs/client/Client.mjs";
16
+ import { OcrClient } from "./api/resources/ocr/client/Client.mjs";
17
+ import { OrganizationClient } from "./api/resources/organization/client/Client.mjs";
18
+ import { PaymentLinkClient } from "./api/resources/paymentLink/client/Client.mjs";
19
+ import { PaymentMethodDomainClient } from "./api/resources/paymentMethodDomain/client/Client.mjs";
20
+ import { PaypointClient } from "./api/resources/paypoint/client/Client.mjs";
21
+ import { QueryClient } from "./api/resources/query/client/Client.mjs";
22
+ import { StatisticClient } from "./api/resources/statistic/client/Client.mjs";
23
+ import { SubscriptionClient } from "./api/resources/subscription/client/Client.mjs";
24
+ import { TemplatesClient } from "./api/resources/templates/client/Client.mjs";
25
+ import { TokenStorageClient } from "./api/resources/tokenStorage/client/Client.mjs";
26
+ import { UserClient } from "./api/resources/user/client/Client.mjs";
27
+ import { VendorClient } from "./api/resources/vendor/client/Client.mjs";
28
+ import { WalletClient } from "./api/resources/wallet/client/Client.mjs";
29
29
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
30
+ import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
30
31
  export declare namespace PayabliClient {
31
- interface Options extends BaseClientOptions {
32
- }
32
+ type Options = BaseClientOptions;
33
33
  interface RequestOptions extends BaseRequestOptions {
34
34
  }
35
35
  }
36
36
  export declare class PayabliClient {
37
- protected readonly _options: PayabliClient.Options;
38
- protected _bill: Bill | undefined;
39
- protected _boarding: Boarding | undefined;
40
- protected _chargeBacks: ChargeBacks | undefined;
41
- protected _checkCapture: CheckCapture | undefined;
42
- protected _cloud: Cloud | undefined;
43
- protected _customer: Customer | undefined;
44
- protected _export: Export | undefined;
45
- protected _hostedPaymentPages: HostedPaymentPages | undefined;
46
- protected _import: Import | undefined;
47
- protected _invoice: Invoice | undefined;
48
- protected _lineItem: LineItem | undefined;
49
- protected _moneyIn: MoneyIn | undefined;
50
- protected _moneyOut: MoneyOut | undefined;
51
- protected _notification: Notification | undefined;
52
- protected _notificationlogs: Notificationlogs | undefined;
53
- protected _ocr: Ocr | undefined;
54
- protected _organization: Organization | undefined;
55
- protected _paymentLink: PaymentLink | undefined;
56
- protected _paymentMethodDomain: PaymentMethodDomain | undefined;
57
- protected _paypoint: Paypoint | undefined;
58
- protected _query: Query | undefined;
59
- protected _statistic: Statistic | undefined;
60
- protected _subscription: Subscription | undefined;
61
- protected _templates: Templates | undefined;
62
- protected _tokenStorage: TokenStorage | undefined;
63
- protected _user: User | undefined;
64
- protected _vendor: Vendor | undefined;
65
- protected _wallet: Wallet | undefined;
66
- constructor(_options?: PayabliClient.Options);
67
- get bill(): Bill;
68
- get boarding(): Boarding;
69
- get chargeBacks(): ChargeBacks;
70
- get checkCapture(): CheckCapture;
71
- get cloud(): Cloud;
72
- get customer(): Customer;
73
- get export(): Export;
74
- get hostedPaymentPages(): HostedPaymentPages;
75
- get import(): Import;
76
- get invoice(): Invoice;
77
- get lineItem(): LineItem;
78
- get moneyIn(): MoneyIn;
79
- get moneyOut(): MoneyOut;
80
- get notification(): Notification;
81
- get notificationlogs(): Notificationlogs;
82
- get ocr(): Ocr;
83
- get organization(): Organization;
84
- get paymentLink(): PaymentLink;
85
- get paymentMethodDomain(): PaymentMethodDomain;
86
- get paypoint(): Paypoint;
87
- get query(): Query;
88
- get statistic(): Statistic;
89
- get subscription(): Subscription;
90
- get templates(): Templates;
91
- get tokenStorage(): TokenStorage;
92
- get user(): User;
93
- get vendor(): Vendor;
94
- get wallet(): Wallet;
37
+ protected readonly _options: NormalizedClientOptionsWithAuth<PayabliClient.Options>;
38
+ protected _bill: BillClient | undefined;
39
+ protected _boarding: BoardingClient | undefined;
40
+ protected _chargeBacks: ChargeBacksClient | undefined;
41
+ protected _checkCapture: CheckCaptureClient | undefined;
42
+ protected _cloud: CloudClient | undefined;
43
+ protected _customer: CustomerClient | undefined;
44
+ protected _export: ExportClient | undefined;
45
+ protected _hostedPaymentPages: HostedPaymentPagesClient | undefined;
46
+ protected _import: ImportClient | undefined;
47
+ protected _invoice: InvoiceClient | undefined;
48
+ protected _lineItem: LineItemClient | undefined;
49
+ protected _moneyIn: MoneyInClient | undefined;
50
+ protected _moneyOut: MoneyOutClient | undefined;
51
+ protected _notification: NotificationClient | undefined;
52
+ protected _notificationlogs: NotificationlogsClient | undefined;
53
+ protected _ocr: OcrClient | undefined;
54
+ protected _organization: OrganizationClient | undefined;
55
+ protected _paymentLink: PaymentLinkClient | undefined;
56
+ protected _paymentMethodDomain: PaymentMethodDomainClient | undefined;
57
+ protected _paypoint: PaypointClient | undefined;
58
+ protected _query: QueryClient | undefined;
59
+ protected _statistic: StatisticClient | undefined;
60
+ protected _subscription: SubscriptionClient | undefined;
61
+ protected _templates: TemplatesClient | undefined;
62
+ protected _tokenStorage: TokenStorageClient | undefined;
63
+ protected _user: UserClient | undefined;
64
+ protected _vendor: VendorClient | undefined;
65
+ protected _wallet: WalletClient | undefined;
66
+ constructor(options?: PayabliClient.Options);
67
+ get bill(): BillClient;
68
+ get boarding(): BoardingClient;
69
+ get chargeBacks(): ChargeBacksClient;
70
+ get checkCapture(): CheckCaptureClient;
71
+ get cloud(): CloudClient;
72
+ get customer(): CustomerClient;
73
+ get export(): ExportClient;
74
+ get hostedPaymentPages(): HostedPaymentPagesClient;
75
+ get import(): ImportClient;
76
+ get invoice(): InvoiceClient;
77
+ get lineItem(): LineItemClient;
78
+ get moneyIn(): MoneyInClient;
79
+ get moneyOut(): MoneyOutClient;
80
+ get notification(): NotificationClient;
81
+ get notificationlogs(): NotificationlogsClient;
82
+ get ocr(): OcrClient;
83
+ get organization(): OrganizationClient;
84
+ get paymentLink(): PaymentLinkClient;
85
+ get paymentMethodDomain(): PaymentMethodDomainClient;
86
+ get paypoint(): PaypointClient;
87
+ get query(): QueryClient;
88
+ get statistic(): StatisticClient;
89
+ get subscription(): SubscriptionClient;
90
+ get templates(): TemplatesClient;
91
+ get tokenStorage(): TokenStorageClient;
92
+ get user(): UserClient;
93
+ get vendor(): VendorClient;
94
+ get wallet(): WalletClient;
95
95
  }
@@ -1,155 +1,147 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- import { Bill } from "./api/resources/bill/client/Client.mjs";
3
- import { Boarding } from "./api/resources/boarding/client/Client.mjs";
4
- import { ChargeBacks } from "./api/resources/chargeBacks/client/Client.mjs";
5
- import { CheckCapture } from "./api/resources/checkCapture/client/Client.mjs";
6
- import { Cloud } from "./api/resources/cloud/client/Client.mjs";
7
- import { Customer } from "./api/resources/customer/client/Client.mjs";
8
- import { Export } from "./api/resources/export/client/Client.mjs";
9
- import { HostedPaymentPages } from "./api/resources/hostedPaymentPages/client/Client.mjs";
10
- import { Import } from "./api/resources/import/client/Client.mjs";
11
- import { Invoice } from "./api/resources/invoice/client/Client.mjs";
12
- import { LineItem } from "./api/resources/lineItem/client/Client.mjs";
13
- import { MoneyIn } from "./api/resources/moneyIn/client/Client.mjs";
14
- import { MoneyOut } from "./api/resources/moneyOut/client/Client.mjs";
15
- import { Notification } from "./api/resources/notification/client/Client.mjs";
16
- import { Notificationlogs } from "./api/resources/notificationlogs/client/Client.mjs";
17
- import { Ocr } from "./api/resources/ocr/client/Client.mjs";
18
- import { Organization } from "./api/resources/organization/client/Client.mjs";
19
- import { PaymentLink } from "./api/resources/paymentLink/client/Client.mjs";
20
- import { PaymentMethodDomain } from "./api/resources/paymentMethodDomain/client/Client.mjs";
21
- import { Paypoint } from "./api/resources/paypoint/client/Client.mjs";
22
- import { Query } from "./api/resources/query/client/Client.mjs";
23
- import { Statistic } from "./api/resources/statistic/client/Client.mjs";
24
- import { Subscription } from "./api/resources/subscription/client/Client.mjs";
25
- import { Templates } from "./api/resources/templates/client/Client.mjs";
26
- import { TokenStorage } from "./api/resources/tokenStorage/client/Client.mjs";
27
- import { User } from "./api/resources/user/client/Client.mjs";
28
- import { Vendor } from "./api/resources/vendor/client/Client.mjs";
29
- import { Wallet } from "./api/resources/wallet/client/Client.mjs";
30
- import { mergeHeaders } from "./core/headers.mjs";
31
- import * as core from "./core/index.mjs";
2
+ import { BillClient } from "./api/resources/bill/client/Client.mjs";
3
+ import { BoardingClient } from "./api/resources/boarding/client/Client.mjs";
4
+ import { ChargeBacksClient } from "./api/resources/chargeBacks/client/Client.mjs";
5
+ import { CheckCaptureClient } from "./api/resources/checkCapture/client/Client.mjs";
6
+ import { CloudClient } from "./api/resources/cloud/client/Client.mjs";
7
+ import { CustomerClient } from "./api/resources/customer/client/Client.mjs";
8
+ import { ExportClient } from "./api/resources/export/client/Client.mjs";
9
+ import { HostedPaymentPagesClient } from "./api/resources/hostedPaymentPages/client/Client.mjs";
10
+ import { ImportClient } from "./api/resources/import/client/Client.mjs";
11
+ import { InvoiceClient } from "./api/resources/invoice/client/Client.mjs";
12
+ import { LineItemClient } from "./api/resources/lineItem/client/Client.mjs";
13
+ import { MoneyInClient } from "./api/resources/moneyIn/client/Client.mjs";
14
+ import { MoneyOutClient } from "./api/resources/moneyOut/client/Client.mjs";
15
+ import { NotificationClient } from "./api/resources/notification/client/Client.mjs";
16
+ import { NotificationlogsClient } from "./api/resources/notificationlogs/client/Client.mjs";
17
+ import { OcrClient } from "./api/resources/ocr/client/Client.mjs";
18
+ import { OrganizationClient } from "./api/resources/organization/client/Client.mjs";
19
+ import { PaymentLinkClient } from "./api/resources/paymentLink/client/Client.mjs";
20
+ import { PaymentMethodDomainClient } from "./api/resources/paymentMethodDomain/client/Client.mjs";
21
+ import { PaypointClient } from "./api/resources/paypoint/client/Client.mjs";
22
+ import { QueryClient } from "./api/resources/query/client/Client.mjs";
23
+ import { StatisticClient } from "./api/resources/statistic/client/Client.mjs";
24
+ import { SubscriptionClient } from "./api/resources/subscription/client/Client.mjs";
25
+ import { TemplatesClient } from "./api/resources/templates/client/Client.mjs";
26
+ import { TokenStorageClient } from "./api/resources/tokenStorage/client/Client.mjs";
27
+ import { UserClient } from "./api/resources/user/client/Client.mjs";
28
+ import { VendorClient } from "./api/resources/vendor/client/Client.mjs";
29
+ import { WalletClient } from "./api/resources/wallet/client/Client.mjs";
30
+ import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
32
31
  export class PayabliClient {
33
- constructor(_options = {}) {
34
- this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
35
- "X-Fern-Language": "JavaScript",
36
- "X-Fern-SDK-Name": "@payabli/sdk-node",
37
- "X-Fern-SDK-Version": "0.0.116",
38
- "User-Agent": "@payabli/sdk-node/0.0.116",
39
- "X-Fern-Runtime": core.RUNTIME.type,
40
- "X-Fern-Runtime-Version": core.RUNTIME.version,
41
- }, _options === null || _options === void 0 ? void 0 : _options.headers) });
32
+ constructor(options = {}) {
33
+ this._options = normalizeClientOptionsWithAuth(options);
42
34
  }
43
35
  get bill() {
44
36
  var _a;
45
- return ((_a = this._bill) !== null && _a !== void 0 ? _a : (this._bill = new Bill(this._options)));
37
+ return ((_a = this._bill) !== null && _a !== void 0 ? _a : (this._bill = new BillClient(this._options)));
46
38
  }
47
39
  get boarding() {
48
40
  var _a;
49
- return ((_a = this._boarding) !== null && _a !== void 0 ? _a : (this._boarding = new Boarding(this._options)));
41
+ return ((_a = this._boarding) !== null && _a !== void 0 ? _a : (this._boarding = new BoardingClient(this._options)));
50
42
  }
51
43
  get chargeBacks() {
52
44
  var _a;
53
- return ((_a = this._chargeBacks) !== null && _a !== void 0 ? _a : (this._chargeBacks = new ChargeBacks(this._options)));
45
+ return ((_a = this._chargeBacks) !== null && _a !== void 0 ? _a : (this._chargeBacks = new ChargeBacksClient(this._options)));
54
46
  }
55
47
  get checkCapture() {
56
48
  var _a;
57
- return ((_a = this._checkCapture) !== null && _a !== void 0 ? _a : (this._checkCapture = new CheckCapture(this._options)));
49
+ return ((_a = this._checkCapture) !== null && _a !== void 0 ? _a : (this._checkCapture = new CheckCaptureClient(this._options)));
58
50
  }
59
51
  get cloud() {
60
52
  var _a;
61
- return ((_a = this._cloud) !== null && _a !== void 0 ? _a : (this._cloud = new Cloud(this._options)));
53
+ return ((_a = this._cloud) !== null && _a !== void 0 ? _a : (this._cloud = new CloudClient(this._options)));
62
54
  }
63
55
  get customer() {
64
56
  var _a;
65
- return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new Customer(this._options)));
57
+ return ((_a = this._customer) !== null && _a !== void 0 ? _a : (this._customer = new CustomerClient(this._options)));
66
58
  }
67
59
  get export() {
68
60
  var _a;
69
- return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new Export(this._options)));
61
+ return ((_a = this._export) !== null && _a !== void 0 ? _a : (this._export = new ExportClient(this._options)));
70
62
  }
71
63
  get hostedPaymentPages() {
72
64
  var _a;
73
- return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new HostedPaymentPages(this._options)));
65
+ return ((_a = this._hostedPaymentPages) !== null && _a !== void 0 ? _a : (this._hostedPaymentPages = new HostedPaymentPagesClient(this._options)));
74
66
  }
75
67
  get import() {
76
68
  var _a;
77
- return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new Import(this._options)));
69
+ return ((_a = this._import) !== null && _a !== void 0 ? _a : (this._import = new ImportClient(this._options)));
78
70
  }
79
71
  get invoice() {
80
72
  var _a;
81
- return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new Invoice(this._options)));
73
+ return ((_a = this._invoice) !== null && _a !== void 0 ? _a : (this._invoice = new InvoiceClient(this._options)));
82
74
  }
83
75
  get lineItem() {
84
76
  var _a;
85
- return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new LineItem(this._options)));
77
+ return ((_a = this._lineItem) !== null && _a !== void 0 ? _a : (this._lineItem = new LineItemClient(this._options)));
86
78
  }
87
79
  get moneyIn() {
88
80
  var _a;
89
- return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new MoneyIn(this._options)));
81
+ return ((_a = this._moneyIn) !== null && _a !== void 0 ? _a : (this._moneyIn = new MoneyInClient(this._options)));
90
82
  }
91
83
  get moneyOut() {
92
84
  var _a;
93
- return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new MoneyOut(this._options)));
85
+ return ((_a = this._moneyOut) !== null && _a !== void 0 ? _a : (this._moneyOut = new MoneyOutClient(this._options)));
94
86
  }
95
87
  get notification() {
96
88
  var _a;
97
- return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new Notification(this._options)));
89
+ return ((_a = this._notification) !== null && _a !== void 0 ? _a : (this._notification = new NotificationClient(this._options)));
98
90
  }
99
91
  get notificationlogs() {
100
92
  var _a;
101
- return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new Notificationlogs(this._options)));
93
+ return ((_a = this._notificationlogs) !== null && _a !== void 0 ? _a : (this._notificationlogs = new NotificationlogsClient(this._options)));
102
94
  }
103
95
  get ocr() {
104
96
  var _a;
105
- return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new Ocr(this._options)));
97
+ return ((_a = this._ocr) !== null && _a !== void 0 ? _a : (this._ocr = new OcrClient(this._options)));
106
98
  }
107
99
  get organization() {
108
100
  var _a;
109
- return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Organization(this._options)));
101
+ return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new OrganizationClient(this._options)));
110
102
  }
111
103
  get paymentLink() {
112
104
  var _a;
113
- return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new PaymentLink(this._options)));
105
+ return ((_a = this._paymentLink) !== null && _a !== void 0 ? _a : (this._paymentLink = new PaymentLinkClient(this._options)));
114
106
  }
115
107
  get paymentMethodDomain() {
116
108
  var _a;
117
- return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new PaymentMethodDomain(this._options)));
109
+ return ((_a = this._paymentMethodDomain) !== null && _a !== void 0 ? _a : (this._paymentMethodDomain = new PaymentMethodDomainClient(this._options)));
118
110
  }
119
111
  get paypoint() {
120
112
  var _a;
121
- return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new Paypoint(this._options)));
113
+ return ((_a = this._paypoint) !== null && _a !== void 0 ? _a : (this._paypoint = new PaypointClient(this._options)));
122
114
  }
123
115
  get query() {
124
116
  var _a;
125
- return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new Query(this._options)));
117
+ return ((_a = this._query) !== null && _a !== void 0 ? _a : (this._query = new QueryClient(this._options)));
126
118
  }
127
119
  get statistic() {
128
120
  var _a;
129
- return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new Statistic(this._options)));
121
+ return ((_a = this._statistic) !== null && _a !== void 0 ? _a : (this._statistic = new StatisticClient(this._options)));
130
122
  }
131
123
  get subscription() {
132
124
  var _a;
133
- return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new Subscription(this._options)));
125
+ return ((_a = this._subscription) !== null && _a !== void 0 ? _a : (this._subscription = new SubscriptionClient(this._options)));
134
126
  }
135
127
  get templates() {
136
128
  var _a;
137
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Templates(this._options)));
129
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new TemplatesClient(this._options)));
138
130
  }
139
131
  get tokenStorage() {
140
132
  var _a;
141
- return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new TokenStorage(this._options)));
133
+ return ((_a = this._tokenStorage) !== null && _a !== void 0 ? _a : (this._tokenStorage = new TokenStorageClient(this._options)));
142
134
  }
143
135
  get user() {
144
136
  var _a;
145
- return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new User(this._options)));
137
+ return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new UserClient(this._options)));
146
138
  }
147
139
  get vendor() {
148
140
  var _a;
149
- return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new Vendor(this._options)));
141
+ return ((_a = this._vendor) !== null && _a !== void 0 ? _a : (this._vendor = new VendorClient(this._options)));
150
142
  }
151
143
  get wallet() {
152
144
  var _a;
153
- return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new Wallet(this._options)));
145
+ return ((_a = this._wallet) !== null && _a !== void 0 ? _a : (this._wallet = new WalletClient(this._options)));
154
146
  }
155
147
  }