@tolt/api 0.1.1 → 0.3.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 (209) hide show
  1. package/dist/Client.d.ts +3 -0
  2. package/dist/Client.js +4 -0
  3. package/dist/api/errors/TooManyRequestsError.d.ts +7 -0
  4. package/dist/api/errors/TooManyRequestsError.js +17 -0
  5. package/dist/api/errors/index.d.ts +1 -0
  6. package/dist/api/errors/index.js +1 -0
  7. package/dist/api/resources/clicks/client/Client.d.ts +10 -4
  8. package/dist/api/resources/clicks/client/Client.js +22 -24
  9. package/dist/api/resources/clicks/client/requests/index.d.ts +0 -1
  10. package/dist/api/resources/clicks/types/CreateClickRequest.d.ts +1 -0
  11. package/dist/api/resources/clicks/types/CreateClickResponse.d.ts +6 -0
  12. package/dist/api/resources/clicks/types/index.d.ts +2 -2
  13. package/dist/api/resources/clicks/types/index.js +2 -2
  14. package/dist/api/resources/commissions/client/Client.d.ts +45 -0
  15. package/dist/api/resources/commissions/client/Client.js +154 -1
  16. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +10 -0
  17. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +10 -0
  18. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.js +2 -0
  19. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +13 -0
  20. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +3 -3
  21. package/dist/api/resources/commissions/client/requests/index.d.ts +2 -0
  22. package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.d.ts +6 -0
  23. package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.js +2 -0
  24. package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.d.ts +6 -0
  25. package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.js +2 -0
  26. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +6 -0
  27. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +6 -0
  28. package/dist/api/resources/commissions/types/ListCommissionsResponse.d.ts +4 -0
  29. package/dist/api/resources/commissions/types/index.d.ts +3 -0
  30. package/dist/api/resources/commissions/types/index.js +3 -0
  31. package/dist/api/resources/customers/client/Client.d.ts +7 -4
  32. package/dist/api/resources/customers/client/Client.js +25 -6
  33. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +14 -0
  34. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.js +2 -0
  35. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +13 -0
  36. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +6 -6
  37. package/dist/api/resources/customers/client/requests/index.d.ts +1 -0
  38. package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +6 -0
  39. package/dist/api/resources/customers/types/ListCustomersRequestSort.js +6 -0
  40. package/dist/api/resources/customers/types/ListCustomersResponse.d.ts +4 -0
  41. package/dist/api/resources/customers/types/index.d.ts +1 -1
  42. package/dist/api/resources/customers/types/index.js +1 -1
  43. package/dist/api/resources/embed/client/Client.d.ts +31 -0
  44. package/dist/api/resources/embed/client/Client.js +75 -0
  45. package/dist/api/resources/embed/client/index.d.ts +1 -0
  46. package/dist/api/resources/embed/client/index.js +1 -0
  47. package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.d.ts +14 -0
  48. package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.js +2 -0
  49. package/dist/api/resources/embed/client/requests/index.d.ts +1 -0
  50. package/dist/api/resources/embed/client/requests/index.js +1 -0
  51. package/dist/api/resources/embed/exports.d.ts +2 -0
  52. package/dist/api/resources/embed/exports.js +3 -0
  53. package/dist/api/resources/embed/index.d.ts +2 -0
  54. package/dist/api/resources/embed/index.js +2 -0
  55. package/dist/api/resources/embed/types/CreateEmbedTokenResponse.d.ts +6 -0
  56. package/dist/api/resources/embed/types/CreateEmbedTokenResponse.js +2 -0
  57. package/dist/api/resources/embed/types/index.d.ts +1 -0
  58. package/dist/api/resources/embed/types/index.js +1 -0
  59. package/dist/api/resources/flows/client/Client.d.ts +2 -0
  60. package/dist/api/resources/flows/client/Client.js +13 -1
  61. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -0
  62. package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +6 -0
  63. package/dist/api/resources/flows/types/ListFlowsRequestSort.js +6 -0
  64. package/dist/api/resources/flows/types/ListFlowsResponse.d.ts +4 -0
  65. package/dist/api/resources/flows/types/index.d.ts +1 -0
  66. package/dist/api/resources/flows/types/index.js +1 -0
  67. package/dist/api/resources/groups/client/Client.d.ts +2 -0
  68. package/dist/api/resources/groups/client/Client.js +13 -1
  69. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +13 -0
  70. package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +6 -0
  71. package/dist/api/resources/groups/types/ListGroupsRequestSort.js +6 -0
  72. package/dist/api/resources/groups/types/ListGroupsResponse.d.ts +4 -0
  73. package/dist/api/resources/groups/types/index.d.ts +1 -0
  74. package/dist/api/resources/groups/types/index.js +1 -0
  75. package/dist/api/resources/index.d.ts +3 -0
  76. package/dist/api/resources/index.js +3 -0
  77. package/dist/api/resources/links/client/Client.d.ts +6 -1
  78. package/dist/api/resources/links/client/Client.js +23 -2
  79. package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +2 -2
  80. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +13 -0
  81. package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +6 -0
  82. package/dist/api/resources/links/types/ListLinksRequestSort.js +6 -0
  83. package/dist/api/resources/links/types/ListLinksResponse.d.ts +4 -0
  84. package/dist/api/resources/links/types/index.d.ts +1 -0
  85. package/dist/api/resources/links/types/index.js +1 -0
  86. package/dist/api/resources/partners/client/Client.d.ts +85 -0
  87. package/dist/api/resources/partners/client/Client.js +273 -1
  88. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +10 -0
  89. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.js +2 -0
  90. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +11 -0
  91. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.js +2 -0
  92. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +41 -0
  93. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +8 -0
  94. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +13 -0
  95. package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +1 -1
  96. package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +1 -1
  97. package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +16 -0
  98. package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.js +2 -0
  99. package/dist/api/resources/partners/client/requests/index.d.ts +4 -0
  100. package/dist/api/resources/partners/client/requests/index.js +1 -1
  101. package/dist/api/resources/partners/types/BulkApprovePartnersResponse.d.ts +6 -0
  102. package/dist/api/resources/partners/types/BulkApprovePartnersResponse.js +2 -0
  103. package/dist/api/resources/partners/types/BulkRejectPartnersResponse.d.ts +6 -0
  104. package/dist/api/resources/partners/types/BulkRejectPartnersResponse.js +2 -0
  105. package/dist/api/resources/partners/types/CreatePartnerResponse.d.ts +6 -0
  106. package/dist/api/resources/partners/types/CreatePartnerResponse.js +2 -0
  107. package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +6 -0
  108. package/dist/api/resources/partners/types/ListPartnersRequestSort.js +6 -0
  109. package/dist/api/resources/partners/types/ListPartnersResponse.d.ts +4 -0
  110. package/dist/api/resources/partners/types/UpdatePartnerResponse.d.ts +6 -0
  111. package/dist/api/resources/partners/types/UpdatePartnerResponse.js +2 -0
  112. package/dist/api/resources/partners/types/index.d.ts +5 -0
  113. package/dist/api/resources/partners/types/index.js +5 -0
  114. package/dist/api/resources/programs/client/Client.d.ts +2 -0
  115. package/dist/api/resources/programs/client/Client.js +13 -1
  116. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +13 -0
  117. package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +6 -0
  118. package/dist/api/resources/programs/types/ListProgramsRequestSort.js +6 -0
  119. package/dist/api/resources/programs/types/ListProgramsResponse.d.ts +4 -0
  120. package/dist/api/resources/programs/types/index.d.ts +1 -0
  121. package/dist/api/resources/programs/types/index.js +1 -0
  122. package/dist/api/resources/promotionCodes/client/Client.d.ts +6 -1
  123. package/dist/api/resources/promotionCodes/client/Client.js +23 -2
  124. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +2 -2
  125. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +13 -0
  126. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +6 -0
  127. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +6 -0
  128. package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.d.ts +4 -0
  129. package/dist/api/resources/promotionCodes/types/index.d.ts +1 -0
  130. package/dist/api/resources/promotionCodes/types/index.js +1 -0
  131. package/dist/api/resources/reports/client/Client.d.ts +61 -2
  132. package/dist/api/resources/reports/client/Client.js +264 -2
  133. package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.d.ts +9 -0
  134. package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.js +2 -0
  135. package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +14 -0
  136. package/dist/api/resources/reports/client/requests/ReportsLinksRequest.js +2 -0
  137. package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +14 -0
  138. package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.js +2 -0
  139. package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +11 -0
  140. package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.js +2 -0
  141. package/dist/api/resources/reports/client/requests/index.d.ts +4 -0
  142. package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.d.ts +6 -0
  143. package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.js +2 -0
  144. package/dist/api/resources/reports/types/ReportsLinksRequestOrder.d.ts +5 -0
  145. package/dist/api/resources/{clicks/types/ListClicksRequestOrder.js → reports/types/ReportsLinksRequestOrder.js} +1 -1
  146. package/dist/api/resources/reports/types/ReportsLinksRequestSort.d.ts +7 -0
  147. package/dist/api/resources/reports/types/ReportsLinksRequestSort.js +7 -0
  148. package/dist/api/resources/{clicks/types/ListClicksResponse.d.ts → reports/types/ReportsLinksResponse.d.ts} +2 -2
  149. package/dist/api/resources/reports/types/ReportsLinksResponse.js +2 -0
  150. package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.d.ts +5 -0
  151. package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.js +5 -0
  152. package/dist/api/resources/reports/types/ReportsPartnersRequestSort.d.ts +7 -0
  153. package/dist/api/resources/reports/types/ReportsPartnersRequestSort.js +7 -0
  154. package/dist/api/resources/reports/types/ReportsPartnersResponse.d.ts +7 -0
  155. package/dist/api/resources/reports/types/ReportsPartnersResponse.js +2 -0
  156. package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.d.ts +6 -0
  157. package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.js +6 -0
  158. package/dist/api/resources/reports/types/ReportsTimeseriesResponse.d.ts +6 -0
  159. package/dist/api/resources/reports/types/ReportsTimeseriesResponse.js +2 -0
  160. package/dist/api/resources/reports/types/index.d.ts +9 -0
  161. package/dist/api/resources/reports/types/index.js +9 -0
  162. package/dist/api/resources/transactions/client/Client.d.ts +8 -1
  163. package/dist/api/resources/transactions/client/Client.js +29 -2
  164. package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +5 -5
  165. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +13 -0
  166. package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +4 -4
  167. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +6 -0
  168. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +6 -0
  169. package/dist/api/resources/transactions/types/ListTransactionsResponse.d.ts +4 -0
  170. package/dist/api/resources/transactions/types/index.d.ts +1 -0
  171. package/dist/api/resources/transactions/types/index.js +1 -0
  172. package/dist/api/types/BulkResult.d.ts +24 -0
  173. package/dist/api/types/BulkResult.js +14 -0
  174. package/dist/api/types/Click.d.ts +5 -5
  175. package/dist/api/types/Commission.d.ts +13 -13
  176. package/dist/api/types/CreatedPartner.d.ts +19 -0
  177. package/dist/api/types/CreatedPartner.js +2 -0
  178. package/dist/api/types/Customer.d.ts +11 -11
  179. package/dist/api/types/EmbedToken.d.ts +4 -0
  180. package/dist/api/types/EmbedToken.js +2 -0
  181. package/dist/api/types/Error_.d.ts +34 -0
  182. package/dist/api/types/Error_.js +21 -1
  183. package/dist/api/types/Flow.d.ts +8 -8
  184. package/dist/api/types/Group.d.ts +9 -9
  185. package/dist/api/types/Link.d.ts +5 -5
  186. package/dist/api/types/Partner.d.ts +12 -8
  187. package/dist/api/types/Program.d.ts +8 -8
  188. package/dist/api/types/PromotionCode.d.ts +8 -8
  189. package/dist/api/types/ReportsCustomerStats.d.ts +6 -0
  190. package/dist/api/types/ReportsCustomerStats.js +2 -0
  191. package/dist/api/types/ReportsLinkRow.d.ts +12 -0
  192. package/dist/api/types/ReportsLinkRow.js +2 -0
  193. package/dist/api/types/ReportsOverview.d.ts +5 -5
  194. package/dist/api/types/ReportsPartnerRow.d.ts +15 -0
  195. package/dist/api/types/ReportsPartnerRow.js +2 -0
  196. package/dist/api/types/ReportsTimeseriesPoint.d.ts +10 -0
  197. package/dist/api/types/ReportsTimeseriesPoint.js +2 -0
  198. package/dist/api/types/Transaction.d.ts +17 -17
  199. package/dist/api/types/index.d.ts +7 -0
  200. package/dist/api/types/index.js +7 -0
  201. package/dist/environments.d.ts +1 -1
  202. package/dist/environments.js +1 -1
  203. package/package.json +1 -1
  204. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +0 -16
  205. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +0 -5
  206. package/dist/api/resources/customers/types/CreateCustomerRequest.d.ts +0 -1
  207. /package/dist/api/resources/clicks/{client/requests/ListClicksRequest.js → types/CreateClickRequest.js} +0 -0
  208. /package/dist/api/resources/clicks/types/{ListClicksResponse.js → CreateClickResponse.js} +0 -0
  209. /package/dist/api/resources/{customers/types/CreateCustomerRequest.js → commissions/client/requests/BulkApproveCommissionsRequest.js} +0 -0
