@schematichq/schematic-typescript-node 1.3.1 → 1.3.2
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/dist/Client.js +87 -0
- package/dist/api/errors/BadRequestError.js +52 -0
- package/dist/api/errors/ForbiddenError.js +52 -0
- package/dist/api/errors/InternalServerError.js +52 -0
- package/dist/api/errors/NotFoundError.js +52 -0
- package/dist/api/errors/UnauthorizedError.js +52 -0
- package/dist/api/errors/index.js +21 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/accesstokens/client/Client.js +184 -0
- package/dist/api/resources/accesstokens/client/index.js +17 -0
- package/dist/api/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.js +5 -0
- package/dist/api/resources/accesstokens/client/requests/index.js +2 -0
- package/dist/api/resources/accesstokens/index.js +18 -0
- package/dist/api/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.js +5 -0
- package/dist/api/resources/accesstokens/types/index.js +17 -0
- package/dist/api/resources/accounts/client/Client.js +1755 -0
- package/dist/api/resources/accounts/client/index.js +17 -0
- package/dist/api/resources/accounts/client/requests/CountApiKeysRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/CountApiRequestsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/CreateApiKeyRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/CreateEnvironmentRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListApiKeysRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListApiRequestsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/ListEnvironmentsRequest.js +5 -0
- package/dist/api/resources/accounts/client/requests/UpdateApiKeyRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/UpdateEnvironmentRequestBody.js +5 -0
- package/dist/api/resources/accounts/client/requests/index.js +2 -0
- package/dist/api/resources/accounts/index.js +18 -0
- package/dist/api/resources/accounts/types/CountApiKeysParams.js +5 -0
- package/dist/api/resources/accounts/types/CountApiKeysResponse.js +5 -0
- package/dist/api/resources/accounts/types/CountApiRequestsParams.js +5 -0
- package/dist/api/resources/accounts/types/CountApiRequestsResponse.js +5 -0
- package/dist/api/resources/accounts/types/CreateApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.d.ts +9 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.js +11 -0
- package/dist/api/resources/accounts/types/CreateEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/DeleteApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/DeleteEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetApiRequestResponse.js +5 -0
- package/dist/api/resources/accounts/types/GetEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListApiKeysParams.js +5 -0
- package/dist/api/resources/accounts/types/ListApiKeysResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListApiRequestsParams.js +5 -0
- package/dist/api/resources/accounts/types/ListApiRequestsResponse.js +5 -0
- package/dist/api/resources/accounts/types/ListEnvironmentsParams.js +5 -0
- package/dist/api/resources/accounts/types/ListEnvironmentsResponse.js +5 -0
- package/dist/api/resources/accounts/types/QuickstartResponse.js +5 -0
- package/dist/api/resources/accounts/types/UpdateApiKeyResponse.js +5 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.d.ts +9 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.js +11 -0
- package/dist/api/resources/accounts/types/UpdateEnvironmentResponse.js +5 -0
- package/dist/api/resources/accounts/types/index.js +38 -0
- package/dist/api/resources/billing/client/Client.js +2585 -0
- package/dist/api/resources/billing/client/index.js +17 -0
- package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/CountCustomersRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingPriceRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingProductRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +49 -0
- package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateCouponRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreateMeterRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +5 -0
- package/dist/api/resources/billing/client/requests/ListBillingProductsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListCouponsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListInvoicesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListMetersRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListPaymentMethodsRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.d.ts +42 -0
- package/dist/api/resources/billing/client/requests/ListProductPricesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/SearchBillingPricesRequest.d.ts +24 -0
- package/dist/api/resources/billing/client/requests/SearchBillingPricesRequest.js +5 -0
- package/dist/api/resources/billing/client/requests/index.js +2 -0
- package/dist/api/resources/billing/index.js +18 -0
- package/dist/api/resources/billing/types/CountBillingProductsParams.js +5 -0
- package/dist/api/resources/billing/types/CountBillingProductsRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CountBillingProductsRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponse.js +5 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/CountCustomersParams.js +5 -0
- package/dist/api/resources/billing/types/CountCustomersResponse.js +5 -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/CreateBillingPriceRequestBodyTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.js +10 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingPriceRequestBodyUsageType.js +10 -0
- package/dist/api/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.d.ts +8 -0
- package/dist/api/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.js +10 -0
- package/dist/api/resources/billing/types/DeleteBillingProductResponse.js +5 -0
- package/dist/api/resources/billing/types/DeleteProductPriceResponse.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsParams.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListBillingProductsRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListCouponsParams.js +5 -0
- package/dist/api/resources/billing/types/ListCouponsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsParams.js +5 -0
- package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListInvoicesParams.js +5 -0
- package/dist/api/resources/billing/types/ListInvoicesResponse.js +5 -0
- package/dist/api/resources/billing/types/ListMetersParams.js +5 -0
- package/dist/api/resources/billing/types/ListMetersResponse.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsParams.js +5 -0
- package/dist/api/resources/billing/types/ListPaymentMethodsResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.d.ts +27 -0
- package/dist/api/resources/billing/types/ListProductPricesParams.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesRequestPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListProductPricesRequestPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/ListProductPricesResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/ListProductPricesResponse.js +5 -0
- package/dist/api/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesParams.d.ts +19 -0
- package/dist/api/resources/billing/types/SearchBillingPricesParams.js +5 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestTiersMode.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesRequestUsageType.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponse.d.ts +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponse.js +5 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.js +10 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsUsageType.d.ts +8 -0
- package/dist/api/resources/billing/types/SearchBillingPricesResponseParamsUsageType.js +10 -0
- package/dist/api/resources/billing/types/UpsertBillingCouponResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingCustomerResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingMeterResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingPriceResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingProductResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertBillingSubscriptionResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertInvoiceResponse.js +5 -0
- package/dist/api/resources/billing/types/UpsertPaymentMethodResponse.js +5 -0
- package/dist/api/resources/billing/types/index.js +60 -0
- package/dist/api/resources/checkout/client/Client.js +546 -0
- package/dist/api/resources/checkout/client/index.js +17 -0
- package/dist/api/resources/checkout/client/requests/CheckoutDataRequestBody.js +5 -0
- package/dist/api/resources/checkout/client/requests/UpdateTrialEndRequestBody.js +5 -0
- package/dist/api/resources/checkout/client/requests/index.js +2 -0
- package/dist/api/resources/checkout/index.js +18 -0
- package/dist/api/resources/checkout/types/CheckoutInternalResponse.js +5 -0
- package/dist/api/resources/checkout/types/GetCheckoutDataResponse.js +5 -0
- package/dist/api/resources/checkout/types/PreviewCheckoutInternalResponse.js +5 -0
- package/dist/api/resources/checkout/types/UpdateCustomerSubscriptionTrialEndResponse.js +5 -0
- package/dist/api/resources/checkout/types/index.js +20 -0
- package/dist/api/resources/companies/client/Client.js +4102 -0
- package/dist/api/resources/companies/client/index.js +17 -0
- package/dist/api/resources/companies/client/requests/CountCompaniesForAdvancedFilterRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountCompaniesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CountUsersRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetActiveDealsRequest.d.ts +22 -0
- package/dist/api/resources/companies/client/requests/GetActiveDealsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetEntityTraitValuesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/GetOrCreateCompanyMembershipRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesForAdvancedFilterRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListCompanyMembershipsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/ListUsersRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/LookupCompanyRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/LookupUserRequest.js +5 -0
- package/dist/api/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.js +5 -0
- package/dist/api/resources/companies/client/requests/index.js +2 -0
- package/dist/api/resources/companies/index.js +18 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterParams.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponse.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/CountCompaniesParams.js +5 -0
- package/dist/api/resources/companies/types/CountCompaniesResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.js +14 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.js +14 -0
- package/dist/api/resources/companies/types/CountUsersParams.js +5 -0
- package/dist/api/resources/companies/types/CountUsersResponse.js +5 -0
- package/dist/api/resources/companies/types/CreateCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.js +10 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.js +14 -0
- package/dist/api/resources/companies/types/CreateUserResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyByKeysResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyMembershipResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteUserByKeysResponse.js +5 -0
- package/dist/api/resources/companies/types/DeleteUserResponse.js +5 -0
- package/dist/api/resources/companies/types/GetActiveCompanySubscriptionParams.js +5 -0
- package/dist/api/resources/companies/types/GetActiveCompanySubscriptionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetActiveDealsParams.d.ts +14 -0
- package/dist/api/resources/companies/types/GetActiveDealsParams.js +5 -0
- package/dist/api/resources/companies/types/GetActiveDealsResponse.d.ts +10 -0
- package/dist/api/resources/companies/types/GetActiveDealsResponse.js +5 -0
- package/dist/api/resources/companies/types/GetCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitValuesParams.js +5 -0
- package/dist/api/resources/companies/types/GetEntityTraitValuesResponse.js +5 -0
- package/dist/api/resources/companies/types/GetOrCreateCompanyMembershipResponse.js +5 -0
- package/dist/api/resources/companies/types/GetOrCreateEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/GetUserResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +11 -0
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +10 -0
- package/dist/api/resources/companies/types/ListCompaniesParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompaniesResponse.js +5 -0
- package/dist/api/resources/companies/types/ListCompanyMembershipsParams.js +5 -0
- package/dist/api/resources/companies/types/ListCompanyMembershipsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsParams.js +5 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.js +14 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponse.js +5 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.d.ts +8 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.js +10 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.js +14 -0
- package/dist/api/resources/companies/types/ListUsersParams.js +5 -0
- package/dist/api/resources/companies/types/ListUsersResponse.js +5 -0
- package/dist/api/resources/companies/types/LookupCompanyParams.js +5 -0
- package/dist/api/resources/companies/types/LookupCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/LookupUserParams.js +5 -0
- package/dist/api/resources/companies/types/LookupUserResponse.js +5 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.d.ts +12 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.js +14 -0
- package/dist/api/resources/companies/types/UpdateEntityTraitDefinitionResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertCompanyResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertCompanyTraitResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertUserResponse.js +5 -0
- package/dist/api/resources/companies/types/UpsertUserTraitResponse.js +5 -0
- package/dist/api/resources/companies/types/index.js +84 -0
- package/dist/api/resources/components/client/Client.js +846 -0
- package/dist/api/resources/components/client/index.js +17 -0
- package/dist/api/resources/components/client/requests/CountComponentsRequest.js +5 -0
- package/dist/api/resources/components/client/requests/CreateComponentRequestBody.js +5 -0
- package/dist/api/resources/components/client/requests/ListComponentsRequest.js +5 -0
- package/dist/api/resources/components/client/requests/PreviewComponentDataRequest.js +5 -0
- package/dist/api/resources/components/client/requests/UpdateComponentRequestBody.js +5 -0
- package/dist/api/resources/components/client/requests/index.js +2 -0
- package/dist/api/resources/components/index.js +18 -0
- package/dist/api/resources/components/types/CountComponentsParams.js +5 -0
- package/dist/api/resources/components/types/CountComponentsResponse.js +5 -0
- package/dist/api/resources/components/types/CreateComponentRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/components/types/CreateComponentRequestBodyEntityType.js +10 -0
- package/dist/api/resources/components/types/CreateComponentResponse.js +5 -0
- package/dist/api/resources/components/types/DeleteComponentResponse.js +5 -0
- package/dist/api/resources/components/types/GetComponentResponse.js +5 -0
- package/dist/api/resources/components/types/ListComponentsParams.js +5 -0
- package/dist/api/resources/components/types/ListComponentsResponse.js +5 -0
- package/dist/api/resources/components/types/PreviewComponentDataParams.js +5 -0
- package/dist/api/resources/components/types/PreviewComponentDataResponse.js +5 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyEntityType.d.ts +8 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyEntityType.js +10 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyState.d.ts +8 -0
- package/dist/api/resources/components/types/UpdateComponentRequestBodyState.js +10 -0
- package/dist/api/resources/components/types/UpdateComponentResponse.js +5 -0
- package/dist/api/resources/components/types/index.js +29 -0
- package/dist/api/resources/credits/client/Client.js +2338 -0
- package/dist/api/resources/credits/client/index.js +17 -0
- package/dist/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountBillingCreditsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CountCreditBundlesRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateBillingCreditRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.d.ts +21 -0
- package/dist/api/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/CreateCreditBundleRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/ListBillingCreditsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListCompanyGrantsRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListCreditBundlesRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/ListGrantsForCreditRequest.js +5 -0
- package/dist/api/resources/credits/client/requests/UpdateBillingCreditRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/ZeroOutGrantRequestBody.js +5 -0
- package/dist/api/resources/credits/client/requests/index.js +2 -0
- package/dist/api/resources/credits/index.js +18 -0
- package/dist/api/resources/credits/types/CountBillingCreditsGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingCreditsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountBillingPlanCreditGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/CountBillingPlanCreditGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesParams.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesRequestStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CountCreditBundlesRequestStatus.js +10 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponse.js +5 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponseParamsStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CountCreditBundlesResponseParamsStatus.js +10 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.js +12 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +9 -0
- package/dist/api/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.js +11 -0
- package/dist/api/resources/credits/types/CreateBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.d.ts +10 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.js +12 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.js +10 -0
- package/dist/api/resources/credits/types/CreateBillingPlanCreditGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.js +10 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/CreateCreditBundleRequestBodyStatus.js +10 -0
- package/dist/api/resources/credits/types/CreateCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/DeleteBillingPlanCreditGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/DeleteCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/GetCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/GetSingleBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/ListBillingCreditsParams.js +5 -0
- package/dist/api/resources/credits/types/ListBillingCreditsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListBillingPlanCreditGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/ListBillingPlanCreditGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsParams.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestDir.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestDir.js +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestOrder.d.ts +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsRequestOrder.js +12 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsDir.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsDir.js +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsOrder.d.ts +10 -0
- package/dist/api/resources/credits/types/ListCompanyGrantsResponseParamsOrder.js +12 -0
- package/dist/api/resources/credits/types/ListCreditBundlesParams.js +5 -0
- package/dist/api/resources/credits/types/ListCreditBundlesRequestStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCreditBundlesRequestStatus.js +10 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponse.js +5 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponseParamsStatus.d.ts +8 -0
- package/dist/api/resources/credits/types/ListCreditBundlesResponseParamsStatus.js +10 -0
- package/dist/api/resources/credits/types/ListGrantsForCreditParams.js +5 -0
- package/dist/api/resources/credits/types/ListGrantsForCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.js +12 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +9 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.js +11 -0
- package/dist/api/resources/credits/types/UpdateBillingCreditResponse.js +5 -0
- package/dist/api/resources/credits/types/UpdateCreditBundleResponse.d.ts +9 -0
- package/dist/api/resources/credits/types/UpdateCreditBundleResponse.js +5 -0
- package/dist/api/resources/credits/types/ZeroOutGrantRequestBodyReason.d.ts +8 -0
- package/dist/api/resources/credits/types/ZeroOutGrantRequestBodyReason.js +10 -0
- package/dist/api/resources/credits/types/ZeroOutGrantResponse.js +5 -0
- package/dist/api/resources/credits/types/index.js +61 -0
- package/dist/api/resources/crm/client/Client.d.ts +129 -0
- package/dist/api/resources/crm/client/Client.js +657 -0
- package/dist/api/resources/crm/client/index.d.ts +1 -0
- package/dist/api/resources/crm/client/index.js +17 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.d.ts +14 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealRequestBody.d.ts +22 -0
- package/dist/api/resources/crm/client/requests/CreateCrmDealRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmLineItemRequestBody.d.ts +23 -0
- package/dist/api/resources/crm/client/requests/CreateCrmLineItemRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/CreateCrmProductRequestBody.d.ts +26 -0
- package/dist/api/resources/crm/client/requests/CreateCrmProductRequestBody.js +5 -0
- package/dist/api/resources/crm/client/requests/ListCrmProductsRequest.d.ts +19 -0
- package/dist/api/resources/crm/client/requests/ListCrmProductsRequest.js +5 -0
- package/dist/api/resources/crm/client/requests/index.d.ts +5 -0
- package/dist/api/resources/crm/client/requests/index.js +2 -0
- package/dist/api/resources/crm/index.d.ts +2 -0
- package/dist/api/resources/crm/index.js +18 -0
- package/dist/api/resources/crm/types/ListCrmProductsParams.d.ts +14 -0
- package/dist/api/resources/crm/types/ListCrmProductsParams.js +5 -0
- package/dist/api/resources/crm/types/ListCrmProductsResponse.d.ts +10 -0
- package/dist/api/resources/crm/types/ListCrmProductsResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertCrmDealResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertCrmDealResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertCrmProductResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertCrmProductResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertDealLineItemAssociationResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertDealLineItemAssociationResponse.js +5 -0
- package/dist/api/resources/crm/types/UpsertLineItemResponse.d.ts +9 -0
- package/dist/api/resources/crm/types/UpsertLineItemResponse.js +5 -0
- package/dist/api/resources/crm/types/index.d.ts +6 -0
- package/dist/api/resources/crm/types/index.js +22 -0
- package/dist/api/resources/dataexports/client/Client.js +265 -0
- package/dist/api/resources/dataexports/client/index.js +17 -0
- package/dist/api/resources/dataexports/client/requests/CreateDataExportRequestBody.js +5 -0
- package/dist/api/resources/dataexports/client/requests/index.js +2 -0
- package/dist/api/resources/dataexports/index.js +18 -0
- package/dist/api/resources/dataexports/types/CreateDataExportResponse.js +5 -0
- package/dist/api/resources/dataexports/types/index.js +17 -0
- package/dist/api/resources/entitlements/client/Client.js +2431 -0
- package/dist/api/resources/entitlements/client/index.js +17 -0
- package/dist/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureCompaniesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureUsageRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountFeatureUsersRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/GetFeatureUsageByCompanyRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureCompaniesRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureUsageRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListFeatureUsersRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.js +5 -0
- package/dist/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +5 -0
- package/dist/api/resources/entitlements/client/requests/index.js +2 -0
- package/dist/api/resources/entitlements/index.js +18 -0
- package/dist/api/resources/entitlements/types/CountCompanyOverridesParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountCompanyOverridesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureCompaniesParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureCompaniesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsageParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsageResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsersParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountFeatureUsersResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsParams.js +5 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/CreateCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/CreatePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/DeleteCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/DeletePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +5 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageByCompanyResponse.js +5 -0
- package/dist/api/resources/entitlements/types/GetPlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListCompanyOverridesParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListCompanyOverridesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureCompaniesParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureCompaniesResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsageParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsageResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsersParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListFeatureUsersResponse.js +5 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsParams.js +5 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsResponse.js +5 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/UpdateCompanyOverrideResponse.js +5 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +12 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.d.ts +11 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.js +13 -0
- package/dist/api/resources/entitlements/types/UpdatePlanEntitlementResponse.js +5 -0
- package/dist/api/resources/entitlements/types/index.js +60 -0
- package/dist/api/resources/events/client/Client.js +757 -0
- package/dist/api/resources/events/client/index.js +17 -0
- package/dist/api/resources/events/client/requests/CreateEventBatchRequestBody.js +5 -0
- package/dist/api/resources/events/client/requests/GetEventSummariesRequest.js +5 -0
- package/dist/api/resources/events/client/requests/ListEventsRequest.js +5 -0
- package/dist/api/resources/events/client/requests/index.js +2 -0
- package/dist/api/resources/events/index.js +18 -0
- package/dist/api/resources/events/types/CreateEventBatchResponse.js +5 -0
- package/dist/api/resources/events/types/CreateEventResponse.js +5 -0
- package/dist/api/resources/events/types/GetEventResponse.js +5 -0
- package/dist/api/resources/events/types/GetEventSummariesParams.js +5 -0
- package/dist/api/resources/events/types/GetEventSummariesResponse.js +5 -0
- package/dist/api/resources/events/types/GetSegmentIntegrationStatusResponse.js +5 -0
- package/dist/api/resources/events/types/ListEventsParams.js +5 -0
- package/dist/api/resources/events/types/ListEventsRequestEventTypesItem.d.ts +9 -0
- package/dist/api/resources/events/types/ListEventsRequestEventTypesItem.js +11 -0
- package/dist/api/resources/events/types/ListEventsResponse.js +5 -0
- package/dist/api/resources/events/types/ListEventsResponseParamsEventTypesItem.d.ts +9 -0
- package/dist/api/resources/events/types/ListEventsResponseParamsEventTypesItem.js +11 -0
- package/dist/api/resources/events/types/index.js +26 -0
- package/dist/api/resources/features/client/Client.js +2324 -0
- package/dist/api/resources/features/client/index.js +17 -0
- package/dist/api/resources/features/client/requests/CountFeaturesRequest.js +5 -0
- package/dist/api/resources/features/client/requests/CountFlagsRequest.js +5 -0
- package/dist/api/resources/features/client/requests/CreateFeatureRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/ListFeaturesRequest.js +5 -0
- package/dist/api/resources/features/client/requests/ListFlagsRequest.js +5 -0
- package/dist/api/resources/features/client/requests/UpdateFeatureRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/UpdateFlagRulesRequestBody.js +5 -0
- package/dist/api/resources/features/client/requests/index.js +2 -0
- package/dist/api/resources/features/index.js +18 -0
- package/dist/api/resources/features/types/CheckFlagResponse.js +5 -0
- package/dist/api/resources/features/types/CheckFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/CountAudienceCompaniesResponse.d.ts +9 -0
- package/dist/api/resources/features/types/CountAudienceCompaniesResponse.js +5 -0
- package/dist/api/resources/features/types/CountAudienceUsersResponse.d.ts +9 -0
- package/dist/api/resources/features/types/CountAudienceUsersResponse.js +5 -0
- package/dist/api/resources/features/types/CountFeaturesParams.js +5 -0
- package/dist/api/resources/features/types/CountFeaturesResponse.js +5 -0
- package/dist/api/resources/features/types/CountFlagsParams.js +5 -0
- package/dist/api/resources/features/types/CountFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyFeatureType.d.ts +9 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyFeatureType.js +11 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.d.ts +15 -0
- package/dist/api/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.js +17 -0
- package/dist/api/resources/features/types/CreateFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/CreateFlagResponse.js +5 -0
- package/dist/api/resources/features/types/DeleteFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/DeleteFlagResponse.js +5 -0
- package/dist/api/resources/features/types/GetFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/GetFlagResponse.js +5 -0
- package/dist/api/resources/features/types/ListAudienceCompaniesResponse.d.ts +10 -0
- package/dist/api/resources/features/types/ListAudienceCompaniesResponse.js +5 -0
- package/dist/api/resources/features/types/ListAudienceUsersResponse.d.ts +10 -0
- package/dist/api/resources/features/types/ListAudienceUsersResponse.js +5 -0
- package/dist/api/resources/features/types/ListFeaturesParams.js +5 -0
- package/dist/api/resources/features/types/ListFeaturesResponse.js +5 -0
- package/dist/api/resources/features/types/ListFlagsParams.js +5 -0
- package/dist/api/resources/features/types/ListFlagsResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyFeatureType.d.ts +9 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyFeatureType.js +11 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.d.ts +15 -0
- package/dist/api/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.js +17 -0
- package/dist/api/resources/features/types/UpdateFeatureResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFlagResponse.js +5 -0
- package/dist/api/resources/features/types/UpdateFlagRulesResponse.js +5 -0
- package/dist/api/resources/features/types/index.js +43 -0
- package/dist/api/resources/index.js +84 -0
- package/dist/api/resources/plangroups/client/Client.js +396 -0
- package/dist/api/resources/plangroups/client/index.js +17 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +5 -0
- package/dist/api/resources/plangroups/client/requests/index.js +2 -0
- package/dist/api/resources/plangroups/index.js +18 -0
- package/dist/api/resources/plangroups/types/CreatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/GetPlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/UpdatePlanGroupResponse.js +5 -0
- package/dist/api/resources/plangroups/types/index.js +19 -0
- package/dist/api/resources/plans/client/Client.js +2047 -0
- package/dist/api/resources/plans/client/index.js +17 -0
- 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/CountPlansRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +18 -0
- package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.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/ListPlansRequest.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +25 -0
- package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdateCompanyPlansRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +14 -0
- package/dist/api/resources/plans/client/requests/UpdatePlanRequestBody.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 +24 -0
- package/dist/api/resources/plans/client/requests/UpsertBillingProductRequestBody.js +5 -0
- package/dist/api/resources/plans/client/requests/index.js +2 -0
- package/dist/api/resources/plans/index.js +18 -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/CountPlansParams.js +5 -0
- package/dist/api/resources/plans/types/CountPlansRequestPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/CountPlansRequestPlanType.js +10 -0
- package/dist/api/resources/plans/types/CountPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/CountPlansResponseParamsPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/CountPlansResponseParamsPlanType.js +10 -0
- package/dist/api/resources/plans/types/CreatePlanRequestBodyPlanType.d.ts +8 -0
- package/dist/api/resources/plans/types/CreatePlanRequestBodyPlanType.js +10 -0
- package/dist/api/resources/plans/types/CreatePlanResponse.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/DeleteAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/DeleteAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/DeletePlanResponse.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/GetAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/GetAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/GetPlanResponse.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/ListPlansParams.js +5 -0
- package/dist/api/resources/plans/types/ListPlansRequestPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/ListPlansRequestPlanType.js +10 -0
- package/dist/api/resources/plans/types/ListPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/ListPlansResponseParamsPlanType.d.ts +11 -0
- package/dist/api/resources/plans/types/ListPlansResponseParamsPlanType.js +10 -0
- package/dist/api/resources/plans/types/UpdateAudienceResponse.d.ts +9 -0
- package/dist/api/resources/plans/types/UpdateAudienceResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdateCompanyPlansResponse.js +5 -0
- package/dist/api/resources/plans/types/UpdatePlanResponse.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/UpsertBillingProductPlanResponse.js +5 -0
- package/dist/api/resources/plans/types/UpsertBillingProductRequestBodyChargeType.d.ts +9 -0
- package/dist/api/resources/plans/types/UpsertBillingProductRequestBodyChargeType.js +11 -0
- package/dist/api/resources/plans/types/index.js +43 -0
- package/dist/api/resources/webhooks/client/Client.js +1100 -0
- package/dist/api/resources/webhooks/client/index.js +17 -0
- package/dist/api/resources/webhooks/client/requests/CountWebhookEventsRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/CountWebhooksRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/CreateWebhookRequestBody.js +5 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhookEventsRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/ListWebhooksRequest.js +5 -0
- package/dist/api/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +5 -0
- package/dist/api/resources/webhooks/client/requests/index.js +2 -0
- package/dist/api/resources/webhooks/index.js +18 -0
- package/dist/api/resources/webhooks/types/CountWebhookEventsParams.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhookEventsResponse.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhooksParams.js +5 -0
- package/dist/api/resources/webhooks/types/CountWebhooksResponse.js +5 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +34 -0
- package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +36 -0
- package/dist/api/resources/webhooks/types/CreateWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/DeleteWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/GetWebhookEventResponse.js +5 -0
- package/dist/api/resources/webhooks/types/GetWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhookEventsParams.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhookEventsResponse.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhooksParams.js +5 -0
- package/dist/api/resources/webhooks/types/ListWebhooksResponse.js +5 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +34 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +36 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyStatus.d.ts +8 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyStatus.js +10 -0
- package/dist/api/resources/webhooks/types/UpdateWebhookResponse.js +5 -0
- package/dist/api/resources/webhooks/types/index.js +32 -0
- package/dist/api/types/ApiError.js +5 -0
- package/dist/api/types/ApiKeyCreateResponseData.js +5 -0
- package/dist/api/types/ApiKeyRequestListResponseData.js +5 -0
- package/dist/api/types/ApiKeyRequestResponseData.js +5 -0
- package/dist/api/types/ApiKeyResponseData.js +5 -0
- package/dist/api/types/AudienceRequestBody.d.ts +13 -0
- package/dist/api/types/AudienceRequestBody.js +5 -0
- package/dist/api/types/BillingCouponResponseData.js +5 -0
- package/dist/api/types/BillingCreditBundleResponseData.js +5 -0
- package/dist/api/types/BillingCreditGrantResponseData.js +5 -0
- package/dist/api/types/BillingCreditResponseData.js +5 -0
- package/dist/api/types/BillingCustomerResponseData.js +5 -0
- package/dist/api/types/BillingCustomerSubscription.js +5 -0
- package/dist/api/types/BillingCustomerWithSubscriptionsResponseData.js +5 -0
- package/dist/api/types/BillingMeterResponseData.js +5 -0
- package/dist/api/types/BillingPlanCreditGrantResponseData.js +5 -0
- package/dist/api/types/BillingPriceResponseData.js +5 -0
- package/dist/api/types/BillingPriceView.js +5 -0
- package/dist/api/types/BillingProductDetailResponseData.js +5 -0
- package/dist/api/types/BillingProductForSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingProductPlanResponseData.js +5 -0
- package/dist/api/types/BillingProductPriceResponseData.js +5 -0
- package/dist/api/types/BillingProductPriceTierResponseData.js +5 -0
- package/dist/api/types/BillingProductPricing.js +5 -0
- package/dist/api/types/BillingProductPricingUsageType.d.ts +8 -0
- package/dist/api/types/BillingProductPricingUsageType.js +10 -0
- package/dist/api/types/BillingProductResponseData.js +5 -0
- package/dist/api/types/BillingSubscriptionDiscount.js +5 -0
- package/dist/api/types/BillingSubscriptionDiscountView.js +5 -0
- package/dist/api/types/BillingSubscriptionResponseData.js +5 -0
- package/dist/api/types/BillingSubscriptionView.js +5 -0
- package/dist/api/types/ChangeSubscriptionInternalRequestBody.js +5 -0
- package/dist/api/types/ChangeSubscriptionRequestBody.js +5 -0
- package/dist/api/types/CheckFlagRequestBody.js +5 -0
- package/dist/api/types/CheckFlagResponseData.js +5 -0
- package/dist/api/types/CheckFlagsResponseData.js +5 -0
- package/dist/api/types/CheckoutDataResponseData.js +5 -0
- package/dist/api/types/CompanyCrmDealsResponseData.d.ts +11 -0
- package/dist/api/types/CompanyCrmDealsResponseData.js +5 -0
- package/dist/api/types/CompanyDetailResponseData.js +5 -0
- package/dist/api/types/CompanyEventPeriodMetricsResponseData.js +5 -0
- package/dist/api/types/CompanyMembershipDetailResponseData.js +5 -0
- package/dist/api/types/CompanyMembershipResponseData.js +5 -0
- package/dist/api/types/CompanyOverrideResponseData.js +5 -0
- package/dist/api/types/CompanyPlanDetailResponseData.js +5 -0
- package/dist/api/types/CompanyPlanWithBillingSubView.js +5 -0
- package/dist/api/types/CompanyResponseData.js +5 -0
- package/dist/api/types/CompanySubscriptionResponseData.js +5 -0
- package/dist/api/types/CompanyViewWithFeatureUsageResponseData.js +5 -0
- package/dist/api/types/CompatiblePlans.js +5 -0
- package/dist/api/types/CompatiblePlansResponseData.js +5 -0
- package/dist/api/types/ComponentCapabilities.js +5 -0
- package/dist/api/types/ComponentHydrateResponseData.js +5 -0
- package/dist/api/types/ComponentPreviewResponseData.js +5 -0
- package/dist/api/types/ComponentResponseData.js +5 -0
- package/dist/api/types/CountResponse.js +5 -0
- package/dist/api/types/CouponRequestBody.js +5 -0
- package/dist/api/types/CreateBillingPriceTierRequestBody.js +5 -0
- package/dist/api/types/CreateEntitlementReqCommon.js +5 -0
- package/dist/api/types/CreateEntitlementReqCommonMetricPeriod.js +12 -0
- package/dist/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/CreateEntitlementReqCommonValueType.d.ts +11 -0
- package/dist/api/types/CreateEntitlementReqCommonValueType.js +13 -0
- package/dist/api/types/CreateEventRequestBody.js +5 -0
- package/dist/api/types/CreateEventRequestBodyEventType.d.ts +12 -0
- package/dist/api/types/CreateEventRequestBodyEventType.js +11 -0
- package/dist/api/types/CreateFlagRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionGroupRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyConditionType.js +16 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +12 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/CreateOrUpdateConditionRequestBodyOperator.js +16 -0
- package/dist/api/types/CreateOrUpdateFlagRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateRuleRequestBody.js +5 -0
- package/dist/api/types/CreateOrUpdateRuleRequestBodyRuleType.js +14 -0
- package/dist/api/types/CreatePriceTierRequestBody.js +5 -0
- package/dist/api/types/CreditBundlePurchaseResponseData.js +5 -0
- package/dist/api/types/CrmDealLineItem.d.ts +18 -0
- package/dist/api/types/CrmDealLineItem.js +5 -0
- package/dist/api/types/CrmDealResponseData.d.ts +19 -0
- package/dist/api/types/CrmDealResponseData.js +5 -0
- package/dist/api/types/CrmLineItemResponseData.d.ts +14 -0
- package/dist/api/types/CrmLineItemResponseData.js +5 -0
- package/dist/api/types/CrmProductResponseData.d.ts +18 -0
- package/dist/api/types/CrmProductResponseData.js +5 -0
- package/dist/api/types/CustomPlanConfig.js +5 -0
- package/dist/api/types/CustomPlanViewConfigResponseData.js +5 -0
- package/dist/api/types/DataExportResponseData.js +5 -0
- package/dist/api/types/Decimal.d.ts +4 -0
- package/dist/api/types/Decimal.js +5 -0
- package/dist/api/types/DeleteResponse.js +5 -0
- package/dist/api/types/EntitlementTriggerConfig.js +5 -0
- package/dist/api/types/EntitlementsInPlan.js +5 -0
- package/dist/api/types/EntityKeyDefinitionResponseData.js +5 -0
- package/dist/api/types/EntityKeyDetailResponseData.js +5 -0
- package/dist/api/types/EntityKeyResponseData.js +5 -0
- package/dist/api/types/EntityTraitDefinitionResponseData.js +5 -0
- package/dist/api/types/EntityTraitDetailResponseData.js +5 -0
- package/dist/api/types/EntityTraitResponseData.js +5 -0
- package/dist/api/types/EntityTraitValue.js +5 -0
- package/dist/api/types/EnvironmentDetailResponseData.js +5 -0
- package/dist/api/types/EnvironmentResponseData.js +5 -0
- package/dist/api/types/EventBody.js +5 -0
- package/dist/api/types/EventBodyFlagCheck.js +5 -0
- package/dist/api/types/EventBodyIdentify.js +5 -0
- package/dist/api/types/EventBodyIdentifyCompany.js +5 -0
- package/dist/api/types/EventBodyTrack.js +5 -0
- package/dist/api/types/EventDetailResponseData.js +5 -0
- package/dist/api/types/EventResponseData.js +5 -0
- package/dist/api/types/EventSummaryResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureCompanyResponseDataAllocationType.js +12 -0
- package/dist/api/types/FeatureCompanyUserResponseData.js +5 -0
- package/dist/api/types/FeatureCompanyUserResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureCompanyUserResponseDataAllocationType.js +12 -0
- package/dist/api/types/FeatureDetailResponseData.js +5 -0
- package/dist/api/types/FeatureResponseData.js +5 -0
- package/dist/api/types/FeatureUsageDataResponseData.js +5 -0
- package/dist/api/types/FeatureUsageDetailResponseData.js +5 -0
- package/dist/api/types/FeatureUsageResponseData.js +5 -0
- package/dist/api/types/FeatureUsageResponseDataAllocationType.d.ts +13 -0
- package/dist/api/types/FeatureUsageResponseDataAllocationType.js +12 -0
- package/dist/api/types/FlagDetailResponseData.js +5 -0
- package/dist/api/types/FlagResponseData.js +5 -0
- package/dist/api/types/GenericPreviewObject.js +5 -0
- package/dist/api/types/InvoiceRequestBody.js +5 -0
- package/dist/api/types/InvoiceResponseData.js +5 -0
- package/dist/api/types/IssueTemporaryAccessTokenResponseData.js +5 -0
- package/dist/api/types/KeysRequestBody.js +5 -0
- package/dist/api/types/MeterRequestBody.js +5 -0
- package/dist/api/types/OrderedPlansInGroup.js +5 -0
- package/dist/api/types/PaginationFilter.d.ts +9 -0
- package/dist/api/types/PaginationFilter.js +5 -0
- package/dist/api/types/PaymentMethodRequestBody.js +5 -0
- package/dist/api/types/PaymentMethodResponseData.js +5 -0
- package/dist/api/types/PlanAudienceDetailResponseData.d.ts +21 -0
- package/dist/api/types/PlanAudienceDetailResponseData.js +5 -0
- package/dist/api/types/PlanAudienceResponseData.d.ts +15 -0
- package/dist/api/types/PlanAudienceResponseData.js +5 -0
- package/dist/api/types/PlanDetailResponseData.js +5 -0
- package/dist/api/types/PlanEntitlementResponseData.js +5 -0
- package/dist/api/types/PlanEntitlementsOrder.js +5 -0
- package/dist/api/types/PlanGroupDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.js +5 -0
- package/dist/api/types/PlanGroupPlanEntitlementsOrder.js +5 -0
- package/dist/api/types/PlanGroupResponseData.js +5 -0
- package/dist/api/types/PlanResponseData.js +5 -0
- package/dist/api/types/PlanTraitResponseData.js +5 -0
- package/dist/api/types/PreviewObject.js +5 -0
- package/dist/api/types/PreviewObjectResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionFinanceResponseData.js +5 -0
- package/dist/api/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +5 -0
- package/dist/api/types/QuickstartResp.js +5 -0
- package/dist/api/types/RawEventBatchResponseData.js +5 -0
- package/dist/api/types/RawEventResponseData.js +5 -0
- package/dist/api/types/RuleConditionDetailResponseData.js +5 -0
- package/dist/api/types/RuleConditionGroupDetailResponseData.js +5 -0
- package/dist/api/types/RuleConditionGroupResponseData.js +5 -0
- package/dist/api/types/RuleConditionResponseData.js +5 -0
- package/dist/api/types/RuleDetailResponseData.js +5 -0
- package/dist/api/types/RuleResponseData.js +5 -0
- package/dist/api/types/RulesDetailResponseData.js +5 -0
- package/dist/api/types/SegmentStatusResp.js +5 -0
- package/dist/api/types/StripeEmbedInfo.js +5 -0
- package/dist/api/types/TemporaryAccessTokenResponseData.js +5 -0
- package/dist/api/types/UpdateAddOnRequestBody.js +5 -0
- package/dist/api/types/UpdateCreditBundleRequestBody.js +5 -0
- package/dist/api/types/UpdateEntitlementReqCommon.js +5 -0
- package/dist/api/types/UpdateEntitlementReqCommonMetricPeriod.js +12 -0
- package/dist/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.js +10 -0
- package/dist/api/types/UpdateEntitlementReqCommonValueType.d.ts +11 -0
- package/dist/api/types/UpdateEntitlementReqCommonValueType.js +13 -0
- package/dist/api/types/UpdatePayInAdvanceRequestBody.js +5 -0
- package/dist/api/types/UpdateRuleRequestBody.js +5 -0
- package/dist/api/types/UpsertCompanyRequestBody.js +5 -0
- package/dist/api/types/UpsertTraitRequestBody.js +5 -0
- package/dist/api/types/UpsertUserRequestBody.js +5 -0
- package/dist/api/types/UpsertUserSubRequestBody.js +5 -0
- package/dist/api/types/UsageBasedEntitlementRequestBody.js +5 -0
- package/dist/api/types/UsageBasedEntitlementRequestBodyPriceBehavior.d.ts +11 -0
- package/dist/api/types/UsageBasedEntitlementRequestBodyPriceBehavior.js +13 -0
- package/dist/api/types/UsageBasedEntitlementResponseData.js +5 -0
- package/dist/api/types/UserDetailResponseData.js +5 -0
- package/dist/api/types/UserResponseData.js +5 -0
- package/dist/api/types/WebhookEventDetailResponseData.js +5 -0
- package/dist/api/types/WebhookEventResponseData.js +5 -0
- package/dist/api/types/WebhookResponseData.js +5 -0
- package/dist/api/types/index.js +188 -0
- package/dist/cache.js +102 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.js +107 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/custom.js +132 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.js +15 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.js +42 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/core/schemas/Schema.js +24 -0
- package/dist/core/schemas/builders/bigint/bigint.js +53 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- package/dist/core/schemas/builders/date/date.js +62 -0
- package/dist/core/schemas/builders/date/index.js +5 -0
- package/dist/core/schemas/builders/enum/enum.js +38 -0
- package/dist/core/schemas/builders/enum/index.js +5 -0
- package/dist/core/schemas/builders/index.js +30 -0
- package/dist/core/schemas/builders/lazy/index.js +7 -0
- package/dist/core/schemas/builders/lazy/lazy.js +24 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +11 -0
- package/dist/core/schemas/builders/list/index.js +5 -0
- package/dist/core/schemas/builders/list/list.js +54 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +28 -0
- package/dist/core/schemas/builders/literals/index.js +7 -0
- package/dist/core/schemas/builders/literals/stringLiteral.js +28 -0
- package/dist/core/schemas/builders/object/index.js +11 -0
- package/dist/core/schemas/builders/object/object.js +261 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +7 -0
- package/dist/core/schemas/builders/object/property.js +15 -0
- package/dist/core/schemas/builders/object/types.js +2 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +53 -0
- package/dist/core/schemas/builders/object-like/index.js +6 -0
- package/dist/core/schemas/builders/object-like/types.js +2 -0
- package/dist/core/schemas/builders/primitives/any.js +6 -0
- package/dist/core/schemas/builders/primitives/boolean.js +25 -0
- package/dist/core/schemas/builders/primitives/index.js +13 -0
- package/dist/core/schemas/builders/primitives/number.js +25 -0
- package/dist/core/schemas/builders/primitives/string.js +25 -0
- package/dist/core/schemas/builders/primitives/unknown.js +6 -0
- package/dist/core/schemas/builders/record/index.js +5 -0
- package/dist/core/schemas/builders/record/record.js +93 -0
- package/dist/core/schemas/builders/record/types.js +2 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +145 -0
- package/dist/core/schemas/builders/schema-utils/index.js +11 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +9 -0
- package/dist/core/schemas/builders/set/index.js +5 -0
- package/dist/core/schemas/builders/set/set.js +43 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.js +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +39 -0
- package/dist/core/schemas/builders/union/discriminant.js +9 -0
- package/dist/core/schemas/builders/union/index.js +7 -0
- package/dist/core/schemas/builders/union/types.js +2 -0
- package/dist/core/schemas/builders/union/union.js +129 -0
- package/dist/core/schemas/index.js +17 -0
- package/dist/core/schemas/utils/MaybePromise.js +2 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +15 -0
- package/dist/core/schemas/utils/entries.js +6 -0
- package/dist/core/schemas/utils/filterObject.js +13 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +27 -0
- package/dist/core/schemas/utils/isPlainObject.js +17 -0
- package/dist/core/schemas/utils/keys.js +6 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +27 -0
- package/dist/core/schemas/utils/partition.js +15 -0
- package/dist/environments.js +9 -0
- package/dist/errors/SchematicError.js +30 -0
- package/dist/errors/SchematicTimeoutError.js +13 -0
- package/dist/errors/index.js +7 -0
- package/dist/events.js +118 -0
- package/dist/index.js +1 -1
- package/dist/logger.js +19 -0
- package/dist/main.js +1 -0
- package/dist/serialization/index.js +18 -0
- package/dist/serialization/resources/accesstokens/client/index.js +17 -0
- package/dist/serialization/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.js +44 -0
- package/dist/serialization/resources/accesstokens/client/requests/index.js +5 -0
- package/dist/serialization/resources/accesstokens/index.js +18 -0
- package/dist/serialization/resources/accesstokens/types/IssueTemporaryAccessTokenResponse.js +45 -0
- package/dist/serialization/resources/accesstokens/types/index.js +17 -0
- package/dist/serialization/resources/accounts/client/index.js +17 -0
- package/dist/serialization/resources/accounts/client/requests/CreateApiKeyRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/CreateEnvironmentRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/UpdateApiKeyRequestBody.js +44 -0
- package/dist/serialization/resources/accounts/client/requests/UpdateEnvironmentRequestBody.js +45 -0
- package/dist/serialization/resources/accounts/client/requests/index.js +11 -0
- package/dist/serialization/resources/accounts/index.js +18 -0
- package/dist/serialization/resources/accounts/types/CountApiKeysParams.js +46 -0
- package/dist/serialization/resources/accounts/types/CountApiKeysResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/CountApiRequestsParams.js +47 -0
- package/dist/serialization/resources/accounts/types/CountApiRequestsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/CreateApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.d.ts +10 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentRequestBodyEnvironmentType.js +41 -0
- package/dist/serialization/resources/accounts/types/CreateEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/DeleteApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/DeleteEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetApiRequestResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/GetEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/ListApiKeysParams.js +46 -0
- package/dist/serialization/resources/accounts/types/ListApiKeysResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/ListApiRequestsParams.js +47 -0
- package/dist/serialization/resources/accounts/types/ListApiRequestsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/ListEnvironmentsParams.js +45 -0
- package/dist/serialization/resources/accounts/types/ListEnvironmentsResponse.js +46 -0
- package/dist/serialization/resources/accounts/types/QuickstartResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/UpdateApiKeyResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.d.ts +10 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentRequestBodyEnvironmentType.js +41 -0
- package/dist/serialization/resources/accounts/types/UpdateEnvironmentResponse.js +45 -0
- package/dist/serialization/resources/accounts/types/index.js +38 -0
- package/dist/serialization/resources/billing/client/index.js +17 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.js +49 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.js +60 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingProductRequestBody.js +46 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.d.ts +31 -0
- package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionsRequestBody.js +62 -0
- package/dist/serialization/resources/billing/client/requests/CreateCouponRequestBody.js +51 -0
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.js +54 -0
- package/dist/serialization/resources/billing/client/requests/CreateMeterRequestBody.js +46 -0
- package/dist/serialization/resources/billing/client/requests/CreatePaymentMethodRequestBody.js +54 -0
- package/dist/serialization/resources/billing/client/requests/index.js +19 -0
- package/dist/serialization/resources/billing/index.js +18 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsParams.js +54 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CountBillingProductsResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CountCustomersParams.js +48 -0
- package/dist/serialization/resources/billing/types/CountCustomersResponse.js +46 -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/CreateBillingPriceRequestBodyTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingPriceRequestBodyUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.d.ts +10 -0
- package/dist/serialization/resources/billing/types/CreateBillingSubscriptionsRequestBodyTrialEndSetting.js +41 -0
- package/dist/serialization/resources/billing/types/DeleteBillingProductResponse.js +45 -0
- package/dist/serialization/resources/billing/types/DeleteProductPriceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsParams.js +54 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListBillingProductsResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListCouponsParams.js +46 -0
- package/dist/serialization/resources/billing/types/ListCouponsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.js +48 -0
- package/dist/serialization/resources/billing/types/ListCustomersWithSubscriptionsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListInvoicesParams.js +47 -0
- package/dist/serialization/resources/billing/types/ListInvoicesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListMetersParams.js +45 -0
- package/dist/serialization/resources/billing/types/ListMetersResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsParams.js +46 -0
- package/dist/serialization/resources/billing/types/ListPaymentMethodsResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.d.ts +23 -0
- package/dist/serialization/resources/billing/types/ListProductPricesParams.js +54 -0
- package/dist/serialization/resources/billing/types/ListProductPricesRequestPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListProductPricesRequestPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/ListProductPricesResponseParamsPriceUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesParams.d.ts +21 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesParams.js +52 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesRequestUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponse.d.ts +15 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponse.js +46 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsTiersMode.js +41 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsUsageType.d.ts +10 -0
- package/dist/serialization/resources/billing/types/SearchBillingPricesResponseParamsUsageType.js +41 -0
- package/dist/serialization/resources/billing/types/UpsertBillingCouponResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingCustomerResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingMeterResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingPriceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingProductResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertBillingSubscriptionResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertInvoiceResponse.js +45 -0
- package/dist/serialization/resources/billing/types/UpsertPaymentMethodResponse.js +45 -0
- package/dist/serialization/resources/billing/types/index.js +60 -0
- package/dist/serialization/resources/checkout/client/index.js +17 -0
- package/dist/serialization/resources/checkout/client/requests/CheckoutDataRequestBody.js +44 -0
- package/dist/serialization/resources/checkout/client/requests/UpdateTrialEndRequestBody.js +43 -0
- package/dist/serialization/resources/checkout/client/requests/index.js +7 -0
- package/dist/serialization/resources/checkout/index.js +18 -0
- package/dist/serialization/resources/checkout/types/CheckoutInternalResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/GetCheckoutDataResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/PreviewCheckoutInternalResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/UpdateCustomerSubscriptionTrialEndResponse.js +45 -0
- package/dist/serialization/resources/checkout/types/index.js +20 -0
- package/dist/serialization/resources/companies/client/index.js +17 -0
- package/dist/serialization/resources/companies/client/requests/CreateEntityTraitDefinitionRequestBody.js +48 -0
- package/dist/serialization/resources/companies/client/requests/GetOrCreateCompanyMembershipRequestBody.js +44 -0
- package/dist/serialization/resources/companies/client/requests/UpdateEntityTraitDefinitionRequestBody.js +45 -0
- package/dist/serialization/resources/companies/client/requests/index.js +9 -0
- package/dist/serialization/resources/companies/index.js +18 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterParams.js +57 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterRequestSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/CountCompaniesParams.js +50 -0
- package/dist/serialization/resources/companies/types/CountCompaniesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsParams.js +48 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityKeyDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsParams.js +50 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsRequestTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CountEntityTraitDefinitionsResponseParamsTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CountUsersParams.js +48 -0
- package/dist/serialization/resources/companies/types/CountUsersResponse.js +46 -0
- package/dist/serialization/resources/companies/types/CreateCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/CreateEntityTraitDefinitionRequestBodyTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/CreateUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyByKeysResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyMembershipResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteUserByKeysResponse.js +45 -0
- package/dist/serialization/resources/companies/types/DeleteUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetActiveCompanySubscriptionParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveCompanySubscriptionResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsParams.d.ts +15 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsResponse.d.ts +15 -0
- package/dist/serialization/resources/companies/types/GetActiveDealsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitValuesParams.js +46 -0
- package/dist/serialization/resources/companies/types/GetEntityTraitValuesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/GetOrCreateCompanyMembershipResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetOrCreateEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/GetUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterParams.js +57 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterRequestSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponseParamsSortOrderDirection.js +41 -0
- package/dist/serialization/resources/companies/types/ListCompaniesParams.js +50 -0
- package/dist/serialization/resources/companies/types/ListCompaniesResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompanyMembershipsParams.js +46 -0
- package/dist/serialization/resources/companies/types/ListCompanyMembershipsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsParams.js +48 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityKeyDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsParams.js +50 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsRequestTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponse.js +46 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsEntityType.js +41 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/ListEntityTraitDefinitionsResponseParamsTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/ListUsersParams.js +48 -0
- package/dist/serialization/resources/companies/types/ListUsersResponse.js +46 -0
- package/dist/serialization/resources/companies/types/LookupCompanyParams.js +43 -0
- package/dist/serialization/resources/companies/types/LookupCompanyResponse.js +46 -0
- package/dist/serialization/resources/companies/types/LookupUserParams.js +43 -0
- package/dist/serialization/resources/companies/types/LookupUserResponse.js +46 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.d.ts +10 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionRequestBodyTraitType.js +41 -0
- package/dist/serialization/resources/companies/types/UpdateEntityTraitDefinitionResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertCompanyResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertCompanyTraitResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertUserResponse.js +45 -0
- package/dist/serialization/resources/companies/types/UpsertUserTraitResponse.js +45 -0
- package/dist/serialization/resources/companies/types/index.js +84 -0
- package/dist/serialization/resources/components/client/index.js +17 -0
- package/dist/serialization/resources/components/client/requests/CreateComponentRequestBody.js +46 -0
- package/dist/serialization/resources/components/client/requests/UpdateComponentRequestBody.js +48 -0
- package/dist/serialization/resources/components/client/requests/index.js +7 -0
- package/dist/serialization/resources/components/index.js +18 -0
- package/dist/serialization/resources/components/types/CountComponentsParams.js +45 -0
- package/dist/serialization/resources/components/types/CountComponentsResponse.js +46 -0
- package/dist/serialization/resources/components/types/CreateComponentRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/components/types/CreateComponentRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/components/types/CreateComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/DeleteComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/GetComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/ListComponentsParams.js +45 -0
- package/dist/serialization/resources/components/types/ListComponentsResponse.js +46 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataParams.js +44 -0
- package/dist/serialization/resources/components/types/PreviewComponentDataResponse.js +46 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyEntityType.d.ts +10 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyEntityType.js +41 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyState.d.ts +10 -0
- package/dist/serialization/resources/components/types/UpdateComponentRequestBodyState.js +41 -0
- package/dist/serialization/resources/components/types/UpdateComponentResponse.js +45 -0
- package/dist/serialization/resources/components/types/index.js +29 -0
- package/dist/serialization/resources/credits/client/index.js +17 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingCreditRequestBody.js +56 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.d.ts +18 -0
- package/dist/serialization/resources/credits/client/requests/CreateBillingPlanCreditGrantRequestBody.js +49 -0
- package/dist/serialization/resources/credits/client/requests/CreateCreditBundleRequestBody.js +54 -0
- package/dist/serialization/resources/credits/client/requests/UpdateBillingCreditRequestBody.js +55 -0
- package/dist/serialization/resources/credits/client/requests/ZeroOutGrantRequestBody.js +44 -0
- package/dist/serialization/resources/credits/client/requests/index.js +13 -0
- package/dist/serialization/resources/credits/index.js +18 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsGrantsParams.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsParams.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingCreditsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountBillingPlanCreditGrantsParams.js +47 -0
- package/dist/serialization/resources/credits/types/CountBillingPlanCreditGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesParams.js +49 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesRequestStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesRequestStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponse.js +46 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponseParamsStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CountCreditBundlesResponseParamsStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyBurnStrategy.js +46 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditRequestBodyDefaultRolloverPolicy.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetCadence.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantRequestBodyResetStart.js +41 -0
- package/dist/serialization/resources/credits/types/CreateBillingPlanCreditGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyExpiryType.js +41 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleRequestBodyStatus.js +41 -0
- package/dist/serialization/resources/credits/types/CreateCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/DeleteBillingPlanCreditGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/DeleteCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/GetCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/GetSingleBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/ListBillingCreditsParams.js +46 -0
- package/dist/serialization/resources/credits/types/ListBillingCreditsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListBillingPlanCreditGrantsParams.js +47 -0
- package/dist/serialization/resources/credits/types/ListBillingPlanCreditGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsParams.js +49 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestDir.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestDir.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestOrder.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsRequestOrder.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsDir.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsDir.js +41 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsOrder.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCompanyGrantsResponseParamsOrder.js +41 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesParams.js +49 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesRequestStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesRequestStatus.js +41 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponse.js +46 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponseParamsStatus.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ListCreditBundlesResponseParamsStatus.js +41 -0
- package/dist/serialization/resources/credits/types/ListGrantsForCreditParams.js +46 -0
- package/dist/serialization/resources/credits/types/ListGrantsForCreditResponse.js +46 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyBurnStrategy.js +46 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.d.ts +10 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditRequestBodyDefaultRolloverPolicy.js +41 -0
- package/dist/serialization/resources/credits/types/UpdateBillingCreditResponse.js +45 -0
- package/dist/serialization/resources/credits/types/UpdateCreditBundleResponse.d.ts +14 -0
- package/dist/serialization/resources/credits/types/UpdateCreditBundleResponse.js +45 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantRequestBodyReason.d.ts +10 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantRequestBodyReason.js +41 -0
- package/dist/serialization/resources/credits/types/ZeroOutGrantResponse.js +45 -0
- package/dist/serialization/resources/credits/types/index.js +61 -0
- package/dist/serialization/resources/crm/client/index.d.ts +1 -0
- package/dist/serialization/resources/crm/client/index.js +17 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.d.ts +13 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealLineItemAssociationRequestBody.js +44 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealRequestBody.d.ts +20 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmDealRequestBody.js +51 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmLineItemRequestBody.d.ts +19 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmLineItemRequestBody.js +50 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmProductRequestBody.d.ts +19 -0
- package/dist/serialization/resources/crm/client/requests/CreateCrmProductRequestBody.js +50 -0
- package/dist/serialization/resources/crm/client/requests/index.d.ts +4 -0
- package/dist/serialization/resources/crm/client/requests/index.js +11 -0
- package/dist/serialization/resources/crm/index.d.ts +2 -0
- package/dist/serialization/resources/crm/index.js +18 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsParams.d.ts +15 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsParams.js +46 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsResponse.d.ts +15 -0
- package/dist/serialization/resources/crm/types/ListCrmProductsResponse.js +46 -0
- package/dist/serialization/resources/crm/types/UpsertCrmDealResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertCrmDealResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertCrmProductResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertCrmProductResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertDealLineItemAssociationResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertDealLineItemAssociationResponse.js +45 -0
- package/dist/serialization/resources/crm/types/UpsertLineItemResponse.d.ts +14 -0
- package/dist/serialization/resources/crm/types/UpsertLineItemResponse.js +45 -0
- package/dist/serialization/resources/crm/types/index.d.ts +6 -0
- package/dist/serialization/resources/crm/types/index.js +22 -0
- package/dist/serialization/resources/dataexports/client/index.js +17 -0
- package/dist/serialization/resources/dataexports/client/requests/CreateDataExportRequestBody.js +43 -0
- package/dist/serialization/resources/dataexports/client/requests/index.js +5 -0
- package/dist/serialization/resources/dataexports/index.js +18 -0
- package/dist/serialization/resources/dataexports/types/CreateDataExportResponse.js +45 -0
- package/dist/serialization/resources/dataexports/types/index.js +17 -0
- package/dist/serialization/resources/entitlements/client/index.js +17 -0
- package/dist/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.js +55 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.js +69 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.js +53 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.js +67 -0
- package/dist/serialization/resources/entitlements/client/requests/index.js +11 -0
- package/dist/serialization/resources/entitlements/index.js +18 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyOverridesParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyOverridesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureCompaniesParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureCompaniesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageParams.js +49 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsageResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsersParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountFeatureUsersResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CountPlanEntitlementsParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/CountPlanEntitlementsResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreateCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/CreatePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/DeleteCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/DeletePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/GetCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyParams.js +43 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageByCompanyResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/GetPlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyOverridesParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyOverridesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureCompaniesParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureCompaniesResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageParams.js +49 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsageResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsersParams.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListFeatureUsersResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/ListPlanEntitlementsParams.js +51 -0
- package/dist/serialization/resources/entitlements/types/ListPlanEntitlementsResponse.js +46 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdateCompanyOverrideResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.d.ts +10 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyValueType.js +41 -0
- package/dist/serialization/resources/entitlements/types/UpdatePlanEntitlementResponse.js +45 -0
- package/dist/serialization/resources/entitlements/types/index.js +60 -0
- package/dist/serialization/resources/events/client/index.js +17 -0
- package/dist/serialization/resources/events/client/requests/CreateEventBatchRequestBody.js +44 -0
- package/dist/serialization/resources/events/client/requests/index.js +5 -0
- package/dist/serialization/resources/events/index.js +18 -0
- package/dist/serialization/resources/events/types/CreateEventBatchResponse.js +45 -0
- package/dist/serialization/resources/events/types/CreateEventResponse.js +45 -0
- package/dist/serialization/resources/events/types/GetEventResponse.js +45 -0
- package/dist/serialization/resources/events/types/GetEventSummariesParams.js +46 -0
- package/dist/serialization/resources/events/types/GetEventSummariesResponse.js +46 -0
- package/dist/serialization/resources/events/types/GetSegmentIntegrationStatusResponse.js +45 -0
- package/dist/serialization/resources/events/types/ListEventsParams.js +50 -0
- package/dist/serialization/resources/events/types/ListEventsRequestEventTypesItem.d.ts +10 -0
- package/dist/serialization/resources/events/types/ListEventsRequestEventTypesItem.js +41 -0
- package/dist/serialization/resources/events/types/ListEventsResponse.js +46 -0
- package/dist/serialization/resources/events/types/ListEventsResponseParamsEventTypesItem.d.ts +10 -0
- package/dist/serialization/resources/events/types/ListEventsResponseParamsEventTypesItem.js +41 -0
- package/dist/serialization/resources/events/types/index.js +26 -0
- package/dist/serialization/resources/features/client/index.js +17 -0
- package/dist/serialization/resources/features/client/requests/CreateFeatureRequestBody.js +56 -0
- package/dist/serialization/resources/features/client/requests/UpdateFeatureRequestBody.js +56 -0
- package/dist/serialization/resources/features/client/requests/UpdateFlagRulesRequestBody.js +44 -0
- package/dist/serialization/resources/features/client/requests/index.js +9 -0
- package/dist/serialization/resources/features/index.js +18 -0
- package/dist/serialization/resources/features/types/CheckFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/CheckFlagsResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountAudienceCompaniesResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/CountAudienceCompaniesResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountAudienceUsersResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/CountAudienceUsersResponse.js +45 -0
- package/dist/serialization/resources/features/types/CountFeaturesParams.js +50 -0
- package/dist/serialization/resources/features/types/CountFeaturesResponse.js +46 -0
- package/dist/serialization/resources/features/types/CountFlagsParams.js +47 -0
- package/dist/serialization/resources/features/types/CountFlagsResponse.js +46 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyFeatureType.d.ts +10 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyFeatureType.js +41 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.d.ts +10 -0
- package/dist/serialization/resources/features/types/CreateFeatureRequestBodyLifecyclePhase.js +51 -0
- package/dist/serialization/resources/features/types/CreateFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/CreateFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/DeleteFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/DeleteFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/GetFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/GetFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListAudienceCompaniesResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/ListAudienceCompaniesResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListAudienceUsersResponse.d.ts +14 -0
- package/dist/serialization/resources/features/types/ListAudienceUsersResponse.js +45 -0
- package/dist/serialization/resources/features/types/ListFeaturesParams.js +50 -0
- package/dist/serialization/resources/features/types/ListFeaturesResponse.js +46 -0
- package/dist/serialization/resources/features/types/ListFlagsParams.js +47 -0
- package/dist/serialization/resources/features/types/ListFlagsResponse.js +46 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyFeatureType.d.ts +10 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyFeatureType.js +41 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.d.ts +10 -0
- package/dist/serialization/resources/features/types/UpdateFeatureRequestBodyLifecyclePhase.js +51 -0
- package/dist/serialization/resources/features/types/UpdateFeatureResponse.js +45 -0
- package/dist/serialization/resources/features/types/UpdateFlagResponse.js +45 -0
- package/dist/serialization/resources/features/types/UpdateFlagRulesResponse.js +45 -0
- package/dist/serialization/resources/features/types/index.js +43 -0
- package/dist/serialization/resources/index.js +84 -0
- package/dist/serialization/resources/plangroups/client/index.js +17 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.js +53 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.js +53 -0
- package/dist/serialization/resources/plangroups/client/requests/index.js +7 -0
- package/dist/serialization/resources/plangroups/index.js +18 -0
- package/dist/serialization/resources/plangroups/types/CreatePlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/GetPlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/UpdatePlanGroupResponse.js +45 -0
- package/dist/serialization/resources/plangroups/types/index.js +19 -0
- package/dist/serialization/resources/plans/client/index.js +17 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +16 -0
- package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.js +47 -0
- 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/UpdateAudienceRequestBody.d.ts +15 -0
- package/dist/serialization/resources/plans/client/requests/UpdateAudienceRequestBody.js +46 -0
- package/dist/serialization/resources/plans/client/requests/UpdateCompanyPlansRequestBody.js +44 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +14 -0
- package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.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 +23 -0
- package/dist/serialization/resources/plans/client/requests/UpsertBillingProductRequestBody.js +54 -0
- package/dist/serialization/resources/plans/client/requests/index.js +17 -0
- package/dist/serialization/resources/plans/index.js +18 -0
- 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/CountPlansParams.js +53 -0
- package/dist/serialization/resources/plans/types/CountPlansRequestPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CountPlansRequestPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CountPlansResponse.js +46 -0
- package/dist/serialization/resources/plans/types/CountPlansResponseParamsPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CountPlansResponseParamsPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CreatePlanRequestBodyPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/CreatePlanRequestBodyPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/CreatePlanResponse.js +45 -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/DeleteAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/DeleteAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/DeletePlanResponse.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/GetAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/GetAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/GetPlanResponse.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/ListPlansParams.js +53 -0
- package/dist/serialization/resources/plans/types/ListPlansRequestPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/ListPlansRequestPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/ListPlansResponse.js +46 -0
- package/dist/serialization/resources/plans/types/ListPlansResponseParamsPlanType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/ListPlansResponseParamsPlanType.js +41 -0
- package/dist/serialization/resources/plans/types/UpdateAudienceResponse.d.ts +14 -0
- package/dist/serialization/resources/plans/types/UpdateAudienceResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpdateCompanyPlansResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpdatePlanResponse.js +45 -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/UpsertBillingProductPlanResponse.js +45 -0
- package/dist/serialization/resources/plans/types/UpsertBillingProductRequestBodyChargeType.d.ts +10 -0
- package/dist/serialization/resources/plans/types/UpsertBillingProductRequestBodyChargeType.js +41 -0
- package/dist/serialization/resources/plans/types/index.js +43 -0
- package/dist/serialization/resources/webhooks/client/index.js +17 -0
- package/dist/serialization/resources/webhooks/client/requests/CreateWebhookRequestBody.js +48 -0
- package/dist/serialization/resources/webhooks/client/requests/UpdateWebhookRequestBody.js +50 -0
- package/dist/serialization/resources/webhooks/client/requests/index.js +7 -0
- package/dist/serialization/resources/webhooks/index.js +18 -0
- package/dist/serialization/resources/webhooks/types/CountWebhookEventsParams.js +47 -0
- package/dist/serialization/resources/webhooks/types/CountWebhookEventsResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/CountWebhooksParams.js +45 -0
- package/dist/serialization/resources/webhooks/types/CountWebhooksResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.js +70 -0
- package/dist/serialization/resources/webhooks/types/CreateWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/DeleteWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/GetWebhookEventResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/GetWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/ListWebhookEventsParams.js +47 -0
- package/dist/serialization/resources/webhooks/types/ListWebhookEventsResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksParams.js +45 -0
- package/dist/serialization/resources/webhooks/types/ListWebhooksResponse.js +46 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.js +70 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyStatus.d.ts +10 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyStatus.js +41 -0
- package/dist/serialization/resources/webhooks/types/UpdateWebhookResponse.js +45 -0
- package/dist/serialization/resources/webhooks/types/index.js +32 -0
- package/dist/serialization/types/ApiError.js +43 -0
- package/dist/serialization/types/ApiKeyCreateResponseData.js +51 -0
- package/dist/serialization/types/ApiKeyRequestListResponseData.js +58 -0
- package/dist/serialization/types/ApiKeyRequestResponseData.js +61 -0
- package/dist/serialization/types/ApiKeyResponseData.js +50 -0
- package/dist/serialization/types/AudienceRequestBody.d.ts +18 -0
- package/dist/serialization/types/AudienceRequestBody.js +49 -0
- package/dist/serialization/types/BillingCouponResponseData.js +58 -0
- package/dist/serialization/types/BillingCreditBundleResponseData.js +55 -0
- package/dist/serialization/types/BillingCreditGrantResponseData.js +60 -0
- package/dist/serialization/types/BillingCreditResponseData.js +59 -0
- package/dist/serialization/types/BillingCustomerResponseData.js +50 -0
- package/dist/serialization/types/BillingCustomerSubscription.js +48 -0
- package/dist/serialization/types/BillingCustomerWithSubscriptionsResponseData.js +52 -0
- package/dist/serialization/types/BillingMeterResponseData.js +47 -0
- package/dist/serialization/types/BillingPlanCreditGrantResponseData.js +51 -0
- package/dist/serialization/types/BillingPriceResponseData.js +49 -0
- package/dist/serialization/types/BillingPriceView.js +64 -0
- package/dist/serialization/types/BillingProductDetailResponseData.js +57 -0
- package/dist/serialization/types/BillingProductForSubscriptionResponseData.js +62 -0
- package/dist/serialization/types/BillingProductPlanResponseData.js +53 -0
- package/dist/serialization/types/BillingProductPriceResponseData.js +57 -0
- package/dist/serialization/types/BillingProductPriceTierResponseData.js +46 -0
- package/dist/serialization/types/BillingProductPricing.js +53 -0
- package/dist/serialization/types/BillingProductPricingUsageType.d.ts +10 -0
- package/dist/serialization/types/BillingProductPricingUsageType.js +41 -0
- package/dist/serialization/types/BillingProductResponseData.js +54 -0
- package/dist/serialization/types/BillingSubscriptionDiscount.js +49 -0
- package/dist/serialization/types/BillingSubscriptionDiscountView.js +56 -0
- package/dist/serialization/types/BillingSubscriptionResponseData.js +60 -0
- package/dist/serialization/types/BillingSubscriptionView.js +68 -0
- package/dist/serialization/types/ChangeSubscriptionInternalRequestBody.js +55 -0
- package/dist/serialization/types/ChangeSubscriptionRequestBody.js +54 -0
- package/dist/serialization/types/CheckFlagRequestBody.js +44 -0
- package/dist/serialization/types/CheckFlagResponseData.js +56 -0
- package/dist/serialization/types/CheckFlagsResponseData.js +44 -0
- package/dist/serialization/types/CheckoutDataResponseData.js +59 -0
- package/dist/serialization/types/CompanyCrmDealsResponseData.d.ts +17 -0
- package/dist/serialization/types/CompanyCrmDealsResponseData.js +48 -0
- package/dist/serialization/types/CompanyDetailResponseData.js +68 -0
- package/dist/serialization/types/CompanyEventPeriodMetricsResponseData.js +53 -0
- package/dist/serialization/types/CompanyMembershipDetailResponseData.js +49 -0
- package/dist/serialization/types/CompanyMembershipResponseData.js +47 -0
- package/dist/serialization/types/CompanyOverrideResponseData.js +64 -0
- package/dist/serialization/types/CompanyPlanDetailResponseData.js +75 -0
- package/dist/serialization/types/CompanyPlanWithBillingSubView.js +51 -0
- package/dist/serialization/types/CompanyResponseData.js +49 -0
- package/dist/serialization/types/CompanySubscriptionResponseData.js +60 -0
- package/dist/serialization/types/CompanyViewWithFeatureUsageResponseData.js +70 -0
- package/dist/serialization/types/CompatiblePlans.js +44 -0
- package/dist/serialization/types/CompatiblePlansResponseData.js +44 -0
- package/dist/serialization/types/ComponentCapabilities.js +44 -0
- package/dist/serialization/types/ComponentHydrateResponseData.js +66 -0
- package/dist/serialization/types/ComponentPreviewResponseData.js +67 -0
- package/dist/serialization/types/ComponentResponseData.js +49 -0
- package/dist/serialization/types/CountResponse.js +43 -0
- package/dist/serialization/types/CouponRequestBody.js +50 -0
- package/dist/serialization/types/CreateBillingPriceTierRequestBody.js +47 -0
- package/dist/serialization/types/CreateEntitlementReqCommon.js +53 -0
- package/dist/serialization/types/CreateEntitlementReqCommonMetricPeriod.js +41 -0
- package/dist/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/CreateEntitlementReqCommonValueType.d.ts +10 -0
- package/dist/serialization/types/CreateEntitlementReqCommonValueType.js +41 -0
- package/dist/serialization/types/CreateEventRequestBody.js +47 -0
- package/dist/serialization/types/CreateEventRequestBodyEventType.d.ts +10 -0
- package/dist/serialization/types/CreateEventRequestBodyEventType.js +41 -0
- package/dist/serialization/types/CreateFlagRequestBody.js +49 -0
- package/dist/serialization/types/CreateOrUpdateConditionGroupRequestBody.js +47 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBody.js +57 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.js +50 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.js +41 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/CreateOrUpdateConditionRequestBodyOperator.js +41 -0
- package/dist/serialization/types/CreateOrUpdateFlagRequestBody.js +50 -0
- package/dist/serialization/types/CreateOrUpdateRuleRequestBody.js +52 -0
- package/dist/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.js +48 -0
- package/dist/serialization/types/CreatePriceTierRequestBody.js +46 -0
- package/dist/serialization/types/CreditBundlePurchaseResponseData.js +46 -0
- package/dist/serialization/types/CrmDealLineItem.d.ts +24 -0
- package/dist/serialization/types/CrmDealLineItem.js +55 -0
- package/dist/serialization/types/CrmDealResponseData.d.ts +22 -0
- package/dist/serialization/types/CrmDealResponseData.js +53 -0
- package/dist/serialization/types/CrmLineItemResponseData.d.ts +17 -0
- package/dist/serialization/types/CrmLineItemResponseData.js +48 -0
- package/dist/serialization/types/CrmProductResponseData.d.ts +21 -0
- package/dist/serialization/types/CrmProductResponseData.js +52 -0
- package/dist/serialization/types/CustomPlanConfig.js +45 -0
- package/dist/serialization/types/CustomPlanViewConfigResponseData.js +45 -0
- package/dist/serialization/types/DataExportResponseData.js +51 -0
- package/dist/serialization/types/Decimal.d.ts +10 -0
- package/dist/serialization/types/Decimal.js +41 -0
- package/dist/serialization/types/DeleteResponse.js +43 -0
- package/dist/serialization/types/EntitlementTriggerConfig.js +43 -0
- package/dist/serialization/types/EntitlementsInPlan.js +44 -0
- package/dist/serialization/types/EntityKeyDefinitionResponseData.js +47 -0
- package/dist/serialization/types/EntityKeyDetailResponseData.js +53 -0
- package/dist/serialization/types/EntityKeyResponseData.js +51 -0
- package/dist/serialization/types/EntityTraitDefinitionResponseData.js +49 -0
- package/dist/serialization/types/EntityTraitDetailResponseData.js +50 -0
- package/dist/serialization/types/EntityTraitResponseData.js +48 -0
- package/dist/serialization/types/EntityTraitValue.js +44 -0
- package/dist/serialization/types/EnvironmentDetailResponseData.js +49 -0
- package/dist/serialization/types/EnvironmentResponseData.js +47 -0
- package/dist/serialization/types/EventBody.js +44 -0
- package/dist/serialization/types/EventBodyFlagCheck.js +52 -0
- package/dist/serialization/types/EventBodyIdentify.js +47 -0
- package/dist/serialization/types/EventBodyIdentifyCompany.js +45 -0
- package/dist/serialization/types/EventBodyTrack.js +47 -0
- package/dist/serialization/types/EventDetailResponseData.js +65 -0
- package/dist/serialization/types/EventResponseData.js +61 -0
- package/dist/serialization/types/EventSummaryResponseData.js +48 -0
- package/dist/serialization/types/FeatureCompanyResponseData.js +59 -0
- package/dist/serialization/types/FeatureCompanyResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureCompanyResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FeatureCompanyUserResponseData.js +60 -0
- package/dist/serialization/types/FeatureCompanyUserResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureCompanyUserResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FeatureDetailResponseData.js +63 -0
- package/dist/serialization/types/FeatureResponseData.js +55 -0
- package/dist/serialization/types/FeatureUsageDataResponseData.js +51 -0
- package/dist/serialization/types/FeatureUsageDetailResponseData.js +44 -0
- package/dist/serialization/types/FeatureUsageResponseData.js +62 -0
- package/dist/serialization/types/FeatureUsageResponseDataAllocationType.d.ts +10 -0
- package/dist/serialization/types/FeatureUsageResponseDataAllocationType.js +41 -0
- package/dist/serialization/types/FlagDetailResponseData.js +57 -0
- package/dist/serialization/types/FlagResponseData.js +52 -0
- package/dist/serialization/types/GenericPreviewObject.js +46 -0
- package/dist/serialization/types/InvoiceRequestBody.js +53 -0
- package/dist/serialization/types/InvoiceResponseData.js +59 -0
- package/dist/serialization/types/IssueTemporaryAccessTokenResponseData.js +50 -0
- package/dist/serialization/types/KeysRequestBody.js +43 -0
- package/dist/serialization/types/MeterRequestBody.js +45 -0
- package/dist/serialization/types/OrderedPlansInGroup.js +45 -0
- package/dist/serialization/types/PaginationFilter.d.ts +13 -0
- package/dist/serialization/types/PaginationFilter.js +44 -0
- package/dist/serialization/types/PaymentMethodRequestBody.js +53 -0
- package/dist/serialization/types/PaymentMethodResponseData.js +59 -0
- package/dist/serialization/types/PlanAudienceDetailResponseData.d.ts +25 -0
- package/dist/serialization/types/PlanAudienceDetailResponseData.js +56 -0
- package/dist/serialization/types/PlanAudienceResponseData.d.ts +21 -0
- package/dist/serialization/types/PlanAudienceResponseData.js +52 -0
- package/dist/serialization/types/PlanDetailResponseData.js +65 -0
- package/dist/serialization/types/PlanEntitlementResponseData.js +72 -0
- package/dist/serialization/types/PlanEntitlementsOrder.js +44 -0
- package/dist/serialization/types/PlanGroupDetailResponseData.js +55 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.js +71 -0
- package/dist/serialization/types/PlanGroupPlanEntitlementsOrder.js +45 -0
- package/dist/serialization/types/PlanGroupResponseData.js +51 -0
- package/dist/serialization/types/PlanResponseData.js +50 -0
- package/dist/serialization/types/PlanTraitResponseData.js +50 -0
- package/dist/serialization/types/PreviewObject.js +46 -0
- package/dist/serialization/types/PreviewObjectResponseData.js +46 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.js +55 -0
- package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.js +52 -0
- package/dist/serialization/types/PreviewSubscriptionUpcomingInvoiceLineItems.js +47 -0
- package/dist/serialization/types/QuickstartResp.js +43 -0
- package/dist/serialization/types/RawEventBatchResponseData.js +44 -0
- package/dist/serialization/types/RawEventResponseData.js +47 -0
- package/dist/serialization/types/RuleConditionDetailResponseData.js +66 -0
- package/dist/serialization/types/RuleConditionGroupDetailResponseData.js +51 -0
- package/dist/serialization/types/RuleConditionGroupResponseData.js +49 -0
- package/dist/serialization/types/RuleConditionResponseData.js +61 -0
- package/dist/serialization/types/RuleDetailResponseData.js +56 -0
- package/dist/serialization/types/RuleResponseData.js +52 -0
- package/dist/serialization/types/RulesDetailResponseData.js +46 -0
- package/dist/serialization/types/SegmentStatusResp.js +45 -0
- package/dist/serialization/types/StripeEmbedInfo.js +44 -0
- package/dist/serialization/types/TemporaryAccessTokenResponseData.js +49 -0
- package/dist/serialization/types/UpdateAddOnRequestBody.js +44 -0
- package/dist/serialization/types/UpdateCreditBundleRequestBody.js +44 -0
- package/dist/serialization/types/UpdateEntitlementReqCommon.js +52 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonMetricPeriod.js +41 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.js +41 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonValueType.d.ts +10 -0
- package/dist/serialization/types/UpdateEntitlementReqCommonValueType.js +41 -0
- package/dist/serialization/types/UpdatePayInAdvanceRequestBody.js +44 -0
- package/dist/serialization/types/UpdateRuleRequestBody.js +49 -0
- package/dist/serialization/types/UpsertCompanyRequestBody.js +48 -0
- package/dist/serialization/types/UpsertTraitRequestBody.js +47 -0
- package/dist/serialization/types/UpsertUserRequestBody.js +54 -0
- package/dist/serialization/types/UpsertUserSubRequestBody.js +50 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBody.js +57 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBodyPriceBehavior.d.ts +10 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBodyPriceBehavior.js +41 -0
- package/dist/serialization/types/UsageBasedEntitlementResponseData.js +54 -0
- package/dist/serialization/types/UserDetailResponseData.js +55 -0
- package/dist/serialization/types/UserResponseData.js +48 -0
- package/dist/serialization/types/WebhookEventDetailResponseData.js +53 -0
- package/dist/serialization/types/WebhookEventResponseData.js +51 -0
- package/dist/serialization/types/WebhookResponseData.js +52 -0
- package/dist/serialization/types/index.js +188 -0
- package/dist/webhooks.js +170 -0
- package/dist/wrapper.js +178 -0
- package/package.json +66 -66
|
@@ -0,0 +1,4102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Companies = void 0;
|
|
52
|
+
const environments = __importStar(require("../../../../environments"));
|
|
53
|
+
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const Schematic = __importStar(require("../../../index"));
|
|
55
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
56
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
57
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
58
|
+
const json_1 = require("../../../../core/json");
|
|
59
|
+
class Companies {
|
|
60
|
+
constructor(_options) {
|
|
61
|
+
this._options = _options;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @param {Schematic.ListCompaniesRequest} request
|
|
65
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link Schematic.BadRequestError}
|
|
68
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
69
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
70
|
+
* @throws {@link Schematic.NotFoundError}
|
|
71
|
+
* @throws {@link Schematic.InternalServerError}
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* await client.companies.listCompanies()
|
|
75
|
+
*/
|
|
76
|
+
listCompanies(request = {}, requestOptions) {
|
|
77
|
+
return core.HttpResponsePromise.fromPromise(this.__listCompanies(request, requestOptions));
|
|
78
|
+
}
|
|
79
|
+
__listCompanies() {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
81
|
+
var _a, _b, _c;
|
|
82
|
+
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, withSubscription, limit, offset } = request;
|
|
83
|
+
const _queryParams = {};
|
|
84
|
+
if (ids != null) {
|
|
85
|
+
if (Array.isArray(ids)) {
|
|
86
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
_queryParams["ids"] = ids;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (planId != null) {
|
|
93
|
+
_queryParams["plan_id"] = planId;
|
|
94
|
+
}
|
|
95
|
+
if (q != null) {
|
|
96
|
+
_queryParams["q"] = q;
|
|
97
|
+
}
|
|
98
|
+
if (withoutFeatureOverrideFor != null) {
|
|
99
|
+
_queryParams["without_feature_override_for"] = withoutFeatureOverrideFor;
|
|
100
|
+
}
|
|
101
|
+
if (withoutPlan != null) {
|
|
102
|
+
_queryParams["without_plan"] = withoutPlan.toString();
|
|
103
|
+
}
|
|
104
|
+
if (withSubscription != null) {
|
|
105
|
+
_queryParams["with_subscription"] = withSubscription.toString();
|
|
106
|
+
}
|
|
107
|
+
if (limit != null) {
|
|
108
|
+
_queryParams["limit"] = limit.toString();
|
|
109
|
+
}
|
|
110
|
+
if (offset != null) {
|
|
111
|
+
_queryParams["offset"] = offset.toString();
|
|
112
|
+
}
|
|
113
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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"),
|
|
115
|
+
method: "GET",
|
|
116
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
117
|
+
contentType: "application/json",
|
|
118
|
+
queryParameters: _queryParams,
|
|
119
|
+
requestType: "json",
|
|
120
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
121
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
122
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
123
|
+
});
|
|
124
|
+
if (_response.ok) {
|
|
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
|
+
};
|
|
135
|
+
}
|
|
136
|
+
if (_response.error.reason === "status-code") {
|
|
137
|
+
switch (_response.error.statusCode) {
|
|
138
|
+
case 400:
|
|
139
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
140
|
+
unrecognizedObjectKeys: "passthrough",
|
|
141
|
+
allowUnrecognizedUnionMembers: true,
|
|
142
|
+
allowUnrecognizedEnumValues: true,
|
|
143
|
+
skipValidation: true,
|
|
144
|
+
breadcrumbsPrefix: ["response"],
|
|
145
|
+
}), _response.rawResponse);
|
|
146
|
+
case 401:
|
|
147
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
148
|
+
unrecognizedObjectKeys: "passthrough",
|
|
149
|
+
allowUnrecognizedUnionMembers: true,
|
|
150
|
+
allowUnrecognizedEnumValues: true,
|
|
151
|
+
skipValidation: true,
|
|
152
|
+
breadcrumbsPrefix: ["response"],
|
|
153
|
+
}), _response.rawResponse);
|
|
154
|
+
case 403:
|
|
155
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
156
|
+
unrecognizedObjectKeys: "passthrough",
|
|
157
|
+
allowUnrecognizedUnionMembers: true,
|
|
158
|
+
allowUnrecognizedEnumValues: true,
|
|
159
|
+
skipValidation: true,
|
|
160
|
+
breadcrumbsPrefix: ["response"],
|
|
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);
|
|
170
|
+
case 500:
|
|
171
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
172
|
+
unrecognizedObjectKeys: "passthrough",
|
|
173
|
+
allowUnrecognizedUnionMembers: true,
|
|
174
|
+
allowUnrecognizedEnumValues: true,
|
|
175
|
+
skipValidation: true,
|
|
176
|
+
breadcrumbsPrefix: ["response"],
|
|
177
|
+
}), _response.rawResponse);
|
|
178
|
+
default:
|
|
179
|
+
throw new errors.SchematicError({
|
|
180
|
+
statusCode: _response.error.statusCode,
|
|
181
|
+
body: _response.error.body,
|
|
182
|
+
rawResponse: _response.rawResponse,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
switch (_response.error.reason) {
|
|
187
|
+
case "non-json":
|
|
188
|
+
throw new errors.SchematicError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.rawBody,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
});
|
|
193
|
+
case "timeout":
|
|
194
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies.");
|
|
195
|
+
case "unknown":
|
|
196
|
+
throw new errors.SchematicError({
|
|
197
|
+
message: _response.error.errorMessage,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @param {Schematic.UpsertCompanyRequestBody} request
|
|
205
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
+
*
|
|
207
|
+
* @throws {@link Schematic.BadRequestError}
|
|
208
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
209
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
210
|
+
* @throws {@link Schematic.NotFoundError}
|
|
211
|
+
* @throws {@link Schematic.InternalServerError}
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* await client.companies.upsertCompany({
|
|
215
|
+
* keys: {
|
|
216
|
+
* "key": "value"
|
|
217
|
+
* }
|
|
218
|
+
* })
|
|
219
|
+
*/
|
|
220
|
+
upsertCompany(request, requestOptions) {
|
|
221
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCompany(request, requestOptions));
|
|
222
|
+
}
|
|
223
|
+
__upsertCompany(request, requestOptions) {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
var _a, _b, _c;
|
|
226
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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"),
|
|
228
|
+
method: "POST",
|
|
229
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
230
|
+
contentType: "application/json",
|
|
231
|
+
requestType: "json",
|
|
232
|
+
body: serializers.UpsertCompanyRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
233
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
234
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
235
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
|
+
});
|
|
237
|
+
if (_response.ok) {
|
|
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
|
+
};
|
|
248
|
+
}
|
|
249
|
+
if (_response.error.reason === "status-code") {
|
|
250
|
+
switch (_response.error.statusCode) {
|
|
251
|
+
case 400:
|
|
252
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
253
|
+
unrecognizedObjectKeys: "passthrough",
|
|
254
|
+
allowUnrecognizedUnionMembers: true,
|
|
255
|
+
allowUnrecognizedEnumValues: true,
|
|
256
|
+
skipValidation: true,
|
|
257
|
+
breadcrumbsPrefix: ["response"],
|
|
258
|
+
}), _response.rawResponse);
|
|
259
|
+
case 401:
|
|
260
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
261
|
+
unrecognizedObjectKeys: "passthrough",
|
|
262
|
+
allowUnrecognizedUnionMembers: true,
|
|
263
|
+
allowUnrecognizedEnumValues: true,
|
|
264
|
+
skipValidation: true,
|
|
265
|
+
breadcrumbsPrefix: ["response"],
|
|
266
|
+
}), _response.rawResponse);
|
|
267
|
+
case 403:
|
|
268
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
269
|
+
unrecognizedObjectKeys: "passthrough",
|
|
270
|
+
allowUnrecognizedUnionMembers: true,
|
|
271
|
+
allowUnrecognizedEnumValues: true,
|
|
272
|
+
skipValidation: true,
|
|
273
|
+
breadcrumbsPrefix: ["response"],
|
|
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);
|
|
283
|
+
case 500:
|
|
284
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
285
|
+
unrecognizedObjectKeys: "passthrough",
|
|
286
|
+
allowUnrecognizedUnionMembers: true,
|
|
287
|
+
allowUnrecognizedEnumValues: true,
|
|
288
|
+
skipValidation: true,
|
|
289
|
+
breadcrumbsPrefix: ["response"],
|
|
290
|
+
}), _response.rawResponse);
|
|
291
|
+
default:
|
|
292
|
+
throw new errors.SchematicError({
|
|
293
|
+
statusCode: _response.error.statusCode,
|
|
294
|
+
body: _response.error.body,
|
|
295
|
+
rawResponse: _response.rawResponse,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
switch (_response.error.reason) {
|
|
300
|
+
case "non-json":
|
|
301
|
+
throw new errors.SchematicError({
|
|
302
|
+
statusCode: _response.error.statusCode,
|
|
303
|
+
body: _response.error.rawBody,
|
|
304
|
+
rawResponse: _response.rawResponse,
|
|
305
|
+
});
|
|
306
|
+
case "timeout":
|
|
307
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies.");
|
|
308
|
+
case "unknown":
|
|
309
|
+
throw new errors.SchematicError({
|
|
310
|
+
message: _response.error.errorMessage,
|
|
311
|
+
rawResponse: _response.rawResponse,
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* @param {string} companyId - company_id
|
|
318
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
319
|
+
*
|
|
320
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
321
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
322
|
+
* @throws {@link Schematic.NotFoundError}
|
|
323
|
+
* @throws {@link Schematic.InternalServerError}
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* await client.companies.getCompany("company_id")
|
|
327
|
+
*/
|
|
328
|
+
getCompany(companyId, requestOptions) {
|
|
329
|
+
return core.HttpResponsePromise.fromPromise(this.__getCompany(companyId, requestOptions));
|
|
330
|
+
}
|
|
331
|
+
__getCompany(companyId, requestOptions) {
|
|
332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
+
var _a, _b, _c;
|
|
334
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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)}`),
|
|
336
|
+
method: "GET",
|
|
337
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
338
|
+
contentType: "application/json",
|
|
339
|
+
requestType: "json",
|
|
340
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
341
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
342
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
343
|
+
});
|
|
344
|
+
if (_response.ok) {
|
|
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
|
+
};
|
|
355
|
+
}
|
|
356
|
+
if (_response.error.reason === "status-code") {
|
|
357
|
+
switch (_response.error.statusCode) {
|
|
358
|
+
case 401:
|
|
359
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
360
|
+
unrecognizedObjectKeys: "passthrough",
|
|
361
|
+
allowUnrecognizedUnionMembers: true,
|
|
362
|
+
allowUnrecognizedEnumValues: true,
|
|
363
|
+
skipValidation: true,
|
|
364
|
+
breadcrumbsPrefix: ["response"],
|
|
365
|
+
}), _response.rawResponse);
|
|
366
|
+
case 403:
|
|
367
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
368
|
+
unrecognizedObjectKeys: "passthrough",
|
|
369
|
+
allowUnrecognizedUnionMembers: true,
|
|
370
|
+
allowUnrecognizedEnumValues: true,
|
|
371
|
+
skipValidation: true,
|
|
372
|
+
breadcrumbsPrefix: ["response"],
|
|
373
|
+
}), _response.rawResponse);
|
|
374
|
+
case 404:
|
|
375
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
376
|
+
unrecognizedObjectKeys: "passthrough",
|
|
377
|
+
allowUnrecognizedUnionMembers: true,
|
|
378
|
+
allowUnrecognizedEnumValues: true,
|
|
379
|
+
skipValidation: true,
|
|
380
|
+
breadcrumbsPrefix: ["response"],
|
|
381
|
+
}), _response.rawResponse);
|
|
382
|
+
case 500:
|
|
383
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
384
|
+
unrecognizedObjectKeys: "passthrough",
|
|
385
|
+
allowUnrecognizedUnionMembers: true,
|
|
386
|
+
allowUnrecognizedEnumValues: true,
|
|
387
|
+
skipValidation: true,
|
|
388
|
+
breadcrumbsPrefix: ["response"],
|
|
389
|
+
}), _response.rawResponse);
|
|
390
|
+
default:
|
|
391
|
+
throw new errors.SchematicError({
|
|
392
|
+
statusCode: _response.error.statusCode,
|
|
393
|
+
body: _response.error.body,
|
|
394
|
+
rawResponse: _response.rawResponse,
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
switch (_response.error.reason) {
|
|
399
|
+
case "non-json":
|
|
400
|
+
throw new errors.SchematicError({
|
|
401
|
+
statusCode: _response.error.statusCode,
|
|
402
|
+
body: _response.error.rawBody,
|
|
403
|
+
rawResponse: _response.rawResponse,
|
|
404
|
+
});
|
|
405
|
+
case "timeout":
|
|
406
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/{company_id}.");
|
|
407
|
+
case "unknown":
|
|
408
|
+
throw new errors.SchematicError({
|
|
409
|
+
message: _response.error.errorMessage,
|
|
410
|
+
rawResponse: _response.rawResponse,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @param {string} companyId - company_id
|
|
417
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
418
|
+
*
|
|
419
|
+
* @throws {@link Schematic.BadRequestError}
|
|
420
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
421
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
422
|
+
* @throws {@link Schematic.NotFoundError}
|
|
423
|
+
* @throws {@link Schematic.InternalServerError}
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* await client.companies.deleteCompany("company_id")
|
|
427
|
+
*/
|
|
428
|
+
deleteCompany(companyId, requestOptions) {
|
|
429
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompany(companyId, requestOptions));
|
|
430
|
+
}
|
|
431
|
+
__deleteCompany(companyId, requestOptions) {
|
|
432
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
433
|
+
var _a, _b, _c;
|
|
434
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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)}`),
|
|
436
|
+
method: "DELETE",
|
|
437
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
438
|
+
contentType: "application/json",
|
|
439
|
+
requestType: "json",
|
|
440
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
441
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
442
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
443
|
+
});
|
|
444
|
+
if (_response.ok) {
|
|
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
|
+
};
|
|
455
|
+
}
|
|
456
|
+
if (_response.error.reason === "status-code") {
|
|
457
|
+
switch (_response.error.statusCode) {
|
|
458
|
+
case 400:
|
|
459
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
460
|
+
unrecognizedObjectKeys: "passthrough",
|
|
461
|
+
allowUnrecognizedUnionMembers: true,
|
|
462
|
+
allowUnrecognizedEnumValues: true,
|
|
463
|
+
skipValidation: true,
|
|
464
|
+
breadcrumbsPrefix: ["response"],
|
|
465
|
+
}), _response.rawResponse);
|
|
466
|
+
case 401:
|
|
467
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
468
|
+
unrecognizedObjectKeys: "passthrough",
|
|
469
|
+
allowUnrecognizedUnionMembers: true,
|
|
470
|
+
allowUnrecognizedEnumValues: true,
|
|
471
|
+
skipValidation: true,
|
|
472
|
+
breadcrumbsPrefix: ["response"],
|
|
473
|
+
}), _response.rawResponse);
|
|
474
|
+
case 403:
|
|
475
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
476
|
+
unrecognizedObjectKeys: "passthrough",
|
|
477
|
+
allowUnrecognizedUnionMembers: true,
|
|
478
|
+
allowUnrecognizedEnumValues: true,
|
|
479
|
+
skipValidation: true,
|
|
480
|
+
breadcrumbsPrefix: ["response"],
|
|
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);
|
|
490
|
+
case 500:
|
|
491
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
492
|
+
unrecognizedObjectKeys: "passthrough",
|
|
493
|
+
allowUnrecognizedUnionMembers: true,
|
|
494
|
+
allowUnrecognizedEnumValues: true,
|
|
495
|
+
skipValidation: true,
|
|
496
|
+
breadcrumbsPrefix: ["response"],
|
|
497
|
+
}), _response.rawResponse);
|
|
498
|
+
default:
|
|
499
|
+
throw new errors.SchematicError({
|
|
500
|
+
statusCode: _response.error.statusCode,
|
|
501
|
+
body: _response.error.body,
|
|
502
|
+
rawResponse: _response.rawResponse,
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
switch (_response.error.reason) {
|
|
507
|
+
case "non-json":
|
|
508
|
+
throw new errors.SchematicError({
|
|
509
|
+
statusCode: _response.error.statusCode,
|
|
510
|
+
body: _response.error.rawBody,
|
|
511
|
+
rawResponse: _response.rawResponse,
|
|
512
|
+
});
|
|
513
|
+
case "timeout":
|
|
514
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /companies/{company_id}.");
|
|
515
|
+
case "unknown":
|
|
516
|
+
throw new errors.SchematicError({
|
|
517
|
+
message: _response.error.errorMessage,
|
|
518
|
+
rawResponse: _response.rawResponse,
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @param {Schematic.CountCompaniesRequest} request
|
|
525
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
526
|
+
*
|
|
527
|
+
* @throws {@link Schematic.BadRequestError}
|
|
528
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
529
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
530
|
+
* @throws {@link Schematic.NotFoundError}
|
|
531
|
+
* @throws {@link Schematic.InternalServerError}
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* await client.companies.countCompanies()
|
|
535
|
+
*/
|
|
536
|
+
countCompanies(request = {}, requestOptions) {
|
|
537
|
+
return core.HttpResponsePromise.fromPromise(this.__countCompanies(request, requestOptions));
|
|
538
|
+
}
|
|
539
|
+
__countCompanies() {
|
|
540
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
541
|
+
var _a, _b, _c;
|
|
542
|
+
const { ids, planId, q, withoutFeatureOverrideFor, withoutPlan, withSubscription, limit, offset } = request;
|
|
543
|
+
const _queryParams = {};
|
|
544
|
+
if (ids != null) {
|
|
545
|
+
if (Array.isArray(ids)) {
|
|
546
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
_queryParams["ids"] = ids;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (planId != null) {
|
|
553
|
+
_queryParams["plan_id"] = planId;
|
|
554
|
+
}
|
|
555
|
+
if (q != null) {
|
|
556
|
+
_queryParams["q"] = q;
|
|
557
|
+
}
|
|
558
|
+
if (withoutFeatureOverrideFor != null) {
|
|
559
|
+
_queryParams["without_feature_override_for"] = withoutFeatureOverrideFor;
|
|
560
|
+
}
|
|
561
|
+
if (withoutPlan != null) {
|
|
562
|
+
_queryParams["without_plan"] = withoutPlan.toString();
|
|
563
|
+
}
|
|
564
|
+
if (withSubscription != null) {
|
|
565
|
+
_queryParams["with_subscription"] = withSubscription.toString();
|
|
566
|
+
}
|
|
567
|
+
if (limit != null) {
|
|
568
|
+
_queryParams["limit"] = limit.toString();
|
|
569
|
+
}
|
|
570
|
+
if (offset != null) {
|
|
571
|
+
_queryParams["offset"] = offset.toString();
|
|
572
|
+
}
|
|
573
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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"),
|
|
575
|
+
method: "GET",
|
|
576
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
577
|
+
contentType: "application/json",
|
|
578
|
+
queryParameters: _queryParams,
|
|
579
|
+
requestType: "json",
|
|
580
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
581
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
582
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
583
|
+
});
|
|
584
|
+
if (_response.ok) {
|
|
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
|
+
};
|
|
595
|
+
}
|
|
596
|
+
if (_response.error.reason === "status-code") {
|
|
597
|
+
switch (_response.error.statusCode) {
|
|
598
|
+
case 400:
|
|
599
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
600
|
+
unrecognizedObjectKeys: "passthrough",
|
|
601
|
+
allowUnrecognizedUnionMembers: true,
|
|
602
|
+
allowUnrecognizedEnumValues: true,
|
|
603
|
+
skipValidation: true,
|
|
604
|
+
breadcrumbsPrefix: ["response"],
|
|
605
|
+
}), _response.rawResponse);
|
|
606
|
+
case 401:
|
|
607
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
608
|
+
unrecognizedObjectKeys: "passthrough",
|
|
609
|
+
allowUnrecognizedUnionMembers: true,
|
|
610
|
+
allowUnrecognizedEnumValues: true,
|
|
611
|
+
skipValidation: true,
|
|
612
|
+
breadcrumbsPrefix: ["response"],
|
|
613
|
+
}), _response.rawResponse);
|
|
614
|
+
case 403:
|
|
615
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
616
|
+
unrecognizedObjectKeys: "passthrough",
|
|
617
|
+
allowUnrecognizedUnionMembers: true,
|
|
618
|
+
allowUnrecognizedEnumValues: true,
|
|
619
|
+
skipValidation: true,
|
|
620
|
+
breadcrumbsPrefix: ["response"],
|
|
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);
|
|
630
|
+
case 500:
|
|
631
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
632
|
+
unrecognizedObjectKeys: "passthrough",
|
|
633
|
+
allowUnrecognizedUnionMembers: true,
|
|
634
|
+
allowUnrecognizedEnumValues: true,
|
|
635
|
+
skipValidation: true,
|
|
636
|
+
breadcrumbsPrefix: ["response"],
|
|
637
|
+
}), _response.rawResponse);
|
|
638
|
+
default:
|
|
639
|
+
throw new errors.SchematicError({
|
|
640
|
+
statusCode: _response.error.statusCode,
|
|
641
|
+
body: _response.error.body,
|
|
642
|
+
rawResponse: _response.rawResponse,
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
switch (_response.error.reason) {
|
|
647
|
+
case "non-json":
|
|
648
|
+
throw new errors.SchematicError({
|
|
649
|
+
statusCode: _response.error.statusCode,
|
|
650
|
+
body: _response.error.rawBody,
|
|
651
|
+
rawResponse: _response.rawResponse,
|
|
652
|
+
});
|
|
653
|
+
case "timeout":
|
|
654
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/count.");
|
|
655
|
+
case "unknown":
|
|
656
|
+
throw new errors.SchematicError({
|
|
657
|
+
message: _response.error.errorMessage,
|
|
658
|
+
rawResponse: _response.rawResponse,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* @param {Schematic.CountCompaniesForAdvancedFilterRequest} request
|
|
665
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
666
|
+
*
|
|
667
|
+
* @throws {@link Schematic.BadRequestError}
|
|
668
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
669
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
670
|
+
* @throws {@link Schematic.NotFoundError}
|
|
671
|
+
* @throws {@link Schematic.InternalServerError}
|
|
672
|
+
*
|
|
673
|
+
* @example
|
|
674
|
+
* await client.companies.countCompaniesForAdvancedFilter()
|
|
675
|
+
*/
|
|
676
|
+
countCompaniesForAdvancedFilter(request = {}, requestOptions) {
|
|
677
|
+
return core.HttpResponsePromise.fromPromise(this.__countCompaniesForAdvancedFilter(request, requestOptions));
|
|
678
|
+
}
|
|
679
|
+
__countCompaniesForAdvancedFilter() {
|
|
680
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
681
|
+
var _a, _b, _c;
|
|
682
|
+
const { ids, planIds, featureIds, subscriptionStatuses, subscriptionTypes, monetizedSubscriptions, q, withoutPlan, withoutSubscription, sortOrderColumn, sortOrderDirection, displayProperties, limit, offset, } = request;
|
|
683
|
+
const _queryParams = {};
|
|
684
|
+
if (ids != null) {
|
|
685
|
+
if (Array.isArray(ids)) {
|
|
686
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
_queryParams["ids"] = ids;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (planIds != null) {
|
|
693
|
+
if (Array.isArray(planIds)) {
|
|
694
|
+
_queryParams["plan_ids"] = planIds.map((item) => item);
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
_queryParams["plan_ids"] = planIds;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (featureIds != null) {
|
|
701
|
+
if (Array.isArray(featureIds)) {
|
|
702
|
+
_queryParams["feature_ids"] = featureIds.map((item) => item);
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
_queryParams["feature_ids"] = featureIds;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
if (subscriptionStatuses != null) {
|
|
709
|
+
if (Array.isArray(subscriptionStatuses)) {
|
|
710
|
+
_queryParams["subscription_statuses"] = subscriptionStatuses.map((item) => item);
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
_queryParams["subscription_statuses"] = subscriptionStatuses;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
if (subscriptionTypes != null) {
|
|
717
|
+
if (Array.isArray(subscriptionTypes)) {
|
|
718
|
+
_queryParams["subscription_types"] = subscriptionTypes.map((item) => item);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
_queryParams["subscription_types"] = subscriptionTypes;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (monetizedSubscriptions != null) {
|
|
725
|
+
_queryParams["monetized_subscriptions"] = monetizedSubscriptions.toString();
|
|
726
|
+
}
|
|
727
|
+
if (q != null) {
|
|
728
|
+
_queryParams["q"] = q;
|
|
729
|
+
}
|
|
730
|
+
if (withoutPlan != null) {
|
|
731
|
+
_queryParams["without_plan"] = withoutPlan.toString();
|
|
732
|
+
}
|
|
733
|
+
if (withoutSubscription != null) {
|
|
734
|
+
_queryParams["without_subscription"] = withoutSubscription.toString();
|
|
735
|
+
}
|
|
736
|
+
if (sortOrderColumn != null) {
|
|
737
|
+
_queryParams["sort_order_column"] = sortOrderColumn;
|
|
738
|
+
}
|
|
739
|
+
if (sortOrderDirection != null) {
|
|
740
|
+
_queryParams["sort_order_direction"] =
|
|
741
|
+
serializers.CountCompaniesForAdvancedFilterRequestSortOrderDirection.jsonOrThrow(sortOrderDirection, {
|
|
742
|
+
unrecognizedObjectKeys: "strip",
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
if (displayProperties != null) {
|
|
746
|
+
if (Array.isArray(displayProperties)) {
|
|
747
|
+
_queryParams["display_properties"] = displayProperties.map((item) => item);
|
|
748
|
+
}
|
|
749
|
+
else {
|
|
750
|
+
_queryParams["display_properties"] = displayProperties;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (limit != null) {
|
|
754
|
+
_queryParams["limit"] = limit.toString();
|
|
755
|
+
}
|
|
756
|
+
if (offset != null) {
|
|
757
|
+
_queryParams["offset"] = offset.toString();
|
|
758
|
+
}
|
|
759
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
760
|
+
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/count2"),
|
|
761
|
+
method: "GET",
|
|
762
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
763
|
+
contentType: "application/json",
|
|
764
|
+
queryParameters: _queryParams,
|
|
765
|
+
requestType: "json",
|
|
766
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
767
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
768
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
769
|
+
});
|
|
770
|
+
if (_response.ok) {
|
|
771
|
+
return {
|
|
772
|
+
data: serializers.CountCompaniesForAdvancedFilterResponse.parseOrThrow(_response.body, {
|
|
773
|
+
unrecognizedObjectKeys: "passthrough",
|
|
774
|
+
allowUnrecognizedUnionMembers: true,
|
|
775
|
+
allowUnrecognizedEnumValues: true,
|
|
776
|
+
skipValidation: true,
|
|
777
|
+
breadcrumbsPrefix: ["response"],
|
|
778
|
+
}),
|
|
779
|
+
rawResponse: _response.rawResponse,
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
if (_response.error.reason === "status-code") {
|
|
783
|
+
switch (_response.error.statusCode) {
|
|
784
|
+
case 400:
|
|
785
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
786
|
+
unrecognizedObjectKeys: "passthrough",
|
|
787
|
+
allowUnrecognizedUnionMembers: true,
|
|
788
|
+
allowUnrecognizedEnumValues: true,
|
|
789
|
+
skipValidation: true,
|
|
790
|
+
breadcrumbsPrefix: ["response"],
|
|
791
|
+
}), _response.rawResponse);
|
|
792
|
+
case 401:
|
|
793
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
794
|
+
unrecognizedObjectKeys: "passthrough",
|
|
795
|
+
allowUnrecognizedUnionMembers: true,
|
|
796
|
+
allowUnrecognizedEnumValues: true,
|
|
797
|
+
skipValidation: true,
|
|
798
|
+
breadcrumbsPrefix: ["response"],
|
|
799
|
+
}), _response.rawResponse);
|
|
800
|
+
case 403:
|
|
801
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
802
|
+
unrecognizedObjectKeys: "passthrough",
|
|
803
|
+
allowUnrecognizedUnionMembers: true,
|
|
804
|
+
allowUnrecognizedEnumValues: true,
|
|
805
|
+
skipValidation: true,
|
|
806
|
+
breadcrumbsPrefix: ["response"],
|
|
807
|
+
}), _response.rawResponse);
|
|
808
|
+
case 404:
|
|
809
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
810
|
+
unrecognizedObjectKeys: "passthrough",
|
|
811
|
+
allowUnrecognizedUnionMembers: true,
|
|
812
|
+
allowUnrecognizedEnumValues: true,
|
|
813
|
+
skipValidation: true,
|
|
814
|
+
breadcrumbsPrefix: ["response"],
|
|
815
|
+
}), _response.rawResponse);
|
|
816
|
+
case 500:
|
|
817
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
818
|
+
unrecognizedObjectKeys: "passthrough",
|
|
819
|
+
allowUnrecognizedUnionMembers: true,
|
|
820
|
+
allowUnrecognizedEnumValues: true,
|
|
821
|
+
skipValidation: true,
|
|
822
|
+
breadcrumbsPrefix: ["response"],
|
|
823
|
+
}), _response.rawResponse);
|
|
824
|
+
default:
|
|
825
|
+
throw new errors.SchematicError({
|
|
826
|
+
statusCode: _response.error.statusCode,
|
|
827
|
+
body: _response.error.body,
|
|
828
|
+
rawResponse: _response.rawResponse,
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
switch (_response.error.reason) {
|
|
833
|
+
case "non-json":
|
|
834
|
+
throw new errors.SchematicError({
|
|
835
|
+
statusCode: _response.error.statusCode,
|
|
836
|
+
body: _response.error.rawBody,
|
|
837
|
+
rawResponse: _response.rawResponse,
|
|
838
|
+
});
|
|
839
|
+
case "timeout":
|
|
840
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/count2.");
|
|
841
|
+
case "unknown":
|
|
842
|
+
throw new errors.SchematicError({
|
|
843
|
+
message: _response.error.errorMessage,
|
|
844
|
+
rawResponse: _response.rawResponse,
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* @param {Schematic.UpsertCompanyRequestBody} request
|
|
851
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
852
|
+
*
|
|
853
|
+
* @throws {@link Schematic.BadRequestError}
|
|
854
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
855
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
856
|
+
* @throws {@link Schematic.NotFoundError}
|
|
857
|
+
* @throws {@link Schematic.InternalServerError}
|
|
858
|
+
*
|
|
859
|
+
* @example
|
|
860
|
+
* await client.companies.createCompany({
|
|
861
|
+
* keys: {
|
|
862
|
+
* "key": "value"
|
|
863
|
+
* }
|
|
864
|
+
* })
|
|
865
|
+
*/
|
|
866
|
+
createCompany(request, requestOptions) {
|
|
867
|
+
return core.HttpResponsePromise.fromPromise(this.__createCompany(request, requestOptions));
|
|
868
|
+
}
|
|
869
|
+
__createCompany(request, requestOptions) {
|
|
870
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
871
|
+
var _a, _b, _c;
|
|
872
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
873
|
+
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"),
|
|
874
|
+
method: "POST",
|
|
875
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
876
|
+
contentType: "application/json",
|
|
877
|
+
requestType: "json",
|
|
878
|
+
body: serializers.UpsertCompanyRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
879
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
880
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
881
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
882
|
+
});
|
|
883
|
+
if (_response.ok) {
|
|
884
|
+
return {
|
|
885
|
+
data: serializers.CreateCompanyResponse.parseOrThrow(_response.body, {
|
|
886
|
+
unrecognizedObjectKeys: "passthrough",
|
|
887
|
+
allowUnrecognizedUnionMembers: true,
|
|
888
|
+
allowUnrecognizedEnumValues: true,
|
|
889
|
+
skipValidation: true,
|
|
890
|
+
breadcrumbsPrefix: ["response"],
|
|
891
|
+
}),
|
|
892
|
+
rawResponse: _response.rawResponse,
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
if (_response.error.reason === "status-code") {
|
|
896
|
+
switch (_response.error.statusCode) {
|
|
897
|
+
case 400:
|
|
898
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
899
|
+
unrecognizedObjectKeys: "passthrough",
|
|
900
|
+
allowUnrecognizedUnionMembers: true,
|
|
901
|
+
allowUnrecognizedEnumValues: true,
|
|
902
|
+
skipValidation: true,
|
|
903
|
+
breadcrumbsPrefix: ["response"],
|
|
904
|
+
}), _response.rawResponse);
|
|
905
|
+
case 401:
|
|
906
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
907
|
+
unrecognizedObjectKeys: "passthrough",
|
|
908
|
+
allowUnrecognizedUnionMembers: true,
|
|
909
|
+
allowUnrecognizedEnumValues: true,
|
|
910
|
+
skipValidation: true,
|
|
911
|
+
breadcrumbsPrefix: ["response"],
|
|
912
|
+
}), _response.rawResponse);
|
|
913
|
+
case 403:
|
|
914
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
915
|
+
unrecognizedObjectKeys: "passthrough",
|
|
916
|
+
allowUnrecognizedUnionMembers: true,
|
|
917
|
+
allowUnrecognizedEnumValues: true,
|
|
918
|
+
skipValidation: true,
|
|
919
|
+
breadcrumbsPrefix: ["response"],
|
|
920
|
+
}), _response.rawResponse);
|
|
921
|
+
case 404:
|
|
922
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
923
|
+
unrecognizedObjectKeys: "passthrough",
|
|
924
|
+
allowUnrecognizedUnionMembers: true,
|
|
925
|
+
allowUnrecognizedEnumValues: true,
|
|
926
|
+
skipValidation: true,
|
|
927
|
+
breadcrumbsPrefix: ["response"],
|
|
928
|
+
}), _response.rawResponse);
|
|
929
|
+
case 500:
|
|
930
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
931
|
+
unrecognizedObjectKeys: "passthrough",
|
|
932
|
+
allowUnrecognizedUnionMembers: true,
|
|
933
|
+
allowUnrecognizedEnumValues: true,
|
|
934
|
+
skipValidation: true,
|
|
935
|
+
breadcrumbsPrefix: ["response"],
|
|
936
|
+
}), _response.rawResponse);
|
|
937
|
+
default:
|
|
938
|
+
throw new errors.SchematicError({
|
|
939
|
+
statusCode: _response.error.statusCode,
|
|
940
|
+
body: _response.error.body,
|
|
941
|
+
rawResponse: _response.rawResponse,
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
switch (_response.error.reason) {
|
|
946
|
+
case "non-json":
|
|
947
|
+
throw new errors.SchematicError({
|
|
948
|
+
statusCode: _response.error.statusCode,
|
|
949
|
+
body: _response.error.rawBody,
|
|
950
|
+
rawResponse: _response.rawResponse,
|
|
951
|
+
});
|
|
952
|
+
case "timeout":
|
|
953
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies/create.");
|
|
954
|
+
case "unknown":
|
|
955
|
+
throw new errors.SchematicError({
|
|
956
|
+
message: _response.error.errorMessage,
|
|
957
|
+
rawResponse: _response.rawResponse,
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* @param {Schematic.KeysRequestBody} request
|
|
964
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
965
|
+
*
|
|
966
|
+
* @throws {@link Schematic.BadRequestError}
|
|
967
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
968
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
969
|
+
* @throws {@link Schematic.NotFoundError}
|
|
970
|
+
* @throws {@link Schematic.InternalServerError}
|
|
971
|
+
*
|
|
972
|
+
* @example
|
|
973
|
+
* await client.companies.deleteCompanyByKeys({
|
|
974
|
+
* keys: {
|
|
975
|
+
* "key": "value"
|
|
976
|
+
* }
|
|
977
|
+
* })
|
|
978
|
+
*/
|
|
979
|
+
deleteCompanyByKeys(request, requestOptions) {
|
|
980
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompanyByKeys(request, requestOptions));
|
|
981
|
+
}
|
|
982
|
+
__deleteCompanyByKeys(request, requestOptions) {
|
|
983
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
984
|
+
var _a, _b, _c;
|
|
985
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
986
|
+
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"),
|
|
987
|
+
method: "POST",
|
|
988
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
989
|
+
contentType: "application/json",
|
|
990
|
+
requestType: "json",
|
|
991
|
+
body: serializers.KeysRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
992
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
993
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
994
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
995
|
+
});
|
|
996
|
+
if (_response.ok) {
|
|
997
|
+
return {
|
|
998
|
+
data: serializers.DeleteCompanyByKeysResponse.parseOrThrow(_response.body, {
|
|
999
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1000
|
+
allowUnrecognizedUnionMembers: true,
|
|
1001
|
+
allowUnrecognizedEnumValues: true,
|
|
1002
|
+
skipValidation: true,
|
|
1003
|
+
breadcrumbsPrefix: ["response"],
|
|
1004
|
+
}),
|
|
1005
|
+
rawResponse: _response.rawResponse,
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
if (_response.error.reason === "status-code") {
|
|
1009
|
+
switch (_response.error.statusCode) {
|
|
1010
|
+
case 400:
|
|
1011
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1012
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1013
|
+
allowUnrecognizedUnionMembers: true,
|
|
1014
|
+
allowUnrecognizedEnumValues: true,
|
|
1015
|
+
skipValidation: true,
|
|
1016
|
+
breadcrumbsPrefix: ["response"],
|
|
1017
|
+
}), _response.rawResponse);
|
|
1018
|
+
case 401:
|
|
1019
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1020
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1021
|
+
allowUnrecognizedUnionMembers: true,
|
|
1022
|
+
allowUnrecognizedEnumValues: true,
|
|
1023
|
+
skipValidation: true,
|
|
1024
|
+
breadcrumbsPrefix: ["response"],
|
|
1025
|
+
}), _response.rawResponse);
|
|
1026
|
+
case 403:
|
|
1027
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1028
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1029
|
+
allowUnrecognizedUnionMembers: true,
|
|
1030
|
+
allowUnrecognizedEnumValues: true,
|
|
1031
|
+
skipValidation: true,
|
|
1032
|
+
breadcrumbsPrefix: ["response"],
|
|
1033
|
+
}), _response.rawResponse);
|
|
1034
|
+
case 404:
|
|
1035
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1036
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1037
|
+
allowUnrecognizedUnionMembers: true,
|
|
1038
|
+
allowUnrecognizedEnumValues: true,
|
|
1039
|
+
skipValidation: true,
|
|
1040
|
+
breadcrumbsPrefix: ["response"],
|
|
1041
|
+
}), _response.rawResponse);
|
|
1042
|
+
case 500:
|
|
1043
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1044
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1045
|
+
allowUnrecognizedUnionMembers: true,
|
|
1046
|
+
allowUnrecognizedEnumValues: true,
|
|
1047
|
+
skipValidation: true,
|
|
1048
|
+
breadcrumbsPrefix: ["response"],
|
|
1049
|
+
}), _response.rawResponse);
|
|
1050
|
+
default:
|
|
1051
|
+
throw new errors.SchematicError({
|
|
1052
|
+
statusCode: _response.error.statusCode,
|
|
1053
|
+
body: _response.error.body,
|
|
1054
|
+
rawResponse: _response.rawResponse,
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
switch (_response.error.reason) {
|
|
1059
|
+
case "non-json":
|
|
1060
|
+
throw new errors.SchematicError({
|
|
1061
|
+
statusCode: _response.error.statusCode,
|
|
1062
|
+
body: _response.error.rawBody,
|
|
1063
|
+
rawResponse: _response.rawResponse,
|
|
1064
|
+
});
|
|
1065
|
+
case "timeout":
|
|
1066
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /companies/delete.");
|
|
1067
|
+
case "unknown":
|
|
1068
|
+
throw new errors.SchematicError({
|
|
1069
|
+
message: _response.error.errorMessage,
|
|
1070
|
+
rawResponse: _response.rawResponse,
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* @param {Schematic.ListCompaniesForAdvancedFilterRequest} request
|
|
1077
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1078
|
+
*
|
|
1079
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1080
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1081
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1082
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1083
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* await client.companies.listCompaniesForAdvancedFilter()
|
|
1087
|
+
*/
|
|
1088
|
+
listCompaniesForAdvancedFilter(request = {}, requestOptions) {
|
|
1089
|
+
return core.HttpResponsePromise.fromPromise(this.__listCompaniesForAdvancedFilter(request, requestOptions));
|
|
1090
|
+
}
|
|
1091
|
+
__listCompaniesForAdvancedFilter() {
|
|
1092
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1093
|
+
var _a, _b, _c;
|
|
1094
|
+
const { ids, planIds, featureIds, subscriptionStatuses, subscriptionTypes, monetizedSubscriptions, q, withoutPlan, withoutSubscription, sortOrderColumn, sortOrderDirection, displayProperties, limit, offset, } = request;
|
|
1095
|
+
const _queryParams = {};
|
|
1096
|
+
if (ids != null) {
|
|
1097
|
+
if (Array.isArray(ids)) {
|
|
1098
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
_queryParams["ids"] = ids;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
if (planIds != null) {
|
|
1105
|
+
if (Array.isArray(planIds)) {
|
|
1106
|
+
_queryParams["plan_ids"] = planIds.map((item) => item);
|
|
1107
|
+
}
|
|
1108
|
+
else {
|
|
1109
|
+
_queryParams["plan_ids"] = planIds;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
if (featureIds != null) {
|
|
1113
|
+
if (Array.isArray(featureIds)) {
|
|
1114
|
+
_queryParams["feature_ids"] = featureIds.map((item) => item);
|
|
1115
|
+
}
|
|
1116
|
+
else {
|
|
1117
|
+
_queryParams["feature_ids"] = featureIds;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
if (subscriptionStatuses != null) {
|
|
1121
|
+
if (Array.isArray(subscriptionStatuses)) {
|
|
1122
|
+
_queryParams["subscription_statuses"] = subscriptionStatuses.map((item) => item);
|
|
1123
|
+
}
|
|
1124
|
+
else {
|
|
1125
|
+
_queryParams["subscription_statuses"] = subscriptionStatuses;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
if (subscriptionTypes != null) {
|
|
1129
|
+
if (Array.isArray(subscriptionTypes)) {
|
|
1130
|
+
_queryParams["subscription_types"] = subscriptionTypes.map((item) => item);
|
|
1131
|
+
}
|
|
1132
|
+
else {
|
|
1133
|
+
_queryParams["subscription_types"] = subscriptionTypes;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
if (monetizedSubscriptions != null) {
|
|
1137
|
+
_queryParams["monetized_subscriptions"] = monetizedSubscriptions.toString();
|
|
1138
|
+
}
|
|
1139
|
+
if (q != null) {
|
|
1140
|
+
_queryParams["q"] = q;
|
|
1141
|
+
}
|
|
1142
|
+
if (withoutPlan != null) {
|
|
1143
|
+
_queryParams["without_plan"] = withoutPlan.toString();
|
|
1144
|
+
}
|
|
1145
|
+
if (withoutSubscription != null) {
|
|
1146
|
+
_queryParams["without_subscription"] = withoutSubscription.toString();
|
|
1147
|
+
}
|
|
1148
|
+
if (sortOrderColumn != null) {
|
|
1149
|
+
_queryParams["sort_order_column"] = sortOrderColumn;
|
|
1150
|
+
}
|
|
1151
|
+
if (sortOrderDirection != null) {
|
|
1152
|
+
_queryParams["sort_order_direction"] =
|
|
1153
|
+
serializers.ListCompaniesForAdvancedFilterRequestSortOrderDirection.jsonOrThrow(sortOrderDirection, {
|
|
1154
|
+
unrecognizedObjectKeys: "strip",
|
|
1155
|
+
});
|
|
1156
|
+
}
|
|
1157
|
+
if (displayProperties != null) {
|
|
1158
|
+
if (Array.isArray(displayProperties)) {
|
|
1159
|
+
_queryParams["display_properties"] = displayProperties.map((item) => item);
|
|
1160
|
+
}
|
|
1161
|
+
else {
|
|
1162
|
+
_queryParams["display_properties"] = displayProperties;
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
if (limit != null) {
|
|
1166
|
+
_queryParams["limit"] = limit.toString();
|
|
1167
|
+
}
|
|
1168
|
+
if (offset != null) {
|
|
1169
|
+
_queryParams["offset"] = offset.toString();
|
|
1170
|
+
}
|
|
1171
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1172
|
+
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/list2"),
|
|
1173
|
+
method: "GET",
|
|
1174
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1175
|
+
contentType: "application/json",
|
|
1176
|
+
queryParameters: _queryParams,
|
|
1177
|
+
requestType: "json",
|
|
1178
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1179
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1180
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1181
|
+
});
|
|
1182
|
+
if (_response.ok) {
|
|
1183
|
+
return {
|
|
1184
|
+
data: serializers.ListCompaniesForAdvancedFilterResponse.parseOrThrow(_response.body, {
|
|
1185
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1186
|
+
allowUnrecognizedUnionMembers: true,
|
|
1187
|
+
allowUnrecognizedEnumValues: true,
|
|
1188
|
+
skipValidation: true,
|
|
1189
|
+
breadcrumbsPrefix: ["response"],
|
|
1190
|
+
}),
|
|
1191
|
+
rawResponse: _response.rawResponse,
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
if (_response.error.reason === "status-code") {
|
|
1195
|
+
switch (_response.error.statusCode) {
|
|
1196
|
+
case 400:
|
|
1197
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1198
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1199
|
+
allowUnrecognizedUnionMembers: true,
|
|
1200
|
+
allowUnrecognizedEnumValues: true,
|
|
1201
|
+
skipValidation: true,
|
|
1202
|
+
breadcrumbsPrefix: ["response"],
|
|
1203
|
+
}), _response.rawResponse);
|
|
1204
|
+
case 401:
|
|
1205
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1206
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1207
|
+
allowUnrecognizedUnionMembers: true,
|
|
1208
|
+
allowUnrecognizedEnumValues: true,
|
|
1209
|
+
skipValidation: true,
|
|
1210
|
+
breadcrumbsPrefix: ["response"],
|
|
1211
|
+
}), _response.rawResponse);
|
|
1212
|
+
case 403:
|
|
1213
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1214
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1215
|
+
allowUnrecognizedUnionMembers: true,
|
|
1216
|
+
allowUnrecognizedEnumValues: true,
|
|
1217
|
+
skipValidation: true,
|
|
1218
|
+
breadcrumbsPrefix: ["response"],
|
|
1219
|
+
}), _response.rawResponse);
|
|
1220
|
+
case 404:
|
|
1221
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1222
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1223
|
+
allowUnrecognizedUnionMembers: true,
|
|
1224
|
+
allowUnrecognizedEnumValues: true,
|
|
1225
|
+
skipValidation: true,
|
|
1226
|
+
breadcrumbsPrefix: ["response"],
|
|
1227
|
+
}), _response.rawResponse);
|
|
1228
|
+
case 500:
|
|
1229
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1230
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1231
|
+
allowUnrecognizedUnionMembers: true,
|
|
1232
|
+
allowUnrecognizedEnumValues: true,
|
|
1233
|
+
skipValidation: true,
|
|
1234
|
+
breadcrumbsPrefix: ["response"],
|
|
1235
|
+
}), _response.rawResponse);
|
|
1236
|
+
default:
|
|
1237
|
+
throw new errors.SchematicError({
|
|
1238
|
+
statusCode: _response.error.statusCode,
|
|
1239
|
+
body: _response.error.body,
|
|
1240
|
+
rawResponse: _response.rawResponse,
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
switch (_response.error.reason) {
|
|
1245
|
+
case "non-json":
|
|
1246
|
+
throw new errors.SchematicError({
|
|
1247
|
+
statusCode: _response.error.statusCode,
|
|
1248
|
+
body: _response.error.rawBody,
|
|
1249
|
+
rawResponse: _response.rawResponse,
|
|
1250
|
+
});
|
|
1251
|
+
case "timeout":
|
|
1252
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/list2.");
|
|
1253
|
+
case "unknown":
|
|
1254
|
+
throw new errors.SchematicError({
|
|
1255
|
+
message: _response.error.errorMessage,
|
|
1256
|
+
rawResponse: _response.rawResponse,
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* @param {Schematic.LookupCompanyRequest} request
|
|
1263
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1264
|
+
*
|
|
1265
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1266
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1267
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1268
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1269
|
+
*
|
|
1270
|
+
* @example
|
|
1271
|
+
* await client.companies.lookupCompany({
|
|
1272
|
+
* keys: {
|
|
1273
|
+
* "keys": "keys"
|
|
1274
|
+
* }
|
|
1275
|
+
* })
|
|
1276
|
+
*/
|
|
1277
|
+
lookupCompany(request, requestOptions) {
|
|
1278
|
+
return core.HttpResponsePromise.fromPromise(this.__lookupCompany(request, requestOptions));
|
|
1279
|
+
}
|
|
1280
|
+
__lookupCompany(request, requestOptions) {
|
|
1281
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1282
|
+
var _a, _b, _c;
|
|
1283
|
+
const { keys } = request;
|
|
1284
|
+
const _queryParams = {};
|
|
1285
|
+
_queryParams["keys"] = (0, json_1.toJson)(keys);
|
|
1286
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1287
|
+
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"),
|
|
1288
|
+
method: "GET",
|
|
1289
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1290
|
+
contentType: "application/json",
|
|
1291
|
+
queryParameters: _queryParams,
|
|
1292
|
+
requestType: "json",
|
|
1293
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1294
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1295
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1296
|
+
});
|
|
1297
|
+
if (_response.ok) {
|
|
1298
|
+
return {
|
|
1299
|
+
data: serializers.LookupCompanyResponse.parseOrThrow(_response.body, {
|
|
1300
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1301
|
+
allowUnrecognizedUnionMembers: true,
|
|
1302
|
+
allowUnrecognizedEnumValues: true,
|
|
1303
|
+
skipValidation: true,
|
|
1304
|
+
breadcrumbsPrefix: ["response"],
|
|
1305
|
+
}),
|
|
1306
|
+
rawResponse: _response.rawResponse,
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
if (_response.error.reason === "status-code") {
|
|
1310
|
+
switch (_response.error.statusCode) {
|
|
1311
|
+
case 401:
|
|
1312
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1313
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1314
|
+
allowUnrecognizedUnionMembers: true,
|
|
1315
|
+
allowUnrecognizedEnumValues: true,
|
|
1316
|
+
skipValidation: true,
|
|
1317
|
+
breadcrumbsPrefix: ["response"],
|
|
1318
|
+
}), _response.rawResponse);
|
|
1319
|
+
case 403:
|
|
1320
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1321
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1322
|
+
allowUnrecognizedUnionMembers: true,
|
|
1323
|
+
allowUnrecognizedEnumValues: true,
|
|
1324
|
+
skipValidation: true,
|
|
1325
|
+
breadcrumbsPrefix: ["response"],
|
|
1326
|
+
}), _response.rawResponse);
|
|
1327
|
+
case 404:
|
|
1328
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1329
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1330
|
+
allowUnrecognizedUnionMembers: true,
|
|
1331
|
+
allowUnrecognizedEnumValues: true,
|
|
1332
|
+
skipValidation: true,
|
|
1333
|
+
breadcrumbsPrefix: ["response"],
|
|
1334
|
+
}), _response.rawResponse);
|
|
1335
|
+
case 500:
|
|
1336
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1337
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1338
|
+
allowUnrecognizedUnionMembers: true,
|
|
1339
|
+
allowUnrecognizedEnumValues: true,
|
|
1340
|
+
skipValidation: true,
|
|
1341
|
+
breadcrumbsPrefix: ["response"],
|
|
1342
|
+
}), _response.rawResponse);
|
|
1343
|
+
default:
|
|
1344
|
+
throw new errors.SchematicError({
|
|
1345
|
+
statusCode: _response.error.statusCode,
|
|
1346
|
+
body: _response.error.body,
|
|
1347
|
+
rawResponse: _response.rawResponse,
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
switch (_response.error.reason) {
|
|
1352
|
+
case "non-json":
|
|
1353
|
+
throw new errors.SchematicError({
|
|
1354
|
+
statusCode: _response.error.statusCode,
|
|
1355
|
+
body: _response.error.rawBody,
|
|
1356
|
+
rawResponse: _response.rawResponse,
|
|
1357
|
+
});
|
|
1358
|
+
case "timeout":
|
|
1359
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /companies/lookup.");
|
|
1360
|
+
case "unknown":
|
|
1361
|
+
throw new errors.SchematicError({
|
|
1362
|
+
message: _response.error.errorMessage,
|
|
1363
|
+
rawResponse: _response.rawResponse,
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* @param {Schematic.GetActiveDealsRequest} request
|
|
1370
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1371
|
+
*
|
|
1372
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1373
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1374
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1375
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1376
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1377
|
+
*
|
|
1378
|
+
* @example
|
|
1379
|
+
* await client.companies.getActiveDeals({
|
|
1380
|
+
* companyId: "company_id",
|
|
1381
|
+
* dealStage: "deal_stage"
|
|
1382
|
+
* })
|
|
1383
|
+
*/
|
|
1384
|
+
getActiveDeals(request, requestOptions) {
|
|
1385
|
+
return core.HttpResponsePromise.fromPromise(this.__getActiveDeals(request, requestOptions));
|
|
1386
|
+
}
|
|
1387
|
+
__getActiveDeals(request, requestOptions) {
|
|
1388
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1389
|
+
var _a, _b, _c;
|
|
1390
|
+
const { companyId, dealStage, limit, offset } = request;
|
|
1391
|
+
const _queryParams = {};
|
|
1392
|
+
_queryParams["company_id"] = companyId;
|
|
1393
|
+
_queryParams["deal_stage"] = dealStage;
|
|
1394
|
+
if (limit != null) {
|
|
1395
|
+
_queryParams["limit"] = limit.toString();
|
|
1396
|
+
}
|
|
1397
|
+
if (offset != null) {
|
|
1398
|
+
_queryParams["offset"] = offset.toString();
|
|
1399
|
+
}
|
|
1400
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1401
|
+
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"),
|
|
1402
|
+
method: "GET",
|
|
1403
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1404
|
+
contentType: "application/json",
|
|
1405
|
+
queryParameters: _queryParams,
|
|
1406
|
+
requestType: "json",
|
|
1407
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1408
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1409
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1410
|
+
});
|
|
1411
|
+
if (_response.ok) {
|
|
1412
|
+
return {
|
|
1413
|
+
data: serializers.GetActiveDealsResponse.parseOrThrow(_response.body, {
|
|
1414
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1415
|
+
allowUnrecognizedUnionMembers: true,
|
|
1416
|
+
allowUnrecognizedEnumValues: true,
|
|
1417
|
+
skipValidation: true,
|
|
1418
|
+
breadcrumbsPrefix: ["response"],
|
|
1419
|
+
}),
|
|
1420
|
+
rawResponse: _response.rawResponse,
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
if (_response.error.reason === "status-code") {
|
|
1424
|
+
switch (_response.error.statusCode) {
|
|
1425
|
+
case 400:
|
|
1426
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1427
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1428
|
+
allowUnrecognizedUnionMembers: true,
|
|
1429
|
+
allowUnrecognizedEnumValues: true,
|
|
1430
|
+
skipValidation: true,
|
|
1431
|
+
breadcrumbsPrefix: ["response"],
|
|
1432
|
+
}), _response.rawResponse);
|
|
1433
|
+
case 401:
|
|
1434
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1435
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1436
|
+
allowUnrecognizedUnionMembers: true,
|
|
1437
|
+
allowUnrecognizedEnumValues: true,
|
|
1438
|
+
skipValidation: true,
|
|
1439
|
+
breadcrumbsPrefix: ["response"],
|
|
1440
|
+
}), _response.rawResponse);
|
|
1441
|
+
case 403:
|
|
1442
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1443
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1444
|
+
allowUnrecognizedUnionMembers: true,
|
|
1445
|
+
allowUnrecognizedEnumValues: true,
|
|
1446
|
+
skipValidation: true,
|
|
1447
|
+
breadcrumbsPrefix: ["response"],
|
|
1448
|
+
}), _response.rawResponse);
|
|
1449
|
+
case 404:
|
|
1450
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1451
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1452
|
+
allowUnrecognizedUnionMembers: true,
|
|
1453
|
+
allowUnrecognizedEnumValues: true,
|
|
1454
|
+
skipValidation: true,
|
|
1455
|
+
breadcrumbsPrefix: ["response"],
|
|
1456
|
+
}), _response.rawResponse);
|
|
1457
|
+
case 500:
|
|
1458
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1459
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1460
|
+
allowUnrecognizedUnionMembers: true,
|
|
1461
|
+
allowUnrecognizedEnumValues: true,
|
|
1462
|
+
skipValidation: true,
|
|
1463
|
+
breadcrumbsPrefix: ["response"],
|
|
1464
|
+
}), _response.rawResponse);
|
|
1465
|
+
default:
|
|
1466
|
+
throw new errors.SchematicError({
|
|
1467
|
+
statusCode: _response.error.statusCode,
|
|
1468
|
+
body: _response.error.body,
|
|
1469
|
+
rawResponse: _response.rawResponse,
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
switch (_response.error.reason) {
|
|
1474
|
+
case "non-json":
|
|
1475
|
+
throw new errors.SchematicError({
|
|
1476
|
+
statusCode: _response.error.statusCode,
|
|
1477
|
+
body: _response.error.rawBody,
|
|
1478
|
+
rawResponse: _response.rawResponse,
|
|
1479
|
+
});
|
|
1480
|
+
case "timeout":
|
|
1481
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-crm-deals.");
|
|
1482
|
+
case "unknown":
|
|
1483
|
+
throw new errors.SchematicError({
|
|
1484
|
+
message: _response.error.errorMessage,
|
|
1485
|
+
rawResponse: _response.rawResponse,
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* @param {Schematic.ListCompanyMembershipsRequest} request
|
|
1492
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1493
|
+
*
|
|
1494
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1495
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1496
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1497
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1498
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1499
|
+
*
|
|
1500
|
+
* @example
|
|
1501
|
+
* await client.companies.listCompanyMemberships()
|
|
1502
|
+
*/
|
|
1503
|
+
listCompanyMemberships(request = {}, requestOptions) {
|
|
1504
|
+
return core.HttpResponsePromise.fromPromise(this.__listCompanyMemberships(request, requestOptions));
|
|
1505
|
+
}
|
|
1506
|
+
__listCompanyMemberships() {
|
|
1507
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1508
|
+
var _a, _b, _c;
|
|
1509
|
+
const { companyId, userId, limit, offset } = request;
|
|
1510
|
+
const _queryParams = {};
|
|
1511
|
+
if (companyId != null) {
|
|
1512
|
+
_queryParams["company_id"] = companyId;
|
|
1513
|
+
}
|
|
1514
|
+
if (userId != null) {
|
|
1515
|
+
_queryParams["user_id"] = userId;
|
|
1516
|
+
}
|
|
1517
|
+
if (limit != null) {
|
|
1518
|
+
_queryParams["limit"] = limit.toString();
|
|
1519
|
+
}
|
|
1520
|
+
if (offset != null) {
|
|
1521
|
+
_queryParams["offset"] = offset.toString();
|
|
1522
|
+
}
|
|
1523
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1524
|
+
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"),
|
|
1525
|
+
method: "GET",
|
|
1526
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1527
|
+
contentType: "application/json",
|
|
1528
|
+
queryParameters: _queryParams,
|
|
1529
|
+
requestType: "json",
|
|
1530
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1531
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1532
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1533
|
+
});
|
|
1534
|
+
if (_response.ok) {
|
|
1535
|
+
return {
|
|
1536
|
+
data: serializers.ListCompanyMembershipsResponse.parseOrThrow(_response.body, {
|
|
1537
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1538
|
+
allowUnrecognizedUnionMembers: true,
|
|
1539
|
+
allowUnrecognizedEnumValues: true,
|
|
1540
|
+
skipValidation: true,
|
|
1541
|
+
breadcrumbsPrefix: ["response"],
|
|
1542
|
+
}),
|
|
1543
|
+
rawResponse: _response.rawResponse,
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
if (_response.error.reason === "status-code") {
|
|
1547
|
+
switch (_response.error.statusCode) {
|
|
1548
|
+
case 400:
|
|
1549
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1550
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1551
|
+
allowUnrecognizedUnionMembers: true,
|
|
1552
|
+
allowUnrecognizedEnumValues: true,
|
|
1553
|
+
skipValidation: true,
|
|
1554
|
+
breadcrumbsPrefix: ["response"],
|
|
1555
|
+
}), _response.rawResponse);
|
|
1556
|
+
case 401:
|
|
1557
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1558
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1559
|
+
allowUnrecognizedUnionMembers: true,
|
|
1560
|
+
allowUnrecognizedEnumValues: true,
|
|
1561
|
+
skipValidation: true,
|
|
1562
|
+
breadcrumbsPrefix: ["response"],
|
|
1563
|
+
}), _response.rawResponse);
|
|
1564
|
+
case 403:
|
|
1565
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1566
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1567
|
+
allowUnrecognizedUnionMembers: true,
|
|
1568
|
+
allowUnrecognizedEnumValues: true,
|
|
1569
|
+
skipValidation: true,
|
|
1570
|
+
breadcrumbsPrefix: ["response"],
|
|
1571
|
+
}), _response.rawResponse);
|
|
1572
|
+
case 404:
|
|
1573
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1574
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1575
|
+
allowUnrecognizedUnionMembers: true,
|
|
1576
|
+
allowUnrecognizedEnumValues: true,
|
|
1577
|
+
skipValidation: true,
|
|
1578
|
+
breadcrumbsPrefix: ["response"],
|
|
1579
|
+
}), _response.rawResponse);
|
|
1580
|
+
case 500:
|
|
1581
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1582
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1583
|
+
allowUnrecognizedUnionMembers: true,
|
|
1584
|
+
allowUnrecognizedEnumValues: true,
|
|
1585
|
+
skipValidation: true,
|
|
1586
|
+
breadcrumbsPrefix: ["response"],
|
|
1587
|
+
}), _response.rawResponse);
|
|
1588
|
+
default:
|
|
1589
|
+
throw new errors.SchematicError({
|
|
1590
|
+
statusCode: _response.error.statusCode,
|
|
1591
|
+
body: _response.error.body,
|
|
1592
|
+
rawResponse: _response.rawResponse,
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
switch (_response.error.reason) {
|
|
1597
|
+
case "non-json":
|
|
1598
|
+
throw new errors.SchematicError({
|
|
1599
|
+
statusCode: _response.error.statusCode,
|
|
1600
|
+
body: _response.error.rawBody,
|
|
1601
|
+
rawResponse: _response.rawResponse,
|
|
1602
|
+
});
|
|
1603
|
+
case "timeout":
|
|
1604
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-memberships.");
|
|
1605
|
+
case "unknown":
|
|
1606
|
+
throw new errors.SchematicError({
|
|
1607
|
+
message: _response.error.errorMessage,
|
|
1608
|
+
rawResponse: _response.rawResponse,
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* @param {Schematic.GetOrCreateCompanyMembershipRequestBody} request
|
|
1615
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1616
|
+
*
|
|
1617
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1618
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1619
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1620
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1621
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1622
|
+
*
|
|
1623
|
+
* @example
|
|
1624
|
+
* await client.companies.getOrCreateCompanyMembership({
|
|
1625
|
+
* companyId: "company_id",
|
|
1626
|
+
* userId: "user_id"
|
|
1627
|
+
* })
|
|
1628
|
+
*/
|
|
1629
|
+
getOrCreateCompanyMembership(request, requestOptions) {
|
|
1630
|
+
return core.HttpResponsePromise.fromPromise(this.__getOrCreateCompanyMembership(request, requestOptions));
|
|
1631
|
+
}
|
|
1632
|
+
__getOrCreateCompanyMembership(request, requestOptions) {
|
|
1633
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1634
|
+
var _a, _b, _c;
|
|
1635
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1636
|
+
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"),
|
|
1637
|
+
method: "POST",
|
|
1638
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1639
|
+
contentType: "application/json",
|
|
1640
|
+
requestType: "json",
|
|
1641
|
+
body: serializers.GetOrCreateCompanyMembershipRequestBody.jsonOrThrow(request, {
|
|
1642
|
+
unrecognizedObjectKeys: "strip",
|
|
1643
|
+
}),
|
|
1644
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1645
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1646
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1647
|
+
});
|
|
1648
|
+
if (_response.ok) {
|
|
1649
|
+
return {
|
|
1650
|
+
data: serializers.GetOrCreateCompanyMembershipResponse.parseOrThrow(_response.body, {
|
|
1651
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1652
|
+
allowUnrecognizedUnionMembers: true,
|
|
1653
|
+
allowUnrecognizedEnumValues: true,
|
|
1654
|
+
skipValidation: true,
|
|
1655
|
+
breadcrumbsPrefix: ["response"],
|
|
1656
|
+
}),
|
|
1657
|
+
rawResponse: _response.rawResponse,
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
if (_response.error.reason === "status-code") {
|
|
1661
|
+
switch (_response.error.statusCode) {
|
|
1662
|
+
case 400:
|
|
1663
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1664
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1665
|
+
allowUnrecognizedUnionMembers: true,
|
|
1666
|
+
allowUnrecognizedEnumValues: true,
|
|
1667
|
+
skipValidation: true,
|
|
1668
|
+
breadcrumbsPrefix: ["response"],
|
|
1669
|
+
}), _response.rawResponse);
|
|
1670
|
+
case 401:
|
|
1671
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1672
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1673
|
+
allowUnrecognizedUnionMembers: true,
|
|
1674
|
+
allowUnrecognizedEnumValues: true,
|
|
1675
|
+
skipValidation: true,
|
|
1676
|
+
breadcrumbsPrefix: ["response"],
|
|
1677
|
+
}), _response.rawResponse);
|
|
1678
|
+
case 403:
|
|
1679
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1680
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1681
|
+
allowUnrecognizedUnionMembers: true,
|
|
1682
|
+
allowUnrecognizedEnumValues: true,
|
|
1683
|
+
skipValidation: true,
|
|
1684
|
+
breadcrumbsPrefix: ["response"],
|
|
1685
|
+
}), _response.rawResponse);
|
|
1686
|
+
case 404:
|
|
1687
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1688
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1689
|
+
allowUnrecognizedUnionMembers: true,
|
|
1690
|
+
allowUnrecognizedEnumValues: true,
|
|
1691
|
+
skipValidation: true,
|
|
1692
|
+
breadcrumbsPrefix: ["response"],
|
|
1693
|
+
}), _response.rawResponse);
|
|
1694
|
+
case 500:
|
|
1695
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1696
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1697
|
+
allowUnrecognizedUnionMembers: true,
|
|
1698
|
+
allowUnrecognizedEnumValues: true,
|
|
1699
|
+
skipValidation: true,
|
|
1700
|
+
breadcrumbsPrefix: ["response"],
|
|
1701
|
+
}), _response.rawResponse);
|
|
1702
|
+
default:
|
|
1703
|
+
throw new errors.SchematicError({
|
|
1704
|
+
statusCode: _response.error.statusCode,
|
|
1705
|
+
body: _response.error.body,
|
|
1706
|
+
rawResponse: _response.rawResponse,
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
switch (_response.error.reason) {
|
|
1711
|
+
case "non-json":
|
|
1712
|
+
throw new errors.SchematicError({
|
|
1713
|
+
statusCode: _response.error.statusCode,
|
|
1714
|
+
body: _response.error.rawBody,
|
|
1715
|
+
rawResponse: _response.rawResponse,
|
|
1716
|
+
});
|
|
1717
|
+
case "timeout":
|
|
1718
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /company-memberships.");
|
|
1719
|
+
case "unknown":
|
|
1720
|
+
throw new errors.SchematicError({
|
|
1721
|
+
message: _response.error.errorMessage,
|
|
1722
|
+
rawResponse: _response.rawResponse,
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* @param {string} companyMembershipId - company_membership_id
|
|
1729
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1730
|
+
*
|
|
1731
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1732
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1733
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1734
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1735
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1736
|
+
*
|
|
1737
|
+
* @example
|
|
1738
|
+
* await client.companies.deleteCompanyMembership("company_membership_id")
|
|
1739
|
+
*/
|
|
1740
|
+
deleteCompanyMembership(companyMembershipId, requestOptions) {
|
|
1741
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCompanyMembership(companyMembershipId, requestOptions));
|
|
1742
|
+
}
|
|
1743
|
+
__deleteCompanyMembership(companyMembershipId, requestOptions) {
|
|
1744
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1745
|
+
var _a, _b, _c;
|
|
1746
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
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, `company-memberships/${encodeURIComponent(companyMembershipId)}`),
|
|
1748
|
+
method: "DELETE",
|
|
1749
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1750
|
+
contentType: "application/json",
|
|
1751
|
+
requestType: "json",
|
|
1752
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1753
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1754
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1755
|
+
});
|
|
1756
|
+
if (_response.ok) {
|
|
1757
|
+
return {
|
|
1758
|
+
data: serializers.DeleteCompanyMembershipResponse.parseOrThrow(_response.body, {
|
|
1759
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1760
|
+
allowUnrecognizedUnionMembers: true,
|
|
1761
|
+
allowUnrecognizedEnumValues: true,
|
|
1762
|
+
skipValidation: true,
|
|
1763
|
+
breadcrumbsPrefix: ["response"],
|
|
1764
|
+
}),
|
|
1765
|
+
rawResponse: _response.rawResponse,
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
if (_response.error.reason === "status-code") {
|
|
1769
|
+
switch (_response.error.statusCode) {
|
|
1770
|
+
case 400:
|
|
1771
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1772
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1773
|
+
allowUnrecognizedUnionMembers: true,
|
|
1774
|
+
allowUnrecognizedEnumValues: true,
|
|
1775
|
+
skipValidation: true,
|
|
1776
|
+
breadcrumbsPrefix: ["response"],
|
|
1777
|
+
}), _response.rawResponse);
|
|
1778
|
+
case 401:
|
|
1779
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1780
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1781
|
+
allowUnrecognizedUnionMembers: true,
|
|
1782
|
+
allowUnrecognizedEnumValues: true,
|
|
1783
|
+
skipValidation: true,
|
|
1784
|
+
breadcrumbsPrefix: ["response"],
|
|
1785
|
+
}), _response.rawResponse);
|
|
1786
|
+
case 403:
|
|
1787
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1788
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1789
|
+
allowUnrecognizedUnionMembers: true,
|
|
1790
|
+
allowUnrecognizedEnumValues: true,
|
|
1791
|
+
skipValidation: true,
|
|
1792
|
+
breadcrumbsPrefix: ["response"],
|
|
1793
|
+
}), _response.rawResponse);
|
|
1794
|
+
case 404:
|
|
1795
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1796
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1797
|
+
allowUnrecognizedUnionMembers: true,
|
|
1798
|
+
allowUnrecognizedEnumValues: true,
|
|
1799
|
+
skipValidation: true,
|
|
1800
|
+
breadcrumbsPrefix: ["response"],
|
|
1801
|
+
}), _response.rawResponse);
|
|
1802
|
+
case 500:
|
|
1803
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1804
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1805
|
+
allowUnrecognizedUnionMembers: true,
|
|
1806
|
+
allowUnrecognizedEnumValues: true,
|
|
1807
|
+
skipValidation: true,
|
|
1808
|
+
breadcrumbsPrefix: ["response"],
|
|
1809
|
+
}), _response.rawResponse);
|
|
1810
|
+
default:
|
|
1811
|
+
throw new errors.SchematicError({
|
|
1812
|
+
statusCode: _response.error.statusCode,
|
|
1813
|
+
body: _response.error.body,
|
|
1814
|
+
rawResponse: _response.rawResponse,
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
switch (_response.error.reason) {
|
|
1819
|
+
case "non-json":
|
|
1820
|
+
throw new errors.SchematicError({
|
|
1821
|
+
statusCode: _response.error.statusCode,
|
|
1822
|
+
body: _response.error.rawBody,
|
|
1823
|
+
rawResponse: _response.rawResponse,
|
|
1824
|
+
});
|
|
1825
|
+
case "timeout":
|
|
1826
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /company-memberships/{company_membership_id}.");
|
|
1827
|
+
case "unknown":
|
|
1828
|
+
throw new errors.SchematicError({
|
|
1829
|
+
message: _response.error.errorMessage,
|
|
1830
|
+
rawResponse: _response.rawResponse,
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* @param {Schematic.GetActiveCompanySubscriptionRequest} request
|
|
1837
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1838
|
+
*
|
|
1839
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1840
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1841
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1842
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1843
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1844
|
+
*
|
|
1845
|
+
* @example
|
|
1846
|
+
* await client.companies.getActiveCompanySubscription()
|
|
1847
|
+
*/
|
|
1848
|
+
getActiveCompanySubscription(request = {}, requestOptions) {
|
|
1849
|
+
return core.HttpResponsePromise.fromPromise(this.__getActiveCompanySubscription(request, requestOptions));
|
|
1850
|
+
}
|
|
1851
|
+
__getActiveCompanySubscription() {
|
|
1852
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
1853
|
+
var _a, _b, _c;
|
|
1854
|
+
const { companyId, companyIds, limit, offset } = request;
|
|
1855
|
+
const _queryParams = {};
|
|
1856
|
+
if (companyId != null) {
|
|
1857
|
+
_queryParams["company_id"] = companyId;
|
|
1858
|
+
}
|
|
1859
|
+
if (companyIds != null) {
|
|
1860
|
+
if (Array.isArray(companyIds)) {
|
|
1861
|
+
_queryParams["company_ids"] = companyIds.map((item) => item);
|
|
1862
|
+
}
|
|
1863
|
+
else {
|
|
1864
|
+
_queryParams["company_ids"] = companyIds;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (limit != null) {
|
|
1868
|
+
_queryParams["limit"] = limit.toString();
|
|
1869
|
+
}
|
|
1870
|
+
if (offset != null) {
|
|
1871
|
+
_queryParams["offset"] = offset.toString();
|
|
1872
|
+
}
|
|
1873
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1874
|
+
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"),
|
|
1875
|
+
method: "GET",
|
|
1876
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1877
|
+
contentType: "application/json",
|
|
1878
|
+
queryParameters: _queryParams,
|
|
1879
|
+
requestType: "json",
|
|
1880
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1881
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1882
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1883
|
+
});
|
|
1884
|
+
if (_response.ok) {
|
|
1885
|
+
return {
|
|
1886
|
+
data: serializers.GetActiveCompanySubscriptionResponse.parseOrThrow(_response.body, {
|
|
1887
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1888
|
+
allowUnrecognizedUnionMembers: true,
|
|
1889
|
+
allowUnrecognizedEnumValues: true,
|
|
1890
|
+
skipValidation: true,
|
|
1891
|
+
breadcrumbsPrefix: ["response"],
|
|
1892
|
+
}),
|
|
1893
|
+
rawResponse: _response.rawResponse,
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
if (_response.error.reason === "status-code") {
|
|
1897
|
+
switch (_response.error.statusCode) {
|
|
1898
|
+
case 400:
|
|
1899
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1900
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1901
|
+
allowUnrecognizedUnionMembers: true,
|
|
1902
|
+
allowUnrecognizedEnumValues: true,
|
|
1903
|
+
skipValidation: true,
|
|
1904
|
+
breadcrumbsPrefix: ["response"],
|
|
1905
|
+
}), _response.rawResponse);
|
|
1906
|
+
case 401:
|
|
1907
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1908
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1909
|
+
allowUnrecognizedUnionMembers: true,
|
|
1910
|
+
allowUnrecognizedEnumValues: true,
|
|
1911
|
+
skipValidation: true,
|
|
1912
|
+
breadcrumbsPrefix: ["response"],
|
|
1913
|
+
}), _response.rawResponse);
|
|
1914
|
+
case 403:
|
|
1915
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1916
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1917
|
+
allowUnrecognizedUnionMembers: true,
|
|
1918
|
+
allowUnrecognizedEnumValues: true,
|
|
1919
|
+
skipValidation: true,
|
|
1920
|
+
breadcrumbsPrefix: ["response"],
|
|
1921
|
+
}), _response.rawResponse);
|
|
1922
|
+
case 404:
|
|
1923
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1924
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1925
|
+
allowUnrecognizedUnionMembers: true,
|
|
1926
|
+
allowUnrecognizedEnumValues: true,
|
|
1927
|
+
skipValidation: true,
|
|
1928
|
+
breadcrumbsPrefix: ["response"],
|
|
1929
|
+
}), _response.rawResponse);
|
|
1930
|
+
case 500:
|
|
1931
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1932
|
+
unrecognizedObjectKeys: "passthrough",
|
|
1933
|
+
allowUnrecognizedUnionMembers: true,
|
|
1934
|
+
allowUnrecognizedEnumValues: true,
|
|
1935
|
+
skipValidation: true,
|
|
1936
|
+
breadcrumbsPrefix: ["response"],
|
|
1937
|
+
}), _response.rawResponse);
|
|
1938
|
+
default:
|
|
1939
|
+
throw new errors.SchematicError({
|
|
1940
|
+
statusCode: _response.error.statusCode,
|
|
1941
|
+
body: _response.error.body,
|
|
1942
|
+
rawResponse: _response.rawResponse,
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
switch (_response.error.reason) {
|
|
1947
|
+
case "non-json":
|
|
1948
|
+
throw new errors.SchematicError({
|
|
1949
|
+
statusCode: _response.error.statusCode,
|
|
1950
|
+
body: _response.error.rawBody,
|
|
1951
|
+
rawResponse: _response.rawResponse,
|
|
1952
|
+
});
|
|
1953
|
+
case "timeout":
|
|
1954
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /company-subscriptions.");
|
|
1955
|
+
case "unknown":
|
|
1956
|
+
throw new errors.SchematicError({
|
|
1957
|
+
message: _response.error.errorMessage,
|
|
1958
|
+
rawResponse: _response.rawResponse,
|
|
1959
|
+
});
|
|
1960
|
+
}
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* @param {Schematic.UpsertTraitRequestBody} request
|
|
1965
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
1966
|
+
*
|
|
1967
|
+
* @throws {@link Schematic.BadRequestError}
|
|
1968
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
1969
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
1970
|
+
* @throws {@link Schematic.NotFoundError}
|
|
1971
|
+
* @throws {@link Schematic.InternalServerError}
|
|
1972
|
+
*
|
|
1973
|
+
* @example
|
|
1974
|
+
* await client.companies.upsertCompanyTrait({
|
|
1975
|
+
* keys: {
|
|
1976
|
+
* "key": "value"
|
|
1977
|
+
* },
|
|
1978
|
+
* trait: "trait"
|
|
1979
|
+
* })
|
|
1980
|
+
*/
|
|
1981
|
+
upsertCompanyTrait(request, requestOptions) {
|
|
1982
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertCompanyTrait(request, requestOptions));
|
|
1983
|
+
}
|
|
1984
|
+
__upsertCompanyTrait(request, requestOptions) {
|
|
1985
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1986
|
+
var _a, _b, _c;
|
|
1987
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1988
|
+
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"),
|
|
1989
|
+
method: "POST",
|
|
1990
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
1991
|
+
contentType: "application/json",
|
|
1992
|
+
requestType: "json",
|
|
1993
|
+
body: serializers.UpsertTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1994
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1995
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1996
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1997
|
+
});
|
|
1998
|
+
if (_response.ok) {
|
|
1999
|
+
return {
|
|
2000
|
+
data: serializers.UpsertCompanyTraitResponse.parseOrThrow(_response.body, {
|
|
2001
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2002
|
+
allowUnrecognizedUnionMembers: true,
|
|
2003
|
+
allowUnrecognizedEnumValues: true,
|
|
2004
|
+
skipValidation: true,
|
|
2005
|
+
breadcrumbsPrefix: ["response"],
|
|
2006
|
+
}),
|
|
2007
|
+
rawResponse: _response.rawResponse,
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
if (_response.error.reason === "status-code") {
|
|
2011
|
+
switch (_response.error.statusCode) {
|
|
2012
|
+
case 400:
|
|
2013
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2014
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2015
|
+
allowUnrecognizedUnionMembers: true,
|
|
2016
|
+
allowUnrecognizedEnumValues: true,
|
|
2017
|
+
skipValidation: true,
|
|
2018
|
+
breadcrumbsPrefix: ["response"],
|
|
2019
|
+
}), _response.rawResponse);
|
|
2020
|
+
case 401:
|
|
2021
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2022
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2023
|
+
allowUnrecognizedUnionMembers: true,
|
|
2024
|
+
allowUnrecognizedEnumValues: true,
|
|
2025
|
+
skipValidation: true,
|
|
2026
|
+
breadcrumbsPrefix: ["response"],
|
|
2027
|
+
}), _response.rawResponse);
|
|
2028
|
+
case 403:
|
|
2029
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2030
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2031
|
+
allowUnrecognizedUnionMembers: true,
|
|
2032
|
+
allowUnrecognizedEnumValues: true,
|
|
2033
|
+
skipValidation: true,
|
|
2034
|
+
breadcrumbsPrefix: ["response"],
|
|
2035
|
+
}), _response.rawResponse);
|
|
2036
|
+
case 404:
|
|
2037
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2038
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2039
|
+
allowUnrecognizedUnionMembers: true,
|
|
2040
|
+
allowUnrecognizedEnumValues: true,
|
|
2041
|
+
skipValidation: true,
|
|
2042
|
+
breadcrumbsPrefix: ["response"],
|
|
2043
|
+
}), _response.rawResponse);
|
|
2044
|
+
case 500:
|
|
2045
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2046
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2047
|
+
allowUnrecognizedUnionMembers: true,
|
|
2048
|
+
allowUnrecognizedEnumValues: true,
|
|
2049
|
+
skipValidation: true,
|
|
2050
|
+
breadcrumbsPrefix: ["response"],
|
|
2051
|
+
}), _response.rawResponse);
|
|
2052
|
+
default:
|
|
2053
|
+
throw new errors.SchematicError({
|
|
2054
|
+
statusCode: _response.error.statusCode,
|
|
2055
|
+
body: _response.error.body,
|
|
2056
|
+
rawResponse: _response.rawResponse,
|
|
2057
|
+
});
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
switch (_response.error.reason) {
|
|
2061
|
+
case "non-json":
|
|
2062
|
+
throw new errors.SchematicError({
|
|
2063
|
+
statusCode: _response.error.statusCode,
|
|
2064
|
+
body: _response.error.rawBody,
|
|
2065
|
+
rawResponse: _response.rawResponse,
|
|
2066
|
+
});
|
|
2067
|
+
case "timeout":
|
|
2068
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /company-traits.");
|
|
2069
|
+
case "unknown":
|
|
2070
|
+
throw new errors.SchematicError({
|
|
2071
|
+
message: _response.error.errorMessage,
|
|
2072
|
+
rawResponse: _response.rawResponse,
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* @param {Schematic.ListEntityKeyDefinitionsRequest} request
|
|
2079
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2080
|
+
*
|
|
2081
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2082
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2083
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2084
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2085
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2086
|
+
*
|
|
2087
|
+
* @example
|
|
2088
|
+
* await client.companies.listEntityKeyDefinitions()
|
|
2089
|
+
*/
|
|
2090
|
+
listEntityKeyDefinitions(request = {}, requestOptions) {
|
|
2091
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntityKeyDefinitions(request, requestOptions));
|
|
2092
|
+
}
|
|
2093
|
+
__listEntityKeyDefinitions() {
|
|
2094
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2095
|
+
var _a, _b, _c;
|
|
2096
|
+
const { entityType, ids, q, limit, offset } = request;
|
|
2097
|
+
const _queryParams = {};
|
|
2098
|
+
if (entityType != null) {
|
|
2099
|
+
_queryParams["entity_type"] = serializers.ListEntityKeyDefinitionsRequestEntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" });
|
|
2100
|
+
}
|
|
2101
|
+
if (ids != null) {
|
|
2102
|
+
if (Array.isArray(ids)) {
|
|
2103
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
2104
|
+
}
|
|
2105
|
+
else {
|
|
2106
|
+
_queryParams["ids"] = ids;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
if (q != null) {
|
|
2110
|
+
_queryParams["q"] = q;
|
|
2111
|
+
}
|
|
2112
|
+
if (limit != null) {
|
|
2113
|
+
_queryParams["limit"] = limit.toString();
|
|
2114
|
+
}
|
|
2115
|
+
if (offset != null) {
|
|
2116
|
+
_queryParams["offset"] = offset.toString();
|
|
2117
|
+
}
|
|
2118
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2119
|
+
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"),
|
|
2120
|
+
method: "GET",
|
|
2121
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2122
|
+
contentType: "application/json",
|
|
2123
|
+
queryParameters: _queryParams,
|
|
2124
|
+
requestType: "json",
|
|
2125
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2126
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2127
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2128
|
+
});
|
|
2129
|
+
if (_response.ok) {
|
|
2130
|
+
return {
|
|
2131
|
+
data: serializers.ListEntityKeyDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2132
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2133
|
+
allowUnrecognizedUnionMembers: true,
|
|
2134
|
+
allowUnrecognizedEnumValues: true,
|
|
2135
|
+
skipValidation: true,
|
|
2136
|
+
breadcrumbsPrefix: ["response"],
|
|
2137
|
+
}),
|
|
2138
|
+
rawResponse: _response.rawResponse,
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
if (_response.error.reason === "status-code") {
|
|
2142
|
+
switch (_response.error.statusCode) {
|
|
2143
|
+
case 400:
|
|
2144
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2145
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2146
|
+
allowUnrecognizedUnionMembers: true,
|
|
2147
|
+
allowUnrecognizedEnumValues: true,
|
|
2148
|
+
skipValidation: true,
|
|
2149
|
+
breadcrumbsPrefix: ["response"],
|
|
2150
|
+
}), _response.rawResponse);
|
|
2151
|
+
case 401:
|
|
2152
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2153
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2154
|
+
allowUnrecognizedUnionMembers: true,
|
|
2155
|
+
allowUnrecognizedEnumValues: true,
|
|
2156
|
+
skipValidation: true,
|
|
2157
|
+
breadcrumbsPrefix: ["response"],
|
|
2158
|
+
}), _response.rawResponse);
|
|
2159
|
+
case 403:
|
|
2160
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2161
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2162
|
+
allowUnrecognizedUnionMembers: true,
|
|
2163
|
+
allowUnrecognizedEnumValues: true,
|
|
2164
|
+
skipValidation: true,
|
|
2165
|
+
breadcrumbsPrefix: ["response"],
|
|
2166
|
+
}), _response.rawResponse);
|
|
2167
|
+
case 404:
|
|
2168
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2169
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2170
|
+
allowUnrecognizedUnionMembers: true,
|
|
2171
|
+
allowUnrecognizedEnumValues: true,
|
|
2172
|
+
skipValidation: true,
|
|
2173
|
+
breadcrumbsPrefix: ["response"],
|
|
2174
|
+
}), _response.rawResponse);
|
|
2175
|
+
case 500:
|
|
2176
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2177
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2178
|
+
allowUnrecognizedUnionMembers: true,
|
|
2179
|
+
allowUnrecognizedEnumValues: true,
|
|
2180
|
+
skipValidation: true,
|
|
2181
|
+
breadcrumbsPrefix: ["response"],
|
|
2182
|
+
}), _response.rawResponse);
|
|
2183
|
+
default:
|
|
2184
|
+
throw new errors.SchematicError({
|
|
2185
|
+
statusCode: _response.error.statusCode,
|
|
2186
|
+
body: _response.error.body,
|
|
2187
|
+
rawResponse: _response.rawResponse,
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
switch (_response.error.reason) {
|
|
2192
|
+
case "non-json":
|
|
2193
|
+
throw new errors.SchematicError({
|
|
2194
|
+
statusCode: _response.error.statusCode,
|
|
2195
|
+
body: _response.error.rawBody,
|
|
2196
|
+
rawResponse: _response.rawResponse,
|
|
2197
|
+
});
|
|
2198
|
+
case "timeout":
|
|
2199
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-key-definitions.");
|
|
2200
|
+
case "unknown":
|
|
2201
|
+
throw new errors.SchematicError({
|
|
2202
|
+
message: _response.error.errorMessage,
|
|
2203
|
+
rawResponse: _response.rawResponse,
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
});
|
|
2207
|
+
}
|
|
2208
|
+
/**
|
|
2209
|
+
* @param {Schematic.CountEntityKeyDefinitionsRequest} request
|
|
2210
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2211
|
+
*
|
|
2212
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2213
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2214
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2215
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2216
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2217
|
+
*
|
|
2218
|
+
* @example
|
|
2219
|
+
* await client.companies.countEntityKeyDefinitions()
|
|
2220
|
+
*/
|
|
2221
|
+
countEntityKeyDefinitions(request = {}, requestOptions) {
|
|
2222
|
+
return core.HttpResponsePromise.fromPromise(this.__countEntityKeyDefinitions(request, requestOptions));
|
|
2223
|
+
}
|
|
2224
|
+
__countEntityKeyDefinitions() {
|
|
2225
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2226
|
+
var _a, _b, _c;
|
|
2227
|
+
const { entityType, ids, q, limit, offset } = request;
|
|
2228
|
+
const _queryParams = {};
|
|
2229
|
+
if (entityType != null) {
|
|
2230
|
+
_queryParams["entity_type"] = serializers.CountEntityKeyDefinitionsRequestEntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" });
|
|
2231
|
+
}
|
|
2232
|
+
if (ids != null) {
|
|
2233
|
+
if (Array.isArray(ids)) {
|
|
2234
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
2235
|
+
}
|
|
2236
|
+
else {
|
|
2237
|
+
_queryParams["ids"] = ids;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
if (q != null) {
|
|
2241
|
+
_queryParams["q"] = q;
|
|
2242
|
+
}
|
|
2243
|
+
if (limit != null) {
|
|
2244
|
+
_queryParams["limit"] = limit.toString();
|
|
2245
|
+
}
|
|
2246
|
+
if (offset != null) {
|
|
2247
|
+
_queryParams["offset"] = offset.toString();
|
|
2248
|
+
}
|
|
2249
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2250
|
+
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"),
|
|
2251
|
+
method: "GET",
|
|
2252
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2253
|
+
contentType: "application/json",
|
|
2254
|
+
queryParameters: _queryParams,
|
|
2255
|
+
requestType: "json",
|
|
2256
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2257
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2258
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2259
|
+
});
|
|
2260
|
+
if (_response.ok) {
|
|
2261
|
+
return {
|
|
2262
|
+
data: serializers.CountEntityKeyDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2263
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2264
|
+
allowUnrecognizedUnionMembers: true,
|
|
2265
|
+
allowUnrecognizedEnumValues: true,
|
|
2266
|
+
skipValidation: true,
|
|
2267
|
+
breadcrumbsPrefix: ["response"],
|
|
2268
|
+
}),
|
|
2269
|
+
rawResponse: _response.rawResponse,
|
|
2270
|
+
};
|
|
2271
|
+
}
|
|
2272
|
+
if (_response.error.reason === "status-code") {
|
|
2273
|
+
switch (_response.error.statusCode) {
|
|
2274
|
+
case 400:
|
|
2275
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2276
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2277
|
+
allowUnrecognizedUnionMembers: true,
|
|
2278
|
+
allowUnrecognizedEnumValues: true,
|
|
2279
|
+
skipValidation: true,
|
|
2280
|
+
breadcrumbsPrefix: ["response"],
|
|
2281
|
+
}), _response.rawResponse);
|
|
2282
|
+
case 401:
|
|
2283
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2284
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2285
|
+
allowUnrecognizedUnionMembers: true,
|
|
2286
|
+
allowUnrecognizedEnumValues: true,
|
|
2287
|
+
skipValidation: true,
|
|
2288
|
+
breadcrumbsPrefix: ["response"],
|
|
2289
|
+
}), _response.rawResponse);
|
|
2290
|
+
case 403:
|
|
2291
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2292
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2293
|
+
allowUnrecognizedUnionMembers: true,
|
|
2294
|
+
allowUnrecognizedEnumValues: true,
|
|
2295
|
+
skipValidation: true,
|
|
2296
|
+
breadcrumbsPrefix: ["response"],
|
|
2297
|
+
}), _response.rawResponse);
|
|
2298
|
+
case 404:
|
|
2299
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2300
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2301
|
+
allowUnrecognizedUnionMembers: true,
|
|
2302
|
+
allowUnrecognizedEnumValues: true,
|
|
2303
|
+
skipValidation: true,
|
|
2304
|
+
breadcrumbsPrefix: ["response"],
|
|
2305
|
+
}), _response.rawResponse);
|
|
2306
|
+
case 500:
|
|
2307
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2308
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2309
|
+
allowUnrecognizedUnionMembers: true,
|
|
2310
|
+
allowUnrecognizedEnumValues: true,
|
|
2311
|
+
skipValidation: true,
|
|
2312
|
+
breadcrumbsPrefix: ["response"],
|
|
2313
|
+
}), _response.rawResponse);
|
|
2314
|
+
default:
|
|
2315
|
+
throw new errors.SchematicError({
|
|
2316
|
+
statusCode: _response.error.statusCode,
|
|
2317
|
+
body: _response.error.body,
|
|
2318
|
+
rawResponse: _response.rawResponse,
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
switch (_response.error.reason) {
|
|
2323
|
+
case "non-json":
|
|
2324
|
+
throw new errors.SchematicError({
|
|
2325
|
+
statusCode: _response.error.statusCode,
|
|
2326
|
+
body: _response.error.rawBody,
|
|
2327
|
+
rawResponse: _response.rawResponse,
|
|
2328
|
+
});
|
|
2329
|
+
case "timeout":
|
|
2330
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-key-definitions/count.");
|
|
2331
|
+
case "unknown":
|
|
2332
|
+
throw new errors.SchematicError({
|
|
2333
|
+
message: _response.error.errorMessage,
|
|
2334
|
+
rawResponse: _response.rawResponse,
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
});
|
|
2338
|
+
}
|
|
2339
|
+
/**
|
|
2340
|
+
* @param {Schematic.ListEntityTraitDefinitionsRequest} request
|
|
2341
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2342
|
+
*
|
|
2343
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2344
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2345
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2346
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2347
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2348
|
+
*
|
|
2349
|
+
* @example
|
|
2350
|
+
* await client.companies.listEntityTraitDefinitions()
|
|
2351
|
+
*/
|
|
2352
|
+
listEntityTraitDefinitions(request = {}, requestOptions) {
|
|
2353
|
+
return core.HttpResponsePromise.fromPromise(this.__listEntityTraitDefinitions(request, requestOptions));
|
|
2354
|
+
}
|
|
2355
|
+
__listEntityTraitDefinitions() {
|
|
2356
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2357
|
+
var _a, _b, _c;
|
|
2358
|
+
const { entityType, ids, q, traitType, limit, offset } = request;
|
|
2359
|
+
const _queryParams = {};
|
|
2360
|
+
if (entityType != null) {
|
|
2361
|
+
_queryParams["entity_type"] = serializers.ListEntityTraitDefinitionsRequestEntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" });
|
|
2362
|
+
}
|
|
2363
|
+
if (ids != null) {
|
|
2364
|
+
if (Array.isArray(ids)) {
|
|
2365
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
2366
|
+
}
|
|
2367
|
+
else {
|
|
2368
|
+
_queryParams["ids"] = ids;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
if (q != null) {
|
|
2372
|
+
_queryParams["q"] = q;
|
|
2373
|
+
}
|
|
2374
|
+
if (traitType != null) {
|
|
2375
|
+
_queryParams["trait_type"] = serializers.ListEntityTraitDefinitionsRequestTraitType.jsonOrThrow(traitType, {
|
|
2376
|
+
unrecognizedObjectKeys: "strip",
|
|
2377
|
+
});
|
|
2378
|
+
}
|
|
2379
|
+
if (limit != null) {
|
|
2380
|
+
_queryParams["limit"] = limit.toString();
|
|
2381
|
+
}
|
|
2382
|
+
if (offset != null) {
|
|
2383
|
+
_queryParams["offset"] = offset.toString();
|
|
2384
|
+
}
|
|
2385
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2386
|
+
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"),
|
|
2387
|
+
method: "GET",
|
|
2388
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2389
|
+
contentType: "application/json",
|
|
2390
|
+
queryParameters: _queryParams,
|
|
2391
|
+
requestType: "json",
|
|
2392
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2393
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2394
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2395
|
+
});
|
|
2396
|
+
if (_response.ok) {
|
|
2397
|
+
return {
|
|
2398
|
+
data: serializers.ListEntityTraitDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2399
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2400
|
+
allowUnrecognizedUnionMembers: true,
|
|
2401
|
+
allowUnrecognizedEnumValues: true,
|
|
2402
|
+
skipValidation: true,
|
|
2403
|
+
breadcrumbsPrefix: ["response"],
|
|
2404
|
+
}),
|
|
2405
|
+
rawResponse: _response.rawResponse,
|
|
2406
|
+
};
|
|
2407
|
+
}
|
|
2408
|
+
if (_response.error.reason === "status-code") {
|
|
2409
|
+
switch (_response.error.statusCode) {
|
|
2410
|
+
case 400:
|
|
2411
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2412
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2413
|
+
allowUnrecognizedUnionMembers: true,
|
|
2414
|
+
allowUnrecognizedEnumValues: true,
|
|
2415
|
+
skipValidation: true,
|
|
2416
|
+
breadcrumbsPrefix: ["response"],
|
|
2417
|
+
}), _response.rawResponse);
|
|
2418
|
+
case 401:
|
|
2419
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2420
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2421
|
+
allowUnrecognizedUnionMembers: true,
|
|
2422
|
+
allowUnrecognizedEnumValues: true,
|
|
2423
|
+
skipValidation: true,
|
|
2424
|
+
breadcrumbsPrefix: ["response"],
|
|
2425
|
+
}), _response.rawResponse);
|
|
2426
|
+
case 403:
|
|
2427
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2428
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2429
|
+
allowUnrecognizedUnionMembers: true,
|
|
2430
|
+
allowUnrecognizedEnumValues: true,
|
|
2431
|
+
skipValidation: true,
|
|
2432
|
+
breadcrumbsPrefix: ["response"],
|
|
2433
|
+
}), _response.rawResponse);
|
|
2434
|
+
case 404:
|
|
2435
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2436
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2437
|
+
allowUnrecognizedUnionMembers: true,
|
|
2438
|
+
allowUnrecognizedEnumValues: true,
|
|
2439
|
+
skipValidation: true,
|
|
2440
|
+
breadcrumbsPrefix: ["response"],
|
|
2441
|
+
}), _response.rawResponse);
|
|
2442
|
+
case 500:
|
|
2443
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2444
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2445
|
+
allowUnrecognizedUnionMembers: true,
|
|
2446
|
+
allowUnrecognizedEnumValues: true,
|
|
2447
|
+
skipValidation: true,
|
|
2448
|
+
breadcrumbsPrefix: ["response"],
|
|
2449
|
+
}), _response.rawResponse);
|
|
2450
|
+
default:
|
|
2451
|
+
throw new errors.SchematicError({
|
|
2452
|
+
statusCode: _response.error.statusCode,
|
|
2453
|
+
body: _response.error.body,
|
|
2454
|
+
rawResponse: _response.rawResponse,
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
switch (_response.error.reason) {
|
|
2459
|
+
case "non-json":
|
|
2460
|
+
throw new errors.SchematicError({
|
|
2461
|
+
statusCode: _response.error.statusCode,
|
|
2462
|
+
body: _response.error.rawBody,
|
|
2463
|
+
rawResponse: _response.rawResponse,
|
|
2464
|
+
});
|
|
2465
|
+
case "timeout":
|
|
2466
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions.");
|
|
2467
|
+
case "unknown":
|
|
2468
|
+
throw new errors.SchematicError({
|
|
2469
|
+
message: _response.error.errorMessage,
|
|
2470
|
+
rawResponse: _response.rawResponse,
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* @param {Schematic.CreateEntityTraitDefinitionRequestBody} request
|
|
2477
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2478
|
+
*
|
|
2479
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2480
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2481
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2482
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2483
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2484
|
+
*
|
|
2485
|
+
* @example
|
|
2486
|
+
* await client.companies.getOrCreateEntityTraitDefinition({
|
|
2487
|
+
* entityType: "company",
|
|
2488
|
+
* hierarchy: ["hierarchy"],
|
|
2489
|
+
* traitType: "boolean"
|
|
2490
|
+
* })
|
|
2491
|
+
*/
|
|
2492
|
+
getOrCreateEntityTraitDefinition(request, requestOptions) {
|
|
2493
|
+
return core.HttpResponsePromise.fromPromise(this.__getOrCreateEntityTraitDefinition(request, requestOptions));
|
|
2494
|
+
}
|
|
2495
|
+
__getOrCreateEntityTraitDefinition(request, requestOptions) {
|
|
2496
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2497
|
+
var _a, _b, _c;
|
|
2498
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2499
|
+
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"),
|
|
2500
|
+
method: "POST",
|
|
2501
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2502
|
+
contentType: "application/json",
|
|
2503
|
+
requestType: "json",
|
|
2504
|
+
body: serializers.CreateEntityTraitDefinitionRequestBody.jsonOrThrow(request, {
|
|
2505
|
+
unrecognizedObjectKeys: "strip",
|
|
2506
|
+
}),
|
|
2507
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2508
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2509
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2510
|
+
});
|
|
2511
|
+
if (_response.ok) {
|
|
2512
|
+
return {
|
|
2513
|
+
data: serializers.GetOrCreateEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2514
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2515
|
+
allowUnrecognizedUnionMembers: true,
|
|
2516
|
+
allowUnrecognizedEnumValues: true,
|
|
2517
|
+
skipValidation: true,
|
|
2518
|
+
breadcrumbsPrefix: ["response"],
|
|
2519
|
+
}),
|
|
2520
|
+
rawResponse: _response.rawResponse,
|
|
2521
|
+
};
|
|
2522
|
+
}
|
|
2523
|
+
if (_response.error.reason === "status-code") {
|
|
2524
|
+
switch (_response.error.statusCode) {
|
|
2525
|
+
case 400:
|
|
2526
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2527
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2528
|
+
allowUnrecognizedUnionMembers: true,
|
|
2529
|
+
allowUnrecognizedEnumValues: true,
|
|
2530
|
+
skipValidation: true,
|
|
2531
|
+
breadcrumbsPrefix: ["response"],
|
|
2532
|
+
}), _response.rawResponse);
|
|
2533
|
+
case 401:
|
|
2534
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2535
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2536
|
+
allowUnrecognizedUnionMembers: true,
|
|
2537
|
+
allowUnrecognizedEnumValues: true,
|
|
2538
|
+
skipValidation: true,
|
|
2539
|
+
breadcrumbsPrefix: ["response"],
|
|
2540
|
+
}), _response.rawResponse);
|
|
2541
|
+
case 403:
|
|
2542
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2543
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2544
|
+
allowUnrecognizedUnionMembers: true,
|
|
2545
|
+
allowUnrecognizedEnumValues: true,
|
|
2546
|
+
skipValidation: true,
|
|
2547
|
+
breadcrumbsPrefix: ["response"],
|
|
2548
|
+
}), _response.rawResponse);
|
|
2549
|
+
case 404:
|
|
2550
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2551
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2552
|
+
allowUnrecognizedUnionMembers: true,
|
|
2553
|
+
allowUnrecognizedEnumValues: true,
|
|
2554
|
+
skipValidation: true,
|
|
2555
|
+
breadcrumbsPrefix: ["response"],
|
|
2556
|
+
}), _response.rawResponse);
|
|
2557
|
+
case 500:
|
|
2558
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2559
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2560
|
+
allowUnrecognizedUnionMembers: true,
|
|
2561
|
+
allowUnrecognizedEnumValues: true,
|
|
2562
|
+
skipValidation: true,
|
|
2563
|
+
breadcrumbsPrefix: ["response"],
|
|
2564
|
+
}), _response.rawResponse);
|
|
2565
|
+
default:
|
|
2566
|
+
throw new errors.SchematicError({
|
|
2567
|
+
statusCode: _response.error.statusCode,
|
|
2568
|
+
body: _response.error.body,
|
|
2569
|
+
rawResponse: _response.rawResponse,
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
switch (_response.error.reason) {
|
|
2574
|
+
case "non-json":
|
|
2575
|
+
throw new errors.SchematicError({
|
|
2576
|
+
statusCode: _response.error.statusCode,
|
|
2577
|
+
body: _response.error.rawBody,
|
|
2578
|
+
rawResponse: _response.rawResponse,
|
|
2579
|
+
});
|
|
2580
|
+
case "timeout":
|
|
2581
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /entity-trait-definitions.");
|
|
2582
|
+
case "unknown":
|
|
2583
|
+
throw new errors.SchematicError({
|
|
2584
|
+
message: _response.error.errorMessage,
|
|
2585
|
+
rawResponse: _response.rawResponse,
|
|
2586
|
+
});
|
|
2587
|
+
}
|
|
2588
|
+
});
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* @param {string} entityTraitDefinitionId - entity_trait_definition_id
|
|
2592
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2593
|
+
*
|
|
2594
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2595
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2596
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2597
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2598
|
+
*
|
|
2599
|
+
* @example
|
|
2600
|
+
* await client.companies.getEntityTraitDefinition("entity_trait_definition_id")
|
|
2601
|
+
*/
|
|
2602
|
+
getEntityTraitDefinition(entityTraitDefinitionId, requestOptions) {
|
|
2603
|
+
return core.HttpResponsePromise.fromPromise(this.__getEntityTraitDefinition(entityTraitDefinitionId, requestOptions));
|
|
2604
|
+
}
|
|
2605
|
+
__getEntityTraitDefinition(entityTraitDefinitionId, requestOptions) {
|
|
2606
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2607
|
+
var _a, _b, _c;
|
|
2608
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2609
|
+
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)}`),
|
|
2610
|
+
method: "GET",
|
|
2611
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2612
|
+
contentType: "application/json",
|
|
2613
|
+
requestType: "json",
|
|
2614
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2615
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2616
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2617
|
+
});
|
|
2618
|
+
if (_response.ok) {
|
|
2619
|
+
return {
|
|
2620
|
+
data: serializers.GetEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2621
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2622
|
+
allowUnrecognizedUnionMembers: true,
|
|
2623
|
+
allowUnrecognizedEnumValues: true,
|
|
2624
|
+
skipValidation: true,
|
|
2625
|
+
breadcrumbsPrefix: ["response"],
|
|
2626
|
+
}),
|
|
2627
|
+
rawResponse: _response.rawResponse,
|
|
2628
|
+
};
|
|
2629
|
+
}
|
|
2630
|
+
if (_response.error.reason === "status-code") {
|
|
2631
|
+
switch (_response.error.statusCode) {
|
|
2632
|
+
case 401:
|
|
2633
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2634
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2635
|
+
allowUnrecognizedUnionMembers: true,
|
|
2636
|
+
allowUnrecognizedEnumValues: true,
|
|
2637
|
+
skipValidation: true,
|
|
2638
|
+
breadcrumbsPrefix: ["response"],
|
|
2639
|
+
}), _response.rawResponse);
|
|
2640
|
+
case 403:
|
|
2641
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2642
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2643
|
+
allowUnrecognizedUnionMembers: true,
|
|
2644
|
+
allowUnrecognizedEnumValues: true,
|
|
2645
|
+
skipValidation: true,
|
|
2646
|
+
breadcrumbsPrefix: ["response"],
|
|
2647
|
+
}), _response.rawResponse);
|
|
2648
|
+
case 404:
|
|
2649
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2650
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2651
|
+
allowUnrecognizedUnionMembers: true,
|
|
2652
|
+
allowUnrecognizedEnumValues: true,
|
|
2653
|
+
skipValidation: true,
|
|
2654
|
+
breadcrumbsPrefix: ["response"],
|
|
2655
|
+
}), _response.rawResponse);
|
|
2656
|
+
case 500:
|
|
2657
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2658
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2659
|
+
allowUnrecognizedUnionMembers: true,
|
|
2660
|
+
allowUnrecognizedEnumValues: true,
|
|
2661
|
+
skipValidation: true,
|
|
2662
|
+
breadcrumbsPrefix: ["response"],
|
|
2663
|
+
}), _response.rawResponse);
|
|
2664
|
+
default:
|
|
2665
|
+
throw new errors.SchematicError({
|
|
2666
|
+
statusCode: _response.error.statusCode,
|
|
2667
|
+
body: _response.error.body,
|
|
2668
|
+
rawResponse: _response.rawResponse,
|
|
2669
|
+
});
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
switch (_response.error.reason) {
|
|
2673
|
+
case "non-json":
|
|
2674
|
+
throw new errors.SchematicError({
|
|
2675
|
+
statusCode: _response.error.statusCode,
|
|
2676
|
+
body: _response.error.rawBody,
|
|
2677
|
+
rawResponse: _response.rawResponse,
|
|
2678
|
+
});
|
|
2679
|
+
case "timeout":
|
|
2680
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions/{entity_trait_definition_id}.");
|
|
2681
|
+
case "unknown":
|
|
2682
|
+
throw new errors.SchematicError({
|
|
2683
|
+
message: _response.error.errorMessage,
|
|
2684
|
+
rawResponse: _response.rawResponse,
|
|
2685
|
+
});
|
|
2686
|
+
}
|
|
2687
|
+
});
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* @param {string} entityTraitDefinitionId - entity_trait_definition_id
|
|
2691
|
+
* @param {Schematic.UpdateEntityTraitDefinitionRequestBody} request
|
|
2692
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2693
|
+
*
|
|
2694
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2695
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2696
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2697
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2698
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2699
|
+
*
|
|
2700
|
+
* @example
|
|
2701
|
+
* await client.companies.updateEntityTraitDefinition("entity_trait_definition_id", {
|
|
2702
|
+
* traitType: "boolean"
|
|
2703
|
+
* })
|
|
2704
|
+
*/
|
|
2705
|
+
updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions) {
|
|
2706
|
+
return core.HttpResponsePromise.fromPromise(this.__updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions));
|
|
2707
|
+
}
|
|
2708
|
+
__updateEntityTraitDefinition(entityTraitDefinitionId, request, requestOptions) {
|
|
2709
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2710
|
+
var _a, _b, _c;
|
|
2711
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2712
|
+
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)}`),
|
|
2713
|
+
method: "PUT",
|
|
2714
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2715
|
+
contentType: "application/json",
|
|
2716
|
+
requestType: "json",
|
|
2717
|
+
body: serializers.UpdateEntityTraitDefinitionRequestBody.jsonOrThrow(request, {
|
|
2718
|
+
unrecognizedObjectKeys: "strip",
|
|
2719
|
+
}),
|
|
2720
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2721
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2722
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2723
|
+
});
|
|
2724
|
+
if (_response.ok) {
|
|
2725
|
+
return {
|
|
2726
|
+
data: serializers.UpdateEntityTraitDefinitionResponse.parseOrThrow(_response.body, {
|
|
2727
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2728
|
+
allowUnrecognizedUnionMembers: true,
|
|
2729
|
+
allowUnrecognizedEnumValues: true,
|
|
2730
|
+
skipValidation: true,
|
|
2731
|
+
breadcrumbsPrefix: ["response"],
|
|
2732
|
+
}),
|
|
2733
|
+
rawResponse: _response.rawResponse,
|
|
2734
|
+
};
|
|
2735
|
+
}
|
|
2736
|
+
if (_response.error.reason === "status-code") {
|
|
2737
|
+
switch (_response.error.statusCode) {
|
|
2738
|
+
case 400:
|
|
2739
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2740
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2741
|
+
allowUnrecognizedUnionMembers: true,
|
|
2742
|
+
allowUnrecognizedEnumValues: true,
|
|
2743
|
+
skipValidation: true,
|
|
2744
|
+
breadcrumbsPrefix: ["response"],
|
|
2745
|
+
}), _response.rawResponse);
|
|
2746
|
+
case 401:
|
|
2747
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2748
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2749
|
+
allowUnrecognizedUnionMembers: true,
|
|
2750
|
+
allowUnrecognizedEnumValues: true,
|
|
2751
|
+
skipValidation: true,
|
|
2752
|
+
breadcrumbsPrefix: ["response"],
|
|
2753
|
+
}), _response.rawResponse);
|
|
2754
|
+
case 403:
|
|
2755
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2756
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2757
|
+
allowUnrecognizedUnionMembers: true,
|
|
2758
|
+
allowUnrecognizedEnumValues: true,
|
|
2759
|
+
skipValidation: true,
|
|
2760
|
+
breadcrumbsPrefix: ["response"],
|
|
2761
|
+
}), _response.rawResponse);
|
|
2762
|
+
case 404:
|
|
2763
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2764
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2765
|
+
allowUnrecognizedUnionMembers: true,
|
|
2766
|
+
allowUnrecognizedEnumValues: true,
|
|
2767
|
+
skipValidation: true,
|
|
2768
|
+
breadcrumbsPrefix: ["response"],
|
|
2769
|
+
}), _response.rawResponse);
|
|
2770
|
+
case 500:
|
|
2771
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2772
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2773
|
+
allowUnrecognizedUnionMembers: true,
|
|
2774
|
+
allowUnrecognizedEnumValues: true,
|
|
2775
|
+
skipValidation: true,
|
|
2776
|
+
breadcrumbsPrefix: ["response"],
|
|
2777
|
+
}), _response.rawResponse);
|
|
2778
|
+
default:
|
|
2779
|
+
throw new errors.SchematicError({
|
|
2780
|
+
statusCode: _response.error.statusCode,
|
|
2781
|
+
body: _response.error.body,
|
|
2782
|
+
rawResponse: _response.rawResponse,
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
switch (_response.error.reason) {
|
|
2787
|
+
case "non-json":
|
|
2788
|
+
throw new errors.SchematicError({
|
|
2789
|
+
statusCode: _response.error.statusCode,
|
|
2790
|
+
body: _response.error.rawBody,
|
|
2791
|
+
rawResponse: _response.rawResponse,
|
|
2792
|
+
});
|
|
2793
|
+
case "timeout":
|
|
2794
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling PUT /entity-trait-definitions/{entity_trait_definition_id}.");
|
|
2795
|
+
case "unknown":
|
|
2796
|
+
throw new errors.SchematicError({
|
|
2797
|
+
message: _response.error.errorMessage,
|
|
2798
|
+
rawResponse: _response.rawResponse,
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
});
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* @param {Schematic.CountEntityTraitDefinitionsRequest} request
|
|
2805
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2806
|
+
*
|
|
2807
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2808
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2809
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2810
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2811
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2812
|
+
*
|
|
2813
|
+
* @example
|
|
2814
|
+
* await client.companies.countEntityTraitDefinitions()
|
|
2815
|
+
*/
|
|
2816
|
+
countEntityTraitDefinitions(request = {}, requestOptions) {
|
|
2817
|
+
return core.HttpResponsePromise.fromPromise(this.__countEntityTraitDefinitions(request, requestOptions));
|
|
2818
|
+
}
|
|
2819
|
+
__countEntityTraitDefinitions() {
|
|
2820
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
2821
|
+
var _a, _b, _c;
|
|
2822
|
+
const { entityType, ids, q, traitType, limit, offset } = request;
|
|
2823
|
+
const _queryParams = {};
|
|
2824
|
+
if (entityType != null) {
|
|
2825
|
+
_queryParams["entity_type"] = serializers.CountEntityTraitDefinitionsRequestEntityType.jsonOrThrow(entityType, { unrecognizedObjectKeys: "strip" });
|
|
2826
|
+
}
|
|
2827
|
+
if (ids != null) {
|
|
2828
|
+
if (Array.isArray(ids)) {
|
|
2829
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
2830
|
+
}
|
|
2831
|
+
else {
|
|
2832
|
+
_queryParams["ids"] = ids;
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
if (q != null) {
|
|
2836
|
+
_queryParams["q"] = q;
|
|
2837
|
+
}
|
|
2838
|
+
if (traitType != null) {
|
|
2839
|
+
_queryParams["trait_type"] = serializers.CountEntityTraitDefinitionsRequestTraitType.jsonOrThrow(traitType, { unrecognizedObjectKeys: "strip" });
|
|
2840
|
+
}
|
|
2841
|
+
if (limit != null) {
|
|
2842
|
+
_queryParams["limit"] = limit.toString();
|
|
2843
|
+
}
|
|
2844
|
+
if (offset != null) {
|
|
2845
|
+
_queryParams["offset"] = offset.toString();
|
|
2846
|
+
}
|
|
2847
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2848
|
+
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"),
|
|
2849
|
+
method: "GET",
|
|
2850
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2851
|
+
contentType: "application/json",
|
|
2852
|
+
queryParameters: _queryParams,
|
|
2853
|
+
requestType: "json",
|
|
2854
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2855
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2856
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2857
|
+
});
|
|
2858
|
+
if (_response.ok) {
|
|
2859
|
+
return {
|
|
2860
|
+
data: serializers.CountEntityTraitDefinitionsResponse.parseOrThrow(_response.body, {
|
|
2861
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2862
|
+
allowUnrecognizedUnionMembers: true,
|
|
2863
|
+
allowUnrecognizedEnumValues: true,
|
|
2864
|
+
skipValidation: true,
|
|
2865
|
+
breadcrumbsPrefix: ["response"],
|
|
2866
|
+
}),
|
|
2867
|
+
rawResponse: _response.rawResponse,
|
|
2868
|
+
};
|
|
2869
|
+
}
|
|
2870
|
+
if (_response.error.reason === "status-code") {
|
|
2871
|
+
switch (_response.error.statusCode) {
|
|
2872
|
+
case 400:
|
|
2873
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2874
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2875
|
+
allowUnrecognizedUnionMembers: true,
|
|
2876
|
+
allowUnrecognizedEnumValues: true,
|
|
2877
|
+
skipValidation: true,
|
|
2878
|
+
breadcrumbsPrefix: ["response"],
|
|
2879
|
+
}), _response.rawResponse);
|
|
2880
|
+
case 401:
|
|
2881
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2882
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2883
|
+
allowUnrecognizedUnionMembers: true,
|
|
2884
|
+
allowUnrecognizedEnumValues: true,
|
|
2885
|
+
skipValidation: true,
|
|
2886
|
+
breadcrumbsPrefix: ["response"],
|
|
2887
|
+
}), _response.rawResponse);
|
|
2888
|
+
case 403:
|
|
2889
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2890
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2891
|
+
allowUnrecognizedUnionMembers: true,
|
|
2892
|
+
allowUnrecognizedEnumValues: true,
|
|
2893
|
+
skipValidation: true,
|
|
2894
|
+
breadcrumbsPrefix: ["response"],
|
|
2895
|
+
}), _response.rawResponse);
|
|
2896
|
+
case 404:
|
|
2897
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2898
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2899
|
+
allowUnrecognizedUnionMembers: true,
|
|
2900
|
+
allowUnrecognizedEnumValues: true,
|
|
2901
|
+
skipValidation: true,
|
|
2902
|
+
breadcrumbsPrefix: ["response"],
|
|
2903
|
+
}), _response.rawResponse);
|
|
2904
|
+
case 500:
|
|
2905
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2906
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2907
|
+
allowUnrecognizedUnionMembers: true,
|
|
2908
|
+
allowUnrecognizedEnumValues: true,
|
|
2909
|
+
skipValidation: true,
|
|
2910
|
+
breadcrumbsPrefix: ["response"],
|
|
2911
|
+
}), _response.rawResponse);
|
|
2912
|
+
default:
|
|
2913
|
+
throw new errors.SchematicError({
|
|
2914
|
+
statusCode: _response.error.statusCode,
|
|
2915
|
+
body: _response.error.body,
|
|
2916
|
+
rawResponse: _response.rawResponse,
|
|
2917
|
+
});
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
switch (_response.error.reason) {
|
|
2921
|
+
case "non-json":
|
|
2922
|
+
throw new errors.SchematicError({
|
|
2923
|
+
statusCode: _response.error.statusCode,
|
|
2924
|
+
body: _response.error.rawBody,
|
|
2925
|
+
rawResponse: _response.rawResponse,
|
|
2926
|
+
});
|
|
2927
|
+
case "timeout":
|
|
2928
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-definitions/count.");
|
|
2929
|
+
case "unknown":
|
|
2930
|
+
throw new errors.SchematicError({
|
|
2931
|
+
message: _response.error.errorMessage,
|
|
2932
|
+
rawResponse: _response.rawResponse,
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
}
|
|
2937
|
+
/**
|
|
2938
|
+
* @param {Schematic.GetEntityTraitValuesRequest} request
|
|
2939
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
2940
|
+
*
|
|
2941
|
+
* @throws {@link Schematic.BadRequestError}
|
|
2942
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
2943
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
2944
|
+
* @throws {@link Schematic.NotFoundError}
|
|
2945
|
+
* @throws {@link Schematic.InternalServerError}
|
|
2946
|
+
*
|
|
2947
|
+
* @example
|
|
2948
|
+
* await client.companies.getEntityTraitValues({
|
|
2949
|
+
* definitionId: "definition_id"
|
|
2950
|
+
* })
|
|
2951
|
+
*/
|
|
2952
|
+
getEntityTraitValues(request, requestOptions) {
|
|
2953
|
+
return core.HttpResponsePromise.fromPromise(this.__getEntityTraitValues(request, requestOptions));
|
|
2954
|
+
}
|
|
2955
|
+
__getEntityTraitValues(request, requestOptions) {
|
|
2956
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2957
|
+
var _a, _b, _c;
|
|
2958
|
+
const { definitionId, q, limit, offset } = request;
|
|
2959
|
+
const _queryParams = {};
|
|
2960
|
+
_queryParams["definition_id"] = definitionId;
|
|
2961
|
+
if (q != null) {
|
|
2962
|
+
_queryParams["q"] = q;
|
|
2963
|
+
}
|
|
2964
|
+
if (limit != null) {
|
|
2965
|
+
_queryParams["limit"] = limit.toString();
|
|
2966
|
+
}
|
|
2967
|
+
if (offset != null) {
|
|
2968
|
+
_queryParams["offset"] = offset.toString();
|
|
2969
|
+
}
|
|
2970
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
2971
|
+
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"),
|
|
2972
|
+
method: "GET",
|
|
2973
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
2974
|
+
contentType: "application/json",
|
|
2975
|
+
queryParameters: _queryParams,
|
|
2976
|
+
requestType: "json",
|
|
2977
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
2978
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
2979
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
2980
|
+
});
|
|
2981
|
+
if (_response.ok) {
|
|
2982
|
+
return {
|
|
2983
|
+
data: serializers.GetEntityTraitValuesResponse.parseOrThrow(_response.body, {
|
|
2984
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2985
|
+
allowUnrecognizedUnionMembers: true,
|
|
2986
|
+
allowUnrecognizedEnumValues: true,
|
|
2987
|
+
skipValidation: true,
|
|
2988
|
+
breadcrumbsPrefix: ["response"],
|
|
2989
|
+
}),
|
|
2990
|
+
rawResponse: _response.rawResponse,
|
|
2991
|
+
};
|
|
2992
|
+
}
|
|
2993
|
+
if (_response.error.reason === "status-code") {
|
|
2994
|
+
switch (_response.error.statusCode) {
|
|
2995
|
+
case 400:
|
|
2996
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
2997
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2998
|
+
allowUnrecognizedUnionMembers: true,
|
|
2999
|
+
allowUnrecognizedEnumValues: true,
|
|
3000
|
+
skipValidation: true,
|
|
3001
|
+
breadcrumbsPrefix: ["response"],
|
|
3002
|
+
}), _response.rawResponse);
|
|
3003
|
+
case 401:
|
|
3004
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3005
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3006
|
+
allowUnrecognizedUnionMembers: true,
|
|
3007
|
+
allowUnrecognizedEnumValues: true,
|
|
3008
|
+
skipValidation: true,
|
|
3009
|
+
breadcrumbsPrefix: ["response"],
|
|
3010
|
+
}), _response.rawResponse);
|
|
3011
|
+
case 403:
|
|
3012
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3013
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3014
|
+
allowUnrecognizedUnionMembers: true,
|
|
3015
|
+
allowUnrecognizedEnumValues: true,
|
|
3016
|
+
skipValidation: true,
|
|
3017
|
+
breadcrumbsPrefix: ["response"],
|
|
3018
|
+
}), _response.rawResponse);
|
|
3019
|
+
case 404:
|
|
3020
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3021
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3022
|
+
allowUnrecognizedUnionMembers: true,
|
|
3023
|
+
allowUnrecognizedEnumValues: true,
|
|
3024
|
+
skipValidation: true,
|
|
3025
|
+
breadcrumbsPrefix: ["response"],
|
|
3026
|
+
}), _response.rawResponse);
|
|
3027
|
+
case 500:
|
|
3028
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3029
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3030
|
+
allowUnrecognizedUnionMembers: true,
|
|
3031
|
+
allowUnrecognizedEnumValues: true,
|
|
3032
|
+
skipValidation: true,
|
|
3033
|
+
breadcrumbsPrefix: ["response"],
|
|
3034
|
+
}), _response.rawResponse);
|
|
3035
|
+
default:
|
|
3036
|
+
throw new errors.SchematicError({
|
|
3037
|
+
statusCode: _response.error.statusCode,
|
|
3038
|
+
body: _response.error.body,
|
|
3039
|
+
rawResponse: _response.rawResponse,
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
switch (_response.error.reason) {
|
|
3044
|
+
case "non-json":
|
|
3045
|
+
throw new errors.SchematicError({
|
|
3046
|
+
statusCode: _response.error.statusCode,
|
|
3047
|
+
body: _response.error.rawBody,
|
|
3048
|
+
rawResponse: _response.rawResponse,
|
|
3049
|
+
});
|
|
3050
|
+
case "timeout":
|
|
3051
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /entity-trait-values.");
|
|
3052
|
+
case "unknown":
|
|
3053
|
+
throw new errors.SchematicError({
|
|
3054
|
+
message: _response.error.errorMessage,
|
|
3055
|
+
rawResponse: _response.rawResponse,
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* @param {Schematic.UpsertTraitRequestBody} request
|
|
3062
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3063
|
+
*
|
|
3064
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3065
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3066
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3067
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3068
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3069
|
+
*
|
|
3070
|
+
* @example
|
|
3071
|
+
* await client.companies.upsertUserTrait({
|
|
3072
|
+
* keys: {
|
|
3073
|
+
* "key": "value"
|
|
3074
|
+
* },
|
|
3075
|
+
* trait: "trait"
|
|
3076
|
+
* })
|
|
3077
|
+
*/
|
|
3078
|
+
upsertUserTrait(request, requestOptions) {
|
|
3079
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertUserTrait(request, requestOptions));
|
|
3080
|
+
}
|
|
3081
|
+
__upsertUserTrait(request, requestOptions) {
|
|
3082
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3083
|
+
var _a, _b, _c;
|
|
3084
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3085
|
+
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"),
|
|
3086
|
+
method: "POST",
|
|
3087
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3088
|
+
contentType: "application/json",
|
|
3089
|
+
requestType: "json",
|
|
3090
|
+
body: serializers.UpsertTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
3091
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3092
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3093
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3094
|
+
});
|
|
3095
|
+
if (_response.ok) {
|
|
3096
|
+
return {
|
|
3097
|
+
data: serializers.UpsertUserTraitResponse.parseOrThrow(_response.body, {
|
|
3098
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3099
|
+
allowUnrecognizedUnionMembers: true,
|
|
3100
|
+
allowUnrecognizedEnumValues: true,
|
|
3101
|
+
skipValidation: true,
|
|
3102
|
+
breadcrumbsPrefix: ["response"],
|
|
3103
|
+
}),
|
|
3104
|
+
rawResponse: _response.rawResponse,
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
if (_response.error.reason === "status-code") {
|
|
3108
|
+
switch (_response.error.statusCode) {
|
|
3109
|
+
case 400:
|
|
3110
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3111
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3112
|
+
allowUnrecognizedUnionMembers: true,
|
|
3113
|
+
allowUnrecognizedEnumValues: true,
|
|
3114
|
+
skipValidation: true,
|
|
3115
|
+
breadcrumbsPrefix: ["response"],
|
|
3116
|
+
}), _response.rawResponse);
|
|
3117
|
+
case 401:
|
|
3118
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3119
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3120
|
+
allowUnrecognizedUnionMembers: true,
|
|
3121
|
+
allowUnrecognizedEnumValues: true,
|
|
3122
|
+
skipValidation: true,
|
|
3123
|
+
breadcrumbsPrefix: ["response"],
|
|
3124
|
+
}), _response.rawResponse);
|
|
3125
|
+
case 403:
|
|
3126
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3127
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3128
|
+
allowUnrecognizedUnionMembers: true,
|
|
3129
|
+
allowUnrecognizedEnumValues: true,
|
|
3130
|
+
skipValidation: true,
|
|
3131
|
+
breadcrumbsPrefix: ["response"],
|
|
3132
|
+
}), _response.rawResponse);
|
|
3133
|
+
case 404:
|
|
3134
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3135
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3136
|
+
allowUnrecognizedUnionMembers: true,
|
|
3137
|
+
allowUnrecognizedEnumValues: true,
|
|
3138
|
+
skipValidation: true,
|
|
3139
|
+
breadcrumbsPrefix: ["response"],
|
|
3140
|
+
}), _response.rawResponse);
|
|
3141
|
+
case 500:
|
|
3142
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3143
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3144
|
+
allowUnrecognizedUnionMembers: true,
|
|
3145
|
+
allowUnrecognizedEnumValues: true,
|
|
3146
|
+
skipValidation: true,
|
|
3147
|
+
breadcrumbsPrefix: ["response"],
|
|
3148
|
+
}), _response.rawResponse);
|
|
3149
|
+
default:
|
|
3150
|
+
throw new errors.SchematicError({
|
|
3151
|
+
statusCode: _response.error.statusCode,
|
|
3152
|
+
body: _response.error.body,
|
|
3153
|
+
rawResponse: _response.rawResponse,
|
|
3154
|
+
});
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
switch (_response.error.reason) {
|
|
3158
|
+
case "non-json":
|
|
3159
|
+
throw new errors.SchematicError({
|
|
3160
|
+
statusCode: _response.error.statusCode,
|
|
3161
|
+
body: _response.error.rawBody,
|
|
3162
|
+
rawResponse: _response.rawResponse,
|
|
3163
|
+
});
|
|
3164
|
+
case "timeout":
|
|
3165
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /user-traits.");
|
|
3166
|
+
case "unknown":
|
|
3167
|
+
throw new errors.SchematicError({
|
|
3168
|
+
message: _response.error.errorMessage,
|
|
3169
|
+
rawResponse: _response.rawResponse,
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
});
|
|
3173
|
+
}
|
|
3174
|
+
/**
|
|
3175
|
+
* @param {Schematic.ListUsersRequest} request
|
|
3176
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3177
|
+
*
|
|
3178
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3179
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3180
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3181
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3182
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3183
|
+
*
|
|
3184
|
+
* @example
|
|
3185
|
+
* await client.companies.listUsers()
|
|
3186
|
+
*/
|
|
3187
|
+
listUsers(request = {}, requestOptions) {
|
|
3188
|
+
return core.HttpResponsePromise.fromPromise(this.__listUsers(request, requestOptions));
|
|
3189
|
+
}
|
|
3190
|
+
__listUsers() {
|
|
3191
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
3192
|
+
var _a, _b, _c;
|
|
3193
|
+
const { companyId, ids, planId, q, limit, offset } = request;
|
|
3194
|
+
const _queryParams = {};
|
|
3195
|
+
if (companyId != null) {
|
|
3196
|
+
_queryParams["company_id"] = companyId;
|
|
3197
|
+
}
|
|
3198
|
+
if (ids != null) {
|
|
3199
|
+
if (Array.isArray(ids)) {
|
|
3200
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
3201
|
+
}
|
|
3202
|
+
else {
|
|
3203
|
+
_queryParams["ids"] = ids;
|
|
3204
|
+
}
|
|
3205
|
+
}
|
|
3206
|
+
if (planId != null) {
|
|
3207
|
+
_queryParams["plan_id"] = planId;
|
|
3208
|
+
}
|
|
3209
|
+
if (q != null) {
|
|
3210
|
+
_queryParams["q"] = q;
|
|
3211
|
+
}
|
|
3212
|
+
if (limit != null) {
|
|
3213
|
+
_queryParams["limit"] = limit.toString();
|
|
3214
|
+
}
|
|
3215
|
+
if (offset != null) {
|
|
3216
|
+
_queryParams["offset"] = offset.toString();
|
|
3217
|
+
}
|
|
3218
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3219
|
+
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"),
|
|
3220
|
+
method: "GET",
|
|
3221
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3222
|
+
contentType: "application/json",
|
|
3223
|
+
queryParameters: _queryParams,
|
|
3224
|
+
requestType: "json",
|
|
3225
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3226
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3227
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3228
|
+
});
|
|
3229
|
+
if (_response.ok) {
|
|
3230
|
+
return {
|
|
3231
|
+
data: serializers.ListUsersResponse.parseOrThrow(_response.body, {
|
|
3232
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3233
|
+
allowUnrecognizedUnionMembers: true,
|
|
3234
|
+
allowUnrecognizedEnumValues: true,
|
|
3235
|
+
skipValidation: true,
|
|
3236
|
+
breadcrumbsPrefix: ["response"],
|
|
3237
|
+
}),
|
|
3238
|
+
rawResponse: _response.rawResponse,
|
|
3239
|
+
};
|
|
3240
|
+
}
|
|
3241
|
+
if (_response.error.reason === "status-code") {
|
|
3242
|
+
switch (_response.error.statusCode) {
|
|
3243
|
+
case 400:
|
|
3244
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3245
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3246
|
+
allowUnrecognizedUnionMembers: true,
|
|
3247
|
+
allowUnrecognizedEnumValues: true,
|
|
3248
|
+
skipValidation: true,
|
|
3249
|
+
breadcrumbsPrefix: ["response"],
|
|
3250
|
+
}), _response.rawResponse);
|
|
3251
|
+
case 401:
|
|
3252
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3253
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3254
|
+
allowUnrecognizedUnionMembers: true,
|
|
3255
|
+
allowUnrecognizedEnumValues: true,
|
|
3256
|
+
skipValidation: true,
|
|
3257
|
+
breadcrumbsPrefix: ["response"],
|
|
3258
|
+
}), _response.rawResponse);
|
|
3259
|
+
case 403:
|
|
3260
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3261
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3262
|
+
allowUnrecognizedUnionMembers: true,
|
|
3263
|
+
allowUnrecognizedEnumValues: true,
|
|
3264
|
+
skipValidation: true,
|
|
3265
|
+
breadcrumbsPrefix: ["response"],
|
|
3266
|
+
}), _response.rawResponse);
|
|
3267
|
+
case 404:
|
|
3268
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3269
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3270
|
+
allowUnrecognizedUnionMembers: true,
|
|
3271
|
+
allowUnrecognizedEnumValues: true,
|
|
3272
|
+
skipValidation: true,
|
|
3273
|
+
breadcrumbsPrefix: ["response"],
|
|
3274
|
+
}), _response.rawResponse);
|
|
3275
|
+
case 500:
|
|
3276
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3277
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3278
|
+
allowUnrecognizedUnionMembers: true,
|
|
3279
|
+
allowUnrecognizedEnumValues: true,
|
|
3280
|
+
skipValidation: true,
|
|
3281
|
+
breadcrumbsPrefix: ["response"],
|
|
3282
|
+
}), _response.rawResponse);
|
|
3283
|
+
default:
|
|
3284
|
+
throw new errors.SchematicError({
|
|
3285
|
+
statusCode: _response.error.statusCode,
|
|
3286
|
+
body: _response.error.body,
|
|
3287
|
+
rawResponse: _response.rawResponse,
|
|
3288
|
+
});
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
switch (_response.error.reason) {
|
|
3292
|
+
case "non-json":
|
|
3293
|
+
throw new errors.SchematicError({
|
|
3294
|
+
statusCode: _response.error.statusCode,
|
|
3295
|
+
body: _response.error.rawBody,
|
|
3296
|
+
rawResponse: _response.rawResponse,
|
|
3297
|
+
});
|
|
3298
|
+
case "timeout":
|
|
3299
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users.");
|
|
3300
|
+
case "unknown":
|
|
3301
|
+
throw new errors.SchematicError({
|
|
3302
|
+
message: _response.error.errorMessage,
|
|
3303
|
+
rawResponse: _response.rawResponse,
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
});
|
|
3307
|
+
}
|
|
3308
|
+
/**
|
|
3309
|
+
* @param {Schematic.UpsertUserRequestBody} request
|
|
3310
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3311
|
+
*
|
|
3312
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3313
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3314
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3315
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3316
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3317
|
+
*
|
|
3318
|
+
* @example
|
|
3319
|
+
* await client.companies.upsertUser({
|
|
3320
|
+
* keys: {
|
|
3321
|
+
* "key": "value"
|
|
3322
|
+
* }
|
|
3323
|
+
* })
|
|
3324
|
+
*/
|
|
3325
|
+
upsertUser(request, requestOptions) {
|
|
3326
|
+
return core.HttpResponsePromise.fromPromise(this.__upsertUser(request, requestOptions));
|
|
3327
|
+
}
|
|
3328
|
+
__upsertUser(request, requestOptions) {
|
|
3329
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3330
|
+
var _a, _b, _c;
|
|
3331
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3332
|
+
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"),
|
|
3333
|
+
method: "POST",
|
|
3334
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3335
|
+
contentType: "application/json",
|
|
3336
|
+
requestType: "json",
|
|
3337
|
+
body: serializers.UpsertUserRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
3338
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3339
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3340
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3341
|
+
});
|
|
3342
|
+
if (_response.ok) {
|
|
3343
|
+
return {
|
|
3344
|
+
data: serializers.UpsertUserResponse.parseOrThrow(_response.body, {
|
|
3345
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3346
|
+
allowUnrecognizedUnionMembers: true,
|
|
3347
|
+
allowUnrecognizedEnumValues: true,
|
|
3348
|
+
skipValidation: true,
|
|
3349
|
+
breadcrumbsPrefix: ["response"],
|
|
3350
|
+
}),
|
|
3351
|
+
rawResponse: _response.rawResponse,
|
|
3352
|
+
};
|
|
3353
|
+
}
|
|
3354
|
+
if (_response.error.reason === "status-code") {
|
|
3355
|
+
switch (_response.error.statusCode) {
|
|
3356
|
+
case 400:
|
|
3357
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3358
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3359
|
+
allowUnrecognizedUnionMembers: true,
|
|
3360
|
+
allowUnrecognizedEnumValues: true,
|
|
3361
|
+
skipValidation: true,
|
|
3362
|
+
breadcrumbsPrefix: ["response"],
|
|
3363
|
+
}), _response.rawResponse);
|
|
3364
|
+
case 401:
|
|
3365
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3366
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3367
|
+
allowUnrecognizedUnionMembers: true,
|
|
3368
|
+
allowUnrecognizedEnumValues: true,
|
|
3369
|
+
skipValidation: true,
|
|
3370
|
+
breadcrumbsPrefix: ["response"],
|
|
3371
|
+
}), _response.rawResponse);
|
|
3372
|
+
case 403:
|
|
3373
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3374
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3375
|
+
allowUnrecognizedUnionMembers: true,
|
|
3376
|
+
allowUnrecognizedEnumValues: true,
|
|
3377
|
+
skipValidation: true,
|
|
3378
|
+
breadcrumbsPrefix: ["response"],
|
|
3379
|
+
}), _response.rawResponse);
|
|
3380
|
+
case 404:
|
|
3381
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3382
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3383
|
+
allowUnrecognizedUnionMembers: true,
|
|
3384
|
+
allowUnrecognizedEnumValues: true,
|
|
3385
|
+
skipValidation: true,
|
|
3386
|
+
breadcrumbsPrefix: ["response"],
|
|
3387
|
+
}), _response.rawResponse);
|
|
3388
|
+
case 500:
|
|
3389
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3390
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3391
|
+
allowUnrecognizedUnionMembers: true,
|
|
3392
|
+
allowUnrecognizedEnumValues: true,
|
|
3393
|
+
skipValidation: true,
|
|
3394
|
+
breadcrumbsPrefix: ["response"],
|
|
3395
|
+
}), _response.rawResponse);
|
|
3396
|
+
default:
|
|
3397
|
+
throw new errors.SchematicError({
|
|
3398
|
+
statusCode: _response.error.statusCode,
|
|
3399
|
+
body: _response.error.body,
|
|
3400
|
+
rawResponse: _response.rawResponse,
|
|
3401
|
+
});
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
switch (_response.error.reason) {
|
|
3405
|
+
case "non-json":
|
|
3406
|
+
throw new errors.SchematicError({
|
|
3407
|
+
statusCode: _response.error.statusCode,
|
|
3408
|
+
body: _response.error.rawBody,
|
|
3409
|
+
rawResponse: _response.rawResponse,
|
|
3410
|
+
});
|
|
3411
|
+
case "timeout":
|
|
3412
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users.");
|
|
3413
|
+
case "unknown":
|
|
3414
|
+
throw new errors.SchematicError({
|
|
3415
|
+
message: _response.error.errorMessage,
|
|
3416
|
+
rawResponse: _response.rawResponse,
|
|
3417
|
+
});
|
|
3418
|
+
}
|
|
3419
|
+
});
|
|
3420
|
+
}
|
|
3421
|
+
/**
|
|
3422
|
+
* @param {string} userId - user_id
|
|
3423
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3424
|
+
*
|
|
3425
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3426
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3427
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3428
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3429
|
+
*
|
|
3430
|
+
* @example
|
|
3431
|
+
* await client.companies.getUser("user_id")
|
|
3432
|
+
*/
|
|
3433
|
+
getUser(userId, requestOptions) {
|
|
3434
|
+
return core.HttpResponsePromise.fromPromise(this.__getUser(userId, requestOptions));
|
|
3435
|
+
}
|
|
3436
|
+
__getUser(userId, requestOptions) {
|
|
3437
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3438
|
+
var _a, _b, _c;
|
|
3439
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3440
|
+
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)}`),
|
|
3441
|
+
method: "GET",
|
|
3442
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3443
|
+
contentType: "application/json",
|
|
3444
|
+
requestType: "json",
|
|
3445
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3446
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3447
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3448
|
+
});
|
|
3449
|
+
if (_response.ok) {
|
|
3450
|
+
return {
|
|
3451
|
+
data: serializers.GetUserResponse.parseOrThrow(_response.body, {
|
|
3452
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3453
|
+
allowUnrecognizedUnionMembers: true,
|
|
3454
|
+
allowUnrecognizedEnumValues: true,
|
|
3455
|
+
skipValidation: true,
|
|
3456
|
+
breadcrumbsPrefix: ["response"],
|
|
3457
|
+
}),
|
|
3458
|
+
rawResponse: _response.rawResponse,
|
|
3459
|
+
};
|
|
3460
|
+
}
|
|
3461
|
+
if (_response.error.reason === "status-code") {
|
|
3462
|
+
switch (_response.error.statusCode) {
|
|
3463
|
+
case 401:
|
|
3464
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3465
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3466
|
+
allowUnrecognizedUnionMembers: true,
|
|
3467
|
+
allowUnrecognizedEnumValues: true,
|
|
3468
|
+
skipValidation: true,
|
|
3469
|
+
breadcrumbsPrefix: ["response"],
|
|
3470
|
+
}), _response.rawResponse);
|
|
3471
|
+
case 403:
|
|
3472
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3473
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3474
|
+
allowUnrecognizedUnionMembers: true,
|
|
3475
|
+
allowUnrecognizedEnumValues: true,
|
|
3476
|
+
skipValidation: true,
|
|
3477
|
+
breadcrumbsPrefix: ["response"],
|
|
3478
|
+
}), _response.rawResponse);
|
|
3479
|
+
case 404:
|
|
3480
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3481
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3482
|
+
allowUnrecognizedUnionMembers: true,
|
|
3483
|
+
allowUnrecognizedEnumValues: true,
|
|
3484
|
+
skipValidation: true,
|
|
3485
|
+
breadcrumbsPrefix: ["response"],
|
|
3486
|
+
}), _response.rawResponse);
|
|
3487
|
+
case 500:
|
|
3488
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3489
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3490
|
+
allowUnrecognizedUnionMembers: true,
|
|
3491
|
+
allowUnrecognizedEnumValues: true,
|
|
3492
|
+
skipValidation: true,
|
|
3493
|
+
breadcrumbsPrefix: ["response"],
|
|
3494
|
+
}), _response.rawResponse);
|
|
3495
|
+
default:
|
|
3496
|
+
throw new errors.SchematicError({
|
|
3497
|
+
statusCode: _response.error.statusCode,
|
|
3498
|
+
body: _response.error.body,
|
|
3499
|
+
rawResponse: _response.rawResponse,
|
|
3500
|
+
});
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
switch (_response.error.reason) {
|
|
3504
|
+
case "non-json":
|
|
3505
|
+
throw new errors.SchematicError({
|
|
3506
|
+
statusCode: _response.error.statusCode,
|
|
3507
|
+
body: _response.error.rawBody,
|
|
3508
|
+
rawResponse: _response.rawResponse,
|
|
3509
|
+
});
|
|
3510
|
+
case "timeout":
|
|
3511
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/{user_id}.");
|
|
3512
|
+
case "unknown":
|
|
3513
|
+
throw new errors.SchematicError({
|
|
3514
|
+
message: _response.error.errorMessage,
|
|
3515
|
+
rawResponse: _response.rawResponse,
|
|
3516
|
+
});
|
|
3517
|
+
}
|
|
3518
|
+
});
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
* @param {string} userId - user_id
|
|
3522
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3523
|
+
*
|
|
3524
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3525
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3526
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3527
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3528
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3529
|
+
*
|
|
3530
|
+
* @example
|
|
3531
|
+
* await client.companies.deleteUser("user_id")
|
|
3532
|
+
*/
|
|
3533
|
+
deleteUser(userId, requestOptions) {
|
|
3534
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteUser(userId, requestOptions));
|
|
3535
|
+
}
|
|
3536
|
+
__deleteUser(userId, requestOptions) {
|
|
3537
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3538
|
+
var _a, _b, _c;
|
|
3539
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3540
|
+
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)}`),
|
|
3541
|
+
method: "DELETE",
|
|
3542
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3543
|
+
contentType: "application/json",
|
|
3544
|
+
requestType: "json",
|
|
3545
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3546
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3547
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3548
|
+
});
|
|
3549
|
+
if (_response.ok) {
|
|
3550
|
+
return {
|
|
3551
|
+
data: serializers.DeleteUserResponse.parseOrThrow(_response.body, {
|
|
3552
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3553
|
+
allowUnrecognizedUnionMembers: true,
|
|
3554
|
+
allowUnrecognizedEnumValues: true,
|
|
3555
|
+
skipValidation: true,
|
|
3556
|
+
breadcrumbsPrefix: ["response"],
|
|
3557
|
+
}),
|
|
3558
|
+
rawResponse: _response.rawResponse,
|
|
3559
|
+
};
|
|
3560
|
+
}
|
|
3561
|
+
if (_response.error.reason === "status-code") {
|
|
3562
|
+
switch (_response.error.statusCode) {
|
|
3563
|
+
case 400:
|
|
3564
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3565
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3566
|
+
allowUnrecognizedUnionMembers: true,
|
|
3567
|
+
allowUnrecognizedEnumValues: true,
|
|
3568
|
+
skipValidation: true,
|
|
3569
|
+
breadcrumbsPrefix: ["response"],
|
|
3570
|
+
}), _response.rawResponse);
|
|
3571
|
+
case 401:
|
|
3572
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3573
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3574
|
+
allowUnrecognizedUnionMembers: true,
|
|
3575
|
+
allowUnrecognizedEnumValues: true,
|
|
3576
|
+
skipValidation: true,
|
|
3577
|
+
breadcrumbsPrefix: ["response"],
|
|
3578
|
+
}), _response.rawResponse);
|
|
3579
|
+
case 403:
|
|
3580
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3581
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3582
|
+
allowUnrecognizedUnionMembers: true,
|
|
3583
|
+
allowUnrecognizedEnumValues: true,
|
|
3584
|
+
skipValidation: true,
|
|
3585
|
+
breadcrumbsPrefix: ["response"],
|
|
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);
|
|
3595
|
+
case 500:
|
|
3596
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3597
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3598
|
+
allowUnrecognizedUnionMembers: true,
|
|
3599
|
+
allowUnrecognizedEnumValues: true,
|
|
3600
|
+
skipValidation: true,
|
|
3601
|
+
breadcrumbsPrefix: ["response"],
|
|
3602
|
+
}), _response.rawResponse);
|
|
3603
|
+
default:
|
|
3604
|
+
throw new errors.SchematicError({
|
|
3605
|
+
statusCode: _response.error.statusCode,
|
|
3606
|
+
body: _response.error.body,
|
|
3607
|
+
rawResponse: _response.rawResponse,
|
|
3608
|
+
});
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
switch (_response.error.reason) {
|
|
3612
|
+
case "non-json":
|
|
3613
|
+
throw new errors.SchematicError({
|
|
3614
|
+
statusCode: _response.error.statusCode,
|
|
3615
|
+
body: _response.error.rawBody,
|
|
3616
|
+
rawResponse: _response.rawResponse,
|
|
3617
|
+
});
|
|
3618
|
+
case "timeout":
|
|
3619
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling DELETE /users/{user_id}.");
|
|
3620
|
+
case "unknown":
|
|
3621
|
+
throw new errors.SchematicError({
|
|
3622
|
+
message: _response.error.errorMessage,
|
|
3623
|
+
rawResponse: _response.rawResponse,
|
|
3624
|
+
});
|
|
3625
|
+
}
|
|
3626
|
+
});
|
|
3627
|
+
}
|
|
3628
|
+
/**
|
|
3629
|
+
* @param {Schematic.CountUsersRequest} request
|
|
3630
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3631
|
+
*
|
|
3632
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3633
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3634
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3635
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3636
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3637
|
+
*
|
|
3638
|
+
* @example
|
|
3639
|
+
* await client.companies.countUsers()
|
|
3640
|
+
*/
|
|
3641
|
+
countUsers(request = {}, requestOptions) {
|
|
3642
|
+
return core.HttpResponsePromise.fromPromise(this.__countUsers(request, requestOptions));
|
|
3643
|
+
}
|
|
3644
|
+
__countUsers() {
|
|
3645
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
3646
|
+
var _a, _b, _c;
|
|
3647
|
+
const { companyId, ids, planId, q, limit, offset } = request;
|
|
3648
|
+
const _queryParams = {};
|
|
3649
|
+
if (companyId != null) {
|
|
3650
|
+
_queryParams["company_id"] = companyId;
|
|
3651
|
+
}
|
|
3652
|
+
if (ids != null) {
|
|
3653
|
+
if (Array.isArray(ids)) {
|
|
3654
|
+
_queryParams["ids"] = ids.map((item) => item);
|
|
3655
|
+
}
|
|
3656
|
+
else {
|
|
3657
|
+
_queryParams["ids"] = ids;
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
if (planId != null) {
|
|
3661
|
+
_queryParams["plan_id"] = planId;
|
|
3662
|
+
}
|
|
3663
|
+
if (q != null) {
|
|
3664
|
+
_queryParams["q"] = q;
|
|
3665
|
+
}
|
|
3666
|
+
if (limit != null) {
|
|
3667
|
+
_queryParams["limit"] = limit.toString();
|
|
3668
|
+
}
|
|
3669
|
+
if (offset != null) {
|
|
3670
|
+
_queryParams["offset"] = offset.toString();
|
|
3671
|
+
}
|
|
3672
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3673
|
+
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"),
|
|
3674
|
+
method: "GET",
|
|
3675
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3676
|
+
contentType: "application/json",
|
|
3677
|
+
queryParameters: _queryParams,
|
|
3678
|
+
requestType: "json",
|
|
3679
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3680
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3681
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3682
|
+
});
|
|
3683
|
+
if (_response.ok) {
|
|
3684
|
+
return {
|
|
3685
|
+
data: serializers.CountUsersResponse.parseOrThrow(_response.body, {
|
|
3686
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3687
|
+
allowUnrecognizedUnionMembers: true,
|
|
3688
|
+
allowUnrecognizedEnumValues: true,
|
|
3689
|
+
skipValidation: true,
|
|
3690
|
+
breadcrumbsPrefix: ["response"],
|
|
3691
|
+
}),
|
|
3692
|
+
rawResponse: _response.rawResponse,
|
|
3693
|
+
};
|
|
3694
|
+
}
|
|
3695
|
+
if (_response.error.reason === "status-code") {
|
|
3696
|
+
switch (_response.error.statusCode) {
|
|
3697
|
+
case 400:
|
|
3698
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3699
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3700
|
+
allowUnrecognizedUnionMembers: true,
|
|
3701
|
+
allowUnrecognizedEnumValues: true,
|
|
3702
|
+
skipValidation: true,
|
|
3703
|
+
breadcrumbsPrefix: ["response"],
|
|
3704
|
+
}), _response.rawResponse);
|
|
3705
|
+
case 401:
|
|
3706
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3707
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3708
|
+
allowUnrecognizedUnionMembers: true,
|
|
3709
|
+
allowUnrecognizedEnumValues: true,
|
|
3710
|
+
skipValidation: true,
|
|
3711
|
+
breadcrumbsPrefix: ["response"],
|
|
3712
|
+
}), _response.rawResponse);
|
|
3713
|
+
case 403:
|
|
3714
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3715
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3716
|
+
allowUnrecognizedUnionMembers: true,
|
|
3717
|
+
allowUnrecognizedEnumValues: true,
|
|
3718
|
+
skipValidation: true,
|
|
3719
|
+
breadcrumbsPrefix: ["response"],
|
|
3720
|
+
}), _response.rawResponse);
|
|
3721
|
+
case 404:
|
|
3722
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3723
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3724
|
+
allowUnrecognizedUnionMembers: true,
|
|
3725
|
+
allowUnrecognizedEnumValues: true,
|
|
3726
|
+
skipValidation: true,
|
|
3727
|
+
breadcrumbsPrefix: ["response"],
|
|
3728
|
+
}), _response.rawResponse);
|
|
3729
|
+
case 500:
|
|
3730
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3731
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3732
|
+
allowUnrecognizedUnionMembers: true,
|
|
3733
|
+
allowUnrecognizedEnumValues: true,
|
|
3734
|
+
skipValidation: true,
|
|
3735
|
+
breadcrumbsPrefix: ["response"],
|
|
3736
|
+
}), _response.rawResponse);
|
|
3737
|
+
default:
|
|
3738
|
+
throw new errors.SchematicError({
|
|
3739
|
+
statusCode: _response.error.statusCode,
|
|
3740
|
+
body: _response.error.body,
|
|
3741
|
+
rawResponse: _response.rawResponse,
|
|
3742
|
+
});
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
switch (_response.error.reason) {
|
|
3746
|
+
case "non-json":
|
|
3747
|
+
throw new errors.SchematicError({
|
|
3748
|
+
statusCode: _response.error.statusCode,
|
|
3749
|
+
body: _response.error.rawBody,
|
|
3750
|
+
rawResponse: _response.rawResponse,
|
|
3751
|
+
});
|
|
3752
|
+
case "timeout":
|
|
3753
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/count.");
|
|
3754
|
+
case "unknown":
|
|
3755
|
+
throw new errors.SchematicError({
|
|
3756
|
+
message: _response.error.errorMessage,
|
|
3757
|
+
rawResponse: _response.rawResponse,
|
|
3758
|
+
});
|
|
3759
|
+
}
|
|
3760
|
+
});
|
|
3761
|
+
}
|
|
3762
|
+
/**
|
|
3763
|
+
* @param {Schematic.UpsertUserRequestBody} request
|
|
3764
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3765
|
+
*
|
|
3766
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3767
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3768
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3769
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3770
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3771
|
+
*
|
|
3772
|
+
* @example
|
|
3773
|
+
* await client.companies.createUser({
|
|
3774
|
+
* keys: {
|
|
3775
|
+
* "key": "value"
|
|
3776
|
+
* }
|
|
3777
|
+
* })
|
|
3778
|
+
*/
|
|
3779
|
+
createUser(request, requestOptions) {
|
|
3780
|
+
return core.HttpResponsePromise.fromPromise(this.__createUser(request, requestOptions));
|
|
3781
|
+
}
|
|
3782
|
+
__createUser(request, requestOptions) {
|
|
3783
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3784
|
+
var _a, _b, _c;
|
|
3785
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3786
|
+
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"),
|
|
3787
|
+
method: "POST",
|
|
3788
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3789
|
+
contentType: "application/json",
|
|
3790
|
+
requestType: "json",
|
|
3791
|
+
body: serializers.UpsertUserRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
3792
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3793
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3794
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3795
|
+
});
|
|
3796
|
+
if (_response.ok) {
|
|
3797
|
+
return {
|
|
3798
|
+
data: serializers.CreateUserResponse.parseOrThrow(_response.body, {
|
|
3799
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3800
|
+
allowUnrecognizedUnionMembers: true,
|
|
3801
|
+
allowUnrecognizedEnumValues: true,
|
|
3802
|
+
skipValidation: true,
|
|
3803
|
+
breadcrumbsPrefix: ["response"],
|
|
3804
|
+
}),
|
|
3805
|
+
rawResponse: _response.rawResponse,
|
|
3806
|
+
};
|
|
3807
|
+
}
|
|
3808
|
+
if (_response.error.reason === "status-code") {
|
|
3809
|
+
switch (_response.error.statusCode) {
|
|
3810
|
+
case 400:
|
|
3811
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3812
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3813
|
+
allowUnrecognizedUnionMembers: true,
|
|
3814
|
+
allowUnrecognizedEnumValues: true,
|
|
3815
|
+
skipValidation: true,
|
|
3816
|
+
breadcrumbsPrefix: ["response"],
|
|
3817
|
+
}), _response.rawResponse);
|
|
3818
|
+
case 401:
|
|
3819
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3820
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3821
|
+
allowUnrecognizedUnionMembers: true,
|
|
3822
|
+
allowUnrecognizedEnumValues: true,
|
|
3823
|
+
skipValidation: true,
|
|
3824
|
+
breadcrumbsPrefix: ["response"],
|
|
3825
|
+
}), _response.rawResponse);
|
|
3826
|
+
case 403:
|
|
3827
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3828
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3829
|
+
allowUnrecognizedUnionMembers: true,
|
|
3830
|
+
allowUnrecognizedEnumValues: true,
|
|
3831
|
+
skipValidation: true,
|
|
3832
|
+
breadcrumbsPrefix: ["response"],
|
|
3833
|
+
}), _response.rawResponse);
|
|
3834
|
+
case 404:
|
|
3835
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3836
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3837
|
+
allowUnrecognizedUnionMembers: true,
|
|
3838
|
+
allowUnrecognizedEnumValues: true,
|
|
3839
|
+
skipValidation: true,
|
|
3840
|
+
breadcrumbsPrefix: ["response"],
|
|
3841
|
+
}), _response.rawResponse);
|
|
3842
|
+
case 500:
|
|
3843
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3844
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3845
|
+
allowUnrecognizedUnionMembers: true,
|
|
3846
|
+
allowUnrecognizedEnumValues: true,
|
|
3847
|
+
skipValidation: true,
|
|
3848
|
+
breadcrumbsPrefix: ["response"],
|
|
3849
|
+
}), _response.rawResponse);
|
|
3850
|
+
default:
|
|
3851
|
+
throw new errors.SchematicError({
|
|
3852
|
+
statusCode: _response.error.statusCode,
|
|
3853
|
+
body: _response.error.body,
|
|
3854
|
+
rawResponse: _response.rawResponse,
|
|
3855
|
+
});
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
switch (_response.error.reason) {
|
|
3859
|
+
case "non-json":
|
|
3860
|
+
throw new errors.SchematicError({
|
|
3861
|
+
statusCode: _response.error.statusCode,
|
|
3862
|
+
body: _response.error.rawBody,
|
|
3863
|
+
rawResponse: _response.rawResponse,
|
|
3864
|
+
});
|
|
3865
|
+
case "timeout":
|
|
3866
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users/create.");
|
|
3867
|
+
case "unknown":
|
|
3868
|
+
throw new errors.SchematicError({
|
|
3869
|
+
message: _response.error.errorMessage,
|
|
3870
|
+
rawResponse: _response.rawResponse,
|
|
3871
|
+
});
|
|
3872
|
+
}
|
|
3873
|
+
});
|
|
3874
|
+
}
|
|
3875
|
+
/**
|
|
3876
|
+
* @param {Schematic.KeysRequestBody} request
|
|
3877
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3878
|
+
*
|
|
3879
|
+
* @throws {@link Schematic.BadRequestError}
|
|
3880
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3881
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3882
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3883
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3884
|
+
*
|
|
3885
|
+
* @example
|
|
3886
|
+
* await client.companies.deleteUserByKeys({
|
|
3887
|
+
* keys: {
|
|
3888
|
+
* "key": "value"
|
|
3889
|
+
* }
|
|
3890
|
+
* })
|
|
3891
|
+
*/
|
|
3892
|
+
deleteUserByKeys(request, requestOptions) {
|
|
3893
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteUserByKeys(request, requestOptions));
|
|
3894
|
+
}
|
|
3895
|
+
__deleteUserByKeys(request, requestOptions) {
|
|
3896
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3897
|
+
var _a, _b, _c;
|
|
3898
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
3899
|
+
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"),
|
|
3900
|
+
method: "POST",
|
|
3901
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
3902
|
+
contentType: "application/json",
|
|
3903
|
+
requestType: "json",
|
|
3904
|
+
body: serializers.KeysRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
3905
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
3906
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
3907
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
3908
|
+
});
|
|
3909
|
+
if (_response.ok) {
|
|
3910
|
+
return {
|
|
3911
|
+
data: serializers.DeleteUserByKeysResponse.parseOrThrow(_response.body, {
|
|
3912
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3913
|
+
allowUnrecognizedUnionMembers: true,
|
|
3914
|
+
allowUnrecognizedEnumValues: true,
|
|
3915
|
+
skipValidation: true,
|
|
3916
|
+
breadcrumbsPrefix: ["response"],
|
|
3917
|
+
}),
|
|
3918
|
+
rawResponse: _response.rawResponse,
|
|
3919
|
+
};
|
|
3920
|
+
}
|
|
3921
|
+
if (_response.error.reason === "status-code") {
|
|
3922
|
+
switch (_response.error.statusCode) {
|
|
3923
|
+
case 400:
|
|
3924
|
+
throw new Schematic.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3925
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3926
|
+
allowUnrecognizedUnionMembers: true,
|
|
3927
|
+
allowUnrecognizedEnumValues: true,
|
|
3928
|
+
skipValidation: true,
|
|
3929
|
+
breadcrumbsPrefix: ["response"],
|
|
3930
|
+
}), _response.rawResponse);
|
|
3931
|
+
case 401:
|
|
3932
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3933
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3934
|
+
allowUnrecognizedUnionMembers: true,
|
|
3935
|
+
allowUnrecognizedEnumValues: true,
|
|
3936
|
+
skipValidation: true,
|
|
3937
|
+
breadcrumbsPrefix: ["response"],
|
|
3938
|
+
}), _response.rawResponse);
|
|
3939
|
+
case 403:
|
|
3940
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3941
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3942
|
+
allowUnrecognizedUnionMembers: true,
|
|
3943
|
+
allowUnrecognizedEnumValues: true,
|
|
3944
|
+
skipValidation: true,
|
|
3945
|
+
breadcrumbsPrefix: ["response"],
|
|
3946
|
+
}), _response.rawResponse);
|
|
3947
|
+
case 404:
|
|
3948
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3949
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3950
|
+
allowUnrecognizedUnionMembers: true,
|
|
3951
|
+
allowUnrecognizedEnumValues: true,
|
|
3952
|
+
skipValidation: true,
|
|
3953
|
+
breadcrumbsPrefix: ["response"],
|
|
3954
|
+
}), _response.rawResponse);
|
|
3955
|
+
case 500:
|
|
3956
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
3957
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3958
|
+
allowUnrecognizedUnionMembers: true,
|
|
3959
|
+
allowUnrecognizedEnumValues: true,
|
|
3960
|
+
skipValidation: true,
|
|
3961
|
+
breadcrumbsPrefix: ["response"],
|
|
3962
|
+
}), _response.rawResponse);
|
|
3963
|
+
default:
|
|
3964
|
+
throw new errors.SchematicError({
|
|
3965
|
+
statusCode: _response.error.statusCode,
|
|
3966
|
+
body: _response.error.body,
|
|
3967
|
+
rawResponse: _response.rawResponse,
|
|
3968
|
+
});
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3971
|
+
switch (_response.error.reason) {
|
|
3972
|
+
case "non-json":
|
|
3973
|
+
throw new errors.SchematicError({
|
|
3974
|
+
statusCode: _response.error.statusCode,
|
|
3975
|
+
body: _response.error.rawBody,
|
|
3976
|
+
rawResponse: _response.rawResponse,
|
|
3977
|
+
});
|
|
3978
|
+
case "timeout":
|
|
3979
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling POST /users/delete.");
|
|
3980
|
+
case "unknown":
|
|
3981
|
+
throw new errors.SchematicError({
|
|
3982
|
+
message: _response.error.errorMessage,
|
|
3983
|
+
rawResponse: _response.rawResponse,
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
});
|
|
3987
|
+
}
|
|
3988
|
+
/**
|
|
3989
|
+
* @param {Schematic.LookupUserRequest} request
|
|
3990
|
+
* @param {Companies.RequestOptions} requestOptions - Request-specific configuration.
|
|
3991
|
+
*
|
|
3992
|
+
* @throws {@link Schematic.UnauthorizedError}
|
|
3993
|
+
* @throws {@link Schematic.ForbiddenError}
|
|
3994
|
+
* @throws {@link Schematic.NotFoundError}
|
|
3995
|
+
* @throws {@link Schematic.InternalServerError}
|
|
3996
|
+
*
|
|
3997
|
+
* @example
|
|
3998
|
+
* await client.companies.lookupUser({
|
|
3999
|
+
* keys: {
|
|
4000
|
+
* "keys": "keys"
|
|
4001
|
+
* }
|
|
4002
|
+
* })
|
|
4003
|
+
*/
|
|
4004
|
+
lookupUser(request, requestOptions) {
|
|
4005
|
+
return core.HttpResponsePromise.fromPromise(this.__lookupUser(request, requestOptions));
|
|
4006
|
+
}
|
|
4007
|
+
__lookupUser(request, requestOptions) {
|
|
4008
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4009
|
+
var _a, _b, _c;
|
|
4010
|
+
const { keys } = request;
|
|
4011
|
+
const _queryParams = {};
|
|
4012
|
+
_queryParams["keys"] = (0, json_1.toJson)(keys);
|
|
4013
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
4014
|
+
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"),
|
|
4015
|
+
method: "GET",
|
|
4016
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@schematichq/schematic-typescript-node", "X-Fern-SDK-Version": "1.1.12", "User-Agent": "@schematichq/schematic-typescript-node/1.1.12", "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),
|
|
4017
|
+
contentType: "application/json",
|
|
4018
|
+
queryParameters: _queryParams,
|
|
4019
|
+
requestType: "json",
|
|
4020
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
4021
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
4022
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
4023
|
+
});
|
|
4024
|
+
if (_response.ok) {
|
|
4025
|
+
return {
|
|
4026
|
+
data: serializers.LookupUserResponse.parseOrThrow(_response.body, {
|
|
4027
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4028
|
+
allowUnrecognizedUnionMembers: true,
|
|
4029
|
+
allowUnrecognizedEnumValues: true,
|
|
4030
|
+
skipValidation: true,
|
|
4031
|
+
breadcrumbsPrefix: ["response"],
|
|
4032
|
+
}),
|
|
4033
|
+
rawResponse: _response.rawResponse,
|
|
4034
|
+
};
|
|
4035
|
+
}
|
|
4036
|
+
if (_response.error.reason === "status-code") {
|
|
4037
|
+
switch (_response.error.statusCode) {
|
|
4038
|
+
case 401:
|
|
4039
|
+
throw new Schematic.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
4040
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4041
|
+
allowUnrecognizedUnionMembers: true,
|
|
4042
|
+
allowUnrecognizedEnumValues: true,
|
|
4043
|
+
skipValidation: true,
|
|
4044
|
+
breadcrumbsPrefix: ["response"],
|
|
4045
|
+
}), _response.rawResponse);
|
|
4046
|
+
case 403:
|
|
4047
|
+
throw new Schematic.ForbiddenError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
4048
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4049
|
+
allowUnrecognizedUnionMembers: true,
|
|
4050
|
+
allowUnrecognizedEnumValues: true,
|
|
4051
|
+
skipValidation: true,
|
|
4052
|
+
breadcrumbsPrefix: ["response"],
|
|
4053
|
+
}), _response.rawResponse);
|
|
4054
|
+
case 404:
|
|
4055
|
+
throw new Schematic.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
4056
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4057
|
+
allowUnrecognizedUnionMembers: true,
|
|
4058
|
+
allowUnrecognizedEnumValues: true,
|
|
4059
|
+
skipValidation: true,
|
|
4060
|
+
breadcrumbsPrefix: ["response"],
|
|
4061
|
+
}), _response.rawResponse);
|
|
4062
|
+
case 500:
|
|
4063
|
+
throw new Schematic.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
4064
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4065
|
+
allowUnrecognizedUnionMembers: true,
|
|
4066
|
+
allowUnrecognizedEnumValues: true,
|
|
4067
|
+
skipValidation: true,
|
|
4068
|
+
breadcrumbsPrefix: ["response"],
|
|
4069
|
+
}), _response.rawResponse);
|
|
4070
|
+
default:
|
|
4071
|
+
throw new errors.SchematicError({
|
|
4072
|
+
statusCode: _response.error.statusCode,
|
|
4073
|
+
body: _response.error.body,
|
|
4074
|
+
rawResponse: _response.rawResponse,
|
|
4075
|
+
});
|
|
4076
|
+
}
|
|
4077
|
+
}
|
|
4078
|
+
switch (_response.error.reason) {
|
|
4079
|
+
case "non-json":
|
|
4080
|
+
throw new errors.SchematicError({
|
|
4081
|
+
statusCode: _response.error.statusCode,
|
|
4082
|
+
body: _response.error.rawBody,
|
|
4083
|
+
rawResponse: _response.rawResponse,
|
|
4084
|
+
});
|
|
4085
|
+
case "timeout":
|
|
4086
|
+
throw new errors.SchematicTimeoutError("Timeout exceeded when calling GET /users/lookup.");
|
|
4087
|
+
case "unknown":
|
|
4088
|
+
throw new errors.SchematicError({
|
|
4089
|
+
message: _response.error.errorMessage,
|
|
4090
|
+
rawResponse: _response.rawResponse,
|
|
4091
|
+
});
|
|
4092
|
+
}
|
|
4093
|
+
});
|
|
4094
|
+
}
|
|
4095
|
+
_getCustomAuthorizationHeaders() {
|
|
4096
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4097
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
4098
|
+
return { "X-Schematic-Api-Key": apiKeyValue };
|
|
4099
|
+
});
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
exports.Companies = Companies;
|