@kard-financial/sdk 12.2.1 → 12.4.0

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 (251) hide show
  1. package/README.md +106 -15
  2. package/dist/cjs/BaseClient.d.ts +7 -8
  3. package/dist/cjs/BaseClient.js +3 -3
  4. package/dist/cjs/Client.d.ts +13 -2
  5. package/dist/cjs/Client.js +67 -0
  6. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
  7. package/dist/cjs/api/resources/auth/client/Client.js +3 -23
  8. package/dist/cjs/api/resources/auth/exports.d.ts +2 -0
  9. package/dist/cjs/api/resources/auth/exports.js +21 -0
  10. package/dist/cjs/api/resources/commons/errors/ConflictError.js +5 -1
  11. package/dist/cjs/api/resources/commons/errors/DoesNotExistError.js +5 -1
  12. package/dist/cjs/api/resources/commons/errors/ForbiddenError.js +5 -1
  13. package/dist/cjs/api/resources/commons/errors/InternalServerError.js +5 -1
  14. package/dist/cjs/api/resources/commons/errors/InvalidRequest.js +5 -1
  15. package/dist/cjs/api/resources/commons/errors/UnauthorizedError.js +5 -1
  16. package/dist/cjs/api/resources/commons/exports.d.ts +1 -0
  17. package/dist/cjs/api/resources/commons/exports.js +18 -0
  18. package/dist/cjs/api/resources/commons/types/ErrorObject.d.ts +2 -2
  19. package/dist/cjs/api/resources/commons/types/ErrorSource.d.ts +3 -3
  20. package/dist/cjs/api/resources/commons/types/Links.d.ts +2 -2
  21. package/dist/cjs/api/resources/files/client/Client.d.ts +1 -2
  22. package/dist/cjs/api/resources/files/client/Client.js +11 -47
  23. package/dist/cjs/api/resources/files/exports.d.ts +2 -0
  24. package/dist/cjs/api/resources/files/exports.js +21 -0
  25. package/dist/cjs/api/resources/notifications/client/Client.d.ts +1 -2
  26. package/dist/cjs/api/resources/notifications/exports.d.ts +3 -0
  27. package/dist/cjs/api/resources/notifications/exports.js +22 -0
  28. package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.d.ts +1 -2
  29. package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +7 -64
  30. package/dist/cjs/api/resources/notifications/resources/subscriptions/exports.d.ts +2 -0
  31. package/dist/cjs/api/resources/notifications/resources/subscriptions/exports.js +21 -0
  32. package/dist/cjs/api/resources/notifications/resources/subscriptions/types/UpdateSubscriptionRequestAttributes.d.ts +3 -3
  33. package/dist/cjs/api/resources/notifications/types/AuditUpdateAttributes.d.ts +3 -3
  34. package/dist/cjs/api/resources/notifications/types/FailedTransactionAttributes.d.ts +1 -1
  35. package/dist/cjs/api/resources/notifications/types/NotificationPayload.d.ts +2 -2
  36. package/dist/cjs/api/resources/notifications/types/RewardNotificationAttributes.d.ts +2 -2
  37. package/dist/cjs/api/resources/ping/client/Client.d.ts +1 -2
  38. package/dist/cjs/api/resources/ping/client/Client.js +2 -20
  39. package/dist/cjs/api/resources/ping/errors/NetworkBlockedError.js +5 -1
  40. package/dist/cjs/api/resources/ping/exports.d.ts +2 -0
  41. package/dist/cjs/api/resources/ping/exports.js +21 -0
  42. package/dist/cjs/api/resources/transactions/client/Client.d.ts +3 -3
  43. package/dist/cjs/api/resources/transactions/client/Client.js +15 -112
  44. package/dist/cjs/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.ts +4 -1
  45. package/dist/cjs/api/resources/transactions/errors/CreateAuditMultiStatus.js +5 -1
  46. package/dist/cjs/api/resources/transactions/errors/CreateIncomingTransactionsMultiStatus.js +5 -1
  47. package/dist/cjs/api/resources/transactions/errors/FraudMultiStatus.js +5 -1
  48. package/dist/cjs/api/resources/transactions/exports.d.ts +2 -0
  49. package/dist/cjs/api/resources/transactions/exports.js +21 -0
  50. package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.d.ts +3 -3
  51. package/dist/cjs/api/resources/transactions/types/CreateAuditMultiStatusResponse.d.ts +1 -1
  52. package/dist/cjs/api/resources/transactions/types/GetEarnedRewardsResponse.d.ts +1 -1
  53. package/dist/cjs/api/resources/transactions/types/MatchedTransactionsAttributes.d.ts +14 -14
  54. package/dist/cjs/api/resources/transactions/types/Merchant.d.ts +9 -9
  55. package/dist/cjs/api/resources/transactions/types/RewardedTransactionAttributes.d.ts +3 -3
  56. package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +18 -18
  57. package/dist/cjs/api/resources/users/client/Client.d.ts +1 -2
  58. package/dist/cjs/api/resources/users/client/Client.js +5 -80
  59. package/dist/cjs/api/resources/users/errors/MultiStatus.js +5 -1
  60. package/dist/cjs/api/resources/users/exports.d.ts +3 -0
  61. package/dist/cjs/api/resources/users/exports.js +22 -0
  62. package/dist/cjs/api/resources/users/resources/attributions/client/Client.d.ts +1 -2
  63. package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +20 -94
  64. package/dist/cjs/api/resources/users/resources/attributions/exports.d.ts +2 -0
  65. package/dist/cjs/api/resources/users/resources/attributions/exports.js +21 -0
  66. package/dist/cjs/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.ts +1 -1
  67. package/dist/cjs/api/resources/users/resources/attributions/types/AttributionState.d.ts +2 -2
  68. package/dist/cjs/api/resources/users/resources/attributions/types/BoostOfferResponse.d.ts +1 -1
  69. package/dist/cjs/api/resources/users/resources/attributions/types/NotificationAttributionAttributes.d.ts +1 -1
  70. package/dist/cjs/api/resources/users/resources/attributions/types/OfferAttributionAttributes.d.ts +1 -1
  71. package/dist/cjs/api/resources/users/resources/auth/client/Client.d.ts +1 -2
  72. package/dist/cjs/api/resources/users/resources/auth/client/Client.js +2 -20
  73. package/dist/cjs/api/resources/users/resources/auth/exports.d.ts +2 -0
  74. package/dist/cjs/api/resources/users/resources/auth/exports.js +21 -0
  75. package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +1 -2
  76. package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +39 -144
  77. package/dist/cjs/api/resources/users/resources/rewards/exports.d.ts +2 -0
  78. package/dist/cjs/api/resources/users/resources/rewards/exports.js +21 -0
  79. package/dist/cjs/api/resources/users/resources/rewards/types/CtaComponent.d.ts +2 -2
  80. package/dist/cjs/api/resources/users/resources/rewards/types/LocationData.d.ts +1 -1
  81. package/dist/cjs/api/resources/users/resources/rewards/types/LocationsResponseObject.d.ts +1 -1
  82. package/dist/cjs/api/resources/users/resources/rewards/types/LogoFlare.d.ts +1 -1
  83. package/dist/cjs/api/resources/users/resources/rewards/types/OfferCommonFields.d.ts +8 -8
  84. package/dist/cjs/api/resources/users/resources/rewards/types/OfferComponents.d.ts +9 -9
  85. package/dist/cjs/api/resources/users/resources/rewards/types/OffersMeta.d.ts +1 -1
  86. package/dist/cjs/api/resources/users/resources/rewards/types/OffersResponseObject.d.ts +2 -2
  87. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBar.d.ts +1 -1
  88. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarLabelPair.d.ts +2 -2
  89. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarLabels.d.ts +1 -1
  90. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarSegment.d.ts +1 -1
  91. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBarSegments.d.ts +1 -1
  92. package/dist/cjs/api/resources/users/resources/rewards/types/StandardOffer.d.ts +1 -1
  93. package/dist/cjs/api/resources/users/resources/uploads/client/Client.d.ts +1 -2
  94. package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +4 -60
  95. package/dist/cjs/api/resources/users/resources/uploads/errors/UploadPartMultiStatus.js +5 -1
  96. package/dist/cjs/api/resources/users/resources/uploads/exports.d.ts +2 -0
  97. package/dist/cjs/api/resources/users/resources/uploads/exports.js +21 -0
  98. package/dist/cjs/api/resources/users/resources/uploads/types/CreateUploadPartMultiStatusResponse.d.ts +1 -1
  99. package/dist/cjs/api/resources/users/types/CreateUsersMultiStatusResponse.d.ts +1 -1
  100. package/dist/cjs/api/resources/users/types/UpdateUserRequestAttributes.d.ts +5 -5
  101. package/dist/cjs/api/resources/users/types/UserRequestAttributes.d.ts +6 -6
  102. package/dist/cjs/auth/OAuthAuthProvider.d.ts +36 -14
  103. package/dist/cjs/auth/OAuthAuthProvider.js +108 -40
  104. package/dist/cjs/core/auth/BasicAuth.d.ts +2 -2
  105. package/dist/cjs/core/auth/BasicAuth.js +7 -1
  106. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
  107. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  108. package/dist/cjs/core/fetcher/Fetcher.d.ts +3 -2
  109. package/dist/cjs/core/fetcher/Fetcher.js +12 -2
  110. package/dist/cjs/core/fetcher/index.d.ts +2 -0
  111. package/dist/cjs/core/fetcher/index.js +3 -1
  112. package/dist/cjs/core/fetcher/makePassthroughRequest.d.ts +49 -0
  113. package/dist/cjs/core/fetcher/makePassthroughRequest.js +135 -0
  114. package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
  115. package/dist/cjs/core/fetcher/makeRequest.js +30 -9
  116. package/dist/cjs/core/headers.d.ts +2 -2
  117. package/dist/cjs/core/runtime/runtime.js +8 -7
  118. package/dist/cjs/errors/KardApiError.d.ts +3 -1
  119. package/dist/cjs/errors/KardApiError.js +9 -2
  120. package/dist/cjs/errors/KardApiTimeoutError.d.ts +4 -1
  121. package/dist/cjs/errors/KardApiTimeoutError.js +9 -2
  122. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  123. package/dist/cjs/errors/handleNonStatusCodeError.js +68 -0
  124. package/dist/cjs/version.d.ts +1 -1
  125. package/dist/cjs/version.js +1 -1
  126. package/dist/esm/BaseClient.d.mts +7 -8
  127. package/dist/esm/BaseClient.mjs +3 -3
  128. package/dist/esm/Client.d.mts +13 -2
  129. package/dist/esm/Client.mjs +34 -0
  130. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
  131. package/dist/esm/api/resources/auth/client/Client.mjs +3 -23
  132. package/dist/esm/api/resources/auth/exports.d.mts +2 -0
  133. package/dist/esm/api/resources/auth/exports.mjs +3 -0
  134. package/dist/esm/api/resources/commons/errors/ConflictError.mjs +5 -1
  135. package/dist/esm/api/resources/commons/errors/DoesNotExistError.mjs +5 -1
  136. package/dist/esm/api/resources/commons/errors/ForbiddenError.mjs +5 -1
  137. package/dist/esm/api/resources/commons/errors/InternalServerError.mjs +5 -1
  138. package/dist/esm/api/resources/commons/errors/InvalidRequest.mjs +5 -1
  139. package/dist/esm/api/resources/commons/errors/UnauthorizedError.mjs +5 -1
  140. package/dist/esm/api/resources/commons/exports.d.mts +1 -0
  141. package/dist/esm/api/resources/commons/exports.mjs +2 -0
  142. package/dist/esm/api/resources/commons/types/ErrorObject.d.mts +2 -2
  143. package/dist/esm/api/resources/commons/types/ErrorSource.d.mts +3 -3
  144. package/dist/esm/api/resources/commons/types/Links.d.mts +2 -2
  145. package/dist/esm/api/resources/files/client/Client.d.mts +1 -2
  146. package/dist/esm/api/resources/files/client/Client.mjs +11 -47
  147. package/dist/esm/api/resources/files/exports.d.mts +2 -0
  148. package/dist/esm/api/resources/files/exports.mjs +3 -0
  149. package/dist/esm/api/resources/notifications/client/Client.d.mts +1 -2
  150. package/dist/esm/api/resources/notifications/exports.d.mts +3 -0
  151. package/dist/esm/api/resources/notifications/exports.mjs +4 -0
  152. package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.d.mts +1 -2
  153. package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +7 -64
  154. package/dist/esm/api/resources/notifications/resources/subscriptions/exports.d.mts +2 -0
  155. package/dist/esm/api/resources/notifications/resources/subscriptions/exports.mjs +3 -0
  156. package/dist/esm/api/resources/notifications/resources/subscriptions/types/UpdateSubscriptionRequestAttributes.d.mts +3 -3
  157. package/dist/esm/api/resources/notifications/types/AuditUpdateAttributes.d.mts +3 -3
  158. package/dist/esm/api/resources/notifications/types/FailedTransactionAttributes.d.mts +1 -1
  159. package/dist/esm/api/resources/notifications/types/NotificationPayload.d.mts +2 -2
  160. package/dist/esm/api/resources/notifications/types/RewardNotificationAttributes.d.mts +2 -2
  161. package/dist/esm/api/resources/ping/client/Client.d.mts +1 -2
  162. package/dist/esm/api/resources/ping/client/Client.mjs +2 -20
  163. package/dist/esm/api/resources/ping/errors/NetworkBlockedError.mjs +5 -1
  164. package/dist/esm/api/resources/ping/exports.d.mts +2 -0
  165. package/dist/esm/api/resources/ping/exports.mjs +3 -0
  166. package/dist/esm/api/resources/transactions/client/Client.d.mts +3 -3
  167. package/dist/esm/api/resources/transactions/client/Client.mjs +15 -112
  168. package/dist/esm/api/resources/transactions/client/requests/GetEarnedRewardsRequest.d.mts +4 -1
  169. package/dist/esm/api/resources/transactions/errors/CreateAuditMultiStatus.mjs +5 -1
  170. package/dist/esm/api/resources/transactions/errors/CreateIncomingTransactionsMultiStatus.mjs +5 -1
  171. package/dist/esm/api/resources/transactions/errors/FraudMultiStatus.mjs +5 -1
  172. package/dist/esm/api/resources/transactions/exports.d.mts +2 -0
  173. package/dist/esm/api/resources/transactions/exports.mjs +3 -0
  174. package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +3 -3
  175. package/dist/esm/api/resources/transactions/types/CreateAuditMultiStatusResponse.d.mts +1 -1
  176. package/dist/esm/api/resources/transactions/types/GetEarnedRewardsResponse.d.mts +1 -1
  177. package/dist/esm/api/resources/transactions/types/MatchedTransactionsAttributes.d.mts +14 -14
  178. package/dist/esm/api/resources/transactions/types/Merchant.d.mts +9 -9
  179. package/dist/esm/api/resources/transactions/types/RewardedTransactionAttributes.d.mts +3 -3
  180. package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +18 -18
  181. package/dist/esm/api/resources/users/client/Client.d.mts +1 -2
  182. package/dist/esm/api/resources/users/client/Client.mjs +5 -80
  183. package/dist/esm/api/resources/users/errors/MultiStatus.mjs +5 -1
  184. package/dist/esm/api/resources/users/exports.d.mts +3 -0
  185. package/dist/esm/api/resources/users/exports.mjs +4 -0
  186. package/dist/esm/api/resources/users/resources/attributions/client/Client.d.mts +1 -2
  187. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +20 -94
  188. package/dist/esm/api/resources/users/resources/attributions/exports.d.mts +2 -0
  189. package/dist/esm/api/resources/users/resources/attributions/exports.mjs +3 -0
  190. package/dist/esm/api/resources/users/resources/attributions/types/ActivateOfferResponse.d.mts +1 -1
  191. package/dist/esm/api/resources/users/resources/attributions/types/AttributionState.d.mts +2 -2
  192. package/dist/esm/api/resources/users/resources/attributions/types/BoostOfferResponse.d.mts +1 -1
  193. package/dist/esm/api/resources/users/resources/attributions/types/NotificationAttributionAttributes.d.mts +1 -1
  194. package/dist/esm/api/resources/users/resources/attributions/types/OfferAttributionAttributes.d.mts +1 -1
  195. package/dist/esm/api/resources/users/resources/auth/client/Client.d.mts +1 -2
  196. package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +2 -20
  197. package/dist/esm/api/resources/users/resources/auth/exports.d.mts +2 -0
  198. package/dist/esm/api/resources/users/resources/auth/exports.mjs +3 -0
  199. package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +1 -2
  200. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +39 -144
  201. package/dist/esm/api/resources/users/resources/rewards/exports.d.mts +2 -0
  202. package/dist/esm/api/resources/users/resources/rewards/exports.mjs +3 -0
  203. package/dist/esm/api/resources/users/resources/rewards/types/CtaComponent.d.mts +2 -2
  204. package/dist/esm/api/resources/users/resources/rewards/types/LocationData.d.mts +1 -1
  205. package/dist/esm/api/resources/users/resources/rewards/types/LocationsResponseObject.d.mts +1 -1
  206. package/dist/esm/api/resources/users/resources/rewards/types/LogoFlare.d.mts +1 -1
  207. package/dist/esm/api/resources/users/resources/rewards/types/OfferCommonFields.d.mts +8 -8
  208. package/dist/esm/api/resources/users/resources/rewards/types/OfferComponents.d.mts +9 -9
  209. package/dist/esm/api/resources/users/resources/rewards/types/OffersMeta.d.mts +1 -1
  210. package/dist/esm/api/resources/users/resources/rewards/types/OffersResponseObject.d.mts +2 -2
  211. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBar.d.mts +1 -1
  212. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarLabelPair.d.mts +2 -2
  213. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarLabels.d.mts +1 -1
  214. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarSegment.d.mts +1 -1
  215. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBarSegments.d.mts +1 -1
  216. package/dist/esm/api/resources/users/resources/rewards/types/StandardOffer.d.mts +1 -1
  217. package/dist/esm/api/resources/users/resources/uploads/client/Client.d.mts +1 -2
  218. package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +4 -60
  219. package/dist/esm/api/resources/users/resources/uploads/errors/UploadPartMultiStatus.mjs +5 -1
  220. package/dist/esm/api/resources/users/resources/uploads/exports.d.mts +2 -0
  221. package/dist/esm/api/resources/users/resources/uploads/exports.mjs +3 -0
  222. package/dist/esm/api/resources/users/resources/uploads/types/CreateUploadPartMultiStatusResponse.d.mts +1 -1
  223. package/dist/esm/api/resources/users/types/CreateUsersMultiStatusResponse.d.mts +1 -1
  224. package/dist/esm/api/resources/users/types/UpdateUserRequestAttributes.d.mts +5 -5
  225. package/dist/esm/api/resources/users/types/UserRequestAttributes.d.mts +6 -6
  226. package/dist/esm/auth/OAuthAuthProvider.d.mts +36 -14
  227. package/dist/esm/auth/OAuthAuthProvider.mjs +106 -39
  228. package/dist/esm/core/auth/BasicAuth.d.mts +2 -2
  229. package/dist/esm/core/auth/BasicAuth.mjs +7 -1
  230. package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
  231. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  232. package/dist/esm/core/fetcher/Fetcher.d.mts +3 -2
  233. package/dist/esm/core/fetcher/Fetcher.mjs +12 -2
  234. package/dist/esm/core/fetcher/index.d.mts +2 -0
  235. package/dist/esm/core/fetcher/index.mjs +1 -0
  236. package/dist/esm/core/fetcher/makePassthroughRequest.d.mts +49 -0
  237. package/dist/esm/core/fetcher/makePassthroughRequest.mjs +132 -0
  238. package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
  239. package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
  240. package/dist/esm/core/headers.d.mts +2 -2
  241. package/dist/esm/core/runtime/runtime.mjs +8 -7
  242. package/dist/esm/errors/KardApiError.d.mts +3 -1
  243. package/dist/esm/errors/KardApiError.mjs +9 -2
  244. package/dist/esm/errors/KardApiTimeoutError.d.mts +4 -1
  245. package/dist/esm/errors/KardApiTimeoutError.mjs +9 -2
  246. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  247. package/dist/esm/errors/handleNonStatusCodeError.mjs +32 -0
  248. package/dist/esm/version.d.mts +1 -1
  249. package/dist/esm/version.mjs +1 -1
  250. package/package.json +134 -10
  251. package/reference.md +3 -1
