@tolt/api 0.6.1 → 0.7.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 (166) hide show
  1. package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
  2. package/dist/api/errors/ContentTooLargeError.js +17 -0
  3. package/dist/api/errors/index.d.ts +1 -0
  4. package/dist/api/errors/index.js +1 -0
  5. package/dist/api/resources/clicks/client/Client.d.ts +6 -1
  6. package/dist/api/resources/clicks/client/Client.js +15 -4
  7. package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +1 -1
  8. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
  9. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
  10. package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
  11. package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
  12. package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
  13. package/dist/api/resources/commissions/client/Client.d.ts +29 -7
  14. package/dist/api/resources/commissions/client/Client.js +56 -16
  15. package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +1 -1
  16. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
  17. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
  18. package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +1 -1
  19. package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +1 -1
  20. package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +1 -1
  21. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
  22. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +19 -4
  23. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +8 -1
  24. package/dist/api/resources/commissions/client/requests/index.d.ts +1 -1
  25. package/dist/api/resources/commissions/client/requests/index.js +1 -1
  26. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
  27. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
  28. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
  29. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
  30. package/dist/api/resources/customers/client/Client.d.ts +27 -4
  31. package/dist/api/resources/customers/client/Client.js +42 -9
  32. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +20 -2
  33. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +1 -0
  34. package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +1 -1
  35. package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +1 -1
  36. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
  37. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +15 -2
  38. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +1 -0
  39. package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
  40. package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
  41. package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
  42. package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
  43. package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
  44. package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
  45. package/dist/api/resources/embed/client/Client.d.ts +5 -2
  46. package/dist/api/resources/embed/client/Client.js +9 -4
  47. package/dist/api/resources/embed/client/index.d.ts +1 -1
  48. package/dist/api/resources/embed/client/index.js +1 -1
  49. package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +1 -0
  50. package/dist/api/resources/embed/types/index.d.ts +1 -0
  51. package/dist/api/resources/embed/types/index.js +1 -0
  52. package/dist/api/resources/flows/client/Client.d.ts +7 -1
  53. package/dist/api/resources/flows/client/Client.js +13 -3
  54. package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +1 -1
  55. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -5
  56. package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +1 -0
  57. package/dist/api/resources/flows/types/ListFlowsRequestActive.js +1 -0
  58. package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
  59. package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
  60. package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
  61. package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
  62. package/dist/api/resources/groups/client/Client.d.ts +7 -1
  63. package/dist/api/resources/groups/client/Client.js +13 -3
  64. package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +1 -1
  65. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +10 -5
  66. package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +1 -0
  67. package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +1 -0
  68. package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
  69. package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
  70. package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
  71. package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
  72. package/dist/api/resources/index.d.ts +0 -1
  73. package/dist/api/resources/index.js +0 -1
  74. package/dist/api/resources/links/client/Client.d.ts +17 -5
  75. package/dist/api/resources/links/client/Client.js +37 -11
  76. package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +6 -2
  77. package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +1 -1
  78. package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +1 -1
  79. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
  80. package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +6 -2
  81. package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
  82. package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
  83. package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
  84. package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
  85. package/dist/api/resources/partners/client/Client.d.ts +39 -10
  86. package/dist/api/resources/partners/client/Client.js +66 -21
  87. package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +1 -1
  88. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
  89. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
  90. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +21 -7
  91. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +1 -0
  92. package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +1 -1
  93. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
  94. package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +2 -1
  95. package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +2 -1
  96. package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +10 -2
  97. package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
  98. package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
  99. package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
  100. package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
  101. package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
  102. package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
  103. package/dist/api/resources/programs/client/Client.d.ts +7 -1
  104. package/dist/api/resources/programs/client/Client.js +13 -3
  105. package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +1 -1
  106. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
  107. package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
  108. package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
  109. package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
  110. package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
  111. package/dist/api/resources/promotionCodes/client/Client.d.ts +27 -5
  112. package/dist/api/resources/promotionCodes/client/Client.js +46 -10
  113. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +9 -2
  114. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +1 -0
  115. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +1 -1
  116. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +1 -1
  117. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
  118. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +8 -1
  119. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +1 -0
  120. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
  121. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
  122. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
  123. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
  124. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
  125. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
  126. package/dist/api/resources/reports/client/Client.d.ts +15 -0
  127. package/dist/api/resources/reports/client/Client.js +30 -5
  128. package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +3 -0
  129. package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +8 -0
  130. package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +3 -0
  131. package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +8 -0
  132. package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +5 -0
  133. package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
  134. package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
  135. package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
  136. package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
  137. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
  138. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
  139. package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
  140. package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
  141. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
  142. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
  143. package/dist/api/resources/transactions/client/Client.d.ts +30 -7
  144. package/dist/api/resources/transactions/client/Client.js +53 -14
  145. package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +17 -3
  146. package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +1 -1
  147. package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +1 -1
  148. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
  149. package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +1 -1
  150. package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +1 -1
  151. package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +13 -2
  152. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
  153. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
  154. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
  155. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
  156. package/dist/api/types/Commission.d.ts +1 -1
  157. package/dist/api/types/Customer.d.ts +2 -2
  158. package/dist/api/types/Error_.d.ts +1 -0
  159. package/dist/api/types/Error_.js +1 -0
  160. package/dist/environments.d.ts +2 -2
  161. package/dist/environments.js +1 -1
  162. package/package.json +1 -1
  163. package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
  164. package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
  165. package/dist/api/resources/embed/client/requests/index.js +0 -1
  166. /package/dist/api/resources/embed/{client/requests → types}/CreateTokenEmbedRequest.js +0 -0
