@tolt/api 0.7.0 → 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 (301) 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 +2 -2
  7. package/dist/api/errors/NotFoundError.d.ts +2 -2
  8. package/dist/api/errors/TooManyRequestsError.d.ts +2 -2
  9. package/dist/api/errors/UnauthorizedError.d.ts +2 -2
  10. package/dist/api/resources/clicks/client/Client.d.ts +10 -7
  11. package/dist/api/resources/clicks/client/Client.js +82 -68
  12. package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
  13. package/dist/api/resources/clicks/client/requests/{GetClicksRequest.d.ts → GetClickRequest.d.ts} +1 -1
  14. package/dist/api/resources/clicks/client/requests/index.d.ts +2 -1
  15. package/dist/api/resources/clicks/types/{CreateClicksResponse.d.ts → CreateClickResponse.d.ts} +1 -1
  16. package/dist/api/resources/clicks/types/{GetClicksResponse.d.ts → GetClickResponse.d.ts} +1 -1
  17. package/dist/api/resources/clicks/types/index.d.ts +2 -3
  18. package/dist/api/resources/clicks/types/index.js +2 -3
  19. package/dist/api/resources/commissions/client/Client.d.ts +19 -15
  20. package/dist/api/resources/commissions/client/Client.js +94 -76
  21. package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.d.ts → ApproveCommissionRequest.d.ts} +1 -1
  22. package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.d.ts +40 -0
  23. package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.js +9 -0
  24. package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.d.ts → DeclineCommissionRequest.d.ts} +1 -1
  25. package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.d.ts → DeleteCommissionRequest.d.ts} +1 -1
  26. package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.d.ts → GetCommissionRequest.d.ts} +1 -1
  27. package/dist/api/resources/commissions/client/requests/{UpdateCommissionsRequest.d.ts → UpdateCommissionRequest.d.ts} +3 -3
  28. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +9 -0
  29. package/dist/api/resources/commissions/client/requests/index.d.ts +6 -5
  30. package/dist/api/resources/commissions/client/requests/index.js +2 -1
  31. package/dist/api/resources/commissions/types/{UpdateCommissionsResponse.d.ts → ApproveCommissionResponse.d.ts} +1 -1
  32. package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.d.ts → CreateCommissionResponse.d.ts} +1 -1
  33. package/dist/api/resources/commissions/types/{CreateCommissionsResponse.d.ts → DeclineCommissionResponse.d.ts} +1 -1
  34. package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
  35. package/dist/api/resources/commissions/types/{GetCommissionsResponse.d.ts → GetCommissionResponse.d.ts} +1 -1
  36. package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
  37. package/dist/api/resources/commissions/types/index.d.ts +6 -7
  38. package/dist/api/resources/commissions/types/index.js +6 -7
  39. package/dist/api/resources/customers/client/Client.d.ts +9 -10
  40. package/dist/api/resources/customers/client/Client.js +84 -71
  41. package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.d.ts → CreateCustomerRequest.d.ts} +3 -3
  42. package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.js → CreateCustomerRequest.js} +4 -4
  43. package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.d.ts → DeleteCustomerRequest.d.ts} +1 -1
  44. package/dist/api/resources/customers/client/requests/{GetCustomersRequest.d.ts → GetCustomerRequest.d.ts} +1 -1
  45. package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.d.ts → UpdateCustomerRequest.d.ts} +3 -3
  46. package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.js → UpdateCustomerRequest.js} +4 -4
  47. package/dist/api/resources/customers/client/requests/index.d.ts +4 -4
  48. package/dist/api/resources/customers/client/requests/index.js +2 -2
  49. package/dist/api/resources/customers/types/{DeleteCustomersResponse.d.ts → CreateCustomerResponse.d.ts} +1 -1
  50. package/dist/api/resources/customers/types/{UpdateCustomersResponse.d.ts → DeleteCustomerResponse.d.ts} +1 -1
  51. package/dist/api/resources/customers/types/{GetCustomersResponse.d.ts → GetCustomerResponse.d.ts} +1 -1
  52. package/dist/api/resources/customers/types/{CreateCustomersResponse.d.ts → UpdateCustomerResponse.d.ts} +1 -1
  53. package/dist/api/resources/customers/types/index.d.ts +4 -4
  54. package/dist/api/resources/customers/types/index.js +4 -4
  55. package/dist/api/resources/{embed → embedTokens}/client/Client.d.ts +9 -11
  56. package/dist/api/resources/{embed → embedTokens}/client/Client.js +7 -9
  57. package/dist/api/resources/embedTokens/client/index.d.ts +1 -0
  58. package/dist/api/resources/embedTokens/client/index.js +1 -0
  59. package/dist/api/resources/embedTokens/client/requests/CreateEmbedTokenRequest.d.ts +21 -0
  60. package/dist/api/resources/embedTokens/client/requests/index.d.ts +1 -0
  61. package/dist/api/resources/embedTokens/exports.d.ts +2 -0
  62. package/dist/api/resources/{embed → embedTokens}/exports.js +1 -1
  63. package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.d.ts → embedTokens/types/CreateEmbedTokenResponse.d.ts} +1 -1
  64. package/dist/api/resources/embedTokens/types/index.d.ts +1 -0
  65. package/dist/api/resources/embedTokens/types/index.js +1 -0
  66. package/dist/api/resources/flows/client/Client.d.ts +3 -4
  67. package/dist/api/resources/flows/client/Client.js +74 -64
  68. package/dist/api/resources/flows/client/requests/{GetFlowsRequest.d.ts → GetFlowRequest.d.ts} +1 -1
  69. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +1 -1
  70. package/dist/api/resources/flows/client/requests/index.d.ts +1 -1
  71. package/dist/api/resources/flows/types/{GetFlowsResponse.d.ts → GetFlowResponse.d.ts} +1 -1
  72. package/dist/api/resources/flows/types/index.d.ts +1 -2
  73. package/dist/api/resources/flows/types/index.js +1 -2
  74. package/dist/api/resources/groups/client/Client.d.ts +3 -4
  75. package/dist/api/resources/groups/client/Client.js +71 -61
  76. package/dist/api/resources/groups/client/requests/{GetGroupsRequest.d.ts → GetGroupRequest.d.ts} +1 -1
  77. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +1 -1
  78. package/dist/api/resources/groups/client/requests/index.d.ts +1 -1
  79. package/dist/api/resources/groups/types/{GetGroupsResponse.d.ts → GetGroupResponse.d.ts} +1 -1
  80. package/dist/api/resources/groups/types/index.d.ts +1 -2
  81. package/dist/api/resources/groups/types/index.js +1 -2
  82. package/dist/api/resources/index.d.ts +3 -2
  83. package/dist/api/resources/index.js +3 -2
  84. package/dist/api/resources/links/client/Client.d.ts +11 -12
  85. package/dist/api/resources/links/client/Client.js +80 -70
  86. package/dist/api/resources/links/client/requests/{CreateLinksRequest.d.ts → CreateLinkRequest.d.ts} +1 -1
  87. package/dist/api/resources/links/client/requests/{DeleteLinksRequest.d.ts → DeleteLinkRequest.d.ts} +1 -1
  88. package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
  89. package/dist/api/resources/links/client/requests/{GetLinksRequest.d.ts → GetLinkRequest.d.ts} +1 -1
  90. package/dist/api/resources/links/client/requests/{UpdateLinksRequest.d.ts → UpdateLinkRequest.d.ts} +1 -1
  91. package/dist/api/resources/links/client/requests/index.d.ts +5 -5
  92. package/dist/api/resources/links/types/{DeleteLinksResponse.d.ts → CreateLinkResponse.d.ts} +1 -1
  93. package/dist/api/resources/links/types/{CreateLinksResponse.d.ts → DeleteLinkResponse.d.ts} +1 -1
  94. package/dist/api/resources/links/types/GetLinkByParamValueResponse.d.ts +6 -0
  95. package/dist/api/resources/links/types/{GetLinksResponse.d.ts → GetLinkResponse.d.ts} +1 -1
  96. package/dist/api/resources/links/types/{UpdateLinksResponse.d.ts → UpdateLinkResponse.d.ts} +1 -1
  97. package/dist/api/resources/links/types/index.d.ts +5 -5
  98. package/dist/api/resources/links/types/index.js +5 -5
  99. package/dist/api/resources/partners/client/Client.d.ts +13 -14
  100. package/dist/api/resources/partners/client/Client.js +82 -72
  101. package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.d.ts → ApprovePartnerRequest.d.ts} +1 -1
  102. package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.d.ts → CreatePartnerRequest.d.ts} +4 -4
  103. package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.js → CreatePartnerRequest.js} +4 -4
  104. package/dist/api/resources/partners/client/requests/{GetPartnersRequest.d.ts → GetPartnerRequest.d.ts} +1 -1
  105. package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.d.ts → RejectPartnerRequest.d.ts} +1 -1
  106. package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.d.ts → SuspendPartnerRequest.d.ts} +1 -1
  107. package/dist/api/resources/partners/client/requests/{UpdatePartnersRequest.d.ts → UpdatePartnerRequest.d.ts} +1 -1
  108. package/dist/api/resources/partners/client/requests/index.d.ts +6 -6
  109. package/dist/api/resources/partners/client/requests/index.js +1 -1
  110. package/dist/api/resources/partners/types/{RejectPartnersResponse.d.ts → ApprovePartnerResponse.d.ts} +1 -1
  111. package/dist/api/resources/partners/types/{CreatePartnersResponse.d.ts → CreatePartnerResponse.d.ts} +1 -1
  112. package/dist/api/resources/partners/types/{GetPartnersResponse.d.ts → GetPartnerResponse.d.ts} +1 -1
  113. package/dist/api/resources/partners/types/{UpdatePartnersResponse.d.ts → RejectPartnerResponse.d.ts} +1 -1
  114. package/dist/api/resources/partners/types/{ApprovePartnersResponse.d.ts → SuspendPartnerResponse.d.ts} +1 -1
  115. package/dist/api/resources/partners/types/{SuspendPartnersResponse.d.ts → UpdatePartnerResponse.d.ts} +1 -1
  116. package/dist/api/resources/partners/types/index.d.ts +6 -6
  117. package/dist/api/resources/partners/types/index.js +6 -6
  118. package/dist/api/resources/programs/client/Client.d.ts +3 -4
  119. package/dist/api/resources/programs/client/Client.js +69 -59
  120. package/dist/api/resources/programs/client/requests/{GetProgramsRequest.d.ts → GetProgramRequest.d.ts} +1 -1
  121. package/dist/api/resources/programs/client/requests/index.d.ts +1 -1
  122. package/dist/api/resources/programs/types/{GetProgramsResponse.d.ts → GetProgramResponse.d.ts} +1 -1
  123. package/dist/api/resources/programs/types/index.d.ts +1 -1
  124. package/dist/api/resources/programs/types/index.js +1 -1
  125. package/dist/api/resources/promotionCodes/client/Client.d.ts +9 -10
  126. package/dist/api/resources/promotionCodes/client/Client.js +81 -68
  127. package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.d.ts → CreatePromotionCodeRequest.d.ts} +3 -3
  128. package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.js → CreatePromotionCodeRequest.js} +4 -4
  129. package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.d.ts → DeletePromotionCodeRequest.d.ts} +1 -1
  130. package/dist/api/resources/promotionCodes/client/requests/{GetPromotionCodesRequest.d.ts → GetPromotionCodeRequest.d.ts} +1 -1
  131. package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.d.ts → UpdatePromotionCodeRequest.d.ts} +3 -3
  132. package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.js → UpdatePromotionCodeRequest.js} +4 -4
  133. package/dist/api/resources/promotionCodes/client/requests/index.d.ts +4 -4
  134. package/dist/api/resources/promotionCodes/client/requests/index.js +2 -2
  135. package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.d.ts → CreatePromotionCodeResponse.d.ts} +1 -1
  136. package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.d.ts → DeletePromotionCodeResponse.d.ts} +1 -1
  137. package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.d.ts → GetPromotionCodeResponse.d.ts} +1 -1
  138. package/dist/api/resources/promotionCodes/types/{UpdatePromotionCodesResponse.d.ts → UpdatePromotionCodeResponse.d.ts} +1 -1
  139. package/dist/api/resources/promotionCodes/types/index.d.ts +4 -4
  140. package/dist/api/resources/promotionCodes/types/index.js +4 -4
  141. package/dist/api/resources/reports/client/Client.d.ts +12 -14
  142. package/dist/api/resources/reports/client/Client.js +158 -119
  143. package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.d.ts → ReportsCustomersRequest.d.ts} +1 -1
  144. package/dist/api/resources/reports/client/requests/{LinksReportsRequest.d.ts → ReportsLinksRequest.d.ts} +1 -1
  145. package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.d.ts → ReportsOverviewRequest.d.ts} +1 -1
  146. package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.d.ts → ReportsPartnersRequest.d.ts} +1 -1
  147. package/dist/api/resources/reports/client/requests/{TimeseriesReportsRequest.d.ts → ReportsTimeseriesRequest.d.ts} +1 -1
  148. package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
  149. package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.d.ts → ReportsCustomersResponse.d.ts} +1 -1
  150. package/dist/api/resources/reports/types/{LinksReportsResponse.d.ts → ReportsLinksResponse.d.ts} +1 -1
  151. package/dist/api/resources/reports/types/{OverviewReportsResponse.d.ts → ReportsOverviewResponse.d.ts} +1 -1
  152. package/dist/api/resources/reports/types/{PartnersReportsResponse.d.ts → ReportsPartnersResponse.d.ts} +1 -1
  153. package/dist/api/resources/reports/types/{TimeseriesReportsResponse.d.ts → ReportsTimeseriesResponse.d.ts} +1 -1
  154. package/dist/api/resources/reports/types/index.d.ts +5 -5
  155. package/dist/api/resources/reports/types/index.js +5 -5
  156. package/dist/api/resources/transactions/client/Client.d.ts +13 -14
  157. package/dist/api/resources/transactions/client/Client.js +87 -74
  158. package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.d.ts → CreateTransactionRequest.d.ts} +1 -1
  159. package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.d.ts → DeleteTransactionRequest.d.ts} +1 -1
  160. package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.d.ts → GetTransactionRequest.d.ts} +1 -1
  161. package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.d.ts → RefundTransactionRequest.d.ts} +1 -1
  162. package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.d.ts → RerunTransactionFlowsRequest.d.ts} +1 -1
  163. package/dist/api/resources/transactions/client/requests/{UpdateTransactionsRequest.d.ts → UpdateTransactionRequest.d.ts} +1 -1
  164. package/dist/api/resources/transactions/client/requests/index.d.ts +6 -6
  165. package/dist/api/resources/transactions/types/{CreateTransactionsResponse.d.ts → CreateTransactionResponse.d.ts} +1 -1
  166. package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.d.ts → DeleteTransactionResponse.d.ts} +1 -1
  167. package/dist/api/resources/transactions/types/{GetTransactionsResponse.d.ts → GetTransactionResponse.d.ts} +1 -1
  168. package/dist/api/resources/transactions/types/{RefundTransactionsResponse.d.ts → RefundTransactionResponse.d.ts} +1 -1
  169. package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.d.ts → RerunTransactionFlowsResponse.d.ts} +1 -1
  170. package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
  171. package/dist/api/resources/transactions/types/index.d.ts +6 -6
  172. package/dist/api/resources/transactions/types/index.js +6 -6
  173. package/dist/api/types/{Error_.d.ts → ErrorResponse.d.ts} +4 -4
  174. package/dist/api/types/{Error_.js → ErrorResponse.js} +4 -4
  175. package/dist/api/types/index.d.ts +1 -1
  176. package/dist/api/types/index.js +1 -1
  177. package/dist/core/exports.d.ts +1 -0
  178. package/dist/core/exports.js +1 -0
  179. package/dist/core/fetcher/Fetcher.js +35 -4
  180. package/dist/core/fetcher/getErrorResponseBody.js +21 -8
  181. package/dist/core/fetcher/getResponseBody.d.ts +16 -0
  182. package/dist/core/fetcher/getResponseBody.js +26 -22
  183. package/dist/core/fetcher/makePassthroughRequest.js +18 -2
  184. package/dist/core/fetcher/makeRequest.d.ts +6 -1
  185. package/dist/core/fetcher/makeRequest.js +45 -13
  186. package/dist/core/fetcher/requestWithRetries.d.ts +1 -1
  187. package/dist/core/fetcher/requestWithRetries.js +23 -2
  188. package/dist/core/fetcher/signals.d.ts +1 -0
  189. package/dist/core/fetcher/signals.js +1 -1
  190. package/dist/core/index.d.ts +2 -0
  191. package/dist/core/index.js +2 -0
  192. package/dist/core/pagination/Page.d.ts +33 -0
  193. package/dist/core/pagination/Page.js +49 -0
  194. package/dist/core/pagination/exports.d.ts +1 -0
  195. package/dist/core/pagination/index.d.ts +1 -0
  196. package/dist/core/pagination/index.js +1 -0
  197. package/dist/core/url/encodePathParam.d.ts +3 -1
  198. package/dist/core/url/encodePathParam.js +8 -2
  199. package/dist/core/utils/index.d.ts +1 -0
  200. package/dist/core/utils/index.js +1 -0
  201. package/dist/core/utils/setObjectProperty.d.ts +12 -0
  202. package/dist/core/utils/setObjectProperty.js +45 -0
  203. package/dist/errors/ToltApiError.js +15 -1
  204. package/package.json +7 -2
  205. package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
  206. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +0 -9
  207. package/dist/api/resources/commissions/types/ApproveCommissionsResponse.d.ts +0 -6
  208. package/dist/api/resources/commissions/types/CreateCommissionsRequest.d.ts +0 -1
  209. package/dist/api/resources/commissions/types/DeclineCommissionsResponse.d.ts +0 -6
  210. package/dist/api/resources/embed/exports.d.ts +0 -2
  211. package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +0 -1
  212. package/dist/api/resources/embed/types/index.d.ts +0 -2
  213. package/dist/api/resources/embed/types/index.js +0 -2
  214. package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -6
  215. package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -6
  216. package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -6
  217. package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -6
  218. package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
  219. package/dist/api/resources/transactions/types/UpdateTransactionsResponse.d.ts +0 -6
  220. package/dist/api/resources/transactions/types/UpdateTransactionsResponse.js +0 -2
  221. /package/dist/api/resources/clicks/client/requests/{GetClicksRequest.js → CreateClickRequest.js} +0 -0
  222. /package/dist/api/resources/clicks/{types/CreateClicksRequest.js → client/requests/GetClickRequest.js} +0 -0
  223. /package/dist/api/resources/clicks/types/{CreateClicksResponse.js → CreateClickResponse.js} +0 -0
  224. /package/dist/api/resources/clicks/types/{GetClicksResponse.js → GetClickResponse.js} +0 -0
  225. /package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.js → ApproveCommissionRequest.js} +0 -0
  226. /package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.js → DeclineCommissionRequest.js} +0 -0
  227. /package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.js → DeleteCommissionRequest.js} +0 -0
  228. /package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.js → GetCommissionRequest.js} +0 -0
  229. /package/dist/api/resources/commissions/types/{ApproveCommissionsResponse.js → ApproveCommissionResponse.js} +0 -0
  230. /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → CreateCommissionResponse.js} +0 -0
  231. /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeclineCommissionResponse.js} +0 -0
  232. /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
  233. /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → GetCommissionResponse.js} +0 -0
  234. /package/dist/api/resources/commissions/types/{GetCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
  235. /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
  236. /package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.js → GetCustomerRequest.js} +0 -0
  237. /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
  238. /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → DeleteCustomerResponse.js} +0 -0
  239. /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → GetCustomerResponse.js} +0 -0
  240. /package/dist/api/resources/customers/types/{GetCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
  241. /package/dist/api/resources/{customers/types/UpdateCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
  242. /package/dist/api/resources/{embed/client → embedTokens/client/requests}/index.js +0 -0
  243. /package/dist/api/resources/{embed → embedTokens}/index.d.ts +0 -0
  244. /package/dist/api/resources/{embed → embedTokens}/index.js +0 -0
  245. /package/dist/api/resources/{embed/types/CreateTokenEmbedRequest.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
  246. /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/client/requests/GetFlowRequest.js} +0 -0
  247. /package/dist/api/resources/flows/{client/requests/GetFlowsRequest.js → types/GetFlowResponse.js} +0 -0
  248. /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/client/requests/GetGroupRequest.js} +0 -0
  249. /package/dist/api/resources/groups/{client/requests/GetGroupsRequest.js → types/GetGroupResponse.js} +0 -0
  250. /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/CreateLinkRequest.js} +0 -0
  251. /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → DeleteLinkRequest.js} +0 -0
  252. /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
  253. /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → GetLinkRequest.js} +0 -0
  254. /package/dist/api/resources/links/client/requests/{GetLinksRequest.js → UpdateLinkRequest.js} +0 -0
  255. /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/CreateLinkResponse.js} +0 -0
  256. /package/dist/api/resources/links/types/{CreateLinksResponse.js → DeleteLinkResponse.js} +0 -0
  257. /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
  258. /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → GetLinkResponse.js} +0 -0
  259. /package/dist/api/resources/links/types/{GetLinksResponse.js → UpdateLinkResponse.js} +0 -0
  260. /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
  261. /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → GetPartnerRequest.js} +0 -0
  262. /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → RejectPartnerRequest.js} +0 -0
  263. /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
  264. /package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
  265. /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
  266. /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → CreatePartnerResponse.js} +0 -0
  267. /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → GetPartnerResponse.js} +0 -0
  268. /package/dist/api/resources/partners/types/{GetPartnersResponse.js → RejectPartnerResponse.js} +0 -0
  269. /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
  270. /package/dist/api/resources/partners/types/{SuspendPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
  271. /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
  272. /package/dist/api/resources/programs/{client/requests/GetProgramsRequest.js → types/GetProgramResponse.js} +0 -0
  273. /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
  274. /package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.js → GetPromotionCodeRequest.js} +0 -0
  275. /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
  276. /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → DeletePromotionCodeResponse.js} +0 -0
  277. /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
  278. /package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
  279. /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
  280. /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsLinksRequest.js} +0 -0
  281. /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsOverviewRequest.js} +0 -0
  282. /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsPartnersRequest.js} +0 -0
  283. /package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
  284. /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
  285. /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsLinksResponse.js} +0 -0
  286. /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsOverviewResponse.js} +0 -0
  287. /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsPartnersResponse.js} +0 -0
  288. /package/dist/api/resources/reports/types/{PartnersReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
  289. /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
  290. /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → DeleteTransactionRequest.js} +0 -0
  291. /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → GetTransactionRequest.js} +0 -0
  292. /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
  293. /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
  294. /package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
  295. /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
  296. /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → DeleteTransactionResponse.js} +0 -0
  297. /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → GetTransactionResponse.js} +0 -0
  298. /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
  299. /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
  300. /package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
  301. /package/dist/{api/resources/embed/client/index.d.ts → core/pagination/exports.js} +0 -0
