@paid-ai/paid-node 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/cjs/BaseClient.d.ts +39 -0
- package/dist/cjs/BaseClient.js +62 -0
- package/dist/cjs/Client.d.ts +30 -93
- package/dist/cjs/Client.js +19 -128
- package/dist/cjs/api/errors/BadRequestError.d.ts +2 -5
- package/dist/cjs/api/errors/BadRequestError.js +6 -4
- package/dist/cjs/api/errors/ForbiddenError.d.ts +2 -5
- package/dist/cjs/api/errors/ForbiddenError.js +6 -4
- package/dist/cjs/api/errors/InternalServerError.d.ts +2 -5
- package/dist/cjs/api/errors/InternalServerError.js +6 -4
- package/dist/cjs/api/errors/NotFoundError.d.ts +2 -5
- package/dist/cjs/api/errors/NotFoundError.js +6 -4
- package/dist/cjs/api/errors/index.d.ts +2 -2
- package/dist/cjs/api/errors/index.js +2 -2
- package/dist/cjs/api/index.d.ts +1 -1
- package/dist/cjs/api/index.js +1 -1
- package/dist/cjs/api/resources/agents/client/Client.d.ts +25 -43
- package/dist/cjs/api/resources/agents/client/Client.js +98 -191
- package/dist/cjs/api/resources/agents/client/requests/AgentCreate.d.ts +0 -3
- package/dist/cjs/api/resources/agents/client/requests/AgentCreate.js +1 -3
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +21 -39
- package/dist/cjs/api/resources/contacts/client/Client.js +76 -149
- package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.d.ts +1 -4
- package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.js +1 -3
- package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/customers/client/Client.d.ts +111 -49
- package/dist/cjs/api/resources/customers/client/Client.js +374 -276
- package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.d.ts +17 -5
- package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.js +1 -3
- package/dist/cjs/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.d.ts +14 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.d.ts +18 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.ts +4 -15
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.js +1 -3
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.ts +4 -15
- package/dist/cjs/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.js +1 -3
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +5 -3
- package/dist/cjs/api/resources/customers/index.d.ts +1 -0
- package/dist/cjs/api/resources/customers/index.js +1 -0
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementRequestView.d.ts +5 -0
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementRequestView.js +8 -0
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementResponse.d.ts +4 -0
- package/dist/cjs/api/resources/customers/types/CustomersCheckEntitlementResponse.js +3 -0
- package/dist/cjs/api/resources/customers/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/customers/types/index.js +18 -0
- package/dist/cjs/api/resources/index.d.ts +12 -11
- package/dist/cjs/api/resources/index.js +16 -15
- package/dist/cjs/api/resources/orders/client/Client.d.ts +100 -39
- package/dist/cjs/api/resources/orders/client/Client.js +300 -124
- package/dist/cjs/api/resources/orders/client/requests/CancelRenewalRequest.d.ts +13 -0
- package/dist/cjs/api/resources/orders/client/requests/CancelRenewalRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/OrderCreate.d.ts +1 -4
- package/dist/cjs/api/resources/orders/client/requests/OrderCreate.js +1 -3
- package/dist/cjs/api/resources/orders/client/requests/OrdersActivateAndPayRequest.d.ts +13 -0
- package/dist/cjs/api/resources/orders/client/requests/OrdersActivateAndPayRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/ProrationUpgradeRequest.d.ts +24 -0
- package/dist/cjs/api/resources/orders/client/requests/ProrationUpgradeRequest.js +3 -0
- package/dist/cjs/api/resources/orders/client/requests/index.d.ts +4 -1
- package/dist/cjs/api/resources/orders/resources/index.d.ts +1 -1
- package/dist/cjs/api/resources/orders/resources/index.js +4 -4
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +11 -29
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +21 -44
- package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.ts +1 -4
- package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.js +1 -3
- package/dist/cjs/api/resources/orders/resources/lines/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/plans/client/Client.d.ts +14 -32
- package/dist/cjs/api/resources/plans/client/Client.js +51 -102
- package/dist/cjs/api/resources/plans/client/requests/PlansGetUsageRequest.d.ts +5 -18
- package/dist/cjs/api/resources/plans/client/requests/PlansGetUsageRequest.js +1 -3
- package/dist/cjs/api/resources/plans/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/products/client/Client.d.ts +25 -43
- package/dist/cjs/api/resources/products/client/Client.js +98 -191
- package/dist/cjs/api/resources/products/client/requests/ProductCreate.d.ts +1 -4
- package/dist/cjs/api/resources/products/client/requests/ProductCreate.js +1 -3
- package/dist/cjs/api/resources/products/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/products/client/requests/index.js +3 -0
- package/dist/cjs/api/resources/traces/client/Client.d.ts +10 -28
- package/dist/cjs/api/resources/traces/client/Client.js +32 -71
- package/dist/cjs/api/resources/traces/client/requests/GetTracesRequest.d.ts +8 -27
- package/dist/cjs/api/resources/traces/client/requests/GetTracesRequest.js +1 -3
- package/dist/cjs/api/resources/traces/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/usage/client/Client.d.ts +14 -32
- package/dist/cjs/api/resources/usage/client/Client.js +44 -87
- package/dist/cjs/api/resources/usage/client/requests/UsageCheckUsageRequest.d.ts +0 -3
- package/dist/cjs/api/resources/usage/client/requests/UsageCheckUsageRequest.js +1 -3
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.d.ts +1 -4
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.js +1 -3
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.ts +1 -4
- package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkV2Request.js +1 -3
- package/dist/cjs/api/resources/usage/client/requests/index.d.ts +3 -3
- package/dist/cjs/api/resources/usage/index.d.ts +1 -1
- package/dist/cjs/api/resources/usage/index.js +1 -1
- package/dist/cjs/api/resources/usage/types/UsageCheckUsageResponse.d.ts +0 -3
- package/dist/cjs/api/resources/usage/types/UsageCheckUsageResponse.js +1 -3
- package/dist/cjs/api/types/Address.d.ts +0 -3
- package/dist/cjs/api/types/Address.js +1 -3
- package/dist/cjs/api/types/Agent.d.ts +1 -4
- package/dist/cjs/api/types/Agent.js +1 -3
- package/dist/cjs/api/types/AgentAttribute.d.ts +1 -4
- package/dist/cjs/api/types/AgentAttribute.js +1 -3
- package/dist/cjs/api/types/AgentPricePoint.d.ts +1 -4
- package/dist/cjs/api/types/AgentPricePoint.js +1 -3
- package/dist/cjs/api/types/AgentPricePointTiers.d.ts +0 -3
- package/dist/cjs/api/types/AgentPricePointTiers.js +1 -3
- package/dist/cjs/api/types/AgentUpdate.d.ts +1 -4
- package/dist/cjs/api/types/AgentUpdate.js +1 -3
- package/dist/cjs/api/types/ApiError.d.ts +0 -3
- package/dist/cjs/api/types/ApiError.js +1 -3
- package/dist/cjs/api/types/BillingFrequency.d.ts +1 -4
- package/dist/cjs/api/types/BillingFrequency.js +1 -3
- package/dist/cjs/api/types/CancelRenewalResponse.d.ts +15 -0
- package/dist/cjs/api/types/CancelRenewalResponse.js +3 -0
- package/dist/cjs/api/types/ChargeType.d.ts +1 -4
- package/dist/cjs/api/types/ChargeType.js +1 -3
- package/dist/cjs/api/types/Contact.d.ts +1 -4
- package/dist/cjs/api/types/Contact.js +1 -3
- package/dist/cjs/api/types/ContactCreateForCustomer.d.ts +15 -0
- package/dist/cjs/api/types/ContactCreateForCustomer.js +3 -0
- package/dist/cjs/api/types/CostAmount.d.ts +0 -3
- package/dist/cjs/api/types/CostAmount.js +1 -3
- package/dist/cjs/api/types/CostTrace.d.ts +1 -4
- package/dist/cjs/api/types/CostTrace.js +1 -3
- package/dist/cjs/api/types/CostTracesResponse.d.ts +1 -4
- package/dist/cjs/api/types/CostTracesResponse.js +1 -3
- package/dist/cjs/api/types/CreationSource.d.ts +1 -4
- package/dist/cjs/api/types/CreationSource.js +1 -3
- package/dist/cjs/api/types/CreationState.d.ts +1 -4
- package/dist/cjs/api/types/CreationState.js +1 -3
- package/dist/cjs/api/types/Customer.d.ts +1 -4
- package/dist/cjs/api/types/Customer.js +1 -3
- package/dist/cjs/api/types/CustomerUpdate.d.ts +1 -4
- package/dist/cjs/api/types/CustomerUpdate.js +1 -3
- package/dist/cjs/api/types/EntitlementUsage.d.ts +0 -3
- package/dist/cjs/api/types/EntitlementUsage.js +1 -3
- package/dist/cjs/api/types/Error_.d.ts +1 -4
- package/dist/cjs/api/types/Error_.js +1 -3
- package/dist/cjs/api/types/Invoice.d.ts +40 -0
- package/dist/cjs/api/types/Invoice.js +14 -0
- package/dist/cjs/api/types/Order.d.ts +1 -4
- package/dist/cjs/api/types/Order.js +1 -3
- package/dist/cjs/api/types/OrderLine.d.ts +1 -4
- package/dist/cjs/api/types/OrderLine.js +1 -3
- package/dist/cjs/api/types/OrderLineAttribute.d.ts +1 -4
- package/dist/cjs/api/types/OrderLineAttribute.js +1 -3
- package/dist/cjs/api/types/OrderLineAttributeCreateOne.d.ts +0 -3
- package/dist/cjs/api/types/OrderLineAttributeCreateOne.js +1 -3
- package/dist/cjs/api/types/OrderLineAttributePricing.d.ts +1 -4
- package/dist/cjs/api/types/OrderLineAttributePricing.js +1 -3
- package/dist/cjs/api/types/OrderLineCreate.d.ts +1 -4
- package/dist/cjs/api/types/OrderLineCreate.js +1 -3
- package/dist/cjs/api/types/PaginationMeta.d.ts +0 -3
- package/dist/cjs/api/types/PaginationMeta.js +1 -3
- package/dist/cjs/api/types/PaymentMethod.d.ts +54 -0
- package/dist/cjs/api/types/PaymentMethod.js +20 -0
- package/dist/cjs/api/types/Plan.d.ts +3 -3
- package/dist/cjs/api/types/Plan.js +1 -3
- package/dist/cjs/api/types/PlanGroup.d.ts +1 -4
- package/dist/cjs/api/types/PlanGroup.js +1 -3
- package/dist/cjs/api/types/PricePoint.d.ts +1 -4
- package/dist/cjs/api/types/PricePoint.js +1 -3
- package/dist/cjs/api/types/Pricing.d.ts +1 -4
- package/dist/cjs/api/types/Pricing.js +1 -3
- package/dist/cjs/api/types/PricingModelType.d.ts +1 -4
- package/dist/cjs/api/types/PricingModelType.js +1 -3
- package/dist/cjs/api/types/Product.d.ts +3 -8
- package/dist/cjs/api/types/Product.js +2 -3
- package/dist/cjs/api/types/ProductUpdate.d.ts +2 -5
- package/dist/cjs/api/types/ProductUpdate.js +1 -3
- package/dist/cjs/api/types/ProrationAttributeUpdate.d.ts +11 -0
- package/dist/cjs/api/types/ProrationAttributeUpdate.js +3 -0
- package/dist/cjs/api/types/ProrationDetail.d.ts +16 -0
- package/dist/cjs/api/types/ProrationDetail.js +3 -0
- package/dist/cjs/api/types/ProrationUpgradeResponse.d.ts +22 -0
- package/dist/cjs/api/types/ProrationUpgradeResponse.js +3 -0
- package/dist/cjs/api/types/Salutation.d.ts +1 -4
- package/dist/cjs/api/types/Salutation.js +1 -3
- package/dist/cjs/api/types/Signal.d.ts +0 -3
- package/dist/cjs/api/types/Signal.js +1 -3
- package/dist/cjs/api/types/SignalV2.d.ts +0 -3
- package/dist/cjs/api/types/SignalV2.js +1 -3
- package/dist/cjs/api/types/TaxExemptStatus.d.ts +1 -4
- package/dist/cjs/api/types/TaxExemptStatus.js +1 -3
- package/dist/cjs/api/types/Tier.d.ts +0 -3
- package/dist/cjs/api/types/Tier.js +1 -3
- package/dist/cjs/api/types/Trace.d.ts +1 -4
- package/dist/cjs/api/types/Trace.js +1 -3
- package/dist/cjs/api/types/TracesResponse.d.ts +1 -4
- package/dist/cjs/api/types/TracesResponse.js +1 -3
- package/dist/cjs/api/types/UsagePaginationMeta.d.ts +0 -3
- package/dist/cjs/api/types/UsagePaginationMeta.js +1 -3
- package/dist/cjs/api/types/UsageSummariesResponse.d.ts +1 -4
- package/dist/cjs/api/types/UsageSummariesResponse.js +1 -3
- package/dist/cjs/api/types/UsageSummary.d.ts +0 -3
- package/dist/cjs/api/types/UsageSummary.js +1 -3
- package/dist/cjs/api/types/index.d.ts +33 -26
- package/dist/cjs/api/types/index.js +33 -26
- package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/cjs/{core/fetcher/stream-wrappers/chooseStreamWrapper.js → auth/BearerAuthProvider.js} +34 -14
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.js +5 -4
- package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
- package/dist/cjs/core/auth/BearerToken.js +7 -6
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +3 -0
- package/dist/cjs/core/auth/index.js +3 -1
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/cjs/core/fetcher/BinaryResponse.js +17 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/cjs/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/{esm/core/fetcher/stream-wrappers/chooseStreamWrapper.mjs → cjs/core/fetcher/EndpointSupplier.js} +10 -11
- package/dist/cjs/core/fetcher/Fetcher.d.ts +15 -7
- package/dist/cjs/core/fetcher/Fetcher.js +210 -14
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +1 -1
- package/dist/cjs/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/cjs/core/fetcher/createRequestUrl.js +3 -7
- package/dist/cjs/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +45 -0
- package/dist/cjs/core/fetcher/getFetchFn.d.ts +1 -4
- package/dist/cjs/core/fetcher/getFetchFn.js +1 -52
- package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
- package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
- package/dist/cjs/core/fetcher/getResponseBody.js +42 -27
- package/dist/cjs/core/fetcher/index.d.ts +7 -4
- package/dist/cjs/core/fetcher/index.js +7 -5
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +2 -4
- package/dist/cjs/core/fetcher/requestWithRetries.js +35 -8
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.d.ts +2 -3
- package/dist/cjs/core/headers.js +6 -4
- package/dist/cjs/core/index.d.ts +4 -1
- package/dist/cjs/core/index.js +27 -1
- package/dist/cjs/core/logging/exports.d.ts +18 -0
- package/dist/cjs/{wrapper/BatchUsage.js → core/logging/exports.js} +10 -27
- package/dist/cjs/core/logging/index.d.ts +1 -0
- package/dist/cjs/core/logging/index.js +17 -0
- package/dist/cjs/core/logging/logger.d.ts +126 -0
- package/dist/cjs/core/logging/logger.js +144 -0
- package/dist/cjs/core/runtime/runtime.js +11 -11
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +3 -0
- package/dist/cjs/core/url/index.js +9 -0
- package/dist/cjs/core/url/join.d.ts +1 -0
- package/dist/cjs/core/url/join.js +68 -0
- package/dist/cjs/core/url/qs.d.ts +6 -0
- package/dist/cjs/core/url/qs.js +64 -0
- package/dist/cjs/environments.d.ts +0 -3
- package/dist/cjs/environments.js +1 -3
- package/dist/cjs/errors/PaidError.d.ts +1 -4
- package/dist/cjs/errors/PaidError.js +7 -5
- package/dist/cjs/errors/PaidTimeoutError.d.ts +0 -3
- package/dist/cjs/errors/PaidTimeoutError.js +6 -4
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/integrations/adapters/expressjs/base-adapter.d.ts +8 -5
- package/dist/cjs/integrations/adapters/expressjs/base-adapter.js +6 -11
- package/dist/cjs/integrations/adapters/expressjs/routes.d.ts +14 -12
- package/dist/cjs/integrations/adapters/expressjs/routes.js +18 -9
- package/dist/cjs/integrations/adapters/nextjs/base-adapter.d.ts +3 -2
- package/dist/cjs/integrations/adapters/nextjs/routes.d.ts +13 -11
- package/dist/cjs/integrations/adapters/nextjs/routes.js +18 -9
- package/dist/cjs/integrations/controllers/billing.d.ts +3 -17
- package/dist/cjs/integrations/controllers/contacts.d.ts +1 -1
- package/dist/cjs/integrations/controllers/customers.d.ts +2 -2
- package/dist/cjs/integrations/controllers/invoices.d.ts +2 -6
- package/dist/cjs/integrations/controllers/orders.d.ts +1 -5
- package/dist/cjs/integrations/controllers/provision-users.d.ts +1 -1
- package/dist/cjs/integrations/utils/create-adapter.d.ts +2 -1
- package/dist/cjs/integrations/utils/create-adapter.js +2 -1
- package/dist/cjs/tracing/autoInstrumentation.js +5 -5
- package/dist/cjs/tracing/spanProcessor.d.ts +2 -2
- package/dist/cjs/tracing/spanProcessor.js +0 -5
- package/dist/cjs/tracing/tracing.d.ts +1 -1
- package/dist/cjs/tracing/tracing.js +2 -0
- package/dist/cjs/tracing/wrappers/anthropicWrapper.d.ts +2 -2
- package/dist/cjs/tracing/wrappers/mistralWrapper.d.ts +3 -3
- package/dist/cjs/tracing/wrappers/openAiWrapper.d.ts +5 -5
- package/dist/cjs/tracing/wrappers/vercelAIWrapper.d.ts +2 -2
- package/dist/cjs/tracing/wrappers/vercelAIWrapper.js +8 -7
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +39 -0
- package/dist/esm/BaseClient.mjs +25 -0
- package/dist/esm/Client.d.mts +30 -93
- package/dist/esm/Client.mjs +20 -96
- package/dist/esm/api/errors/BadRequestError.d.mts +2 -5
- package/dist/esm/api/errors/BadRequestError.mjs +6 -4
- package/dist/esm/api/errors/ForbiddenError.d.mts +2 -5
- package/dist/esm/api/errors/ForbiddenError.mjs +6 -4
- package/dist/esm/api/errors/InternalServerError.d.mts +2 -5
- package/dist/esm/api/errors/InternalServerError.mjs +6 -4
- package/dist/esm/api/errors/NotFoundError.d.mts +2 -5
- package/dist/esm/api/errors/NotFoundError.mjs +6 -4
- package/dist/esm/api/errors/index.d.mts +2 -2
- package/dist/esm/api/errors/index.mjs +2 -2
- package/dist/esm/api/index.d.mts +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/resources/agents/client/Client.d.mts +25 -43
- package/dist/esm/api/resources/agents/client/Client.mjs +96 -186
- package/dist/esm/api/resources/agents/client/requests/AgentCreate.d.mts +0 -3
- package/dist/esm/api/resources/agents/client/requests/AgentCreate.mjs +1 -3
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/contacts/client/Client.d.mts +21 -39
- package/dist/esm/api/resources/contacts/client/Client.mjs +74 -144
- package/dist/esm/api/resources/contacts/client/requests/ContactCreate.d.mts +1 -4
- package/dist/esm/api/resources/contacts/client/requests/ContactCreate.mjs +1 -3
- package/dist/esm/api/resources/contacts/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/customers/client/Client.d.mts +111 -49
- package/dist/esm/api/resources/customers/client/Client.mjs +372 -271
- package/dist/esm/api/resources/customers/client/requests/CustomerCreate.d.mts +17 -5
- package/dist/esm/api/resources/customers/client/requests/CustomerCreate.mjs +1 -3
- package/dist/esm/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.d.mts +14 -0
- package/dist/esm/api/resources/customers/client/requests/CustomersCheckEntitlementRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.d.mts +18 -0
- package/dist/esm/api/resources/customers/client/requests/CustomersCreatePaymentMethodRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.d.mts +4 -15
- package/dist/esm/api/resources/customers/client/requests/CustomersGetCostsByExternalIdRequest.mjs +1 -3
- package/dist/esm/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.d.mts +4 -15
- package/dist/esm/api/resources/customers/client/requests/CustomersGetUsageByExternalIdRequest.mjs +1 -3
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +5 -3
- package/dist/esm/api/resources/customers/index.d.mts +1 -0
- package/dist/esm/api/resources/customers/index.mjs +1 -0
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementRequestView.d.mts +5 -0
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementRequestView.mjs +5 -0
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementResponse.d.mts +4 -0
- package/dist/esm/api/resources/customers/types/CustomersCheckEntitlementResponse.mjs +2 -0
- package/dist/esm/api/resources/customers/types/index.d.mts +2 -0
- package/dist/esm/api/resources/customers/types/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +12 -11
- package/dist/esm/api/resources/index.mjs +12 -11
- package/dist/esm/api/resources/orders/client/Client.d.mts +100 -39
- package/dist/esm/api/resources/orders/client/Client.mjs +299 -120
- package/dist/esm/api/resources/orders/client/requests/CancelRenewalRequest.d.mts +13 -0
- package/dist/esm/api/resources/orders/client/requests/CancelRenewalRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/OrderCreate.d.mts +1 -4
- package/dist/esm/api/resources/orders/client/requests/OrderCreate.mjs +1 -3
- package/dist/esm/api/resources/orders/client/requests/OrdersActivateAndPayRequest.d.mts +13 -0
- package/dist/esm/api/resources/orders/client/requests/OrdersActivateAndPayRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/ProrationUpgradeRequest.d.mts +24 -0
- package/dist/esm/api/resources/orders/client/requests/ProrationUpgradeRequest.mjs +2 -0
- package/dist/esm/api/resources/orders/client/requests/index.d.mts +4 -1
- package/dist/esm/api/resources/orders/resources/index.d.mts +1 -1
- package/dist/esm/api/resources/orders/resources/index.mjs +1 -1
- package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +11 -29
- package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +19 -39
- package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.mts +1 -4
- package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.mjs +1 -3
- package/dist/esm/api/resources/orders/resources/lines/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/plans/client/Client.d.mts +14 -32
- package/dist/esm/api/resources/plans/client/Client.mjs +49 -97
- package/dist/esm/api/resources/plans/client/requests/PlansGetUsageRequest.d.mts +5 -18
- package/dist/esm/api/resources/plans/client/requests/PlansGetUsageRequest.mjs +1 -3
- package/dist/esm/api/resources/plans/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/products/client/Client.d.mts +25 -43
- package/dist/esm/api/resources/products/client/Client.mjs +96 -186
- package/dist/esm/api/resources/products/client/requests/ProductCreate.d.mts +1 -4
- package/dist/esm/api/resources/products/client/requests/ProductCreate.mjs +1 -3
- package/dist/esm/api/resources/products/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/products/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/traces/client/Client.d.mts +10 -28
- package/dist/esm/api/resources/traces/client/Client.mjs +30 -66
- package/dist/esm/api/resources/traces/client/requests/GetTracesRequest.d.mts +8 -27
- package/dist/esm/api/resources/traces/client/requests/GetTracesRequest.mjs +1 -3
- package/dist/esm/api/resources/traces/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/usage/client/Client.d.mts +14 -32
- package/dist/esm/api/resources/usage/client/Client.mjs +42 -82
- package/dist/esm/api/resources/usage/client/requests/UsageCheckUsageRequest.d.mts +0 -3
- package/dist/esm/api/resources/usage/client/requests/UsageCheckUsageRequest.mjs +1 -3
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.d.mts +1 -4
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.mjs +1 -3
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.d.mts +1 -4
- package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkV2Request.mjs +1 -3
- package/dist/esm/api/resources/usage/client/requests/index.d.mts +3 -3
- package/dist/esm/api/resources/usage/index.d.mts +1 -1
- package/dist/esm/api/resources/usage/index.mjs +1 -1
- package/dist/esm/api/resources/usage/types/UsageCheckUsageResponse.d.mts +0 -3
- package/dist/esm/api/resources/usage/types/UsageCheckUsageResponse.mjs +1 -3
- package/dist/esm/api/types/Address.d.mts +0 -3
- package/dist/esm/api/types/Address.mjs +1 -3
- package/dist/esm/api/types/Agent.d.mts +1 -4
- package/dist/esm/api/types/Agent.mjs +1 -3
- package/dist/esm/api/types/AgentAttribute.d.mts +1 -4
- package/dist/esm/api/types/AgentAttribute.mjs +1 -3
- package/dist/esm/api/types/AgentPricePoint.d.mts +1 -4
- package/dist/esm/api/types/AgentPricePoint.mjs +1 -3
- package/dist/esm/api/types/AgentPricePointTiers.d.mts +0 -3
- package/dist/esm/api/types/AgentPricePointTiers.mjs +1 -3
- package/dist/esm/api/types/AgentUpdate.d.mts +1 -4
- package/dist/esm/api/types/AgentUpdate.mjs +1 -3
- package/dist/esm/api/types/ApiError.d.mts +0 -3
- package/dist/esm/api/types/ApiError.mjs +1 -3
- package/dist/esm/api/types/BillingFrequency.d.mts +1 -4
- package/dist/esm/api/types/BillingFrequency.mjs +1 -3
- package/dist/esm/api/types/CancelRenewalResponse.d.mts +15 -0
- package/dist/esm/api/types/CancelRenewalResponse.mjs +2 -0
- package/dist/esm/api/types/ChargeType.d.mts +1 -4
- package/dist/esm/api/types/ChargeType.mjs +1 -3
- package/dist/esm/api/types/Contact.d.mts +1 -4
- package/dist/esm/api/types/Contact.mjs +1 -3
- package/dist/esm/api/types/ContactCreateForCustomer.d.mts +15 -0
- package/dist/esm/api/types/ContactCreateForCustomer.mjs +2 -0
- package/dist/esm/api/types/CostAmount.d.mts +0 -3
- package/dist/esm/api/types/CostAmount.mjs +1 -3
- package/dist/esm/api/types/CostTrace.d.mts +1 -4
- package/dist/esm/api/types/CostTrace.mjs +1 -3
- package/dist/esm/api/types/CostTracesResponse.d.mts +1 -4
- package/dist/esm/api/types/CostTracesResponse.mjs +1 -3
- package/dist/esm/api/types/CreationSource.d.mts +1 -4
- package/dist/esm/api/types/CreationSource.mjs +1 -3
- package/dist/esm/api/types/CreationState.d.mts +1 -4
- package/dist/esm/api/types/CreationState.mjs +1 -3
- package/dist/esm/api/types/Customer.d.mts +1 -4
- package/dist/esm/api/types/Customer.mjs +1 -3
- package/dist/esm/api/types/CustomerUpdate.d.mts +1 -4
- package/dist/esm/api/types/CustomerUpdate.mjs +1 -3
- package/dist/esm/api/types/EntitlementUsage.d.mts +0 -3
- package/dist/esm/api/types/EntitlementUsage.mjs +1 -3
- package/dist/esm/api/types/Error_.d.mts +1 -4
- package/dist/esm/api/types/Error_.mjs +1 -3
- package/dist/esm/api/types/Invoice.d.mts +40 -0
- package/dist/esm/api/types/Invoice.mjs +11 -0
- package/dist/esm/api/types/Order.d.mts +1 -4
- package/dist/esm/api/types/Order.mjs +1 -3
- package/dist/esm/api/types/OrderLine.d.mts +1 -4
- package/dist/esm/api/types/OrderLine.mjs +1 -3
- package/dist/esm/api/types/OrderLineAttribute.d.mts +1 -4
- package/dist/esm/api/types/OrderLineAttribute.mjs +1 -3
- package/dist/esm/api/types/OrderLineAttributeCreateOne.d.mts +0 -3
- package/dist/esm/api/types/OrderLineAttributeCreateOne.mjs +1 -3
- package/dist/esm/api/types/OrderLineAttributePricing.d.mts +1 -4
- package/dist/esm/api/types/OrderLineAttributePricing.mjs +1 -3
- package/dist/esm/api/types/OrderLineCreate.d.mts +1 -4
- package/dist/esm/api/types/OrderLineCreate.mjs +1 -3
- package/dist/esm/api/types/PaginationMeta.d.mts +0 -3
- package/dist/esm/api/types/PaginationMeta.mjs +1 -3
- package/dist/esm/api/types/PaymentMethod.d.mts +54 -0
- package/dist/esm/api/types/PaymentMethod.mjs +17 -0
- package/dist/esm/api/types/Plan.d.mts +3 -3
- package/dist/esm/api/types/Plan.mjs +1 -3
- package/dist/esm/api/types/PlanGroup.d.mts +1 -4
- package/dist/esm/api/types/PlanGroup.mjs +1 -3
- package/dist/esm/api/types/PricePoint.d.mts +1 -4
- package/dist/esm/api/types/PricePoint.mjs +1 -3
- package/dist/esm/api/types/Pricing.d.mts +1 -4
- package/dist/esm/api/types/Pricing.mjs +1 -3
- package/dist/esm/api/types/PricingModelType.d.mts +1 -4
- package/dist/esm/api/types/PricingModelType.mjs +1 -3
- package/dist/esm/api/types/Product.d.mts +3 -8
- package/dist/esm/api/types/Product.mjs +2 -3
- package/dist/esm/api/types/ProductUpdate.d.mts +2 -5
- package/dist/esm/api/types/ProductUpdate.mjs +1 -3
- package/dist/esm/api/types/ProrationAttributeUpdate.d.mts +11 -0
- package/dist/esm/api/types/ProrationAttributeUpdate.mjs +2 -0
- package/dist/esm/api/types/ProrationDetail.d.mts +16 -0
- package/dist/esm/api/types/ProrationDetail.mjs +2 -0
- package/dist/esm/api/types/ProrationUpgradeResponse.d.mts +22 -0
- package/dist/esm/api/types/ProrationUpgradeResponse.mjs +2 -0
- package/dist/esm/api/types/Salutation.d.mts +1 -4
- package/dist/esm/api/types/Salutation.mjs +1 -3
- package/dist/esm/api/types/Signal.d.mts +0 -3
- package/dist/esm/api/types/Signal.mjs +1 -3
- package/dist/esm/api/types/SignalV2.d.mts +0 -3
- package/dist/esm/api/types/SignalV2.mjs +1 -3
- package/dist/esm/api/types/TaxExemptStatus.d.mts +1 -4
- package/dist/esm/api/types/TaxExemptStatus.mjs +1 -3
- package/dist/esm/api/types/Tier.d.mts +0 -3
- package/dist/esm/api/types/Tier.mjs +1 -3
- package/dist/esm/api/types/Trace.d.mts +1 -4
- package/dist/esm/api/types/Trace.mjs +1 -3
- package/dist/esm/api/types/TracesResponse.d.mts +1 -4
- package/dist/esm/api/types/TracesResponse.mjs +1 -3
- package/dist/esm/api/types/UsagePaginationMeta.d.mts +0 -3
- package/dist/esm/api/types/UsagePaginationMeta.mjs +1 -3
- package/dist/esm/api/types/UsageSummariesResponse.d.mts +1 -4
- package/dist/esm/api/types/UsageSummariesResponse.mjs +1 -3
- package/dist/esm/api/types/UsageSummary.d.mts +0 -3
- package/dist/esm/api/types/UsageSummary.mjs +1 -3
- package/dist/esm/api/types/index.d.mts +33 -26
- package/dist/esm/api/types/index.mjs +33 -26
- package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +42 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.mjs +5 -4
- package/dist/esm/core/auth/BearerToken.d.mts +3 -1
- package/dist/esm/core/auth/BearerToken.mjs +7 -6
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +3 -0
- package/dist/esm/core/auth/index.mjs +1 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +19 -0
- package/dist/esm/core/fetcher/BinaryResponse.mjs +14 -0
- package/dist/esm/core/fetcher/EndpointMetadata.d.mts +13 -0
- package/dist/esm/core/fetcher/EndpointMetadata.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +12 -0
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +19 -0
- package/dist/esm/core/fetcher/Fetcher.d.mts +15 -7
- package/dist/esm/core/fetcher/Fetcher.mjs +210 -14
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +1 -1
- package/dist/esm/core/fetcher/createRequestUrl.d.mts +1 -1
- package/dist/esm/core/fetcher/createRequestUrl.mjs +3 -4
- package/dist/esm/core/fetcher/getErrorResponseBody.d.mts +1 -0
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +42 -0
- package/dist/esm/core/fetcher/getFetchFn.d.mts +1 -4
- package/dist/esm/core/fetcher/getFetchFn.mjs +1 -19
- package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
- package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
- package/dist/esm/core/fetcher/getResponseBody.mjs +42 -27
- package/dist/esm/core/fetcher/index.d.mts +7 -4
- package/dist/esm/core/fetcher/index.mjs +3 -2
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +2 -4
- package/dist/esm/core/fetcher/requestWithRetries.mjs +35 -8
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.d.mts +2 -3
- package/dist/esm/core/headers.mjs +6 -4
- package/dist/esm/core/index.d.mts +4 -1
- package/dist/esm/core/index.mjs +4 -1
- package/dist/esm/core/logging/exports.d.mts +18 -0
- package/dist/esm/core/logging/exports.mjs +9 -0
- package/dist/esm/core/logging/index.d.mts +1 -0
- package/dist/esm/core/logging/index.mjs +1 -0
- package/dist/esm/core/logging/logger.d.mts +126 -0
- package/dist/esm/core/logging/logger.mjs +138 -0
- package/dist/esm/core/runtime/runtime.mjs +11 -11
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +3 -0
- package/dist/esm/core/url/index.mjs +3 -0
- package/dist/esm/core/url/join.d.mts +1 -0
- package/dist/esm/core/url/join.mjs +65 -0
- package/dist/esm/core/url/qs.d.mts +6 -0
- package/dist/esm/core/url/qs.mjs +61 -0
- package/dist/esm/environments.d.mts +0 -3
- package/dist/esm/environments.mjs +1 -3
- package/dist/esm/errors/PaidError.d.mts +1 -4
- package/dist/esm/errors/PaidError.mjs +7 -5
- package/dist/esm/errors/PaidTimeoutError.d.mts +0 -3
- package/dist/esm/errors/PaidTimeoutError.mjs +6 -4
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/integrations/adapters/expressjs/base-adapter.d.mts +8 -5
- package/dist/esm/integrations/adapters/expressjs/base-adapter.mjs +6 -11
- package/dist/esm/integrations/adapters/expressjs/routes.d.mts +14 -12
- package/dist/esm/integrations/adapters/expressjs/routes.mjs +18 -9
- package/dist/esm/integrations/adapters/nextjs/base-adapter.d.mts +3 -2
- package/dist/esm/integrations/adapters/nextjs/base-adapter.mjs +1 -1
- package/dist/esm/integrations/adapters/nextjs/routes.d.mts +13 -11
- package/dist/esm/integrations/adapters/nextjs/routes.mjs +18 -9
- package/dist/esm/integrations/controllers/billing.d.mts +3 -17
- package/dist/esm/integrations/controllers/contacts.d.mts +1 -1
- package/dist/esm/integrations/controllers/contacts.mjs +1 -0
- package/dist/esm/integrations/controllers/customers.d.mts +2 -2
- package/dist/esm/integrations/controllers/customers.mjs +1 -0
- package/dist/esm/integrations/controllers/invoices.d.mts +2 -6
- package/dist/esm/integrations/controllers/orders.d.mts +1 -5
- package/dist/esm/integrations/controllers/provision-users.d.mts +1 -1
- package/dist/esm/integrations/utils/create-adapter.d.mts +2 -1
- package/dist/esm/integrations/utils/create-adapter.mjs +2 -1
- package/dist/esm/tracing/autoInstrumentation.mjs +1 -1
- package/dist/esm/tracing/spanProcessor.d.mts +2 -2
- package/dist/esm/tracing/spanProcessor.mjs +0 -5
- package/dist/esm/tracing/tracing.d.mts +1 -1
- package/dist/esm/tracing/tracing.mjs +3 -0
- package/dist/esm/tracing/wrappers/anthropicWrapper.d.mts +2 -2
- package/dist/esm/tracing/wrappers/anthropicWrapper.mjs +1 -0
- package/dist/esm/tracing/wrappers/mistralWrapper.d.mts +3 -3
- package/dist/esm/tracing/wrappers/mistralWrapper.mjs +1 -0
- package/dist/esm/tracing/wrappers/openAiWrapper.d.mts +5 -5
- package/dist/esm/tracing/wrappers/openAiWrapper.mjs +1 -0
- package/dist/esm/tracing/wrappers/vercelAIWrapper.d.mts +2 -2
- package/dist/esm/tracing/wrappers/vercelAIWrapper.mjs +8 -7
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +43 -28
- package/reference.md +985 -396
- package/dist/cjs/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/dist/cjs/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -247
- package/dist/cjs/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/dist/cjs/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -126
- package/dist/cjs/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/dist/cjs/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -229
- package/dist/cjs/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/dist/cjs/wrapper/BatchUsage.d.ts +0 -8
- package/dist/esm/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.mts +0 -30
- package/dist/esm/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.mjs +0 -243
- package/dist/esm/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.mts +0 -21
- package/dist/esm/core/fetcher/stream-wrappers/NodePre18StreamWrapper.mjs +0 -122
- package/dist/esm/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.mts +0 -31
- package/dist/esm/core/fetcher/stream-wrappers/UndiciStreamWrapper.mjs +0 -225
- package/dist/esm/core/fetcher/stream-wrappers/chooseStreamWrapper.d.mts +0 -18
- package/dist/esm/wrapper/BatchUsage.d.mts +0 -8
- package/dist/esm/wrapper/BatchUsage.mjs +0 -25
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { CancelRenewalRequest } from "./CancelRenewalRequest.mjs";
|
|
2
|
+
export type { OrderCreate } from "./OrderCreate.mjs";
|
|
3
|
+
export type { OrdersActivateAndPayRequest } from "./OrdersActivateAndPayRequest.mjs";
|
|
4
|
+
export type { ProrationUpgradeRequest } from "./ProrationUpgradeRequest.mjs";
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../../../environments.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
|
|
5
3
|
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
-
import * as Paid from "../../../../../index.mjs";
|
|
7
|
-
export declare namespace
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** Specify a custom URL to connect the client to. */
|
|
11
|
-
baseUrl?: core.Supplier<string>;
|
|
12
|
-
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
-
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
|
-
}
|
|
16
|
-
interface RequestOptions {
|
|
17
|
-
/** The maximum time to wait for a response in seconds. */
|
|
18
|
-
timeoutInSeconds?: number;
|
|
19
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
-
maxRetries?: number;
|
|
21
|
-
/** A hook to abort the request. */
|
|
22
|
-
abortSignal?: AbortSignal;
|
|
23
|
-
/** Additional headers to include in the request. */
|
|
24
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
4
|
+
import type * as Paid from "../../../../../index.mjs";
|
|
5
|
+
export declare namespace LinesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
25
8
|
}
|
|
26
9
|
}
|
|
27
|
-
export declare class
|
|
28
|
-
protected readonly _options:
|
|
29
|
-
constructor(
|
|
10
|
+
export declare class LinesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<LinesClient.Options>;
|
|
12
|
+
constructor(options?: LinesClient.Options);
|
|
30
13
|
/**
|
|
31
14
|
* @param {string} orderId
|
|
32
15
|
* @param {Paid.orders.LinesUpdateRequest} request
|
|
33
|
-
* @param {
|
|
16
|
+
* @param {LinesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
34
17
|
*
|
|
35
18
|
* @example
|
|
36
19
|
* await client.orders.lines.update("orderId", {
|
|
@@ -43,7 +26,6 @@ export declare class Lines {
|
|
|
43
26
|
* }]
|
|
44
27
|
* })
|
|
45
28
|
*/
|
|
46
|
-
update(orderId: string, request?: Paid.orders.LinesUpdateRequest, requestOptions?:
|
|
29
|
+
update(orderId: string, request?: Paid.orders.LinesUpdateRequest, requestOptions?: LinesClient.RequestOptions): core.HttpResponsePromise<Paid.Order>;
|
|
47
30
|
private __update;
|
|
48
|
-
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
49
31
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
4
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
9
|
});
|
|
12
10
|
};
|
|
13
|
-
import
|
|
11
|
+
import { normalizeClientOptions } from "../../../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../../../core/headers.mjs";
|
|
14
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
17
16
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
18
|
-
export class
|
|
19
|
-
constructor(
|
|
20
|
-
this._options =
|
|
17
|
+
export class LinesClient {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
this._options = normalizeClientOptions(options);
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* @param {string} orderId
|
|
24
23
|
* @param {Paid.orders.LinesUpdateRequest} request
|
|
25
|
-
* @param {
|
|
24
|
+
* @param {LinesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
25
|
*
|
|
27
26
|
* @example
|
|
28
27
|
* await client.orders.lines.update("orderId", {
|
|
@@ -40,17 +39,21 @@ export class Lines {
|
|
|
40
39
|
}
|
|
41
40
|
__update(orderId_1) {
|
|
42
41
|
return __awaiter(this, arguments, void 0, function* (orderId, request = {}, requestOptions) {
|
|
43
|
-
var _a, _b, _c;
|
|
42
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
43
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
44
44
|
const _response = yield core.fetcher({
|
|
45
|
-
url:
|
|
45
|
+
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, `orders/${core.url.encodePathParam(orderId)}/lines`),
|
|
46
46
|
method: "PUT",
|
|
47
|
-
headers:
|
|
47
|
+
headers: _headers,
|
|
48
48
|
contentType: "application/json",
|
|
49
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
49
50
|
requestType: "json",
|
|
50
51
|
body: request,
|
|
51
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
52
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
52
|
+
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,
|
|
53
|
+
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,
|
|
53
54
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
55
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
56
|
+
logging: this._options.logging,
|
|
54
57
|
});
|
|
55
58
|
if (_response.ok) {
|
|
56
59
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -62,30 +65,7 @@ export class Lines {
|
|
|
62
65
|
rawResponse: _response.rawResponse,
|
|
63
66
|
});
|
|
64
67
|
}
|
|
65
|
-
|
|
66
|
-
case "non-json":
|
|
67
|
-
throw new errors.PaidError({
|
|
68
|
-
statusCode: _response.error.statusCode,
|
|
69
|
-
body: _response.error.rawBody,
|
|
70
|
-
rawResponse: _response.rawResponse,
|
|
71
|
-
});
|
|
72
|
-
case "timeout":
|
|
73
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /orders/{orderId}/lines.");
|
|
74
|
-
case "unknown":
|
|
75
|
-
throw new errors.PaidError({
|
|
76
|
-
message: _response.error.errorMessage,
|
|
77
|
-
rawResponse: _response.rawResponse,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
_getAuthorizationHeader() {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
const bearer = yield core.Supplier.get(this._options.token);
|
|
85
|
-
if (bearer != null) {
|
|
86
|
-
return `Bearer ${bearer}`;
|
|
87
|
-
}
|
|
88
|
-
return undefined;
|
|
68
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/orders/{orderId}/lines");
|
|
89
69
|
});
|
|
90
70
|
}
|
|
91
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { LinesUpdateRequest } from "./LinesUpdateRequest.mjs";
|
|
@@ -1,35 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../environments.mjs";
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
5
3
|
import * as core from "../../../../core/index.mjs";
|
|
6
4
|
import * as Paid from "../../../index.mjs";
|
|
7
|
-
export declare namespace
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** Specify a custom URL to connect the client to. */
|
|
11
|
-
baseUrl?: core.Supplier<string>;
|
|
12
|
-
token?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
-
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
|
-
}
|
|
16
|
-
interface RequestOptions {
|
|
17
|
-
/** The maximum time to wait for a response in seconds. */
|
|
18
|
-
timeoutInSeconds?: number;
|
|
19
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
-
maxRetries?: number;
|
|
21
|
-
/** A hook to abort the request. */
|
|
22
|
-
abortSignal?: AbortSignal;
|
|
23
|
-
/** Additional headers to include in the request. */
|
|
24
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
5
|
+
export declare namespace PlansClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
25
8
|
}
|
|
26
9
|
}
|
|
27
|
-
export declare class
|
|
28
|
-
protected readonly _options:
|
|
29
|
-
constructor(
|
|
10
|
+
export declare class PlansClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptions<PlansClient.Options>;
|
|
12
|
+
constructor(options?: PlansClient.Options);
|
|
30
13
|
/**
|
|
31
14
|
* @param {string} planId - The ID of the plan
|
|
32
|
-
* @param {
|
|
15
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
33
16
|
*
|
|
34
17
|
* @throws {@link Paid.ForbiddenError}
|
|
35
18
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -37,12 +20,12 @@ export declare class Plans {
|
|
|
37
20
|
* @example
|
|
38
21
|
* await client.plans.getById("planId")
|
|
39
22
|
*/
|
|
40
|
-
getById(planId: string, requestOptions?:
|
|
23
|
+
getById(planId: string, requestOptions?: PlansClient.RequestOptions): core.HttpResponsePromise<Paid.Plan>;
|
|
41
24
|
private __getById;
|
|
42
25
|
/**
|
|
43
26
|
* @param {string} planId - The ID of the plan
|
|
44
27
|
* @param {Paid.PlansGetUsageRequest} request
|
|
45
|
-
* @param {
|
|
28
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
46
29
|
*
|
|
47
30
|
* @throws {@link Paid.BadRequestError}
|
|
48
31
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -57,11 +40,11 @@ export declare class Plans {
|
|
|
57
40
|
* endTime: "2024-01-15T09:30:00Z"
|
|
58
41
|
* })
|
|
59
42
|
*/
|
|
60
|
-
getUsage(planId: string, request: Paid.PlansGetUsageRequest, requestOptions?:
|
|
43
|
+
getUsage(planId: string, request: Paid.PlansGetUsageRequest, requestOptions?: PlansClient.RequestOptions): core.HttpResponsePromise<Paid.UsageSummariesResponse>;
|
|
61
44
|
private __getUsage;
|
|
62
45
|
/**
|
|
63
46
|
* @param {string} planGroupId - The ID of the plan group
|
|
64
|
-
* @param {
|
|
47
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
65
48
|
*
|
|
66
49
|
* @throws {@link Paid.ForbiddenError}
|
|
67
50
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -69,7 +52,6 @@ export declare class Plans {
|
|
|
69
52
|
* @example
|
|
70
53
|
* await client.plans.getGroupById("planGroupId")
|
|
71
54
|
*/
|
|
72
|
-
getGroupById(planGroupId: string, requestOptions?:
|
|
55
|
+
getGroupById(planGroupId: string, requestOptions?: PlansClient.RequestOptions): core.HttpResponsePromise<Paid.PlanGroup>;
|
|
73
56
|
private __getGroupById;
|
|
74
|
-
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
75
57
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
4
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -10,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
9
|
});
|
|
12
10
|
};
|
|
13
|
-
import
|
|
11
|
+
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
14
13
|
import * as core from "../../../../core/index.mjs";
|
|
15
|
-
import * as
|
|
16
|
-
import {
|
|
17
|
-
import urlJoin from "url-join";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
18
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
import * as Paid from "../../../index.mjs";
|
|
18
|
+
export class PlansClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptions(options);
|
|
22
21
|
}
|
|
23
22
|
/**
|
|
24
23
|
* @param {string} planId - The ID of the plan
|
|
25
|
-
* @param {
|
|
24
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
25
|
*
|
|
27
26
|
* @throws {@link Paid.ForbiddenError}
|
|
28
27
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -35,14 +34,18 @@ export class Plans {
|
|
|
35
34
|
}
|
|
36
35
|
__getById(planId, requestOptions) {
|
|
37
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
var _a, _b, _c;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
39
39
|
const _response = yield core.fetcher({
|
|
40
|
-
url:
|
|
40
|
+
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, `plans/${core.url.encodePathParam(planId)}`),
|
|
41
41
|
method: "GET",
|
|
42
|
-
headers:
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
headers: _headers,
|
|
43
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
44
|
+
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,
|
|
45
|
+
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,
|
|
45
46
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
47
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
48
|
+
logging: this._options.logging,
|
|
46
49
|
});
|
|
47
50
|
if (_response.ok) {
|
|
48
51
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -61,27 +64,13 @@ export class Plans {
|
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
case "non-json":
|
|
66
|
-
throw new errors.PaidError({
|
|
67
|
-
statusCode: _response.error.statusCode,
|
|
68
|
-
body: _response.error.rawBody,
|
|
69
|
-
rawResponse: _response.rawResponse,
|
|
70
|
-
});
|
|
71
|
-
case "timeout":
|
|
72
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/{planId}.");
|
|
73
|
-
case "unknown":
|
|
74
|
-
throw new errors.PaidError({
|
|
75
|
-
message: _response.error.errorMessage,
|
|
76
|
-
rawResponse: _response.rawResponse,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
67
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/plans/{planId}");
|
|
79
68
|
});
|
|
80
69
|
}
|
|
81
70
|
/**
|
|
82
71
|
* @param {string} planId - The ID of the plan
|
|
83
72
|
* @param {Paid.PlansGetUsageRequest} request
|
|
84
|
-
* @param {
|
|
73
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
74
|
*
|
|
86
75
|
* @throws {@link Paid.BadRequestError}
|
|
87
76
|
* @throws {@link Paid.ForbiddenError}
|
|
@@ -101,30 +90,26 @@ export class Plans {
|
|
|
101
90
|
}
|
|
102
91
|
__getUsage(planId, request, requestOptions) {
|
|
103
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
var _a, _b, _c;
|
|
93
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
105
94
|
const { externalId, limit, offset, startTime, endTime } = request;
|
|
106
|
-
const _queryParams = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (startTime != null) {
|
|
115
|
-
_queryParams["startTime"] = startTime;
|
|
116
|
-
}
|
|
117
|
-
if (endTime != null) {
|
|
118
|
-
_queryParams["endTime"] = endTime;
|
|
119
|
-
}
|
|
95
|
+
const _queryParams = {
|
|
96
|
+
externalId,
|
|
97
|
+
limit,
|
|
98
|
+
offset,
|
|
99
|
+
startTime,
|
|
100
|
+
endTime,
|
|
101
|
+
};
|
|
102
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
103
|
const _response = yield core.fetcher({
|
|
121
|
-
url:
|
|
104
|
+
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, `plans/${core.url.encodePathParam(planId)}/usage`),
|
|
122
105
|
method: "GET",
|
|
123
|
-
headers:
|
|
124
|
-
queryParameters: _queryParams,
|
|
125
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
126
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
106
|
+
headers: _headers,
|
|
107
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
108
|
+
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,
|
|
109
|
+
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,
|
|
127
110
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
111
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
112
|
+
logging: this._options.logging,
|
|
128
113
|
});
|
|
129
114
|
if (_response.ok) {
|
|
130
115
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -145,26 +130,12 @@ export class Plans {
|
|
|
145
130
|
});
|
|
146
131
|
}
|
|
147
132
|
}
|
|
148
|
-
|
|
149
|
-
case "non-json":
|
|
150
|
-
throw new errors.PaidError({
|
|
151
|
-
statusCode: _response.error.statusCode,
|
|
152
|
-
body: _response.error.rawBody,
|
|
153
|
-
rawResponse: _response.rawResponse,
|
|
154
|
-
});
|
|
155
|
-
case "timeout":
|
|
156
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/{planId}/usage.");
|
|
157
|
-
case "unknown":
|
|
158
|
-
throw new errors.PaidError({
|
|
159
|
-
message: _response.error.errorMessage,
|
|
160
|
-
rawResponse: _response.rawResponse,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
133
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/plans/{planId}/usage");
|
|
163
134
|
});
|
|
164
135
|
}
|
|
165
136
|
/**
|
|
166
137
|
* @param {string} planGroupId - The ID of the plan group
|
|
167
|
-
* @param {
|
|
138
|
+
* @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
168
139
|
*
|
|
169
140
|
* @throws {@link Paid.ForbiddenError}
|
|
170
141
|
* @throws {@link Paid.NotFoundError}
|
|
@@ -177,14 +148,18 @@ export class Plans {
|
|
|
177
148
|
}
|
|
178
149
|
__getGroupById(planGroupId, requestOptions) {
|
|
179
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
-
var _a, _b, _c;
|
|
151
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
152
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
181
153
|
const _response = yield core.fetcher({
|
|
182
|
-
url:
|
|
154
|
+
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, `plans/group/${core.url.encodePathParam(planGroupId)}`),
|
|
183
155
|
method: "GET",
|
|
184
|
-
headers:
|
|
185
|
-
|
|
186
|
-
|
|
156
|
+
headers: _headers,
|
|
157
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
158
|
+
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,
|
|
159
|
+
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,
|
|
187
160
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
161
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
162
|
+
logging: this._options.logging,
|
|
188
163
|
});
|
|
189
164
|
if (_response.ok) {
|
|
190
165
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
@@ -203,30 +178,7 @@ export class Plans {
|
|
|
203
178
|
});
|
|
204
179
|
}
|
|
205
180
|
}
|
|
206
|
-
|
|
207
|
-
case "non-json":
|
|
208
|
-
throw new errors.PaidError({
|
|
209
|
-
statusCode: _response.error.statusCode,
|
|
210
|
-
body: _response.error.rawBody,
|
|
211
|
-
rawResponse: _response.rawResponse,
|
|
212
|
-
});
|
|
213
|
-
case "timeout":
|
|
214
|
-
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /plans/group/{planGroupId}.");
|
|
215
|
-
case "unknown":
|
|
216
|
-
throw new errors.PaidError({
|
|
217
|
-
message: _response.error.errorMessage,
|
|
218
|
-
rawResponse: _response.rawResponse,
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
_getAuthorizationHeader() {
|
|
224
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
const bearer = yield core.Supplier.get(this._options.token);
|
|
226
|
-
if (bearer != null) {
|
|
227
|
-
return `Bearer ${bearer}`;
|
|
228
|
-
}
|
|
229
|
-
return undefined;
|
|
181
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/plans/group/{planGroupId}");
|
|
230
182
|
});
|
|
231
183
|
}
|
|
232
184
|
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* @example
|
|
6
3
|
* {
|
|
@@ -12,24 +9,14 @@
|
|
|
12
9
|
* }
|
|
13
10
|
*/
|
|
14
11
|
export interface PlansGetUsageRequest {
|
|
15
|
-
/**
|
|
16
|
-
* The external ID of the customer
|
|
17
|
-
*/
|
|
12
|
+
/** The external ID of the customer */
|
|
18
13
|
externalId: string;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum number of usage summaries to return (1-1000)
|
|
21
|
-
*/
|
|
14
|
+
/** Maximum number of usage summaries to return (1-1000) */
|
|
22
15
|
limit?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Number of usage summaries to skip for pagination
|
|
25
|
-
*/
|
|
16
|
+
/** Number of usage summaries to skip for pagination */
|
|
26
17
|
offset?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range.
|
|
29
|
-
*/
|
|
18
|
+
/** Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range. */
|
|
30
19
|
startTime?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range.
|
|
33
|
-
*/
|
|
20
|
+
/** Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range. */
|
|
34
21
|
endTime?: string;
|
|
35
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { PlansGetUsageRequest } from "./PlansGetUsageRequest.mjs";
|