@paid-ai/paid-node 1.0.1-alpha2 → 1.0.1-alpha8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/cjs/BaseClient.d.ts +1 -1
- package/dist/cjs/Client.d.ts +9 -15
- package/dist/cjs/Client.js +17 -27
- package/dist/cjs/api/errors/BadRequestError.d.ts +1 -1
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -1
- package/dist/cjs/api/errors/InternalServerError.d.ts +1 -1
- package/dist/cjs/api/errors/NotFoundError.d.ts +1 -1
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +113 -31
- package/dist/cjs/api/resources/contacts/client/Client.js +341 -84
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +19 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsRequest.d.ts +8 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactByIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +8 -1
- package/dist/cjs/api/resources/customers/client/Client.d.ts +68 -140
- package/dist/cjs/api/resources/customers/client/Client.js +155 -521
- package/dist/cjs/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +20 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/ListCustomersRequest.d.ts +8 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +8 -5
- package/dist/cjs/api/resources/customers/index.d.ts +0 -1
- package/dist/cjs/api/resources/customers/index.js +0 -1
- package/dist/cjs/api/resources/index.d.ts +4 -10
- package/dist/cjs/api/resources/index.js +5 -11
- package/dist/cjs/api/resources/invoices/client/Client.d.ts +81 -0
- package/dist/cjs/api/resources/{usage → invoices}/client/Client.js +170 -77
- package/dist/cjs/api/resources/invoices/client/requests/GetInvoiceByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/invoices/client/requests/GetInvoiceLinesRequest.d.ts +11 -0
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesRequest.d.ts +8 -0
- package/dist/cjs/api/resources/invoices/client/requests/UpdateInvoiceRequest.d.ts +10 -0
- package/dist/cjs/api/resources/invoices/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/orders/client/Client.d.ts +49 -91
- package/dist/cjs/api/resources/orders/client/Client.js +142 -267
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +22 -0
- package/dist/cjs/api/resources/orders/client/requests/DeleteOrderByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/orders/client/requests/GetOrderByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/orders/client/requests/GetOrderLinesRequest.d.ts +11 -0
- package/dist/cjs/api/resources/orders/client/requests/ListOrdersRequest.d.ts +8 -0
- package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.d.ts +22 -0
- package/dist/cjs/api/resources/orders/client/requests/index.d.ts +6 -4
- package/dist/cjs/api/resources/orders/index.d.ts +0 -1
- package/dist/cjs/api/resources/orders/index.js +0 -1
- package/dist/cjs/api/resources/products/client/Client.d.ts +74 -48
- package/dist/cjs/api/resources/products/client/Client.js +195 -184
- package/dist/cjs/api/resources/products/client/requests/CreateProductRequest.d.ts +14 -0
- package/dist/cjs/api/resources/products/client/requests/GetProductByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/products/client/requests/GetProductByIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/products/client/requests/ListProductsRequest.d.ts +8 -0
- package/dist/cjs/api/resources/products/client/requests/UpdateProductByExternalIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/products/client/requests/UpdateProductByIdRequest.d.ts +12 -0
- package/dist/cjs/api/resources/products/client/requests/index.d.ts +6 -1
- package/dist/cjs/api/resources/signals/client/Client.d.ts +36 -0
- package/dist/cjs/api/resources/{traces → signals}/client/Client.js +30 -54
- package/dist/cjs/api/resources/signals/client/requests/BulkSignalsRequest.d.ts +15 -0
- package/dist/cjs/api/resources/signals/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/Attribution.d.ts +2 -0
- package/dist/cjs/api/types/BulkSignalsResponse.d.ts +5 -0
- package/dist/cjs/api/types/Contact.d.ts +10 -15
- package/dist/cjs/api/types/ContactBillingAddress.d.ts +7 -0
- package/dist/cjs/api/types/ContactListResponse.d.ts +5 -0
- package/dist/cjs/api/types/Customer.d.ts +13 -12
- package/dist/cjs/api/types/CustomerAttribution.d.ts +2 -0
- package/dist/cjs/api/types/CustomerBillingAddress.d.ts +8 -0
- package/dist/cjs/api/types/CustomerByExternalId.d.ts +4 -0
- package/dist/cjs/api/types/CustomerById.d.ts +4 -0
- package/dist/cjs/api/types/CustomerCreationState.d.ts +5 -0
- package/dist/cjs/api/types/CustomerCreationState.js +8 -0
- package/dist/cjs/api/types/CustomerListResponse.d.ts +5 -0
- package/dist/cjs/api/types/EmptyResponse.d.ts +1 -0
- package/dist/cjs/api/types/ErrorResponse.d.ts +5 -0
- package/dist/cjs/api/types/Invoice.d.ts +57 -32
- package/dist/cjs/api/types/Invoice.js +23 -3
- package/dist/cjs/api/types/InvoiceLine.d.ts +30 -0
- package/dist/cjs/api/types/InvoiceLine.js +14 -0
- package/dist/cjs/api/types/InvoiceLinesResponse.d.ts +5 -0
- package/dist/cjs/api/types/InvoiceListResponse.d.ts +5 -0
- package/dist/cjs/api/types/Order.d.ts +24 -16
- package/dist/cjs/api/types/OrderCreationState.d.ts +5 -0
- package/dist/cjs/api/types/{CreationState.js → OrderCreationState.js} +3 -3
- package/dist/cjs/api/types/OrderLine.d.ts +6 -15
- package/dist/cjs/api/types/OrderLinesResponse.d.ts +5 -0
- package/dist/cjs/api/types/OrderListResponse.d.ts +5 -0
- package/dist/cjs/api/types/Pagination.d.ts +6 -0
- package/dist/cjs/api/types/Product.d.ts +7 -26
- package/dist/cjs/api/types/Product.js +0 -10
- package/dist/cjs/api/types/ProductByExternalId.d.ts +4 -0
- package/dist/cjs/api/types/ProductById.d.ts +4 -0
- package/dist/cjs/api/types/ProductListResponse.d.ts +5 -0
- package/dist/cjs/api/types/Signal.d.ts +5 -16
- package/dist/cjs/api/types/UpdateContactRequest.d.ts +10 -0
- package/dist/cjs/api/types/UpdateCustomerRequest.d.ts +14 -0
- package/dist/cjs/api/types/UpdateProductRequest.d.ts +8 -0
- package/dist/cjs/api/types/index.d.ts +25 -44
- package/dist/cjs/api/types/index.js +25 -44
- package/dist/cjs/environments.d.ts +2 -2
- package/dist/cjs/environments.js +1 -1
- package/dist/cjs/tracing/aiSdkSpanProcessor.d.ts +17 -0
- package/dist/cjs/tracing/aiSdkSpanProcessor.js +101 -0
- package/dist/cjs/tracing/autoInstrumentation.d.ts +1 -3
- package/dist/cjs/tracing/autoInstrumentation.js +99 -41
- package/dist/cjs/tracing/index.d.ts +2 -1
- package/dist/cjs/tracing/index.js +3 -1
- package/dist/cjs/tracing/signal.js +1 -4
- package/dist/cjs/tracing/spanProcessor.js +12 -0
- package/dist/cjs/tracing/tracing.js +10 -11
- package/dist/cjs/tracing/wrappers/anthropicWrapper.js +2 -2
- package/dist/cjs/tracing/wrappers/openAiWrapper.js +2 -2
- package/dist/cjs/tracing/wrappers/vercelAIWrapper.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +1 -1
- package/dist/esm/Client.d.mts +9 -15
- package/dist/esm/Client.mjs +13 -23
- package/dist/esm/api/errors/BadRequestError.d.mts +1 -1
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -1
- package/dist/esm/api/errors/InternalServerError.d.mts +1 -1
- package/dist/esm/api/errors/NotFoundError.d.mts +1 -1
- package/dist/esm/api/resources/contacts/client/Client.d.mts +113 -31
- package/dist/esm/api/resources/contacts/client/Client.mjs +341 -84
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +19 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/ListContactsRequest.d.mts +8 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactByIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/contacts/client/requests/index.d.mts +8 -1
- package/dist/esm/api/resources/customers/client/Client.d.mts +68 -140
- package/dist/esm/api/resources/customers/client/Client.mjs +155 -521
- package/dist/esm/api/resources/customers/client/requests/CreateCustomerRequest.d.mts +20 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/ListCustomersRequest.d.mts +8 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +8 -5
- package/dist/esm/api/resources/customers/index.d.mts +0 -1
- package/dist/esm/api/resources/customers/index.mjs +0 -1
- package/dist/esm/api/resources/index.d.mts +4 -10
- package/dist/esm/api/resources/index.mjs +4 -10
- package/dist/esm/api/resources/invoices/client/Client.d.mts +81 -0
- package/dist/esm/api/resources/{usage → invoices}/client/Client.mjs +168 -75
- package/dist/esm/api/resources/invoices/client/requests/GetInvoiceByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/invoices/client/requests/GetInvoiceLinesRequest.d.mts +11 -0
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesRequest.d.mts +8 -0
- package/dist/esm/api/resources/invoices/client/requests/UpdateInvoiceRequest.d.mts +10 -0
- package/dist/esm/api/resources/invoices/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/orders/client/Client.d.mts +49 -91
- package/dist/esm/api/resources/orders/client/Client.mjs +142 -267
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +22 -0
- package/dist/esm/api/resources/orders/client/requests/DeleteOrderByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/orders/client/requests/GetOrderByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/orders/client/requests/GetOrderLinesRequest.d.mts +11 -0
- package/dist/esm/api/resources/orders/client/requests/ListOrdersRequest.d.mts +8 -0
- package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.d.mts +22 -0
- package/dist/esm/api/resources/orders/client/requests/index.d.mts +6 -4
- package/dist/esm/api/resources/orders/index.d.mts +0 -1
- package/dist/esm/api/resources/orders/index.mjs +0 -1
- package/dist/esm/api/resources/products/client/Client.d.mts +74 -48
- package/dist/esm/api/resources/products/client/Client.mjs +195 -184
- package/dist/esm/api/resources/products/client/requests/CreateProductRequest.d.mts +14 -0
- package/dist/esm/api/resources/products/client/requests/GetProductByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/products/client/requests/GetProductByIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/products/client/requests/ListProductsRequest.d.mts +8 -0
- package/dist/esm/api/resources/products/client/requests/UpdateProductByExternalIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/products/client/requests/UpdateProductByIdRequest.d.mts +12 -0
- package/dist/esm/api/resources/products/client/requests/index.d.mts +6 -1
- package/dist/esm/api/resources/signals/client/Client.d.mts +36 -0
- package/dist/esm/api/resources/{traces → signals}/client/Client.mjs +28 -52
- package/dist/esm/api/resources/signals/client/requests/BulkSignalsRequest.d.mts +15 -0
- package/dist/esm/api/resources/signals/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/Attribution.d.mts +2 -0
- package/dist/esm/api/types/BulkSignalsResponse.d.mts +5 -0
- package/dist/esm/api/types/Contact.d.mts +10 -15
- package/dist/esm/api/types/ContactBillingAddress.d.mts +7 -0
- package/dist/esm/api/types/ContactListResponse.d.mts +5 -0
- package/dist/esm/api/types/Customer.d.mts +13 -12
- package/dist/esm/api/types/CustomerAttribution.d.mts +2 -0
- package/dist/esm/api/types/CustomerBillingAddress.d.mts +8 -0
- package/dist/esm/api/types/CustomerByExternalId.d.mts +4 -0
- package/dist/esm/api/types/CustomerById.d.mts +4 -0
- package/dist/esm/api/types/CustomerCreationState.d.mts +5 -0
- package/dist/esm/api/types/CustomerCreationState.mjs +5 -0
- package/dist/esm/api/types/CustomerListResponse.d.mts +5 -0
- package/dist/esm/api/types/EmptyResponse.d.mts +1 -0
- package/dist/esm/api/types/ErrorResponse.d.mts +5 -0
- package/dist/esm/api/types/Invoice.d.mts +57 -32
- package/dist/esm/api/types/Invoice.mjs +23 -3
- package/dist/esm/api/types/InvoiceLine.d.mts +30 -0
- package/dist/esm/api/types/InvoiceLine.mjs +11 -0
- package/dist/esm/api/types/InvoiceLinesResponse.d.mts +5 -0
- package/dist/esm/api/types/InvoiceListResponse.d.mts +5 -0
- package/dist/esm/api/types/Order.d.mts +24 -16
- package/dist/esm/api/types/OrderCreationState.d.mts +5 -0
- package/dist/esm/api/types/{CreationState.mjs → OrderCreationState.mjs} +2 -2
- package/dist/esm/api/types/OrderLine.d.mts +6 -15
- package/dist/esm/api/types/OrderLinesResponse.d.mts +5 -0
- package/dist/esm/api/types/OrderListResponse.d.mts +5 -0
- package/dist/esm/api/types/Pagination.d.mts +6 -0
- package/dist/esm/api/types/Product.d.mts +7 -26
- package/dist/esm/api/types/Product.mjs +1 -9
- package/dist/esm/api/types/ProductByExternalId.d.mts +4 -0
- package/dist/esm/api/types/ProductById.d.mts +4 -0
- package/dist/esm/api/types/ProductListResponse.d.mts +5 -0
- package/dist/esm/api/types/Signal.d.mts +5 -16
- package/dist/esm/api/types/UpdateContactRequest.d.mts +10 -0
- package/dist/esm/api/types/UpdateCustomerRequest.d.mts +14 -0
- package/dist/esm/api/types/UpdateProductRequest.d.mts +8 -0
- package/dist/esm/api/types/index.d.mts +25 -44
- package/dist/esm/api/types/index.mjs +25 -44
- package/dist/esm/environments.d.mts +2 -2
- package/dist/esm/environments.mjs +1 -1
- package/dist/esm/tracing/aiSdkSpanProcessor.d.mts +17 -0
- package/dist/esm/tracing/aiSdkSpanProcessor.mjs +97 -0
- package/dist/esm/tracing/autoInstrumentation.d.mts +1 -3
- package/dist/esm/tracing/autoInstrumentation.mjs +66 -41
- package/dist/esm/tracing/index.d.mts +2 -1
- package/dist/esm/tracing/index.mjs +2 -1
- package/dist/esm/tracing/signal.mjs +1 -4
- package/dist/esm/tracing/spanProcessor.mjs +12 -0
- package/dist/esm/tracing/tracing.mjs +10 -11
- package/dist/esm/tracing/wrappers/anthropicWrapper.mjs +2 -2
- package/dist/esm/tracing/wrappers/openAiWrapper.mjs +2 -2
- package/dist/esm/tracing/wrappers/vercelAIWrapper.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +5 -74
- package/reference.md +410 -1671
- package/dist/cjs/api/resources/agents/client/Client.d.ts +0 -154
- package/dist/cjs/api/resources/agents/client/Client.js +0 -542
- package/dist/cjs/api/resources/agents/client/requests/AgentCreate.d.ts +0 -15
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.d.ts +0 -26
- package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.d.ts +0 -36
- package/dist/cjs/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.d.ts +0 -14
- package/dist/cjs/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.d.ts +0 -18
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.ts +0 -19
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.ts +0 -19
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementRequestView.d.ts +0 -5
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementRequestView.js +0 -8
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementResponse.d.ts +0 -4
- package/dist/cjs/api/resources/customers/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/customers/types/index.js +0 -18
- package/dist/cjs/api/resources/orders/client/requests/CancelRenewalRequest.d.ts +0 -13
- package/dist/cjs/api/resources/orders/client/requests/OrderCreate.d.ts +0 -35
- package/dist/cjs/api/resources/orders/client/requests/OrdersActivateAndPayRequest.d.ts +0 -13
- package/dist/cjs/api/resources/orders/client/requests/ProrationUpgradeRequest.d.ts +0 -24
- package/dist/cjs/api/resources/orders/resources/index.d.ts +0 -2
- package/dist/cjs/api/resources/orders/resources/index.js +0 -41
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +0 -32
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +0 -127
- package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.ts +0 -16
- package/dist/cjs/api/resources/orders/resources/lines/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/plans/client/Client.d.ts +0 -128
- package/dist/cjs/api/resources/plans/client/Client.js +0 -551
- package/dist/cjs/api/resources/plans/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/plans/client/index.js +0 -17
- package/dist/cjs/api/resources/plans/client/requests/PlansGetUsageRequest.d.ts +0 -22
- package/dist/cjs/api/resources/plans/client/requests/PlansSubscribeRequest.d.ts +0 -13
- package/dist/cjs/api/resources/plans/client/requests/PlansUnsubscribeRequest.d.ts +0 -10
- package/dist/cjs/api/resources/plans/client/requests/PlansUpgradeRequest.d.ts +0 -16
- package/dist/cjs/api/resources/plans/client/requests/index.d.ts +0 -4
- package/dist/cjs/api/resources/plans/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/plans/index.d.ts +0 -1
- package/dist/cjs/api/resources/plans/index.js +0 -17
- package/dist/cjs/api/resources/products/client/requests/ProductCreate.d.ts +0 -26
- package/dist/cjs/api/resources/products/client/requests/ProductCreate.js +0 -12
- package/dist/cjs/api/resources/traces/client/Client.d.ts +0 -35
- package/dist/cjs/api/resources/traces/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/traces/client/index.js +0 -17
- package/dist/cjs/api/resources/traces/client/requests/GetTracesRequest.d.ts +0 -31
- package/dist/cjs/api/resources/traces/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/resources/traces/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/traces/index.d.ts +0 -1
- package/dist/cjs/api/resources/traces/index.js +0 -17
- package/dist/cjs/api/resources/usage/client/Client.d.ts +0 -72
- package/dist/cjs/api/resources/usage/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/usage/client/index.js +0 -17
- package/dist/cjs/api/resources/usage/client/requests/UsageCheckUsageRequest.d.ts +0 -25
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.d.ts +0 -10
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.ts +0 -26
- package/dist/cjs/api/resources/usage/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/usage/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/usage/index.d.ts +0 -2
- package/dist/cjs/api/resources/usage/index.js +0 -18
- package/dist/cjs/api/resources/usage/types/UsageCheckUsageResponse.d.ts +0 -14
- package/dist/cjs/api/resources/usage/types/index.d.ts +0 -1
- package/dist/cjs/api/resources/usage/types/index.js +0 -17
- package/dist/cjs/api/types/Address.d.ts +0 -8
- package/dist/cjs/api/types/Agent.d.ts +0 -11
- package/dist/cjs/api/types/AgentAttribute.d.ts +0 -6
- package/dist/cjs/api/types/AgentPricePoint.d.ts +0 -7
- package/dist/cjs/api/types/AgentPricePointTiers.d.ts +0 -5
- package/dist/cjs/api/types/AgentUpdate.d.ts +0 -9
- package/dist/cjs/api/types/ApiError.d.ts +0 -9
- package/dist/cjs/api/types/BillingFrequency.d.ts +0 -6
- package/dist/cjs/api/types/BillingFrequency.js +0 -9
- package/dist/cjs/api/types/CancelRenewalResponse.d.ts +0 -15
- package/dist/cjs/api/types/ChargeType.d.ts +0 -7
- package/dist/cjs/api/types/ChargeType.js +0 -10
- package/dist/cjs/api/types/ContactCreateForCustomer.d.ts +0 -15
- package/dist/cjs/api/types/CostAmount.d.ts +0 -9
- package/dist/cjs/api/types/CostTrace.d.ts +0 -19
- package/dist/cjs/api/types/CostTracesResponse.d.ts +0 -8
- package/dist/cjs/api/types/CreationSource.d.ts +0 -7
- package/dist/cjs/api/types/CreationSource.js +0 -10
- package/dist/cjs/api/types/CreationState.d.ts +0 -5
- package/dist/cjs/api/types/CustomerUpdate.d.ts +0 -14
- package/dist/cjs/api/types/EntitlementUsage.d.ts +0 -20
- package/dist/cjs/api/types/Error_.d.ts +0 -7
- package/dist/cjs/api/types/OrderLineAttribute.d.ts +0 -7
- package/dist/cjs/api/types/OrderLineAttributeCreateOne.d.ts +0 -1
- package/dist/cjs/api/types/OrderLineAttributePricing.d.ts +0 -8
- package/dist/cjs/api/types/OrderLineCreate.d.ts +0 -19
- package/dist/cjs/api/types/PaginationMeta.d.ts +0 -25
- package/dist/cjs/api/types/PaymentMethod.d.ts +0 -54
- package/dist/cjs/api/types/PaymentMethod.js +0 -20
- package/dist/cjs/api/types/Plan.d.ts +0 -91
- package/dist/cjs/api/types/Plan.js +0 -22
- package/dist/cjs/api/types/PlanGroup.d.ts +0 -20
- package/dist/cjs/api/types/PlanWithFeatures.d.ts +0 -67
- package/dist/cjs/api/types/PlanWithFeatures.js +0 -22
- package/dist/cjs/api/types/PricePoint.d.ts +0 -7
- package/dist/cjs/api/types/Pricing.d.ts +0 -10
- package/dist/cjs/api/types/PricingModelType.d.ts +0 -7
- package/dist/cjs/api/types/PricingModelType.js +0 -10
- package/dist/cjs/api/types/ProductUpdate.d.ts +0 -20
- package/dist/cjs/api/types/ProductUpdate.js +0 -12
- package/dist/cjs/api/types/ProrationAttributeUpdate.d.ts +0 -11
- package/dist/cjs/api/types/ProrationDetail.d.ts +0 -16
- package/dist/cjs/api/types/ProrationUpgradeResponse.d.ts +0 -22
- package/dist/cjs/api/types/Salutation.d.ts +0 -9
- package/dist/cjs/api/types/Salutation.js +0 -12
- package/dist/cjs/api/types/SignalV2.d.ts +0 -19
- package/dist/cjs/api/types/TaxExemptStatus.d.ts +0 -6
- package/dist/cjs/api/types/TaxExemptStatus.js +0 -9
- package/dist/cjs/api/types/Tier.d.ts +0 -5
- package/dist/cjs/api/types/Trace.d.ts +0 -23
- package/dist/cjs/api/types/TracesResponse.d.ts +0 -8
- package/dist/cjs/api/types/UsagePaginationMeta.d.ts +0 -13
- package/dist/cjs/api/types/UsageSummariesResponse.d.ts +0 -8
- package/dist/cjs/api/types/UsageSummary.d.ts +0 -55
- package/dist/cjs/integrations/adapters/expressjs/base-adapter.d.ts +0 -20
- package/dist/cjs/integrations/adapters/expressjs/base-adapter.js +0 -66
- package/dist/cjs/integrations/adapters/expressjs/index.d.ts +0 -6
- package/dist/cjs/integrations/adapters/expressjs/index.js +0 -21
- package/dist/cjs/integrations/adapters/expressjs/routes.d.ts +0 -180
- package/dist/cjs/integrations/adapters/expressjs/routes.js +0 -306
- package/dist/cjs/integrations/adapters/nestjs/index.d.ts +0 -7
- package/dist/cjs/integrations/adapters/nestjs/index.js +0 -23
- package/dist/cjs/integrations/adapters/nextjs/base-adapter.d.ts +0 -11
- package/dist/cjs/integrations/adapters/nextjs/base-adapter.js +0 -58
- package/dist/cjs/integrations/adapters/nextjs/index.d.ts +0 -5
- package/dist/cjs/integrations/adapters/nextjs/index.js +0 -22
- package/dist/cjs/integrations/adapters/nextjs/routes.d.ts +0 -302
- package/dist/cjs/integrations/adapters/nextjs/routes.js +0 -356
- package/dist/cjs/integrations/client.d.ts +0 -49
- package/dist/cjs/integrations/client.js +0 -93
- package/dist/cjs/integrations/controllers/billing.d.ts +0 -182
- package/dist/cjs/integrations/controllers/billing.js +0 -267
- package/dist/cjs/integrations/controllers/contacts.d.ts +0 -66
- package/dist/cjs/integrations/controllers/contacts.js +0 -145
- package/dist/cjs/integrations/controllers/customers.d.ts +0 -96
- package/dist/cjs/integrations/controllers/customers.js +0 -206
- package/dist/cjs/integrations/controllers/index.d.ts +0 -7
- package/dist/cjs/integrations/controllers/index.js +0 -42
- package/dist/cjs/integrations/controllers/invoices.d.ts +0 -36
- package/dist/cjs/integrations/controllers/invoices.js +0 -72
- package/dist/cjs/integrations/controllers/orders.d.ts +0 -68
- package/dist/cjs/integrations/controllers/orders.js +0 -229
- package/dist/cjs/integrations/controllers/plans.d.ts +0 -208
- package/dist/cjs/integrations/controllers/plans.js +0 -365
- package/dist/cjs/integrations/controllers/provision-users.d.ts +0 -62
- package/dist/cjs/integrations/controllers/provision-users.js +0 -130
- package/dist/cjs/integrations/index.d.ts +0 -29
- package/dist/cjs/integrations/index.js +0 -44
- package/dist/cjs/integrations/types.d.ts +0 -122
- package/dist/cjs/integrations/types.js +0 -2
- package/dist/cjs/integrations/utils/api-fetch.d.ts +0 -18
- package/dist/cjs/integrations/utils/api-fetch.js +0 -53
- package/dist/cjs/integrations/utils/base-handler.d.ts +0 -79
- package/dist/cjs/integrations/utils/base-handler.js +0 -168
- package/dist/cjs/integrations/utils/create-adapter.d.ts +0 -30
- package/dist/cjs/integrations/utils/create-adapter.js +0 -57
- package/dist/esm/api/resources/agents/client/Client.d.mts +0 -154
- package/dist/esm/api/resources/agents/client/Client.mjs +0 -505
- package/dist/esm/api/resources/agents/client/requests/AgentCreate.d.mts +0 -15
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/contacts/client/requests/ContactCreate.d.mts +0 -26
- package/dist/esm/api/resources/customers/client/requests/CustomerCreate.d.mts +0 -36
- package/dist/esm/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.d.mts +0 -14
- package/dist/esm/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.d.mts +0 -18
- package/dist/esm/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.mts +0 -19
- package/dist/esm/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.mts +0 -19
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementRequestView.d.mts +0 -5
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementRequestView.mjs +0 -5
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementResponse.d.mts +0 -4
- package/dist/esm/api/resources/customers/types/index.d.mts +0 -2
- package/dist/esm/api/resources/customers/types/index.mjs +0 -2
- package/dist/esm/api/resources/orders/client/requests/CancelRenewalRequest.d.mts +0 -13
- package/dist/esm/api/resources/orders/client/requests/OrderCreate.d.mts +0 -35
- package/dist/esm/api/resources/orders/client/requests/OrdersActivateAndPayRequest.d.mts +0 -13
- package/dist/esm/api/resources/orders/client/requests/ProrationUpgradeRequest.d.mts +0 -24
- package/dist/esm/api/resources/orders/resources/index.d.mts +0 -2
- package/dist/esm/api/resources/orders/resources/index.mjs +0 -2
- package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +0 -32
- package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +0 -90
- package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.mts +0 -16
- package/dist/esm/api/resources/orders/resources/lines/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/plans/client/Client.d.mts +0 -128
- package/dist/esm/api/resources/plans/client/Client.mjs +0 -514
- package/dist/esm/api/resources/plans/client/index.d.mts +0 -1
- package/dist/esm/api/resources/plans/client/index.mjs +0 -1
- package/dist/esm/api/resources/plans/client/requests/PlansGetUsageRequest.d.mts +0 -22
- package/dist/esm/api/resources/plans/client/requests/PlansSubscribeRequest.d.mts +0 -13
- package/dist/esm/api/resources/plans/client/requests/PlansUnsubscribeRequest.d.mts +0 -10
- package/dist/esm/api/resources/plans/client/requests/PlansUpgradeRequest.d.mts +0 -16
- package/dist/esm/api/resources/plans/client/requests/index.d.mts +0 -4
- package/dist/esm/api/resources/plans/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/plans/index.d.mts +0 -1
- package/dist/esm/api/resources/plans/index.mjs +0 -1
- package/dist/esm/api/resources/products/client/requests/ProductCreate.d.mts +0 -26
- package/dist/esm/api/resources/products/client/requests/ProductCreate.mjs +0 -9
- package/dist/esm/api/resources/traces/client/Client.d.mts +0 -35
- package/dist/esm/api/resources/traces/client/index.d.mts +0 -1
- package/dist/esm/api/resources/traces/client/index.mjs +0 -1
- package/dist/esm/api/resources/traces/client/requests/GetTracesRequest.d.mts +0 -31
- package/dist/esm/api/resources/traces/client/requests/index.d.mts +0 -1
- package/dist/esm/api/resources/traces/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/traces/index.d.mts +0 -1
- package/dist/esm/api/resources/traces/index.mjs +0 -1
- package/dist/esm/api/resources/usage/client/Client.d.mts +0 -72
- package/dist/esm/api/resources/usage/client/index.d.mts +0 -1
- package/dist/esm/api/resources/usage/client/index.mjs +0 -1
- package/dist/esm/api/resources/usage/client/requests/UsageCheckUsageRequest.d.mts +0 -25
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.d.mts +0 -10
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.mts +0 -26
- package/dist/esm/api/resources/usage/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/usage/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/usage/index.d.mts +0 -2
- package/dist/esm/api/resources/usage/index.mjs +0 -2
- package/dist/esm/api/resources/usage/types/UsageCheckUsageResponse.d.mts +0 -14
- package/dist/esm/api/resources/usage/types/index.d.mts +0 -1
- package/dist/esm/api/resources/usage/types/index.mjs +0 -1
- package/dist/esm/api/types/Address.d.mts +0 -8
- package/dist/esm/api/types/Agent.d.mts +0 -11
- package/dist/esm/api/types/AgentAttribute.d.mts +0 -6
- package/dist/esm/api/types/AgentPricePoint.d.mts +0 -7
- package/dist/esm/api/types/AgentPricePointTiers.d.mts +0 -5
- package/dist/esm/api/types/AgentUpdate.d.mts +0 -9
- package/dist/esm/api/types/ApiError.d.mts +0 -9
- package/dist/esm/api/types/BillingFrequency.d.mts +0 -6
- package/dist/esm/api/types/BillingFrequency.mjs +0 -6
- package/dist/esm/api/types/CancelRenewalResponse.d.mts +0 -15
- package/dist/esm/api/types/ChargeType.d.mts +0 -7
- package/dist/esm/api/types/ChargeType.mjs +0 -7
- package/dist/esm/api/types/ContactCreateForCustomer.d.mts +0 -15
- package/dist/esm/api/types/CostAmount.d.mts +0 -9
- package/dist/esm/api/types/CostTrace.d.mts +0 -19
- package/dist/esm/api/types/CostTracesResponse.d.mts +0 -8
- package/dist/esm/api/types/CreationSource.d.mts +0 -7
- package/dist/esm/api/types/CreationSource.mjs +0 -7
- package/dist/esm/api/types/CreationState.d.mts +0 -5
- package/dist/esm/api/types/CustomerUpdate.d.mts +0 -14
- package/dist/esm/api/types/EntitlementUsage.d.mts +0 -20
- package/dist/esm/api/types/Error_.d.mts +0 -7
- package/dist/esm/api/types/OrderLineAttribute.d.mts +0 -7
- package/dist/esm/api/types/OrderLineAttributeCreateOne.d.mts +0 -1
- package/dist/esm/api/types/OrderLineAttributePricing.d.mts +0 -8
- package/dist/esm/api/types/OrderLineCreate.d.mts +0 -19
- package/dist/esm/api/types/PaginationMeta.d.mts +0 -25
- package/dist/esm/api/types/PaymentMethod.d.mts +0 -54
- package/dist/esm/api/types/PaymentMethod.mjs +0 -17
- package/dist/esm/api/types/Plan.d.mts +0 -91
- package/dist/esm/api/types/Plan.mjs +0 -19
- package/dist/esm/api/types/PlanGroup.d.mts +0 -20
- package/dist/esm/api/types/PlanWithFeatures.d.mts +0 -67
- package/dist/esm/api/types/PlanWithFeatures.mjs +0 -19
- package/dist/esm/api/types/PricePoint.d.mts +0 -7
- package/dist/esm/api/types/Pricing.d.mts +0 -10
- package/dist/esm/api/types/PricingModelType.d.mts +0 -7
- package/dist/esm/api/types/PricingModelType.mjs +0 -7
- package/dist/esm/api/types/ProductUpdate.d.mts +0 -20
- package/dist/esm/api/types/ProductUpdate.mjs +0 -9
- package/dist/esm/api/types/ProrationAttributeUpdate.d.mts +0 -11
- package/dist/esm/api/types/ProrationDetail.d.mts +0 -16
- package/dist/esm/api/types/ProrationUpgradeResponse.d.mts +0 -22
- package/dist/esm/api/types/Salutation.d.mts +0 -9
- package/dist/esm/api/types/Salutation.mjs +0 -9
- package/dist/esm/api/types/SignalV2.d.mts +0 -19
- package/dist/esm/api/types/TaxExemptStatus.d.mts +0 -6
- package/dist/esm/api/types/TaxExemptStatus.mjs +0 -6
- package/dist/esm/api/types/Tier.d.mts +0 -5
- package/dist/esm/api/types/Trace.d.mts +0 -23
- package/dist/esm/api/types/TracesResponse.d.mts +0 -8
- package/dist/esm/api/types/UsagePaginationMeta.d.mts +0 -13
- package/dist/esm/api/types/UsageSummariesResponse.d.mts +0 -8
- package/dist/esm/api/types/UsageSummary.d.mts +0 -55
- package/dist/esm/integrations/adapters/expressjs/base-adapter.d.mts +0 -20
- package/dist/esm/integrations/adapters/expressjs/base-adapter.mjs +0 -62
- package/dist/esm/integrations/adapters/expressjs/index.d.mts +0 -6
- package/dist/esm/integrations/adapters/expressjs/index.mjs +0 -6
- package/dist/esm/integrations/adapters/expressjs/routes.d.mts +0 -180
- package/dist/esm/integrations/adapters/expressjs/routes.mjs +0 -294
- package/dist/esm/integrations/adapters/nestjs/index.d.mts +0 -7
- package/dist/esm/integrations/adapters/nestjs/index.mjs +0 -7
- package/dist/esm/integrations/adapters/nextjs/base-adapter.d.mts +0 -11
- package/dist/esm/integrations/adapters/nextjs/base-adapter.mjs +0 -55
- package/dist/esm/integrations/adapters/nextjs/index.d.mts +0 -5
- package/dist/esm/integrations/adapters/nextjs/index.mjs +0 -5
- package/dist/esm/integrations/adapters/nextjs/routes.d.mts +0 -302
- package/dist/esm/integrations/adapters/nextjs/routes.mjs +0 -340
- package/dist/esm/integrations/client.d.mts +0 -49
- package/dist/esm/integrations/client.mjs +0 -89
- package/dist/esm/integrations/controllers/billing.d.mts +0 -182
- package/dist/esm/integrations/controllers/billing.mjs +0 -259
- package/dist/esm/integrations/controllers/contacts.d.mts +0 -66
- package/dist/esm/integrations/controllers/contacts.mjs +0 -141
- package/dist/esm/integrations/controllers/customers.d.mts +0 -96
- package/dist/esm/integrations/controllers/customers.mjs +0 -200
- package/dist/esm/integrations/controllers/index.d.mts +0 -7
- package/dist/esm/integrations/controllers/index.mjs +0 -7
- package/dist/esm/integrations/controllers/invoices.d.mts +0 -36
- package/dist/esm/integrations/controllers/invoices.mjs +0 -68
- package/dist/esm/integrations/controllers/orders.d.mts +0 -68
- package/dist/esm/integrations/controllers/orders.mjs +0 -224
- package/dist/esm/integrations/controllers/plans.d.mts +0 -208
- package/dist/esm/integrations/controllers/plans.mjs +0 -353
- package/dist/esm/integrations/controllers/provision-users.d.mts +0 -62
- package/dist/esm/integrations/controllers/provision-users.mjs +0 -126
- package/dist/esm/integrations/index.d.mts +0 -29
- package/dist/esm/integrations/index.mjs +0 -28
- package/dist/esm/integrations/types.d.mts +0 -122
- package/dist/esm/integrations/types.mjs +0 -1
- package/dist/esm/integrations/utils/api-fetch.d.mts +0 -18
- package/dist/esm/integrations/utils/api-fetch.mjs +0 -50
- package/dist/esm/integrations/utils/base-handler.d.mts +0 -79
- package/dist/esm/integrations/utils/base-handler.mjs +0 -164
- package/dist/esm/integrations/utils/create-adapter.d.mts +0 -30
- package/dist/esm/integrations/utils/create-adapter.mjs +0 -54
- /package/dist/cjs/api/resources/{agents/client/requests/AgentCreate.js → contacts/client/requests/CreateContactRequest.js} +0 -0
- /package/dist/cjs/api/resources/contacts/client/requests/{ContactCreate.js → DeleteContactByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/client/requests/CustomerCreate.js → contacts/client/requests/DeleteContactByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/client/requests/CustomersCheckEntitlementRequest.js → contacts/client/requests/GetContactByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/client/requests/CustomersCreatePaymentMethodRequest.js → contacts/client/requests/GetContactByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/client/requests/CustomersGetCostsByExternalIdRequest.js → contacts/client/requests/ListContactsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/client/requests/CustomersGetUsageByExternalIdRequest.js → contacts/client/requests/UpdateContactByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{customers/types/CustomersCheckEntitlementResponse.js → contacts/client/requests/UpdateContactByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/client/requests/CancelRenewalRequest.js → customers/client/requests/CreateCustomerRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/client/requests/OrderCreate.js → customers/client/requests/DeleteCustomerByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/client/requests/OrdersActivateAndPayRequest.js → customers/client/requests/DeleteCustomerByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/client/requests/ProrationUpgradeRequest.js → customers/client/requests/GetCustomerByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines/client/requests/LinesUpdateRequest.js → customers/client/requests/GetCustomerByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{plans/client/requests/PlansGetUsageRequest.js → customers/client/requests/ListCustomersRequest.js} +0 -0
- /package/dist/cjs/api/resources/{plans/client/requests/PlansSubscribeRequest.js → customers/client/requests/UpdateCustomerByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{plans/client/requests/PlansUnsubscribeRequest.js → customers/client/requests/UpdateCustomerByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agents → invoices}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agents → invoices}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{plans/client/requests/PlansUpgradeRequest.js → invoices/client/requests/GetInvoiceByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{traces/client/requests/GetTracesRequest.js → invoices/client/requests/GetInvoiceLinesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{usage/client/requests/UsageCheckUsageRequest.js → invoices/client/requests/ListInvoicesRequest.js} +0 -0
- /package/dist/cjs/api/resources/{usage/client/requests/UsageRecordBulkRequest.js → invoices/client/requests/UpdateInvoiceRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agents → invoices}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{agents → invoices}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agents → invoices}/index.js +0 -0
- /package/dist/cjs/api/resources/{usage/client/requests/UsageRecordBulkV2Request.js → orders/client/requests/CreateOrderRequest.js} +0 -0
- /package/dist/cjs/api/resources/{usage/types/UsageCheckUsageResponse.js → orders/client/requests/DeleteOrderByIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/Address.js → resources/orders/client/requests/GetOrderByIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/Agent.js → resources/orders/client/requests/GetOrderLinesRequest.js} +0 -0
- /package/dist/cjs/api/{types/AgentAttribute.js → resources/orders/client/requests/ListOrdersRequest.js} +0 -0
- /package/dist/cjs/api/{types/AgentPricePoint.js → resources/orders/client/requests/UpdateOrderRequest.js} +0 -0
- /package/dist/cjs/api/{types/AgentPricePointTiers.js → resources/products/client/requests/CreateProductRequest.js} +0 -0
- /package/dist/cjs/api/{types/AgentUpdate.js → resources/products/client/requests/GetProductByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/ApiError.js → resources/products/client/requests/GetProductByIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/CancelRenewalResponse.js → resources/products/client/requests/ListProductsRequest.js} +0 -0
- /package/dist/cjs/api/{types/ContactCreateForCustomer.js → resources/products/client/requests/UpdateProductByExternalIdRequest.js} +0 -0
- /package/dist/cjs/api/{types/CostAmount.js → resources/products/client/requests/UpdateProductByIdRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines → signals}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines → signals}/client/index.js +0 -0
- /package/dist/cjs/api/{types/CostTrace.js → resources/signals/client/requests/BulkSignalsRequest.js} +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines → signals}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines → signals}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{orders/resources/lines → signals}/index.js +0 -0
- /package/dist/cjs/api/types/{CostTracesResponse.js → Attribution.js} +0 -0
- /package/dist/cjs/api/types/{CustomerUpdate.js → BulkSignalsResponse.js} +0 -0
- /package/dist/cjs/api/types/{EntitlementUsage.js → ContactBillingAddress.js} +0 -0
- /package/dist/cjs/api/types/{Error_.js → ContactListResponse.js} +0 -0
- /package/dist/cjs/api/types/{OrderLineAttribute.js → CustomerAttribution.js} +0 -0
- /package/dist/cjs/api/types/{OrderLineAttributeCreateOne.js → CustomerBillingAddress.js} +0 -0
- /package/dist/cjs/api/types/{OrderLineAttributePricing.js → CustomerByExternalId.js} +0 -0
- /package/dist/cjs/api/types/{OrderLineCreate.js → CustomerById.js} +0 -0
- /package/dist/cjs/api/types/{PaginationMeta.js → CustomerListResponse.js} +0 -0
- /package/dist/cjs/api/types/{PlanGroup.js → EmptyResponse.js} +0 -0
- /package/dist/cjs/api/types/{PricePoint.js → ErrorResponse.js} +0 -0
- /package/dist/cjs/api/types/{Pricing.js → InvoiceLinesResponse.js} +0 -0
- /package/dist/cjs/api/types/{ProrationAttributeUpdate.js → InvoiceListResponse.js} +0 -0
- /package/dist/cjs/api/types/{ProrationDetail.js → OrderLinesResponse.js} +0 -0
- /package/dist/cjs/api/types/{ProrationUpgradeResponse.js → OrderListResponse.js} +0 -0
- /package/dist/cjs/api/types/{SignalV2.js → Pagination.js} +0 -0
- /package/dist/cjs/api/types/{Tier.js → ProductByExternalId.js} +0 -0
- /package/dist/cjs/api/types/{Trace.js → ProductById.js} +0 -0
- /package/dist/cjs/api/types/{TracesResponse.js → ProductListResponse.js} +0 -0
- /package/dist/cjs/api/types/{UsagePaginationMeta.js → UpdateContactRequest.js} +0 -0
- /package/dist/cjs/api/types/{UsageSummariesResponse.js → UpdateCustomerRequest.js} +0 -0
- /package/dist/cjs/api/types/{UsageSummary.js → UpdateProductRequest.js} +0 -0
- /package/dist/esm/api/resources/{agents/client/requests/AgentCreate.mjs → contacts/client/requests/CreateContactRequest.mjs} +0 -0
- /package/dist/esm/api/resources/contacts/client/requests/{ContactCreate.mjs → DeleteContactByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/client/requests/CustomerCreate.mjs → contacts/client/requests/DeleteContactByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/client/requests/CustomersCheckEntitlementRequest.mjs → contacts/client/requests/GetContactByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/client/requests/CustomersCreatePaymentMethodRequest.mjs → contacts/client/requests/GetContactByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/client/requests/CustomersGetCostsByExternalIdRequest.mjs → contacts/client/requests/ListContactsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/client/requests/CustomersGetUsageByExternalIdRequest.mjs → contacts/client/requests/UpdateContactByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{customers/types/CustomersCheckEntitlementResponse.mjs → contacts/client/requests/UpdateContactByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/client/requests/CancelRenewalRequest.mjs → customers/client/requests/CreateCustomerRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/client/requests/OrderCreate.mjs → customers/client/requests/DeleteCustomerByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/client/requests/OrdersActivateAndPayRequest.mjs → customers/client/requests/DeleteCustomerByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/client/requests/ProrationUpgradeRequest.mjs → customers/client/requests/GetCustomerByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines/client/requests/LinesUpdateRequest.mjs → customers/client/requests/GetCustomerByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{plans/client/requests/PlansGetUsageRequest.mjs → customers/client/requests/ListCustomersRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{plans/client/requests/PlansSubscribeRequest.mjs → customers/client/requests/UpdateCustomerByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{plans/client/requests/PlansUnsubscribeRequest.mjs → customers/client/requests/UpdateCustomerByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agents → invoices}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agents → invoices}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{plans/client/requests/PlansUpgradeRequest.mjs → invoices/client/requests/GetInvoiceByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{traces/client/requests/GetTracesRequest.mjs → invoices/client/requests/GetInvoiceLinesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{usage/client/requests/UsageCheckUsageRequest.mjs → invoices/client/requests/ListInvoicesRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{usage/client/requests/UsageRecordBulkRequest.mjs → invoices/client/requests/UpdateInvoiceRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agents → invoices}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{agents → invoices}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agents → invoices}/index.mjs +0 -0
- /package/dist/esm/api/resources/{usage/client/requests/UsageRecordBulkV2Request.mjs → orders/client/requests/CreateOrderRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{usage/types/UsageCheckUsageResponse.mjs → orders/client/requests/DeleteOrderByIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/Address.mjs → resources/orders/client/requests/GetOrderByIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/Agent.mjs → resources/orders/client/requests/GetOrderLinesRequest.mjs} +0 -0
- /package/dist/esm/api/{types/AgentAttribute.mjs → resources/orders/client/requests/ListOrdersRequest.mjs} +0 -0
- /package/dist/esm/api/{types/AgentPricePoint.mjs → resources/orders/client/requests/UpdateOrderRequest.mjs} +0 -0
- /package/dist/esm/api/{types/AgentPricePointTiers.mjs → resources/products/client/requests/CreateProductRequest.mjs} +0 -0
- /package/dist/esm/api/{types/AgentUpdate.mjs → resources/products/client/requests/GetProductByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/ApiError.mjs → resources/products/client/requests/GetProductByIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CancelRenewalResponse.mjs → resources/products/client/requests/ListProductsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/ContactCreateForCustomer.mjs → resources/products/client/requests/UpdateProductByExternalIdRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CostAmount.mjs → resources/products/client/requests/UpdateProductByIdRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines → signals}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines → signals}/client/index.mjs +0 -0
- /package/dist/esm/api/{types/CostTrace.mjs → resources/signals/client/requests/BulkSignalsRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines → signals}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines → signals}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{orders/resources/lines → signals}/index.mjs +0 -0
- /package/dist/esm/api/types/{CostTracesResponse.mjs → Attribution.mjs} +0 -0
- /package/dist/esm/api/types/{CustomerUpdate.mjs → BulkSignalsResponse.mjs} +0 -0
- /package/dist/esm/api/types/{EntitlementUsage.mjs → ContactBillingAddress.mjs} +0 -0
- /package/dist/esm/api/types/{Error_.mjs → ContactListResponse.mjs} +0 -0
- /package/dist/esm/api/types/{OrderLineAttribute.mjs → CustomerAttribution.mjs} +0 -0
- /package/dist/esm/api/types/{OrderLineAttributeCreateOne.mjs → CustomerBillingAddress.mjs} +0 -0
- /package/dist/esm/api/types/{OrderLineAttributePricing.mjs → CustomerByExternalId.mjs} +0 -0
- /package/dist/esm/api/types/{OrderLineCreate.mjs → CustomerById.mjs} +0 -0
- /package/dist/esm/api/types/{PaginationMeta.mjs → CustomerListResponse.mjs} +0 -0
- /package/dist/esm/api/types/{PlanGroup.mjs → EmptyResponse.mjs} +0 -0
- /package/dist/esm/api/types/{PricePoint.mjs → ErrorResponse.mjs} +0 -0
- /package/dist/esm/api/types/{Pricing.mjs → InvoiceLinesResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ProrationAttributeUpdate.mjs → InvoiceListResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ProrationDetail.mjs → OrderLinesResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ProrationUpgradeResponse.mjs → OrderListResponse.mjs} +0 -0
- /package/dist/esm/api/types/{SignalV2.mjs → Pagination.mjs} +0 -0
- /package/dist/esm/api/types/{Tier.mjs → ProductByExternalId.mjs} +0 -0
- /package/dist/esm/api/types/{Trace.mjs → ProductById.mjs} +0 -0
- /package/dist/esm/api/types/{TracesResponse.mjs → ProductListResponse.mjs} +0 -0
- /package/dist/esm/api/types/{UsagePaginationMeta.mjs → UpdateContactRequest.mjs} +0 -0
- /package/dist/esm/api/types/{UsageSummariesResponse.mjs → UpdateCustomerRequest.mjs} +0 -0
- /package/dist/esm/api/types/{UsageSummary.mjs → UpdateProductRequest.mjs} +0 -0
|
@@ -50,146 +50,42 @@ const environments = __importStar(require("../../../../environments.js"));
|
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
const Paid = __importStar(require("../../../index.js"));
|
|
52
52
|
class Customers {
|
|
53
|
-
constructor(_options
|
|
53
|
+
constructor(_options) {
|
|
54
54
|
this._options = _options;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Get a list of customers for the organization
|
|
58
58
|
*
|
|
59
|
-
* @
|
|
60
|
-
* await client.customers.list()
|
|
61
|
-
*/
|
|
62
|
-
list(requestOptions) {
|
|
63
|
-
return core.HttpResponsePromise.fromPromise(this.__list(requestOptions));
|
|
64
|
-
}
|
|
65
|
-
__list(requestOptions) {
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
68
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
69
|
-
const _response = yield core.fetcher({
|
|
70
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, "customers"),
|
|
71
|
-
method: "GET",
|
|
72
|
-
headers: _headers,
|
|
73
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
74
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
75
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
76
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
77
|
-
});
|
|
78
|
-
if (_response.ok) {
|
|
79
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
80
|
-
}
|
|
81
|
-
if (_response.error.reason === "status-code") {
|
|
82
|
-
throw new errors.PaidError({
|
|
83
|
-
statusCode: _response.error.statusCode,
|
|
84
|
-
body: _response.error.body,
|
|
85
|
-
rawResponse: _response.rawResponse,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
switch (_response.error.reason) {
|
|
89
|
-
case "non-json":
|
|
90
|
-
throw new errors.PaidError({
|
|
91
|
-
statusCode: _response.error.statusCode,
|
|
92
|
-
body: _response.error.rawBody,
|
|
93
|
-
rawResponse: _response.rawResponse,
|
|
94
|
-
});
|
|
95
|
-
case "timeout":
|
|
96
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers.");
|
|
97
|
-
case "unknown":
|
|
98
|
-
throw new errors.PaidError({
|
|
99
|
-
message: _response.error.errorMessage,
|
|
100
|
-
rawResponse: _response.rawResponse,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* @param {Paid.CustomerCreate} request
|
|
59
|
+
* @param {Paid.ListCustomersRequest} request
|
|
107
60
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
61
|
*
|
|
62
|
+
* @throws {@link Paid.BadRequestError}
|
|
63
|
+
* @throws {@link Paid.ForbiddenError}
|
|
64
|
+
* @throws {@link Paid.InternalServerError}
|
|
65
|
+
*
|
|
109
66
|
* @example
|
|
110
|
-
* await client.customers.
|
|
111
|
-
* name: "Acme, Inc.",
|
|
112
|
-
* externalId: "acme-inc",
|
|
113
|
-
* contacts: [{
|
|
114
|
-
* salutation: "Mr.",
|
|
115
|
-
* firstName: "John",
|
|
116
|
-
* lastName: "Doe",
|
|
117
|
-
* accountName: "Acme, Inc.",
|
|
118
|
-
* email: "john.doe@acme.com",
|
|
119
|
-
* phone: "+1-555-0100",
|
|
120
|
-
* billingStreet: "123 Main Street",
|
|
121
|
-
* billingCity: "San Francisco",
|
|
122
|
-
* billingStateProvince: "CA",
|
|
123
|
-
* billingCountry: "USA",
|
|
124
|
-
* billingPostalCode: "94102"
|
|
125
|
-
* }]
|
|
126
|
-
* })
|
|
67
|
+
* await client.customers.listCustomers()
|
|
127
68
|
*/
|
|
128
|
-
|
|
129
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
69
|
+
listCustomers(request = {}, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__listCustomers(request, requestOptions));
|
|
130
71
|
}
|
|
131
|
-
|
|
132
|
-
return __awaiter(this,
|
|
72
|
+
__listCustomers() {
|
|
73
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
133
74
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
headers: _headers,
|
|
139
|
-
contentType: "application/json",
|
|
140
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
141
|
-
requestType: "json",
|
|
142
|
-
body: request,
|
|
143
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
144
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
145
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
146
|
-
});
|
|
147
|
-
if (_response.ok) {
|
|
148
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
149
|
-
}
|
|
150
|
-
if (_response.error.reason === "status-code") {
|
|
151
|
-
throw new errors.PaidError({
|
|
152
|
-
statusCode: _response.error.statusCode,
|
|
153
|
-
body: _response.error.body,
|
|
154
|
-
rawResponse: _response.rawResponse,
|
|
155
|
-
});
|
|
75
|
+
const { limit, offset } = request;
|
|
76
|
+
const _queryParams = {};
|
|
77
|
+
if (limit != null) {
|
|
78
|
+
_queryParams.limit = limit.toString();
|
|
156
79
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
throw new errors.PaidError({
|
|
160
|
-
statusCode: _response.error.statusCode,
|
|
161
|
-
body: _response.error.rawBody,
|
|
162
|
-
rawResponse: _response.rawResponse,
|
|
163
|
-
});
|
|
164
|
-
case "timeout":
|
|
165
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers.");
|
|
166
|
-
case "unknown":
|
|
167
|
-
throw new errors.PaidError({
|
|
168
|
-
message: _response.error.errorMessage,
|
|
169
|
-
rawResponse: _response.rawResponse,
|
|
170
|
-
});
|
|
80
|
+
if (offset != null) {
|
|
81
|
+
_queryParams.offset = offset.toString();
|
|
171
82
|
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* @param {string} customerId
|
|
176
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* await client.customers.get("customerId")
|
|
180
|
-
*/
|
|
181
|
-
get(customerId, requestOptions) {
|
|
182
|
-
return core.HttpResponsePromise.fromPromise(this.__get(customerId, requestOptions));
|
|
183
|
-
}
|
|
184
|
-
__get(customerId, requestOptions) {
|
|
185
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
187
83
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
188
84
|
const _response = yield core.fetcher({
|
|
189
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
85
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "customers/"),
|
|
190
86
|
method: "GET",
|
|
191
87
|
headers: _headers,
|
|
192
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
88
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
193
89
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
194
90
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
195
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -198,11 +94,20 @@ class Customers {
|
|
|
198
94
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
199
95
|
}
|
|
200
96
|
if (_response.error.reason === "status-code") {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
97
|
+
switch (_response.error.statusCode) {
|
|
98
|
+
case 400:
|
|
99
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
100
|
+
case 403:
|
|
101
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
102
|
+
case 500:
|
|
103
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.PaidError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
206
111
|
}
|
|
207
112
|
switch (_response.error.reason) {
|
|
208
113
|
case "non-json":
|
|
@@ -212,7 +117,7 @@ class Customers {
|
|
|
212
117
|
rawResponse: _response.rawResponse,
|
|
213
118
|
});
|
|
214
119
|
case "timeout":
|
|
215
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers
|
|
120
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/.");
|
|
216
121
|
case "unknown":
|
|
217
122
|
throw new errors.PaidError({
|
|
218
123
|
message: _response.error.errorMessage,
|
|
@@ -222,28 +127,30 @@ class Customers {
|
|
|
222
127
|
});
|
|
223
128
|
}
|
|
224
129
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
130
|
+
* Creates a new customer for the organization
|
|
131
|
+
*
|
|
132
|
+
* @param {Paid.CreateCustomerRequest} request
|
|
227
133
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
228
134
|
*
|
|
135
|
+
* @throws {@link Paid.BadRequestError}
|
|
136
|
+
* @throws {@link Paid.ForbiddenError}
|
|
137
|
+
* @throws {@link Paid.InternalServerError}
|
|
138
|
+
*
|
|
229
139
|
* @example
|
|
230
|
-
* await client.customers.
|
|
231
|
-
* name: "
|
|
232
|
-
* phone: "123-456-7890",
|
|
233
|
-
* employeeCount: 101,
|
|
234
|
-
* annualRevenue: 1000001
|
|
140
|
+
* await client.customers.createCustomer({
|
|
141
|
+
* name: "name"
|
|
235
142
|
* })
|
|
236
143
|
*/
|
|
237
|
-
|
|
238
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
144
|
+
createCustomer(request, requestOptions) {
|
|
145
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomer(request, requestOptions));
|
|
239
146
|
}
|
|
240
|
-
|
|
147
|
+
__createCustomer(request, requestOptions) {
|
|
241
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
242
149
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
243
150
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
151
|
const _response = yield core.fetcher({
|
|
245
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
246
|
-
method: "
|
|
152
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "customers/"),
|
|
153
|
+
method: "POST",
|
|
247
154
|
headers: _headers,
|
|
248
155
|
contentType: "application/json",
|
|
249
156
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -256,128 +163,14 @@ class Customers {
|
|
|
256
163
|
if (_response.ok) {
|
|
257
164
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
258
165
|
}
|
|
259
|
-
if (_response.error.reason === "status-code") {
|
|
260
|
-
throw new errors.PaidError({
|
|
261
|
-
statusCode: _response.error.statusCode,
|
|
262
|
-
body: _response.error.body,
|
|
263
|
-
rawResponse: _response.rawResponse,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
switch (_response.error.reason) {
|
|
267
|
-
case "non-json":
|
|
268
|
-
throw new errors.PaidError({
|
|
269
|
-
statusCode: _response.error.statusCode,
|
|
270
|
-
body: _response.error.rawBody,
|
|
271
|
-
rawResponse: _response.rawResponse,
|
|
272
|
-
});
|
|
273
|
-
case "timeout":
|
|
274
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerId}.");
|
|
275
|
-
case "unknown":
|
|
276
|
-
throw new errors.PaidError({
|
|
277
|
-
message: _response.error.errorMessage,
|
|
278
|
-
rawResponse: _response.rawResponse,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* @param {string} customerId
|
|
285
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
286
|
-
*
|
|
287
|
-
* @example
|
|
288
|
-
* await client.customers.delete("customerId")
|
|
289
|
-
*/
|
|
290
|
-
delete(customerId, requestOptions) {
|
|
291
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(customerId, requestOptions));
|
|
292
|
-
}
|
|
293
|
-
__delete(customerId, requestOptions) {
|
|
294
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
296
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
297
|
-
const _response = yield core.fetcher({
|
|
298
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, `customers/${core.url.encodePathParam(customerId)}`),
|
|
299
|
-
method: "DELETE",
|
|
300
|
-
headers: _headers,
|
|
301
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
302
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
303
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
304
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
305
|
-
});
|
|
306
|
-
if (_response.ok) {
|
|
307
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
308
|
-
}
|
|
309
|
-
if (_response.error.reason === "status-code") {
|
|
310
|
-
throw new errors.PaidError({
|
|
311
|
-
statusCode: _response.error.statusCode,
|
|
312
|
-
body: _response.error.body,
|
|
313
|
-
rawResponse: _response.rawResponse,
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
switch (_response.error.reason) {
|
|
317
|
-
case "non-json":
|
|
318
|
-
throw new errors.PaidError({
|
|
319
|
-
statusCode: _response.error.statusCode,
|
|
320
|
-
body: _response.error.rawBody,
|
|
321
|
-
rawResponse: _response.rawResponse,
|
|
322
|
-
});
|
|
323
|
-
case "timeout":
|
|
324
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{customerId}.");
|
|
325
|
-
case "unknown":
|
|
326
|
-
throw new errors.PaidError({
|
|
327
|
-
message: _response.error.errorMessage,
|
|
328
|
-
rawResponse: _response.rawResponse,
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @param {string} customerId - The customer ID
|
|
335
|
-
* @param {Paid.CustomersCheckEntitlementRequest} request
|
|
336
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
337
|
-
*
|
|
338
|
-
* @throws {@link Paid.BadRequestError}
|
|
339
|
-
* @throws {@link Paid.NotFoundError}
|
|
340
|
-
*
|
|
341
|
-
* @example
|
|
342
|
-
* await client.customers.checkEntitlement("customerId", {
|
|
343
|
-
* event_name: "event_name",
|
|
344
|
-
* view: "all"
|
|
345
|
-
* })
|
|
346
|
-
*/
|
|
347
|
-
checkEntitlement(customerId, request, requestOptions) {
|
|
348
|
-
return core.HttpResponsePromise.fromPromise(this.__checkEntitlement(customerId, request, requestOptions));
|
|
349
|
-
}
|
|
350
|
-
__checkEntitlement(customerId, request, requestOptions) {
|
|
351
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
353
|
-
const { event_name: eventName, view } = request;
|
|
354
|
-
const _queryParams = {};
|
|
355
|
-
_queryParams.event_name = eventName;
|
|
356
|
-
if (view != null) {
|
|
357
|
-
_queryParams.view = view;
|
|
358
|
-
}
|
|
359
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
360
|
-
const _response = yield core.fetcher({
|
|
361
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, `customers/${core.url.encodePathParam(customerId)}/entitlement`),
|
|
362
|
-
method: "GET",
|
|
363
|
-
headers: _headers,
|
|
364
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
365
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
366
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
367
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
368
|
-
});
|
|
369
|
-
if (_response.ok) {
|
|
370
|
-
return {
|
|
371
|
-
data: _response.body,
|
|
372
|
-
rawResponse: _response.rawResponse,
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
166
|
if (_response.error.reason === "status-code") {
|
|
376
167
|
switch (_response.error.statusCode) {
|
|
377
168
|
case 400:
|
|
378
169
|
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
379
|
-
case
|
|
380
|
-
throw new Paid.
|
|
170
|
+
case 403:
|
|
171
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
172
|
+
case 500:
|
|
173
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
381
174
|
default:
|
|
382
175
|
throw new errors.PaidError({
|
|
383
176
|
statusCode: _response.error.statusCode,
|
|
@@ -394,7 +187,7 @@ class Customers {
|
|
|
394
187
|
rawResponse: _response.rawResponse,
|
|
395
188
|
});
|
|
396
189
|
case "timeout":
|
|
397
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
190
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/.");
|
|
398
191
|
case "unknown":
|
|
399
192
|
throw new errors.PaidError({
|
|
400
193
|
message: _response.error.errorMessage,
|
|
@@ -404,23 +197,30 @@ class Customers {
|
|
|
404
197
|
});
|
|
405
198
|
}
|
|
406
199
|
/**
|
|
407
|
-
*
|
|
200
|
+
* Get a customer by ID
|
|
201
|
+
*
|
|
202
|
+
* @param {Paid.GetCustomerByIdRequest} request
|
|
408
203
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
409
204
|
*
|
|
410
205
|
* @throws {@link Paid.ForbiddenError}
|
|
206
|
+
* @throws {@link Paid.NotFoundError}
|
|
207
|
+
* @throws {@link Paid.InternalServerError}
|
|
411
208
|
*
|
|
412
209
|
* @example
|
|
413
|
-
* await client.customers.
|
|
210
|
+
* await client.customers.getCustomerById({
|
|
211
|
+
* id: "id"
|
|
212
|
+
* })
|
|
414
213
|
*/
|
|
415
|
-
|
|
416
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
214
|
+
getCustomerById(request, requestOptions) {
|
|
215
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerById(request, requestOptions));
|
|
417
216
|
}
|
|
418
|
-
|
|
217
|
+
__getCustomerById(request, requestOptions) {
|
|
419
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
420
219
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
220
|
+
const { id } = request;
|
|
421
221
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
422
222
|
const _response = yield core.fetcher({
|
|
423
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
223
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
424
224
|
method: "GET",
|
|
425
225
|
headers: _headers,
|
|
426
226
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -435,6 +235,10 @@ class Customers {
|
|
|
435
235
|
switch (_response.error.statusCode) {
|
|
436
236
|
case 403:
|
|
437
237
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
238
|
+
case 404:
|
|
239
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
240
|
+
case 500:
|
|
241
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
438
242
|
default:
|
|
439
243
|
throw new errors.PaidError({
|
|
440
244
|
statusCode: _response.error.statusCode,
|
|
@@ -451,111 +255,7 @@ class Customers {
|
|
|
451
255
|
rawResponse: _response.rawResponse,
|
|
452
256
|
});
|
|
453
257
|
case "timeout":
|
|
454
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{
|
|
455
|
-
case "unknown":
|
|
456
|
-
throw new errors.PaidError({
|
|
457
|
-
message: _response.error.errorMessage,
|
|
458
|
-
rawResponse: _response.rawResponse,
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* @param {string} externalId
|
|
465
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
466
|
-
*
|
|
467
|
-
* @example
|
|
468
|
-
* await client.customers.getByExternalId("externalId")
|
|
469
|
-
*/
|
|
470
|
-
getByExternalId(externalId, requestOptions) {
|
|
471
|
-
return core.HttpResponsePromise.fromPromise(this.__getByExternalId(externalId, requestOptions));
|
|
472
|
-
}
|
|
473
|
-
__getByExternalId(externalId, requestOptions) {
|
|
474
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
475
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
476
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
477
|
-
const _response = yield core.fetcher({
|
|
478
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
479
|
-
method: "GET",
|
|
480
|
-
headers: _headers,
|
|
481
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
482
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
483
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
484
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
485
|
-
});
|
|
486
|
-
if (_response.ok) {
|
|
487
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
488
|
-
}
|
|
489
|
-
if (_response.error.reason === "status-code") {
|
|
490
|
-
throw new errors.PaidError({
|
|
491
|
-
statusCode: _response.error.statusCode,
|
|
492
|
-
body: _response.error.body,
|
|
493
|
-
rawResponse: _response.rawResponse,
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
switch (_response.error.reason) {
|
|
497
|
-
case "non-json":
|
|
498
|
-
throw new errors.PaidError({
|
|
499
|
-
statusCode: _response.error.statusCode,
|
|
500
|
-
body: _response.error.rawBody,
|
|
501
|
-
rawResponse: _response.rawResponse,
|
|
502
|
-
});
|
|
503
|
-
case "timeout":
|
|
504
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}.");
|
|
505
|
-
case "unknown":
|
|
506
|
-
throw new errors.PaidError({
|
|
507
|
-
message: _response.error.errorMessage,
|
|
508
|
-
rawResponse: _response.rawResponse,
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* @param {string} externalId
|
|
515
|
-
* @param {Paid.CustomerUpdate} request
|
|
516
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
517
|
-
*
|
|
518
|
-
* @example
|
|
519
|
-
* await client.customers.updateByExternalId("externalId", {})
|
|
520
|
-
*/
|
|
521
|
-
updateByExternalId(externalId, request, requestOptions) {
|
|
522
|
-
return core.HttpResponsePromise.fromPromise(this.__updateByExternalId(externalId, request, requestOptions));
|
|
523
|
-
}
|
|
524
|
-
__updateByExternalId(externalId, request, requestOptions) {
|
|
525
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
526
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
527
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
528
|
-
const _response = yield core.fetcher({
|
|
529
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
530
|
-
method: "PUT",
|
|
531
|
-
headers: _headers,
|
|
532
|
-
contentType: "application/json",
|
|
533
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
534
|
-
requestType: "json",
|
|
535
|
-
body: request,
|
|
536
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
537
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
538
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
539
|
-
});
|
|
540
|
-
if (_response.ok) {
|
|
541
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
542
|
-
}
|
|
543
|
-
if (_response.error.reason === "status-code") {
|
|
544
|
-
throw new errors.PaidError({
|
|
545
|
-
statusCode: _response.error.statusCode,
|
|
546
|
-
body: _response.error.body,
|
|
547
|
-
rawResponse: _response.rawResponse,
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
switch (_response.error.reason) {
|
|
551
|
-
case "non-json":
|
|
552
|
-
throw new errors.PaidError({
|
|
553
|
-
statusCode: _response.error.statusCode,
|
|
554
|
-
body: _response.error.rawBody,
|
|
555
|
-
rawResponse: _response.rawResponse,
|
|
556
|
-
});
|
|
557
|
-
case "timeout":
|
|
558
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}.");
|
|
258
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}.");
|
|
559
259
|
case "unknown":
|
|
560
260
|
throw new errors.PaidError({
|
|
561
261
|
message: _response.error.errorMessage,
|
|
@@ -565,98 +265,38 @@ class Customers {
|
|
|
565
265
|
});
|
|
566
266
|
}
|
|
567
267
|
/**
|
|
568
|
-
*
|
|
569
|
-
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
268
|
+
* Update a customer by ID
|
|
570
269
|
*
|
|
571
|
-
* @
|
|
572
|
-
* await client.customers.deleteByExternalId("externalId")
|
|
573
|
-
*/
|
|
574
|
-
deleteByExternalId(externalId, requestOptions) {
|
|
575
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteByExternalId(externalId, requestOptions));
|
|
576
|
-
}
|
|
577
|
-
__deleteByExternalId(externalId, requestOptions) {
|
|
578
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
579
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
580
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
581
|
-
const _response = yield core.fetcher({
|
|
582
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Production, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
583
|
-
method: "DELETE",
|
|
584
|
-
headers: _headers,
|
|
585
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
586
|
-
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
587
|
-
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
588
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
589
|
-
});
|
|
590
|
-
if (_response.ok) {
|
|
591
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
592
|
-
}
|
|
593
|
-
if (_response.error.reason === "status-code") {
|
|
594
|
-
throw new errors.PaidError({
|
|
595
|
-
statusCode: _response.error.statusCode,
|
|
596
|
-
body: _response.error.body,
|
|
597
|
-
rawResponse: _response.rawResponse,
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
switch (_response.error.reason) {
|
|
601
|
-
case "non-json":
|
|
602
|
-
throw new errors.PaidError({
|
|
603
|
-
statusCode: _response.error.statusCode,
|
|
604
|
-
body: _response.error.rawBody,
|
|
605
|
-
rawResponse: _response.rawResponse,
|
|
606
|
-
});
|
|
607
|
-
case "timeout":
|
|
608
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}.");
|
|
609
|
-
case "unknown":
|
|
610
|
-
throw new errors.PaidError({
|
|
611
|
-
message: _response.error.errorMessage,
|
|
612
|
-
rawResponse: _response.rawResponse,
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* @param {string} externalId - The external ID of the customer
|
|
619
|
-
* @param {Paid.CustomersGetCostsByExternalIdRequest} request
|
|
270
|
+
* @param {Paid.UpdateCustomerByIdRequest} request
|
|
620
271
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
621
272
|
*
|
|
622
273
|
* @throws {@link Paid.BadRequestError}
|
|
623
274
|
* @throws {@link Paid.ForbiddenError}
|
|
624
275
|
* @throws {@link Paid.NotFoundError}
|
|
276
|
+
* @throws {@link Paid.InternalServerError}
|
|
625
277
|
*
|
|
626
278
|
* @example
|
|
627
|
-
* await client.customers.
|
|
628
|
-
*
|
|
629
|
-
*
|
|
630
|
-
* startTime: "2024-01-15T09:30:00Z",
|
|
631
|
-
* endTime: "2024-01-15T09:30:00Z"
|
|
279
|
+
* await client.customers.updateCustomerById({
|
|
280
|
+
* id: "id",
|
|
281
|
+
* body: {}
|
|
632
282
|
* })
|
|
633
283
|
*/
|
|
634
|
-
|
|
635
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
284
|
+
updateCustomerById(request, requestOptions) {
|
|
285
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerById(request, requestOptions));
|
|
636
286
|
}
|
|
637
|
-
|
|
638
|
-
return __awaiter(this,
|
|
287
|
+
__updateCustomerById(request, requestOptions) {
|
|
288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
639
289
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
640
|
-
const {
|
|
641
|
-
const _queryParams = {};
|
|
642
|
-
if (limit != null) {
|
|
643
|
-
_queryParams.limit = limit.toString();
|
|
644
|
-
}
|
|
645
|
-
if (offset != null) {
|
|
646
|
-
_queryParams.offset = offset.toString();
|
|
647
|
-
}
|
|
648
|
-
if (startTime != null) {
|
|
649
|
-
_queryParams.startTime = startTime;
|
|
650
|
-
}
|
|
651
|
-
if (endTime != null) {
|
|
652
|
-
_queryParams.endTime = endTime;
|
|
653
|
-
}
|
|
290
|
+
const { id, body: _body } = request;
|
|
654
291
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
655
292
|
const _response = yield core.fetcher({
|
|
656
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
657
|
-
method: "
|
|
293
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
294
|
+
method: "PUT",
|
|
658
295
|
headers: _headers,
|
|
659
|
-
|
|
296
|
+
contentType: "application/json",
|
|
297
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
298
|
+
requestType: "json",
|
|
299
|
+
body: _body,
|
|
660
300
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
661
301
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
662
302
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -672,6 +312,8 @@ class Customers {
|
|
|
672
312
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
673
313
|
case 404:
|
|
674
314
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
315
|
+
case 500:
|
|
316
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
675
317
|
default:
|
|
676
318
|
throw new errors.PaidError({
|
|
677
319
|
statusCode: _response.error.statusCode,
|
|
@@ -688,7 +330,7 @@ class Customers {
|
|
|
688
330
|
rawResponse: _response.rawResponse,
|
|
689
331
|
});
|
|
690
332
|
case "timeout":
|
|
691
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
333
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}.");
|
|
692
334
|
case "unknown":
|
|
693
335
|
throw new errors.PaidError({
|
|
694
336
|
message: _response.error.errorMessage,
|
|
@@ -698,48 +340,33 @@ class Customers {
|
|
|
698
340
|
});
|
|
699
341
|
}
|
|
700
342
|
/**
|
|
701
|
-
*
|
|
702
|
-
*
|
|
343
|
+
* Delete a customer by ID
|
|
344
|
+
*
|
|
345
|
+
* @param {Paid.DeleteCustomerByIdRequest} request
|
|
703
346
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
704
347
|
*
|
|
705
|
-
* @throws {@link Paid.BadRequestError}
|
|
706
348
|
* @throws {@link Paid.ForbiddenError}
|
|
707
349
|
* @throws {@link Paid.NotFoundError}
|
|
350
|
+
* @throws {@link Paid.InternalServerError}
|
|
708
351
|
*
|
|
709
352
|
* @example
|
|
710
|
-
* await client.customers.
|
|
711
|
-
*
|
|
712
|
-
* offset: 1,
|
|
713
|
-
* startTime: "2024-01-15T09:30:00Z",
|
|
714
|
-
* endTime: "2024-01-15T09:30:00Z"
|
|
353
|
+
* await client.customers.deleteCustomerById({
|
|
354
|
+
* id: "id"
|
|
715
355
|
* })
|
|
716
356
|
*/
|
|
717
|
-
|
|
718
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
357
|
+
deleteCustomerById(request, requestOptions) {
|
|
358
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerById(request, requestOptions));
|
|
719
359
|
}
|
|
720
|
-
|
|
721
|
-
return __awaiter(this,
|
|
360
|
+
__deleteCustomerById(request, requestOptions) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
722
362
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
723
|
-
const {
|
|
724
|
-
const _queryParams = {};
|
|
725
|
-
if (limit != null) {
|
|
726
|
-
_queryParams.limit = limit.toString();
|
|
727
|
-
}
|
|
728
|
-
if (offset != null) {
|
|
729
|
-
_queryParams.offset = offset.toString();
|
|
730
|
-
}
|
|
731
|
-
if (startTime != null) {
|
|
732
|
-
_queryParams.startTime = startTime;
|
|
733
|
-
}
|
|
734
|
-
if (endTime != null) {
|
|
735
|
-
_queryParams.endTime = endTime;
|
|
736
|
-
}
|
|
363
|
+
const { id } = request;
|
|
737
364
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
738
365
|
const _response = yield core.fetcher({
|
|
739
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
740
|
-
method: "
|
|
366
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}`),
|
|
367
|
+
method: "DELETE",
|
|
741
368
|
headers: _headers,
|
|
742
|
-
queryParameters:
|
|
369
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
743
370
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
744
371
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
745
372
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -749,12 +376,12 @@ class Customers {
|
|
|
749
376
|
}
|
|
750
377
|
if (_response.error.reason === "status-code") {
|
|
751
378
|
switch (_response.error.statusCode) {
|
|
752
|
-
case 400:
|
|
753
|
-
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
754
379
|
case 403:
|
|
755
380
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
756
381
|
case 404:
|
|
757
382
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
383
|
+
case 500:
|
|
384
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
758
385
|
default:
|
|
759
386
|
throw new errors.PaidError({
|
|
760
387
|
statusCode: _response.error.statusCode,
|
|
@@ -771,7 +398,7 @@ class Customers {
|
|
|
771
398
|
rawResponse: _response.rawResponse,
|
|
772
399
|
});
|
|
773
400
|
case "timeout":
|
|
774
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
401
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}.");
|
|
775
402
|
case "unknown":
|
|
776
403
|
throw new errors.PaidError({
|
|
777
404
|
message: _response.error.errorMessage,
|
|
@@ -781,26 +408,30 @@ class Customers {
|
|
|
781
408
|
});
|
|
782
409
|
}
|
|
783
410
|
/**
|
|
784
|
-
*
|
|
411
|
+
* Get a customer by external ID
|
|
785
412
|
*
|
|
786
|
-
* @param {
|
|
413
|
+
* @param {Paid.GetCustomerByExternalIdRequest} request
|
|
787
414
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
788
415
|
*
|
|
789
416
|
* @throws {@link Paid.ForbiddenError}
|
|
790
417
|
* @throws {@link Paid.NotFoundError}
|
|
418
|
+
* @throws {@link Paid.InternalServerError}
|
|
791
419
|
*
|
|
792
420
|
* @example
|
|
793
|
-
* await client.customers.
|
|
421
|
+
* await client.customers.getCustomerByExternalId({
|
|
422
|
+
* externalId: "externalId"
|
|
423
|
+
* })
|
|
794
424
|
*/
|
|
795
|
-
|
|
796
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
425
|
+
getCustomerByExternalId(request, requestOptions) {
|
|
426
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerByExternalId(request, requestOptions));
|
|
797
427
|
}
|
|
798
|
-
|
|
428
|
+
__getCustomerByExternalId(request, requestOptions) {
|
|
799
429
|
return __awaiter(this, void 0, void 0, function* () {
|
|
800
430
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
431
|
+
const { externalId } = request;
|
|
801
432
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
802
433
|
const _response = yield core.fetcher({
|
|
803
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
434
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
804
435
|
method: "GET",
|
|
805
436
|
headers: _headers,
|
|
806
437
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -817,6 +448,8 @@ class Customers {
|
|
|
817
448
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
818
449
|
case 404:
|
|
819
450
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
451
|
+
case 500:
|
|
452
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
820
453
|
default:
|
|
821
454
|
throw new errors.PaidError({
|
|
822
455
|
statusCode: _response.error.statusCode,
|
|
@@ -833,7 +466,7 @@ class Customers {
|
|
|
833
466
|
rawResponse: _response.rawResponse,
|
|
834
467
|
});
|
|
835
468
|
case "timeout":
|
|
836
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}
|
|
469
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}.");
|
|
837
470
|
case "unknown":
|
|
838
471
|
throw new errors.PaidError({
|
|
839
472
|
message: _response.error.errorMessage,
|
|
@@ -843,40 +476,38 @@ class Customers {
|
|
|
843
476
|
});
|
|
844
477
|
}
|
|
845
478
|
/**
|
|
846
|
-
*
|
|
479
|
+
* Update a customer by external ID
|
|
847
480
|
*
|
|
848
|
-
* @param {
|
|
849
|
-
* @param {Paid.CustomersCreatePaymentMethodRequest} request
|
|
481
|
+
* @param {Paid.UpdateCustomerByExternalIdRequest} request
|
|
850
482
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
851
483
|
*
|
|
852
484
|
* @throws {@link Paid.BadRequestError}
|
|
853
485
|
* @throws {@link Paid.ForbiddenError}
|
|
854
486
|
* @throws {@link Paid.NotFoundError}
|
|
487
|
+
* @throws {@link Paid.InternalServerError}
|
|
855
488
|
*
|
|
856
489
|
* @example
|
|
857
|
-
* await client.customers.
|
|
858
|
-
*
|
|
859
|
-
*
|
|
860
|
-
* metadata: {
|
|
861
|
-
* "source": "api"
|
|
862
|
-
* }
|
|
490
|
+
* await client.customers.updateCustomerByExternalId({
|
|
491
|
+
* externalId: "externalId",
|
|
492
|
+
* body: {}
|
|
863
493
|
* })
|
|
864
494
|
*/
|
|
865
|
-
|
|
866
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
495
|
+
updateCustomerByExternalId(request, requestOptions) {
|
|
496
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomerByExternalId(request, requestOptions));
|
|
867
497
|
}
|
|
868
|
-
|
|
498
|
+
__updateCustomerByExternalId(request, requestOptions) {
|
|
869
499
|
return __awaiter(this, void 0, void 0, function* () {
|
|
870
500
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
501
|
+
const { externalId, body: _body } = request;
|
|
871
502
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
872
503
|
const _response = yield core.fetcher({
|
|
873
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
874
|
-
method: "
|
|
504
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
505
|
+
method: "PUT",
|
|
875
506
|
headers: _headers,
|
|
876
507
|
contentType: "application/json",
|
|
877
508
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
878
509
|
requestType: "json",
|
|
879
|
-
body:
|
|
510
|
+
body: _body,
|
|
880
511
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
881
512
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
882
513
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -892,6 +523,8 @@ class Customers {
|
|
|
892
523
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
893
524
|
case 404:
|
|
894
525
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
526
|
+
case 500:
|
|
527
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
895
528
|
default:
|
|
896
529
|
throw new errors.PaidError({
|
|
897
530
|
statusCode: _response.error.statusCode,
|
|
@@ -908,7 +541,7 @@ class Customers {
|
|
|
908
541
|
rawResponse: _response.rawResponse,
|
|
909
542
|
});
|
|
910
543
|
case "timeout":
|
|
911
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling
|
|
544
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}.");
|
|
912
545
|
case "unknown":
|
|
913
546
|
throw new errors.PaidError({
|
|
914
547
|
message: _response.error.errorMessage,
|
|
@@ -918,27 +551,30 @@ class Customers {
|
|
|
918
551
|
});
|
|
919
552
|
}
|
|
920
553
|
/**
|
|
921
|
-
*
|
|
554
|
+
* Delete a customer by external ID
|
|
922
555
|
*
|
|
923
|
-
* @param {
|
|
924
|
-
* @param {string} paymentMethodId - The ID of the payment method to delete
|
|
556
|
+
* @param {Paid.DeleteCustomerByExternalIdRequest} request
|
|
925
557
|
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
926
558
|
*
|
|
927
559
|
* @throws {@link Paid.ForbiddenError}
|
|
928
560
|
* @throws {@link Paid.NotFoundError}
|
|
561
|
+
* @throws {@link Paid.InternalServerError}
|
|
929
562
|
*
|
|
930
563
|
* @example
|
|
931
|
-
* await client.customers.
|
|
564
|
+
* await client.customers.deleteCustomerByExternalId({
|
|
565
|
+
* externalId: "externalId"
|
|
566
|
+
* })
|
|
932
567
|
*/
|
|
933
|
-
|
|
934
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
568
|
+
deleteCustomerByExternalId(request, requestOptions) {
|
|
569
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomerByExternalId(request, requestOptions));
|
|
935
570
|
}
|
|
936
|
-
|
|
571
|
+
__deleteCustomerByExternalId(request, requestOptions) {
|
|
937
572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
938
573
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
574
|
+
const { externalId } = request;
|
|
939
575
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
940
576
|
const _response = yield core.fetcher({
|
|
941
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.
|
|
577
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}`),
|
|
942
578
|
method: "DELETE",
|
|
943
579
|
headers: _headers,
|
|
944
580
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -947,7 +583,7 @@ class Customers {
|
|
|
947
583
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
948
584
|
});
|
|
949
585
|
if (_response.ok) {
|
|
950
|
-
return { data:
|
|
586
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
951
587
|
}
|
|
952
588
|
if (_response.error.reason === "status-code") {
|
|
953
589
|
switch (_response.error.statusCode) {
|
|
@@ -955,6 +591,8 @@ class Customers {
|
|
|
955
591
|
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
956
592
|
case 404:
|
|
957
593
|
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
594
|
+
case 500:
|
|
595
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
958
596
|
default:
|
|
959
597
|
throw new errors.PaidError({
|
|
960
598
|
statusCode: _response.error.statusCode,
|
|
@@ -971,7 +609,7 @@ class Customers {
|
|
|
971
609
|
rawResponse: _response.rawResponse,
|
|
972
610
|
});
|
|
973
611
|
case "timeout":
|
|
974
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}
|
|
612
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}.");
|
|
975
613
|
case "unknown":
|
|
976
614
|
throw new errors.PaidError({
|
|
977
615
|
message: _response.error.errorMessage,
|
|
@@ -982,11 +620,7 @@ class Customers {
|
|
|
982
620
|
}
|
|
983
621
|
_getAuthorizationHeader() {
|
|
984
622
|
return __awaiter(this, void 0, void 0, function* () {
|
|
985
|
-
|
|
986
|
-
if (bearer != null) {
|
|
987
|
-
return `Bearer ${bearer}`;
|
|
988
|
-
}
|
|
989
|
-
return undefined;
|
|
623
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
990
624
|
});
|
|
991
625
|
}
|
|
992
626
|
}
|