@@ -27,75 +27,88 @@ export class CustomersClient {
27
27
  * @example
28
28
  * await client.customers.list()
29
29
  */
30
- list(request = {}, requestOptions) {
31
- return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
32
- }
33
- async __list(request = {}, requestOptions) {
34
- 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;
35
- const _queryParams = {
36
- limit,
37
- order: order != null ? order : undefined,
38
- sort: sort != null ? sort : undefined,
39
- starting_after: startingAfter,
40
- ending_before: endingBefore,
41
- created_after: createdAfter != null ? createdAfter : undefined,
42
- created_before: createdBefore != null ? createdBefore : undefined,
43
- updated_after: updatedAfter != null ? updatedAfter : undefined,
44
- updated_before: updatedBefore != null ? updatedBefore : undefined,
45
- program_id: programId,
46
- partner_id: partnerId,
47
- customer_id: customerId,
48
- status: status != null ? status : undefined,
49
- search,
50
- click_id: clickId,
51
- link_id: linkId,
52
- };
53
- const _authRequest = await this._options.authProvider.getAuthRequest();
54
- const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
55
- const _response = await core.fetcher({
56
- url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
57
- (await core.Supplier.get(this._options.environment)) ??
58
- environments.ToltApiEnvironment.Default, "v2/customers"),
59
- method: "GET",
60
- headers: _headers,
61
- queryString: core.url
62
- .queryBuilder()
63
- .addMany(_queryParams)
64
- .mergeAdditional(requestOptions?.queryParams)
65
- .build(),
66
- timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
67
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
68
- abortSignal: requestOptions?.abortSignal,
69
- fetchFn: this._options?.fetch,
70
- logging: this._options.logging,
71
- });
72
- if (_response.ok) {
73
- return { data: _response.body, rawResponse: _response.rawResponse };
74
- }
75
- if (_response.error.reason === "status-code") {
76
- switch (_response.error.statusCode) {
77
- case 400:
78
- throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
79
- case 401:
80
- throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
81
- case 413:
82
- throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
83
- case 429:
84
- throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
85
- default:
86
- throw new errors.ToltApiError({
87
- statusCode: _response.error.statusCode,
88
- body: _response.error.body,
89
- rawResponse: _response.rawResponse,
90
- });
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
+ };
91
75
  }
92
- }
93
- 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
+ });
94
107
  }
