@tolt/api 1.1.0 → 1.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/README.md +43 -15
- package/dist/BaseClient.js +1 -1
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +4 -0
- package/dist/api/resources/embedTokens/client/Client.d.ts +1 -1
- package/dist/api/resources/embedTokens/client/Client.js +1 -1
- package/dist/api/resources/embedTokens/client/requests/CreateEmbedTokenRequest.d.ts +8 -2
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +3 -0
- package/dist/api/resources/partnerTags/client/Client.d.ts +118 -0
- package/dist/api/resources/partnerTags/client/Client.js +352 -0
- package/dist/api/resources/partnerTags/client/index.d.ts +1 -0
- package/dist/api/resources/partnerTags/client/index.js +1 -0
- package/dist/api/resources/partnerTags/client/requests/CreatePartnerTagRequest.d.ts +16 -0
- package/dist/api/resources/partnerTags/client/requests/CreatePartnerTagRequest.js +2 -0
- package/dist/api/resources/partnerTags/client/requests/DeletePartnerTagRequest.d.ts +9 -0
- package/dist/api/resources/partnerTags/client/requests/DeletePartnerTagRequest.js +2 -0
- package/dist/api/resources/partnerTags/client/requests/GetPartnerTagRequest.d.ts +9 -0
- package/dist/api/resources/partnerTags/client/requests/GetPartnerTagRequest.js +2 -0
- package/dist/api/resources/partnerTags/client/requests/ListPartnerTagsRequest.d.ts +29 -0
- package/dist/api/resources/partnerTags/client/requests/ListPartnerTagsRequest.js +2 -0
- package/dist/api/resources/partnerTags/client/requests/UpdatePartnerTagRequest.d.ts +15 -0
- package/dist/api/resources/partnerTags/client/requests/UpdatePartnerTagRequest.js +2 -0
- package/dist/api/resources/partnerTags/client/requests/index.d.ts +5 -0
- package/dist/api/resources/partnerTags/client/requests/index.js +1 -0
- package/dist/api/resources/partnerTags/exports.d.ts +2 -0
- package/dist/api/resources/partnerTags/exports.js +3 -0
- package/dist/api/resources/partnerTags/index.d.ts +2 -0
- package/dist/api/resources/partnerTags/index.js +2 -0
- package/dist/api/resources/partnerTags/types/CreatePartnerTagResponse.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/CreatePartnerTagResponse.js +2 -0
- package/dist/api/resources/partnerTags/types/DeletePartnerTagResponse.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/DeletePartnerTagResponse.js +2 -0
- package/dist/api/resources/partnerTags/types/GetPartnerTagResponse.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/GetPartnerTagResponse.js +2 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsRequestOrder.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsRequestOrder.js +6 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsRequestSort.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsRequestSort.js +6 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsResponse.d.ts +11 -0
- package/dist/api/resources/partnerTags/types/ListPartnerTagsResponse.js +2 -0
- package/dist/api/resources/partnerTags/types/UpdatePartnerTagResponse.d.ts +6 -0
- package/dist/api/resources/partnerTags/types/UpdatePartnerTagResponse.js +2 -0
- package/dist/api/resources/partnerTags/types/index.d.ts +7 -0
- package/dist/api/resources/partnerTags/types/index.js +7 -0
- package/dist/api/resources/partners/client/Client.d.ts +43 -0
- package/dist/api/resources/partners/client/Client.js +132 -1
- package/dist/api/resources/partners/client/requests/AddPartnerTagsRequest.d.ts +12 -0
- package/dist/api/resources/partners/client/requests/AddPartnerTagsRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +2 -0
- package/dist/api/resources/partners/client/requests/RemovePartnerTagRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/RemovePartnerTagRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/index.d.ts +2 -0
- package/dist/api/resources/partners/types/AddPartnerTagsResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/AddPartnerTagsResponse.js +2 -0
- package/dist/api/resources/partners/types/RemovePartnerTagResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/RemovePartnerTagResponse.js +2 -0
- package/dist/api/resources/partners/types/index.d.ts +2 -0
- package/dist/api/resources/partners/types/index.js +2 -0
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +1 -1
- package/dist/api/types/EmbedToken.d.ts +2 -0
- package/dist/api/types/PartnerDetails.d.ts +2 -0
- package/dist/api/types/PartnerTag.d.ts +11 -0
- package/dist/api/types/PartnerTag.js +2 -0
- package/dist/api/types/PartnerTagSummary.d.ts +5 -0
- package/dist/api/types/PartnerTagSummary.js +2 -0
- package/dist/api/types/index.d.ts +2 -0
- package/dist/api/types/index.js +2 -0
- package/package.json +1 -1
|
@@ -203,4 +203,47 @@ export declare class PartnersClient {
|
|
|
203
203
|
*/
|
|
204
204
|
suspend(request: ToltApi.SuspendPartnerRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.SuspendPartnerResponse>;
|
|
205
205
|
private __suspend;
|
|
206
|
+
/**
|
|
207
|
+
* Puts one or more tags on the partner. Each tag must belong to the partner's program; tags the partner already has stay as they are. Returns every tag the partner now has, and sends partner.updated if any tag was added.
|
|
208
|
+
*
|
|
209
|
+
* @param {ToltApi.AddPartnerTagsRequest} request
|
|
210
|
+
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
211
|
+
*
|
|
212
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
213
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
214
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
215
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
216
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
217
|
+
* @throws {@link errors.ToltApiError}
|
|
218
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* await client.partners.addPartnerTags({
|
|
222
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
223
|
+
* tag_ids: ["ptag_zDEcdqNuNBPcokarWxBnk9gB"]
|
|
224
|
+
* })
|
|
225
|
+
*/
|
|
226
|
+
addPartnerTags(request: ToltApi.AddPartnerTagsRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.AddPartnerTagsResponse>;
|
|
227
|
+
private __addPartnerTags;
|
|
228
|
+
/**
|
|
229
|
+
* Takes the tag off the partner. Removing a tag the partner does not have succeeds and changes nothing. Returns every tag the partner still has, and sends partner.updated if the tag was removed.
|
|
230
|
+
*
|
|
231
|
+
* @param {ToltApi.RemovePartnerTagRequest} request
|
|
232
|
+
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
233
|
+
*
|
|
234
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
235
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
236
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
237
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
238
|
+
* @throws {@link errors.ToltApiError}
|
|
239
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* await client.partners.removePartnerTag({
|
|
243
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
244
|
+
* tag_id: "ptag_zDEcdqNuNBPcokarWxBnk9gB"
|
|
245
|
+
* })
|
|
246
|
+
*/
|
|
247
|
+
removePartnerTag(request: ToltApi.RemovePartnerTagRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.RemovePartnerTagResponse>;
|
|
248
|
+
private __removePartnerTag;
|
|
206
249
|
}
|
|
@@ -156,7 +156,7 @@ export class PartnersClient {
|
|
|
156
156
|
*/
|
|
157
157
|
async list(request = {}, requestOptions) {
|
|
158
158
|
const list = core.HttpResponsePromise.interceptFunction(async (request) => {
|
|
159
|
-
const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, status, program_id: programId, group_id: groupId, search, } = request;
|
|
159
|
+
const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, status, program_id: programId, group_id: groupId, tag_id: tagId, search, } = request;
|
|
160
160
|
const _queryParams = {
|
|
161
161
|
limit,
|
|
162
162
|
order: order != null ? order : undefined,
|
|
@@ -170,6 +170,7 @@ export class PartnersClient {
|
|
|
170
170
|
status: status != null ? status : undefined,
|
|
171
171
|
program_id: programId,
|
|
172
172
|
group_id: groupId,
|
|
173
|
+
tag_id: tagId,
|
|
173
174
|
search,
|
|
174
175
|
};
|
|
175
176
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
@@ -626,4 +627,134 @@ export class PartnersClient {
|
|
|
626
627
|
}
|
|
627
628
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/suspend");
|
|
628
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* Puts one or more tags on the partner. Each tag must belong to the partner's program; tags the partner already has stay as they are. Returns every tag the partner now has, and sends partner.updated if any tag was added.
|
|
632
|
+
*
|
|
633
|
+
* @param {ToltApi.AddPartnerTagsRequest} request
|
|
634
|
+
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
635
|
+
*
|
|
636
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
637
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
638
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
639
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
640
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
641
|
+
* @throws {@link errors.ToltApiError}
|
|
642
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
643
|
+
*
|
|
644
|
+
* @example
|
|
645
|
+
* await client.partners.addPartnerTags({
|
|
646
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
647
|
+
* tag_ids: ["ptag_zDEcdqNuNBPcokarWxBnk9gB"]
|
|
648
|
+
* })
|
|
649
|
+
*/
|
|
650
|
+
addPartnerTags(request, requestOptions) {
|
|
651
|
+
return core.HttpResponsePromise.fromPromise(this.__addPartnerTags(request, requestOptions));
|
|
652
|
+
}
|
|
653
|
+
async __addPartnerTags(request, requestOptions) {
|
|
654
|
+
const { id, ..._body } = request;
|
|
655
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
656
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
657
|
+
const _response = await core.fetcher({
|
|
658
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
659
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
660
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}/tags`),
|
|
661
|
+
method: "POST",
|
|
662
|
+
headers: _headers,
|
|
663
|
+
contentType: "application/json",
|
|
664
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
665
|
+
requestType: "json",
|
|
666
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),
|
|
667
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
668
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
669
|
+
abortSignal: requestOptions?.abortSignal,
|
|
670
|
+
fetchFn: this._options?.fetch,
|
|
671
|
+
logging: this._options.logging,
|
|
672
|
+
});
|
|
673
|
+
if (_response.ok) {
|
|
674
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
675
|
+
}
|
|
676
|
+
if (_response.error.reason === "status-code") {
|
|
677
|
+
switch (_response.error.statusCode) {
|
|
678
|
+
case 400:
|
|
679
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
680
|
+
case 401:
|
|
681
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
682
|
+
case 404:
|
|
683
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
684
|
+
case 413:
|
|
685
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
686
|
+
case 429:
|
|
687
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
688
|
+
default:
|
|
689
|
+
throw new errors.ToltApiError({
|
|
690
|
+
statusCode: _response.error.statusCode,
|
|
691
|
+
body: _response.error.body,
|
|
692
|
+
rawResponse: _response.rawResponse,
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/tags");
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Takes the tag off the partner. Removing a tag the partner does not have succeeds and changes nothing. Returns every tag the partner still has, and sends partner.updated if the tag was removed.
|
|
700
|
+
*
|
|
701
|
+
* @param {ToltApi.RemovePartnerTagRequest} request
|
|
702
|
+
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
703
|
+
*
|
|
704
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
705
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
706
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
707
|
+
* @throws {@link ToltApi.TooManyRequestsError}
|
|
708
|
+
* @throws {@link errors.ToltApiError}
|
|
709
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
710
|
+
*
|
|
711
|
+
* @example
|
|
712
|
+
* await client.partners.removePartnerTag({
|
|
713
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
714
|
+
* tag_id: "ptag_zDEcdqNuNBPcokarWxBnk9gB"
|
|
715
|
+
* })
|
|
716
|
+
*/
|
|
717
|
+
removePartnerTag(request, requestOptions) {
|
|
718
|
+
return core.HttpResponsePromise.fromPromise(this.__removePartnerTag(request, requestOptions));
|
|
719
|
+
}
|
|
720
|
+
async __removePartnerTag(request, requestOptions) {
|
|
721
|
+
const { id, tag_id: tagId } = request;
|
|
722
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
723
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
724
|
+
const _response = await core.fetcher({
|
|
725
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
726
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
727
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}/tags/${core.url.encodePathParam(tagId, errors.ToltApiError)}`),
|
|
728
|
+
method: "DELETE",
|
|
729
|
+
headers: _headers,
|
|
730
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
731
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
732
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
733
|
+
abortSignal: requestOptions?.abortSignal,
|
|
734
|
+
fetchFn: this._options?.fetch,
|
|
735
|
+
logging: this._options.logging,
|
|
736
|
+
});
|
|
737
|
+
if (_response.ok) {
|
|
738
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
739
|
+
}
|
|
740
|
+
if (_response.error.reason === "status-code") {
|
|
741
|
+
switch (_response.error.statusCode) {
|
|
742
|
+
case 401:
|
|
743
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
744
|
+
case 404:
|
|
745
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
746
|
+
case 413:
|
|
747
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
748
|
+
case 429:
|
|
749
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
750
|
+
default:
|
|
751
|
+
throw new errors.ToltApiError({
|
|
752
|
+
statusCode: _response.error.statusCode,
|
|
753
|
+
body: _response.error.body,
|
|
754
|
+
rawResponse: _response.rawResponse,
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v2/partners/{id}/tags/{tag_id}");
|
|
759
|
+
}
|
|
629
760
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
5
|
+
* tag_ids: ["ptag_zDEcdqNuNBPcokarWxBnk9gB"]
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface AddPartnerTagsRequest {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Ids of the tags to add (ptag_...), as returned when listing partner tags. Each must belong to the partner's program. Tags the partner already has stay as they are. */
|
|
11
|
+
tag_ids: string[];
|
|
12
|
+
}
|
|
@@ -28,6 +28,8 @@ export interface ListPartnersRequest {
|
|
|
28
28
|
program_id?: string;
|
|
29
29
|
/** Limit to partners in one group, by the group id (grp_...) as returned when listing groups. */
|
|
30
30
|
group_id?: string;
|
|
31
|
+
/** Limit to partners with this tag, by the tag id (ptag_...) as returned when listing partner tags. */
|
|
32
|
+
tag_id?: string;
|
|
31
33
|
/** Text matched anywhere in the partner's id, email, first name, last name or company name, ignoring case. */
|
|
32
34
|
search?: string;
|
|
33
35
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { AddPartnerTagsRequest } from "./AddPartnerTagsRequest.js";
|
|
1
2
|
export type { ApprovePartnerRequest } from "./ApprovePartnerRequest.js";
|
|
2
3
|
export type { BulkApprovePartnersRequest } from "./BulkApprovePartnersRequest.js";
|
|
3
4
|
export type { BulkRejectPartnersRequest } from "./BulkRejectPartnersRequest.js";
|
|
@@ -5,5 +6,6 @@ export { CreatePartnerRequest } from "./CreatePartnerRequest.js";
|
|
|
5
6
|
export type { GetPartnerRequest } from "./GetPartnerRequest.js";
|
|
6
7
|
export type { ListPartnersRequest } from "./ListPartnersRequest.js";
|
|
7
8
|
export type { RejectPartnerRequest } from "./RejectPartnerRequest.js";
|
|
9
|
+
export type { RemovePartnerTagRequest } from "./RemovePartnerTagRequest.js";
|
|
8
10
|
export type { SuspendPartnerRequest } from "./SuspendPartnerRequest.js";
|
|
9
11
|
export type { UpdatePartnerRequest } from "./UpdatePartnerRequest.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AddPartnerTagsResponse.js";
|
|
1
2
|
export * from "./ApprovePartnerResponse.js";
|
|
2
3
|
export * from "./BulkApprovePartnersResponse.js";
|
|
3
4
|
export * from "./BulkRejectPartnersResponse.js";
|
|
@@ -8,5 +9,6 @@ export * from "./ListPartnersRequestSort.js";
|
|
|
8
9
|
export * from "./ListPartnersRequestStatus.js";
|
|
9
10
|
export * from "./ListPartnersResponse.js";
|
|
10
11
|
export * from "./RejectPartnerResponse.js";
|
|
12
|
+
export * from "./RemovePartnerTagResponse.js";
|
|
11
13
|
export * from "./SuspendPartnerResponse.js";
|
|
12
14
|
export * from "./UpdatePartnerResponse.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AddPartnerTagsResponse.js";
|
|
1
2
|
export * from "./ApprovePartnerResponse.js";
|
|
2
3
|
export * from "./BulkApprovePartnersResponse.js";
|
|
3
4
|
export * from "./BulkRejectPartnersResponse.js";
|
|
@@ -8,5 +9,6 @@ export * from "./ListPartnersRequestSort.js";
|
|
|
8
9
|
export * from "./ListPartnersRequestStatus.js";
|
|
9
10
|
export * from "./ListPartnersResponse.js";
|
|
10
11
|
export * from "./RejectPartnerResponse.js";
|
|
12
|
+
export * from "./RemovePartnerTagResponse.js";
|
|
11
13
|
export * from "./SuspendPartnerResponse.js";
|
|
12
14
|
export * from "./UpdatePartnerResponse.js";
|
|
@@ -17,7 +17,7 @@ export interface CreateTransactionRequest {
|
|
|
17
17
|
product_id?: string;
|
|
18
18
|
/** Readable name of the purchased product, such as Pro plan. It is saved as the transaction's product name, which revenue_by_product groups revenue by; flows match on product_id, not on this name. */
|
|
19
19
|
product_name?: string;
|
|
20
|
-
/** The payment amount in the smallest unit of the program currency (cents for USD); percentage commissions are calculated from it. */
|
|
20
|
+
/** The payment amount in the smallest unit of the program currency (cents for USD); percentage commissions are calculated from it. It must be 0 or more: to reverse a payment, refund its transaction instead of recording a negative amount. */
|
|
21
21
|
amount: number;
|
|
22
22
|
/** Id of the customer who paid (cus_...), as returned when listing customers. The transaction goes to that customer's partner and program, and the customer becomes active. */
|
|
23
23
|
customer_id: string;
|
|
@@ -2,6 +2,8 @@ import type * as ToltApi from "../index.js";
|
|
|
2
2
|
export interface PartnerDetails extends ToltApi.Partner {
|
|
3
3
|
/** Custom-field answers with their questions. Empty when no answers exist. */
|
|
4
4
|
custom_fields: PartnerDetails.CustomFields.Item[];
|
|
5
|
+
/** Tags on the partner, sorted by name. Empty when the partner has none. */
|
|
6
|
+
tags: ToltApi.PartnerTagSummary[];
|
|
5
7
|
}
|
|
6
8
|
export declare namespace PartnerDetails {
|
|
7
9
|
type CustomFields = CustomFields.Item[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PartnerTag {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
/** Hex color of the tag in the dashboard. */
|
|
5
|
+
color: string;
|
|
6
|
+
program_id: string;
|
|
7
|
+
/** How many partners have the tag. */
|
|
8
|
+
partners_count: number;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
|
@@ -10,6 +10,8 @@ export * from "./Group.js";
|
|
|
10
10
|
export * from "./Link.js";
|
|
11
11
|
export * from "./Partner.js";
|
|
12
12
|
export * from "./PartnerDetails.js";
|
|
13
|
+
export * from "./PartnerTag.js";
|
|
14
|
+
export * from "./PartnerTagSummary.js";
|
|
13
15
|
export * from "./Program.js";
|
|
14
16
|
export * from "./PromotionCode.js";
|
|
15
17
|
export * from "./ReportsCustomerStats.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -10,6 +10,8 @@ export * from "./Group.js";
|
|
|
10
10
|
export * from "./Link.js";
|
|
11
11
|
export * from "./Partner.js";
|
|
12
12
|
export * from "./PartnerDetails.js";
|
|
13
|
+
export * from "./PartnerTag.js";
|
|
14
|
+
export * from "./PartnerTagSummary.js";
|
|
13
15
|
export * from "./Program.js";
|
|
14
16
|
export * from "./PromotionCode.js";
|
|
15
17
|
export * from "./ReportsCustomerStats.js";
|