@tolt/api 0.6.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseClient.js +1 -0
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +3 -3
- package/dist/api/errors/BadRequestError.d.ts +2 -2
- package/dist/api/errors/ConflictError.d.ts +2 -2
- package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
- package/dist/api/errors/ContentTooLargeError.js +17 -0
- package/dist/api/errors/NotFoundError.d.ts +2 -2
- package/dist/api/errors/TooManyRequestsError.d.ts +2 -2
- package/dist/api/errors/UnauthorizedError.d.ts +2 -2
- 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 +16 -8
- package/dist/api/resources/clicks/client/Client.js +93 -68
- package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
- package/dist/api/resources/clicks/client/requests/GetClickRequest.d.ts +9 -0
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
- package/dist/api/resources/clicks/client/requests/index.d.ts +2 -1
- package/dist/api/resources/clicks/types/{CreateClicksResponse.d.ts → CreateClickResponse.d.ts} +1 -1
- package/dist/api/resources/clicks/types/{GetClicksResponse.d.ts → GetClickResponse.d.ts} +1 -1
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
- package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
- package/dist/api/resources/clicks/types/index.d.ts +2 -3
- package/dist/api/resources/clicks/types/index.js +2 -3
- package/dist/api/resources/commissions/client/Client.d.ts +48 -22
- package/dist/api/resources/commissions/client/Client.js +142 -84
- package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.d.ts +40 -0
- package/dist/api/resources/commissions/client/requests/CreateCommissionRequest.js +9 -0
- package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/GetCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +33 -0
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +9 -0
- package/dist/api/resources/commissions/client/requests/index.d.ts +6 -5
- package/dist/api/resources/commissions/client/requests/index.js +2 -1
- package/dist/api/resources/commissions/types/{UpdateCommissionsResponse.d.ts → ApproveCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.d.ts → CreateCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/{CreateCommissionsResponse.d.ts → DeclineCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/{GetCommissionsResponse.d.ts → GetCommissionResponse.d.ts} +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
- package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/index.d.ts +6 -7
- package/dist/api/resources/commissions/types/index.js +6 -7
- package/dist/api/resources/customers/client/Client.d.ts +36 -14
- package/dist/api/resources/customers/client/Client.js +120 -74
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +47 -0
- package/dist/api/resources/customers/client/requests/CreateCustomerRequest.js +12 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/GetCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +44 -0
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.js +12 -0
- package/dist/api/resources/customers/client/requests/index.d.ts +4 -4
- package/dist/api/resources/customers/client/requests/index.js +2 -2
- package/dist/api/resources/customers/types/{DeleteCustomersResponse.d.ts → CreateCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/{UpdateCustomersResponse.d.ts → DeleteCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/{GetCustomersResponse.d.ts → GetCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
- package/dist/api/resources/customers/types/{CreateCustomersResponse.d.ts → UpdateCustomerResponse.d.ts} +1 -1
- package/dist/api/resources/customers/types/index.d.ts +4 -4
- package/dist/api/resources/customers/types/index.js +4 -4
- package/dist/api/resources/{embed → embedTokens}/client/Client.d.ts +10 -9
- package/dist/api/resources/{embed → embedTokens}/client/Client.js +11 -8
- package/dist/api/resources/embedTokens/client/requests/CreateEmbedTokenRequest.d.ts +21 -0
- package/dist/api/resources/embedTokens/client/requests/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/exports.d.ts +2 -0
- package/dist/api/resources/{embed → embedTokens}/exports.js +1 -1
- package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.d.ts → embedTokens/types/CreateEmbedTokenResponse.d.ts} +1 -1
- package/dist/api/resources/embedTokens/types/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/types/index.js +1 -0
- package/dist/api/resources/flows/client/Client.d.ts +10 -5
- package/dist/api/resources/flows/client/Client.js +83 -63
- package/dist/api/resources/flows/client/requests/GetFlowRequest.d.ts +9 -0
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +14 -6
- package/dist/api/resources/flows/client/requests/index.d.ts +1 -1
- package/dist/api/resources/flows/types/{GetFlowsResponse.d.ts → GetFlowResponse.d.ts} +1 -1
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
- package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
- package/dist/api/resources/flows/types/index.d.ts +1 -2
- package/dist/api/resources/flows/types/index.js +1 -2
- package/dist/api/resources/groups/client/Client.d.ts +10 -5
- package/dist/api/resources/groups/client/Client.js +80 -60
- package/dist/api/resources/groups/client/requests/GetGroupRequest.d.ts +9 -0
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +11 -6
- package/dist/api/resources/groups/client/requests/index.d.ts +1 -1
- package/dist/api/resources/groups/types/{GetGroupsResponse.d.ts → GetGroupResponse.d.ts} +1 -1
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
- package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
- package/dist/api/resources/groups/types/index.d.ts +1 -2
- package/dist/api/resources/groups/types/index.js +1 -2
- package/dist/api/resources/index.d.ts +3 -3
- package/dist/api/resources/index.js +3 -3
- package/dist/api/resources/links/client/Client.d.ts +28 -17
- package/dist/api/resources/links/client/Client.js +111 -75
- package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +16 -0
- package/dist/api/resources/links/client/requests/DeleteLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/GetLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
- package/dist/api/resources/links/client/requests/UpdateLinkRequest.d.ts +15 -0
- package/dist/api/resources/links/client/requests/index.d.ts +5 -5
- package/dist/api/resources/links/types/{DeleteLinksResponse.d.ts → CreateLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/{CreateLinksResponse.d.ts → DeleteLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/GetLinkByParamValueResponse.d.ts +6 -0
- package/dist/api/resources/links/types/{GetLinksResponse.d.ts → GetLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
- package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
- package/dist/api/resources/links/types/{UpdateLinksResponse.d.ts → UpdateLinkResponse.d.ts} +1 -1
- package/dist/api/resources/links/types/index.d.ts +5 -5
- package/dist/api/resources/links/types/index.js +5 -5
- package/dist/api/resources/partners/client/Client.d.ts +52 -24
- package/dist/api/resources/partners/client/Client.js +140 -85
- package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +59 -0
- package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +9 -0
- package/dist/api/resources/partners/client/requests/GetPartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
- package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +11 -0
- package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +24 -0
- package/dist/api/resources/partners/client/requests/index.d.ts +6 -6
- package/dist/api/resources/partners/client/requests/index.js +1 -1
- package/dist/api/resources/partners/types/{RejectPartnersResponse.d.ts → ApprovePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{CreatePartnersResponse.d.ts → CreatePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{GetPartnersResponse.d.ts → GetPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
- package/dist/api/resources/partners/types/{UpdatePartnersResponse.d.ts → RejectPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{ApprovePartnersResponse.d.ts → SuspendPartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/{SuspendPartnersResponse.d.ts → UpdatePartnerResponse.d.ts} +1 -1
- package/dist/api/resources/partners/types/index.d.ts +6 -6
- package/dist/api/resources/partners/types/index.js +6 -6
- package/dist/api/resources/programs/client/Client.d.ts +10 -5
- package/dist/api/resources/programs/client/Client.js +78 -58
- package/dist/api/resources/programs/client/requests/GetProgramRequest.d.ts +9 -0
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
- package/dist/api/resources/programs/client/requests/index.d.ts +1 -1
- package/dist/api/resources/programs/types/{GetProgramsResponse.d.ts → GetProgramResponse.d.ts} +1 -1
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
- package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
- package/dist/api/resources/programs/types/index.d.ts +1 -1
- package/dist/api/resources/programs/types/index.js +1 -1
- package/dist/api/resources/promotionCodes/client/Client.d.ts +36 -15
- package/dist/api/resources/promotionCodes/client/Client.js +121 -72
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +27 -0
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.js +9 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.d.ts +26 -0
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.js +9 -0
- package/dist/api/resources/promotionCodes/client/requests/index.d.ts +4 -4
- package/dist/api/resources/promotionCodes/client/requests/index.js +2 -2
- package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.d.ts → CreatePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.d.ts → DeletePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.d.ts → GetPromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
- package/dist/api/resources/promotionCodes/types/{UpdatePromotionCodesResponse.d.ts → UpdatePromotionCodeResponse.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/types/index.d.ts +4 -4
- package/dist/api/resources/promotionCodes/types/index.js +4 -4
- package/dist/api/resources/reports/client/Client.d.ts +27 -14
- package/dist/api/resources/reports/client/Client.js +182 -118
- package/dist/api/resources/reports/client/requests/ReportsCustomersRequest.d.ts +12 -0
- package/dist/api/resources/reports/client/requests/ReportsLinksRequest.d.ts +23 -0
- package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.d.ts +12 -0
- package/dist/api/resources/reports/client/requests/ReportsPartnersRequest.d.ts +23 -0
- package/dist/api/resources/reports/client/requests/ReportsTimeseriesRequest.d.ts +17 -0
- package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.d.ts → ReportsCustomersResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{LinksReportsResponse.d.ts → ReportsLinksResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{OverviewReportsResponse.d.ts → ReportsOverviewResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{PartnersReportsResponse.d.ts → ReportsPartnersResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/{TimeseriesReportsResponse.d.ts → ReportsTimeseriesResponse.d.ts} +1 -1
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
- package/dist/api/resources/reports/types/index.d.ts +5 -5
- package/dist/api/resources/reports/types/index.js +5 -5
- package/dist/api/resources/transactions/client/Client.d.ts +43 -21
- package/dist/api/resources/transactions/client/Client.js +132 -80
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +34 -0
- package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/GetTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
- package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +31 -0
- package/dist/api/resources/transactions/client/requests/index.d.ts +6 -6
- package/dist/api/resources/transactions/types/{CreateTransactionsResponse.d.ts → CreateTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.d.ts → DeleteTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{GetTransactionsResponse.d.ts → GetTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
- package/dist/api/resources/transactions/types/{RefundTransactionsResponse.d.ts → RefundTransactionResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.d.ts → RerunTransactionFlowsResponse.d.ts} +1 -1
- package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/index.d.ts +6 -6
- package/dist/api/resources/transactions/types/index.js +6 -6
- package/dist/api/types/Commission.d.ts +1 -1
- package/dist/api/types/Customer.d.ts +2 -2
- package/dist/api/types/{Error_.d.ts → ErrorResponse.d.ts} +5 -4
- package/dist/api/types/{Error_.js → ErrorResponse.js} +5 -4
- package/dist/api/types/index.d.ts +1 -1
- package/dist/api/types/index.js +1 -1
- package/dist/core/exports.d.ts +1 -0
- package/dist/core/exports.js +1 -0
- package/dist/core/fetcher/Fetcher.js +35 -4
- package/dist/core/fetcher/getErrorResponseBody.js +21 -8
- package/dist/core/fetcher/getResponseBody.d.ts +16 -0
- package/dist/core/fetcher/getResponseBody.js +26 -22
- package/dist/core/fetcher/makePassthroughRequest.js +18 -2
- package/dist/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/core/fetcher/makeRequest.js +45 -13
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +23 -2
- package/dist/core/fetcher/signals.d.ts +1 -0
- package/dist/core/fetcher/signals.js +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/pagination/Page.d.ts +33 -0
- package/dist/core/pagination/Page.js +49 -0
- package/dist/core/pagination/exports.d.ts +1 -0
- package/dist/core/pagination/exports.js +1 -0
- package/dist/core/pagination/index.d.ts +1 -0
- package/dist/core/pagination/index.js +1 -0
- package/dist/core/url/encodePathParam.d.ts +3 -1
- package/dist/core/url/encodePathParam.js +8 -2
- package/dist/core/utils/index.d.ts +1 -0
- package/dist/core/utils/index.js +1 -0
- package/dist/core/utils/setObjectProperty.d.ts +12 -0
- package/dist/core/utils/setObjectProperty.js +45 -0
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/dist/errors/ToltApiError.js +15 -1
- package/package.json +7 -2
- package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +0 -9
- package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
- package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +0 -9
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +0 -18
- package/dist/api/resources/commissions/types/ApproveCommissionsResponse.d.ts +0 -6
- package/dist/api/resources/commissions/types/CreateCommissionsRequest.d.ts +0 -1
- package/dist/api/resources/commissions/types/DeclineCommissionsResponse.d.ts +0 -6
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +0 -29
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +0 -11
- package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +0 -9
- package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +0 -9
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +0 -31
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +0 -11
- package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
- package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
- package/dist/api/resources/embed/exports.d.ts +0 -2
- package/dist/api/resources/embed/types/index.d.ts +0 -1
- package/dist/api/resources/embed/types/index.js +0 -1
- package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +0 -9
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -5
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -5
- package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +0 -9
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -5
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -5
- package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +0 -12
- package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +0 -9
- package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +0 -9
- package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +0 -11
- package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
- package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +0 -9
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +0 -45
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +0 -8
- package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +0 -9
- package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +0 -10
- package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +0 -10
- package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +0 -16
- package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +0 -20
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +0 -8
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +0 -9
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +0 -19
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +0 -8
- package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +0 -9
- package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +0 -15
- package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +0 -9
- package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +0 -15
- package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +0 -12
- package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +0 -20
- package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +0 -9
- package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +0 -20
- package/dist/api/resources/transactions/types/RerunFlowsTransactionsResponse.js +0 -2
- package/dist/api/resources/transactions/types/UpdateTransactionsResponse.d.ts +0 -6
- package/dist/api/resources/transactions/types/UpdateTransactionsResponse.js +0 -2
- /package/dist/api/resources/clicks/client/requests/{GetClicksRequest.js → CreateClickRequest.js} +0 -0
- /package/dist/api/resources/clicks/{types/CreateClicksRequest.js → client/requests/GetClickRequest.js} +0 -0
- /package/dist/api/resources/clicks/types/{CreateClicksResponse.js → CreateClickResponse.js} +0 -0
- /package/dist/api/resources/clicks/types/{GetClicksResponse.js → GetClickResponse.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.js → ApproveCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{DeclineCommissionsRequest.js → DeclineCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.js → DeleteCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.js → GetCommissionRequest.js} +0 -0
- /package/dist/api/resources/commissions/{client/requests/UpdateCommissionsRequest.js → types/ApproveCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{ApproveCommissionsResponse.js → CreateCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → DeclineCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → GetCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
- /package/dist/api/resources/{commissions/types/GetCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
- /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/GetCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/DeleteCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/DeleteCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → GetCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
- /package/dist/api/resources/{embed → embedTokens}/client/index.d.ts +0 -0
- /package/dist/api/resources/{embed → embedTokens}/client/index.js +0 -0
- /package/dist/api/resources/{customers/types/GetCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
- /package/dist/api/resources/{embed → embedTokens}/client/requests/index.js +0 -0
- /package/dist/api/resources/{embed → embedTokens}/index.d.ts +0 -0
- /package/dist/api/resources/{embed → embedTokens}/index.js +0 -0
- /package/dist/api/resources/{customers/types/UpdateCustomersResponse.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
- /package/dist/api/resources/{embed/client/requests/CreateTokenEmbedRequest.js → flows/client/requests/GetFlowRequest.js} +0 -0
- /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/types/GetFlowResponse.js} +0 -0
- /package/dist/api/resources/{flows/client/requests/GetFlowsRequest.js → groups/client/requests/GetGroupRequest.js} +0 -0
- /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/types/GetGroupResponse.js} +0 -0
- /package/dist/api/resources/{groups/client/requests/GetGroupsRequest.js → links/client/requests/CreateLinkRequest.js} +0 -0
- /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/DeleteLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → UpdateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/{client/requests/GetLinksRequest.js → types/CreateLinkResponse.js} +0 -0
- /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/DeleteLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{CreateLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
- /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → UpdateLinkResponse.js} +0 -0
- /package/dist/api/resources/{links/types/GetLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
- /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/GetPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → RejectPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/SuspendPartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/CreatePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → GetPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → RejectPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{GetPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
- /package/dist/api/resources/{partners/types/SuspendPartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
- /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/types/GetProgramResponse.js} +0 -0
- /package/dist/api/resources/{programs/client/requests/GetProgramsRequest.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/GetPromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/DeletePromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/DeletePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/GetPromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsLinksRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsOverviewRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsPartnersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/PartnersReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsLinksResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsOverviewResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsPartnersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
- /package/dist/api/resources/{reports/types/PartnersReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
- /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/DeleteTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → GetTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/RerunFlowsTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/DeleteTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → GetTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
|
@@ -19,13 +19,14 @@ export class PartnersClient {
|
|
|
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}
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* await client.partners.bulkApprove({
|
|
28
|
-
* ids: ["
|
|
29
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"]
|
|
29
30
|
* })
|
|
30
31
|
*/
|
|
31
32
|
bulkApprove(request, requestOptions) {
|
|
@@ -37,7 +38,7 @@ export class PartnersClient {
|
|
|
37
38
|
const _response = await core.fetcher({
|
|
38
39
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
39
40
|
(await core.Supplier.get(this._options.environment)) ??
|
|
40
|
-
environments.ToltApiEnvironment.
|
|
41
|
+
environments.ToltApiEnvironment.Default, "v2/partners/bulk/approve"),
|
|
41
42
|
method: "POST",
|
|
42
43
|
headers: _headers,
|
|
43
44
|
contentType: "application/json",
|
|
@@ -59,6 +60,8 @@ export class PartnersClient {
|
|
|
59
60
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
60
61
|
case 401:
|
|
61
62
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
63
|
+
case 413:
|
|
64
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
62
65
|
case 429:
|
|
63
66
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
64
67
|
default:
|
|
@@ -79,13 +82,15 @@ export class PartnersClient {
|
|
|
79
82
|
*
|
|
80
83
|
* @throws {@link ToltApi.BadRequestError}
|
|
81
84
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
85
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
82
86
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
83
87
|
* @throws {@link errors.ToltApiError}
|
|
84
88
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
85
89
|
*
|
|
86
90
|
* @example
|
|
87
91
|
* await client.partners.bulkReject({
|
|
88
|
-
* ids: ["
|
|
92
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"],
|
|
93
|
+
* rejection_note: "Site does not match our audience."
|
|
89
94
|
* })
|
|
90
95
|
*/
|
|
91
96
|
bulkReject(request, requestOptions) {
|
|
@@ -97,7 +102,7 @@ export class PartnersClient {
|
|
|
97
102
|
const _response = await core.fetcher({
|
|
98
103
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
99
104
|
(await core.Supplier.get(this._options.environment)) ??
|
|
100
|
-
environments.ToltApiEnvironment.
|
|
105
|
+
environments.ToltApiEnvironment.Default, "v2/partners/bulk/reject"),
|
|
101
106
|
method: "POST",
|
|
102
107
|
headers: _headers,
|
|
103
108
|
contentType: "application/json",
|
|
@@ -119,6 +124,8 @@ export class PartnersClient {
|
|
|
119
124
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
120
125
|
case 401:
|
|
121
126
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 413:
|
|
128
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
122
129
|
case 429:
|
|
123
130
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
124
131
|
default:
|
|
@@ -132,11 +139,14 @@ export class PartnersClient {
|
|
|
132
139
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/bulk/reject");
|
|
133
140
|
}
|
|
134
141
|
/**
|
|
142
|
+
* Lists onboarded partners. Filter by status, program or group, search by name, email or company, and page with cursors.
|
|
143
|
+
*
|
|
135
144
|
* @param {ToltApi.ListPartnersRequest} request
|
|
136
145
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
137
146
|
*
|
|
138
147
|
* @throws {@link ToltApi.BadRequestError}
|
|
139
148
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
149
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
140
150
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
141
151
|
* @throws {@link errors.ToltApiError}
|
|
142
152
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -144,83 +154,103 @@ export class PartnersClient {
|
|
|
144
154
|
* @example
|
|
145
155
|
* await client.partners.list()
|
|
146
156
|
*/
|
|
147
|
-
list(request = {}, requestOptions) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
if (_response.ok) {
|
|
187
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
188
|
-
}
|
|
189
|
-
if (_response.error.reason === "status-code") {
|
|
190
|
-
switch (_response.error.statusCode) {
|
|
191
|
-
case 400:
|
|
192
|
-
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
193
|
-
case 401:
|
|
194
|
-
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
195
|
-
case 429:
|
|
196
|
-
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
197
|
-
default:
|
|
198
|
-
throw new errors.ToltApiError({
|
|
199
|
-
statusCode: _response.error.statusCode,
|
|
200
|
-
body: _response.error.body,
|
|
201
|
-
rawResponse: _response.rawResponse,
|
|
202
|
-
});
|
|
157
|
+
async list(request = {}, requestOptions) {
|
|
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;
|
|
160
|
+
const _queryParams = {
|
|
161
|
+
limit,
|
|
162
|
+
order: order != null ? order : undefined,
|
|
163
|
+
sort: sort != null ? sort : undefined,
|
|
164
|
+
starting_after: startingAfter,
|
|
165
|
+
ending_before: endingBefore,
|
|
166
|
+
created_after: createdAfter != null ? createdAfter : undefined,
|
|
167
|
+
created_before: createdBefore != null ? createdBefore : undefined,
|
|
168
|
+
updated_after: updatedAfter != null ? updatedAfter : undefined,
|
|
169
|
+
updated_before: updatedBefore != null ? updatedBefore : undefined,
|
|
170
|
+
status: status != null ? status : undefined,
|
|
171
|
+
program_id: programId,
|
|
172
|
+
group_id: groupId,
|
|
173
|
+
search,
|
|
174
|
+
};
|
|
175
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
176
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
177
|
+
const _response = await core.fetcher({
|
|
178
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
179
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
180
|
+
environments.ToltApiEnvironment.Default, "v2/partners"),
|
|
181
|
+
method: "GET",
|
|
182
|
+
headers: _headers,
|
|
183
|
+
queryString: core.url
|
|
184
|
+
.queryBuilder()
|
|
185
|
+
.addMany(_queryParams)
|
|
186
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
187
|
+
.build(),
|
|
188
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
189
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
190
|
+
abortSignal: requestOptions?.abortSignal,
|
|
191
|
+
fetchFn: this._options?.fetch,
|
|
192
|
+
logging: this._options.logging,
|
|
193
|
+
});
|
|
194
|
+
if (_response.ok) {
|
|
195
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
203
196
|
}
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
if (_response.error.reason === "status-code") {
|
|
198
|
+
switch (_response.error.statusCode) {
|
|
199
|
+
case 400:
|
|
200
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
201
|
+
case 401:
|
|
202
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
203
|
+
case 413:
|
|
204
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
205
|
+
case 429:
|
|
206
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
207
|
+
default:
|
|
208
|
+
throw new errors.ToltApiError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/partners");
|
|
216
|
+
});
|
|
217
|
+
const dataWithRawResponse = await list(request).withRawResponse();
|
|
218
|
+
return new core.Page({
|
|
219
|
+
response: dataWithRawResponse.data,
|
|
220
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
221
|
+
hasNextPage: (response) => response?.next_cursor != null &&
|
|
222
|
+
!(typeof response?.next_cursor === "string" && response?.next_cursor === ""),
|
|
223
|
+
getItems: (response) => response?.data ?? [],
|
|
224
|
+
loadPage: (response) => {
|
|
225
|
+
return list(core.setObjectProperty(request, "starting_after", response?.next_cursor));
|
|
226
|
+
},
|
|
227
|
+
});
|
|
206
228
|
}
|
|
207
229
|
/**
|
|
208
230
|
* Creates an onboarded partner together with their referral link. The link value defaults to a slug of the partner's name or email and the parameter to the program's first link parameter. Omit group_id to place the partner in the program's default group.
|
|
209
231
|
*
|
|
210
|
-
* @param {ToltApi.
|
|
232
|
+
* @param {ToltApi.CreatePartnerRequest} request
|
|
211
233
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
212
234
|
*
|
|
213
235
|
* @throws {@link ToltApi.BadRequestError}
|
|
214
236
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
215
237
|
* @throws {@link ToltApi.ConflictError}
|
|
238
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
216
239
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
217
240
|
* @throws {@link errors.ToltApiError}
|
|
218
241
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
219
242
|
*
|
|
220
243
|
* @example
|
|
221
244
|
* await client.partners.create({
|
|
222
|
-
* email: "sam@
|
|
223
|
-
* program_id: "
|
|
245
|
+
* email: "sam@example.com",
|
|
246
|
+
* program_id: "prg_T6z8aRW3XCmvFWP972RKxpAd",
|
|
247
|
+
* first_name: "Sam",
|
|
248
|
+
* last_name: "Taylor",
|
|
249
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a",
|
|
250
|
+
* link: {
|
|
251
|
+
* value: "sam",
|
|
252
|
+
* param: "ref"
|
|
253
|
+
* }
|
|
224
254
|
* })
|
|
225
255
|
*/
|
|
226
256
|
create(request, requestOptions) {
|
|
@@ -232,7 +262,7 @@ export class PartnersClient {
|
|
|
232
262
|
const _response = await core.fetcher({
|
|
233
263
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
234
264
|
(await core.Supplier.get(this._options.environment)) ??
|
|
235
|
-
environments.ToltApiEnvironment.
|
|
265
|
+
environments.ToltApiEnvironment.Default, "v2/partners"),
|
|
236
266
|
method: "POST",
|
|
237
267
|
headers: _headers,
|
|
238
268
|
contentType: "application/json",
|
|
@@ -240,7 +270,7 @@ export class PartnersClient {
|
|
|
240
270
|
requestType: "json",
|
|
241
271
|
body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
|
|
242
272
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
243
|
-
maxRetries:
|
|
273
|
+
maxRetries: 0,
|
|
244
274
|
abortSignal: requestOptions?.abortSignal,
|
|
245
275
|
fetchFn: this._options?.fetch,
|
|
246
276
|
logging: this._options.logging,
|
|
@@ -256,6 +286,8 @@ export class PartnersClient {
|
|
|
256
286
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
257
287
|
case 409:
|
|
258
288
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
289
|
+
case 413:
|
|
290
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
259
291
|
case 429:
|
|
260
292
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
261
293
|
default:
|
|
@@ -269,18 +301,21 @@ export class PartnersClient {
|
|
|
269
301
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners");
|
|
270
302
|
}
|
|
271
303
|
/**
|
|
272
|
-
*
|
|
304
|
+
* Gets a partner by ID, with their profile, status, group and program.
|
|
305
|
+
*
|
|
306
|
+
* @param {ToltApi.GetPartnerRequest} request
|
|
273
307
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
274
308
|
*
|
|
275
309
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
276
310
|
* @throws {@link ToltApi.NotFoundError}
|
|
311
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
277
312
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
278
313
|
* @throws {@link errors.ToltApiError}
|
|
279
314
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
280
315
|
*
|
|
281
316
|
* @example
|
|
282
317
|
* await client.partners.get({
|
|
283
|
-
* id: "
|
|
318
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
284
319
|
* })
|
|
285
320
|
*/
|
|
286
321
|
get(request, requestOptions) {
|
|
@@ -293,7 +328,7 @@ export class PartnersClient {
|
|
|
293
328
|
const _response = await core.fetcher({
|
|
294
329
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
295
330
|
(await core.Supplier.get(this._options.environment)) ??
|
|
296
|
-
environments.ToltApiEnvironment.
|
|
331
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
297
332
|
method: "GET",
|
|
298
333
|
headers: _headers,
|
|
299
334
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -312,6 +347,8 @@ export class PartnersClient {
|
|
|
312
347
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
313
348
|
case 404:
|
|
314
349
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
350
|
+
case 413:
|
|
351
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
315
352
|
case 429:
|
|
316
353
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
317
354
|
default:
|
|
@@ -327,20 +364,23 @@ export class PartnersClient {
|
|
|
327
364
|
/**
|
|
328
365
|
* Edits profile fields and group membership. Status changes go through the approve, reject and suspend actions.
|
|
329
366
|
*
|
|
330
|
-
* @param {ToltApi.
|
|
367
|
+
* @param {ToltApi.UpdatePartnerRequest} request
|
|
331
368
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
332
369
|
*
|
|
333
370
|
* @throws {@link ToltApi.BadRequestError}
|
|
334
371
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
335
372
|
* @throws {@link ToltApi.NotFoundError}
|
|
336
|
-
* @throws {@link ToltApi.
|
|
373
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
337
374
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
338
375
|
* @throws {@link errors.ToltApiError}
|
|
339
376
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
340
377
|
*
|
|
341
378
|
* @example
|
|
342
379
|
* await client.partners.update({
|
|
343
|
-
* id: "
|
|
380
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
381
|
+
* first_name: "Sam",
|
|
382
|
+
* last_name: "Taylor",
|
|
383
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a"
|
|
344
384
|
* })
|
|
345
385
|
*/
|
|
346
386
|
update(request, requestOptions) {
|
|
@@ -353,7 +393,7 @@ export class PartnersClient {
|
|
|
353
393
|
const _response = await core.fetcher({
|
|
354
394
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
355
395
|
(await core.Supplier.get(this._options.environment)) ??
|
|
356
|
-
environments.ToltApiEnvironment.
|
|
396
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
357
397
|
method: "PUT",
|
|
358
398
|
headers: _headers,
|
|
359
399
|
contentType: "application/json",
|
|
@@ -377,8 +417,8 @@ export class PartnersClient {
|
|
|
377
417
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
378
418
|
case 404:
|
|
379
419
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
380
|
-
case
|
|
381
|
-
throw new ToltApi.
|
|
420
|
+
case 413:
|
|
421
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
382
422
|
case 429:
|
|
383
423
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
384
424
|
default:
|
|
@@ -392,18 +432,21 @@ export class PartnersClient {
|
|
|
392
432
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/partners/{id}");
|
|
393
433
|
}
|
|
394
434
|
/**
|
|
395
|
-
*
|
|
435
|
+
* Makes the partner active. A partner who was not already active is sent the program's approval email.
|
|
436
|
+
*
|
|
437
|
+
* @param {ToltApi.ApprovePartnerRequest} request
|
|
396
438
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
397
439
|
*
|
|
398
440
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
399
441
|
* @throws {@link ToltApi.NotFoundError}
|
|
442
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
400
443
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
401
444
|
* @throws {@link errors.ToltApiError}
|
|
402
445
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
403
446
|
*
|
|
404
447
|
* @example
|
|
405
448
|
* await client.partners.approve({
|
|
406
|
-
* id: "
|
|
449
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
407
450
|
* })
|
|
408
451
|
*/
|
|
409
452
|
approve(request, requestOptions) {
|
|
@@ -416,7 +459,7 @@ export class PartnersClient {
|
|
|
416
459
|
const _response = await core.fetcher({
|
|
417
460
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
418
461
|
(await core.Supplier.get(this._options.environment)) ??
|
|
419
|
-
environments.ToltApiEnvironment.
|
|
462
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}/approve`),
|
|
420
463
|
method: "POST",
|
|
421
464
|
headers: _headers,
|
|
422
465
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -435,6 +478,8 @@ export class PartnersClient {
|
|
|
435
478
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
436
479
|
case 404:
|
|
437
480
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
481
|
+
case 413:
|
|
482
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
438
483
|
case 429:
|
|
439
484
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
440
485
|
default:
|
|
@@ -448,19 +493,22 @@ export class PartnersClient {
|
|
|
448
493
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/approve");
|
|
449
494
|
}
|
|
450
495
|
/**
|
|
451
|
-
*
|
|
496
|
+
* Rejects the partner. A partner who was not already rejected is sent the program's rejection email with the note.
|
|
497
|
+
*
|
|
498
|
+
* @param {ToltApi.RejectPartnerRequest} request
|
|
452
499
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
453
500
|
*
|
|
454
501
|
* @throws {@link ToltApi.BadRequestError}
|
|
455
502
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
456
503
|
* @throws {@link ToltApi.NotFoundError}
|
|
504
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
457
505
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
458
506
|
* @throws {@link errors.ToltApiError}
|
|
459
507
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
460
508
|
*
|
|
461
509
|
* @example
|
|
462
510
|
* await client.partners.reject({
|
|
463
|
-
* id: "
|
|
511
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
464
512
|
* })
|
|
465
513
|
*/
|
|
466
514
|
reject(request, requestOptions) {
|
|
@@ -473,7 +521,7 @@ export class PartnersClient {
|
|
|
473
521
|
const _response = await core.fetcher({
|
|
474
522
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
475
523
|
(await core.Supplier.get(this._options.environment)) ??
|
|
476
|
-
environments.ToltApiEnvironment.
|
|
524
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}/reject`),
|
|
477
525
|
method: "POST",
|
|
478
526
|
headers: _headers,
|
|
479
527
|
contentType: "application/json",
|
|
@@ -497,6 +545,8 @@ export class PartnersClient {
|
|
|
497
545
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
498
546
|
case 404:
|
|
499
547
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
548
|
+
case 413:
|
|
549
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
500
550
|
case 429:
|
|
501
551
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
502
552
|
default:
|
|
@@ -510,19 +560,22 @@ export class PartnersClient {
|
|
|
510
560
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/reject");
|
|
511
561
|
}
|
|
512
562
|
/**
|
|
513
|
-
*
|
|
563
|
+
* Suspends the partner, with an optional suspension_reason. Use the approve action to make them active again.
|
|
564
|
+
*
|
|
565
|
+
* @param {ToltApi.SuspendPartnerRequest} request
|
|
514
566
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
515
567
|
*
|
|
516
568
|
* @throws {@link ToltApi.BadRequestError}
|
|
517
569
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
518
570
|
* @throws {@link ToltApi.NotFoundError}
|
|
571
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
519
572
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
520
573
|
* @throws {@link errors.ToltApiError}
|
|
521
574
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
522
575
|
*
|
|
523
576
|
* @example
|
|
524
577
|
* await client.partners.suspend({
|
|
525
|
-
* id: "
|
|
578
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
526
579
|
* })
|
|
527
580
|
*/
|
|
528
581
|
suspend(request, requestOptions) {
|
|
@@ -535,7 +588,7 @@ export class PartnersClient {
|
|
|
535
588
|
const _response = await core.fetcher({
|
|
536
589
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
537
590
|
(await core.Supplier.get(this._options.environment)) ??
|
|
538
|
-
environments.ToltApiEnvironment.
|
|
591
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id, errors.ToltApiError)}/suspend`),
|
|
539
592
|
method: "POST",
|
|
540
593
|
headers: _headers,
|
|
541
594
|
contentType: "application/json",
|
|
@@ -559,6 +612,8 @@ export class PartnersClient {
|
|
|
559
612
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
560
613
|
case 404:
|
|
561
614
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
615
|
+
case 413:
|
|
616
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
562
617
|
case 429:
|
|
563
618
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
564
619
|
default:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"]
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface BulkApprovePartnersRequest {
|
|
8
|
-
/**
|
|
8
|
+
/** Ids of the partners to act on, as returned when listing partners. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
9
|
ids: string[];
|
|
10
10
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"],
|
|
5
|
+
* rejection_note: "Site does not match our audience."
|
|
5
6
|
* }
|
|
6
7
|
*/
|
|
7
8
|
export interface BulkRejectPartnersRequest {
|
|
8
|
-
/**
|
|
9
|
+
/** Ids of the partners to act on, as returned when listing partners. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
10
|
ids: string[];
|
|
11
|
+
/** Reason for the rejection, shown to the partner in the partner portal. Null clears an earlier note. */
|
|
10
12
|
rejection_note?: string | null;
|
|
11
13
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* email: "sam@example.com",
|
|
5
|
+
* program_id: "prg_T6z8aRW3XCmvFWP972RKxpAd",
|
|
6
|
+
* first_name: "Sam",
|
|
7
|
+
* last_name: "Taylor",
|
|
8
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a",
|
|
9
|
+
* link: {
|
|
10
|
+
* value: "sam",
|
|
11
|
+
* param: "ref"
|
|
12
|
+
* }
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface CreatePartnerRequest {
|
|
16
|
+
/** Partner's email address, where program emails such as the welcome email go. It identifies the partner in the program, so it cannot match another partner's email there, ignoring case. */
|
|
17
|
+
email: string;
|
|
18
|
+
/** Id of the program to add the partner to (prg_...), as returned when listing programs. */
|
|
19
|
+
program_id: string;
|
|
20
|
+
/** Partner's first name. With last_name it is used for the default link value when link is omitted. */
|
|
21
|
+
first_name?: string;
|
|
22
|
+
/** Partner's last name. With first_name it makes up the name shown for the partner unless display_name is set. */
|
|
23
|
+
last_name?: string;
|
|
24
|
+
/** Overrides the name shown for the partner; defaults to the first and last name. */
|
|
25
|
+
display_name?: string;
|
|
26
|
+
/** Business the partner promotes through, if they are a company rather than a person. Leave it out for an individual. */
|
|
27
|
+
company_name?: string;
|
|
28
|
+
/** Two-letter ISO country code. */
|
|
29
|
+
country_code?: string;
|
|
30
|
+
/** URL of the partner's website, starting with http:// or https://. */
|
|
31
|
+
website_url?: string;
|
|
32
|
+
/** Backdate the partner's creation time. Defaults to now. */
|
|
33
|
+
created_at?: string;
|
|
34
|
+
/** Group in the program. Defaults to the program's default group. */
|
|
35
|
+
group_id?: string;
|
|
36
|
+
/** Use pending to add the partner as an application that still needs approval instead of an active partner. */
|
|
37
|
+
status?: CreatePartnerRequest.Status;
|
|
38
|
+
/** The referral link created with the partner. Leave it out to build the slug from the partner's name, or from the part of the email before the @ when there is no name. */
|
|
39
|
+
link?: CreatePartnerRequest.Link;
|
|
40
|
+
/** Send the partner the program's welcome email. Only goes out when the program's welcome email is enabled and the partner is active. */
|
|
41
|
+
notify_partner?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare namespace CreatePartnerRequest {
|
|
44
|
+
/** Use pending to add the partner as an application that still needs approval instead of an active partner. */
|
|
45
|
+
const Status: {
|
|
46
|
+
readonly Active: "active";
|
|
47
|
+
readonly Pending: "pending";
|
|
48
|
+
};
|
|
49
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
50
|
+
/**
|
|
51
|
+
* The referral link created with the partner. Leave it out to build the slug from the partner's name, or from the part of the email before the @ when there is no name.
|
|
52
|
+
*/
|
|
53
|
+
interface Link {
|
|
54
|
+
/** Slug that identifies the partner in referral URLs, such as `sam` in `?ref=sam`. Pick one that no other link uses with the same parameter. */
|
|
55
|
+
value: string;
|
|
56
|
+
/** Query parameter of the link, such as `ref` in `?ref=sam`. Leave it out to use the program's first link parameter. */
|
|
57
|
+
param?: string | undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var CreatePartnerRequest;
|
|
3
|
+
(function (CreatePartnerRequest) {
|
|
4
|
+
/** Use pending to add the partner as an application that still needs approval instead of an active partner. */
|
|
5
|
+
CreatePartnerRequest.Status = {
|
|
6
|
+
Active: "active",
|
|
7
|
+
Pending: "pending",
|
|
8
|
+
};
|
|
9
|
+
})(CreatePartnerRequest || (CreatePartnerRequest = {}));
|
|
@@ -4,24 +4,30 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
4
4
|
* {}
|
|
5
5
|
*/
|
|
6
6
|
export interface ListPartnersRequest {
|
|
7
|
+
/** How many rows to return in one page. */
|
|
7
8
|
limit?: number;
|
|
9
|
+
/** Ranking direction: desc puts the most recently created or updated rows first. */
|
|
8
10
|
order?: ToltApi.ListPartnersRequestOrder;
|
|
9
|
-
/**
|
|
11
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
10
12
|
sort?: ToltApi.ListPartnersRequestSort;
|
|
11
13
|
/** 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. */
|
|
12
14
|
starting_after?: string;
|
|
13
15
|
/** 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
16
|
ending_before?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** 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. */
|
|
16
18
|
created_after?: string;
|
|
17
|
-
/**
|
|
19
|
+
/** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
|
|
18
20
|
created_before?: string;
|
|
19
|
-
/** Only items
|
|
21
|
+
/** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
|
|
20
22
|
updated_after?: string;
|
|
21
|
-
/** Only items
|
|
23
|
+
/** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
|
|
22
24
|
updated_before?: string;
|
|
25
|
+
/** Keep only partners at this review stage; approved partners appear as active. */
|
|
23
26
|
status?: ToltApi.ListPartnersRequestStatus;
|
|
27
|
+
/** Limit to one program, by its id (prg_...) as returned when listing programs. */
|
|
24
28
|
program_id?: string;
|
|
29
|
+
/** Limit to partners in one group, by the group id (grp_...) as returned when listing groups. */
|
|
25
30
|
group_id?: string;
|
|
31
|
+
/** Text matched anywhere in the partner's id, email, first name, last name or company name, ignoring case. */
|
|
26
32
|
search?: string;
|
|
27
33
|
}
|