@tolt/api 0.1.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 (484) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +2 -0
  3. package/README.md +39 -0
  4. package/dist/BaseClient.d.ts +54 -0
  5. package/dist/BaseClient.js +43 -0
  6. package/dist/Client.d.ts +56 -0
  7. package/dist/Client.js +73 -0
  8. package/dist/api/errors/BadRequestError.d.ts +7 -0
  9. package/dist/api/errors/BadRequestError.js +17 -0
  10. package/dist/api/errors/ConflictError.d.ts +7 -0
  11. package/dist/api/errors/ConflictError.js +17 -0
  12. package/dist/api/errors/NotFoundError.d.ts +7 -0
  13. package/dist/api/errors/NotFoundError.js +17 -0
  14. package/dist/api/errors/UnauthorizedError.d.ts +7 -0
  15. package/dist/api/errors/UnauthorizedError.js +17 -0
  16. package/dist/api/errors/index.d.ts +4 -0
  17. package/dist/api/errors/index.js +4 -0
  18. package/dist/api/index.d.ts +3 -0
  19. package/dist/api/index.js +3 -0
  20. package/dist/api/resources/clicks/client/Client.d.ts +43 -0
  21. package/dist/api/resources/clicks/client/Client.js +132 -0
  22. package/dist/api/resources/clicks/client/index.d.ts +1 -0
  23. package/dist/api/resources/clicks/client/index.js +1 -0
  24. package/dist/api/resources/clicks/client/requests/GetClickRequest.d.ts +9 -0
  25. package/dist/api/resources/clicks/client/requests/GetClickRequest.js +2 -0
  26. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +16 -0
  27. package/dist/api/resources/clicks/client/requests/ListClicksRequest.js +2 -0
  28. package/dist/api/resources/clicks/client/requests/index.d.ts +2 -0
  29. package/dist/api/resources/clicks/client/requests/index.js +1 -0
  30. package/dist/api/resources/clicks/exports.d.ts +2 -0
  31. package/dist/api/resources/clicks/exports.js +3 -0
  32. package/dist/api/resources/clicks/index.d.ts +2 -0
  33. package/dist/api/resources/clicks/index.js +2 -0
  34. package/dist/api/resources/clicks/types/GetClickResponse.d.ts +6 -0
  35. package/dist/api/resources/clicks/types/GetClickResponse.js +2 -0
  36. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +5 -0
  37. package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +5 -0
  38. package/dist/api/resources/clicks/types/ListClicksResponse.d.ts +7 -0
  39. package/dist/api/resources/clicks/types/ListClicksResponse.js +2 -0
  40. package/dist/api/resources/clicks/types/index.d.ts +3 -0
  41. package/dist/api/resources/clicks/types/index.js +3 -0
  42. package/dist/api/resources/commissions/client/Client.d.ts +132 -0
  43. package/dist/api/resources/commissions/client/Client.js +431 -0
  44. package/dist/api/resources/commissions/client/index.d.ts +1 -0
  45. package/dist/api/resources/commissions/client/index.js +1 -0
  46. package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.d.ts +9 -0
  47. package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.js +2 -0
  48. package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.d.ts +9 -0
  49. package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.js +2 -0
  50. package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.d.ts +9 -0
  51. package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.js +2 -0
  52. package/dist/api/resources/commissions/client/requests/GetCommissionRequest.d.ts +9 -0
  53. package/dist/api/resources/commissions/client/requests/GetCommissionRequest.js +2 -0
  54. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +17 -0
  55. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.js +2 -0
  56. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +18 -0
  57. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +2 -0
  58. package/dist/api/resources/commissions/client/requests/index.d.ts +6 -0
  59. package/dist/api/resources/commissions/client/requests/index.js +1 -0
  60. package/dist/api/resources/commissions/exports.d.ts +2 -0
  61. package/dist/api/resources/commissions/exports.js +3 -0
  62. package/dist/api/resources/commissions/index.d.ts +2 -0
  63. package/dist/api/resources/commissions/index.js +2 -0
  64. package/dist/api/resources/commissions/types/ApproveCommissionResponse.d.ts +6 -0
  65. package/dist/api/resources/commissions/types/ApproveCommissionResponse.js +2 -0
  66. package/dist/api/resources/commissions/types/CreateCommissionRequest.d.ts +1 -0
  67. package/dist/api/resources/commissions/types/CreateCommissionRequest.js +2 -0
  68. package/dist/api/resources/commissions/types/CreateCommissionResponse.d.ts +6 -0
  69. package/dist/api/resources/commissions/types/CreateCommissionResponse.js +2 -0
  70. package/dist/api/resources/commissions/types/DeclineCommissionResponse.d.ts +6 -0
  71. package/dist/api/resources/commissions/types/DeclineCommissionResponse.js +2 -0
  72. package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
  73. package/dist/api/resources/commissions/types/DeleteCommissionResponse.js +2 -0
  74. package/dist/api/resources/commissions/types/GetCommissionResponse.d.ts +6 -0
  75. package/dist/api/resources/commissions/types/GetCommissionResponse.js +2 -0
  76. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +5 -0
  77. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +5 -0
  78. package/dist/api/resources/commissions/types/ListCommissionsResponse.d.ts +7 -0
  79. package/dist/api/resources/commissions/types/ListCommissionsResponse.js +2 -0
  80. package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
  81. package/dist/api/resources/commissions/types/UpdateCommissionResponse.js +2 -0
  82. package/dist/api/resources/commissions/types/index.d.ts +9 -0
  83. package/dist/api/resources/commissions/types/index.js +9 -0
  84. package/dist/api/resources/customers/client/Client.d.ts +92 -0
  85. package/dist/api/resources/customers/client/Client.js +299 -0
  86. package/dist/api/resources/customers/client/index.d.ts +1 -0
  87. package/dist/api/resources/customers/client/index.js +1 -0
  88. package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.d.ts +9 -0
  89. package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.js +2 -0
  90. package/dist/api/resources/customers/client/requests/GetCustomerRequest.d.ts +9 -0
  91. package/dist/api/resources/customers/client/requests/GetCustomerRequest.js +2 -0
  92. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +15 -0
  93. package/dist/api/resources/customers/client/requests/ListCustomersRequest.js +2 -0
  94. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +18 -0
  95. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.js +2 -0
  96. package/dist/api/resources/customers/client/requests/index.d.ts +4 -0
  97. package/dist/api/resources/customers/client/requests/index.js +1 -0
  98. package/dist/api/resources/customers/exports.d.ts +2 -0
  99. package/dist/api/resources/customers/exports.js +3 -0
  100. package/dist/api/resources/customers/index.d.ts +2 -0
  101. package/dist/api/resources/customers/index.js +2 -0
  102. package/dist/api/resources/customers/types/CreateCustomerRequest.d.ts +1 -0
  103. package/dist/api/resources/customers/types/CreateCustomerRequest.js +2 -0
  104. package/dist/api/resources/customers/types/CreateCustomerResponse.d.ts +6 -0
  105. package/dist/api/resources/customers/types/CreateCustomerResponse.js +2 -0
  106. package/dist/api/resources/customers/types/DeleteCustomerResponse.d.ts +6 -0
  107. package/dist/api/resources/customers/types/DeleteCustomerResponse.js +2 -0
  108. package/dist/api/resources/customers/types/GetCustomerResponse.d.ts +6 -0
  109. package/dist/api/resources/customers/types/GetCustomerResponse.js +2 -0
  110. package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +5 -0
  111. package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +5 -0
  112. package/dist/api/resources/customers/types/ListCustomersResponse.d.ts +7 -0
  113. package/dist/api/resources/customers/types/ListCustomersResponse.js +2 -0
  114. package/dist/api/resources/customers/types/UpdateCustomerResponse.d.ts +6 -0
  115. package/dist/api/resources/customers/types/UpdateCustomerResponse.js +2 -0
  116. package/dist/api/resources/customers/types/index.d.ts +7 -0
  117. package/dist/api/resources/customers/types/index.js +7 -0
  118. package/dist/api/resources/flows/client/Client.d.ts +43 -0
  119. package/dist/api/resources/flows/client/Client.js +132 -0
  120. package/dist/api/resources/flows/client/index.d.ts +1 -0
  121. package/dist/api/resources/flows/client/index.js +1 -0
  122. package/dist/api/resources/flows/client/requests/GetFlowRequest.d.ts +9 -0
  123. package/dist/api/resources/flows/client/requests/GetFlowRequest.js +2 -0
  124. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +16 -0
  125. package/dist/api/resources/flows/client/requests/ListFlowsRequest.js +2 -0
  126. package/dist/api/resources/flows/client/requests/index.d.ts +2 -0
  127. package/dist/api/resources/flows/client/requests/index.js +1 -0
  128. package/dist/api/resources/flows/exports.d.ts +2 -0
  129. package/dist/api/resources/flows/exports.js +3 -0
  130. package/dist/api/resources/flows/index.d.ts +2 -0
  131. package/dist/api/resources/flows/index.js +2 -0
  132. package/dist/api/resources/flows/types/GetFlowResponse.d.ts +6 -0
  133. package/dist/api/resources/flows/types/GetFlowResponse.js +2 -0
  134. package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +5 -0
  135. package/dist/api/resources/flows/types/ListFlowsRequestActive.js +5 -0
  136. package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +5 -0
  137. package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +5 -0
  138. package/dist/api/resources/flows/types/ListFlowsResponse.d.ts +7 -0
  139. package/dist/api/resources/flows/types/ListFlowsResponse.js +2 -0
  140. package/dist/api/resources/flows/types/index.d.ts +4 -0
  141. package/dist/api/resources/flows/types/index.js +4 -0
  142. package/dist/api/resources/groups/client/Client.d.ts +43 -0
  143. package/dist/api/resources/groups/client/Client.js +129 -0
  144. package/dist/api/resources/groups/client/index.d.ts +1 -0
  145. package/dist/api/resources/groups/client/index.js +1 -0
  146. package/dist/api/resources/groups/client/requests/GetGroupRequest.d.ts +9 -0
  147. package/dist/api/resources/groups/client/requests/GetGroupRequest.js +2 -0
  148. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +13 -0
  149. package/dist/api/resources/groups/client/requests/ListGroupsRequest.js +2 -0
  150. package/dist/api/resources/groups/client/requests/index.d.ts +2 -0
  151. package/dist/api/resources/groups/client/requests/index.js +1 -0
  152. package/dist/api/resources/groups/exports.d.ts +2 -0
  153. package/dist/api/resources/groups/exports.js +3 -0
  154. package/dist/api/resources/groups/index.d.ts +2 -0
  155. package/dist/api/resources/groups/index.js +2 -0
  156. package/dist/api/resources/groups/types/GetGroupResponse.d.ts +6 -0
  157. package/dist/api/resources/groups/types/GetGroupResponse.js +2 -0
  158. package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +5 -0
  159. package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +5 -0
  160. package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +5 -0
  161. package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +5 -0
  162. package/dist/api/resources/groups/types/ListGroupsResponse.d.ts +7 -0
  163. package/dist/api/resources/groups/types/ListGroupsResponse.js +2 -0
  164. package/dist/api/resources/groups/types/index.d.ts +4 -0
  165. package/dist/api/resources/groups/types/index.js +4 -0
  166. package/dist/api/resources/index.d.ts +33 -0
  167. package/dist/api/resources/index.js +33 -0
  168. package/dist/api/resources/links/client/Client.d.ts +93 -0
  169. package/dist/api/resources/links/client/Client.js +298 -0
  170. package/dist/api/resources/links/client/index.d.ts +1 -0
  171. package/dist/api/resources/links/client/index.js +1 -0
  172. package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +12 -0
  173. package/dist/api/resources/links/client/requests/CreateLinkRequest.js +2 -0
  174. package/dist/api/resources/links/client/requests/DeleteLinkRequest.d.ts +9 -0
  175. package/dist/api/resources/links/client/requests/DeleteLinkRequest.js +2 -0
  176. package/dist/api/resources/links/client/requests/GetLinkRequest.d.ts +9 -0
  177. package/dist/api/resources/links/client/requests/GetLinkRequest.js +2 -0
  178. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +13 -0
  179. package/dist/api/resources/links/client/requests/ListLinksRequest.js +2 -0
  180. package/dist/api/resources/links/client/requests/UpdateLinkRequest.d.ts +11 -0
  181. package/dist/api/resources/links/client/requests/UpdateLinkRequest.js +2 -0
  182. package/dist/api/resources/links/client/requests/index.d.ts +5 -0
  183. package/dist/api/resources/links/client/requests/index.js +1 -0
  184. package/dist/api/resources/links/exports.d.ts +2 -0
  185. package/dist/api/resources/links/exports.js +3 -0
  186. package/dist/api/resources/links/index.d.ts +2 -0
  187. package/dist/api/resources/links/index.js +2 -0
  188. package/dist/api/resources/links/types/CreateLinkResponse.d.ts +6 -0
  189. package/dist/api/resources/links/types/CreateLinkResponse.js +2 -0
  190. package/dist/api/resources/links/types/DeleteLinkResponse.d.ts +6 -0
  191. package/dist/api/resources/links/types/DeleteLinkResponse.js +2 -0
  192. package/dist/api/resources/links/types/GetLinkResponse.d.ts +6 -0
  193. package/dist/api/resources/links/types/GetLinkResponse.js +2 -0
  194. package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +5 -0
  195. package/dist/api/resources/links/types/ListLinksRequestOrder.js +5 -0
  196. package/dist/api/resources/links/types/ListLinksResponse.d.ts +7 -0
  197. package/dist/api/resources/links/types/ListLinksResponse.js +2 -0
  198. package/dist/api/resources/links/types/UpdateLinkResponse.d.ts +6 -0
  199. package/dist/api/resources/links/types/UpdateLinkResponse.js +2 -0
  200. package/dist/api/resources/links/types/index.d.ts +6 -0
  201. package/dist/api/resources/links/types/index.js +6 -0
  202. package/dist/api/resources/partners/client/Client.d.ts +93 -0
  203. package/dist/api/resources/partners/client/Client.js +302 -0
  204. package/dist/api/resources/partners/client/index.d.ts +1 -0
  205. package/dist/api/resources/partners/client/index.js +1 -0
  206. package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.d.ts +9 -0
  207. package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.js +2 -0
  208. package/dist/api/resources/partners/client/requests/GetPartnerRequest.d.ts +9 -0
  209. package/dist/api/resources/partners/client/requests/GetPartnerRequest.js +2 -0
  210. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +14 -0
  211. package/dist/api/resources/partners/client/requests/ListPartnersRequest.js +2 -0
  212. package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +10 -0
  213. package/dist/api/resources/partners/client/requests/RejectPartnerRequest.js +2 -0
  214. package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +10 -0
  215. package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.js +2 -0
  216. package/dist/api/resources/partners/client/requests/index.d.ts +5 -0
  217. package/dist/api/resources/partners/client/requests/index.js +1 -0
  218. package/dist/api/resources/partners/exports.d.ts +2 -0
  219. package/dist/api/resources/partners/exports.js +3 -0
  220. package/dist/api/resources/partners/index.d.ts +2 -0
  221. package/dist/api/resources/partners/index.js +2 -0
  222. package/dist/api/resources/partners/types/ApprovePartnerResponse.d.ts +6 -0
  223. package/dist/api/resources/partners/types/ApprovePartnerResponse.js +2 -0
  224. package/dist/api/resources/partners/types/GetPartnerResponse.d.ts +6 -0
  225. package/dist/api/resources/partners/types/GetPartnerResponse.js +2 -0
  226. package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +5 -0
  227. package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +5 -0
  228. package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +7 -0
  229. package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +7 -0
  230. package/dist/api/resources/partners/types/ListPartnersResponse.d.ts +7 -0
  231. package/dist/api/resources/partners/types/ListPartnersResponse.js +2 -0
  232. package/dist/api/resources/partners/types/RejectPartnerResponse.d.ts +6 -0
  233. package/dist/api/resources/partners/types/RejectPartnerResponse.js +2 -0
  234. package/dist/api/resources/partners/types/SuspendPartnerResponse.d.ts +6 -0
  235. package/dist/api/resources/partners/types/SuspendPartnerResponse.js +2 -0
  236. package/dist/api/resources/partners/types/index.d.ts +7 -0
  237. package/dist/api/resources/partners/types/index.js +7 -0
  238. package/dist/api/resources/programs/client/Client.d.ts +43 -0
  239. package/dist/api/resources/programs/client/Client.js +127 -0
  240. package/dist/api/resources/programs/client/index.d.ts +1 -0
  241. package/dist/api/resources/programs/client/index.js +1 -0
  242. package/dist/api/resources/programs/client/requests/GetProgramRequest.d.ts +9 -0
  243. package/dist/api/resources/programs/client/requests/GetProgramRequest.js +2 -0
  244. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +11 -0
  245. package/dist/api/resources/programs/client/requests/ListProgramsRequest.js +2 -0
  246. package/dist/api/resources/programs/client/requests/index.d.ts +2 -0
  247. package/dist/api/resources/programs/client/requests/index.js +1 -0
  248. package/dist/api/resources/programs/exports.d.ts +2 -0
  249. package/dist/api/resources/programs/exports.js +3 -0
  250. package/dist/api/resources/programs/index.d.ts +2 -0
  251. package/dist/api/resources/programs/index.js +2 -0
  252. package/dist/api/resources/programs/types/GetProgramResponse.d.ts +6 -0
  253. package/dist/api/resources/programs/types/GetProgramResponse.js +2 -0
  254. package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +5 -0
  255. package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +5 -0
  256. package/dist/api/resources/programs/types/ListProgramsResponse.d.ts +7 -0
  257. package/dist/api/resources/programs/types/ListProgramsResponse.js +2 -0
  258. package/dist/api/resources/programs/types/index.d.ts +3 -0
  259. package/dist/api/resources/programs/types/index.js +3 -0
  260. package/dist/api/resources/promotionCodes/client/Client.d.ts +93 -0
  261. package/dist/api/resources/promotionCodes/client/Client.js +299 -0
  262. package/dist/api/resources/promotionCodes/client/index.d.ts +1 -0
  263. package/dist/api/resources/promotionCodes/client/index.js +1 -0
  264. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +13 -0
  265. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.js +2 -0
  266. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.d.ts +9 -0
  267. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.js +2 -0
  268. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.d.ts +9 -0
  269. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.js +2 -0
  270. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +14 -0
  271. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.js +2 -0
  272. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.d.ts +12 -0
  273. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.js +2 -0
  274. package/dist/api/resources/promotionCodes/client/requests/index.d.ts +5 -0
  275. package/dist/api/resources/promotionCodes/client/requests/index.js +1 -0
  276. package/dist/api/resources/promotionCodes/exports.d.ts +2 -0
  277. package/dist/api/resources/promotionCodes/exports.js +3 -0
  278. package/dist/api/resources/promotionCodes/index.d.ts +2 -0
  279. package/dist/api/resources/promotionCodes/index.js +2 -0
  280. package/dist/api/resources/promotionCodes/types/CreatePromotionCodeResponse.d.ts +6 -0
  281. package/dist/api/resources/promotionCodes/types/CreatePromotionCodeResponse.js +2 -0
  282. package/dist/api/resources/promotionCodes/types/DeletePromotionCodeResponse.d.ts +6 -0
  283. package/dist/api/resources/promotionCodes/types/DeletePromotionCodeResponse.js +2 -0
  284. package/dist/api/resources/promotionCodes/types/GetPromotionCodeResponse.d.ts +6 -0
  285. package/dist/api/resources/promotionCodes/types/GetPromotionCodeResponse.js +2 -0
  286. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +5 -0
  287. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +5 -0
  288. package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.d.ts +7 -0
  289. package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.js +2 -0
  290. package/dist/api/resources/promotionCodes/types/UpdatePromotionCodeResponse.d.ts +6 -0
  291. package/dist/api/resources/promotionCodes/types/UpdatePromotionCodeResponse.js +2 -0
  292. package/dist/api/resources/promotionCodes/types/index.d.ts +6 -0
  293. package/dist/api/resources/promotionCodes/types/index.js +6 -0
  294. package/dist/api/resources/reports/client/Client.d.ts +29 -0
  295. package/dist/api/resources/reports/client/Client.js +75 -0
  296. package/dist/api/resources/reports/client/index.d.ts +1 -0
  297. package/dist/api/resources/reports/client/index.js +1 -0
  298. package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.d.ts +9 -0
  299. package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.js +2 -0
  300. package/dist/api/resources/reports/client/requests/index.d.ts +1 -0
  301. package/dist/api/resources/reports/client/requests/index.js +1 -0
  302. package/dist/api/resources/reports/exports.d.ts +2 -0
  303. package/dist/api/resources/reports/exports.js +3 -0
  304. package/dist/api/resources/reports/index.d.ts +2 -0
  305. package/dist/api/resources/reports/index.js +2 -0
  306. package/dist/api/resources/reports/types/ReportsOverviewResponse.d.ts +6 -0
  307. package/dist/api/resources/reports/types/ReportsOverviewResponse.js +2 -0
  308. package/dist/api/resources/reports/types/index.d.ts +1 -0
  309. package/dist/api/resources/reports/types/index.js +1 -0
  310. package/dist/api/resources/transactions/client/Client.d.ts +131 -0
  311. package/dist/api/resources/transactions/client/Client.js +423 -0
  312. package/dist/api/resources/transactions/client/index.d.ts +1 -0
  313. package/dist/api/resources/transactions/client/index.js +1 -0
  314. package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +17 -0
  315. package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.js +2 -0
  316. package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.d.ts +9 -0
  317. package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.js +2 -0
  318. package/dist/api/resources/transactions/client/requests/GetTransactionRequest.d.ts +9 -0
  319. package/dist/api/resources/transactions/client/requests/GetTransactionRequest.js +2 -0
  320. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +15 -0
  321. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.js +2 -0
  322. package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.d.ts +9 -0
  323. package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.js +2 -0
  324. package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.d.ts +9 -0
  325. package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.js +2 -0
  326. package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +18 -0
  327. package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.js +2 -0
  328. package/dist/api/resources/transactions/client/requests/index.d.ts +7 -0
  329. package/dist/api/resources/transactions/client/requests/index.js +1 -0
  330. package/dist/api/resources/transactions/exports.d.ts +2 -0
  331. package/dist/api/resources/transactions/exports.js +3 -0
  332. package/dist/api/resources/transactions/index.d.ts +2 -0
  333. package/dist/api/resources/transactions/index.js +2 -0
  334. package/dist/api/resources/transactions/types/CreateTransactionResponse.d.ts +6 -0
  335. package/dist/api/resources/transactions/types/CreateTransactionResponse.js +2 -0
  336. package/dist/api/resources/transactions/types/DeleteTransactionResponse.d.ts +6 -0
  337. package/dist/api/resources/transactions/types/DeleteTransactionResponse.js +2 -0
  338. package/dist/api/resources/transactions/types/GetTransactionResponse.d.ts +6 -0
  339. package/dist/api/resources/transactions/types/GetTransactionResponse.js +2 -0
  340. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +5 -0
  341. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +5 -0
  342. package/dist/api/resources/transactions/types/ListTransactionsResponse.d.ts +7 -0
  343. package/dist/api/resources/transactions/types/ListTransactionsResponse.js +2 -0
  344. package/dist/api/resources/transactions/types/RefundTransactionResponse.d.ts +6 -0
  345. package/dist/api/resources/transactions/types/RefundTransactionResponse.js +2 -0
  346. package/dist/api/resources/transactions/types/RerunTransactionFlowsResponse.d.ts +6 -0
  347. package/dist/api/resources/transactions/types/RerunTransactionFlowsResponse.js +2 -0
  348. package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
  349. package/dist/api/resources/transactions/types/UpdateTransactionResponse.js +2 -0
  350. package/dist/api/resources/transactions/types/index.d.ts +8 -0
  351. package/dist/api/resources/transactions/types/index.js +8 -0
  352. package/dist/api/types/Click.d.ts +14 -0
  353. package/dist/api/types/Click.js +2 -0
  354. package/dist/api/types/Commission.d.ts +24 -0
  355. package/dist/api/types/Commission.js +2 -0
  356. package/dist/api/types/Customer.d.ts +19 -0
  357. package/dist/api/types/Customer.js +2 -0
  358. package/dist/api/types/Error_.d.ts +4 -0
  359. package/dist/api/types/Error_.js +2 -0
  360. package/dist/api/types/Flow.d.ts +18 -0
  361. package/dist/api/types/Flow.js +2 -0
  362. package/dist/api/types/Group.d.ts +14 -0
  363. package/dist/api/types/Group.js +2 -0
  364. package/dist/api/types/Link.d.ts +11 -0
  365. package/dist/api/types/Link.js +2 -0
  366. package/dist/api/types/Partner.d.ts +13 -0
  367. package/dist/api/types/Partner.js +2 -0
  368. package/dist/api/types/Program.d.ts +15 -0
  369. package/dist/api/types/Program.js +2 -0
  370. package/dist/api/types/PromotionCode.d.ts +16 -0
  371. package/dist/api/types/PromotionCode.js +2 -0
  372. package/dist/api/types/ReportsOverview.d.ts +30 -0
  373. package/dist/api/types/ReportsOverview.js +2 -0
  374. package/dist/api/types/RerunFlowsResult.d.ts +4 -0
  375. package/dist/api/types/RerunFlowsResult.js +2 -0
  376. package/dist/api/types/Transaction.d.ts +32 -0
  377. package/dist/api/types/Transaction.js +2 -0
  378. package/dist/api/types/index.d.ts +13 -0
  379. package/dist/api/types/index.js +13 -0
  380. package/dist/auth/BearerAuthProvider.d.ts +20 -0
  381. package/dist/auth/BearerAuthProvider.js +31 -0
  382. package/dist/auth/index.d.ts +1 -0
  383. package/dist/auth/index.js +1 -0
  384. package/dist/core/auth/AuthProvider.d.ts +8 -0
  385. package/dist/core/auth/AuthProvider.js +6 -0
  386. package/dist/core/auth/AuthRequest.d.ts +9 -0
  387. package/dist/core/auth/AuthRequest.js +1 -0
  388. package/dist/core/auth/BasicAuth.d.ts +8 -0
  389. package/dist/core/auth/BasicAuth.js +29 -0
  390. package/dist/core/auth/BearerToken.d.ts +7 -0
  391. package/dist/core/auth/BearerToken.js +13 -0
  392. package/dist/core/auth/NoOpAuthProvider.d.ts +5 -0
  393. package/dist/core/auth/NoOpAuthProvider.js +5 -0
  394. package/dist/core/auth/index.d.ts +5 -0
  395. package/dist/core/auth/index.js +4 -0
  396. package/dist/core/base64.d.ts +2 -0
  397. package/dist/core/base64.js +22 -0
  398. package/dist/core/exports.d.ts +1 -0
  399. package/dist/core/exports.js +1 -0
  400. package/dist/core/fetcher/APIResponse.d.ts +20 -0
  401. package/dist/core/fetcher/APIResponse.js +1 -0
  402. package/dist/core/fetcher/BinaryResponse.d.ts +19 -0
  403. package/dist/core/fetcher/BinaryResponse.js +14 -0
  404. package/dist/core/fetcher/EndpointMetadata.d.ts +13 -0
  405. package/dist/core/fetcher/EndpointMetadata.js +1 -0
  406. package/dist/core/fetcher/EndpointSupplier.d.ts +12 -0
  407. package/dist/core/fetcher/EndpointSupplier.js +10 -0
  408. package/dist/core/fetcher/Fetcher.d.ts +56 -0
  409. package/dist/core/fetcher/Fetcher.js +223 -0
  410. package/dist/core/fetcher/Headers.d.ts +2 -0
  411. package/dist/core/fetcher/Headers.js +82 -0
  412. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  413. package/dist/core/fetcher/HttpResponsePromise.js +88 -0
  414. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  415. package/dist/core/fetcher/RawResponse.js +40 -0
  416. package/dist/core/fetcher/Supplier.d.ts +4 -0
  417. package/dist/core/fetcher/Supplier.js +10 -0
  418. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  419. package/dist/core/fetcher/createRequestUrl.js +5 -0
  420. package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
  421. package/dist/core/fetcher/getErrorResponseBody.js +30 -0
  422. package/dist/core/fetcher/getFetchFn.d.ts +1 -0
  423. package/dist/core/fetcher/getFetchFn.js +3 -0
  424. package/dist/core/fetcher/getHeader.d.ts +1 -0
  425. package/dist/core/fetcher/getHeader.js +8 -0
  426. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  427. package/dist/core/fetcher/getRequestBody.js +13 -0
  428. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  429. package/dist/core/fetcher/getResponseBody.js +66 -0
  430. package/dist/core/fetcher/index.d.ts +13 -0
  431. package/dist/core/fetcher/index.js +7 -0
  432. package/dist/core/fetcher/makePassthroughRequest.d.ts +49 -0
  433. package/dist/core/fetcher/makePassthroughRequest.js +141 -0
  434. package/dist/core/fetcher/makeRequest.d.ts +6 -0
  435. package/dist/core/fetcher/makeRequest.js +53 -0
  436. package/dist/core/fetcher/redactUrl.d.ts +2 -0
  437. package/dist/core/fetcher/redactUrl.js +84 -0
  438. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  439. package/dist/core/fetcher/requestWithRetries.js +56 -0
  440. package/dist/core/fetcher/signals.d.ts +5 -0
  441. package/dist/core/fetcher/signals.js +28 -0
  442. package/dist/core/headers.d.ts +2 -0
  443. package/dist/core/headers.js +27 -0
  444. package/dist/core/index.d.ts +6 -0
  445. package/dist/core/index.js +6 -0
  446. package/dist/core/json.d.ts +15 -0
  447. package/dist/core/json.js +19 -0
  448. package/dist/core/logging/exports.d.ts +18 -0
  449. package/dist/core/logging/exports.js +9 -0
  450. package/dist/core/logging/index.d.ts +1 -0
  451. package/dist/core/logging/index.js +1 -0
  452. package/dist/core/logging/logger.d.ts +126 -0
  453. package/dist/core/logging/logger.js +137 -0
  454. package/dist/core/requestBody.d.ts +12 -0
  455. package/dist/core/requestBody.js +23 -0
  456. package/dist/core/runtime/index.d.ts +1 -0
  457. package/dist/core/runtime/index.js +1 -0
  458. package/dist/core/runtime/runtime.d.ts +28 -0
  459. package/dist/core/runtime/runtime.js +171 -0
  460. package/dist/core/url/QueryStringBuilder.d.ts +47 -0
  461. package/dist/core/url/QueryStringBuilder.js +80 -0
  462. package/dist/core/url/encodePathParam.d.ts +1 -0
  463. package/dist/core/url/encodePathParam.js +18 -0
  464. package/dist/core/url/index.d.ts +4 -0
  465. package/dist/core/url/index.js +4 -0
  466. package/dist/core/url/join.d.ts +1 -0
  467. package/dist/core/url/join.js +65 -0
  468. package/dist/core/url/qs.d.ts +7 -0
  469. package/dist/core/url/qs.js +76 -0
  470. package/dist/environments.d.ts +4 -0
  471. package/dist/environments.js +4 -0
  472. package/dist/errors/ToltApiError.d.ts +15 -0
  473. package/dist/errors/ToltApiError.js +34 -0
  474. package/dist/errors/ToltApiTimeoutError.d.ts +6 -0
  475. package/dist/errors/ToltApiTimeoutError.js +15 -0
  476. package/dist/errors/handleNonStatusCodeError.d.ts +2 -0
  477. package/dist/errors/handleNonStatusCodeError.js +32 -0
  478. package/dist/errors/index.d.ts +2 -0
  479. package/dist/errors/index.js +2 -0
  480. package/dist/exports.d.ts +1 -0
  481. package/dist/exports.js +1 -0
  482. package/dist/index.d.ts +6 -0
  483. package/dist/index.js +5 -0
  484. package/package.json +44 -0
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { ReportsClient } from "./client/Client.js";
3
+ export * from "./client/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface ReportsOverviewResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.ReportsOverview;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./ReportsOverviewResponse.js";
@@ -0,0 +1 @@
1
+ export * from "./ReportsOverviewResponse.js";
@@ -0,0 +1,131 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as ToltApi from "../../../index.js";
5
+ export declare namespace TransactionsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class TransactionsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<TransactionsClient.Options>;
12
+ constructor(options: TransactionsClient.Options);
13
+ /**
14
+ * @param {ToltApi.ListTransactionsRequest} request
15
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ *
17
+ * @throws {@link ToltApi.BadRequestError}
18
+ * @throws {@link ToltApi.UnauthorizedError}
19
+ * @throws {@link errors.ToltApiError}
20
+ * @throws {@link errors.ToltApiTimeoutError}
21
+ *
22
+ * @example
23
+ * await client.transactions.listTransactions()
24
+ */
25
+ listTransactions(request?: ToltApi.ListTransactionsRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ListTransactionsResponse>;
26
+ private __listTransactions;
27
+ /**
28
+ * @param {ToltApi.CreateTransactionRequest} request
29
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link ToltApi.BadRequestError}
32
+ * @throws {@link ToltApi.UnauthorizedError}
33
+ * @throws {@link errors.ToltApiError}
34
+ * @throws {@link errors.ToltApiTimeoutError}
35
+ *
36
+ * @example
37
+ * await client.transactions.createTransaction({
38
+ * amount: 1,
39
+ * customerId: "customerId"
40
+ * })
41
+ */
42
+ createTransaction(request: ToltApi.CreateTransactionRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateTransactionResponse>;
43
+ private __createTransaction;
44
+ /**
45
+ * @param {ToltApi.GetTransactionRequest} request
46
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
47
+ *
48
+ * @throws {@link ToltApi.UnauthorizedError}
49
+ * @throws {@link ToltApi.NotFoundError}
50
+ * @throws {@link errors.ToltApiError}
51
+ * @throws {@link errors.ToltApiTimeoutError}
52
+ *
53
+ * @example
54
+ * await client.transactions.getTransaction({
55
+ * id: "id"
56
+ * })
57
+ */
58
+ getTransaction(request: ToltApi.GetTransactionRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetTransactionResponse>;
59
+ private __getTransaction;
60
+ /**
61
+ * @param {ToltApi.UpdateTransactionRequest} request
62
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link ToltApi.BadRequestError}
65
+ * @throws {@link ToltApi.UnauthorizedError}
66
+ * @throws {@link ToltApi.NotFoundError}
67
+ * @throws {@link ToltApi.ConflictError}
68
+ * @throws {@link errors.ToltApiError}
69
+ * @throws {@link errors.ToltApiTimeoutError}
70
+ *
71
+ * @example
72
+ * await client.transactions.updateTransaction({
73
+ * id: "id"
74
+ * })
75
+ */
76
+ updateTransaction(request: ToltApi.UpdateTransactionRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdateTransactionResponse>;
77
+ private __updateTransaction;
78
+ /**
79
+ * @param {ToltApi.DeleteTransactionRequest} request
80
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
81
+ *
82
+ * @throws {@link ToltApi.UnauthorizedError}
83
+ * @throws {@link ToltApi.NotFoundError}
84
+ * @throws {@link ToltApi.ConflictError}
85
+ * @throws {@link errors.ToltApiError}
86
+ * @throws {@link errors.ToltApiTimeoutError}
87
+ *
88
+ * @example
89
+ * await client.transactions.deleteTransaction({
90
+ * id: "id"
91
+ * })
92
+ */
93
+ deleteTransaction(request: ToltApi.DeleteTransactionRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeleteTransactionResponse>;
94
+ private __deleteTransaction;
95
+ /**
96
+ * @param {ToltApi.RefundTransactionRequest} request
97
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
98
+ *
99
+ * @throws {@link ToltApi.UnauthorizedError}
100
+ * @throws {@link ToltApi.NotFoundError}
101
+ * @throws {@link ToltApi.ConflictError}
102
+ * @throws {@link errors.ToltApiError}
103
+ * @throws {@link errors.ToltApiTimeoutError}
104
+ *
105
+ * @example
106
+ * await client.transactions.refundTransaction({
107
+ * id: "id"
108
+ * })
109
+ */
110
+ refundTransaction(request: ToltApi.RefundTransactionRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.RefundTransactionResponse>;
111
+ private __refundTransaction;
112
+ /**
113
+ * Re-queues the transaction for asynchronous flow processing. Only transactions without an existing commission are eligible, so a rerun cannot create a duplicate commission.
114
+ *
115
+ * @param {ToltApi.RerunTransactionFlowsRequest} request
116
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
117
+ *
118
+ * @throws {@link ToltApi.UnauthorizedError}
119
+ * @throws {@link ToltApi.NotFoundError}
120
+ * @throws {@link ToltApi.ConflictError}
121
+ * @throws {@link errors.ToltApiError}
122
+ * @throws {@link errors.ToltApiTimeoutError}
123
+ *
124
+ * @example
125
+ * await client.transactions.rerunTransactionFlows({
126
+ * id: "id"
127
+ * })
128
+ */
129
+ rerunTransactionFlows(request: ToltApi.RerunTransactionFlowsRequest, requestOptions?: TransactionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.RerunTransactionFlowsResponse>;
130
+ private __rerunTransactionFlows;
131
+ }
@@ -0,0 +1,423 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import { mergeHeaders } from "../../../../core/headers.js";
4
+ import * as core from "../../../../core/index.js";
5
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js";
6
+ import * as environments from "../../../../environments.js";
7
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
+ import * as errors from "../../../../errors/index.js";
9
+ import * as ToltApi from "../../../index.js";
10
+ export class TransactionsClient {
11
+ constructor(options) {
12
+ this._options = normalizeClientOptionsWithAuth(options);
13
+ }
14
+ /**
15
+ * @param {ToltApi.ListTransactionsRequest} request
16
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ *
18
+ * @throws {@link ToltApi.BadRequestError}
19
+ * @throws {@link ToltApi.UnauthorizedError}
20
+ * @throws {@link errors.ToltApiError}
21
+ * @throws {@link errors.ToltApiTimeoutError}
22
+ *
23
+ * @example
24
+ * await client.transactions.listTransactions()
25
+ */
26
+ listTransactions(request = {}, requestOptions) {
27
+ return core.HttpResponsePromise.fromPromise(this.__listTransactions(request, requestOptions));
28
+ }
29
+ async __listTransactions(request = {}, requestOptions) {
30
+ const { limit, order, starting_after: startingAfter, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, } = request;
31
+ const _queryParams = {
32
+ limit,
33
+ order: order != null ? order : undefined,
34
+ starting_after: startingAfter,
35
+ program_id: programId,
36
+ partner_id: partnerId,
37
+ customer_id: customerId,
38
+ status,
39
+ search,
40
+ };
41
+ const _authRequest = await this._options.authProvider.getAuthRequest();
42
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
43
+ const _response = await core.fetcher({
44
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
45
+ (await core.Supplier.get(this._options.environment)) ??
46
+ environments.ToltApiEnvironment.Production, "v2/transactions"),
47
+ method: "GET",
48
+ headers: _headers,
49
+ queryString: core.url
50
+ .queryBuilder()
51
+ .addMany(_queryParams)
52
+ .mergeAdditional(requestOptions?.queryParams)
53
+ .build(),
54
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
55
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
56
+ abortSignal: requestOptions?.abortSignal,
57
+ fetchFn: this._options?.fetch,
58
+ logging: this._options.logging,
59
+ });
60
+ if (_response.ok) {
61
+ return { data: _response.body, rawResponse: _response.rawResponse };
62
+ }
63
+ if (_response.error.reason === "status-code") {
64
+ switch (_response.error.statusCode) {
65
+ case 400:
66
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
67
+ case 401:
68
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
69
+ default:
70
+ throw new errors.ToltApiError({
71
+ statusCode: _response.error.statusCode,
72
+ body: _response.error.body,
73
+ rawResponse: _response.rawResponse,
74
+ });
75
+ }
76
+ }
77
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/transactions");
78
+ }
79
+ /**
80
+ * @param {ToltApi.CreateTransactionRequest} request
81
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
82
+ *
83
+ * @throws {@link ToltApi.BadRequestError}
84
+ * @throws {@link ToltApi.UnauthorizedError}
85
+ * @throws {@link errors.ToltApiError}
86
+ * @throws {@link errors.ToltApiTimeoutError}
87
+ *
88
+ * @example
89
+ * await client.transactions.createTransaction({
90
+ * amount: 1,
91
+ * customerId: "customerId"
92
+ * })
93
+ */
94
+ createTransaction(request, requestOptions) {
95
+ return core.HttpResponsePromise.fromPromise(this.__createTransaction(request, requestOptions));
96
+ }
97
+ async __createTransaction(request, requestOptions) {
98
+ const _authRequest = await this._options.authProvider.getAuthRequest();
99
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
100
+ const _response = await core.fetcher({
101
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
102
+ (await core.Supplier.get(this._options.environment)) ??
103
+ environments.ToltApiEnvironment.Production, "v2/transactions"),
104
+ method: "POST",
105
+ headers: _headers,
106
+ contentType: "application/json",
107
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
108
+ requestType: "json",
109
+ body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
110
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
111
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
112
+ abortSignal: requestOptions?.abortSignal,
113
+ fetchFn: this._options?.fetch,
114
+ logging: this._options.logging,
115
+ });
116
+ if (_response.ok) {
117
+ return { data: _response.body, rawResponse: _response.rawResponse };
118
+ }
119
+ if (_response.error.reason === "status-code") {
120
+ switch (_response.error.statusCode) {
121
+ case 400:
122
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
123
+ case 401:
124
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.ToltApiError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/transactions");
134
+ }
135
+ /**
136
+ * @param {ToltApi.GetTransactionRequest} request
137
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
138
+ *
139
+ * @throws {@link ToltApi.UnauthorizedError}
140
+ * @throws {@link ToltApi.NotFoundError}
141
+ * @throws {@link errors.ToltApiError}
142
+ * @throws {@link errors.ToltApiTimeoutError}
143
+ *
144
+ * @example
145
+ * await client.transactions.getTransaction({
146
+ * id: "id"
147
+ * })
148
+ */
149
+ getTransaction(request, requestOptions) {
150
+ return core.HttpResponsePromise.fromPromise(this.__getTransaction(request, requestOptions));
151
+ }
152
+ async __getTransaction(request, requestOptions) {
153
+ const { id } = request;
154
+ const _authRequest = await this._options.authProvider.getAuthRequest();
155
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
156
+ const _response = await core.fetcher({
157
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
158
+ (await core.Supplier.get(this._options.environment)) ??
159
+ environments.ToltApiEnvironment.Production, `v2/transactions/${core.url.encodePathParam(id)}`),
160
+ method: "GET",
161
+ headers: _headers,
162
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
163
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
164
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
165
+ abortSignal: requestOptions?.abortSignal,
166
+ fetchFn: this._options?.fetch,
167
+ logging: this._options.logging,
168
+ });
169
+ if (_response.ok) {
170
+ return { data: _response.body, rawResponse: _response.rawResponse };
171
+ }
172
+ if (_response.error.reason === "status-code") {
173
+ switch (_response.error.statusCode) {
174
+ case 401:
175
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
176
+ case 404:
177
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
178
+ default:
179
+ throw new errors.ToltApiError({
180
+ statusCode: _response.error.statusCode,
181
+ body: _response.error.body,
182
+ rawResponse: _response.rawResponse,
183
+ });
184
+ }
185
+ }
186
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/transactions/{id}");
187
+ }
188
+ /**
189
+ * @param {ToltApi.UpdateTransactionRequest} request
190
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
191
+ *
192
+ * @throws {@link ToltApi.BadRequestError}
193
+ * @throws {@link ToltApi.UnauthorizedError}
194
+ * @throws {@link ToltApi.NotFoundError}
195
+ * @throws {@link ToltApi.ConflictError}
196
+ * @throws {@link errors.ToltApiError}
197
+ * @throws {@link errors.ToltApiTimeoutError}
198
+ *
199
+ * @example
200
+ * await client.transactions.updateTransaction({
201
+ * id: "id"
202
+ * })
203
+ */
204
+ updateTransaction(request, requestOptions) {
205
+ return core.HttpResponsePromise.fromPromise(this.__updateTransaction(request, requestOptions));
206
+ }
207
+ async __updateTransaction(request, requestOptions) {
208
+ const { id, ..._body } = request;
209
+ const _authRequest = await this._options.authProvider.getAuthRequest();
210
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
211
+ const _response = await core.fetcher({
212
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
213
+ (await core.Supplier.get(this._options.environment)) ??
214
+ environments.ToltApiEnvironment.Production, `v2/transactions/${core.url.encodePathParam(id)}`),
215
+ method: "PUT",
216
+ headers: _headers,
217
+ contentType: "application/json",
218
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
219
+ requestType: "json",
220
+ body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),
221
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
222
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
223
+ abortSignal: requestOptions?.abortSignal,
224
+ fetchFn: this._options?.fetch,
225
+ logging: this._options.logging,
226
+ });
227
+ if (_response.ok) {
228
+ return { data: _response.body, rawResponse: _response.rawResponse };
229
+ }
230
+ if (_response.error.reason === "status-code") {
231
+ switch (_response.error.statusCode) {
232
+ case 400:
233
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
234
+ case 401:
235
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
236
+ case 404:
237
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
238
+ case 409:
239
+ throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
240
+ default:
241
+ throw new errors.ToltApiError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ }
248
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/transactions/{id}");
249
+ }
250
+ /**
251
+ * @param {ToltApi.DeleteTransactionRequest} request
252
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
253
+ *
254
+ * @throws {@link ToltApi.UnauthorizedError}
255
+ * @throws {@link ToltApi.NotFoundError}
256
+ * @throws {@link ToltApi.ConflictError}
257
+ * @throws {@link errors.ToltApiError}
258
+ * @throws {@link errors.ToltApiTimeoutError}
259
+ *
260
+ * @example
261
+ * await client.transactions.deleteTransaction({
262
+ * id: "id"
263
+ * })
264
+ */
265
+ deleteTransaction(request, requestOptions) {
266
+ return core.HttpResponsePromise.fromPromise(this.__deleteTransaction(request, requestOptions));
267
+ }
268
+ async __deleteTransaction(request, requestOptions) {
269
+ const { id } = request;
270
+ const _authRequest = await this._options.authProvider.getAuthRequest();
271
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
272
+ const _response = await core.fetcher({
273
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
274
+ (await core.Supplier.get(this._options.environment)) ??
275
+ environments.ToltApiEnvironment.Production, `v2/transactions/${core.url.encodePathParam(id)}`),
276
+ method: "DELETE",
277
+ headers: _headers,
278
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
279
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
280
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
281
+ abortSignal: requestOptions?.abortSignal,
282
+ fetchFn: this._options?.fetch,
283
+ logging: this._options.logging,
284
+ });
285
+ if (_response.ok) {
286
+ return { data: _response.body, rawResponse: _response.rawResponse };
287
+ }
288
+ if (_response.error.reason === "status-code") {
289
+ switch (_response.error.statusCode) {
290
+ case 401:
291
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
292
+ case 404:
293
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
294
+ case 409:
295
+ throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
296
+ default:
297
+ throw new errors.ToltApiError({
298
+ statusCode: _response.error.statusCode,
299
+ body: _response.error.body,
300
+ rawResponse: _response.rawResponse,
301
+ });
302
+ }
303
+ }
304
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v2/transactions/{id}");
305
+ }
306
+ /**
307
+ * @param {ToltApi.RefundTransactionRequest} request
308
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
309
+ *
310
+ * @throws {@link ToltApi.UnauthorizedError}
311
+ * @throws {@link ToltApi.NotFoundError}
312
+ * @throws {@link ToltApi.ConflictError}
313
+ * @throws {@link errors.ToltApiError}
314
+ * @throws {@link errors.ToltApiTimeoutError}
315
+ *
316
+ * @example
317
+ * await client.transactions.refundTransaction({
318
+ * id: "id"
319
+ * })
320
+ */
321
+ refundTransaction(request, requestOptions) {
322
+ return core.HttpResponsePromise.fromPromise(this.__refundTransaction(request, requestOptions));
323
+ }
324
+ async __refundTransaction(request, requestOptions) {
325
+ const { id } = request;
326
+ const _authRequest = await this._options.authProvider.getAuthRequest();
327
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
328
+ const _response = await core.fetcher({
329
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
330
+ (await core.Supplier.get(this._options.environment)) ??
331
+ environments.ToltApiEnvironment.Production, `v2/transactions/${core.url.encodePathParam(id)}/refund`),
332
+ method: "POST",
333
+ headers: _headers,
334
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
335
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
336
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
337
+ abortSignal: requestOptions?.abortSignal,
338
+ fetchFn: this._options?.fetch,
339
+ logging: this._options.logging,
340
+ });
341
+ if (_response.ok) {
342
+ return { data: _response.body, rawResponse: _response.rawResponse };
343
+ }
344
+ if (_response.error.reason === "status-code") {
345
+ switch (_response.error.statusCode) {
346
+ case 401:
347
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
348
+ case 404:
349
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
350
+ case 409:
351
+ throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
352
+ default:
353
+ throw new errors.ToltApiError({
354
+ statusCode: _response.error.statusCode,
355
+ body: _response.error.body,
356
+ rawResponse: _response.rawResponse,
357
+ });
358
+ }
359
+ }
360
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/transactions/{id}/refund");
361
+ }
362
+ /**
363
+ * Re-queues the transaction for asynchronous flow processing. Only transactions without an existing commission are eligible, so a rerun cannot create a duplicate commission.
364
+ *
365
+ * @param {ToltApi.RerunTransactionFlowsRequest} request
366
+ * @param {TransactionsClient.RequestOptions} requestOptions - Request-specific configuration.
367
+ *
368
+ * @throws {@link ToltApi.UnauthorizedError}
369
+ * @throws {@link ToltApi.NotFoundError}
370
+ * @throws {@link ToltApi.ConflictError}
371
+ * @throws {@link errors.ToltApiError}
372
+ * @throws {@link errors.ToltApiTimeoutError}
373
+ *
374
+ * @example
375
+ * await client.transactions.rerunTransactionFlows({
376
+ * id: "id"
377
+ * })
378
+ */
379
+ rerunTransactionFlows(request, requestOptions) {
380
+ return core.HttpResponsePromise.fromPromise(this.__rerunTransactionFlows(request, requestOptions));
381
+ }
382
+ async __rerunTransactionFlows(request, requestOptions) {
383
+ const { id } = request;
384
+ const _authRequest = await this._options.authProvider.getAuthRequest();
385
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
386
+ const _response = await core.fetcher({
387
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
388
+ (await core.Supplier.get(this._options.environment)) ??
389
+ environments.ToltApiEnvironment.Production, `v2/transactions/${core.url.encodePathParam(id)}/rerun-flows`),
390
+ method: "POST",
391
+ headers: _headers,
392
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
393
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
394
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
395
+ abortSignal: requestOptions?.abortSignal,
396
+ fetchFn: this._options?.fetch,
397
+ logging: this._options.logging,
398
+ });
399
+ if (_response.ok) {
400
+ return {
401
+ data: _response.body,
402
+ rawResponse: _response.rawResponse,
403
+ };
404
+ }
405
+ if (_response.error.reason === "status-code") {
406
+ switch (_response.error.statusCode) {
407
+ case 401:
408
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
409
+ case 404:
410
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
411
+ case 409:
412
+ throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
413
+ default:
414
+ throw new errors.ToltApiError({
415
+ statusCode: _response.error.statusCode,
416
+ body: _response.error.body,
417
+ rawResponse: _response.rawResponse,
418
+ });
419
+ }
420
+ }
421
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/transactions/{id}/rerun-flows");
422
+ }
423
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * amount: 1,
5
+ * customerId: "customerId"
6
+ * }
7
+ */
8
+ export interface CreateTransactionRequest {
9
+ /** Monetary amount as an integer in the smallest currency unit (cents), e.g. 500 = 5.00 */
10
+ amount: number;
11
+ customerId: string;
12
+ billingType?: string;
13
+ chargeId?: string;
14
+ clickId?: string;
15
+ interval?: string;
16
+ source?: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface DeleteTransactionRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface GetTransactionRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,15 @@
1
+ import type * as ToltApi from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ListTransactionsRequest {
7
+ limit?: number;
8
+ order?: ToltApi.ListTransactionsRequestOrder;
9
+ starting_after?: string;
10
+ program_id?: string;
11
+ partner_id?: string;
12
+ customer_id?: string;
13
+ status?: string;
14
+ search?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};