@tolt/api 0.6.1 → 1.0.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 (420) hide show
  1. package/dist/BaseClient.js +1 -0
  2. package/dist/Client.d.ts +3 -3
  3. package/dist/Client.js +3 -3
  4. package/dist/api/errors/BadRequestError.d.ts +2 -2
  5. package/dist/api/errors/ConflictError.d.ts +2 -2
  6. package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
  7. package/dist/api/errors/ContentTooLargeError.js +17 -0
  8. package/dist/api/errors/NotFoundError.d.ts +2 -2
  9. package/dist/api/errors/TooManyRequestsError.d.ts +2 -2
  10. package/dist/api/errors/UnauthorizedError.d.ts +2 -2
  11. package/dist/api/errors/index.d.ts +1 -0
  12. package/dist/api/errors/index.js +1 -0
  13. package/dist/api/resources/clicks/client/Client.d.ts +16 -8
  14. package/dist/api/resources/clicks/client/Client.js +93 -68
  15. package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
  16. package/dist/api/resources/clicks/client/requests/GetClickRequest.d.ts +9 -0
  17. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
  18. package/dist/api/resources/clicks/client/requests/index.d.ts +2 -1
  19. package/dist/api/resources/clicks/types/{CreateClicksResponse.d.ts → CreateClickResponse.d.ts} +1 -1
  20. package/dist/api/resources/clicks/types/{GetClicksResponse.d.ts → GetClickResponse.d.ts} +1 -1
  21. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
  22. package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
  23. package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
  24. package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
  25. package/dist/api/resources/clicks/types/index.d.ts +2 -3
  26. package/dist/api/resources/clicks/types/index.js +2 -3
  27. package/dist/api/resources/commissions/client/Client.d.ts +48 -22
  28. package/dist/api/resources/commissions/client/Client.js +142 -84
  29. package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.d.ts +9 -0
  30. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
  31. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
  32. package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.d.ts +40 -0
  33. package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.js +9 -0
  34. package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.d.ts +9 -0
  35. package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.d.ts +9 -0
  36. package/dist/api/resources/commissions/client/requests/GetCommissionRequest.d.ts +9 -0
  37. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
  38. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +33 -0
  39. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +9 -0
  40. package/dist/api/resources/commissions/client/requests/index.d.ts +6 -5
  41. package/dist/api/resources/commissions/client/requests/index.js +2 -1
  42. package/dist/api/resources/commissions/types/{UpdateCommissionsResponse.d.ts → ApproveCommissionResponse.d.ts} +1 -1
  43. package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.d.ts → CreateCommissionResponse.d.ts} +1 -1
  44. package/dist/api/resources/commissions/types/{CreateCommissionsResponse.d.ts → DeclineCommissionResponse.d.ts} +1 -1
  45. package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
  46. package/dist/api/resources/commissions/types/{GetCommissionsResponse.d.ts → GetCommissionResponse.d.ts} +1 -1
  47. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
  48. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
  49. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
  50. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
  51. package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
  52. package/dist/api/resources/commissions/types/index.d.ts +6 -7
  53. package/dist/api/resources/commissions/types/index.js +6 -7
  54. package/dist/api/resources/customers/client/Client.d.ts +36 -14
  55. package/dist/api/resources/customers/client/Client.js +120 -74
  56. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +47 -0
  57. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.js +12 -0
  58. package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.d.ts +9 -0
  59. package/dist/api/resources/customers/client/requests/GetCustomerRequest.d.ts +9 -0
  60. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
  61. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +44 -0
  62. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.js +12 -0
  63. package/dist/api/resources/customers/client/requests/index.d.ts +4 -4
  64. package/dist/api/resources/customers/client/requests/index.js +2 -2
  65. package/dist/api/resources/customers/types/{DeleteCustomersResponse.d.ts → CreateCustomerResponse.d.ts} +1 -1
  66. package/dist/api/resources/customers/types/{UpdateCustomersResponse.d.ts → DeleteCustomerResponse.d.ts} +1 -1
  67. package/dist/api/resources/customers/types/{GetCustomersResponse.d.ts → GetCustomerResponse.d.ts} +1 -1
  68. package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
  69. package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
  70. package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
  71. package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
  72. package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
  73. package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
  74. package/dist/api/resources/customers/types/{CreateCustomersResponse.d.ts → UpdateCustomerResponse.d.ts} +1 -1
  75. package/dist/api/resources/customers/types/index.d.ts +4 -4
  76. package/dist/api/resources/customers/types/index.js +4 -4
  77. package/dist/api/resources/{embed → embedTokens}/client/Client.d.ts +10 -9
  78. package/dist/api/resources/{embed → embedTokens}/client/Client.js +11 -8
  79. package/dist/api/resources/embedTokens/client/requests/CreateEmbedTokenRequest.d.ts +21 -0
  80. package/dist/api/resources/embedTokens/client/requests/index.d.ts +1 -0
  81. package/dist/api/resources/embedTokens/exports.d.ts +2 -0
  82. package/dist/api/resources/{embed → embedTokens}/exports.js +1 -1
  83. package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.d.ts → embedTokens/types/CreateEmbedTokenResponse.d.ts} +1 -1
  84. package/dist/api/resources/embedTokens/types/index.d.ts +1 -0
  85. package/dist/api/resources/embedTokens/types/index.js +1 -0
  86. package/dist/api/resources/flows/client/Client.d.ts +10 -5
  87. package/dist/api/resources/flows/client/Client.js +83 -63
  88. package/dist/api/resources/flows/client/requests/GetFlowRequest.d.ts +9 -0
  89. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +14 -6
  90. package/dist/api/resources/flows/client/requests/index.d.ts +1 -1
  91. package/dist/api/resources/flows/types/{GetFlowsResponse.d.ts → GetFlowResponse.d.ts} +1 -1
  92. package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
  93. package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
  94. package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
  95. package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
  96. package/dist/api/resources/flows/types/index.d.ts +1 -2
  97. package/dist/api/resources/flows/types/index.js +1 -2
  98. package/dist/api/resources/groups/client/Client.d.ts +10 -5
  99. package/dist/api/resources/groups/client/Client.js +80 -60
  100. package/dist/api/resources/groups/client/requests/GetGroupRequest.d.ts +9 -0
  101. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +11 -6
  102. package/dist/api/resources/groups/client/requests/index.d.ts +1 -1
  103. package/dist/api/resources/groups/types/{GetGroupsResponse.d.ts → GetGroupResponse.d.ts} +1 -1
  104. package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
  105. package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
  106. package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
  107. package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
  108. package/dist/api/resources/groups/types/index.d.ts +1 -2
  109. package/dist/api/resources/groups/types/index.js +1 -2
  110. package/dist/api/resources/index.d.ts +3 -3
  111. package/dist/api/resources/index.js +3 -3
  112. package/dist/api/resources/links/client/Client.d.ts +28 -17
  113. package/dist/api/resources/links/client/Client.js +111 -75
  114. package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +16 -0
  115. package/dist/api/resources/links/client/requests/DeleteLinkRequest.d.ts +9 -0
  116. package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
  117. package/dist/api/resources/links/client/requests/GetLinkRequest.d.ts +9 -0
  118. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
  119. package/dist/api/resources/links/client/requests/UpdateLinkRequest.d.ts +15 -0
  120. package/dist/api/resources/links/client/requests/index.d.ts +5 -5
  121. package/dist/api/resources/links/types/{DeleteLinksResponse.d.ts → CreateLinkResponse.d.ts} +1 -1
  122. package/dist/api/resources/links/types/{CreateLinksResponse.d.ts → DeleteLinkResponse.d.ts} +1 -1
  123. package/dist/api/resources/links/types/GetLinkByParamValueResponse.d.ts +6 -0
  124. package/dist/api/resources/links/types/{GetLinksResponse.d.ts → GetLinkResponse.d.ts} +1 -1
  125. package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
  126. package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
  127. package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
  128. package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
  129. package/dist/api/resources/links/types/{UpdateLinksResponse.d.ts → UpdateLinkResponse.d.ts} +1 -1
  130. package/dist/api/resources/links/types/index.d.ts +5 -5
  131. package/dist/api/resources/links/types/index.js +5 -5
  132. package/dist/api/resources/partners/client/Client.d.ts +52 -24
  133. package/dist/api/resources/partners/client/Client.js +140 -85
  134. package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.d.ts +9 -0
  135. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
  136. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
  137. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +59 -0
  138. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +9 -0
  139. package/dist/api/resources/partners/client/requests/GetPartnerRequest.d.ts +9 -0
  140. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
  141. package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +11 -0
  142. package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +11 -0
  143. package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +24 -0
  144. package/dist/api/resources/partners/client/requests/index.d.ts +6 -6
  145. package/dist/api/resources/partners/client/requests/index.js +1 -1
  146. package/dist/api/resources/partners/types/{RejectPartnersResponse.d.ts → ApprovePartnerResponse.d.ts} +1 -1
  147. package/dist/api/resources/partners/types/{CreatePartnersResponse.d.ts → CreatePartnerResponse.d.ts} +1 -1
  148. package/dist/api/resources/partners/types/{GetPartnersResponse.d.ts → GetPartnerResponse.d.ts} +1 -1
  149. package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
  150. package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
  151. package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
  152. package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
  153. package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
  154. package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
  155. package/dist/api/resources/partners/types/{UpdatePartnersResponse.d.ts → RejectPartnerResponse.d.ts} +1 -1
  156. package/dist/api/resources/partners/types/{ApprovePartnersResponse.d.ts → SuspendPartnerResponse.d.ts} +1 -1
  157. package/dist/api/resources/partners/types/{SuspendPartnersResponse.d.ts → UpdatePartnerResponse.d.ts} +1 -1
  158. package/dist/api/resources/partners/types/index.d.ts +6 -6
  159. package/dist/api/resources/partners/types/index.js +6 -6
  160. package/dist/api/resources/programs/client/Client.d.ts +10 -5
  161. package/dist/api/resources/programs/client/Client.js +78 -58
  162. package/dist/api/resources/programs/client/requests/GetProgramRequest.d.ts +9 -0
  163. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
  164. package/dist/api/resources/programs/client/requests/index.d.ts +1 -1
  165. package/dist/api/resources/programs/types/{GetProgramsResponse.d.ts → GetProgramResponse.d.ts} +1 -1
  166. package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
  167. package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
  168. package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
  169. package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
  170. package/dist/api/resources/programs/types/index.d.ts +1 -1
  171. package/dist/api/resources/programs/types/index.js +1 -1
  172. package/dist/api/resources/promotionCodes/client/Client.d.ts +36 -15
  173. package/dist/api/resources/promotionCodes/client/Client.js +121 -72
  174. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +27 -0
  175. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.js +9 -0
  176. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.d.ts +9 -0
  177. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.d.ts +9 -0
  178. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
  179. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.d.ts +26 -0
  180. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.js +9 -0
  181. package/dist/api/resources/promotionCodes/client/requests/index.d.ts +4 -4
  182. package/dist/api/resources/promotionCodes/client/requests/index.js +2 -2
  183. package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.d.ts → CreatePromotionCodeResponse.d.ts} +1 -1
  184. package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.d.ts → DeletePromotionCodeResponse.d.ts} +1 -1
  185. package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.d.ts → GetPromotionCodeResponse.d.ts} +1 -1
  186. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
  187. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
  188. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
  189. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
  190. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
  191. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
  192. package/dist/api/resources/promotionCodes/types/{UpdatePromotionCodesResponse.d.ts → UpdatePromotionCodeResponse.d.ts} +1 -1
  193. package/dist/api/resources/promotionCodes/types/index.d.ts +4 -4
  194. package/dist/api/resources/promotionCodes/types/index.js +4 -4
  195. package/dist/api/resources/reports/client/Client.d.ts +27 -14
  196. package/dist/api/resources/reports/client/Client.js +182 -118
  197. package/dist/api/resources/reports/client/requests/ReportsCustomersRequest.d.ts +12 -0
  198. package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +23 -0
  199. package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.d.ts +12 -0
  200. package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +23 -0
  201. package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +17 -0
  202. package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
  203. package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
  204. package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
  205. package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
  206. package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
  207. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
  208. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
  209. package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
  210. package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
  211. package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.d.ts → ReportsCustomersResponse.d.ts} +1 -1
  212. package/dist/api/resources/reports/types/{LinksReportsResponse.d.ts → ReportsLinksResponse.d.ts} +1 -1
  213. package/dist/api/resources/reports/types/{OverviewReportsResponse.d.ts → ReportsOverviewResponse.d.ts} +1 -1
  214. package/dist/api/resources/reports/types/{PartnersReportsResponse.d.ts → ReportsPartnersResponse.d.ts} +1 -1
  215. package/dist/api/resources/reports/types/{TimeseriesReportsResponse.d.ts → ReportsTimeseriesResponse.d.ts} +1 -1
  216. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
  217. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
  218. package/dist/api/resources/reports/types/index.d.ts +5 -5
  219. package/dist/api/resources/reports/types/index.js +5 -5
  220. package/dist/api/resources/transactions/client/Client.d.ts +43 -21
  221. package/dist/api/resources/transactions/client/Client.js +132 -80
  222. package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +34 -0
  223. package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.d.ts +9 -0
  224. package/dist/api/resources/transactions/client/requests/GetTransactionRequest.d.ts +9 -0
  225. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
  226. package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.d.ts +9 -0
  227. package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.d.ts +9 -0
  228. package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +31 -0
  229. package/dist/api/resources/transactions/client/requests/index.d.ts +6 -6
  230. package/dist/api/resources/transactions/types/{CreateTransactionsResponse.d.ts → CreateTransactionResponse.d.ts} +1 -1
  231. package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.d.ts → DeleteTransactionResponse.d.ts} +1 -1
  232. package/dist/api/resources/transactions/types/{GetTransactionsResponse.d.ts → GetTransactionResponse.d.ts} +1 -1
  233. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
  234. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
  235. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
  236. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
  237. package/dist/api/resources/transactions/types/{RefundTransactionsResponse.d.ts → RefundTransactionResponse.d.ts} +1 -1
  238. package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.d.ts → RerunTransactionFlowsResponse.d.ts} +1 -1
  239. package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
  240. package/dist/api/resources/transactions/types/index.d.ts +6 -6
  241. package/dist/api/resources/transactions/types/index.js +6 -6
  242. package/dist/api/types/Commission.d.ts +1 -1
  243. package/dist/api/types/Customer.d.ts +2 -2
  244. package/dist/api/types/{Error_.d.ts → ErrorResponse.d.ts} +5 -4
  245. package/dist/api/types/{Error_.js → ErrorResponse.js} +5 -4
  246. package/dist/api/types/index.d.ts +1 -1
  247. package/dist/api/types/index.js +1 -1
  248. package/dist/core/exports.d.ts +1 -0
  249. package/dist/core/exports.js +1 -0
  250. package/dist/core/fetcher/Fetcher.js +35 -4
  251. package/dist/core/fetcher/getErrorResponseBody.js +21 -8
  252. package/dist/core/fetcher/getResponseBody.d.ts +16 -0
  253. package/dist/core/fetcher/getResponseBody.js +26 -22
  254. package/dist/core/fetcher/makePassthroughRequest.js +18 -2
  255. package/dist/core/fetcher/makeRequest.d.ts +6 -1
  256. package/dist/core/fetcher/makeRequest.js +45 -13
  257. package/dist/core/fetcher/requestWithRetries.d.ts +1 -1
  258. package/dist/core/fetcher/requestWithRetries.js +23 -2
  259. package/dist/core/fetcher/signals.d.ts +1 -0
  260. package/dist/core/fetcher/signals.js +1 -1
  261. package/dist/core/index.d.ts +2 -0
  262. package/dist/core/index.js +2 -0
  263. package/dist/core/pagination/Page.d.ts +33 -0
  264. package/dist/core/pagination/Page.js +49 -0
  265. package/dist/core/pagination/exports.d.ts +1 -0
  266. package/dist/core/pagination/exports.js +1 -0
  267. package/dist/core/pagination/index.d.ts +1 -0
  268. package/dist/core/pagination/index.js +1 -0
  269. package/dist/core/url/encodePathParam.d.ts +3 -1
  270. package/dist/core/url/encodePathParam.js +8 -2
  271. package/dist/core/utils/index.d.ts +1 -0
  272. package/dist/core/utils/index.js +1 -0
  273. package/dist/core/utils/setObjectProperty.d.ts +12 -0
  274. package/dist/core/utils/setObjectProperty.js +45 -0
  275. package/dist/environments.d.ts +2 -2
  276. package/dist/environments.js +1 -1
  277. package/dist/errors/ToltApiError.js +15 -1
  278. package/package.json +7 -2
  279. package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +0 -9
  280. package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
  281. package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +0 -9
  282. package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +0 -9
  283. package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +0 -9
  284. package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +0 -9
  285. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +0 -18
  286. package/dist/api/resources/commissions/types/ApproveCommissionsResponse.d.ts +0 -6
  287. package/dist/api/resources/commissions/types/CreateCommissionsRequest.d.ts +0 -1
  288. package/dist/api/resources/commissions/types/DeclineCommissionsResponse.d.ts +0 -6
  289. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +0 -29
  290. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +0 -11
  291. package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +0 -9
  292. package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +0 -9
  293. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +0 -31
  294. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +0 -11
  295. package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
  296. package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
  297. package/dist/api/resources/embed/exports.d.ts +0 -2
  298. package/dist/api/resources/embed/types/index.d.ts +0 -1
  299. package/dist/api/resources/embed/types/index.js +0 -1
  300. package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +0 -9
  301. package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -5
  302. package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -5
  303. package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +0 -9
  304. package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -5
  305. package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -5
  306. package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +0 -12
  307. package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +0 -9
  308. package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +0 -9
  309. package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +0 -11
  310. package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
  311. package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +0 -9
  312. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +0 -45
  313. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +0 -8
  314. package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +0 -9
  315. package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +0 -10
  316. package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +0 -10
  317. package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +0 -16
  318. package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +0 -9
  319. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +0 -20
  320. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +0 -8
  321. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +0 -9
  322. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +0 -9
  323. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +0 -19
  324. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +0 -8
  325. package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +0 -9
  326. package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +0 -15
  327. package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +0 -9
  328. package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +0 -15
  329. package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +0 -12
  330. package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +0 -20
  331. package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +0 -9
  332. package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +0 -9
  333. package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +0 -9
  334. package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +0 -9
  335. package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +0 -20
  336. package/dist/api/resources/transactions/types/RerunFlowsTransactionsResponse.js +0 -2
  337. package/dist/api/resources/transactions/types/UpdateTransactionsResponse.d.ts +0 -6
  338. package/dist/api/resources/transactions/types/UpdateTransactionsResponse.js +0 -2
  339. /package/dist/api/resources/clicks/client/requests/{GetClicksRequest.js → CreateClickRequest.js} +0 -0
  340. /package/dist/api/resources/clicks/{types/CreateClicksRequest.js → client/requests/GetClickRequest.js} +0 -0
  341. /package/dist/api/resources/clicks/types/{CreateClicksResponse.js → CreateClickResponse.js} +0 -0
  342. /package/dist/api/resources/clicks/types/{GetClicksResponse.js → GetClickResponse.js} +0 -0
  343. /package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.js → ApproveCommissionRequest.js} +0 -0
  344. /package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.js → DeclineCommissionRequest.js} +0 -0
  345. /package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.js → DeleteCommissionRequest.js} +0 -0
  346. /package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.js → GetCommissionRequest.js} +0 -0
  347. /package/dist/api/resources/commissions/{client/requests/UpdateCommissionsRequest.js → types/ApproveCommissionResponse.js} +0 -0
  348. /package/dist/api/resources/commissions/types/{ApproveCommissionsResponse.js → CreateCommissionResponse.js} +0 -0
  349. /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → DeclineCommissionResponse.js} +0 -0
  350. /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
  351. /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → GetCommissionResponse.js} +0 -0
  352. /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
  353. /package/dist/api/resources/{commissions/types/GetCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
  354. /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/GetCustomerRequest.js} +0 -0
  355. /package/dist/api/resources/customers/{client/requests/DeleteCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
  356. /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/DeleteCustomerResponse.js} +0 -0
  357. /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → GetCustomerResponse.js} +0 -0
  358. /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
  359. /package/dist/api/resources/{embed → embedTokens}/client/index.d.ts +0 -0
  360. /package/dist/api/resources/{embed → embedTokens}/client/index.js +0 -0
  361. /package/dist/api/resources/{customers/types/GetCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
  362. /package/dist/api/resources/{embed → embedTokens}/client/requests/index.js +0 -0
  363. /package/dist/api/resources/{embed → embedTokens}/index.d.ts +0 -0
  364. /package/dist/api/resources/{embed → embedTokens}/index.js +0 -0
  365. /package/dist/api/resources/{customers/types/UpdateCustomersResponse.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
  366. /package/dist/api/resources/{embed/client/requests/CreateTokenEmbedRequest.js → flows/client/requests/GetFlowRequest.js} +0 -0
  367. /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/types/GetFlowResponse.js} +0 -0
  368. /package/dist/api/resources/{flows/client/requests/GetFlowsRequest.js → groups/client/requests/GetGroupRequest.js} +0 -0
  369. /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/types/GetGroupResponse.js} +0 -0
  370. /package/dist/api/resources/{groups/client/requests/GetGroupsRequest.js → links/client/requests/CreateLinkRequest.js} +0 -0
  371. /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/DeleteLinkRequest.js} +0 -0
  372. /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
  373. /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkRequest.js} +0 -0
  374. /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → UpdateLinkRequest.js} +0 -0
  375. /package/dist/api/resources/links/{client/requests/GetLinksRequest.js → types/CreateLinkResponse.js} +0 -0
  376. /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/DeleteLinkResponse.js} +0 -0
  377. /package/dist/api/resources/links/types/{CreateLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
  378. /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkResponse.js} +0 -0
  379. /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → UpdateLinkResponse.js} +0 -0
  380. /package/dist/api/resources/{links/types/GetLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
  381. /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/GetPartnerRequest.js} +0 -0
  382. /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → RejectPartnerRequest.js} +0 -0
  383. /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
  384. /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
  385. /package/dist/api/resources/partners/{client/requests/SuspendPartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
  386. /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/CreatePartnerResponse.js} +0 -0
  387. /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → GetPartnerResponse.js} +0 -0
  388. /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → RejectPartnerResponse.js} +0 -0
  389. /package/dist/api/resources/partners/types/{GetPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
  390. /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
  391. /package/dist/api/resources/{partners/types/SuspendPartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
  392. /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/types/GetProgramResponse.js} +0 -0
  393. /package/dist/api/resources/{programs/client/requests/GetProgramsRequest.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
  394. /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/GetPromotionCodeRequest.js} +0 -0
  395. /package/dist/api/resources/promotionCodes/{client/requests/DeletePromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
  396. /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/DeletePromotionCodeResponse.js} +0 -0
  397. /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
  398. /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
  399. /package/dist/api/resources/{promotionCodes/types/GetPromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
  400. /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsLinksRequest.js} +0 -0
  401. /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsOverviewRequest.js} +0 -0
  402. /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsPartnersRequest.js} +0 -0
  403. /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
  404. /package/dist/api/resources/reports/{client/requests/PartnersReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
  405. /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsLinksResponse.js} +0 -0
  406. /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsOverviewResponse.js} +0 -0
  407. /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsPartnersResponse.js} +0 -0
  408. /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
  409. /package/dist/api/resources/{reports/types/PartnersReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
  410. /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/DeleteTransactionRequest.js} +0 -0
  411. /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → GetTransactionRequest.js} +0 -0
  412. /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
  413. /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
  414. /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
  415. /package/dist/api/resources/transactions/{client/requests/RerunFlowsTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
  416. /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/DeleteTransactionResponse.js} +0 -0
  417. /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → GetTransactionResponse.js} +0 -0
  418. /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
  419. /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
  420. /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
