@schematichq/schematic-typescript-node 1.1.2 → 1.1.5
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/Client.d.ts +13 -0
- package/Client.js +97 -4
- package/api/resources/accesstokens/client/Client.js +1 -1
- package/api/resources/accounts/client/Client.d.ts +1 -1
- package/api/resources/accounts/client/Client.js +15 -15
- package/api/resources/accounts/client/requests/CreateEnvironmentRequestBody.d.ts +1 -1
- package/api/resources/billing/client/Client.d.ts +131 -1
- package/api/resources/billing/client/Client.js +836 -11
- package/api/resources/billing/client/requests/CountBillingProductsRequest.d.ts +24 -0
- package/api/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +2 -0
- package/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +8 -1
- package/api/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +29 -0
- package/api/resources/billing/client/requests/CreateMeterRequestBody.d.ts +18 -0
- package/api/resources/billing/client/requests/CreatePaymentMethodRequestBody.d.ts +26 -0
- package/api/resources/billing/client/requests/ListBillingProductsRequest.d.ts +4 -0
- package/api/resources/billing/client/requests/ListInvoicesRequest.d.ts +22 -0
- package/api/resources/{companies/client/requests/ListCompanyPlansRequest.d.ts → billing/client/requests/ListMetersRequest.d.ts} +2 -3
- package/api/resources/billing/client/requests/ListPaymentMethodsRequest.d.ts +22 -0
- package/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +4 -0
- package/api/resources/billing/client/requests/index.d.ts +7 -0
- package/api/resources/billing/types/CountBillingProductsParams.d.ts +17 -0
- package/api/resources/billing/types/CountBillingProductsResponse.d.ts +9 -0
- package/api/resources/{components/types/HydrateComponentResponse.d.ts → billing/types/DeleteProductPriceResponse.d.ts} +2 -2
- package/api/resources/billing/types/ListBillingProductsParams.d.ts +2 -0
- package/api/resources/billing/types/ListInvoicesParams.d.ts +15 -0
- package/api/resources/billing/types/ListInvoicesParams.js +5 -0
- package/{dist/api/resources/companies/types/ListCompanyPlansResponse.d.ts → api/resources/billing/types/ListInvoicesResponse.d.ts} +3 -3
- package/api/resources/billing/types/ListInvoicesResponse.js +5 -0
- package/api/resources/{companies/types/ListCompanyPlansParams.d.ts → billing/types/ListMetersParams.d.ts} +2 -3
- package/api/resources/billing/types/ListMetersParams.js +5 -0
- package/api/resources/{companies/types/ListCompanyPlansResponse.d.ts → billing/types/ListMetersResponse.d.ts} +3 -3
- package/api/resources/billing/types/ListMetersResponse.js +5 -0
- package/api/resources/billing/types/ListPaymentMethodsParams.d.ts +15 -0
- package/api/resources/billing/types/ListPaymentMethodsParams.js +5 -0
- package/api/resources/billing/types/ListPaymentMethodsResponse.d.ts +10 -0
- package/api/resources/billing/types/ListPaymentMethodsResponse.js +5 -0
- package/api/resources/billing/types/ListProductPricesParams.d.ts +2 -0
- package/{dist/api/resources/components/types/HydrateComponentResponse.d.ts → api/resources/billing/types/UpsertBillingMeterResponse.d.ts} +2 -2
- package/api/resources/billing/types/UpsertBillingMeterResponse.js +5 -0
- package/api/resources/billing/types/UpsertInvoiceResponse.d.ts +9 -0
- package/api/resources/billing/types/UpsertInvoiceResponse.js +5 -0
- package/api/resources/billing/types/UpsertPaymentMethodResponse.d.ts +9 -0
- package/api/resources/billing/types/UpsertPaymentMethodResponse.js +5 -0
- package/api/resources/billing/types/index.d.ts +12 -0
- package/api/resources/billing/types/index.js +12 -0
- package/api/resources/companies/client/Client.d.ts +3 -16
- package/api/resources/companies/client/Client.js +50 -149
- package/api/resources/companies/client/requests/CountCompaniesRequest.d.ts +11 -1
- package/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.d.ts +1 -1
- package/api/resources/companies/client/requests/CountUsersRequest.d.ts +10 -1
- package/api/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.d.ts +2 -2
- package/api/resources/companies/client/requests/ListCompaniesRequest.d.ts +11 -1
- package/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.d.ts +1 -1
- package/api/resources/companies/client/requests/ListUsersRequest.d.ts +10 -1
- package/api/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.d.ts +1 -1
- package/api/resources/companies/client/requests/index.d.ts +0 -1
- package/api/resources/companies/types/CountCompaniesParams.d.ts +5 -1
- package/api/resources/companies/types/CountUsersParams.d.ts +4 -1
- package/api/resources/companies/types/ListCompaniesParams.d.ts +5 -1
- package/api/resources/companies/types/ListUsersParams.d.ts +4 -1
- package/api/resources/companies/types/index.d.ts +0 -2
- package/api/resources/companies/types/index.js +0 -2
- package/api/resources/components/client/Client.d.ts +9 -9
- package/api/resources/components/client/Client.js +49 -40
- package/api/resources/components/client/requests/CreateComponentRequestBody.d.ts +1 -1
- package/api/resources/components/client/requests/PreviewComponentDataRequest.d.ts +11 -0
- package/api/resources/components/client/requests/PreviewComponentDataRequest.js +5 -0
- package/api/resources/components/client/requests/index.d.ts +1 -0
- package/api/resources/components/types/PreviewComponentDataParams.d.ts +10 -0
- package/api/resources/components/types/PreviewComponentDataParams.js +5 -0
- package/api/resources/components/types/PreviewComponentDataResponse.d.ts +9 -0
- package/api/resources/components/types/PreviewComponentDataResponse.js +5 -0
- package/api/resources/components/types/index.d.ts +2 -1
- package/api/resources/components/types/index.js +2 -1
- package/api/resources/crm/client/Client.js +5 -5
- package/api/resources/entitlements/client/Client.d.ts +4 -4
- package/api/resources/entitlements/client/Client.js +31 -25
- package/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.d.ts +18 -0
- package/api/resources/entitlements/client/requests/CountFeatureUsageRequest.d.ts +2 -1
- package/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.d.ts +18 -0
- package/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.d.ts +1 -1
- package/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +1 -1
- package/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.d.ts +18 -0
- package/api/resources/entitlements/client/requests/ListFeatureUsageRequest.d.ts +2 -1
- package/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.d.ts +18 -0
- package/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.d.ts +1 -1
- package/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +1 -1
- package/api/resources/entitlements/types/CountCompanyOverridesParams.d.ts +6 -0
- package/api/resources/entitlements/types/CountFeatureUsageParams.d.ts +1 -0
- package/api/resources/entitlements/types/CountPlanEntitlementsParams.d.ts +6 -0
- package/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.d.ts +2 -1
- package/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +1 -0
- package/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.d.ts +2 -1
- package/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +1 -0
- package/api/resources/entitlements/types/ListCompanyOverridesParams.d.ts +6 -0
- package/api/resources/entitlements/types/ListFeatureUsageParams.d.ts +1 -0
- package/api/resources/entitlements/types/ListPlanEntitlementsParams.d.ts +6 -0
- package/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.d.ts +2 -1
- package/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +1 -0
- package/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.d.ts +2 -1
- package/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +1 -0
- package/api/resources/events/client/Client.d.ts +2 -2
- package/api/resources/events/client/Client.js +10 -10
- package/api/resources/events/client/requests/CreateEventBatchRequestBody.d.ts +1 -1
- package/api/resources/features/client/Client.d.ts +21 -21
- package/api/resources/features/client/Client.js +40 -40
- package/api/resources/features/client/requests/CreateFeatureRequestBody.d.ts +1 -1
- package/api/resources/features/client/requests/UpdateFlagRulesRequestBody.d.ts +4 -4
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/plangroups/client/Client.d.ts +74 -0
- package/api/resources/plangroups/client/Client.js +346 -0
- package/api/resources/plangroups/client/index.d.ts +1 -0
- package/api/resources/plangroups/client/index.js +17 -0
- package/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +15 -0
- package/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +5 -0
- package/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +15 -0
- package/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +5 -0
- package/api/resources/plangroups/client/requests/index.d.ts +2 -0
- package/api/resources/plangroups/client/requests/index.js +2 -0
- package/api/resources/plangroups/index.d.ts +2 -0
- package/api/resources/plangroups/index.js +18 -0
- package/api/resources/plangroups/types/CreatePlanGroupResponse.d.ts +9 -0
- package/api/resources/plangroups/types/CreatePlanGroupResponse.js +5 -0
- package/api/resources/plangroups/types/GetPlanGroupResponse.d.ts +9 -0
- package/api/resources/plangroups/types/GetPlanGroupResponse.js +5 -0
- package/api/resources/plangroups/types/UpdatePlanGroupResponse.d.ts +9 -0
- package/api/resources/plangroups/types/UpdatePlanGroupResponse.js +5 -0
- package/api/resources/plangroups/types/index.d.ts +3 -0
- package/api/resources/plangroups/types/index.js +19 -0
- package/api/resources/plans/client/Client.d.ts +5 -6
- package/api/resources/plans/client/Client.js +35 -24
- package/api/resources/plans/client/requests/CountPlansRequest.d.ts +9 -1
- package/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +1 -2
- package/api/resources/plans/client/requests/ListPlansRequest.d.ts +9 -1
- package/api/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +4 -4
- package/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
- package/api/resources/plans/types/CountPlansParams.d.ts +4 -0
- package/api/resources/plans/types/ListPlansParams.d.ts +4 -0
- package/api/resources/webhooks/client/Client.d.ts +1 -1
- package/api/resources/webhooks/client/Client.js +18 -18
- package/api/resources/webhooks/client/requests/CountWebhookEventsRequest.d.ts +1 -1
- package/api/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +1 -1
- package/api/resources/webhooks/client/requests/ListWebhookEventsRequest.d.ts +1 -1
- package/api/types/BillingCustomerSubscription.d.ts +1 -0
- package/api/types/BillingMeterResponseData.d.ts +10 -0
- package/api/types/BillingMeterResponseData.js +5 -0
- package/api/types/BillingPriceResponseData.d.ts +1 -0
- package/api/types/BillingProductForSubscriptionResponseData.d.ts +18 -0
- package/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/api/types/BillingProductPricing.d.ts +3 -0
- package/api/types/BillingSubscriptionResponseData.d.ts +4 -4
- package/api/types/CheckFlagRequestBody.d.ts +2 -2
- package/api/types/CompanyDetailResponseData.d.ts +4 -3
- package/api/types/CompanyPlanDetailResponseData.d.ts +23 -0
- package/api/types/CompanyPlanDetailResponseData.js +5 -0
- package/api/types/CompanyPlanWithBillingSubView.d.ts +12 -0
- package/api/types/CompanyPlanWithBillingSubView.js +5 -0
- package/api/types/CompanySubscriptionResponseData.d.ts +6 -1
- package/api/types/ComponentHydrateResponseData.d.ts +5 -3
- package/api/types/ComponentPreviewResponseData.d.ts +18 -0
- package/api/types/ComponentPreviewResponseData.js +5 -0
- package/api/types/ComponentResponseData.d.ts +3 -0
- package/api/types/CreateOrUpdateConditionRequestBodyConditionType.d.ts +2 -1
- package/api/types/CreateOrUpdateConditionRequestBodyConditionType.js +1 -0
- package/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.d.ts +2 -1
- package/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +1 -0
- package/api/types/CreateOrUpdateConditionRequestBodyOperator.d.ts +3 -1
- package/api/types/CreateOrUpdateConditionRequestBodyOperator.js +2 -0
- package/api/types/CreateReqCommonMetricPeriod.d.ts +2 -1
- package/api/types/CreateReqCommonMetricPeriod.js +1 -0
- package/api/types/EventBodyFlagCheck.d.ts +2 -2
- package/api/types/GenericPreviewObject.d.ts +9 -0
- package/api/types/GenericPreviewObject.js +5 -0
- package/api/types/InvoiceRequestBody.d.ts +16 -0
- package/api/types/InvoiceRequestBody.js +5 -0
- package/api/types/InvoiceResponseData.d.ts +22 -0
- package/api/types/InvoiceResponseData.js +5 -0
- package/api/types/MeterRequestBody.d.ts +8 -0
- package/api/types/MeterRequestBody.js +5 -0
- package/api/types/PaymentMethodRequestBody.d.ts +17 -0
- package/api/types/PaymentMethodRequestBody.js +5 -0
- package/api/types/PaymentMethodResponseData.d.ts +23 -0
- package/api/types/PaymentMethodResponseData.js +5 -0
- package/api/types/PlanDetailResponseData.d.ts +4 -4
- package/api/types/PlanEntitlementResponseData.d.ts +0 -3
- package/api/types/PlanGroupDetailResponseData.d.ts +13 -0
- package/api/types/PlanGroupDetailResponseData.js +5 -0
- package/api/types/PlanGroupPlanDetailResponseData.d.ts +21 -0
- package/api/types/PlanGroupPlanDetailResponseData.js +5 -0
- package/api/types/PlanGroupResponseData.d.ts +12 -0
- package/api/types/PlanGroupResponseData.js +5 -0
- package/api/types/PlanResponseData.d.ts +1 -1
- package/api/types/StripeEmbedInfo.d.ts +7 -0
- package/api/types/StripeEmbedInfo.js +5 -0
- package/api/types/UpdateReqCommonMetricPeriod.d.ts +2 -1
- package/api/types/UpdateReqCommonMetricPeriod.js +1 -0
- package/api/types/index.d.ts +15 -1
- package/api/types/index.js +15 -1
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +8 -8
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +23 -2
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +2 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +16 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +2 -1
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +23 -2
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +1 -1
- package/core/schemas/Schema.d.ts +1 -0
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +50 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +5 -0
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/dist/Client.d.ts +13 -0
- package/dist/Client.js +97 -4
- package/dist/api/resources/accesstokens/client/Client.js +1 -1
- package/dist/api/resources/accounts/client/Client.d.ts +1 -1
- package/dist/api/resources/accounts/client/Client.js +15 -15
- package/dist/api/resources/accounts/client/requests/CreateEnvironmentRequestBody.d.ts +1 -1
- package/dist/api/resources/billing/client/Client.d.ts +131 -1
- package/dist/api/resources/billing/client/Client.js +836 -11
- package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.d.ts +24 -0
- package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +2 -0
- package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +8 -1
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +29 -0
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateMeterRequestBody.d.ts +18 -0
- package/dist/api/resources/billing/client/requests/CreateMeterRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreatePaymentMethodRequestBody.d.ts +26 -0
- package/dist/api/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/ListBillingProductsRequest.d.ts +4 -0
- package/dist/api/resources/billing/client/requests/ListInvoicesRequest.d.ts +22 -0
- package/dist/api/resources/billing/client/requests/ListInvoicesRequest.js +5 -0
- package/dist/api/resources/{companies/client/requests/ListCompanyPlansRequest.d.ts → billing/client/requests/ListMetersRequest.d.ts} +2 -3
- package/dist/api/resources/billing/client/requests/ListMetersRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListPaymentMethodsRequest.d.ts +22 -0
- package/dist/api/resources/billing/client/requests/ListPaymentMethodsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +4 -0
- package/dist/api/resources/billing/client/requests/index.d.ts +7 -0
- package/dist/api/resources/billing/types/CountBillingProductsParams.d.ts +17 -0
- package/dist/api/resources/billing/types/CountBillingProductsParams.js +5 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponse.js +5 -0
- package/dist/api/resources/billing/types/DeleteProductPriceResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/DeleteProductPriceResponse.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsParams.d.ts +2 -0
- package/dist/api/resources/billing/types/ListInvoicesParams.d.ts +15 -0
- package/dist/api/resources/billing/types/ListInvoicesParams.js +5 -0
- package/dist/api/resources/billing/types/ListInvoicesResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/ListInvoicesResponse.js +5 -0
- package/dist/api/resources/{companies/types/ListCompanyPlansParams.d.ts → billing/types/ListMetersParams.d.ts} +2 -3
- package/dist/api/resources/billing/types/ListMetersParams.js +5 -0
- package/dist/api/resources/billing/types/ListMetersResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/ListMetersResponse.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsParams.d.ts +15 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsParams.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.d.ts +2 -0
- package/dist/api/resources/billing/types/UpsertBillingMeterResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/UpsertBillingMeterResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertInvoiceResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/UpsertInvoiceResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertPaymentMethodResponse.d.ts +9 -0
- package/dist/api/resources/billing/types/UpsertPaymentMethodResponse.js +5 -0
- package/dist/api/resources/billing/types/index.d.ts +12 -0
- package/dist/api/resources/billing/types/index.js +12 -0
- package/dist/api/resources/companies/client/Client.d.ts +3 -16
- package/dist/api/resources/companies/client/Client.js +50 -149
- package/dist/api/resources/companies/client/requests/CountCompaniesRequest.d.ts +11 -1
- package/dist/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.d.ts +1 -1
- package/dist/api/resources/companies/client/requests/CountUsersRequest.d.ts +10 -1
- package/dist/api/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.d.ts +2 -2
- package/dist/api/resources/companies/client/requests/ListCompaniesRequest.d.ts +11 -1
- package/dist/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.d.ts +1 -1
- package/dist/api/resources/companies/client/requests/ListUsersRequest.d.ts +10 -1
- package/dist/api/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.d.ts +1 -1
- package/dist/api/resources/companies/client/requests/index.d.ts +0 -1
- package/dist/api/resources/companies/types/CountCompaniesParams.d.ts +5 -1
- package/dist/api/resources/companies/types/CountUsersParams.d.ts +4 -1
- package/dist/api/resources/companies/types/ListCompaniesParams.d.ts +5 -1
- package/dist/api/resources/companies/types/ListUsersParams.d.ts +4 -1
- package/dist/api/resources/companies/types/index.d.ts +0 -2
- package/dist/api/resources/companies/types/index.js +0 -2
- package/dist/api/resources/components/client/Client.d.ts +9 -9
- package/dist/api/resources/components/client/Client.js +49 -40
- package/dist/api/resources/components/client/requests/CreateComponentRequestBody.d.ts +1 -1
- package/dist/api/resources/components/client/requests/PreviewComponentDataRequest.d.ts +11 -0
- package/dist/api/resources/components/client/requests/PreviewComponentDataRequest.js +5 -0
- package/dist/api/resources/components/client/requests/index.d.ts +1 -0
- package/dist/api/resources/components/types/PreviewComponentDataParams.d.ts +10 -0
- package/dist/api/resources/components/types/PreviewComponentDataParams.js +5 -0
- package/dist/api/resources/components/types/PreviewComponentDataResponse.d.ts +9 -0
- package/dist/api/resources/components/types/PreviewComponentDataResponse.js +5 -0
- package/dist/api/resources/components/types/index.d.ts +2 -1
- package/dist/api/resources/components/types/index.js +2 -1
- package/dist/api/resources/crm/client/Client.js +5 -5
- package/dist/api/resources/entitlements/client/Client.d.ts +4 -4
- package/dist/api/resources/entitlements/client/Client.js +31 -25
- package/dist/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.d.ts +18 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureUsageRequest.d.ts +2 -1
- package/dist/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.d.ts +18 -0
- package/dist/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.d.ts +18 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureUsageRequest.d.ts +2 -1
- package/dist/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.d.ts +18 -0
- package/dist/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/types/CountCompanyOverridesParams.d.ts +6 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsageParams.d.ts +1 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsParams.d.ts +6 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.d.ts +2 -1
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +1 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.d.ts +2 -1
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +1 -0
- package/dist/api/resources/entitlements/types/ListCompanyOverridesParams.d.ts +6 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsageParams.d.ts +1 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsParams.d.ts +6 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.d.ts +2 -1
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +1 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.d.ts +2 -1
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +1 -0
- package/dist/api/resources/events/client/Client.d.ts +2 -2
- package/dist/api/resources/events/client/Client.js +10 -10
- package/dist/api/resources/events/client/requests/CreateEventBatchRequestBody.d.ts +1 -1
- package/dist/api/resources/features/client/Client.d.ts +21 -21
- package/dist/api/resources/features/client/Client.js +40 -40
- package/dist/api/resources/features/client/requests/CreateFeatureRequestBody.d.ts +1 -1
- package/dist/api/resources/features/client/requests/UpdateFlagRulesRequestBody.d.ts +4 -4
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/plangroups/client/Client.d.ts +74 -0
- package/dist/api/resources/plangroups/client/Client.js +346 -0
- package/dist/api/resources/plangroups/client/index.d.ts +1 -0
- package/dist/api/resources/plangroups/client/index.js +17 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +15 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +15 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/index.d.ts +2 -0
- package/dist/api/resources/plangroups/client/requests/index.js +2 -0
- package/dist/api/resources/plangroups/index.d.ts +2 -0
- package/dist/api/resources/plangroups/index.js +18 -0
- package/dist/api/resources/plangroups/types/CreatePlanGroupResponse.d.ts +9 -0
- package/dist/api/resources/plangroups/types/CreatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/GetPlanGroupResponse.d.ts +9 -0
- package/dist/api/resources/plangroups/types/GetPlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/UpdatePlanGroupResponse.d.ts +9 -0
- package/dist/api/resources/plangroups/types/UpdatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/index.d.ts +3 -0
- package/dist/api/resources/plangroups/types/index.js +19 -0
- package/dist/api/resources/plans/client/Client.d.ts +5 -6
- package/dist/api/resources/plans/client/Client.js +35 -24
- package/dist/api/resources/plans/client/requests/CountPlansRequest.d.ts +9 -1
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +1 -2
- package/dist/api/resources/plans/client/requests/ListPlansRequest.d.ts +9 -1
- package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +4 -4
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -2
- package/dist/api/resources/plans/types/CountPlansParams.d.ts +4 -0
- package/dist/api/resources/plans/types/ListPlansParams.d.ts +4 -0
- package/dist/api/resources/webhooks/client/Client.d.ts +1 -1
- package/dist/api/resources/webhooks/client/Client.js +18 -18
- package/dist/api/resources/webhooks/client/requests/CountWebhookEventsRequest.d.ts +1 -1
- package/dist/api/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +1 -1
- package/dist/api/resources/webhooks/client/requests/ListWebhookEventsRequest.d.ts +1 -1
- package/dist/api/types/BillingCustomerSubscription.d.ts +1 -0
- package/dist/api/types/BillingMeterResponseData.d.ts +10 -0
- package/dist/api/types/BillingMeterResponseData.js +5 -0
- package/dist/api/types/BillingPriceResponseData.d.ts +1 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.d.ts +18 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingProductPricing.d.ts +3 -0
- package/dist/api/types/BillingSubscriptionResponseData.d.ts +4 -4
- package/dist/api/types/CheckFlagRequestBody.d.ts +2 -2
- package/dist/api/types/CompanyDetailResponseData.d.ts +4 -3
- package/dist/api/types/CompanyPlanDetailResponseData.d.ts +23 -0
- package/dist/api/types/CompanyPlanDetailResponseData.js +5 -0
- package/dist/api/types/CompanyPlanWithBillingSubView.d.ts +12 -0
- package/dist/api/types/CompanyPlanWithBillingSubView.js +5 -0
- package/dist/api/types/CompanySubscriptionResponseData.d.ts +6 -1
- package/dist/api/types/ComponentHydrateResponseData.d.ts +5 -3
- package/dist/api/types/ComponentPreviewResponseData.d.ts +18 -0
- package/dist/api/types/ComponentPreviewResponseData.js +5 -0
- package/dist/api/types/ComponentResponseData.d.ts +3 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyConditionType.d.ts +2 -1
- package/dist/api/types/CreateOrUpdateConditionRequestBodyConditionType.js +1 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.d.ts +2 -1
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +1 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyOperator.d.ts +3 -1
- package/dist/api/types/CreateOrUpdateConditionRequestBodyOperator.js +2 -0
- package/dist/api/types/CreateReqCommonMetricPeriod.d.ts +2 -1
- package/dist/api/types/CreateReqCommonMetricPeriod.js +1 -0
- package/dist/api/types/EventBodyFlagCheck.d.ts +2 -2
- package/dist/api/types/GenericPreviewObject.d.ts +9 -0
- package/dist/api/types/GenericPreviewObject.js +5 -0
- package/dist/api/types/InvoiceRequestBody.d.ts +16 -0
- package/dist/api/types/InvoiceRequestBody.js +5 -0
- package/dist/api/types/InvoiceResponseData.d.ts +22 -0
- package/dist/api/types/InvoiceResponseData.js +5 -0
- package/dist/api/types/MeterRequestBody.d.ts +8 -0
- package/dist/api/types/MeterRequestBody.js +5 -0
- package/dist/api/types/PaymentMethodRequestBody.d.ts +17 -0
- package/dist/api/types/PaymentMethodRequestBody.js +5 -0
- package/dist/api/types/PaymentMethodResponseData.d.ts +23 -0
- package/dist/api/types/PaymentMethodResponseData.js +5 -0
- package/dist/api/types/PlanDetailResponseData.d.ts +4 -4
- package/dist/api/types/PlanEntitlementResponseData.d.ts +0 -3
- package/dist/api/types/PlanGroupDetailResponseData.d.ts +13 -0
- package/dist/api/types/PlanGroupDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.d.ts +21 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupResponseData.d.ts +12 -0
- package/dist/api/types/PlanGroupResponseData.js +5 -0
- package/dist/api/types/PlanResponseData.d.ts +1 -1
- package/dist/api/types/StripeEmbedInfo.d.ts +7 -0
- package/dist/api/types/StripeEmbedInfo.js +5 -0
- package/dist/api/types/UpdateReqCommonMetricPeriod.d.ts +2 -1
- package/dist/api/types/UpdateReqCommonMetricPeriod.js +1 -0
- package/dist/api/types/index.d.ts +15 -1
- package/dist/api/types/index.js +15 -1
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +8 -8
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +23 -2
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +2 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +16 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +2 -1
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +23 -2
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +1 -1
- package/dist/core/schemas/Schema.d.ts +1 -0
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +50 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
- package/dist/events.d.ts +3 -0
- package/dist/events.js +17 -5
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +1 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +1 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +3 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +3 -0
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +23 -0
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.js +44 -0
- package/dist/serialization/resources/billing/client/requests/CreateMeterRequestBody.d.ts +15 -0
- package/dist/serialization/resources/billing/client/requests/CreateMeterRequestBody.js +36 -0
- package/dist/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.d.ts +24 -0
- package/dist/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +45 -0
- package/dist/serialization/resources/billing/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/billing/client/requests/index.js +7 -1
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.d.ts +17 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.js +38 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponse.js +36 -0
- package/dist/serialization/resources/billing/types/DeleteProductPriceResponse.d.ts +14 -0
- package/{serialization/resources/components/types/HydrateComponentResponse.js → dist/serialization/resources/billing/types/DeleteProductPriceResponse.js} +4 -4
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.d.ts +1 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.js +1 -0
- package/dist/serialization/resources/{companies/types/ListCompanyPlansParams.d.ts → billing/types/ListInvoicesParams.d.ts} +4 -3
- package/dist/serialization/resources/billing/types/ListInvoicesParams.js +37 -0
- package/dist/serialization/resources/billing/types/ListInvoicesResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/ListInvoicesResponse.js +36 -0
- package/dist/serialization/resources/billing/types/ListMetersParams.d.ts +14 -0
- package/dist/serialization/resources/{companies/types/ListCompanyPlansParams.js → billing/types/ListMetersParams.js} +3 -4
- package/dist/serialization/resources/billing/types/ListMetersResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/ListMetersResponse.js +36 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsParams.d.ts +16 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsParams.js +37 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsResponse.js +36 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.d.ts +1 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.js +1 -0
- package/dist/serialization/resources/billing/types/UpsertBillingMeterResponse.d.ts +14 -0
- package/dist/serialization/resources/{components/types/HydrateComponentResponse.js → billing/types/UpsertBillingMeterResponse.js} +4 -4
- package/dist/serialization/resources/billing/types/UpsertInvoiceResponse.d.ts +14 -0
- package/dist/serialization/resources/billing/types/UpsertInvoiceResponse.js +35 -0
- package/dist/serialization/resources/billing/types/UpsertPaymentMethodResponse.d.ts +14 -0
- package/dist/serialization/resources/billing/types/UpsertPaymentMethodResponse.js +35 -0
- package/dist/serialization/resources/billing/types/index.d.ts +12 -0
- package/dist/serialization/resources/billing/types/index.js +12 -0
- package/dist/serialization/resources/companies/types/CountCompaniesParams.d.ts +1 -0
- package/dist/serialization/resources/companies/types/CountCompaniesParams.js +1 -0
- package/dist/serialization/resources/companies/types/ListCompaniesParams.d.ts +1 -0
- package/dist/serialization/resources/companies/types/ListCompaniesParams.js +1 -0
- package/dist/serialization/resources/companies/types/index.d.ts +0 -2
- package/dist/serialization/resources/companies/types/index.js +0 -2
- package/dist/serialization/resources/components/types/PreviewComponentDataParams.d.ts +13 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataParams.js +34 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataResponse.d.ts +15 -0
- package/dist/serialization/resources/{companies/types/ListCompanyPlansResponse.js → components/types/PreviewComponentDataResponse.js} +6 -6
- package/dist/serialization/resources/components/types/index.d.ts +2 -1
- package/dist/serialization/resources/components/types/index.js +2 -1
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageParams.d.ts +1 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageParams.js +1 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.d.ts +1 -1
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +1 -1
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.d.ts +1 -1
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +1 -1
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageParams.d.ts +1 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageParams.js +1 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.d.ts +1 -1
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +1 -1
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.d.ts +1 -1
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +1 -1
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/plangroups/client/index.d.ts +1 -0
- package/dist/serialization/resources/plangroups/client/index.js +17 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +35 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +35 -0
- package/dist/serialization/resources/plangroups/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/plangroups/client/requests/index.js +7 -0
- package/dist/serialization/resources/plangroups/index.d.ts +2 -0
- package/dist/serialization/resources/plangroups/index.js +18 -0
- package/dist/serialization/resources/plangroups/types/CreatePlanGroupResponse.d.ts +14 -0
- package/dist/serialization/resources/plangroups/types/CreatePlanGroupResponse.js +35 -0
- package/dist/serialization/resources/plangroups/types/GetPlanGroupResponse.d.ts +14 -0
- package/dist/serialization/resources/plangroups/types/GetPlanGroupResponse.js +35 -0
- package/dist/serialization/resources/plangroups/types/UpdatePlanGroupResponse.d.ts +14 -0
- package/dist/serialization/resources/plangroups/types/UpdatePlanGroupResponse.js +35 -0
- package/dist/serialization/resources/plangroups/types/index.d.ts +3 -0
- package/dist/serialization/resources/plangroups/types/index.js +19 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
- package/dist/serialization/resources/plans/types/CountPlansParams.d.ts +2 -0
- package/dist/serialization/resources/plans/types/CountPlansParams.js +2 -0
- package/dist/serialization/resources/plans/types/ListPlansParams.d.ts +2 -0
- package/dist/serialization/resources/plans/types/ListPlansParams.js +2 -0
- package/dist/serialization/types/BillingCustomerSubscription.d.ts +1 -0
- package/dist/serialization/types/BillingCustomerSubscription.js +1 -0
- package/dist/serialization/types/BillingMeterResponseData.d.ts +16 -0
- package/{serialization/types/CompanyPlanResponseData.js → dist/serialization/types/BillingMeterResponseData.js} +6 -7
- package/dist/serialization/types/BillingPriceResponseData.d.ts +1 -0
- package/dist/serialization/types/BillingPriceResponseData.js +1 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.d.ts +24 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.js +45 -0
- package/dist/serialization/types/BillingProductPricing.d.ts +3 -0
- package/dist/serialization/types/BillingProductPricing.js +3 -0
- package/dist/serialization/types/BillingSubscriptionResponseData.d.ts +4 -1
- package/dist/serialization/types/BillingSubscriptionResponseData.js +4 -1
- package/dist/serialization/types/CheckFlagRequestBody.d.ts +2 -2
- package/dist/serialization/types/CheckFlagRequestBody.js +2 -2
- package/dist/serialization/types/CompanyDetailResponseData.d.ts +7 -4
- package/dist/serialization/types/CompanyDetailResponseData.js +7 -4
- package/dist/serialization/types/CompanyPlanDetailResponseData.d.ts +32 -0
- package/dist/serialization/types/CompanyPlanDetailResponseData.js +53 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.d.ts +18 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.js +39 -0
- package/dist/serialization/types/CompanySubscriptionResponseData.d.ts +9 -2
- package/dist/serialization/types/CompanySubscriptionResponseData.js +9 -2
- package/dist/serialization/types/ComponentHydrateResponseData.d.ts +9 -0
- package/dist/serialization/types/ComponentHydrateResponseData.js +9 -0
- package/dist/serialization/types/ComponentPreviewResponseData.d.ts +27 -0
- package/dist/serialization/types/ComponentPreviewResponseData.js +48 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.d.ts +1 -1
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.js +10 -1
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.d.ts +1 -1
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +1 -1
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyOperator.d.ts +1 -1
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyOperator.js +1 -1
- package/dist/serialization/types/CreateReqCommonMetricPeriod.d.ts +1 -1
- package/dist/serialization/types/CreateReqCommonMetricPeriod.js +1 -1
- package/dist/serialization/types/EventBodyFlagCheck.d.ts +2 -2
- package/dist/serialization/types/EventBodyFlagCheck.js +2 -2
- package/dist/serialization/types/GenericPreviewObject.d.ts +15 -0
- package/dist/serialization/types/GenericPreviewObject.js +36 -0
- package/dist/serialization/types/InvoiceRequestBody.d.ts +22 -0
- package/dist/serialization/types/InvoiceRequestBody.js +43 -0
- package/dist/serialization/types/InvoiceResponseData.d.ts +28 -0
- package/dist/serialization/types/InvoiceResponseData.js +49 -0
- package/dist/serialization/types/MeterRequestBody.d.ts +14 -0
- package/dist/serialization/types/MeterRequestBody.js +35 -0
- package/dist/serialization/types/PaymentMethodRequestBody.d.ts +23 -0
- package/dist/serialization/types/PaymentMethodRequestBody.js +44 -0
- package/dist/serialization/types/PaymentMethodResponseData.d.ts +29 -0
- package/dist/serialization/types/PaymentMethodResponseData.js +50 -0
- package/dist/serialization/types/PlanDetailResponseData.d.ts +5 -1
- package/dist/serialization/types/PlanDetailResponseData.js +5 -1
- package/dist/serialization/types/PlanGroupDetailResponseData.d.ts +16 -0
- package/dist/serialization/types/PlanGroupDetailResponseData.js +37 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.d.ts +30 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.js +51 -0
- package/dist/serialization/types/PlanGroupResponseData.d.ts +15 -0
- package/dist/serialization/types/PlanGroupResponseData.js +36 -0
- package/dist/serialization/types/PlanResponseData.d.ts +1 -1
- package/dist/serialization/types/PlanResponseData.js +1 -1
- package/dist/serialization/types/StripeEmbedInfo.d.ts +13 -0
- package/dist/serialization/types/StripeEmbedInfo.js +34 -0
- package/dist/serialization/types/UpdateReqCommonMetricPeriod.d.ts +1 -1
- package/dist/serialization/types/UpdateReqCommonMetricPeriod.js +1 -1
- package/dist/serialization/types/index.d.ts +15 -1
- package/dist/serialization/types/index.js +15 -1
- package/dist/wrapper.js +20 -15
- package/events.d.ts +3 -0
- package/events.js +17 -5
- package/package.json +9 -3
- package/reference.md +691 -136
- package/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +1 -0
- package/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +1 -0
- package/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +3 -0
- package/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +3 -0
- package/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +23 -0
- package/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.js +44 -0
- package/serialization/resources/billing/client/requests/CreateMeterRequestBody.d.ts +15 -0
- package/serialization/resources/billing/client/requests/CreateMeterRequestBody.js +36 -0
- package/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.d.ts +24 -0
- package/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +45 -0
- package/serialization/resources/billing/client/requests/index.d.ts +3 -0
- package/serialization/resources/billing/client/requests/index.js +7 -1
- package/serialization/resources/billing/types/CountBillingProductsParams.d.ts +17 -0
- package/serialization/resources/billing/types/CountBillingProductsParams.js +38 -0
- package/serialization/resources/billing/types/CountBillingProductsResponse.d.ts +15 -0
- package/serialization/resources/billing/types/CountBillingProductsResponse.js +36 -0
- package/serialization/resources/billing/types/DeleteProductPriceResponse.d.ts +14 -0
- package/serialization/resources/billing/types/DeleteProductPriceResponse.js +35 -0
- package/serialization/resources/billing/types/ListBillingProductsParams.d.ts +1 -0
- package/serialization/resources/billing/types/ListBillingProductsParams.js +1 -0
- package/serialization/resources/{companies/types/ListCompanyPlansParams.d.ts → billing/types/ListInvoicesParams.d.ts} +4 -3
- package/serialization/resources/billing/types/ListInvoicesParams.js +37 -0
- package/serialization/resources/billing/types/ListInvoicesResponse.d.ts +15 -0
- package/serialization/resources/billing/types/ListInvoicesResponse.js +36 -0
- package/serialization/resources/billing/types/ListMetersParams.d.ts +14 -0
- package/serialization/resources/{companies/types/ListCompanyPlansParams.js → billing/types/ListMetersParams.js} +3 -4
- package/serialization/resources/billing/types/ListMetersResponse.d.ts +15 -0
- package/serialization/resources/billing/types/ListMetersResponse.js +36 -0
- package/serialization/resources/billing/types/ListPaymentMethodsParams.d.ts +16 -0
- package/serialization/resources/billing/types/ListPaymentMethodsParams.js +37 -0
- package/serialization/resources/billing/types/ListPaymentMethodsResponse.d.ts +15 -0
- package/serialization/resources/billing/types/ListPaymentMethodsResponse.js +36 -0
- package/serialization/resources/billing/types/ListProductPricesParams.d.ts +1 -0
- package/serialization/resources/billing/types/ListProductPricesParams.js +1 -0
- package/serialization/resources/billing/types/UpsertBillingMeterResponse.d.ts +14 -0
- package/serialization/resources/billing/types/UpsertBillingMeterResponse.js +35 -0
- package/serialization/resources/billing/types/UpsertInvoiceResponse.d.ts +14 -0
- package/serialization/resources/billing/types/UpsertInvoiceResponse.js +35 -0
- package/serialization/resources/billing/types/UpsertPaymentMethodResponse.d.ts +14 -0
- package/serialization/resources/billing/types/UpsertPaymentMethodResponse.js +35 -0
- package/serialization/resources/billing/types/index.d.ts +12 -0
- package/serialization/resources/billing/types/index.js +12 -0
- package/serialization/resources/companies/types/CountCompaniesParams.d.ts +1 -0
- package/serialization/resources/companies/types/CountCompaniesParams.js +1 -0
- package/serialization/resources/companies/types/ListCompaniesParams.d.ts +1 -0
- package/serialization/resources/companies/types/ListCompaniesParams.js +1 -0
- package/serialization/resources/companies/types/index.d.ts +0 -2
- package/serialization/resources/companies/types/index.js +0 -2
- package/serialization/resources/components/types/PreviewComponentDataParams.d.ts +13 -0
- package/serialization/resources/components/types/PreviewComponentDataParams.js +34 -0
- package/serialization/resources/components/types/PreviewComponentDataResponse.d.ts +15 -0
- package/serialization/resources/components/types/PreviewComponentDataResponse.js +36 -0
- package/serialization/resources/components/types/index.d.ts +2 -1
- package/serialization/resources/components/types/index.js +2 -1
- package/serialization/resources/entitlements/types/CountFeatureUsageParams.d.ts +1 -0
- package/serialization/resources/entitlements/types/CountFeatureUsageParams.js +1 -0
- package/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.d.ts +1 -1
- package/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +1 -1
- package/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.d.ts +1 -1
- package/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +1 -1
- package/serialization/resources/entitlements/types/ListFeatureUsageParams.d.ts +1 -0
- package/serialization/resources/entitlements/types/ListFeatureUsageParams.js +1 -0
- package/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.d.ts +1 -1
- package/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +1 -1
- package/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.d.ts +1 -1
- package/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +1 -1
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/plangroups/client/index.d.ts +1 -0
- package/serialization/resources/plangroups/client/index.js +17 -0
- package/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +14 -0
- package/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +35 -0
- package/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +14 -0
- package/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +35 -0
- package/serialization/resources/plangroups/client/requests/index.d.ts +2 -0
- package/serialization/resources/plangroups/client/requests/index.js +7 -0
- package/serialization/resources/plangroups/index.d.ts +2 -0
- package/serialization/resources/plangroups/index.js +18 -0
- package/serialization/resources/plangroups/types/CreatePlanGroupResponse.d.ts +14 -0
- package/serialization/resources/plangroups/types/CreatePlanGroupResponse.js +35 -0
- package/serialization/resources/plangroups/types/GetPlanGroupResponse.d.ts +14 -0
- package/serialization/resources/plangroups/types/GetPlanGroupResponse.js +35 -0
- package/serialization/resources/plangroups/types/UpdatePlanGroupResponse.d.ts +14 -0
- package/serialization/resources/plangroups/types/UpdatePlanGroupResponse.js +35 -0
- package/serialization/resources/plangroups/types/index.d.ts +3 -0
- package/serialization/resources/plangroups/types/index.js +19 -0
- package/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -1
- package/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +0 -1
- package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -1
- package/serialization/resources/plans/client/requests/UpdatePlanRequestBody.js +0 -1
- package/serialization/resources/plans/types/CountPlansParams.d.ts +2 -0
- package/serialization/resources/plans/types/CountPlansParams.js +2 -0
- package/serialization/resources/plans/types/ListPlansParams.d.ts +2 -0
- package/serialization/resources/plans/types/ListPlansParams.js +2 -0
- package/serialization/types/BillingCustomerSubscription.d.ts +1 -0
- package/serialization/types/BillingCustomerSubscription.js +1 -0
- package/serialization/types/BillingMeterResponseData.d.ts +16 -0
- package/{dist/serialization/types/CompanyPlanResponseData.js → serialization/types/BillingMeterResponseData.js} +6 -7
- package/serialization/types/BillingPriceResponseData.d.ts +1 -0
- package/serialization/types/BillingPriceResponseData.js +1 -0
- package/serialization/types/BillingProductForSubscriptionResponseData.d.ts +24 -0
- package/serialization/types/BillingProductForSubscriptionResponseData.js +45 -0
- package/serialization/types/BillingProductPricing.d.ts +3 -0
- package/serialization/types/BillingProductPricing.js +3 -0
- package/serialization/types/BillingSubscriptionResponseData.d.ts +4 -1
- package/serialization/types/BillingSubscriptionResponseData.js +4 -1
- package/serialization/types/CheckFlagRequestBody.d.ts +2 -2
- package/serialization/types/CheckFlagRequestBody.js +2 -2
- package/serialization/types/CompanyDetailResponseData.d.ts +7 -4
- package/serialization/types/CompanyDetailResponseData.js +7 -4
- package/serialization/types/CompanyPlanDetailResponseData.d.ts +32 -0
- package/serialization/types/CompanyPlanDetailResponseData.js +53 -0
- package/serialization/types/CompanyPlanWithBillingSubView.d.ts +18 -0
- package/serialization/types/CompanyPlanWithBillingSubView.js +39 -0
- package/serialization/types/CompanySubscriptionResponseData.d.ts +9 -2
- package/serialization/types/CompanySubscriptionResponseData.js +9 -2
- package/serialization/types/ComponentHydrateResponseData.d.ts +9 -0
- package/serialization/types/ComponentHydrateResponseData.js +9 -0
- package/serialization/types/ComponentPreviewResponseData.d.ts +27 -0
- package/serialization/types/ComponentPreviewResponseData.js +48 -0
- package/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.d.ts +1 -1
- package/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.js +10 -1
- package/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.d.ts +1 -1
- package/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +1 -1
- package/serialization/types/CreateOrUpdateConditionRequestBodyOperator.d.ts +1 -1
- package/serialization/types/CreateOrUpdateConditionRequestBodyOperator.js +1 -1
- package/serialization/types/CreateReqCommonMetricPeriod.d.ts +1 -1
- package/serialization/types/CreateReqCommonMetricPeriod.js +1 -1
- package/serialization/types/EventBodyFlagCheck.d.ts +2 -2
- package/serialization/types/EventBodyFlagCheck.js +2 -2
- package/serialization/types/GenericPreviewObject.d.ts +15 -0
- package/serialization/types/GenericPreviewObject.js +36 -0
- package/serialization/types/InvoiceRequestBody.d.ts +22 -0
- package/serialization/types/InvoiceRequestBody.js +43 -0
- package/serialization/types/InvoiceResponseData.d.ts +28 -0
- package/serialization/types/InvoiceResponseData.js +49 -0
- package/serialization/types/MeterRequestBody.d.ts +14 -0
- package/serialization/types/MeterRequestBody.js +35 -0
- package/serialization/types/PaymentMethodRequestBody.d.ts +23 -0
- package/serialization/types/PaymentMethodRequestBody.js +44 -0
- package/serialization/types/PaymentMethodResponseData.d.ts +29 -0
- package/serialization/types/PaymentMethodResponseData.js +50 -0
- package/serialization/types/PlanDetailResponseData.d.ts +5 -1
- package/serialization/types/PlanDetailResponseData.js +5 -1
- package/serialization/types/PlanGroupDetailResponseData.d.ts +16 -0
- package/serialization/types/PlanGroupDetailResponseData.js +37 -0
- package/serialization/types/PlanGroupPlanDetailResponseData.d.ts +30 -0
- package/serialization/types/PlanGroupPlanDetailResponseData.js +51 -0
- package/serialization/types/PlanGroupResponseData.d.ts +15 -0
- package/serialization/types/PlanGroupResponseData.js +36 -0
- package/serialization/types/PlanResponseData.d.ts +1 -1
- package/serialization/types/PlanResponseData.js +1 -1
- package/serialization/types/StripeEmbedInfo.d.ts +13 -0
- package/serialization/types/StripeEmbedInfo.js +34 -0
- package/serialization/types/UpdateReqCommonMetricPeriod.d.ts +1 -1
- package/serialization/types/UpdateReqCommonMetricPeriod.js +1 -1
- package/serialization/types/index.d.ts +15 -1
- package/serialization/types/index.js +15 -1
- package/wrapper.js +20 -15
- package/api/types/CompanyPlanResponseData.d.ts +0 -11
- package/dist/api/types/CompanyPlanResponseData.d.ts +0 -11
- package/dist/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
- package/dist/serialization/resources/components/types/HydrateComponentResponse.d.ts +0 -14
- package/dist/serialization/types/CompanyPlanResponseData.d.ts +0 -17
- package/serialization/resources/companies/types/ListCompanyPlansResponse.d.ts +0 -15
- package/serialization/resources/companies/types/ListCompanyPlansResponse.js +0 -36
- package/serialization/resources/components/types/HydrateComponentResponse.d.ts +0 -14
- package/serialization/types/CompanyPlanResponseData.d.ts +0 -17
- /package/api/resources/{companies/client/requests/ListCompanyPlansRequest.js → billing/client/requests/CountBillingProductsRequest.js} +0 -0
- /package/api/resources/{companies/types/ListCompanyPlansParams.js → billing/client/requests/CreateInvoiceRequestBody.js} +0 -0
- /package/api/resources/{companies/types/ListCompanyPlansResponse.js → billing/client/requests/CreateMeterRequestBody.js} +0 -0
- /package/api/resources/{components/types/HydrateComponentResponse.js → billing/client/requests/CreatePaymentMethodRequestBody.js} +0 -0
- /package/api/{types/CompanyPlanResponseData.js → resources/billing/client/requests/ListInvoicesRequest.js} +0 -0
- /package/{dist/api/resources/companies/client/requests/ListCompanyPlansRequest.js → api/resources/billing/client/requests/ListMetersRequest.js} +0 -0
- /package/{dist/api/resources/companies/types/ListCompanyPlansParams.js → api/resources/billing/client/requests/ListPaymentMethodsRequest.js} +0 -0
- /package/{dist/api/resources/companies/types/ListCompanyPlansResponse.js → api/resources/billing/types/CountBillingProductsParams.js} +0 -0
- /package/{dist/api/resources/components/types/HydrateComponentResponse.js → api/resources/billing/types/CountBillingProductsResponse.js} +0 -0
- /package/{dist/api/types/CompanyPlanResponseData.js → api/resources/billing/types/DeleteProductPriceResponse.js} +0 -0
|
@@ -75,7 +75,7 @@ class Billing {
|
|
|
75
75
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
76
76
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customer/upsert"),
|
|
77
77
|
method: "POST",
|
|
78
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
78
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
79
79
|
contentType: "application/json",
|
|
80
80
|
requestType: "json",
|
|
81
81
|
body: serializers.CreateBillingCustomerRequestBody.jsonOrThrow(request, {
|
|
@@ -185,7 +185,7 @@ class Billing {
|
|
|
185
185
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
186
186
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customers"),
|
|
187
187
|
method: "GET",
|
|
188
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
188
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
189
189
|
contentType: "application/json",
|
|
190
190
|
queryParameters: _queryParams,
|
|
191
191
|
requestType: "json",
|
|
@@ -293,7 +293,7 @@ class Billing {
|
|
|
293
293
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
294
294
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/customers/count"),
|
|
295
295
|
method: "GET",
|
|
296
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
296
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
297
297
|
contentType: "application/json",
|
|
298
298
|
queryParameters: _queryParams,
|
|
299
299
|
requestType: "json",
|
|
@@ -366,6 +366,614 @@ class Billing {
|
|
|
366
366
|
}
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* @param {Schematic.ListInvoicesRequest} request
|
|
371
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
372
|
+
*
|
|
373
|
+
* @throws {@link Schematic.BadRequestError}
|
|
374
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
375
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
376
|
+
* @throws {@link Schematic.InternalServerError}
|
|
377
|
+
*
|
|
378
|
+
* @example
|
|
379
|
+
* await client.billing.listInvoices({
|
|
380
|
+
* customerExternalId: "customer_external_id"
|
|
381
|
+
* })
|
|
382
|
+
*/
|
|
383
|
+
listInvoices(request, requestOptions) {
|
|
384
|
+
var _a, _b;
|
|
385
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
386
|
+
const { companyId, customerExternalId, subscriptionExternalId, limit, offset } = request;
|
|
387
|
+
const _queryParams = {};
|
|
388
|
+
if (companyId != null) {
|
|
389
|
+
_queryParams["company_id"] = companyId;
|
|
390
|
+
}
|
|
391
|
+
_queryParams["customer_external_id"] = customerExternalId;
|
|
392
|
+
if (subscriptionExternalId != null) {
|
|
393
|
+
_queryParams["subscription_external_id"] = subscriptionExternalId;
|
|
394
|
+
}
|
|
395
|
+
if (limit != null) {
|
|
396
|
+
_queryParams["limit"] = limit.toString();
|
|
397
|
+
}
|
|
398
|
+
if (offset != null) {
|
|
399
|
+
_queryParams["offset"] = offset.toString();
|
|
400
|
+
}
|
|
401
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
402
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/invoices"),
|
|
403
|
+
method: "GET",
|
|
404
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
405
|
+
contentType: "application/json",
|
|
406
|
+
queryParameters: _queryParams,
|
|
407
|
+
requestType: "json",
|
|
408
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
409
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
410
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
411
|
+
});
|
|
412
|
+
if (_response.ok) {
|
|
413
|
+
return serializers.ListInvoicesResponse.parseOrThrow(_response.body, {
|
|
414
|
+
unrecognizedObjectKeys: "passthrough",
|
|
415
|
+
allowUnrecognizedUnionMembers: true,
|
|
416
|
+
allowUnrecognizedEnumValues: true,
|
|
417
|
+
skipValidation: true,
|
|
418
|
+
breadcrumbsPrefix: ["response"],
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
if (_response.error.reason === "status-code") {
|
|
422
|
+
switch (_response.error.statusCode) {
|
|
423
|
+
case 400:
|
|
424
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
425
|
+
unrecognizedObjectKeys: "passthrough",
|
|
426
|
+
allowUnrecognizedUnionMembers: true,
|
|
427
|
+
allowUnrecognizedEnumValues: true,
|
|
428
|
+
skipValidation: true,
|
|
429
|
+
breadcrumbsPrefix: ["response"],
|
|
430
|
+
}));
|
|
431
|
+
case 401:
|
|
432
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
433
|
+
unrecognizedObjectKeys: "passthrough",
|
|
434
|
+
allowUnrecognizedUnionMembers: true,
|
|
435
|
+
allowUnrecognizedEnumValues: true,
|
|
436
|
+
skipValidation: true,
|
|
437
|
+
breadcrumbsPrefix: ["response"],
|
|
438
|
+
}));
|
|
439
|
+
case 403:
|
|
440
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
441
|
+
unrecognizedObjectKeys: "passthrough",
|
|
442
|
+
allowUnrecognizedUnionMembers: true,
|
|
443
|
+
allowUnrecognizedEnumValues: true,
|
|
444
|
+
skipValidation: true,
|
|
445
|
+
breadcrumbsPrefix: ["response"],
|
|
446
|
+
}));
|
|
447
|
+
case 500:
|
|
448
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
449
|
+
unrecognizedObjectKeys: "passthrough",
|
|
450
|
+
allowUnrecognizedUnionMembers: true,
|
|
451
|
+
allowUnrecognizedEnumValues: true,
|
|
452
|
+
skipValidation: true,
|
|
453
|
+
breadcrumbsPrefix: ["response"],
|
|
454
|
+
}));
|
|
455
|
+
default:
|
|
456
|
+
throw new errors.SchematicError({
|
|
457
|
+
statusCode: _response.error.statusCode,
|
|
458
|
+
body: _response.error.body,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
switch (_response.error.reason) {
|
|
463
|
+
case "non-json":
|
|
464
|
+
throw new errors.SchematicError({
|
|
465
|
+
statusCode: _response.error.statusCode,
|
|
466
|
+
body: _response.error.rawBody,
|
|
467
|
+
});
|
|
468
|
+
case "timeout":
|
|
469
|
+
throw new errors.SchematicTimeoutError();
|
|
470
|
+
case "unknown":
|
|
471
|
+
throw new errors.SchematicError({
|
|
472
|
+
message: _response.error.errorMessage,
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* @param {Schematic.CreateInvoiceRequestBody} request
|
|
479
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
480
|
+
*
|
|
481
|
+
* @throws {@link Schematic.BadRequestError}
|
|
482
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
483
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
484
|
+
* @throws {@link Schematic.InternalServerError}
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* await client.billing.upsertInvoice({
|
|
488
|
+
* amountDue: 1,
|
|
489
|
+
* amountPaid: 1,
|
|
490
|
+
* amountRemaining: 1,
|
|
491
|
+
* collectionMethod: "collection_method",
|
|
492
|
+
* currency: "currency",
|
|
493
|
+
* customerExternalId: "customer_external_id",
|
|
494
|
+
* subtotal: 1
|
|
495
|
+
* })
|
|
496
|
+
*/
|
|
497
|
+
upsertInvoice(request, requestOptions) {
|
|
498
|
+
var _a, _b;
|
|
499
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
500
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
501
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/invoices"),
|
|
502
|
+
method: "POST",
|
|
503
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
504
|
+
contentType: "application/json",
|
|
505
|
+
requestType: "json",
|
|
506
|
+
body: serializers.CreateInvoiceRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
507
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
508
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
509
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
510
|
+
});
|
|
511
|
+
if (_response.ok) {
|
|
512
|
+
return serializers.UpsertInvoiceResponse.parseOrThrow(_response.body, {
|
|
513
|
+
unrecognizedObjectKeys: "passthrough",
|
|
514
|
+
allowUnrecognizedUnionMembers: true,
|
|
515
|
+
allowUnrecognizedEnumValues: true,
|
|
516
|
+
skipValidation: true,
|
|
517
|
+
breadcrumbsPrefix: ["response"],
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
if (_response.error.reason === "status-code") {
|
|
521
|
+
switch (_response.error.statusCode) {
|
|
522
|
+
case 400:
|
|
523
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
524
|
+
unrecognizedObjectKeys: "passthrough",
|
|
525
|
+
allowUnrecognizedUnionMembers: true,
|
|
526
|
+
allowUnrecognizedEnumValues: true,
|
|
527
|
+
skipValidation: true,
|
|
528
|
+
breadcrumbsPrefix: ["response"],
|
|
529
|
+
}));
|
|
530
|
+
case 401:
|
|
531
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
532
|
+
unrecognizedObjectKeys: "passthrough",
|
|
533
|
+
allowUnrecognizedUnionMembers: true,
|
|
534
|
+
allowUnrecognizedEnumValues: true,
|
|
535
|
+
skipValidation: true,
|
|
536
|
+
breadcrumbsPrefix: ["response"],
|
|
537
|
+
}));
|
|
538
|
+
case 403:
|
|
539
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
540
|
+
unrecognizedObjectKeys: "passthrough",
|
|
541
|
+
allowUnrecognizedUnionMembers: true,
|
|
542
|
+
allowUnrecognizedEnumValues: true,
|
|
543
|
+
skipValidation: true,
|
|
544
|
+
breadcrumbsPrefix: ["response"],
|
|
545
|
+
}));
|
|
546
|
+
case 500:
|
|
547
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
548
|
+
unrecognizedObjectKeys: "passthrough",
|
|
549
|
+
allowUnrecognizedUnionMembers: true,
|
|
550
|
+
allowUnrecognizedEnumValues: true,
|
|
551
|
+
skipValidation: true,
|
|
552
|
+
breadcrumbsPrefix: ["response"],
|
|
553
|
+
}));
|
|
554
|
+
default:
|
|
555
|
+
throw new errors.SchematicError({
|
|
556
|
+
statusCode: _response.error.statusCode,
|
|
557
|
+
body: _response.error.body,
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
switch (_response.error.reason) {
|
|
562
|
+
case "non-json":
|
|
563
|
+
throw new errors.SchematicError({
|
|
564
|
+
statusCode: _response.error.statusCode,
|
|
565
|
+
body: _response.error.rawBody,
|
|
566
|
+
});
|
|
567
|
+
case "timeout":
|
|
568
|
+
throw new errors.SchematicTimeoutError();
|
|
569
|
+
case "unknown":
|
|
570
|
+
throw new errors.SchematicError({
|
|
571
|
+
message: _response.error.errorMessage,
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* @param {Schematic.ListMetersRequest} request
|
|
578
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
579
|
+
*
|
|
580
|
+
* @throws {@link Schematic.BadRequestError}
|
|
581
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
582
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
583
|
+
* @throws {@link Schematic.InternalServerError}
|
|
584
|
+
*
|
|
585
|
+
* @example
|
|
586
|
+
* await client.billing.listMeters()
|
|
587
|
+
*/
|
|
588
|
+
listMeters(request = {}, requestOptions) {
|
|
589
|
+
var _a, _b;
|
|
590
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
591
|
+
const { displayName, limit, offset } = request;
|
|
592
|
+
const _queryParams = {};
|
|
593
|
+
if (displayName != null) {
|
|
594
|
+
_queryParams["display_name"] = displayName;
|
|
595
|
+
}
|
|
596
|
+
if (limit != null) {
|
|
597
|
+
_queryParams["limit"] = limit.toString();
|
|
598
|
+
}
|
|
599
|
+
if (offset != null) {
|
|
600
|
+
_queryParams["offset"] = offset.toString();
|
|
601
|
+
}
|
|
602
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
603
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/meter"),
|
|
604
|
+
method: "GET",
|
|
605
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
606
|
+
contentType: "application/json",
|
|
607
|
+
queryParameters: _queryParams,
|
|
608
|
+
requestType: "json",
|
|
609
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
610
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
611
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
612
|
+
});
|
|
613
|
+
if (_response.ok) {
|
|
614
|
+
return serializers.ListMetersResponse.parseOrThrow(_response.body, {
|
|
615
|
+
unrecognizedObjectKeys: "passthrough",
|
|
616
|
+
allowUnrecognizedUnionMembers: true,
|
|
617
|
+
allowUnrecognizedEnumValues: true,
|
|
618
|
+
skipValidation: true,
|
|
619
|
+
breadcrumbsPrefix: ["response"],
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
if (_response.error.reason === "status-code") {
|
|
623
|
+
switch (_response.error.statusCode) {
|
|
624
|
+
case 400:
|
|
625
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
626
|
+
unrecognizedObjectKeys: "passthrough",
|
|
627
|
+
allowUnrecognizedUnionMembers: true,
|
|
628
|
+
allowUnrecognizedEnumValues: true,
|
|
629
|
+
skipValidation: true,
|
|
630
|
+
breadcrumbsPrefix: ["response"],
|
|
631
|
+
}));
|
|
632
|
+
case 401:
|
|
633
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
634
|
+
unrecognizedObjectKeys: "passthrough",
|
|
635
|
+
allowUnrecognizedUnionMembers: true,
|
|
636
|
+
allowUnrecognizedEnumValues: true,
|
|
637
|
+
skipValidation: true,
|
|
638
|
+
breadcrumbsPrefix: ["response"],
|
|
639
|
+
}));
|
|
640
|
+
case 403:
|
|
641
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
642
|
+
unrecognizedObjectKeys: "passthrough",
|
|
643
|
+
allowUnrecognizedUnionMembers: true,
|
|
644
|
+
allowUnrecognizedEnumValues: true,
|
|
645
|
+
skipValidation: true,
|
|
646
|
+
breadcrumbsPrefix: ["response"],
|
|
647
|
+
}));
|
|
648
|
+
case 500:
|
|
649
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
650
|
+
unrecognizedObjectKeys: "passthrough",
|
|
651
|
+
allowUnrecognizedUnionMembers: true,
|
|
652
|
+
allowUnrecognizedEnumValues: true,
|
|
653
|
+
skipValidation: true,
|
|
654
|
+
breadcrumbsPrefix: ["response"],
|
|
655
|
+
}));
|
|
656
|
+
default:
|
|
657
|
+
throw new errors.SchematicError({
|
|
658
|
+
statusCode: _response.error.statusCode,
|
|
659
|
+
body: _response.error.body,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
switch (_response.error.reason) {
|
|
664
|
+
case "non-json":
|
|
665
|
+
throw new errors.SchematicError({
|
|
666
|
+
statusCode: _response.error.statusCode,
|
|
667
|
+
body: _response.error.rawBody,
|
|
668
|
+
});
|
|
669
|
+
case "timeout":
|
|
670
|
+
throw new errors.SchematicTimeoutError();
|
|
671
|
+
case "unknown":
|
|
672
|
+
throw new errors.SchematicError({
|
|
673
|
+
message: _response.error.errorMessage,
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* @param {Schematic.CreateMeterRequestBody} request
|
|
680
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
681
|
+
*
|
|
682
|
+
* @throws {@link Schematic.BadRequestError}
|
|
683
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
684
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
685
|
+
* @throws {@link Schematic.InternalServerError}
|
|
686
|
+
*
|
|
687
|
+
* @example
|
|
688
|
+
* await client.billing.upsertBillingMeter({
|
|
689
|
+
* displayName: "DisplayName",
|
|
690
|
+
* eventName: "EventName",
|
|
691
|
+
* eventPayloadKey: "EventPayloadKey",
|
|
692
|
+
* externalId: "external_id"
|
|
693
|
+
* })
|
|
694
|
+
*/
|
|
695
|
+
upsertBillingMeter(request, requestOptions) {
|
|
696
|
+
var _a, _b;
|
|
697
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
698
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
699
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/meter/upsert"),
|
|
700
|
+
method: "POST",
|
|
701
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
702
|
+
contentType: "application/json",
|
|
703
|
+
requestType: "json",
|
|
704
|
+
body: serializers.CreateMeterRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
705
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
706
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
707
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
708
|
+
});
|
|
709
|
+
if (_response.ok) {
|
|
710
|
+
return serializers.UpsertBillingMeterResponse.parseOrThrow(_response.body, {
|
|
711
|
+
unrecognizedObjectKeys: "passthrough",
|
|
712
|
+
allowUnrecognizedUnionMembers: true,
|
|
713
|
+
allowUnrecognizedEnumValues: true,
|
|
714
|
+
skipValidation: true,
|
|
715
|
+
breadcrumbsPrefix: ["response"],
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
if (_response.error.reason === "status-code") {
|
|
719
|
+
switch (_response.error.statusCode) {
|
|
720
|
+
case 400:
|
|
721
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
722
|
+
unrecognizedObjectKeys: "passthrough",
|
|
723
|
+
allowUnrecognizedUnionMembers: true,
|
|
724
|
+
allowUnrecognizedEnumValues: true,
|
|
725
|
+
skipValidation: true,
|
|
726
|
+
breadcrumbsPrefix: ["response"],
|
|
727
|
+
}));
|
|
728
|
+
case 401:
|
|
729
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
730
|
+
unrecognizedObjectKeys: "passthrough",
|
|
731
|
+
allowUnrecognizedUnionMembers: true,
|
|
732
|
+
allowUnrecognizedEnumValues: true,
|
|
733
|
+
skipValidation: true,
|
|
734
|
+
breadcrumbsPrefix: ["response"],
|
|
735
|
+
}));
|
|
736
|
+
case 403:
|
|
737
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
738
|
+
unrecognizedObjectKeys: "passthrough",
|
|
739
|
+
allowUnrecognizedUnionMembers: true,
|
|
740
|
+
allowUnrecognizedEnumValues: true,
|
|
741
|
+
skipValidation: true,
|
|
742
|
+
breadcrumbsPrefix: ["response"],
|
|
743
|
+
}));
|
|
744
|
+
case 500:
|
|
745
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
746
|
+
unrecognizedObjectKeys: "passthrough",
|
|
747
|
+
allowUnrecognizedUnionMembers: true,
|
|
748
|
+
allowUnrecognizedEnumValues: true,
|
|
749
|
+
skipValidation: true,
|
|
750
|
+
breadcrumbsPrefix: ["response"],
|
|
751
|
+
}));
|
|
752
|
+
default:
|
|
753
|
+
throw new errors.SchematicError({
|
|
754
|
+
statusCode: _response.error.statusCode,
|
|
755
|
+
body: _response.error.body,
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
switch (_response.error.reason) {
|
|
760
|
+
case "non-json":
|
|
761
|
+
throw new errors.SchematicError({
|
|
762
|
+
statusCode: _response.error.statusCode,
|
|
763
|
+
body: _response.error.rawBody,
|
|
764
|
+
});
|
|
765
|
+
case "timeout":
|
|
766
|
+
throw new errors.SchematicTimeoutError();
|
|
767
|
+
case "unknown":
|
|
768
|
+
throw new errors.SchematicError({
|
|
769
|
+
message: _response.error.errorMessage,
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* @param {Schematic.ListPaymentMethodsRequest} request
|
|
776
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
777
|
+
*
|
|
778
|
+
* @throws {@link Schematic.BadRequestError}
|
|
779
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
780
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
781
|
+
* @throws {@link Schematic.InternalServerError}
|
|
782
|
+
*
|
|
783
|
+
* @example
|
|
784
|
+
* await client.billing.listPaymentMethods({
|
|
785
|
+
* customerExternalId: "customer_external_id"
|
|
786
|
+
* })
|
|
787
|
+
*/
|
|
788
|
+
listPaymentMethods(request, requestOptions) {
|
|
789
|
+
var _a, _b;
|
|
790
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
791
|
+
const { companyId, customerExternalId, subscriptionExternalId, limit, offset } = request;
|
|
792
|
+
const _queryParams = {};
|
|
793
|
+
if (companyId != null) {
|
|
794
|
+
_queryParams["company_id"] = companyId;
|
|
795
|
+
}
|
|
796
|
+
_queryParams["customer_external_id"] = customerExternalId;
|
|
797
|
+
if (subscriptionExternalId != null) {
|
|
798
|
+
_queryParams["subscription_external_id"] = subscriptionExternalId;
|
|
799
|
+
}
|
|
800
|
+
if (limit != null) {
|
|
801
|
+
_queryParams["limit"] = limit.toString();
|
|
802
|
+
}
|
|
803
|
+
if (offset != null) {
|
|
804
|
+
_queryParams["offset"] = offset.toString();
|
|
805
|
+
}
|
|
806
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
807
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/payment-methods"),
|
|
808
|
+
method: "GET",
|
|
809
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
810
|
+
contentType: "application/json",
|
|
811
|
+
queryParameters: _queryParams,
|
|
812
|
+
requestType: "json",
|
|
813
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
814
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
815
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
816
|
+
});
|
|
817
|
+
if (_response.ok) {
|
|
818
|
+
return serializers.ListPaymentMethodsResponse.parseOrThrow(_response.body, {
|
|
819
|
+
unrecognizedObjectKeys: "passthrough",
|
|
820
|
+
allowUnrecognizedUnionMembers: true,
|
|
821
|
+
allowUnrecognizedEnumValues: true,
|
|
822
|
+
skipValidation: true,
|
|
823
|
+
breadcrumbsPrefix: ["response"],
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
if (_response.error.reason === "status-code") {
|
|
827
|
+
switch (_response.error.statusCode) {
|
|
828
|
+
case 400:
|
|
829
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
830
|
+
unrecognizedObjectKeys: "passthrough",
|
|
831
|
+
allowUnrecognizedUnionMembers: true,
|
|
832
|
+
allowUnrecognizedEnumValues: true,
|
|
833
|
+
skipValidation: true,
|
|
834
|
+
breadcrumbsPrefix: ["response"],
|
|
835
|
+
}));
|
|
836
|
+
case 401:
|
|
837
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
838
|
+
unrecognizedObjectKeys: "passthrough",
|
|
839
|
+
allowUnrecognizedUnionMembers: true,
|
|
840
|
+
allowUnrecognizedEnumValues: true,
|
|
841
|
+
skipValidation: true,
|
|
842
|
+
breadcrumbsPrefix: ["response"],
|
|
843
|
+
}));
|
|
844
|
+
case 403:
|
|
845
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
846
|
+
unrecognizedObjectKeys: "passthrough",
|
|
847
|
+
allowUnrecognizedUnionMembers: true,
|
|
848
|
+
allowUnrecognizedEnumValues: true,
|
|
849
|
+
skipValidation: true,
|
|
850
|
+
breadcrumbsPrefix: ["response"],
|
|
851
|
+
}));
|
|
852
|
+
case 500:
|
|
853
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
854
|
+
unrecognizedObjectKeys: "passthrough",
|
|
855
|
+
allowUnrecognizedUnionMembers: true,
|
|
856
|
+
allowUnrecognizedEnumValues: true,
|
|
857
|
+
skipValidation: true,
|
|
858
|
+
breadcrumbsPrefix: ["response"],
|
|
859
|
+
}));
|
|
860
|
+
default:
|
|
861
|
+
throw new errors.SchematicError({
|
|
862
|
+
statusCode: _response.error.statusCode,
|
|
863
|
+
body: _response.error.body,
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
switch (_response.error.reason) {
|
|
868
|
+
case "non-json":
|
|
869
|
+
throw new errors.SchematicError({
|
|
870
|
+
statusCode: _response.error.statusCode,
|
|
871
|
+
body: _response.error.rawBody,
|
|
872
|
+
});
|
|
873
|
+
case "timeout":
|
|
874
|
+
throw new errors.SchematicTimeoutError();
|
|
875
|
+
case "unknown":
|
|
876
|
+
throw new errors.SchematicError({
|
|
877
|
+
message: _response.error.errorMessage,
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* @param {Schematic.CreatePaymentMethodRequestBody} request
|
|
884
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
885
|
+
*
|
|
886
|
+
* @throws {@link Schematic.BadRequestError}
|
|
887
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
888
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
889
|
+
* @throws {@link Schematic.InternalServerError}
|
|
890
|
+
*
|
|
891
|
+
* @example
|
|
892
|
+
* await client.billing.upsertPaymentMethod({
|
|
893
|
+
* customerExternalId: "customer_external_id",
|
|
894
|
+
* externalId: "external_id",
|
|
895
|
+
* paymentMethodType: "payment_method_type"
|
|
896
|
+
* })
|
|
897
|
+
*/
|
|
898
|
+
upsertPaymentMethod(request, requestOptions) {
|
|
899
|
+
var _a, _b;
|
|
900
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
901
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
902
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/payment-methods"),
|
|
903
|
+
method: "POST",
|
|
904
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
905
|
+
contentType: "application/json",
|
|
906
|
+
requestType: "json",
|
|
907
|
+
body: serializers.CreatePaymentMethodRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
908
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
909
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
910
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
911
|
+
});
|
|
912
|
+
if (_response.ok) {
|
|
913
|
+
return serializers.UpsertPaymentMethodResponse.parseOrThrow(_response.body, {
|
|
914
|
+
unrecognizedObjectKeys: "passthrough",
|
|
915
|
+
allowUnrecognizedUnionMembers: true,
|
|
916
|
+
allowUnrecognizedEnumValues: true,
|
|
917
|
+
skipValidation: true,
|
|
918
|
+
breadcrumbsPrefix: ["response"],
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
if (_response.error.reason === "status-code") {
|
|
922
|
+
switch (_response.error.statusCode) {
|
|
923
|
+
case 400:
|
|
924
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
925
|
+
unrecognizedObjectKeys: "passthrough",
|
|
926
|
+
allowUnrecognizedUnionMembers: true,
|
|
927
|
+
allowUnrecognizedEnumValues: true,
|
|
928
|
+
skipValidation: true,
|
|
929
|
+
breadcrumbsPrefix: ["response"],
|
|
930
|
+
}));
|
|
931
|
+
case 401:
|
|
932
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
933
|
+
unrecognizedObjectKeys: "passthrough",
|
|
934
|
+
allowUnrecognizedUnionMembers: true,
|
|
935
|
+
allowUnrecognizedEnumValues: true,
|
|
936
|
+
skipValidation: true,
|
|
937
|
+
breadcrumbsPrefix: ["response"],
|
|
938
|
+
}));
|
|
939
|
+
case 403:
|
|
940
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
941
|
+
unrecognizedObjectKeys: "passthrough",
|
|
942
|
+
allowUnrecognizedUnionMembers: true,
|
|
943
|
+
allowUnrecognizedEnumValues: true,
|
|
944
|
+
skipValidation: true,
|
|
945
|
+
breadcrumbsPrefix: ["response"],
|
|
946
|
+
}));
|
|
947
|
+
case 500:
|
|
948
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
949
|
+
unrecognizedObjectKeys: "passthrough",
|
|
950
|
+
allowUnrecognizedUnionMembers: true,
|
|
951
|
+
allowUnrecognizedEnumValues: true,
|
|
952
|
+
skipValidation: true,
|
|
953
|
+
breadcrumbsPrefix: ["response"],
|
|
954
|
+
}));
|
|
955
|
+
default:
|
|
956
|
+
throw new errors.SchematicError({
|
|
957
|
+
statusCode: _response.error.statusCode,
|
|
958
|
+
body: _response.error.body,
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
switch (_response.error.reason) {
|
|
963
|
+
case "non-json":
|
|
964
|
+
throw new errors.SchematicError({
|
|
965
|
+
statusCode: _response.error.statusCode,
|
|
966
|
+
body: _response.error.rawBody,
|
|
967
|
+
});
|
|
968
|
+
case "timeout":
|
|
969
|
+
throw new errors.SchematicTimeoutError();
|
|
970
|
+
case "unknown":
|
|
971
|
+
throw new errors.SchematicError({
|
|
972
|
+
message: _response.error.errorMessage,
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
}
|
|
369
977
|
/**
|
|
370
978
|
* @param {Schematic.CreateBillingPriceRequestBody} request
|
|
371
979
|
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -377,6 +985,7 @@ class Billing {
|
|
|
377
985
|
*
|
|
378
986
|
* @example
|
|
379
987
|
* await client.billing.upsertBillingPrice({
|
|
988
|
+
* currency: "currency",
|
|
380
989
|
* interval: "interval",
|
|
381
990
|
* price: 1,
|
|
382
991
|
* priceExternalId: "price_external_id",
|
|
@@ -389,7 +998,7 @@ class Billing {
|
|
|
389
998
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
390
999
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/price/upsert"),
|
|
391
1000
|
method: "POST",
|
|
392
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1001
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
393
1002
|
contentType: "application/json",
|
|
394
1003
|
requestType: "json",
|
|
395
1004
|
body: serializers.CreateBillingPriceRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -477,7 +1086,7 @@ class Billing {
|
|
|
477
1086
|
listProductPrices(request = {}, requestOptions) {
|
|
478
1087
|
var _a, _b;
|
|
479
1088
|
return __awaiter(this, void 0, void 0, function* () {
|
|
480
|
-
const { ids, name, q, limit, offset } = request;
|
|
1089
|
+
const { ids, name, q, withoutLinkedToPlan, limit, offset } = request;
|
|
481
1090
|
const _queryParams = {};
|
|
482
1091
|
if (ids != null) {
|
|
483
1092
|
if (Array.isArray(ids)) {
|
|
@@ -493,6 +1102,9 @@ class Billing {
|
|
|
493
1102
|
if (q != null) {
|
|
494
1103
|
_queryParams["q"] = q;
|
|
495
1104
|
}
|
|
1105
|
+
if (withoutLinkedToPlan != null) {
|
|
1106
|
+
_queryParams["without_linked_to_plan"] = withoutLinkedToPlan.toString();
|
|
1107
|
+
}
|
|
496
1108
|
if (limit != null) {
|
|
497
1109
|
_queryParams["limit"] = limit.toString();
|
|
498
1110
|
}
|
|
@@ -502,7 +1114,7 @@ class Billing {
|
|
|
502
1114
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
503
1115
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/product/prices"),
|
|
504
1116
|
method: "GET",
|
|
505
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1117
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
506
1118
|
contentType: "application/json",
|
|
507
1119
|
queryParameters: _queryParams,
|
|
508
1120
|
requestType: "json",
|
|
@@ -575,6 +1187,96 @@ class Billing {
|
|
|
575
1187
|
}
|
|
576
1188
|
});
|
|
577
1189
|
}
|
|
1190
|
+
/**
|
|
1191
|
+
* @param {string} billingId - billing_id
|
|
1192
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
1193
|
+
*
|
|
1194
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1195
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1196
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1197
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1198
|
+
*
|
|
1199
|
+
* @example
|
|
1200
|
+
* await client.billing.deleteProductPrice("billing_id")
|
|
1201
|
+
*/
|
|
1202
|
+
deleteProductPrice(billingId, requestOptions) {
|
|
1203
|
+
var _a, _b;
|
|
1204
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1205
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1206
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, `billing/product/prices/${encodeURIComponent(billingId)}`),
|
|
1207
|
+
method: "DELETE",
|
|
1208
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1209
|
+
contentType: "application/json",
|
|
1210
|
+
requestType: "json",
|
|
1211
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1212
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1213
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1214
|
+
});
|
|
1215
|
+
if (_response.ok) {
|
|
1216
|
+
return serializers.DeleteProductPriceResponse.parseOrThrow(_response.body, {
|
|
1217
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1218
|
+
allowUnrecognizedUnionMembers: true,
|
|
1219
|
+
allowUnrecognizedEnumValues: true,
|
|
1220
|
+
skipValidation: true,
|
|
1221
|
+
breadcrumbsPrefix: ["response"],
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
if (_response.error.reason === "status-code") {
|
|
1225
|
+
switch (_response.error.statusCode) {
|
|
1226
|
+
case 400:
|
|
1227
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1228
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1229
|
+
allowUnrecognizedUnionMembers: true,
|
|
1230
|
+
allowUnrecognizedEnumValues: true,
|
|
1231
|
+
skipValidation: true,
|
|
1232
|
+
breadcrumbsPrefix: ["response"],
|
|
1233
|
+
}));
|
|
1234
|
+
case 401:
|
|
1235
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1236
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1237
|
+
allowUnrecognizedUnionMembers: true,
|
|
1238
|
+
allowUnrecognizedEnumValues: true,
|
|
1239
|
+
skipValidation: true,
|
|
1240
|
+
breadcrumbsPrefix: ["response"],
|
|
1241
|
+
}));
|
|
1242
|
+
case 403:
|
|
1243
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1244
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1245
|
+
allowUnrecognizedUnionMembers: true,
|
|
1246
|
+
allowUnrecognizedEnumValues: true,
|
|
1247
|
+
skipValidation: true,
|
|
1248
|
+
breadcrumbsPrefix: ["response"],
|
|
1249
|
+
}));
|
|
1250
|
+
case 500:
|
|
1251
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1252
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1253
|
+
allowUnrecognizedUnionMembers: true,
|
|
1254
|
+
allowUnrecognizedEnumValues: true,
|
|
1255
|
+
skipValidation: true,
|
|
1256
|
+
breadcrumbsPrefix: ["response"],
|
|
1257
|
+
}));
|
|
1258
|
+
default:
|
|
1259
|
+
throw new errors.SchematicError({
|
|
1260
|
+
statusCode: _response.error.statusCode,
|
|
1261
|
+
body: _response.error.body,
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
switch (_response.error.reason) {
|
|
1266
|
+
case "non-json":
|
|
1267
|
+
throw new errors.SchematicError({
|
|
1268
|
+
statusCode: _response.error.statusCode,
|
|
1269
|
+
body: _response.error.rawBody,
|
|
1270
|
+
});
|
|
1271
|
+
case "timeout":
|
|
1272
|
+
throw new errors.SchematicTimeoutError();
|
|
1273
|
+
case "unknown":
|
|
1274
|
+
throw new errors.SchematicError({
|
|
1275
|
+
message: _response.error.errorMessage,
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
578
1280
|
/**
|
|
579
1281
|
* @param {Schematic.CreateBillingProductRequestBody} request
|
|
580
1282
|
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -599,7 +1301,7 @@ class Billing {
|
|
|
599
1301
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
600
1302
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/product/upsert"),
|
|
601
1303
|
method: "POST",
|
|
602
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1304
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
603
1305
|
contentType: "application/json",
|
|
604
1306
|
requestType: "json",
|
|
605
1307
|
body: serializers.CreateBillingProductRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -687,7 +1389,7 @@ class Billing {
|
|
|
687
1389
|
listBillingProducts(request = {}, requestOptions) {
|
|
688
1390
|
var _a, _b;
|
|
689
1391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
690
|
-
const { ids, name, q, limit, offset } = request;
|
|
1392
|
+
const { ids, name, q, withoutLinkedToPlan, limit, offset } = request;
|
|
691
1393
|
const _queryParams = {};
|
|
692
1394
|
if (ids != null) {
|
|
693
1395
|
if (Array.isArray(ids)) {
|
|
@@ -703,6 +1405,9 @@ class Billing {
|
|
|
703
1405
|
if (q != null) {
|
|
704
1406
|
_queryParams["q"] = q;
|
|
705
1407
|
}
|
|
1408
|
+
if (withoutLinkedToPlan != null) {
|
|
1409
|
+
_queryParams["without_linked_to_plan"] = withoutLinkedToPlan.toString();
|
|
1410
|
+
}
|
|
706
1411
|
if (limit != null) {
|
|
707
1412
|
_queryParams["limit"] = limit.toString();
|
|
708
1413
|
}
|
|
@@ -712,7 +1417,7 @@ class Billing {
|
|
|
712
1417
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
713
1418
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/products"),
|
|
714
1419
|
method: "GET",
|
|
715
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1420
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
716
1421
|
contentType: "application/json",
|
|
717
1422
|
queryParameters: _queryParams,
|
|
718
1423
|
requestType: "json",
|
|
@@ -785,6 +1490,122 @@ class Billing {
|
|
|
785
1490
|
}
|
|
786
1491
|
});
|
|
787
1492
|
}
|
|
1493
|
+
/**
|
|
1494
|
+
* @param {Schematic.CountBillingProductsRequest} request
|
|
1495
|
+
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
1496
|
+
*
|
|
1497
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1498
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1499
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1500
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1501
|
+
*
|
|
1502
|
+
* @example
|
|
1503
|
+
* await client.billing.countBillingProducts()
|
|
1504
|
+
*/
|
|
1505
|
+
countBillingProducts(request = {}, requestOptions) {
|
|
1506
|
+
var _a, _b;
|
|
1507
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1508
|
+
const { ids, name, q, withoutLinkedToPlan, limit, offset } = request;
|
|
1509
|
+
const _queryParams = {};
|
|
1510
|
+
if (ids != null) {
|
|
1511
|
+
if (Array.isArray(ids)) {
|
|
1512
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
1513
|
+
}
|
|
1514
|
+
else {
|
|
1515
|
+
_queryParams["ids"] = ids;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
if (name != null) {
|
|
1519
|
+
_queryParams["name"] = name;
|
|
1520
|
+
}
|
|
1521
|
+
if (q != null) {
|
|
1522
|
+
_queryParams["q"] = q;
|
|
1523
|
+
}
|
|
1524
|
+
if (withoutLinkedToPlan != null) {
|
|
1525
|
+
_queryParams["without_linked_to_plan"] = withoutLinkedToPlan.toString();
|
|
1526
|
+
}
|
|
1527
|
+
if (limit != null) {
|
|
1528
|
+
_queryParams["limit"] = limit.toString();
|
|
1529
|
+
}
|
|
1530
|
+
if (offset != null) {
|
|
1531
|
+
_queryParams["offset"] = offset.toString();
|
|
1532
|
+
}
|
|
1533
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1534
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/products/count"),
|
|
1535
|
+
method: "GET",
|
|
1536
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1537
|
+
contentType: "application/json",
|
|
1538
|
+
queryParameters: _queryParams,
|
|
1539
|
+
requestType: "json",
|
|
1540
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1541
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1542
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1543
|
+
});
|
|
1544
|
+
if (_response.ok) {
|
|
1545
|
+
return serializers.CountBillingProductsResponse.parseOrThrow(_response.body, {
|
|
1546
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1547
|
+
allowUnrecognizedUnionMembers: true,
|
|
1548
|
+
allowUnrecognizedEnumValues: true,
|
|
1549
|
+
skipValidation: true,
|
|
1550
|
+
breadcrumbsPrefix: ["response"],
|
|
1551
|
+
});
|
|
1552
|
+
}
|
|
1553
|
+
if (_response.error.reason === "status-code") {
|
|
1554
|
+
switch (_response.error.statusCode) {
|
|
1555
|
+
case 400:
|
|
1556
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1557
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1558
|
+
allowUnrecognizedUnionMembers: true,
|
|
1559
|
+
allowUnrecognizedEnumValues: true,
|
|
1560
|
+
skipValidation: true,
|
|
1561
|
+
breadcrumbsPrefix: ["response"],
|
|
1562
|
+
}));
|
|
1563
|
+
case 401:
|
|
1564
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1565
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1566
|
+
allowUnrecognizedUnionMembers: true,
|
|
1567
|
+
allowUnrecognizedEnumValues: true,
|
|
1568
|
+
skipValidation: true,
|
|
1569
|
+
breadcrumbsPrefix: ["response"],
|
|
1570
|
+
}));
|
|
1571
|
+
case 403:
|
|
1572
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1573
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1574
|
+
allowUnrecognizedUnionMembers: true,
|
|
1575
|
+
allowUnrecognizedEnumValues: true,
|
|
1576
|
+
skipValidation: true,
|
|
1577
|
+
breadcrumbsPrefix: ["response"],
|
|
1578
|
+
}));
|
|
1579
|
+
case 500:
|
|
1580
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1581
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1582
|
+
allowUnrecognizedUnionMembers: true,
|
|
1583
|
+
allowUnrecognizedEnumValues: true,
|
|
1584
|
+
skipValidation: true,
|
|
1585
|
+
breadcrumbsPrefix: ["response"],
|
|
1586
|
+
}));
|
|
1587
|
+
default:
|
|
1588
|
+
throw new errors.SchematicError({
|
|
1589
|
+
statusCode: _response.error.statusCode,
|
|
1590
|
+
body: _response.error.body,
|
|
1591
|
+
});
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
switch (_response.error.reason) {
|
|
1595
|
+
case "non-json":
|
|
1596
|
+
throw new errors.SchematicError({
|
|
1597
|
+
statusCode: _response.error.statusCode,
|
|
1598
|
+
body: _response.error.rawBody,
|
|
1599
|
+
});
|
|
1600
|
+
case "timeout":
|
|
1601
|
+
throw new errors.SchematicTimeoutError();
|
|
1602
|
+
case "unknown":
|
|
1603
|
+
throw new errors.SchematicError({
|
|
1604
|
+
message: _response.error.errorMessage,
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
788
1609
|
/**
|
|
789
1610
|
* @param {Schematic.CreateBillingSubscriptionsRequestBody} request
|
|
790
1611
|
* @param {Billing.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -796,10 +1617,14 @@ class Billing {
|
|
|
796
1617
|
*
|
|
797
1618
|
* @example
|
|
798
1619
|
* await client.billing.upsertBillingSubscription({
|
|
1620
|
+
* currency: "currency",
|
|
799
1621
|
* customerExternalId: "customer_external_id",
|
|
800
|
-
* expiredAt:
|
|
1622
|
+
* expiredAt: "2024-01-15T09:30:00Z",
|
|
801
1623
|
* productExternalIds: [{
|
|
1624
|
+
* currency: "currency",
|
|
1625
|
+
* interval: "interval",
|
|
802
1626
|
* price: 1,
|
|
1627
|
+
* priceExternalId: "price_external_id",
|
|
803
1628
|
* productExternalId: "product_external_id"
|
|
804
1629
|
* }],
|
|
805
1630
|
* subscriptionExternalId: "subscription_external_id",
|
|
@@ -812,7 +1637,7 @@ class Billing {
|
|
|
812
1637
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
813
1638
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.SchematicEnvironment.Default, "billing/subscription/upsert"),
|
|
814
1639
|
method: "POST",
|
|
815
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1640
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.5", "User-Agent": "@schematichq/schematic-typescript-node/1.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
816
1641
|
contentType: "application/json",
|
|
817
1642
|
requestType: "json",
|
|
818
1643
|
body: serializers.CreateBillingSubscriptionsRequestBody.jsonOrThrow(request, {
|