@@ -48,6 +48,7 @@ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
48
  const headers_js_1 = require("../../../../../../core/headers.js");
49
49
  const core = __importStar(require("../../../../../../core/index.js"));
50
50
  const environments = __importStar(require("../../../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
51
52
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
53
  const KardApi = __importStar(require("../../../../../index.js"));
53
54
  class AuthClient {
@@ -103,26 +104,7 @@ class AuthClient {
103
104
  });
104
105
  }
105
106
  }
106
- switch (_response.error.reason) {
107
- case "non-json":
108
- throw new errors.KardApiError({
109
- statusCode: _response.error.statusCode,
110
- body: _response.error.rawBody,
111
- rawResponse: _response.rawResponse,
112
- });
113
- case "body-is-null":
114
- throw new errors.KardApiError({
115
- statusCode: _response.error.statusCode,
116
- rawResponse: _response.rawResponse,
117
- });
118
- case "timeout":
119
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/auth/issuers/{organizationId}/users/{userId}/token.");
120
- case "unknown":
121
- throw new errors.KardApiError({
122
- message: _response.error.errorMessage,
123
- rawResponse: _response.rawResponse,
124
- });
125
- }
107
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/auth/issuers/{organizationId}/users/{userId}/token");
126
108
  });
127
109
  }
128
110
  }
