@tolt/api 0.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/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +39 -0
- package/dist/BaseClient.d.ts +54 -0
- package/dist/BaseClient.js +43 -0
- package/dist/Client.d.ts +56 -0
- package/dist/Client.js +73 -0
- package/dist/api/errors/BadRequestError.d.ts +7 -0
- package/dist/api/errors/BadRequestError.js +17 -0
- package/dist/api/errors/ConflictError.d.ts +7 -0
- package/dist/api/errors/ConflictError.js +17 -0
- package/dist/api/errors/NotFoundError.d.ts +7 -0
- package/dist/api/errors/NotFoundError.js +17 -0
- package/dist/api/errors/UnauthorizedError.d.ts +7 -0
- package/dist/api/errors/UnauthorizedError.js +17 -0
- package/dist/api/errors/index.d.ts +4 -0
- package/dist/api/errors/index.js +4 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/resources/clicks/client/Client.d.ts +43 -0
- package/dist/api/resources/clicks/client/Client.js +132 -0
- package/dist/api/resources/clicks/client/index.d.ts +1 -0
- package/dist/api/resources/clicks/client/index.js +1 -0
- package/dist/api/resources/clicks/client/requests/GetClickRequest.d.ts +9 -0
- package/dist/api/resources/clicks/client/requests/GetClickRequest.js +2 -0
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +16 -0
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.js +2 -0
- package/dist/api/resources/clicks/client/requests/index.d.ts +2 -0
- package/dist/api/resources/clicks/client/requests/index.js +1 -0
- package/dist/api/resources/clicks/exports.d.ts +2 -0
- package/dist/api/resources/clicks/exports.js +3 -0
- package/dist/api/resources/clicks/index.d.ts +2 -0
- package/dist/api/resources/clicks/index.js +2 -0
- package/dist/api/resources/clicks/types/GetClickResponse.d.ts +6 -0
- package/dist/api/resources/clicks/types/GetClickResponse.js +2 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +5 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +5 -0
- package/dist/api/resources/clicks/types/ListClicksResponse.d.ts +7 -0
- package/dist/api/resources/clicks/types/ListClicksResponse.js +2 -0
- package/dist/api/resources/clicks/types/index.d.ts +3 -0
- package/dist/api/resources/clicks/types/index.js +3 -0
- package/dist/api/resources/commissions/client/Client.d.ts +132 -0
- package/dist/api/resources/commissions/client/Client.js +431 -0
- package/dist/api/resources/commissions/client/index.d.ts +1 -0
- package/dist/api/resources/commissions/client/index.js +1 -0
- package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/ApproveCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/DeclineCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/DeleteCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/GetCommissionRequest.d.ts +9 -0
- package/dist/api/resources/commissions/client/requests/GetCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +17 -0
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +18 -0
- package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/client/requests/index.d.ts +6 -0
- package/dist/api/resources/commissions/client/requests/index.js +1 -0
- package/dist/api/resources/commissions/exports.d.ts +2 -0
- package/dist/api/resources/commissions/exports.js +3 -0
- package/dist/api/resources/commissions/index.d.ts +2 -0
- package/dist/api/resources/commissions/index.js +2 -0
- package/dist/api/resources/commissions/types/ApproveCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/ApproveCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/CreateCommissionRequest.d.ts +1 -0
- package/dist/api/resources/commissions/types/CreateCommissionRequest.js +2 -0
- package/dist/api/resources/commissions/types/CreateCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/CreateCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/DeclineCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/DeclineCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/DeleteCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/DeleteCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/GetCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/GetCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +5 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +5 -0
- package/dist/api/resources/commissions/types/ListCommissionsResponse.d.ts +7 -0
- package/dist/api/resources/commissions/types/ListCommissionsResponse.js +2 -0
- package/dist/api/resources/commissions/types/UpdateCommissionResponse.d.ts +6 -0
- package/dist/api/resources/commissions/types/UpdateCommissionResponse.js +2 -0
- package/dist/api/resources/commissions/types/index.d.ts +9 -0
- package/dist/api/resources/commissions/types/index.js +9 -0
- package/dist/api/resources/customers/client/Client.d.ts +92 -0
- package/dist/api/resources/customers/client/Client.js +299 -0
- package/dist/api/resources/customers/client/index.d.ts +1 -0
- package/dist/api/resources/customers/client/index.js +1 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomerRequest.js +2 -0
- package/dist/api/resources/customers/client/requests/GetCustomerRequest.d.ts +9 -0
- package/dist/api/resources/customers/client/requests/GetCustomerRequest.js +2 -0
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +15 -0
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.js +2 -0
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +18 -0
- package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.js +2 -0
- package/dist/api/resources/customers/client/requests/index.d.ts +4 -0
- package/dist/api/resources/customers/client/requests/index.js +1 -0
- package/dist/api/resources/customers/exports.d.ts +2 -0
- package/dist/api/resources/customers/exports.js +3 -0
- package/dist/api/resources/customers/index.d.ts +2 -0
- package/dist/api/resources/customers/index.js +2 -0
- package/dist/api/resources/customers/types/CreateCustomerRequest.d.ts +1 -0
- package/dist/api/resources/customers/types/CreateCustomerRequest.js +2 -0
- package/dist/api/resources/customers/types/CreateCustomerResponse.d.ts +6 -0
- package/dist/api/resources/customers/types/CreateCustomerResponse.js +2 -0
- package/dist/api/resources/customers/types/DeleteCustomerResponse.d.ts +6 -0
- package/dist/api/resources/customers/types/DeleteCustomerResponse.js +2 -0
- package/dist/api/resources/customers/types/GetCustomerResponse.d.ts +6 -0
- package/dist/api/resources/customers/types/GetCustomerResponse.js +2 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +5 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +5 -0
- package/dist/api/resources/customers/types/ListCustomersResponse.d.ts +7 -0
- package/dist/api/resources/customers/types/ListCustomersResponse.js +2 -0
- package/dist/api/resources/customers/types/UpdateCustomerResponse.d.ts +6 -0
- package/dist/api/resources/customers/types/UpdateCustomerResponse.js +2 -0
- package/dist/api/resources/customers/types/index.d.ts +7 -0
- package/dist/api/resources/customers/types/index.js +7 -0
- package/dist/api/resources/flows/client/Client.d.ts +43 -0
- package/dist/api/resources/flows/client/Client.js +132 -0
- package/dist/api/resources/flows/client/index.d.ts +1 -0
- package/dist/api/resources/flows/client/index.js +1 -0
- package/dist/api/resources/flows/client/requests/GetFlowRequest.d.ts +9 -0
- package/dist/api/resources/flows/client/requests/GetFlowRequest.js +2 -0
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +16 -0
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.js +2 -0
- package/dist/api/resources/flows/client/requests/index.d.ts +2 -0
- package/dist/api/resources/flows/client/requests/index.js +1 -0
- package/dist/api/resources/flows/exports.d.ts +2 -0
- package/dist/api/resources/flows/exports.js +3 -0
- package/dist/api/resources/flows/index.d.ts +2 -0
- package/dist/api/resources/flows/index.js +2 -0
- package/dist/api/resources/flows/types/GetFlowResponse.d.ts +6 -0
- package/dist/api/resources/flows/types/GetFlowResponse.js +2 -0
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +5 -0
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +5 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +5 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +5 -0
- package/dist/api/resources/flows/types/ListFlowsResponse.d.ts +7 -0
- package/dist/api/resources/flows/types/ListFlowsResponse.js +2 -0
- package/dist/api/resources/flows/types/index.d.ts +4 -0
- package/dist/api/resources/flows/types/index.js +4 -0
- package/dist/api/resources/groups/client/Client.d.ts +43 -0
- package/dist/api/resources/groups/client/Client.js +129 -0
- package/dist/api/resources/groups/client/index.d.ts +1 -0
- package/dist/api/resources/groups/client/index.js +1 -0
- package/dist/api/resources/groups/client/requests/GetGroupRequest.d.ts +9 -0
- package/dist/api/resources/groups/client/requests/GetGroupRequest.js +2 -0
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +13 -0
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.js +2 -0
- package/dist/api/resources/groups/client/requests/index.d.ts +2 -0
- package/dist/api/resources/groups/client/requests/index.js +1 -0
- package/dist/api/resources/groups/exports.d.ts +2 -0
- package/dist/api/resources/groups/exports.js +3 -0
- package/dist/api/resources/groups/index.d.ts +2 -0
- package/dist/api/resources/groups/index.js +2 -0
- package/dist/api/resources/groups/types/GetGroupResponse.d.ts +6 -0
- package/dist/api/resources/groups/types/GetGroupResponse.js +2 -0
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +5 -0
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +5 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +5 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +5 -0
- package/dist/api/resources/groups/types/ListGroupsResponse.d.ts +7 -0
- package/dist/api/resources/groups/types/ListGroupsResponse.js +2 -0
- package/dist/api/resources/groups/types/index.d.ts +4 -0
- package/dist/api/resources/groups/types/index.js +4 -0
- package/dist/api/resources/index.d.ts +33 -0
- package/dist/api/resources/index.js +33 -0
- package/dist/api/resources/links/client/Client.d.ts +93 -0
- package/dist/api/resources/links/client/Client.js +298 -0
- package/dist/api/resources/links/client/index.d.ts +1 -0
- package/dist/api/resources/links/client/index.js +1 -0
- package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +12 -0
- package/dist/api/resources/links/client/requests/CreateLinkRequest.js +2 -0
- package/dist/api/resources/links/client/requests/DeleteLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/DeleteLinkRequest.js +2 -0
- package/dist/api/resources/links/client/requests/GetLinkRequest.d.ts +9 -0
- package/dist/api/resources/links/client/requests/GetLinkRequest.js +2 -0
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +13 -0
- package/dist/api/resources/links/client/requests/ListLinksRequest.js +2 -0
- package/dist/api/resources/links/client/requests/UpdateLinkRequest.d.ts +11 -0
- package/dist/api/resources/links/client/requests/UpdateLinkRequest.js +2 -0
- package/dist/api/resources/links/client/requests/index.d.ts +5 -0
- package/dist/api/resources/links/client/requests/index.js +1 -0
- package/dist/api/resources/links/exports.d.ts +2 -0
- package/dist/api/resources/links/exports.js +3 -0
- package/dist/api/resources/links/index.d.ts +2 -0
- package/dist/api/resources/links/index.js +2 -0
- package/dist/api/resources/links/types/CreateLinkResponse.d.ts +6 -0
- package/dist/api/resources/links/types/CreateLinkResponse.js +2 -0
- package/dist/api/resources/links/types/DeleteLinkResponse.d.ts +6 -0
- package/dist/api/resources/links/types/DeleteLinkResponse.js +2 -0
- package/dist/api/resources/links/types/GetLinkResponse.d.ts +6 -0
- package/dist/api/resources/links/types/GetLinkResponse.js +2 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +5 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.js +5 -0
- package/dist/api/resources/links/types/ListLinksResponse.d.ts +7 -0
- package/dist/api/resources/links/types/ListLinksResponse.js +2 -0
- package/dist/api/resources/links/types/UpdateLinkResponse.d.ts +6 -0
- package/dist/api/resources/links/types/UpdateLinkResponse.js +2 -0
- package/dist/api/resources/links/types/index.d.ts +6 -0
- package/dist/api/resources/links/types/index.js +6 -0
- package/dist/api/resources/partners/client/Client.d.ts +93 -0
- package/dist/api/resources/partners/client/Client.js +302 -0
- package/dist/api/resources/partners/client/index.d.ts +1 -0
- package/dist/api/resources/partners/client/index.js +1 -0
- package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/ApprovePartnerRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/GetPartnerRequest.d.ts +9 -0
- package/dist/api/resources/partners/client/requests/GetPartnerRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +14 -0
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +10 -0
- package/dist/api/resources/partners/client/requests/RejectPartnerRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +10 -0
- package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.js +2 -0
- package/dist/api/resources/partners/client/requests/index.d.ts +5 -0
- package/dist/api/resources/partners/client/requests/index.js +1 -0
- package/dist/api/resources/partners/exports.d.ts +2 -0
- package/dist/api/resources/partners/exports.js +3 -0
- package/dist/api/resources/partners/index.d.ts +2 -0
- package/dist/api/resources/partners/index.js +2 -0
- package/dist/api/resources/partners/types/ApprovePartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/ApprovePartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/GetPartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/GetPartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +5 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +5 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +7 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +7 -0
- package/dist/api/resources/partners/types/ListPartnersResponse.d.ts +7 -0
- package/dist/api/resources/partners/types/ListPartnersResponse.js +2 -0
- package/dist/api/resources/partners/types/RejectPartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/RejectPartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/SuspendPartnerResponse.d.ts +6 -0
- package/dist/api/resources/partners/types/SuspendPartnerResponse.js +2 -0
- package/dist/api/resources/partners/types/index.d.ts +7 -0
- package/dist/api/resources/partners/types/index.js +7 -0
- package/dist/api/resources/programs/client/Client.d.ts +43 -0
- package/dist/api/resources/programs/client/Client.js +127 -0
- package/dist/api/resources/programs/client/index.d.ts +1 -0
- package/dist/api/resources/programs/client/index.js +1 -0
- package/dist/api/resources/programs/client/requests/GetProgramRequest.d.ts +9 -0
- package/dist/api/resources/programs/client/requests/GetProgramRequest.js +2 -0
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +11 -0
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.js +2 -0
- package/dist/api/resources/programs/client/requests/index.d.ts +2 -0
- package/dist/api/resources/programs/client/requests/index.js +1 -0
- package/dist/api/resources/programs/exports.d.ts +2 -0
- package/dist/api/resources/programs/exports.js +3 -0
- package/dist/api/resources/programs/index.d.ts +2 -0
- package/dist/api/resources/programs/index.js +2 -0
- package/dist/api/resources/programs/types/GetProgramResponse.d.ts +6 -0
- package/dist/api/resources/programs/types/GetProgramResponse.js +2 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +5 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +5 -0
- package/dist/api/resources/programs/types/ListProgramsResponse.d.ts +7 -0
- package/dist/api/resources/programs/types/ListProgramsResponse.js +2 -0
- package/dist/api/resources/programs/types/index.d.ts +3 -0
- package/dist/api/resources/programs/types/index.js +3 -0
- package/dist/api/resources/promotionCodes/client/Client.d.ts +93 -0
- package/dist/api/resources/promotionCodes/client/Client.js +299 -0
- package/dist/api/resources/promotionCodes/client/index.d.ts +1 -0
- package/dist/api/resources/promotionCodes/client/index.js +1 -0
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +13 -0
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.js +2 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodeRequest.js +2 -0
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.d.ts +9 -0
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodeRequest.js +2 -0
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +14 -0
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.js +2 -0
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.d.ts +12 -0
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodeRequest.js +2 -0
- package/dist/api/resources/promotionCodes/client/requests/index.d.ts +5 -0
- package/dist/api/resources/promotionCodes/client/requests/index.js +1 -0
- package/dist/api/resources/promotionCodes/exports.d.ts +2 -0
- package/dist/api/resources/promotionCodes/exports.js +3 -0
- package/dist/api/resources/promotionCodes/index.d.ts +2 -0
- package/dist/api/resources/promotionCodes/index.js +2 -0
- package/dist/api/resources/promotionCodes/types/CreatePromotionCodeResponse.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/CreatePromotionCodeResponse.js +2 -0
- package/dist/api/resources/promotionCodes/types/DeletePromotionCodeResponse.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/DeletePromotionCodeResponse.js +2 -0
- package/dist/api/resources/promotionCodes/types/GetPromotionCodeResponse.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/GetPromotionCodeResponse.js +2 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +5 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +5 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.d.ts +7 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.js +2 -0
- package/dist/api/resources/promotionCodes/types/UpdatePromotionCodeResponse.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/UpdatePromotionCodeResponse.js +2 -0
- package/dist/api/resources/promotionCodes/types/index.d.ts +6 -0
- package/dist/api/resources/promotionCodes/types/index.js +6 -0
- package/dist/api/resources/reports/client/Client.d.ts +29 -0
- package/dist/api/resources/reports/client/Client.js +75 -0
- package/dist/api/resources/reports/client/index.d.ts +1 -0
- package/dist/api/resources/reports/client/index.js +1 -0
- package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.d.ts +9 -0
- package/dist/api/resources/reports/client/requests/ReportsOverviewRequest.js +2 -0
- package/dist/api/resources/reports/client/requests/index.d.ts +1 -0
- package/dist/api/resources/reports/client/requests/index.js +1 -0
- package/dist/api/resources/reports/exports.d.ts +2 -0
- package/dist/api/resources/reports/exports.js +3 -0
- package/dist/api/resources/reports/index.d.ts +2 -0
- package/dist/api/resources/reports/index.js +2 -0
- package/dist/api/resources/reports/types/ReportsOverviewResponse.d.ts +6 -0
- package/dist/api/resources/reports/types/ReportsOverviewResponse.js +2 -0
- package/dist/api/resources/reports/types/index.d.ts +1 -0
- package/dist/api/resources/reports/types/index.js +1 -0
- package/dist/api/resources/transactions/client/Client.d.ts +131 -0
- package/dist/api/resources/transactions/client/Client.js +423 -0
- package/dist/api/resources/transactions/client/index.d.ts +1 -0
- package/dist/api/resources/transactions/client/index.js +1 -0
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +17 -0
- package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/DeleteTransactionRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/GetTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/GetTransactionRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +15 -0
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/RefundTransactionRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.d.ts +9 -0
- package/dist/api/resources/transactions/client/requests/RerunTransactionFlowsRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +18 -0
- package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.js +2 -0
- package/dist/api/resources/transactions/client/requests/index.d.ts +7 -0
- package/dist/api/resources/transactions/client/requests/index.js +1 -0
- package/dist/api/resources/transactions/exports.d.ts +2 -0
- package/dist/api/resources/transactions/exports.js +3 -0
- package/dist/api/resources/transactions/index.d.ts +2 -0
- package/dist/api/resources/transactions/index.js +2 -0
- package/dist/api/resources/transactions/types/CreateTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/CreateTransactionResponse.js +2 -0
- package/dist/api/resources/transactions/types/DeleteTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/DeleteTransactionResponse.js +2 -0
- package/dist/api/resources/transactions/types/GetTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/GetTransactionResponse.js +2 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +5 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +5 -0
- package/dist/api/resources/transactions/types/ListTransactionsResponse.d.ts +7 -0
- package/dist/api/resources/transactions/types/ListTransactionsResponse.js +2 -0
- package/dist/api/resources/transactions/types/RefundTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/RefundTransactionResponse.js +2 -0
- package/dist/api/resources/transactions/types/RerunTransactionFlowsResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/RerunTransactionFlowsResponse.js +2 -0
- package/dist/api/resources/transactions/types/UpdateTransactionResponse.d.ts +6 -0
- package/dist/api/resources/transactions/types/UpdateTransactionResponse.js +2 -0
- package/dist/api/resources/transactions/types/index.d.ts +8 -0
- package/dist/api/resources/transactions/types/index.js +8 -0
- package/dist/api/types/Click.d.ts +14 -0
- package/dist/api/types/Click.js +2 -0
- package/dist/api/types/Commission.d.ts +24 -0
- package/dist/api/types/Commission.js +2 -0
- package/dist/api/types/Customer.d.ts +19 -0
- package/dist/api/types/Customer.js +2 -0
- package/dist/api/types/Error_.d.ts +4 -0
- package/dist/api/types/Error_.js +2 -0
- package/dist/api/types/Flow.d.ts +18 -0
- package/dist/api/types/Flow.js +2 -0
- package/dist/api/types/Group.d.ts +14 -0
- package/dist/api/types/Group.js +2 -0
- package/dist/api/types/Link.d.ts +11 -0
- package/dist/api/types/Link.js +2 -0
- package/dist/api/types/Partner.d.ts +13 -0
- package/dist/api/types/Partner.js +2 -0
- package/dist/api/types/Program.d.ts +15 -0
- package/dist/api/types/Program.js +2 -0
- package/dist/api/types/PromotionCode.d.ts +16 -0
- package/dist/api/types/PromotionCode.js +2 -0
- package/dist/api/types/ReportsOverview.d.ts +30 -0
- package/dist/api/types/ReportsOverview.js +2 -0
- package/dist/api/types/RerunFlowsResult.d.ts +4 -0
- package/dist/api/types/RerunFlowsResult.js +2 -0
- package/dist/api/types/Transaction.d.ts +32 -0
- package/dist/api/types/Transaction.js +2 -0
- package/dist/api/types/index.d.ts +13 -0
- package/dist/api/types/index.js +13 -0
- package/dist/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/auth/BearerAuthProvider.js +31 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/core/auth/AuthProvider.d.ts +8 -0
- package/dist/core/auth/AuthProvider.js +6 -0
- package/dist/core/auth/AuthRequest.d.ts +9 -0
- package/dist/core/auth/AuthRequest.js +1 -0
- package/dist/core/auth/BasicAuth.d.ts +8 -0
- package/dist/core/auth/BasicAuth.js +29 -0
- package/dist/core/auth/BearerToken.d.ts +7 -0
- package/dist/core/auth/BearerToken.js +13 -0
- package/dist/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/core/auth/NoOpAuthProvider.js +5 -0
- package/dist/core/auth/index.d.ts +5 -0
- package/dist/core/auth/index.js +4 -0
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/base64.js +22 -0
- package/dist/core/exports.d.ts +1 -0
- package/dist/core/exports.js +1 -0
- package/dist/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/core/fetcher/APIResponse.js +1 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/core/fetcher/BinaryResponse.js +14 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/core/fetcher/EndpointMetadata.js +1 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/core/fetcher/EndpointSupplier.js +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +56 -0
- package/dist/core/fetcher/Fetcher.js +223 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +82 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +88 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +40 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +10 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +5 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +30 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/core/fetcher/getFetchFn.js +3 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +8 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +13 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +66 -0
- package/dist/core/fetcher/index.d.ts +13 -0
- package/dist/core/fetcher/index.js +7 -0
- package/dist/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/core/fetcher/makePassthroughRequest.js +141 -0
- package/dist/core/fetcher/makeRequest.d.ts +6 -0
- package/dist/core/fetcher/makeRequest.js +53 -0
- package/dist/core/fetcher/redactUrl.d.ts +2 -0
- package/dist/core/fetcher/redactUrl.js +84 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +56 -0
- package/dist/core/fetcher/signals.d.ts +5 -0
- package/dist/core/fetcher/signals.js +28 -0
- package/dist/core/headers.d.ts +2 -0
- package/dist/core/headers.js +27 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +19 -0
- package/dist/core/logging/exports.d.ts +18 -0
- package/dist/core/logging/exports.js +9 -0
- package/dist/core/logging/index.d.ts +1 -0
- package/dist/core/logging/index.js +1 -0
- package/dist/core/logging/logger.d.ts +126 -0
- package/dist/core/logging/logger.js +137 -0
- package/dist/core/requestBody.d.ts +12 -0
- package/dist/core/requestBody.js +23 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +1 -0
- package/dist/core/runtime/runtime.d.ts +28 -0
- package/dist/core/runtime/runtime.js +171 -0
- package/dist/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/core/url/QueryStringBuilder.js +80 -0
- package/dist/core/url/encodePathParam.d.ts +1 -0
- package/dist/core/url/encodePathParam.js +18 -0
- package/dist/core/url/index.d.ts +4 -0
- package/dist/core/url/index.js +4 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +65 -0
- package/dist/core/url/qs.d.ts +7 -0
- package/dist/core/url/qs.js +76 -0
- package/dist/environments.d.ts +4 -0
- package/dist/environments.js +4 -0
- package/dist/errors/ToltApiError.d.ts +15 -0
- package/dist/errors/ToltApiError.js +34 -0
- package/dist/errors/ToltApiTimeoutError.d.ts +6 -0
- package/dist/errors/ToltApiTimeoutError.js +15 -0
- package/dist/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/errors/handleNonStatusCodeError.js +32 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +2 -0
- package/dist/exports.d.ts +1 -0
- package/dist/exports.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/package.json +44 -0
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import { mergeHeaders } from "../../../../core/headers.js";
|
|
4
|
+
import * as core from "../../../../core/index.js";
|
|
5
|
+
import { mergeAdditionalBodyParameters } from "../../../../core/requestBody.js";
|
|
6
|
+
import * as environments from "../../../../environments.js";
|
|
7
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
|
|
8
|
+
import * as errors from "../../../../errors/index.js";
|
|
9
|
+
import * as ToltApi from "../../../index.js";
|
|
10
|
+
export class CommissionsClient {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {ToltApi.ListCommissionsRequest} request
|
|
16
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
19
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
20
|
+
* @throws {@link errors.ToltApiError}
|
|
21
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.commissions.listCommissions()
|
|
25
|
+
*/
|
|
26
|
+
listCommissions(request = {}, requestOptions) {
|
|
27
|
+
return core.HttpResponsePromise.fromPromise(this.__listCommissions(request, requestOptions));
|
|
28
|
+
}
|
|
29
|
+
async __listCommissions(request = {}, requestOptions) {
|
|
30
|
+
const { limit, order, starting_after: startingAfter, program_id: programId, partner_id: partnerId, customer_id: customerId, transaction_id: transactionId, status, type: type_, search, } = request;
|
|
31
|
+
const _queryParams = {
|
|
32
|
+
limit,
|
|
33
|
+
order: order != null ? order : undefined,
|
|
34
|
+
starting_after: startingAfter,
|
|
35
|
+
program_id: programId,
|
|
36
|
+
partner_id: partnerId,
|
|
37
|
+
customer_id: customerId,
|
|
38
|
+
transaction_id: transactionId,
|
|
39
|
+
status,
|
|
40
|
+
type: type_,
|
|
41
|
+
search,
|
|
42
|
+
};
|
|
43
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
44
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
45
|
+
const _response = await core.fetcher({
|
|
46
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
47
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
48
|
+
environments.ToltApiEnvironment.Production, "v2/commissions"),
|
|
49
|
+
method: "GET",
|
|
50
|
+
headers: _headers,
|
|
51
|
+
queryString: core.url
|
|
52
|
+
.queryBuilder()
|
|
53
|
+
.addMany(_queryParams)
|
|
54
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
55
|
+
.build(),
|
|
56
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
57
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
58
|
+
abortSignal: requestOptions?.abortSignal,
|
|
59
|
+
fetchFn: this._options?.fetch,
|
|
60
|
+
logging: this._options.logging,
|
|
61
|
+
});
|
|
62
|
+
if (_response.ok) {
|
|
63
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
64
|
+
}
|
|
65
|
+
if (_response.error.reason === "status-code") {
|
|
66
|
+
switch (_response.error.statusCode) {
|
|
67
|
+
case 400:
|
|
68
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
69
|
+
case 401:
|
|
70
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
71
|
+
default:
|
|
72
|
+
throw new errors.ToltApiError({
|
|
73
|
+
statusCode: _response.error.statusCode,
|
|
74
|
+
body: _response.error.body,
|
|
75
|
+
rawResponse: _response.rawResponse,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/commissions");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @param {ToltApi.CreateCommissionRequest} request
|
|
83
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
84
|
+
*
|
|
85
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
86
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
87
|
+
* @throws {@link ToltApi.ConflictError}
|
|
88
|
+
* @throws {@link errors.ToltApiError}
|
|
89
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* await client.commissions.createCommission({
|
|
93
|
+
* "key": "value"
|
|
94
|
+
* })
|
|
95
|
+
*/
|
|
96
|
+
createCommission(request, requestOptions) {
|
|
97
|
+
return core.HttpResponsePromise.fromPromise(this.__createCommission(request, requestOptions));
|
|
98
|
+
}
|
|
99
|
+
async __createCommission(request, requestOptions) {
|
|
100
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
101
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
102
|
+
const _response = await core.fetcher({
|
|
103
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
104
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
105
|
+
environments.ToltApiEnvironment.Production, "v2/commissions"),
|
|
106
|
+
method: "POST",
|
|
107
|
+
headers: _headers,
|
|
108
|
+
contentType: "application/json",
|
|
109
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
110
|
+
requestType: "json",
|
|
111
|
+
body: mergeAdditionalBodyParameters(request, requestOptions?.additionalBodyParameters),
|
|
112
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
113
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
114
|
+
abortSignal: requestOptions?.abortSignal,
|
|
115
|
+
fetchFn: this._options?.fetch,
|
|
116
|
+
logging: this._options.logging,
|
|
117
|
+
});
|
|
118
|
+
if (_response.ok) {
|
|
119
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
120
|
+
}
|
|
121
|
+
if (_response.error.reason === "status-code") {
|
|
122
|
+
switch (_response.error.statusCode) {
|
|
123
|
+
case 400:
|
|
124
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
125
|
+
case 401:
|
|
126
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 409:
|
|
128
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
129
|
+
default:
|
|
130
|
+
throw new errors.ToltApiError({
|
|
131
|
+
statusCode: _response.error.statusCode,
|
|
132
|
+
body: _response.error.body,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions");
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @param {ToltApi.GetCommissionRequest} request
|
|
141
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
142
|
+
*
|
|
143
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
144
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
145
|
+
* @throws {@link errors.ToltApiError}
|
|
146
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* await client.commissions.getCommission({
|
|
150
|
+
* id: "id"
|
|
151
|
+
* })
|
|
152
|
+
*/
|
|
153
|
+
getCommission(request, requestOptions) {
|
|
154
|
+
return core.HttpResponsePromise.fromPromise(this.__getCommission(request, requestOptions));
|
|
155
|
+
}
|
|
156
|
+
async __getCommission(request, requestOptions) {
|
|
157
|
+
const { id } = request;
|
|
158
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
159
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
160
|
+
const _response = await core.fetcher({
|
|
161
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
162
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
163
|
+
environments.ToltApiEnvironment.Production, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
164
|
+
method: "GET",
|
|
165
|
+
headers: _headers,
|
|
166
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
167
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
168
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
169
|
+
abortSignal: requestOptions?.abortSignal,
|
|
170
|
+
fetchFn: this._options?.fetch,
|
|
171
|
+
logging: this._options.logging,
|
|
172
|
+
});
|
|
173
|
+
if (_response.ok) {
|
|
174
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
175
|
+
}
|
|
176
|
+
if (_response.error.reason === "status-code") {
|
|
177
|
+
switch (_response.error.statusCode) {
|
|
178
|
+
case 401:
|
|
179
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
180
|
+
case 404:
|
|
181
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
182
|
+
default:
|
|
183
|
+
throw new errors.ToltApiError({
|
|
184
|
+
statusCode: _response.error.statusCode,
|
|
185
|
+
body: _response.error.body,
|
|
186
|
+
rawResponse: _response.rawResponse,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/commissions/{id}");
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* @param {ToltApi.UpdateCommissionRequest} request
|
|
194
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
195
|
+
*
|
|
196
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
197
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
198
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
199
|
+
* @throws {@link ToltApi.ConflictError}
|
|
200
|
+
* @throws {@link errors.ToltApiError}
|
|
201
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* await client.commissions.updateCommission({
|
|
205
|
+
* id: "id"
|
|
206
|
+
* })
|
|
207
|
+
*/
|
|
208
|
+
updateCommission(request, requestOptions) {
|
|
209
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCommission(request, requestOptions));
|
|
210
|
+
}
|
|
211
|
+
async __updateCommission(request, requestOptions) {
|
|
212
|
+
const { id, ..._body } = request;
|
|
213
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
214
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
215
|
+
const _response = await core.fetcher({
|
|
216
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
217
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
218
|
+
environments.ToltApiEnvironment.Production, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
219
|
+
method: "PUT",
|
|
220
|
+
headers: _headers,
|
|
221
|
+
contentType: "application/json",
|
|
222
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
223
|
+
requestType: "json",
|
|
224
|
+
body: mergeAdditionalBodyParameters(_body, requestOptions?.additionalBodyParameters),
|
|
225
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
226
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
227
|
+
abortSignal: requestOptions?.abortSignal,
|
|
228
|
+
fetchFn: this._options?.fetch,
|
|
229
|
+
logging: this._options.logging,
|
|
230
|
+
});
|
|
231
|
+
if (_response.ok) {
|
|
232
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
233
|
+
}
|
|
234
|
+
if (_response.error.reason === "status-code") {
|
|
235
|
+
switch (_response.error.statusCode) {
|
|
236
|
+
case 400:
|
|
237
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
238
|
+
case 401:
|
|
239
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
240
|
+
case 404:
|
|
241
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
242
|
+
case 409:
|
|
243
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
244
|
+
default:
|
|
245
|
+
throw new errors.ToltApiError({
|
|
246
|
+
statusCode: _response.error.statusCode,
|
|
247
|
+
body: _response.error.body,
|
|
248
|
+
rawResponse: _response.rawResponse,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/commissions/{id}");
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* @param {ToltApi.DeleteCommissionRequest} request
|
|
256
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
257
|
+
*
|
|
258
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
259
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
260
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
261
|
+
* @throws {@link ToltApi.ConflictError}
|
|
262
|
+
* @throws {@link errors.ToltApiError}
|
|
263
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* await client.commissions.deleteCommission({
|
|
267
|
+
* id: "id"
|
|
268
|
+
* })
|
|
269
|
+
*/
|
|
270
|
+
deleteCommission(request, requestOptions) {
|
|
271
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCommission(request, requestOptions));
|
|
272
|
+
}
|
|
273
|
+
async __deleteCommission(request, requestOptions) {
|
|
274
|
+
const { id } = request;
|
|
275
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
276
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
277
|
+
const _response = await core.fetcher({
|
|
278
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
279
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
280
|
+
environments.ToltApiEnvironment.Production, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
281
|
+
method: "DELETE",
|
|
282
|
+
headers: _headers,
|
|
283
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
284
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
285
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
286
|
+
abortSignal: requestOptions?.abortSignal,
|
|
287
|
+
fetchFn: this._options?.fetch,
|
|
288
|
+
logging: this._options.logging,
|
|
289
|
+
});
|
|
290
|
+
if (_response.ok) {
|
|
291
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
292
|
+
}
|
|
293
|
+
if (_response.error.reason === "status-code") {
|
|
294
|
+
switch (_response.error.statusCode) {
|
|
295
|
+
case 400:
|
|
296
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
297
|
+
case 401:
|
|
298
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
299
|
+
case 404:
|
|
300
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
301
|
+
case 409:
|
|
302
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
303
|
+
default:
|
|
304
|
+
throw new errors.ToltApiError({
|
|
305
|
+
statusCode: _response.error.statusCode,
|
|
306
|
+
body: _response.error.body,
|
|
307
|
+
rawResponse: _response.rawResponse,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v2/commissions/{id}");
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* @param {ToltApi.ApproveCommissionRequest} request
|
|
315
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
316
|
+
*
|
|
317
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
318
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
319
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
320
|
+
* @throws {@link ToltApi.ConflictError}
|
|
321
|
+
* @throws {@link errors.ToltApiError}
|
|
322
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
323
|
+
*
|
|
324
|
+
* @example
|
|
325
|
+
* await client.commissions.approveCommission({
|
|
326
|
+
* id: "id"
|
|
327
|
+
* })
|
|
328
|
+
*/
|
|
329
|
+
approveCommission(request, requestOptions) {
|
|
330
|
+
return core.HttpResponsePromise.fromPromise(this.__approveCommission(request, requestOptions));
|
|
331
|
+
}
|
|
332
|
+
async __approveCommission(request, requestOptions) {
|
|
333
|
+
const { id } = request;
|
|
334
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
335
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
336
|
+
const _response = await core.fetcher({
|
|
337
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
338
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
339
|
+
environments.ToltApiEnvironment.Production, `v2/commissions/${core.url.encodePathParam(id)}/approve`),
|
|
340
|
+
method: "POST",
|
|
341
|
+
headers: _headers,
|
|
342
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
343
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
344
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
345
|
+
abortSignal: requestOptions?.abortSignal,
|
|
346
|
+
fetchFn: this._options?.fetch,
|
|
347
|
+
logging: this._options.logging,
|
|
348
|
+
});
|
|
349
|
+
if (_response.ok) {
|
|
350
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
351
|
+
}
|
|
352
|
+
if (_response.error.reason === "status-code") {
|
|
353
|
+
switch (_response.error.statusCode) {
|
|
354
|
+
case 400:
|
|
355
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
356
|
+
case 401:
|
|
357
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
358
|
+
case 404:
|
|
359
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
360
|
+
case 409:
|
|
361
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
362
|
+
default:
|
|
363
|
+
throw new errors.ToltApiError({
|
|
364
|
+
statusCode: _response.error.statusCode,
|
|
365
|
+
body: _response.error.body,
|
|
366
|
+
rawResponse: _response.rawResponse,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions/{id}/approve");
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @param {ToltApi.DeclineCommissionRequest} request
|
|
374
|
+
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
375
|
+
*
|
|
376
|
+
* @throws {@link ToltApi.BadRequestError}
|
|
377
|
+
* @throws {@link ToltApi.UnauthorizedError}
|
|
378
|
+
* @throws {@link ToltApi.NotFoundError}
|
|
379
|
+
* @throws {@link ToltApi.ConflictError}
|
|
380
|
+
* @throws {@link errors.ToltApiError}
|
|
381
|
+
* @throws {@link errors.ToltApiTimeoutError}
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* await client.commissions.declineCommission({
|
|
385
|
+
* id: "id"
|
|
386
|
+
* })
|
|
387
|
+
*/
|
|
388
|
+
declineCommission(request, requestOptions) {
|
|
389
|
+
return core.HttpResponsePromise.fromPromise(this.__declineCommission(request, requestOptions));
|
|
390
|
+
}
|
|
391
|
+
async __declineCommission(request, requestOptions) {
|
|
392
|
+
const { id } = request;
|
|
393
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
394
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
395
|
+
const _response = await core.fetcher({
|
|
396
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
397
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
398
|
+
environments.ToltApiEnvironment.Production, `v2/commissions/${core.url.encodePathParam(id)}/decline`),
|
|
399
|
+
method: "POST",
|
|
400
|
+
headers: _headers,
|
|
401
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
402
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
403
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
404
|
+
abortSignal: requestOptions?.abortSignal,
|
|
405
|
+
fetchFn: this._options?.fetch,
|
|
406
|
+
logging: this._options.logging,
|
|
407
|
+
});
|
|
408
|
+
if (_response.ok) {
|
|
409
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
410
|
+
}
|
|
411
|
+
if (_response.error.reason === "status-code") {
|
|
412
|
+
switch (_response.error.statusCode) {
|
|
413
|
+
case 400:
|
|
414
|
+
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
415
|
+
case 401:
|
|
416
|
+
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
417
|
+
case 404:
|
|
418
|
+
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
419
|
+
case 409:
|
|
420
|
+
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
421
|
+
default:
|
|
422
|
+
throw new errors.ToltApiError({
|
|
423
|
+
statusCode: _response.error.statusCode,
|
|
424
|
+
body: _response.error.body,
|
|
425
|
+
rawResponse: _response.rawResponse,
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions/{id}/decline");
|
|
430
|
+
}
|
|
431
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as ToltApi from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface ListCommissionsRequest {
|
|
7
|
+
limit?: number;
|
|
8
|
+
order?: ToltApi.ListCommissionsRequestOrder;
|
|
9
|
+
starting_after?: string;
|
|
10
|
+
program_id?: string;
|
|
11
|
+
partner_id?: string;
|
|
12
|
+
customer_id?: string;
|
|
13
|
+
transaction_id?: string;
|
|
14
|
+
status?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
search?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* id: "id"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface UpdateCommissionRequest {
|
|
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
|
+
chargeId?: string | null;
|
|
16
|
+
transactionId?: string | null;
|
|
17
|
+
createdAt?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { ApproveCommissionRequest } from "./ApproveCommissionRequest.js";
|
|
2
|
+
export type { DeclineCommissionRequest } from "./DeclineCommissionRequest.js";
|
|
3
|
+
export type { DeleteCommissionRequest } from "./DeleteCommissionRequest.js";
|
|
4
|
+
export type { GetCommissionRequest } from "./GetCommissionRequest.js";
|
|
5
|
+
export type { ListCommissionsRequest } from "./ListCommissionsRequest.js";
|
|
6
|
+
export type { UpdateCommissionRequest } from "./UpdateCommissionRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type CreateCommissionRequest = unknown;
|