@tolt/api 0.7.0 → 1.1.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 +2 -2
- 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/resources/clicks/client/Client.d.ts +10 -7
- package/dist/api/resources/clicks/client/Client.js +82 -68
- package/dist/api/resources/clicks/client/requests/CreateClickRequest.d.ts +28 -0
- package/dist/api/resources/clicks/client/requests/{GetClicksRequest.d.ts → GetClickRequest.d.ts} +1 -1
- 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/index.d.ts +2 -3
- package/dist/api/resources/clicks/types/index.js +2 -3
- package/dist/api/resources/commissions/client/Client.d.ts +19 -15
- package/dist/api/resources/commissions/client/Client.js +94 -76
- package/dist/api/resources/commissions/client/requests/{DeleteCommissionsRequest.d.ts → ApproveCommissionRequest.d.ts} +1 -1
- 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/{DeclineCommissionsRequest.d.ts → DeclineCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{ApproveCommissionsRequest.d.ts → DeleteCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{GetCommissionsRequest.d.ts → GetCommissionRequest.d.ts} +1 -1
- package/dist/api/resources/commissions/client/requests/{UpdateCommissionsRequest.d.ts → UpdateCommissionRequest.d.ts} +3 -3
- 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/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 +9 -10
- package/dist/api/resources/customers/client/Client.js +84 -71
- package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.d.ts → CreateCustomerRequest.d.ts} +3 -3
- package/dist/api/resources/customers/client/requests/{CreateCustomersRequest.js → CreateCustomerRequest.js} +4 -4
- package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.d.ts → DeleteCustomerRequest.d.ts} +1 -1
- package/dist/api/resources/customers/client/requests/{GetCustomersRequest.d.ts → GetCustomerRequest.d.ts} +1 -1
- package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.d.ts → UpdateCustomerRequest.d.ts} +3 -3
- package/dist/api/resources/customers/client/requests/{UpdateCustomersRequest.js → UpdateCustomerRequest.js} +4 -4
- 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/{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 +9 -11
- package/dist/api/resources/{embed → embedTokens}/client/Client.js +7 -9
- package/dist/api/resources/embedTokens/client/index.d.ts +1 -0
- package/dist/api/resources/embedTokens/client/index.js +1 -0
- 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 +3 -4
- package/dist/api/resources/flows/client/Client.js +74 -64
- package/dist/api/resources/flows/client/requests/{GetFlowsRequest.d.ts → GetFlowRequest.d.ts} +1 -1
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +1 -1
- 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/index.d.ts +1 -2
- package/dist/api/resources/flows/types/index.js +1 -2
- package/dist/api/resources/groups/client/Client.d.ts +3 -4
- package/dist/api/resources/groups/client/Client.js +71 -61
- package/dist/api/resources/groups/client/requests/{GetGroupsRequest.d.ts → GetGroupRequest.d.ts} +1 -1
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +1 -1
- 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/index.d.ts +1 -2
- package/dist/api/resources/groups/types/index.js +1 -2
- package/dist/api/resources/index.d.ts +3 -2
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/links/client/Client.d.ts +11 -12
- package/dist/api/resources/links/client/Client.js +80 -70
- package/dist/api/resources/links/client/requests/{CreateLinksRequest.d.ts → CreateLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{DeleteLinksRequest.d.ts → DeleteLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.d.ts → GetLinkByParamValueRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{GetLinksRequest.d.ts → GetLinkRequest.d.ts} +1 -1
- package/dist/api/resources/links/client/requests/{UpdateLinksRequest.d.ts → UpdateLinkRequest.d.ts} +1 -1
- 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/{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 +13 -14
- package/dist/api/resources/partners/client/Client.js +82 -72
- package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.d.ts → ApprovePartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.d.ts → CreatePartnerRequest.d.ts} +4 -4
- package/dist/api/resources/partners/client/requests/{CreatePartnersRequest.js → CreatePartnerRequest.js} +4 -4
- package/dist/api/resources/partners/client/requests/{GetPartnersRequest.d.ts → GetPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.d.ts → RejectPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.d.ts → SuspendPartnerRequest.d.ts} +1 -1
- package/dist/api/resources/partners/client/requests/{UpdatePartnersRequest.d.ts → UpdatePartnerRequest.d.ts} +1 -1
- 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/{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 +3 -4
- package/dist/api/resources/programs/client/Client.js +69 -59
- package/dist/api/resources/programs/client/requests/{GetProgramsRequest.d.ts → GetProgramRequest.d.ts} +1 -1
- 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/index.d.ts +1 -1
- package/dist/api/resources/programs/types/index.js +1 -1
- package/dist/api/resources/promotionCodes/client/Client.d.ts +9 -10
- package/dist/api/resources/promotionCodes/client/Client.js +81 -68
- package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.d.ts → CreatePromotionCodeRequest.d.ts} +3 -3
- package/dist/api/resources/promotionCodes/client/requests/{CreatePromotionCodesRequest.js → CreatePromotionCodeRequest.js} +4 -4
- package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.d.ts → DeletePromotionCodeRequest.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/client/requests/{GetPromotionCodesRequest.d.ts → GetPromotionCodeRequest.d.ts} +1 -1
- package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.d.ts → UpdatePromotionCodeRequest.d.ts} +3 -3
- package/dist/api/resources/promotionCodes/client/requests/{UpdatePromotionCodesRequest.js → UpdatePromotionCodeRequest.js} +4 -4
- 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/{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 +12 -14
- package/dist/api/resources/reports/client/Client.js +158 -119
- package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.d.ts → ReportsCustomersRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{LinksReportsRequest.d.ts → ReportsLinksRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.d.ts → ReportsOverviewRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.d.ts → ReportsPartnersRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/{TimeseriesReportsRequest.d.ts → ReportsTimeseriesRequest.d.ts} +1 -1
- package/dist/api/resources/reports/client/requests/index.d.ts +5 -5
- 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/index.d.ts +5 -5
- package/dist/api/resources/reports/types/index.js +5 -5
- package/dist/api/resources/transactions/client/Client.d.ts +13 -14
- package/dist/api/resources/transactions/client/Client.js +87 -74
- package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.d.ts → CreateTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.d.ts → DeleteTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.d.ts → GetTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.d.ts → RefundTransactionRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.d.ts → RerunTransactionFlowsRequest.d.ts} +1 -1
- package/dist/api/resources/transactions/client/requests/{UpdateTransactionsRequest.d.ts → UpdateTransactionRequest.d.ts} +1 -1
- 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/{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/{Error_.d.ts → ErrorResponse.d.ts} +4 -4
- package/dist/api/types/{Error_.js → ErrorResponse.js} +4 -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/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 +1 -1
- package/dist/environments.js +1 -1
- package/dist/errors/ToltApiError.js +15 -1
- package/package.json +7 -2
- package/dist/api/resources/clicks/types/CreateClicksRequest.d.ts +0 -1
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +0 -9
- 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/embed/exports.d.ts +0 -2
- package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +0 -1
- package/dist/api/resources/embed/types/index.d.ts +0 -2
- package/dist/api/resources/embed/types/index.js +0 -2
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +0 -6
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +0 -6
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +0 -6
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +0 -6
- package/dist/api/resources/links/types/GetByParamValueLinksResponse.d.ts +0 -6
- 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/types/{ApproveCommissionsResponse.js → ApproveCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsRequest.js → CreateCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{CreateCommissionsResponse.js → DeclineCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeclineCommissionsResponse.js → DeleteCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{DeleteCommissionsResponse.js → GetCommissionResponse.js} +0 -0
- /package/dist/api/resources/commissions/types/{GetCommissionsResponse.js → UpdateCommissionResponse.js} +0 -0
- /package/dist/api/resources/{commissions/types/UpdateCommissionsResponse.js → customers/client/requests/DeleteCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/client/requests/{DeleteCustomersRequest.js → GetCustomerRequest.js} +0 -0
- /package/dist/api/resources/customers/{client/requests/GetCustomersRequest.js → types/CreateCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{CreateCustomersResponse.js → DeleteCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{DeleteCustomersResponse.js → GetCustomerResponse.js} +0 -0
- /package/dist/api/resources/customers/types/{GetCustomersResponse.js → UpdateCustomerResponse.js} +0 -0
- /package/dist/api/resources/{customers/types/UpdateCustomersResponse.js → embedTokens/client/requests/CreateEmbedTokenRequest.js} +0 -0
- /package/dist/api/resources/{embed/client → 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/{embed/types/CreateTokenEmbedRequest.js → embedTokens/types/CreateEmbedTokenResponse.js} +0 -0
- /package/dist/api/resources/{embed/types/CreateTokenEmbedResponse.js → flows/client/requests/GetFlowRequest.js} +0 -0
- /package/dist/api/resources/flows/{client/requests/GetFlowsRequest.js → types/GetFlowResponse.js} +0 -0
- /package/dist/api/resources/{flows/types/GetFlowsResponse.js → groups/client/requests/GetGroupRequest.js} +0 -0
- /package/dist/api/resources/groups/{client/requests/GetGroupsRequest.js → types/GetGroupResponse.js} +0 -0
- /package/dist/api/resources/{groups/types/GetGroupsResponse.js → links/client/requests/CreateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{CreateLinksRequest.js → DeleteLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{DeleteLinksRequest.js → GetLinkByParamValueRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetByParamValueLinksRequest.js → GetLinkRequest.js} +0 -0
- /package/dist/api/resources/links/client/requests/{GetLinksRequest.js → UpdateLinkRequest.js} +0 -0
- /package/dist/api/resources/links/{client/requests/UpdateLinksRequest.js → types/CreateLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{CreateLinksResponse.js → DeleteLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{DeleteLinksResponse.js → GetLinkByParamValueResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetByParamValueLinksResponse.js → GetLinkResponse.js} +0 -0
- /package/dist/api/resources/links/types/{GetLinksResponse.js → UpdateLinkResponse.js} +0 -0
- /package/dist/api/resources/{links/types/UpdateLinksResponse.js → partners/client/requests/ApprovePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{ApprovePartnersRequest.js → GetPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{GetPartnersRequest.js → RejectPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{RejectPartnersRequest.js → SuspendPartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/client/requests/{SuspendPartnersRequest.js → UpdatePartnerRequest.js} +0 -0
- /package/dist/api/resources/partners/{client/requests/UpdatePartnersRequest.js → types/ApprovePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{ApprovePartnersResponse.js → CreatePartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{CreatePartnersResponse.js → GetPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{GetPartnersResponse.js → RejectPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{RejectPartnersResponse.js → SuspendPartnerResponse.js} +0 -0
- /package/dist/api/resources/partners/types/{SuspendPartnersResponse.js → UpdatePartnerResponse.js} +0 -0
- /package/dist/api/resources/{partners/types/UpdatePartnersResponse.js → programs/client/requests/GetProgramRequest.js} +0 -0
- /package/dist/api/resources/programs/{client/requests/GetProgramsRequest.js → types/GetProgramResponse.js} +0 -0
- /package/dist/api/resources/{programs/types/GetProgramsResponse.js → promotionCodes/client/requests/DeletePromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/client/requests/{DeletePromotionCodesRequest.js → GetPromotionCodeRequest.js} +0 -0
- /package/dist/api/resources/promotionCodes/{client/requests/GetPromotionCodesRequest.js → types/CreatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{CreatePromotionCodesResponse.js → DeletePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{DeletePromotionCodesResponse.js → GetPromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/promotionCodes/types/{GetPromotionCodesResponse.js → UpdatePromotionCodeResponse.js} +0 -0
- /package/dist/api/resources/{promotionCodes/types/UpdatePromotionCodesResponse.js → reports/client/requests/ReportsCustomersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{CustomerStatsReportsRequest.js → ReportsLinksRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{LinksReportsRequest.js → ReportsOverviewRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{OverviewReportsRequest.js → ReportsPartnersRequest.js} +0 -0
- /package/dist/api/resources/reports/client/requests/{PartnersReportsRequest.js → ReportsTimeseriesRequest.js} +0 -0
- /package/dist/api/resources/reports/{client/requests/TimeseriesReportsRequest.js → types/ReportsCustomersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{CustomerStatsReportsResponse.js → ReportsLinksResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{LinksReportsResponse.js → ReportsOverviewResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{OverviewReportsResponse.js → ReportsPartnersResponse.js} +0 -0
- /package/dist/api/resources/reports/types/{PartnersReportsResponse.js → ReportsTimeseriesResponse.js} +0 -0
- /package/dist/api/resources/{reports/types/TimeseriesReportsResponse.js → transactions/client/requests/CreateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{CreateTransactionsRequest.js → DeleteTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{DeleteTransactionsRequest.js → GetTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{GetTransactionsRequest.js → RefundTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RefundTransactionsRequest.js → RerunTransactionFlowsRequest.js} +0 -0
- /package/dist/api/resources/transactions/client/requests/{RerunFlowsTransactionsRequest.js → UpdateTransactionRequest.js} +0 -0
- /package/dist/api/resources/transactions/{client/requests/UpdateTransactionsRequest.js → types/CreateTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{CreateTransactionsResponse.js → DeleteTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{DeleteTransactionsResponse.js → GetTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{GetTransactionsResponse.js → RefundTransactionResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RefundTransactionsResponse.js → RerunTransactionFlowsResponse.js} +0 -0
- /package/dist/api/resources/transactions/types/{RerunFlowsTransactionsResponse.js → UpdateTransactionResponse.js} +0 -0
- /package/dist/{api/resources/embed/client/index.d.ts → core/pagination/exports.js} +0 -0
|
@@ -26,12 +26,11 @@ export declare class PromotionCodesClient {
|
|
|
26
26
|
* @example
|
|
27
27
|
* await client.promotionCodes.list()
|
|
28
28
|
*/
|
|
29
|
-
list(request?: ToltApi.ListPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.
|
|
30
|
-
private __list;
|
|
29
|
+
list(request?: ToltApi.ListPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): Promise<core.Page<ToltApi.PromotionCode, ToltApi.ListPromotionCodesResponse>>;
|
|
31
30
|
/**
|
|
32
31
|
* Creates a promotion code for a partner, so customers who use it are credited to them. A partner cannot have the same code twice.
|
|
33
32
|
*
|
|
34
|
-
* @param {ToltApi.
|
|
33
|
+
* @param {ToltApi.CreatePromotionCodeRequest} request
|
|
35
34
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
35
|
*
|
|
37
36
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -50,12 +49,12 @@ export declare class PromotionCodesClient {
|
|
|
50
49
|
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
51
50
|
* })
|
|
52
51
|
*/
|
|
53
|
-
create(request: ToltApi.
|
|
52
|
+
create(request: ToltApi.CreatePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreatePromotionCodeResponse>;
|
|
54
53
|
private __create;
|
|
55
54
|
/**
|
|
56
55
|
* Gets a promotion code by ID, with its discount type and value and the partner, group or program it belongs to.
|
|
57
56
|
*
|
|
58
|
-
* @param {ToltApi.
|
|
57
|
+
* @param {ToltApi.GetPromotionCodeRequest} request
|
|
59
58
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
59
|
*
|
|
61
60
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -70,12 +69,12 @@ export declare class PromotionCodesClient {
|
|
|
70
69
|
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
71
70
|
* })
|
|
72
71
|
*/
|
|
73
|
-
get(request: ToltApi.
|
|
72
|
+
get(request: ToltApi.GetPromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetPromotionCodeResponse>;
|
|
74
73
|
private __get;
|
|
75
74
|
/**
|
|
76
75
|
* Updates a promotion code's code, discount type or value.
|
|
77
76
|
*
|
|
78
|
-
* @param {ToltApi.
|
|
77
|
+
* @param {ToltApi.UpdatePromotionCodeRequest} request
|
|
79
78
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
79
|
*
|
|
81
80
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -95,12 +94,12 @@ export declare class PromotionCodesClient {
|
|
|
95
94
|
* value: "20"
|
|
96
95
|
* })
|
|
97
96
|
*/
|
|
98
|
-
update(request: ToltApi.
|
|
97
|
+
update(request: ToltApi.UpdatePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdatePromotionCodeResponse>;
|
|
99
98
|
private __update;
|
|
100
99
|
/**
|
|
101
100
|
* Deletes a promotion code, so customers who use it afterwards are no longer attributed through it.
|
|
102
101
|
*
|
|
103
|
-
* @param {ToltApi.
|
|
102
|
+
* @param {ToltApi.DeletePromotionCodeRequest} request
|
|
104
103
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
105
104
|
*
|
|
106
105
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -115,6 +114,6 @@ export declare class PromotionCodesClient {
|
|
|
115
114
|
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
116
115
|
* })
|
|
117
116
|
*/
|
|
118
|
-
delete(request: ToltApi.
|
|
117
|
+
delete(request: ToltApi.DeletePromotionCodeRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeletePromotionCodeResponse>;
|
|
119
118
|
private __delete;
|
|
120
119
|
}
|
|
@@ -27,72 +27,85 @@ export class PromotionCodesClient {
|
|
|
27
27
|
* @example
|
|
28
28
|
* await client.promotionCodes.list()
|
|
29
29
|
*/
|
|
30
|
-
list(request = {}, requestOptions) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (_response.error.reason === "status-code") {
|
|
73
|
-
switch (_response.error.statusCode) {
|
|
74
|
-
case 400:
|
|
75
|
-
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
76
|
-
case 401:
|
|
77
|
-
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
78
|
-
case 413:
|
|
79
|
-
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
80
|
-
case 429:
|
|
81
|
-
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
82
|
-
default:
|
|
83
|
-
throw new errors.ToltApiError({
|
|
84
|
-
statusCode: _response.error.statusCode,
|
|
85
|
-
body: _response.error.body,
|
|
86
|
-
rawResponse: _response.rawResponse,
|
|
87
|
-
});
|
|
30
|
+
async list(request = {}, requestOptions) {
|
|
31
|
+
const list = core.HttpResponsePromise.interceptFunction(async (request) => {
|
|
32
|
+
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;
|
|
33
|
+
const _queryParams = {
|
|
34
|
+
limit,
|
|
35
|
+
order: order != null ? order : undefined,
|
|
36
|
+
sort: sort != null ? sort : undefined,
|
|
37
|
+
starting_after: startingAfter,
|
|
38
|
+
ending_before: endingBefore,
|
|
39
|
+
created_after: createdAfter != null ? createdAfter : undefined,
|
|
40
|
+
created_before: createdBefore != null ? createdBefore : undefined,
|
|
41
|
+
updated_after: updatedAfter != null ? updatedAfter : undefined,
|
|
42
|
+
updated_before: updatedBefore != null ? updatedBefore : undefined,
|
|
43
|
+
program_id: programId,
|
|
44
|
+
partner_id: partnerId,
|
|
45
|
+
type: type_ != null ? type_ : undefined,
|
|
46
|
+
search,
|
|
47
|
+
};
|
|
48
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
49
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
50
|
+
const _response = await core.fetcher({
|
|
51
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
52
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
53
|
+
environments.ToltApiEnvironment.Default, "v2/promotion-codes"),
|
|
54
|
+
method: "GET",
|
|
55
|
+
headers: _headers,
|
|
56
|
+
queryString: core.url
|
|
57
|
+
.queryBuilder()
|
|
58
|
+
.addMany(_queryParams)
|
|
59
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
60
|
+
.build(),
|
|
61
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
62
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
63
|
+
abortSignal: requestOptions?.abortSignal,
|
|
64
|
+
fetchFn: this._options?.fetch,
|
|
65
|
+
logging: this._options.logging,
|
|
66
|
+
});
|
|
67
|
+
if (_response.ok) {
|
|
68
|
+
return {
|
|
69
|
+
data: _response.body,
|
|
70
|
+
rawResponse: _response.rawResponse,
|
|
71
|
+
};
|
|
88
72
|
}
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 400:
|
|
76
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
77
|
+
case 401:
|
|
78
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
79
|
+
case 413:
|
|
80
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
81
|
+
case 429:
|
|
82
|
+
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
83
|
+
default:
|
|
84
|
+
throw new errors.ToltApiError({
|
|
85
|
+
statusCode: _response.error.statusCode,
|
|
86
|
+
body: _response.error.body,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/promotion-codes");
|
|
92
|
+
});
|
|
93
|
+
const dataWithRawResponse = await list(request).withRawResponse();
|
|
94
|
+
return new core.Page({
|
|
95
|
+
response: dataWithRawResponse.data,
|
|
96
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
97
|
+
hasNextPage: (response) => response?.next_cursor != null &&
|
|
98
|
+
!(typeof response?.next_cursor === "string" && response?.next_cursor === ""),
|
|
99
|
+
getItems: (response) => response?.data ?? [],
|
|
100
|
+
loadPage: (response) => {
|
|
101
|
+
return list(core.setObjectProperty(request, "starting_after", response?.next_cursor));
|
|
102
|
+
},
|
|
103
|
+
});
|
|
91
104
|
}
|
|
92
105
|
/**
|
|
93
106
|
* Creates a promotion code for a partner, so customers who use it are credited to them. A partner cannot have the same code twice.
|
|
94
107
|
*
|
|
95
|
-
* @param {ToltApi.
|
|
108
|
+
* @param {ToltApi.CreatePromotionCodeRequest} request
|
|
96
109
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
97
110
|
*
|
|
98
111
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -128,7 +141,7 @@ export class PromotionCodesClient {
|
|
|
128
141
|
requestType: "json",
|
|
129
142
|
body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
|
|
130
143
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
131
|
-
maxRetries:
|
|
144
|
+
maxRetries: 0,
|
|
132
145
|
abortSignal: requestOptions?.abortSignal,
|
|
133
146
|
fetchFn: this._options?.fetch,
|
|
134
147
|
logging: this._options.logging,
|
|
@@ -161,7 +174,7 @@ export class PromotionCodesClient {
|
|
|
161
174
|
/**
|
|
162
175
|
* Gets a promotion code by ID, with its discount type and value and the partner, group or program it belongs to.
|
|
163
176
|
*
|
|
164
|
-
* @param {ToltApi.
|
|
177
|
+
* @param {ToltApi.GetPromotionCodeRequest} request
|
|
165
178
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
166
179
|
*
|
|
167
180
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -186,7 +199,7 @@ export class PromotionCodesClient {
|
|
|
186
199
|
const _response = await core.fetcher({
|
|
187
200
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
188
201
|
(await core.Supplier.get(this._options.environment)) ??
|
|
189
|
-
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id)}`),
|
|
202
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
190
203
|
method: "GET",
|
|
191
204
|
headers: _headers,
|
|
192
205
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -222,7 +235,7 @@ export class PromotionCodesClient {
|
|
|
222
235
|
/**
|
|
223
236
|
* Updates a promotion code's code, discount type or value.
|
|
224
237
|
*
|
|
225
|
-
* @param {ToltApi.
|
|
238
|
+
* @param {ToltApi.UpdatePromotionCodeRequest} request
|
|
226
239
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
227
240
|
*
|
|
228
241
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -252,7 +265,7 @@ export class PromotionCodesClient {
|
|
|
252
265
|
const _response = await core.fetcher({
|
|
253
266
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
254
267
|
(await core.Supplier.get(this._options.environment)) ??
|
|
255
|
-
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id)}`),
|
|
268
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
256
269
|
method: "PUT",
|
|
257
270
|
headers: _headers,
|
|
258
271
|
contentType: "application/json",
|
|
@@ -295,7 +308,7 @@ export class PromotionCodesClient {
|
|
|
295
308
|
/**
|
|
296
309
|
* Deletes a promotion code, so customers who use it afterwards are no longer attributed through it.
|
|
297
310
|
*
|
|
298
|
-
* @param {ToltApi.
|
|
311
|
+
* @param {ToltApi.DeletePromotionCodeRequest} request
|
|
299
312
|
* @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
300
313
|
*
|
|
301
314
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
@@ -320,7 +333,7 @@ export class PromotionCodesClient {
|
|
|
320
333
|
const _response = await core.fetcher({
|
|
321
334
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
322
335
|
(await core.Supplier.get(this._options.environment)) ??
|
|
323
|
-
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id)}`),
|
|
336
|
+
environments.ToltApiEnvironment.Default, `v2/promotion-codes/${core.url.encodePathParam(id, errors.ToltApiError)}`),
|
|
324
337
|
method: "DELETE",
|
|
325
338
|
headers: _headers,
|
|
326
339
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface CreatePromotionCodeRequest {
|
|
11
11
|
/** The discount code as customers enter it at checkout. Customers and payments that use it are attributed to the code's partner. A partner cannot have the same code twice, ignoring case. Recording it here does not create it in your billing system. */
|
|
12
12
|
code: string;
|
|
13
13
|
/** Whether value is a percent off or a fixed amount off. */
|
|
14
|
-
type?:
|
|
14
|
+
type?: CreatePromotionCodeRequest.Type;
|
|
15
15
|
/** Size of the discount as a plain decimal: a percent from 0 to 100 for percentage codes ("20" is 20%), or an amount from 0 to 1,000,000 in major units of the program currency for fixed codes ("20" is 20.00). */
|
|
16
16
|
value?: string;
|
|
17
17
|
/** Id of the partner the code belongs to (part_...), as returned when listing partners. The code is created in that partner's program. */
|
|
18
18
|
partner_id: string;
|
|
19
19
|
}
|
|
20
|
-
export declare namespace
|
|
20
|
+
export declare namespace CreatePromotionCodeRequest {
|
|
21
21
|
/** Whether value is a percent off or a fixed amount off. */
|
|
22
22
|
const Type: {
|
|
23
23
|
readonly Fixed: "fixed";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var
|
|
3
|
-
(function (
|
|
2
|
+
export var CreatePromotionCodeRequest;
|
|
3
|
+
(function (CreatePromotionCodeRequest) {
|
|
4
4
|
/** Whether value is a percent off or a fixed amount off. */
|
|
5
|
-
|
|
5
|
+
CreatePromotionCodeRequest.Type = {
|
|
6
6
|
Fixed: "fixed",
|
|
7
7
|
Percentage: "percentage",
|
|
8
8
|
};
|
|
9
|
-
})(
|
|
9
|
+
})(CreatePromotionCodeRequest || (CreatePromotionCodeRequest = {}));
|
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
* value: "20"
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface UpdatePromotionCodeRequest {
|
|
11
11
|
id: string;
|
|
12
12
|
/** The discount code as customers enter it at checkout. Customers and payments that use it are attributed to the code's partner. A partner cannot have the same code twice, ignoring case. */
|
|
13
13
|
code?: string;
|
|
14
14
|
/** Whether value is a percent off or a fixed amount off. */
|
|
15
|
-
type?:
|
|
15
|
+
type?: UpdatePromotionCodeRequest.Type | null;
|
|
16
16
|
/** Size of the discount as a plain decimal: a percent from 0 to 100 for percentage codes ("20" is 20%), or an amount from 0 to 1,000,000 in major units of the program currency for fixed codes ("20" is 20.00). null clears it. */
|
|
17
17
|
value?: string | null;
|
|
18
18
|
}
|
|
19
|
-
export declare namespace
|
|
19
|
+
export declare namespace UpdatePromotionCodeRequest {
|
|
20
20
|
/** Whether value is a percent off or a fixed amount off. */
|
|
21
21
|
const Type: {
|
|
22
22
|
readonly Fixed: "fixed";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var
|
|
3
|
-
(function (
|
|
2
|
+
export var UpdatePromotionCodeRequest;
|
|
3
|
+
(function (UpdatePromotionCodeRequest) {
|
|
4
4
|
/** Whether value is a percent off or a fixed amount off. */
|
|
5
|
-
|
|
5
|
+
UpdatePromotionCodeRequest.Type = {
|
|
6
6
|
Fixed: "fixed",
|
|
7
7
|
Percentage: "percentage",
|
|
8
8
|
};
|
|
9
|
-
})(
|
|
9
|
+
})(UpdatePromotionCodeRequest || (UpdatePromotionCodeRequest = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
3
|
-
export type {
|
|
1
|
+
export { CreatePromotionCodeRequest } from "./CreatePromotionCodeRequest.js";
|
|
2
|
+
export type { DeletePromotionCodeRequest } from "./DeletePromotionCodeRequest.js";
|
|
3
|
+
export type { GetPromotionCodeRequest } from "./GetPromotionCodeRequest.js";
|
|
4
4
|
export type { ListPromotionCodesRequest } from "./ListPromotionCodesRequest.js";
|
|
5
|
-
export {
|
|
5
|
+
export { UpdatePromotionCodeRequest } from "./UpdatePromotionCodeRequest.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CreatePromotionCodeRequest } from "./CreatePromotionCodeRequest.js";
|
|
2
|
+
export { UpdatePromotionCodeRequest } from "./UpdatePromotionCodeRequest.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./CreatePromotionCodeResponse.js";
|
|
2
|
+
export * from "./DeletePromotionCodeResponse.js";
|
|
3
|
+
export * from "./GetPromotionCodeResponse.js";
|
|
4
4
|
export * from "./ListPromotionCodesRequestOrder.js";
|
|
5
5
|
export * from "./ListPromotionCodesRequestSort.js";
|
|
6
6
|
export * from "./ListPromotionCodesRequestType.js";
|
|
7
7
|
export * from "./ListPromotionCodesResponse.js";
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./UpdatePromotionCodeResponse.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
1
|
+
export * from "./CreatePromotionCodeResponse.js";
|
|
2
|
+
export * from "./DeletePromotionCodeResponse.js";
|
|
3
|
+
export * from "./GetPromotionCodeResponse.js";
|
|
4
4
|
export * from "./ListPromotionCodesRequestOrder.js";
|
|
5
5
|
export * from "./ListPromotionCodesRequestSort.js";
|
|
6
6
|
export * from "./ListPromotionCodesRequestType.js";
|
|
7
7
|
export * from "./ListPromotionCodesResponse.js";
|
|
8
|
-
export * from "./
|
|
8
|
+
export * from "./UpdatePromotionCodeResponse.js";
|
|
@@ -13,7 +13,7 @@ export declare class ReportsClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns revenue, commission, customer and partner totals for the organization or one program over a date range.
|
|
15
15
|
*
|
|
16
|
-
* @param {ToltApi.
|
|
16
|
+
* @param {ToltApi.ReportsOverviewRequest} request
|
|
17
17
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -26,12 +26,12 @@ export declare class ReportsClient {
|
|
|
26
26
|
* @example
|
|
27
27
|
* await client.reports.overview()
|
|
28
28
|
*/
|
|
29
|
-
overview(request?: ToltApi.
|
|
29
|
+
overview(request?: ToltApi.ReportsOverviewRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsOverviewResponse>;
|
|
30
30
|
private __overview;
|
|
31
31
|
/**
|
|
32
32
|
* Returns one row of revenue, commissions, customers and clicks per partner over a date range, sorted and paged by offset.
|
|
33
33
|
*
|
|
34
|
-
* @param {ToltApi.
|
|
34
|
+
* @param {ToltApi.ReportsPartnersRequest} request
|
|
35
35
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -44,12 +44,11 @@ export declare class ReportsClient {
|
|
|
44
44
|
* @example
|
|
45
45
|
* await client.reports.partners()
|
|
46
46
|
*/
|
|
47
|
-
partners(request?: ToltApi.
|
|
48
|
-
private __partners;
|
|
47
|
+
partners(request?: ToltApi.ReportsPartnersRequest, requestOptions?: ReportsClient.RequestOptions): Promise<core.Page<ToltApi.ReportsPartnerRow, ToltApi.ReportsPartnersResponse>>;
|
|
49
48
|
/**
|
|
50
49
|
* Returns one row of revenue, commissions, customers and clicks per link over a date range, sorted and paged by offset.
|
|
51
50
|
*
|
|
52
|
-
* @param {ToltApi.
|
|
51
|
+
* @param {ToltApi.ReportsLinksRequest} request
|
|
53
52
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
53
|
*
|
|
55
54
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -62,12 +61,11 @@ export declare class ReportsClient {
|
|
|
62
61
|
* @example
|
|
63
62
|
* await client.reports.links()
|
|
64
63
|
*/
|
|
65
|
-
links(request?: ToltApi.
|
|
66
|
-
private __links;
|
|
64
|
+
links(request?: ToltApi.ReportsLinksRequest, requestOptions?: ReportsClient.RequestOptions): Promise<core.Page<ToltApi.ReportsLinkRow, ToltApi.ReportsLinksResponse>>;
|
|
67
65
|
/**
|
|
68
66
|
* Returns revenue, commissions, customers and clicks per day, week or month over a date range, ready to chart.
|
|
69
67
|
*
|
|
70
|
-
* @param {ToltApi.
|
|
68
|
+
* @param {ToltApi.ReportsTimeseriesRequest} request
|
|
71
69
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
72
70
|
*
|
|
73
71
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -80,12 +78,12 @@ export declare class ReportsClient {
|
|
|
80
78
|
* @example
|
|
81
79
|
* await client.reports.timeseries()
|
|
82
80
|
*/
|
|
83
|
-
timeseries(request?: ToltApi.
|
|
81
|
+
timeseries(request?: ToltApi.ReportsTimeseriesRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsTimeseriesResponse>;
|
|
84
82
|
private __timeseries;
|
|
85
83
|
/**
|
|
86
84
|
* Returns how many customers are in each subscription status for the organization or one program.
|
|
87
85
|
*
|
|
88
|
-
* @param {ToltApi.
|
|
86
|
+
* @param {ToltApi.ReportsCustomersRequest} request
|
|
89
87
|
* @param {ReportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
88
|
*
|
|
91
89
|
* @throws {@link ToltApi.BadRequestError}
|
|
@@ -96,8 +94,8 @@ export declare class ReportsClient {
|
|
|
96
94
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
97
95
|
*
|
|
98
96
|
* @example
|
|
99
|
-
* await client.reports.
|
|
97
|
+
* await client.reports.customers()
|
|
100
98
|
*/
|
|
101
|
-
|
|
102
|
-
private
|
|
99
|
+
customers(request?: ToltApi.ReportsCustomersRequest, requestOptions?: ReportsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ReportsCustomersResponse>;
|
|
100
|
+
private __customers;
|
|
103
101
|
}
|