@schematichq/schematic-typescript-node 1.1.10 → 1.1.11
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 +3 -0
- package/Client.js +13 -8
- package/README.md +2 -0
- package/api/errors/BadRequestError.d.ts +2 -1
- package/api/errors/BadRequestError.js +2 -1
- package/api/errors/ForbiddenError.d.ts +2 -1
- package/api/errors/ForbiddenError.js +2 -1
- package/api/errors/InternalServerError.d.ts +2 -1
- package/api/errors/InternalServerError.js +2 -1
- package/api/errors/NotFoundError.d.ts +2 -1
- package/api/errors/NotFoundError.js +2 -1
- package/api/errors/UnauthorizedError.d.ts +2 -1
- package/api/errors/UnauthorizedError.js +2 -1
- package/api/errors/index.d.ts +1 -1
- package/api/errors/index.js +1 -1
- package/api/resources/accesstokens/client/Client.d.ts +3 -1
- package/api/resources/accesstokens/client/Client.js +30 -12
- package/api/resources/accounts/client/Client.d.ts +51 -14
- package/api/resources/accounts/client/Client.js +489 -175
- package/api/resources/accounts/types/QuickstartResponse.d.ts +9 -0
- package/api/resources/accounts/types/index.d.ts +1 -0
- package/api/resources/accounts/types/index.js +1 -0
- package/api/resources/billing/client/Client.d.ts +64 -26
- package/api/resources/billing/client/Client.js +651 -259
- package/api/resources/billing/client/requests/CountBillingProductsRequest.d.ts +8 -0
- package/api/resources/billing/client/requests/CountCustomersRequest.d.ts +1 -0
- package/api/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +4 -0
- package/api/resources/billing/client/requests/CreateBillingProductRequestBody.d.ts +2 -7
- package/api/resources/billing/client/requests/ListBillingProductsRequest.d.ts +8 -0
- package/api/resources/billing/client/requests/{ListCustomersRequest.d.ts → ListCustomersWithSubscriptionsRequest.d.ts} +2 -1
- package/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +8 -0
- package/api/resources/billing/client/requests/index.d.ts +1 -1
- package/api/resources/billing/types/CountBillingProductsParams.d.ts +4 -0
- package/api/resources/billing/types/CountCustomersParams.d.ts +1 -0
- package/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +8 -0
- package/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +10 -0
- package/api/resources/billing/types/ListBillingProductsParams.d.ts +4 -0
- package/{dist/api/resources/billing/types/ListCustomersParams.d.ts → api/resources/billing/types/ListCustomersWithSubscriptionsParams.d.ts} +2 -1
- package/{dist/api/resources/billing/types/ListCustomersResponse.d.ts → api/resources/billing/types/ListCustomersWithSubscriptionsResponse.d.ts} +2 -2
- package/api/resources/billing/types/ListProductPricesParams.d.ts +4 -0
- package/api/resources/billing/types/index.d.ts +3 -2
- package/api/resources/billing/types/index.js +3 -2
- package/api/resources/checkout/client/Client.d.ts +11 -4
- package/api/resources/checkout/client/Client.js +113 -50
- package/api/resources/companies/client/Client.d.ts +95 -37
- package/api/resources/companies/client/Client.js +903 -391
- package/api/resources/companies/client/requests/CountCompaniesRequest.d.ts +4 -0
- package/api/resources/companies/client/requests/ListCompaniesRequest.d.ts +4 -0
- package/api/resources/companies/client/requests/LookupCompanyRequest.d.ts +2 -4
- package/api/resources/companies/client/requests/LookupUserRequest.d.ts +2 -4
- package/api/resources/companies/types/CountCompaniesParams.d.ts +2 -0
- package/api/resources/companies/types/ListCompaniesParams.d.ts +2 -0
- package/api/resources/companies/types/LookupCompanyParams.d.ts +1 -1
- package/api/resources/companies/types/LookupUserParams.d.ts +1 -1
- package/api/resources/components/client/Client.d.ts +18 -7
- package/api/resources/components/client/Client.js +188 -89
- package/api/resources/crm/client/Client.d.ts +15 -5
- package/api/resources/crm/client/Client.js +151 -61
- package/api/resources/dataexports/client/Client.d.ts +58 -0
- package/api/resources/dataexports/client/Client.js +265 -0
- package/api/resources/dataexports/client/index.d.ts +1 -0
- package/api/resources/dataexports/client/index.js +17 -0
- package/api/resources/dataexports/client/requests/CreateDataExportRequestBody.d.ts +12 -0
- package/api/resources/dataexports/client/requests/index.d.ts +1 -0
- package/api/resources/dataexports/client/requests/index.js +2 -0
- package/api/resources/dataexports/index.d.ts +2 -0
- package/api/resources/dataexports/index.js +18 -0
- package/api/resources/dataexports/types/CreateDataExportResponse.d.ts +9 -0
- package/api/resources/dataexports/types/index.d.ts +1 -0
- package/api/resources/dataexports/types/index.js +17 -0
- package/api/resources/entitlements/client/Client.d.ts +53 -22
- package/api/resources/entitlements/client/Client.js +534 -239
- package/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +6 -0
- package/api/resources/entitlements/client/requests/GetFeatureUsageByCompanyRequest.d.ts +2 -4
- package/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +6 -0
- package/api/resources/entitlements/types/GetFeatureUsageByCompanyParams.d.ts +1 -1
- package/api/resources/events/client/Client.d.ts +16 -6
- package/api/resources/events/client/Client.js +164 -74
- package/api/resources/features/client/Client.d.ts +52 -19
- package/api/resources/features/client/Client.js +533 -236
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/plangroups/client/Client.d.ts +7 -3
- package/api/resources/plangroups/client/Client.js +73 -37
- package/api/resources/plans/client/Client.d.ts +124 -11
- package/api/resources/plans/client/Client.js +1010 -171
- package/api/resources/plans/client/requests/CountPlanTraitsRequest.d.ts +20 -0
- package/api/resources/plans/client/requests/CountPlanTraitsRequest.js +5 -0
- package/api/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +16 -0
- package/api/resources/plans/client/requests/CreatePlanTraitRequestBody.js +5 -0
- package/api/resources/plans/client/requests/ListPlanTraitsRequest.d.ts +20 -0
- package/api/resources/plans/client/requests/ListPlanTraitsRequest.js +5 -0
- package/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +14 -0
- package/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +5 -0
- package/api/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +2 -0
- package/api/resources/plans/client/requests/index.d.ts +4 -0
- package/api/resources/plans/types/CountPlanTraitsParams.d.ts +15 -0
- package/api/resources/plans/types/CountPlanTraitsParams.js +5 -0
- package/api/resources/plans/types/CountPlanTraitsResponse.d.ts +9 -0
- package/api/resources/plans/types/CountPlanTraitsResponse.js +5 -0
- package/api/resources/plans/types/CreatePlanTraitResponse.d.ts +9 -0
- package/api/resources/plans/types/CreatePlanTraitResponse.js +5 -0
- package/api/resources/plans/types/DeletePlanTraitResponse.d.ts +9 -0
- package/api/resources/plans/types/DeletePlanTraitResponse.js +5 -0
- package/api/resources/plans/types/GetPlanTraitResponse.d.ts +9 -0
- package/api/resources/plans/types/GetPlanTraitResponse.js +5 -0
- package/api/resources/plans/types/ListPlanTraitsParams.d.ts +15 -0
- package/api/resources/plans/types/ListPlanTraitsParams.js +5 -0
- package/api/resources/plans/types/ListPlanTraitsResponse.d.ts +10 -0
- package/api/resources/plans/types/ListPlanTraitsResponse.js +5 -0
- package/api/resources/plans/types/UpdatePlanTraitResponse.d.ts +9 -0
- package/api/resources/plans/types/UpdatePlanTraitResponse.js +5 -0
- package/api/resources/plans/types/index.d.ts +8 -0
- package/api/resources/plans/types/index.js +8 -0
- package/api/resources/webhooks/client/Client.d.ts +24 -9
- package/api/resources/webhooks/client/Client.js +249 -114
- package/api/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +1 -0
- package/api/resources/webhooks/client/requests/UpdateWebhookRequestBody.d.ts +1 -0
- package/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +5 -1
- package/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +5 -1
- package/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/api/types/BillingPriceResponseData.d.ts +2 -0
- package/api/types/BillingPriceView.d.ts +7 -0
- package/api/types/BillingProductDetailResponseData.d.ts +2 -0
- package/api/types/BillingProductForSubscriptionResponseData.d.ts +5 -0
- package/api/types/BillingProductPlanResponseData.d.ts +2 -0
- package/api/types/BillingProductPriceResponseData.d.ts +3 -0
- package/api/types/BillingProductPriceTierResponseData.d.ts +9 -0
- package/api/types/BillingProductPriceTierResponseData.js +5 -0
- package/api/types/BillingProductPricing.d.ts +2 -0
- package/api/types/BillingProductResponseData.d.ts +2 -0
- package/api/types/CheckFlagResponseData.d.ts +2 -0
- package/api/types/CompanyDetailResponseData.d.ts +1 -0
- package/api/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/api/types/CompanyPlanWithBillingSubView.d.ts +2 -0
- package/api/types/CreateBillingPriceTierRequestBody.d.ts +1 -0
- package/api/types/DataExportResponseData.d.ts +17 -0
- package/api/types/DataExportResponseData.js +5 -0
- package/api/types/EntitlementTriggerConfig.d.ts +6 -0
- package/api/types/EntitlementTriggerConfig.js +5 -0
- package/api/types/EventSummaryResponseData.d.ts +2 -2
- package/api/types/PlanDetailResponseData.d.ts +2 -0
- package/api/types/PlanEntitlementResponseData.d.ts +1 -0
- package/api/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/api/types/PlanTraitResponseData.d.ts +16 -0
- package/api/types/PlanTraitResponseData.js +5 -0
- package/api/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/api/types/PreviewSubscriptionFinanceResponseData.d.ts +15 -0
- package/api/types/PreviewSubscriptionFinanceResponseData.js +5 -0
- package/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.d.ts +10 -0
- package/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +5 -0
- package/api/types/QuickstartResp.d.ts +6 -0
- package/api/types/QuickstartResp.js +5 -0
- package/api/types/UpsertCompanyRequestBody.d.ts +1 -0
- package/api/types/UpsertTraitRequestBody.d.ts +1 -1
- package/api/types/UpsertUserRequestBody.d.ts +7 -2
- package/api/types/UpsertUserSubRequestBody.d.ts +4 -1
- package/api/types/UsageBasedEntitlementRequestBody.d.ts +6 -0
- package/api/types/WebhookResponseData.d.ts +2 -0
- package/api/types/index.d.ts +7 -0
- package/api/types/index.js +7 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.js +7 -0
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/custom.js +17 -0
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +13 -8
- package/dist/api/errors/BadRequestError.d.ts +2 -1
- package/dist/api/errors/BadRequestError.js +2 -1
- package/dist/api/errors/ForbiddenError.d.ts +2 -1
- package/dist/api/errors/ForbiddenError.js +2 -1
- package/dist/api/errors/InternalServerError.d.ts +2 -1
- package/dist/api/errors/InternalServerError.js +2 -1
- package/dist/api/errors/NotFoundError.d.ts +2 -1
- package/dist/api/errors/NotFoundError.js +2 -1
- package/dist/api/errors/UnauthorizedError.d.ts +2 -1
- package/dist/api/errors/UnauthorizedError.js +2 -1
- package/dist/api/errors/index.d.ts +1 -1
- package/dist/api/errors/index.js +1 -1
- package/dist/api/resources/accesstokens/client/Client.d.ts +3 -1
- package/dist/api/resources/accesstokens/client/Client.js +30 -12
- package/dist/api/resources/accounts/client/Client.d.ts +51 -14
- package/dist/api/resources/accounts/client/Client.js +489 -175
- package/dist/api/resources/accounts/types/QuickstartResponse.d.ts +9 -0
- package/dist/api/resources/accounts/types/QuickstartResponse.js +5 -0
- package/dist/api/resources/accounts/types/index.d.ts +1 -0
- package/dist/api/resources/accounts/types/index.js +1 -0
- package/dist/api/resources/billing/client/Client.d.ts +64 -26
- package/dist/api/resources/billing/client/Client.js +651 -259
- package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.d.ts +8 -0
- package/dist/api/resources/billing/client/requests/CountCustomersRequest.d.ts +1 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +4 -0
- package/dist/api/resources/billing/client/requests/CreateBillingProductRequestBody.d.ts +2 -7
- package/dist/api/resources/billing/client/requests/ListBillingProductsRequest.d.ts +8 -0
- package/dist/api/resources/billing/client/requests/{ListCustomersRequest.d.ts → ListCustomersWithSubscriptionsRequest.d.ts} +2 -1
- package/dist/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +8 -0
- package/dist/api/resources/billing/client/requests/index.d.ts +1 -1
- package/dist/api/resources/billing/types/CountBillingProductsParams.d.ts +4 -0
- package/dist/api/resources/billing/types/CountCustomersParams.d.ts +1 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +10 -0
- package/dist/api/resources/billing/types/ListBillingProductsParams.d.ts +4 -0
- package/{api/resources/billing/types/ListCustomersParams.d.ts → dist/api/resources/billing/types/ListCustomersWithSubscriptionsParams.d.ts} +2 -1
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsParams.js +5 -0
- package/{api/resources/billing/types/ListCustomersResponse.d.ts → dist/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.d.ts} +2 -2
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.d.ts +4 -0
- package/dist/api/resources/billing/types/index.d.ts +3 -2
- package/dist/api/resources/billing/types/index.js +3 -2
- package/dist/api/resources/checkout/client/Client.d.ts +11 -4
- package/dist/api/resources/checkout/client/Client.js +113 -50
- package/dist/api/resources/companies/client/Client.d.ts +95 -37
- package/dist/api/resources/companies/client/Client.js +903 -391
- package/dist/api/resources/companies/client/requests/CountCompaniesRequest.d.ts +4 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesRequest.d.ts +4 -0
- package/dist/api/resources/companies/client/requests/LookupCompanyRequest.d.ts +2 -4
- package/dist/api/resources/companies/client/requests/LookupUserRequest.d.ts +2 -4
- package/dist/api/resources/companies/types/CountCompaniesParams.d.ts +2 -0
- package/dist/api/resources/companies/types/ListCompaniesParams.d.ts +2 -0
- package/dist/api/resources/companies/types/LookupCompanyParams.d.ts +1 -1
- package/dist/api/resources/companies/types/LookupUserParams.d.ts +1 -1
- package/dist/api/resources/components/client/Client.d.ts +18 -7
- package/dist/api/resources/components/client/Client.js +188 -89
- package/dist/api/resources/crm/client/Client.d.ts +15 -5
- package/dist/api/resources/crm/client/Client.js +151 -61
- package/dist/api/resources/dataexports/client/Client.d.ts +58 -0
- package/dist/api/resources/dataexports/client/Client.js +265 -0
- package/dist/api/resources/dataexports/client/index.d.ts +1 -0
- package/dist/api/resources/dataexports/client/index.js +17 -0
- package/dist/api/resources/dataexports/client/requests/CreateDataExportRequestBody.d.ts +12 -0
- package/dist/api/resources/dataexports/client/requests/CreateDataExportRequestBody.js +5 -0
- package/dist/api/resources/dataexports/client/requests/index.d.ts +1 -0
- package/dist/api/resources/dataexports/client/requests/index.js +2 -0
- package/dist/api/resources/dataexports/index.d.ts +2 -0
- package/dist/api/resources/dataexports/index.js +18 -0
- package/dist/api/resources/dataexports/types/CreateDataExportResponse.d.ts +9 -0
- package/dist/api/resources/dataexports/types/CreateDataExportResponse.js +5 -0
- package/dist/api/resources/dataexports/types/index.d.ts +1 -0
- package/dist/api/resources/dataexports/types/index.js +17 -0
- package/dist/api/resources/entitlements/client/Client.d.ts +53 -22
- package/dist/api/resources/entitlements/client/Client.js +534 -239
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +6 -0
- package/dist/api/resources/entitlements/client/requests/GetFeatureUsageByCompanyRequest.d.ts +2 -4
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +6 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageByCompanyParams.d.ts +1 -1
- package/dist/api/resources/events/client/Client.d.ts +16 -6
- package/dist/api/resources/events/client/Client.js +164 -74
- package/dist/api/resources/features/client/Client.d.ts +52 -19
- package/dist/api/resources/features/client/Client.js +533 -236
- 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 +7 -3
- package/dist/api/resources/plangroups/client/Client.js +73 -37
- package/dist/api/resources/plans/client/Client.d.ts +124 -11
- package/dist/api/resources/plans/client/Client.js +1010 -171
- package/dist/api/resources/plans/client/requests/CountPlanTraitsRequest.d.ts +20 -0
- package/dist/api/resources/plans/client/requests/CountPlanTraitsRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +16 -0
- package/dist/api/resources/plans/client/requests/CreatePlanTraitRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/ListPlanTraitsRequest.d.ts +20 -0
- package/dist/api/resources/plans/client/requests/ListPlanTraitsRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +14 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +2 -0
- package/dist/api/resources/plans/client/requests/index.d.ts +4 -0
- package/dist/api/resources/plans/types/CountPlanTraitsParams.d.ts +15 -0
- package/dist/api/resources/plans/types/CountPlanTraitsParams.js +5 -0
- package/dist/api/resources/plans/types/CountPlanTraitsResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/CountPlanTraitsResponse.js +5 -0
- package/dist/api/resources/plans/types/CreatePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/CreatePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/DeletePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/DeletePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/GetPlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/GetPlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/ListPlanTraitsParams.d.ts +15 -0
- package/dist/api/resources/plans/types/ListPlanTraitsParams.js +5 -0
- package/dist/api/resources/plans/types/ListPlanTraitsResponse.d.ts +10 -0
- package/dist/api/resources/plans/types/ListPlanTraitsResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdatePlanTraitResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/UpdatePlanTraitResponse.js +5 -0
- package/dist/api/resources/plans/types/index.d.ts +8 -0
- package/dist/api/resources/plans/types/index.js +8 -0
- package/dist/api/resources/webhooks/client/Client.d.ts +24 -9
- package/dist/api/resources/webhooks/client/Client.js +249 -114
- package/dist/api/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +1 -0
- package/dist/api/resources/webhooks/client/requests/UpdateWebhookRequestBody.d.ts +1 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +5 -1
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +5 -1
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/dist/api/types/BillingPriceResponseData.d.ts +2 -0
- package/dist/api/types/BillingPriceView.d.ts +7 -0
- package/dist/api/types/BillingProductDetailResponseData.d.ts +2 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.d.ts +5 -0
- package/dist/api/types/BillingProductPlanResponseData.d.ts +2 -0
- package/dist/api/types/BillingProductPriceResponseData.d.ts +3 -0
- package/dist/api/types/BillingProductPriceTierResponseData.d.ts +9 -0
- package/dist/api/types/BillingProductPriceTierResponseData.js +5 -0
- package/dist/api/types/BillingProductPricing.d.ts +2 -0
- package/dist/api/types/BillingProductResponseData.d.ts +2 -0
- package/dist/api/types/CheckFlagResponseData.d.ts +2 -0
- package/dist/api/types/CompanyDetailResponseData.d.ts +1 -0
- package/dist/api/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/CompanyPlanWithBillingSubView.d.ts +2 -0
- package/dist/api/types/CreateBillingPriceTierRequestBody.d.ts +1 -0
- package/dist/api/types/DataExportResponseData.d.ts +17 -0
- package/dist/api/types/DataExportResponseData.js +5 -0
- package/dist/api/types/EntitlementTriggerConfig.d.ts +6 -0
- package/dist/api/types/EntitlementTriggerConfig.js +5 -0
- package/dist/api/types/EventSummaryResponseData.d.ts +2 -2
- package/dist/api/types/PlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/PlanEntitlementResponseData.d.ts +1 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/PlanTraitResponseData.d.ts +16 -0
- package/dist/api/types/PlanTraitResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/dist/api/types/PreviewSubscriptionFinanceResponseData.d.ts +15 -0
- package/dist/api/types/PreviewSubscriptionFinanceResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.d.ts +10 -0
- package/dist/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +5 -0
- package/dist/api/types/QuickstartResp.d.ts +6 -0
- package/dist/api/types/QuickstartResp.js +5 -0
- package/dist/api/types/UpsertCompanyRequestBody.d.ts +1 -0
- package/dist/api/types/UpsertTraitRequestBody.d.ts +1 -1
- package/dist/api/types/UpsertUserRequestBody.d.ts +7 -2
- package/dist/api/types/UpsertUserSubRequestBody.d.ts +4 -1
- package/dist/api/types/UsageBasedEntitlementRequestBody.d.ts +6 -0
- package/dist/api/types/WebhookResponseData.d.ts +2 -0
- package/dist/api/types/index.d.ts +7 -0
- package/dist/api/types/index.js +7 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.js +7 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/custom.js +17 -0
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/errors/SchematicError.d.ts +4 -1
- package/dist/errors/SchematicError.js +4 -7
- package/dist/events.d.ts +4 -0
- package/dist/events.js +41 -5
- package/dist/events.test.js +50 -3
- package/dist/serialization/resources/accounts/types/QuickstartResponse.d.ts +14 -0
- package/dist/serialization/resources/accounts/types/QuickstartResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/index.d.ts +1 -0
- package/dist/serialization/resources/accounts/types/index.js +1 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +4 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +4 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.d.ts +1 -3
- package/dist/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.js +1 -3
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.d.ts +2 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.js +2 -0
- package/dist/serialization/resources/billing/types/CountCustomersParams.d.ts +1 -0
- package/dist/serialization/resources/billing/types/CountCustomersParams.js +1 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +41 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.d.ts +2 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.js +2 -0
- package/dist/serialization/resources/billing/types/{ListCustomersParams.d.ts → ListCustomersWithSubscriptionsParams.d.ts} +3 -2
- package/dist/serialization/resources/billing/types/{ListCustomersParams.js → ListCustomersWithSubscriptionsParams.js} +3 -2
- package/dist/serialization/resources/billing/types/{ListCustomersResponse.d.ts → ListCustomersWithSubscriptionsResponse.d.ts} +4 -4
- package/dist/serialization/resources/billing/types/{ListCustomersResponse.js → ListCustomersWithSubscriptionsResponse.js} +4 -4
- package/dist/serialization/resources/billing/types/ListProductPricesParams.d.ts +2 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.js +2 -0
- package/dist/serialization/resources/billing/types/index.d.ts +3 -2
- package/dist/serialization/resources/billing/types/index.js +3 -2
- 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/LookupCompanyParams.d.ts +1 -1
- package/dist/serialization/resources/companies/types/LookupCompanyParams.js +1 -1
- package/dist/serialization/resources/companies/types/LookupUserParams.d.ts +1 -1
- package/dist/serialization/resources/companies/types/LookupUserParams.js +1 -1
- package/dist/serialization/resources/dataexports/client/index.d.ts +1 -0
- package/dist/serialization/resources/dataexports/client/index.js +17 -0
- package/dist/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.d.ts +12 -0
- package/dist/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.js +43 -0
- package/dist/serialization/resources/dataexports/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/dataexports/client/requests/index.js +5 -0
- package/dist/serialization/resources/dataexports/index.d.ts +2 -0
- package/dist/serialization/resources/dataexports/index.js +18 -0
- package/dist/serialization/resources/dataexports/types/CreateDataExportResponse.d.ts +14 -0
- package/dist/serialization/resources/dataexports/types/CreateDataExportResponse.js +45 -0
- package/dist/serialization/resources/dataexports/types/index.d.ts +1 -0
- package/dist/serialization/resources/dataexports/types/index.js +17 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +6 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +6 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +6 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +6 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.d.ts +1 -1
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +1 -1
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.js +45 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +13 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +44 -0
- package/dist/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +2 -0
- package/dist/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.js +2 -0
- package/dist/serialization/resources/plans/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/plans/client/requests/index.js +5 -1
- package/dist/serialization/resources/plans/types/CountPlanTraitsParams.d.ts +16 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsParams.js +47 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsResponse.d.ts +15 -0
- package/dist/serialization/resources/plans/types/CountPlanTraitsResponse.js +46 -0
- package/dist/serialization/resources/plans/types/CreatePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/CreatePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/DeletePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/DeletePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/GetPlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/GetPlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsParams.d.ts +16 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsParams.js +47 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsResponse.d.ts +15 -0
- package/dist/serialization/resources/plans/types/ListPlanTraitsResponse.js +46 -0
- package/dist/serialization/resources/plans/types/UpdatePlanTraitResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/UpdatePlanTraitResponse.js +45 -0
- package/dist/serialization/resources/plans/types/index.d.ts +8 -0
- package/dist/serialization/resources/plans/types/index.js +8 -0
- package/dist/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +2 -0
- package/dist/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.js +2 -0
- package/dist/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.d.ts +2 -0
- package/dist/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +2 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/dist/serialization/types/BillingPriceResponseData.d.ts +2 -0
- package/dist/serialization/types/BillingPriceResponseData.js +2 -0
- package/dist/serialization/types/BillingPriceView.d.ts +7 -0
- package/dist/serialization/types/BillingPriceView.js +7 -0
- package/dist/serialization/types/BillingProductDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/BillingProductDetailResponseData.js +2 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.d.ts +5 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/dist/serialization/types/BillingProductPlanResponseData.d.ts +2 -0
- package/dist/serialization/types/BillingProductPlanResponseData.js +2 -0
- package/dist/serialization/types/BillingProductPriceResponseData.d.ts +3 -0
- package/dist/serialization/types/BillingProductPriceResponseData.js +3 -0
- package/dist/serialization/types/BillingProductPriceTierResponseData.d.ts +15 -0
- package/dist/serialization/types/BillingProductPriceTierResponseData.js +46 -0
- package/dist/serialization/types/BillingProductPricing.d.ts +2 -0
- package/dist/serialization/types/BillingProductPricing.js +2 -0
- package/dist/serialization/types/BillingProductResponseData.d.ts +2 -0
- package/dist/serialization/types/BillingProductResponseData.js +2 -0
- package/dist/serialization/types/CheckFlagResponseData.d.ts +1 -0
- package/dist/serialization/types/CheckFlagResponseData.js +1 -0
- package/dist/serialization/types/CompanyDetailResponseData.d.ts +2 -1
- package/dist/serialization/types/CompanyDetailResponseData.js +2 -1
- package/dist/serialization/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/CompanyPlanDetailResponseData.js +2 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.d.ts +2 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.js +2 -0
- package/dist/serialization/types/CreateBillingPriceTierRequestBody.d.ts +1 -0
- package/dist/serialization/types/CreateBillingPriceTierRequestBody.js +1 -0
- package/dist/serialization/types/DataExportResponseData.d.ts +20 -0
- package/dist/serialization/types/DataExportResponseData.js +51 -0
- package/dist/serialization/types/EntitlementTriggerConfig.d.ts +12 -0
- package/dist/serialization/types/EntitlementTriggerConfig.js +43 -0
- package/dist/serialization/types/EventSummaryResponseData.d.ts +2 -2
- package/dist/serialization/types/EventSummaryResponseData.js +2 -2
- package/dist/serialization/types/PlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanDetailResponseData.js +2 -0
- package/dist/serialization/types/PlanEntitlementResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanEntitlementResponseData.js +2 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.js +2 -0
- package/dist/serialization/types/PlanTraitResponseData.d.ts +19 -0
- package/dist/serialization/types/PlanTraitResponseData.js +50 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +4 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.js +4 -0
- package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.d.ts +21 -0
- package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.js +52 -0
- package/dist/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.d.ts +16 -0
- package/dist/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +47 -0
- package/dist/serialization/types/QuickstartResp.d.ts +12 -0
- package/dist/serialization/types/QuickstartResp.js +43 -0
- package/dist/serialization/types/UpsertUserRequestBody.d.ts +2 -0
- package/dist/serialization/types/UpsertUserRequestBody.js +2 -0
- package/dist/serialization/types/UpsertUserSubRequestBody.d.ts +1 -0
- package/dist/serialization/types/UpsertUserSubRequestBody.js +1 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBody.d.ts +6 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBody.js +6 -0
- package/dist/serialization/types/WebhookResponseData.d.ts +2 -0
- package/dist/serialization/types/WebhookResponseData.js +2 -0
- package/dist/serialization/types/index.d.ts +7 -0
- package/dist/serialization/types/index.js +7 -0
- package/errors/SchematicError.d.ts +4 -1
- package/errors/SchematicError.js +4 -7
- package/events.d.ts +4 -0
- package/events.js +41 -5
- package/events.test.js +50 -3
- package/package.json +3 -2
- package/reference.md +412 -15
- package/serialization/resources/accounts/types/QuickstartResponse.d.ts +14 -0
- package/serialization/resources/accounts/types/QuickstartResponse.js +45 -0
- package/serialization/resources/accounts/types/index.d.ts +1 -0
- package/serialization/resources/accounts/types/index.js +1 -0
- package/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.d.ts +4 -0
- package/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +4 -0
- package/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.d.ts +1 -3
- package/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.js +1 -3
- package/serialization/resources/billing/types/CountBillingProductsParams.d.ts +2 -0
- package/serialization/resources/billing/types/CountBillingProductsParams.js +2 -0
- package/serialization/resources/billing/types/CountCustomersParams.d.ts +1 -0
- package/serialization/resources/billing/types/CountCustomersParams.js +1 -0
- package/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.d.ts +10 -0
- package/serialization/resources/billing/types/CreateBillingPriceRequestBodyBillingScheme.js +41 -0
- package/serialization/resources/billing/types/ListBillingProductsParams.d.ts +2 -0
- package/serialization/resources/billing/types/ListBillingProductsParams.js +2 -0
- package/serialization/resources/billing/types/{ListCustomersParams.d.ts → ListCustomersWithSubscriptionsParams.d.ts} +3 -2
- package/serialization/resources/billing/types/{ListCustomersParams.js → ListCustomersWithSubscriptionsParams.js} +3 -2
- package/serialization/resources/billing/types/{ListCustomersResponse.d.ts → ListCustomersWithSubscriptionsResponse.d.ts} +4 -4
- package/serialization/resources/billing/types/{ListCustomersResponse.js → ListCustomersWithSubscriptionsResponse.js} +4 -4
- package/serialization/resources/billing/types/ListProductPricesParams.d.ts +2 -0
- package/serialization/resources/billing/types/ListProductPricesParams.js +2 -0
- package/serialization/resources/billing/types/index.d.ts +3 -2
- package/serialization/resources/billing/types/index.js +3 -2
- 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/LookupCompanyParams.d.ts +1 -1
- package/serialization/resources/companies/types/LookupCompanyParams.js +1 -1
- package/serialization/resources/companies/types/LookupUserParams.d.ts +1 -1
- package/serialization/resources/companies/types/LookupUserParams.js +1 -1
- package/serialization/resources/dataexports/client/index.d.ts +1 -0
- package/serialization/resources/dataexports/client/index.js +17 -0
- package/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.d.ts +12 -0
- package/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.js +43 -0
- package/serialization/resources/dataexports/client/requests/index.d.ts +1 -0
- package/serialization/resources/dataexports/client/requests/index.js +5 -0
- package/serialization/resources/dataexports/index.d.ts +2 -0
- package/serialization/resources/dataexports/index.js +18 -0
- package/serialization/resources/dataexports/types/CreateDataExportResponse.d.ts +14 -0
- package/serialization/resources/dataexports/types/CreateDataExportResponse.js +45 -0
- package/serialization/resources/dataexports/types/index.d.ts +1 -0
- package/serialization/resources/dataexports/types/index.js +17 -0
- package/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +6 -0
- package/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +6 -0
- package/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +6 -0
- package/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +6 -0
- package/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.d.ts +1 -1
- package/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +1 -1
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.d.ts +14 -0
- package/serialization/resources/plans/client/requests/CreatePlanTraitRequestBody.js +45 -0
- package/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.d.ts +13 -0
- package/serialization/resources/plans/client/requests/UpdatePlanTraitRequestBody.js +44 -0
- package/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.d.ts +2 -0
- package/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.js +2 -0
- package/serialization/resources/plans/client/requests/index.d.ts +2 -0
- package/serialization/resources/plans/client/requests/index.js +5 -1
- package/serialization/resources/plans/types/CountPlanTraitsParams.d.ts +16 -0
- package/serialization/resources/plans/types/CountPlanTraitsParams.js +47 -0
- package/serialization/resources/plans/types/CountPlanTraitsResponse.d.ts +15 -0
- package/serialization/resources/plans/types/CountPlanTraitsResponse.js +46 -0
- package/serialization/resources/plans/types/CreatePlanTraitResponse.d.ts +14 -0
- package/serialization/resources/plans/types/CreatePlanTraitResponse.js +45 -0
- package/serialization/resources/plans/types/DeletePlanTraitResponse.d.ts +14 -0
- package/serialization/resources/plans/types/DeletePlanTraitResponse.js +45 -0
- package/serialization/resources/plans/types/GetPlanTraitResponse.d.ts +14 -0
- package/serialization/resources/plans/types/GetPlanTraitResponse.js +45 -0
- package/serialization/resources/plans/types/ListPlanTraitsParams.d.ts +16 -0
- package/serialization/resources/plans/types/ListPlanTraitsParams.js +47 -0
- package/serialization/resources/plans/types/ListPlanTraitsResponse.d.ts +15 -0
- package/serialization/resources/plans/types/ListPlanTraitsResponse.js +46 -0
- package/serialization/resources/plans/types/UpdatePlanTraitResponse.d.ts +14 -0
- package/serialization/resources/plans/types/UpdatePlanTraitResponse.js +45 -0
- package/serialization/resources/plans/types/index.d.ts +8 -0
- package/serialization/resources/plans/types/index.js +8 -0
- package/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.d.ts +2 -0
- package/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.js +2 -0
- package/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.d.ts +2 -0
- package/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +2 -0
- package/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
- package/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
- package/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +4 -0
- package/serialization/types/BillingPriceResponseData.d.ts +2 -0
- package/serialization/types/BillingPriceResponseData.js +2 -0
- package/serialization/types/BillingPriceView.d.ts +7 -0
- package/serialization/types/BillingPriceView.js +7 -0
- package/serialization/types/BillingProductDetailResponseData.d.ts +2 -0
- package/serialization/types/BillingProductDetailResponseData.js +2 -0
- package/serialization/types/BillingProductForSubscriptionResponseData.d.ts +5 -0
- package/serialization/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/serialization/types/BillingProductPlanResponseData.d.ts +2 -0
- package/serialization/types/BillingProductPlanResponseData.js +2 -0
- package/serialization/types/BillingProductPriceResponseData.d.ts +3 -0
- package/serialization/types/BillingProductPriceResponseData.js +3 -0
- package/serialization/types/BillingProductPriceTierResponseData.d.ts +15 -0
- package/serialization/types/BillingProductPriceTierResponseData.js +46 -0
- package/serialization/types/BillingProductPricing.d.ts +2 -0
- package/serialization/types/BillingProductPricing.js +2 -0
- package/serialization/types/BillingProductResponseData.d.ts +2 -0
- package/serialization/types/BillingProductResponseData.js +2 -0
- package/serialization/types/CheckFlagResponseData.d.ts +1 -0
- package/serialization/types/CheckFlagResponseData.js +1 -0
- package/serialization/types/CompanyDetailResponseData.d.ts +2 -1
- package/serialization/types/CompanyDetailResponseData.js +2 -1
- package/serialization/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/serialization/types/CompanyPlanDetailResponseData.js +2 -0
- package/serialization/types/CompanyPlanWithBillingSubView.d.ts +2 -0
- package/serialization/types/CompanyPlanWithBillingSubView.js +2 -0
- package/serialization/types/CreateBillingPriceTierRequestBody.d.ts +1 -0
- package/serialization/types/CreateBillingPriceTierRequestBody.js +1 -0
- package/serialization/types/DataExportResponseData.d.ts +20 -0
- package/serialization/types/DataExportResponseData.js +51 -0
- package/serialization/types/EntitlementTriggerConfig.d.ts +12 -0
- package/serialization/types/EntitlementTriggerConfig.js +43 -0
- package/serialization/types/EventSummaryResponseData.d.ts +2 -2
- package/serialization/types/EventSummaryResponseData.js +2 -2
- package/serialization/types/PlanDetailResponseData.d.ts +2 -0
- package/serialization/types/PlanDetailResponseData.js +2 -0
- package/serialization/types/PlanEntitlementResponseData.d.ts +2 -0
- package/serialization/types/PlanEntitlementResponseData.js +2 -0
- package/serialization/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/serialization/types/PlanGroupPlanDetailResponseData.js +2 -0
- package/serialization/types/PlanTraitResponseData.d.ts +19 -0
- package/serialization/types/PlanTraitResponseData.js +50 -0
- package/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +4 -0
- package/serialization/types/PreviewSubscriptionChangeResponseData.js +4 -0
- package/serialization/types/PreviewSubscriptionFinanceResponseData.d.ts +21 -0
- package/serialization/types/PreviewSubscriptionFinanceResponseData.js +52 -0
- package/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.d.ts +16 -0
- package/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +47 -0
- package/serialization/types/QuickstartResp.d.ts +12 -0
- package/serialization/types/QuickstartResp.js +43 -0
- package/serialization/types/UpsertUserRequestBody.d.ts +2 -0
- package/serialization/types/UpsertUserRequestBody.js +2 -0
- package/serialization/types/UpsertUserSubRequestBody.d.ts +1 -0
- package/serialization/types/UpsertUserSubRequestBody.js +1 -0
- package/serialization/types/UsageBasedEntitlementRequestBody.d.ts +6 -0
- package/serialization/types/UsageBasedEntitlementRequestBody.js +6 -0
- package/serialization/types/WebhookResponseData.d.ts +2 -0
- package/serialization/types/WebhookResponseData.js +2 -0
- package/serialization/types/index.d.ts +7 -0
- package/serialization/types/index.js +7 -0
- /package/api/resources/{billing/client/requests/ListCustomersRequest.js → accounts/types/QuickstartResponse.js} +0 -0
- /package/api/resources/billing/{types/ListCustomersParams.js → client/requests/ListCustomersWithSubscriptionsRequest.js} +0 -0
- /package/api/resources/billing/types/{ListCustomersResponse.js → ListCustomersWithSubscriptionsParams.js} +0 -0
- /package/{dist/api/resources/billing/client/requests/ListCustomersRequest.js → api/resources/billing/types/ListCustomersWithSubscriptionsResponse.js} +0 -0
- /package/{dist/api/resources/billing/types/ListCustomersParams.js → api/resources/dataexports/client/requests/CreateDataExportRequestBody.js} +0 -0
- /package/{dist/api/resources/billing/types/ListCustomersResponse.js → api/resources/dataexports/types/CreateDataExportResponse.js} +0 -0
|
@@ -67,15 +67,19 @@ class Companies {
|
|
|
67
67
|
* @throws {@link Schematic.BadRequestError}
|
|
68
68
|
* @throws {@link Schematic.UnauthorizedError}
|
|
69
69
|
* @throws {@link Schematic.ForbiddenError}
|
|
70
|
+
* @throws {@link Schematic.NotFoundError}
|
|
70
71
|
* @throws {@link Schematic.InternalServerError}
|
|
71
72
|
*
|
|
72
73
|
* @example
|
|
73
74
|
* await client.companies.listCompanies()
|
|
74
75
|
*/
|
|
75
|
-
listCompanies() {
|
|
76
|
+
listCompanies(request = {}, requestOptions) {
|
|
77
|
+
return core.HttpResponsePromise.fromPromise(this.__listCompanies(request, requestOptions));
|
|
78
|
+
}
|
|
79
|
+
__listCompanies() {
|
|
76
80
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
77
81
|
var _a, _b, _c;
|
|
78
|
-
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, limit, offset } = request;
|
|
82
|
+
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, withSubscription, limit, offset } = request;
|
|
79
83
|
const _queryParams = {};
|
|
80
84
|
if (ids != null) {
|
|
81
85
|
if (Array.isArray(ids)) {
|
|
@@ -97,6 +101,9 @@ class Companies {
|
|
|
97
101
|
if (withoutPlan != null) {
|
|
98
102
|
_queryParams["without_plan"] = withoutPlan.toString();
|
|
99
103
|
}
|
|
104
|
+
if (withSubscription != null) {
|
|
105
|
+
_queryParams["with_subscription"] = withSubscription.toString();
|
|
106
|
+
}
|
|
100
107
|
if (limit != null) {
|
|
101
108
|
_queryParams["limit"] = limit.toString();
|
|
102
109
|
}
|
|
@@ -106,7 +113,7 @@ class Companies {
|
|
|
106
113
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
107
114
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies"),
|
|
108
115
|
method: "GET",
|
|
109
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
116
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
110
117
|
contentType: "application/json",
|
|
111
118
|
queryParameters: _queryParams,
|
|
112
119
|
requestType: "json",
|
|
@@ -115,13 +122,16 @@ class Companies {
|
|
|
115
122
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
116
123
|
});
|
|
117
124
|
if (_response.ok) {
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
return {
|
|
126
|
+
data: serializers.ListCompaniesResponse.parseOrThrow(_response.body, {
|
|
127
|
+
unrecognizedObjectKeys: "passthrough",
|
|
128
|
+
allowUnrecognizedUnionMembers: true,
|
|
129
|
+
allowUnrecognizedEnumValues: true,
|
|
130
|
+
skipValidation: true,
|
|
131
|
+
breadcrumbsPrefix: ["response"],
|
|
132
|
+
}),
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
134
|
+
};
|
|
125
135
|
}
|
|
126
136
|
if (_response.error.reason === "status-code") {
|
|
127
137
|
switch (_response.error.statusCode) {
|
|
@@ -132,7 +142,7 @@ class Companies {
|
|
|
132
142
|
allowUnrecognizedEnumValues: true,
|
|
133
143
|
skipValidation: true,
|
|
134
144
|
breadcrumbsPrefix: ["response"],
|
|
135
|
-
}));
|
|
145
|
+
}), _response.rawResponse);
|
|
136
146
|
case 401:
|
|
137
147
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
138
148
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -140,7 +150,7 @@ class Companies {
|
|
|
140
150
|
allowUnrecognizedEnumValues: true,
|
|
141
151
|
skipValidation: true,
|
|
142
152
|
breadcrumbsPrefix: ["response"],
|
|
143
|
-
}));
|
|
153
|
+
}), _response.rawResponse);
|
|
144
154
|
case 403:
|
|
145
155
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
146
156
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -148,7 +158,15 @@ class Companies {
|
|
|
148
158
|
allowUnrecognizedEnumValues: true,
|
|
149
159
|
skipValidation: true,
|
|
150
160
|
breadcrumbsPrefix: ["response"],
|
|
151
|
-
}));
|
|
161
|
+
}), _response.rawResponse);
|
|
162
|
+
case 404:
|
|
163
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
164
|
+
unrecognizedObjectKeys: "passthrough",
|
|
165
|
+
allowUnrecognizedUnionMembers: true,
|
|
166
|
+
allowUnrecognizedEnumValues: true,
|
|
167
|
+
skipValidation: true,
|
|
168
|
+
breadcrumbsPrefix: ["response"],
|
|
169
|
+
}), _response.rawResponse);
|
|
152
170
|
case 500:
|
|
153
171
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
154
172
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -156,11 +174,12 @@ class Companies {
|
|
|
156
174
|
allowUnrecognizedEnumValues: true,
|
|
157
175
|
skipValidation: true,
|
|
158
176
|
breadcrumbsPrefix: ["response"],
|
|
159
|
-
}));
|
|
177
|
+
}), _response.rawResponse);
|
|
160
178
|
default:
|
|
161
179
|
throw new errors.SchematicError({
|
|
162
180
|
statusCode: _response.error.statusCode,
|
|
163
181
|
body: _response.error.body,
|
|
182
|
+
rawResponse: _response.rawResponse,
|
|
164
183
|
});
|
|
165
184
|
}
|
|
166
185
|
}
|
|
@@ -169,12 +188,14 @@ class Companies {
|
|
|
169
188
|
throw new errors.SchematicError({
|
|
170
189
|
statusCode: _response.error.statusCode,
|
|
171
190
|
body: _response.error.rawBody,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
172
192
|
});
|
|
173
193
|
case "timeout":
|
|
174
194
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies.");
|
|
175
195
|
case "unknown":
|
|
176
196
|
throw new errors.SchematicError({
|
|
177
197
|
message: _response.error.errorMessage,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
178
199
|
});
|
|
179
200
|
}
|
|
180
201
|
});
|
|
@@ -186,6 +207,7 @@ class Companies {
|
|
|
186
207
|
* @throws {@link Schematic.BadRequestError}
|
|
187
208
|
* @throws {@link Schematic.UnauthorizedError}
|
|
188
209
|
* @throws {@link Schematic.ForbiddenError}
|
|
210
|
+
* @throws {@link Schematic.NotFoundError}
|
|
189
211
|
* @throws {@link Schematic.InternalServerError}
|
|
190
212
|
*
|
|
191
213
|
* @example
|
|
@@ -196,12 +218,15 @@ class Companies {
|
|
|
196
218
|
* })
|
|
197
219
|
*/
|
|
198
220
|
upsertCompany(request, requestOptions) {
|
|
221
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCompany(request, requestOptions));
|
|
222
|
+
}
|
|
223
|
+
__upsertCompany(request, requestOptions) {
|
|
199
224
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
225
|
var _a, _b, _c;
|
|
201
226
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
202
227
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies"),
|
|
203
228
|
method: "POST",
|
|
204
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
229
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
205
230
|
contentType: "application/json",
|
|
206
231
|
requestType: "json",
|
|
207
232
|
body: serializers.UpsertCompanyRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -210,13 +235,16 @@ class Companies {
|
|
|
210
235
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
211
236
|
});
|
|
212
237
|
if (_response.ok) {
|
|
213
|
-
return
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
238
|
+
return {
|
|
239
|
+
data: serializers.UpsertCompanyResponse.parseOrThrow(_response.body, {
|
|
240
|
+
unrecognizedObjectKeys: "passthrough",
|
|
241
|
+
allowUnrecognizedUnionMembers: true,
|
|
242
|
+
allowUnrecognizedEnumValues: true,
|
|
243
|
+
skipValidation: true,
|
|
244
|
+
breadcrumbsPrefix: ["response"],
|
|
245
|
+
}),
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
247
|
+
};
|
|
220
248
|
}
|
|
221
249
|
if (_response.error.reason === "status-code") {
|
|
222
250
|
switch (_response.error.statusCode) {
|
|
@@ -227,7 +255,7 @@ class Companies {
|
|
|
227
255
|
allowUnrecognizedEnumValues: true,
|
|
228
256
|
skipValidation: true,
|
|
229
257
|
breadcrumbsPrefix: ["response"],
|
|
230
|
-
}));
|
|
258
|
+
}), _response.rawResponse);
|
|
231
259
|
case 401:
|
|
232
260
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
233
261
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -235,7 +263,7 @@ class Companies {
|
|
|
235
263
|
allowUnrecognizedEnumValues: true,
|
|
236
264
|
skipValidation: true,
|
|
237
265
|
breadcrumbsPrefix: ["response"],
|
|
238
|
-
}));
|
|
266
|
+
}), _response.rawResponse);
|
|
239
267
|
case 403:
|
|
240
268
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
241
269
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -243,7 +271,15 @@ class Companies {
|
|
|
243
271
|
allowUnrecognizedEnumValues: true,
|
|
244
272
|
skipValidation: true,
|
|
245
273
|
breadcrumbsPrefix: ["response"],
|
|
246
|
-
}));
|
|
274
|
+
}), _response.rawResponse);
|
|
275
|
+
case 404:
|
|
276
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
277
|
+
unrecognizedObjectKeys: "passthrough",
|
|
278
|
+
allowUnrecognizedUnionMembers: true,
|
|
279
|
+
allowUnrecognizedEnumValues: true,
|
|
280
|
+
skipValidation: true,
|
|
281
|
+
breadcrumbsPrefix: ["response"],
|
|
282
|
+
}), _response.rawResponse);
|
|
247
283
|
case 500:
|
|
248
284
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
249
285
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -251,11 +287,12 @@ class Companies {
|
|
|
251
287
|
allowUnrecognizedEnumValues: true,
|
|
252
288
|
skipValidation: true,
|
|
253
289
|
breadcrumbsPrefix: ["response"],
|
|
254
|
-
}));
|
|
290
|
+
}), _response.rawResponse);
|
|
255
291
|
default:
|
|
256
292
|
throw new errors.SchematicError({
|
|
257
293
|
statusCode: _response.error.statusCode,
|
|
258
294
|
body: _response.error.body,
|
|
295
|
+
rawResponse: _response.rawResponse,
|
|
259
296
|
});
|
|
260
297
|
}
|
|
261
298
|
}
|
|
@@ -264,12 +301,14 @@ class Companies {
|
|
|
264
301
|
throw new errors.SchematicError({
|
|
265
302
|
statusCode: _response.error.statusCode,
|
|
266
303
|
body: _response.error.rawBody,
|
|
304
|
+
rawResponse: _response.rawResponse,
|
|
267
305
|
});
|
|
268
306
|
case "timeout":
|
|
269
307
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies.");
|
|
270
308
|
case "unknown":
|
|
271
309
|
throw new errors.SchematicError({
|
|
272
310
|
message: _response.error.errorMessage,
|
|
311
|
+
rawResponse: _response.rawResponse,
|
|
273
312
|
});
|
|
274
313
|
}
|
|
275
314
|
});
|
|
@@ -287,12 +326,15 @@ class Companies {
|
|
|
287
326
|
* await client.companies.getCompany("company_id")
|
|
288
327
|
*/
|
|
289
328
|
getCompany(companyId, requestOptions) {
|
|
329
|
+
return core.HttpResponsePromise.fromPromise(this.__getCompany(companyId, requestOptions));
|
|
330
|
+
}
|
|
331
|
+
__getCompany(companyId, requestOptions) {
|
|
290
332
|
return __awaiter(this, void 0, void 0, function* () {
|
|
291
333
|
var _a, _b, _c;
|
|
292
334
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
293
335
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `companies/${encodeURIComponent(companyId)}`),
|
|
294
336
|
method: "GET",
|
|
295
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
337
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
296
338
|
contentType: "application/json",
|
|
297
339
|
requestType: "json",
|
|
298
340
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -300,13 +342,16 @@ class Companies {
|
|
|
300
342
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
301
343
|
});
|
|
302
344
|
if (_response.ok) {
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
345
|
+
return {
|
|
346
|
+
data: serializers.GetCompanyResponse.parseOrThrow(_response.body, {
|
|
347
|
+
unrecognizedObjectKeys: "passthrough",
|
|
348
|
+
allowUnrecognizedUnionMembers: true,
|
|
349
|
+
allowUnrecognizedEnumValues: true,
|
|
350
|
+
skipValidation: true,
|
|
351
|
+
breadcrumbsPrefix: ["response"],
|
|
352
|
+
}),
|
|
353
|
+
rawResponse: _response.rawResponse,
|
|
354
|
+
};
|
|
310
355
|
}
|
|
311
356
|
if (_response.error.reason === "status-code") {
|
|
312
357
|
switch (_response.error.statusCode) {
|
|
@@ -317,7 +362,7 @@ class Companies {
|
|
|
317
362
|
allowUnrecognizedEnumValues: true,
|
|
318
363
|
skipValidation: true,
|
|
319
364
|
breadcrumbsPrefix: ["response"],
|
|
320
|
-
}));
|
|
365
|
+
}), _response.rawResponse);
|
|
321
366
|
case 403:
|
|
322
367
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
323
368
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -325,7 +370,7 @@ class Companies {
|
|
|
325
370
|
allowUnrecognizedEnumValues: true,
|
|
326
371
|
skipValidation: true,
|
|
327
372
|
breadcrumbsPrefix: ["response"],
|
|
328
|
-
}));
|
|
373
|
+
}), _response.rawResponse);
|
|
329
374
|
case 404:
|
|
330
375
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
331
376
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -333,7 +378,7 @@ class Companies {
|
|
|
333
378
|
allowUnrecognizedEnumValues: true,
|
|
334
379
|
skipValidation: true,
|
|
335
380
|
breadcrumbsPrefix: ["response"],
|
|
336
|
-
}));
|
|
381
|
+
}), _response.rawResponse);
|
|
337
382
|
case 500:
|
|
338
383
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
339
384
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -341,11 +386,12 @@ class Companies {
|
|
|
341
386
|
allowUnrecognizedEnumValues: true,
|
|
342
387
|
skipValidation: true,
|
|
343
388
|
breadcrumbsPrefix: ["response"],
|
|
344
|
-
}));
|
|
389
|
+
}), _response.rawResponse);
|
|
345
390
|
default:
|
|
346
391
|
throw new errors.SchematicError({
|
|
347
392
|
statusCode: _response.error.statusCode,
|
|
348
393
|
body: _response.error.body,
|
|
394
|
+
rawResponse: _response.rawResponse,
|
|
349
395
|
});
|
|
350
396
|
}
|
|
351
397
|
}
|
|
@@ -354,12 +400,14 @@ class Companies {
|
|
|
354
400
|
throw new errors.SchematicError({
|
|
355
401
|
statusCode: _response.error.statusCode,
|
|
356
402
|
body: _response.error.rawBody,
|
|
403
|
+
rawResponse: _response.rawResponse,
|
|
357
404
|
});
|
|
358
405
|
case "timeout":
|
|
359
406
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/{company_id}.");
|
|
360
407
|
case "unknown":
|
|
361
408
|
throw new errors.SchematicError({
|
|
362
409
|
message: _response.error.errorMessage,
|
|
410
|
+
rawResponse: _response.rawResponse,
|
|
363
411
|
});
|
|
364
412
|
}
|
|
365
413
|
});
|
|
@@ -371,18 +419,22 @@ class Companies {
|
|
|
371
419
|
* @throws {@link Schematic.BadRequestError}
|
|
372
420
|
* @throws {@link Schematic.UnauthorizedError}
|
|
373
421
|
* @throws {@link Schematic.ForbiddenError}
|
|
422
|
+
* @throws {@link Schematic.NotFoundError}
|
|
374
423
|
* @throws {@link Schematic.InternalServerError}
|
|
375
424
|
*
|
|
376
425
|
* @example
|
|
377
426
|
* await client.companies.deleteCompany("company_id")
|
|
378
427
|
*/
|
|
379
428
|
deleteCompany(companyId, requestOptions) {
|
|
429
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompany(companyId, requestOptions));
|
|
430
|
+
}
|
|
431
|
+
__deleteCompany(companyId, requestOptions) {
|
|
380
432
|
return __awaiter(this, void 0, void 0, function* () {
|
|
381
433
|
var _a, _b, _c;
|
|
382
434
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
383
435
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `companies/${encodeURIComponent(companyId)}`),
|
|
384
436
|
method: "DELETE",
|
|
385
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
437
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
386
438
|
contentType: "application/json",
|
|
387
439
|
requestType: "json",
|
|
388
440
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -390,13 +442,16 @@ class Companies {
|
|
|
390
442
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
391
443
|
});
|
|
392
444
|
if (_response.ok) {
|
|
393
|
-
return
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
445
|
+
return {
|
|
446
|
+
data: serializers.DeleteCompanyResponse.parseOrThrow(_response.body, {
|
|
447
|
+
unrecognizedObjectKeys: "passthrough",
|
|
448
|
+
allowUnrecognizedUnionMembers: true,
|
|
449
|
+
allowUnrecognizedEnumValues: true,
|
|
450
|
+
skipValidation: true,
|
|
451
|
+
breadcrumbsPrefix: ["response"],
|
|
452
|
+
}),
|
|
453
|
+
rawResponse: _response.rawResponse,
|
|
454
|
+
};
|
|
400
455
|
}
|
|
401
456
|
if (_response.error.reason === "status-code") {
|
|
402
457
|
switch (_response.error.statusCode) {
|
|
@@ -407,7 +462,7 @@ class Companies {
|
|
|
407
462
|
allowUnrecognizedEnumValues: true,
|
|
408
463
|
skipValidation: true,
|
|
409
464
|
breadcrumbsPrefix: ["response"],
|
|
410
|
-
}));
|
|
465
|
+
}), _response.rawResponse);
|
|
411
466
|
case 401:
|
|
412
467
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
413
468
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -415,7 +470,7 @@ class Companies {
|
|
|
415
470
|
allowUnrecognizedEnumValues: true,
|
|
416
471
|
skipValidation: true,
|
|
417
472
|
breadcrumbsPrefix: ["response"],
|
|
418
|
-
}));
|
|
473
|
+
}), _response.rawResponse);
|
|
419
474
|
case 403:
|
|
420
475
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
421
476
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -423,7 +478,15 @@ class Companies {
|
|
|
423
478
|
allowUnrecognizedEnumValues: true,
|
|
424
479
|
skipValidation: true,
|
|
425
480
|
breadcrumbsPrefix: ["response"],
|
|
426
|
-
}));
|
|
481
|
+
}), _response.rawResponse);
|
|
482
|
+
case 404:
|
|
483
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
484
|
+
unrecognizedObjectKeys: "passthrough",
|
|
485
|
+
allowUnrecognizedUnionMembers: true,
|
|
486
|
+
allowUnrecognizedEnumValues: true,
|
|
487
|
+
skipValidation: true,
|
|
488
|
+
breadcrumbsPrefix: ["response"],
|
|
489
|
+
}), _response.rawResponse);
|
|
427
490
|
case 500:
|
|
428
491
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
429
492
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -431,11 +494,12 @@ class Companies {
|
|
|
431
494
|
allowUnrecognizedEnumValues: true,
|
|
432
495
|
skipValidation: true,
|
|
433
496
|
breadcrumbsPrefix: ["response"],
|
|
434
|
-
}));
|
|
497
|
+
}), _response.rawResponse);
|
|
435
498
|
default:
|
|
436
499
|
throw new errors.SchematicError({
|
|
437
500
|
statusCode: _response.error.statusCode,
|
|
438
501
|
body: _response.error.body,
|
|
502
|
+
rawResponse: _response.rawResponse,
|
|
439
503
|
});
|
|
440
504
|
}
|
|
441
505
|
}
|
|
@@ -444,12 +508,14 @@ class Companies {
|
|
|
444
508
|
throw new errors.SchematicError({
|
|
445
509
|
statusCode: _response.error.statusCode,
|
|
446
510
|
body: _response.error.rawBody,
|
|
511
|
+
rawResponse: _response.rawResponse,
|
|
447
512
|
});
|
|
448
513
|
case "timeout":
|
|
449
514
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /companies/{company_id}.");
|
|
450
515
|
case "unknown":
|
|
451
516
|
throw new errors.SchematicError({
|
|
452
517
|
message: _response.error.errorMessage,
|
|
518
|
+
rawResponse: _response.rawResponse,
|
|
453
519
|
});
|
|
454
520
|
}
|
|
455
521
|
});
|
|
@@ -461,15 +527,19 @@ class Companies {
|
|
|
461
527
|
* @throws {@link Schematic.BadRequestError}
|
|
462
528
|
* @throws {@link Schematic.UnauthorizedError}
|
|
463
529
|
* @throws {@link Schematic.ForbiddenError}
|
|
530
|
+
* @throws {@link Schematic.NotFoundError}
|
|
464
531
|
* @throws {@link Schematic.InternalServerError}
|
|
465
532
|
*
|
|
466
533
|
* @example
|
|
467
534
|
* await client.companies.countCompanies()
|
|
468
535
|
*/
|
|
469
|
-
countCompanies() {
|
|
536
|
+
countCompanies(request = {}, requestOptions) {
|
|
537
|
+
return core.HttpResponsePromise.fromPromise(this.__countCompanies(request, requestOptions));
|
|
538
|
+
}
|
|
539
|
+
__countCompanies() {
|
|
470
540
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
471
541
|
var _a, _b, _c;
|
|
472
|
-
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, limit, offset } = request;
|
|
542
|
+
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, withSubscription, limit, offset } = request;
|
|
473
543
|
const _queryParams = {};
|
|
474
544
|
if (ids != null) {
|
|
475
545
|
if (Array.isArray(ids)) {
|
|
@@ -491,6 +561,9 @@ class Companies {
|
|
|
491
561
|
if (withoutPlan != null) {
|
|
492
562
|
_queryParams["without_plan"] = withoutPlan.toString();
|
|
493
563
|
}
|
|
564
|
+
if (withSubscription != null) {
|
|
565
|
+
_queryParams["with_subscription"] = withSubscription.toString();
|
|
566
|
+
}
|
|
494
567
|
if (limit != null) {
|
|
495
568
|
_queryParams["limit"] = limit.toString();
|
|
496
569
|
}
|
|
@@ -500,7 +573,7 @@ class Companies {
|
|
|
500
573
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
501
574
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies/count"),
|
|
502
575
|
method: "GET",
|
|
503
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
576
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
504
577
|
contentType: "application/json",
|
|
505
578
|
queryParameters: _queryParams,
|
|
506
579
|
requestType: "json",
|
|
@@ -509,13 +582,16 @@ class Companies {
|
|
|
509
582
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
510
583
|
});
|
|
511
584
|
if (_response.ok) {
|
|
512
|
-
return
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
585
|
+
return {
|
|
586
|
+
data: serializers.CountCompaniesResponse.parseOrThrow(_response.body, {
|
|
587
|
+
unrecognizedObjectKeys: "passthrough",
|
|
588
|
+
allowUnrecognizedUnionMembers: true,
|
|
589
|
+
allowUnrecognizedEnumValues: true,
|
|
590
|
+
skipValidation: true,
|
|
591
|
+
breadcrumbsPrefix: ["response"],
|
|
592
|
+
}),
|
|
593
|
+
rawResponse: _response.rawResponse,
|
|
594
|
+
};
|
|
519
595
|
}
|
|
520
596
|
if (_response.error.reason === "status-code") {
|
|
521
597
|
switch (_response.error.statusCode) {
|
|
@@ -526,7 +602,7 @@ class Companies {
|
|
|
526
602
|
allowUnrecognizedEnumValues: true,
|
|
527
603
|
skipValidation: true,
|
|
528
604
|
breadcrumbsPrefix: ["response"],
|
|
529
|
-
}));
|
|
605
|
+
}), _response.rawResponse);
|
|
530
606
|
case 401:
|
|
531
607
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
532
608
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -534,7 +610,7 @@ class Companies {
|
|
|
534
610
|
allowUnrecognizedEnumValues: true,
|
|
535
611
|
skipValidation: true,
|
|
536
612
|
breadcrumbsPrefix: ["response"],
|
|
537
|
-
}));
|
|
613
|
+
}), _response.rawResponse);
|
|
538
614
|
case 403:
|
|
539
615
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
540
616
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -542,7 +618,15 @@ class Companies {
|
|
|
542
618
|
allowUnrecognizedEnumValues: true,
|
|
543
619
|
skipValidation: true,
|
|
544
620
|
breadcrumbsPrefix: ["response"],
|
|
545
|
-
}));
|
|
621
|
+
}), _response.rawResponse);
|
|
622
|
+
case 404:
|
|
623
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
624
|
+
unrecognizedObjectKeys: "passthrough",
|
|
625
|
+
allowUnrecognizedUnionMembers: true,
|
|
626
|
+
allowUnrecognizedEnumValues: true,
|
|
627
|
+
skipValidation: true,
|
|
628
|
+
breadcrumbsPrefix: ["response"],
|
|
629
|
+
}), _response.rawResponse);
|
|
546
630
|
case 500:
|
|
547
631
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
548
632
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -550,11 +634,12 @@ class Companies {
|
|
|
550
634
|
allowUnrecognizedEnumValues: true,
|
|
551
635
|
skipValidation: true,
|
|
552
636
|
breadcrumbsPrefix: ["response"],
|
|
553
|
-
}));
|
|
637
|
+
}), _response.rawResponse);
|
|
554
638
|
default:
|
|
555
639
|
throw new errors.SchematicError({
|
|
556
640
|
statusCode: _response.error.statusCode,
|
|
557
641
|
body: _response.error.body,
|
|
642
|
+
rawResponse: _response.rawResponse,
|
|
558
643
|
});
|
|
559
644
|
}
|
|
560
645
|
}
|
|
@@ -563,12 +648,14 @@ class Companies {
|
|
|
563
648
|
throw new errors.SchematicError({
|
|
564
649
|
statusCode: _response.error.statusCode,
|
|
565
650
|
body: _response.error.rawBody,
|
|
651
|
+
rawResponse: _response.rawResponse,
|
|
566
652
|
});
|
|
567
653
|
case "timeout":
|
|
568
654
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/count.");
|
|
569
655
|
case "unknown":
|
|
570
656
|
throw new errors.SchematicError({
|
|
571
657
|
message: _response.error.errorMessage,
|
|
658
|
+
rawResponse: _response.rawResponse,
|
|
572
659
|
});
|
|
573
660
|
}
|
|
574
661
|
});
|
|
@@ -580,6 +667,7 @@ class Companies {
|
|
|
580
667
|
* @throws {@link Schematic.BadRequestError}
|
|
581
668
|
* @throws {@link Schematic.UnauthorizedError}
|
|
582
669
|
* @throws {@link Schematic.ForbiddenError}
|
|
670
|
+
* @throws {@link Schematic.NotFoundError}
|
|
583
671
|
* @throws {@link Schematic.InternalServerError}
|
|
584
672
|
*
|
|
585
673
|
* @example
|
|
@@ -590,12 +678,15 @@ class Companies {
|
|
|
590
678
|
* })
|
|
591
679
|
*/
|
|
592
680
|
createCompany(request, requestOptions) {
|
|
681
|
+
return core.HttpResponsePromise.fromPromise(this.__createCompany(request, requestOptions));
|
|
682
|
+
}
|
|
683
|
+
__createCompany(request, requestOptions) {
|
|
593
684
|
return __awaiter(this, void 0, void 0, function* () {
|
|
594
685
|
var _a, _b, _c;
|
|
595
686
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
596
687
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies/create"),
|
|
597
688
|
method: "POST",
|
|
598
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
689
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
599
690
|
contentType: "application/json",
|
|
600
691
|
requestType: "json",
|
|
601
692
|
body: serializers.UpsertCompanyRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -604,13 +695,16 @@ class Companies {
|
|
|
604
695
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
605
696
|
});
|
|
606
697
|
if (_response.ok) {
|
|
607
|
-
return
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
698
|
+
return {
|
|
699
|
+
data: serializers.CreateCompanyResponse.parseOrThrow(_response.body, {
|
|
700
|
+
unrecognizedObjectKeys: "passthrough",
|
|
701
|
+
allowUnrecognizedUnionMembers: true,
|
|
702
|
+
allowUnrecognizedEnumValues: true,
|
|
703
|
+
skipValidation: true,
|
|
704
|
+
breadcrumbsPrefix: ["response"],
|
|
705
|
+
}),
|
|
706
|
+
rawResponse: _response.rawResponse,
|
|
707
|
+
};
|
|
614
708
|
}
|
|
615
709
|
if (_response.error.reason === "status-code") {
|
|
616
710
|
switch (_response.error.statusCode) {
|
|
@@ -621,7 +715,7 @@ class Companies {
|
|
|
621
715
|
allowUnrecognizedEnumValues: true,
|
|
622
716
|
skipValidation: true,
|
|
623
717
|
breadcrumbsPrefix: ["response"],
|
|
624
|
-
}));
|
|
718
|
+
}), _response.rawResponse);
|
|
625
719
|
case 401:
|
|
626
720
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
627
721
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -629,7 +723,7 @@ class Companies {
|
|
|
629
723
|
allowUnrecognizedEnumValues: true,
|
|
630
724
|
skipValidation: true,
|
|
631
725
|
breadcrumbsPrefix: ["response"],
|
|
632
|
-
}));
|
|
726
|
+
}), _response.rawResponse);
|
|
633
727
|
case 403:
|
|
634
728
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
635
729
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -637,7 +731,15 @@ class Companies {
|
|
|
637
731
|
allowUnrecognizedEnumValues: true,
|
|
638
732
|
skipValidation: true,
|
|
639
733
|
breadcrumbsPrefix: ["response"],
|
|
640
|
-
}));
|
|
734
|
+
}), _response.rawResponse);
|
|
735
|
+
case 404:
|
|
736
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
737
|
+
unrecognizedObjectKeys: "passthrough",
|
|
738
|
+
allowUnrecognizedUnionMembers: true,
|
|
739
|
+
allowUnrecognizedEnumValues: true,
|
|
740
|
+
skipValidation: true,
|
|
741
|
+
breadcrumbsPrefix: ["response"],
|
|
742
|
+
}), _response.rawResponse);
|
|
641
743
|
case 500:
|
|
642
744
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
643
745
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -645,11 +747,12 @@ class Companies {
|
|
|
645
747
|
allowUnrecognizedEnumValues: true,
|
|
646
748
|
skipValidation: true,
|
|
647
749
|
breadcrumbsPrefix: ["response"],
|
|
648
|
-
}));
|
|
750
|
+
}), _response.rawResponse);
|
|
649
751
|
default:
|
|
650
752
|
throw new errors.SchematicError({
|
|
651
753
|
statusCode: _response.error.statusCode,
|
|
652
754
|
body: _response.error.body,
|
|
755
|
+
rawResponse: _response.rawResponse,
|
|
653
756
|
});
|
|
654
757
|
}
|
|
655
758
|
}
|
|
@@ -658,12 +761,14 @@ class Companies {
|
|
|
658
761
|
throw new errors.SchematicError({
|
|
659
762
|
statusCode: _response.error.statusCode,
|
|
660
763
|
body: _response.error.rawBody,
|
|
764
|
+
rawResponse: _response.rawResponse,
|
|
661
765
|
});
|
|
662
766
|
case "timeout":
|
|
663
767
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies/create.");
|
|
664
768
|
case "unknown":
|
|
665
769
|
throw new errors.SchematicError({
|
|
666
770
|
message: _response.error.errorMessage,
|
|
771
|
+
rawResponse: _response.rawResponse,
|
|
667
772
|
});
|
|
668
773
|
}
|
|
669
774
|
});
|
|
@@ -675,6 +780,7 @@ class Companies {
|
|
|
675
780
|
* @throws {@link Schematic.BadRequestError}
|
|
676
781
|
* @throws {@link Schematic.UnauthorizedError}
|
|
677
782
|
* @throws {@link Schematic.ForbiddenError}
|
|
783
|
+
* @throws {@link Schematic.NotFoundError}
|
|
678
784
|
* @throws {@link Schematic.InternalServerError}
|
|
679
785
|
*
|
|
680
786
|
* @example
|
|
@@ -685,12 +791,15 @@ class Companies {
|
|
|
685
791
|
* })
|
|
686
792
|
*/
|
|
687
793
|
deleteCompanyByKeys(request, requestOptions) {
|
|
794
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompanyByKeys(request, requestOptions));
|
|
795
|
+
}
|
|
796
|
+
__deleteCompanyByKeys(request, requestOptions) {
|
|
688
797
|
return __awaiter(this, void 0, void 0, function* () {
|
|
689
798
|
var _a, _b, _c;
|
|
690
799
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
691
800
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies/delete"),
|
|
692
801
|
method: "POST",
|
|
693
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
802
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
694
803
|
contentType: "application/json",
|
|
695
804
|
requestType: "json",
|
|
696
805
|
body: serializers.KeysRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -699,13 +808,16 @@ class Companies {
|
|
|
699
808
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
700
809
|
});
|
|
701
810
|
if (_response.ok) {
|
|
702
|
-
return
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
811
|
+
return {
|
|
812
|
+
data: serializers.DeleteCompanyByKeysResponse.parseOrThrow(_response.body, {
|
|
813
|
+
unrecognizedObjectKeys: "passthrough",
|
|
814
|
+
allowUnrecognizedUnionMembers: true,
|
|
815
|
+
allowUnrecognizedEnumValues: true,
|
|
816
|
+
skipValidation: true,
|
|
817
|
+
breadcrumbsPrefix: ["response"],
|
|
818
|
+
}),
|
|
819
|
+
rawResponse: _response.rawResponse,
|
|
820
|
+
};
|
|
709
821
|
}
|
|
710
822
|
if (_response.error.reason === "status-code") {
|
|
711
823
|
switch (_response.error.statusCode) {
|
|
@@ -716,7 +828,7 @@ class Companies {
|
|
|
716
828
|
allowUnrecognizedEnumValues: true,
|
|
717
829
|
skipValidation: true,
|
|
718
830
|
breadcrumbsPrefix: ["response"],
|
|
719
|
-
}));
|
|
831
|
+
}), _response.rawResponse);
|
|
720
832
|
case 401:
|
|
721
833
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
722
834
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -724,7 +836,7 @@ class Companies {
|
|
|
724
836
|
allowUnrecognizedEnumValues: true,
|
|
725
837
|
skipValidation: true,
|
|
726
838
|
breadcrumbsPrefix: ["response"],
|
|
727
|
-
}));
|
|
839
|
+
}), _response.rawResponse);
|
|
728
840
|
case 403:
|
|
729
841
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
730
842
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -732,7 +844,15 @@ class Companies {
|
|
|
732
844
|
allowUnrecognizedEnumValues: true,
|
|
733
845
|
skipValidation: true,
|
|
734
846
|
breadcrumbsPrefix: ["response"],
|
|
735
|
-
}));
|
|
847
|
+
}), _response.rawResponse);
|
|
848
|
+
case 404:
|
|
849
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
850
|
+
unrecognizedObjectKeys: "passthrough",
|
|
851
|
+
allowUnrecognizedUnionMembers: true,
|
|
852
|
+
allowUnrecognizedEnumValues: true,
|
|
853
|
+
skipValidation: true,
|
|
854
|
+
breadcrumbsPrefix: ["response"],
|
|
855
|
+
}), _response.rawResponse);
|
|
736
856
|
case 500:
|
|
737
857
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
738
858
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -740,11 +860,12 @@ class Companies {
|
|
|
740
860
|
allowUnrecognizedEnumValues: true,
|
|
741
861
|
skipValidation: true,
|
|
742
862
|
breadcrumbsPrefix: ["response"],
|
|
743
|
-
}));
|
|
863
|
+
}), _response.rawResponse);
|
|
744
864
|
default:
|
|
745
865
|
throw new errors.SchematicError({
|
|
746
866
|
statusCode: _response.error.statusCode,
|
|
747
867
|
body: _response.error.body,
|
|
868
|
+
rawResponse: _response.rawResponse,
|
|
748
869
|
});
|
|
749
870
|
}
|
|
750
871
|
}
|
|
@@ -753,12 +874,14 @@ class Companies {
|
|
|
753
874
|
throw new errors.SchematicError({
|
|
754
875
|
statusCode: _response.error.statusCode,
|
|
755
876
|
body: _response.error.rawBody,
|
|
877
|
+
rawResponse: _response.rawResponse,
|
|
756
878
|
});
|
|
757
879
|
case "timeout":
|
|
758
880
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies/delete.");
|
|
759
881
|
case "unknown":
|
|
760
882
|
throw new errors.SchematicError({
|
|
761
883
|
message: _response.error.errorMessage,
|
|
884
|
+
rawResponse: _response.rawResponse,
|
|
762
885
|
});
|
|
763
886
|
}
|
|
764
887
|
});
|
|
@@ -775,13 +898,14 @@ class Companies {
|
|
|
775
898
|
* @example
|
|
776
899
|
* await client.companies.lookupCompany({
|
|
777
900
|
* keys: {
|
|
778
|
-
* "keys":
|
|
779
|
-
* "key": "value"
|
|
780
|
-
* }
|
|
901
|
+
* "keys": "keys"
|
|
781
902
|
* }
|
|
782
903
|
* })
|
|
783
904
|
*/
|
|
784
905
|
lookupCompany(request, requestOptions) {
|
|
906
|
+
return core.HttpResponsePromise.fromPromise(this.__lookupCompany(request, requestOptions));
|
|
907
|
+
}
|
|
908
|
+
__lookupCompany(request, requestOptions) {
|
|
785
909
|
return __awaiter(this, void 0, void 0, function* () {
|
|
786
910
|
var _a, _b, _c;
|
|
787
911
|
const { keys } = request;
|
|
@@ -790,7 +914,7 @@ class Companies {
|
|
|
790
914
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
791
915
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "companies/lookup"),
|
|
792
916
|
method: "GET",
|
|
793
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
917
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
794
918
|
contentType: "application/json",
|
|
795
919
|
queryParameters: _queryParams,
|
|
796
920
|
requestType: "json",
|
|
@@ -799,13 +923,16 @@ class Companies {
|
|
|
799
923
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
800
924
|
});
|
|
801
925
|
if (_response.ok) {
|
|
802
|
-
return
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
926
|
+
return {
|
|
927
|
+
data: serializers.LookupCompanyResponse.parseOrThrow(_response.body, {
|
|
928
|
+
unrecognizedObjectKeys: "passthrough",
|
|
929
|
+
allowUnrecognizedUnionMembers: true,
|
|
930
|
+
allowUnrecognizedEnumValues: true,
|
|
931
|
+
skipValidation: true,
|
|
932
|
+
breadcrumbsPrefix: ["response"],
|
|
933
|
+
}),
|
|
934
|
+
rawResponse: _response.rawResponse,
|
|
935
|
+
};
|
|
809
936
|
}
|
|
810
937
|
if (_response.error.reason === "status-code") {
|
|
811
938
|
switch (_response.error.statusCode) {
|
|
@@ -816,7 +943,7 @@ class Companies {
|
|
|
816
943
|
allowUnrecognizedEnumValues: true,
|
|
817
944
|
skipValidation: true,
|
|
818
945
|
breadcrumbsPrefix: ["response"],
|
|
819
|
-
}));
|
|
946
|
+
}), _response.rawResponse);
|
|
820
947
|
case 403:
|
|
821
948
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
822
949
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -824,7 +951,7 @@ class Companies {
|
|
|
824
951
|
allowUnrecognizedEnumValues: true,
|
|
825
952
|
skipValidation: true,
|
|
826
953
|
breadcrumbsPrefix: ["response"],
|
|
827
|
-
}));
|
|
954
|
+
}), _response.rawResponse);
|
|
828
955
|
case 404:
|
|
829
956
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
830
957
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -832,7 +959,7 @@ class Companies {
|
|
|
832
959
|
allowUnrecognizedEnumValues: true,
|
|
833
960
|
skipValidation: true,
|
|
834
961
|
breadcrumbsPrefix: ["response"],
|
|
835
|
-
}));
|
|
962
|
+
}), _response.rawResponse);
|
|
836
963
|
case 500:
|
|
837
964
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
838
965
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -840,11 +967,12 @@ class Companies {
|
|
|
840
967
|
allowUnrecognizedEnumValues: true,
|
|
841
968
|
skipValidation: true,
|
|
842
969
|
breadcrumbsPrefix: ["response"],
|
|
843
|
-
}));
|
|
970
|
+
}), _response.rawResponse);
|
|
844
971
|
default:
|
|
845
972
|
throw new errors.SchematicError({
|
|
846
973
|
statusCode: _response.error.statusCode,
|
|
847
974
|
body: _response.error.body,
|
|
975
|
+
rawResponse: _response.rawResponse,
|
|
848
976
|
});
|
|
849
977
|
}
|
|
850
978
|
}
|
|
@@ -853,12 +981,14 @@ class Companies {
|
|
|
853
981
|
throw new errors.SchematicError({
|
|
854
982
|
statusCode: _response.error.statusCode,
|
|
855
983
|
body: _response.error.rawBody,
|
|
984
|
+
rawResponse: _response.rawResponse,
|
|
856
985
|
});
|
|
857
986
|
case "timeout":
|
|
858
987
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/lookup.");
|
|
859
988
|
case "unknown":
|
|
860
989
|
throw new errors.SchematicError({
|
|
861
990
|
message: _response.error.errorMessage,
|
|
991
|
+
rawResponse: _response.rawResponse,
|
|
862
992
|
});
|
|
863
993
|
}
|
|
864
994
|
});
|
|
@@ -870,6 +1000,7 @@ class Companies {
|
|
|
870
1000
|
* @throws {@link Schematic.BadRequestError}
|
|
871
1001
|
* @throws {@link Schematic.UnauthorizedError}
|
|
872
1002
|
* @throws {@link Schematic.ForbiddenError}
|
|
1003
|
+
* @throws {@link Schematic.NotFoundError}
|
|
873
1004
|
* @throws {@link Schematic.InternalServerError}
|
|
874
1005
|
*
|
|
875
1006
|
* @example
|
|
@@ -879,6 +1010,9 @@ class Companies {
|
|
|
879
1010
|
* })
|
|
880
1011
|
*/
|
|
881
1012
|
getActiveDeals(request, requestOptions) {
|
|
1013
|
+
return core.HttpResponsePromise.fromPromise(this.__getActiveDeals(request, requestOptions));
|
|
1014
|
+
}
|
|
1015
|
+
__getActiveDeals(request, requestOptions) {
|
|
882
1016
|
return __awaiter(this, void 0, void 0, function* () {
|
|
883
1017
|
var _a, _b, _c;
|
|
884
1018
|
const { companyId, dealStage, limit, offset } = request;
|
|
@@ -894,7 +1028,7 @@ class Companies {
|
|
|
894
1028
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
895
1029
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "company-crm-deals"),
|
|
896
1030
|
method: "GET",
|
|
897
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1031
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
898
1032
|
contentType: "application/json",
|
|
899
1033
|
queryParameters: _queryParams,
|
|
900
1034
|
requestType: "json",
|
|
@@ -903,13 +1037,16 @@ class Companies {
|
|
|
903
1037
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
904
1038
|
});
|
|
905
1039
|
if (_response.ok) {
|
|
906
|
-
return
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1040
|
+
return {
|
|
1041
|
+
data: serializers.GetActiveDealsResponse.parseOrThrow(_response.body, {
|
|
1042
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1043
|
+
allowUnrecognizedUnionMembers: true,
|
|
1044
|
+
allowUnrecognizedEnumValues: true,
|
|
1045
|
+
skipValidation: true,
|
|
1046
|
+
breadcrumbsPrefix: ["response"],
|
|
1047
|
+
}),
|
|
1048
|
+
rawResponse: _response.rawResponse,
|
|
1049
|
+
};
|
|
913
1050
|
}
|
|
914
1051
|
if (_response.error.reason === "status-code") {
|
|
915
1052
|
switch (_response.error.statusCode) {
|
|
@@ -920,7 +1057,7 @@ class Companies {
|
|
|
920
1057
|
allowUnrecognizedEnumValues: true,
|
|
921
1058
|
skipValidation: true,
|
|
922
1059
|
breadcrumbsPrefix: ["response"],
|
|
923
|
-
}));
|
|
1060
|
+
}), _response.rawResponse);
|
|
924
1061
|
case 401:
|
|
925
1062
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
926
1063
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -928,7 +1065,7 @@ class Companies {
|
|
|
928
1065
|
allowUnrecognizedEnumValues: true,
|
|
929
1066
|
skipValidation: true,
|
|
930
1067
|
breadcrumbsPrefix: ["response"],
|
|
931
|
-
}));
|
|
1068
|
+
}), _response.rawResponse);
|
|
932
1069
|
case 403:
|
|
933
1070
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
934
1071
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -936,7 +1073,15 @@ class Companies {
|
|
|
936
1073
|
allowUnrecognizedEnumValues: true,
|
|
937
1074
|
skipValidation: true,
|
|
938
1075
|
breadcrumbsPrefix: ["response"],
|
|
939
|
-
}));
|
|
1076
|
+
}), _response.rawResponse);
|
|
1077
|
+
case 404:
|
|
1078
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1079
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1080
|
+
allowUnrecognizedUnionMembers: true,
|
|
1081
|
+
allowUnrecognizedEnumValues: true,
|
|
1082
|
+
skipValidation: true,
|
|
1083
|
+
breadcrumbsPrefix: ["response"],
|
|
1084
|
+
}), _response.rawResponse);
|
|
940
1085
|
case 500:
|
|
941
1086
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
942
1087
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -944,11 +1089,12 @@ class Companies {
|
|
|
944
1089
|
allowUnrecognizedEnumValues: true,
|
|
945
1090
|
skipValidation: true,
|
|
946
1091
|
breadcrumbsPrefix: ["response"],
|
|
947
|
-
}));
|
|
1092
|
+
}), _response.rawResponse);
|
|
948
1093
|
default:
|
|
949
1094
|
throw new errors.SchematicError({
|
|
950
1095
|
statusCode: _response.error.statusCode,
|
|
951
1096
|
body: _response.error.body,
|
|
1097
|
+
rawResponse: _response.rawResponse,
|
|
952
1098
|
});
|
|
953
1099
|
}
|
|
954
1100
|
}
|
|
@@ -957,12 +1103,14 @@ class Companies {
|
|
|
957
1103
|
throw new errors.SchematicError({
|
|
958
1104
|
statusCode: _response.error.statusCode,
|
|
959
1105
|
body: _response.error.rawBody,
|
|
1106
|
+
rawResponse: _response.rawResponse,
|
|
960
1107
|
});
|
|
961
1108
|
case "timeout":
|
|
962
1109
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-crm-deals.");
|
|
963
1110
|
case "unknown":
|
|
964
1111
|
throw new errors.SchematicError({
|
|
965
1112
|
message: _response.error.errorMessage,
|
|
1113
|
+
rawResponse: _response.rawResponse,
|
|
966
1114
|
});
|
|
967
1115
|
}
|
|
968
1116
|
});
|
|
@@ -974,12 +1122,16 @@ class Companies {
|
|
|
974
1122
|
* @throws {@link Schematic.BadRequestError}
|
|
975
1123
|
* @throws {@link Schematic.UnauthorizedError}
|
|
976
1124
|
* @throws {@link Schematic.ForbiddenError}
|
|
1125
|
+
* @throws {@link Schematic.NotFoundError}
|
|
977
1126
|
* @throws {@link Schematic.InternalServerError}
|
|
978
1127
|
*
|
|
979
1128
|
* @example
|
|
980
1129
|
* await client.companies.listCompanyMemberships()
|
|
981
1130
|
*/
|
|
982
|
-
listCompanyMemberships() {
|
|
1131
|
+
listCompanyMemberships(request = {}, requestOptions) {
|
|
1132
|
+
return core.HttpResponsePromise.fromPromise(this.__listCompanyMemberships(request, requestOptions));
|
|
1133
|
+
}
|
|
1134
|
+
__listCompanyMemberships() {
|
|
983
1135
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
984
1136
|
var _a, _b, _c;
|
|
985
1137
|
const { companyId, userId, limit, offset } = request;
|
|
@@ -999,7 +1151,7 @@ class Companies {
|
|
|
999
1151
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1000
1152
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "company-memberships"),
|
|
1001
1153
|
method: "GET",
|
|
1002
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1154
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1003
1155
|
contentType: "application/json",
|
|
1004
1156
|
queryParameters: _queryParams,
|
|
1005
1157
|
requestType: "json",
|
|
@@ -1008,13 +1160,16 @@ class Companies {
|
|
|
1008
1160
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1009
1161
|
});
|
|
1010
1162
|
if (_response.ok) {
|
|
1011
|
-
return
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1163
|
+
return {
|
|
1164
|
+
data: serializers.ListCompanyMembershipsResponse.parseOrThrow(_response.body, {
|
|
1165
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1166
|
+
allowUnrecognizedUnionMembers: true,
|
|
1167
|
+
allowUnrecognizedEnumValues: true,
|
|
1168
|
+
skipValidation: true,
|
|
1169
|
+
breadcrumbsPrefix: ["response"],
|
|
1170
|
+
}),
|
|
1171
|
+
rawResponse: _response.rawResponse,
|
|
1172
|
+
};
|
|
1018
1173
|
}
|
|
1019
1174
|
if (_response.error.reason === "status-code") {
|
|
1020
1175
|
switch (_response.error.statusCode) {
|
|
@@ -1025,7 +1180,7 @@ class Companies {
|
|
|
1025
1180
|
allowUnrecognizedEnumValues: true,
|
|
1026
1181
|
skipValidation: true,
|
|
1027
1182
|
breadcrumbsPrefix: ["response"],
|
|
1028
|
-
}));
|
|
1183
|
+
}), _response.rawResponse);
|
|
1029
1184
|
case 401:
|
|
1030
1185
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1031
1186
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1033,7 +1188,7 @@ class Companies {
|
|
|
1033
1188
|
allowUnrecognizedEnumValues: true,
|
|
1034
1189
|
skipValidation: true,
|
|
1035
1190
|
breadcrumbsPrefix: ["response"],
|
|
1036
|
-
}));
|
|
1191
|
+
}), _response.rawResponse);
|
|
1037
1192
|
case 403:
|
|
1038
1193
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1039
1194
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1041,7 +1196,15 @@ class Companies {
|
|
|
1041
1196
|
allowUnrecognizedEnumValues: true,
|
|
1042
1197
|
skipValidation: true,
|
|
1043
1198
|
breadcrumbsPrefix: ["response"],
|
|
1044
|
-
}));
|
|
1199
|
+
}), _response.rawResponse);
|
|
1200
|
+
case 404:
|
|
1201
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1202
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1203
|
+
allowUnrecognizedUnionMembers: true,
|
|
1204
|
+
allowUnrecognizedEnumValues: true,
|
|
1205
|
+
skipValidation: true,
|
|
1206
|
+
breadcrumbsPrefix: ["response"],
|
|
1207
|
+
}), _response.rawResponse);
|
|
1045
1208
|
case 500:
|
|
1046
1209
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1047
1210
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1049,11 +1212,12 @@ class Companies {
|
|
|
1049
1212
|
allowUnrecognizedEnumValues: true,
|
|
1050
1213
|
skipValidation: true,
|
|
1051
1214
|
breadcrumbsPrefix: ["response"],
|
|
1052
|
-
}));
|
|
1215
|
+
}), _response.rawResponse);
|
|
1053
1216
|
default:
|
|
1054
1217
|
throw new errors.SchematicError({
|
|
1055
1218
|
statusCode: _response.error.statusCode,
|
|
1056
1219
|
body: _response.error.body,
|
|
1220
|
+
rawResponse: _response.rawResponse,
|
|
1057
1221
|
});
|
|
1058
1222
|
}
|
|
1059
1223
|
}
|
|
@@ -1062,12 +1226,14 @@ class Companies {
|
|
|
1062
1226
|
throw new errors.SchematicError({
|
|
1063
1227
|
statusCode: _response.error.statusCode,
|
|
1064
1228
|
body: _response.error.rawBody,
|
|
1229
|
+
rawResponse: _response.rawResponse,
|
|
1065
1230
|
});
|
|
1066
1231
|
case "timeout":
|
|
1067
1232
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-memberships.");
|
|
1068
1233
|
case "unknown":
|
|
1069
1234
|
throw new errors.SchematicError({
|
|
1070
1235
|
message: _response.error.errorMessage,
|
|
1236
|
+
rawResponse: _response.rawResponse,
|
|
1071
1237
|
});
|
|
1072
1238
|
}
|
|
1073
1239
|
});
|
|
@@ -1079,6 +1245,7 @@ class Companies {
|
|
|
1079
1245
|
* @throws {@link Schematic.BadRequestError}
|
|
1080
1246
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1081
1247
|
* @throws {@link Schematic.ForbiddenError}
|
|
1248
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1082
1249
|
* @throws {@link Schematic.InternalServerError}
|
|
1083
1250
|
*
|
|
1084
1251
|
* @example
|
|
@@ -1088,12 +1255,15 @@ class Companies {
|
|
|
1088
1255
|
* })
|
|
1089
1256
|
*/
|
|
1090
1257
|
getOrCreateCompanyMembership(request, requestOptions) {
|
|
1258
|
+
return core.HttpResponsePromise.fromPromise(this.__getOrCreateCompanyMembership(request, requestOptions));
|
|
1259
|
+
}
|
|
1260
|
+
__getOrCreateCompanyMembership(request, requestOptions) {
|
|
1091
1261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1092
1262
|
var _a, _b, _c;
|
|
1093
1263
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1094
1264
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "company-memberships"),
|
|
1095
1265
|
method: "POST",
|
|
1096
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1266
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1097
1267
|
contentType: "application/json",
|
|
1098
1268
|
requestType: "json",
|
|
1099
1269
|
body: serializers.GetOrCreateCompanyMembershipRequestBody.jsonOrThrow(request, {
|
|
@@ -1104,13 +1274,16 @@ class Companies {
|
|
|
1104
1274
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1105
1275
|
});
|
|
1106
1276
|
if (_response.ok) {
|
|
1107
|
-
return
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1277
|
+
return {
|
|
1278
|
+
data: serializers.GetOrCreateCompanyMembershipResponse.parseOrThrow(_response.body, {
|
|
1279
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1280
|
+
allowUnrecognizedUnionMembers: true,
|
|
1281
|
+
allowUnrecognizedEnumValues: true,
|
|
1282
|
+
skipValidation: true,
|
|
1283
|
+
breadcrumbsPrefix: ["response"],
|
|
1284
|
+
}),
|
|
1285
|
+
rawResponse: _response.rawResponse,
|
|
1286
|
+
};
|
|
1114
1287
|
}
|
|
1115
1288
|
if (_response.error.reason === "status-code") {
|
|
1116
1289
|
switch (_response.error.statusCode) {
|
|
@@ -1121,7 +1294,7 @@ class Companies {
|
|
|
1121
1294
|
allowUnrecognizedEnumValues: true,
|
|
1122
1295
|
skipValidation: true,
|
|
1123
1296
|
breadcrumbsPrefix: ["response"],
|
|
1124
|
-
}));
|
|
1297
|
+
}), _response.rawResponse);
|
|
1125
1298
|
case 401:
|
|
1126
1299
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1127
1300
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1129,7 +1302,7 @@ class Companies {
|
|
|
1129
1302
|
allowUnrecognizedEnumValues: true,
|
|
1130
1303
|
skipValidation: true,
|
|
1131
1304
|
breadcrumbsPrefix: ["response"],
|
|
1132
|
-
}));
|
|
1305
|
+
}), _response.rawResponse);
|
|
1133
1306
|
case 403:
|
|
1134
1307
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1135
1308
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1137,7 +1310,15 @@ class Companies {
|
|
|
1137
1310
|
allowUnrecognizedEnumValues: true,
|
|
1138
1311
|
skipValidation: true,
|
|
1139
1312
|
breadcrumbsPrefix: ["response"],
|
|
1140
|
-
}));
|
|
1313
|
+
}), _response.rawResponse);
|
|
1314
|
+
case 404:
|
|
1315
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1316
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1317
|
+
allowUnrecognizedUnionMembers: true,
|
|
1318
|
+
allowUnrecognizedEnumValues: true,
|
|
1319
|
+
skipValidation: true,
|
|
1320
|
+
breadcrumbsPrefix: ["response"],
|
|
1321
|
+
}), _response.rawResponse);
|
|
1141
1322
|
case 500:
|
|
1142
1323
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1143
1324
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1145,11 +1326,12 @@ class Companies {
|
|
|
1145
1326
|
allowUnrecognizedEnumValues: true,
|
|
1146
1327
|
skipValidation: true,
|
|
1147
1328
|
breadcrumbsPrefix: ["response"],
|
|
1148
|
-
}));
|
|
1329
|
+
}), _response.rawResponse);
|
|
1149
1330
|
default:
|
|
1150
1331
|
throw new errors.SchematicError({
|
|
1151
1332
|
statusCode: _response.error.statusCode,
|
|
1152
1333
|
body: _response.error.body,
|
|
1334
|
+
rawResponse: _response.rawResponse,
|
|
1153
1335
|
});
|
|
1154
1336
|
}
|
|
1155
1337
|
}
|
|
@@ -1158,12 +1340,14 @@ class Companies {
|
|
|
1158
1340
|
throw new errors.SchematicError({
|
|
1159
1341
|
statusCode: _response.error.statusCode,
|
|
1160
1342
|
body: _response.error.rawBody,
|
|
1343
|
+
rawResponse: _response.rawResponse,
|
|
1161
1344
|
});
|
|
1162
1345
|
case "timeout":
|
|
1163
1346
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /company-memberships.");
|
|
1164
1347
|
case "unknown":
|
|
1165
1348
|
throw new errors.SchematicError({
|
|
1166
1349
|
message: _response.error.errorMessage,
|
|
1350
|
+
rawResponse: _response.rawResponse,
|
|
1167
1351
|
});
|
|
1168
1352
|
}
|
|
1169
1353
|
});
|
|
@@ -1175,18 +1359,22 @@ class Companies {
|
|
|
1175
1359
|
* @throws {@link Schematic.BadRequestError}
|
|
1176
1360
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1177
1361
|
* @throws {@link Schematic.ForbiddenError}
|
|
1362
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1178
1363
|
* @throws {@link Schematic.InternalServerError}
|
|
1179
1364
|
*
|
|
1180
1365
|
* @example
|
|
1181
1366
|
* await client.companies.deleteCompanyMembership("company_membership_id")
|
|
1182
1367
|
*/
|
|
1183
1368
|
deleteCompanyMembership(companyMembershipId, requestOptions) {
|
|
1369
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompanyMembership(companyMembershipId, requestOptions));
|
|
1370
|
+
}
|
|
1371
|
+
__deleteCompanyMembership(companyMembershipId, requestOptions) {
|
|
1184
1372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1185
1373
|
var _a, _b, _c;
|
|
1186
1374
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1187
1375
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `company-memberships/${encodeURIComponent(companyMembershipId)}`),
|
|
1188
1376
|
method: "DELETE",
|
|
1189
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1377
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1190
1378
|
contentType: "application/json",
|
|
1191
1379
|
requestType: "json",
|
|
1192
1380
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1194,13 +1382,16 @@ class Companies {
|
|
|
1194
1382
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1195
1383
|
});
|
|
1196
1384
|
if (_response.ok) {
|
|
1197
|
-
return
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1385
|
+
return {
|
|
1386
|
+
data: serializers.DeleteCompanyMembershipResponse.parseOrThrow(_response.body, {
|
|
1387
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1388
|
+
allowUnrecognizedUnionMembers: true,
|
|
1389
|
+
allowUnrecognizedEnumValues: true,
|
|
1390
|
+
skipValidation: true,
|
|
1391
|
+
breadcrumbsPrefix: ["response"],
|
|
1392
|
+
}),
|
|
1393
|
+
rawResponse: _response.rawResponse,
|
|
1394
|
+
};
|
|
1204
1395
|
}
|
|
1205
1396
|
if (_response.error.reason === "status-code") {
|
|
1206
1397
|
switch (_response.error.statusCode) {
|
|
@@ -1211,7 +1402,7 @@ class Companies {
|
|
|
1211
1402
|
allowUnrecognizedEnumValues: true,
|
|
1212
1403
|
skipValidation: true,
|
|
1213
1404
|
breadcrumbsPrefix: ["response"],
|
|
1214
|
-
}));
|
|
1405
|
+
}), _response.rawResponse);
|
|
1215
1406
|
case 401:
|
|
1216
1407
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1217
1408
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1219,7 +1410,7 @@ class Companies {
|
|
|
1219
1410
|
allowUnrecognizedEnumValues: true,
|
|
1220
1411
|
skipValidation: true,
|
|
1221
1412
|
breadcrumbsPrefix: ["response"],
|
|
1222
|
-
}));
|
|
1413
|
+
}), _response.rawResponse);
|
|
1223
1414
|
case 403:
|
|
1224
1415
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1225
1416
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1227,7 +1418,15 @@ class Companies {
|
|
|
1227
1418
|
allowUnrecognizedEnumValues: true,
|
|
1228
1419
|
skipValidation: true,
|
|
1229
1420
|
breadcrumbsPrefix: ["response"],
|
|
1230
|
-
}));
|
|
1421
|
+
}), _response.rawResponse);
|
|
1422
|
+
case 404:
|
|
1423
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1424
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1425
|
+
allowUnrecognizedUnionMembers: true,
|
|
1426
|
+
allowUnrecognizedEnumValues: true,
|
|
1427
|
+
skipValidation: true,
|
|
1428
|
+
breadcrumbsPrefix: ["response"],
|
|
1429
|
+
}), _response.rawResponse);
|
|
1231
1430
|
case 500:
|
|
1232
1431
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1233
1432
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1235,11 +1434,12 @@ class Companies {
|
|
|
1235
1434
|
allowUnrecognizedEnumValues: true,
|
|
1236
1435
|
skipValidation: true,
|
|
1237
1436
|
breadcrumbsPrefix: ["response"],
|
|
1238
|
-
}));
|
|
1437
|
+
}), _response.rawResponse);
|
|
1239
1438
|
default:
|
|
1240
1439
|
throw new errors.SchematicError({
|
|
1241
1440
|
statusCode: _response.error.statusCode,
|
|
1242
1441
|
body: _response.error.body,
|
|
1442
|
+
rawResponse: _response.rawResponse,
|
|
1243
1443
|
});
|
|
1244
1444
|
}
|
|
1245
1445
|
}
|
|
@@ -1248,12 +1448,14 @@ class Companies {
|
|
|
1248
1448
|
throw new errors.SchematicError({
|
|
1249
1449
|
statusCode: _response.error.statusCode,
|
|
1250
1450
|
body: _response.error.rawBody,
|
|
1451
|
+
rawResponse: _response.rawResponse,
|
|
1251
1452
|
});
|
|
1252
1453
|
case "timeout":
|
|
1253
1454
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /company-memberships/{company_membership_id}.");
|
|
1254
1455
|
case "unknown":
|
|
1255
1456
|
throw new errors.SchematicError({
|
|
1256
1457
|
message: _response.error.errorMessage,
|
|
1458
|
+
rawResponse: _response.rawResponse,
|
|
1257
1459
|
});
|
|
1258
1460
|
}
|
|
1259
1461
|
});
|
|
@@ -1265,12 +1467,16 @@ class Companies {
|
|
|
1265
1467
|
* @throws {@link Schematic.BadRequestError}
|
|
1266
1468
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1267
1469
|
* @throws {@link Schematic.ForbiddenError}
|
|
1470
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1268
1471
|
* @throws {@link Schematic.InternalServerError}
|
|
1269
1472
|
*
|
|
1270
1473
|
* @example
|
|
1271
1474
|
* await client.companies.getActiveCompanySubscription()
|
|
1272
1475
|
*/
|
|
1273
|
-
getActiveCompanySubscription() {
|
|
1476
|
+
getActiveCompanySubscription(request = {}, requestOptions) {
|
|
1477
|
+
return core.HttpResponsePromise.fromPromise(this.__getActiveCompanySubscription(request, requestOptions));
|
|
1478
|
+
}
|
|
1479
|
+
__getActiveCompanySubscription() {
|
|
1274
1480
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1275
1481
|
var _a, _b, _c;
|
|
1276
1482
|
const { companyId, companyIds, limit, offset } = request;
|
|
@@ -1295,7 +1501,7 @@ class Companies {
|
|
|
1295
1501
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1296
1502
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "company-subscriptions"),
|
|
1297
1503
|
method: "GET",
|
|
1298
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1504
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1299
1505
|
contentType: "application/json",
|
|
1300
1506
|
queryParameters: _queryParams,
|
|
1301
1507
|
requestType: "json",
|
|
@@ -1304,13 +1510,16 @@ class Companies {
|
|
|
1304
1510
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1305
1511
|
});
|
|
1306
1512
|
if (_response.ok) {
|
|
1307
|
-
return
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1513
|
+
return {
|
|
1514
|
+
data: serializers.GetActiveCompanySubscriptionResponse.parseOrThrow(_response.body, {
|
|
1515
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1516
|
+
allowUnrecognizedUnionMembers: true,
|
|
1517
|
+
allowUnrecognizedEnumValues: true,
|
|
1518
|
+
skipValidation: true,
|
|
1519
|
+
breadcrumbsPrefix: ["response"],
|
|
1520
|
+
}),
|
|
1521
|
+
rawResponse: _response.rawResponse,
|
|
1522
|
+
};
|
|
1314
1523
|
}
|
|
1315
1524
|
if (_response.error.reason === "status-code") {
|
|
1316
1525
|
switch (_response.error.statusCode) {
|
|
@@ -1321,7 +1530,7 @@ class Companies {
|
|
|
1321
1530
|
allowUnrecognizedEnumValues: true,
|
|
1322
1531
|
skipValidation: true,
|
|
1323
1532
|
breadcrumbsPrefix: ["response"],
|
|
1324
|
-
}));
|
|
1533
|
+
}), _response.rawResponse);
|
|
1325
1534
|
case 401:
|
|
1326
1535
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1327
1536
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1329,7 +1538,7 @@ class Companies {
|
|
|
1329
1538
|
allowUnrecognizedEnumValues: true,
|
|
1330
1539
|
skipValidation: true,
|
|
1331
1540
|
breadcrumbsPrefix: ["response"],
|
|
1332
|
-
}));
|
|
1541
|
+
}), _response.rawResponse);
|
|
1333
1542
|
case 403:
|
|
1334
1543
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1335
1544
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1337,7 +1546,15 @@ class Companies {
|
|
|
1337
1546
|
allowUnrecognizedEnumValues: true,
|
|
1338
1547
|
skipValidation: true,
|
|
1339
1548
|
breadcrumbsPrefix: ["response"],
|
|
1340
|
-
}));
|
|
1549
|
+
}), _response.rawResponse);
|
|
1550
|
+
case 404:
|
|
1551
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1552
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1553
|
+
allowUnrecognizedUnionMembers: true,
|
|
1554
|
+
allowUnrecognizedEnumValues: true,
|
|
1555
|
+
skipValidation: true,
|
|
1556
|
+
breadcrumbsPrefix: ["response"],
|
|
1557
|
+
}), _response.rawResponse);
|
|
1341
1558
|
case 500:
|
|
1342
1559
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1343
1560
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1345,11 +1562,12 @@ class Companies {
|
|
|
1345
1562
|
allowUnrecognizedEnumValues: true,
|
|
1346
1563
|
skipValidation: true,
|
|
1347
1564
|
breadcrumbsPrefix: ["response"],
|
|
1348
|
-
}));
|
|
1565
|
+
}), _response.rawResponse);
|
|
1349
1566
|
default:
|
|
1350
1567
|
throw new errors.SchematicError({
|
|
1351
1568
|
statusCode: _response.error.statusCode,
|
|
1352
1569
|
body: _response.error.body,
|
|
1570
|
+
rawResponse: _response.rawResponse,
|
|
1353
1571
|
});
|
|
1354
1572
|
}
|
|
1355
1573
|
}
|
|
@@ -1358,12 +1576,14 @@ class Companies {
|
|
|
1358
1576
|
throw new errors.SchematicError({
|
|
1359
1577
|
statusCode: _response.error.statusCode,
|
|
1360
1578
|
body: _response.error.rawBody,
|
|
1579
|
+
rawResponse: _response.rawResponse,
|
|
1361
1580
|
});
|
|
1362
1581
|
case "timeout":
|
|
1363
1582
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-subscriptions.");
|
|
1364
1583
|
case "unknown":
|
|
1365
1584
|
throw new errors.SchematicError({
|
|
1366
1585
|
message: _response.error.errorMessage,
|
|
1586
|
+
rawResponse: _response.rawResponse,
|
|
1367
1587
|
});
|
|
1368
1588
|
}
|
|
1369
1589
|
});
|
|
@@ -1375,6 +1595,7 @@ class Companies {
|
|
|
1375
1595
|
* @throws {@link Schematic.BadRequestError}
|
|
1376
1596
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1377
1597
|
* @throws {@link Schematic.ForbiddenError}
|
|
1598
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1378
1599
|
* @throws {@link Schematic.InternalServerError}
|
|
1379
1600
|
*
|
|
1380
1601
|
* @example
|
|
@@ -1386,12 +1607,15 @@ class Companies {
|
|
|
1386
1607
|
* })
|
|
1387
1608
|
*/
|
|
1388
1609
|
upsertCompanyTrait(request, requestOptions) {
|
|
1610
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCompanyTrait(request, requestOptions));
|
|
1611
|
+
}
|
|
1612
|
+
__upsertCompanyTrait(request, requestOptions) {
|
|
1389
1613
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1390
1614
|
var _a, _b, _c;
|
|
1391
1615
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1392
1616
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "company-traits"),
|
|
1393
1617
|
method: "POST",
|
|
1394
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1618
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1395
1619
|
contentType: "application/json",
|
|
1396
1620
|
requestType: "json",
|
|
1397
1621
|
body: serializers.UpsertTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -1400,13 +1624,16 @@ class Companies {
|
|
|
1400
1624
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1401
1625
|
});
|
|
1402
1626
|
if (_response.ok) {
|
|
1403
|
-
return
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1627
|
+
return {
|
|
1628
|
+
data: serializers.UpsertCompanyTraitResponse.parseOrThrow(_response.body, {
|
|
1629
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1630
|
+
allowUnrecognizedUnionMembers: true,
|
|
1631
|
+
allowUnrecognizedEnumValues: true,
|
|
1632
|
+
skipValidation: true,
|
|
1633
|
+
breadcrumbsPrefix: ["response"],
|
|
1634
|
+
}),
|
|
1635
|
+
rawResponse: _response.rawResponse,
|
|
1636
|
+
};
|
|
1410
1637
|
}
|
|
1411
1638
|
if (_response.error.reason === "status-code") {
|
|
1412
1639
|
switch (_response.error.statusCode) {
|
|
@@ -1417,7 +1644,7 @@ class Companies {
|
|
|
1417
1644
|
allowUnrecognizedEnumValues: true,
|
|
1418
1645
|
skipValidation: true,
|
|
1419
1646
|
breadcrumbsPrefix: ["response"],
|
|
1420
|
-
}));
|
|
1647
|
+
}), _response.rawResponse);
|
|
1421
1648
|
case 401:
|
|
1422
1649
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1423
1650
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1425,7 +1652,7 @@ class Companies {
|
|
|
1425
1652
|
allowUnrecognizedEnumValues: true,
|
|
1426
1653
|
skipValidation: true,
|
|
1427
1654
|
breadcrumbsPrefix: ["response"],
|
|
1428
|
-
}));
|
|
1655
|
+
}), _response.rawResponse);
|
|
1429
1656
|
case 403:
|
|
1430
1657
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1431
1658
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1433,7 +1660,15 @@ class Companies {
|
|
|
1433
1660
|
allowUnrecognizedEnumValues: true,
|
|
1434
1661
|
skipValidation: true,
|
|
1435
1662
|
breadcrumbsPrefix: ["response"],
|
|
1436
|
-
}));
|
|
1663
|
+
}), _response.rawResponse);
|
|
1664
|
+
case 404:
|
|
1665
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1666
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1667
|
+
allowUnrecognizedUnionMembers: true,
|
|
1668
|
+
allowUnrecognizedEnumValues: true,
|
|
1669
|
+
skipValidation: true,
|
|
1670
|
+
breadcrumbsPrefix: ["response"],
|
|
1671
|
+
}), _response.rawResponse);
|
|
1437
1672
|
case 500:
|
|
1438
1673
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1439
1674
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1441,11 +1676,12 @@ class Companies {
|
|
|
1441
1676
|
allowUnrecognizedEnumValues: true,
|
|
1442
1677
|
skipValidation: true,
|
|
1443
1678
|
breadcrumbsPrefix: ["response"],
|
|
1444
|
-
}));
|
|
1679
|
+
}), _response.rawResponse);
|
|
1445
1680
|
default:
|
|
1446
1681
|
throw new errors.SchematicError({
|
|
1447
1682
|
statusCode: _response.error.statusCode,
|
|
1448
1683
|
body: _response.error.body,
|
|
1684
|
+
rawResponse: _response.rawResponse,
|
|
1449
1685
|
});
|
|
1450
1686
|
}
|
|
1451
1687
|
}
|
|
@@ -1454,12 +1690,14 @@ class Companies {
|
|
|
1454
1690
|
throw new errors.SchematicError({
|
|
1455
1691
|
statusCode: _response.error.statusCode,
|
|
1456
1692
|
body: _response.error.rawBody,
|
|
1693
|
+
rawResponse: _response.rawResponse,
|
|
1457
1694
|
});
|
|
1458
1695
|
case "timeout":
|
|
1459
1696
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /company-traits.");
|
|
1460
1697
|
case "unknown":
|
|
1461
1698
|
throw new errors.SchematicError({
|
|
1462
1699
|
message: _response.error.errorMessage,
|
|
1700
|
+
rawResponse: _response.rawResponse,
|
|
1463
1701
|
});
|
|
1464
1702
|
}
|
|
1465
1703
|
});
|
|
@@ -1471,12 +1709,16 @@ class Companies {
|
|
|
1471
1709
|
* @throws {@link Schematic.BadRequestError}
|
|
1472
1710
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1473
1711
|
* @throws {@link Schematic.ForbiddenError}
|
|
1712
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1474
1713
|
* @throws {@link Schematic.InternalServerError}
|
|
1475
1714
|
*
|
|
1476
1715
|
* @example
|
|
1477
1716
|
* await client.companies.listEntityKeyDefinitions()
|
|
1478
1717
|
*/
|
|
1479
|
-
listEntityKeyDefinitions() {
|
|
1718
|
+
listEntityKeyDefinitions(request = {}, requestOptions) {
|
|
1719
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntityKeyDefinitions(request, requestOptions));
|
|
1720
|
+
}
|
|
1721
|
+
__listEntityKeyDefinitions() {
|
|
1480
1722
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1481
1723
|
var _a, _b, _c;
|
|
1482
1724
|
const { entityType, ids, q, limit, offset } = request;
|
|
@@ -1504,7 +1746,7 @@ class Companies {
|
|
|
1504
1746
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1505
1747
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-key-definitions"),
|
|
1506
1748
|
method: "GET",
|
|
1507
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1749
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1508
1750
|
contentType: "application/json",
|
|
1509
1751
|
queryParameters: _queryParams,
|
|
1510
1752
|
requestType: "json",
|
|
@@ -1513,13 +1755,16 @@ class Companies {
|
|
|
1513
1755
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1514
1756
|
});
|
|
1515
1757
|
if (_response.ok) {
|
|
1516
|
-
return
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1758
|
+
return {
|
|
1759
|
+
data: serializers.ListEntityKeyDefinitionsResponse.parseOrThrow(_response.body, {
|
|
1760
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1761
|
+
allowUnrecognizedUnionMembers: true,
|
|
1762
|
+
allowUnrecognizedEnumValues: true,
|
|
1763
|
+
skipValidation: true,
|
|
1764
|
+
breadcrumbsPrefix: ["response"],
|
|
1765
|
+
}),
|
|
1766
|
+
rawResponse: _response.rawResponse,
|
|
1767
|
+
};
|
|
1523
1768
|
}
|
|
1524
1769
|
if (_response.error.reason === "status-code") {
|
|
1525
1770
|
switch (_response.error.statusCode) {
|
|
@@ -1530,7 +1775,7 @@ class Companies {
|
|
|
1530
1775
|
allowUnrecognizedEnumValues: true,
|
|
1531
1776
|
skipValidation: true,
|
|
1532
1777
|
breadcrumbsPrefix: ["response"],
|
|
1533
|
-
}));
|
|
1778
|
+
}), _response.rawResponse);
|
|
1534
1779
|
case 401:
|
|
1535
1780
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1536
1781
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1538,7 +1783,7 @@ class Companies {
|
|
|
1538
1783
|
allowUnrecognizedEnumValues: true,
|
|
1539
1784
|
skipValidation: true,
|
|
1540
1785
|
breadcrumbsPrefix: ["response"],
|
|
1541
|
-
}));
|
|
1786
|
+
}), _response.rawResponse);
|
|
1542
1787
|
case 403:
|
|
1543
1788
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1544
1789
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1546,7 +1791,15 @@ class Companies {
|
|
|
1546
1791
|
allowUnrecognizedEnumValues: true,
|
|
1547
1792
|
skipValidation: true,
|
|
1548
1793
|
breadcrumbsPrefix: ["response"],
|
|
1549
|
-
}));
|
|
1794
|
+
}), _response.rawResponse);
|
|
1795
|
+
case 404:
|
|
1796
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1797
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1798
|
+
allowUnrecognizedUnionMembers: true,
|
|
1799
|
+
allowUnrecognizedEnumValues: true,
|
|
1800
|
+
skipValidation: true,
|
|
1801
|
+
breadcrumbsPrefix: ["response"],
|
|
1802
|
+
}), _response.rawResponse);
|
|
1550
1803
|
case 500:
|
|
1551
1804
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1552
1805
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1554,11 +1807,12 @@ class Companies {
|
|
|
1554
1807
|
allowUnrecognizedEnumValues: true,
|
|
1555
1808
|
skipValidation: true,
|
|
1556
1809
|
breadcrumbsPrefix: ["response"],
|
|
1557
|
-
}));
|
|
1810
|
+
}), _response.rawResponse);
|
|
1558
1811
|
default:
|
|
1559
1812
|
throw new errors.SchematicError({
|
|
1560
1813
|
statusCode: _response.error.statusCode,
|
|
1561
1814
|
body: _response.error.body,
|
|
1815
|
+
rawResponse: _response.rawResponse,
|
|
1562
1816
|
});
|
|
1563
1817
|
}
|
|
1564
1818
|
}
|
|
@@ -1567,12 +1821,14 @@ class Companies {
|
|
|
1567
1821
|
throw new errors.SchematicError({
|
|
1568
1822
|
statusCode: _response.error.statusCode,
|
|
1569
1823
|
body: _response.error.rawBody,
|
|
1824
|
+
rawResponse: _response.rawResponse,
|
|
1570
1825
|
});
|
|
1571
1826
|
case "timeout":
|
|
1572
1827
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-key-definitions.");
|
|
1573
1828
|
case "unknown":
|
|
1574
1829
|
throw new errors.SchematicError({
|
|
1575
1830
|
message: _response.error.errorMessage,
|
|
1831
|
+
rawResponse: _response.rawResponse,
|
|
1576
1832
|
});
|
|
1577
1833
|
}
|
|
1578
1834
|
});
|
|
@@ -1584,12 +1840,16 @@ class Companies {
|
|
|
1584
1840
|
* @throws {@link Schematic.BadRequestError}
|
|
1585
1841
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1586
1842
|
* @throws {@link Schematic.ForbiddenError}
|
|
1843
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1587
1844
|
* @throws {@link Schematic.InternalServerError}
|
|
1588
1845
|
*
|
|
1589
1846
|
* @example
|
|
1590
1847
|
* await client.companies.countEntityKeyDefinitions()
|
|
1591
1848
|
*/
|
|
1592
|
-
countEntityKeyDefinitions() {
|
|
1849
|
+
countEntityKeyDefinitions(request = {}, requestOptions) {
|
|
1850
|
+
return core.HttpResponsePromise.fromPromise(this.__countEntityKeyDefinitions(request, requestOptions));
|
|
1851
|
+
}
|
|
1852
|
+
__countEntityKeyDefinitions() {
|
|
1593
1853
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1594
1854
|
var _a, _b, _c;
|
|
1595
1855
|
const { entityType, ids, q, limit, offset } = request;
|
|
@@ -1617,7 +1877,7 @@ class Companies {
|
|
|
1617
1877
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1618
1878
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-key-definitions/count"),
|
|
1619
1879
|
method: "GET",
|
|
1620
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
1880
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1621
1881
|
contentType: "application/json",
|
|
1622
1882
|
queryParameters: _queryParams,
|
|
1623
1883
|
requestType: "json",
|
|
@@ -1626,13 +1886,16 @@ class Companies {
|
|
|
1626
1886
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1627
1887
|
});
|
|
1628
1888
|
if (_response.ok) {
|
|
1629
|
-
return
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1889
|
+
return {
|
|
1890
|
+
data: serializers.CountEntityKeyDefinitionsResponse.parseOrThrow(_response.body, {
|
|
1891
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1892
|
+
allowUnrecognizedUnionMembers: true,
|
|
1893
|
+
allowUnrecognizedEnumValues: true,
|
|
1894
|
+
skipValidation: true,
|
|
1895
|
+
breadcrumbsPrefix: ["response"],
|
|
1896
|
+
}),
|
|
1897
|
+
rawResponse: _response.rawResponse,
|
|
1898
|
+
};
|
|
1636
1899
|
}
|
|
1637
1900
|
if (_response.error.reason === "status-code") {
|
|
1638
1901
|
switch (_response.error.statusCode) {
|
|
@@ -1643,7 +1906,7 @@ class Companies {
|
|
|
1643
1906
|
allowUnrecognizedEnumValues: true,
|
|
1644
1907
|
skipValidation: true,
|
|
1645
1908
|
breadcrumbsPrefix: ["response"],
|
|
1646
|
-
}));
|
|
1909
|
+
}), _response.rawResponse);
|
|
1647
1910
|
case 401:
|
|
1648
1911
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1649
1912
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1651,7 +1914,7 @@ class Companies {
|
|
|
1651
1914
|
allowUnrecognizedEnumValues: true,
|
|
1652
1915
|
skipValidation: true,
|
|
1653
1916
|
breadcrumbsPrefix: ["response"],
|
|
1654
|
-
}));
|
|
1917
|
+
}), _response.rawResponse);
|
|
1655
1918
|
case 403:
|
|
1656
1919
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1657
1920
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1659,7 +1922,15 @@ class Companies {
|
|
|
1659
1922
|
allowUnrecognizedEnumValues: true,
|
|
1660
1923
|
skipValidation: true,
|
|
1661
1924
|
breadcrumbsPrefix: ["response"],
|
|
1662
|
-
}));
|
|
1925
|
+
}), _response.rawResponse);
|
|
1926
|
+
case 404:
|
|
1927
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1928
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1929
|
+
allowUnrecognizedUnionMembers: true,
|
|
1930
|
+
allowUnrecognizedEnumValues: true,
|
|
1931
|
+
skipValidation: true,
|
|
1932
|
+
breadcrumbsPrefix: ["response"],
|
|
1933
|
+
}), _response.rawResponse);
|
|
1663
1934
|
case 500:
|
|
1664
1935
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1665
1936
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1667,11 +1938,12 @@ class Companies {
|
|
|
1667
1938
|
allowUnrecognizedEnumValues: true,
|
|
1668
1939
|
skipValidation: true,
|
|
1669
1940
|
breadcrumbsPrefix: ["response"],
|
|
1670
|
-
}));
|
|
1941
|
+
}), _response.rawResponse);
|
|
1671
1942
|
default:
|
|
1672
1943
|
throw new errors.SchematicError({
|
|
1673
1944
|
statusCode: _response.error.statusCode,
|
|
1674
1945
|
body: _response.error.body,
|
|
1946
|
+
rawResponse: _response.rawResponse,
|
|
1675
1947
|
});
|
|
1676
1948
|
}
|
|
1677
1949
|
}
|
|
@@ -1680,12 +1952,14 @@ class Companies {
|
|
|
1680
1952
|
throw new errors.SchematicError({
|
|
1681
1953
|
statusCode: _response.error.statusCode,
|
|
1682
1954
|
body: _response.error.rawBody,
|
|
1955
|
+
rawResponse: _response.rawResponse,
|
|
1683
1956
|
});
|
|
1684
1957
|
case "timeout":
|
|
1685
1958
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-key-definitions/count.");
|
|
1686
1959
|
case "unknown":
|
|
1687
1960
|
throw new errors.SchematicError({
|
|
1688
1961
|
message: _response.error.errorMessage,
|
|
1962
|
+
rawResponse: _response.rawResponse,
|
|
1689
1963
|
});
|
|
1690
1964
|
}
|
|
1691
1965
|
});
|
|
@@ -1697,12 +1971,16 @@ class Companies {
|
|
|
1697
1971
|
* @throws {@link Schematic.BadRequestError}
|
|
1698
1972
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1699
1973
|
* @throws {@link Schematic.ForbiddenError}
|
|
1974
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1700
1975
|
* @throws {@link Schematic.InternalServerError}
|
|
1701
1976
|
*
|
|
1702
1977
|
* @example
|
|
1703
1978
|
* await client.companies.listEntityTraitDefinitions()
|
|
1704
1979
|
*/
|
|
1705
|
-
listEntityTraitDefinitions() {
|
|
1980
|
+
listEntityTraitDefinitions(request = {}, requestOptions) {
|
|
1981
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntityTraitDefinitions(request, requestOptions));
|
|
1982
|
+
}
|
|
1983
|
+
__listEntityTraitDefinitions() {
|
|
1706
1984
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1707
1985
|
var _a, _b, _c;
|
|
1708
1986
|
const { entityType, ids, q, traitType, limit, offset } = request;
|
|
@@ -1735,7 +2013,7 @@ class Companies {
|
|
|
1735
2013
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1736
2014
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-trait-definitions"),
|
|
1737
2015
|
method: "GET",
|
|
1738
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2016
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1739
2017
|
contentType: "application/json",
|
|
1740
2018
|
queryParameters: _queryParams,
|
|
1741
2019
|
requestType: "json",
|
|
@@ -1744,13 +2022,16 @@ class Companies {
|
|
|
1744
2022
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1745
2023
|
});
|
|
1746
2024
|
if (_response.ok) {
|
|
1747
|
-
return
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
2025
|
+
return {
|
|
2026
|
+
data: serializers.ListEntityTraitDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2027
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2028
|
+
allowUnrecognizedUnionMembers: true,
|
|
2029
|
+
allowUnrecognizedEnumValues: true,
|
|
2030
|
+
skipValidation: true,
|
|
2031
|
+
breadcrumbsPrefix: ["response"],
|
|
2032
|
+
}),
|
|
2033
|
+
rawResponse: _response.rawResponse,
|
|
2034
|
+
};
|
|
1754
2035
|
}
|
|
1755
2036
|
if (_response.error.reason === "status-code") {
|
|
1756
2037
|
switch (_response.error.statusCode) {
|
|
@@ -1761,7 +2042,7 @@ class Companies {
|
|
|
1761
2042
|
allowUnrecognizedEnumValues: true,
|
|
1762
2043
|
skipValidation: true,
|
|
1763
2044
|
breadcrumbsPrefix: ["response"],
|
|
1764
|
-
}));
|
|
2045
|
+
}), _response.rawResponse);
|
|
1765
2046
|
case 401:
|
|
1766
2047
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1767
2048
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1769,7 +2050,7 @@ class Companies {
|
|
|
1769
2050
|
allowUnrecognizedEnumValues: true,
|
|
1770
2051
|
skipValidation: true,
|
|
1771
2052
|
breadcrumbsPrefix: ["response"],
|
|
1772
|
-
}));
|
|
2053
|
+
}), _response.rawResponse);
|
|
1773
2054
|
case 403:
|
|
1774
2055
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1775
2056
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1777,7 +2058,15 @@ class Companies {
|
|
|
1777
2058
|
allowUnrecognizedEnumValues: true,
|
|
1778
2059
|
skipValidation: true,
|
|
1779
2060
|
breadcrumbsPrefix: ["response"],
|
|
1780
|
-
}));
|
|
2061
|
+
}), _response.rawResponse);
|
|
2062
|
+
case 404:
|
|
2063
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2064
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2065
|
+
allowUnrecognizedUnionMembers: true,
|
|
2066
|
+
allowUnrecognizedEnumValues: true,
|
|
2067
|
+
skipValidation: true,
|
|
2068
|
+
breadcrumbsPrefix: ["response"],
|
|
2069
|
+
}), _response.rawResponse);
|
|
1781
2070
|
case 500:
|
|
1782
2071
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1783
2072
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1785,11 +2074,12 @@ class Companies {
|
|
|
1785
2074
|
allowUnrecognizedEnumValues: true,
|
|
1786
2075
|
skipValidation: true,
|
|
1787
2076
|
breadcrumbsPrefix: ["response"],
|
|
1788
|
-
}));
|
|
2077
|
+
}), _response.rawResponse);
|
|
1789
2078
|
default:
|
|
1790
2079
|
throw new errors.SchematicError({
|
|
1791
2080
|
statusCode: _response.error.statusCode,
|
|
1792
2081
|
body: _response.error.body,
|
|
2082
|
+
rawResponse: _response.rawResponse,
|
|
1793
2083
|
});
|
|
1794
2084
|
}
|
|
1795
2085
|
}
|
|
@@ -1798,12 +2088,14 @@ class Companies {
|
|
|
1798
2088
|
throw new errors.SchematicError({
|
|
1799
2089
|
statusCode: _response.error.statusCode,
|
|
1800
2090
|
body: _response.error.rawBody,
|
|
2091
|
+
rawResponse: _response.rawResponse,
|
|
1801
2092
|
});
|
|
1802
2093
|
case "timeout":
|
|
1803
2094
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions.");
|
|
1804
2095
|
case "unknown":
|
|
1805
2096
|
throw new errors.SchematicError({
|
|
1806
2097
|
message: _response.error.errorMessage,
|
|
2098
|
+
rawResponse: _response.rawResponse,
|
|
1807
2099
|
});
|
|
1808
2100
|
}
|
|
1809
2101
|
});
|
|
@@ -1815,6 +2107,7 @@ class Companies {
|
|
|
1815
2107
|
* @throws {@link Schematic.BadRequestError}
|
|
1816
2108
|
* @throws {@link Schematic.UnauthorizedError}
|
|
1817
2109
|
* @throws {@link Schematic.ForbiddenError}
|
|
2110
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1818
2111
|
* @throws {@link Schematic.InternalServerError}
|
|
1819
2112
|
*
|
|
1820
2113
|
* @example
|
|
@@ -1825,12 +2118,15 @@ class Companies {
|
|
|
1825
2118
|
* })
|
|
1826
2119
|
*/
|
|
1827
2120
|
getOrCreateEntityTraitDefinition(request, requestOptions) {
|
|
2121
|
+
return core.HttpResponsePromise.fromPromise(this.__getOrCreateEntityTraitDefinition(request, requestOptions));
|
|
2122
|
+
}
|
|
2123
|
+
__getOrCreateEntityTraitDefinition(request, requestOptions) {
|
|
1828
2124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1829
2125
|
var _a, _b, _c;
|
|
1830
2126
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1831
2127
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-trait-definitions"),
|
|
1832
2128
|
method: "POST",
|
|
1833
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2129
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1834
2130
|
contentType: "application/json",
|
|
1835
2131
|
requestType: "json",
|
|
1836
2132
|
body: serializers.CreateEntityTraitDefinitionRequestBody.jsonOrThrow(request, {
|
|
@@ -1841,13 +2137,16 @@ class Companies {
|
|
|
1841
2137
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1842
2138
|
});
|
|
1843
2139
|
if (_response.ok) {
|
|
1844
|
-
return
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
2140
|
+
return {
|
|
2141
|
+
data: serializers.GetOrCreateEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2142
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2143
|
+
allowUnrecognizedUnionMembers: true,
|
|
2144
|
+
allowUnrecognizedEnumValues: true,
|
|
2145
|
+
skipValidation: true,
|
|
2146
|
+
breadcrumbsPrefix: ["response"],
|
|
2147
|
+
}),
|
|
2148
|
+
rawResponse: _response.rawResponse,
|
|
2149
|
+
};
|
|
1851
2150
|
}
|
|
1852
2151
|
if (_response.error.reason === "status-code") {
|
|
1853
2152
|
switch (_response.error.statusCode) {
|
|
@@ -1858,7 +2157,7 @@ class Companies {
|
|
|
1858
2157
|
allowUnrecognizedEnumValues: true,
|
|
1859
2158
|
skipValidation: true,
|
|
1860
2159
|
breadcrumbsPrefix: ["response"],
|
|
1861
|
-
}));
|
|
2160
|
+
}), _response.rawResponse);
|
|
1862
2161
|
case 401:
|
|
1863
2162
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1864
2163
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1866,7 +2165,7 @@ class Companies {
|
|
|
1866
2165
|
allowUnrecognizedEnumValues: true,
|
|
1867
2166
|
skipValidation: true,
|
|
1868
2167
|
breadcrumbsPrefix: ["response"],
|
|
1869
|
-
}));
|
|
2168
|
+
}), _response.rawResponse);
|
|
1870
2169
|
case 403:
|
|
1871
2170
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1872
2171
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1874,7 +2173,15 @@ class Companies {
|
|
|
1874
2173
|
allowUnrecognizedEnumValues: true,
|
|
1875
2174
|
skipValidation: true,
|
|
1876
2175
|
breadcrumbsPrefix: ["response"],
|
|
1877
|
-
}));
|
|
2176
|
+
}), _response.rawResponse);
|
|
2177
|
+
case 404:
|
|
2178
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2179
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2180
|
+
allowUnrecognizedUnionMembers: true,
|
|
2181
|
+
allowUnrecognizedEnumValues: true,
|
|
2182
|
+
skipValidation: true,
|
|
2183
|
+
breadcrumbsPrefix: ["response"],
|
|
2184
|
+
}), _response.rawResponse);
|
|
1878
2185
|
case 500:
|
|
1879
2186
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1880
2187
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1882,11 +2189,12 @@ class Companies {
|
|
|
1882
2189
|
allowUnrecognizedEnumValues: true,
|
|
1883
2190
|
skipValidation: true,
|
|
1884
2191
|
breadcrumbsPrefix: ["response"],
|
|
1885
|
-
}));
|
|
2192
|
+
}), _response.rawResponse);
|
|
1886
2193
|
default:
|
|
1887
2194
|
throw new errors.SchematicError({
|
|
1888
2195
|
statusCode: _response.error.statusCode,
|
|
1889
2196
|
body: _response.error.body,
|
|
2197
|
+
rawResponse: _response.rawResponse,
|
|
1890
2198
|
});
|
|
1891
2199
|
}
|
|
1892
2200
|
}
|
|
@@ -1895,12 +2203,14 @@ class Companies {
|
|
|
1895
2203
|
throw new errors.SchematicError({
|
|
1896
2204
|
statusCode: _response.error.statusCode,
|
|
1897
2205
|
body: _response.error.rawBody,
|
|
2206
|
+
rawResponse: _response.rawResponse,
|
|
1898
2207
|
});
|
|
1899
2208
|
case "timeout":
|
|
1900
2209
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /entity-trait-definitions.");
|
|
1901
2210
|
case "unknown":
|
|
1902
2211
|
throw new errors.SchematicError({
|
|
1903
2212
|
message: _response.error.errorMessage,
|
|
2213
|
+
rawResponse: _response.rawResponse,
|
|
1904
2214
|
});
|
|
1905
2215
|
}
|
|
1906
2216
|
});
|
|
@@ -1918,12 +2228,15 @@ class Companies {
|
|
|
1918
2228
|
* await client.companies.getEntityTraitDefinition("entity_trait_definition_id")
|
|
1919
2229
|
*/
|
|
1920
2230
|
getEntityTraitDefinition(entityTraitDefinitionId, requestOptions) {
|
|
2231
|
+
return core.HttpResponsePromise.fromPromise(this.__getEntityTraitDefinition(entityTraitDefinitionId, requestOptions));
|
|
2232
|
+
}
|
|
2233
|
+
__getEntityTraitDefinition(entityTraitDefinitionId, requestOptions) {
|
|
1921
2234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1922
2235
|
var _a, _b, _c;
|
|
1923
2236
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1924
2237
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `entity-trait-definitions/${encodeURIComponent(entityTraitDefinitionId)}`),
|
|
1925
2238
|
method: "GET",
|
|
1926
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2239
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1927
2240
|
contentType: "application/json",
|
|
1928
2241
|
requestType: "json",
|
|
1929
2242
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -1931,13 +2244,16 @@ class Companies {
|
|
|
1931
2244
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1932
2245
|
});
|
|
1933
2246
|
if (_response.ok) {
|
|
1934
|
-
return
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2247
|
+
return {
|
|
2248
|
+
data: serializers.GetEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2249
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2250
|
+
allowUnrecognizedUnionMembers: true,
|
|
2251
|
+
allowUnrecognizedEnumValues: true,
|
|
2252
|
+
skipValidation: true,
|
|
2253
|
+
breadcrumbsPrefix: ["response"],
|
|
2254
|
+
}),
|
|
2255
|
+
rawResponse: _response.rawResponse,
|
|
2256
|
+
};
|
|
1941
2257
|
}
|
|
1942
2258
|
if (_response.error.reason === "status-code") {
|
|
1943
2259
|
switch (_response.error.statusCode) {
|
|
@@ -1948,7 +2264,7 @@ class Companies {
|
|
|
1948
2264
|
allowUnrecognizedEnumValues: true,
|
|
1949
2265
|
skipValidation: true,
|
|
1950
2266
|
breadcrumbsPrefix: ["response"],
|
|
1951
|
-
}));
|
|
2267
|
+
}), _response.rawResponse);
|
|
1952
2268
|
case 403:
|
|
1953
2269
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1954
2270
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1956,7 +2272,7 @@ class Companies {
|
|
|
1956
2272
|
allowUnrecognizedEnumValues: true,
|
|
1957
2273
|
skipValidation: true,
|
|
1958
2274
|
breadcrumbsPrefix: ["response"],
|
|
1959
|
-
}));
|
|
2275
|
+
}), _response.rawResponse);
|
|
1960
2276
|
case 404:
|
|
1961
2277
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1962
2278
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1964,7 +2280,7 @@ class Companies {
|
|
|
1964
2280
|
allowUnrecognizedEnumValues: true,
|
|
1965
2281
|
skipValidation: true,
|
|
1966
2282
|
breadcrumbsPrefix: ["response"],
|
|
1967
|
-
}));
|
|
2283
|
+
}), _response.rawResponse);
|
|
1968
2284
|
case 500:
|
|
1969
2285
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1970
2286
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -1972,11 +2288,12 @@ class Companies {
|
|
|
1972
2288
|
allowUnrecognizedEnumValues: true,
|
|
1973
2289
|
skipValidation: true,
|
|
1974
2290
|
breadcrumbsPrefix: ["response"],
|
|
1975
|
-
}));
|
|
2291
|
+
}), _response.rawResponse);
|
|
1976
2292
|
default:
|
|
1977
2293
|
throw new errors.SchematicError({
|
|
1978
2294
|
statusCode: _response.error.statusCode,
|
|
1979
2295
|
body: _response.error.body,
|
|
2296
|
+
rawResponse: _response.rawResponse,
|
|
1980
2297
|
});
|
|
1981
2298
|
}
|
|
1982
2299
|
}
|
|
@@ -1985,12 +2302,14 @@ class Companies {
|
|
|
1985
2302
|
throw new errors.SchematicError({
|
|
1986
2303
|
statusCode: _response.error.statusCode,
|
|
1987
2304
|
body: _response.error.rawBody,
|
|
2305
|
+
rawResponse: _response.rawResponse,
|
|
1988
2306
|
});
|
|
1989
2307
|
case "timeout":
|
|
1990
2308
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions/{entity_trait_definition_id}.");
|
|
1991
2309
|
case "unknown":
|
|
1992
2310
|
throw new errors.SchematicError({
|
|
1993
2311
|
message: _response.error.errorMessage,
|
|
2312
|
+
rawResponse: _response.rawResponse,
|
|
1994
2313
|
});
|
|
1995
2314
|
}
|
|
1996
2315
|
});
|
|
@@ -2012,12 +2331,15 @@ class Companies {
|
|
|
2012
2331
|
* })
|
|
2013
2332
|
*/
|
|
2014
2333
|
updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions) {
|
|
2334
|
+
return core.HttpResponsePromise.fromPromise(this.__updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions));
|
|
2335
|
+
}
|
|
2336
|
+
__updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions) {
|
|
2015
2337
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2016
2338
|
var _a, _b, _c;
|
|
2017
2339
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2018
2340
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `entity-trait-definitions/${encodeURIComponent(entityTraitDefinitionId)}`),
|
|
2019
2341
|
method: "PUT",
|
|
2020
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2342
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2021
2343
|
contentType: "application/json",
|
|
2022
2344
|
requestType: "json",
|
|
2023
2345
|
body: serializers.UpdateEntityTraitDefinitionRequestBody.jsonOrThrow(request, {
|
|
@@ -2028,13 +2350,16 @@ class Companies {
|
|
|
2028
2350
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2029
2351
|
});
|
|
2030
2352
|
if (_response.ok) {
|
|
2031
|
-
return
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2353
|
+
return {
|
|
2354
|
+
data: serializers.UpdateEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2355
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2356
|
+
allowUnrecognizedUnionMembers: true,
|
|
2357
|
+
allowUnrecognizedEnumValues: true,
|
|
2358
|
+
skipValidation: true,
|
|
2359
|
+
breadcrumbsPrefix: ["response"],
|
|
2360
|
+
}),
|
|
2361
|
+
rawResponse: _response.rawResponse,
|
|
2362
|
+
};
|
|
2038
2363
|
}
|
|
2039
2364
|
if (_response.error.reason === "status-code") {
|
|
2040
2365
|
switch (_response.error.statusCode) {
|
|
@@ -2045,7 +2370,7 @@ class Companies {
|
|
|
2045
2370
|
allowUnrecognizedEnumValues: true,
|
|
2046
2371
|
skipValidation: true,
|
|
2047
2372
|
breadcrumbsPrefix: ["response"],
|
|
2048
|
-
}));
|
|
2373
|
+
}), _response.rawResponse);
|
|
2049
2374
|
case 401:
|
|
2050
2375
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2051
2376
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2053,7 +2378,7 @@ class Companies {
|
|
|
2053
2378
|
allowUnrecognizedEnumValues: true,
|
|
2054
2379
|
skipValidation: true,
|
|
2055
2380
|
breadcrumbsPrefix: ["response"],
|
|
2056
|
-
}));
|
|
2381
|
+
}), _response.rawResponse);
|
|
2057
2382
|
case 403:
|
|
2058
2383
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2059
2384
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2061,7 +2386,7 @@ class Companies {
|
|
|
2061
2386
|
allowUnrecognizedEnumValues: true,
|
|
2062
2387
|
skipValidation: true,
|
|
2063
2388
|
breadcrumbsPrefix: ["response"],
|
|
2064
|
-
}));
|
|
2389
|
+
}), _response.rawResponse);
|
|
2065
2390
|
case 404:
|
|
2066
2391
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2067
2392
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2069,7 +2394,7 @@ class Companies {
|
|
|
2069
2394
|
allowUnrecognizedEnumValues: true,
|
|
2070
2395
|
skipValidation: true,
|
|
2071
2396
|
breadcrumbsPrefix: ["response"],
|
|
2072
|
-
}));
|
|
2397
|
+
}), _response.rawResponse);
|
|
2073
2398
|
case 500:
|
|
2074
2399
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2075
2400
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2077,11 +2402,12 @@ class Companies {
|
|
|
2077
2402
|
allowUnrecognizedEnumValues: true,
|
|
2078
2403
|
skipValidation: true,
|
|
2079
2404
|
breadcrumbsPrefix: ["response"],
|
|
2080
|
-
}));
|
|
2405
|
+
}), _response.rawResponse);
|
|
2081
2406
|
default:
|
|
2082
2407
|
throw new errors.SchematicError({
|
|
2083
2408
|
statusCode: _response.error.statusCode,
|
|
2084
2409
|
body: _response.error.body,
|
|
2410
|
+
rawResponse: _response.rawResponse,
|
|
2085
2411
|
});
|
|
2086
2412
|
}
|
|
2087
2413
|
}
|
|
@@ -2090,12 +2416,14 @@ class Companies {
|
|
|
2090
2416
|
throw new errors.SchematicError({
|
|
2091
2417
|
statusCode: _response.error.statusCode,
|
|
2092
2418
|
body: _response.error.rawBody,
|
|
2419
|
+
rawResponse: _response.rawResponse,
|
|
2093
2420
|
});
|
|
2094
2421
|
case "timeout":
|
|
2095
2422
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling PUT /entity-trait-definitions/{entity_trait_definition_id}.");
|
|
2096
2423
|
case "unknown":
|
|
2097
2424
|
throw new errors.SchematicError({
|
|
2098
2425
|
message: _response.error.errorMessage,
|
|
2426
|
+
rawResponse: _response.rawResponse,
|
|
2099
2427
|
});
|
|
2100
2428
|
}
|
|
2101
2429
|
});
|
|
@@ -2107,12 +2435,16 @@ class Companies {
|
|
|
2107
2435
|
* @throws {@link Schematic.BadRequestError}
|
|
2108
2436
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2109
2437
|
* @throws {@link Schematic.ForbiddenError}
|
|
2438
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2110
2439
|
* @throws {@link Schematic.InternalServerError}
|
|
2111
2440
|
*
|
|
2112
2441
|
* @example
|
|
2113
2442
|
* await client.companies.countEntityTraitDefinitions()
|
|
2114
2443
|
*/
|
|
2115
|
-
countEntityTraitDefinitions() {
|
|
2444
|
+
countEntityTraitDefinitions(request = {}, requestOptions) {
|
|
2445
|
+
return core.HttpResponsePromise.fromPromise(this.__countEntityTraitDefinitions(request, requestOptions));
|
|
2446
|
+
}
|
|
2447
|
+
__countEntityTraitDefinitions() {
|
|
2116
2448
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2117
2449
|
var _a, _b, _c;
|
|
2118
2450
|
const { entityType, ids, q, traitType, limit, offset } = request;
|
|
@@ -2143,7 +2475,7 @@ class Companies {
|
|
|
2143
2475
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2144
2476
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-trait-definitions/count"),
|
|
2145
2477
|
method: "GET",
|
|
2146
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2478
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2147
2479
|
contentType: "application/json",
|
|
2148
2480
|
queryParameters: _queryParams,
|
|
2149
2481
|
requestType: "json",
|
|
@@ -2152,13 +2484,16 @@ class Companies {
|
|
|
2152
2484
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2153
2485
|
});
|
|
2154
2486
|
if (_response.ok) {
|
|
2155
|
-
return
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2487
|
+
return {
|
|
2488
|
+
data: serializers.CountEntityTraitDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2489
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2490
|
+
allowUnrecognizedUnionMembers: true,
|
|
2491
|
+
allowUnrecognizedEnumValues: true,
|
|
2492
|
+
skipValidation: true,
|
|
2493
|
+
breadcrumbsPrefix: ["response"],
|
|
2494
|
+
}),
|
|
2495
|
+
rawResponse: _response.rawResponse,
|
|
2496
|
+
};
|
|
2162
2497
|
}
|
|
2163
2498
|
if (_response.error.reason === "status-code") {
|
|
2164
2499
|
switch (_response.error.statusCode) {
|
|
@@ -2169,7 +2504,7 @@ class Companies {
|
|
|
2169
2504
|
allowUnrecognizedEnumValues: true,
|
|
2170
2505
|
skipValidation: true,
|
|
2171
2506
|
breadcrumbsPrefix: ["response"],
|
|
2172
|
-
}));
|
|
2507
|
+
}), _response.rawResponse);
|
|
2173
2508
|
case 401:
|
|
2174
2509
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2175
2510
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2177,7 +2512,7 @@ class Companies {
|
|
|
2177
2512
|
allowUnrecognizedEnumValues: true,
|
|
2178
2513
|
skipValidation: true,
|
|
2179
2514
|
breadcrumbsPrefix: ["response"],
|
|
2180
|
-
}));
|
|
2515
|
+
}), _response.rawResponse);
|
|
2181
2516
|
case 403:
|
|
2182
2517
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2183
2518
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2185,7 +2520,15 @@ class Companies {
|
|
|
2185
2520
|
allowUnrecognizedEnumValues: true,
|
|
2186
2521
|
skipValidation: true,
|
|
2187
2522
|
breadcrumbsPrefix: ["response"],
|
|
2188
|
-
}));
|
|
2523
|
+
}), _response.rawResponse);
|
|
2524
|
+
case 404:
|
|
2525
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2526
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2527
|
+
allowUnrecognizedUnionMembers: true,
|
|
2528
|
+
allowUnrecognizedEnumValues: true,
|
|
2529
|
+
skipValidation: true,
|
|
2530
|
+
breadcrumbsPrefix: ["response"],
|
|
2531
|
+
}), _response.rawResponse);
|
|
2189
2532
|
case 500:
|
|
2190
2533
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2191
2534
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2193,11 +2536,12 @@ class Companies {
|
|
|
2193
2536
|
allowUnrecognizedEnumValues: true,
|
|
2194
2537
|
skipValidation: true,
|
|
2195
2538
|
breadcrumbsPrefix: ["response"],
|
|
2196
|
-
}));
|
|
2539
|
+
}), _response.rawResponse);
|
|
2197
2540
|
default:
|
|
2198
2541
|
throw new errors.SchematicError({
|
|
2199
2542
|
statusCode: _response.error.statusCode,
|
|
2200
2543
|
body: _response.error.body,
|
|
2544
|
+
rawResponse: _response.rawResponse,
|
|
2201
2545
|
});
|
|
2202
2546
|
}
|
|
2203
2547
|
}
|
|
@@ -2206,12 +2550,14 @@ class Companies {
|
|
|
2206
2550
|
throw new errors.SchematicError({
|
|
2207
2551
|
statusCode: _response.error.statusCode,
|
|
2208
2552
|
body: _response.error.rawBody,
|
|
2553
|
+
rawResponse: _response.rawResponse,
|
|
2209
2554
|
});
|
|
2210
2555
|
case "timeout":
|
|
2211
2556
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions/count.");
|
|
2212
2557
|
case "unknown":
|
|
2213
2558
|
throw new errors.SchematicError({
|
|
2214
2559
|
message: _response.error.errorMessage,
|
|
2560
|
+
rawResponse: _response.rawResponse,
|
|
2215
2561
|
});
|
|
2216
2562
|
}
|
|
2217
2563
|
});
|
|
@@ -2223,6 +2569,7 @@ class Companies {
|
|
|
2223
2569
|
* @throws {@link Schematic.BadRequestError}
|
|
2224
2570
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2225
2571
|
* @throws {@link Schematic.ForbiddenError}
|
|
2572
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2226
2573
|
* @throws {@link Schematic.InternalServerError}
|
|
2227
2574
|
*
|
|
2228
2575
|
* @example
|
|
@@ -2231,6 +2578,9 @@ class Companies {
|
|
|
2231
2578
|
* })
|
|
2232
2579
|
*/
|
|
2233
2580
|
getEntityTraitValues(request, requestOptions) {
|
|
2581
|
+
return core.HttpResponsePromise.fromPromise(this.__getEntityTraitValues(request, requestOptions));
|
|
2582
|
+
}
|
|
2583
|
+
__getEntityTraitValues(request, requestOptions) {
|
|
2234
2584
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2235
2585
|
var _a, _b, _c;
|
|
2236
2586
|
const { definitionId, q, limit, offset } = request;
|
|
@@ -2248,7 +2598,7 @@ class Companies {
|
|
|
2248
2598
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2249
2599
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "entity-trait-values"),
|
|
2250
2600
|
method: "GET",
|
|
2251
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2601
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2252
2602
|
contentType: "application/json",
|
|
2253
2603
|
queryParameters: _queryParams,
|
|
2254
2604
|
requestType: "json",
|
|
@@ -2257,13 +2607,16 @@ class Companies {
|
|
|
2257
2607
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2258
2608
|
});
|
|
2259
2609
|
if (_response.ok) {
|
|
2260
|
-
return
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2610
|
+
return {
|
|
2611
|
+
data: serializers.GetEntityTraitValuesResponse.parseOrThrow(_response.body, {
|
|
2612
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2613
|
+
allowUnrecognizedUnionMembers: true,
|
|
2614
|
+
allowUnrecognizedEnumValues: true,
|
|
2615
|
+
skipValidation: true,
|
|
2616
|
+
breadcrumbsPrefix: ["response"],
|
|
2617
|
+
}),
|
|
2618
|
+
rawResponse: _response.rawResponse,
|
|
2619
|
+
};
|
|
2267
2620
|
}
|
|
2268
2621
|
if (_response.error.reason === "status-code") {
|
|
2269
2622
|
switch (_response.error.statusCode) {
|
|
@@ -2274,7 +2627,7 @@ class Companies {
|
|
|
2274
2627
|
allowUnrecognizedEnumValues: true,
|
|
2275
2628
|
skipValidation: true,
|
|
2276
2629
|
breadcrumbsPrefix: ["response"],
|
|
2277
|
-
}));
|
|
2630
|
+
}), _response.rawResponse);
|
|
2278
2631
|
case 401:
|
|
2279
2632
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2280
2633
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2282,7 +2635,7 @@ class Companies {
|
|
|
2282
2635
|
allowUnrecognizedEnumValues: true,
|
|
2283
2636
|
skipValidation: true,
|
|
2284
2637
|
breadcrumbsPrefix: ["response"],
|
|
2285
|
-
}));
|
|
2638
|
+
}), _response.rawResponse);
|
|
2286
2639
|
case 403:
|
|
2287
2640
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2288
2641
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2290,7 +2643,15 @@ class Companies {
|
|
|
2290
2643
|
allowUnrecognizedEnumValues: true,
|
|
2291
2644
|
skipValidation: true,
|
|
2292
2645
|
breadcrumbsPrefix: ["response"],
|
|
2293
|
-
}));
|
|
2646
|
+
}), _response.rawResponse);
|
|
2647
|
+
case 404:
|
|
2648
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2649
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2650
|
+
allowUnrecognizedUnionMembers: true,
|
|
2651
|
+
allowUnrecognizedEnumValues: true,
|
|
2652
|
+
skipValidation: true,
|
|
2653
|
+
breadcrumbsPrefix: ["response"],
|
|
2654
|
+
}), _response.rawResponse);
|
|
2294
2655
|
case 500:
|
|
2295
2656
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2296
2657
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2298,11 +2659,12 @@ class Companies {
|
|
|
2298
2659
|
allowUnrecognizedEnumValues: true,
|
|
2299
2660
|
skipValidation: true,
|
|
2300
2661
|
breadcrumbsPrefix: ["response"],
|
|
2301
|
-
}));
|
|
2662
|
+
}), _response.rawResponse);
|
|
2302
2663
|
default:
|
|
2303
2664
|
throw new errors.SchematicError({
|
|
2304
2665
|
statusCode: _response.error.statusCode,
|
|
2305
2666
|
body: _response.error.body,
|
|
2667
|
+
rawResponse: _response.rawResponse,
|
|
2306
2668
|
});
|
|
2307
2669
|
}
|
|
2308
2670
|
}
|
|
@@ -2311,12 +2673,14 @@ class Companies {
|
|
|
2311
2673
|
throw new errors.SchematicError({
|
|
2312
2674
|
statusCode: _response.error.statusCode,
|
|
2313
2675
|
body: _response.error.rawBody,
|
|
2676
|
+
rawResponse: _response.rawResponse,
|
|
2314
2677
|
});
|
|
2315
2678
|
case "timeout":
|
|
2316
2679
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-values.");
|
|
2317
2680
|
case "unknown":
|
|
2318
2681
|
throw new errors.SchematicError({
|
|
2319
2682
|
message: _response.error.errorMessage,
|
|
2683
|
+
rawResponse: _response.rawResponse,
|
|
2320
2684
|
});
|
|
2321
2685
|
}
|
|
2322
2686
|
});
|
|
@@ -2328,6 +2692,7 @@ class Companies {
|
|
|
2328
2692
|
* @throws {@link Schematic.BadRequestError}
|
|
2329
2693
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2330
2694
|
* @throws {@link Schematic.ForbiddenError}
|
|
2695
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2331
2696
|
* @throws {@link Schematic.InternalServerError}
|
|
2332
2697
|
*
|
|
2333
2698
|
* @example
|
|
@@ -2339,12 +2704,15 @@ class Companies {
|
|
|
2339
2704
|
* })
|
|
2340
2705
|
*/
|
|
2341
2706
|
upsertUserTrait(request, requestOptions) {
|
|
2707
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertUserTrait(request, requestOptions));
|
|
2708
|
+
}
|
|
2709
|
+
__upsertUserTrait(request, requestOptions) {
|
|
2342
2710
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2343
2711
|
var _a, _b, _c;
|
|
2344
2712
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2345
2713
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "user-traits"),
|
|
2346
2714
|
method: "POST",
|
|
2347
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2715
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2348
2716
|
contentType: "application/json",
|
|
2349
2717
|
requestType: "json",
|
|
2350
2718
|
body: serializers.UpsertTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2353,13 +2721,16 @@ class Companies {
|
|
|
2353
2721
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2354
2722
|
});
|
|
2355
2723
|
if (_response.ok) {
|
|
2356
|
-
return
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2724
|
+
return {
|
|
2725
|
+
data: serializers.UpsertUserTraitResponse.parseOrThrow(_response.body, {
|
|
2726
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2727
|
+
allowUnrecognizedUnionMembers: true,
|
|
2728
|
+
allowUnrecognizedEnumValues: true,
|
|
2729
|
+
skipValidation: true,
|
|
2730
|
+
breadcrumbsPrefix: ["response"],
|
|
2731
|
+
}),
|
|
2732
|
+
rawResponse: _response.rawResponse,
|
|
2733
|
+
};
|
|
2363
2734
|
}
|
|
2364
2735
|
if (_response.error.reason === "status-code") {
|
|
2365
2736
|
switch (_response.error.statusCode) {
|
|
@@ -2370,7 +2741,7 @@ class Companies {
|
|
|
2370
2741
|
allowUnrecognizedEnumValues: true,
|
|
2371
2742
|
skipValidation: true,
|
|
2372
2743
|
breadcrumbsPrefix: ["response"],
|
|
2373
|
-
}));
|
|
2744
|
+
}), _response.rawResponse);
|
|
2374
2745
|
case 401:
|
|
2375
2746
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2376
2747
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2378,7 +2749,7 @@ class Companies {
|
|
|
2378
2749
|
allowUnrecognizedEnumValues: true,
|
|
2379
2750
|
skipValidation: true,
|
|
2380
2751
|
breadcrumbsPrefix: ["response"],
|
|
2381
|
-
}));
|
|
2752
|
+
}), _response.rawResponse);
|
|
2382
2753
|
case 403:
|
|
2383
2754
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2384
2755
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2386,7 +2757,15 @@ class Companies {
|
|
|
2386
2757
|
allowUnrecognizedEnumValues: true,
|
|
2387
2758
|
skipValidation: true,
|
|
2388
2759
|
breadcrumbsPrefix: ["response"],
|
|
2389
|
-
}));
|
|
2760
|
+
}), _response.rawResponse);
|
|
2761
|
+
case 404:
|
|
2762
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2763
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2764
|
+
allowUnrecognizedUnionMembers: true,
|
|
2765
|
+
allowUnrecognizedEnumValues: true,
|
|
2766
|
+
skipValidation: true,
|
|
2767
|
+
breadcrumbsPrefix: ["response"],
|
|
2768
|
+
}), _response.rawResponse);
|
|
2390
2769
|
case 500:
|
|
2391
2770
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2392
2771
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2394,11 +2773,12 @@ class Companies {
|
|
|
2394
2773
|
allowUnrecognizedEnumValues: true,
|
|
2395
2774
|
skipValidation: true,
|
|
2396
2775
|
breadcrumbsPrefix: ["response"],
|
|
2397
|
-
}));
|
|
2776
|
+
}), _response.rawResponse);
|
|
2398
2777
|
default:
|
|
2399
2778
|
throw new errors.SchematicError({
|
|
2400
2779
|
statusCode: _response.error.statusCode,
|
|
2401
2780
|
body: _response.error.body,
|
|
2781
|
+
rawResponse: _response.rawResponse,
|
|
2402
2782
|
});
|
|
2403
2783
|
}
|
|
2404
2784
|
}
|
|
@@ -2407,12 +2787,14 @@ class Companies {
|
|
|
2407
2787
|
throw new errors.SchematicError({
|
|
2408
2788
|
statusCode: _response.error.statusCode,
|
|
2409
2789
|
body: _response.error.rawBody,
|
|
2790
|
+
rawResponse: _response.rawResponse,
|
|
2410
2791
|
});
|
|
2411
2792
|
case "timeout":
|
|
2412
2793
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /user-traits.");
|
|
2413
2794
|
case "unknown":
|
|
2414
2795
|
throw new errors.SchematicError({
|
|
2415
2796
|
message: _response.error.errorMessage,
|
|
2797
|
+
rawResponse: _response.rawResponse,
|
|
2416
2798
|
});
|
|
2417
2799
|
}
|
|
2418
2800
|
});
|
|
@@ -2424,12 +2806,16 @@ class Companies {
|
|
|
2424
2806
|
* @throws {@link Schematic.BadRequestError}
|
|
2425
2807
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2426
2808
|
* @throws {@link Schematic.ForbiddenError}
|
|
2809
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2427
2810
|
* @throws {@link Schematic.InternalServerError}
|
|
2428
2811
|
*
|
|
2429
2812
|
* @example
|
|
2430
2813
|
* await client.companies.listUsers()
|
|
2431
2814
|
*/
|
|
2432
|
-
listUsers() {
|
|
2815
|
+
listUsers(request = {}, requestOptions) {
|
|
2816
|
+
return core.HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions));
|
|
2817
|
+
}
|
|
2818
|
+
__listUsers() {
|
|
2433
2819
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2434
2820
|
var _a, _b, _c;
|
|
2435
2821
|
const { companyId, ids, planId, q, limit, offset } = request;
|
|
@@ -2460,7 +2846,7 @@ class Companies {
|
|
|
2460
2846
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2461
2847
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users"),
|
|
2462
2848
|
method: "GET",
|
|
2463
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2849
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2464
2850
|
contentType: "application/json",
|
|
2465
2851
|
queryParameters: _queryParams,
|
|
2466
2852
|
requestType: "json",
|
|
@@ -2469,13 +2855,16 @@ class Companies {
|
|
|
2469
2855
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2470
2856
|
});
|
|
2471
2857
|
if (_response.ok) {
|
|
2472
|
-
return
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2858
|
+
return {
|
|
2859
|
+
data: serializers.ListUsersResponse.parseOrThrow(_response.body, {
|
|
2860
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2861
|
+
allowUnrecognizedUnionMembers: true,
|
|
2862
|
+
allowUnrecognizedEnumValues: true,
|
|
2863
|
+
skipValidation: true,
|
|
2864
|
+
breadcrumbsPrefix: ["response"],
|
|
2865
|
+
}),
|
|
2866
|
+
rawResponse: _response.rawResponse,
|
|
2867
|
+
};
|
|
2479
2868
|
}
|
|
2480
2869
|
if (_response.error.reason === "status-code") {
|
|
2481
2870
|
switch (_response.error.statusCode) {
|
|
@@ -2486,7 +2875,7 @@ class Companies {
|
|
|
2486
2875
|
allowUnrecognizedEnumValues: true,
|
|
2487
2876
|
skipValidation: true,
|
|
2488
2877
|
breadcrumbsPrefix: ["response"],
|
|
2489
|
-
}));
|
|
2878
|
+
}), _response.rawResponse);
|
|
2490
2879
|
case 401:
|
|
2491
2880
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2492
2881
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2494,7 +2883,7 @@ class Companies {
|
|
|
2494
2883
|
allowUnrecognizedEnumValues: true,
|
|
2495
2884
|
skipValidation: true,
|
|
2496
2885
|
breadcrumbsPrefix: ["response"],
|
|
2497
|
-
}));
|
|
2886
|
+
}), _response.rawResponse);
|
|
2498
2887
|
case 403:
|
|
2499
2888
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2500
2889
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2502,7 +2891,15 @@ class Companies {
|
|
|
2502
2891
|
allowUnrecognizedEnumValues: true,
|
|
2503
2892
|
skipValidation: true,
|
|
2504
2893
|
breadcrumbsPrefix: ["response"],
|
|
2505
|
-
}));
|
|
2894
|
+
}), _response.rawResponse);
|
|
2895
|
+
case 404:
|
|
2896
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2897
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2898
|
+
allowUnrecognizedUnionMembers: true,
|
|
2899
|
+
allowUnrecognizedEnumValues: true,
|
|
2900
|
+
skipValidation: true,
|
|
2901
|
+
breadcrumbsPrefix: ["response"],
|
|
2902
|
+
}), _response.rawResponse);
|
|
2506
2903
|
case 500:
|
|
2507
2904
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2508
2905
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2510,11 +2907,12 @@ class Companies {
|
|
|
2510
2907
|
allowUnrecognizedEnumValues: true,
|
|
2511
2908
|
skipValidation: true,
|
|
2512
2909
|
breadcrumbsPrefix: ["response"],
|
|
2513
|
-
}));
|
|
2910
|
+
}), _response.rawResponse);
|
|
2514
2911
|
default:
|
|
2515
2912
|
throw new errors.SchematicError({
|
|
2516
2913
|
statusCode: _response.error.statusCode,
|
|
2517
2914
|
body: _response.error.body,
|
|
2915
|
+
rawResponse: _response.rawResponse,
|
|
2518
2916
|
});
|
|
2519
2917
|
}
|
|
2520
2918
|
}
|
|
@@ -2523,12 +2921,14 @@ class Companies {
|
|
|
2523
2921
|
throw new errors.SchematicError({
|
|
2524
2922
|
statusCode: _response.error.statusCode,
|
|
2525
2923
|
body: _response.error.rawBody,
|
|
2924
|
+
rawResponse: _response.rawResponse,
|
|
2526
2925
|
});
|
|
2527
2926
|
case "timeout":
|
|
2528
2927
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users.");
|
|
2529
2928
|
case "unknown":
|
|
2530
2929
|
throw new errors.SchematicError({
|
|
2531
2930
|
message: _response.error.errorMessage,
|
|
2931
|
+
rawResponse: _response.rawResponse,
|
|
2532
2932
|
});
|
|
2533
2933
|
}
|
|
2534
2934
|
});
|
|
@@ -2540,10 +2940,14 @@ class Companies {
|
|
|
2540
2940
|
* @throws {@link Schematic.BadRequestError}
|
|
2541
2941
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2542
2942
|
* @throws {@link Schematic.ForbiddenError}
|
|
2943
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2543
2944
|
* @throws {@link Schematic.InternalServerError}
|
|
2544
2945
|
*
|
|
2545
2946
|
* @example
|
|
2546
2947
|
* await client.companies.upsertUser({
|
|
2948
|
+
* companies: [{
|
|
2949
|
+
* "key": "value"
|
|
2950
|
+
* }],
|
|
2547
2951
|
* company: {
|
|
2548
2952
|
* "key": "value"
|
|
2549
2953
|
* },
|
|
@@ -2553,12 +2957,15 @@ class Companies {
|
|
|
2553
2957
|
* })
|
|
2554
2958
|
*/
|
|
2555
2959
|
upsertUser(request, requestOptions) {
|
|
2960
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertUser(request, requestOptions));
|
|
2961
|
+
}
|
|
2962
|
+
__upsertUser(request, requestOptions) {
|
|
2556
2963
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2557
2964
|
var _a, _b, _c;
|
|
2558
2965
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2559
2966
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users"),
|
|
2560
2967
|
method: "POST",
|
|
2561
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
2968
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2562
2969
|
contentType: "application/json",
|
|
2563
2970
|
requestType: "json",
|
|
2564
2971
|
body: serializers.UpsertUserRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2567,13 +2974,16 @@ class Companies {
|
|
|
2567
2974
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2568
2975
|
});
|
|
2569
2976
|
if (_response.ok) {
|
|
2570
|
-
return
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2977
|
+
return {
|
|
2978
|
+
data: serializers.UpsertUserResponse.parseOrThrow(_response.body, {
|
|
2979
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2980
|
+
allowUnrecognizedUnionMembers: true,
|
|
2981
|
+
allowUnrecognizedEnumValues: true,
|
|
2982
|
+
skipValidation: true,
|
|
2983
|
+
breadcrumbsPrefix: ["response"],
|
|
2984
|
+
}),
|
|
2985
|
+
rawResponse: _response.rawResponse,
|
|
2986
|
+
};
|
|
2577
2987
|
}
|
|
2578
2988
|
if (_response.error.reason === "status-code") {
|
|
2579
2989
|
switch (_response.error.statusCode) {
|
|
@@ -2584,7 +2994,7 @@ class Companies {
|
|
|
2584
2994
|
allowUnrecognizedEnumValues: true,
|
|
2585
2995
|
skipValidation: true,
|
|
2586
2996
|
breadcrumbsPrefix: ["response"],
|
|
2587
|
-
}));
|
|
2997
|
+
}), _response.rawResponse);
|
|
2588
2998
|
case 401:
|
|
2589
2999
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2590
3000
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2592,7 +3002,7 @@ class Companies {
|
|
|
2592
3002
|
allowUnrecognizedEnumValues: true,
|
|
2593
3003
|
skipValidation: true,
|
|
2594
3004
|
breadcrumbsPrefix: ["response"],
|
|
2595
|
-
}));
|
|
3005
|
+
}), _response.rawResponse);
|
|
2596
3006
|
case 403:
|
|
2597
3007
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2598
3008
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2600,7 +3010,15 @@ class Companies {
|
|
|
2600
3010
|
allowUnrecognizedEnumValues: true,
|
|
2601
3011
|
skipValidation: true,
|
|
2602
3012
|
breadcrumbsPrefix: ["response"],
|
|
2603
|
-
}));
|
|
3013
|
+
}), _response.rawResponse);
|
|
3014
|
+
case 404:
|
|
3015
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3016
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3017
|
+
allowUnrecognizedUnionMembers: true,
|
|
3018
|
+
allowUnrecognizedEnumValues: true,
|
|
3019
|
+
skipValidation: true,
|
|
3020
|
+
breadcrumbsPrefix: ["response"],
|
|
3021
|
+
}), _response.rawResponse);
|
|
2604
3022
|
case 500:
|
|
2605
3023
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2606
3024
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2608,11 +3026,12 @@ class Companies {
|
|
|
2608
3026
|
allowUnrecognizedEnumValues: true,
|
|
2609
3027
|
skipValidation: true,
|
|
2610
3028
|
breadcrumbsPrefix: ["response"],
|
|
2611
|
-
}));
|
|
3029
|
+
}), _response.rawResponse);
|
|
2612
3030
|
default:
|
|
2613
3031
|
throw new errors.SchematicError({
|
|
2614
3032
|
statusCode: _response.error.statusCode,
|
|
2615
3033
|
body: _response.error.body,
|
|
3034
|
+
rawResponse: _response.rawResponse,
|
|
2616
3035
|
});
|
|
2617
3036
|
}
|
|
2618
3037
|
}
|
|
@@ -2621,12 +3040,14 @@ class Companies {
|
|
|
2621
3040
|
throw new errors.SchematicError({
|
|
2622
3041
|
statusCode: _response.error.statusCode,
|
|
2623
3042
|
body: _response.error.rawBody,
|
|
3043
|
+
rawResponse: _response.rawResponse,
|
|
2624
3044
|
});
|
|
2625
3045
|
case "timeout":
|
|
2626
3046
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users.");
|
|
2627
3047
|
case "unknown":
|
|
2628
3048
|
throw new errors.SchematicError({
|
|
2629
3049
|
message: _response.error.errorMessage,
|
|
3050
|
+
rawResponse: _response.rawResponse,
|
|
2630
3051
|
});
|
|
2631
3052
|
}
|
|
2632
3053
|
});
|
|
@@ -2644,12 +3065,15 @@ class Companies {
|
|
|
2644
3065
|
* await client.companies.getUser("user_id")
|
|
2645
3066
|
*/
|
|
2646
3067
|
getUser(userId, requestOptions) {
|
|
3068
|
+
return core.HttpResponsePromise.fromPromise(this.__getUser(userId, requestOptions));
|
|
3069
|
+
}
|
|
3070
|
+
__getUser(userId, requestOptions) {
|
|
2647
3071
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2648
3072
|
var _a, _b, _c;
|
|
2649
3073
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2650
3074
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `users/${encodeURIComponent(userId)}`),
|
|
2651
3075
|
method: "GET",
|
|
2652
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3076
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2653
3077
|
contentType: "application/json",
|
|
2654
3078
|
requestType: "json",
|
|
2655
3079
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2657,13 +3081,16 @@ class Companies {
|
|
|
2657
3081
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2658
3082
|
});
|
|
2659
3083
|
if (_response.ok) {
|
|
2660
|
-
return
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
3084
|
+
return {
|
|
3085
|
+
data: serializers.GetUserResponse.parseOrThrow(_response.body, {
|
|
3086
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3087
|
+
allowUnrecognizedUnionMembers: true,
|
|
3088
|
+
allowUnrecognizedEnumValues: true,
|
|
3089
|
+
skipValidation: true,
|
|
3090
|
+
breadcrumbsPrefix: ["response"],
|
|
3091
|
+
}),
|
|
3092
|
+
rawResponse: _response.rawResponse,
|
|
3093
|
+
};
|
|
2667
3094
|
}
|
|
2668
3095
|
if (_response.error.reason === "status-code") {
|
|
2669
3096
|
switch (_response.error.statusCode) {
|
|
@@ -2674,7 +3101,7 @@ class Companies {
|
|
|
2674
3101
|
allowUnrecognizedEnumValues: true,
|
|
2675
3102
|
skipValidation: true,
|
|
2676
3103
|
breadcrumbsPrefix: ["response"],
|
|
2677
|
-
}));
|
|
3104
|
+
}), _response.rawResponse);
|
|
2678
3105
|
case 403:
|
|
2679
3106
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2680
3107
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2682,7 +3109,7 @@ class Companies {
|
|
|
2682
3109
|
allowUnrecognizedEnumValues: true,
|
|
2683
3110
|
skipValidation: true,
|
|
2684
3111
|
breadcrumbsPrefix: ["response"],
|
|
2685
|
-
}));
|
|
3112
|
+
}), _response.rawResponse);
|
|
2686
3113
|
case 404:
|
|
2687
3114
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2688
3115
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2690,7 +3117,7 @@ class Companies {
|
|
|
2690
3117
|
allowUnrecognizedEnumValues: true,
|
|
2691
3118
|
skipValidation: true,
|
|
2692
3119
|
breadcrumbsPrefix: ["response"],
|
|
2693
|
-
}));
|
|
3120
|
+
}), _response.rawResponse);
|
|
2694
3121
|
case 500:
|
|
2695
3122
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2696
3123
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2698,11 +3125,12 @@ class Companies {
|
|
|
2698
3125
|
allowUnrecognizedEnumValues: true,
|
|
2699
3126
|
skipValidation: true,
|
|
2700
3127
|
breadcrumbsPrefix: ["response"],
|
|
2701
|
-
}));
|
|
3128
|
+
}), _response.rawResponse);
|
|
2702
3129
|
default:
|
|
2703
3130
|
throw new errors.SchematicError({
|
|
2704
3131
|
statusCode: _response.error.statusCode,
|
|
2705
3132
|
body: _response.error.body,
|
|
3133
|
+
rawResponse: _response.rawResponse,
|
|
2706
3134
|
});
|
|
2707
3135
|
}
|
|
2708
3136
|
}
|
|
@@ -2711,12 +3139,14 @@ class Companies {
|
|
|
2711
3139
|
throw new errors.SchematicError({
|
|
2712
3140
|
statusCode: _response.error.statusCode,
|
|
2713
3141
|
body: _response.error.rawBody,
|
|
3142
|
+
rawResponse: _response.rawResponse,
|
|
2714
3143
|
});
|
|
2715
3144
|
case "timeout":
|
|
2716
3145
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/{user_id}.");
|
|
2717
3146
|
case "unknown":
|
|
2718
3147
|
throw new errors.SchematicError({
|
|
2719
3148
|
message: _response.error.errorMessage,
|
|
3149
|
+
rawResponse: _response.rawResponse,
|
|
2720
3150
|
});
|
|
2721
3151
|
}
|
|
2722
3152
|
});
|
|
@@ -2728,18 +3158,22 @@ class Companies {
|
|
|
2728
3158
|
* @throws {@link Schematic.BadRequestError}
|
|
2729
3159
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2730
3160
|
* @throws {@link Schematic.ForbiddenError}
|
|
3161
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2731
3162
|
* @throws {@link Schematic.InternalServerError}
|
|
2732
3163
|
*
|
|
2733
3164
|
* @example
|
|
2734
3165
|
* await client.companies.deleteUser("user_id")
|
|
2735
3166
|
*/
|
|
2736
3167
|
deleteUser(userId, requestOptions) {
|
|
3168
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteUser(userId, requestOptions));
|
|
3169
|
+
}
|
|
3170
|
+
__deleteUser(userId, requestOptions) {
|
|
2737
3171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2738
3172
|
var _a, _b, _c;
|
|
2739
3173
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2740
3174
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, `users/${encodeURIComponent(userId)}`),
|
|
2741
3175
|
method: "DELETE",
|
|
2742
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3176
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2743
3177
|
contentType: "application/json",
|
|
2744
3178
|
requestType: "json",
|
|
2745
3179
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -2747,13 +3181,16 @@ class Companies {
|
|
|
2747
3181
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2748
3182
|
});
|
|
2749
3183
|
if (_response.ok) {
|
|
2750
|
-
return
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
3184
|
+
return {
|
|
3185
|
+
data: serializers.DeleteUserResponse.parseOrThrow(_response.body, {
|
|
3186
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3187
|
+
allowUnrecognizedUnionMembers: true,
|
|
3188
|
+
allowUnrecognizedEnumValues: true,
|
|
3189
|
+
skipValidation: true,
|
|
3190
|
+
breadcrumbsPrefix: ["response"],
|
|
3191
|
+
}),
|
|
3192
|
+
rawResponse: _response.rawResponse,
|
|
3193
|
+
};
|
|
2757
3194
|
}
|
|
2758
3195
|
if (_response.error.reason === "status-code") {
|
|
2759
3196
|
switch (_response.error.statusCode) {
|
|
@@ -2764,7 +3201,7 @@ class Companies {
|
|
|
2764
3201
|
allowUnrecognizedEnumValues: true,
|
|
2765
3202
|
skipValidation: true,
|
|
2766
3203
|
breadcrumbsPrefix: ["response"],
|
|
2767
|
-
}));
|
|
3204
|
+
}), _response.rawResponse);
|
|
2768
3205
|
case 401:
|
|
2769
3206
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2770
3207
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2772,7 +3209,7 @@ class Companies {
|
|
|
2772
3209
|
allowUnrecognizedEnumValues: true,
|
|
2773
3210
|
skipValidation: true,
|
|
2774
3211
|
breadcrumbsPrefix: ["response"],
|
|
2775
|
-
}));
|
|
3212
|
+
}), _response.rawResponse);
|
|
2776
3213
|
case 403:
|
|
2777
3214
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2778
3215
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2780,7 +3217,15 @@ class Companies {
|
|
|
2780
3217
|
allowUnrecognizedEnumValues: true,
|
|
2781
3218
|
skipValidation: true,
|
|
2782
3219
|
breadcrumbsPrefix: ["response"],
|
|
2783
|
-
}));
|
|
3220
|
+
}), _response.rawResponse);
|
|
3221
|
+
case 404:
|
|
3222
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3223
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3224
|
+
allowUnrecognizedUnionMembers: true,
|
|
3225
|
+
allowUnrecognizedEnumValues: true,
|
|
3226
|
+
skipValidation: true,
|
|
3227
|
+
breadcrumbsPrefix: ["response"],
|
|
3228
|
+
}), _response.rawResponse);
|
|
2784
3229
|
case 500:
|
|
2785
3230
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2786
3231
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2788,11 +3233,12 @@ class Companies {
|
|
|
2788
3233
|
allowUnrecognizedEnumValues: true,
|
|
2789
3234
|
skipValidation: true,
|
|
2790
3235
|
breadcrumbsPrefix: ["response"],
|
|
2791
|
-
}));
|
|
3236
|
+
}), _response.rawResponse);
|
|
2792
3237
|
default:
|
|
2793
3238
|
throw new errors.SchematicError({
|
|
2794
3239
|
statusCode: _response.error.statusCode,
|
|
2795
3240
|
body: _response.error.body,
|
|
3241
|
+
rawResponse: _response.rawResponse,
|
|
2796
3242
|
});
|
|
2797
3243
|
}
|
|
2798
3244
|
}
|
|
@@ -2801,12 +3247,14 @@ class Companies {
|
|
|
2801
3247
|
throw new errors.SchematicError({
|
|
2802
3248
|
statusCode: _response.error.statusCode,
|
|
2803
3249
|
body: _response.error.rawBody,
|
|
3250
|
+
rawResponse: _response.rawResponse,
|
|
2804
3251
|
});
|
|
2805
3252
|
case "timeout":
|
|
2806
3253
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /users/{user_id}.");
|
|
2807
3254
|
case "unknown":
|
|
2808
3255
|
throw new errors.SchematicError({
|
|
2809
3256
|
message: _response.error.errorMessage,
|
|
3257
|
+
rawResponse: _response.rawResponse,
|
|
2810
3258
|
});
|
|
2811
3259
|
}
|
|
2812
3260
|
});
|
|
@@ -2818,12 +3266,16 @@ class Companies {
|
|
|
2818
3266
|
* @throws {@link Schematic.BadRequestError}
|
|
2819
3267
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2820
3268
|
* @throws {@link Schematic.ForbiddenError}
|
|
3269
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2821
3270
|
* @throws {@link Schematic.InternalServerError}
|
|
2822
3271
|
*
|
|
2823
3272
|
* @example
|
|
2824
3273
|
* await client.companies.countUsers()
|
|
2825
3274
|
*/
|
|
2826
|
-
countUsers() {
|
|
3275
|
+
countUsers(request = {}, requestOptions) {
|
|
3276
|
+
return core.HttpResponsePromise.fromPromise(this.__countUsers(request, requestOptions));
|
|
3277
|
+
}
|
|
3278
|
+
__countUsers() {
|
|
2827
3279
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2828
3280
|
var _a, _b, _c;
|
|
2829
3281
|
const { companyId, ids, planId, q, limit, offset } = request;
|
|
@@ -2854,7 +3306,7 @@ class Companies {
|
|
|
2854
3306
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2855
3307
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users/count"),
|
|
2856
3308
|
method: "GET",
|
|
2857
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3309
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2858
3310
|
contentType: "application/json",
|
|
2859
3311
|
queryParameters: _queryParams,
|
|
2860
3312
|
requestType: "json",
|
|
@@ -2863,13 +3315,16 @@ class Companies {
|
|
|
2863
3315
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2864
3316
|
});
|
|
2865
3317
|
if (_response.ok) {
|
|
2866
|
-
return
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
3318
|
+
return {
|
|
3319
|
+
data: serializers.CountUsersResponse.parseOrThrow(_response.body, {
|
|
3320
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3321
|
+
allowUnrecognizedUnionMembers: true,
|
|
3322
|
+
allowUnrecognizedEnumValues: true,
|
|
3323
|
+
skipValidation: true,
|
|
3324
|
+
breadcrumbsPrefix: ["response"],
|
|
3325
|
+
}),
|
|
3326
|
+
rawResponse: _response.rawResponse,
|
|
3327
|
+
};
|
|
2873
3328
|
}
|
|
2874
3329
|
if (_response.error.reason === "status-code") {
|
|
2875
3330
|
switch (_response.error.statusCode) {
|
|
@@ -2880,7 +3335,7 @@ class Companies {
|
|
|
2880
3335
|
allowUnrecognizedEnumValues: true,
|
|
2881
3336
|
skipValidation: true,
|
|
2882
3337
|
breadcrumbsPrefix: ["response"],
|
|
2883
|
-
}));
|
|
3338
|
+
}), _response.rawResponse);
|
|
2884
3339
|
case 401:
|
|
2885
3340
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2886
3341
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2888,7 +3343,7 @@ class Companies {
|
|
|
2888
3343
|
allowUnrecognizedEnumValues: true,
|
|
2889
3344
|
skipValidation: true,
|
|
2890
3345
|
breadcrumbsPrefix: ["response"],
|
|
2891
|
-
}));
|
|
3346
|
+
}), _response.rawResponse);
|
|
2892
3347
|
case 403:
|
|
2893
3348
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2894
3349
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2896,7 +3351,15 @@ class Companies {
|
|
|
2896
3351
|
allowUnrecognizedEnumValues: true,
|
|
2897
3352
|
skipValidation: true,
|
|
2898
3353
|
breadcrumbsPrefix: ["response"],
|
|
2899
|
-
}));
|
|
3354
|
+
}), _response.rawResponse);
|
|
3355
|
+
case 404:
|
|
3356
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3357
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3358
|
+
allowUnrecognizedUnionMembers: true,
|
|
3359
|
+
allowUnrecognizedEnumValues: true,
|
|
3360
|
+
skipValidation: true,
|
|
3361
|
+
breadcrumbsPrefix: ["response"],
|
|
3362
|
+
}), _response.rawResponse);
|
|
2900
3363
|
case 500:
|
|
2901
3364
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2902
3365
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2904,11 +3367,12 @@ class Companies {
|
|
|
2904
3367
|
allowUnrecognizedEnumValues: true,
|
|
2905
3368
|
skipValidation: true,
|
|
2906
3369
|
breadcrumbsPrefix: ["response"],
|
|
2907
|
-
}));
|
|
3370
|
+
}), _response.rawResponse);
|
|
2908
3371
|
default:
|
|
2909
3372
|
throw new errors.SchematicError({
|
|
2910
3373
|
statusCode: _response.error.statusCode,
|
|
2911
3374
|
body: _response.error.body,
|
|
3375
|
+
rawResponse: _response.rawResponse,
|
|
2912
3376
|
});
|
|
2913
3377
|
}
|
|
2914
3378
|
}
|
|
@@ -2917,12 +3381,14 @@ class Companies {
|
|
|
2917
3381
|
throw new errors.SchematicError({
|
|
2918
3382
|
statusCode: _response.error.statusCode,
|
|
2919
3383
|
body: _response.error.rawBody,
|
|
3384
|
+
rawResponse: _response.rawResponse,
|
|
2920
3385
|
});
|
|
2921
3386
|
case "timeout":
|
|
2922
3387
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/count.");
|
|
2923
3388
|
case "unknown":
|
|
2924
3389
|
throw new errors.SchematicError({
|
|
2925
3390
|
message: _response.error.errorMessage,
|
|
3391
|
+
rawResponse: _response.rawResponse,
|
|
2926
3392
|
});
|
|
2927
3393
|
}
|
|
2928
3394
|
});
|
|
@@ -2934,10 +3400,14 @@ class Companies {
|
|
|
2934
3400
|
* @throws {@link Schematic.BadRequestError}
|
|
2935
3401
|
* @throws {@link Schematic.UnauthorizedError}
|
|
2936
3402
|
* @throws {@link Schematic.ForbiddenError}
|
|
3403
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2937
3404
|
* @throws {@link Schematic.InternalServerError}
|
|
2938
3405
|
*
|
|
2939
3406
|
* @example
|
|
2940
3407
|
* await client.companies.createUser({
|
|
3408
|
+
* companies: [{
|
|
3409
|
+
* "key": "value"
|
|
3410
|
+
* }],
|
|
2941
3411
|
* company: {
|
|
2942
3412
|
* "key": "value"
|
|
2943
3413
|
* },
|
|
@@ -2947,12 +3417,15 @@ class Companies {
|
|
|
2947
3417
|
* })
|
|
2948
3418
|
*/
|
|
2949
3419
|
createUser(request, requestOptions) {
|
|
3420
|
+
return core.HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
3421
|
+
}
|
|
3422
|
+
__createUser(request, requestOptions) {
|
|
2950
3423
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2951
3424
|
var _a, _b, _c;
|
|
2952
3425
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2953
3426
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users/create"),
|
|
2954
3427
|
method: "POST",
|
|
2955
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3428
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
2956
3429
|
contentType: "application/json",
|
|
2957
3430
|
requestType: "json",
|
|
2958
3431
|
body: serializers.UpsertUserRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -2961,13 +3434,16 @@ class Companies {
|
|
|
2961
3434
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2962
3435
|
});
|
|
2963
3436
|
if (_response.ok) {
|
|
2964
|
-
return
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
3437
|
+
return {
|
|
3438
|
+
data: serializers.CreateUserResponse.parseOrThrow(_response.body, {
|
|
3439
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3440
|
+
allowUnrecognizedUnionMembers: true,
|
|
3441
|
+
allowUnrecognizedEnumValues: true,
|
|
3442
|
+
skipValidation: true,
|
|
3443
|
+
breadcrumbsPrefix: ["response"],
|
|
3444
|
+
}),
|
|
3445
|
+
rawResponse: _response.rawResponse,
|
|
3446
|
+
};
|
|
2971
3447
|
}
|
|
2972
3448
|
if (_response.error.reason === "status-code") {
|
|
2973
3449
|
switch (_response.error.statusCode) {
|
|
@@ -2978,7 +3454,7 @@ class Companies {
|
|
|
2978
3454
|
allowUnrecognizedEnumValues: true,
|
|
2979
3455
|
skipValidation: true,
|
|
2980
3456
|
breadcrumbsPrefix: ["response"],
|
|
2981
|
-
}));
|
|
3457
|
+
}), _response.rawResponse);
|
|
2982
3458
|
case 401:
|
|
2983
3459
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2984
3460
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2986,7 +3462,7 @@ class Companies {
|
|
|
2986
3462
|
allowUnrecognizedEnumValues: true,
|
|
2987
3463
|
skipValidation: true,
|
|
2988
3464
|
breadcrumbsPrefix: ["response"],
|
|
2989
|
-
}));
|
|
3465
|
+
}), _response.rawResponse);
|
|
2990
3466
|
case 403:
|
|
2991
3467
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2992
3468
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -2994,7 +3470,15 @@ class Companies {
|
|
|
2994
3470
|
allowUnrecognizedEnumValues: true,
|
|
2995
3471
|
skipValidation: true,
|
|
2996
3472
|
breadcrumbsPrefix: ["response"],
|
|
2997
|
-
}));
|
|
3473
|
+
}), _response.rawResponse);
|
|
3474
|
+
case 404:
|
|
3475
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3476
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3477
|
+
allowUnrecognizedUnionMembers: true,
|
|
3478
|
+
allowUnrecognizedEnumValues: true,
|
|
3479
|
+
skipValidation: true,
|
|
3480
|
+
breadcrumbsPrefix: ["response"],
|
|
3481
|
+
}), _response.rawResponse);
|
|
2998
3482
|
case 500:
|
|
2999
3483
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3000
3484
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3002,11 +3486,12 @@ class Companies {
|
|
|
3002
3486
|
allowUnrecognizedEnumValues: true,
|
|
3003
3487
|
skipValidation: true,
|
|
3004
3488
|
breadcrumbsPrefix: ["response"],
|
|
3005
|
-
}));
|
|
3489
|
+
}), _response.rawResponse);
|
|
3006
3490
|
default:
|
|
3007
3491
|
throw new errors.SchematicError({
|
|
3008
3492
|
statusCode: _response.error.statusCode,
|
|
3009
3493
|
body: _response.error.body,
|
|
3494
|
+
rawResponse: _response.rawResponse,
|
|
3010
3495
|
});
|
|
3011
3496
|
}
|
|
3012
3497
|
}
|
|
@@ -3015,12 +3500,14 @@ class Companies {
|
|
|
3015
3500
|
throw new errors.SchematicError({
|
|
3016
3501
|
statusCode: _response.error.statusCode,
|
|
3017
3502
|
body: _response.error.rawBody,
|
|
3503
|
+
rawResponse: _response.rawResponse,
|
|
3018
3504
|
});
|
|
3019
3505
|
case "timeout":
|
|
3020
3506
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users/create.");
|
|
3021
3507
|
case "unknown":
|
|
3022
3508
|
throw new errors.SchematicError({
|
|
3023
3509
|
message: _response.error.errorMessage,
|
|
3510
|
+
rawResponse: _response.rawResponse,
|
|
3024
3511
|
});
|
|
3025
3512
|
}
|
|
3026
3513
|
});
|
|
@@ -3032,6 +3519,7 @@ class Companies {
|
|
|
3032
3519
|
* @throws {@link Schematic.BadRequestError}
|
|
3033
3520
|
* @throws {@link Schematic.UnauthorizedError}
|
|
3034
3521
|
* @throws {@link Schematic.ForbiddenError}
|
|
3522
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3035
3523
|
* @throws {@link Schematic.InternalServerError}
|
|
3036
3524
|
*
|
|
3037
3525
|
* @example
|
|
@@ -3042,12 +3530,15 @@ class Companies {
|
|
|
3042
3530
|
* })
|
|
3043
3531
|
*/
|
|
3044
3532
|
deleteUserByKeys(request, requestOptions) {
|
|
3533
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteUserByKeys(request, requestOptions));
|
|
3534
|
+
}
|
|
3535
|
+
__deleteUserByKeys(request, requestOptions) {
|
|
3045
3536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3046
3537
|
var _a, _b, _c;
|
|
3047
3538
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3048
3539
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users/delete"),
|
|
3049
3540
|
method: "POST",
|
|
3050
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3541
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
3051
3542
|
contentType: "application/json",
|
|
3052
3543
|
requestType: "json",
|
|
3053
3544
|
body: serializers.KeysRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -3056,13 +3547,16 @@ class Companies {
|
|
|
3056
3547
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3057
3548
|
});
|
|
3058
3549
|
if (_response.ok) {
|
|
3059
|
-
return
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3550
|
+
return {
|
|
3551
|
+
data: serializers.DeleteUserByKeysResponse.parseOrThrow(_response.body, {
|
|
3552
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3553
|
+
allowUnrecognizedUnionMembers: true,
|
|
3554
|
+
allowUnrecognizedEnumValues: true,
|
|
3555
|
+
skipValidation: true,
|
|
3556
|
+
breadcrumbsPrefix: ["response"],
|
|
3557
|
+
}),
|
|
3558
|
+
rawResponse: _response.rawResponse,
|
|
3559
|
+
};
|
|
3066
3560
|
}
|
|
3067
3561
|
if (_response.error.reason === "status-code") {
|
|
3068
3562
|
switch (_response.error.statusCode) {
|
|
@@ -3073,7 +3567,7 @@ class Companies {
|
|
|
3073
3567
|
allowUnrecognizedEnumValues: true,
|
|
3074
3568
|
skipValidation: true,
|
|
3075
3569
|
breadcrumbsPrefix: ["response"],
|
|
3076
|
-
}));
|
|
3570
|
+
}), _response.rawResponse);
|
|
3077
3571
|
case 401:
|
|
3078
3572
|
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3079
3573
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3081,7 +3575,7 @@ class Companies {
|
|
|
3081
3575
|
allowUnrecognizedEnumValues: true,
|
|
3082
3576
|
skipValidation: true,
|
|
3083
3577
|
breadcrumbsPrefix: ["response"],
|
|
3084
|
-
}));
|
|
3578
|
+
}), _response.rawResponse);
|
|
3085
3579
|
case 403:
|
|
3086
3580
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3087
3581
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3089,7 +3583,15 @@ class Companies {
|
|
|
3089
3583
|
allowUnrecognizedEnumValues: true,
|
|
3090
3584
|
skipValidation: true,
|
|
3091
3585
|
breadcrumbsPrefix: ["response"],
|
|
3092
|
-
}));
|
|
3586
|
+
}), _response.rawResponse);
|
|
3587
|
+
case 404:
|
|
3588
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3589
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3590
|
+
allowUnrecognizedUnionMembers: true,
|
|
3591
|
+
allowUnrecognizedEnumValues: true,
|
|
3592
|
+
skipValidation: true,
|
|
3593
|
+
breadcrumbsPrefix: ["response"],
|
|
3594
|
+
}), _response.rawResponse);
|
|
3093
3595
|
case 500:
|
|
3094
3596
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3095
3597
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3097,11 +3599,12 @@ class Companies {
|
|
|
3097
3599
|
allowUnrecognizedEnumValues: true,
|
|
3098
3600
|
skipValidation: true,
|
|
3099
3601
|
breadcrumbsPrefix: ["response"],
|
|
3100
|
-
}));
|
|
3602
|
+
}), _response.rawResponse);
|
|
3101
3603
|
default:
|
|
3102
3604
|
throw new errors.SchematicError({
|
|
3103
3605
|
statusCode: _response.error.statusCode,
|
|
3104
3606
|
body: _response.error.body,
|
|
3607
|
+
rawResponse: _response.rawResponse,
|
|
3105
3608
|
});
|
|
3106
3609
|
}
|
|
3107
3610
|
}
|
|
@@ -3110,12 +3613,14 @@ class Companies {
|
|
|
3110
3613
|
throw new errors.SchematicError({
|
|
3111
3614
|
statusCode: _response.error.statusCode,
|
|
3112
3615
|
body: _response.error.rawBody,
|
|
3616
|
+
rawResponse: _response.rawResponse,
|
|
3113
3617
|
});
|
|
3114
3618
|
case "timeout":
|
|
3115
3619
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users/delete.");
|
|
3116
3620
|
case "unknown":
|
|
3117
3621
|
throw new errors.SchematicError({
|
|
3118
3622
|
message: _response.error.errorMessage,
|
|
3623
|
+
rawResponse: _response.rawResponse,
|
|
3119
3624
|
});
|
|
3120
3625
|
}
|
|
3121
3626
|
});
|
|
@@ -3132,13 +3637,14 @@ class Companies {
|
|
|
3132
3637
|
* @example
|
|
3133
3638
|
* await client.companies.lookupUser({
|
|
3134
3639
|
* keys: {
|
|
3135
|
-
* "keys":
|
|
3136
|
-
* "key": "value"
|
|
3137
|
-
* }
|
|
3640
|
+
* "keys": "keys"
|
|
3138
3641
|
* }
|
|
3139
3642
|
* })
|
|
3140
3643
|
*/
|
|
3141
3644
|
lookupUser(request, requestOptions) {
|
|
3645
|
+
return core.HttpResponsePromise.fromPromise(this.__lookupUser(request, requestOptions));
|
|
3646
|
+
}
|
|
3647
|
+
__lookupUser(request, requestOptions) {
|
|
3142
3648
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3143
3649
|
var _a, _b, _c;
|
|
3144
3650
|
const { keys } = request;
|
|
@@ -3147,7 +3653,7 @@ class Companies {
|
|
|
3147
3653
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3148
3654
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.SchematicEnvironment.Default, "users/lookup"),
|
|
3149
3655
|
method: "GET",
|
|
3150
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.
|
|
3656
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.11", "User-Agent": "@schematichq/schematic-typescript-node/1.1.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
3151
3657
|
contentType: "application/json",
|
|
3152
3658
|
queryParameters: _queryParams,
|
|
3153
3659
|
requestType: "json",
|
|
@@ -3156,13 +3662,16 @@ class Companies {
|
|
|
3156
3662
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3157
3663
|
});
|
|
3158
3664
|
if (_response.ok) {
|
|
3159
|
-
return
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3665
|
+
return {
|
|
3666
|
+
data: serializers.LookupUserResponse.parseOrThrow(_response.body, {
|
|
3667
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3668
|
+
allowUnrecognizedUnionMembers: true,
|
|
3669
|
+
allowUnrecognizedEnumValues: true,
|
|
3670
|
+
skipValidation: true,
|
|
3671
|
+
breadcrumbsPrefix: ["response"],
|
|
3672
|
+
}),
|
|
3673
|
+
rawResponse: _response.rawResponse,
|
|
3674
|
+
};
|
|
3166
3675
|
}
|
|
3167
3676
|
if (_response.error.reason === "status-code") {
|
|
3168
3677
|
switch (_response.error.statusCode) {
|
|
@@ -3173,7 +3682,7 @@ class Companies {
|
|
|
3173
3682
|
allowUnrecognizedEnumValues: true,
|
|
3174
3683
|
skipValidation: true,
|
|
3175
3684
|
breadcrumbsPrefix: ["response"],
|
|
3176
|
-
}));
|
|
3685
|
+
}), _response.rawResponse);
|
|
3177
3686
|
case 403:
|
|
3178
3687
|
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3179
3688
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3181,7 +3690,7 @@ class Companies {
|
|
|
3181
3690
|
allowUnrecognizedEnumValues: true,
|
|
3182
3691
|
skipValidation: true,
|
|
3183
3692
|
breadcrumbsPrefix: ["response"],
|
|
3184
|
-
}));
|
|
3693
|
+
}), _response.rawResponse);
|
|
3185
3694
|
case 404:
|
|
3186
3695
|
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3187
3696
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3189,7 +3698,7 @@ class Companies {
|
|
|
3189
3698
|
allowUnrecognizedEnumValues: true,
|
|
3190
3699
|
skipValidation: true,
|
|
3191
3700
|
breadcrumbsPrefix: ["response"],
|
|
3192
|
-
}));
|
|
3701
|
+
}), _response.rawResponse);
|
|
3193
3702
|
case 500:
|
|
3194
3703
|
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3195
3704
|
unrecognizedObjectKeys: "passthrough",
|
|
@@ -3197,11 +3706,12 @@ class Companies {
|
|
|
3197
3706
|
allowUnrecognizedEnumValues: true,
|
|
3198
3707
|
skipValidation: true,
|
|
3199
3708
|
breadcrumbsPrefix: ["response"],
|
|
3200
|
-
}));
|
|
3709
|
+
}), _response.rawResponse);
|
|
3201
3710
|
default:
|
|
3202
3711
|
throw new errors.SchematicError({
|
|
3203
3712
|
statusCode: _response.error.statusCode,
|
|
3204
3713
|
body: _response.error.body,
|
|
3714
|
+
rawResponse: _response.rawResponse,
|
|
3205
3715
|
});
|
|
3206
3716
|
}
|
|
3207
3717
|
}
|
|
@@ -3210,12 +3720,14 @@ class Companies {
|
|
|
3210
3720
|
throw new errors.SchematicError({
|
|
3211
3721
|
statusCode: _response.error.statusCode,
|
|
3212
3722
|
body: _response.error.rawBody,
|
|
3723
|
+
rawResponse: _response.rawResponse,
|
|
3213
3724
|
});
|
|
3214
3725
|
case "timeout":
|
|
3215
3726
|
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/lookup.");
|
|
3216
3727
|
case "unknown":
|
|
3217
3728
|
throw new errors.SchematicError({
|
|
3218
3729
|
message: _response.error.errorMessage,
|
|
3730
|
+
rawResponse: _response.rawResponse,
|
|
3219
3731
|
});
|
|
3220
3732
|
}
|
|
3221
3733
|
});
|