@@ -12,11 +12,14 @@ export class CustomersClient {
12
12
  this._options = normalizeClientOptionsWithAuth(options);
13
13
  }
14
14
  /**
15
+ * Lists customers. Filter by program, partner, link, click, status or your own customer_id, and page with cursors.
16
+ *
15
17
  * @param {ToltApi.ListCustomersRequest} request
16
18
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
17
19
  *
18
20
  * @throws {@link ToltApi.BadRequestError}
19
21
  * @throws {@link ToltApi.UnauthorizedError}
22
+ * @throws {@link ToltApi.ContentTooLargeError}
20
23
  * @throws {@link ToltApi.TooManyRequestsError}
21
24
  * @throws {@link errors.ToltApiError}
22
25
  * @throws {@link errors.ToltApiTimeoutError}
@@ -24,82 +27,106 @@ export class CustomersClient {
24
27
  * @example
25
28
  * await client.customers.list()
26
29
  */
27
- list(request = {}, requestOptions) {
28
- return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
29
- }
30
- async __list(request = {}, requestOptions) {
31
- const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, click_id: clickId, link_id: linkId, } = request;
32
- const _queryParams = {
33
- limit,
34
- order: order != null ? order : undefined,
35
- sort: sort != null ? sort : undefined,
36
- starting_after: startingAfter,
37
- ending_before: endingBefore,
38
- created_after: createdAfter != null ? createdAfter : undefined,
39
- created_before: createdBefore != null ? createdBefore : undefined,
40
- updated_after: updatedAfter != null ? updatedAfter : undefined,
41
- updated_before: updatedBefore != null ? updatedBefore : undefined,
42
- program_id: programId,
43
- partner_id: partnerId,
44
- customer_id: customerId,
45
- status: status != null ? status : undefined,
46
- search,
47
- click_id: clickId,
48
- link_id: linkId,
49
- };
50
- const _authRequest = await this._options.authProvider.getAuthRequest();
51
- const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
52
- const _response = await core.fetcher({
53
- url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
54
- (await core.Supplier.get(this._options.environment)) ??
55
- environments.ToltApiEnvironment.Production, "v2/customers"),
56
- method: "GET",
57
- headers: _headers,
58
- queryString: core.url
59
- .queryBuilder()
60
- .addMany(_queryParams)
61
- .mergeAdditional(requestOptions?.queryParams)
62
- .build(),
63
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
64
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
65
- abortSignal: requestOptions?.abortSignal,
66
- fetchFn: this._options?.fetch,
67
- logging: this._options.logging,
68
- });
69
- if (_response.ok) {
70
- return { data: _response.body, rawResponse: _response.rawResponse };
71
- }
72
- if (_response.error.reason === "status-code") {
73
- switch (_response.error.statusCode) {
74
- case 400:
75
- throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
76
- case 401:
77
- throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
78
- case 429:
79
- throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
80
- default:
81
- throw new errors.ToltApiError({
82
- statusCode: _response.error.statusCode,
83
- body: _response.error.body,
84
- rawResponse: _response.rawResponse,
85
- });
30
+ async list(request = {}, requestOptions) {
31
+ const list = core.HttpResponsePromise.interceptFunction(async (request) => {
32
+ const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, click_id: clickId, link_id: linkId, } = request;
33
+ const _queryParams = {
34
+ limit,
35
+ order: order != null ? order : undefined,
36
+ sort: sort != null ? sort : undefined,
37
+ starting_after: startingAfter,
38
+ ending_before: endingBefore,
39
+ created_after: createdAfter != null ? createdAfter : undefined,
40
+ created_before: createdBefore != null ? createdBefore : undefined,
41
+ updated_after: updatedAfter != null ? updatedAfter : undefined,
42
+ updated_before: updatedBefore != null ? updatedBefore : undefined,
43
+ program_id: programId,
44
+ partner_id: partnerId,
45
+ customer_id: customerId,
46
+ status: status != null ? status : undefined,
47
+ search,
48
+ click_id: clickId,
49
+ link_id: linkId,
50
+ };
51
+ const _authRequest = await this._options.authProvider.getAuthRequest();
52
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
53
+ const _response = await core.fetcher({
54
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
55
+ (await core.Supplier.get(this._options.environment)) ??
56
+ environments.ToltApiEnvironment.Default, "v2/customers"),
57
+ method: "GET",
58
+ headers: _headers,
59
+ queryString: core.url
60
+ .queryBuilder()
61
+ .addMany(_queryParams)
62
+ .mergeAdditional(requestOptions?.queryParams)
63
+ .build(),
64
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
65
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
66
+ abortSignal: requestOptions?.abortSignal,
67
+ fetchFn: this._options?.fetch,
68
+ logging: this._options.logging,
69
+ });
70
+ if (_response.ok) {
71
+ return {
72
+ data: _response.body,
73
+ rawResponse: _response.rawResponse,
74
+ };
86
75
  }
87
- }
88
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/customers");
76
+ if (_response.error.reason === "status-code") {
77
+ switch (_response.error.statusCode) {
78
+ case 400:
79
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
80
+ case 401:
81
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
82
+ case 413:
83
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
84
+ case 429:
85
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
86
+ default:
87
+ throw new errors.ToltApiError({
88
+ statusCode: _response.error.statusCode,
89
+ body: _response.error.body,
90
+ rawResponse: _response.rawResponse,
91
+ });
92
+ }
93
+ }
94
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/customers");
95
+ });
96
+ const dataWithRawResponse = await list(request).withRawResponse();
97
+ return new core.Page({
98
+ response: dataWithRawResponse.data,
99
+ rawResponse: dataWithRawResponse.rawResponse,
100
+ hasNextPage: (response) => response?.next_cursor != null &&
101
+ !(typeof response?.next_cursor === "string" && response?.next_cursor === ""),
102
+ getItems: (response) => response?.data ?? [],
103
+ loadPage: (response) => {
104
+ return list(core.setObjectProperty(request, "starting_after", response?.next_cursor));
105
+ },
106
+ });
89
107
  }
