@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
|
@@ -48,28 +48,44 @@ const headers_js_1 = require("../../../../core/headers.js");
|
|
|
48
48
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
49
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
+
const Paid = __importStar(require("../../../index.js"));
|
|
51
52
|
class Products {
|
|
52
|
-
constructor(_options
|
|
53
|
+
constructor(_options) {
|
|
53
54
|
this._options = _options;
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
57
|
+
* Get a list of products for the organization
|
|
58
|
+
*
|
|
59
|
+
* @param {Paid.ListProductsRequest} request
|
|
56
60
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
61
|
*
|
|
62
|
+
* @throws {@link Paid.BadRequestError}
|
|
63
|
+
* @throws {@link Paid.ForbiddenError}
|
|
64
|
+
* @throws {@link Paid.InternalServerError}
|
|
65
|
+
*
|
|
58
66
|
* @example
|
|
59
|
-
* await client.products.
|
|
67
|
+
* await client.products.listProducts()
|
|
60
68
|
*/
|
|
61
|
-
|
|
62
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
69
|
+
listProducts(request = {}, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__listProducts(request, requestOptions));
|
|
63
71
|
}
|
|
64
|
-
|
|
65
|
-
return __awaiter(this,
|
|
72
|
+
__listProducts() {
|
|
73
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
66
74
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
75
|
+
const { limit, offset } = request;
|
|
76
|
+
const _queryParams = {};
|
|
77
|
+
if (limit != null) {
|
|
78
|
+
_queryParams.limit = limit.toString();
|
|
79
|
+
}
|
|
80
|
+
if (offset != null) {
|
|
81
|
+
_queryParams.offset = offset.toString();
|
|
82
|
+
}
|
|
67
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);
|
|
68
84
|
const _response = yield core.fetcher({
|
|
69
|
-
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, "products/"),
|
|
70
86
|
method: "GET",
|
|
71
87
|
headers: _headers,
|
|
72
|
-
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),
|
|
73
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,
|
|
74
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,
|
|
75
91
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -78,11 +94,20 @@ class Products {
|
|
|
78
94
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
79
95
|
}
|
|
80
96
|
if (_response.error.reason === "status-code") {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
}
|
|
86
111
|
}
|
|
87
112
|
switch (_response.error.reason) {
|
|
88
113
|
case "non-json":
|
|
@@ -92,7 +117,7 @@ class Products {
|
|
|
92
117
|
rawResponse: _response.rawResponse,
|
|
93
118
|
});
|
|
94
119
|
case "timeout":
|
|
95
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /products
|
|
120
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /products/.");
|
|
96
121
|
case "unknown":
|
|
97
122
|
throw new errors.PaidError({
|
|
98
123
|
message: _response.error.errorMessage,
|
|
@@ -102,26 +127,29 @@ class Products {
|
|
|
102
127
|
});
|
|
103
128
|
}
|
|
104
129
|
/**
|
|
105
|
-
*
|
|
130
|
+
* Creates a new product for the organization
|
|
131
|
+
*
|
|
132
|
+
* @param {Paid.CreateProductRequest} request
|
|
106
133
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
134
|
*
|
|
135
|
+
* @throws {@link Paid.BadRequestError}
|
|
136
|
+
* @throws {@link Paid.ForbiddenError}
|
|
137
|
+
* @throws {@link Paid.InternalServerError}
|
|
138
|
+
*
|
|
108
139
|
* @example
|
|
109
|
-
* await client.products.
|
|
110
|
-
* name: "
|
|
111
|
-
* description: "Acme Product does amazing things.",
|
|
112
|
-
* externalId: "acme-product",
|
|
113
|
-
* type: "product"
|
|
140
|
+
* await client.products.createProduct({
|
|
141
|
+
* name: "name"
|
|
114
142
|
* })
|
|
115
143
|
*/
|
|
116
|
-
|
|
117
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
144
|
+
createProduct(request, requestOptions) {
|
|
145
|
+
return core.HttpResponsePromise.fromPromise(this.__createProduct(request, requestOptions));
|
|
118
146
|
}
|
|
119
|
-
|
|
147
|
+
__createProduct(request, requestOptions) {
|
|
120
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
149
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
122
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);
|
|
123
151
|
const _response = yield core.fetcher({
|
|
124
|
-
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.
|
|
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, "products/"),
|
|
125
153
|
method: "POST",
|
|
126
154
|
headers: _headers,
|
|
127
155
|
contentType: "application/json",
|
|
@@ -136,11 +164,20 @@ class Products {
|
|
|
136
164
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
137
165
|
}
|
|
138
166
|
if (_response.error.reason === "status-code") {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
167
|
+
switch (_response.error.statusCode) {
|
|
168
|
+
case 400:
|
|
169
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
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);
|
|
174
|
+
default:
|
|
175
|
+
throw new errors.PaidError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.body,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
144
181
|
}
|
|
145
182
|
switch (_response.error.reason) {
|
|
146
183
|
case "non-json":
|
|
@@ -150,7 +187,7 @@ class Products {
|
|
|
150
187
|
rawResponse: _response.rawResponse,
|
|
151
188
|
});
|
|
152
189
|
case "timeout":
|
|
153
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /products
|
|
190
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /products/.");
|
|
154
191
|
case "unknown":
|
|
155
192
|
throw new errors.PaidError({
|
|
156
193
|
message: _response.error.errorMessage,
|
|
@@ -160,21 +197,30 @@ class Products {
|
|
|
160
197
|
});
|
|
161
198
|
}
|
|
162
199
|
/**
|
|
163
|
-
*
|
|
200
|
+
* Get a product by ID
|
|
201
|
+
*
|
|
202
|
+
* @param {Paid.GetProductByIdRequest} request
|
|
164
203
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
165
204
|
*
|
|
205
|
+
* @throws {@link Paid.ForbiddenError}
|
|
206
|
+
* @throws {@link Paid.NotFoundError}
|
|
207
|
+
* @throws {@link Paid.InternalServerError}
|
|
208
|
+
*
|
|
166
209
|
* @example
|
|
167
|
-
* await client.products.
|
|
210
|
+
* await client.products.getProductById({
|
|
211
|
+
* id: "id"
|
|
212
|
+
* })
|
|
168
213
|
*/
|
|
169
|
-
|
|
170
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
214
|
+
getProductById(request, requestOptions) {
|
|
215
|
+
return core.HttpResponsePromise.fromPromise(this.__getProductById(request, requestOptions));
|
|
171
216
|
}
|
|
172
|
-
|
|
217
|
+
__getProductById(request, requestOptions) {
|
|
173
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
174
219
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
220
|
+
const { id } = request;
|
|
175
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);
|
|
176
222
|
const _response = yield core.fetcher({
|
|
177
|
-
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, `products/${core.url.encodePathParam(id)}`),
|
|
178
224
|
method: "GET",
|
|
179
225
|
headers: _headers,
|
|
180
226
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -186,11 +232,20 @@ class Products {
|
|
|
186
232
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
187
233
|
}
|
|
188
234
|
if (_response.error.reason === "status-code") {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
235
|
+
switch (_response.error.statusCode) {
|
|
236
|
+
case 403:
|
|
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);
|
|
242
|
+
default:
|
|
243
|
+
throw new errors.PaidError({
|
|
244
|
+
statusCode: _response.error.statusCode,
|
|
245
|
+
body: _response.error.body,
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
194
249
|
}
|
|
195
250
|
switch (_response.error.reason) {
|
|
196
251
|
case "non-json":
|
|
@@ -200,7 +255,7 @@ class Products {
|
|
|
200
255
|
rawResponse: _response.rawResponse,
|
|
201
256
|
});
|
|
202
257
|
case "timeout":
|
|
203
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /products/{
|
|
258
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /products/{id}.");
|
|
204
259
|
case "unknown":
|
|
205
260
|
throw new errors.PaidError({
|
|
206
261
|
message: _response.error.errorMessage,
|
|
@@ -210,28 +265,38 @@ class Products {
|
|
|
210
265
|
});
|
|
211
266
|
}
|
|
212
267
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
268
|
+
* Update a product by ID
|
|
269
|
+
*
|
|
270
|
+
* @param {Paid.UpdateProductByIdRequest} request
|
|
215
271
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
216
272
|
*
|
|
273
|
+
* @throws {@link Paid.BadRequestError}
|
|
274
|
+
* @throws {@link Paid.ForbiddenError}
|
|
275
|
+
* @throws {@link Paid.NotFoundError}
|
|
276
|
+
* @throws {@link Paid.InternalServerError}
|
|
277
|
+
*
|
|
217
278
|
* @example
|
|
218
|
-
* await client.products.
|
|
279
|
+
* await client.products.updateProductById({
|
|
280
|
+
* id: "id",
|
|
281
|
+
* body: {}
|
|
282
|
+
* })
|
|
219
283
|
*/
|
|
220
|
-
|
|
221
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
284
|
+
updateProductById(request, requestOptions) {
|
|
285
|
+
return core.HttpResponsePromise.fromPromise(this.__updateProductById(request, requestOptions));
|
|
222
286
|
}
|
|
223
|
-
|
|
287
|
+
__updateProductById(request, requestOptions) {
|
|
224
288
|
return __awaiter(this, void 0, void 0, function* () {
|
|
225
289
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
290
|
+
const { id, body: _body } = request;
|
|
226
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);
|
|
227
292
|
const _response = yield core.fetcher({
|
|
228
|
-
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.
|
|
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, `products/${core.url.encodePathParam(id)}`),
|
|
229
294
|
method: "PUT",
|
|
230
295
|
headers: _headers,
|
|
231
296
|
contentType: "application/json",
|
|
232
297
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
233
298
|
requestType: "json",
|
|
234
|
-
body:
|
|
299
|
+
body: _body,
|
|
235
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,
|
|
236
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,
|
|
237
302
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -240,11 +305,22 @@ class Products {
|
|
|
240
305
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
241
306
|
}
|
|
242
307
|
if (_response.error.reason === "status-code") {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
308
|
+
switch (_response.error.statusCode) {
|
|
309
|
+
case 400:
|
|
310
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
311
|
+
case 403:
|
|
312
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
313
|
+
case 404:
|
|
314
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
315
|
+
case 500:
|
|
316
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
317
|
+
default:
|
|
318
|
+
throw new errors.PaidError({
|
|
319
|
+
statusCode: _response.error.statusCode,
|
|
320
|
+
body: _response.error.body,
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
248
324
|
}
|
|
249
325
|
switch (_response.error.reason) {
|
|
250
326
|
case "non-json":
|
|
@@ -254,7 +330,7 @@ class Products {
|
|
|
254
330
|
rawResponse: _response.rawResponse,
|
|
255
331
|
});
|
|
256
332
|
case "timeout":
|
|
257
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /products/{
|
|
333
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /products/{id}.");
|
|
258
334
|
case "unknown":
|
|
259
335
|
throw new errors.PaidError({
|
|
260
336
|
message: _response.error.errorMessage,
|
|
@@ -264,71 +340,30 @@ class Products {
|
|
|
264
340
|
});
|
|
265
341
|
}
|
|
266
342
|
/**
|
|
267
|
-
*
|
|
268
|
-
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
343
|
+
* Get a product by external ID
|
|
269
344
|
*
|
|
270
|
-
* @
|
|
271
|
-
* await client.products.delete("productId")
|
|
272
|
-
*/
|
|
273
|
-
delete(productId, requestOptions) {
|
|
274
|
-
return core.HttpResponsePromise.fromPromise(this.__delete(productId, requestOptions));
|
|
275
|
-
}
|
|
276
|
-
__delete(productId, requestOptions) {
|
|
277
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
279
|
-
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);
|
|
280
|
-
const _response = yield core.fetcher({
|
|
281
|
-
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, `products/${core.url.encodePathParam(productId)}`),
|
|
282
|
-
method: "DELETE",
|
|
283
|
-
headers: _headers,
|
|
284
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
285
|
-
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,
|
|
286
|
-
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,
|
|
287
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
288
|
-
});
|
|
289
|
-
if (_response.ok) {
|
|
290
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
291
|
-
}
|
|
292
|
-
if (_response.error.reason === "status-code") {
|
|
293
|
-
throw new errors.PaidError({
|
|
294
|
-
statusCode: _response.error.statusCode,
|
|
295
|
-
body: _response.error.body,
|
|
296
|
-
rawResponse: _response.rawResponse,
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
switch (_response.error.reason) {
|
|
300
|
-
case "non-json":
|
|
301
|
-
throw new errors.PaidError({
|
|
302
|
-
statusCode: _response.error.statusCode,
|
|
303
|
-
body: _response.error.rawBody,
|
|
304
|
-
rawResponse: _response.rawResponse,
|
|
305
|
-
});
|
|
306
|
-
case "timeout":
|
|
307
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /products/{productId}.");
|
|
308
|
-
case "unknown":
|
|
309
|
-
throw new errors.PaidError({
|
|
310
|
-
message: _response.error.errorMessage,
|
|
311
|
-
rawResponse: _response.rawResponse,
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @param {string} externalId
|
|
345
|
+
* @param {Paid.GetProductByExternalIdRequest} request
|
|
318
346
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
319
347
|
*
|
|
348
|
+
* @throws {@link Paid.ForbiddenError}
|
|
349
|
+
* @throws {@link Paid.NotFoundError}
|
|
350
|
+
* @throws {@link Paid.InternalServerError}
|
|
351
|
+
*
|
|
320
352
|
* @example
|
|
321
|
-
* await client.products.
|
|
353
|
+
* await client.products.getProductByExternalId({
|
|
354
|
+
* externalId: "externalId"
|
|
355
|
+
* })
|
|
322
356
|
*/
|
|
323
|
-
|
|
324
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
357
|
+
getProductByExternalId(request, requestOptions) {
|
|
358
|
+
return core.HttpResponsePromise.fromPromise(this.__getProductByExternalId(request, requestOptions));
|
|
325
359
|
}
|
|
326
|
-
|
|
360
|
+
__getProductByExternalId(request, requestOptions) {
|
|
327
361
|
return __awaiter(this, void 0, void 0, function* () {
|
|
328
362
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
363
|
+
const { externalId } = request;
|
|
329
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);
|
|
330
365
|
const _response = yield core.fetcher({
|
|
331
|
-
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.
|
|
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, `products/external/${core.url.encodePathParam(externalId)}`),
|
|
332
367
|
method: "GET",
|
|
333
368
|
headers: _headers,
|
|
334
369
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -340,11 +375,20 @@ class Products {
|
|
|
340
375
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
341
376
|
}
|
|
342
377
|
if (_response.error.reason === "status-code") {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
378
|
+
switch (_response.error.statusCode) {
|
|
379
|
+
case 403:
|
|
380
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
381
|
+
case 404:
|
|
382
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
383
|
+
case 500:
|
|
384
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
385
|
+
default:
|
|
386
|
+
throw new errors.PaidError({
|
|
387
|
+
statusCode: _response.error.statusCode,
|
|
388
|
+
body: _response.error.body,
|
|
389
|
+
rawResponse: _response.rawResponse,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
348
392
|
}
|
|
349
393
|
switch (_response.error.reason) {
|
|
350
394
|
case "non-json":
|
|
@@ -364,28 +408,38 @@ class Products {
|
|
|
364
408
|
});
|
|
365
409
|
}
|
|
366
410
|
/**
|
|
367
|
-
*
|
|
368
|
-
*
|
|
411
|
+
* Update a product by external ID
|
|
412
|
+
*
|
|
413
|
+
* @param {Paid.UpdateProductByExternalIdRequest} request
|
|
369
414
|
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
370
415
|
*
|
|
416
|
+
* @throws {@link Paid.BadRequestError}
|
|
417
|
+
* @throws {@link Paid.ForbiddenError}
|
|
418
|
+
* @throws {@link Paid.NotFoundError}
|
|
419
|
+
* @throws {@link Paid.InternalServerError}
|
|
420
|
+
*
|
|
371
421
|
* @example
|
|
372
|
-
* await client.products.
|
|
422
|
+
* await client.products.updateProductByExternalId({
|
|
423
|
+
* externalId: "externalId",
|
|
424
|
+
* body: {}
|
|
425
|
+
* })
|
|
373
426
|
*/
|
|
374
|
-
|
|
375
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
427
|
+
updateProductByExternalId(request, requestOptions) {
|
|
428
|
+
return core.HttpResponsePromise.fromPromise(this.__updateProductByExternalId(request, requestOptions));
|
|
376
429
|
}
|
|
377
|
-
|
|
430
|
+
__updateProductByExternalId(request, requestOptions) {
|
|
378
431
|
return __awaiter(this, void 0, void 0, function* () {
|
|
379
432
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
433
|
+
const { externalId, body: _body } = request;
|
|
380
434
|
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);
|
|
381
435
|
const _response = yield core.fetcher({
|
|
382
|
-
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.
|
|
436
|
+
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, `products/external/${core.url.encodePathParam(externalId)}`),
|
|
383
437
|
method: "PUT",
|
|
384
438
|
headers: _headers,
|
|
385
439
|
contentType: "application/json",
|
|
386
440
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
387
441
|
requestType: "json",
|
|
388
|
-
body:
|
|
442
|
+
body: _body,
|
|
389
443
|
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,
|
|
390
444
|
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,
|
|
391
445
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -394,11 +448,22 @@ class Products {
|
|
|
394
448
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
395
449
|
}
|
|
396
450
|
if (_response.error.reason === "status-code") {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
451
|
+
switch (_response.error.statusCode) {
|
|
452
|
+
case 400:
|
|
453
|
+
throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
|
|
454
|
+
case 403:
|
|
455
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
456
|
+
case 404:
|
|
457
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
458
|
+
case 500:
|
|
459
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
460
|
+
default:
|
|
461
|
+
throw new errors.PaidError({
|
|
462
|
+
statusCode: _response.error.statusCode,
|
|
463
|
+
body: _response.error.body,
|
|
464
|
+
rawResponse: _response.rawResponse,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
402
467
|
}
|
|
403
468
|
switch (_response.error.reason) {
|
|
404
469
|
case "non-json":
|
|
@@ -417,63 +482,9 @@ class Products {
|
|
|
417
482
|
}
|
|
418
483
|
});
|
|
419
484
|
}
|
|
420
|
-
/**
|
|
421
|
-
* @param {string} externalId
|
|
422
|
-
* @param {Products.RequestOptions} requestOptions - Request-specific configuration.
|
|
423
|
-
*
|
|
424
|
-
* @example
|
|
425
|
-
* await client.products.deleteByExternalId("externalId")
|
|
426
|
-
*/
|
|
427
|
-
deleteByExternalId(externalId, requestOptions) {
|
|
428
|
-
return core.HttpResponsePromise.fromPromise(this.__deleteByExternalId(externalId, requestOptions));
|
|
429
|
-
}
|
|
430
|
-
__deleteByExternalId(externalId, requestOptions) {
|
|
431
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
432
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
433
|
-
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);
|
|
434
|
-
const _response = yield core.fetcher({
|
|
435
|
-
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, `products/external/${core.url.encodePathParam(externalId)}`),
|
|
436
|
-
method: "DELETE",
|
|
437
|
-
headers: _headers,
|
|
438
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
439
|
-
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,
|
|
440
|
-
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,
|
|
441
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
442
|
-
});
|
|
443
|
-
if (_response.ok) {
|
|
444
|
-
return { data: undefined, rawResponse: _response.rawResponse };
|
|
445
|
-
}
|
|
446
|
-
if (_response.error.reason === "status-code") {
|
|
447
|
-
throw new errors.PaidError({
|
|
448
|
-
statusCode: _response.error.statusCode,
|
|
449
|
-
body: _response.error.body,
|
|
450
|
-
rawResponse: _response.rawResponse,
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
switch (_response.error.reason) {
|
|
454
|
-
case "non-json":
|
|
455
|
-
throw new errors.PaidError({
|
|
456
|
-
statusCode: _response.error.statusCode,
|
|
457
|
-
body: _response.error.rawBody,
|
|
458
|
-
rawResponse: _response.rawResponse,
|
|
459
|
-
});
|
|
460
|
-
case "timeout":
|
|
461
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /products/external/{externalId}.");
|
|
462
|
-
case "unknown":
|
|
463
|
-
throw new errors.PaidError({
|
|
464
|
-
message: _response.error.errorMessage,
|
|
465
|
-
rawResponse: _response.rawResponse,
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
485
|
_getAuthorizationHeader() {
|
|
471
486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
472
|
-
|
|
473
|
-
if (bearer != null) {
|
|
474
|
-
return `Bearer ${bearer}`;
|
|
475
|
-
}
|
|
476
|
-
return undefined;
|
|
487
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
477
488
|
});
|
|
478
489
|
}
|
|
479
490
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* name: "name"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface CreateProductRequest {
|
|
8
|
+
name: string;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
productCode?: string | null;
|
|
12
|
+
externalId?: string | null;
|
|
13
|
+
metadata?: Record<string, unknown> | null;
|
|
14
|
+
}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { CreateProductRequest } from "./CreateProductRequest.js";
|
|
2
|
+
export type { GetProductByExternalIdRequest } from "./GetProductByExternalIdRequest.js";
|
|
3
|
+
export type { GetProductByIdRequest } from "./GetProductByIdRequest.js";
|
|
4
|
+
export type { ListProductsRequest } from "./ListProductsRequest.js";
|
|
5
|
+
export type { UpdateProductByExternalIdRequest } from "./UpdateProductByExternalIdRequest.js";
|
|
6
|
+
export type { UpdateProductByIdRequest } from "./UpdateProductByIdRequest.js";
|