@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.
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +4 -0
- package/dist/api/errors/TooManyRequestsError.d.ts +7 -0
- package/dist/api/errors/TooManyRequestsError.js +17 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/clicks/client/Client.d.ts +10 -4
- package/dist/api/resources/clicks/client/Client.js +22 -24
- package/dist/api/resources/clicks/client/requests/index.d.ts +0 -1
- package/dist/api/resources/clicks/types/CreateClickRequest.d.ts +1 -0
- package/dist/api/resources/clicks/types/CreateClickResponse.d.ts +6 -0
- package/dist/api/resources/clicks/types/index.d.ts +2 -2
- package/dist/api/resources/clicks/types/index.js +2 -2
- package/dist/api/resources/commissions/client/Client.d.ts +45 -0
- package/dist/api/resources/commissions/client/Client.js +154 -1
- package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +10 -0
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +10 -0
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +13 -0
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +3 -3
- package/dist/api/resources/commissions/client/requests/index.d.ts +2 -0
- package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.js +2 -0
- package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.js +2 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +6 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +6 -0
- package/dist/api/resources/commissions/types/ListCommissionsResponse.d.ts +4 -0
- package/dist/api/resources/commissions/types/index.d.ts +3 -0
- package/dist/api/resources/commissions/types/index.js +3 -0
- package/dist/api/resources/customers/client/Client.d.ts +7 -4
- package/dist/api/resources/customers/client/Client.js +25 -6
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +14 -0
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.js +2 -0
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +13 -0
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +6 -6
- package/dist/api/resources/customers/client/requests/index.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +6 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.js +6 -0
- package/dist/api/resources/customers/types/ListCustomersResponse.d.ts +4 -0
- package/dist/api/resources/customers/types/index.d.ts +1 -1
- package/dist/api/resources/customers/types/index.js +1 -1
- package/dist/api/resources/embed/client/Client.d.ts +31 -0
- package/dist/api/resources/embed/client/Client.js +75 -0
- package/dist/api/resources/embed/client/index.d.ts +1 -0
- package/dist/api/resources/embed/client/index.js +1 -0
- package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.d.ts +14 -0
- package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.js +2 -0
- package/dist/api/resources/embed/client/requests/index.d.ts +1 -0
- package/dist/api/resources/embed/client/requests/index.js +1 -0
- package/dist/api/resources/embed/exports.d.ts +2 -0
- package/dist/api/resources/embed/exports.js +3 -0
- package/dist/api/resources/embed/index.d.ts +2 -0
- package/dist/api/resources/embed/index.js +2 -0
- package/dist/api/resources/embed/types/CreateEmbedTokenResponse.d.ts +6 -0
- package/dist/api/resources/embed/types/CreateEmbedTokenResponse.js +2 -0
- package/dist/api/resources/embed/types/index.d.ts +1 -0
- package/dist/api/resources/embed/types/index.js +1 -0
- package/dist/api/resources/flows/client/Client.d.ts +2 -0
- package/dist/api/resources/flows/client/Client.js +13 -1
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +6 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.js +6 -0
- package/dist/api/resources/flows/types/ListFlowsResponse.d.ts +4 -0
- package/dist/api/resources/flows/types/index.d.ts +1 -0
- package/dist/api/resources/flows/types/index.js +1 -0
- package/dist/api/resources/groups/client/Client.d.ts +2 -0
- package/dist/api/resources/groups/client/Client.js +13 -1
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +13 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +6 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.js +6 -0
- package/dist/api/resources/groups/types/ListGroupsResponse.d.ts +4 -0
- package/dist/api/resources/groups/types/index.d.ts +1 -0
- package/dist/api/resources/groups/types/index.js +1 -0
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +3 -0
- package/dist/api/resources/links/client/Client.d.ts +6 -1
- package/dist/api/resources/links/client/Client.js +23 -2
- package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +2 -2
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +13 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +6 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.js +6 -0
- package/dist/api/resources/links/types/ListLinksResponse.d.ts +4 -0
- package/dist/api/resources/links/types/index.d.ts +1 -0
- package/dist/api/resources/links/types/index.js +1 -0
- package/dist/api/resources/partners/client/Client.d.ts +85 -0
- package/dist/api/resources/partners/client/Client.js +273 -1
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +10 -0
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +41 -0
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +8 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +13 -0
- package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +16 -0
- package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/index.d.ts +4 -0
- package/dist/api/resources/partners/client/requests/index.js +1 -1
- package/dist/api/resources/partners/types/BulkApprovePartnersResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/BulkApprovePartnersResponse.js +2 -0
- package/dist/api/resources/partners/types/BulkRejectPartnersResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/BulkRejectPartnersResponse.js +2 -0
- package/dist/api/resources/partners/types/CreatePartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/CreatePartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +6 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.js +6 -0
- package/dist/api/resources/partners/types/ListPartnersResponse.d.ts +4 -0
- package/dist/api/resources/partners/types/UpdatePartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/UpdatePartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/index.d.ts +5 -0
- package/dist/api/resources/partners/types/index.js +5 -0
- package/dist/api/resources/programs/client/Client.d.ts +2 -0
- package/dist/api/resources/programs/client/Client.js +13 -1
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +13 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +6 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.js +6 -0
- package/dist/api/resources/programs/types/ListProgramsResponse.d.ts +4 -0
- package/dist/api/resources/programs/types/index.d.ts +1 -0
- package/dist/api/resources/programs/types/index.js +1 -0
- package/dist/api/resources/promotionCodes/client/Client.d.ts +6 -1
- package/dist/api/resources/promotionCodes/client/Client.js +23 -2
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +2 -2
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +13 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +6 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.d.ts +4 -0
- package/dist/api/resources/promotionCodes/types/index.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/index.js +1 -0
- package/dist/api/resources/reports/client/Client.d.ts +61 -2
- package/dist/api/resources/reports/client/Client.js +264 -2
- package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.d.ts +9 -0
- package/dist/api/resources/reports/client/requests/ReportsCustomerStatsRequest.js +2 -0
- package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +14 -0
- package/dist/api/resources/reports/client/requests/ReportsLinksRequest.js +2 -0
- package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +14 -0
- package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.js +2 -0
- package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +11 -0
- package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.js +2 -0
- package/dist/api/resources/reports/client/requests/index.d.ts +4 -0
- package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.d.ts +6 -0
- package/dist/api/resources/reports/types/ReportsCustomerStatsResponse.js +2 -0
- package/dist/api/resources/reports/types/ReportsLinksRequestOrder.d.ts +5 -0
- package/dist/api/resources/{clicks/types/ListClicksRequestOrder.js → reports/types/ReportsLinksRequestOrder.js} +1 -1
- package/dist/api/resources/reports/types/ReportsLinksRequestSort.d.ts +7 -0
- package/dist/api/resources/reports/types/ReportsLinksRequestSort.js +7 -0
- package/dist/api/resources/{clicks/types/ListClicksResponse.d.ts → reports/types/ReportsLinksResponse.d.ts} +2 -2
- package/dist/api/resources/reports/types/ReportsLinksResponse.js +2 -0
- package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.d.ts +5 -0
- package/dist/api/resources/reports/types/ReportsPartnersRequestOrder.js +5 -0
- package/dist/api/resources/reports/types/ReportsPartnersRequestSort.d.ts +7 -0
- package/dist/api/resources/reports/types/ReportsPartnersRequestSort.js +7 -0
- package/dist/api/resources/reports/types/ReportsPartnersResponse.d.ts +7 -0
- package/dist/api/resources/reports/types/ReportsPartnersResponse.js +2 -0
- package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.d.ts +6 -0
- package/dist/api/resources/reports/types/ReportsTimeseriesRequestGranularity.js +6 -0
- package/dist/api/resources/reports/types/ReportsTimeseriesResponse.d.ts +6 -0
- package/dist/api/resources/reports/types/ReportsTimeseriesResponse.js +2 -0
- package/dist/api/resources/reports/types/index.d.ts +9 -0
- package/dist/api/resources/reports/types/index.js +9 -0
- package/dist/api/resources/transactions/client/Client.d.ts +8 -1
- package/dist/api/resources/transactions/client/Client.js +29 -2
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +5 -5
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +13 -0
- package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +4 -4
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +6 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +6 -0
- package/dist/api/resources/transactions/types/ListTransactionsResponse.d.ts +4 -0
- package/dist/api/resources/transactions/types/index.d.ts +1 -0
- package/dist/api/resources/transactions/types/index.js +1 -0
- package/dist/api/types/BulkResult.d.ts +24 -0
- package/dist/api/types/BulkResult.js +14 -0
- package/dist/api/types/Click.d.ts +5 -5
- package/dist/api/types/Commission.d.ts +13 -13
- package/dist/api/types/CreatedPartner.d.ts +19 -0
- package/dist/api/types/CreatedPartner.js +2 -0
- package/dist/api/types/Customer.d.ts +11 -11
- package/dist/api/types/EmbedToken.d.ts +4 -0
- package/dist/api/types/EmbedToken.js +2 -0
- package/dist/api/types/Error_.d.ts +34 -0
- package/dist/api/types/Error_.js +21 -1
- package/dist/api/types/Flow.d.ts +8 -8
- package/dist/api/types/Group.d.ts +9 -9
- package/dist/api/types/Link.d.ts +5 -5
- package/dist/api/types/Partner.d.ts +12 -8
- package/dist/api/types/Program.d.ts +8 -8
- package/dist/api/types/PromotionCode.d.ts +8 -8
- package/dist/api/types/ReportsCustomerStats.d.ts +6 -0
- package/dist/api/types/ReportsCustomerStats.js +2 -0
- package/dist/api/types/ReportsLinkRow.d.ts +12 -0
- package/dist/api/types/ReportsLinkRow.js +2 -0
- package/dist/api/types/ReportsOverview.d.ts +5 -5
- package/dist/api/types/ReportsPartnerRow.d.ts +15 -0
- package/dist/api/types/ReportsPartnerRow.js +2 -0
- package/dist/api/types/ReportsTimeseriesPoint.d.ts +10 -0
- package/dist/api/types/ReportsTimeseriesPoint.js +2 -0
- package/dist/api/types/Transaction.d.ts +17 -17
- package/dist/api/types/index.d.ts +7 -0
- package/dist/api/types/index.js +7 -0
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/package.json +1 -1
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +0 -16
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +0 -5
- package/dist/api/resources/customers/types/CreateCustomerRequest.d.ts +0 -1
- /package/dist/api/resources/clicks/{client/requests/ListClicksRequest.js → types/CreateClickRequest.js} +0 -0
- /package/dist/api/resources/clicks/types/{ListClicksResponse.js → CreateClickResponse.js} +0 -0
- /package/dist/api/resources/{customers/types/CreateCustomerRequest.js → commissions/client/requests/BulkApproveCommissionsRequest.js} +0 -0
|
@@ -16,6 +16,7 @@ export class ProgramsClient {
|
|
|
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
|
*
|
|
@@ -26,11 +27,17 @@ export class ProgramsClient {
|
|
|
26
27
|
return core.HttpResponsePromise.fromPromise(this.__listPrograms(request, requestOptions));
|
|
27
28
|
}
|
|
28
29
|
async __listPrograms(request = {}, requestOptions) {
|
|
29
|
-
const { limit, order, starting_after: startingAfter, search } = request;
|
|
30
|
+
const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, search, } = request;
|
|
30
31
|
const _queryParams = {
|
|
31
32
|
limit,
|
|
32
33
|
order: order != null ? order : undefined,
|
|
34
|
+
sort: sort != null ? sort : undefined,
|
|
33
35
|
starting_after: startingAfter,
|
|
36
|
+
ending_before: endingBefore,
|
|
37
|
+
created_after: createdAfter != null ? createdAfter : undefined,
|
|
38
|
+
created_before: createdBefore != null ? createdBefore : undefined,
|
|
39
|
+
updated_after: updatedAfter != null ? updatedAfter : undefined,
|
|
40
|
+
updated_before: updatedBefore != null ? updatedBefore : undefined,
|
|
34
41
|
search,
|
|
35
42
|
};
|
|
36
43
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
@@ -61,6 +68,8 @@ export class ProgramsClient {
|
|
|
61
68
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
62
69
|
case 401:
|
|
63
70
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
71
|
+
case 429:
|
|
72
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
64
73
|
default:
|
|
65
74
|
throw new errors.ToltApiError({
|
|
66
75
|
statusCode: _response.error.statusCode,
|
|
@@ -77,6 +86,7 @@ export class ProgramsClient {
|
|
|
77
86
|
*
|
|
78
87
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
79
88
|
* @throws {@link ToltApi.NotFoundError}
|
|
89
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
80
90
|
* @throws {@link errors.ToltApiError}
|
|
81
91
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
82
92
|
*
|
|
@@ -114,6 +124,8 @@ export class ProgramsClient {
|
|
|
114
124
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
115
125
|
case 404:
|
|
116
126
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 429:
|
|
128
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
117
129
|
default:
|
|
118
130
|
throw new errors.ToltApiError({
|
|
119
131
|
statusCode: _response.error.statusCode,
|
|
@@ -6,6 +6,19 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
6
6
|
export interface ListProgramsRequest {
|
|
7
7
|
limit?: number;
|
|
8
8
|
order?: ToltApi.ListProgramsRequestOrder;
|
|
9
|
+
/** Column the list is ordered and paged by. */
|
|
10
|
+
sort?: ToltApi.ListProgramsRequestSort;
|
|
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
|
search?: string;
|
|
11
24
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Column the list is ordered and paged by. */
|
|
2
|
+
export declare const ListProgramsRequestSort: {
|
|
3
|
+
readonly CreatedAt: "created_at";
|
|
4
|
+
readonly UpdatedAt: "updated_at";
|
|
5
|
+
};
|
|
6
|
+
export type ListProgramsRequestSort = (typeof ListProgramsRequestSort)[keyof typeof ListProgramsRequestSort];
|
|
@@ -4,4 +4,8 @@ export interface ListProgramsResponse {
|
|
|
4
4
|
message: string;
|
|
5
5
|
data: ToltApi.Program[];
|
|
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
|
}
|
|
@@ -16,6 +16,7 @@ export declare class PromotionCodesClient {
|
|
|
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,13 +31,14 @@ export declare class PromotionCodesClient {
|
|
|
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
39
|
* await client.promotionCodes.createPromotionCode({
|
|
38
40
|
* code: "code",
|
|
39
|
-
*
|
|
41
|
+
* partner_id: "partner_id"
|
|
40
42
|
* })
|
|
41
43
|
*/
|
|
42
44
|
createPromotionCode(request: ToltApi.CreatePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreatePromotionCodeResponse>;
|
|
@@ -47,6 +49,7 @@ export declare class PromotionCodesClient {
|
|
|
47
49
|
*
|
|
48
50
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
49
51
|
* @throws {@link ToltApi.NotFoundError}
|
|
52
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
50
53
|
* @throws {@link errors.ToltApiError}
|
|
51
54
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
52
55
|
*
|
|
@@ -64,6 +67,7 @@ export declare class PromotionCodesClient {
|
|
|
64
67
|
* @throws {@link ToltApi.BadRequestError}
|
|
65
68
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
66
69
|
* @throws {@link ToltApi.NotFoundError}
|
|
70
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
67
71
|
* @throws {@link errors.ToltApiError}
|
|
68
72
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
69
73
|
*
|
|
@@ -80,6 +84,7 @@ export declare class PromotionCodesClient {
|
|
|
80
84
|
*
|
|
81
85
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
82
86
|
* @throws {@link ToltApi.NotFoundError}
|
|
87
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
83
88
|
* @throws {@link errors.ToltApiError}
|
|
84
89
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
85
90
|
*
|
|
@@ -17,6 +17,7 @@ export class PromotionCodesClient {
|
|
|
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 PromotionCodesClient {
|
|
|
27
28
|
return core.HttpResponsePromise.fromPromise(this.__listPromotionCodes(request, requestOptions));
|
|
28
29
|
}
|
|
29
30
|
async __listPromotionCodes(request = {}, requestOptions) {
|
|
30
|
-
const { limit, order, starting_after: startingAfter, program_id: programId, partner_id: partnerId, type: type_, 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, type: type_, 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
|
type: type_,
|
|
@@ -65,6 +72,8 @@ export class PromotionCodesClient {
|
|
|
65
72
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
66
73
|
case 401:
|
|
67
74
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
75
|
+
case 429:
|
|
76
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
68
77
|
default:
|
|
69
78
|
throw new errors.ToltApiError({
|
|
70
79
|
statusCode: _response.error.statusCode,
|
|
@@ -81,13 +90,14 @@ export class PromotionCodesClient {
|
|
|
81
90
|
*
|
|
82
91
|
* @throws {@link ToltApi.BadRequestError}
|
|
83
92
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
93
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
84
94
|
* @throws {@link errors.ToltApiError}
|
|
85
95
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
86
96
|
*
|
|
87
97
|
* @example
|
|
88
98
|
* await client.promotionCodes.createPromotionCode({
|
|
89
99
|
* code: "code",
|
|
90
|
-
*
|
|
100
|
+
* partner_id: "partner_id"
|
|
91
101
|
* })
|
|
92
102
|
*/
|
|
93
103
|
createPromotionCode(request, requestOptions) {
|
|
@@ -121,6 +131,8 @@ export class PromotionCodesClient {
|
|
|
121
131
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
122
132
|
case 401:
|
|
123
133
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
134
|
+
case 429:
|
|
135
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
124
136
|
default:
|
|
125
137
|
throw new errors.ToltApiError({
|
|
126
138
|
statusCode: _response.error.statusCode,
|
|
@@ -137,6 +149,7 @@ export class PromotionCodesClient {
|
|
|
137
149
|
*
|
|
138
150
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
139
151
|
* @throws {@link ToltApi.NotFoundError}
|
|
152
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
140
153
|
* @throws {@link errors.ToltApiError}
|
|
141
154
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
142
155
|
*
|
|
@@ -174,6 +187,8 @@ export class PromotionCodesClient {
|
|
|
174
187
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
175
188
|
case 404:
|
|
176
189
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
190
|
+
case 429:
|
|
191
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
177
192
|
default:
|
|
178
193
|
throw new errors.ToltApiError({
|
|
179
194
|
statusCode: _response.error.statusCode,
|
|
@@ -191,6 +206,7 @@ export class PromotionCodesClient {
|
|
|
191
206
|
* @throws {@link ToltApi.BadRequestError}
|
|
192
207
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
193
208
|
* @throws {@link ToltApi.NotFoundError}
|
|
209
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
194
210
|
* @throws {@link errors.ToltApiError}
|
|
195
211
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
196
212
|
*
|
|
@@ -233,6 +249,8 @@ export class PromotionCodesClient {
|
|
|
233
249
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
234
250
|
case 404:
|
|
235
251
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
252
|
+
case 429:
|
|
253
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
236
254
|
default:
|
|
237
255
|
throw new errors.ToltApiError({
|
|
238
256
|
statusCode: _response.error.statusCode,
|
|
@@ -249,6 +267,7 @@ export class PromotionCodesClient {
|
|
|
249
267
|
*
|
|
250
268
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
251
269
|
* @throws {@link ToltApi.NotFoundError}
|
|
270
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
252
271
|
* @throws {@link errors.ToltApiError}
|
|
253
272
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
254
273
|
*
|
|
@@ -286,6 +305,8 @@ export class PromotionCodesClient {
|
|
|
286
305
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
287
306
|
case 404:
|
|
288
307
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
308
|
+
case 429:
|
|
309
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
289
310
|
default:
|
|
290
311
|
throw new errors.ToltApiError({
|
|
291
312
|
statusCode: _response.error.statusCode,
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* code: "code",
|
|
5
|
-
*
|
|
5
|
+
* partner_id: "partner_id"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface CreatePromotionCodeRequest {
|
|
9
9
|
code: string;
|
|
10
10
|
type?: string;
|
|
11
11
|
value?: string;
|
|
12
|
-
|
|
12
|
+
partner_id: string;
|
|
13
13
|
}
|
|
@@ -6,7 +6,20 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
6
6
|
export interface ListPromotionCodesRequest {
|
|
7
7
|
limit?: number;
|
|
8
8
|
order?: ToltApi.ListPromotionCodesRequestOrder;
|
|
9
|
+
/** Column the list is ordered and paged by. */
|
|
10
|
+
sort?: ToltApi.ListPromotionCodesRequestSort;
|
|
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
|
type?: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Column the list is ordered and paged by. */
|
|
2
|
+
export declare const ListPromotionCodesRequestSort: {
|
|
3
|
+
readonly CreatedAt: "created_at";
|
|
4
|
+
readonly UpdatedAt: "updated_at";
|
|
5
|
+
};
|
|
6
|
+
export type ListPromotionCodesRequestSort = (typeof ListPromotionCodesRequestSort)[keyof typeof ListPromotionCodesRequestSort];
|
|
@@ -4,4 +4,8 @@ export interface ListPromotionCodesResponse {
|
|
|
4
4
|
message: string;
|
|
5
5
|
data: ToltApi.PromotionCode[];
|
|
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
|
}
|
|
@@ -2,5 +2,6 @@ export * from "./CreatePromotionCodeResponse.js";
|
|
|
2
2
|
export * from "./DeletePromotionCodeResponse.js";
|
|
3
3
|
export * from "./GetPromotionCodeResponse.js";
|
|
4
4
|
export * from "./ListPromotionCodesRequestOrder.js";
|
|
5
|
+
export * from "./ListPromotionCodesRequestSort.js";
|
|
5
6
|
export * from "./ListPromotionCodesResponse.js";
|
|
6
7
|
export * from "./UpdatePromotionCodeResponse.js";
|
|
@@ -2,5 +2,6 @@ export * from "./CreatePromotionCodeResponse.js";
|
|
|
2
2
|
export * from "./DeletePromotionCodeResponse.js";
|
|
3
3
|
export * from "./GetPromotionCodeResponse.js";
|
|
4
4
|
export * from "./ListPromotionCodesRequestOrder.js";
|
|
5
|
+
export * from "./ListPromotionCodesRequestSort.js";
|
|
5
6
|
export * from "./ListPromotionCodesResponse.js";
|
|
6
7
|
export * from "./UpdatePromotionCodeResponse.js";
|
|
@@ -11,13 +11,12 @@ export declare class ReportsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<ReportsClient.Options>;
|
|
12
12
|
constructor(options: ReportsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Aggregate revenue and commission totals (grouped by currency) plus commission, customer, and partner counts for the organization. Supports optional program_id and start_date/end_date filters.
|
|
15
|
-
*
|
|
16
14
|
* @param {ToltApi.ReportsOverviewRequest} request
|
|
17
15
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
16
|
*
|
|
19
17
|
* @throws {@link ToltApi.BadRequestError}
|
|
20
18
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
19
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
21
20
|
* @throws {@link errors.ToltApiError}
|
|
22
21
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
23
22
|
*
|
|
@@ -26,4 +25,64 @@ export declare class ReportsClient {
|
|
|
26
25
|
*/
|
|
27
26
|
overview(request?: ToltApi.ReportsOverviewRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsOverviewResponse>;
|
|
28
27
|
private __overview;
|
|
28
|
+
/**
|
|
29
|
+
* @param {ToltApi.ReportsPartnersRequest} request
|
|
30
|
+
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
+
*
|
|
32
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
33
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
34
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
35
|
+
* @throws {@link errors.ToltApiError}
|
|
36
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.reports.partners()
|
|
40
|
+
*/
|
|
41
|
+
partners(request?: ToltApi.ReportsPartnersRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsPartnersResponse>;
|
|
42
|
+
private __partners;
|
|
43
|
+
/**
|
|
44
|
+
* @param {ToltApi.ReportsLinksRequest} request
|
|
45
|
+
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
46
|
+
*
|
|
47
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
48
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
49
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
50
|
+
* @throws {@link errors.ToltApiError}
|
|
51
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* await client.reports.links()
|
|
55
|
+
*/
|
|
56
|
+
links(request?: ToltApi.ReportsLinksRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsLinksResponse>;
|
|
57
|
+
private __links;
|
|
58
|
+
/**
|
|
59
|
+
* @param {ToltApi.ReportsTimeseriesRequest} request
|
|
60
|
+
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
63
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
64
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
65
|
+
* @throws {@link errors.ToltApiError}
|
|
66
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.reports.timeseries()
|
|
70
|
+
*/
|
|
71
|
+
timeseries(request?: ToltApi.ReportsTimeseriesRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsTimeseriesResponse>;
|
|
72
|
+
private __timeseries;
|
|
73
|
+
/**
|
|
74
|
+
* @param {ToltApi.ReportsCustomerStatsRequest} request
|
|
75
|
+
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
78
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
79
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
80
|
+
* @throws {@link errors.ToltApiError}
|
|
81
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await client.reports.customerStats()
|
|
85
|
+
*/
|
|
86
|
+
customerStats(request?: ToltApi.ReportsCustomerStatsRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsCustomerStatsResponse>;
|
|
87
|
+
private __customerStats;
|
|
29
88
|
}
|