@paid-ai/paid-node 0.5.1 → 1.0.1-alpha0
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 +26 -0
- package/dist/cjs/BaseClient.js +3 -0
- package/dist/cjs/Client.d.ts +6 -69
- package/dist/cjs/Client.js +20 -88
- package/dist/cjs/api/errors/BadRequestError.d.ts +2 -5
- package/dist/cjs/api/errors/BadRequestError.js +1 -3
- package/dist/cjs/api/errors/ForbiddenError.d.ts +2 -5
- package/dist/cjs/api/errors/ForbiddenError.js +1 -3
- package/dist/cjs/api/errors/InternalServerError.d.ts +2 -5
- package/dist/cjs/api/errors/InternalServerError.js +1 -3
- package/dist/cjs/api/errors/NotFoundError.d.ts +2 -5
- package/dist/cjs/api/errors/NotFoundError.js +1 -3
- 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 +4 -21
- package/dist/cjs/api/resources/agents/client/Client.js +59 -49
- 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 +4 -21
- package/dist/cjs/api/resources/contacts/client/Client.js +45 -39
- 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 +84 -21
- package/dist/cjs/api/resources/customers/client/Client.js +376 -76
- 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 +82 -20
- package/dist/cjs/api/resources/orders/client/Client.js +325 -34
- 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 +4 -21
- package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +10 -14
- 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 +3 -20
- package/dist/cjs/api/resources/plans/client/Client.js +30 -31
- 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 +4 -21
- package/dist/cjs/api/resources/products/client/Client.js +59 -49
- 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/traces/client/Client.d.ts +3 -20
- package/dist/cjs/api/resources/traces/client/Client.js +19 -24
- 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 +3 -20
- package/dist/cjs/api/resources/usage/client/Client.js +25 -25
- 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/core/auth/AuthProvider.d.ts +4 -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/index.d.ts +2 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +20 -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 +7 -5
- package/dist/cjs/core/fetcher/Fetcher.js +9 -7
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +1 -1
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/cjs/core/fetcher/ResponseWithBody.js +6 -0
- 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/getResponseBody.js +34 -33
- 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.js +2 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
- package/dist/cjs/core/headers.d.ts +2 -3
- package/dist/cjs/core/index.d.ts +3 -1
- package/dist/cjs/core/index.js +26 -1
- package/dist/cjs/core/runtime/runtime.js +0 -1
- 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 +69 -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 +2 -4
- package/dist/cjs/errors/PaidTimeoutError.d.ts +0 -3
- package/dist/cjs/errors/PaidTimeoutError.js +1 -3
- package/dist/cjs/index.d.ts +1 -2
- package/dist/cjs/index.js +1 -6
- 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 +26 -0
- package/dist/esm/BaseClient.mjs +2 -0
- package/dist/esm/Client.d.mts +6 -69
- package/dist/esm/Client.mjs +9 -77
- package/dist/esm/api/errors/BadRequestError.d.mts +2 -5
- package/dist/esm/api/errors/BadRequestError.mjs +1 -3
- package/dist/esm/api/errors/ForbiddenError.d.mts +2 -5
- package/dist/esm/api/errors/ForbiddenError.mjs +1 -3
- package/dist/esm/api/errors/InternalServerError.d.mts +2 -5
- package/dist/esm/api/errors/InternalServerError.mjs +1 -3
- package/dist/esm/api/errors/NotFoundError.d.mts +2 -5
- package/dist/esm/api/errors/NotFoundError.mjs +1 -3
- 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 +4 -21
- package/dist/esm/api/resources/agents/client/Client.mjs +59 -46
- 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 +4 -21
- package/dist/esm/api/resources/contacts/client/Client.mjs +45 -36
- 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 +84 -21
- package/dist/esm/api/resources/customers/client/Client.mjs +376 -73
- 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 +82 -20
- package/dist/esm/api/resources/orders/client/Client.mjs +325 -31
- 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 +4 -21
- package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +10 -11
- 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 +3 -20
- package/dist/esm/api/resources/plans/client/Client.mjs +30 -28
- 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 +4 -21
- package/dist/esm/api/resources/products/client/Client.mjs +59 -46
- 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/traces/client/Client.d.mts +3 -20
- package/dist/esm/api/resources/traces/client/Client.mjs +19 -21
- 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 +3 -20
- package/dist/esm/api/resources/usage/client/Client.mjs +25 -22
- 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/core/auth/AuthProvider.d.mts +4 -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/index.d.mts +2 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +20 -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 +7 -5
- package/dist/esm/core/fetcher/Fetcher.mjs +9 -7
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +1 -1
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +4 -0
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +3 -0
- 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/getResponseBody.mjs +34 -33
- 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.mjs +2 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
- package/dist/esm/core/headers.d.mts +2 -3
- package/dist/esm/core/index.d.mts +3 -1
- package/dist/esm/core/index.mjs +3 -1
- package/dist/esm/core/runtime/runtime.mjs +0 -1
- 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 +66 -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 +2 -4
- package/dist/esm/errors/PaidTimeoutError.d.mts +0 -3
- package/dist/esm/errors/PaidTimeoutError.mjs +1 -3
- package/dist/esm/index.d.mts +1 -2
- package/dist/esm/index.mjs +0 -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 +40 -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/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -59
- package/dist/cjs/wrapper/BatchUsage.d.ts +0 -8
- package/dist/cjs/wrapper/BatchUsage.js +0 -62
- 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
|
@@ -37,11 +37,6 @@ export interface PayInvoiceResult {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
export declare function payInvoice(config: PayInvoiceConfig, request: PayInvoiceRequest): Promise<PayInvoiceResult>;
|
|
40
|
-
interface PayInvoiceRequestWithBody {
|
|
41
|
-
invoiceId?: string;
|
|
42
|
-
confirmationToken: string;
|
|
43
|
-
returnUrl?: string;
|
|
44
|
-
}
|
|
45
40
|
/**
|
|
46
41
|
* Create a framework-agnostic handler for invoice payment
|
|
47
42
|
*
|
|
@@ -50,7 +45,7 @@ interface PayInvoiceRequestWithBody {
|
|
|
50
45
|
*
|
|
51
46
|
* @returns Handler function
|
|
52
47
|
*/
|
|
53
|
-
export declare function createPayInvoiceHandler(): (request:
|
|
48
|
+
export declare function createPayInvoiceHandler(): (request: any, response: any, config?: any) => Promise<any>;
|
|
54
49
|
export interface ActivateOrderSyncConfig {
|
|
55
50
|
apiUrl: string;
|
|
56
51
|
apiKey: string;
|
|
@@ -93,14 +88,6 @@ export interface ActivateOrderSyncResult {
|
|
|
93
88
|
* ```
|
|
94
89
|
*/
|
|
95
90
|
export declare function activateOrderSync(config: ActivateOrderSyncConfig, request: ActivateOrderSyncRequest): Promise<ActivateOrderSyncResult>;
|
|
96
|
-
/**
|
|
97
|
-
* Internal request body type for the handler
|
|
98
|
-
*/
|
|
99
|
-
interface ActivateOrderSyncRequestBody {
|
|
100
|
-
orderId?: string;
|
|
101
|
-
confirmationToken: string;
|
|
102
|
-
returnUrl?: string;
|
|
103
|
-
}
|
|
104
91
|
/**
|
|
105
92
|
* Create a framework-agnostic handler for synchronous order activation
|
|
106
93
|
*
|
|
@@ -109,7 +96,7 @@ interface ActivateOrderSyncRequestBody {
|
|
|
109
96
|
* @param defaultReturnUrl - Optional default return URL
|
|
110
97
|
* @returns Handler function
|
|
111
98
|
*/
|
|
112
|
-
export declare function createActivateOrderSyncHandler(defaultReturnUrl?: string): (request:
|
|
99
|
+
export declare function createActivateOrderSyncHandler(defaultReturnUrl?: string): (request: any, response: any, config?: any) => Promise<any>;
|
|
113
100
|
export interface SetupIntentRequest {
|
|
114
101
|
customerId: string;
|
|
115
102
|
confirmationToken: string;
|
|
@@ -192,5 +179,4 @@ export declare function createSetupIntent(config: SetupIntentConfig, request: Se
|
|
|
192
179
|
* }
|
|
193
180
|
* ```
|
|
194
181
|
*/
|
|
195
|
-
export declare function createSetupIntentHandler(defaultReturnUrl?: string): (request:
|
|
196
|
-
export {};
|
|
182
|
+
export declare function createSetupIntentHandler(defaultReturnUrl?: string): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -63,4 +63,4 @@ export declare function createContact(client: PaidClient, data: Required<Omit<Co
|
|
|
63
63
|
*
|
|
64
64
|
* @returns Handler function
|
|
65
65
|
*/
|
|
66
|
-
export declare function createContactsHandler(): (request:
|
|
66
|
+
export declare function createContactsHandler(): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -60,7 +60,7 @@ export declare function createCustomer(client: PaidClient, data: Required<Omit<C
|
|
|
60
60
|
*
|
|
61
61
|
* @returns Handler function
|
|
62
62
|
*/
|
|
63
|
-
export declare function createCustomersHandler(): (request:
|
|
63
|
+
export declare function createCustomersHandler(): (request: any, response: any, config?: any) => Promise<any>;
|
|
64
64
|
/**
|
|
65
65
|
* Get a customer by external ID
|
|
66
66
|
*
|
|
@@ -93,4 +93,4 @@ export declare function getCustomer(client: PaidClient, customerExternalId: stri
|
|
|
93
93
|
* export const GET = nextjsAdapter(handler);
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
|
-
export declare function createGetCustomerHandler(): (request:
|
|
96
|
+
export declare function createGetCustomerHandler(): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PayInvoiceConfig } from "./billing.js";
|
|
1
|
+
import type { PayInvoiceConfig } from "./billing.js";
|
|
2
2
|
export interface CustomerInvoicesResult {
|
|
3
3
|
data: any[];
|
|
4
4
|
}
|
|
@@ -25,9 +25,6 @@ export interface CustomerInvoicesResult {
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export declare function getCustomerInvoices(config: PayInvoiceConfig, customerExternalId: string): Promise<CustomerInvoicesResult>;
|
|
28
|
-
interface CustomerInvoicesRequest {
|
|
29
|
-
customerExternalId: string;
|
|
30
|
-
}
|
|
31
28
|
/**
|
|
32
29
|
* Create a framework-agnostic handler for fetching customer invoices
|
|
33
30
|
*
|
|
@@ -36,5 +33,4 @@ interface CustomerInvoicesRequest {
|
|
|
36
33
|
*
|
|
37
34
|
* @returns Handler function
|
|
38
35
|
*/
|
|
39
|
-
export declare function createCustomerInvoicesHandler(): (request:
|
|
40
|
-
export {};
|
|
36
|
+
export declare function createCustomerInvoicesHandler(): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -57,9 +57,6 @@ export declare function createOrderWithDefaults(client: PaidClient, config: Orde
|
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
export declare function createOrder(client: PaidClient, config: Required<OrderConfig>, options?: OrderOptions): Promise<OrderCreationResult>;
|
|
60
|
-
interface OrderRequest extends OrderConfig {
|
|
61
|
-
autoActivate?: boolean;
|
|
62
|
-
}
|
|
63
60
|
/**
|
|
64
61
|
* Create a framework-agnostic handler for order creation
|
|
65
62
|
*
|
|
@@ -68,5 +65,4 @@ interface OrderRequest extends OrderConfig {
|
|
|
68
65
|
* @param helperOptions - Default options for order creation
|
|
69
66
|
* @returns Handler function
|
|
70
67
|
*/
|
|
71
|
-
export declare function createOrdersHandler(helperOptions?: OrderOptions): (request:
|
|
72
|
-
export {};
|
|
68
|
+
export declare function createOrdersHandler(helperOptions?: OrderOptions): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -59,4 +59,4 @@ export declare function provisionNewUser(client: PaidClient, config: Provisionin
|
|
|
59
59
|
* }
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
|
-
export declare function createProvisioningHandler(orderOptions?: OrderOptions, defaultAgentExternalId?: string): (request:
|
|
62
|
+
export declare function createProvisioningHandler(orderOptions?: OrderOptions, defaultAgentExternalId?: string): (request: any, response: any, config?: any) => Promise<any>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Generic adapter factory - eliminates repetitive adapter code
|
|
3
3
|
* Works with any framework (Express, Fastify, Hono, Next.js, etc.)
|
|
4
4
|
*/
|
|
5
|
+
export type FrameworkAdapter<TFrameworkReq = any, TFrameworkRes = any> = (innerHandler: Function) => (req: TFrameworkReq, context?: any, config?: any) => Promise<any>;
|
|
5
6
|
/**
|
|
6
7
|
* Creates a framework adapter for any HTTP framework
|
|
7
8
|
* Automatically extracts headers and converts request/response
|
|
@@ -26,4 +27,4 @@ export declare function createFrameworkAdapter<TFrameworkReq = any, TFrameworkRe
|
|
|
26
27
|
getParams?: (req: TFrameworkReq, context?: any) => Record<string, string> | Promise<Record<string, string>>;
|
|
27
28
|
getQuery?: (req: TFrameworkReq) => Record<string, string>;
|
|
28
29
|
sendJson: (data: any, status: number) => TFrameworkRes;
|
|
29
|
-
}):
|
|
30
|
+
}): FrameworkAdapter<TFrameworkReq, TFrameworkRes>;
|
|
@@ -32,7 +32,7 @@ exports.createFrameworkAdapter = createFrameworkAdapter;
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
function createFrameworkAdapter(extractors) {
|
|
35
|
-
|
|
35
|
+
const adaptHandler = (innerHandler) => {
|
|
36
36
|
return (req, context, config) => __awaiter(this, void 0, void 0, function* () {
|
|
37
37
|
var _a;
|
|
38
38
|
const body = yield extractors.getBody(req);
|
|
@@ -53,4 +53,5 @@ function createFrameworkAdapter(extractors) {
|
|
|
53
53
|
return innerHandler(requestContext, responseContext, config);
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
+
return adaptHandler;
|
|
56
57
|
}
|
|
@@ -5,7 +5,7 @@ const instrumentation_1 = require("@opentelemetry/instrumentation");
|
|
|
5
5
|
const openinference_instrumentation_openai_1 = require("@arizeai/openinference-instrumentation-openai");
|
|
6
6
|
const instrumentation_bedrock_1 = require("@traceloop/instrumentation-bedrock");
|
|
7
7
|
const openinference_instrumentation_anthropic_1 = require("@arizeai/openinference-instrumentation-anthropic");
|
|
8
|
-
const
|
|
8
|
+
const tracing_js_1 = require("./tracing.js");
|
|
9
9
|
let IS_INITIALIZED = false;
|
|
10
10
|
const getInstrumentations = (tracerProvider) => {
|
|
11
11
|
const instrumentations = [
|
|
@@ -36,13 +36,13 @@ const getManualInstrumentations = (tracerProvider, libraries) => {
|
|
|
36
36
|
};
|
|
37
37
|
function paidAutoInstrument(libraries) {
|
|
38
38
|
if (IS_INITIALIZED) {
|
|
39
|
-
|
|
39
|
+
tracing_js_1.logger.info("Auto instrumentation is already initialized");
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
(0,
|
|
43
|
-
const tracerProvider = (0,
|
|
42
|
+
(0, tracing_js_1.initializeTracing)(); // try initializing tracing
|
|
43
|
+
const tracerProvider = (0, tracing_js_1.getPaidTracerProvider)();
|
|
44
44
|
if (!tracerProvider) {
|
|
45
|
-
|
|
45
|
+
tracing_js_1.logger.error("Could not get tracer provider, make sure you ran 'initializeTracing()' or check your environment variables");
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
const isManualInstrumentation = libraries && Object.keys(libraries).length > 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "@opentelemetry/api";
|
|
2
|
-
import { SpanProcessor, Span } from "@opentelemetry/sdk-trace-base";
|
|
1
|
+
import type { Context } from "@opentelemetry/api";
|
|
2
|
+
import type { SpanProcessor, Span } from "@opentelemetry/sdk-trace-base";
|
|
3
3
|
export declare class PaidSpanProcessor implements SpanProcessor {
|
|
4
4
|
private static readonly SPAN_NAME_PREFIX;
|
|
5
5
|
private static readonly PROMPT_ATTRIBUTES_SUBSTRINGS;
|
|
@@ -11,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PaidSpanProcessor = void 0;
|
|
13
13
|
const tracingContext_js_1 = require("./tracingContext.js");
|
|
14
|
-
const tracing_js_1 = require("./tracing.js");
|
|
15
14
|
class PaidSpanProcessor {
|
|
16
15
|
onStart(span, _parentContext) {
|
|
17
16
|
const { name } = span;
|
|
@@ -44,10 +43,6 @@ class PaidSpanProcessor {
|
|
|
44
43
|
if (externalAgentId) {
|
|
45
44
|
span.setAttribute("external_agent_id", externalAgentId);
|
|
46
45
|
}
|
|
47
|
-
const token = (0, tracing_js_1.getToken)();
|
|
48
|
-
if (token) {
|
|
49
|
-
span.setAttribute("token", token);
|
|
50
|
-
}
|
|
51
46
|
}
|
|
52
47
|
onEnd() {
|
|
53
48
|
// mutating this span object doesn't do anything
|
|
@@ -20,6 +20,7 @@ exports.initializeTracing = initializeTracing;
|
|
|
20
20
|
exports.trace = trace;
|
|
21
21
|
const api_1 = require("@opentelemetry/api");
|
|
22
22
|
const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-http");
|
|
23
|
+
const resources_1 = require("@opentelemetry/resources");
|
|
23
24
|
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
|
24
25
|
const winston_1 = __importDefault(require("winston"));
|
|
25
26
|
const tracingContext_js_1 = require("./tracingContext.js");
|
|
@@ -87,6 +88,7 @@ function initializeTracing(apiKey, collectorEndpoint) {
|
|
|
87
88
|
const exporter = new exporter_trace_otlp_http_1.OTLPTraceExporter({ url });
|
|
88
89
|
const spanProcessor = new sdk_trace_node_1.SimpleSpanProcessor(exporter);
|
|
89
90
|
paidTracerProvider = new sdk_trace_node_1.NodeTracerProvider({
|
|
91
|
+
resource: (0, resources_1.resourceFromAttributes)({ "api.key": paidApiToken }),
|
|
90
92
|
spanProcessors: [spanProcessor, new spanProcessor_js_1.PaidSpanProcessor()],
|
|
91
93
|
});
|
|
92
94
|
paidTracerProvider.register();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Anthropic from "@anthropic-ai/sdk";
|
|
2
|
-
import { Tracer } from "@opentelemetry/api";
|
|
3
|
-
import { MessageCreateParams } from "@anthropic-ai/sdk/resources/messages";
|
|
2
|
+
import type { Tracer } from "@opentelemetry/api";
|
|
3
|
+
import type { MessageCreateParams } from "@anthropic-ai/sdk/resources/messages";
|
|
4
4
|
export declare class PaidAnthropic {
|
|
5
5
|
private readonly anthropic;
|
|
6
6
|
private readonly tracer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Mistral } from "@mistralai/mistralai";
|
|
2
|
-
import { Tracer } from "@opentelemetry/api";
|
|
3
|
-
import { OCRRequest, OCRResponse } from "@mistralai/mistralai/models/components";
|
|
4
|
-
import { RequestOptions } from "@mistralai/mistralai/lib/sdks";
|
|
2
|
+
import type { Tracer } from "@opentelemetry/api";
|
|
3
|
+
import type { OCRRequest, OCRResponse } from "@mistralai/mistralai/models/components";
|
|
4
|
+
import type { RequestOptions } from "@mistralai/mistralai/lib/sdks";
|
|
5
5
|
export declare class PaidMistral {
|
|
6
6
|
private readonly mistral;
|
|
7
7
|
private readonly tracer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import OpenAI from "openai";
|
|
2
|
-
import { Tracer } from "@opentelemetry/api";
|
|
3
|
-
import { ChatCompletion, ChatCompletionCreateParams } from "openai/resources/chat/completions";
|
|
4
|
-
import { EmbeddingCreateParams } from "openai/resources/embeddings";
|
|
5
|
-
import { ImagesResponse, ImageGenerateParams } from "openai/resources/images";
|
|
6
|
-
import { CreateEmbeddingResponse } from "openai/resources/embeddings";
|
|
2
|
+
import type { Tracer } from "@opentelemetry/api";
|
|
3
|
+
import type { ChatCompletion, ChatCompletionCreateParams } from "openai/resources/chat/completions";
|
|
4
|
+
import type { EmbeddingCreateParams } from "openai/resources/embeddings";
|
|
5
|
+
import type { ImagesResponse, ImageGenerateParams } from "openai/resources/images";
|
|
6
|
+
import type { CreateEmbeddingResponse } from "openai/resources/embeddings";
|
|
7
7
|
export declare class PaidOpenAI {
|
|
8
8
|
private readonly openai;
|
|
9
9
|
private readonly tracer;
|
|
@@ -11,7 +11,7 @@ export declare function generateObject(params: GenerateObjectParams): Promise<Re
|
|
|
11
11
|
export declare function streamObject(params: StreamObjectParams): Promise<ReturnType<typeof originalStreamObject>>;
|
|
12
12
|
export declare function embed(params: EmbedParams): Promise<ReturnType<typeof originalEmbed>>;
|
|
13
13
|
export declare function embedMany(params: EmbedManyParams): Promise<ReturnType<typeof originalEmbedMany>>;
|
|
14
|
-
declare const
|
|
14
|
+
declare const vercelAIWrapper: {
|
|
15
15
|
generateText: typeof generateText;
|
|
16
16
|
streamText: typeof streamText;
|
|
17
17
|
generateObject: typeof generateObject;
|
|
@@ -19,4 +19,4 @@ declare const _default: {
|
|
|
19
19
|
embed: typeof embed;
|
|
20
20
|
embedMany: typeof embedMany;
|
|
21
21
|
};
|
|
22
|
-
export default
|
|
22
|
+
export default vercelAIWrapper;
|
|
@@ -342,11 +342,12 @@ function embedMany(params) {
|
|
|
342
342
|
}));
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
|
|
346
|
-
generateText,
|
|
347
|
-
streamText,
|
|
348
|
-
generateObject,
|
|
349
|
-
streamObject,
|
|
350
|
-
embed,
|
|
351
|
-
embedMany,
|
|
345
|
+
const vercelAIWrapper = {
|
|
346
|
+
generateText: generateText,
|
|
347
|
+
streamText: streamText,
|
|
348
|
+
generateObject: generateObject,
|
|
349
|
+
streamObject: streamObject,
|
|
350
|
+
embed: embed,
|
|
351
|
+
embedMany: embedMany,
|
|
352
352
|
};
|
|
353
|
+
exports.default = vercelAIWrapper;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.1-alpha0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type * as core from "./core/index.mjs";
|
|
2
|
+
import type * as environments from "./environments.mjs";
|
|
3
|
+
export interface BaseClientOptions {
|
|
4
|
+
environment?: core.Supplier<environments.PaidEnvironment | string>;
|
|
5
|
+
/** Specify a custom URL to connect the client to. */
|
|
6
|
+
baseUrl?: core.Supplier<string>;
|
|
7
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
8
|
+
/** Additional headers to include in requests. */
|
|
9
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
10
|
+
/** The default maximum time to wait for a response in seconds. */
|
|
11
|
+
timeoutInSeconds?: number;
|
|
12
|
+
/** The default number of times to retry the request. Defaults to 2. */
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface BaseRequestOptions {
|
|
16
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
|
+
timeoutInSeconds?: number;
|
|
18
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** A hook to abort the request. */
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional query string parameters to include in the request. */
|
|
23
|
+
queryParams?: Record<string, unknown>;
|
|
24
|
+
/** Additional headers to include in the request. */
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
26
|
+
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "./environments.mjs";
|
|
5
|
-
import * as core from "./core/index.mjs";
|
|
6
|
-
import { Customers } from "./api/resources/customers/client/Client.mjs";
|
|
7
1
|
import { Agents } from "./api/resources/agents/client/Client.mjs";
|
|
8
|
-
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
9
2
|
import { Contacts } from "./api/resources/contacts/client/Client.mjs";
|
|
3
|
+
import { Customers } from "./api/resources/customers/client/Client.mjs";
|
|
10
4
|
import { Orders } from "./api/resources/orders/client/Client.mjs";
|
|
11
5
|
import { Plans } from "./api/resources/plans/client/Client.mjs";
|
|
12
|
-
import {
|
|
6
|
+
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
13
7
|
import { Traces } from "./api/resources/traces/client/Client.mjs";
|
|
14
|
-
import {
|
|
8
|
+
import { Usage } from "./api/resources/usage/client/Client.mjs";
|
|
9
|
+
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
15
10
|
export declare namespace PaidClient {
|
|
16
|
-
interface Options {
|
|
17
|
-
environment?: core.Supplier<environments.PaidEnvironment | string>;
|
|
18
|
-
/** Specify a custom URL to connect the client to. */
|
|
19
|
-
baseUrl?: core.Supplier<string>;
|
|
20
|
-
token?: core.Supplier<core.BearerToken | undefined>;
|
|
21
|
-
/** Additional headers to include in requests. */
|
|
22
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
11
|
+
interface Options extends BaseClientOptions {
|
|
23
12
|
}
|
|
24
|
-
interface RequestOptions {
|
|
25
|
-
/** The maximum time to wait for a response in seconds. */
|
|
26
|
-
timeoutInSeconds?: number;
|
|
27
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
28
|
-
maxRetries?: number;
|
|
29
|
-
/** A hook to abort the request. */
|
|
30
|
-
abortSignal?: AbortSignal;
|
|
31
|
-
/** Additional headers to include in the request. */
|
|
32
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
33
14
|
}
|
|
34
15
|
}
|
|
35
16
|
export declare class PaidClient {
|
|
@@ -51,48 +32,4 @@ export declare class PaidClient {
|
|
|
51
32
|
get plans(): Plans;
|
|
52
33
|
get usage(): Usage;
|
|
53
34
|
get traces(): Traces;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated use the standalone 'initializeTracing' instead
|
|
56
|
-
*/
|
|
57
|
-
initializeTracing(collectorEndpoint?: string): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated use the standalone 'trace()' instead
|
|
60
|
-
* Use this method to track actions like LLM costs and sending signals.
|
|
61
|
-
* The callback to this function is the work that you want to trace.
|
|
62
|
-
*
|
|
63
|
-
* @param externalCustomerId - The external customer ID
|
|
64
|
-
* @param fn - The callback function containing the work to be traced
|
|
65
|
-
* @param externalAgentId - @deprecated Use externalProductId instead
|
|
66
|
-
* @param externalProductId - The external product ID
|
|
67
|
-
* @param storePrompt - Whether to store the prompt (defaults to false)
|
|
68
|
-
* @param args - Arguments to pass to the callback function
|
|
69
|
-
* @returns The return value of the callback function
|
|
70
|
-
*/
|
|
71
|
-
trace<T extends (...args: any[]) => any>(externalCustomerId: string, fn: T, externalAgentId?: string, externalProductId?: string, storePrompt?: boolean, ...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
72
|
-
/**
|
|
73
|
-
* @deprecated use the standalone 'signal()' instead
|
|
74
|
-
* Sends Paid signal. Needs to be called as part of callback to Paid.trace().
|
|
75
|
-
* When enableCostTracing flag is on, signal is associated
|
|
76
|
-
* with cost traces from the same Paid.trace() context.
|
|
77
|
-
*
|
|
78
|
-
* @param eventName - The name of the signal.
|
|
79
|
-
* @param enableCostTracing - Whether to associate this signal with cost traces
|
|
80
|
-
* from the current Paid.trace() context (default: false)
|
|
81
|
-
* @param data - Optional additional data to include with the signal
|
|
82
|
-
*
|
|
83
|
-
* @remarks
|
|
84
|
-
* When enableCostTracing is on, the signal will be associated with cost
|
|
85
|
-
* traces within the same Paid.trace() context.
|
|
86
|
-
* It is advised to only make one call to this function
|
|
87
|
-
* with enableCostTracing per Paid.trace() context.
|
|
88
|
-
* Otherwise, there will be multiple signals that refer to the same costs.
|
|
89
|
-
*/
|
|
90
|
-
signal(eventName: string): void;
|
|
91
|
-
signal(eventName: string, data: Record<string, any>): void;
|
|
92
|
-
signal(eventName: string, enableCostTracing: boolean, data?: Record<string, any>): void;
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated use the standalone 'getPaidTracerProvider()' instead
|
|
95
|
-
* Export the tracer provider which user can use for his own tracing.
|
|
96
|
-
*/
|
|
97
|
-
get tracerProvider(): NodeTracerProvider | undefined;
|
|
98
35
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
import * as core from "./core/index.mjs";
|
|
14
|
-
import { mergeHeaders } from "./core/headers.mjs";
|
|
15
|
-
import { Customers } from "./api/resources/customers/client/Client.mjs";
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
16
2
|
import { Agents } from "./api/resources/agents/client/Client.mjs";
|
|
17
|
-
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
18
3
|
import { Contacts } from "./api/resources/contacts/client/Client.mjs";
|
|
4
|
+
import { Customers } from "./api/resources/customers/client/Client.mjs";
|
|
19
5
|
import { Orders } from "./api/resources/orders/client/Client.mjs";
|
|
20
6
|
import { Plans } from "./api/resources/plans/client/Client.mjs";
|
|
21
|
-
import {
|
|
7
|
+
import { Products } from "./api/resources/products/client/Client.mjs";
|
|
22
8
|
import { Traces } from "./api/resources/traces/client/Client.mjs";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
9
|
+
import { Usage } from "./api/resources/usage/client/Client.mjs";
|
|
10
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
11
|
+
import * as core from "./core/index.mjs";
|
|
25
12
|
export class PaidClient {
|
|
26
13
|
constructor(_options = {}) {
|
|
27
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
28
15
|
"X-Fern-Language": "JavaScript",
|
|
29
|
-
"X-Fern-SDK-Name": "",
|
|
30
|
-
"X-Fern-SDK-Version": "0.
|
|
16
|
+
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
17
|
+
"X-Fern-SDK-Version": "1.0.1-alpha0",
|
|
18
|
+
"User-Agent": "@paid-ai/paid-node/1.0.1-alpha0",
|
|
31
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
32
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
33
21
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -64,60 +52,4 @@ export class PaidClient {
|
|
|
64
52
|
var _a;
|
|
65
53
|
return ((_a = this._traces) !== null && _a !== void 0 ? _a : (this._traces = new Traces(this._options)));
|
|
66
54
|
}
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated use the standalone 'initializeTracing' instead
|
|
69
|
-
*/
|
|
70
|
-
initializeTracing(collectorEndpoint) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
const tokenSupplier = this._options.token;
|
|
73
|
-
const token = typeof tokenSupplier === "function" ? yield tokenSupplier() : tokenSupplier;
|
|
74
|
-
const resolvedToken = yield Promise.resolve(token);
|
|
75
|
-
initializeTracing(resolvedToken, collectorEndpoint);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated use the standalone 'trace()' instead
|
|
80
|
-
* Use this method to track actions like LLM costs and sending signals.
|
|
81
|
-
* The callback to this function is the work that you want to trace.
|
|
82
|
-
*
|
|
83
|
-
* @param externalCustomerId - The external customer ID
|
|
84
|
-
* @param fn - The callback function containing the work to be traced
|
|
85
|
-
* @param externalAgentId - @deprecated Use externalProductId instead
|
|
86
|
-
* @param externalProductId - The external product ID
|
|
87
|
-
* @param storePrompt - Whether to store the prompt (defaults to false)
|
|
88
|
-
* @param args - Arguments to pass to the callback function
|
|
89
|
-
* @returns The return value of the callback function
|
|
90
|
-
*/
|
|
91
|
-
trace(externalCustomerId_1, fn_1, externalAgentId_1, externalProductId_1) {
|
|
92
|
-
return __awaiter(this, arguments, void 0, function* (externalCustomerId, fn, externalAgentId, externalProductId, storePrompt = false, ...args) {
|
|
93
|
-
// TODO: remove this after deprecation and replace externalAgentId with externalProductId everywhere
|
|
94
|
-
if (externalProductId) {
|
|
95
|
-
externalAgentId = externalProductId;
|
|
96
|
-
}
|
|
97
|
-
return yield trace({ externalCustomerId, externalProductId: externalAgentId, storePrompt }, fn, ...args);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
signal(eventName, enableCostTracingOrData, data) {
|
|
101
|
-
let enableCostTracing = false;
|
|
102
|
-
let finalData;
|
|
103
|
-
if (typeof enableCostTracingOrData === "boolean") {
|
|
104
|
-
// Case: signal(eventName, boolean, data?)
|
|
105
|
-
enableCostTracing = enableCostTracingOrData;
|
|
106
|
-
finalData = data;
|
|
107
|
-
}
|
|
108
|
-
else if (typeof enableCostTracingOrData === "object") {
|
|
109
|
-
// Case: signal(eventName, data)
|
|
110
|
-
enableCostTracing = false;
|
|
111
|
-
finalData = enableCostTracingOrData;
|
|
112
|
-
}
|
|
113
|
-
// Case: signal(eventName) - both remain default/undefined
|
|
114
|
-
return signal(eventName, enableCostTracing, finalData);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* @deprecated use the standalone 'getPaidTracerProvider()' instead
|
|
118
|
-
* Export the tracer provider which user can use for his own tracing.
|
|
119
|
-
*/
|
|
120
|
-
get tracerProvider() {
|
|
121
|
-
return getPaidTracerProvider();
|
|
122
|
-
}
|
|
123
55
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
4
2
|
import * as errors from "../../errors/index.mjs";
|
|
5
|
-
import * as Paid from "../index.mjs";
|
|
6
|
-
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as Paid from "../index.mjs";
|
|
7
4
|
export declare class BadRequestError extends errors.PaidError {
|
|
8
5
|
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
6
|
}
|
|
@@ -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
|
import * as errors from "../../errors/index.mjs";
|
|
5
3
|
export class BadRequestError extends errors.PaidError {
|
|
6
4
|
constructor(body, rawResponse) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
4
2
|
import * as errors from "../../errors/index.mjs";
|
|
5
|
-
import * as Paid from "../index.mjs";
|
|
6
|
-
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as Paid from "../index.mjs";
|
|
7
4
|
export declare class ForbiddenError extends errors.PaidError {
|
|
8
5
|
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
6
|
}
|
|
@@ -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
|
import * as errors from "../../errors/index.mjs";
|
|
5
3
|
export class ForbiddenError extends errors.PaidError {
|
|
6
4
|
constructor(body, rawResponse) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
4
2
|
import * as errors from "../../errors/index.mjs";
|
|
5
|
-
import * as Paid from "../index.mjs";
|
|
6
|
-
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as Paid from "../index.mjs";
|
|
7
4
|
export declare class InternalServerError extends errors.PaidError {
|
|
8
5
|
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
6
|
}
|
|
@@ -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
|
import * as errors from "../../errors/index.mjs";
|
|
5
3
|
export class InternalServerError extends errors.PaidError {
|
|
6
4
|
constructor(body, rawResponse) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
4
2
|
import * as errors from "../../errors/index.mjs";
|
|
5
|
-
import * as Paid from "../index.mjs";
|
|
6
|
-
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as Paid from "../index.mjs";
|
|
7
4
|
export declare class NotFoundError extends errors.PaidError {
|
|
8
5
|
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
6
|
}
|