@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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A page of results from a paginated API.
|
|
3
|
+
*
|
|
4
|
+
* @template T The type of the items in the page.
|
|
5
|
+
* @template R The type of the API response.
|
|
6
|
+
*/
|
|
7
|
+
export class Page {
|
|
8
|
+
constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }) {
|
|
9
|
+
this.response = response;
|
|
10
|
+
this.rawResponse = rawResponse;
|
|
11
|
+
this.data = getItems(response);
|
|
12
|
+
this._hasNextPage = hasNextPage;
|
|
13
|
+
this.getItems = getItems;
|
|
14
|
+
this.loadNextPage = loadPage;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the next page
|
|
18
|
+
* @returns this
|
|
19
|
+
*/
|
|
20
|
+
async getNextPage() {
|
|
21
|
+
const { data, rawResponse } = await this.loadNextPage(this.response).withRawResponse();
|
|
22
|
+
this.response = data;
|
|
23
|
+
this.rawResponse = rawResponse;
|
|
24
|
+
this.data = this.getItems(this.response);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @returns whether there is a next page to load
|
|
29
|
+
*/
|
|
30
|
+
hasNextPage() {
|
|
31
|
+
return this._hasNextPage(this.response);
|
|
32
|
+
}
|
|
33
|
+
async *iterMessages() {
|
|
34
|
+
for (const item of this.data) {
|
|
35
|
+
yield item;
|
|
36
|
+
}
|
|
37
|
+
while (this.hasNextPage()) {
|
|
38
|
+
await this.getNextPage();
|
|
39
|
+
for (const item of this.data) {
|
|
40
|
+
yield item;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async *[Symbol.asyncIterator]() {
|
|
45
|
+
for await (const message of this.iterMessages()) {
|
|
46
|
+
yield message;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { Page } from "./Page.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Page } from "./Page.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Page } from "./Page.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function encodePathParam(param) {
|
|
1
|
+
export function encodePathParam(param, InvalidPathParameterError) {
|
|
2
2
|
if (param === null) {
|
|
3
3
|
return "null";
|
|
4
4
|
}
|
|
@@ -14,5 +14,11 @@ export function encodePathParam(param) {
|
|
|
14
14
|
param = String(param);
|
|
15
15
|
break;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const encoded = encodeURIComponent(param);
|
|
18
|
+
// "." and ".." are dot segments: URL resolution would remove them and send the request to a different path.
|
|
19
|
+
if (encoded === "." || encoded === "..") {
|
|
20
|
+
const message = `Invalid path parameter "${encoded}": "." and ".." are not allowed because they change the request path.`;
|
|
21
|
+
throw InvalidPathParameterError != null ? new InvalidPathParameterError({ message }) : new Error(message);
|
|
22
|
+
}
|
|
23
|
+
return encoded;
|
|
18
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setObjectProperty } from "./setObjectProperty.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setObjectProperty } from "./setObjectProperty.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a copy of object with the value at path set. If a portion of path doesn’t exist it’s created.
|
|
3
|
+
* Each object along path is shallow-copied, so the original object (and any nested objects it
|
|
4
|
+
* shares with the copy) is never modified. This is inspired by Lodash's set function, but is
|
|
5
|
+
* simplified to accommodate our use case. For more details, see https://lodash.com/docs/4.17.15#set.
|
|
6
|
+
*
|
|
7
|
+
* @param object The object to copy.
|
|
8
|
+
* @param path The path of the property to set.
|
|
9
|
+
* @param value The value to set.
|
|
10
|
+
* @return Returns the updated copy of object.
|
|
11
|
+
*/
|
|
12
|
+
export declare function setObjectProperty<T extends object>(object: T, path: string, value: any): T;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a copy of object with the value at path set. If a portion of path doesn’t exist it’s created.
|
|
3
|
+
* Each object along path is shallow-copied, so the original object (and any nested objects it
|
|
4
|
+
* shares with the copy) is never modified. This is inspired by Lodash's set function, but is
|
|
5
|
+
* simplified to accommodate our use case. For more details, see https://lodash.com/docs/4.17.15#set.
|
|
6
|
+
*
|
|
7
|
+
* @param object The object to copy.
|
|
8
|
+
* @param path The path of the property to set.
|
|
9
|
+
* @param value The value to set.
|
|
10
|
+
* @return Returns the updated copy of object.
|
|
11
|
+
*/
|
|
12
|
+
export function setObjectProperty(object, path, value) {
|
|
13
|
+
if (object == null) {
|
|
14
|
+
return object;
|
|
15
|
+
}
|
|
16
|
+
const keys = path.split(".");
|
|
17
|
+
if (keys.length === 0) {
|
|
18
|
+
// Invalid path; do nothing.
|
|
19
|
+
return object;
|
|
20
|
+
}
|
|
21
|
+
const result = { ...object };
|
|
22
|
+
let current = result;
|
|
23
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
24
|
+
const key = keys[i];
|
|
25
|
+
if (key == null) {
|
|
26
|
+
// Unreachable.
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const next = current[key];
|
|
30
|
+
if (Array.isArray(next)) {
|
|
31
|
+
current[key] = [...next];
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
current[key] = next != null && typeof next === "object" ? { ...next } : {};
|
|
35
|
+
}
|
|
36
|
+
current = current[key];
|
|
37
|
+
}
|
|
38
|
+
const lastKey = keys[keys.length - 1];
|
|
39
|
+
if (lastKey == null) {
|
|
40
|
+
// Unreachable.
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
current[lastKey] = value;
|
|
44
|
+
return result;
|
|
45
|
+
}
|
package/dist/environments.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const ToltApiEnvironment: {
|
|
2
|
-
readonly
|
|
2
|
+
readonly Default: "https://platform.tolt.dev";
|
|
3
3
|
};
|
|
4
|
-
export type ToltApiEnvironment = typeof ToltApiEnvironment.
|
|
4
|
+
export type ToltApiEnvironment = typeof ToltApiEnvironment.Default;
|
package/dist/environments.js
CHANGED
|
@@ -16,7 +16,21 @@ export class ToltApiError extends Error {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
get requestId() {
|
|
19
|
-
|
|
19
|
+
const headers = this.rawResponse?.headers;
|
|
20
|
+
if (headers == null) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const requestId = headers.get("X-Request-Id");
|
|
24
|
+
if (requestId != null) {
|
|
25
|
+
return requestId;
|
|
26
|
+
}
|
|
27
|
+
let fallback;
|
|
28
|
+
headers.forEach((value, name) => {
|
|
29
|
+
if (fallback === undefined && /request[-_]?id$/i.test(name)) {
|
|
30
|
+
fallback = value;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return fallback;
|
|
20
34
|
}
|
|
21
35
|
}
|
|
22
36
|
function buildMessage({ message, statusCode, body, }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolt/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "TypeScript SDK for the Tolt Public API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
18
|
+
},
|
|
16
19
|
"main": "./dist/index.js",
|
|
17
20
|
"types": "./dist/index.d.ts",
|
|
18
21
|
"exports": {
|
|
@@ -31,11 +34,13 @@
|
|
|
31
34
|
},
|
|
32
35
|
"scripts": {
|
|
33
36
|
"build": "tsc -p tsconfig.json",
|
|
34
|
-
"prepare": "npm run build"
|
|
37
|
+
"prepare": "npm run build",
|
|
38
|
+
"test": "node --test test/client.test.mjs"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@semantic-release/changelog": "^7.0.0",
|
|
38
42
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
43
|
+
"@semantic-release/exec": "^7.1.0",
|
|
39
44
|
"@semantic-release/git": "^11.0.1",
|
|
40
45
|
"@semantic-release/github": "^12.0.9",
|
|
41
46
|
"@semantic-release/npm": "^13.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CreateClicksRequest = unknown;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {
|
|
4
|
-
* id: "id"
|
|
5
|
-
* }
|
|
6
|
-
*/
|
|
7
|
-
export interface UpdateCommissionsRequest {
|
|
8
|
-
id: string;
|
|
9
|
-
/** Monetary amount as an integer in the smallest currency unit (cents), e.g. 500 = 5.00 */
|
|
10
|
-
amount?: number;
|
|
11
|
-
/** Monetary amount as an integer in the smallest currency unit (cents), e.g. 500 = 5.00 */
|
|
12
|
-
revenue?: number;
|
|
13
|
-
status?: string | null;
|
|
14
|
-
source?: string | null;
|
|
15
|
-
charge_id?: string | null;
|
|
16
|
-
transaction_id?: string | null;
|
|
17
|
-
created_at?: string;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CreateCommissionsRequest = unknown;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {}
|
|
4
|
-
*/
|
|
5
|
-
export interface CreateCustomersRequest {
|
|
6
|
-
email?: string;
|
|
7
|
-
/** Resolve a code in the partner’s program, preferring partner, group, then program scope. An unmatched code leaves attribution unchanged. */
|
|
8
|
-
promotion_code?: string;
|
|
9
|
-
created_at?: string;
|
|
10
|
-
name?: string;
|
|
11
|
-
customer_id?: string;
|
|
12
|
-
status?: CreateCustomersRequest.Status;
|
|
13
|
-
subscription_id?: string;
|
|
14
|
-
click_id?: string;
|
|
15
|
-
link_id?: string;
|
|
16
|
-
partner_id?: string;
|
|
17
|
-
lead_at?: string | null;
|
|
18
|
-
active_at?: string | null;
|
|
19
|
-
}
|
|
20
|
-
export declare namespace CreateCustomersRequest {
|
|
21
|
-
const Status: {
|
|
22
|
-
readonly Lead: "lead";
|
|
23
|
-
readonly Active: "active";
|
|
24
|
-
readonly Canceled: "canceled";
|
|
25
|
-
readonly Suspended: "suspended";
|
|
26
|
-
readonly Trialing: "trialing";
|
|
27
|
-
};
|
|
28
|
-
type Status = (typeof Status)[keyof typeof Status];
|
|
29
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var CreateCustomersRequest;
|
|
3
|
-
(function (CreateCustomersRequest) {
|
|
4
|
-
CreateCustomersRequest.Status = {
|
|
5
|
-
Lead: "lead",
|
|
6
|
-
Active: "active",
|
|
7
|
-
Canceled: "canceled",
|
|
8
|
-
Suspended: "suspended",
|
|
9
|
-
Trialing: "trialing",
|
|
10
|
-
};
|
|
11
|
-
})(CreateCustomersRequest || (CreateCustomersRequest = {}));
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {
|
|
4
|
-
* id: "id"
|
|
5
|
-
* }
|
|
6
|
-
*/
|
|
7
|
-
export interface UpdateCustomersRequest {
|
|
8
|
-
id: string;
|
|
9
|
-
email?: string;
|
|
10
|
-
/** Resolve a code in the partner’s program, preferring partner, group, then program scope. An unmatched code leaves attribution unchanged. Null clears the promotion code and its derived attribution. */
|
|
11
|
-
promotion_code?: string | null;
|
|
12
|
-
created_at?: string;
|
|
13
|
-
name?: string | null;
|
|
14
|
-
status?: UpdateCustomersRequest.Status | null;
|
|
15
|
-
customer_id?: string;
|
|
16
|
-
subscription_id?: string | null;
|
|
17
|
-
click_id?: string | null;
|
|
18
|
-
link_id?: string | null;
|
|
19
|
-
lead_at?: string | null;
|
|
20
|
-
active_at?: string | null;
|
|
21
|
-
}
|
|
22
|
-
export declare namespace UpdateCustomersRequest {
|
|
23
|
-
const Status: {
|
|
24
|
-
readonly Lead: "lead";
|
|
25
|
-
readonly Active: "active";
|
|
26
|
-
readonly Canceled: "canceled";
|
|
27
|
-
readonly Suspended: "suspended";
|
|
28
|
-
readonly Trialing: "trialing";
|
|
29
|
-
};
|
|
30
|
-
type Status = (typeof Status)[keyof typeof Status];
|
|
31
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var UpdateCustomersRequest;
|
|
3
|
-
(function (UpdateCustomersRequest) {
|
|
4
|
-
UpdateCustomersRequest.Status = {
|
|
5
|
-
Lead: "lead",
|
|
6
|
-
Active: "active",
|
|
7
|
-
Canceled: "canceled",
|
|
8
|
-
Suspended: "suspended",
|
|
9
|
-
Trialing: "trialing",
|
|
10
|
-
};
|
|
11
|
-
})(UpdateCustomersRequest || (UpdateCustomersRequest = {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {}
|
|
4
|
-
*/
|
|
5
|
-
export interface CreateTokenEmbedRequest {
|
|
6
|
-
partner_id?: string;
|
|
7
|
-
partner?: CreateTokenEmbedRequest.Partner;
|
|
8
|
-
}
|
|
9
|
-
export declare namespace CreateTokenEmbedRequest {
|
|
10
|
-
interface Partner {
|
|
11
|
-
email: string;
|
|
12
|
-
program_id: string;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { CreateTokenEmbedRequest } from "./CreateTokenEmbedRequest.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./CreateTokenEmbedResponse.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./CreateTokenEmbedResponse.js";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @example
|
|
3
|
-
* {
|
|
4
|
-
* email: "sam@acme.com",
|
|
5
|
-
* program_id: "prg_YRsbPDAK"
|
|
6
|
-
* }
|
|
7
|
-
*/
|
|
8
|
-
export interface CreatePartnersRequest {
|
|
9
|
-
/** Unique within the program, compared case-insensitively. */
|
|
10
|
-
email: string;
|
|
11
|
-
program_id: string;
|
|
12
|
-
first_name?: string;
|
|
13
|
-
last_name?: string;
|
|
14
|
-
/** Overrides the name shown for the partner; defaults to the first and last name. */
|
|
15
|
-
display_name?: string;
|
|
16
|
-
company_name?: string;
|
|
17
|
-
/** Two-letter ISO country code. */
|
|
18
|
-
country_code?: string;
|
|
19
|
-
website_url?: string;
|
|
20
|
-
/** Backdate the partner's creation time. Defaults to now. */
|
|
21
|
-
created_at?: string;
|
|
22
|
-
/** Group in the program. Defaults to the program's default group. */
|
|
23
|
-
group_id?: string;
|
|
24
|
-
status?: CreatePartnersRequest.Status;
|
|
25
|
-
/** The referral link created with the partner. Defaults to a slug of the name or email. */
|
|
26
|
-
link?: CreatePartnersRequest.Link;
|
|
27
|
-
/** Send the partner the program's welcome email. Only goes out when the program's welcome email is enabled and the partner is active. */
|
|
28
|
-
notify_partner?: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare namespace CreatePartnersRequest {
|
|
31
|
-
const Status: {
|
|
32
|
-
readonly Active: "active";
|
|
33
|
-
readonly Pending: "pending";
|
|
34
|
-
};
|
|
35
|
-
type Status = (typeof Status)[keyof typeof Status];
|
|
36
|
-
/**
|
|
37
|
-
* The referral link created with the partner. Defaults to a slug of the name or email.
|
|
38
|
-
*/
|
|
39
|
-
interface Link {
|
|
40
|
-
/** The slug after the parameter, e.g. `sam` in `?ref=sam`. */
|
|
41
|
-
value: string;
|
|
42
|
-
/** Defaults to the program's first link parameter. */
|
|
43
|
-
param?: string | undefined;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export var CreatePartnersRequest;
|
|
3
|
-
(function (CreatePartnersRequest) {
|
|
4
|
-
CreatePartnersRequest.Status = {
|
|
5
|
-
Active: "active",
|
|
6
|
-
Pending: "pending",
|
|
7
|
-
};
|
|
8
|
-
})(CreatePartnersRequest || (CreatePartnersRequest = {}));
|