90
108
  /**
91
- * @param {ToltApi.CreateCustomersRequest} request
109
+ * Creates a customer attributed to a partner. Pass partner_id or link_id, and optionally the click_id that brought them in.
110
+ *
111
+ * @param {ToltApi.CreateCustomerRequest} request
92
112
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
93
113
  *
94
114
  * @throws {@link ToltApi.BadRequestError}
95
115
  * @throws {@link ToltApi.UnauthorizedError}
96
116
  * @throws {@link ToltApi.ConflictError}
117
+ * @throws {@link ToltApi.ContentTooLargeError}
97
118
  * @throws {@link ToltApi.TooManyRequestsError}
98
119
  * @throws {@link errors.ToltApiError}
99
120
  * @throws {@link errors.ToltApiTimeoutError}
100
121
  *
101
122
  * @example
102
- * await client.customers.create()
123
+ * await client.customers.create({
124
+ * email: "alex@example.com",
125
+ * name: "Alex Morgan",
126
+ * customer_id: "user_4821",
127
+ * link_id: "lnk_mtTeeckFa1vMdvDFXretQNs6",
128
+ * partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
129
+ * })
103
130
  */
104
131
  create(request = {}, requestOptions) {
105
132
  return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
@@ -110,7 +137,7 @@ export class CustomersClient {
110
137
  const _response = await core.fetcher({
111
138
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
112
139
  (await core.Supplier.get(this._options.environment)) ??
113
- environments.ToltApiEnvironment.Production, "v2/customers"),
140
+ environments.ToltApiEnvironment.Default, "v2/customers"),
114
141
  method: "POST",
115
142
  headers: _headers,
116
143
  contentType: "application/json",
@@ -118,7 +145,7 @@ export class CustomersClient {
118
145
  requestType: "json",
119
146
  body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
120
147
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
121
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
148
+ maxRetries: 0,
122
149
  abortSignal: requestOptions?.abortSignal,
123
150
  fetchFn: this._options?.fetch,
124
151
  logging: this._options.logging,
@@ -134,6 +161,8 @@ export class CustomersClient {
134
161
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
135
162
  case 409:
136
163
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
164
+ case 413:
165
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
137
166
  case 429:
138
167
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
139
168
  default:
@@ -147,18 +176,21 @@ export class CustomersClient {
147
176
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/customers");
148
177
  }
149
178
  /**
150
- * @param {ToltApi.GetCustomersRequest} request
179
+ * Gets a customer by ID, with its status, the partner it is attributed to and your own customer and subscription IDs.
180
+ *
181
+ * @param {ToltApi.GetCustomerRequest} request
151
182
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
152
183
  *
153
184
  * @throws {@link ToltApi.UnauthorizedError}
154
185
  * @throws {@link ToltApi.NotFoundError}
186
+ * @throws {@link ToltApi.ContentTooLargeError}
155
187
  * @throws {@link ToltApi.TooManyRequestsError}
156
188
  * @throws {@link errors.ToltApiError}
157
189
  * @throws {@link errors.ToltApiTimeoutError}
158
190
  *
159
191
  * @example
160
192
  * await client.customers.get({
161
- * id: "id"
193
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
162
194
  * })
163
195
  */
164
196
  get(request, requestOptions) {
@@ -171,7 +203,7 @@ export class CustomersClient {
171
203
  const _response = await core.fetcher({
172
204
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
173
205
  (await core.Supplier.get(this._options.environment)) ??
174
- environments.ToltApiEnvironment.Production, `v2/customers/${core.url.encodePathParam(id)}`),
206
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
175
207
  method: "GET",
176
208
  headers: _headers,
177
209
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -190,6 +222,8 @@ export class CustomersClient {
190
222
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
191
223
  case 404:
192
224
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
225
+ case 413:
226
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
193
227
  case 429:
194
228
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
195
229
  default:
@@ -203,20 +237,25 @@ export class CustomersClient {
203
237
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/customers/{id}");
204
238
  }
205
239
  /**
206
- * @param {ToltApi.UpdateCustomersRequest} request
240
+ * Updates a customer's name, email, status, your own IDs, or the click and link the customer came from.
241
+ *
242
+ * @param {ToltApi.UpdateCustomerRequest} request
207
243
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
208
244
  *
209
245
  * @throws {@link ToltApi.BadRequestError}
210
246
  * @throws {@link ToltApi.UnauthorizedError}
211
247
  * @throws {@link ToltApi.NotFoundError}
212
248
  * @throws {@link ToltApi.ConflictError}
249
+ * @throws {@link ToltApi.ContentTooLargeError}
213
250
  * @throws {@link ToltApi.TooManyRequestsError}
214
251
  * @throws {@link errors.ToltApiError}
215
252
  * @throws {@link errors.ToltApiTimeoutError}
216
253
  *
217
254
  * @example
218
255
  * await client.customers.update({
219
- * id: "id"
256
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv",
257
+ * name: "Alex Morgan",
258
+ * status: "active"
220
259
  * })
221
260
  */
222
261
  update(request, requestOptions) {
@@ -229,7 +268,7 @@ export class CustomersClient {
229
268
  const _response = await core.fetcher({
230
269
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
231
270
  (await core.Supplier.get(this._options.environment)) ??
232
- environments.ToltApiEnvironment.Production, `v2/customers/${core.url.encodePathParam(id)}`),
271
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
233
272
  method: "PUT",
234
273
  headers: _headers,
235
274
  contentType: "application/json",
@@ -255,6 +294,8 @@ export class CustomersClient {
255
294
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
256
295
  case 409:
257
296
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
297
+ case 413:
298
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
258
299
  case 429:
259
300
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
260
301
  default:
@@ -268,19 +309,22 @@ export class CustomersClient {
268
309
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/customers/{id}");
269
310
  }
270
311
  /**
271
- * @param {ToltApi.DeleteCustomersRequest} request
312
+ * Deletes a customer. Fails when any of the customer's commissions is paid or already included in a payout.
313
+ *
314
+ * @param {ToltApi.DeleteCustomerRequest} request
272
315
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
273
316
  *
274
317
  * @throws {@link ToltApi.BadRequestError}
275
318
  * @throws {@link ToltApi.UnauthorizedError}
276
319
  * @throws {@link ToltApi.NotFoundError}
320
+ * @throws {@link ToltApi.ContentTooLargeError}
277
321
  * @throws {@link ToltApi.TooManyRequestsError}
278
322
  * @throws {@link errors.ToltApiError}
279
323
  * @throws {@link errors.ToltApiTimeoutError}
280
324
  *
281
325
  * @example
282
326
  * await client.customers.delete({
283
- * id: "id"
327
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
284
328
  * })
285
329
  */
286
330
  delete(request, requestOptions) {
@@ -293,7 +337,7 @@ export class CustomersClient {
293
337
  const _response = await core.fetcher({
294
338
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
295
339
  (await core.Supplier.get(this._options.environment)) ??
296
- environments.ToltApiEnvironment.Production, `v2/customers/${core.url.encodePathParam(id)}`),
340
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
297
341
  method: "DELETE",
298
342
  headers: _headers,
299
343
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -314,6 +358,8 @@ export class CustomersClient {
314
358
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
315
359
  case 404:
316
360
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
361
+ case 413:
362
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
317
363
  case 429:
318
364
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
319
365
  default:
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * email: "alex@example.com",
5
+ * name: "Alex Morgan",
6
+ * customer_id: "user_4821",
7
+ * link_id: "lnk_mtTeeckFa1vMdvDFXretQNs6",
8
+ * partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
9
+ * }
10
+ */
11
+ export interface CreateCustomerRequest {
12
+ /** Customer's email, stored lowercased and used as their identifier. It must not belong to another customer. Provide this or customer_id. */
13
+ email?: string;
14
+ /** Resolve a code in the partner’s program, ignoring case, preferring partner, group, then program scope. An unmatched code leaves attribution unchanged. */
15
+ promotion_code?: string;
16
+ /** When the customer was created, for backdating. Defaults to now; lead_at, and active_at for active customers, default to it. */
17
+ created_at?: string;
18
+ /** Customer's full name as you want it shown in the dashboard; it does not affect attribution or matching. */
19
+ name?: string;
20
+ /** Customer's id in your billing system, such as a Stripe customer id. The billing integration matches payments to this customer by it. Provide this or email. */
21
+ customer_id?: string;
22
+ /** Lifecycle stage of the customer. Defaults to lead (signed up, not paying yet); recording a transaction for the customer makes them active. */
23
+ status?: CreateCustomerRequest.Status;
24
+ /** Customer's subscription id in your billing system, such as a Stripe subscription id. */
25
+ subscription_id?: string;
26
+ /** Id of the tracked click the customer came from, as returned when listing clicks. It must belong to the partner, and its link is used when link_id is omitted. */
27
+ click_id?: string;
28
+ /** Id of the referral link the customer came through (lnk_...). Without partner_id the link's partner is used; with it, the link must belong to that partner. */
29
+ link_id?: string;
30
+ /** Id of the partner who referred the customer (part_...), as returned when listing partners. The customer joins that partner's program. Provide this or link_id. */
31
+ partner_id?: string;
32
+ /** When the customer signed up as a lead, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. Defaults to created_at. */
33
+ lead_at?: string | null;
34
+ /** When the customer became a paying customer, as a timestamp with a time zone. Defaults to created_at when status is active, otherwise it is set when a transaction is recorded for the customer. */
35
+ active_at?: string | null;
36
+ }
37
+ export declare namespace CreateCustomerRequest {
38
+ /** Lifecycle stage of the customer. Defaults to lead (signed up, not paying yet); recording a transaction for the customer makes them active. */
39
+ const Status: {
40
+ readonly Lead: "lead";
41
+ readonly Active: "active";
42
+ readonly Canceled: "canceled";
43
+ readonly Suspended: "suspended";
44
+ readonly Trialing: "trialing";
45
+ };
46
+ type Status = (typeof Status)[keyof typeof Status];
47
+ }
@@ -0,0 +1,12 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var CreateCustomerRequest;
3
+ (function (CreateCustomerRequest) {
4
+ /** Lifecycle stage of the customer. Defaults to lead (signed up, not paying yet); recording a transaction for the customer makes them active. */
5
+ CreateCustomerRequest.Status = {
6
+ Lead: "lead",
7
+ Active: "active",
8
+ Canceled: "canceled",
9
+ Suspended: "suspended",
10
+ Trialing: "trialing",
11
+ };
12
+ })(CreateCustomerRequest || (CreateCustomerRequest = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
5
+ * }
6
+ */
7
+ export interface DeleteCustomerRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
5
+ * }
6
+ */
7
+ export interface GetCustomerRequest {
8
+ id: string;
9
+ }
@@ -4,27 +4,36 @@ import type * as ToltApi from "../../../../index.js";
4
4
  * {}
5
5
  */
6
6
  export interface ListCustomersRequest {
7
+ /** How many rows to return in one page. */
7
8
  limit?: number;
9
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
8
10
  order?: ToltApi.ListCustomersRequestOrder;
9
- /** Column the list is ordered and paged by. */
11
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
10
12
  sort?: ToltApi.ListCustomersRequestSort;
11
13
  /** Continue after a position: the next_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with ending_before. */
12
14
  starting_after?: string;
13
15
  /** Page backward from a position: the prev_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with starting_after. */
14
16
  ending_before?: string;
15
- /** Only items created at or after this ISO 8601 time. */
17
+ /** Start of a window on when items were created: items created at this time or later are included, for example 2026-01-01T00:00:00Z. Leave it out for no lower bound. */
16
18
  created_after?: string;
17
- /** Only items created before this ISO 8601 time. */
19
+ /** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
18
20
  created_before?: string;
19
- /** Only items updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
21
+ /** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
20
22
  updated_after?: string;
21
- /** Only items updated before this ISO 8601 time. */
23
+ /** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
22
24
  updated_before?: string;
25
+ /** Limit to one program, by its id (prg_...) as returned when listing programs. */
23
26
  program_id?: string;
27
+ /** Limit to one partner, by its id (part_...) as returned when listing partners. */
24
28
  partner_id?: string;
29
+ /** Exact match on the customer's customer_id field, the id the customer has in your own system or billing provider; not the Tolt customer id. */
25
30
  customer_id?: string;
31
+ /** Keep only customers at this lifecycle stage, from signed-up leads through trials to paying, canceled or suspended customers. Leave it out to include every stage. */
26
32
  status?: ToltApi.ListCustomersRequestStatus;
33
+ /** Text matched anywhere in the customer's email, name, identifier or customer_id, ignoring case. */
27
34
  search?: string;
35
+ /** Only the customers attributed to this click, by its id (clk_...). */
28
36
  click_id?: string;
37
+ /** Only customers attributed to this referral link (lnk_...), directly or through one of its clicks. */
29
38
  link_id?: string;
30
39
  }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "cus_LBfjvtfct9pVUeLojMHiGnXv",
5
+ * name: "Alex Morgan",
6
+ * status: "active"
7
+ * }
8
+ */
9
+ export interface UpdateCustomerRequest {
10
+ id: string;
11
+ /** New email, stored lowercased and used as the customer's identifier. It must not belong to another customer. */
12
+ email?: string;
13
+ /** Resolve a code in the partner’s program, ignoring case, preferring partner, group, then program scope. An unmatched code leaves attribution unchanged. Null clears the promotion code and its derived attribution. */
14
+ promotion_code?: string | null;
15
+ /** When the customer was created, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. Reports and filters that date customers by creation use it; those that date them by conversion read active_at, which this does not change. */
16
+ created_at?: string;
17
+ /** Customer's full name as you want it shown in the dashboard; it does not affect attribution or matching. */
18
+ name?: string | null;
19
+ /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
20
+ status?: UpdateCustomerRequest.Status | null;
21
+ /** Customer's id in your billing system, such as a Stripe customer id. The billing integration matches payments to this customer by it. */
22
+ customer_id?: string;
23
+ /** Customer's subscription id in your billing system, such as a Stripe subscription id. */
24
+ subscription_id?: string | null;
25
+ /** Id of the tracked click the customer came from, as returned when listing clicks. It must belong to the customer's partner; link_id is not changed. */
26
+ click_id?: string | null;
27
+ /** Id of the referral link the customer came through (lnk_...). It must belong to the customer's partner; a customer without a partner takes the link's partner and program. */
28
+ link_id?: string | null;
29
+ /** When the customer signed up as a lead, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. */
30
+ lead_at?: string | null;
31
+ /** When the customer became a paying customer, as a timestamp with a time zone. */
32
+ active_at?: string | null;
33
+ }
34
+ export declare namespace UpdateCustomerRequest {
35
+ /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
36
+ const Status: {
37
+ readonly Lead: "lead";
38
+ readonly Active: "active";
39
+ readonly Canceled: "canceled";
40
+ readonly Suspended: "suspended";
41
+ readonly Trialing: "trialing";
42
+ };
43
+ type Status = (typeof Status)[keyof typeof Status];
44
+ }
@@ -0,0 +1,12 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var UpdateCustomerRequest;
3
+ (function (UpdateCustomerRequest) {
4
+ /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
5
+ UpdateCustomerRequest.Status = {
6
+ Lead: "lead",
7
+ Active: "active",
8
+ Canceled: "canceled",
9
+ Suspended: "suspended",
10
+ Trialing: "trialing",
11
+ };
12
+ })(UpdateCustomerRequest || (UpdateCustomerRequest = {}));
@@ -1,5 +1,5 @@
1
- export { CreateCustomersRequest } from "./CreateCustomersRequest.js";
2
- export type { DeleteCustomersRequest } from "./DeleteCustomersRequest.js";
3
- export type { GetCustomersRequest } from "./GetCustomersRequest.js";
1
+ export { CreateCustomerRequest } from "./CreateCustomerRequest.js";
2
+ export type { DeleteCustomerRequest } from "./DeleteCustomerRequest.js";
3
+ export type { GetCustomerRequest } from "./GetCustomerRequest.js";
4
4
  export type { ListCustomersRequest } from "./ListCustomersRequest.js";
5
- export { UpdateCustomersRequest } from "./UpdateCustomersRequest.js";
5
+ export { UpdateCustomerRequest } from "./UpdateCustomerRequest.js";
@@ -1,2 +1,2 @@
1
- export { CreateCustomersRequest } from "./CreateCustomersRequest.js";
2
- export { UpdateCustomersRequest } from "./UpdateCustomersRequest.js";
1
+ export { CreateCustomerRequest } from "./CreateCustomerRequest.js";
2
+ export { UpdateCustomerRequest } from "./UpdateCustomerRequest.js";
@@ -1,5 +1,5 @@
1
1
  import type * as ToltApi from "../../../index.js";
2
- export interface DeleteCustomersResponse {
2
+ export interface CreateCustomerResponse {
3
3
  success: boolean;
4
4
  message: string;
5
5
  data: ToltApi.Customer;
@@ -1,5 +1,5 @@
1
1
  import type * as ToltApi from "../../../index.js";
2
- export interface UpdateCustomersResponse {
2
+ export interface DeleteCustomerResponse {
3
3
  success: boolean;
4
4
  message: string;
5
5
  data: ToltApi.Customer;
@@ -1,5 +1,5 @@
1
1
  import type * as ToltApi from "../../../index.js";
2
- export interface GetCustomersResponse {
2
+ export interface GetCustomerResponse {
3
3
  success: boolean;
4
4
  message: string;
5
5
  data: ToltApi.Customer;
@@ -1,3 +1,4 @@
1
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
1
2
  export declare const ListCustomersRequestOrder: {
2
3
  readonly Asc: "asc";
3
4
  readonly Desc: "desc";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
2
3
  export const ListCustomersRequestOrder = {
3
4
  Asc: "asc",
4
5
  Desc: "desc",
@@ -1,4 +1,4 @@
1
- /** Column the list is ordered and paged by. */
1
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
2
2
  export declare const ListCustomersRequestSort: {
3
3
  readonly CreatedAt: "created_at";
4
4
  readonly UpdatedAt: "updated_at";
@@ -1,5 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- /** Column the list is ordered and paged by. */
2
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
3
3
  export const ListCustomersRequestSort = {
4
4
  CreatedAt: "created_at",
5
5
  UpdatedAt: "updated_at",
@@ -1,3 +1,4 @@
1
+ /** Keep only customers at this lifecycle stage, from signed-up leads through trials to paying, canceled or suspended customers. Leave it out to include every stage. */
1
2
  export declare const ListCustomersRequestStatus: {
2
3
  readonly Lead: "lead";
3
4
  readonly Active: "active";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Keep only customers at this lifecycle stage, from signed-up leads through trials to paying, canceled or suspended customers. Leave it out to include every stage. */
2
3
  export const ListCustomersRequestStatus = {
3
4
  Lead: "lead",
4
5
  Active: "active",
@@ -1,5 +1,5 @@
1
1
  import type * as ToltApi from "../../../index.js";
2
- export interface CreateCustomersResponse {
2
+ export interface UpdateCustomerResponse {
3
3
  success: boolean;
4
4
  message: string;
5
5
  data: ToltApi.Customer;
@@ -1,8 +1,8 @@
1
- export * from "./CreateCustomersResponse.js";
2
- export * from "./DeleteCustomersResponse.js";
3
- export * from "./GetCustomersResponse.js";
1
+ export * from "./CreateCustomerResponse.js";
2
+ export * from "./DeleteCustomerResponse.js";
3
+ export * from "./GetCustomerResponse.js";
4
4
  export * from "./ListCustomersRequestOrder.js";
5
5
  export * from "./ListCustomersRequestSort.js";
6
6
  export * from "./ListCustomersRequestStatus.js";
7
7
  export * from "./ListCustomersResponse.js";
8
- export * from "./UpdateCustomersResponse.js";
8
+ export * from "./UpdateCustomerResponse.js";