@@ -0,0 +1,7 @@
1
+ import type * as core from "../../core/index.js";
2
+ import * as errors from "../../errors/index.js";
3
+ import type * as ToltApi from "../index.js";
4
+ export declare class ContentTooLargeError extends errors.ToltApiError {
5
+ readonly body: ToltApi.Error_;
6
+ constructor(body: ToltApi.Error_, rawResponse?: core.RawResponse);
7
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.js";
3
+ export class ContentTooLargeError extends errors.ToltApiError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "ContentTooLargeError",
7
+ statusCode: 413,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = "ContentTooLargeError";
16
+ }
17
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./BadRequestError.js";
2
2
  export * from "./ConflictError.js";
3
+ export * from "./ContentTooLargeError.js";
3
4
  export * from "./NotFoundError.js";
4
5
  export * from "./TooManyRequestsError.js";
5
6
  export * from "./UnauthorizedError.js";
@@ -1,5 +1,6 @@
1
1
  export * from "./BadRequestError.js";
2
2
  export * from "./ConflictError.js";
3
+ export * from "./ContentTooLargeError.js";
3
4
  export * from "./NotFoundError.js";
4
5
  export * from "./TooManyRequestsError.js";
5
6
  export * from "./UnauthorizedError.js";
@@ -18,6 +18,7 @@ export declare class ClicksClient {
18
18
  *
19
19
  * @throws {@link ToltApi.BadRequestError}
20
20
  * @throws {@link ToltApi.UnauthorizedError}
21
+ * @throws {@link ToltApi.ContentTooLargeError}
21
22
  * @throws {@link ToltApi.TooManyRequestsError}
22
23
  * @throws {@link errors.ToltApiError}
23
24
  * @throws {@link errors.ToltApiTimeoutError}
@@ -38,6 +39,7 @@ export declare class ClicksClient {
38
39
  *
39
40
  * @throws {@link ToltApi.BadRequestError}
40
41
  * @throws {@link ToltApi.UnauthorizedError}
42
+ * @throws {@link ToltApi.ContentTooLargeError}
41
43
  * @throws {@link ToltApi.TooManyRequestsError}
42
44
  * @throws {@link errors.ToltApiError}
43
45
  * @throws {@link errors.ToltApiTimeoutError}
@@ -50,18 +52,21 @@ export declare class ClicksClient {
50
52
  create(request: ToltApi.CreateClicksRequest, requestOptions?: ClicksClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateClicksResponse>;
51
53
  private __create;
52
54
  /**
55
+ * Gets a recorded click by ID, with the partner, link, page, referrer, country, device and browser it came from.
56
+ *
53
57
  * @param {ToltApi.GetClicksRequest} request
54
58
  * @param {ClicksClient.RequestOptions} requestOptions - Request-specific configuration.
55
59
  *
56
60
  * @throws {@link ToltApi.UnauthorizedError}
57
61
  * @throws {@link ToltApi.NotFoundError}
62
+ * @throws {@link ToltApi.ContentTooLargeError}
58
63
  * @throws {@link ToltApi.TooManyRequestsError}
59
64
  * @throws {@link errors.ToltApiError}
60
65
  * @throws {@link errors.ToltApiTimeoutError}
61
66
  *
62
67
  * @example
63
68
  * await client.clicks.get({
64
- * id: "id"
69
+ * id: "clk_mEsbFYv6ZjqXjAoFwokjS6v6"
65
70
  * })
66
71
  */
67
72
  get(request: ToltApi.GetClicksRequest, requestOptions?: ClicksClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetClicksResponse>;
@@ -19,6 +19,7 @@ export class ClicksClient {
19
19
  *
20
20
  * @throws {@link ToltApi.BadRequestError}
21
21
  * @throws {@link ToltApi.UnauthorizedError}
22
+ * @throws {@link ToltApi.ContentTooLargeError}
22
23
  * @throws {@link ToltApi.TooManyRequestsError}
23
24
  * @throws {@link errors.ToltApiError}
24
25
  * @throws {@link errors.ToltApiTimeoutError}
@@ -55,7 +56,7 @@ export class ClicksClient {
55
56
  const _response = await core.fetcher({
56
57
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
57
58
  (await core.Supplier.get(this._options.environment)) ??
58
- environments.ToltApiEnvironment.Production, "v2/clicks"),
59
+ environments.ToltApiEnvironment.Default, "v2/clicks"),
59
60
  method: "GET",
60
61
  headers: _headers,
61
62
  queryString: core.url
@@ -78,6 +79,8 @@ export class ClicksClient {
78
79
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
79
80
  case 401:
80
81
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
82
+ case 413:
83
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
81
84
  case 429:
82
85
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
83
86
  default:
@@ -98,6 +101,7 @@ export class ClicksClient {
98
101
  *
99
102
  * @throws {@link ToltApi.BadRequestError}
100
103
  * @throws {@link ToltApi.UnauthorizedError}
104
+ * @throws {@link ToltApi.ContentTooLargeError}
101
105
  * @throws {@link ToltApi.TooManyRequestsError}
102
106
  * @throws {@link errors.ToltApiError}
103
107
  * @throws {@link errors.ToltApiTimeoutError}
@@ -116,7 +120,7 @@ export class ClicksClient {
116
120
  const _response = await core.fetcher({
117
121
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
118
122
  (await core.Supplier.get(this._options.environment)) ??
119
- environments.ToltApiEnvironment.Production, "v2/clicks"),
123
+ environments.ToltApiEnvironment.Default, "v2/clicks"),
120
124
  method: "POST",
121
125
  headers: _headers,
122
126
  contentType: "application/json",
@@ -138,6 +142,8 @@ export class ClicksClient {
138
142
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
139
143
  case 401:
140
144
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
145
+ case 413:
146
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
141
147
  case 429:
142
148
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
143
149
  default:
@@ -151,18 +157,21 @@ export class ClicksClient {
151
157
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/clicks");
152
158
  }
153
159
  /**
160
+ * Gets a recorded click by ID, with the partner, link, page, referrer, country, device and browser it came from.
161
+ *
154
162
  * @param {ToltApi.GetClicksRequest} request
155
163
  * @param {ClicksClient.RequestOptions} requestOptions - Request-specific configuration.
156
164
  *
157
165
  * @throws {@link ToltApi.UnauthorizedError}
158
166
  * @throws {@link ToltApi.NotFoundError}
167
+ * @throws {@link ToltApi.ContentTooLargeError}
159
168
  * @throws {@link ToltApi.TooManyRequestsError}
160
169
  * @throws {@link errors.ToltApiError}
161
170
  * @throws {@link errors.ToltApiTimeoutError}
162
171
  *
163
172
  * @example
164
173
  * await client.clicks.get({
165
- * id: "id"
174
+ * id: "clk_mEsbFYv6ZjqXjAoFwokjS6v6"
166
175
  * })
167
176
  */
168
177
  get(request, requestOptions) {
@@ -175,7 +184,7 @@ export class ClicksClient {
175
184
  const _response = await core.fetcher({
176
185
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
177
186
  (await core.Supplier.get(this._options.environment)) ??
178
- environments.ToltApiEnvironment.Production, `v2/clicks/${core.url.encodePathParam(id)}`),
187
+ environments.ToltApiEnvironment.Default, `v2/clicks/${core.url.encodePathParam(id)}`),
179
188
  method: "GET",
180
189
  headers: _headers,
181
190
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -194,6 +203,8 @@ export class ClicksClient {
194
203
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
195
204
  case 404:
196
205
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
206
+ case 413:
207
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
197
208
  case 429:
198
209
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
199
210
  default:
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "clk_mEsbFYv6ZjqXjAoFwokjS6v6"
5
5
  * }
6
6
  */
7
7
  export interface GetClicksRequest {
@@ -7,24 +7,29 @@ import type * as ToltApi from "../../../../index.js";
7
7
  * }
8
8
  */
9
9
  export interface ListClicksRequest {
10
+ /** How many rows to return in one page. */
10
11
  limit?: number;
12
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
11
13
  order?: ToltApi.ListClicksRequestOrder;
12
- /** Column the list is ordered and paged by. */
14
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
13
15
  sort?: ToltApi.ListClicksRequestSort;
14
16
  /** 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. */
15
17
  starting_after?: string;
16
18
  /** 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. */
17
19
  ending_before?: string;
18
- /** Only items created at or after this ISO 8601 time. */
20
+ /** Start of a window on when items were created: items created at this time or later are included, for example 2026-01-01T00:00:00Z. Leave it out for no lower bound. */
19
21
  created_after?: string;
20
- /** Only items created before this ISO 8601 time. */
22
+ /** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
21
23
  created_before?: string;
22
- /** Only items updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
24
+ /** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
23
25
  updated_after?: string;
24
- /** Only items updated before this ISO 8601 time. */
26
+ /** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
25
27
  updated_before?: string;
28
+ /** Limit to one program, by its id (prg_...) as returned when listing programs. */
26
29
  program_id?: string;
30
+ /** Limit to one partner, by its id (part_...) as returned when listing partners. */
27
31
  partner_id?: string;
32
+ /** Limit to one referral link, by its id (lnk_...) as returned when listing links. */
28
33
  link_id?: string;
29
34
  /** Filter by the click's stored country, matched exactly (values are not normalized). Clicks recorded by the tracking script store a country name (e.g. `Canada`); clicks created through the API store a 2-letter ISO code (e.g. `CA`). Filter by the exact form you expect. */
30
35
  country?: string;
@@ -1,3 +1,4 @@
1
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
1
2
  export declare const ListClicksRequestOrder: {
2
3
  readonly Asc: "asc";
3
4
  readonly Desc: "desc";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
2
3
  export const ListClicksRequestOrder = {
3
4
  Asc: "asc",
4
5
  Desc: "desc",
@@ -1,4 +1,4 @@
1
- /** Column the list is ordered and paged by. */
1
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
2
2
  export declare const ListClicksRequestSort: {
3
3
  readonly CreatedAt: "created_at";
4
4
  readonly UpdatedAt: "updated_at";
@@ -1,5 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- /** Column the list is ordered and paged by. */
2
+ /** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
3
3
  export const ListClicksRequestSort = {
4
4
  CreatedAt: "created_at",
5
5
  UpdatedAt: "updated_at",
@@ -18,13 +18,14 @@ export declare class CommissionsClient {
18
18
  *
19
19
  * @throws {@link ToltApi.BadRequestError}
20
20
  * @throws {@link ToltApi.UnauthorizedError}
21
+ * @throws {@link ToltApi.ContentTooLargeError}
21
22
  * @throws {@link ToltApi.TooManyRequestsError}
22
23
  * @throws {@link errors.ToltApiError}
23
24
  * @throws {@link errors.ToltApiTimeoutError}
24
25
  *
25
26
  * @example
26
27
  * await client.commissions.bulkApprove({
27
- * ids: ["part_9fQ2xLL", "part_3RtV9k"]
28
+ * ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
28
29
  * })
29
30
  */
30
31
  bulkApprove(request: ToltApi.BulkApproveCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.BulkApproveCommissionsResponse>;
@@ -37,23 +38,27 @@ export declare class CommissionsClient {
37
38
  *
38
39
  * @throws {@link ToltApi.BadRequestError}
39
40
  * @throws {@link ToltApi.UnauthorizedError}
41
+ * @throws {@link ToltApi.ContentTooLargeError}
40
42
  * @throws {@link ToltApi.TooManyRequestsError}
41
43
  * @throws {@link errors.ToltApiError}
42
44
  * @throws {@link errors.ToltApiTimeoutError}
43
45
  *
44
46
  * @example
45
47
  * await client.commissions.bulkDecline({
46
- * ids: ["part_9fQ2xLL", "part_3RtV9k"]
48
+ * ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
47
49
  * })
48
50
  */
49
51
  bulkDecline(request: ToltApi.BulkDeclineCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.BulkDeclineCommissionsResponse>;
50
52
  private __bulkDecline;
51
53
  /**
54
+ * Lists commissions. Filter by program, partner, customer, transaction, status or type, and page with cursors.
55
+ *
52
56
  * @param {ToltApi.ListCommissionsRequest} request
53
57
  * @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
54
58
  *
55
59
  * @throws {@link ToltApi.BadRequestError}
56
60
  * @throws {@link ToltApi.UnauthorizedError}
61
+ * @throws {@link ToltApi.ContentTooLargeError}
57
62
  * @throws {@link ToltApi.TooManyRequestsError}
58
63
  * @throws {@link errors.ToltApiError}
59
64
  * @throws {@link errors.ToltApiTimeoutError}
@@ -72,6 +77,7 @@ export declare class CommissionsClient {
72
77
  * @throws {@link ToltApi.BadRequestError}
73
78
  * @throws {@link ToltApi.UnauthorizedError}
74
79
  * @throws {@link ToltApi.ConflictError}
80
+ * @throws {@link ToltApi.ContentTooLargeError}
75
81
  * @throws {@link ToltApi.TooManyRequestsError}
76
82
  * @throws {@link errors.ToltApiError}
77
83
  * @throws {@link errors.ToltApiTimeoutError}
@@ -84,18 +90,21 @@ export declare class CommissionsClient {
84
90
  create(request: ToltApi.CreateCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCommissionsResponse>;
85
91
  private __create;
86
92
  /**
93
+ * Gets a commission by ID, with its amount, status, type and partner, plus its customer and transaction when it has them.
94
+ *
87
95
  * @param {ToltApi.GetCommissionsRequest} request
88
96
  * @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
89
97
  *
90
98
  * @throws {@link ToltApi.UnauthorizedError}
91
99
  * @throws {@link ToltApi.NotFoundError}
100
+ * @throws {@link ToltApi.ContentTooLargeError}
92
101
  * @throws {@link ToltApi.TooManyRequestsError}
93
102
  * @throws {@link errors.ToltApiError}
94
103
  * @throws {@link errors.ToltApiTimeoutError}
95
104
  *
96
105
  * @example
97
106
  * await client.commissions.get({
98
- * id: "id"
107
+ * id: "comm_X85RLnefjTCNrypH4MA1PdSp"
99
108
  * })
100
109
  */
101
110
  get(request: ToltApi.GetCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetCommissionsResponse>;
@@ -110,18 +119,24 @@ export declare class CommissionsClient {
110
119
  * @throws {@link ToltApi.UnauthorizedError}
111
120
  * @throws {@link ToltApi.NotFoundError}
112
121
  * @throws {@link ToltApi.ConflictError}
122
+ * @throws {@link ToltApi.ContentTooLargeError}
113
123
  * @throws {@link ToltApi.TooManyRequestsError}
114
124
  * @throws {@link errors.ToltApiError}
115
125
  * @throws {@link errors.ToltApiTimeoutError}
116
126
  *
117
127
  * @example
118
128
  * await client.commissions.update({
119
- * id: "id"
129
+ * id: "comm_X85RLnefjTCNrypH4MA1PdSp",
130
+ * amount: 1000,
131
+ * revenue: 5000,
132
+ * status: "approved"
120
133
  * })
121
134
  */
122
135
  update(request: ToltApi.UpdateCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdateCommissionsResponse>;
123
136
  private __update;
124
137
  /**
138
+ * Deletes a commission. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
139
+ *
125
140
  * @param {ToltApi.DeleteCommissionsRequest} request
126
141
  * @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
127
142
  *
@@ -129,18 +144,21 @@ export declare class CommissionsClient {
129
144
  * @throws {@link ToltApi.UnauthorizedError}
130
145
  * @throws {@link ToltApi.NotFoundError}
131
146
  * @throws {@link ToltApi.ConflictError}
147
+ * @throws {@link ToltApi.ContentTooLargeError}
132
148
  * @throws {@link ToltApi.TooManyRequestsError}
133
149
  * @throws {@link errors.ToltApiError}
134
150
  * @throws {@link errors.ToltApiTimeoutError}
135
151
  *
136
152
  * @example
137
153
  * await client.commissions.delete({
138
- * id: "id"
154
+ * id: "comm_X85RLnefjTCNrypH4MA1PdSp"
139
155
  * })
140
156
  */
141
157
  delete(request: ToltApi.DeleteCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeleteCommissionsResponse>;
142
158
  private __delete;
143
159
  /**
160
+ * Marks a commission approved so it is included in the next payout. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
161
+ *
144
162
  * @param {ToltApi.ApproveCommissionsRequest} request
145
163
  * @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
146
164
  *
@@ -148,18 +166,21 @@ export declare class CommissionsClient {
148
166
  * @throws {@link ToltApi.UnauthorizedError}
149
167
  * @throws {@link ToltApi.NotFoundError}
150
168
  * @throws {@link ToltApi.ConflictError}
169
+ * @throws {@link ToltApi.ContentTooLargeError}
151
170
  * @throws {@link ToltApi.TooManyRequestsError}
152
171
  * @throws {@link errors.ToltApiError}
153
172
  * @throws {@link errors.ToltApiTimeoutError}
154
173
  *
155
174
  * @example
156
175
  * await client.commissions.approve({
157
- * id: "id"
176
+ * id: "comm_X85RLnefjTCNrypH4MA1PdSp"
158
177
  * })
159
178
  */
160
179
  approve(request: ToltApi.ApproveCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ApproveCommissionsResponse>;
161
180
  private __approve;
162
181
  /**
182
+ * Marks a commission declined so it is left out of payouts until it is approved again. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
183
+ *
163
184
  * @param {ToltApi.DeclineCommissionsRequest} request
164
185
  * @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
165
186
  *
@@ -167,13 +188,14 @@ export declare class CommissionsClient {
167
188
  * @throws {@link ToltApi.UnauthorizedError}
168
189
  * @throws {@link ToltApi.NotFoundError}
169
190
  * @throws {@link ToltApi.ConflictError}
191
+ * @throws {@link ToltApi.ContentTooLargeError}
170
192
  * @throws {@link ToltApi.TooManyRequestsError}
171
193
  * @throws {@link errors.ToltApiError}
172
194
  * @throws {@link errors.ToltApiTimeoutError}
173
195
  *
174
196
  * @example
175
197
  * await client.commissions.decline({
176
- * id: "id"
198
+ * id: "comm_X85RLnefjTCNrypH4MA1PdSp"
177
199
  * })
178
200
  */
179
201
  decline(request: ToltApi.DeclineCommissionsRequest, requestOptions?: CommissionsClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeclineCommissionsResponse>;