@@ -0,0 +1,2 @@
1
+ export { AuthClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.AuthClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "AuthClient", { enumerable: true, get: function () { return Client_js_1.AuthClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as KardApi from "../../../../../index.js";
5
5
  export declare namespace RewardsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -49,6 +49,7 @@ const headers_js_1 = require("../../../../../../core/headers.js");
49
49
  const core = __importStar(require("../../../../../../core/index.js"));
50
50
  const json_js_1 = require("../../../../../../core/json.js");
51
51
  const environments = __importStar(require("../../../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
52
53
  const errors = __importStar(require("../../../../../../errors/index.js"));
53
54
  const KardApi = __importStar(require("../../../../../index.js"));
54
55
  class RewardsClient {
@@ -85,52 +86,22 @@ class RewardsClient {
85
86
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
86
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
87
88
  const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[search]": filterSearch, "filter[purchaseChannel]": filterPurchaseChannel, "filter[category]": filterCategory, "filter[isTargeted]": filterIsTargeted, sort, include, supportedComponents, } = request;
88
- const _queryParams = {};
89
- if (pageSize != null) {
90
- _queryParams["page[size]"] = pageSize.toString();
91
- }
92
- if (pageAfter != null) {
93
- _queryParams["page[after]"] = pageAfter;
94
- }
95
- if (pageBefore != null) {
96
- _queryParams["page[before]"] = pageBefore;
97
- }
98
- if (filterSearch != null) {
99
- _queryParams["filter[search]"] = filterSearch;
100
- }
101
- if (filterPurchaseChannel != null) {
102
- _queryParams["filter[purchaseChannel]"] = (0, json_js_1.toJson)(filterPurchaseChannel);
103
- }
104
- if (filterCategory != null) {
105
- _queryParams["filter[category]"] = filterCategory;
106
- }
107
- if (filterIsTargeted != null) {
108
- _queryParams["filter[isTargeted]"] = filterIsTargeted.toString();
109
- }
110
- if (sort != null) {
111
- if (Array.isArray(sort)) {
112
- _queryParams.sort = sort.map((item) => item);
113
- }
114
- else {
115
- _queryParams.sort = sort;
116
- }
117
- }
118
- if (include != null) {
119
- if (Array.isArray(include)) {
120
- _queryParams.include = include.map((item) => item);
121
- }
122
- else {
123
- _queryParams.include = include;
124
- }
125
- }
126
- if (supportedComponents != null) {
127
- if (Array.isArray(supportedComponents)) {
128
- _queryParams.supportedComponents = supportedComponents.map((item) => item);
129
- }
130
- else {
131
- _queryParams.supportedComponents = supportedComponents;
132
- }
133
- }
89
+ const _queryParams = {
90
+ "page[size]": pageSize,
91
+ "page[after]": pageAfter,
92
+ "page[before]": pageBefore,
93
+ "filter[search]": filterSearch,
94
+ "filter[purchaseChannel]": filterPurchaseChannel != null ? (0, json_js_1.toJson)(filterPurchaseChannel) : undefined,
95
+ "filter[category]": filterCategory != null ? filterCategory : undefined,
96
+ "filter[isTargeted]": filterIsTargeted,
97
+ sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
98
+ include,
99
+ supportedComponents: Array.isArray(supportedComponents)
100
+ ? supportedComponents.map((item) => item)
101
+ : supportedComponents != null
102
+ ? supportedComponents
103
+ : undefined,
104
+ };
134
105
  const _authRequest = yield this._options.authProvider.getAuthRequest();
135
106
  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);
136
107
  const _response = yield core.fetcher({
@@ -165,26 +136,7 @@ class RewardsClient {
165
136
  });
166
137
  }
167
138
  }
168
- switch (_response.error.reason) {
169
- case "non-json":
170
- throw new errors.KardApiError({
171
- statusCode: _response.error.statusCode,
172
- body: _response.error.rawBody,
173
- rawResponse: _response.rawResponse,
174
- });
175
- case "body-is-null":
176
- throw new errors.KardApiError({
177
- statusCode: _response.error.statusCode,
178
- rawResponse: _response.rawResponse,
179
- });
180
- case "timeout":
181
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/users/{userId}/offers.");
182
- case "unknown":
183
- throw new errors.KardApiError({
184
- message: _response.error.errorMessage,
185
- rawResponse: _response.rawResponse,
186
- });
187
- }
139
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/offers");
188
140
  });
189
141
  }
190
142
  /**
@@ -221,64 +173,26 @@ class RewardsClient {
221
173
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
222
174
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
223
175
  const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[name]": filterName, "filter[city]": filterCity, "filter[zipCode]": filterZipCode, "filter[state]": filterState, "filter[category]": filterCategory, "filter[longitude]": filterLongitude, "filter[latitude]": filterLatitude, "filter[radius]": filterRadius, sort, include, supportedComponents, } = request;
224
- const _queryParams = {};
225
- if (pageSize != null) {
226
- _queryParams["page[size]"] = pageSize.toString();
227
- }
228
- if (pageAfter != null) {
229
- _queryParams["page[after]"] = pageAfter;
230
- }
231
- if (pageBefore != null) {
232
- _queryParams["page[before]"] = pageBefore;
233
- }
234
- if (filterName != null) {
235
- _queryParams["filter[name]"] = filterName;
236
- }
237
- if (filterCity != null) {
238
- _queryParams["filter[city]"] = filterCity;
239
- }
240
- if (filterZipCode != null) {
241
- _queryParams["filter[zipCode]"] = filterZipCode;
242
- }
243
- if (filterState != null) {
244
- _queryParams["filter[state]"] = filterState;
245
- }
246
- if (filterCategory != null) {
247
- _queryParams["filter[category]"] = filterCategory;
248
- }
249
- if (filterLongitude != null) {
250
- _queryParams["filter[longitude]"] = filterLongitude.toString();
251
- }
252
- if (filterLatitude != null) {
253
- _queryParams["filter[latitude]"] = filterLatitude.toString();
254
- }
255
- if (filterRadius != null) {
256
- _queryParams["filter[radius]"] = filterRadius.toString();
257
- }
258
- if (sort != null) {
259
- if (Array.isArray(sort)) {
260
- _queryParams.sort = sort.map((item) => item);
261
- }
262
- else {
263
- _queryParams.sort = sort;
264
- }
265
- }
266
- if (include != null) {
267
- if (Array.isArray(include)) {
268
- _queryParams.include = include.map((item) => item);
269
- }
270
- else {
271
- _queryParams.include = include;
272
- }
273
- }
274
- if (supportedComponents != null) {
275
- if (Array.isArray(supportedComponents)) {
276
- _queryParams.supportedComponents = supportedComponents.map((item) => item);
277
- }
278
- else {
279
- _queryParams.supportedComponents = supportedComponents;
280
- }
281
- }
176
+ const _queryParams = {
177
+ "page[size]": pageSize,
178
+ "page[after]": pageAfter,
179
+ "page[before]": pageBefore,
180
+ "filter[name]": filterName,
181
+ "filter[city]": filterCity,
182
+ "filter[zipCode]": filterZipCode,
183
+ "filter[state]": filterState != null ? filterState : undefined,
184
+ "filter[category]": filterCategory != null ? filterCategory : undefined,
185
+ "filter[longitude]": filterLongitude,
186
+ "filter[latitude]": filterLatitude,
187
+ "filter[radius]": filterRadius,
188
+ sort: Array.isArray(sort) ? sort.map((item) => item) : sort != null ? sort : undefined,
189
+ include,
190
+ supportedComponents: Array.isArray(supportedComponents)
191
+ ? supportedComponents.map((item) => item)
192
+ : supportedComponents != null
193
+ ? supportedComponents
194
+ : undefined,
195
+ };
282
196
  const _authRequest = yield this._options.authProvider.getAuthRequest();
283
197
  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);
284
198
  const _response = yield core.fetcher({
@@ -316,26 +230,7 @@ class RewardsClient {
316
230
  });
317
231
  }
318
232
  }
319
- switch (_response.error.reason) {
320
- case "non-json":
321
- throw new errors.KardApiError({
322
- statusCode: _response.error.statusCode,
323
- body: _response.error.rawBody,
324
- rawResponse: _response.rawResponse,
325
- });
326
- case "body-is-null":
327
- throw new errors.KardApiError({
328
- statusCode: _response.error.statusCode,
329
- rawResponse: _response.rawResponse,
330
- });
331
- case "timeout":
332
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling GET /v2/issuers/{organizationId}/users/{userId}/locations.");
333
- case "unknown":
334
- throw new errors.KardApiError({
335
- message: _response.error.errorMessage,
336
- rawResponse: _response.rawResponse,
337
- });
338
- }
233
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/locations");
339
234
  });
340
235
  }
341
236
  }
@@ -0,0 +1,2 @@
1
+ export { RewardsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RewardsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "RewardsClient", { enumerable: true, get: function () { return Client_js_1.RewardsClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -8,7 +8,7 @@ export interface CtaComponent {
8
8
  /** Style of the button */
9
9
  buttonStyle: KardApi.users.ButtonStyle;
10
10
  /** Action to perform when the button is clicked */
11
- action?: KardApi.users.CtaAction;
11
+ action?: KardApi.users.CtaAction | undefined;
12
12
  /** Icon identifier to display on the button */
13
- startIcon?: string;
13
+ startIcon?: string | undefined;
14
14
  }
@@ -5,5 +5,5 @@ export interface LocationData {
5
5
  id: KardApi.MongoId;
6
6
  attributes: KardApi.users.LocationAttributes;
7
7
  /** Related resources to the offer */
8
- relationships?: KardApi.users.LocationRelationships;
8
+ relationships?: KardApi.users.LocationRelationships | undefined;
9
9
  }
@@ -142,5 +142,5 @@ import type * as KardApi from "../../../../../index.js";
142
142
  export interface LocationsResponseObject {
143
143
  data: KardApi.users.LocationData[];
144
144
  links: KardApi.Links;
145
- included?: KardApi.users.EligibilityLocationIncluded[];
145
+ included?: KardApi.users.EligibilityLocationIncluded[] | undefined;
146
146
  }
@@ -6,5 +6,5 @@ export interface LogoFlare {
6
6
  /** Border color style for the logo flare */
7
7
  borderColor: KardApi.users.LogoFlareBorderColor;
8
8
  /** Optional badge to display on the logo */
9
- badge?: KardApi.users.LogoFlareBadge;
9
+ badge?: KardApi.users.LogoFlareBadge | undefined;
10
10
  }
@@ -3,7 +3,7 @@ export interface OfferCommonFields {
3
3
  /** Terms and conditions on offer */
4
4
  terms: string;
5
5
  /** Maximum times cardholder can redeem offer, if applicable */
6
- maxRedemptions?: number;
6
+ maxRedemptions?: number | undefined;
7
7
  /** Name of offer */
8
8
  name: string;
9
9
  purchaseChannel: KardApi.PurchaseChannel[];
@@ -17,17 +17,17 @@ export interface OfferCommonFields {
17
17
  /** True returns only targeted offers, false returns only non-targeted offers */
18
18
  isTargeted: boolean;
19
19
  /** Minimum Transaction Amount required to redeem offer, if available on offer */
20
- minTransactionAmount?: KardApi.users.Amount;
20
+ minTransactionAmount?: KardApi.users.Amount | undefined;
21
21
  /** Maximum Transaction Amount allowed to redeem offer, if available on offer */
22
- maxTransactionAmount?: KardApi.users.Amount;
22
+ maxTransactionAmount?: KardApi.users.Amount | undefined;
23
23
  /** Minimum Reward Amount, if available on offer */
24
- minRewardAmount?: KardApi.users.Amount;
24
+ minRewardAmount?: KardApi.users.Amount | undefined;
25
25
  /** Maximum Reward Amount, if available on offer */
26
- maxRewardAmount?: KardApi.users.Amount;
26
+ maxRewardAmount?: KardApi.users.Amount | undefined;
27
27
  /** URL to the website of the offer provider */
28
- websiteUrl?: string;
28
+ websiteUrl?: string | undefined;
29
29
  /** Description of the offer */
30
- description?: string;
30
+ description?: string | undefined;
31
31
  /** UI component data for the offer, returned when supportedComponents query parameter is provided */
32
- components?: KardApi.users.OfferComponents;
32
+ components?: KardApi.users.OfferComponents | undefined;
33
33
  }
@@ -4,21 +4,21 @@ import type * as KardApi from "../../../../../index.js";
4
4
  */
5
5
  export interface OfferComponents {
6
6
  /** Short description for the offer */
7
- shortDescription?: string;
7
+ shortDescription?: string | undefined;
8
8
  /** Long description for the offer */
9
- longDescription?: string;
9
+ longDescription?: string | undefined;
10
10
  /** Formatted reward string */
11
- baseReward?: string;
11
+ baseReward?: string | undefined;
12
12
  /** Formatted boosted reward string */
13
- boostedReward?: string;
13
+ boostedReward?: string | undefined;
14
14
  /** Call-to-action button component */
15
- cta?: KardApi.users.CtaComponent;
15
+ cta?: KardApi.users.CtaComponent | undefined;
16
16
  /** Tags for the offer */
17
- tags?: string[];
17
+ tags?: string[] | undefined;
18
18
  /** Detail tags for the offer */
19
- detailTags?: string[];
19
+ detailTags?: string[] | undefined;
20
20
  /** Logo flare configuration for the offer */
21
- logoFlare?: KardApi.users.LogoFlare;
21
+ logoFlare?: KardApi.users.LogoFlare | undefined;
22
22
  /** Progress bar component for tracking offer redemptions */
23
- progressBar?: KardApi.users.ProgressBar;
23
+ progressBar?: KardApi.users.ProgressBar | undefined;
24
24
  }
@@ -4,5 +4,5 @@ import type * as KardApi from "../../../../../index.js";
4
4
  */
5
5
  export interface OffersMeta {
6
6
  /** All distinct categories available across the entire filtered result set, not just the current page */
7
- availableCategories?: KardApi.users.CategoryIncluded[];
7
+ availableCategories?: KardApi.users.CategoryIncluded[] | undefined;
8
8
  }
@@ -94,6 +94,6 @@ import type * as KardApi from "../../../../../index.js";
94
94
  export interface OffersResponseObject {
95
95
  data: KardApi.users.OfferDataUnion[];
96
96
  links: KardApi.Links;
97
- included?: KardApi.users.EligibilityOfferIncluded[];
98
- meta?: KardApi.users.OffersMeta;
97
+ included?: KardApi.users.EligibilityOfferIncluded[] | undefined;
98
+ meta?: KardApi.users.OffersMeta | undefined;
99
99
  }
@@ -12,7 +12,7 @@ export interface ProgressBar {
12
12
  /** Whether the progress bar should be displayed as segmented */
13
13
  segmented: boolean;
14
14
  /** Segment configuration for the progress bar in different layouts */
15
- segments?: KardApi.users.ProgressBarSegments;
15
+ segments?: KardApi.users.ProgressBarSegments | undefined;
16
16
  /** Labels to render around the progress bar in different layouts */
17
17
  labels: KardApi.users.ProgressBarLabels;
18
18
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export interface ProgressBarLabelPair {
5
5
  /** Text content for the left label */
6
- left?: string;
6
+ left?: string | undefined;
7
7
  /** Text content for the right label */
8
- right?: string;
8
+ right?: string | undefined;
9
9
  }
@@ -4,7 +4,7 @@ import type * as KardApi from "../../../../../index.js";
4
4
  */
5
5
  export interface ProgressBarLabels {
6
6
  /** Label configuration for the details view */
7
- details?: KardApi.users.ProgressBarLabelPair;
7
+ details?: KardApi.users.ProgressBarLabelPair | undefined;
8
8
  /** Label configuration for the default view */
9
9
  default: KardApi.users.ProgressBarLabelPair;
10
10
  }
@@ -4,7 +4,7 @@ import type * as KardApi from "../../../../../index.js";
4
4
  */
5
5
  export interface ProgressBarSegment {
6
6
  /** SVG icon to use for each segment */
7
- icon?: string;
7
+ icon?: string | undefined;
8
8
  /** Position of the segment within the layout */
9
9
  position: KardApi.users.ProgressBarSegmentPosition;
10
10
  }
@@ -4,7 +4,7 @@ import type * as KardApi from "../../../../../index.js";
4
4
  */
5
5
  export interface ProgressBarSegments {
6
6
  /** Segment configuration for the details view */
7
- details?: KardApi.users.ProgressBarSegment;
7
+ details?: KardApi.users.ProgressBarSegment | undefined;
8
8
  /** Segment configuration for the default view */
9
9
  default: KardApi.users.ProgressBarSegment;
10
10
  }
@@ -1,4 +1,4 @@
1
1
  import type * as KardApi from "../../../../../index.js";
2
2
  export interface StandardOffer extends KardApi.users.StandardOfferCore {
3
- relationships?: KardApi.users.EligibilityOfferRelationship;
3
+ relationships?: KardApi.users.EligibilityOfferRelationship | undefined;
4
4
  }
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
3
3
  import * as core from "../../../../../../core/index.js";
4
4
  import * as KardApi from "../../../../../index.js";
5
5
  export declare namespace UploadsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -48,6 +48,7 @@ const BaseClient_js_1 = require("../../../../../../BaseClient.js");
48
48
  const headers_js_1 = require("../../../../../../core/headers.js");
49
49
  const core = __importStar(require("../../../../../../core/index.js"));
50
50
  const environments = __importStar(require("../../../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../../../errors/handleNonStatusCodeError.js");
51
52
  const errors = __importStar(require("../../../../../../errors/index.js"));
52
53
  const KardApi = __importStar(require("../../../../../index.js"));
53
54
  class UploadsClient {
@@ -120,26 +121,7 @@ class UploadsClient {
120
121
  });
121
122
  }
122
123
  }
123
- switch (_response.error.reason) {
124
- case "non-json":
125
- throw new errors.KardApiError({
126
- statusCode: _response.error.statusCode,
127
- body: _response.error.rawBody,
128
- rawResponse: _response.rawResponse,
129
- });
130
- case "body-is-null":
131
- throw new errors.KardApiError({
132
- statusCode: _response.error.statusCode,
133
- rawResponse: _response.rawResponse,
134
- });
135
- case "timeout":
136
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling POST /v2/issuers/{organizationId}/users/{userId}/uploads.");
137
- case "unknown":
138
- throw new errors.KardApiError({
139
- message: _response.error.errorMessage,
140
- rawResponse: _response.rawResponse,
141
- });
142
- }
124
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v2/issuers/{organizationId}/users/{userId}/uploads");
143
125
  });