95
108
  /**
96
109
  * Creates a customer attributed to a partner. Pass partner_id or link_id, and optionally the click_id that brought them in.
97
110
  *
98
- * @param {ToltApi.CreateCustomersRequest} request
111
+ * @param {ToltApi.CreateCustomerRequest} request
99
112
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
100
113
  *
101
114
  * @throws {@link ToltApi.BadRequestError}
@@ -132,7 +145,7 @@ export class CustomersClient {
132
145
  requestType: "json",
133
146
  body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
134
147
  timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
135
- maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
148
+ maxRetries: 0,
136
149
  abortSignal: requestOptions?.abortSignal,
137
150
  fetchFn: this._options?.fetch,
138
151
  logging: this._options.logging,
@@ -165,7 +178,7 @@ export class CustomersClient {
165
178
  /**
166
179
  * Gets a customer by ID, with its status, the partner it is attributed to and your own customer and subscription IDs.
167
180
  *
168
- * @param {ToltApi.GetCustomersRequest} request
181
+ * @param {ToltApi.GetCustomerRequest} request
169
182
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
170
183
  *
171
184
  * @throws {@link ToltApi.UnauthorizedError}
@@ -190,7 +203,7 @@ export class CustomersClient {
190
203
  const _response = await core.fetcher({
191
204
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
192
205
  (await core.Supplier.get(this._options.environment)) ??
193
- environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id)}`),
206
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
194
207
  method: "GET",
195
208
  headers: _headers,
196
209
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -226,7 +239,7 @@ export class CustomersClient {
226
239
  /**
227
240
  * Updates a customer's name, email, status, your own IDs, or the click and link the customer came from.
228
241
  *
229
- * @param {ToltApi.UpdateCustomersRequest} request
242
+ * @param {ToltApi.UpdateCustomerRequest} request
230
243
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
231
244
  *
232
245
  * @throws {@link ToltApi.BadRequestError}
@@ -255,7 +268,7 @@ export class CustomersClient {
255
268
  const _response = await core.fetcher({
256
269
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
257
270
  (await core.Supplier.get(this._options.environment)) ??
258
- environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id)}`),
271
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
259
272
  method: "PUT",
260
273
  headers: _headers,
261
274
  contentType: "application/json",
@@ -298,7 +311,7 @@ export class CustomersClient {
298
311
  /**
299
312
  * Deletes a customer. Fails when any of the customer's commissions is paid or already included in a payout.
300
313
  *
301
- * @param {ToltApi.DeleteCustomersRequest} request
314
+ * @param {ToltApi.DeleteCustomerRequest} request
302
315
  * @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
303
316
  *
304
317
  * @throws {@link ToltApi.BadRequestError}
@@ -324,7 +337,7 @@ export class CustomersClient {
324
337
  const _response = await core.fetcher({
325
338
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
326
339
  (await core.Supplier.get(this._options.environment)) ??
327
- environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id)}`),
340
+ environments.ToltApiEnvironment.Default, `v2/customers/${core.url.encodePathParam(id, errors.ToltApiError)}`),
328
341
  method: "DELETE",
329
342
  headers: _headers,
330
343
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -8,7 +8,7 @@
8
8
  * partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
9
9
  * }
10
10
  */