@@ -6,7 +6,20 @@ import type * as ToltApi from "../../../../index.js";
6
6
  export interface ListCommissionsRequest {
7
7
  limit?: number;
8
8
  order?: ToltApi.ListCommissionsRequestOrder;
9
+ /** Column the list is ordered and paged by. */
10
+ sort?: ToltApi.ListCommissionsRequestSort;
11
+ /** 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. */
9
12
  starting_after?: string;
13
+ /** 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
+ ending_before?: string;
15
+ /** Only items created at or after this ISO 8601 time. */
16
+ created_after?: string;
17
+ /** Only items created before this ISO 8601 time. */
18
+ created_before?: string;
19
+ /** Only items updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
20
+ updated_after?: string;
21
+ /** Only items updated before this ISO 8601 time. */
22
+ updated_before?: string;
10
23
  program_id?: string;
11
24
  partner_id?: string;
12
25
  customer_id?: string;
@@ -12,7 +12,7 @@ export interface UpdateCommissionRequest {
12
12
  revenue?: number;
13
13
  status?: string | null;
14
14
  source?: string | null;
15
- chargeId?: string | null;
16
- transactionId?: string | null;
17
- createdAt?: string;
15
+ charge_id?: string | null;
16
+ transaction_id?: string | null;
17
+ created_at?: string;
18
18
  }
@@ -1,4 +1,6 @@
1
1
  export type { ApproveCommissionRequest } from "./ApproveCommissionRequest.js";
2
+ export type { BulkApproveCommissionsRequest } from "./BulkApproveCommissionsRequest.js";
3
+ export type { BulkDeclineCommissionsRequest } from "./BulkDeclineCommissionsRequest.js";
2
4
  export type { DeclineCommissionRequest } from "./DeclineCommissionRequest.js";
3
5
  export type { DeleteCommissionRequest } from "./DeleteCommissionRequest.js";
4
6
  export type { GetCommissionRequest } from "./GetCommissionRequest.js";
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface BulkApproveCommissionsResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.BulkResult;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface BulkDeclineCommissionsResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.BulkResult;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ /** Column the list is ordered and paged by. */
2
+ export declare const ListCommissionsRequestSort: {
3
+ readonly CreatedAt: "created_at";
4
+ readonly UpdatedAt: "updated_at";
5
+ };
6
+ export type ListCommissionsRequestSort = (typeof ListCommissionsRequestSort)[keyof typeof ListCommissionsRequestSort];
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Column the list is ordered and paged by. */
3
+ export const ListCommissionsRequestSort = {
4
+ CreatedAt: "created_at",
5
+ UpdatedAt: "updated_at",
6
+ };
@@ -4,4 +4,8 @@ export interface ListCommissionsResponse {
4
4
  message: string;
5
5
  data: ToltApi.Commission[];
6
6
  has_more: boolean;
7
+ /** Opaque cursor marking the last item on this page. Pass it as starting_after to continue. Null when the page is empty. */
8
+ next_cursor: string | null;
9
+ /** Opaque cursor marking the first item on this page. Pass it as ending_before to page backward. Null when the page is empty. */
10
+ prev_cursor: string | null;
7
11
  }
@@ -1,9 +1,12 @@
1
1
  export * from "./ApproveCommissionResponse.js";
2
+ export * from "./BulkApproveCommissionsResponse.js";
3
+ export * from "./BulkDeclineCommissionsResponse.js";
2
4
  export * from "./CreateCommissionRequest.js";
3
5
  export * from "./CreateCommissionResponse.js";
4
6
  export * from "./DeclineCommissionResponse.js";
5
7
  export * from "./DeleteCommissionResponse.js";
6
8
  export * from "./GetCommissionResponse.js";
7
9
  export * from "./ListCommissionsRequestOrder.js";
10
+ export * from "./ListCommissionsRequestSort.js";
8
11
  export * from "./ListCommissionsResponse.js";
9
12
  export * from "./UpdateCommissionResponse.js";
@@ -1,9 +1,12 @@
1
1
  export * from "./ApproveCommissionResponse.js";
2
+ export * from "./BulkApproveCommissionsResponse.js";
3
+ export * from "./BulkDeclineCommissionsResponse.js";
2
4
  export * from "./CreateCommissionRequest.js";
3
5
  export * from "./CreateCommissionResponse.js";
4
6
  export * from "./DeclineCommissionResponse.js";
5
7
  export * from "./DeleteCommissionResponse.js";
6
8
  export * from "./GetCommissionResponse.js";
7
9
  export * from "./ListCommissionsRequestOrder.js";
10
+ export * from "./ListCommissionsRequestSort.js";
8
11
  export * from "./ListCommissionsResponse.js";
9
12
  export * from "./UpdateCommissionResponse.js";
@@ -16,6 +16,7 @@ export declare class CustomersClient {
16
16
  *
17
17
  * @throws {@link ToltApi.BadRequestError}
18
18
  * @throws {@link ToltApi.UnauthorizedError}
19
+ * @throws {@link ToltApi.TooManyRequestsError}
19
20
  * @throws {@link errors.ToltApiError}
20
21
  * @throws {@link errors.ToltApiTimeoutError}
21
22
  *
@@ -30,15 +31,14 @@ export declare class CustomersClient {
30
31
  *
31
32
  * @throws {@link ToltApi.BadRequestError}
32
33
  * @throws {@link ToltApi.UnauthorizedError}
34
+ * @throws {@link ToltApi.TooManyRequestsError}
33
35
  * @throws {@link errors.ToltApiError}
34
36
  * @throws {@link errors.ToltApiTimeoutError}
35
37
  *
36
38
  * @example
37
- * await client.customers.createCustomer({
38
- * "key": "value"
39
- * })
39
+ * await client.customers.createCustomer()
40
40
  */
41
- createCustomer(request: ToltApi.CreateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomerResponse>;
41
+ createCustomer(request?: ToltApi.CreateCustomerRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomerResponse>;
42
42
  private __createCustomer;
43
43
  /**
44
44
  * @param {ToltApi.GetCustomerRequest} request
@@ -46,6 +46,7 @@ export declare class CustomersClient {
46
46
  *
47
47
  * @throws {@link ToltApi.UnauthorizedError}
48
48
  * @throws {@link ToltApi.NotFoundError}
49
+ * @throws {@link ToltApi.TooManyRequestsError}
49
50
  * @throws {@link errors.ToltApiError}
50
51
  * @throws {@link errors.ToltApiTimeoutError}
51
52
  *
@@ -63,6 +64,7 @@ export declare class CustomersClient {
63
64
  * @throws {@link ToltApi.BadRequestError}
64
65
  * @throws {@link ToltApi.UnauthorizedError}
65
66
  * @throws {@link ToltApi.NotFoundError}
67
+ * @throws {@link ToltApi.TooManyRequestsError}
66
68
  * @throws {@link errors.ToltApiError}
67
69
  * @throws {@link errors.ToltApiTimeoutError}
68
70
  *
@@ -79,6 +81,7 @@ export declare class CustomersClient {
79
81
  *
80
82
  * @throws {@link ToltApi.UnauthorizedError}
81
83
  * @throws {@link ToltApi.NotFoundError}
84
+ * @throws {@link ToltApi.TooManyRequestsError}
82
85
  * @throws {@link errors.ToltApiError}
83
86
  * @throws {@link errors.ToltApiTimeoutError}
84
87
  *
@@ -17,6 +17,7 @@ export class CustomersClient {
17
17
  *
18
18
  * @throws {@link ToltApi.BadRequestError}
19
19
  * @throws {@link ToltApi.UnauthorizedError}
20
+ * @throws {@link ToltApi.TooManyRequestsError}
20
21
  * @throws {@link errors.ToltApiError}
21
22
  * @throws {@link errors.ToltApiTimeoutError}
22
23
  *
@@ -27,11 +28,17 @@ export class CustomersClient {
27
28
  return core.HttpResponsePromise.fromPromise(this.__listCustomers(request, requestOptions));
28
29
  }
29
30
  async __listCustomers(request = {}, requestOptions) {
30
- const { limit, order, starting_after: startingAfter, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, } = request;
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, } = request;
31
32
  const _queryParams = {
32
33
  limit,
33
34
  order: order != null ? order : undefined,
35
+ sort: sort != null ? sort : undefined,
34
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,
35
42
  program_id: programId,
36
43
  partner_id: partnerId,
37
44
  customer_id: customerId,
@@ -66,6 +73,8 @@ export class CustomersClient {
66
73
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
67
74
  case 401:
68
75
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
76
+ case 429:
77
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
69
78
  default:
70
79
  throw new errors.ToltApiError({
71
80
  statusCode: _response.error.statusCode,
@@ -82,18 +91,17 @@ export class CustomersClient {
82
91
  *
83
92
  * @throws {@link ToltApi.BadRequestError}
84
93
  * @throws {@link ToltApi.UnauthorizedError}
94
+ * @throws {@link ToltApi.TooManyRequestsError}
85
95
  * @throws {@link errors.ToltApiError}
86
96
  * @throws {@link errors.ToltApiTimeoutError}
87
97
  *
88
98
  * @example
89
- * await client.customers.createCustomer({
90
- * "key": "value"
91
- * })
99
+ * await client.customers.createCustomer()
92
100
  */
93
- createCustomer(request, requestOptions) {
101
+ createCustomer(request = {}, requestOptions) {
94
102
  return core.HttpResponsePromise.fromPromise(this.__createCustomer(request, requestOptions));
95
103
  }
96
- async __createCustomer(request, requestOptions) {
104
+ async __createCustomer(request = {}, requestOptions) {
97
105
  const _authRequest = await this._options.authProvider.getAuthRequest();
98
106
  const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
99
107
  const _response = await core.fetcher({
@@ -121,6 +129,8 @@ export class CustomersClient {
121
129
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
122
130
  case 401:
123
131
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
132
+ case 429:
133
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
124
134
  default:
125
135
  throw new errors.ToltApiError({
126
136
  statusCode: _response.error.statusCode,
@@ -137,6 +147,7 @@ export class CustomersClient {
137
147
  *
138
148
  * @throws {@link ToltApi.UnauthorizedError}
139
149
  * @throws {@link ToltApi.NotFoundError}
150
+ * @throws {@link ToltApi.TooManyRequestsError}
140
151
  * @throws {@link errors.ToltApiError}
141
152
  * @throws {@link errors.ToltApiTimeoutError}
142
153
  *
@@ -174,6 +185,8 @@ export class CustomersClient {
174
185
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
175
186
  case 404:
176
187
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
188
+ case 429:
189
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
177
190
  default:
178
191
  throw new errors.ToltApiError({
179
192
  statusCode: _response.error.statusCode,
@@ -191,6 +204,7 @@ export class CustomersClient {
191
204
  * @throws {@link ToltApi.BadRequestError}
192
205
  * @throws {@link ToltApi.UnauthorizedError}
193
206
  * @throws {@link ToltApi.NotFoundError}
207
+ * @throws {@link ToltApi.TooManyRequestsError}
194
208
  * @throws {@link errors.ToltApiError}
195
209
  * @throws {@link errors.ToltApiTimeoutError}
196
210
  *
@@ -233,6 +247,8 @@ export class CustomersClient {
233
247
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
234
248
  case 404:
235
249
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
250
+ case 429:
251
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
236
252
  default:
237
253
  throw new errors.ToltApiError({
238
254
  statusCode: _response.error.statusCode,
@@ -249,6 +265,7 @@ export class CustomersClient {
249
265
  *
250
266
  * @throws {@link ToltApi.UnauthorizedError}
251
267
  * @throws {@link ToltApi.NotFoundError}
268
+ * @throws {@link ToltApi.TooManyRequestsError}
252
269
  * @throws {@link errors.ToltApiError}
253
270
  * @throws {@link errors.ToltApiTimeoutError}
254
271
  *
@@ -286,6 +303,8 @@ export class CustomersClient {
286
303
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
287
304
  case 404:
288
305
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
306
+ case 429:
307
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
289
308
  default:
290
309
  throw new errors.ToltApiError({
291
310
  statusCode: _response.error.statusCode,
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateCustomerRequest {
6
+ email?: string;
7
+ name?: string;
8
+ customer_id?: string;
9
+ status?: string;
10
+ subscription_id?: string;
11
+ click_id?: string;
12
+ link_id?: string;
13
+ partner_id?: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -6,7 +6,20 @@ import type * as ToltApi from "../../../../index.js";
6
6
  export interface ListCustomersRequest {
7
7
  limit?: number;
8
8
  order?: ToltApi.ListCustomersRequestOrder;
9
+ /** Column the list is ordered and paged by. */
10
+ sort?: ToltApi.ListCustomersRequestSort;
11
+ /** 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. */
9
12
  starting_after?: string;
13
+ /** 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
+ ending_before?: string;
15
+ /** Only items created at or after this ISO 8601 time. */
16
+ created_after?: string;
17
+ /** Only items created before this ISO 8601 time. */
18
+ created_before?: string;
19
+ /** Only items updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
20
+ updated_after?: string;
21
+ /** Only items updated before this ISO 8601 time. */
22
+ updated_before?: string;
10
23
  program_id?: string;
11
24
  partner_id?: string;
12
25
  customer_id?: string;
@@ -9,10 +9,10 @@ export interface UpdateCustomerRequest {
9
9
  email?: string;
10
10
  name?: string | null;
11
11
  status?: string | null;
12
- customerId?: string;
13
- subscriptionId?: string | null;
14
- clickId?: string | null;
15
- linkId?: string | null;
16
- leadAt?: string | null;
17
- activeAt?: string | null;
12
+ customer_id?: string;
13
+ subscription_id?: string | null;
14
+ click_id?: string | null;
15
+ link_id?: string | null;
16
+ lead_at?: string | null;
17
+ active_at?: string | null;
18
18
  }
@@ -1,3 +1,4 @@
1
+ export type { CreateCustomerRequest } from "./CreateCustomerRequest.js";
1
2
  export type { DeleteCustomerRequest } from "./DeleteCustomerRequest.js";
2
3
  export type { GetCustomerRequest } from "./GetCustomerRequest.js";
3
4
  export type { ListCustomersRequest } from "./ListCustomersRequest.js";
@@ -0,0 +1,6 @@
1
+ /** Column the list is ordered and paged by. */
2
+ export declare const ListCustomersRequestSort: {
3
+ readonly CreatedAt: "created_at";
4
+ readonly UpdatedAt: "updated_at";
5
+ };
6
+ export type ListCustomersRequestSort = (typeof ListCustomersRequestSort)[keyof typeof ListCustomersRequestSort];
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Column the list is ordered and paged by. */
3
+ export const ListCustomersRequestSort = {
4
+ CreatedAt: "created_at",
5
+ UpdatedAt: "updated_at",
6
+ };
@@ -4,4 +4,8 @@ export interface ListCustomersResponse {
4
4
  message: string;
5
5
  data: ToltApi.Customer[];
6
6
  has_more: boolean;
7
+ /** Opaque cursor marking the last item on this page. Pass it as starting_after to continue. Null when the page is empty. */
8
+ next_cursor: string | null;
9
+ /** Opaque cursor marking the first item on this page. Pass it as ending_before to page backward. Null when the page is empty. */
10
+ prev_cursor: string | null;
7
11
  }
@@ -1,7 +1,7 @@
1
- export * from "./CreateCustomerRequest.js";
2
1
  export * from "./CreateCustomerResponse.js";
3
2
  export * from "./DeleteCustomerResponse.js";
4
3
  export * from "./GetCustomerResponse.js";
5
4
  export * from "./ListCustomersRequestOrder.js";
5
+ export * from "./ListCustomersRequestSort.js";
6
6
  export * from "./ListCustomersResponse.js";
7
7
  export * from "./UpdateCustomerResponse.js";
@@ -1,7 +1,7 @@
1
- export * from "./CreateCustomerRequest.js";
2
1
  export * from "./CreateCustomerResponse.js";
3
2
  export * from "./DeleteCustomerResponse.js";
4
3
  export * from "./GetCustomerResponse.js";
5
4
  export * from "./ListCustomersRequestOrder.js";
5
+ export * from "./ListCustomersRequestSort.js";
6
6
  export * from "./ListCustomersResponse.js";
7
7
  export * from "./UpdateCustomerResponse.js";
@@ -0,0 +1,31 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as ToltApi from "../../../index.js";
5
+ export declare namespace EmbedClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class EmbedClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<EmbedClient.Options>;
12
+ constructor(options: EmbedClient.Options);
13
+ /**
14
+ * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
15
+ *
16
+ * @param {ToltApi.CreateEmbedTokenRequest} request
17
+ * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link ToltApi.BadRequestError}
20
+ * @throws {@link ToltApi.UnauthorizedError}
21
+ * @throws {@link ToltApi.NotFoundError}
22
+ * @throws {@link ToltApi.TooManyRequestsError}
23
+ * @throws {@link errors.ToltApiError}
24
+ * @throws {@link errors.ToltApiTimeoutError}
25
+ *
26
+ * @example
27
+ * await client.embed.createEmbedToken()
28
+ */
29
+ createEmbedToken(request?: ToltApi.CreateEmbedTokenRequest, requestOptions?: EmbedClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateEmbedTokenResponse>;
30
+ private __createEmbedToken;
31
+ }
@@ -0,0 +1,75 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import { mergeHeaders } from "../../../../core/headers.js";
4
+ import * as core from "../../../../core/index.js";
5
+ import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js";
6
+ import * as environments from "../../../../environments.js";
7
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
8
+ import * as errors from "../../../../errors/index.js";
9
+ import * as ToltApi from "../../../index.js";
10
+ export class EmbedClient {
11
+ constructor(options) {
12
+ this._options = normalizeClientOptionsWithAuth(options);
13
+ }
14
+ /**
15
+ * Mint a short-lived, partner-scoped token for the embedded referral dashboard. Safe to send to the browser.
16
+ *
17
+ * @param {ToltApi.CreateEmbedTokenRequest} request
18
+ * @param {EmbedClient.RequestOptions} requestOptions - Request-specific configuration.
19
+ *
20
+ * @throws {@link ToltApi.BadRequestError}
21
+ * @throws {@link ToltApi.UnauthorizedError}
22
+ * @throws {@link ToltApi.NotFoundError}
23
+ * @throws {@link ToltApi.TooManyRequestsError}
24
+ * @throws {@link errors.ToltApiError}
25
+ * @throws {@link errors.ToltApiTimeoutError}
26
+ *
27
+ * @example
28
+ * await client.embed.createEmbedToken()
29
+ */
30
+ createEmbedToken(request = {}, requestOptions) {
31
+ return core.HttpResponsePromise.fromPromise(this.__createEmbedToken(request, requestOptions));
32
+ }
33
+ async __createEmbedToken(request = {}, requestOptions) {
34
+ const _authRequest = await this._options.authProvider.getAuthRequest();
35
+ const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
36
+ const _response = await core.fetcher({
37
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
38
+ (await core.Supplier.get(this._options.environment)) ??
39
+ environments.ToltApiEnvironment.Production, "v2/embed-tokens"),
40
+ method: "POST",
41
+ headers: _headers,
42
+ contentType: "application/json",
43
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
44
+ requestType: "json",
45
+ body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
46
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
47
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
48
+ abortSignal: requestOptions?.abortSignal,
49
+ fetchFn: this._options?.fetch,
50
+ logging: this._options.logging,
51
+ });
52
+ if (_response.ok) {
53
+ return { data: _response.body, rawResponse: _response.rawResponse };
54
+ }
55
+ if (_response.error.reason === "status-code") {
56
+ switch (_response.error.statusCode) {
57
+ case 400:
58
+ throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
59
+ case 401:
60
+ throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
61
+ case 404:
62
+ throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
63
+ case 429:
64
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
65
+ default:
66
+ throw new errors.ToltApiError({
67
+ statusCode: _response.error.statusCode,
68
+ body: _response.error.body,
69
+ rawResponse: _response.rawResponse,
70
+ });
71
+ }
72
+ }
73
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/embed-tokens");
74
+ }
75
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface CreateEmbedTokenRequest {
6
+ partner_id?: string;
7
+ partner?: CreateEmbedTokenRequest.Partner;
8
+ }
9
+ export declare namespace CreateEmbedTokenRequest {
10
+ interface Partner {
11
+ email: string;
12
+ program_id: string;
13
+ }
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { CreateEmbedTokenRequest } from "./CreateEmbedTokenRequest.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { EmbedClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { EmbedClient } from "./client/Client.js";
3
+ export * from "./client/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,6 @@
1
+ import type * as ToltApi from "../../../index.js";
2
+ export interface CreateEmbedTokenResponse {
3
+ success: boolean;
4
+ message: string;
5
+ data: ToltApi.EmbedToken;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -0,0 +1 @@
1
+ export * from "./CreateEmbedTokenResponse.js";
@@ -16,6 +16,7 @@ export declare class FlowsClient {
16
16
  *
17
17
  * @throws {@link ToltApi.BadRequestError}
18
18
  * @throws {@link ToltApi.UnauthorizedError}
19
+ * @throws {@link ToltApi.TooManyRequestsError}
19
20
  * @throws {@link errors.ToltApiError}
20
21
  * @throws {@link errors.ToltApiTimeoutError}
21
22
  *
@@ -30,6 +31,7 @@ export declare class FlowsClient {
30
31
  *
31
32
  * @throws {@link ToltApi.UnauthorizedError}
32
33
  * @throws {@link ToltApi.NotFoundError}
34
+ * @throws {@link ToltApi.TooManyRequestsError}
33
35
  * @throws {@link errors.ToltApiError}
34
36
  * @throws {@link errors.ToltApiTimeoutError}
35
37
  *