144
126
  }
145
127
  /**
@@ -244,26 +226,7 @@ class UploadsClient {
244
226
  });
245
227
  }
246
228
  }
247
- switch (_response.error.reason) {
248
- case "non-json":
249
- throw new errors.KardApiError({
250
- statusCode: _response.error.statusCode,
251
- body: _response.error.rawBody,
252
- rawResponse: _response.rawResponse,
253
- });
254
- case "body-is-null":
255
- throw new errors.KardApiError({
256
- statusCode: _response.error.statusCode,
257
- rawResponse: _response.rawResponse,
258
- });
259
- case "timeout":
260
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling PUT /v2/issuers/{organizationId}/users/{userId}/uploads/{uploadId}/parts.");
261
- case "unknown":
262
- throw new errors.KardApiError({
263
- message: _response.error.errorMessage,
264
- rawResponse: _response.rawResponse,
265
- });
266
- }
229
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v2/issuers/{organizationId}/users/{userId}/uploads/{uploadId}/parts");
267
230
  });
268
231
  }
269
232
  /**
@@ -336,26 +299,7 @@ class UploadsClient {
336
299
  });
337
300
  }
338
301
  }
339
- switch (_response.error.reason) {
340
- case "non-json":
341
- throw new errors.KardApiError({
342
- statusCode: _response.error.statusCode,
343
- body: _response.error.rawBody,
344
- rawResponse: _response.rawResponse,
345
- });
346
- case "body-is-null":
347
- throw new errors.KardApiError({
348
- statusCode: _response.error.statusCode,
349
- rawResponse: _response.rawResponse,
350
- });
351
- case "timeout":
352
- throw new errors.KardApiTimeoutError("Timeout exceeded when calling PUT /v2/issuers/{organizationId}/users/{userId}/uploads/{uploadId}.");
353
- case "unknown":
354
- throw new errors.KardApiError({
355
- message: _response.error.errorMessage,
356
- rawResponse: _response.rawResponse,
357
- });
358
- }
302
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/v2/issuers/{organizationId}/users/{userId}/uploads/{uploadId}");
359
303
  });
360
304
  }
361
305
  }
@@ -44,7 +44,11 @@ class UploadPartMultiStatus extends errors.KardApiError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, UploadPartMultiStatus.prototype);
47
+ Object.setPrototypeOf(this, new.target.prototype);
48
+ if (Error.captureStackTrace) {
49
+ Error.captureStackTrace(this, this.constructor);
50
+ }
51
+ this.name = this.constructor.name;
48
52
  }
49
53
  }
50
54
  exports.UploadPartMultiStatus = UploadPartMultiStatus;
@@ -0,0 +1,2 @@
1
+ export { UploadsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";