11
- export interface CreateCustomersRequest {
11
+ export interface CreateCustomerRequest {
12
12
  /** Customer's email, stored lowercased and used as their identifier. It must not belong to another customer. Provide this or customer_id. */
13
13
  email?: string;
14
14
  /** Resolve a code in the partner’s program, ignoring case, preferring partner, group, then program scope. An unmatched code leaves attribution unchanged. */
@@ -20,7 +20,7 @@ export interface CreateCustomersRequest {
20
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
21
  customer_id?: string;
22
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?: CreateCustomersRequest.Status;
23
+ status?: CreateCustomerRequest.Status;
24
24
  /** Customer's subscription id in your billing system, such as a Stripe subscription id. */
25
25
  subscription_id?: string;
26
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. */
@@ -34,7 +34,7 @@ export interface CreateCustomersRequest {
34
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
35
  active_at?: string | null;
36
36
  }
37
- export declare namespace CreateCustomersRequest {
37
+ export declare namespace CreateCustomerRequest {
38
38
  /** Lifecycle stage of the customer. Defaults to lead (signed up, not paying yet); recording a transaction for the customer makes them active. */
39
39
  const Status: {
40
40
  readonly Lead: "lead";
@@ -1,12 +1,12 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export var CreateCustomersRequest;
3
- (function (CreateCustomersRequest) {
2
+ export var CreateCustomerRequest;
3
+ (function (CreateCustomerRequest) {
4
4
  /** Lifecycle stage of the customer. Defaults to lead (signed up, not paying yet); recording a transaction for the customer makes them active. */
5
- CreateCustomersRequest.Status = {
5
+ CreateCustomerRequest.Status = {
6
6
  Lead: "lead",
7
7
  Active: "active",
8
8
  Canceled: "canceled",
9
9
  Suspended: "suspended",
10
10
  Trialing: "trialing",
11
11
  };
12
- })(CreateCustomersRequest || (CreateCustomersRequest = {}));
12
+ })(CreateCustomerRequest || (CreateCustomerRequest = {}));
@@ -4,6 +4,6 @@
4
4
  * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
5
5
  * }
6
6
  */
7
- export interface DeleteCustomersRequest {
7
+ export interface DeleteCustomerRequest {
8
8
  id: string;
9
9
  }
@@ -4,6 +4,6 @@
4
4
  * id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
5
5
  * }
6
6
  */
7
- export interface GetCustomersRequest {
7
+ export interface GetCustomerRequest {
8
8
  id: string;
9
9
  }
@@ -6,7 +6,7 @@
6
6
  * status: "active"
7
7
  * }
8
8
  */
9
- export interface UpdateCustomersRequest {
9
+ export interface UpdateCustomerRequest {
10
10
  id: string;
11
11
  /** New email, stored lowercased and used as the customer's identifier. It must not belong to another customer. */
12
12
  email?: string;
@@ -17,7 +17,7 @@ export interface UpdateCustomersRequest {
17
17
  /** Customer's full name as you want it shown in the dashboard; it does not affect attribution or matching. */
18
18
  name?: string | null;
19
19
  /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
20
- status?: UpdateCustomersRequest.Status | null;
20
+ status?: UpdateCustomerRequest.Status | null;
21
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
22
  customer_id?: string;
23
23
  /** Customer's subscription id in your billing system, such as a Stripe subscription id. */
@@ -31,7 +31,7 @@ export interface UpdateCustomersRequest {
31
31
  /** When the customer became a paying customer, as a timestamp with a time zone. */
32
32
  active_at?: string | null;
33
33
  }
34
- export declare namespace UpdateCustomersRequest {
34
+ export declare namespace UpdateCustomerRequest {
35
35
  /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
36
36
  const Status: {
37
37
  readonly Lead: "lead";
@@ -1,12 +1,12 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export var UpdateCustomersRequest;
3
- (function (UpdateCustomersRequest) {
2
+ export var UpdateCustomerRequest;
3
+ (function (UpdateCustomerRequest) {
4
4
  /** Lifecycle stage of the customer. Changing it does not set active_at or run commission flows. */
5
- UpdateCustomersRequest.Status = {
5
+ UpdateCustomerRequest.Status = {
6
6
  Lead: "lead",
7
7
  Active: "active",
8
8
  Canceled: "canceled",
9
9
  Suspended: "suspended",
10
10
  Trialing: "trialing",
11
11
  };
12
- })(UpdateCustomersRequest || (UpdateCustomersRequest = {}));
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,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";
@@ -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";
@@ -2,19 +2,19 @@ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClie
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import * as core from "../../../../core/index.js";
4
4
  import * as ToltApi from "../../../index.js";
5
- export declare namespace EmbedClient {
5
+ export declare namespace EmbedTokensClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class EmbedClient {
11
- protected readonly _options: NormalizedClientOptionsWithAuth<EmbedClient.Options>;
12
- constructor(options: EmbedClient.Options);
10
+ export declare class EmbedTokensClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<EmbedTokensClient.Options>;
12
+ constructor(options: EmbedTokensClient.Options);
13
13
  /**
14
14
  * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
15
15
  *
16
- * @param {ToltApi.CreateTokenEmbedRequest} request
17
- * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ * @param {ToltApi.CreateEmbedTokenRequest} request
17
+ * @param {EmbedTokensClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
19
  * @throws {@link ToltApi.BadRequestError}
20
20
  * @throws {@link ToltApi.UnauthorizedError}
@@ -25,10 +25,8 @@ export declare class EmbedClient {
25
25
  * @throws {@link errors.ToltApiTimeoutError}
26
26
  *
27
27
  * @example
28
- * await client.embed.createToken({
29
- * "key": "value"
30
- * })
28
+ * await client.embedTokens.create()
31
29
  */
32
- createToken(request: ToltApi.CreateTokenEmbedRequest, requestOptions?: EmbedClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateTokenEmbedResponse>;
33
- private __createToken;
30
+ create(request?: ToltApi.CreateEmbedTokenRequest, requestOptions?: EmbedTokensClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateEmbedTokenResponse>;
31
+ private __create;
34
32
  }
@@ -7,15 +7,15 @@ import * as environments from "../../../../environments.js";
7
7
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
8
  import * as errors from "../../../../errors/index.js";
9
9
  import * as ToltApi from "../../../index.js";
10
- export class EmbedClient {
10
+ export class EmbedTokensClient {
11
11
  constructor(options) {
12
12
  this._options = normalizeClientOptionsWithAuth(options);
13
13
  }
14
14
  /**
15
15
  * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
16
16
  *
17
- * @param {ToltApi.CreateTokenEmbedRequest} request
18
- * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
17
+ * @param {ToltApi.CreateEmbedTokenRequest} request
18
+ * @param {EmbedTokensClient.RequestOptions} requestOptions - Request-specific configuration.
19
19
  *
20
20
  * @throws {@link ToltApi.BadRequestError}
21
21
  * @throws {@link ToltApi.UnauthorizedError}
@@ -26,14 +26,12 @@ export class EmbedClient {
26
26
  * @throws {@link errors.ToltApiTimeoutError}
27
27
  *
28
28
  * @example
29
- * await client.embed.createToken({
30
- * "key": "value"
31
- * })
29
+ * await client.embedTokens.create()
32
30
  */
33
- createToken(request, requestOptions) {
34
- return core.HttpResponsePromise.fromPromise(this.__createToken(request, requestOptions));
31
+ create(request = {}, requestOptions) {
32
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
35
33
  }
36
- async __createToken(request, requestOptions) {
34
+ async __create(request = {}, requestOptions) {
37
35
  const _authRequest = await this._options.authProvider.getAuthRequest();
38
36
  const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
39
37
  const _response = await core.fetcher({
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateEmbedTokenRequest {
6
+ /** Id of an existing partner (part_...). Send this or partner, not both. */
7
+ partner_id?: string;
8
+ /** Look up an onboarded partner by email within a program. Send this or partner_id, not both. */
9
+ partner?: CreateEmbedTokenRequest.Partner;
10
+ }
11
+ export declare namespace CreateEmbedTokenRequest {
12
+ /**
13
+ * Look up an onboarded partner by email within a program. Send this or partner_id, not both.
14
+ */
15
+ interface Partner {
16
+ /** Email of the partner, matched without regard to case. */
17
+ email: string;
18
+ /** Program the partner belongs to (prg_...). */
19
+ program_id: string;
20
+ }
21
+ }
@@ -0,0 +1 @@
1
+ export type { CreateEmbedTokenRequest } from "./CreateEmbedTokenRequest.js";
@@ -0,0 +1,2 @@
1
+ export { EmbedTokensClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -1,3 +1,3 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export { EmbedClient } from "./client/Client.js";
2
+ export { EmbedTokensClient } from "./client/Client.js";
3
3
  export * from "./client/index.js";
@@ -1,5 +1,5 @@
1
1
  import type * as ToltApi from "../../../index.js";
2
- export interface CreateTokenEmbedResponse {
2
+ export interface CreateEmbedTokenResponse {
3
3
  success: boolean;
4
4
  message: string;
5
5
  data: ToltApi.EmbedToken;
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -26,12 +26,11 @@ export declare class FlowsClient {
26
26
  * @example
27
27
  * await client.flows.list()
28
28
  */
29
- list(request?: ToltApi.ListFlowsRequest, requestOptions?: FlowsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ListFlowsResponse>;
30
- private __list;
29
+ list(request?: ToltApi.ListFlowsRequest, requestOptions?: FlowsClient.RequestOptions): Promise<core.Page<ToltApi.Flow, ToltApi.ListFlowsResponse>>;
31
30
  /**
32
31
  * Gets a flow by ID, with the event it runs on, its conditions and its action: a commission to generate or a group to move the partner to.
33
32
  *
34
- * @param {ToltApi.GetFlowsRequest} request
33
+ * @param {ToltApi.GetFlowRequest} request
35
34
  * @param {FlowsClient.RequestOptions} requestOptions - Request-specific configuration.
36
35
  *
37
36
  * @throws {@link ToltApi.UnauthorizedError}
@@ -46,6 +45,6 @@ export declare class FlowsClient {
46
45
  * id: "flw_fAyK6FQ6EZngabgw8JifzQgN"
47
46
  * })
48
47
  */
49
- get(request: ToltApi.GetFlowsRequest, requestOptions?: FlowsClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetFlowsResponse>;
48
+ get(request: ToltApi.GetFlowRequest, requestOptions?: FlowsClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetFlowResponse>;
50
49
  private __get;
51
50
  }