From 246a38d4a5657471372ac05ccbc6fe3bc221c508 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 23:51:16 +0000 Subject: [PATCH 1/2] SDK regeneration --- .fern/metadata.json | 6 +- reference.md | 458 +++++------- src/Client.ts | 128 ---- src/api/resources/accounts/client/Client.ts | 32 + .../requests/ListAccountMembersRequest.ts | 1 + .../requests/ListEnvironmentsRequest.ts | 1 + src/api/resources/billing/client/Client.ts | 58 ++ .../requests/CountBillingProductsRequest.ts | 1 + .../client/requests/CountCustomersRequest.ts | 1 + .../requests/CreateBillingPriceRequestBody.ts | 1 + .../requests/ListBillingPricesRequest.ts | 2 + .../ListBillingProductPricesRequest.ts | 2 + .../requests/ListBillingProductsRequest.ts | 1 + .../ListCustomersWithSubscriptionsRequest.ts | 1 + src/api/resources/companies/client/Client.ts | 515 +++---------- .../client/requests/CountCompaniesRequest.ts | 5 + .../CountEntityKeyDefinitionsRequest.ts | 1 + .../CountEntityTraitDefinitionsRequest.ts | 2 + .../client/requests/CountPlanTraitsRequest.ts | 2 + .../client/requests/CountUsersRequest.ts | 1 + .../requests/CreatePlanTraitRequestBody.ts | 15 - .../GetActiveCompanySubscriptionRequest.ts | 1 + .../client/requests/ListCompaniesRequest.ts | 5 + .../ListEntityKeyDefinitionsRequest.ts | 1 + .../ListEntityTraitDefinitionsRequest.ts | 2 + .../client/requests/ListPlanChangesRequest.ts | 2 + .../client/requests/ListPlanTraitsRequest.ts | 2 + .../client/requests/ListUsersRequest.ts | 1 + .../requests/UpdatePlanTraitRequestBody.ts | 13 - .../companies/client/requests/index.ts | 2 - .../types/CreatePlanTraitResponse.ts | 9 - .../types/DeletePlanTraitResponse.ts | 9 - src/api/resources/companies/types/index.ts | 3 - src/api/resources/components/client/Client.ts | 15 + src/api/resources/credits/client/Client.ts | 85 +++ .../CountBillingCreditsGrantsRequest.ts | 1 + .../requests/CountBillingCreditsRequest.ts | 1 + .../CountBillingPlanCreditGrantsRequest.ts | 2 + .../requests/CountCreditBundlesRequest.ts | 1 + .../requests/ListBillingCreditsRequest.ts | 1 + .../ListBillingPlanCreditGrantsRequest.ts | 2 + .../requests/ListCreditBundlesRequest.ts | 1 + .../requests/ListGrantsForCreditRequest.ts | 1 + .../resources/entitlements/client/Client.ts | 76 ++ .../requests/CountCompanyOverridesRequest.ts | 3 + .../requests/CountFeatureUsageRequest.ts | 1 + .../requests/CountPlanEntitlementsRequest.ts | 4 + ...BillingLinkedPlanEntitlementRequestBody.ts | 4 +- .../CreateCompanyOverrideRequestBody.ts | 4 +- .../CreatePlanEntitlementRequestBody.ts | 4 +- .../requests/ListCompanyOverridesRequest.ts | 3 + .../requests/ListFeatureUsageRequest.ts | 1 + .../requests/ListPlanEntitlementsRequest.ts | 4 + .../UpdateCompanyOverrideRequestBody.ts | 4 +- .../UpdatePlanEntitlementRequestBody.ts | 4 +- ...dPlanEntitlementRequestBodyMetricPeriod.ts | 10 - ...lementRequestBodyMetricPeriodMonthReset.ts | 8 - ...eCompanyOverrideRequestBodyMetricPeriod.ts | 10 - ...errideRequestBodyMetricPeriodMonthReset.ts | 8 - ...ePlanEntitlementRequestBodyMetricPeriod.ts | 10 - ...lementRequestBodyMetricPeriodMonthReset.ts | 8 - ...eCompanyOverrideRequestBodyMetricPeriod.ts | 10 - ...errideRequestBodyMetricPeriodMonthReset.ts | 8 - ...ePlanEntitlementRequestBodyMetricPeriod.ts | 10 - ...lementRequestBodyMetricPeriodMonthReset.ts | 8 - src/api/resources/entitlements/types/index.ts | 10 - src/api/resources/events/client/Client.ts | 12 + .../requests/GetEventSummariesRequest.ts | 1 + .../client/requests/ListEventsRequest.ts | 1 + src/api/resources/features/client/Client.ts | 30 +- .../client/requests/CountFeaturesRequest.ts | 2 + .../client/requests/CountFlagsRequest.ts | 1 + .../CreateBillingLinkedFeatureRequestBody.ts | 2 +- .../requests/CreateFeatureRequestBody.ts | 2 +- .../client/requests/ListFeaturesRequest.ts | 2 + .../client/requests/ListFlagsRequest.ts | 1 + .../requests/UpdateFeatureRequestBody.ts | 2 +- .../requests/UpdateFlagRulesRequestBody.ts | 4 +- src/api/resources/plangroups/client/Client.ts | 5 + .../resources/planmigrations/client/Client.ts | 20 + src/api/resources/plans/client/Client.ts | 350 +++++++++ .../client/requests/CountPlansRequest.ts | 4 + .../requests/ListCustomPlanBillingsRequest.ts | 29 + .../plans/client/requests/ListPlansRequest.ts | 4 + .../RetryCustomPlanBillingRequestBody.ts | 20 + .../resources/plans/client/requests/index.ts | 2 + .../resources/plans/types/CountPlansParams.ts | 2 + .../types/ListCustomPlanBillingsParams.ts | 21 + .../types/ListCustomPlanBillingsResponse.ts | 9 + .../resources/plans/types/ListPlansParams.ts | 2 + .../types/RetryCustomPlanBillingResponse.ts} | 4 +- src/api/resources/plans/types/index.ts | 3 + .../scheduledcheckout/client/Client.ts | 5 + src/api/resources/webhooks/client/Client.ts | 22 + .../requests/CountWebhookEventsRequest.ts | 1 + .../requests/ListWebhookEventsRequest.ts | 1 + src/api/types/ApiKeyCreateResponseData.ts | 1 + src/api/types/ApiKeyResponseData.ts | 1 + src/api/types/AuditLogListResponseData.ts | 1 + src/api/types/AuditLogResponseData.ts | 1 + src/api/types/BillingPriceResponseData.ts | 1 + src/api/types/BillingPriceView.ts | 1 + .../types/BillingProductPriceResponseData.ts | 1 + src/api/types/CheckFlagResponseData.ts | 4 +- .../CompanyEventPeriodMetricsResponseData.ts | 6 +- src/api/types/CompanyOverrideResponseData.ts | 4 +- .../types/CompanyPlanDetailResponseData.ts | 4 +- .../types/CompanySubscriptionResponseData.ts | 1 + ...itionOperator.ts => ComparableOperator.ts} | 10 +- src/api/types/Condition.ts | 8 +- .../types/ConditionMetricPeriodMonthReset.ts | 8 - src/api/types/ConditionResponseData.ts | 8 +- ...itionConditionType.ts => ConditionType.ts} | 4 +- src/api/types/ConditionView.ts | 8 +- .../CreateEntitlementInBundleRequestBody.ts | 4 +- ...itlementInBundleRequestBodyMetricPeriod.ts | 10 - ...BundleRequestBodyMetricPeriodMonthReset.ts | 8 - src/api/types/CreateEntitlementReqCommon.ts | 4 +- .../CreateEntitlementReqCommonMetricPeriod.ts | 10 - ...itlementReqCommonMetricPeriodMonthReset.ts | 8 - src/api/types/CreateFlagRequestBody.ts | 2 +- .../CreateOrUpdateConditionRequestBody.ts | 8 +- ...UpdateConditionRequestBodyConditionType.ts | 13 - ...rUpdateConditionRequestBodyMetricPeriod.ts | 11 - ...ditionRequestBodyMetricPeriodMonthReset.ts | 9 - ...ateOrUpdateConditionRequestBodyOperator.ts | 14 - .../types/CreateOrUpdateFlagRequestBody.ts | 2 +- .../types/CreateOrUpdateRuleRequestBody.ts | 2 +- .../CreateOrUpdateRuleRequestBodyRuleType.ts | 11 - src/api/types/CustomPlanBillingStatus.ts | 1 + src/api/types/FeatureCompanyResponseData.ts | 6 +- .../types/FeatureCompanyUserResponseData.ts | 4 +- src/api/types/FeatureDetailResponseData.ts | 3 +- src/api/types/FeatureEntitlement.ts | 4 +- .../types/FeatureEntitlementMetricPeriod.ts | 11 - src/api/types/FeatureEntitlementMonthReset.ts | 9 - src/api/types/FeatureInPlanResponseData.ts | 24 + src/api/types/FeatureResponseData.ts | 2 +- src/api/types/FeatureUsageResponseData.ts | 6 +- src/api/types/FeatureView.ts | 1 - src/api/types/FlagDetailResponseData.ts | 3 +- src/api/types/FlagInPlanResponseData.ts | 19 + src/api/types/FlagResponseData.ts | 2 +- src/api/types/FlagView.ts | 1 - ...nditionMetricPeriod.ts => MetricPeriod.ts} | 4 +- src/api/types/MetricPeriodMonthReset.ts | 7 + src/api/types/PlanDetailResponseData.ts | 4 +- src/api/types/PlanEntitlementResponseData.ts | 4 +- .../types/PlanGroupPlanDetailResponseData.ts | 4 +- src/api/types/PlanViewPublicResponseData.ts | 4 +- src/api/types/Rule.ts | 2 +- .../types/RuleConditionDetailResponseData.ts | 8 +- src/api/types/RuleConditionResponseData.ts | 8 +- src/api/types/RuleDetailResponseData.ts | 2 +- src/api/types/RuleResponseData.ts | 4 +- .../types/{RuleRuleType.ts => RuleType.ts} | 8 +- src/api/types/RuleView.ts | 2 +- src/api/types/RulesEngineSchemaVersion.ts | 2 +- src/api/types/RulesengineCheckFlagResult.ts | 4 +- ...engineCheckFlagResultFeatureUsagePeriod.ts | 10 - .../RulesengineCheckFlagResultRuleType.ts | 13 - src/api/types/RulesengineCompanyMetric.ts | 4 +- .../RulesengineCompanyMetricMonthReset.ts | 8 - src/api/types/RulesengineCondition.ts | 8 +- .../types/RulesengineConditionMetricPeriod.ts | 10 - ...esengineConditionMetricPeriodMonthReset.ts | 8 - src/api/types/RulesengineConditionOperator.ts | 14 - ...ionType.ts => RulesengineConditionType.ts} | 5 +- .../types/RulesengineFeatureEntitlement.ts | 4 +- ...lesengineFeatureEntitlementMetricPeriod.ts | 11 - ...RulesengineFeatureEntitlementMonthReset.ts | 9 - ...icPeriod.ts => RulesengineMetricPeriod.ts} | 5 +- .../RulesengineMetricPeriodMonthReset.ts | 8 + src/api/types/RulesengineRule.ts | 2 +- ...RuleRuleType.ts => RulesengineRuleType.ts} | 8 +- src/api/types/UpdateEntitlementReqCommon.ts | 4 +- .../UpdateEntitlementReqCommonMetricPeriod.ts | 10 - ...itlementReqCommonMetricPeriodMonthReset.ts | 8 - .../UsageBasedEntitlementResponseData.ts | 4 +- src/api/types/index.ts | 40 +- src/core/auth/BasicAuth.ts | 11 +- src/core/fetcher/Fetcher.ts | 14 +- src/core/url/QueryStringBuilder.ts | 87 +++ src/core/url/index.ts | 1 + src/core/url/qs.ts | 37 +- src/errors/SchematicError.ts | 6 + src/errors/SchematicTimeoutError.ts | 7 +- src/errors/handleNonStatusCodeError.ts | 5 +- .../requests/CreateBillingPriceRequestBody.ts | 2 + .../requests/CreatePlanTraitRequestBody.ts | 22 - .../requests/UpdatePlanTraitRequestBody.ts | 20 - .../companies/client/requests/index.ts | 2 - .../types/CreatePlanTraitResponse.ts | 21 - .../types/UpdatePlanTraitResponse.ts | 21 - .../resources/companies/types/index.ts | 3 - ...BillingLinkedPlanEntitlementRequestBody.ts | 18 +- .../CreateCompanyOverrideRequestBody.ts | 15 +- .../CreatePlanEntitlementRequestBody.ts | 15 +- .../UpdateCompanyOverrideRequestBody.ts | 15 +- .../UpdatePlanEntitlementRequestBody.ts | 15 +- ...dPlanEntitlementRequestBodyMetricPeriod.ts | 14 - ...lementRequestBodyMetricPeriodMonthReset.ts | 14 - ...eCompanyOverrideRequestBodyMetricPeriod.ts | 14 - ...errideRequestBodyMetricPeriodMonthReset.ts | 14 - ...ePlanEntitlementRequestBodyMetricPeriod.ts | 14 - ...lementRequestBodyMetricPeriodMonthReset.ts | 14 - ...eCompanyOverrideRequestBodyMetricPeriod.ts | 14 - ...errideRequestBodyMetricPeriodMonthReset.ts | 14 - ...ePlanEntitlementRequestBodyMetricPeriod.ts | 14 - ...lementRequestBodyMetricPeriodMonthReset.ts | 14 - .../resources/entitlements/types/index.ts | 10 - .../CreateBillingLinkedFeatureRequestBody.ts | 7 +- .../requests/CreateFeatureRequestBody.ts | 7 +- .../requests/UpdateFeatureRequestBody.ts | 7 +- .../RetryCustomPlanBillingRequestBody.ts | 26 + .../resources/plans/client/requests/index.ts | 1 + .../resources/plans/types/CountPlansParams.ts | 5 + .../types/ListCustomPlanBillingsParams.ts | 29 + .../types/ListCustomPlanBillingsResponse.ts | 22 + .../resources/plans/types/ListPlansParams.ts | 5 + .../types/RetryCustomPlanBillingResponse.ts} | 14 +- .../resources/plans/types/index.ts | 3 + .../types/ApiKeyCreateResponseData.ts | 3 + src/serialization/types/ApiKeyResponseData.ts | 3 + .../types/AuditLogListResponseData.ts | 3 + .../types/AuditLogResponseData.ts | 3 + .../types/BillingPriceResponseData.ts | 2 + src/serialization/types/BillingPriceView.ts | 2 + .../types/BillingProductPriceResponseData.ts | 2 + .../types/CheckFlagResponseData.ts | 10 +- .../CompanyEventPeriodMetricsResponseData.ts | 10 +- .../types/CompanyOverrideResponseData.ts | 13 +- .../types/CompanyPlanDetailResponseData.ts | 11 +- .../types/CompanySubscriptionResponseData.ts | 3 + src/serialization/types/ComparableOperator.ts | 14 + src/serialization/types/Condition.ts | 24 +- .../types/ConditionMetricPeriodMonthReset.ts | 14 - src/serialization/types/ConditionOperator.ts | 14 - .../types/ConditionResponseData.ts | 23 +- src/serialization/types/ConditionType.ts | 31 + src/serialization/types/ConditionView.ts | 20 +- .../CreateEntitlementInBundleRequestBody.ts | 18 +- ...itlementInBundleRequestBodyMetricPeriod.ts | 14 - ...BundleRequestBodyMetricPeriodMonthReset.ts | 14 - .../types/CreateEntitlementReqCommon.ts | 15 +- .../CreateEntitlementReqCommonMetricPeriod.ts | 14 - ...itlementReqCommonMetricPeriodMonthReset.ts | 14 - .../types/CreateFlagRequestBody.ts | 7 +- .../CreateOrUpdateConditionRequestBody.ts | 30 +- ...UpdateConditionRequestBodyConditionType.ts | 14 - ...rUpdateConditionRequestBodyMetricPeriod.ts | 14 - ...ditionRequestBodyMetricPeriodMonthReset.ts | 14 - ...ateOrUpdateConditionRequestBodyOperator.ts | 14 - .../types/CreateOrUpdateFlagRequestBody.ts | 7 +- .../types/CreateOrUpdateRuleRequestBody.ts | 6 +- .../CreateOrUpdateRuleRequestBodyRuleType.ts | 14 - .../types/CustomPlanBillingStatus.ts | 4 +- .../types/FeatureCompanyResponseData.ts | 16 +- .../types/FeatureCompanyUserResponseData.ts | 10 +- .../types/FeatureDetailResponseData.ts | 10 +- src/serialization/types/FeatureEntitlement.ts | 12 +- .../types/FeatureEntitlementMetricPeriod.ts | 14 - .../types/FeatureEntitlementMonthReset.ts | 14 - .../types/FeatureInPlanResponseData.ts | 65 ++ .../types/FeatureResponseData.ts | 7 +- .../types/FeatureUsageResponseData.ts | 16 +- src/serialization/types/FeatureView.ts | 2 - .../types/FlagDetailResponseData.ts | 10 +- .../types/FlagInPlanResponseData.ts | 48 ++ src/serialization/types/FlagResponseData.ts | 7 +- src/serialization/types/FlagView.ts | 2 - ...CompanyMetricPeriod.ts => MetricPeriod.ts} | 8 +- .../types/MetricPeriodMonthReset.ts | 14 + .../types/PlanDetailResponseData.ts | 11 +- .../types/PlanEntitlementResponseData.ts | 13 +- .../types/PlanGroupPlanDetailResponseData.ts | 11 +- .../types/PlanViewPublicResponseData.ts | 11 +- src/serialization/types/Rule.ts | 6 +- .../types/RuleConditionDetailResponseData.ts | 23 +- .../types/RuleConditionResponseData.ts | 23 +- .../types/RuleDetailResponseData.ts | 5 +- src/serialization/types/RuleResponseData.ts | 5 +- .../types/{RuleRuleType.ts => RuleType.ts} | 12 +- src/serialization/types/RuleView.ts | 5 +- .../types/RulesEngineSchemaVersion.ts | 4 +- .../types/RulesengineCheckFlagResult.ts | 15 +- ...engineCheckFlagResultFeatureUsagePeriod.ts | 14 - .../RulesengineCheckFlagResultRuleType.ts | 29 - .../types/RulesengineCompanyMetric.ts | 12 +- .../RulesengineCompanyMetricMonthReset.ts | 14 - .../types/RulesengineCondition.ts | 24 +- .../RulesengineConditionConditionType.ts | 33 - .../types/RulesengineConditionMetricPeriod.ts | 14 - ...esengineConditionMetricPeriodMonthReset.ts | 14 - .../types/RulesengineConditionOperator.ts | 14 - ...ionType.ts => RulesengineConditionType.ts} | 8 +- .../types/RulesengineFeatureEntitlement.ts | 12 +- ...lesengineFeatureEntitlementMetricPeriod.ts | 14 - ...RulesengineFeatureEntitlementMonthReset.ts | 14 - ...icPeriod.ts => RulesengineMetricPeriod.ts} | 8 +- .../RulesengineMetricPeriodMonthReset.ts | 14 + src/serialization/types/RulesengineRule.ts | 6 +- ...RuleRuleType.ts => RulesengineRuleType.ts} | 16 +- .../types/UpdateEntitlementReqCommon.ts | 15 +- .../UpdateEntitlementReqCommonMetricPeriod.ts | 14 - ...itlementReqCommonMetricPeriodMonthReset.ts | 14 - .../UsageBasedEntitlementResponseData.ts | 13 +- src/serialization/types/index.ts | 40 +- tests/unit/auth/BasicAuth.test.ts | 26 +- tests/unit/fetcher/createRequestUrl.test.ts | 4 + tests/unit/url/QueryStringBuilder.test.ts | 236 ++++++ tests/unit/url/qs.test.ts | 102 ++- tests/wire/accounts.test.ts | 86 +++ tests/wire/billing.test.ts | 14 + tests/wire/checkout.test.ts | 110 +-- tests/wire/companies.test.ts | 651 ++++------------ tests/wire/components.test.ts | 110 +-- tests/wire/componentspublic.test.ts | 48 +- tests/wire/credits.test.ts | 32 + tests/wire/entitlements.test.ts | 472 ++++++------ tests/wire/events.test.ts | 2 + tests/wire/features.test.ts | 702 +++++++++++------- tests/wire/main.test.ts | 26 - tests/wire/plangroups.test.ts | 148 ++-- tests/wire/plans.test.ts | 626 +++++++++++++--- tests/wire/webhooks.test.ts | 2 + yarn.lock | 172 ++--- 327 files changed, 4361 insertions(+), 3708 deletions(-) delete mode 100644 src/api/resources/companies/client/requests/CreatePlanTraitRequestBody.ts delete mode 100644 src/api/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts delete mode 100644 src/api/resources/companies/types/CreatePlanTraitResponse.ts delete mode 100644 src/api/resources/companies/types/DeletePlanTraitResponse.ts delete mode 100644 src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts delete mode 100644 src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts delete mode 100644 src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts create mode 100644 src/api/resources/plans/client/requests/ListCustomPlanBillingsRequest.ts create mode 100644 src/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts create mode 100644 src/api/resources/plans/types/ListCustomPlanBillingsParams.ts create mode 100644 src/api/resources/plans/types/ListCustomPlanBillingsResponse.ts rename src/api/resources/{companies/types/UpdatePlanTraitResponse.ts => plans/types/RetryCustomPlanBillingResponse.ts} (64%) rename src/api/types/{ConditionOperator.ts => ComparableOperator.ts} (62%) delete mode 100644 src/api/types/ConditionMetricPeriodMonthReset.ts rename src/api/types/{ConditionConditionType.ts => ConditionType.ts} (67%) delete mode 100644 src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriod.ts delete mode 100644 src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/types/CreateEntitlementReqCommonMetricPeriod.ts delete mode 100644 src/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts delete mode 100644 src/api/types/CreateOrUpdateConditionRequestBodyConditionType.ts delete mode 100644 src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts delete mode 100644 src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/api/types/CreateOrUpdateConditionRequestBodyOperator.ts delete mode 100644 src/api/types/CreateOrUpdateRuleRequestBodyRuleType.ts delete mode 100644 src/api/types/FeatureEntitlementMetricPeriod.ts delete mode 100644 src/api/types/FeatureEntitlementMonthReset.ts create mode 100644 src/api/types/FeatureInPlanResponseData.ts create mode 100644 src/api/types/FlagInPlanResponseData.ts rename src/api/types/{ConditionMetricPeriod.ts => MetricPeriod.ts} (58%) create mode 100644 src/api/types/MetricPeriodMonthReset.ts rename src/api/types/{RuleRuleType.ts => RuleType.ts} (78%) delete mode 100644 src/api/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts delete mode 100644 src/api/types/RulesengineCheckFlagResultRuleType.ts delete mode 100644 src/api/types/RulesengineCompanyMetricMonthReset.ts delete mode 100644 src/api/types/RulesengineConditionMetricPeriod.ts delete mode 100644 src/api/types/RulesengineConditionMetricPeriodMonthReset.ts delete mode 100644 src/api/types/RulesengineConditionOperator.ts rename src/api/types/{RulesengineConditionConditionType.ts => RulesengineConditionType.ts} (60%) delete mode 100644 src/api/types/RulesengineFeatureEntitlementMetricPeriod.ts delete mode 100644 src/api/types/RulesengineFeatureEntitlementMonthReset.ts rename src/api/types/{RulesengineCompanyMetricPeriod.ts => RulesengineMetricPeriod.ts} (52%) create mode 100644 src/api/types/RulesengineMetricPeriodMonthReset.ts rename src/api/types/{RulesengineRuleRuleType.ts => RulesengineRuleType.ts} (71%) delete mode 100644 src/api/types/UpdateEntitlementReqCommonMetricPeriod.ts delete mode 100644 src/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts create mode 100644 src/core/url/QueryStringBuilder.ts delete mode 100644 src/serialization/resources/companies/client/requests/CreatePlanTraitRequestBody.ts delete mode 100644 src/serialization/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts delete mode 100644 src/serialization/resources/companies/types/CreatePlanTraitResponse.ts delete mode 100644 src/serialization/resources/companies/types/UpdatePlanTraitResponse.ts delete mode 100644 src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts create mode 100644 src/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts create mode 100644 src/serialization/resources/plans/types/ListCustomPlanBillingsParams.ts create mode 100644 src/serialization/resources/plans/types/ListCustomPlanBillingsResponse.ts rename src/serialization/resources/{companies/types/DeletePlanTraitResponse.ts => plans/types/RetryCustomPlanBillingResponse.ts} (50%) create mode 100644 src/serialization/types/ComparableOperator.ts delete mode 100644 src/serialization/types/ConditionMetricPeriodMonthReset.ts delete mode 100644 src/serialization/types/ConditionOperator.ts create mode 100644 src/serialization/types/ConditionType.ts delete mode 100644 src/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/types/CreateEntitlementReqCommonMetricPeriod.ts delete mode 100644 src/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts delete mode 100644 src/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.ts delete mode 100644 src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts delete mode 100644 src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts delete mode 100644 src/serialization/types/CreateOrUpdateConditionRequestBodyOperator.ts delete mode 100644 src/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.ts delete mode 100644 src/serialization/types/FeatureEntitlementMetricPeriod.ts delete mode 100644 src/serialization/types/FeatureEntitlementMonthReset.ts create mode 100644 src/serialization/types/FeatureInPlanResponseData.ts create mode 100644 src/serialization/types/FlagInPlanResponseData.ts rename src/serialization/types/{RulesengineCompanyMetricPeriod.ts => MetricPeriod.ts} (52%) create mode 100644 src/serialization/types/MetricPeriodMonthReset.ts rename src/serialization/types/{RuleRuleType.ts => RuleType.ts} (82%) delete mode 100644 src/serialization/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts delete mode 100644 src/serialization/types/RulesengineCheckFlagResultRuleType.ts delete mode 100644 src/serialization/types/RulesengineCompanyMetricMonthReset.ts delete mode 100644 src/serialization/types/RulesengineConditionConditionType.ts delete mode 100644 src/serialization/types/RulesengineConditionMetricPeriod.ts delete mode 100644 src/serialization/types/RulesengineConditionMetricPeriodMonthReset.ts delete mode 100644 src/serialization/types/RulesengineConditionOperator.ts rename src/serialization/types/{ConditionConditionType.ts => RulesengineConditionType.ts} (74%) delete mode 100644 src/serialization/types/RulesengineFeatureEntitlementMetricPeriod.ts delete mode 100644 src/serialization/types/RulesengineFeatureEntitlementMonthReset.ts rename src/serialization/types/{ConditionMetricPeriod.ts => RulesengineMetricPeriod.ts} (65%) create mode 100644 src/serialization/types/RulesengineMetricPeriodMonthReset.ts rename src/serialization/types/{RulesengineRuleRuleType.ts => RulesengineRuleType.ts} (76%) delete mode 100644 src/serialization/types/UpdateEntitlementReqCommonMetricPeriod.ts delete mode 100644 src/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts create mode 100644 tests/unit/url/QueryStringBuilder.test.ts delete mode 100644 tests/wire/main.test.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index 6c20f4a6..3619be57 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "4.43.1", + "cliVersion": "4.76.1", "generatorName": "fernapi/fern-typescript-node-sdk", - "generatorVersion": "3.60.9", + "generatorVersion": "3.65.4", "generatorConfig": { "allowCustomFetcher": true, "includeApiReference": true, @@ -52,6 +52,6 @@ ] } }, - "originGitCommit": "3b0798fafff35a7e1b538c50c4a39870c9b32fdc", + "originGitCommit": "bc4c906cc55dca6e6d5e9213c5fb6a756783126b", "sdkVersion": "1.4.6" } diff --git a/reference.md b/reference.md index 77f96fe7..7f9183a1 100644 --- a/reference.md +++ b/reference.md @@ -1,102 +1,4 @@ # Reference -
client.putPlanAudiencesPlanAudienceId(plan_audience_id) -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.putPlanAudiencesPlanAudienceId("plan_audience_id"); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**plan_audience_id:** `string` - -
-
- -
-
- -**requestOptions:** `SchematicClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.deletePlanAudiencesPlanAudienceId(plan_audience_id) -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.deletePlanAudiencesPlanAudienceId("plan_audience_id"); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**plan_audience_id:** `string` - -
-
- -
-
- -**requestOptions:** `SchematicClient.RequestOptions` - -
-
-
-
- - -
-
-
- ## accounts
client.accounts.listAccountMembers({ ...params }) -> Schematic.ListAccountMembersResponse
@@ -112,6 +14,7 @@ await client.deletePlanAudiencesPlanAudienceId("plan_audience_id"); ```typescript await client.accounts.listAccountMembers({ + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000 @@ -691,6 +594,7 @@ await client.accounts.countAuditLogs({ ```typescript await client.accounts.listEnvironments({ + ids: ["ids"], limit: 1000000, offset: 1000000 }); @@ -1201,6 +1105,7 @@ await client.billing.upsertBillingCustomer({ ```typescript await client.billing.listCustomersWithSubscriptions({ + companyIds: ["company_ids"], name: "name", providerType: "orb", q: "q", @@ -1256,6 +1161,7 @@ await client.billing.listCustomersWithSubscriptions({ ```typescript await client.billing.countCustomers({ + companyIds: ["company_ids"], name: "name", providerType: "orb", q: "q", @@ -1640,10 +1546,12 @@ await client.billing.listBillingPrices({ currency: "currency", forInitialPlan: true, forTrialExpiryPlan: true, + ids: ["ids"], interval: "interval", isActive: true, price: 1000000, productId: "product_id", + productIds: ["product_ids"], providerType: "orb", q: "q", tiersMode: "graduated", @@ -1815,10 +1723,12 @@ await client.billing.listBillingProductPrices({ currency: "currency", forInitialPlan: true, forTrialExpiryPlan: true, + ids: ["ids"], interval: "interval", isActive: true, price: 1000000, productId: "product_id", + productIds: ["product_ids"], providerType: "orb", q: "q", tiersMode: "graduated", @@ -1977,6 +1887,7 @@ await client.billing.upsertBillingProduct({ ```typescript await client.billing.listBillingProducts({ + ids: ["ids"], isActive: true, name: "name", priceUsageType: "licensed", @@ -2038,6 +1949,7 @@ await client.billing.listBillingProducts({ ```typescript await client.billing.countBillingProducts({ + ids: ["ids"], isActive: true, name: "name", priceUsageType: "licensed", @@ -2171,6 +2083,7 @@ await client.billing.upsertBillingSubscription({ ```typescript await client.credits.listBillingCredits({ + ids: ["ids"], name: "name", limit: 1000000, offset: 1000000 @@ -2435,6 +2348,7 @@ await client.credits.softDeleteBillingCredit("credit_id"); ```typescript await client.credits.listCreditBundles({ + ids: ["ids"], creditId: "credit_id", status: "active", bundleType: "fixed", @@ -2702,6 +2616,7 @@ await client.credits.deleteCreditBundle("bundle_id"); ```typescript await client.credits.countCreditBundles({ + ids: ["ids"], creditId: "credit_id", status: "active", bundleType: "fixed", @@ -2757,6 +2672,7 @@ await client.credits.countCreditBundles({ ```typescript await client.credits.countBillingCredits({ + ids: ["ids"], name: "name", limit: 1000000, offset: 1000000 @@ -3032,6 +2948,7 @@ await client.credits.listCompanyGrants({ ```typescript await client.credits.countBillingCreditsGrants({ creditId: "credit_id", + ids: ["ids"], limit: 1000000, offset: 1000000 }); @@ -3085,6 +3002,7 @@ await client.credits.countBillingCreditsGrants({ ```typescript await client.credits.listGrantsForCredit({ creditId: "credit_id", + ids: ["ids"], limit: 1000000, offset: 1000000 }); @@ -3254,7 +3172,9 @@ await client.credits.countCreditLedger({ ```typescript await client.credits.listBillingPlanCreditGrants({ creditId: "credit_id", + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", limit: 1000000, offset: 1000000 @@ -3532,7 +3452,9 @@ await client.credits.deleteBillingPlanCreditGrant("plan_grant_id", { ```typescript await client.credits.countBillingPlanCreditGrants({ creditId: "credit_id", + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", limit: 1000000, offset: 1000000 @@ -4119,13 +4041,18 @@ await client.checkout.updateCustomerSubscriptionTrialEnd("subscription_id"); ```typescript await client.companies.listCompanies({ + creditTypeIds: ["credit_type_ids"], hasScheduledDowngrade: true, + ids: ["ids"], monetizedSubscriptions: true, planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", q: "q", sortOrderColumn: "sort_order_column", sortOrderDirection: "asc", + subscriptionStatuses: ["active"], + subscriptionTypes: ["free"], withEntitlementFor: "with_entitlement_for", withoutFeatureOverrideFor: "without_feature_override_for", withoutPlan: true, @@ -4345,13 +4272,18 @@ await client.companies.deleteCompany("company_id", { ```typescript await client.companies.countCompanies({ + creditTypeIds: ["credit_type_ids"], hasScheduledDowngrade: true, + ids: ["ids"], monetizedSubscriptions: true, planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", q: "q", sortOrderColumn: "sort_order_column", sortOrderDirection: "asc", + subscriptionStatuses: ["active"], + subscriptionTypes: ["free"], withEntitlementFor: "with_entitlement_for", withoutFeatureOverrideFor: "without_feature_override_for", withoutPlan: true, @@ -4742,6 +4674,7 @@ await client.companies.deleteCompanyMembership("company_membership_id"); ```typescript await client.companies.getActiveCompanySubscription({ companyId: "company_id", + companyIds: ["company_ids"], limit: 1000000, offset: 1000000 }); @@ -4849,6 +4782,7 @@ await client.companies.upsertCompanyTrait({ ```typescript await client.companies.listEntityKeyDefinitions({ entityType: "company", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000 @@ -4903,6 +4837,7 @@ await client.companies.listEntityKeyDefinitions({ ```typescript await client.companies.countEntityKeyDefinitions({ entityType: "company", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000 @@ -4957,8 +4892,10 @@ await client.companies.countEntityKeyDefinitions({ ```typescript await client.companies.listEntityTraitDefinitions({ entityType: "company", + ids: ["ids"], q: "q", traitType: "boolean", + traitTypes: ["boolean"], limit: 1000000, offset: 1000000 }); @@ -5173,8 +5110,10 @@ await client.companies.updateEntityTraitDefinition("entity_trait_definition_id", ```typescript await client.companies.countEntityTraitDefinitions({ entityType: "company", + ids: ["ids"], q: "q", traitType: "boolean", + traitTypes: ["boolean"], limit: 1000000, offset: 1000000 }); @@ -5284,6 +5223,8 @@ await client.companies.listPlanChanges({ action: "checkout", basePlanAction: "fallback", companyId: "company_id", + companyIds: ["company_ids"], + planIds: ["plan_ids"], limit: 1000000, offset: 1000000 }); @@ -5385,8 +5326,10 @@ await client.companies.getPlanChange("plan_change_id"); ```typescript await client.companies.listPlanTraits({ + ids: ["ids"], planId: "plan_id", traitId: "trait_id", + traitIds: ["trait_ids"], limit: 1000000, offset: 1000000 }); @@ -5421,59 +5364,6 @@ await client.companies.listPlanTraits({
- - -
- -
client.companies.createPlanTrait({ ...params }) -> Schematic.CreatePlanTraitResponse -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request:** `Schematic.CreatePlanTraitRequestBody` - -
-
- -
-
- -**requestOptions:** `CompaniesClient.RequestOptions` - -
-
-
-
- -
@@ -5523,115 +5413,6 @@ await client.companies.getPlanTrait("plan_trait_id"); - - - - -
client.companies.updatePlanTrait(plan_trait_id, { ...params }) -> Schematic.UpdatePlanTraitResponse -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value" -}); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**plan_trait_id:** `string` — plan_trait_id - -
-
- -
-
- -**request:** `Schematic.UpdatePlanTraitRequestBody` - -
-
- -
-
- -**requestOptions:** `CompaniesClient.RequestOptions` - -
-
-
-
- - -
-
-
- -
client.companies.deletePlanTrait(plan_trait_id) -> Schematic.DeletePlanTraitResponse -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.companies.deletePlanTrait("plan_trait_id"); - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**plan_trait_id:** `string` — plan_trait_id - -
-
- -
-
- -**requestOptions:** `CompaniesClient.RequestOptions` - -
-
-
-
- -
@@ -5706,8 +5487,10 @@ await client.companies.updatePlanTraitsBulk({ ```typescript await client.companies.countPlanTraits({ + ids: ["ids"], planId: "plan_id", traitId: "trait_id", + traitIds: ["trait_ids"], limit: 1000000, offset: 1000000 }); @@ -5815,6 +5598,7 @@ await client.companies.upsertUserTrait({ ```typescript await client.companies.listUsers({ companyId: "company_id", + ids: ["ids"], planId: "plan_id", q: "q", limit: 1000000, @@ -6021,6 +5805,7 @@ await client.companies.deleteUser("user_id"); ```typescript await client.companies.countUsers({ companyId: "company_id", + ids: ["ids"], planId: "plan_id", q: "q", limit: 1000000, @@ -6236,7 +6021,10 @@ await client.companies.lookupUser({ ```typescript await client.entitlements.listCompanyOverrides({ companyId: "company_id", + companyIds: ["company_ids"], featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], withoutExpired: true, q: "q", limit: 1000000, @@ -6502,7 +6290,10 @@ await client.entitlements.deleteCompanyOverride("company_override_id"); ```typescript await client.entitlements.countCompanyOverrides({ companyId: "company_id", + companyIds: ["company_ids"], featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], withoutExpired: true, q: "q", limit: 1000000, @@ -6666,6 +6457,7 @@ await client.entitlements.countFeatureCompanies({ ```typescript await client.entitlements.listFeatureUsage({ companyId: "company_id", + featureIds: ["feature_ids"], includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, @@ -6777,6 +6569,7 @@ await client.entitlements.getFeatureUsageTimeSeries({ ```typescript await client.entitlements.countFeatureUsage({ companyId: "company_id", + featureIds: ["feature_ids"], includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, @@ -6941,8 +6734,12 @@ await client.entitlements.countFeatureUsers({ ```typescript await client.entitlements.listPlanEntitlements({ featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", + planVersionIds: ["plan_version_ids"], q: "q", withMeteredProducts: true, limit: 1000000, @@ -7263,8 +7060,12 @@ await client.entitlements.upsertPlanEntitlementForBillingProduct({ ```typescript await client.entitlements.countPlanEntitlements({ featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", + planVersionIds: ["plan_version_ids"], q: "q", withMeteredProducts: true, limit: 1000000, @@ -7466,6 +7267,125 @@ await client.plans.updateCompanyPlans("company_plan_id", { + + + + +
client.plans.listCustomPlanBillings({ ...params }) -> Schematic.ListCustomPlanBillingsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.plans.listCustomPlanBillings({ + companyId: "company_id", + planId: "plan_id", + status: "active", + statuses: ["active"], + limit: 1000000, + offset: 1000000 +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Schematic.ListCustomPlanBillingsRequest` + +
+
+ +
+
+ +**requestOptions:** `PlansClient.RequestOptions` + +
+
+
+
+ + +
+
+
+ +
client.plans.retryCustomPlanBilling(custom_plan_billing_id, { ...params }) -> Schematic.RetryCustomPlanBillingResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [{ + priceId: "price_id", + quantity: 1000000 + }] +}); + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**custom_plan_billing_id:** `string` — custom_plan_billing_id + +
+
+ +
+
+ +**request:** `Schematic.RetryCustomPlanBillingRequestBody` + +
+
+ +
+
+ +**requestOptions:** `PlansClient.RequestOptions` + +
+
+
+
+ +
@@ -7538,10 +7458,12 @@ await client.plans.createCustomPlan({ ```typescript await client.plans.listPlans({ companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + ids: ["ids"], includeDraftVersions: true, planType: "plan", q: "q", @@ -8044,10 +7966,12 @@ await client.plans.countBillingProductMatchCompanies({ ```typescript await client.plans.countPlans({ companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + ids: ["ids"], includeDraftVersions: true, planType: "plan", q: "q", @@ -8803,6 +8727,7 @@ await client.events.createEventBatch({ ```typescript await client.events.getEventSummaries({ q: "q", + eventSubtypes: ["event_subtypes"], limit: 1000000, offset: 1000000 }); @@ -8857,6 +8782,7 @@ await client.events.getEventSummaries({ await client.events.listEvents({ companyId: "company_id", eventSubtype: "event_subtype", + eventTypes: ["flag_check"], flagId: "flag_id", userId: "user_id", limit: 1000000, @@ -9054,6 +8980,8 @@ await client.events.getSegmentIntegrationStatus(); ```typescript await client.features.listFeatures({ booleanRequireEvent: true, + featureType: ["boolean"], + ids: ["ids"], planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -9374,6 +9302,8 @@ await client.features.upsertFeatureForBillingProduct({ ```typescript await client.features.countFeatures({ booleanRequireEvent: true, + featureType: ["boolean"], + ids: ["ids"], planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -9431,6 +9361,7 @@ await client.features.countFeatures({ ```typescript await client.features.listFlags({ featureId: "feature_id", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000 @@ -9703,13 +9634,13 @@ await client.features.updateFlagRules("flag_id", { rules: [{ conditionGroups: [{ conditions: [{ - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids"] }] }], conditions: [{ - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids"] }], @@ -9933,6 +9864,7 @@ await client.features.checkFlagsBulk({ ```typescript await client.features.countFlags({ featureId: "feature_id", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000 @@ -10939,6 +10871,7 @@ await client.accesstokens.issueTemporaryAccessToken({ ```typescript await client.webhooks.listWebhookEvents({ + ids: ["ids"], q: "q", webhookId: "webhook_id", limit: 1000000, @@ -11042,6 +10975,7 @@ await client.webhooks.getWebhookEvent("webhook_event_id"); ```typescript await client.webhooks.countWebhookEvents({ + ids: ["ids"], q: "q", webhookId: "webhook_id", limit: 1000000, diff --git a/src/Client.ts b/src/Client.ts index bd659b70..b54594bb 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -22,10 +22,6 @@ import { WebhooksClient } from "./api/resources/webhooks/client/Client"; import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient"; import * as core from "./core"; -import { mergeHeaders } from "./core/headers"; -import * as environments from "./environments"; -import { handleNonStatusCodeError } from "./errors/handleNonStatusCodeError"; -import * as errors from "./errors/index"; export declare namespace SchematicClient { export type Options = BaseClientOptions; @@ -135,130 +131,6 @@ export class SchematicClient { return (this._webhooks ??= new WebhooksClient(this._options)); } - /** - * @param {string} plan_audience_id - * @param {SchematicClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.putPlanAudiencesPlanAudienceId("plan_audience_id") - */ - public putPlanAudiencesPlanAudienceId( - plan_audience_id: string, - requestOptions?: SchematicClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise( - this.__putPlanAudiencesPlanAudienceId(plan_audience_id, requestOptions), - ); - } - - private async __putPlanAudiencesPlanAudienceId( - plan_audience_id: string, - requestOptions?: SchematicClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SchematicEnvironment.Default, - `plan-audiences/${core.url.encodePathParam(plan_audience_id)}`, - ), - method: "PUT", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SchematicError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "PUT", - "/plan-audiences/{plan_audience_id}", - ); - } - - /** - * @param {string} plan_audience_id - * @param {SchematicClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @example - * await client.deletePlanAudiencesPlanAudienceId("plan_audience_id") - */ - public deletePlanAudiencesPlanAudienceId( - plan_audience_id: string, - requestOptions?: SchematicClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise( - this.__deletePlanAudiencesPlanAudienceId(plan_audience_id, requestOptions), - ); - } - - private async __deletePlanAudiencesPlanAudienceId( - plan_audience_id: string, - requestOptions?: SchematicClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SchematicEnvironment.Default, - `plan-audiences/${core.url.encodePathParam(plan_audience_id)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; - } - - if (_response.error.reason === "status-code") { - throw new errors.SchematicError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/plan-audiences/{plan_audience_id}", - ); - } - /** * Make a passthrough request using the SDK's configured auth, retry, logging, etc. * This is useful for making requests to endpoints not yet supported in the SDK. diff --git a/src/api/resources/accounts/client/Client.ts b/src/api/resources/accounts/client/Client.ts index 133d3329..80f20e84 100644 --- a/src/api/resources/accounts/client/Client.ts +++ b/src/api/resources/accounts/client/Client.ts @@ -35,6 +35,7 @@ export class AccountsClient { * * @example * await client.accounts.listAccountMembers({ + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 @@ -74,6 +75,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -335,6 +341,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -986,6 +997,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1135,6 +1151,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1400,6 +1421,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1500,6 +1526,7 @@ export class AccountsClient { * * @example * await client.accounts.listEnvironments({ + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * }) @@ -1537,6 +1564,11 @@ export class AccountsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/accounts/client/requests/ListAccountMembersRequest.ts b/src/api/resources/accounts/client/requests/ListAccountMembersRequest.ts index 4ef13d4d..038208dd 100644 --- a/src/api/resources/accounts/client/requests/ListAccountMembersRequest.ts +++ b/src/api/resources/accounts/client/requests/ListAccountMembersRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts b/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts index baffe355..e71f5a63 100644 --- a/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts +++ b/src/api/resources/accounts/client/requests/ListEnvironmentsRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/billing/client/Client.ts b/src/api/resources/billing/client/Client.ts index b98e399f..7a293cb1 100644 --- a/src/api/resources/billing/client/Client.ts +++ b/src/api/resources/billing/client/Client.ts @@ -75,6 +75,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -455,6 +460,7 @@ export class BillingClient { * * @example * await client.billing.listCustomersWithSubscriptions({ + * companyIds: ["company_ids"], * name: "name", * providerType: "orb", * q: "q", @@ -501,6 +507,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -601,6 +612,7 @@ export class BillingClient { * * @example * await client.billing.countCustomers({ + * companyIds: ["company_ids"], * name: "name", * providerType: "orb", * q: "q", @@ -647,6 +659,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -789,6 +806,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1066,6 +1088,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1342,6 +1369,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1580,10 +1612,12 @@ export class BillingClient { * currency: "currency", * forInitialPlan: true, * forTrialExpiryPlan: true, + * ids: ["ids"], * interval: "interval", * isActive: true, * price: 1000000, * productId: "product_id", + * productIds: ["product_ids"], * providerType: "orb", * q: "q", * tiersMode: "graduated", @@ -1665,6 +1699,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2045,10 +2084,12 @@ export class BillingClient { * currency: "currency", * forInitialPlan: true, * forTrialExpiryPlan: true, + * ids: ["ids"], * interval: "interval", * isActive: true, * price: 1000000, * productId: "product_id", + * productIds: ["product_ids"], * providerType: "orb", * q: "q", * tiersMode: "graduated", @@ -2130,6 +2171,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2497,6 +2543,7 @@ export class BillingClient { * * @example * await client.billing.listBillingProducts({ + * ids: ["ids"], * isActive: true, * name: "name", * priceUsageType: "licensed", @@ -2571,6 +2618,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2671,6 +2723,7 @@ export class BillingClient { * * @example * await client.billing.countBillingProducts({ + * ids: ["ids"], * isActive: true, * name: "name", * priceUsageType: "licensed", @@ -2745,6 +2798,11 @@ export class BillingClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts index e617b37c..b4537332 100644 --- a/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/CountBillingProductsRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * ids: ["ids"], * isActive: true, * name: "name", * priceUsageType: "licensed", diff --git a/src/api/resources/billing/client/requests/CountCustomersRequest.ts b/src/api/resources/billing/client/requests/CountCustomersRequest.ts index 03ba9db7..86b1fc6f 100644 --- a/src/api/resources/billing/client/requests/CountCustomersRequest.ts +++ b/src/api/resources/billing/client/requests/CountCustomersRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * companyIds: ["company_ids"], * name: "name", * providerType: "orb", * q: "q", diff --git a/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts b/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts index e8b11ba3..295ad64e 100644 --- a/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts +++ b/src/api/resources/billing/client/requests/CreateBillingPriceRequestBody.ts @@ -26,6 +26,7 @@ export interface CreateBillingPriceRequestBody { interval: string; isActive: boolean; meterId?: string; + nickname?: string; packageSize?: number; price: number; priceDecimal?: string; diff --git a/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts b/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts index 6225564f..c836702e 100644 --- a/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingPricesRequest.ts @@ -8,10 +8,12 @@ import type * as Schematic from "../../../../index"; * currency: "currency", * forInitialPlan: true, * forTrialExpiryPlan: true, + * ids: ["ids"], * interval: "interval", * isActive: true, * price: 1000000, * productId: "product_id", + * productIds: ["product_ids"], * providerType: "orb", * q: "q", * tiersMode: "graduated", diff --git a/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts b/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts index fc026bd8..0c0f5730 100644 --- a/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingProductPricesRequest.ts @@ -8,10 +8,12 @@ import type * as Schematic from "../../../../index"; * currency: "currency", * forInitialPlan: true, * forTrialExpiryPlan: true, + * ids: ["ids"], * interval: "interval", * isActive: true, * price: 1000000, * productId: "product_id", + * productIds: ["product_ids"], * providerType: "orb", * q: "q", * tiersMode: "graduated", diff --git a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts index da0840a1..2c55075c 100644 --- a/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts +++ b/src/api/resources/billing/client/requests/ListBillingProductsRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * ids: ["ids"], * isActive: true, * name: "name", * priceUsageType: "licensed", diff --git a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts index f843e72e..6ebf9dfb 100644 --- a/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts +++ b/src/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * companyIds: ["company_ids"], * name: "name", * providerType: "orb", * q: "q", diff --git a/src/api/resources/companies/client/Client.ts b/src/api/resources/companies/client/Client.ts index 4f10416e..6676fae8 100644 --- a/src/api/resources/companies/client/Client.ts +++ b/src/api/resources/companies/client/Client.ts @@ -36,13 +36,18 @@ export class CompaniesClient { * * @example * await client.companies.listCompanies({ + * creditTypeIds: ["credit_type_ids"], * hasScheduledDowngrade: true, + * ids: ["ids"], * monetizedSubscriptions: true, * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * q: "q", * sortOrderColumn: "sort_order_column", * sortOrderDirection: "asc", + * subscriptionStatuses: ["active"], + * subscriptionTypes: ["free"], * withEntitlementFor: "with_entitlement_for", * withoutFeatureOverrideFor: "without_feature_override_for", * withoutPlan: true, @@ -138,6 +143,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -528,6 +538,11 @@ export class CompaniesClient { method: "DELETE", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -628,13 +643,18 @@ export class CompaniesClient { * * @example * await client.companies.countCompanies({ + * creditTypeIds: ["credit_type_ids"], * hasScheduledDowngrade: true, + * ids: ["ids"], * monetizedSubscriptions: true, * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * q: "q", * sortOrderColumn: "sort_order_column", * sortOrderDirection: "asc", + * subscriptionStatuses: ["active"], + * subscriptionTypes: ["free"], * withEntitlementFor: "with_entitlement_for", * withoutFeatureOverrideFor: "without_feature_override_for", * withoutPlan: true, @@ -730,6 +750,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1141,6 +1166,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1270,6 +1300,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1642,6 +1677,7 @@ export class CompaniesClient { * @example * await client.companies.getActiveCompanySubscription({ * companyId: "company_id", + * companyIds: ["company_ids"], * limit: 1000000, * offset: 1000000 * }) @@ -1680,6 +1716,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1917,6 +1958,7 @@ export class CompaniesClient { * @example * await client.companies.listEntityKeyDefinitions({ * entityType: "company", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 @@ -1960,6 +2002,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2061,6 +2108,7 @@ export class CompaniesClient { * @example * await client.companies.countEntityKeyDefinitions({ * entityType: "company", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 @@ -2104,6 +2152,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2205,8 +2258,10 @@ export class CompaniesClient { * @example * await client.companies.listEntityTraitDefinitions({ * entityType: "company", + * ids: ["ids"], * q: "q", * traitType: "boolean", + * traitTypes: ["boolean"], * limit: 1000000, * offset: 1000000 * }) @@ -2258,6 +2313,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2764,8 +2824,10 @@ export class CompaniesClient { * @example * await client.companies.countEntityTraitDefinitions({ * entityType: "company", + * ids: ["ids"], * q: "q", * traitType: "boolean", + * traitTypes: ["boolean"], * limit: 1000000, * offset: 1000000 * }) @@ -2817,6 +2879,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2962,6 +3029,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3065,6 +3137,8 @@ export class CompaniesClient { * action: "checkout", * basePlanAction: "fallback", * companyId: "company_id", + * companyIds: ["company_ids"], + * planIds: ["plan_ids"], * limit: 1000000, * offset: 1000000 * }) @@ -3114,6 +3188,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3335,8 +3414,10 @@ export class CompaniesClient { * * @example * await client.companies.listPlanTraits({ + * ids: ["ids"], * planId: "plan_id", * traitId: "trait_id", + * traitIds: ["trait_ids"], * limit: 1000000, * offset: 1000000 * }) @@ -3377,6 +3458,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3465,141 +3551,6 @@ export class CompaniesClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/plan-traits"); } - /** - * @param {Schematic.CreatePlanTraitRequestBody} request - * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Schematic.BadRequestError} - * @throws {@link Schematic.UnauthorizedError} - * @throws {@link Schematic.ForbiddenError} - * @throws {@link Schematic.NotFoundError} - * @throws {@link Schematic.InternalServerError} - * - * @example - * await client.companies.createPlanTrait({ - * planId: "plan_id", - * traitId: "trait_id", - * traitValue: "trait_value" - * }) - */ - public createPlanTrait( - request: Schematic.CreatePlanTraitRequestBody, - requestOptions?: CompaniesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__createPlanTrait(request, requestOptions)); - } - - private async __createPlanTrait( - request: Schematic.CreatePlanTraitRequestBody, - requestOptions?: CompaniesClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SchematicEnvironment.Default, - "plan-traits", - ), - method: "POST", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.CreatePlanTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.CreatePlanTraitResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Schematic.BadRequestError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 401: - throw new Schematic.UnauthorizedError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 403: - throw new Schematic.ForbiddenError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 404: - throw new Schematic.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Schematic.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.SchematicError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/plan-traits"); - } - /** * @param {string} plan_trait_id - plan_trait_id * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. @@ -3716,276 +3667,6 @@ export class CompaniesClient { return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/plan-traits/{plan_trait_id}"); } - /** - * @param {string} plan_trait_id - plan_trait_id - * @param {Schematic.UpdatePlanTraitRequestBody} request - * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Schematic.BadRequestError} - * @throws {@link Schematic.UnauthorizedError} - * @throws {@link Schematic.ForbiddenError} - * @throws {@link Schematic.NotFoundError} - * @throws {@link Schematic.InternalServerError} - * - * @example - * await client.companies.updatePlanTrait("plan_trait_id", { - * planId: "plan_id", - * traitValue: "trait_value" - * }) - */ - public updatePlanTrait( - plan_trait_id: string, - request: Schematic.UpdatePlanTraitRequestBody, - requestOptions?: CompaniesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__updatePlanTrait(plan_trait_id, request, requestOptions)); - } - - private async __updatePlanTrait( - plan_trait_id: string, - request: Schematic.UpdatePlanTraitRequestBody, - requestOptions?: CompaniesClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SchematicEnvironment.Default, - `plan-traits/${core.url.encodePathParam(plan_trait_id)}`, - ), - method: "PUT", - headers: _headers, - contentType: "application/json", - queryParameters: requestOptions?.queryParams, - requestType: "json", - body: serializers.UpdatePlanTraitRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.UpdatePlanTraitResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Schematic.BadRequestError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 401: - throw new Schematic.UnauthorizedError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 403: - throw new Schematic.ForbiddenError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 404: - throw new Schematic.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Schematic.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.SchematicError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/plan-traits/{plan_trait_id}"); - } - - /** - * @param {string} plan_trait_id - plan_trait_id - * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. - * - * @throws {@link Schematic.BadRequestError} - * @throws {@link Schematic.UnauthorizedError} - * @throws {@link Schematic.ForbiddenError} - * @throws {@link Schematic.NotFoundError} - * @throws {@link Schematic.InternalServerError} - * - * @example - * await client.companies.deletePlanTrait("plan_trait_id") - */ - public deletePlanTrait( - plan_trait_id: string, - requestOptions?: CompaniesClient.RequestOptions, - ): core.HttpResponsePromise { - return core.HttpResponsePromise.fromPromise(this.__deletePlanTrait(plan_trait_id, requestOptions)); - } - - private async __deletePlanTrait( - plan_trait_id: string, - requestOptions?: CompaniesClient.RequestOptions, - ): Promise> { - const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - _authRequest.headers, - this._options?.headers, - requestOptions?.headers, - ); - const _response = await (this._options.fetcher ?? core.fetcher)({ - url: core.url.join( - (await core.Supplier.get(this._options.baseUrl)) ?? - (await core.Supplier.get(this._options.environment)) ?? - environments.SchematicEnvironment.Default, - `plan-traits/${core.url.encodePathParam(plan_trait_id)}`, - ), - method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, - abortSignal: requestOptions?.abortSignal, - fetchFn: this._options?.fetch, - logging: this._options.logging, - }); - if (_response.ok) { - return { - data: serializers.DeletePlanTraitResponse.parseOrThrow(_response.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - rawResponse: _response.rawResponse, - }; - } - - if (_response.error.reason === "status-code") { - switch (_response.error.statusCode) { - case 400: - throw new Schematic.BadRequestError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 401: - throw new Schematic.UnauthorizedError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 403: - throw new Schematic.ForbiddenError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 404: - throw new Schematic.NotFoundError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - case 500: - throw new Schematic.InternalServerError( - serializers.ApiError.parseOrThrow(_response.error.body, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - skipValidation: true, - breadcrumbsPrefix: ["response"], - }), - _response.rawResponse, - ); - default: - throw new errors.SchematicError({ - statusCode: _response.error.statusCode, - body: _response.error.body, - rawResponse: _response.rawResponse, - }); - } - } - - return handleNonStatusCodeError( - _response.error, - _response.rawResponse, - "DELETE", - "/plan-traits/{plan_trait_id}", - ); - } - /** * @param {Schematic.UpdatePlanTraitBulkRequestBody} request * @param {CompaniesClient.RequestOptions} requestOptions - Request-specific configuration. @@ -4136,8 +3817,10 @@ export class CompaniesClient { * * @example * await client.companies.countPlanTraits({ + * ids: ["ids"], * planId: "plan_id", * traitId: "trait_id", + * traitIds: ["trait_ids"], * limit: 1000000, * offset: 1000000 * }) @@ -4178,6 +3861,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -4415,6 +4103,7 @@ export class CompaniesClient { * @example * await client.companies.listUsers({ * companyId: "company_id", + * ids: ["ids"], * planId: "plan_id", * q: "q", * limit: 1000000, @@ -4457,6 +4146,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -4937,6 +4631,7 @@ export class CompaniesClient { * @example * await client.companies.countUsers({ * companyId: "company_id", + * ids: ["ids"], * planId: "plan_id", * q: "q", * limit: 1000000, @@ -4979,6 +4674,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -5384,6 +5084,11 @@ export class CompaniesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/companies/client/requests/CountCompaniesRequest.ts b/src/api/resources/companies/client/requests/CountCompaniesRequest.ts index d25eb651..332f740d 100644 --- a/src/api/resources/companies/client/requests/CountCompaniesRequest.ts +++ b/src/api/resources/companies/client/requests/CountCompaniesRequest.ts @@ -5,13 +5,18 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * creditTypeIds: ["credit_type_ids"], * hasScheduledDowngrade: true, + * ids: ["ids"], * monetizedSubscriptions: true, * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * q: "q", * sortOrderColumn: "sort_order_column", * sortOrderDirection: "asc", + * subscriptionStatuses: ["active"], + * subscriptionTypes: ["free"], * withEntitlementFor: "with_entitlement_for", * withoutFeatureOverrideFor: "without_feature_override_for", * withoutPlan: true, diff --git a/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts b/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts index 1e798207..eacf524e 100644 --- a/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/CountEntityKeyDefinitionsRequest.ts @@ -6,6 +6,7 @@ import type * as Schematic from "../../../../index"; * @example * { * entityType: "company", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts b/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts index 8da73346..8f4c1768 100644 --- a/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/CountEntityTraitDefinitionsRequest.ts @@ -6,8 +6,10 @@ import type * as Schematic from "../../../../index"; * @example * { * entityType: "company", + * ids: ["ids"], * q: "q", * traitType: "boolean", + * traitTypes: ["boolean"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts b/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts index 53e6ebc3..4e518459 100644 --- a/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts +++ b/src/api/resources/companies/client/requests/CountPlanTraitsRequest.ts @@ -3,8 +3,10 @@ /** * @example * { + * ids: ["ids"], * planId: "plan_id", * traitId: "trait_id", + * traitIds: ["trait_ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/CountUsersRequest.ts b/src/api/resources/companies/client/requests/CountUsersRequest.ts index fc4fab7c..f2c6467a 100644 --- a/src/api/resources/companies/client/requests/CountUsersRequest.ts +++ b/src/api/resources/companies/client/requests/CountUsersRequest.ts @@ -4,6 +4,7 @@ * @example * { * companyId: "company_id", + * ids: ["ids"], * planId: "plan_id", * q: "q", * limit: 1000000, diff --git a/src/api/resources/companies/client/requests/CreatePlanTraitRequestBody.ts b/src/api/resources/companies/client/requests/CreatePlanTraitRequestBody.ts deleted file mode 100644 index 3e003651..00000000 --- a/src/api/resources/companies/client/requests/CreatePlanTraitRequestBody.ts +++ /dev/null @@ -1,15 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * planId: "plan_id", - * traitId: "trait_id", - * traitValue: "trait_value" - * } - */ -export interface CreatePlanTraitRequestBody { - planId: string; - traitId: string; - traitValue: string; -} diff --git a/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts b/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts index 868e7ccc..265a9ff7 100644 --- a/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts +++ b/src/api/resources/companies/client/requests/GetActiveCompanySubscriptionRequest.ts @@ -4,6 +4,7 @@ * @example * { * companyId: "company_id", + * companyIds: ["company_ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/ListCompaniesRequest.ts b/src/api/resources/companies/client/requests/ListCompaniesRequest.ts index a50eb885..e007569e 100644 --- a/src/api/resources/companies/client/requests/ListCompaniesRequest.ts +++ b/src/api/resources/companies/client/requests/ListCompaniesRequest.ts @@ -5,13 +5,18 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * creditTypeIds: ["credit_type_ids"], * hasScheduledDowngrade: true, + * ids: ["ids"], * monetizedSubscriptions: true, * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * q: "q", * sortOrderColumn: "sort_order_column", * sortOrderDirection: "asc", + * subscriptionStatuses: ["active"], + * subscriptionTypes: ["free"], * withEntitlementFor: "with_entitlement_for", * withoutFeatureOverrideFor: "without_feature_override_for", * withoutPlan: true, diff --git a/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts b/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts index c978f5c8..eb51d3c7 100644 --- a/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/ListEntityKeyDefinitionsRequest.ts @@ -6,6 +6,7 @@ import type * as Schematic from "../../../../index"; * @example * { * entityType: "company", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts b/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts index 87b1734a..dbab8c9e 100644 --- a/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts +++ b/src/api/resources/companies/client/requests/ListEntityTraitDefinitionsRequest.ts @@ -6,8 +6,10 @@ import type * as Schematic from "../../../../index"; * @example * { * entityType: "company", + * ids: ["ids"], * q: "q", * traitType: "boolean", + * traitTypes: ["boolean"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts b/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts index a8873809..183e068b 100644 --- a/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts +++ b/src/api/resources/companies/client/requests/ListPlanChangesRequest.ts @@ -8,6 +8,8 @@ import type * as Schematic from "../../../../index"; * action: "checkout", * basePlanAction: "fallback", * companyId: "company_id", + * companyIds: ["company_ids"], + * planIds: ["plan_ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts b/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts index cc824c94..c04a21eb 100644 --- a/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts +++ b/src/api/resources/companies/client/requests/ListPlanTraitsRequest.ts @@ -3,8 +3,10 @@ /** * @example * { + * ids: ["ids"], * planId: "plan_id", * traitId: "trait_id", + * traitIds: ["trait_ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/companies/client/requests/ListUsersRequest.ts b/src/api/resources/companies/client/requests/ListUsersRequest.ts index 8b778d36..f6fdc7a8 100644 --- a/src/api/resources/companies/client/requests/ListUsersRequest.ts +++ b/src/api/resources/companies/client/requests/ListUsersRequest.ts @@ -4,6 +4,7 @@ * @example * { * companyId: "company_id", + * ids: ["ids"], * planId: "plan_id", * q: "q", * limit: 1000000, diff --git a/src/api/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts b/src/api/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts deleted file mode 100644 index b720dbc7..00000000 --- a/src/api/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** - * @example - * { - * planId: "plan_id", - * traitValue: "trait_value" - * } - */ -export interface UpdatePlanTraitRequestBody { - planId: string; - traitValue: string; -} diff --git a/src/api/resources/companies/client/requests/index.ts b/src/api/resources/companies/client/requests/index.ts index 70bb450f..f989fd3d 100644 --- a/src/api/resources/companies/client/requests/index.ts +++ b/src/api/resources/companies/client/requests/index.ts @@ -4,7 +4,6 @@ export type { CountEntityTraitDefinitionsRequest } from "./CountEntityTraitDefin export type { CountPlanTraitsRequest } from "./CountPlanTraitsRequest"; export type { CountUsersRequest } from "./CountUsersRequest"; export type { CreateEntityTraitDefinitionRequestBody } from "./CreateEntityTraitDefinitionRequestBody"; -export type { CreatePlanTraitRequestBody } from "./CreatePlanTraitRequestBody"; export type { DeleteCompanyRequest } from "./DeleteCompanyRequest"; export type { GetActiveCompanySubscriptionRequest } from "./GetActiveCompanySubscriptionRequest"; export type { GetEntityTraitValuesRequest } from "./GetEntityTraitValuesRequest"; @@ -20,4 +19,3 @@ export type { LookupCompanyRequest } from "./LookupCompanyRequest"; export type { LookupUserRequest } from "./LookupUserRequest"; export type { UpdateEntityTraitDefinitionRequestBody } from "./UpdateEntityTraitDefinitionRequestBody"; export type { UpdatePlanTraitBulkRequestBody } from "./UpdatePlanTraitBulkRequestBody"; -export type { UpdatePlanTraitRequestBody } from "./UpdatePlanTraitRequestBody"; diff --git a/src/api/resources/companies/types/CreatePlanTraitResponse.ts b/src/api/resources/companies/types/CreatePlanTraitResponse.ts deleted file mode 100644 index 7275ad2e..00000000 --- a/src/api/resources/companies/types/CreatePlanTraitResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../index"; - -export interface CreatePlanTraitResponse { - data: Schematic.PlanTraitResponseData; - /** Input parameters */ - params: Record; -} diff --git a/src/api/resources/companies/types/DeletePlanTraitResponse.ts b/src/api/resources/companies/types/DeletePlanTraitResponse.ts deleted file mode 100644 index 8fc16ed5..00000000 --- a/src/api/resources/companies/types/DeletePlanTraitResponse.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../index"; - -export interface DeletePlanTraitResponse { - data: Schematic.DeleteResponse; - /** Input parameters */ - params: Record; -} diff --git a/src/api/resources/companies/types/index.ts b/src/api/resources/companies/types/index.ts index a69478e3..57269ee9 100644 --- a/src/api/resources/companies/types/index.ts +++ b/src/api/resources/companies/types/index.ts @@ -9,13 +9,11 @@ export * from "./CountPlanTraitsResponse"; export * from "./CountUsersParams"; export * from "./CountUsersResponse"; export * from "./CreateCompanyResponse"; -export * from "./CreatePlanTraitResponse"; export * from "./CreateUserResponse"; export * from "./DeleteCompanyByKeysResponse"; export * from "./DeleteCompanyMembershipResponse"; export * from "./DeleteCompanyParams"; export * from "./DeleteCompanyResponse"; -export * from "./DeletePlanTraitResponse"; export * from "./DeleteUserByKeysResponse"; export * from "./DeleteUserResponse"; export * from "./GetActiveCompanySubscriptionParams"; @@ -48,7 +46,6 @@ export * from "./LookupCompanyResponse"; export * from "./LookupUserParams"; export * from "./LookupUserResponse"; export * from "./UpdateEntityTraitDefinitionResponse"; -export * from "./UpdatePlanTraitResponse"; export * from "./UpdatePlanTraitsBulkResponse"; export * from "./UpsertCompanyResponse"; export * from "./UpsertCompanyTraitResponse"; diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index b07288db..18bcb9aa 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -73,6 +73,11 @@ export class ComponentsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -723,6 +728,11 @@ export class ComponentsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -858,6 +868,11 @@ export class ComponentsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/credits/client/Client.ts b/src/api/resources/credits/client/Client.ts index 8fc38775..bee1ad0e 100644 --- a/src/api/resources/credits/client/Client.ts +++ b/src/api/resources/credits/client/Client.ts @@ -35,6 +35,7 @@ export class CreditsClient { * * @example * await client.credits.listBillingCredits({ + * ids: ["ids"], * name: "name", * limit: 1000000, * offset: 1000000 @@ -74,6 +75,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -695,6 +701,7 @@ export class CreditsClient { * * @example * await client.credits.listCreditBundles({ + * ids: ["ids"], * creditId: "credit_id", * status: "active", * bundleType: "fixed", @@ -744,6 +751,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1380,6 +1392,7 @@ export class CreditsClient { * * @example * await client.credits.countCreditBundles({ + * ids: ["ids"], * creditId: "credit_id", * status: "active", * bundleType: "fixed", @@ -1429,6 +1442,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1534,6 +1552,7 @@ export class CreditsClient { * * @example * await client.credits.countBillingCredits({ + * ids: ["ids"], * name: "name", * limit: 1000000, * offset: 1000000 @@ -1573,6 +1592,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2001,6 +2025,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2154,6 +2183,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2260,6 +2294,7 @@ export class CreditsClient { * @example * await client.credits.countBillingCreditsGrants({ * creditId: "credit_id", + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * }) @@ -2298,6 +2333,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2399,6 +2439,7 @@ export class CreditsClient { * @example * await client.credits.listGrantsForCredit({ * creditId: "credit_id", + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * }) @@ -2437,6 +2478,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2585,6 +2631,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2733,6 +2784,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2834,7 +2890,9 @@ export class CreditsClient { * @example * await client.credits.listBillingPlanCreditGrants({ * creditId: "credit_id", + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * limit: 1000000, * offset: 1000000 @@ -2877,6 +2935,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3424,6 +3487,11 @@ export class CreditsClient { method: "DELETE", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3530,7 +3598,9 @@ export class CreditsClient { * @example * await client.credits.countBillingPlanCreditGrants({ * creditId: "credit_id", + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * limit: 1000000, * offset: 1000000 @@ -3573,6 +3643,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3729,6 +3804,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3880,6 +3960,11 @@ export class CreditsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts b/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts index 7c9a9f9d..7b80b162 100644 --- a/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingCreditsGrantsRequest.ts @@ -4,6 +4,7 @@ * @example * { * creditId: "credit_id", + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts b/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts index d6582fd1..e056ef9a 100644 --- a/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingCreditsRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * name: "name", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts b/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts index bde0d9cf..872821aa 100644 --- a/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.ts @@ -4,7 +4,9 @@ * @example * { * creditId: "credit_id", + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts b/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts index 895363d8..8c7b1741 100644 --- a/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts +++ b/src/api/resources/credits/client/requests/CountCreditBundlesRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * ids: ["ids"], * creditId: "credit_id", * status: "active", * bundleType: "fixed", diff --git a/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts b/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts index 1e7eb865..76c7217e 100644 --- a/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts +++ b/src/api/resources/credits/client/requests/ListBillingCreditsRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * name: "name", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts b/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts index 1d3b0982..0ce867eb 100644 --- a/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts +++ b/src/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.ts @@ -4,7 +4,9 @@ * @example * { * creditId: "credit_id", + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts b/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts index 7261f0c6..2bc63894 100644 --- a/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts +++ b/src/api/resources/credits/client/requests/ListCreditBundlesRequest.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index"; /** * @example * { + * ids: ["ids"], * creditId: "credit_id", * status: "active", * bundleType: "fixed", diff --git a/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts b/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts index c1139d58..87db0bbb 100644 --- a/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts +++ b/src/api/resources/credits/client/requests/ListGrantsForCreditRequest.ts @@ -4,6 +4,7 @@ * @example * { * creditId: "credit_id", + * ids: ["ids"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/entitlements/client/Client.ts b/src/api/resources/entitlements/client/Client.ts index 7c7fe566..4c470f52 100644 --- a/src/api/resources/entitlements/client/Client.ts +++ b/src/api/resources/entitlements/client/Client.ts @@ -37,7 +37,10 @@ export class EntitlementsClient { * @example * await client.entitlements.listCompanyOverrides({ * companyId: "company_id", + * companyIds: ["company_ids"], * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * withoutExpired: true, * q: "q", * limit: 1000000, @@ -83,6 +86,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -720,7 +728,10 @@ export class EntitlementsClient { * @example * await client.entitlements.countCompanyOverrides({ * companyId: "company_id", + * companyIds: ["company_ids"], * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * withoutExpired: true, * q: "q", * limit: 1000000, @@ -766,6 +777,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -906,6 +922,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1046,6 +1067,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1147,6 +1173,7 @@ export class EntitlementsClient { * @example * await client.entitlements.listFeatureUsage({ * companyId: "company_id", + * featureIds: ["feature_ids"], * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, @@ -1201,6 +1228,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1345,6 +1377,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1435,6 +1472,7 @@ export class EntitlementsClient { * @example * await client.entitlements.countFeatureUsage({ * companyId: "company_id", + * featureIds: ["feature_ids"], * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, @@ -1489,6 +1527,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1629,6 +1672,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1769,6 +1817,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1870,8 +1923,12 @@ export class EntitlementsClient { * @example * await client.entitlements.listPlanEntitlements({ * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", + * planVersionIds: ["plan_version_ids"], * q: "q", * withMeteredProducts: true, * limit: 1000000, @@ -1931,6 +1988,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -2714,8 +2776,12 @@ export class EntitlementsClient { * @example * await client.entitlements.countPlanEntitlements({ * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", + * planVersionIds: ["plan_version_ids"], * q: "q", * withMeteredProducts: true, * limit: 1000000, @@ -2775,6 +2841,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -3046,6 +3117,11 @@ export class EntitlementsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts b/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts index f13f47ea..5052039d 100644 --- a/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountCompanyOverridesRequest.ts @@ -4,7 +4,10 @@ * @example * { * companyId: "company_id", + * companyIds: ["company_ids"], * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * withoutExpired: true, * q: "q", * limit: 1000000, diff --git a/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts b/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts index f59ef172..e16a3637 100644 --- a/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountFeatureUsageRequest.ts @@ -4,6 +4,7 @@ * @example * { * companyId: "company_id", + * featureIds: ["feature_ids"], * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, diff --git a/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts b/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts index 9e82d641..1997a6b8 100644 --- a/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts +++ b/src/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.ts @@ -4,8 +4,12 @@ * @example * { * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", + * planVersionIds: ["plan_version_ids"], * q: "q", * withMeteredProducts: true, * limit: 1000000, diff --git a/src/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts b/src/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts index 26ca85ed..9714d16c 100644 --- a/src/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts +++ b/src/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts @@ -21,8 +21,8 @@ export interface CreateBillingLinkedPlanEntitlementRequestBody { currencyPrices?: Schematic.CurrencyPriceRequestBody[]; externalResourceId: string; featureId: string; - metricPeriod?: Schematic.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; monthlyMeteredPriceId?: string; monthlyPriceTiers?: Schematic.CreatePriceTierRequestBody[]; monthlyUnitPrice?: number; diff --git a/src/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts b/src/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts index 274c5a4a..5d6aa4e3 100644 --- a/src/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts +++ b/src/api/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts @@ -15,8 +15,8 @@ export interface CreateCompanyOverrideRequestBody { creditConsumptionRate?: number; expirationDate?: Date; featureId: string; - metricPeriod?: Schematic.CreateCompanyOverrideRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.CreateCompanyOverrideRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; note?: string; valueBool?: boolean; valueCreditId?: string; diff --git a/src/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts b/src/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts index ffe00d72..fa5650dd 100644 --- a/src/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts +++ b/src/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts @@ -17,8 +17,8 @@ export interface CreatePlanEntitlementRequestBody { currency?: string; currencyPrices?: Schematic.CurrencyPriceRequestBody[]; featureId: string; - metricPeriod?: Schematic.CreatePlanEntitlementRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.CreatePlanEntitlementRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; monthlyMeteredPriceId?: string; monthlyPriceTiers?: Schematic.CreatePriceTierRequestBody[]; monthlyUnitPrice?: number; diff --git a/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts b/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts index c8a9e0cf..31de5d60 100644 --- a/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListCompanyOverridesRequest.ts @@ -4,7 +4,10 @@ * @example * { * companyId: "company_id", + * companyIds: ["company_ids"], * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * withoutExpired: true, * q: "q", * limit: 1000000, diff --git a/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts b/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts index f331f8d7..39a6f6f6 100644 --- a/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListFeatureUsageRequest.ts @@ -4,6 +4,7 @@ * @example * { * companyId: "company_id", + * featureIds: ["feature_ids"], * includeUsageAggregation: true, * q: "q", * withoutNegativeEntitlements: true, diff --git a/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts b/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts index cf0ba70b..54db7e97 100644 --- a/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts +++ b/src/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.ts @@ -4,8 +4,12 @@ * @example * { * featureId: "feature_id", + * featureIds: ["feature_ids"], + * ids: ["ids"], * planId: "plan_id", + * planIds: ["plan_ids"], * planVersionId: "plan_version_id", + * planVersionIds: ["plan_version_ids"], * q: "q", * withMeteredProducts: true, * limit: 1000000, diff --git a/src/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts b/src/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts index 17132eed..8e645537 100644 --- a/src/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts +++ b/src/api/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts @@ -11,8 +11,8 @@ import type * as Schematic from "../../../../index"; export interface UpdateCompanyOverrideRequestBody { creditConsumptionRate?: number; expirationDate?: Date; - metricPeriod?: Schematic.UpdateCompanyOverrideRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; note?: string; valueBool?: boolean; valueCreditId?: string; diff --git a/src/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts b/src/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts index 5dc3730a..399844d3 100644 --- a/src/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts +++ b/src/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts @@ -14,8 +14,8 @@ export interface UpdatePlanEntitlementRequestBody { creditConsumptionRate?: number; currency?: string; currencyPrices?: Schematic.CurrencyPriceRequestBody[]; - metricPeriod?: Schematic.UpdatePlanEntitlementRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; monthlyMeteredPriceId?: string; monthlyPriceTiers?: Schematic.CreatePriceTierRequestBody[]; monthlyUnitPrice?: number; diff --git a/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts b/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index ffca319e..00000000 --- a/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod = - (typeof CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod)[keyof typeof CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod]; diff --git a/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index d6a52144..00000000 --- a/src/api/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset = - (typeof CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset)[keyof typeof CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts b/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts deleted file mode 100644 index 5129abff..00000000 --- a/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateCompanyOverrideRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreateCompanyOverrideRequestBodyMetricPeriod = - (typeof CreateCompanyOverrideRequestBodyMetricPeriod)[keyof typeof CreateCompanyOverrideRequestBodyMetricPeriod]; diff --git a/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts b/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index efd3ec83..00000000 --- a/src/api/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateCompanyOverrideRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreateCompanyOverrideRequestBodyMetricPeriodMonthReset = - (typeof CreateCompanyOverrideRequestBodyMetricPeriodMonthReset)[keyof typeof CreateCompanyOverrideRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts b/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index b105f2c9..00000000 --- a/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreatePlanEntitlementRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreatePlanEntitlementRequestBodyMetricPeriod = - (typeof CreatePlanEntitlementRequestBodyMetricPeriod)[keyof typeof CreatePlanEntitlementRequestBodyMetricPeriod]; diff --git a/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 15923b32..00000000 --- a/src/api/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreatePlanEntitlementRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreatePlanEntitlementRequestBodyMetricPeriodMonthReset = - (typeof CreatePlanEntitlementRequestBodyMetricPeriodMonthReset)[keyof typeof CreatePlanEntitlementRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts b/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts deleted file mode 100644 index 96d683fe..00000000 --- a/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdateCompanyOverrideRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type UpdateCompanyOverrideRequestBodyMetricPeriod = - (typeof UpdateCompanyOverrideRequestBodyMetricPeriod)[keyof typeof UpdateCompanyOverrideRequestBodyMetricPeriod]; diff --git a/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts b/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index ac22a601..00000000 --- a/src/api/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset = - (typeof UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset)[keyof typeof UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts b/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index c260c15d..00000000 --- a/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdatePlanEntitlementRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type UpdatePlanEntitlementRequestBodyMetricPeriod = - (typeof UpdatePlanEntitlementRequestBodyMetricPeriod)[keyof typeof UpdatePlanEntitlementRequestBodyMetricPeriod]; diff --git a/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index da8fcc7b..00000000 --- a/src/api/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset = - (typeof UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset)[keyof typeof UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/resources/entitlements/types/index.ts b/src/api/resources/entitlements/types/index.ts index 7f55ef95..118d4eaa 100644 --- a/src/api/resources/entitlements/types/index.ts +++ b/src/api/resources/entitlements/types/index.ts @@ -8,13 +8,7 @@ export * from "./CountFeatureUsersParams"; export * from "./CountFeatureUsersResponse"; export * from "./CountPlanEntitlementsParams"; export * from "./CountPlanEntitlementsResponse"; -export * from "./CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod"; -export * from "./CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset"; -export * from "./CreateCompanyOverrideRequestBodyMetricPeriod"; -export * from "./CreateCompanyOverrideRequestBodyMetricPeriodMonthReset"; export * from "./CreateCompanyOverrideResponse"; -export * from "./CreatePlanEntitlementRequestBodyMetricPeriod"; -export * from "./CreatePlanEntitlementRequestBodyMetricPeriodMonthReset"; export * from "./CreatePlanEntitlementResponse"; export * from "./DeleteCompanyOverrideResponse"; export * from "./DeletePlanEntitlementResponse"; @@ -35,10 +29,6 @@ export * from "./ListFeatureUsersParams"; export * from "./ListFeatureUsersResponse"; export * from "./ListPlanEntitlementsParams"; export * from "./ListPlanEntitlementsResponse"; -export * from "./UpdateCompanyOverrideRequestBodyMetricPeriod"; -export * from "./UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset"; export * from "./UpdateCompanyOverrideResponse"; -export * from "./UpdatePlanEntitlementRequestBodyMetricPeriod"; -export * from "./UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset"; export * from "./UpdatePlanEntitlementResponse"; export * from "./UpsertPlanEntitlementForBillingProductResponse"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index 784b4b4c..79b7109d 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -171,6 +171,7 @@ export class EventsClient { * @example * await client.events.getEventSummaries({ * q: "q", + * eventSubtypes: ["event_subtypes"], * limit: 1000000, * offset: 1000000 * }) @@ -209,6 +210,11 @@ export class EventsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -311,6 +317,7 @@ export class EventsClient { * await client.events.listEvents({ * companyId: "company_id", * eventSubtype: "event_subtype", + * eventTypes: ["flag_check"], * flagId: "flag_id", * userId: "user_id", * limit: 1000000, @@ -358,6 +365,11 @@ export class EventsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/events/client/requests/GetEventSummariesRequest.ts b/src/api/resources/events/client/requests/GetEventSummariesRequest.ts index 8c6c0e28..d32b3062 100644 --- a/src/api/resources/events/client/requests/GetEventSummariesRequest.ts +++ b/src/api/resources/events/client/requests/GetEventSummariesRequest.ts @@ -4,6 +4,7 @@ * @example * { * q: "q", + * eventSubtypes: ["event_subtypes"], * limit: 1000000, * offset: 1000000 * } diff --git a/src/api/resources/events/client/requests/ListEventsRequest.ts b/src/api/resources/events/client/requests/ListEventsRequest.ts index f7ea057c..5eb26381 100644 --- a/src/api/resources/events/client/requests/ListEventsRequest.ts +++ b/src/api/resources/events/client/requests/ListEventsRequest.ts @@ -7,6 +7,7 @@ import type * as Schematic from "../../../../index"; * { * companyId: "company_id", * eventSubtype: "event_subtype", + * eventTypes: ["flag_check"], * flagId: "flag_id", * userId: "user_id", * limit: 1000000, diff --git a/src/api/resources/features/client/Client.ts b/src/api/resources/features/client/Client.ts index 4e737d78..f934e65b 100644 --- a/src/api/resources/features/client/Client.ts +++ b/src/api/resources/features/client/Client.ts @@ -36,6 +36,8 @@ export class FeaturesClient { * @example * await client.features.listFeatures({ * booleanRequireEvent: true, + * featureType: ["boolean"], + * ids: ["ids"], * planVersionId: "plan_version_id", * q: "q", * withoutCompanyOverrideFor: "without_company_override_for", @@ -99,6 +101,11 @@ export class FeaturesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -852,6 +859,8 @@ export class FeaturesClient { * @example * await client.features.countFeatures({ * booleanRequireEvent: true, + * featureType: ["boolean"], + * ids: ["ids"], * planVersionId: "plan_version_id", * q: "q", * withoutCompanyOverrideFor: "without_company_override_for", @@ -915,6 +924,11 @@ export class FeaturesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1016,6 +1030,7 @@ export class FeaturesClient { * @example * await client.features.listFlags({ * featureId: "feature_id", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 @@ -1056,6 +1071,11 @@ export class FeaturesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1681,13 +1701,13 @@ export class FeaturesClient { * rules: [{ * conditionGroups: [{ * conditions: [{ - * conditionType: "company", + * conditionType: "base_plan", * operator: "eq", * resourceIds: ["resource_ids"] * }] * }], * conditions: [{ - * conditionType: "company", + * conditionType: "base_plan", * operator: "eq", * resourceIds: ["resource_ids"] * }], @@ -2228,6 +2248,7 @@ export class FeaturesClient { * @example * await client.features.countFlags({ * featureId: "feature_id", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 @@ -2268,6 +2289,11 @@ export class FeaturesClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/features/client/requests/CountFeaturesRequest.ts b/src/api/resources/features/client/requests/CountFeaturesRequest.ts index 14defd0a..4c0bca8f 100644 --- a/src/api/resources/features/client/requests/CountFeaturesRequest.ts +++ b/src/api/resources/features/client/requests/CountFeaturesRequest.ts @@ -6,6 +6,8 @@ import type * as Schematic from "../../../../index"; * @example * { * booleanRequireEvent: true, + * featureType: ["boolean"], + * ids: ["ids"], * planVersionId: "plan_version_id", * q: "q", * withoutCompanyOverrideFor: "without_company_override_for", diff --git a/src/api/resources/features/client/requests/CountFlagsRequest.ts b/src/api/resources/features/client/requests/CountFlagsRequest.ts index 8e207682..a42eae28 100644 --- a/src/api/resources/features/client/requests/CountFlagsRequest.ts +++ b/src/api/resources/features/client/requests/CountFlagsRequest.ts @@ -4,6 +4,7 @@ * @example * { * featureId: "feature_id", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts b/src/api/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts index 291ea2d2..65a33796 100644 --- a/src/api/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts +++ b/src/api/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts @@ -21,7 +21,7 @@ export interface CreateBillingLinkedFeatureRequestBody { flag?: Schematic.CreateOrUpdateFlagRequestBody; icon?: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; pluralName?: string; singularName?: string; diff --git a/src/api/resources/features/client/requests/CreateFeatureRequestBody.ts b/src/api/resources/features/client/requests/CreateFeatureRequestBody.ts index 5d90ce48..f6a3bca3 100644 --- a/src/api/resources/features/client/requests/CreateFeatureRequestBody.ts +++ b/src/api/resources/features/client/requests/CreateFeatureRequestBody.ts @@ -17,7 +17,7 @@ export interface CreateFeatureRequestBody { flag?: Schematic.CreateOrUpdateFlagRequestBody; icon?: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; pluralName?: string; singularName?: string; diff --git a/src/api/resources/features/client/requests/ListFeaturesRequest.ts b/src/api/resources/features/client/requests/ListFeaturesRequest.ts index 14fb9b78..6bb5ad38 100644 --- a/src/api/resources/features/client/requests/ListFeaturesRequest.ts +++ b/src/api/resources/features/client/requests/ListFeaturesRequest.ts @@ -6,6 +6,8 @@ import type * as Schematic from "../../../../index"; * @example * { * booleanRequireEvent: true, + * featureType: ["boolean"], + * ids: ["ids"], * planVersionId: "plan_version_id", * q: "q", * withoutCompanyOverrideFor: "without_company_override_for", diff --git a/src/api/resources/features/client/requests/ListFlagsRequest.ts b/src/api/resources/features/client/requests/ListFlagsRequest.ts index 6b5bf659..91d4301d 100644 --- a/src/api/resources/features/client/requests/ListFlagsRequest.ts +++ b/src/api/resources/features/client/requests/ListFlagsRequest.ts @@ -4,6 +4,7 @@ * @example * { * featureId: "feature_id", + * ids: ["ids"], * q: "q", * limit: 1000000, * offset: 1000000 diff --git a/src/api/resources/features/client/requests/UpdateFeatureRequestBody.ts b/src/api/resources/features/client/requests/UpdateFeatureRequestBody.ts index 4118ab4f..d824ab81 100644 --- a/src/api/resources/features/client/requests/UpdateFeatureRequestBody.ts +++ b/src/api/resources/features/client/requests/UpdateFeatureRequestBody.ts @@ -13,7 +13,7 @@ export interface UpdateFeatureRequestBody { flag?: Schematic.CreateOrUpdateFlagRequestBody; icon?: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; + maintainerAccountMemberId?: string; name?: string; pluralName?: string; singularName?: string; diff --git a/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts b/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts index bf262e9f..62b1ce56 100644 --- a/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts +++ b/src/api/resources/features/client/requests/UpdateFlagRulesRequestBody.ts @@ -8,13 +8,13 @@ import type * as Schematic from "../../../../index"; * rules: [{ * conditionGroups: [{ * conditions: [{ - * conditionType: "company", + * conditionType: "base_plan", * operator: "eq", * resourceIds: ["resource_ids"] * }] * }], * conditions: [{ - * conditionType: "company", + * conditionType: "base_plan", * operator: "eq", * resourceIds: ["resource_ids"] * }], diff --git a/src/api/resources/plangroups/client/Client.ts b/src/api/resources/plangroups/client/Client.ts index 02616f92..08c382ce 100644 --- a/src/api/resources/plangroups/client/Client.ts +++ b/src/api/resources/plangroups/client/Client.ts @@ -68,6 +68,11 @@ export class PlangroupsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/planmigrations/client/Client.ts b/src/api/resources/planmigrations/client/Client.ts index 71e34926..007e47a9 100644 --- a/src/api/resources/planmigrations/client/Client.ts +++ b/src/api/resources/planmigrations/client/Client.ts @@ -82,6 +82,11 @@ export class PlanmigrationsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -234,6 +239,11 @@ export class PlanmigrationsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -382,6 +392,11 @@ export class PlanmigrationsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -646,6 +661,11 @@ export class PlanmigrationsClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/plans/client/Client.ts b/src/api/resources/plans/client/Client.ts index dd6be1c6..9b956b2c 100644 --- a/src/api/resources/plans/client/Client.ts +++ b/src/api/resources/plans/client/Client.ts @@ -166,6 +166,313 @@ export class PlansClient { ); } + /** + * @param {Schematic.ListCustomPlanBillingsRequest} request + * @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.plans.listCustomPlanBillings({ + * companyId: "company_id", + * planId: "plan_id", + * status: "active", + * statuses: ["active"], + * limit: 1000000, + * offset: 1000000 + * }) + */ + public listCustomPlanBillings( + request: Schematic.ListCustomPlanBillingsRequest = {}, + requestOptions?: PlansClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise(this.__listCustomPlanBillings(request, requestOptions)); + } + + private async __listCustomPlanBillings( + request: Schematic.ListCustomPlanBillingsRequest = {}, + requestOptions?: PlansClient.RequestOptions, + ): Promise> { + const { companyId, planId, status, statuses, limit, offset } = request; + const _queryParams: Record = { + company_id: companyId, + plan_id: planId, + status: + status != null + ? serializers.CustomPlanBillingStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip" }) + : undefined, + statuses: Array.isArray(statuses) + ? statuses.map((item) => + serializers.CustomPlanBillingStatus.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }), + ) + : statuses != null + ? serializers.CustomPlanBillingStatus.jsonOrThrow(statuses, { unrecognizedObjectKeys: "strip" }) + : undefined, + limit, + offset, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + "custom-plan-billings", + ), + method: "GET", + headers: _headers, + queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.ListCustomPlanBillingsResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/custom-plan-billings"); + } + + /** + * @param {string} custom_plan_billing_id - custom_plan_billing_id + * @param {Schematic.RetryCustomPlanBillingRequestBody} request + * @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Schematic.BadRequestError} + * @throws {@link Schematic.UnauthorizedError} + * @throws {@link Schematic.ForbiddenError} + * @throws {@link Schematic.NotFoundError} + * @throws {@link Schematic.InternalServerError} + * + * @example + * await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + * customerEmail: "customer_email", + * payInAdvance: [{ + * priceId: "price_id", + * quantity: 1000000 + * }] + * }) + */ + public retryCustomPlanBilling( + custom_plan_billing_id: string, + request: Schematic.RetryCustomPlanBillingRequestBody, + requestOptions?: PlansClient.RequestOptions, + ): core.HttpResponsePromise { + return core.HttpResponsePromise.fromPromise( + this.__retryCustomPlanBilling(custom_plan_billing_id, request, requestOptions), + ); + } + + private async __retryCustomPlanBilling( + custom_plan_billing_id: string, + request: Schematic.RetryCustomPlanBillingRequestBody, + requestOptions?: PlansClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + requestOptions?.headers, + ); + const _response = await (this._options.fetcher ?? core.fetcher)({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + (await core.Supplier.get(this._options.environment)) ?? + environments.SchematicEnvironment.Default, + `custom-plan-billings/${core.url.encodePathParam(custom_plan_billing_id)}/retry`, + ), + method: "PUT", + headers: _headers, + contentType: "application/json", + queryParameters: requestOptions?.queryParams, + requestType: "json", + body: serializers.RetryCustomPlanBillingRequestBody.jsonOrThrow(request, { + unrecognizedObjectKeys: "strip", + }), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: serializers.RetryCustomPlanBillingResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + rawResponse: _response.rawResponse, + }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Schematic.BadRequestError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 401: + throw new Schematic.UnauthorizedError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 403: + throw new Schematic.ForbiddenError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 404: + throw new Schematic.NotFoundError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + case 500: + throw new Schematic.InternalServerError( + serializers.ApiError.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }), + _response.rawResponse, + ); + default: + throw new errors.SchematicError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "PUT", + "/custom-plan-billings/{custom_plan_billing_id}/retry", + ); + } + /** * @param {Schematic.CreateCustomPlanRequestBody} request * @param {PlansClient.RequestOptions} requestOptions - Request-specific configuration. @@ -314,10 +621,12 @@ export class PlansClient { * @example * await client.plans.listPlans({ * companyId: "company_id", + * excludeCompanyScoped: true, * forFallbackPlan: true, * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * ids: ["ids"], * includeDraftVersions: true, * planType: "plan", * q: "q", @@ -341,6 +650,7 @@ export class PlansClient { ): Promise> { const { companyId, + excludeCompanyScoped, forFallbackPlan, forInitialPlan, forTrialExpiryPlan, @@ -357,6 +667,7 @@ export class PlansClient { } = request; const _queryParams: Record = { company_id: companyId, + exclude_company_scoped: excludeCompanyScoped, for_fallback_plan: forFallbackPlan, for_initial_plan: forInitialPlan, for_trial_expiry_plan: forTrialExpiryPlan, @@ -390,6 +701,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -661,6 +977,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1335,6 +1656,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1480,6 +1806,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1586,10 +1917,12 @@ export class PlansClient { * @example * await client.plans.countPlans({ * companyId: "company_id", + * excludeCompanyScoped: true, * forFallbackPlan: true, * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * ids: ["ids"], * includeDraftVersions: true, * planType: "plan", * q: "q", @@ -1613,6 +1946,7 @@ export class PlansClient { ): Promise> { const { companyId, + excludeCompanyScoped, forFallbackPlan, forInitialPlan, forTrialExpiryPlan, @@ -1629,6 +1963,7 @@ export class PlansClient { } = request; const _queryParams: Record = { company_id: companyId, + exclude_company_scoped: excludeCompanyScoped, for_fallback_plan: forFallbackPlan, for_initial_plan: forInitialPlan, for_trial_expiry_plan: forTrialExpiryPlan, @@ -1662,6 +1997,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1798,6 +2138,11 @@ export class PlansClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1935,6 +2280,11 @@ export class PlansClient { method: "DELETE", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/plans/client/requests/CountPlansRequest.ts b/src/api/resources/plans/client/requests/CountPlansRequest.ts index 651c7200..40a9fc78 100644 --- a/src/api/resources/plans/client/requests/CountPlansRequest.ts +++ b/src/api/resources/plans/client/requests/CountPlansRequest.ts @@ -6,10 +6,12 @@ import type * as Schematic from "../../../../index"; * @example * { * companyId: "company_id", + * excludeCompanyScoped: true, * forFallbackPlan: true, * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * ids: ["ids"], * includeDraftVersions: true, * planType: "plan", * q: "q", @@ -22,6 +24,8 @@ import type * as Schematic from "../../../../index"; */ export interface CountPlansRequest { companyId?: string; + /** Exclude plans that are scoped to a company (custom plans assigned to a company) */ + excludeCompanyScoped?: boolean; /** Filter for plans valid as fallback plans (not linked to billing) */ forFallbackPlan?: boolean; /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */ diff --git a/src/api/resources/plans/client/requests/ListCustomPlanBillingsRequest.ts b/src/api/resources/plans/client/requests/ListCustomPlanBillingsRequest.ts new file mode 100644 index 00000000..5be318e0 --- /dev/null +++ b/src/api/resources/plans/client/requests/ListCustomPlanBillingsRequest.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../index"; + +/** + * @example + * { + * companyId: "company_id", + * planId: "plan_id", + * status: "active", + * statuses: ["active"], + * limit: 1000000, + * offset: 1000000 + * } + */ +export interface ListCustomPlanBillingsRequest { + /** Filter by company ID */ + companyId?: string; + /** Filter by plan ID */ + planId?: string; + /** Filter by billing status */ + status?: Schematic.CustomPlanBillingStatus; + /** Filter by multiple billing statuses */ + statuses?: Schematic.CustomPlanBillingStatus | Schematic.CustomPlanBillingStatus[]; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; +} diff --git a/src/api/resources/plans/client/requests/ListPlansRequest.ts b/src/api/resources/plans/client/requests/ListPlansRequest.ts index c34b61f3..b1d2f49e 100644 --- a/src/api/resources/plans/client/requests/ListPlansRequest.ts +++ b/src/api/resources/plans/client/requests/ListPlansRequest.ts @@ -6,10 +6,12 @@ import type * as Schematic from "../../../../index"; * @example * { * companyId: "company_id", + * excludeCompanyScoped: true, * forFallbackPlan: true, * forInitialPlan: true, * forTrialExpiryPlan: true, * hasProductId: true, + * ids: ["ids"], * includeDraftVersions: true, * planType: "plan", * q: "q", @@ -22,6 +24,8 @@ import type * as Schematic from "../../../../index"; */ export interface ListPlansRequest { companyId?: string; + /** Exclude plans that are scoped to a company (custom plans assigned to a company) */ + excludeCompanyScoped?: boolean; /** Filter for plans valid as fallback plans (not linked to billing) */ forFallbackPlan?: boolean; /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */ diff --git a/src/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts b/src/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts new file mode 100644 index 00000000..52d97d5b --- /dev/null +++ b/src/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts @@ -0,0 +1,20 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../index"; + +/** + * @example + * { + * customerEmail: "customer_email", + * payInAdvance: [{ + * priceId: "price_id", + * quantity: 1000000 + * }] + * } + */ +export interface RetryCustomPlanBillingRequestBody { + activationStrategy?: Schematic.CustomPlanActivationStrategy; + customerEmail: string; + daysUntilDue?: number; + payInAdvance: Schematic.UpdatePayInAdvanceRequestBody[]; +} diff --git a/src/api/resources/plans/client/requests/index.ts b/src/api/resources/plans/client/requests/index.ts index 432aed32..f3670288 100644 --- a/src/api/resources/plans/client/requests/index.ts +++ b/src/api/resources/plans/client/requests/index.ts @@ -5,7 +5,9 @@ export type { CreateCustomPlanRequestBody } from "./CreateCustomPlanRequestBody" export type { DeletePlanVersionRequest } from "./DeletePlanVersionRequest"; export type { GetPlanRequest } from "./GetPlanRequest"; export type { ListBillingProductMatchCompaniesRequest } from "./ListBillingProductMatchCompaniesRequest"; +export type { ListCustomPlanBillingsRequest } from "./ListCustomPlanBillingsRequest"; export type { ListPlanIssuesRequest } from "./ListPlanIssuesRequest"; export type { ListPlansRequest } from "./ListPlansRequest"; export type { PublishPlanVersionRequestBody } from "./PublishPlanVersionRequestBody"; +export type { RetryCustomPlanBillingRequestBody } from "./RetryCustomPlanBillingRequestBody"; export type { UpdateCompanyPlansRequestBody } from "./UpdateCompanyPlansRequestBody"; diff --git a/src/api/resources/plans/types/CountPlansParams.ts b/src/api/resources/plans/types/CountPlansParams.ts index e0cc39d2..06949b09 100644 --- a/src/api/resources/plans/types/CountPlansParams.ts +++ b/src/api/resources/plans/types/CountPlansParams.ts @@ -7,6 +7,8 @@ import type * as Schematic from "../../../index"; */ export interface CountPlansParams { companyId?: string; + /** Exclude plans that are scoped to a company (custom plans assigned to a company) */ + excludeCompanyScoped?: boolean; /** Filter for plans valid as fallback plans (not linked to billing) */ forFallbackPlan?: boolean; /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */ diff --git a/src/api/resources/plans/types/ListCustomPlanBillingsParams.ts b/src/api/resources/plans/types/ListCustomPlanBillingsParams.ts new file mode 100644 index 00000000..c518ea44 --- /dev/null +++ b/src/api/resources/plans/types/ListCustomPlanBillingsParams.ts @@ -0,0 +1,21 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +/** + * Input parameters + */ +export interface ListCustomPlanBillingsParams { + /** Filter by company ID */ + companyId?: string; + /** Page limit (default 100) */ + limit?: number; + /** Page offset (default 0) */ + offset?: number; + /** Filter by plan ID */ + planId?: string; + /** Filter by billing status */ + status?: Schematic.CustomPlanBillingStatus; + /** Filter by multiple billing statuses */ + statuses?: Schematic.CustomPlanBillingStatus[]; +} diff --git a/src/api/resources/plans/types/ListCustomPlanBillingsResponse.ts b/src/api/resources/plans/types/ListCustomPlanBillingsResponse.ts new file mode 100644 index 00000000..c96f5ff3 --- /dev/null +++ b/src/api/resources/plans/types/ListCustomPlanBillingsResponse.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../index"; + +export interface ListCustomPlanBillingsResponse { + data: Schematic.CustomPlanBillingResponseData[]; + /** Input parameters */ + params: Schematic.ListCustomPlanBillingsParams; +} diff --git a/src/api/resources/plans/types/ListPlansParams.ts b/src/api/resources/plans/types/ListPlansParams.ts index 8e5b675b..6ad735bb 100644 --- a/src/api/resources/plans/types/ListPlansParams.ts +++ b/src/api/resources/plans/types/ListPlansParams.ts @@ -7,6 +7,8 @@ import type * as Schematic from "../../../index"; */ export interface ListPlansParams { companyId?: string; + /** Exclude plans that are scoped to a company (custom plans assigned to a company) */ + excludeCompanyScoped?: boolean; /** Filter for plans valid as fallback plans (not linked to billing) */ forFallbackPlan?: boolean; /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */ diff --git a/src/api/resources/companies/types/UpdatePlanTraitResponse.ts b/src/api/resources/plans/types/RetryCustomPlanBillingResponse.ts similarity index 64% rename from src/api/resources/companies/types/UpdatePlanTraitResponse.ts rename to src/api/resources/plans/types/RetryCustomPlanBillingResponse.ts index f469f4d8..593a708a 100644 --- a/src/api/resources/companies/types/UpdatePlanTraitResponse.ts +++ b/src/api/resources/plans/types/RetryCustomPlanBillingResponse.ts @@ -2,8 +2,8 @@ import type * as Schematic from "../../../index"; -export interface UpdatePlanTraitResponse { - data: Schematic.PlanTraitResponseData; +export interface RetryCustomPlanBillingResponse { + data: Schematic.CustomPlanBillingResponseData; /** Input parameters */ params: Record; } diff --git a/src/api/resources/plans/types/index.ts b/src/api/resources/plans/types/index.ts index 3c0ca520..9200140f 100644 --- a/src/api/resources/plans/types/index.ts +++ b/src/api/resources/plans/types/index.ts @@ -11,11 +11,14 @@ export * from "./GetPlanParams"; export * from "./GetPlanResponse"; export * from "./ListBillingProductMatchCompaniesParams"; export * from "./ListBillingProductMatchCompaniesResponse"; +export * from "./ListCustomPlanBillingsParams"; +export * from "./ListCustomPlanBillingsResponse"; export * from "./ListPlanIssuesParams"; export * from "./ListPlanIssuesResponse"; export * from "./ListPlansParams"; export * from "./ListPlansResponse"; export * from "./PublishPlanVersionResponse"; +export * from "./RetryCustomPlanBillingResponse"; export * from "./UpdateCompanyPlansResponse"; export * from "./UpdatePlanResponse"; export * from "./UpsertBillingProductPlanResponse"; diff --git a/src/api/resources/scheduledcheckout/client/Client.ts b/src/api/resources/scheduledcheckout/client/Client.ts index 196d7dd4..2e380b04 100644 --- a/src/api/resources/scheduledcheckout/client/Client.ts +++ b/src/api/resources/scheduledcheckout/client/Client.ts @@ -78,6 +78,11 @@ export class ScheduledcheckoutClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index fb9874ea..9d3943e4 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -35,6 +35,7 @@ export class WebhooksClient { * * @example * await client.webhooks.listWebhookEvents({ + * ids: ["ids"], * q: "q", * webhookId: "webhook_id", * limit: 1000000, @@ -76,6 +77,11 @@ export class WebhooksClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -297,6 +303,7 @@ export class WebhooksClient { * * @example * await client.webhooks.countWebhookEvents({ + * ids: ["ids"], * q: "q", * webhookId: "webhook_id", * limit: 1000000, @@ -338,6 +345,11 @@ export class WebhooksClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -476,6 +488,11 @@ export class WebhooksClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1127,6 +1144,11 @@ export class WebhooksClient { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts b/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts index e2726ef7..36796c7c 100644 --- a/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts +++ b/src/api/resources/webhooks/client/requests/CountWebhookEventsRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * q: "q", * webhookId: "webhook_id", * limit: 1000000, diff --git a/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts b/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts index e90b964b..3a80e01f 100644 --- a/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts +++ b/src/api/resources/webhooks/client/requests/ListWebhookEventsRequest.ts @@ -3,6 +3,7 @@ /** * @example * { + * ids: ["ids"], * q: "q", * webhookId: "webhook_id", * limit: 1000000, diff --git a/src/api/types/ApiKeyCreateResponseData.ts b/src/api/types/ApiKeyCreateResponseData.ts index 44ce2c1a..4f623534 100644 --- a/src/api/types/ApiKeyCreateResponseData.ts +++ b/src/api/types/ApiKeyCreateResponseData.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../index"; export interface ApiKeyCreateResponseData { createdAt: Date; description?: string; + environment?: Schematic.EnvironmentResponseData; environmentId?: string; id: string; lastUsedAt?: Date; diff --git a/src/api/types/ApiKeyResponseData.ts b/src/api/types/ApiKeyResponseData.ts index 6749eee4..72ef79e3 100644 --- a/src/api/types/ApiKeyResponseData.ts +++ b/src/api/types/ApiKeyResponseData.ts @@ -5,6 +5,7 @@ import type * as Schematic from "../index"; export interface ApiKeyResponseData { createdAt: Date; description?: string; + environment?: Schematic.EnvironmentResponseData; environmentId?: string; id: string; lastUsedAt?: Date; diff --git a/src/api/types/AuditLogListResponseData.ts b/src/api/types/AuditLogListResponseData.ts index 1c774b2c..353f8363 100644 --- a/src/api/types/AuditLogListResponseData.ts +++ b/src/api/types/AuditLogListResponseData.ts @@ -6,6 +6,7 @@ export interface AuditLogListResponseData { actorType: Schematic.ActorType; apiKeyId?: string; endedAt?: Date; + environment?: Schematic.EnvironmentResponseData; environmentId?: string; id: string; method: string; diff --git a/src/api/types/AuditLogResponseData.ts b/src/api/types/AuditLogResponseData.ts index 4a482dda..0283fbd9 100644 --- a/src/api/types/AuditLogResponseData.ts +++ b/src/api/types/AuditLogResponseData.ts @@ -6,6 +6,7 @@ export interface AuditLogResponseData { actorType: Schematic.ActorType; apiKeyId?: string; endedAt?: Date; + environment?: Schematic.EnvironmentResponseData; environmentId?: string; id: string; method: string; diff --git a/src/api/types/BillingPriceResponseData.ts b/src/api/types/BillingPriceResponseData.ts index 62d46819..2cdf10d7 100644 --- a/src/api/types/BillingPriceResponseData.ts +++ b/src/api/types/BillingPriceResponseData.ts @@ -7,6 +7,7 @@ export interface BillingPriceResponseData { externalPriceId: string; id: string; interval: Schematic.BillingProductPriceInterval; + nickname?: string; price: number; priceDecimal?: string; providerType: Schematic.BillingProviderType; diff --git a/src/api/types/BillingPriceView.ts b/src/api/types/BillingPriceView.ts index 45de8b11..779d650a 100644 --- a/src/api/types/BillingPriceView.ts +++ b/src/api/types/BillingPriceView.ts @@ -12,6 +12,7 @@ export interface BillingPriceView { meterEventName?: string; meterEventPayloadKey?: string; meterId?: string; + nickname?: string; packageSize: number; price: number; priceDecimal?: string; diff --git a/src/api/types/BillingProductPriceResponseData.ts b/src/api/types/BillingProductPriceResponseData.ts index 7889a214..774d897d 100644 --- a/src/api/types/BillingProductPriceResponseData.ts +++ b/src/api/types/BillingProductPriceResponseData.ts @@ -10,6 +10,7 @@ export interface BillingProductPriceResponseData { interval: Schematic.BillingProductPriceInterval; isActive: boolean; meterId?: string; + nickname?: string; packageSize: number; price: number; priceDecimal?: string; diff --git a/src/api/types/CheckFlagResponseData.ts b/src/api/types/CheckFlagResponseData.ts index 3fee0e07..990a5ad4 100644 --- a/src/api/types/CheckFlagResponseData.ts +++ b/src/api/types/CheckFlagResponseData.ts @@ -16,7 +16,7 @@ export interface CheckFlagResponseData { /** Deprecated: Use Entitlement.EventName instead. */ featureUsageEvent?: string; /** Deprecated: Use Entitlement.MetricPeriod instead. */ - featureUsagePeriod?: string; + featureUsagePeriod?: Schematic.MetricPeriod; /** Deprecated: Use Entitlement.MetricResetAt instead. */ featureUsageResetAt?: Date; /** The key used to check the flag */ @@ -28,7 +28,7 @@ export interface CheckFlagResponseData { /** If a rule was found, its ID */ ruleId?: string; /** If a rule was found, its type */ - ruleType?: string; + ruleType?: Schematic.RuleType; /** If user keys were provided and matched a user, its ID */ userId?: string; /** A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted */ diff --git a/src/api/types/CompanyEventPeriodMetricsResponseData.ts b/src/api/types/CompanyEventPeriodMetricsResponseData.ts index 15c244af..7f2a1b3d 100644 --- a/src/api/types/CompanyEventPeriodMetricsResponseData.ts +++ b/src/api/types/CompanyEventPeriodMetricsResponseData.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Schematic from "../index"; + export interface CompanyEventPeriodMetricsResponseData { accountId: string; capturedAtMax: Date; @@ -8,8 +10,8 @@ export interface CompanyEventPeriodMetricsResponseData { createdAt: Date; environmentId: string; eventSubtype: string; - monthReset: string; - period: string; + monthReset: Schematic.MetricPeriodMonthReset; + period: Schematic.MetricPeriod; validUntil?: Date; value: number; } diff --git a/src/api/types/CompanyOverrideResponseData.ts b/src/api/types/CompanyOverrideResponseData.ts index 76549ec2..ad78e24a 100644 --- a/src/api/types/CompanyOverrideResponseData.ts +++ b/src/api/types/CompanyOverrideResponseData.ts @@ -12,8 +12,8 @@ export interface CompanyOverrideResponseData { feature?: Schematic.FeatureResponseData; featureId: string; id: string; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; notes: Schematic.CompanyOverrideNoteResponseData[]; ruleId?: string; ruleIdUsageExceeded?: string; diff --git a/src/api/types/CompanyPlanDetailResponseData.ts b/src/api/types/CompanyPlanDetailResponseData.ts index fa32ae0f..797c4084 100644 --- a/src/api/types/CompanyPlanDetailResponseData.ts +++ b/src/api/types/CompanyPlanDetailResponseData.ts @@ -13,7 +13,7 @@ export interface CompanyPlanDetailResponseData { companyId?: string; companyName?: string; compatiblePlanIds: string[]; - controlledBy: string; + controlledBy: Schematic.BillingProviderType; copiedFromPlanId?: string; createdAt: Date; currencyPrices: Schematic.PlanCurrencyPricesResponseData[]; @@ -23,7 +23,7 @@ export interface CompanyPlanDetailResponseData { description: string; draftVersion?: Schematic.PlanVersionResponseData; entitlements: Schematic.PlanEntitlementResponseData[]; - features: Schematic.FeatureDetailResponseData[]; + features: Schematic.FeatureInPlanResponseData[]; icon: Schematic.PlanIcon; id: string; includedCreditGrants: Schematic.PlanCreditGrantView[]; diff --git a/src/api/types/CompanySubscriptionResponseData.ts b/src/api/types/CompanySubscriptionResponseData.ts index 6e2c0df5..dcbca08e 100644 --- a/src/api/types/CompanySubscriptionResponseData.ts +++ b/src/api/types/CompanySubscriptionResponseData.ts @@ -13,6 +13,7 @@ export interface CompanySubscriptionResponseData { latestInvoice?: Schematic.InvoiceResponseData; paymentMethod?: Schematic.PaymentMethodResponseData; products: Schematic.BillingProductForSubscriptionResponseData[]; + providerType: Schematic.BillingProviderType; status: string; subscriptionExternalId: string; totalPrice: number; diff --git a/src/api/types/ConditionOperator.ts b/src/api/types/ComparableOperator.ts similarity index 62% rename from src/api/types/ConditionOperator.ts rename to src/api/types/ComparableOperator.ts index c617ace6..f914d7dc 100644 --- a/src/api/types/ConditionOperator.ts +++ b/src/api/types/ComparableOperator.ts @@ -1,13 +1,13 @@ // This file was auto-generated by Fern from our API Definition. -export const ConditionOperator = { +export const ComparableOperator = { Eq: "eq", - Ne: "ne", Gt: "gt", - Lt: "lt", Gte: "gte", - Lte: "lte", IsEmpty: "is_empty", + Lt: "lt", + Lte: "lte", NotEmpty: "not_empty", + Ne: "ne", } as const; -export type ConditionOperator = (typeof ConditionOperator)[keyof typeof ConditionOperator]; +export type ComparableOperator = (typeof ComparableOperator)[keyof typeof ComparableOperator]; diff --git a/src/api/types/Condition.ts b/src/api/types/Condition.ts index fdc05ea2..df4cfb44 100644 --- a/src/api/types/Condition.ts +++ b/src/api/types/Condition.ts @@ -5,16 +5,16 @@ import type * as Schematic from "../index"; export interface Condition { accountId: string; comparisonTraitDefinition?: Schematic.TraitDefinition; - conditionType: Schematic.ConditionConditionType; + conditionType: Schematic.ConditionType; consumptionRate?: number; creditId?: string; environmentId: string; eventSubtype?: string; id: string; - metricPeriod?: Schematic.ConditionMetricPeriod; - metricPeriodMonthReset?: Schematic.ConditionMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; metricValue?: number; - operator: Schematic.ConditionOperator; + operator: Schematic.ComparableOperator; resourceIds: string[]; traitDefinition?: Schematic.TraitDefinition; traitValue: string; diff --git a/src/api/types/ConditionMetricPeriodMonthReset.ts b/src/api/types/ConditionMetricPeriodMonthReset.ts deleted file mode 100644 index 28fd37a1..00000000 --- a/src/api/types/ConditionMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const ConditionMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type ConditionMetricPeriodMonthReset = - (typeof ConditionMetricPeriodMonthReset)[keyof typeof ConditionMetricPeriodMonthReset]; diff --git a/src/api/types/ConditionResponseData.ts b/src/api/types/ConditionResponseData.ts index bf95d384..d4b07b29 100644 --- a/src/api/types/ConditionResponseData.ts +++ b/src/api/types/ConditionResponseData.ts @@ -6,7 +6,7 @@ export interface ConditionResponseData { accountId: string; comparisonTraitId?: string; conditionGroupId?: string; - conditionType: string; + conditionType: Schematic.ConditionType; consumptionRate?: number; createdAt: Date; creditId?: string; @@ -14,10 +14,10 @@ export interface ConditionResponseData { eventSubtype?: string; flagId?: string; id: string; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; metricValue?: number; - operator: string; + operator: Schematic.ComparableOperator; resourceUnspecifiedIds: string[]; ruleId: string; traitEntityType?: Schematic.EntityType; diff --git a/src/api/types/ConditionConditionType.ts b/src/api/types/ConditionType.ts similarity index 67% rename from src/api/types/ConditionConditionType.ts rename to src/api/types/ConditionType.ts index 6068ca9e..9e7840ea 100644 --- a/src/api/types/ConditionConditionType.ts +++ b/src/api/types/ConditionType.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -export const ConditionConditionType = { +export const ConditionType = { BasePlan: "base_plan", BillingProduct: "billing_product", Company: "company", @@ -11,4 +11,4 @@ export const ConditionConditionType = { Trait: "trait", User: "user", } as const; -export type ConditionConditionType = (typeof ConditionConditionType)[keyof typeof ConditionConditionType]; +export type ConditionType = (typeof ConditionType)[keyof typeof ConditionType]; diff --git a/src/api/types/ConditionView.ts b/src/api/types/ConditionView.ts index 019df55c..3ba4c341 100644 --- a/src/api/types/ConditionView.ts +++ b/src/api/types/ConditionView.ts @@ -9,7 +9,7 @@ export interface ConditionView { comparisonTrait?: Schematic.EntityTraitDefinitionResponseData; comparisonTraitId?: string; conditionGroupId?: string; - conditionType: string; + conditionType: Schematic.ConditionType; consumptionRate?: number; createdAt: Date; creditId?: string; @@ -17,10 +17,10 @@ export interface ConditionView { eventSubtype?: string; flagId?: string; id: string; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; metricValue?: number; - operator: string; + operator: Schematic.ComparableOperator; planVersions: Schematic.GenericPreviewObject[]; plans: Schematic.GenericPreviewObject[]; resourceUnspecifiedIds: string[]; diff --git a/src/api/types/CreateEntitlementInBundleRequestBody.ts b/src/api/types/CreateEntitlementInBundleRequestBody.ts index 9b5b4e95..f4c45305 100644 --- a/src/api/types/CreateEntitlementInBundleRequestBody.ts +++ b/src/api/types/CreateEntitlementInBundleRequestBody.ts @@ -9,8 +9,8 @@ export interface CreateEntitlementInBundleRequestBody { currency?: string; currencyPrices?: Schematic.CurrencyPriceRequestBody[]; featureId: string; - metricPeriod?: Schematic.CreateEntitlementInBundleRequestBodyMetricPeriod; - metricPeriodMonthReset?: Schematic.CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; monthlyMeteredPriceId?: string; monthlyPriceTiers?: Schematic.CreatePriceTierRequestBody[]; monthlyUnitPrice?: number; diff --git a/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriod.ts b/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriod.ts deleted file mode 100644 index a9f8bfb1..00000000 --- a/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateEntitlementInBundleRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreateEntitlementInBundleRequestBodyMetricPeriod = - (typeof CreateEntitlementInBundleRequestBodyMetricPeriod)[keyof typeof CreateEntitlementInBundleRequestBodyMetricPeriod]; diff --git a/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts b/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 74a6db2f..00000000 --- a/src/api/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset = - (typeof CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset)[keyof typeof CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/types/CreateEntitlementReqCommon.ts b/src/api/types/CreateEntitlementReqCommon.ts index 1bc58bfc..4e2c4589 100644 --- a/src/api/types/CreateEntitlementReqCommon.ts +++ b/src/api/types/CreateEntitlementReqCommon.ts @@ -5,8 +5,8 @@ import type * as Schematic from "../index"; export interface CreateEntitlementReqCommon { creditConsumptionRate?: number; featureId: string; - metricPeriod?: Schematic.CreateEntitlementReqCommonMetricPeriod; - metricPeriodMonthReset?: Schematic.CreateEntitlementReqCommonMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; valueBool?: boolean; valueCreditId?: string; valueNumeric?: number; diff --git a/src/api/types/CreateEntitlementReqCommonMetricPeriod.ts b/src/api/types/CreateEntitlementReqCommonMetricPeriod.ts deleted file mode 100644 index f9b80296..00000000 --- a/src/api/types/CreateEntitlementReqCommonMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateEntitlementReqCommonMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreateEntitlementReqCommonMetricPeriod = - (typeof CreateEntitlementReqCommonMetricPeriod)[keyof typeof CreateEntitlementReqCommonMetricPeriod]; diff --git a/src/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts b/src/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts deleted file mode 100644 index 313054ec..00000000 --- a/src/api/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateEntitlementReqCommonMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreateEntitlementReqCommonMetricPeriodMonthReset = - (typeof CreateEntitlementReqCommonMetricPeriodMonthReset)[keyof typeof CreateEntitlementReqCommonMetricPeriodMonthReset]; diff --git a/src/api/types/CreateFlagRequestBody.ts b/src/api/types/CreateFlagRequestBody.ts index 7ff54f29..4ee4af84 100644 --- a/src/api/types/CreateFlagRequestBody.ts +++ b/src/api/types/CreateFlagRequestBody.ts @@ -8,6 +8,6 @@ export interface CreateFlagRequestBody { featureId?: string; flagType: Schematic.FlagType; key: string; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; } diff --git a/src/api/types/CreateOrUpdateConditionRequestBody.ts b/src/api/types/CreateOrUpdateConditionRequestBody.ts index cb36a3ad..f717e20c 100644 --- a/src/api/types/CreateOrUpdateConditionRequestBody.ts +++ b/src/api/types/CreateOrUpdateConditionRequestBody.ts @@ -5,7 +5,7 @@ import type * as Schematic from "../index"; export interface CreateOrUpdateConditionRequestBody { /** Optionally provide a trait ID to compare a metric or trait value against instead of a value */ comparisonTraitId?: string; - conditionType: Schematic.CreateOrUpdateConditionRequestBodyConditionType; + conditionType: Schematic.ConditionType; /** Cost of credit to use to measure this condition */ creditCost?: number; /** ID of credit to use to measure this condition */ @@ -14,12 +14,12 @@ export interface CreateOrUpdateConditionRequestBody { eventSubtype?: string; id?: string; /** Period of time over which to measure the track event metric */ - metricPeriod?: Schematic.CreateOrUpdateConditionRequestBodyMetricPeriod; + metricPeriod?: Schematic.MetricPeriod; /** When metric_period=current_month, specify whether the month restarts based on the calendar month or the billing period */ - metricPeriodMonthReset?: Schematic.CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; /** Value to compare the track event metric against */ metricValue?: number; - operator: Schematic.CreateOrUpdateConditionRequestBodyOperator; + operator: Schematic.ComparableOperator; /** List of resource IDs (companies, users, or plans) targeted by this condition */ resourceIds: string[]; /** ID of trait to use to measure this condition */ diff --git a/src/api/types/CreateOrUpdateConditionRequestBodyConditionType.ts b/src/api/types/CreateOrUpdateConditionRequestBodyConditionType.ts deleted file mode 100644 index aeceff34..00000000 --- a/src/api/types/CreateOrUpdateConditionRequestBodyConditionType.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateOrUpdateConditionRequestBodyConditionType = { - Company: "company", - Metric: "metric", - Trait: "trait", - User: "user", - Plan: "plan", - BillingProduct: "billing_product", - BasePlan: "base_plan", -} as const; -export type CreateOrUpdateConditionRequestBodyConditionType = - (typeof CreateOrUpdateConditionRequestBodyConditionType)[keyof typeof CreateOrUpdateConditionRequestBodyConditionType]; diff --git a/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts b/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts deleted file mode 100644 index 01d70b3e..00000000 --- a/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Period of time over which to measure the track event metric */ -export const CreateOrUpdateConditionRequestBodyMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type CreateOrUpdateConditionRequestBodyMetricPeriod = - (typeof CreateOrUpdateConditionRequestBodyMetricPeriod)[keyof typeof CreateOrUpdateConditionRequestBodyMetricPeriod]; diff --git a/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts b/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 7d4ffcdc..00000000 --- a/src/api/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** When metric_period=current_month, specify whether the month restarts based on the calendar month or the billing period */ -export const CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset = - (typeof CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset)[keyof typeof CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset]; diff --git a/src/api/types/CreateOrUpdateConditionRequestBodyOperator.ts b/src/api/types/CreateOrUpdateConditionRequestBodyOperator.ts deleted file mode 100644 index 168d63a0..00000000 --- a/src/api/types/CreateOrUpdateConditionRequestBodyOperator.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateOrUpdateConditionRequestBodyOperator = { - Eq: "eq", - Ne: "ne", - Gt: "gt", - Gte: "gte", - Lt: "lt", - Lte: "lte", - IsEmpty: "is_empty", - NotEmpty: "not_empty", -} as const; -export type CreateOrUpdateConditionRequestBodyOperator = - (typeof CreateOrUpdateConditionRequestBodyOperator)[keyof typeof CreateOrUpdateConditionRequestBodyOperator]; diff --git a/src/api/types/CreateOrUpdateFlagRequestBody.ts b/src/api/types/CreateOrUpdateFlagRequestBody.ts index ae4d60e6..308d57f2 100644 --- a/src/api/types/CreateOrUpdateFlagRequestBody.ts +++ b/src/api/types/CreateOrUpdateFlagRequestBody.ts @@ -9,6 +9,6 @@ export interface CreateOrUpdateFlagRequestBody { flagType: Schematic.FlagType; id?: string; key: string; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; } diff --git a/src/api/types/CreateOrUpdateRuleRequestBody.ts b/src/api/types/CreateOrUpdateRuleRequestBody.ts index 90c2c23c..3eab4b5b 100644 --- a/src/api/types/CreateOrUpdateRuleRequestBody.ts +++ b/src/api/types/CreateOrUpdateRuleRequestBody.ts @@ -8,6 +8,6 @@ export interface CreateOrUpdateRuleRequestBody { id?: string; name: string; priority: number; - ruleType?: Schematic.CreateOrUpdateRuleRequestBodyRuleType; + ruleType?: Schematic.RuleType; value: boolean; } diff --git a/src/api/types/CreateOrUpdateRuleRequestBodyRuleType.ts b/src/api/types/CreateOrUpdateRuleRequestBodyRuleType.ts deleted file mode 100644 index 98de6c63..00000000 --- a/src/api/types/CreateOrUpdateRuleRequestBodyRuleType.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const CreateOrUpdateRuleRequestBodyRuleType = { - GlobalOverride: "global_override", - CompanyOverride: "company_override", - PlanEntitlement: "plan_entitlement", - Standard: "standard", - Default: "default", -} as const; -export type CreateOrUpdateRuleRequestBodyRuleType = - (typeof CreateOrUpdateRuleRequestBodyRuleType)[keyof typeof CreateOrUpdateRuleRequestBodyRuleType]; diff --git a/src/api/types/CustomPlanBillingStatus.ts b/src/api/types/CustomPlanBillingStatus.ts index 815e9abb..f8e29892 100644 --- a/src/api/types/CustomPlanBillingStatus.ts +++ b/src/api/types/CustomPlanBillingStatus.ts @@ -2,6 +2,7 @@ export const CustomPlanBillingStatus = { Active: "active", + Expired: "expired", Paid: "paid", Pending: "pending", } as const; diff --git a/src/api/types/FeatureCompanyResponseData.ts b/src/api/types/FeatureCompanyResponseData.ts index 9443dca6..fa37a460 100644 --- a/src/api/types/FeatureCompanyResponseData.ts +++ b/src/api/types/FeatureCompanyResponseData.ts @@ -35,7 +35,7 @@ export interface FeatureCompanyResponseData { /** Source of the entitlement (plan or company_override) */ entitlementSource?: string; entitlementType: Schematic.EntitlementType; - feature?: Schematic.FeatureDetailResponseData; + feature?: Schematic.FeatureInPlanResponseData; /** Whether a valid allocation exists */ hasValidAllocation?: boolean; /** Whether this is an unlimited allocation */ @@ -43,14 +43,14 @@ export interface FeatureCompanyResponseData { /** The time at which the metric will reset. */ metricResetAt?: Date; /** If the period is current_month, when the month resets. */ - monthReset?: string; + monthReset?: Schematic.MetricPeriodMonthReset; monthlyUsageBasedPrice?: Schematic.BillingPriceView; /** Amount of usage exceeding soft limit (overage pricing only) */ overuse?: number; /** Percentage of allocation consumed (0-100+) */ percentUsed?: number; /** The period over which usage is measured. */ - period?: string; + period?: Schematic.MetricPeriod; plan?: Schematic.PlanResponseData; planEntitlement?: Schematic.PlanEntitlementResponseData; priceBehavior?: Schematic.EntitlementPriceBehavior; diff --git a/src/api/types/FeatureCompanyUserResponseData.ts b/src/api/types/FeatureCompanyUserResponseData.ts index 0b47f3bb..ee2629f9 100644 --- a/src/api/types/FeatureCompanyUserResponseData.ts +++ b/src/api/types/FeatureCompanyUserResponseData.ts @@ -16,9 +16,9 @@ export interface FeatureCompanyUserResponseData { /** The time at which the metric will resets. */ metricResetAt?: Date; /** If the period is current_month, when the month resets. */ - monthReset?: string; + monthReset?: Schematic.MetricPeriodMonthReset; /** The period over which usage is measured. */ - period?: string; + period?: Schematic.MetricPeriod; plan?: Schematic.PlanResponseData; /** The amount of usage that has been consumed; a null value indicates that usage is not being measured. */ usage?: number; diff --git a/src/api/types/FeatureDetailResponseData.ts b/src/api/types/FeatureDetailResponseData.ts index da8d4fd9..06a88634 100644 --- a/src/api/types/FeatureDetailResponseData.ts +++ b/src/api/types/FeatureDetailResponseData.ts @@ -13,7 +13,8 @@ export interface FeatureDetailResponseData { icon: string; id: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; + maintainer?: Schematic.AccountMemberResponseData; + maintainerAccountMemberId?: string; name: string; plans: Schematic.PreviewObject[]; pluralName?: string; diff --git a/src/api/types/FeatureEntitlement.ts b/src/api/types/FeatureEntitlement.ts index c73501a0..9c8f46a4 100644 --- a/src/api/types/FeatureEntitlement.ts +++ b/src/api/types/FeatureEntitlement.ts @@ -20,11 +20,11 @@ export interface FeatureEntitlement { /** The key of the flag associated with the feature */ featureKey: string; /** For event-based feature entitlements, the period over which usage is tracked */ - metricPeriod?: Schematic.FeatureEntitlementMetricPeriod; + metricPeriod?: Schematic.MetricPeriod; /** For event-based feature entitlements, when the usage period will reset */ metricResetAt?: Date; /** For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle */ - monthReset?: Schematic.FeatureEntitlementMonthReset; + monthReset?: Schematic.MetricPeriodMonthReset; /** For usage-based pricing, the soft limit for overage charges or the next tier boundary */ softLimit?: number; /** If the company has a numeric entitlement for this feature, the current usage amount */ diff --git a/src/api/types/FeatureEntitlementMetricPeriod.ts b/src/api/types/FeatureEntitlementMetricPeriod.ts deleted file mode 100644 index f0fd485c..00000000 --- a/src/api/types/FeatureEntitlementMetricPeriod.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** For event-based feature entitlements, the period over which usage is tracked */ -export const FeatureEntitlementMetricPeriod = { - AllTime: "all_time", - CurrentDay: "current_day", - CurrentMonth: "current_month", - CurrentWeek: "current_week", -} as const; -export type FeatureEntitlementMetricPeriod = - (typeof FeatureEntitlementMetricPeriod)[keyof typeof FeatureEntitlementMetricPeriod]; diff --git a/src/api/types/FeatureEntitlementMonthReset.ts b/src/api/types/FeatureEntitlementMonthReset.ts deleted file mode 100644 index afa09858..00000000 --- a/src/api/types/FeatureEntitlementMonthReset.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle */ -export const FeatureEntitlementMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type FeatureEntitlementMonthReset = - (typeof FeatureEntitlementMonthReset)[keyof typeof FeatureEntitlementMonthReset]; diff --git a/src/api/types/FeatureInPlanResponseData.ts b/src/api/types/FeatureInPlanResponseData.ts new file mode 100644 index 00000000..4f530a0d --- /dev/null +++ b/src/api/types/FeatureInPlanResponseData.ts @@ -0,0 +1,24 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface FeatureInPlanResponseData { + billingLinkedResource?: Schematic.BillingLinkedResourceResponseData; + createdAt: Date; + description: string; + eventSubtype?: string; + eventSummary?: Schematic.EventSummaryResponseData; + featureType: Schematic.FeatureType; + flags: Schematic.FlagInPlanResponseData[]; + icon: string; + id: string; + lifecyclePhase?: Schematic.FeatureLifecyclePhase; + maintainerAccountMemberId?: string; + name: string; + plans: Schematic.PreviewObject[]; + pluralName?: string; + singularName?: string; + trait?: Schematic.EntityTraitDefinitionResponseData; + traitId?: string; + updatedAt: Date; +} diff --git a/src/api/types/FeatureResponseData.ts b/src/api/types/FeatureResponseData.ts index a0fe18ad..790a2391 100644 --- a/src/api/types/FeatureResponseData.ts +++ b/src/api/types/FeatureResponseData.ts @@ -10,7 +10,7 @@ export interface FeatureResponseData { icon: string; id: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; pluralName?: string; singularName?: string; diff --git a/src/api/types/FeatureUsageResponseData.ts b/src/api/types/FeatureUsageResponseData.ts index f5de4cf3..2ed15d97 100644 --- a/src/api/types/FeatureUsageResponseData.ts +++ b/src/api/types/FeatureUsageResponseData.ts @@ -33,7 +33,7 @@ export interface FeatureUsageResponseData { /** Source of the entitlement (plan or company_override) */ entitlementSource?: string; entitlementType: Schematic.EntitlementType; - feature?: Schematic.FeatureDetailResponseData; + feature?: Schematic.FeatureInPlanResponseData; /** Whether a valid allocation exists */ hasValidAllocation?: boolean; /** Whether this is an unlimited allocation */ @@ -41,14 +41,14 @@ export interface FeatureUsageResponseData { /** The time at which the metric will reset. */ metricResetAt?: Date; /** If the period is current_month, when the month resets. */ - monthReset?: string; + monthReset?: Schematic.MetricPeriodMonthReset; monthlyUsageBasedPrice?: Schematic.BillingPriceView; /** Amount of usage exceeding soft limit (overage pricing only) */ overuse?: number; /** Percentage of allocation consumed (0-100+) */ percentUsed?: number; /** The period over which usage is measured. */ - period?: string; + period?: Schematic.MetricPeriod; plan?: Schematic.PlanResponseData; planEntitlement?: Schematic.PlanEntitlementResponseData; priceBehavior?: Schematic.EntitlementPriceBehavior; diff --git a/src/api/types/FeatureView.ts b/src/api/types/FeatureView.ts index c894eee6..158a4a02 100644 --- a/src/api/types/FeatureView.ts +++ b/src/api/types/FeatureView.ts @@ -14,7 +14,6 @@ export interface FeatureView { icon: string; id: string; lifecyclePhase?: Schematic.FeatureLifecyclePhase; - maintainerId?: string; name: string; plans: Schematic.PreviewObject[]; pluralName?: string; diff --git a/src/api/types/FlagDetailResponseData.ts b/src/api/types/FlagDetailResponseData.ts index a3d7e7f1..0fb622a0 100644 --- a/src/api/types/FlagDetailResponseData.ts +++ b/src/api/types/FlagDetailResponseData.ts @@ -12,7 +12,8 @@ export interface FlagDetailResponseData { id: string; key: string; lastCheckedAt?: Date; - maintainerId?: string; + maintainer?: Schematic.AccountMemberResponseData; + maintainerAccountMemberId?: string; name: string; rules: Schematic.RuleDetailResponseData[]; updatedAt: Date; diff --git a/src/api/types/FlagInPlanResponseData.ts b/src/api/types/FlagInPlanResponseData.ts new file mode 100644 index 00000000..116bbdc9 --- /dev/null +++ b/src/api/types/FlagInPlanResponseData.ts @@ -0,0 +1,19 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../index"; + +export interface FlagInPlanResponseData { + createdAt: Date; + defaultValue: boolean; + description: string; + feature?: Schematic.FeatureResponseData; + featureId?: string; + flagType: Schematic.FlagType; + id: string; + key: string; + lastCheckedAt?: Date; + maintainerAccountMemberId?: string; + name: string; + rules: Schematic.RuleDetailResponseData[]; + updatedAt: Date; +} diff --git a/src/api/types/FlagResponseData.ts b/src/api/types/FlagResponseData.ts index c7d5c711..e4386136 100644 --- a/src/api/types/FlagResponseData.ts +++ b/src/api/types/FlagResponseData.ts @@ -10,7 +10,7 @@ export interface FlagResponseData { flagType: Schematic.FlagType; id: string; key: string; - maintainerId?: string; + maintainerAccountMemberId?: string; name: string; updatedAt: Date; } diff --git a/src/api/types/FlagView.ts b/src/api/types/FlagView.ts index 6c377910..728779ef 100644 --- a/src/api/types/FlagView.ts +++ b/src/api/types/FlagView.ts @@ -13,7 +13,6 @@ export interface FlagView { id: string; key: string; lastCheckedAt?: Date; - maintainerId?: string; name: string; rules: Schematic.RuleView[]; updatedAt: Date; diff --git a/src/api/types/ConditionMetricPeriod.ts b/src/api/types/MetricPeriod.ts similarity index 58% rename from src/api/types/ConditionMetricPeriod.ts rename to src/api/types/MetricPeriod.ts index d1ca661f..2638eacd 100644 --- a/src/api/types/ConditionMetricPeriod.ts +++ b/src/api/types/MetricPeriod.ts @@ -1,9 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -export const ConditionMetricPeriod = { +export const MetricPeriod = { AllTime: "all_time", CurrentDay: "current_day", CurrentMonth: "current_month", CurrentWeek: "current_week", } as const; -export type ConditionMetricPeriod = (typeof ConditionMetricPeriod)[keyof typeof ConditionMetricPeriod]; +export type MetricPeriod = (typeof MetricPeriod)[keyof typeof MetricPeriod]; diff --git a/src/api/types/MetricPeriodMonthReset.ts b/src/api/types/MetricPeriodMonthReset.ts new file mode 100644 index 00000000..b13bd206 --- /dev/null +++ b/src/api/types/MetricPeriodMonthReset.ts @@ -0,0 +1,7 @@ +// This file was auto-generated by Fern from our API Definition. + +export const MetricPeriodMonthReset = { + BillingCycle: "billing_cycle", + FirstOfMonth: "first_of_month", +} as const; +export type MetricPeriodMonthReset = (typeof MetricPeriodMonthReset)[keyof typeof MetricPeriodMonthReset]; diff --git a/src/api/types/PlanDetailResponseData.ts b/src/api/types/PlanDetailResponseData.ts index 82a5c47d..ee10cd23 100644 --- a/src/api/types/PlanDetailResponseData.ts +++ b/src/api/types/PlanDetailResponseData.ts @@ -11,13 +11,13 @@ export interface PlanDetailResponseData { companyCount: number; companyId?: string; companyName?: string; - controlledBy: string; + controlledBy: Schematic.BillingProviderType; copiedFromPlanId?: string; createdAt: Date; currencyPrices: Schematic.PlanCurrencyPricesResponseData[]; description: string; draftVersion?: Schematic.PlanVersionResponseData; - features: Schematic.FeatureDetailResponseData[]; + features: Schematic.FeatureInPlanResponseData[]; icon: Schematic.PlanIcon; id: string; includedCreditGrants?: Schematic.BillingPlanCreditGrantResponseData[]; diff --git a/src/api/types/PlanEntitlementResponseData.ts b/src/api/types/PlanEntitlementResponseData.ts index 6c89158e..7713f542 100644 --- a/src/api/types/PlanEntitlementResponseData.ts +++ b/src/api/types/PlanEntitlementResponseData.ts @@ -14,8 +14,8 @@ export interface PlanEntitlementResponseData { id: string; meteredMonthlyPrice?: Schematic.BillingPriceView; meteredYearlyPrice?: Schematic.BillingPriceView; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; plan?: Schematic.PlanResponseData; planId: string; priceBehavior?: Schematic.EntitlementPriceBehavior; diff --git a/src/api/types/PlanGroupPlanDetailResponseData.ts b/src/api/types/PlanGroupPlanDetailResponseData.ts index 7f2bb68a..c53d5082 100644 --- a/src/api/types/PlanGroupPlanDetailResponseData.ts +++ b/src/api/types/PlanGroupPlanDetailResponseData.ts @@ -12,7 +12,7 @@ export interface PlanGroupPlanDetailResponseData { companyId?: string; companyName?: string; compatiblePlanIds: string[]; - controlledBy: string; + controlledBy: Schematic.BillingProviderType; copiedFromPlanId?: string; createdAt: Date; currencyPrices: Schematic.PlanCurrencyPricesResponseData[]; @@ -20,7 +20,7 @@ export interface PlanGroupPlanDetailResponseData { description: string; draftVersion?: Schematic.PlanVersionResponseData; entitlements: Schematic.PlanEntitlementResponseData[]; - features: Schematic.FeatureDetailResponseData[]; + features: Schematic.FeatureInPlanResponseData[]; icon: Schematic.PlanIcon; id: string; includedCreditGrants?: Schematic.BillingPlanCreditGrantResponseData[]; diff --git a/src/api/types/PlanViewPublicResponseData.ts b/src/api/types/PlanViewPublicResponseData.ts index fcbf8596..5c231370 100644 --- a/src/api/types/PlanViewPublicResponseData.ts +++ b/src/api/types/PlanViewPublicResponseData.ts @@ -12,7 +12,7 @@ export interface PlanViewPublicResponseData { companyId?: string; companyName?: string; compatiblePlanIds: string[]; - controlledBy: string; + controlledBy: Schematic.BillingProviderType; copiedFromPlanId?: string; createdAt: Date; currencyPrices: Schematic.PlanCurrencyPricesResponseData[]; @@ -21,7 +21,7 @@ export interface PlanViewPublicResponseData { description: string; draftVersion?: Schematic.PlanVersionResponseData; entitlements: Schematic.PlanEntitlementResponseData[]; - features: Schematic.FeatureDetailResponseData[]; + features: Schematic.FeatureInPlanResponseData[]; icon: Schematic.PlanIcon; id: string; includedCreditGrants: Schematic.PlanCreditGrantView[]; diff --git a/src/api/types/Rule.ts b/src/api/types/Rule.ts index 3e7ac924..73edfb15 100644 --- a/src/api/types/Rule.ts +++ b/src/api/types/Rule.ts @@ -11,6 +11,6 @@ export interface Rule { id: string; name: string; priority: number; - ruleType: Schematic.RuleRuleType; + ruleType: Schematic.RuleType; value: boolean; } diff --git a/src/api/types/RuleConditionDetailResponseData.ts b/src/api/types/RuleConditionDetailResponseData.ts index 030b2e83..73053ae3 100644 --- a/src/api/types/RuleConditionDetailResponseData.ts +++ b/src/api/types/RuleConditionDetailResponseData.ts @@ -6,16 +6,16 @@ export interface RuleConditionDetailResponseData { comparisonTrait?: Schematic.EntityTraitDefinitionResponseData; comparisonTraitId?: string; conditionGroupId?: string; - conditionType: string; + conditionType: Schematic.ConditionType; createdAt: Date; environmentId: string; eventSubtype?: string; flagId?: string; id: string; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; metricValue?: number; - operator: string; + operator: Schematic.ComparableOperator; resourceIds: string[]; resources: Schematic.PreviewObjectResponseData[]; ruleId: string; diff --git a/src/api/types/RuleConditionResponseData.ts b/src/api/types/RuleConditionResponseData.ts index cac3caa6..ea9b41bc 100644 --- a/src/api/types/RuleConditionResponseData.ts +++ b/src/api/types/RuleConditionResponseData.ts @@ -5,16 +5,16 @@ import type * as Schematic from "../index"; export interface RuleConditionResponseData { comparisonTraitId?: string; conditionGroupId?: string; - conditionType: string; + conditionType: Schematic.ConditionType; createdAt: Date; environmentId: string; eventSubtype?: string; flagId?: string; id: string; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; metricValue?: number; - operator: string; + operator: Schematic.ComparableOperator; resourceIds: string[]; ruleId: string; traitEntityType?: Schematic.EntityType; diff --git a/src/api/types/RuleDetailResponseData.ts b/src/api/types/RuleDetailResponseData.ts index bcb5099b..2723ef99 100644 --- a/src/api/types/RuleDetailResponseData.ts +++ b/src/api/types/RuleDetailResponseData.ts @@ -11,7 +11,7 @@ export interface RuleDetailResponseData { id: string; name: string; priority: number; - ruleType: string; + ruleType: Schematic.RuleType; updatedAt: Date; value: boolean; } diff --git a/src/api/types/RuleResponseData.ts b/src/api/types/RuleResponseData.ts index 6e707fdd..b1c91df7 100644 --- a/src/api/types/RuleResponseData.ts +++ b/src/api/types/RuleResponseData.ts @@ -1,5 +1,7 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Schematic from "../index"; + export interface RuleResponseData { createdAt: Date; environmentId: string; @@ -7,7 +9,7 @@ export interface RuleResponseData { id: string; name: string; priority: number; - ruleType: string; + ruleType: Schematic.RuleType; updatedAt: Date; value: boolean; } diff --git a/src/api/types/RuleRuleType.ts b/src/api/types/RuleType.ts similarity index 78% rename from src/api/types/RuleRuleType.ts rename to src/api/types/RuleType.ts index ae8fccf6..99fbdf9c 100644 --- a/src/api/types/RuleRuleType.ts +++ b/src/api/types/RuleType.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -export const RuleRuleType = { - Default: "default", - GlobalOverride: "global_override", +export const RuleType = { CompanyOverride: "company_override", CompanyOverrideUsageExceeded: "company_override_usage_exceeded", + Default: "default", + GlobalOverride: "global_override", PlanEntitlement: "plan_entitlement", PlanEntitlementUsageExceeded: "plan_entitlement_usage_exceeded", Standard: "standard", } as const; -export type RuleRuleType = (typeof RuleRuleType)[keyof typeof RuleRuleType]; +export type RuleType = (typeof RuleType)[keyof typeof RuleType]; diff --git a/src/api/types/RuleView.ts b/src/api/types/RuleView.ts index dbd35078..357befb5 100644 --- a/src/api/types/RuleView.ts +++ b/src/api/types/RuleView.ts @@ -12,7 +12,7 @@ export interface RuleView { id: string; name: string; priority: number; - ruleType: string; + ruleType: Schematic.RuleType; updatedAt: Date; value: boolean; } diff --git a/src/api/types/RulesEngineSchemaVersion.ts b/src/api/types/RulesEngineSchemaVersion.ts index 2a6bbe09..4c1cab90 100644 --- a/src/api/types/RulesEngineSchemaVersion.ts +++ b/src/api/types/RulesEngineSchemaVersion.ts @@ -2,7 +2,7 @@ /** The current schema version hash for rules engine types. The first enum value is always the current version. */ export const RulesEngineSchemaVersion = { - V313Fa646: "v313fa646", + Vf05Bf5Da: "vf05bf5da", PlaceholderForFernCompatibility: "placeholder-for-fern-compatibility", } as const; export type RulesEngineSchemaVersion = (typeof RulesEngineSchemaVersion)[keyof typeof RulesEngineSchemaVersion]; diff --git a/src/api/types/RulesengineCheckFlagResult.ts b/src/api/types/RulesengineCheckFlagResult.ts index 580cb0b4..8099a7d6 100644 --- a/src/api/types/RulesengineCheckFlagResult.ts +++ b/src/api/types/RulesengineCheckFlagResult.ts @@ -9,13 +9,13 @@ export interface RulesengineCheckFlagResult { featureAllocation?: number; featureUsage?: number; featureUsageEvent?: string; - featureUsagePeriod?: Schematic.RulesengineCheckFlagResultFeatureUsagePeriod; + featureUsagePeriod?: Schematic.RulesengineMetricPeriod; featureUsageResetAt?: Date; flagId?: string; flagKey: string; reason: string; ruleId?: string; - ruleType?: Schematic.RulesengineCheckFlagResultRuleType; + ruleType?: Schematic.RulesengineRuleType; userId?: string; value: boolean; } diff --git a/src/api/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts b/src/api/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts deleted file mode 100644 index 48c6b325..00000000 --- a/src/api/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineCheckFlagResultFeatureUsagePeriod = { - AllTime: "all_time", - CurrentDay: "current_day", - CurrentMonth: "current_month", - CurrentWeek: "current_week", -} as const; -export type RulesengineCheckFlagResultFeatureUsagePeriod = - (typeof RulesengineCheckFlagResultFeatureUsagePeriod)[keyof typeof RulesengineCheckFlagResultFeatureUsagePeriod]; diff --git a/src/api/types/RulesengineCheckFlagResultRuleType.ts b/src/api/types/RulesengineCheckFlagResultRuleType.ts deleted file mode 100644 index 364f40e9..00000000 --- a/src/api/types/RulesengineCheckFlagResultRuleType.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineCheckFlagResultRuleType = { - Default: "default", - GlobalOverride: "global_override", - CompanyOverride: "company_override", - CompanyOverrideUsageExceeded: "company_override_usage_exceeded", - PlanEntitlement: "plan_entitlement", - PlanEntitlementUsageExceeded: "plan_entitlement_usage_exceeded", - Standard: "standard", -} as const; -export type RulesengineCheckFlagResultRuleType = - (typeof RulesengineCheckFlagResultRuleType)[keyof typeof RulesengineCheckFlagResultRuleType]; diff --git a/src/api/types/RulesengineCompanyMetric.ts b/src/api/types/RulesengineCompanyMetric.ts index de529a8d..33c11d7c 100644 --- a/src/api/types/RulesengineCompanyMetric.ts +++ b/src/api/types/RulesengineCompanyMetric.ts @@ -8,8 +8,8 @@ export interface RulesengineCompanyMetric { createdAt: Date; environmentId: string; eventSubtype: string; - monthReset: Schematic.RulesengineCompanyMetricMonthReset; - period: Schematic.RulesengineCompanyMetricPeriod; + monthReset: Schematic.RulesengineMetricPeriodMonthReset; + period: Schematic.RulesengineMetricPeriod; validUntil?: Date; value: number; } diff --git a/src/api/types/RulesengineCompanyMetricMonthReset.ts b/src/api/types/RulesengineCompanyMetricMonthReset.ts deleted file mode 100644 index ebfa6c8b..00000000 --- a/src/api/types/RulesengineCompanyMetricMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineCompanyMetricMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type RulesengineCompanyMetricMonthReset = - (typeof RulesengineCompanyMetricMonthReset)[keyof typeof RulesengineCompanyMetricMonthReset]; diff --git a/src/api/types/RulesengineCondition.ts b/src/api/types/RulesengineCondition.ts index c83fe541..0d804e53 100644 --- a/src/api/types/RulesengineCondition.ts +++ b/src/api/types/RulesengineCondition.ts @@ -5,16 +5,16 @@ import type * as Schematic from "../index"; export interface RulesengineCondition { accountId: string; comparisonTraitDefinition?: Schematic.RulesengineTraitDefinition; - conditionType: Schematic.RulesengineConditionConditionType; + conditionType: Schematic.RulesengineConditionType; consumptionRate?: number; creditId?: string; environmentId: string; eventSubtype?: string; id: string; - metricPeriod?: Schematic.RulesengineConditionMetricPeriod; - metricPeriodMonthReset?: Schematic.RulesengineConditionMetricPeriodMonthReset; + metricPeriod?: Schematic.RulesengineMetricPeriod; + metricPeriodMonthReset?: Schematic.RulesengineMetricPeriodMonthReset; metricValue?: number; - operator: Schematic.RulesengineConditionOperator; + operator: Schematic.ComparableOperator; resourceIds: string[]; traitDefinition?: Schematic.RulesengineTraitDefinition; traitValue: string; diff --git a/src/api/types/RulesengineConditionMetricPeriod.ts b/src/api/types/RulesengineConditionMetricPeriod.ts deleted file mode 100644 index 6af7d407..00000000 --- a/src/api/types/RulesengineConditionMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineConditionMetricPeriod = { - AllTime: "all_time", - CurrentDay: "current_day", - CurrentMonth: "current_month", - CurrentWeek: "current_week", -} as const; -export type RulesengineConditionMetricPeriod = - (typeof RulesengineConditionMetricPeriod)[keyof typeof RulesengineConditionMetricPeriod]; diff --git a/src/api/types/RulesengineConditionMetricPeriodMonthReset.ts b/src/api/types/RulesengineConditionMetricPeriodMonthReset.ts deleted file mode 100644 index 94e73b32..00000000 --- a/src/api/types/RulesengineConditionMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineConditionMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type RulesengineConditionMetricPeriodMonthReset = - (typeof RulesengineConditionMetricPeriodMonthReset)[keyof typeof RulesengineConditionMetricPeriodMonthReset]; diff --git a/src/api/types/RulesengineConditionOperator.ts b/src/api/types/RulesengineConditionOperator.ts deleted file mode 100644 index c132e31e..00000000 --- a/src/api/types/RulesengineConditionOperator.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const RulesengineConditionOperator = { - Eq: "eq", - Ne: "ne", - Gt: "gt", - Lt: "lt", - Gte: "gte", - Lte: "lte", - IsEmpty: "is_empty", - NotEmpty: "not_empty", -} as const; -export type RulesengineConditionOperator = - (typeof RulesengineConditionOperator)[keyof typeof RulesengineConditionOperator]; diff --git a/src/api/types/RulesengineConditionConditionType.ts b/src/api/types/RulesengineConditionType.ts similarity index 60% rename from src/api/types/RulesengineConditionConditionType.ts rename to src/api/types/RulesengineConditionType.ts index 94d602cb..f8d736a6 100644 --- a/src/api/types/RulesengineConditionConditionType.ts +++ b/src/api/types/RulesengineConditionType.ts @@ -1,6 +1,6 @@ // This file was auto-generated by Fern from our API Definition. -export const RulesengineConditionConditionType = { +export const RulesengineConditionType = { BasePlan: "base_plan", BillingProduct: "billing_product", Company: "company", @@ -11,5 +11,4 @@ export const RulesengineConditionConditionType = { Trait: "trait", User: "user", } as const; -export type RulesengineConditionConditionType = - (typeof RulesengineConditionConditionType)[keyof typeof RulesengineConditionConditionType]; +export type RulesengineConditionType = (typeof RulesengineConditionType)[keyof typeof RulesengineConditionType]; diff --git a/src/api/types/RulesengineFeatureEntitlement.ts b/src/api/types/RulesengineFeatureEntitlement.ts index 38c71c74..139b6e84 100644 --- a/src/api/types/RulesengineFeatureEntitlement.ts +++ b/src/api/types/RulesengineFeatureEntitlement.ts @@ -20,11 +20,11 @@ export interface RulesengineFeatureEntitlement { /** The key of the flag associated with the feature */ featureKey: string; /** For event-based feature entitlements, the period over which usage is tracked */ - metricPeriod?: Schematic.RulesengineFeatureEntitlementMetricPeriod; + metricPeriod?: Schematic.RulesengineMetricPeriod; /** For event-based feature entitlements, when the usage period will reset */ metricResetAt?: Date; /** For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle */ - monthReset?: Schematic.RulesengineFeatureEntitlementMonthReset; + monthReset?: Schematic.RulesengineMetricPeriodMonthReset; /** For usage-based pricing, the soft limit for overage charges or the next tier boundary */ softLimit?: number; /** If the company has a numeric entitlement for this feature, the current usage amount */ diff --git a/src/api/types/RulesengineFeatureEntitlementMetricPeriod.ts b/src/api/types/RulesengineFeatureEntitlementMetricPeriod.ts deleted file mode 100644 index 712916f9..00000000 --- a/src/api/types/RulesengineFeatureEntitlementMetricPeriod.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** For event-based feature entitlements, the period over which usage is tracked */ -export const RulesengineFeatureEntitlementMetricPeriod = { - AllTime: "all_time", - CurrentDay: "current_day", - CurrentMonth: "current_month", - CurrentWeek: "current_week", -} as const; -export type RulesengineFeatureEntitlementMetricPeriod = - (typeof RulesengineFeatureEntitlementMetricPeriod)[keyof typeof RulesengineFeatureEntitlementMetricPeriod]; diff --git a/src/api/types/RulesengineFeatureEntitlementMonthReset.ts b/src/api/types/RulesengineFeatureEntitlementMonthReset.ts deleted file mode 100644 index 1651c630..00000000 --- a/src/api/types/RulesengineFeatureEntitlementMonthReset.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** For event-based feature entitlements that have a monthly period, whether that monthly reset is based on the calendar month or a billing cycle */ -export const RulesengineFeatureEntitlementMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type RulesengineFeatureEntitlementMonthReset = - (typeof RulesengineFeatureEntitlementMonthReset)[keyof typeof RulesengineFeatureEntitlementMonthReset]; diff --git a/src/api/types/RulesengineCompanyMetricPeriod.ts b/src/api/types/RulesengineMetricPeriod.ts similarity index 52% rename from src/api/types/RulesengineCompanyMetricPeriod.ts rename to src/api/types/RulesengineMetricPeriod.ts index 178ce800..c102c72a 100644 --- a/src/api/types/RulesengineCompanyMetricPeriod.ts +++ b/src/api/types/RulesengineMetricPeriod.ts @@ -1,10 +1,9 @@ // This file was auto-generated by Fern from our API Definition. -export const RulesengineCompanyMetricPeriod = { +export const RulesengineMetricPeriod = { AllTime: "all_time", CurrentDay: "current_day", CurrentMonth: "current_month", CurrentWeek: "current_week", } as const; -export type RulesengineCompanyMetricPeriod = - (typeof RulesengineCompanyMetricPeriod)[keyof typeof RulesengineCompanyMetricPeriod]; +export type RulesengineMetricPeriod = (typeof RulesengineMetricPeriod)[keyof typeof RulesengineMetricPeriod]; diff --git a/src/api/types/RulesengineMetricPeriodMonthReset.ts b/src/api/types/RulesengineMetricPeriodMonthReset.ts new file mode 100644 index 00000000..c7da3c03 --- /dev/null +++ b/src/api/types/RulesengineMetricPeriodMonthReset.ts @@ -0,0 +1,8 @@ +// This file was auto-generated by Fern from our API Definition. + +export const RulesengineMetricPeriodMonthReset = { + BillingCycle: "billing_cycle", + FirstOfMonth: "first_of_month", +} as const; +export type RulesengineMetricPeriodMonthReset = + (typeof RulesengineMetricPeriodMonthReset)[keyof typeof RulesengineMetricPeriodMonthReset]; diff --git a/src/api/types/RulesengineRule.ts b/src/api/types/RulesengineRule.ts index 08d61aec..130179c7 100644 --- a/src/api/types/RulesengineRule.ts +++ b/src/api/types/RulesengineRule.ts @@ -11,6 +11,6 @@ export interface RulesengineRule { id: string; name: string; priority: number; - ruleType: Schematic.RulesengineRuleRuleType; + ruleType: Schematic.RulesengineRuleType; value: boolean; } diff --git a/src/api/types/RulesengineRuleRuleType.ts b/src/api/types/RulesengineRuleType.ts similarity index 71% rename from src/api/types/RulesengineRuleRuleType.ts rename to src/api/types/RulesengineRuleType.ts index 69ec9db5..50512b0c 100644 --- a/src/api/types/RulesengineRuleRuleType.ts +++ b/src/api/types/RulesengineRuleType.ts @@ -1,12 +1,12 @@ // This file was auto-generated by Fern from our API Definition. -export const RulesengineRuleRuleType = { - Default: "default", - GlobalOverride: "global_override", +export const RulesengineRuleType = { CompanyOverride: "company_override", CompanyOverrideUsageExceeded: "company_override_usage_exceeded", + Default: "default", + GlobalOverride: "global_override", PlanEntitlement: "plan_entitlement", PlanEntitlementUsageExceeded: "plan_entitlement_usage_exceeded", Standard: "standard", } as const; -export type RulesengineRuleRuleType = (typeof RulesengineRuleRuleType)[keyof typeof RulesengineRuleRuleType]; +export type RulesengineRuleType = (typeof RulesengineRuleType)[keyof typeof RulesengineRuleType]; diff --git a/src/api/types/UpdateEntitlementReqCommon.ts b/src/api/types/UpdateEntitlementReqCommon.ts index bf5741ff..9e47beae 100644 --- a/src/api/types/UpdateEntitlementReqCommon.ts +++ b/src/api/types/UpdateEntitlementReqCommon.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../index"; export interface UpdateEntitlementReqCommon { creditConsumptionRate?: number; - metricPeriod?: Schematic.UpdateEntitlementReqCommonMetricPeriod; - metricPeriodMonthReset?: Schematic.UpdateEntitlementReqCommonMetricPeriodMonthReset; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; valueBool?: boolean; valueCreditId?: string; valueNumeric?: number; diff --git a/src/api/types/UpdateEntitlementReqCommonMetricPeriod.ts b/src/api/types/UpdateEntitlementReqCommonMetricPeriod.ts deleted file mode 100644 index 56e1aa63..00000000 --- a/src/api/types/UpdateEntitlementReqCommonMetricPeriod.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdateEntitlementReqCommonMetricPeriod = { - AllTime: "all_time", - CurrentMonth: "current_month", - CurrentWeek: "current_week", - CurrentDay: "current_day", -} as const; -export type UpdateEntitlementReqCommonMetricPeriod = - (typeof UpdateEntitlementReqCommonMetricPeriod)[keyof typeof UpdateEntitlementReqCommonMetricPeriod]; diff --git a/src/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts b/src/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts deleted file mode 100644 index c36cd0d9..00000000 --- a/src/api/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -export const UpdateEntitlementReqCommonMetricPeriodMonthReset = { - FirstOfMonth: "first_of_month", - BillingCycle: "billing_cycle", -} as const; -export type UpdateEntitlementReqCommonMetricPeriodMonthReset = - (typeof UpdateEntitlementReqCommonMetricPeriodMonthReset)[keyof typeof UpdateEntitlementReqCommonMetricPeriodMonthReset]; diff --git a/src/api/types/UsageBasedEntitlementResponseData.ts b/src/api/types/UsageBasedEntitlementResponseData.ts index 7e207d58..43861ed1 100644 --- a/src/api/types/UsageBasedEntitlementResponseData.ts +++ b/src/api/types/UsageBasedEntitlementResponseData.ts @@ -7,8 +7,8 @@ export interface UsageBasedEntitlementResponseData { consumptionRate?: number; featureId: string; meteredPrice?: Schematic.BillingPriceView; - metricPeriod?: string; - metricPeriodMonthReset?: string; + metricPeriod?: Schematic.MetricPeriod; + metricPeriodMonthReset?: Schematic.MetricPeriodMonthReset; monthlyUsageBasedPrice?: Schematic.BillingPriceView; priceBehavior?: Schematic.EntitlementPriceBehavior; valueBool?: boolean; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index b2511a60..92fca62f 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -75,6 +75,7 @@ export * from "./CompanyPlanInvalidReason"; export * from "./CompanyPlanWithBillingSubView"; export * from "./CompanyResponseData"; export * from "./CompanySubscriptionResponseData"; +export * from "./ComparableOperator"; export * from "./CompatiblePlans"; export * from "./CompatiblePlansResponseData"; export * from "./ComponentCapabilities"; @@ -87,36 +88,24 @@ export * from "./ComponentResponseData"; export * from "./ComponentSettingsResponseData"; export * from "./ComponentState"; export * from "./Condition"; -export * from "./ConditionConditionType"; export * from "./ConditionGroup"; export * from "./ConditionGroupResponseData"; export * from "./ConditionGroupView"; -export * from "./ConditionMetricPeriod"; -export * from "./ConditionMetricPeriodMonthReset"; -export * from "./ConditionOperator"; export * from "./ConditionResponseData"; +export * from "./ConditionType"; export * from "./ConditionView"; export * from "./CountResponse"; export * from "./CouponRequestBody"; export * from "./CreateBillingPlanCreditGrantRequestBody"; export * from "./CreateBillingPriceTierRequestBody"; export * from "./CreateEntitlementInBundleRequestBody"; -export * from "./CreateEntitlementInBundleRequestBodyMetricPeriod"; -export * from "./CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset"; export * from "./CreateEntitlementReqCommon"; -export * from "./CreateEntitlementReqCommonMetricPeriod"; -export * from "./CreateEntitlementReqCommonMetricPeriodMonthReset"; export * from "./CreateEventRequestBody"; export * from "./CreateFlagRequestBody"; export * from "./CreateOrUpdateConditionGroupRequestBody"; export * from "./CreateOrUpdateConditionRequestBody"; -export * from "./CreateOrUpdateConditionRequestBodyConditionType"; -export * from "./CreateOrUpdateConditionRequestBodyMetricPeriod"; -export * from "./CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset"; -export * from "./CreateOrUpdateConditionRequestBodyOperator"; export * from "./CreateOrUpdateFlagRequestBody"; export * from "./CreateOrUpdateRuleRequestBody"; -export * from "./CreateOrUpdateRuleRequestBodyRuleType"; export * from "./CreatePlanRequestBody"; export * from "./CreatePriceTierRequestBody"; export * from "./CreditAutoTopupAmountType"; @@ -189,8 +178,7 @@ export * from "./FeatureCompanyResponseData"; export * from "./FeatureCompanyUserResponseData"; export * from "./FeatureDetailResponseData"; export * from "./FeatureEntitlement"; -export * from "./FeatureEntitlementMetricPeriod"; -export * from "./FeatureEntitlementMonthReset"; +export * from "./FeatureInPlanResponseData"; export * from "./FeatureLedgerResponseData"; export * from "./FeatureLifecyclePhase"; export * from "./FeatureResponseData"; @@ -201,6 +189,7 @@ export * from "./FeatureUsageResponseData"; export * from "./FeatureUsageTimeSeriesResponseData"; export * from "./FeatureView"; export * from "./FlagDetailResponseData"; +export * from "./FlagInPlanResponseData"; export * from "./FlagResponseData"; export * from "./FlagType"; export * from "./FlagView"; @@ -217,6 +206,8 @@ export * from "./ManagePlanPreviewResponseResponseData"; export * from "./ManagePlanRequest"; export * from "./ManagePlanResponseResponseData"; export * from "./MeterRequestBody"; +export * from "./MetricPeriod"; +export * from "./MetricPeriodMonthReset"; export * from "./OrderedPlansInGroup"; export * from "./PaymentMethodRequestBody"; export * from "./PaymentMethodResponseData"; @@ -272,35 +263,28 @@ export * from "./RuleConditionGroupResponseData"; export * from "./RuleConditionResponseData"; export * from "./RuleDetailResponseData"; export * from "./RuleResponseData"; -export * from "./RuleRuleType"; export * from "./RulesDetailResponseData"; export * from "./RulesEngineSchemaVersion"; export * from "./RulesengineCheckFlagResult"; -export * from "./RulesengineCheckFlagResultFeatureUsagePeriod"; -export * from "./RulesengineCheckFlagResultRuleType"; export * from "./RulesengineCompany"; export * from "./RulesengineCompanyMetric"; -export * from "./RulesengineCompanyMetricMonthReset"; -export * from "./RulesengineCompanyMetricPeriod"; export * from "./RulesengineCondition"; -export * from "./RulesengineConditionConditionType"; export * from "./RulesengineConditionGroup"; -export * from "./RulesengineConditionMetricPeriod"; -export * from "./RulesengineConditionMetricPeriodMonthReset"; -export * from "./RulesengineConditionOperator"; +export * from "./RulesengineConditionType"; export * from "./RulesengineEntitlementValueType"; export * from "./RulesengineEntityType"; export * from "./RulesengineFeatureEntitlement"; -export * from "./RulesengineFeatureEntitlementMetricPeriod"; -export * from "./RulesengineFeatureEntitlementMonthReset"; export * from "./RulesengineFlag"; +export * from "./RulesengineMetricPeriod"; +export * from "./RulesengineMetricPeriodMonthReset"; export * from "./RulesengineRule"; -export * from "./RulesengineRuleRuleType"; +export * from "./RulesengineRuleType"; export * from "./RulesengineSubscription"; export * from "./RulesengineTrait"; export * from "./RulesengineTraitDefinition"; export * from "./RulesengineTraitDefinitionComparableType"; export * from "./RulesengineUser"; +export * from "./RuleType"; export * from "./RuleView"; export * from "./ScheduledCheckoutResponseData"; export * from "./ScheduledCheckoutStatus"; @@ -325,8 +309,6 @@ export * from "./UpdateAddOnRequestBody"; export * from "./UpdateBillingPlanCreditGrantRequestBody"; export * from "./UpdateCreditBundleRequestBody"; export * from "./UpdateEntitlementReqCommon"; -export * from "./UpdateEntitlementReqCommonMetricPeriod"; -export * from "./UpdateEntitlementReqCommonMetricPeriodMonthReset"; export * from "./UpdatePayInAdvanceRequestBody"; export * from "./UpdatePlanRequestBody"; export * from "./UpdatePlanTraitTraitRequestBody"; diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index c6efa5e2..60d55148 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -1,8 +1,8 @@ import { base64Decode, base64Encode } from "../base64"; export interface BasicAuth { - username: string; - password: string; + username?: string; + password?: string; } const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; @@ -12,7 +12,12 @@ export const BasicAuth = { if (basicAuth == null) { return undefined; } - const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); + const username = basicAuth.username ?? ""; + const password = basicAuth.password ?? ""; + if (username === "" && password === "") { + return undefined; + } + const token = base64Encode(`${username}:${password}`); return `Basic ${token}`; }, fromAuthorizationHeader: (header: string): BasicAuth => { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 0858d135..a099cc2f 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -22,6 +22,7 @@ export declare namespace Fetcher { contentType?: string; headers?: Record; queryParameters?: Record; + queryString?: string; body?: unknown; timeoutMs?: number; maxRetries?: number; @@ -56,11 +57,13 @@ export declare namespace Fetcher { export interface TimeoutError { reason: "timeout"; + cause?: unknown; } export interface UnknownError { reason: "unknown"; errorMessage: string; + cause?: unknown; } } @@ -249,7 +252,12 @@ async function getHeaders(args: Fetcher.Args): Promise { } export async function fetcherImpl(args: Fetcher.Args): Promise> { - const url = createRequestUrl(args.url, args.queryParameters); + let url = args.url; + if (args.queryString != null && args.queryString.length > 0) { + url = `${url}?${args.queryString}`; + } else { + url = createRequestUrl(args.url, args.queryParameters); + } const requestBody: BodyInit | undefined = await getRequestBody({ body: args.body, type: args.requestType ?? "other", @@ -338,6 +346,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise = new Map(); + + /** + * Adds a query parameter, serializing it immediately. + * + * By default arrays use "repeat" format (`key=a&key=b`). + * Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters + * to get comma-separated values (`key=a,b,c`). + * + * Null / undefined values are silently skipped. + */ + add(key: string, value: unknown, options?: { style?: "comma" }): this { + if (value === undefined || value === null) { + return this; + } + const serialized = toQueryString( + { [key]: value }, + { arrayFormat: options?.style === "comma" ? "comma" : "repeat" }, + ); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + return this; + } + + /** + * Adds multiple query parameters at once from a record. + * All parameters use the default "repeat" array format. + * Null / undefined values are silently skipped. + */ + addMany(params: Record): this { + if (params != null) { + for (const [key, value] of Object.entries(params)) { + this.add(key, value); + } + } + return this; + } + + /** + * Merges additional query parameters supplied at call-time via + * `requestOptions.queryParams`. Overrides existing keys (last-write-wins). + */ + mergeAdditional(additionalParams?: Record): this { + if (additionalParams != null) { + for (const [key, value] of Object.entries(additionalParams)) { + if (value === undefined || value === null) { + continue; + } + const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" }); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + } + } + return this; + } + + /** + * Returns the assembled query string (without the leading `?`). + * Returns an empty string when no parameters were added. + */ + build(): string { + return [...this.parts.values()].join("&"); + } +} diff --git a/src/core/url/index.ts b/src/core/url/index.ts index 62f9123b..b71fadd3 100644 --- a/src/core/url/index.ts +++ b/src/core/url/index.ts @@ -1,3 +1,4 @@ export { encodePathParam } from "./encodePathParam"; export { join } from "./join"; +export { queryBuilder } from "./QueryStringBuilder"; export { toQueryString } from "./qs"; diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts index 13e89be9..f8b45565 100644 --- a/src/core/url/qs.ts +++ b/src/core/url/qs.ts @@ -1,5 +1,7 @@ +type ArrayFormat = "indices" | "repeat" | "comma"; + interface QueryStringOptions { - arrayFormat?: "indices" | "repeat"; + arrayFormat?: ArrayFormat; encode?: boolean; } @@ -33,18 +35,29 @@ function stringifyObject(obj: Record, prefix = "", options: Req if (value.length === 0) { continue; } - for (let i = 0; i < value.length; i++) { - const item = value[i]; - if (item === undefined) { - continue; + const effectiveFormat = options.arrayFormat; + if (effectiveFormat === "comma") { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + const encodedValues = value + .filter((item) => item !== undefined && item !== null) + .map((item) => encodeValue(item, options.encode)); + if (encodedValues.length > 0) { + parts.push(`${encodedKey}=${encodedValues.join(",")}`); } - if (typeof item === "object" && !Array.isArray(item) && item !== null) { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - parts.push(...stringifyObject(item as Record, arrayKey, options)); - } else { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; - parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } else { + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item === undefined) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item as Record, arrayKey, options)); + } else { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } } } } else if (typeof value === "object" && value !== null) { diff --git a/src/errors/SchematicError.ts b/src/errors/SchematicError.ts index 1e748880..8a47e665 100644 --- a/src/errors/SchematicError.ts +++ b/src/errors/SchematicError.ts @@ -7,17 +7,20 @@ export class SchematicError extends Error { public readonly statusCode?: number; public readonly body?: unknown; public readonly rawResponse?: core.RawResponse; + public readonly cause?: unknown; constructor({ message, statusCode, body, rawResponse, + cause, }: { message?: string; statusCode?: number; body?: unknown; rawResponse?: core.RawResponse; + cause?: unknown; }) { super(buildMessage({ message, statusCode, body })); Object.setPrototypeOf(this, new.target.prototype); @@ -29,6 +32,9 @@ export class SchematicError extends Error { this.statusCode = statusCode; this.body = body; this.rawResponse = rawResponse; + if (cause != null) { + this.cause = cause; + } } } diff --git a/src/errors/SchematicTimeoutError.ts b/src/errors/SchematicTimeoutError.ts index 89f1371c..66707a80 100644 --- a/src/errors/SchematicTimeoutError.ts +++ b/src/errors/SchematicTimeoutError.ts @@ -1,7 +1,9 @@ // This file was auto-generated by Fern from our API Definition. export class SchematicTimeoutError extends Error { - constructor(message: string) { + public readonly cause?: unknown; + + constructor(message: string, opts?: { cause?: unknown }) { super(message); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { @@ -9,5 +11,8 @@ export class SchematicTimeoutError extends Error { } this.name = this.constructor.name; + if (opts?.cause != null) { + this.cause = opts.cause; + } } } diff --git a/src/errors/handleNonStatusCodeError.ts b/src/errors/handleNonStatusCodeError.ts index dd9b99a1..f797ed71 100644 --- a/src/errors/handleNonStatusCodeError.ts +++ b/src/errors/handleNonStatusCodeError.ts @@ -22,11 +22,14 @@ export function handleNonStatusCodeError( rawResponse: rawResponse, }); case "timeout": - throw new errors.SchematicTimeoutError(`Timeout exceeded when calling ${method} ${path}.`); + throw new errors.SchematicTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, { + cause: error.cause, + }); case "unknown": throw new errors.SchematicError({ message: error.errorMessage, rawResponse: rawResponse, + cause: error.cause, }); default: throw new errors.SchematicError({ diff --git a/src/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.ts b/src/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.ts index 3b614fa8..36d6c45b 100644 --- a/src/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.ts +++ b/src/serialization/resources/billing/client/requests/CreateBillingPriceRequestBody.ts @@ -19,6 +19,7 @@ export const CreateBillingPriceRequestBody: core.serialization.Schema< interval: core.serialization.string(), isActive: core.serialization.property("is_active", core.serialization.boolean()), meterId: core.serialization.property("meter_id", core.serialization.string().optional()), + nickname: core.serialization.string().optional(), packageSize: core.serialization.property("package_size", core.serialization.number().optional()), price: core.serialization.number(), priceDecimal: core.serialization.property("price_decimal", core.serialization.string().optional()), @@ -38,6 +39,7 @@ export declare namespace CreateBillingPriceRequestBody { interval: string; is_active: boolean; meter_id?: string | null; + nickname?: string | null; package_size?: number | null; price: number; price_decimal?: string | null; diff --git a/src/serialization/resources/companies/client/requests/CreatePlanTraitRequestBody.ts b/src/serialization/resources/companies/client/requests/CreatePlanTraitRequestBody.ts deleted file mode 100644 index 19d242b9..00000000 --- a/src/serialization/resources/companies/client/requests/CreatePlanTraitRequestBody.ts +++ /dev/null @@ -1,22 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; - -export const CreatePlanTraitRequestBody: core.serialization.Schema< - serializers.CreatePlanTraitRequestBody.Raw, - Schematic.CreatePlanTraitRequestBody -> = core.serialization.object({ - planId: core.serialization.property("plan_id", core.serialization.string()), - traitId: core.serialization.property("trait_id", core.serialization.string()), - traitValue: core.serialization.property("trait_value", core.serialization.string()), -}); - -export declare namespace CreatePlanTraitRequestBody { - export interface Raw { - plan_id: string; - trait_id: string; - trait_value: string; - } -} diff --git a/src/serialization/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts b/src/serialization/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts deleted file mode 100644 index 91f0929e..00000000 --- a/src/serialization/resources/companies/client/requests/UpdatePlanTraitRequestBody.ts +++ /dev/null @@ -1,20 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../../api/index"; -import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; - -export const UpdatePlanTraitRequestBody: core.serialization.Schema< - serializers.UpdatePlanTraitRequestBody.Raw, - Schematic.UpdatePlanTraitRequestBody -> = core.serialization.object({ - planId: core.serialization.property("plan_id", core.serialization.string()), - traitValue: core.serialization.property("trait_value", core.serialization.string()), -}); - -export declare namespace UpdatePlanTraitRequestBody { - export interface Raw { - plan_id: string; - trait_value: string; - } -} diff --git a/src/serialization/resources/companies/client/requests/index.ts b/src/serialization/resources/companies/client/requests/index.ts index d27bbe3b..95e0a192 100644 --- a/src/serialization/resources/companies/client/requests/index.ts +++ b/src/serialization/resources/companies/client/requests/index.ts @@ -1,6 +1,4 @@ export { CreateEntityTraitDefinitionRequestBody } from "./CreateEntityTraitDefinitionRequestBody"; -export { CreatePlanTraitRequestBody } from "./CreatePlanTraitRequestBody"; export { GetOrCreateCompanyMembershipRequestBody } from "./GetOrCreateCompanyMembershipRequestBody"; export { UpdateEntityTraitDefinitionRequestBody } from "./UpdateEntityTraitDefinitionRequestBody"; export { UpdatePlanTraitBulkRequestBody } from "./UpdatePlanTraitBulkRequestBody"; -export { UpdatePlanTraitRequestBody } from "./UpdatePlanTraitRequestBody"; diff --git a/src/serialization/resources/companies/types/CreatePlanTraitResponse.ts b/src/serialization/resources/companies/types/CreatePlanTraitResponse.ts deleted file mode 100644 index 755a12ba..00000000 --- a/src/serialization/resources/companies/types/CreatePlanTraitResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { PlanTraitResponseData } from "../../../types/PlanTraitResponseData"; - -export const CreatePlanTraitResponse: core.serialization.ObjectSchema< - serializers.CreatePlanTraitResponse.Raw, - Schematic.CreatePlanTraitResponse -> = core.serialization.object({ - data: PlanTraitResponseData, - params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), -}); - -export declare namespace CreatePlanTraitResponse { - export interface Raw { - data: PlanTraitResponseData.Raw; - params: Record; - } -} diff --git a/src/serialization/resources/companies/types/UpdatePlanTraitResponse.ts b/src/serialization/resources/companies/types/UpdatePlanTraitResponse.ts deleted file mode 100644 index 2e7d3513..00000000 --- a/src/serialization/resources/companies/types/UpdatePlanTraitResponse.ts +++ /dev/null @@ -1,21 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { PlanTraitResponseData } from "../../../types/PlanTraitResponseData"; - -export const UpdatePlanTraitResponse: core.serialization.ObjectSchema< - serializers.UpdatePlanTraitResponse.Raw, - Schematic.UpdatePlanTraitResponse -> = core.serialization.object({ - data: PlanTraitResponseData, - params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), -}); - -export declare namespace UpdatePlanTraitResponse { - export interface Raw { - data: PlanTraitResponseData.Raw; - params: Record; - } -} diff --git a/src/serialization/resources/companies/types/index.ts b/src/serialization/resources/companies/types/index.ts index a69478e3..57269ee9 100644 --- a/src/serialization/resources/companies/types/index.ts +++ b/src/serialization/resources/companies/types/index.ts @@ -9,13 +9,11 @@ export * from "./CountPlanTraitsResponse"; export * from "./CountUsersParams"; export * from "./CountUsersResponse"; export * from "./CreateCompanyResponse"; -export * from "./CreatePlanTraitResponse"; export * from "./CreateUserResponse"; export * from "./DeleteCompanyByKeysResponse"; export * from "./DeleteCompanyMembershipResponse"; export * from "./DeleteCompanyParams"; export * from "./DeleteCompanyResponse"; -export * from "./DeletePlanTraitResponse"; export * from "./DeleteUserByKeysResponse"; export * from "./DeleteUserResponse"; export * from "./GetActiveCompanySubscriptionParams"; @@ -48,7 +46,6 @@ export * from "./LookupCompanyResponse"; export * from "./LookupUserParams"; export * from "./LookupUserResponse"; export * from "./UpdateEntityTraitDefinitionResponse"; -export * from "./UpdatePlanTraitResponse"; export * from "./UpdatePlanTraitsBulkResponse"; export * from "./UpsertCompanyResponse"; export * from "./UpsertCompanyTraitResponse"; diff --git a/src/serialization/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts b/src/serialization/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts index c0901ecd..611478ae 100644 --- a/src/serialization/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts +++ b/src/serialization/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.ts @@ -9,8 +9,8 @@ import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierReq import { CurrencyPriceRequestBody } from "../../../../types/CurrencyPriceRequestBody"; import { EntitlementPriceBehavior } from "../../../../types/EntitlementPriceBehavior"; import { EntitlementValueType } from "../../../../types/EntitlementValueType"; -import { CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod } from "../../types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod"; -import { CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset } from "../../types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset"; +import { MetricPeriod } from "../../../../types/MetricPeriod"; +import { MetricPeriodMonthReset } from "../../../../types/MetricPeriodMonthReset"; export const CreateBillingLinkedPlanEntitlementRequestBody: core.serialization.Schema< serializers.CreateBillingLinkedPlanEntitlementRequestBody.Raw, @@ -30,14 +30,8 @@ export const CreateBillingLinkedPlanEntitlementRequestBody: core.serialization.S ), externalResourceId: core.serialization.property("external_resource_id", core.serialization.string()), featureId: core.serialization.property("feature_id", core.serialization.string()), - metricPeriod: core.serialization.property( - "metric_period", - CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.optional(), - ), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), monthlyMeteredPriceId: core.serialization.property( "monthly_metered_price_id", core.serialization.string().optional(), @@ -94,8 +88,8 @@ export declare namespace CreateBillingLinkedPlanEntitlementRequestBody { currency_prices?: CurrencyPriceRequestBody.Raw[] | null; external_resource_id: string; feature_id: string; - metric_period?: CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; monthly_metered_price_id?: string | null; monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null; monthly_unit_price?: number | null; diff --git a/src/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts b/src/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts index e2f4f9ac..0fc2fb52 100644 --- a/src/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts +++ b/src/serialization/resources/entitlements/client/requests/CreateCompanyOverrideRequestBody.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../../../../../api/index"; import * as core from "../../../../../core"; import type * as serializers from "../../../../index"; import { EntitlementValueType } from "../../../../types/EntitlementValueType"; -import { CreateCompanyOverrideRequestBodyMetricPeriod } from "../../types/CreateCompanyOverrideRequestBodyMetricPeriod"; -import { CreateCompanyOverrideRequestBodyMetricPeriodMonthReset } from "../../types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset"; +import { MetricPeriod } from "../../../../types/MetricPeriod"; +import { MetricPeriodMonthReset } from "../../../../types/MetricPeriodMonthReset"; export const CreateCompanyOverrideRequestBody: core.serialization.Schema< serializers.CreateCompanyOverrideRequestBody.Raw, @@ -18,11 +18,8 @@ export const CreateCompanyOverrideRequestBody: core.serialization.Schema< ), expirationDate: core.serialization.property("expiration_date", core.serialization.date().optional()), featureId: core.serialization.property("feature_id", core.serialization.string()), - metricPeriod: core.serialization.property("metric_period", CreateCompanyOverrideRequestBodyMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), note: core.serialization.string().optional(), valueBool: core.serialization.property("value_bool", core.serialization.boolean().optional()), valueCreditId: core.serialization.property("value_credit_id", core.serialization.string().optional()), @@ -37,8 +34,8 @@ export declare namespace CreateCompanyOverrideRequestBody { credit_consumption_rate?: number | null; expiration_date?: string | null; feature_id: string; - metric_period?: CreateCompanyOverrideRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; note?: string | null; value_bool?: boolean | null; value_credit_id?: string | null; diff --git a/src/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts b/src/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts index 5b3a5508..50901742 100644 --- a/src/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts +++ b/src/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.ts @@ -8,8 +8,8 @@ import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierReq import { CurrencyPriceRequestBody } from "../../../../types/CurrencyPriceRequestBody"; import { EntitlementPriceBehavior } from "../../../../types/EntitlementPriceBehavior"; import { EntitlementValueType } from "../../../../types/EntitlementValueType"; -import { CreatePlanEntitlementRequestBodyMetricPeriod } from "../../types/CreatePlanEntitlementRequestBodyMetricPeriod"; -import { CreatePlanEntitlementRequestBodyMetricPeriodMonthReset } from "../../types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset"; +import { MetricPeriod } from "../../../../types/MetricPeriod"; +import { MetricPeriodMonthReset } from "../../../../types/MetricPeriodMonthReset"; export const CreatePlanEntitlementRequestBody: core.serialization.Schema< serializers.CreatePlanEntitlementRequestBody.Raw, @@ -27,11 +27,8 @@ export const CreatePlanEntitlementRequestBody: core.serialization.Schema< core.serialization.list(CurrencyPriceRequestBody).optional(), ), featureId: core.serialization.property("feature_id", core.serialization.string()), - metricPeriod: core.serialization.property("metric_period", CreatePlanEntitlementRequestBodyMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), monthlyMeteredPriceId: core.serialization.property( "monthly_metered_price_id", core.serialization.string().optional(), @@ -86,8 +83,8 @@ export declare namespace CreatePlanEntitlementRequestBody { currency?: string | null; currency_prices?: CurrencyPriceRequestBody.Raw[] | null; feature_id: string; - metric_period?: CreatePlanEntitlementRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; monthly_metered_price_id?: string | null; monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null; monthly_unit_price?: number | null; diff --git a/src/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts b/src/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts index 6bbdb270..957107f3 100644 --- a/src/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts +++ b/src/serialization/resources/entitlements/client/requests/UpdateCompanyOverrideRequestBody.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../../../../../api/index"; import * as core from "../../../../../core"; import type * as serializers from "../../../../index"; import { EntitlementValueType } from "../../../../types/EntitlementValueType"; -import { UpdateCompanyOverrideRequestBodyMetricPeriod } from "../../types/UpdateCompanyOverrideRequestBodyMetricPeriod"; -import { UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset } from "../../types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset"; +import { MetricPeriod } from "../../../../types/MetricPeriod"; +import { MetricPeriodMonthReset } from "../../../../types/MetricPeriodMonthReset"; export const UpdateCompanyOverrideRequestBody: core.serialization.Schema< serializers.UpdateCompanyOverrideRequestBody.Raw, @@ -16,11 +16,8 @@ export const UpdateCompanyOverrideRequestBody: core.serialization.Schema< core.serialization.number().optional(), ), expirationDate: core.serialization.property("expiration_date", core.serialization.date().optional()), - metricPeriod: core.serialization.property("metric_period", UpdateCompanyOverrideRequestBodyMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), note: core.serialization.string().optional(), valueBool: core.serialization.property("value_bool", core.serialization.boolean().optional()), valueCreditId: core.serialization.property("value_credit_id", core.serialization.string().optional()), @@ -33,8 +30,8 @@ export declare namespace UpdateCompanyOverrideRequestBody { export interface Raw { credit_consumption_rate?: number | null; expiration_date?: string | null; - metric_period?: UpdateCompanyOverrideRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; note?: string | null; value_bool?: boolean | null; value_credit_id?: string | null; diff --git a/src/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts b/src/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts index c9c32c4c..bc954b85 100644 --- a/src/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts +++ b/src/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.ts @@ -8,8 +8,8 @@ import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierReq import { CurrencyPriceRequestBody } from "../../../../types/CurrencyPriceRequestBody"; import { EntitlementPriceBehavior } from "../../../../types/EntitlementPriceBehavior"; import { EntitlementValueType } from "../../../../types/EntitlementValueType"; -import { UpdatePlanEntitlementRequestBodyMetricPeriod } from "../../types/UpdatePlanEntitlementRequestBodyMetricPeriod"; -import { UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset } from "../../types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset"; +import { MetricPeriod } from "../../../../types/MetricPeriod"; +import { MetricPeriodMonthReset } from "../../../../types/MetricPeriodMonthReset"; export const UpdatePlanEntitlementRequestBody: core.serialization.Schema< serializers.UpdatePlanEntitlementRequestBody.Raw, @@ -26,11 +26,8 @@ export const UpdatePlanEntitlementRequestBody: core.serialization.Schema< "currency_prices", core.serialization.list(CurrencyPriceRequestBody).optional(), ), - metricPeriod: core.serialization.property("metric_period", UpdatePlanEntitlementRequestBodyMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), monthlyMeteredPriceId: core.serialization.property( "monthly_metered_price_id", core.serialization.string().optional(), @@ -82,8 +79,8 @@ export declare namespace UpdatePlanEntitlementRequestBody { credit_consumption_rate?: number | null; currency?: string | null; currency_prices?: CurrencyPriceRequestBody.Raw[] | null; - metric_period?: UpdatePlanEntitlementRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; monthly_metered_price_id?: string | null; monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null; monthly_unit_price?: number | null; diff --git a/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts b/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index c151b96e..00000000 --- a/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod: core.serialization.Schema< - serializers.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod.Raw, - Schematic.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 5b54c5b1..00000000 --- a/src/serialization/resources/entitlements/types/CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset.Raw, - Schematic.CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts b/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts deleted file mode 100644 index 809a7d49..00000000 --- a/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreateCompanyOverrideRequestBodyMetricPeriod: core.serialization.Schema< - serializers.CreateCompanyOverrideRequestBodyMetricPeriod.Raw, - Schematic.CreateCompanyOverrideRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreateCompanyOverrideRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts b/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index d58c4c7a..00000000 --- a/src/serialization/resources/entitlements/types/CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreateCompanyOverrideRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreateCompanyOverrideRequestBodyMetricPeriodMonthReset.Raw, - Schematic.CreateCompanyOverrideRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreateCompanyOverrideRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts b/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index d30e753e..00000000 --- a/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreatePlanEntitlementRequestBodyMetricPeriod: core.serialization.Schema< - serializers.CreatePlanEntitlementRequestBodyMetricPeriod.Raw, - Schematic.CreatePlanEntitlementRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreatePlanEntitlementRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 9fc2b007..00000000 --- a/src/serialization/resources/entitlements/types/CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const CreatePlanEntitlementRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreatePlanEntitlementRequestBodyMetricPeriodMonthReset.Raw, - Schematic.CreatePlanEntitlementRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreatePlanEntitlementRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts b/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts deleted file mode 100644 index 4278025a..00000000 --- a/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const UpdateCompanyOverrideRequestBodyMetricPeriod: core.serialization.Schema< - serializers.UpdateCompanyOverrideRequestBodyMetricPeriod.Raw, - Schematic.UpdateCompanyOverrideRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace UpdateCompanyOverrideRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts b/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index ac9a90d5..00000000 --- a/src/serialization/resources/entitlements/types/UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset.Raw, - Schematic.UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts b/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts deleted file mode 100644 index 6ccf8c5e..00000000 --- a/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const UpdatePlanEntitlementRequestBodyMetricPeriod: core.serialization.Schema< - serializers.UpdatePlanEntitlementRequestBodyMetricPeriod.Raw, - Schematic.UpdatePlanEntitlementRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace UpdatePlanEntitlementRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts b/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 07f278e0..00000000 --- a/src/serialization/resources/entitlements/types/UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../../../api/index"; -import * as core from "../../../../core"; -import type * as serializers from "../../../index"; - -export const UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset.Raw, - Schematic.UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/resources/entitlements/types/index.ts b/src/serialization/resources/entitlements/types/index.ts index 7f55ef95..118d4eaa 100644 --- a/src/serialization/resources/entitlements/types/index.ts +++ b/src/serialization/resources/entitlements/types/index.ts @@ -8,13 +8,7 @@ export * from "./CountFeatureUsersParams"; export * from "./CountFeatureUsersResponse"; export * from "./CountPlanEntitlementsParams"; export * from "./CountPlanEntitlementsResponse"; -export * from "./CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriod"; -export * from "./CreateBillingLinkedPlanEntitlementRequestBodyMetricPeriodMonthReset"; -export * from "./CreateCompanyOverrideRequestBodyMetricPeriod"; -export * from "./CreateCompanyOverrideRequestBodyMetricPeriodMonthReset"; export * from "./CreateCompanyOverrideResponse"; -export * from "./CreatePlanEntitlementRequestBodyMetricPeriod"; -export * from "./CreatePlanEntitlementRequestBodyMetricPeriodMonthReset"; export * from "./CreatePlanEntitlementResponse"; export * from "./DeleteCompanyOverrideResponse"; export * from "./DeletePlanEntitlementResponse"; @@ -35,10 +29,6 @@ export * from "./ListFeatureUsersParams"; export * from "./ListFeatureUsersResponse"; export * from "./ListPlanEntitlementsParams"; export * from "./ListPlanEntitlementsResponse"; -export * from "./UpdateCompanyOverrideRequestBodyMetricPeriod"; -export * from "./UpdateCompanyOverrideRequestBodyMetricPeriodMonthReset"; export * from "./UpdateCompanyOverrideResponse"; -export * from "./UpdatePlanEntitlementRequestBodyMetricPeriod"; -export * from "./UpdatePlanEntitlementRequestBodyMetricPeriodMonthReset"; export * from "./UpdatePlanEntitlementResponse"; export * from "./UpsertPlanEntitlementForBillingProductResponse"; diff --git a/src/serialization/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts b/src/serialization/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts index 3f3a6ff9..c2f561c8 100644 --- a/src/serialization/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts +++ b/src/serialization/resources/features/client/requests/CreateBillingLinkedFeatureRequestBody.ts @@ -20,7 +20,10 @@ export const CreateBillingLinkedFeatureRequestBody: core.serialization.Schema< flag: CreateOrUpdateFlagRequestBody.optional(), icon: core.serialization.string().optional(), lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), singularName: core.serialization.property("singular_name", core.serialization.string().optional()), @@ -37,7 +40,7 @@ export declare namespace CreateBillingLinkedFeatureRequestBody { flag?: CreateOrUpdateFlagRequestBody.Raw | null; icon?: string | null; lifecycle_phase?: FeatureLifecyclePhase.Raw | null; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; plural_name?: string | null; singular_name?: string | null; diff --git a/src/serialization/resources/features/client/requests/CreateFeatureRequestBody.ts b/src/serialization/resources/features/client/requests/CreateFeatureRequestBody.ts index 7fbb2934..ae4dd17f 100644 --- a/src/serialization/resources/features/client/requests/CreateFeatureRequestBody.ts +++ b/src/serialization/resources/features/client/requests/CreateFeatureRequestBody.ts @@ -17,7 +17,10 @@ export const CreateFeatureRequestBody: core.serialization.Schema< flag: CreateOrUpdateFlagRequestBody.optional(), icon: core.serialization.string().optional(), lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), singularName: core.serialization.property("singular_name", core.serialization.string().optional()), @@ -32,7 +35,7 @@ export declare namespace CreateFeatureRequestBody { flag?: CreateOrUpdateFlagRequestBody.Raw | null; icon?: string | null; lifecycle_phase?: FeatureLifecyclePhase.Raw | null; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; plural_name?: string | null; singular_name?: string | null; diff --git a/src/serialization/resources/features/client/requests/UpdateFeatureRequestBody.ts b/src/serialization/resources/features/client/requests/UpdateFeatureRequestBody.ts index cf106376..56d06d6e 100644 --- a/src/serialization/resources/features/client/requests/UpdateFeatureRequestBody.ts +++ b/src/serialization/resources/features/client/requests/UpdateFeatureRequestBody.ts @@ -17,7 +17,10 @@ export const UpdateFeatureRequestBody: core.serialization.Schema< flag: CreateOrUpdateFlagRequestBody.optional(), icon: core.serialization.string().optional(), lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string().optional(), pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), singularName: core.serialization.property("singular_name", core.serialization.string().optional()), @@ -32,7 +35,7 @@ export declare namespace UpdateFeatureRequestBody { flag?: CreateOrUpdateFlagRequestBody.Raw | null; icon?: string | null; lifecycle_phase?: FeatureLifecyclePhase.Raw | null; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name?: string | null; plural_name?: string | null; singular_name?: string | null; diff --git a/src/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts b/src/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts new file mode 100644 index 00000000..ef78001b --- /dev/null +++ b/src/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.ts @@ -0,0 +1,26 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../../api/index"; +import * as core from "../../../../../core"; +import type * as serializers from "../../../../index"; +import { CustomPlanActivationStrategy } from "../../../../types/CustomPlanActivationStrategy"; +import { UpdatePayInAdvanceRequestBody } from "../../../../types/UpdatePayInAdvanceRequestBody"; + +export const RetryCustomPlanBillingRequestBody: core.serialization.Schema< + serializers.RetryCustomPlanBillingRequestBody.Raw, + Schematic.RetryCustomPlanBillingRequestBody +> = core.serialization.object({ + activationStrategy: core.serialization.property("activation_strategy", CustomPlanActivationStrategy.optional()), + customerEmail: core.serialization.property("customer_email", core.serialization.string()), + daysUntilDue: core.serialization.property("days_until_due", core.serialization.number().optional()), + payInAdvance: core.serialization.property("pay_in_advance", core.serialization.list(UpdatePayInAdvanceRequestBody)), +}); + +export declare namespace RetryCustomPlanBillingRequestBody { + export interface Raw { + activation_strategy?: CustomPlanActivationStrategy.Raw | null; + customer_email: string; + days_until_due?: number | null; + pay_in_advance: UpdatePayInAdvanceRequestBody.Raw[]; + } +} diff --git a/src/serialization/resources/plans/client/requests/index.ts b/src/serialization/resources/plans/client/requests/index.ts index a65d97b9..7f91c7dc 100644 --- a/src/serialization/resources/plans/client/requests/index.ts +++ b/src/serialization/resources/plans/client/requests/index.ts @@ -1,4 +1,5 @@ export { CreateBillingLinkedPlanRequestBody } from "./CreateBillingLinkedPlanRequestBody"; export { CreateCustomPlanRequestBody } from "./CreateCustomPlanRequestBody"; export { PublishPlanVersionRequestBody } from "./PublishPlanVersionRequestBody"; +export { RetryCustomPlanBillingRequestBody } from "./RetryCustomPlanBillingRequestBody"; export { UpdateCompanyPlansRequestBody } from "./UpdateCompanyPlansRequestBody"; diff --git a/src/serialization/resources/plans/types/CountPlansParams.ts b/src/serialization/resources/plans/types/CountPlansParams.ts index ebbd9294..d211a3d0 100644 --- a/src/serialization/resources/plans/types/CountPlansParams.ts +++ b/src/serialization/resources/plans/types/CountPlansParams.ts @@ -10,6 +10,10 @@ export const CountPlansParams: core.serialization.ObjectSchema< Schematic.CountPlansParams > = core.serialization.object({ companyId: core.serialization.property("company_id", core.serialization.string().optional()), + excludeCompanyScoped: core.serialization.property( + "exclude_company_scoped", + core.serialization.boolean().optional(), + ), forFallbackPlan: core.serialization.property("for_fallback_plan", core.serialization.boolean().optional()), forInitialPlan: core.serialization.property("for_initial_plan", core.serialization.boolean().optional()), forTrialExpiryPlan: core.serialization.property("for_trial_expiry_plan", core.serialization.boolean().optional()), @@ -37,6 +41,7 @@ export const CountPlansParams: core.serialization.ObjectSchema< export declare namespace CountPlansParams { export interface Raw { company_id?: string | null; + exclude_company_scoped?: boolean | null; for_fallback_plan?: boolean | null; for_initial_plan?: boolean | null; for_trial_expiry_plan?: boolean | null; diff --git a/src/serialization/resources/plans/types/ListCustomPlanBillingsParams.ts b/src/serialization/resources/plans/types/ListCustomPlanBillingsParams.ts new file mode 100644 index 00000000..b76b3f8c --- /dev/null +++ b/src/serialization/resources/plans/types/ListCustomPlanBillingsParams.ts @@ -0,0 +1,29 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CustomPlanBillingStatus } from "../../../types/CustomPlanBillingStatus"; + +export const ListCustomPlanBillingsParams: core.serialization.ObjectSchema< + serializers.ListCustomPlanBillingsParams.Raw, + Schematic.ListCustomPlanBillingsParams +> = core.serialization.object({ + companyId: core.serialization.property("company_id", core.serialization.string().optional()), + limit: core.serialization.number().optional(), + offset: core.serialization.number().optional(), + planId: core.serialization.property("plan_id", core.serialization.string().optional()), + status: CustomPlanBillingStatus.optional(), + statuses: core.serialization.list(CustomPlanBillingStatus).optional(), +}); + +export declare namespace ListCustomPlanBillingsParams { + export interface Raw { + company_id?: string | null; + limit?: number | null; + offset?: number | null; + plan_id?: string | null; + status?: CustomPlanBillingStatus.Raw | null; + statuses?: CustomPlanBillingStatus.Raw[] | null; + } +} diff --git a/src/serialization/resources/plans/types/ListCustomPlanBillingsResponse.ts b/src/serialization/resources/plans/types/ListCustomPlanBillingsResponse.ts new file mode 100644 index 00000000..6e0fe9a3 --- /dev/null +++ b/src/serialization/resources/plans/types/ListCustomPlanBillingsResponse.ts @@ -0,0 +1,22 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../../../api/index"; +import * as core from "../../../../core"; +import type * as serializers from "../../../index"; +import { CustomPlanBillingResponseData } from "../../../types/CustomPlanBillingResponseData"; +import { ListCustomPlanBillingsParams } from "./ListCustomPlanBillingsParams"; + +export const ListCustomPlanBillingsResponse: core.serialization.ObjectSchema< + serializers.ListCustomPlanBillingsResponse.Raw, + Schematic.ListCustomPlanBillingsResponse +> = core.serialization.object({ + data: core.serialization.list(CustomPlanBillingResponseData), + params: ListCustomPlanBillingsParams, +}); + +export declare namespace ListCustomPlanBillingsResponse { + export interface Raw { + data: CustomPlanBillingResponseData.Raw[]; + params: ListCustomPlanBillingsParams.Raw; + } +} diff --git a/src/serialization/resources/plans/types/ListPlansParams.ts b/src/serialization/resources/plans/types/ListPlansParams.ts index 6641632c..8aa6607d 100644 --- a/src/serialization/resources/plans/types/ListPlansParams.ts +++ b/src/serialization/resources/plans/types/ListPlansParams.ts @@ -10,6 +10,10 @@ export const ListPlansParams: core.serialization.ObjectSchema< Schematic.ListPlansParams > = core.serialization.object({ companyId: core.serialization.property("company_id", core.serialization.string().optional()), + excludeCompanyScoped: core.serialization.property( + "exclude_company_scoped", + core.serialization.boolean().optional(), + ), forFallbackPlan: core.serialization.property("for_fallback_plan", core.serialization.boolean().optional()), forInitialPlan: core.serialization.property("for_initial_plan", core.serialization.boolean().optional()), forTrialExpiryPlan: core.serialization.property("for_trial_expiry_plan", core.serialization.boolean().optional()), @@ -37,6 +41,7 @@ export const ListPlansParams: core.serialization.ObjectSchema< export declare namespace ListPlansParams { export interface Raw { company_id?: string | null; + exclude_company_scoped?: boolean | null; for_fallback_plan?: boolean | null; for_initial_plan?: boolean | null; for_trial_expiry_plan?: boolean | null; diff --git a/src/serialization/resources/companies/types/DeletePlanTraitResponse.ts b/src/serialization/resources/plans/types/RetryCustomPlanBillingResponse.ts similarity index 50% rename from src/serialization/resources/companies/types/DeletePlanTraitResponse.ts rename to src/serialization/resources/plans/types/RetryCustomPlanBillingResponse.ts index 525663c1..c035899f 100644 --- a/src/serialization/resources/companies/types/DeletePlanTraitResponse.ts +++ b/src/serialization/resources/plans/types/RetryCustomPlanBillingResponse.ts @@ -3,19 +3,19 @@ import type * as Schematic from "../../../../api/index"; import * as core from "../../../../core"; import type * as serializers from "../../../index"; -import { DeleteResponse } from "../../../types/DeleteResponse"; +import { CustomPlanBillingResponseData } from "../../../types/CustomPlanBillingResponseData"; -export const DeletePlanTraitResponse: core.serialization.ObjectSchema< - serializers.DeletePlanTraitResponse.Raw, - Schematic.DeletePlanTraitResponse +export const RetryCustomPlanBillingResponse: core.serialization.ObjectSchema< + serializers.RetryCustomPlanBillingResponse.Raw, + Schematic.RetryCustomPlanBillingResponse > = core.serialization.object({ - data: DeleteResponse, + data: CustomPlanBillingResponseData, params: core.serialization.record(core.serialization.string(), core.serialization.unknown()), }); -export declare namespace DeletePlanTraitResponse { +export declare namespace RetryCustomPlanBillingResponse { export interface Raw { - data: DeleteResponse.Raw; + data: CustomPlanBillingResponseData.Raw; params: Record; } } diff --git a/src/serialization/resources/plans/types/index.ts b/src/serialization/resources/plans/types/index.ts index 3c0ca520..9200140f 100644 --- a/src/serialization/resources/plans/types/index.ts +++ b/src/serialization/resources/plans/types/index.ts @@ -11,11 +11,14 @@ export * from "./GetPlanParams"; export * from "./GetPlanResponse"; export * from "./ListBillingProductMatchCompaniesParams"; export * from "./ListBillingProductMatchCompaniesResponse"; +export * from "./ListCustomPlanBillingsParams"; +export * from "./ListCustomPlanBillingsResponse"; export * from "./ListPlanIssuesParams"; export * from "./ListPlanIssuesResponse"; export * from "./ListPlansParams"; export * from "./ListPlansResponse"; export * from "./PublishPlanVersionResponse"; +export * from "./RetryCustomPlanBillingResponse"; export * from "./UpdateCompanyPlansResponse"; export * from "./UpdatePlanResponse"; export * from "./UpsertBillingProductPlanResponse"; diff --git a/src/serialization/types/ApiKeyCreateResponseData.ts b/src/serialization/types/ApiKeyCreateResponseData.ts index 49ce85c7..58faf293 100644 --- a/src/serialization/types/ApiKeyCreateResponseData.ts +++ b/src/serialization/types/ApiKeyCreateResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { ApiKeyScope } from "./ApiKeyScope"; +import { EnvironmentResponseData } from "./EnvironmentResponseData"; export const ApiKeyCreateResponseData: core.serialization.ObjectSchema< serializers.ApiKeyCreateResponseData.Raw, @@ -11,6 +12,7 @@ export const ApiKeyCreateResponseData: core.serialization.ObjectSchema< > = core.serialization.object({ createdAt: core.serialization.property("created_at", core.serialization.date()), description: core.serialization.string().optional(), + environment: EnvironmentResponseData.optional(), environmentId: core.serialization.property("environment_id", core.serialization.string().optional()), id: core.serialization.string(), lastUsedAt: core.serialization.property("last_used_at", core.serialization.date().optional()), @@ -25,6 +27,7 @@ export declare namespace ApiKeyCreateResponseData { export interface Raw { created_at: string; description?: string | null; + environment?: EnvironmentResponseData.Raw | null; environment_id?: string | null; id: string; last_used_at?: string | null; diff --git a/src/serialization/types/ApiKeyResponseData.ts b/src/serialization/types/ApiKeyResponseData.ts index a6b9d2e2..fcba5e77 100644 --- a/src/serialization/types/ApiKeyResponseData.ts +++ b/src/serialization/types/ApiKeyResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { ApiKeyScope } from "./ApiKeyScope"; +import { EnvironmentResponseData } from "./EnvironmentResponseData"; export const ApiKeyResponseData: core.serialization.ObjectSchema< serializers.ApiKeyResponseData.Raw, @@ -11,6 +12,7 @@ export const ApiKeyResponseData: core.serialization.ObjectSchema< > = core.serialization.object({ createdAt: core.serialization.property("created_at", core.serialization.date()), description: core.serialization.string().optional(), + environment: EnvironmentResponseData.optional(), environmentId: core.serialization.property("environment_id", core.serialization.string().optional()), id: core.serialization.string(), lastUsedAt: core.serialization.property("last_used_at", core.serialization.date().optional()), @@ -24,6 +26,7 @@ export declare namespace ApiKeyResponseData { export interface Raw { created_at: string; description?: string | null; + environment?: EnvironmentResponseData.Raw | null; environment_id?: string | null; id: string; last_used_at?: string | null; diff --git a/src/serialization/types/AuditLogListResponseData.ts b/src/serialization/types/AuditLogListResponseData.ts index b82d94f7..f9615856 100644 --- a/src/serialization/types/AuditLogListResponseData.ts +++ b/src/serialization/types/AuditLogListResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { ActorType } from "./ActorType"; +import { EnvironmentResponseData } from "./EnvironmentResponseData"; export const AuditLogListResponseData: core.serialization.ObjectSchema< serializers.AuditLogListResponseData.Raw, @@ -12,6 +13,7 @@ export const AuditLogListResponseData: core.serialization.ObjectSchema< actorType: core.serialization.property("actor_type", ActorType), apiKeyId: core.serialization.property("api_key_id", core.serialization.string().optional()), endedAt: core.serialization.property("ended_at", core.serialization.date().optional()), + environment: EnvironmentResponseData.optional(), environmentId: core.serialization.property("environment_id", core.serialization.string().optional()), id: core.serialization.string(), method: core.serialization.string(), @@ -31,6 +33,7 @@ export declare namespace AuditLogListResponseData { actor_type: ActorType.Raw; api_key_id?: string | null; ended_at?: string | null; + environment?: EnvironmentResponseData.Raw | null; environment_id?: string | null; id: string; method: string; diff --git a/src/serialization/types/AuditLogResponseData.ts b/src/serialization/types/AuditLogResponseData.ts index 7f771bd7..8ea9d8c6 100644 --- a/src/serialization/types/AuditLogResponseData.ts +++ b/src/serialization/types/AuditLogResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { ActorType } from "./ActorType"; +import { EnvironmentResponseData } from "./EnvironmentResponseData"; export const AuditLogResponseData: core.serialization.ObjectSchema< serializers.AuditLogResponseData.Raw, @@ -12,6 +13,7 @@ export const AuditLogResponseData: core.serialization.ObjectSchema< actorType: core.serialization.property("actor_type", ActorType), apiKeyId: core.serialization.property("api_key_id", core.serialization.string().optional()), endedAt: core.serialization.property("ended_at", core.serialization.date().optional()), + environment: EnvironmentResponseData.optional(), environmentId: core.serialization.property("environment_id", core.serialization.string().optional()), id: core.serialization.string(), method: core.serialization.string(), @@ -34,6 +36,7 @@ export declare namespace AuditLogResponseData { actor_type: ActorType.Raw; api_key_id?: string | null; ended_at?: string | null; + environment?: EnvironmentResponseData.Raw | null; environment_id?: string | null; id: string; method: string; diff --git a/src/serialization/types/BillingPriceResponseData.ts b/src/serialization/types/BillingPriceResponseData.ts index 6d44166c..b3cee0e3 100644 --- a/src/serialization/types/BillingPriceResponseData.ts +++ b/src/serialization/types/BillingPriceResponseData.ts @@ -15,6 +15,7 @@ export const BillingPriceResponseData: core.serialization.ObjectSchema< externalPriceId: core.serialization.property("external_price_id", core.serialization.string()), id: core.serialization.string(), interval: BillingProductPriceInterval, + nickname: core.serialization.string().optional(), price: core.serialization.number(), priceDecimal: core.serialization.property("price_decimal", core.serialization.string().optional()), providerType: core.serialization.property("provider_type", BillingProviderType), @@ -27,6 +28,7 @@ export declare namespace BillingPriceResponseData { external_price_id: string; id: string; interval: BillingProductPriceInterval.Raw; + nickname?: string | null; price: number; price_decimal?: string | null; provider_type: BillingProviderType.Raw; diff --git a/src/serialization/types/BillingPriceView.ts b/src/serialization/types/BillingPriceView.ts index 53e6330f..50068c4e 100644 --- a/src/serialization/types/BillingPriceView.ts +++ b/src/serialization/types/BillingPriceView.ts @@ -26,6 +26,7 @@ export const BillingPriceView: core.serialization.ObjectSchema< core.serialization.string().optional(), ), meterId: core.serialization.property("meter_id", core.serialization.string().optional()), + nickname: core.serialization.string().optional(), packageSize: core.serialization.property("package_size", core.serialization.number()), price: core.serialization.number(), priceDecimal: core.serialization.property("price_decimal", core.serialization.string().optional()), @@ -52,6 +53,7 @@ export declare namespace BillingPriceView { meter_event_name?: string | null; meter_event_payload_key?: string | null; meter_id?: string | null; + nickname?: string | null; package_size: number; price: number; price_decimal?: string | null; diff --git a/src/serialization/types/BillingProductPriceResponseData.ts b/src/serialization/types/BillingProductPriceResponseData.ts index 37f43758..637e885c 100644 --- a/src/serialization/types/BillingProductPriceResponseData.ts +++ b/src/serialization/types/BillingProductPriceResponseData.ts @@ -20,6 +20,7 @@ export const BillingProductPriceResponseData: core.serialization.ObjectSchema< interval: BillingProductPriceInterval, isActive: core.serialization.property("is_active", core.serialization.boolean()), meterId: core.serialization.property("meter_id", core.serialization.string().optional()), + nickname: core.serialization.string().optional(), packageSize: core.serialization.property("package_size", core.serialization.number()), price: core.serialization.number(), priceDecimal: core.serialization.property("price_decimal", core.serialization.string().optional()), @@ -40,6 +41,7 @@ export declare namespace BillingProductPriceResponseData { interval: BillingProductPriceInterval.Raw; is_active: boolean; meter_id?: string | null; + nickname?: string | null; package_size: number; price: number; price_decimal?: string | null; diff --git a/src/serialization/types/CheckFlagResponseData.ts b/src/serialization/types/CheckFlagResponseData.ts index 94b6e6d4..a62d7cc6 100644 --- a/src/serialization/types/CheckFlagResponseData.ts +++ b/src/serialization/types/CheckFlagResponseData.ts @@ -4,6 +4,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { FeatureEntitlement } from "./FeatureEntitlement"; +import { MetricPeriod } from "./MetricPeriod"; +import { RuleType } from "./RuleType"; export const CheckFlagResponseData: core.serialization.ObjectSchema< serializers.CheckFlagResponseData.Raw, @@ -15,13 +17,13 @@ export const CheckFlagResponseData: core.serialization.ObjectSchema< featureAllocation: core.serialization.property("feature_allocation", core.serialization.number().optional()), featureUsage: core.serialization.property("feature_usage", core.serialization.number().optional()), featureUsageEvent: core.serialization.property("feature_usage_event", core.serialization.string().optional()), - featureUsagePeriod: core.serialization.property("feature_usage_period", core.serialization.string().optional()), + featureUsagePeriod: core.serialization.property("feature_usage_period", MetricPeriod.optional()), featureUsageResetAt: core.serialization.property("feature_usage_reset_at", core.serialization.date().optional()), flag: core.serialization.string(), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), reason: core.serialization.string(), ruleId: core.serialization.property("rule_id", core.serialization.string().optional()), - ruleType: core.serialization.property("rule_type", core.serialization.string().optional()), + ruleType: core.serialization.property("rule_type", RuleType.optional()), userId: core.serialization.property("user_id", core.serialization.string().optional()), value: core.serialization.boolean(), }); @@ -34,13 +36,13 @@ export declare namespace CheckFlagResponseData { feature_allocation?: number | null; feature_usage?: number | null; feature_usage_event?: string | null; - feature_usage_period?: string | null; + feature_usage_period?: MetricPeriod.Raw | null; feature_usage_reset_at?: string | null; flag: string; flag_id?: string | null; reason: string; rule_id?: string | null; - rule_type?: string | null; + rule_type?: RuleType.Raw | null; user_id?: string | null; value: boolean; } diff --git a/src/serialization/types/CompanyEventPeriodMetricsResponseData.ts b/src/serialization/types/CompanyEventPeriodMetricsResponseData.ts index dbbbac43..a8466d13 100644 --- a/src/serialization/types/CompanyEventPeriodMetricsResponseData.ts +++ b/src/serialization/types/CompanyEventPeriodMetricsResponseData.ts @@ -3,6 +3,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const CompanyEventPeriodMetricsResponseData: core.serialization.ObjectSchema< serializers.CompanyEventPeriodMetricsResponseData.Raw, @@ -15,8 +17,8 @@ export const CompanyEventPeriodMetricsResponseData: core.serialization.ObjectSch createdAt: core.serialization.property("created_at", core.serialization.date()), environmentId: core.serialization.property("environment_id", core.serialization.string()), eventSubtype: core.serialization.property("event_subtype", core.serialization.string()), - monthReset: core.serialization.property("month_reset", core.serialization.string()), - period: core.serialization.string(), + monthReset: core.serialization.property("month_reset", MetricPeriodMonthReset), + period: MetricPeriod, validUntil: core.serialization.property("valid_until", core.serialization.date().optional()), value: core.serialization.number(), }); @@ -30,8 +32,8 @@ export declare namespace CompanyEventPeriodMetricsResponseData { created_at: string; environment_id: string; event_subtype: string; - month_reset: string; - period: string; + month_reset: MetricPeriodMonthReset.Raw; + period: MetricPeriod.Raw; valid_until?: string | null; value: number; } diff --git a/src/serialization/types/CompanyOverrideResponseData.ts b/src/serialization/types/CompanyOverrideResponseData.ts index 7bcd8d88..bdc4c395 100644 --- a/src/serialization/types/CompanyOverrideResponseData.ts +++ b/src/serialization/types/CompanyOverrideResponseData.ts @@ -8,6 +8,8 @@ import { CompanyOverrideNoteResponseData } from "./CompanyOverrideNoteResponseDa import { EntitlementValueType } from "./EntitlementValueType"; import { EntityTraitDefinitionResponseData } from "./EntityTraitDefinitionResponseData"; import { FeatureResponseData } from "./FeatureResponseData"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const CompanyOverrideResponseData: core.serialization.ObjectSchema< serializers.CompanyOverrideResponseData.Raw, @@ -22,11 +24,8 @@ export const CompanyOverrideResponseData: core.serialization.ObjectSchema< feature: FeatureResponseData.optional(), featureId: core.serialization.property("feature_id", core.serialization.string()), id: core.serialization.string(), - metricPeriod: core.serialization.property("metric_period", core.serialization.string().optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - core.serialization.string().optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), notes: core.serialization.list(CompanyOverrideNoteResponseData), ruleId: core.serialization.property("rule_id", core.serialization.string().optional()), ruleIdUsageExceeded: core.serialization.property("rule_id_usage_exceeded", core.serialization.string().optional()), @@ -49,8 +48,8 @@ export declare namespace CompanyOverrideResponseData { feature?: FeatureResponseData.Raw | null; feature_id: string; id: string; - metric_period?: string | null; - metric_period_month_reset?: string | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; notes: CompanyOverrideNoteResponseData.Raw[]; rule_id?: string | null; rule_id_usage_exceeded?: string | null; diff --git a/src/serialization/types/CompanyPlanDetailResponseData.ts b/src/serialization/types/CompanyPlanDetailResponseData.ts index b735481a..6001f55d 100644 --- a/src/serialization/types/CompanyPlanDetailResponseData.ts +++ b/src/serialization/types/CompanyPlanDetailResponseData.ts @@ -6,10 +6,11 @@ import type * as serializers from "../index"; import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceResponseData"; import { BillingPriceResponseData } from "./BillingPriceResponseData"; import { BillingProductDetailResponseData } from "./BillingProductDetailResponseData"; +import { BillingProviderType } from "./BillingProviderType"; import { ChargeType } from "./ChargeType"; import { CompanyPlanInvalidReason } from "./CompanyPlanInvalidReason"; import { CustomPlanConfig } from "./CustomPlanConfig"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; import { FeatureUsageResponseData } from "./FeatureUsageResponseData"; import { PlanCreditGrantView } from "./PlanCreditGrantView"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; @@ -38,7 +39,7 @@ export const CompanyPlanDetailResponseData: core.serialization.ObjectSchema< "compatible_plan_ids", core.serialization.list(core.serialization.string()), ), - controlledBy: core.serialization.property("controlled_by", core.serialization.string()), + controlledBy: core.serialization.property("controlled_by", BillingProviderType), copiedFromPlanId: core.serialization.property("copied_from_plan_id", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), currencyPrices: core.serialization.property( @@ -51,7 +52,7 @@ export const CompanyPlanDetailResponseData: core.serialization.ObjectSchema< description: core.serialization.string(), draftVersion: core.serialization.property("draft_version", PlanVersionResponseData.optional()), entitlements: core.serialization.list(PlanEntitlementResponseData), - features: core.serialization.list(FeatureDetailResponseData), + features: core.serialization.list(FeatureInPlanResponseData), icon: PlanIcon, id: core.serialization.string(), includedCreditGrants: core.serialization.property( @@ -87,7 +88,7 @@ export declare namespace CompanyPlanDetailResponseData { company_id?: string | null; company_name?: string | null; compatible_plan_ids: string[]; - controlled_by: string; + controlled_by: BillingProviderType.Raw; copied_from_plan_id?: string | null; created_at: string; currency_prices: PlanCurrencyPricesResponseData.Raw[]; @@ -97,7 +98,7 @@ export declare namespace CompanyPlanDetailResponseData { description: string; draft_version?: PlanVersionResponseData.Raw | null; entitlements: PlanEntitlementResponseData.Raw[]; - features: FeatureDetailResponseData.Raw[]; + features: FeatureInPlanResponseData.Raw[]; icon: PlanIcon.Raw; id: string; included_credit_grants: PlanCreditGrantView.Raw[]; diff --git a/src/serialization/types/CompanySubscriptionResponseData.ts b/src/serialization/types/CompanySubscriptionResponseData.ts index 3e816927..6c5b6c4d 100644 --- a/src/serialization/types/CompanySubscriptionResponseData.ts +++ b/src/serialization/types/CompanySubscriptionResponseData.ts @@ -4,6 +4,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { BillingProductForSubscriptionResponseData } from "./BillingProductForSubscriptionResponseData"; +import { BillingProviderType } from "./BillingProviderType"; import { BillingSubscriptionDiscountView } from "./BillingSubscriptionDiscountView"; import { InvoiceResponseData } from "./InvoiceResponseData"; import { PaymentMethodResponseData } from "./PaymentMethodResponseData"; @@ -22,6 +23,7 @@ export const CompanySubscriptionResponseData: core.serialization.ObjectSchema< latestInvoice: core.serialization.property("latest_invoice", InvoiceResponseData.optional()), paymentMethod: core.serialization.property("payment_method", PaymentMethodResponseData.optional()), products: core.serialization.list(BillingProductForSubscriptionResponseData), + providerType: core.serialization.property("provider_type", BillingProviderType), status: core.serialization.string(), subscriptionExternalId: core.serialization.property("subscription_external_id", core.serialization.string()), totalPrice: core.serialization.property("total_price", core.serialization.number()), @@ -40,6 +42,7 @@ export declare namespace CompanySubscriptionResponseData { latest_invoice?: InvoiceResponseData.Raw | null; payment_method?: PaymentMethodResponseData.Raw | null; products: BillingProductForSubscriptionResponseData.Raw[]; + provider_type: BillingProviderType.Raw; status: string; subscription_external_id: string; total_price: number; diff --git a/src/serialization/types/ComparableOperator.ts b/src/serialization/types/ComparableOperator.ts new file mode 100644 index 00000000..993af426 --- /dev/null +++ b/src/serialization/types/ComparableOperator.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const ComparableOperator: core.serialization.Schema< + serializers.ComparableOperator.Raw, + Schematic.ComparableOperator +> = core.serialization.enum_(["eq", "gt", "gte", "is_empty", "lt", "lte", "not_empty", "ne"]); + +export declare namespace ComparableOperator { + export type Raw = "eq" | "gt" | "gte" | "is_empty" | "lt" | "lte" | "not_empty" | "ne"; +} diff --git a/src/serialization/types/Condition.ts b/src/serialization/types/Condition.ts index cf96a37a..653d6f43 100644 --- a/src/serialization/types/Condition.ts +++ b/src/serialization/types/Condition.ts @@ -3,10 +3,10 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { ConditionConditionType } from "./ConditionConditionType"; -import { ConditionMetricPeriod } from "./ConditionMetricPeriod"; -import { ConditionMetricPeriodMonthReset } from "./ConditionMetricPeriodMonthReset"; -import { ConditionOperator } from "./ConditionOperator"; +import { ComparableOperator } from "./ComparableOperator"; +import { ConditionType } from "./ConditionType"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; import { TraitDefinition } from "./TraitDefinition"; export const Condition: core.serialization.ObjectSchema = @@ -16,19 +16,19 @@ export const Condition: core.serialization.ObjectSchema = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace ConditionMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/ConditionOperator.ts b/src/serialization/types/ConditionOperator.ts deleted file mode 100644 index 89498bc7..00000000 --- a/src/serialization/types/ConditionOperator.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const ConditionOperator: core.serialization.Schema< - serializers.ConditionOperator.Raw, - Schematic.ConditionOperator -> = core.serialization.enum_(["eq", "ne", "gt", "lt", "gte", "lte", "is_empty", "not_empty"]); - -export declare namespace ConditionOperator { - export type Raw = "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "is_empty" | "not_empty"; -} diff --git a/src/serialization/types/ConditionResponseData.ts b/src/serialization/types/ConditionResponseData.ts index e4c79833..f06f53a0 100644 --- a/src/serialization/types/ConditionResponseData.ts +++ b/src/serialization/types/ConditionResponseData.ts @@ -3,7 +3,11 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { ComparableOperator } from "./ComparableOperator"; +import { ConditionType } from "./ConditionType"; import { EntityType } from "./EntityType"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const ConditionResponseData: core.serialization.ObjectSchema< serializers.ConditionResponseData.Raw, @@ -12,7 +16,7 @@ export const ConditionResponseData: core.serialization.ObjectSchema< accountId: core.serialization.property("account_id", core.serialization.string()), comparisonTraitId: core.serialization.property("comparison_trait_id", core.serialization.string().optional()), conditionGroupId: core.serialization.property("condition_group_id", core.serialization.string().optional()), - conditionType: core.serialization.property("condition_type", core.serialization.string()), + conditionType: core.serialization.property("condition_type", ConditionType), consumptionRate: core.serialization.property("consumption_rate", core.serialization.number().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), creditId: core.serialization.property("credit_id", core.serialization.string().optional()), @@ -20,13 +24,10 @@ export const ConditionResponseData: core.serialization.ObjectSchema< eventSubtype: core.serialization.property("event_subtype", core.serialization.string().optional()), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), id: core.serialization.string(), - metricPeriod: core.serialization.property("metric_period", core.serialization.string().optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - core.serialization.string().optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), metricValue: core.serialization.property("metric_value", core.serialization.number().optional()), - operator: core.serialization.string(), + operator: ComparableOperator, resourceUnspecifiedIds: core.serialization.property( "resource_unspecified_ids", core.serialization.list(core.serialization.string()), @@ -46,7 +47,7 @@ export declare namespace ConditionResponseData { account_id: string; comparison_trait_id?: string | null; condition_group_id?: string | null; - condition_type: string; + condition_type: ConditionType.Raw; consumption_rate?: number | null; created_at: string; credit_id?: string | null; @@ -54,10 +55,10 @@ export declare namespace ConditionResponseData { event_subtype?: string | null; flag_id?: string | null; id: string; - metric_period?: string | null; - metric_period_month_reset?: string | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; metric_value?: number | null; - operator: string; + operator: ComparableOperator.Raw; resource_unspecified_ids: string[]; rule_id: string; trait_entity_type?: EntityType.Raw | null; diff --git a/src/serialization/types/ConditionType.ts b/src/serialization/types/ConditionType.ts new file mode 100644 index 00000000..724bcaa5 --- /dev/null +++ b/src/serialization/types/ConditionType.ts @@ -0,0 +1,31 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const ConditionType: core.serialization.Schema = + core.serialization.enum_([ + "base_plan", + "billing_product", + "company", + "credit", + "metric", + "plan", + "plan_version", + "trait", + "user", + ]); + +export declare namespace ConditionType { + export type Raw = + | "base_plan" + | "billing_product" + | "company" + | "credit" + | "metric" + | "plan" + | "plan_version" + | "trait" + | "user"; +} diff --git a/src/serialization/types/ConditionView.ts b/src/serialization/types/ConditionView.ts index 8532dfc4..1b2906dc 100644 --- a/src/serialization/types/ConditionView.ts +++ b/src/serialization/types/ConditionView.ts @@ -3,9 +3,13 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { ComparableOperator } from "./ComparableOperator"; +import { ConditionType } from "./ConditionType"; import { EntityTraitDefinitionResponseData } from "./EntityTraitDefinitionResponseData"; import { EntityType } from "./EntityType"; import { GenericPreviewObject } from "./GenericPreviewObject"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const ConditionView: core.serialization.ObjectSchema = core.serialization.object({ @@ -15,7 +19,7 @@ export const ConditionView: core.serialization.ObjectSchema = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreateEntitlementInBundleRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts b/src/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 09370f14..00000000 --- a/src/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.Raw, - Schematic.CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/CreateEntitlementReqCommon.ts b/src/serialization/types/CreateEntitlementReqCommon.ts index aff60fc2..4df971d4 100644 --- a/src/serialization/types/CreateEntitlementReqCommon.ts +++ b/src/serialization/types/CreateEntitlementReqCommon.ts @@ -3,9 +3,9 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { CreateEntitlementReqCommonMetricPeriod } from "./CreateEntitlementReqCommonMetricPeriod"; -import { CreateEntitlementReqCommonMetricPeriodMonthReset } from "./CreateEntitlementReqCommonMetricPeriodMonthReset"; import { EntitlementValueType } from "./EntitlementValueType"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const CreateEntitlementReqCommon: core.serialization.ObjectSchema< serializers.CreateEntitlementReqCommon.Raw, @@ -16,11 +16,8 @@ export const CreateEntitlementReqCommon: core.serialization.ObjectSchema< core.serialization.number().optional(), ), featureId: core.serialization.property("feature_id", core.serialization.string()), - metricPeriod: core.serialization.property("metric_period", CreateEntitlementReqCommonMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - CreateEntitlementReqCommonMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), valueBool: core.serialization.property("value_bool", core.serialization.boolean().optional()), valueCreditId: core.serialization.property("value_credit_id", core.serialization.string().optional()), valueNumeric: core.serialization.property("value_numeric", core.serialization.number().optional()), @@ -32,8 +29,8 @@ export declare namespace CreateEntitlementReqCommon { export interface Raw { credit_consumption_rate?: number | null; feature_id: string; - metric_period?: CreateEntitlementReqCommonMetricPeriod.Raw | null; - metric_period_month_reset?: CreateEntitlementReqCommonMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; value_bool?: boolean | null; value_credit_id?: string | null; value_numeric?: number | null; diff --git a/src/serialization/types/CreateEntitlementReqCommonMetricPeriod.ts b/src/serialization/types/CreateEntitlementReqCommonMetricPeriod.ts deleted file mode 100644 index 64e1f6f3..00000000 --- a/src/serialization/types/CreateEntitlementReqCommonMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateEntitlementReqCommonMetricPeriod: core.serialization.Schema< - serializers.CreateEntitlementReqCommonMetricPeriod.Raw, - Schematic.CreateEntitlementReqCommonMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreateEntitlementReqCommonMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts b/src/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts deleted file mode 100644 index bf24d3df..00000000 --- a/src/serialization/types/CreateEntitlementReqCommonMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateEntitlementReqCommonMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreateEntitlementReqCommonMetricPeriodMonthReset.Raw, - Schematic.CreateEntitlementReqCommonMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreateEntitlementReqCommonMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/CreateFlagRequestBody.ts b/src/serialization/types/CreateFlagRequestBody.ts index 0074fa34..6a3372b9 100644 --- a/src/serialization/types/CreateFlagRequestBody.ts +++ b/src/serialization/types/CreateFlagRequestBody.ts @@ -14,7 +14,10 @@ export const CreateFlagRequestBody: core.serialization.ObjectSchema< featureId: core.serialization.property("feature_id", core.serialization.string().optional()), flagType: core.serialization.property("flag_type", FlagType), key: core.serialization.string(), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), }); @@ -25,7 +28,7 @@ export declare namespace CreateFlagRequestBody { feature_id?: string | null; flag_type: FlagType.Raw; key: string; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; } } diff --git a/src/serialization/types/CreateOrUpdateConditionRequestBody.ts b/src/serialization/types/CreateOrUpdateConditionRequestBody.ts index 3ac2f2d3..325907c4 100644 --- a/src/serialization/types/CreateOrUpdateConditionRequestBody.ts +++ b/src/serialization/types/CreateOrUpdateConditionRequestBody.ts @@ -3,31 +3,25 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { CreateOrUpdateConditionRequestBodyConditionType } from "./CreateOrUpdateConditionRequestBodyConditionType"; -import { CreateOrUpdateConditionRequestBodyMetricPeriod } from "./CreateOrUpdateConditionRequestBodyMetricPeriod"; -import { CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset } from "./CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset"; -import { CreateOrUpdateConditionRequestBodyOperator } from "./CreateOrUpdateConditionRequestBodyOperator"; +import { ComparableOperator } from "./ComparableOperator"; +import { ConditionType } from "./ConditionType"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const CreateOrUpdateConditionRequestBody: core.serialization.ObjectSchema< serializers.CreateOrUpdateConditionRequestBody.Raw, Schematic.CreateOrUpdateConditionRequestBody > = core.serialization.object({ comparisonTraitId: core.serialization.property("comparison_trait_id", core.serialization.string().optional()), - conditionType: core.serialization.property("condition_type", CreateOrUpdateConditionRequestBodyConditionType), + conditionType: core.serialization.property("condition_type", ConditionType), creditCost: core.serialization.property("credit_cost", core.serialization.number().optional()), creditId: core.serialization.property("credit_id", core.serialization.string().optional()), eventSubtype: core.serialization.property("event_subtype", core.serialization.string().optional()), id: core.serialization.string().optional(), - metricPeriod: core.serialization.property( - "metric_period", - CreateOrUpdateConditionRequestBodyMetricPeriod.optional(), - ), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), metricValue: core.serialization.property("metric_value", core.serialization.number().optional()), - operator: CreateOrUpdateConditionRequestBodyOperator, + operator: ComparableOperator, resourceIds: core.serialization.property("resource_ids", core.serialization.list(core.serialization.string())), traitId: core.serialization.property("trait_id", core.serialization.string().optional()), traitValue: core.serialization.property("trait_value", core.serialization.string().optional()), @@ -36,15 +30,15 @@ export const CreateOrUpdateConditionRequestBody: core.serialization.ObjectSchema export declare namespace CreateOrUpdateConditionRequestBody { export interface Raw { comparison_trait_id?: string | null; - condition_type: CreateOrUpdateConditionRequestBodyConditionType.Raw; + condition_type: ConditionType.Raw; credit_cost?: number | null; credit_id?: string | null; event_subtype?: string | null; id?: string | null; - metric_period?: CreateOrUpdateConditionRequestBodyMetricPeriod.Raw | null; - metric_period_month_reset?: CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; metric_value?: number | null; - operator: CreateOrUpdateConditionRequestBodyOperator.Raw; + operator: ComparableOperator.Raw; resource_ids: string[]; trait_id?: string | null; trait_value?: string | null; diff --git a/src/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.ts b/src/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.ts deleted file mode 100644 index fd69f5b3..00000000 --- a/src/serialization/types/CreateOrUpdateConditionRequestBodyConditionType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateOrUpdateConditionRequestBodyConditionType: core.serialization.Schema< - serializers.CreateOrUpdateConditionRequestBodyConditionType.Raw, - Schematic.CreateOrUpdateConditionRequestBodyConditionType -> = core.serialization.enum_(["company", "metric", "trait", "user", "plan", "billing_product", "base_plan"]); - -export declare namespace CreateOrUpdateConditionRequestBodyConditionType { - export type Raw = "company" | "metric" | "trait" | "user" | "plan" | "billing_product" | "base_plan"; -} diff --git a/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts b/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts deleted file mode 100644 index 08c3bf7c..00000000 --- a/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateOrUpdateConditionRequestBodyMetricPeriod: core.serialization.Schema< - serializers.CreateOrUpdateConditionRequestBodyMetricPeriod.Raw, - Schematic.CreateOrUpdateConditionRequestBodyMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace CreateOrUpdateConditionRequestBodyMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts b/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts deleted file mode 100644 index 8be7b423..00000000 --- a/src/serialization/types/CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset: core.serialization.Schema< - serializers.CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset.Raw, - Schematic.CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/CreateOrUpdateConditionRequestBodyOperator.ts b/src/serialization/types/CreateOrUpdateConditionRequestBodyOperator.ts deleted file mode 100644 index d2bd2984..00000000 --- a/src/serialization/types/CreateOrUpdateConditionRequestBodyOperator.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateOrUpdateConditionRequestBodyOperator: core.serialization.Schema< - serializers.CreateOrUpdateConditionRequestBodyOperator.Raw, - Schematic.CreateOrUpdateConditionRequestBodyOperator -> = core.serialization.enum_(["eq", "ne", "gt", "gte", "lt", "lte", "is_empty", "not_empty"]); - -export declare namespace CreateOrUpdateConditionRequestBodyOperator { - export type Raw = "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "is_empty" | "not_empty"; -} diff --git a/src/serialization/types/CreateOrUpdateFlagRequestBody.ts b/src/serialization/types/CreateOrUpdateFlagRequestBody.ts index 2a95b485..af6ed705 100644 --- a/src/serialization/types/CreateOrUpdateFlagRequestBody.ts +++ b/src/serialization/types/CreateOrUpdateFlagRequestBody.ts @@ -15,7 +15,10 @@ export const CreateOrUpdateFlagRequestBody: core.serialization.ObjectSchema< flagType: core.serialization.property("flag_type", FlagType), id: core.serialization.string().optional(), key: core.serialization.string(), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), }); @@ -27,7 +30,7 @@ export declare namespace CreateOrUpdateFlagRequestBody { flag_type: FlagType.Raw; id?: string | null; key: string; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; } } diff --git a/src/serialization/types/CreateOrUpdateRuleRequestBody.ts b/src/serialization/types/CreateOrUpdateRuleRequestBody.ts index 95e9cbf8..1979a2ac 100644 --- a/src/serialization/types/CreateOrUpdateRuleRequestBody.ts +++ b/src/serialization/types/CreateOrUpdateRuleRequestBody.ts @@ -5,7 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { CreateOrUpdateConditionGroupRequestBody } from "./CreateOrUpdateConditionGroupRequestBody"; import { CreateOrUpdateConditionRequestBody } from "./CreateOrUpdateConditionRequestBody"; -import { CreateOrUpdateRuleRequestBodyRuleType } from "./CreateOrUpdateRuleRequestBodyRuleType"; +import { RuleType } from "./RuleType"; export const CreateOrUpdateRuleRequestBody: core.serialization.ObjectSchema< serializers.CreateOrUpdateRuleRequestBody.Raw, @@ -19,7 +19,7 @@ export const CreateOrUpdateRuleRequestBody: core.serialization.ObjectSchema< id: core.serialization.string().optional(), name: core.serialization.string(), priority: core.serialization.number(), - ruleType: core.serialization.property("rule_type", CreateOrUpdateRuleRequestBodyRuleType.optional()), + ruleType: core.serialization.property("rule_type", RuleType.optional()), value: core.serialization.boolean(), }); @@ -30,7 +30,7 @@ export declare namespace CreateOrUpdateRuleRequestBody { id?: string | null; name: string; priority: number; - rule_type?: CreateOrUpdateRuleRequestBodyRuleType.Raw | null; + rule_type?: RuleType.Raw | null; value: boolean; } } diff --git a/src/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.ts b/src/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.ts deleted file mode 100644 index f282d3ba..00000000 --- a/src/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const CreateOrUpdateRuleRequestBodyRuleType: core.serialization.Schema< - serializers.CreateOrUpdateRuleRequestBodyRuleType.Raw, - Schematic.CreateOrUpdateRuleRequestBodyRuleType -> = core.serialization.enum_(["global_override", "company_override", "plan_entitlement", "standard", "default"]); - -export declare namespace CreateOrUpdateRuleRequestBodyRuleType { - export type Raw = "global_override" | "company_override" | "plan_entitlement" | "standard" | "default"; -} diff --git a/src/serialization/types/CustomPlanBillingStatus.ts b/src/serialization/types/CustomPlanBillingStatus.ts index 64076276..916eac90 100644 --- a/src/serialization/types/CustomPlanBillingStatus.ts +++ b/src/serialization/types/CustomPlanBillingStatus.ts @@ -7,8 +7,8 @@ import type * as serializers from "../index"; export const CustomPlanBillingStatus: core.serialization.Schema< serializers.CustomPlanBillingStatus.Raw, Schematic.CustomPlanBillingStatus -> = core.serialization.enum_(["active", "paid", "pending"]); +> = core.serialization.enum_(["active", "expired", "paid", "pending"]); export declare namespace CustomPlanBillingStatus { - export type Raw = "active" | "paid" | "pending"; + export type Raw = "active" | "expired" | "paid" | "pending"; } diff --git a/src/serialization/types/FeatureCompanyResponseData.ts b/src/serialization/types/FeatureCompanyResponseData.ts index 507716f6..b21bd4f6 100644 --- a/src/serialization/types/FeatureCompanyResponseData.ts +++ b/src/serialization/types/FeatureCompanyResponseData.ts @@ -13,7 +13,9 @@ import { CreditUsageAggregation } from "./CreditUsageAggregation"; import { EntitlementPriceBehavior } from "./EntitlementPriceBehavior"; import { EntitlementType } from "./EntitlementType"; import { EntitlementValueType } from "./EntitlementValueType"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; import { PlanResponseData } from "./PlanResponseData"; @@ -54,15 +56,15 @@ export const FeatureCompanyResponseData: core.serialization.ObjectSchema< entitlementId: core.serialization.property("entitlement_id", core.serialization.string()), entitlementSource: core.serialization.property("entitlement_source", core.serialization.string().optional()), entitlementType: core.serialization.property("entitlement_type", EntitlementType), - feature: FeatureDetailResponseData.optional(), + feature: FeatureInPlanResponseData.optional(), hasValidAllocation: core.serialization.property("has_valid_allocation", core.serialization.boolean().optional()), isUnlimited: core.serialization.property("is_unlimited", core.serialization.boolean().optional()), metricResetAt: core.serialization.property("metric_reset_at", core.serialization.date().optional()), - monthReset: core.serialization.property("month_reset", core.serialization.string().optional()), + monthReset: core.serialization.property("month_reset", MetricPeriodMonthReset.optional()), monthlyUsageBasedPrice: core.serialization.property("monthly_usage_based_price", BillingPriceView.optional()), overuse: core.serialization.number().optional(), percentUsed: core.serialization.property("percent_used", core.serialization.number().optional()), - period: core.serialization.string().optional(), + period: MetricPeriod.optional(), plan: PlanResponseData.optional(), planEntitlement: core.serialization.property("plan_entitlement", PlanEntitlementResponseData.optional()), priceBehavior: core.serialization.property("price_behavior", EntitlementPriceBehavior.optional()), @@ -94,15 +96,15 @@ export declare namespace FeatureCompanyResponseData { entitlement_id: string; entitlement_source?: string | null; entitlement_type: EntitlementType.Raw; - feature?: FeatureDetailResponseData.Raw | null; + feature?: FeatureInPlanResponseData.Raw | null; has_valid_allocation?: boolean | null; is_unlimited?: boolean | null; metric_reset_at?: string | null; - month_reset?: string | null; + month_reset?: MetricPeriodMonthReset.Raw | null; monthly_usage_based_price?: BillingPriceView.Raw | null; overuse?: number | null; percent_used?: number | null; - period?: string | null; + period?: MetricPeriod.Raw | null; plan?: PlanResponseData.Raw | null; plan_entitlement?: PlanEntitlementResponseData.Raw | null; price_behavior?: EntitlementPriceBehavior.Raw | null; diff --git a/src/serialization/types/FeatureCompanyUserResponseData.ts b/src/serialization/types/FeatureCompanyUserResponseData.ts index be97d337..832251a4 100644 --- a/src/serialization/types/FeatureCompanyUserResponseData.ts +++ b/src/serialization/types/FeatureCompanyUserResponseData.ts @@ -7,6 +7,8 @@ import { CompanyDetailResponseData } from "./CompanyDetailResponseData"; import { EntitlementType } from "./EntitlementType"; import { EntitlementValueType } from "./EntitlementValueType"; import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; import { PlanResponseData } from "./PlanResponseData"; import { UserResponseData } from "./UserResponseData"; @@ -22,8 +24,8 @@ export const FeatureCompanyUserResponseData: core.serialization.ObjectSchema< entitlementType: core.serialization.property("entitlement_type", EntitlementType), feature: FeatureDetailResponseData.optional(), metricResetAt: core.serialization.property("metric_reset_at", core.serialization.date().optional()), - monthReset: core.serialization.property("month_reset", core.serialization.string().optional()), - period: core.serialization.string().optional(), + monthReset: core.serialization.property("month_reset", MetricPeriodMonthReset.optional()), + period: MetricPeriod.optional(), plan: PlanResponseData.optional(), usage: core.serialization.number().optional(), user: UserResponseData.optional(), @@ -39,8 +41,8 @@ export declare namespace FeatureCompanyUserResponseData { entitlement_type: EntitlementType.Raw; feature?: FeatureDetailResponseData.Raw | null; metric_reset_at?: string | null; - month_reset?: string | null; - period?: string | null; + month_reset?: MetricPeriodMonthReset.Raw | null; + period?: MetricPeriod.Raw | null; plan?: PlanResponseData.Raw | null; usage?: number | null; user?: UserResponseData.Raw | null; diff --git a/src/serialization/types/FeatureDetailResponseData.ts b/src/serialization/types/FeatureDetailResponseData.ts index 8682bc6c..01262489 100644 --- a/src/serialization/types/FeatureDetailResponseData.ts +++ b/src/serialization/types/FeatureDetailResponseData.ts @@ -3,6 +3,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { AccountMemberResponseData } from "./AccountMemberResponseData"; import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceResponseData"; import { EntityTraitDefinitionResponseData } from "./EntityTraitDefinitionResponseData"; import { EventSummaryResponseData } from "./EventSummaryResponseData"; @@ -28,7 +29,11 @@ export const FeatureDetailResponseData: core.serialization.ObjectSchema< icon: core.serialization.string(), id: core.serialization.string(), lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainer: AccountMemberResponseData.optional(), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), plans: core.serialization.list(PreviewObject), pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), @@ -50,7 +55,8 @@ export declare namespace FeatureDetailResponseData { icon: string; id: string; lifecycle_phase?: FeatureLifecyclePhase.Raw | null; - maintainer_id?: string | null; + maintainer?: AccountMemberResponseData.Raw | null; + maintainer_account_member_id?: string | null; name: string; plans: PreviewObject.Raw[]; plural_name?: string | null; diff --git a/src/serialization/types/FeatureEntitlement.ts b/src/serialization/types/FeatureEntitlement.ts index f5ed45d0..419064d6 100644 --- a/src/serialization/types/FeatureEntitlement.ts +++ b/src/serialization/types/FeatureEntitlement.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { EntitlementValueType } from "./EntitlementValueType"; -import { FeatureEntitlementMetricPeriod } from "./FeatureEntitlementMetricPeriod"; -import { FeatureEntitlementMonthReset } from "./FeatureEntitlementMonthReset"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const FeatureEntitlement: core.serialization.ObjectSchema< serializers.FeatureEntitlement.Raw, @@ -19,9 +19,9 @@ export const FeatureEntitlement: core.serialization.ObjectSchema< eventName: core.serialization.property("event_name", core.serialization.string().optional()), featureId: core.serialization.property("feature_id", core.serialization.string()), featureKey: core.serialization.property("feature_key", core.serialization.string()), - metricPeriod: core.serialization.property("metric_period", FeatureEntitlementMetricPeriod.optional()), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), metricResetAt: core.serialization.property("metric_reset_at", core.serialization.date().optional()), - monthReset: core.serialization.property("month_reset", FeatureEntitlementMonthReset.optional()), + monthReset: core.serialization.property("month_reset", MetricPeriodMonthReset.optional()), softLimit: core.serialization.property("soft_limit", core.serialization.number().optional()), usage: core.serialization.number().optional(), valueType: core.serialization.property("value_type", EntitlementValueType), @@ -37,9 +37,9 @@ export declare namespace FeatureEntitlement { event_name?: string | null; feature_id: string; feature_key: string; - metric_period?: FeatureEntitlementMetricPeriod.Raw | null; + metric_period?: MetricPeriod.Raw | null; metric_reset_at?: string | null; - month_reset?: FeatureEntitlementMonthReset.Raw | null; + month_reset?: MetricPeriodMonthReset.Raw | null; soft_limit?: number | null; usage?: number | null; value_type: EntitlementValueType.Raw; diff --git a/src/serialization/types/FeatureEntitlementMetricPeriod.ts b/src/serialization/types/FeatureEntitlementMetricPeriod.ts deleted file mode 100644 index 1ad73096..00000000 --- a/src/serialization/types/FeatureEntitlementMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const FeatureEntitlementMetricPeriod: core.serialization.Schema< - serializers.FeatureEntitlementMetricPeriod.Raw, - Schematic.FeatureEntitlementMetricPeriod -> = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); - -export declare namespace FeatureEntitlementMetricPeriod { - export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; -} diff --git a/src/serialization/types/FeatureEntitlementMonthReset.ts b/src/serialization/types/FeatureEntitlementMonthReset.ts deleted file mode 100644 index 98390c18..00000000 --- a/src/serialization/types/FeatureEntitlementMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const FeatureEntitlementMonthReset: core.serialization.Schema< - serializers.FeatureEntitlementMonthReset.Raw, - Schematic.FeatureEntitlementMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace FeatureEntitlementMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/FeatureInPlanResponseData.ts b/src/serialization/types/FeatureInPlanResponseData.ts new file mode 100644 index 00000000..a13b3fc2 --- /dev/null +++ b/src/serialization/types/FeatureInPlanResponseData.ts @@ -0,0 +1,65 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; +import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceResponseData"; +import { EntityTraitDefinitionResponseData } from "./EntityTraitDefinitionResponseData"; +import { EventSummaryResponseData } from "./EventSummaryResponseData"; +import { FeatureLifecyclePhase } from "./FeatureLifecyclePhase"; +import { FeatureType } from "./FeatureType"; +import { FlagInPlanResponseData } from "./FlagInPlanResponseData"; +import { PreviewObject } from "./PreviewObject"; + +export const FeatureInPlanResponseData: core.serialization.ObjectSchema< + serializers.FeatureInPlanResponseData.Raw, + Schematic.FeatureInPlanResponseData +> = core.serialization.object({ + billingLinkedResource: core.serialization.property( + "billing_linked_resource", + BillingLinkedResourceResponseData.optional(), + ), + createdAt: core.serialization.property("created_at", core.serialization.date()), + description: core.serialization.string(), + eventSubtype: core.serialization.property("event_subtype", core.serialization.string().optional()), + eventSummary: core.serialization.property("event_summary", EventSummaryResponseData.optional()), + featureType: core.serialization.property("feature_type", FeatureType), + flags: core.serialization.list(FlagInPlanResponseData), + icon: core.serialization.string(), + id: core.serialization.string(), + lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), + name: core.serialization.string(), + plans: core.serialization.list(PreviewObject), + pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), + singularName: core.serialization.property("singular_name", core.serialization.string().optional()), + trait: EntityTraitDefinitionResponseData.optional(), + traitId: core.serialization.property("trait_id", core.serialization.string().optional()), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), +}); + +export declare namespace FeatureInPlanResponseData { + export interface Raw { + billing_linked_resource?: BillingLinkedResourceResponseData.Raw | null; + created_at: string; + description: string; + event_subtype?: string | null; + event_summary?: EventSummaryResponseData.Raw | null; + feature_type: FeatureType.Raw; + flags: FlagInPlanResponseData.Raw[]; + icon: string; + id: string; + lifecycle_phase?: FeatureLifecyclePhase.Raw | null; + maintainer_account_member_id?: string | null; + name: string; + plans: PreviewObject.Raw[]; + plural_name?: string | null; + singular_name?: string | null; + trait?: EntityTraitDefinitionResponseData.Raw | null; + trait_id?: string | null; + updated_at: string; + } +} diff --git a/src/serialization/types/FeatureResponseData.ts b/src/serialization/types/FeatureResponseData.ts index aa452064..bbc3eda2 100644 --- a/src/serialization/types/FeatureResponseData.ts +++ b/src/serialization/types/FeatureResponseData.ts @@ -17,7 +17,10 @@ export const FeatureResponseData: core.serialization.ObjectSchema< icon: core.serialization.string(), id: core.serialization.string(), lifecyclePhase: core.serialization.property("lifecycle_phase", FeatureLifecyclePhase.optional()), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), pluralName: core.serialization.property("plural_name", core.serialization.string().optional()), singularName: core.serialization.property("singular_name", core.serialization.string().optional()), @@ -34,7 +37,7 @@ export declare namespace FeatureResponseData { icon: string; id: string; lifecycle_phase?: FeatureLifecyclePhase.Raw | null; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; plural_name?: string | null; singular_name?: string | null; diff --git a/src/serialization/types/FeatureUsageResponseData.ts b/src/serialization/types/FeatureUsageResponseData.ts index a2691107..a9fb1993 100644 --- a/src/serialization/types/FeatureUsageResponseData.ts +++ b/src/serialization/types/FeatureUsageResponseData.ts @@ -11,7 +11,9 @@ import { CreditUsageAggregation } from "./CreditUsageAggregation"; import { EntitlementPriceBehavior } from "./EntitlementPriceBehavior"; import { EntitlementType } from "./EntitlementType"; import { EntitlementValueType } from "./EntitlementValueType"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; import { PlanResponseData } from "./PlanResponseData"; @@ -50,15 +52,15 @@ export const FeatureUsageResponseData: core.serialization.ObjectSchema< entitlementId: core.serialization.property("entitlement_id", core.serialization.string()), entitlementSource: core.serialization.property("entitlement_source", core.serialization.string().optional()), entitlementType: core.serialization.property("entitlement_type", EntitlementType), - feature: FeatureDetailResponseData.optional(), + feature: FeatureInPlanResponseData.optional(), hasValidAllocation: core.serialization.property("has_valid_allocation", core.serialization.boolean().optional()), isUnlimited: core.serialization.property("is_unlimited", core.serialization.boolean().optional()), metricResetAt: core.serialization.property("metric_reset_at", core.serialization.date().optional()), - monthReset: core.serialization.property("month_reset", core.serialization.string().optional()), + monthReset: core.serialization.property("month_reset", MetricPeriodMonthReset.optional()), monthlyUsageBasedPrice: core.serialization.property("monthly_usage_based_price", BillingPriceView.optional()), overuse: core.serialization.number().optional(), percentUsed: core.serialization.property("percent_used", core.serialization.number().optional()), - period: core.serialization.string().optional(), + period: MetricPeriod.optional(), plan: PlanResponseData.optional(), planEntitlement: core.serialization.property("plan_entitlement", PlanEntitlementResponseData.optional()), priceBehavior: core.serialization.property("price_behavior", EntitlementPriceBehavior.optional()), @@ -88,15 +90,15 @@ export declare namespace FeatureUsageResponseData { entitlement_id: string; entitlement_source?: string | null; entitlement_type: EntitlementType.Raw; - feature?: FeatureDetailResponseData.Raw | null; + feature?: FeatureInPlanResponseData.Raw | null; has_valid_allocation?: boolean | null; is_unlimited?: boolean | null; metric_reset_at?: string | null; - month_reset?: string | null; + month_reset?: MetricPeriodMonthReset.Raw | null; monthly_usage_based_price?: BillingPriceView.Raw | null; overuse?: number | null; percent_used?: number | null; - period?: string | null; + period?: MetricPeriod.Raw | null; plan?: PlanResponseData.Raw | null; plan_entitlement?: PlanEntitlementResponseData.Raw | null; price_behavior?: EntitlementPriceBehavior.Raw | null; diff --git a/src/serialization/types/FeatureView.ts b/src/serialization/types/FeatureView.ts index f8c76856..af15394d 100644 --- a/src/serialization/types/FeatureView.ts +++ b/src/serialization/types/FeatureView.ts @@ -27,7 +27,6 @@ export const FeatureView: core.serialization.ObjectSchema = core.serialization.object({ + createdAt: core.serialization.property("created_at", core.serialization.date()), + defaultValue: core.serialization.property("default_value", core.serialization.boolean()), + description: core.serialization.string(), + feature: FeatureResponseData.optional(), + featureId: core.serialization.property("feature_id", core.serialization.string().optional()), + flagType: core.serialization.property("flag_type", FlagType), + id: core.serialization.string(), + key: core.serialization.string(), + lastCheckedAt: core.serialization.property("last_checked_at", core.serialization.date().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), + name: core.serialization.string(), + rules: core.serialization.list(RuleDetailResponseData), + updatedAt: core.serialization.property("updated_at", core.serialization.date()), +}); + +export declare namespace FlagInPlanResponseData { + export interface Raw { + created_at: string; + default_value: boolean; + description: string; + feature?: FeatureResponseData.Raw | null; + feature_id?: string | null; + flag_type: FlagType.Raw; + id: string; + key: string; + last_checked_at?: string | null; + maintainer_account_member_id?: string | null; + name: string; + rules: RuleDetailResponseData.Raw[]; + updated_at: string; + } +} diff --git a/src/serialization/types/FlagResponseData.ts b/src/serialization/types/FlagResponseData.ts index 76f6c618..6148a36b 100644 --- a/src/serialization/types/FlagResponseData.ts +++ b/src/serialization/types/FlagResponseData.ts @@ -16,7 +16,10 @@ export const FlagResponseData: core.serialization.ObjectSchema< flagType: core.serialization.property("flag_type", FlagType), id: core.serialization.string(), key: core.serialization.string(), - maintainerId: core.serialization.property("maintainer_id", core.serialization.string().optional()), + maintainerAccountMemberId: core.serialization.property( + "maintainer_account_member_id", + core.serialization.string().optional(), + ), name: core.serialization.string(), updatedAt: core.serialization.property("updated_at", core.serialization.date()), }); @@ -30,7 +33,7 @@ export declare namespace FlagResponseData { flag_type: FlagType.Raw; id: string; key: string; - maintainer_id?: string | null; + maintainer_account_member_id?: string | null; name: string; updated_at: string; } diff --git a/src/serialization/types/FlagView.ts b/src/serialization/types/FlagView.ts index d9239e71..d7f748c0 100644 --- a/src/serialization/types/FlagView.ts +++ b/src/serialization/types/FlagView.ts @@ -19,7 +19,6 @@ export const FlagView: core.serialization.ObjectSchema = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); +export const MetricPeriod: core.serialization.Schema = + core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); -export declare namespace RulesengineCompanyMetricPeriod { +export declare namespace MetricPeriod { export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; } diff --git a/src/serialization/types/MetricPeriodMonthReset.ts b/src/serialization/types/MetricPeriodMonthReset.ts new file mode 100644 index 00000000..6b795e3f --- /dev/null +++ b/src/serialization/types/MetricPeriodMonthReset.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const MetricPeriodMonthReset: core.serialization.Schema< + serializers.MetricPeriodMonthReset.Raw, + Schematic.MetricPeriodMonthReset +> = core.serialization.enum_(["billing_cycle", "first_of_month"]); + +export declare namespace MetricPeriodMonthReset { + export type Raw = "billing_cycle" | "first_of_month"; +} diff --git a/src/serialization/types/PlanDetailResponseData.ts b/src/serialization/types/PlanDetailResponseData.ts index cb457346..0d55c7a7 100644 --- a/src/serialization/types/PlanDetailResponseData.ts +++ b/src/serialization/types/PlanDetailResponseData.ts @@ -7,8 +7,9 @@ import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceRespon import { BillingPlanCreditGrantResponseData } from "./BillingPlanCreditGrantResponseData"; import { BillingPriceResponseData } from "./BillingPriceResponseData"; import { BillingProductDetailResponseData } from "./BillingProductDetailResponseData"; +import { BillingProviderType } from "./BillingProviderType"; import { ChargeType } from "./ChargeType"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanIcon } from "./PlanIcon"; import { PlanType } from "./PlanType"; @@ -29,7 +30,7 @@ export const PlanDetailResponseData: core.serialization.ObjectSchema< companyCount: core.serialization.property("company_count", core.serialization.number()), companyId: core.serialization.property("company_id", core.serialization.string().optional()), companyName: core.serialization.property("company_name", core.serialization.string().optional()), - controlledBy: core.serialization.property("controlled_by", core.serialization.string()), + controlledBy: core.serialization.property("controlled_by", BillingProviderType), copiedFromPlanId: core.serialization.property("copied_from_plan_id", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), currencyPrices: core.serialization.property( @@ -38,7 +39,7 @@ export const PlanDetailResponseData: core.serialization.ObjectSchema< ), description: core.serialization.string(), draftVersion: core.serialization.property("draft_version", PlanVersionResponseData.optional()), - features: core.serialization.list(FeatureDetailResponseData), + features: core.serialization.list(FeatureInPlanResponseData), icon: PlanIcon, id: core.serialization.string(), includedCreditGrants: core.serialization.property( @@ -68,13 +69,13 @@ export declare namespace PlanDetailResponseData { company_count: number; company_id?: string | null; company_name?: string | null; - controlled_by: string; + controlled_by: BillingProviderType.Raw; copied_from_plan_id?: string | null; created_at: string; currency_prices: PlanCurrencyPricesResponseData.Raw[]; description: string; draft_version?: PlanVersionResponseData.Raw | null; - features: FeatureDetailResponseData.Raw[]; + features: FeatureInPlanResponseData.Raw[]; icon: PlanIcon.Raw; id: string; included_credit_grants?: BillingPlanCreditGrantResponseData.Raw[] | null; diff --git a/src/serialization/types/PlanEntitlementResponseData.ts b/src/serialization/types/PlanEntitlementResponseData.ts index 72d8bfcc..38d59e26 100644 --- a/src/serialization/types/PlanEntitlementResponseData.ts +++ b/src/serialization/types/PlanEntitlementResponseData.ts @@ -12,6 +12,8 @@ import { EntitlementPriceBehavior } from "./EntitlementPriceBehavior"; import { EntitlementValueType } from "./EntitlementValueType"; import { EntityTraitDefinitionResponseData } from "./EntityTraitDefinitionResponseData"; import { FeatureResponseData } from "./FeatureResponseData"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; import { PlanResponseData } from "./PlanResponseData"; export const PlanEntitlementResponseData: core.serialization.ObjectSchema< @@ -35,11 +37,8 @@ export const PlanEntitlementResponseData: core.serialization.ObjectSchema< id: core.serialization.string(), meteredMonthlyPrice: core.serialization.property("metered_monthly_price", BillingPriceView.optional()), meteredYearlyPrice: core.serialization.property("metered_yearly_price", BillingPriceView.optional()), - metricPeriod: core.serialization.property("metric_period", core.serialization.string().optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - core.serialization.string().optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), plan: PlanResponseData.optional(), planId: core.serialization.property("plan_id", core.serialization.string()), priceBehavior: core.serialization.property("price_behavior", EntitlementPriceBehavior.optional()), @@ -69,8 +68,8 @@ export declare namespace PlanEntitlementResponseData { id: string; metered_monthly_price?: BillingPriceView.Raw | null; metered_yearly_price?: BillingPriceView.Raw | null; - metric_period?: string | null; - metric_period_month_reset?: string | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; plan?: PlanResponseData.Raw | null; plan_id: string; price_behavior?: EntitlementPriceBehavior.Raw | null; diff --git a/src/serialization/types/PlanGroupPlanDetailResponseData.ts b/src/serialization/types/PlanGroupPlanDetailResponseData.ts index 52f0ec69..e492b5d8 100644 --- a/src/serialization/types/PlanGroupPlanDetailResponseData.ts +++ b/src/serialization/types/PlanGroupPlanDetailResponseData.ts @@ -7,9 +7,10 @@ import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceRespon import { BillingPlanCreditGrantResponseData } from "./BillingPlanCreditGrantResponseData"; import { BillingPriceResponseData } from "./BillingPriceResponseData"; import { BillingProductDetailResponseData } from "./BillingProductDetailResponseData"; +import { BillingProviderType } from "./BillingProviderType"; import { ChargeType } from "./ChargeType"; import { CustomPlanViewConfigResponseData } from "./CustomPlanViewConfigResponseData"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; import { PlanIcon } from "./PlanIcon"; @@ -35,7 +36,7 @@ export const PlanGroupPlanDetailResponseData: core.serialization.ObjectSchema< "compatible_plan_ids", core.serialization.list(core.serialization.string()), ), - controlledBy: core.serialization.property("controlled_by", core.serialization.string()), + controlledBy: core.serialization.property("controlled_by", BillingProviderType), copiedFromPlanId: core.serialization.property("copied_from_plan_id", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), currencyPrices: core.serialization.property( @@ -46,7 +47,7 @@ export const PlanGroupPlanDetailResponseData: core.serialization.ObjectSchema< description: core.serialization.string(), draftVersion: core.serialization.property("draft_version", PlanVersionResponseData.optional()), entitlements: core.serialization.list(PlanEntitlementResponseData), - features: core.serialization.list(FeatureDetailResponseData), + features: core.serialization.list(FeatureInPlanResponseData), icon: PlanIcon, id: core.serialization.string(), includedCreditGrants: core.serialization.property( @@ -78,7 +79,7 @@ export declare namespace PlanGroupPlanDetailResponseData { company_id?: string | null; company_name?: string | null; compatible_plan_ids: string[]; - controlled_by: string; + controlled_by: BillingProviderType.Raw; copied_from_plan_id?: string | null; created_at: string; currency_prices: PlanCurrencyPricesResponseData.Raw[]; @@ -86,7 +87,7 @@ export declare namespace PlanGroupPlanDetailResponseData { description: string; draft_version?: PlanVersionResponseData.Raw | null; entitlements: PlanEntitlementResponseData.Raw[]; - features: FeatureDetailResponseData.Raw[]; + features: FeatureInPlanResponseData.Raw[]; icon: PlanIcon.Raw; id: string; included_credit_grants?: BillingPlanCreditGrantResponseData.Raw[] | null; diff --git a/src/serialization/types/PlanViewPublicResponseData.ts b/src/serialization/types/PlanViewPublicResponseData.ts index 4bcabbb1..fcf6935e 100644 --- a/src/serialization/types/PlanViewPublicResponseData.ts +++ b/src/serialization/types/PlanViewPublicResponseData.ts @@ -6,9 +6,10 @@ import type * as serializers from "../index"; import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceResponseData"; import { BillingPriceResponseData } from "./BillingPriceResponseData"; import { BillingProductDetailResponseData } from "./BillingProductDetailResponseData"; +import { BillingProviderType } from "./BillingProviderType"; import { ChargeType } from "./ChargeType"; import { CustomPlanConfig } from "./CustomPlanConfig"; -import { FeatureDetailResponseData } from "./FeatureDetailResponseData"; +import { FeatureInPlanResponseData } from "./FeatureInPlanResponseData"; import { PlanCreditGrantView } from "./PlanCreditGrantView"; import { PlanCurrencyPricesResponseData } from "./PlanCurrencyPricesResponseData"; import { PlanEntitlementResponseData } from "./PlanEntitlementResponseData"; @@ -35,7 +36,7 @@ export const PlanViewPublicResponseData: core.serialization.ObjectSchema< "compatible_plan_ids", core.serialization.list(core.serialization.string()), ), - controlledBy: core.serialization.property("controlled_by", core.serialization.string()), + controlledBy: core.serialization.property("controlled_by", BillingProviderType), copiedFromPlanId: core.serialization.property("copied_from_plan_id", core.serialization.string().optional()), createdAt: core.serialization.property("created_at", core.serialization.date()), currencyPrices: core.serialization.property( @@ -47,7 +48,7 @@ export const PlanViewPublicResponseData: core.serialization.ObjectSchema< description: core.serialization.string(), draftVersion: core.serialization.property("draft_version", PlanVersionResponseData.optional()), entitlements: core.serialization.list(PlanEntitlementResponseData), - features: core.serialization.list(FeatureDetailResponseData), + features: core.serialization.list(FeatureInPlanResponseData), icon: PlanIcon, id: core.serialization.string(), includedCreditGrants: core.serialization.property( @@ -79,7 +80,7 @@ export declare namespace PlanViewPublicResponseData { company_id?: string | null; company_name?: string | null; compatible_plan_ids: string[]; - controlled_by: string; + controlled_by: BillingProviderType.Raw; copied_from_plan_id?: string | null; created_at: string; currency_prices: PlanCurrencyPricesResponseData.Raw[]; @@ -88,7 +89,7 @@ export declare namespace PlanViewPublicResponseData { description: string; draft_version?: PlanVersionResponseData.Raw | null; entitlements: PlanEntitlementResponseData.Raw[]; - features: FeatureDetailResponseData.Raw[]; + features: FeatureInPlanResponseData.Raw[]; icon: PlanIcon.Raw; id: string; included_credit_grants: PlanCreditGrantView.Raw[]; diff --git a/src/serialization/types/Rule.ts b/src/serialization/types/Rule.ts index 57a1a23e..922eb88f 100644 --- a/src/serialization/types/Rule.ts +++ b/src/serialization/types/Rule.ts @@ -5,7 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { Condition } from "./Condition"; import { ConditionGroup } from "./ConditionGroup"; -import { RuleRuleType } from "./RuleRuleType"; +import { RuleType } from "./RuleType"; export const Rule: core.serialization.ObjectSchema = core.serialization.object({ accountId: core.serialization.property("account_id", core.serialization.string()), @@ -16,7 +16,7 @@ export const Rule: core.serialization.ObjectSchema = core.serialization.object({ comparisonTraitId: core.serialization.property("comparison_trait_id", core.serialization.string().optional()), conditionGroupId: core.serialization.property("condition_group_id", core.serialization.string().optional()), - conditionType: core.serialization.property("condition_type", core.serialization.string()), + conditionType: core.serialization.property("condition_type", ConditionType), createdAt: core.serialization.property("created_at", core.serialization.date()), environmentId: core.serialization.property("environment_id", core.serialization.string()), eventSubtype: core.serialization.property("event_subtype", core.serialization.string().optional()), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), id: core.serialization.string(), - metricPeriod: core.serialization.property("metric_period", core.serialization.string().optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - core.serialization.string().optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), metricValue: core.serialization.property("metric_value", core.serialization.number().optional()), - operator: core.serialization.string(), + operator: ComparableOperator, resourceIds: core.serialization.property("resource_ids", core.serialization.list(core.serialization.string())), ruleId: core.serialization.property("rule_id", core.serialization.string()), traitEntityType: core.serialization.property("trait_entity_type", EntityType.optional()), @@ -36,16 +37,16 @@ export declare namespace RuleConditionResponseData { export interface Raw { comparison_trait_id?: string | null; condition_group_id?: string | null; - condition_type: string; + condition_type: ConditionType.Raw; created_at: string; environment_id: string; event_subtype?: string | null; flag_id?: string | null; id: string; - metric_period?: string | null; - metric_period_month_reset?: string | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; metric_value?: number | null; - operator: string; + operator: ComparableOperator.Raw; resource_ids: string[]; rule_id: string; trait_entity_type?: EntityType.Raw | null; diff --git a/src/serialization/types/RuleDetailResponseData.ts b/src/serialization/types/RuleDetailResponseData.ts index 8d960e7f..6649e8e2 100644 --- a/src/serialization/types/RuleDetailResponseData.ts +++ b/src/serialization/types/RuleDetailResponseData.ts @@ -5,6 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { RuleConditionDetailResponseData } from "./RuleConditionDetailResponseData"; import { RuleConditionGroupDetailResponseData } from "./RuleConditionGroupDetailResponseData"; +import { RuleType } from "./RuleType"; export const RuleDetailResponseData: core.serialization.ObjectSchema< serializers.RuleDetailResponseData.Raw, @@ -21,7 +22,7 @@ export const RuleDetailResponseData: core.serialization.ObjectSchema< id: core.serialization.string(), name: core.serialization.string(), priority: core.serialization.number(), - ruleType: core.serialization.property("rule_type", core.serialization.string()), + ruleType: core.serialization.property("rule_type", RuleType), updatedAt: core.serialization.property("updated_at", core.serialization.date()), value: core.serialization.boolean(), }); @@ -36,7 +37,7 @@ export declare namespace RuleDetailResponseData { id: string; name: string; priority: number; - rule_type: string; + rule_type: RuleType.Raw; updated_at: string; value: boolean; } diff --git a/src/serialization/types/RuleResponseData.ts b/src/serialization/types/RuleResponseData.ts index c43ec251..a4b0c665 100644 --- a/src/serialization/types/RuleResponseData.ts +++ b/src/serialization/types/RuleResponseData.ts @@ -3,6 +3,7 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { RuleType } from "./RuleType"; export const RuleResponseData: core.serialization.ObjectSchema< serializers.RuleResponseData.Raw, @@ -14,7 +15,7 @@ export const RuleResponseData: core.serialization.ObjectSchema< id: core.serialization.string(), name: core.serialization.string(), priority: core.serialization.number(), - ruleType: core.serialization.property("rule_type", core.serialization.string()), + ruleType: core.serialization.property("rule_type", RuleType), updatedAt: core.serialization.property("updated_at", core.serialization.date()), value: core.serialization.boolean(), }); @@ -27,7 +28,7 @@ export declare namespace RuleResponseData { id: string; name: string; priority: number; - rule_type: string; + rule_type: RuleType.Raw; updated_at: string; value: boolean; } diff --git a/src/serialization/types/RuleRuleType.ts b/src/serialization/types/RuleType.ts similarity index 82% rename from src/serialization/types/RuleRuleType.ts rename to src/serialization/types/RuleType.ts index affa25e0..f16402e6 100644 --- a/src/serialization/types/RuleRuleType.ts +++ b/src/serialization/types/RuleType.ts @@ -4,23 +4,23 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -export const RuleRuleType: core.serialization.Schema = +export const RuleType: core.serialization.Schema = core.serialization.enum_([ - "default", - "global_override", "company_override", "company_override_usage_exceeded", + "default", + "global_override", "plan_entitlement", "plan_entitlement_usage_exceeded", "standard", ]); -export declare namespace RuleRuleType { +export declare namespace RuleType { export type Raw = - | "default" - | "global_override" | "company_override" | "company_override_usage_exceeded" + | "default" + | "global_override" | "plan_entitlement" | "plan_entitlement_usage_exceeded" | "standard"; diff --git a/src/serialization/types/RuleView.ts b/src/serialization/types/RuleView.ts index 314c35b1..e4904f03 100644 --- a/src/serialization/types/RuleView.ts +++ b/src/serialization/types/RuleView.ts @@ -5,6 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { ConditionGroupView } from "./ConditionGroupView"; import { ConditionView } from "./ConditionView"; +import { RuleType } from "./RuleType"; export const RuleView: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,7 +18,7 @@ export const RuleView: core.serialization.ObjectSchema = core.serialization.enum_(["v313fa646", "placeholder-for-fern-compatibility"]); +> = core.serialization.enum_(["vf05bf5da", "placeholder-for-fern-compatibility"]); export declare namespace RulesEngineSchemaVersion { - export type Raw = "v313fa646" | "placeholder-for-fern-compatibility"; + export type Raw = "vf05bf5da" | "placeholder-for-fern-compatibility"; } diff --git a/src/serialization/types/RulesengineCheckFlagResult.ts b/src/serialization/types/RulesengineCheckFlagResult.ts index 0447c9dc..278f2f99 100644 --- a/src/serialization/types/RulesengineCheckFlagResult.ts +++ b/src/serialization/types/RulesengineCheckFlagResult.ts @@ -3,9 +3,9 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { RulesengineCheckFlagResultFeatureUsagePeriod } from "./RulesengineCheckFlagResultFeatureUsagePeriod"; -import { RulesengineCheckFlagResultRuleType } from "./RulesengineCheckFlagResultRuleType"; import { RulesengineFeatureEntitlement } from "./RulesengineFeatureEntitlement"; +import { RulesengineMetricPeriod } from "./RulesengineMetricPeriod"; +import { RulesengineRuleType } from "./RulesengineRuleType"; export const RulesengineCheckFlagResult: core.serialization.ObjectSchema< serializers.RulesengineCheckFlagResult.Raw, @@ -17,16 +17,13 @@ export const RulesengineCheckFlagResult: core.serialization.ObjectSchema< featureAllocation: core.serialization.property("feature_allocation", core.serialization.number().optional()), featureUsage: core.serialization.property("feature_usage", core.serialization.number().optional()), featureUsageEvent: core.serialization.property("feature_usage_event", core.serialization.string().optional()), - featureUsagePeriod: core.serialization.property( - "feature_usage_period", - RulesengineCheckFlagResultFeatureUsagePeriod.optional(), - ), + featureUsagePeriod: core.serialization.property("feature_usage_period", RulesengineMetricPeriod.optional()), featureUsageResetAt: core.serialization.property("feature_usage_reset_at", core.serialization.date().optional()), flagId: core.serialization.property("flag_id", core.serialization.string().optional()), flagKey: core.serialization.property("flag_key", core.serialization.string()), reason: core.serialization.string(), ruleId: core.serialization.property("rule_id", core.serialization.string().optional()), - ruleType: core.serialization.property("rule_type", RulesengineCheckFlagResultRuleType.optional()), + ruleType: core.serialization.property("rule_type", RulesengineRuleType.optional()), userId: core.serialization.property("user_id", core.serialization.string().optional()), value: core.serialization.boolean(), }); @@ -39,13 +36,13 @@ export declare namespace RulesengineCheckFlagResult { feature_allocation?: number | null; feature_usage?: number | null; feature_usage_event?: string | null; - feature_usage_period?: RulesengineCheckFlagResultFeatureUsagePeriod.Raw | null; + feature_usage_period?: RulesengineMetricPeriod.Raw | null; feature_usage_reset_at?: string | null; flag_id?: string | null; flag_key: string; reason: string; rule_id?: string | null; - rule_type?: RulesengineCheckFlagResultRuleType.Raw | null; + rule_type?: RulesengineRuleType.Raw | null; user_id?: string | null; value: boolean; } diff --git a/src/serialization/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts b/src/serialization/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts deleted file mode 100644 index 712aaf22..00000000 --- a/src/serialization/types/RulesengineCheckFlagResultFeatureUsagePeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineCheckFlagResultFeatureUsagePeriod: core.serialization.Schema< - serializers.RulesengineCheckFlagResultFeatureUsagePeriod.Raw, - Schematic.RulesengineCheckFlagResultFeatureUsagePeriod -> = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); - -export declare namespace RulesengineCheckFlagResultFeatureUsagePeriod { - export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; -} diff --git a/src/serialization/types/RulesengineCheckFlagResultRuleType.ts b/src/serialization/types/RulesengineCheckFlagResultRuleType.ts deleted file mode 100644 index 366259fb..00000000 --- a/src/serialization/types/RulesengineCheckFlagResultRuleType.ts +++ /dev/null @@ -1,29 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineCheckFlagResultRuleType: core.serialization.Schema< - serializers.RulesengineCheckFlagResultRuleType.Raw, - Schematic.RulesengineCheckFlagResultRuleType -> = core.serialization.enum_([ - "default", - "global_override", - "company_override", - "company_override_usage_exceeded", - "plan_entitlement", - "plan_entitlement_usage_exceeded", - "standard", -]); - -export declare namespace RulesengineCheckFlagResultRuleType { - export type Raw = - | "default" - | "global_override" - | "company_override" - | "company_override_usage_exceeded" - | "plan_entitlement" - | "plan_entitlement_usage_exceeded" - | "standard"; -} diff --git a/src/serialization/types/RulesengineCompanyMetric.ts b/src/serialization/types/RulesengineCompanyMetric.ts index 23220738..9d92734a 100644 --- a/src/serialization/types/RulesengineCompanyMetric.ts +++ b/src/serialization/types/RulesengineCompanyMetric.ts @@ -3,8 +3,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { RulesengineCompanyMetricMonthReset } from "./RulesengineCompanyMetricMonthReset"; -import { RulesengineCompanyMetricPeriod } from "./RulesengineCompanyMetricPeriod"; +import { RulesengineMetricPeriod } from "./RulesengineMetricPeriod"; +import { RulesengineMetricPeriodMonthReset } from "./RulesengineMetricPeriodMonthReset"; export const RulesengineCompanyMetric: core.serialization.ObjectSchema< serializers.RulesengineCompanyMetric.Raw, @@ -15,8 +15,8 @@ export const RulesengineCompanyMetric: core.serialization.ObjectSchema< createdAt: core.serialization.property("created_at", core.serialization.date()), environmentId: core.serialization.property("environment_id", core.serialization.string()), eventSubtype: core.serialization.property("event_subtype", core.serialization.string()), - monthReset: core.serialization.property("month_reset", RulesengineCompanyMetricMonthReset), - period: RulesengineCompanyMetricPeriod, + monthReset: core.serialization.property("month_reset", RulesengineMetricPeriodMonthReset), + period: RulesengineMetricPeriod, validUntil: core.serialization.property("valid_until", core.serialization.date().optional()), value: core.serialization.number(), }); @@ -28,8 +28,8 @@ export declare namespace RulesengineCompanyMetric { created_at: string; environment_id: string; event_subtype: string; - month_reset: RulesengineCompanyMetricMonthReset.Raw; - period: RulesengineCompanyMetricPeriod.Raw; + month_reset: RulesengineMetricPeriodMonthReset.Raw; + period: RulesengineMetricPeriod.Raw; valid_until?: string | null; value: number; } diff --git a/src/serialization/types/RulesengineCompanyMetricMonthReset.ts b/src/serialization/types/RulesengineCompanyMetricMonthReset.ts deleted file mode 100644 index d9e3867b..00000000 --- a/src/serialization/types/RulesengineCompanyMetricMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineCompanyMetricMonthReset: core.serialization.Schema< - serializers.RulesengineCompanyMetricMonthReset.Raw, - Schematic.RulesengineCompanyMetricMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace RulesengineCompanyMetricMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/RulesengineCondition.ts b/src/serialization/types/RulesengineCondition.ts index 65232efb..a62c188a 100644 --- a/src/serialization/types/RulesengineCondition.ts +++ b/src/serialization/types/RulesengineCondition.ts @@ -3,10 +3,10 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -import { RulesengineConditionConditionType } from "./RulesengineConditionConditionType"; -import { RulesengineConditionMetricPeriod } from "./RulesengineConditionMetricPeriod"; -import { RulesengineConditionMetricPeriodMonthReset } from "./RulesengineConditionMetricPeriodMonthReset"; -import { RulesengineConditionOperator } from "./RulesengineConditionOperator"; +import { ComparableOperator } from "./ComparableOperator"; +import { RulesengineConditionType } from "./RulesengineConditionType"; +import { RulesengineMetricPeriod } from "./RulesengineMetricPeriod"; +import { RulesengineMetricPeriodMonthReset } from "./RulesengineMetricPeriodMonthReset"; import { RulesengineTraitDefinition } from "./RulesengineTraitDefinition"; export const RulesengineCondition: core.serialization.ObjectSchema< @@ -18,19 +18,19 @@ export const RulesengineCondition: core.serialization.ObjectSchema< "comparison_trait_definition", RulesengineTraitDefinition.optional(), ), - conditionType: core.serialization.property("condition_type", RulesengineConditionConditionType), + conditionType: core.serialization.property("condition_type", RulesengineConditionType), consumptionRate: core.serialization.property("consumption_rate", core.serialization.number().optional()), creditId: core.serialization.property("credit_id", core.serialization.string().optional()), environmentId: core.serialization.property("environment_id", core.serialization.string()), eventSubtype: core.serialization.property("event_subtype", core.serialization.string().optional()), id: core.serialization.string(), - metricPeriod: core.serialization.property("metric_period", RulesengineConditionMetricPeriod.optional()), + metricPeriod: core.serialization.property("metric_period", RulesengineMetricPeriod.optional()), metricPeriodMonthReset: core.serialization.property( "metric_period_month_reset", - RulesengineConditionMetricPeriodMonthReset.optional(), + RulesengineMetricPeriodMonthReset.optional(), ), metricValue: core.serialization.property("metric_value", core.serialization.number().optional()), - operator: RulesengineConditionOperator, + operator: ComparableOperator, resourceIds: core.serialization.property("resource_ids", core.serialization.list(core.serialization.string())), traitDefinition: core.serialization.property("trait_definition", RulesengineTraitDefinition.optional()), traitValue: core.serialization.property("trait_value", core.serialization.string()), @@ -40,16 +40,16 @@ export declare namespace RulesengineCondition { export interface Raw { account_id: string; comparison_trait_definition?: RulesengineTraitDefinition.Raw | null; - condition_type: RulesengineConditionConditionType.Raw; + condition_type: RulesengineConditionType.Raw; consumption_rate?: number | null; credit_id?: string | null; environment_id: string; event_subtype?: string | null; id: string; - metric_period?: RulesengineConditionMetricPeriod.Raw | null; - metric_period_month_reset?: RulesengineConditionMetricPeriodMonthReset.Raw | null; + metric_period?: RulesengineMetricPeriod.Raw | null; + metric_period_month_reset?: RulesengineMetricPeriodMonthReset.Raw | null; metric_value?: number | null; - operator: RulesengineConditionOperator.Raw; + operator: ComparableOperator.Raw; resource_ids: string[]; trait_definition?: RulesengineTraitDefinition.Raw | null; trait_value: string; diff --git a/src/serialization/types/RulesengineConditionConditionType.ts b/src/serialization/types/RulesengineConditionConditionType.ts deleted file mode 100644 index 8507b8c6..00000000 --- a/src/serialization/types/RulesengineConditionConditionType.ts +++ /dev/null @@ -1,33 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineConditionConditionType: core.serialization.Schema< - serializers.RulesengineConditionConditionType.Raw, - Schematic.RulesengineConditionConditionType -> = core.serialization.enum_([ - "base_plan", - "billing_product", - "company", - "credit", - "metric", - "plan", - "plan_version", - "trait", - "user", -]); - -export declare namespace RulesengineConditionConditionType { - export type Raw = - | "base_plan" - | "billing_product" - | "company" - | "credit" - | "metric" - | "plan" - | "plan_version" - | "trait" - | "user"; -} diff --git a/src/serialization/types/RulesengineConditionMetricPeriod.ts b/src/serialization/types/RulesengineConditionMetricPeriod.ts deleted file mode 100644 index 2e24420b..00000000 --- a/src/serialization/types/RulesengineConditionMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineConditionMetricPeriod: core.serialization.Schema< - serializers.RulesengineConditionMetricPeriod.Raw, - Schematic.RulesengineConditionMetricPeriod -> = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); - -export declare namespace RulesengineConditionMetricPeriod { - export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; -} diff --git a/src/serialization/types/RulesengineConditionMetricPeriodMonthReset.ts b/src/serialization/types/RulesengineConditionMetricPeriodMonthReset.ts deleted file mode 100644 index aa8d0b04..00000000 --- a/src/serialization/types/RulesengineConditionMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineConditionMetricPeriodMonthReset: core.serialization.Schema< - serializers.RulesengineConditionMetricPeriodMonthReset.Raw, - Schematic.RulesengineConditionMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace RulesengineConditionMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/RulesengineConditionOperator.ts b/src/serialization/types/RulesengineConditionOperator.ts deleted file mode 100644 index 855f7194..00000000 --- a/src/serialization/types/RulesengineConditionOperator.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineConditionOperator: core.serialization.Schema< - serializers.RulesengineConditionOperator.Raw, - Schematic.RulesengineConditionOperator -> = core.serialization.enum_(["eq", "ne", "gt", "lt", "gte", "lte", "is_empty", "not_empty"]); - -export declare namespace RulesengineConditionOperator { - export type Raw = "eq" | "ne" | "gt" | "lt" | "gte" | "lte" | "is_empty" | "not_empty"; -} diff --git a/src/serialization/types/ConditionConditionType.ts b/src/serialization/types/RulesengineConditionType.ts similarity index 74% rename from src/serialization/types/ConditionConditionType.ts rename to src/serialization/types/RulesengineConditionType.ts index 35510066..6e7c21e0 100644 --- a/src/serialization/types/ConditionConditionType.ts +++ b/src/serialization/types/RulesengineConditionType.ts @@ -4,9 +4,9 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -export const ConditionConditionType: core.serialization.Schema< - serializers.ConditionConditionType.Raw, - Schematic.ConditionConditionType +export const RulesengineConditionType: core.serialization.Schema< + serializers.RulesengineConditionType.Raw, + Schematic.RulesengineConditionType > = core.serialization.enum_([ "base_plan", "billing_product", @@ -19,7 +19,7 @@ export const ConditionConditionType: core.serialization.Schema< "user", ]); -export declare namespace ConditionConditionType { +export declare namespace RulesengineConditionType { export type Raw = | "base_plan" | "billing_product" diff --git a/src/serialization/types/RulesengineFeatureEntitlement.ts b/src/serialization/types/RulesengineFeatureEntitlement.ts index 445609b1..01e23c02 100644 --- a/src/serialization/types/RulesengineFeatureEntitlement.ts +++ b/src/serialization/types/RulesengineFeatureEntitlement.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { RulesengineEntitlementValueType } from "./RulesengineEntitlementValueType"; -import { RulesengineFeatureEntitlementMetricPeriod } from "./RulesengineFeatureEntitlementMetricPeriod"; -import { RulesengineFeatureEntitlementMonthReset } from "./RulesengineFeatureEntitlementMonthReset"; +import { RulesengineMetricPeriod } from "./RulesengineMetricPeriod"; +import { RulesengineMetricPeriodMonthReset } from "./RulesengineMetricPeriodMonthReset"; export const RulesengineFeatureEntitlement: core.serialization.ObjectSchema< serializers.RulesengineFeatureEntitlement.Raw, @@ -19,9 +19,9 @@ export const RulesengineFeatureEntitlement: core.serialization.ObjectSchema< eventName: core.serialization.property("event_name", core.serialization.string().optional()), featureId: core.serialization.property("feature_id", core.serialization.string()), featureKey: core.serialization.property("feature_key", core.serialization.string()), - metricPeriod: core.serialization.property("metric_period", RulesengineFeatureEntitlementMetricPeriod.optional()), + metricPeriod: core.serialization.property("metric_period", RulesengineMetricPeriod.optional()), metricResetAt: core.serialization.property("metric_reset_at", core.serialization.date().optional()), - monthReset: core.serialization.property("month_reset", RulesengineFeatureEntitlementMonthReset.optional()), + monthReset: core.serialization.property("month_reset", RulesengineMetricPeriodMonthReset.optional()), softLimit: core.serialization.property("soft_limit", core.serialization.number().optional()), usage: core.serialization.number().optional(), valueType: core.serialization.property("value_type", RulesengineEntitlementValueType), @@ -37,9 +37,9 @@ export declare namespace RulesengineFeatureEntitlement { event_name?: string | null; feature_id: string; feature_key: string; - metric_period?: RulesengineFeatureEntitlementMetricPeriod.Raw | null; + metric_period?: RulesengineMetricPeriod.Raw | null; metric_reset_at?: string | null; - month_reset?: RulesengineFeatureEntitlementMonthReset.Raw | null; + month_reset?: RulesengineMetricPeriodMonthReset.Raw | null; soft_limit?: number | null; usage?: number | null; value_type: RulesengineEntitlementValueType.Raw; diff --git a/src/serialization/types/RulesengineFeatureEntitlementMetricPeriod.ts b/src/serialization/types/RulesengineFeatureEntitlementMetricPeriod.ts deleted file mode 100644 index 0bf19219..00000000 --- a/src/serialization/types/RulesengineFeatureEntitlementMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineFeatureEntitlementMetricPeriod: core.serialization.Schema< - serializers.RulesengineFeatureEntitlementMetricPeriod.Raw, - Schematic.RulesengineFeatureEntitlementMetricPeriod -> = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); - -export declare namespace RulesengineFeatureEntitlementMetricPeriod { - export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; -} diff --git a/src/serialization/types/RulesengineFeatureEntitlementMonthReset.ts b/src/serialization/types/RulesengineFeatureEntitlementMonthReset.ts deleted file mode 100644 index cff4e293..00000000 --- a/src/serialization/types/RulesengineFeatureEntitlementMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const RulesengineFeatureEntitlementMonthReset: core.serialization.Schema< - serializers.RulesengineFeatureEntitlementMonthReset.Raw, - Schematic.RulesengineFeatureEntitlementMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace RulesengineFeatureEntitlementMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/ConditionMetricPeriod.ts b/src/serialization/types/RulesengineMetricPeriod.ts similarity index 65% rename from src/serialization/types/ConditionMetricPeriod.ts rename to src/serialization/types/RulesengineMetricPeriod.ts index 362c965c..2a5afc28 100644 --- a/src/serialization/types/ConditionMetricPeriod.ts +++ b/src/serialization/types/RulesengineMetricPeriod.ts @@ -4,11 +4,11 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -export const ConditionMetricPeriod: core.serialization.Schema< - serializers.ConditionMetricPeriod.Raw, - Schematic.ConditionMetricPeriod +export const RulesengineMetricPeriod: core.serialization.Schema< + serializers.RulesengineMetricPeriod.Raw, + Schematic.RulesengineMetricPeriod > = core.serialization.enum_(["all_time", "current_day", "current_month", "current_week"]); -export declare namespace ConditionMetricPeriod { +export declare namespace RulesengineMetricPeriod { export type Raw = "all_time" | "current_day" | "current_month" | "current_week"; } diff --git a/src/serialization/types/RulesengineMetricPeriodMonthReset.ts b/src/serialization/types/RulesengineMetricPeriodMonthReset.ts new file mode 100644 index 00000000..b6f8c7b3 --- /dev/null +++ b/src/serialization/types/RulesengineMetricPeriodMonthReset.ts @@ -0,0 +1,14 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Schematic from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const RulesengineMetricPeriodMonthReset: core.serialization.Schema< + serializers.RulesengineMetricPeriodMonthReset.Raw, + Schematic.RulesengineMetricPeriodMonthReset +> = core.serialization.enum_(["billing_cycle", "first_of_month"]); + +export declare namespace RulesengineMetricPeriodMonthReset { + export type Raw = "billing_cycle" | "first_of_month"; +} diff --git a/src/serialization/types/RulesengineRule.ts b/src/serialization/types/RulesengineRule.ts index 6b1ca292..d039315d 100644 --- a/src/serialization/types/RulesengineRule.ts +++ b/src/serialization/types/RulesengineRule.ts @@ -5,7 +5,7 @@ import * as core from "../../core"; import type * as serializers from "../index"; import { RulesengineCondition } from "./RulesengineCondition"; import { RulesengineConditionGroup } from "./RulesengineConditionGroup"; -import { RulesengineRuleRuleType } from "./RulesengineRuleRuleType"; +import { RulesengineRuleType } from "./RulesengineRuleType"; export const RulesengineRule: core.serialization.ObjectSchema< serializers.RulesengineRule.Raw, @@ -22,7 +22,7 @@ export const RulesengineRule: core.serialization.ObjectSchema< id: core.serialization.string(), name: core.serialization.string(), priority: core.serialization.number(), - ruleType: core.serialization.property("rule_type", RulesengineRuleRuleType), + ruleType: core.serialization.property("rule_type", RulesengineRuleType), value: core.serialization.boolean(), }); @@ -36,7 +36,7 @@ export declare namespace RulesengineRule { id: string; name: string; priority: number; - rule_type: RulesengineRuleRuleType.Raw; + rule_type: RulesengineRuleType.Raw; value: boolean; } } diff --git a/src/serialization/types/RulesengineRuleRuleType.ts b/src/serialization/types/RulesengineRuleType.ts similarity index 76% rename from src/serialization/types/RulesengineRuleRuleType.ts rename to src/serialization/types/RulesengineRuleType.ts index d3715771..ea3df21f 100644 --- a/src/serialization/types/RulesengineRuleRuleType.ts +++ b/src/serialization/types/RulesengineRuleType.ts @@ -4,25 +4,25 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; -export const RulesengineRuleRuleType: core.serialization.Schema< - serializers.RulesengineRuleRuleType.Raw, - Schematic.RulesengineRuleRuleType +export const RulesengineRuleType: core.serialization.Schema< + serializers.RulesengineRuleType.Raw, + Schematic.RulesengineRuleType > = core.serialization.enum_([ - "default", - "global_override", "company_override", "company_override_usage_exceeded", + "default", + "global_override", "plan_entitlement", "plan_entitlement_usage_exceeded", "standard", ]); -export declare namespace RulesengineRuleRuleType { +export declare namespace RulesengineRuleType { export type Raw = - | "default" - | "global_override" | "company_override" | "company_override_usage_exceeded" + | "default" + | "global_override" | "plan_entitlement" | "plan_entitlement_usage_exceeded" | "standard"; diff --git a/src/serialization/types/UpdateEntitlementReqCommon.ts b/src/serialization/types/UpdateEntitlementReqCommon.ts index f5de43a6..eaad8abd 100644 --- a/src/serialization/types/UpdateEntitlementReqCommon.ts +++ b/src/serialization/types/UpdateEntitlementReqCommon.ts @@ -4,8 +4,8 @@ import type * as Schematic from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { EntitlementValueType } from "./EntitlementValueType"; -import { UpdateEntitlementReqCommonMetricPeriod } from "./UpdateEntitlementReqCommonMetricPeriod"; -import { UpdateEntitlementReqCommonMetricPeriodMonthReset } from "./UpdateEntitlementReqCommonMetricPeriodMonthReset"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const UpdateEntitlementReqCommon: core.serialization.ObjectSchema< serializers.UpdateEntitlementReqCommon.Raw, @@ -15,11 +15,8 @@ export const UpdateEntitlementReqCommon: core.serialization.ObjectSchema< "credit_consumption_rate", core.serialization.number().optional(), ), - metricPeriod: core.serialization.property("metric_period", UpdateEntitlementReqCommonMetricPeriod.optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - UpdateEntitlementReqCommonMetricPeriodMonthReset.optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), valueBool: core.serialization.property("value_bool", core.serialization.boolean().optional()), valueCreditId: core.serialization.property("value_credit_id", core.serialization.string().optional()), valueNumeric: core.serialization.property("value_numeric", core.serialization.number().optional()), @@ -30,8 +27,8 @@ export const UpdateEntitlementReqCommon: core.serialization.ObjectSchema< export declare namespace UpdateEntitlementReqCommon { export interface Raw { credit_consumption_rate?: number | null; - metric_period?: UpdateEntitlementReqCommonMetricPeriod.Raw | null; - metric_period_month_reset?: UpdateEntitlementReqCommonMetricPeriodMonthReset.Raw | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; value_bool?: boolean | null; value_credit_id?: string | null; value_numeric?: number | null; diff --git a/src/serialization/types/UpdateEntitlementReqCommonMetricPeriod.ts b/src/serialization/types/UpdateEntitlementReqCommonMetricPeriod.ts deleted file mode 100644 index 17ae677d..00000000 --- a/src/serialization/types/UpdateEntitlementReqCommonMetricPeriod.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const UpdateEntitlementReqCommonMetricPeriod: core.serialization.Schema< - serializers.UpdateEntitlementReqCommonMetricPeriod.Raw, - Schematic.UpdateEntitlementReqCommonMetricPeriod -> = core.serialization.enum_(["all_time", "current_month", "current_week", "current_day"]); - -export declare namespace UpdateEntitlementReqCommonMetricPeriod { - export type Raw = "all_time" | "current_month" | "current_week" | "current_day"; -} diff --git a/src/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts b/src/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts deleted file mode 100644 index 1a10c175..00000000 --- a/src/serialization/types/UpdateEntitlementReqCommonMetricPeriodMonthReset.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Schematic from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const UpdateEntitlementReqCommonMetricPeriodMonthReset: core.serialization.Schema< - serializers.UpdateEntitlementReqCommonMetricPeriodMonthReset.Raw, - Schematic.UpdateEntitlementReqCommonMetricPeriodMonthReset -> = core.serialization.enum_(["first_of_month", "billing_cycle"]); - -export declare namespace UpdateEntitlementReqCommonMetricPeriodMonthReset { - export type Raw = "first_of_month" | "billing_cycle"; -} diff --git a/src/serialization/types/UsageBasedEntitlementResponseData.ts b/src/serialization/types/UsageBasedEntitlementResponseData.ts index eff421d8..1a447da5 100644 --- a/src/serialization/types/UsageBasedEntitlementResponseData.ts +++ b/src/serialization/types/UsageBasedEntitlementResponseData.ts @@ -6,6 +6,8 @@ import type * as serializers from "../index"; import { BillingPriceView } from "./BillingPriceView"; import { EntitlementPriceBehavior } from "./EntitlementPriceBehavior"; import { EntitlementValueType } from "./EntitlementValueType"; +import { MetricPeriod } from "./MetricPeriod"; +import { MetricPeriodMonthReset } from "./MetricPeriodMonthReset"; export const UsageBasedEntitlementResponseData: core.serialization.ObjectSchema< serializers.UsageBasedEntitlementResponseData.Raw, @@ -15,11 +17,8 @@ export const UsageBasedEntitlementResponseData: core.serialization.ObjectSchema< consumptionRate: core.serialization.property("consumption_rate", core.serialization.number().optional()), featureId: core.serialization.property("feature_id", core.serialization.string()), meteredPrice: core.serialization.property("metered_price", BillingPriceView.optional()), - metricPeriod: core.serialization.property("metric_period", core.serialization.string().optional()), - metricPeriodMonthReset: core.serialization.property( - "metric_period_month_reset", - core.serialization.string().optional(), - ), + metricPeriod: core.serialization.property("metric_period", MetricPeriod.optional()), + metricPeriodMonthReset: core.serialization.property("metric_period_month_reset", MetricPeriodMonthReset.optional()), monthlyUsageBasedPrice: core.serialization.property("monthly_usage_based_price", BillingPriceView.optional()), priceBehavior: core.serialization.property("price_behavior", EntitlementPriceBehavior.optional()), valueBool: core.serialization.property("value_bool", core.serialization.boolean().optional()), @@ -34,8 +33,8 @@ export declare namespace UsageBasedEntitlementResponseData { consumption_rate?: number | null; feature_id: string; metered_price?: BillingPriceView.Raw | null; - metric_period?: string | null; - metric_period_month_reset?: string | null; + metric_period?: MetricPeriod.Raw | null; + metric_period_month_reset?: MetricPeriodMonthReset.Raw | null; monthly_usage_based_price?: BillingPriceView.Raw | null; price_behavior?: EntitlementPriceBehavior.Raw | null; value_bool?: boolean | null; diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index b2511a60..92fca62f 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -75,6 +75,7 @@ export * from "./CompanyPlanInvalidReason"; export * from "./CompanyPlanWithBillingSubView"; export * from "./CompanyResponseData"; export * from "./CompanySubscriptionResponseData"; +export * from "./ComparableOperator"; export * from "./CompatiblePlans"; export * from "./CompatiblePlansResponseData"; export * from "./ComponentCapabilities"; @@ -87,36 +88,24 @@ export * from "./ComponentResponseData"; export * from "./ComponentSettingsResponseData"; export * from "./ComponentState"; export * from "./Condition"; -export * from "./ConditionConditionType"; export * from "./ConditionGroup"; export * from "./ConditionGroupResponseData"; export * from "./ConditionGroupView"; -export * from "./ConditionMetricPeriod"; -export * from "./ConditionMetricPeriodMonthReset"; -export * from "./ConditionOperator"; export * from "./ConditionResponseData"; +export * from "./ConditionType"; export * from "./ConditionView"; export * from "./CountResponse"; export * from "./CouponRequestBody"; export * from "./CreateBillingPlanCreditGrantRequestBody"; export * from "./CreateBillingPriceTierRequestBody"; export * from "./CreateEntitlementInBundleRequestBody"; -export * from "./CreateEntitlementInBundleRequestBodyMetricPeriod"; -export * from "./CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset"; export * from "./CreateEntitlementReqCommon"; -export * from "./CreateEntitlementReqCommonMetricPeriod"; -export * from "./CreateEntitlementReqCommonMetricPeriodMonthReset"; export * from "./CreateEventRequestBody"; export * from "./CreateFlagRequestBody"; export * from "./CreateOrUpdateConditionGroupRequestBody"; export * from "./CreateOrUpdateConditionRequestBody"; -export * from "./CreateOrUpdateConditionRequestBodyConditionType"; -export * from "./CreateOrUpdateConditionRequestBodyMetricPeriod"; -export * from "./CreateOrUpdateConditionRequestBodyMetricPeriodMonthReset"; -export * from "./CreateOrUpdateConditionRequestBodyOperator"; export * from "./CreateOrUpdateFlagRequestBody"; export * from "./CreateOrUpdateRuleRequestBody"; -export * from "./CreateOrUpdateRuleRequestBodyRuleType"; export * from "./CreatePlanRequestBody"; export * from "./CreatePriceTierRequestBody"; export * from "./CreditAutoTopupAmountType"; @@ -189,8 +178,7 @@ export * from "./FeatureCompanyResponseData"; export * from "./FeatureCompanyUserResponseData"; export * from "./FeatureDetailResponseData"; export * from "./FeatureEntitlement"; -export * from "./FeatureEntitlementMetricPeriod"; -export * from "./FeatureEntitlementMonthReset"; +export * from "./FeatureInPlanResponseData"; export * from "./FeatureLedgerResponseData"; export * from "./FeatureLifecyclePhase"; export * from "./FeatureResponseData"; @@ -201,6 +189,7 @@ export * from "./FeatureUsageResponseData"; export * from "./FeatureUsageTimeSeriesResponseData"; export * from "./FeatureView"; export * from "./FlagDetailResponseData"; +export * from "./FlagInPlanResponseData"; export * from "./FlagResponseData"; export * from "./FlagType"; export * from "./FlagView"; @@ -217,6 +206,8 @@ export * from "./ManagePlanPreviewResponseResponseData"; export * from "./ManagePlanRequest"; export * from "./ManagePlanResponseResponseData"; export * from "./MeterRequestBody"; +export * from "./MetricPeriod"; +export * from "./MetricPeriodMonthReset"; export * from "./OrderedPlansInGroup"; export * from "./PaymentMethodRequestBody"; export * from "./PaymentMethodResponseData"; @@ -272,35 +263,28 @@ export * from "./RuleConditionGroupResponseData"; export * from "./RuleConditionResponseData"; export * from "./RuleDetailResponseData"; export * from "./RuleResponseData"; -export * from "./RuleRuleType"; export * from "./RulesDetailResponseData"; export * from "./RulesEngineSchemaVersion"; export * from "./RulesengineCheckFlagResult"; -export * from "./RulesengineCheckFlagResultFeatureUsagePeriod"; -export * from "./RulesengineCheckFlagResultRuleType"; export * from "./RulesengineCompany"; export * from "./RulesengineCompanyMetric"; -export * from "./RulesengineCompanyMetricMonthReset"; -export * from "./RulesengineCompanyMetricPeriod"; export * from "./RulesengineCondition"; -export * from "./RulesengineConditionConditionType"; export * from "./RulesengineConditionGroup"; -export * from "./RulesengineConditionMetricPeriod"; -export * from "./RulesengineConditionMetricPeriodMonthReset"; -export * from "./RulesengineConditionOperator"; +export * from "./RulesengineConditionType"; export * from "./RulesengineEntitlementValueType"; export * from "./RulesengineEntityType"; export * from "./RulesengineFeatureEntitlement"; -export * from "./RulesengineFeatureEntitlementMetricPeriod"; -export * from "./RulesengineFeatureEntitlementMonthReset"; export * from "./RulesengineFlag"; +export * from "./RulesengineMetricPeriod"; +export * from "./RulesengineMetricPeriodMonthReset"; export * from "./RulesengineRule"; -export * from "./RulesengineRuleRuleType"; +export * from "./RulesengineRuleType"; export * from "./RulesengineSubscription"; export * from "./RulesengineTrait"; export * from "./RulesengineTraitDefinition"; export * from "./RulesengineTraitDefinitionComparableType"; export * from "./RulesengineUser"; +export * from "./RuleType"; export * from "./RuleView"; export * from "./ScheduledCheckoutResponseData"; export * from "./ScheduledCheckoutStatus"; @@ -325,8 +309,6 @@ export * from "./UpdateAddOnRequestBody"; export * from "./UpdateBillingPlanCreditGrantRequestBody"; export * from "./UpdateCreditBundleRequestBody"; export * from "./UpdateEntitlementReqCommon"; -export * from "./UpdateEntitlementReqCommonMetricPeriod"; -export * from "./UpdateEntitlementReqCommonMetricPeriodMonthReset"; export * from "./UpdatePayInAdvanceRequestBody"; export * from "./UpdatePlanRequestBody"; export * from "./UpdatePlanTraitTraitRequestBody"; diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 9b512336..8c82c1b7 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -3,8 +3,8 @@ import { BasicAuth } from "../../../src/core/auth/BasicAuth"; describe("BasicAuth", () => { interface ToHeaderTestCase { description: string; - input: { username: string; password: string }; - expected: string; + input: { username?: string; password?: string }; + expected: string | undefined; } interface FromHeaderTestCase { @@ -22,10 +22,30 @@ describe("BasicAuth", () => { describe("toAuthorizationHeader", () => { const toHeaderTests: ToHeaderTestCase[] = [ { - description: "correctly converts to header", + description: "correctly converts to header with both username and password", input: { username: "username", password: "password" }, expected: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", }, + { + description: "encodes username only with trailing colon", + input: { username: "username" }, + expected: "Basic dXNlcm5hbWU6", + }, + { + description: "encodes password only with leading colon", + input: { password: "password" }, + expected: "Basic OnBhc3N3b3Jk", + }, + { + description: "returns undefined when neither provided", + input: {}, + expected: undefined, + }, + { + description: "returns undefined when both are empty strings", + input: { username: "", password: "" }, + expected: undefined, + }, ]; toHeaderTests.forEach(({ description, input, expected }) => { diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index a92f1b5e..f8afeaf0 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -160,4 +160,8 @@ describe("Test createRequestUrl", () => { expect(createRequestUrl(baseUrl, queryParams)).toBe(expected); }); }); + + it("should default to repeat format for arrays", () => { + expect(createRequestUrl(BASE_URL, { items: ["a", "b"] })).toBe("https://api.example.com?items=a&items=b"); + }); }); diff --git a/tests/unit/url/QueryStringBuilder.test.ts b/tests/unit/url/QueryStringBuilder.test.ts new file mode 100644 index 00000000..1afa2d22 --- /dev/null +++ b/tests/unit/url/QueryStringBuilder.test.ts @@ -0,0 +1,236 @@ +import { queryBuilder } from "../../../src/core/url/QueryStringBuilder"; + +describe("QueryStringBuilder", () => { + describe("add() — default repeat format", () => { + it("adds a scalar string value", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).toBe("key=value"); + }); + + it("adds a scalar number value", () => { + const qs = queryBuilder().add("limit", 10).build(); + expect(qs).toBe("limit=10"); + }); + + it("adds a boolean value", () => { + const qs = queryBuilder().add("active", true).build(); + expect(qs).toBe("active=true"); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("key", undefined).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("key", null).build(); + expect(qs).toBe(""); + }); + + it("repeats array elements as separate key=value pairs", () => { + const qs = queryBuilder().add("color", ["red", "blue", "green"]).build(); + expect(qs).toBe("color=red&color=blue&color=green"); + }); + + it("skips undefined items within arrays", () => { + const qs = queryBuilder().add("color", ["red", undefined, "blue"]).build(); + expect(qs).toBe("color=red&color=blue"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("color", []).build(); + expect(qs).toBe(""); + }); + + it("encodes special characters in keys and values", () => { + const qs = queryBuilder().add("my key", "hello world").build(); + expect(qs).toBe("my%20key=hello%20world"); + }); + + it("handles nested objects", () => { + const qs = queryBuilder().add("filter", { status: "active" }).build(); + expect(qs).toBe("filter%5Bstatus%5D=active"); + }); + }); + + describe("add() — comma style", () => { + it("joins array values with literal commas", () => { + const qs = queryBuilder().add("tags", ["a", "b", "c"], { style: "comma" }).build(); + expect(qs).toBe("tags=a,b,c"); + }); + + it("handles single-element array", () => { + const qs = queryBuilder().add("tags", ["only"], { style: "comma" }).build(); + expect(qs).toBe("tags=only"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("tags", [], { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("tags", undefined, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("tags", null, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("treats scalar values same as default add()", () => { + const qs = queryBuilder().add("tag", "single", { style: "comma" }).build(); + expect(qs).toBe("tag=single"); + }); + + it("encodes commas within individual values as %2C", () => { + const qs = queryBuilder().add("items", ["a,b", "c"], { style: "comma" }).build(); + expect(qs).toBe("items=a%2Cb,c"); + }); + + it("encodes special characters in values", () => { + const qs = queryBuilder().add("tags", ["hello world", "foo&bar"], { style: "comma" }).build(); + expect(qs).toBe("tags=hello%20world,foo%26bar"); + }); + }); + + describe("chaining", () => { + it("chains multiple add() calls", () => { + const qs = queryBuilder().add("limit", 10).add("offset", 20).build(); + expect(qs).toBe("limit=10&offset=20"); + }); + + it("chains add() with default and comma styles", () => { + const qs = queryBuilder() + .add("limit", 10) + .add("tags", ["ACCESS_GRANTED", "COPY", "DELETE"], { style: "comma" }) + .add("active", true) + .build(); + expect(qs).toBe("limit=10&tags=ACCESS_GRANTED,COPY,DELETE&active=true"); + }); + + it("skips undefined/null params in chain without breaking", () => { + const qs = queryBuilder() + .add("a", "1") + .add("b", undefined) + .add("c", null, { style: "comma" }) + .add("d", "4") + .build(); + expect(qs).toBe("a=1&d=4"); + }); + }); + + describe("addMany()", () => { + it("adds all params from a record", () => { + const qs = queryBuilder().addMany({ limit: 10, offset: 20, name: "test" }).build(); + expect(qs).toBe("limit=10&offset=20&name=test"); + }); + + it("skips null and undefined values", () => { + const qs = queryBuilder().addMany({ a: "1", b: null, c: undefined, d: "4" }).build(); + expect(qs).toBe("a=1&d=4"); + }); + + it("handles empty record", () => { + const qs = queryBuilder().addMany({}).build(); + expect(qs).toBe(""); + }); + + it("works with comma-style override after addMany", () => { + const params = { limit: 10, tags: ["a", "b"], active: true }; + const qs = queryBuilder().addMany(params).add("tags", params.tags, { style: "comma" }).build(); + expect(qs).toBe("limit=10&tags=a,b&active=true"); + }); + + it("handles array values with default repeat format", () => { + const qs = queryBuilder() + .addMany({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + }); + + describe("mergeAdditional()", () => { + it("appends additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: "value" }).build(); + expect(qs).toBe("limit=10&extra=value"); + }); + + it("overrides existing keys (last-write-wins)", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ limit: 20 }).build(); + expect(qs).toBe("limit=20"); + }); + + it("handles undefined additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional(undefined).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips undefined values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: undefined }).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips null values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: null }).build(); + expect(qs).toBe("limit=10"); + }); + + it("handles array values in additional params using repeat format", () => { + const qs = queryBuilder() + .mergeAdditional({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + + it("overrides a comma-style param with repeat format", () => { + const qs = queryBuilder() + .add("tags", ["a", "b"], { style: "comma" }) + .mergeAdditional({ tags: ["x", "y"] }) + .build(); + expect(qs).toBe("tags=x&tags=y"); + }); + }); + + describe("build()", () => { + it("returns empty string when no params added", () => { + const qs = queryBuilder().build(); + expect(qs).toBe(""); + }); + + it("does not include leading ?", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).not.toContain("?"); + }); + }); + + describe("end-to-end scenarios", () => { + it("matches expected query-parameters-openapi output pattern", () => { + const params: Record = { + limit: 1, + id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + date: "2023-01-15", + deadline: "2024-01-15T09:30:00.000Z", + bytes: "SGVsbG8gd29ybGQh", + user: "user", + userList: ["user"], + optionalString: "optionalString", + nestedUser: "nestedUser", + excludeUser: "excludeUser", + filter: "filter", + tags: ["tags"], + optionalTags: undefined, + }; + const qs = queryBuilder() + .addMany(params) + .add("tags", params.tags, { style: "comma" }) + .add("optionalTags", params.optionalTags, { style: "comma" }) + .mergeAdditional(undefined) + .build(); + expect(qs).toContain("limit=1"); + expect(qs).toContain("tags=tags"); + expect(qs).not.toContain("optionalTags"); + }); + }); +}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts index 42cdffb9..1099b954 100644 --- a/tests/unit/url/qs.test.ts +++ b/tests/unit/url/qs.test.ts @@ -34,7 +34,7 @@ describe("Test qs toQueryString", () => { interface ArrayTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -150,7 +150,7 @@ describe("Test qs toQueryString", () => { interface MixedTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -241,11 +241,107 @@ describe("Test qs toQueryString", () => { }); }); + describe("Comma array format", () => { + interface CommaTestCase { + description: string; + input: any; + options?: { arrayFormat?: "comma"; encode?: boolean }; + expected: string; + } + + const commaTests: CommaTestCase[] = [ + { + description: "should join array values with commas", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE", + }, + { + description: "should handle single-element array", + input: { event_type: ["ACCESS_GRANTED"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED", + }, + { + description: "should handle empty array", + input: { event_type: [] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should not percent-encode commas", + input: { items: ["a", "b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,b,c", + }, + { + description: "should encode values but not commas", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%20b,c%20d", + }, + { + description: "should not encode when encode is false", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma", encode: false }, + expected: "items=a b,c d", + }, + { + description: "should handle mixed parameters with comma and non-array values", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"], limit: 10, offset: 0 }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE&limit=10&offset=0", + }, + { + description: "should handle numeric array values", + input: { ids: [1, 2, 3] }, + options: { arrayFormat: "comma" }, + expected: "ids=1,2,3", + }, + { + description: "should handle boolean array values", + input: { flags: [true, false, true] }, + options: { arrayFormat: "comma" }, + expected: "flags=true,false,true", + }, + { + description: "should skip null values in comma format", + input: { items: ["a", null, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should skip undefined values in comma format", + input: { items: ["a", undefined, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should produce empty string for all-null array in comma format", + input: { items: [null, undefined] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should encode commas within values while keeping separator commas literal", + input: { items: ["a,b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%2Cb,c", + }, + ]; + + commaTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + describe("Options combinations", () => { interface OptionsTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices"; encode?: boolean }; + options?: { arrayFormat?: "repeat" | "indices" | "comma"; encode?: boolean }; expected: string; } diff --git a/tests/wire/accounts.test.ts b/tests/wire/accounts.test.ts index 2301e62a..8bb2f433 100644 --- a/tests/wire/accounts.test.ts +++ b/tests/wire/accounts.test.ts @@ -28,6 +28,7 @@ describe("AccountsClient", () => { server.mockEndpoint().get("/account-members").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.listAccountMembers({ + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000, @@ -252,6 +253,13 @@ describe("AccountsClient", () => { { created_at: "2024-01-15T09:30:00Z", description: "description", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", last_used_at: "2024-01-15T09:30:00Z", @@ -277,6 +285,13 @@ describe("AccountsClient", () => { { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -378,6 +393,13 @@ describe("AccountsClient", () => { data: { created_at: "2024-01-15T09:30:00Z", description: "description", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", last_used_at: "2024-01-15T09:30:00Z", @@ -406,6 +428,13 @@ describe("AccountsClient", () => { data: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -539,6 +568,13 @@ describe("AccountsClient", () => { data: { created_at: "2024-01-15T09:30:00Z", description: "description", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", last_used_at: "2024-01-15T09:30:00Z", @@ -563,6 +599,13 @@ describe("AccountsClient", () => { data: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -661,6 +704,13 @@ describe("AccountsClient", () => { data: { created_at: "2024-01-15T09:30:00Z", description: "description", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", last_used_at: "2024-01-15T09:30:00Z", @@ -686,6 +736,13 @@ describe("AccountsClient", () => { data: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1035,6 +1092,13 @@ describe("AccountsClient", () => { actor_type: "api_key", api_key_id: "api_key_id", ended_at: "2024-01-15T09:30:00Z", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", method: "method", @@ -1077,6 +1141,13 @@ describe("AccountsClient", () => { actorType: "api_key", apiKeyId: "api_key_id", endedAt: new Date("2024-01-15T09:30:00.000Z"), + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", method: "method", @@ -1177,6 +1248,13 @@ describe("AccountsClient", () => { actor_type: "api_key", api_key_id: "api_key_id", ended_at: "2024-01-15T09:30:00Z", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", method: "method", @@ -1210,6 +1288,13 @@ describe("AccountsClient", () => { actorType: "api_key", apiKeyId: "api_key_id", endedAt: new Date("2024-01-15T09:30:00.000Z"), + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", method: "method", @@ -1437,6 +1522,7 @@ describe("AccountsClient", () => { server.mockEndpoint().get("/environments").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.accounts.listEnvironments({ + ids: ["ids"], limit: 1000000, offset: 1000000, }); diff --git a/tests/wire/billing.test.ts b/tests/wire/billing.test.ts index 482a32c8..cccec919 100644 --- a/tests/wire/billing.test.ts +++ b/tests/wire/billing.test.ts @@ -639,6 +639,7 @@ describe("BillingClient", () => { server.mockEndpoint().get("/billing/customers").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listCustomersWithSubscriptions({ + companyIds: ["company_ids"], name: "name", providerType: "orb", q: "q", @@ -768,6 +769,7 @@ describe("BillingClient", () => { .build(); const response = await client.billing.countCustomers({ + companyIds: ["company_ids"], name: "name", providerType: "orb", q: "q", @@ -2032,6 +2034,7 @@ describe("BillingClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -2073,10 +2076,12 @@ describe("BillingClient", () => { currency: "currency", forInitialPlan: true, forTrialExpiryPlan: true, + ids: ["ids"], interval: "interval", isActive: true, price: 1000000, productId: "product_id", + productIds: ["product_ids"], providerType: "orb", q: "q", tiersMode: "graduated", @@ -2097,6 +2102,7 @@ describe("BillingClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -2219,6 +2225,7 @@ describe("BillingClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2258,6 +2265,7 @@ describe("BillingClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2650,6 +2658,7 @@ describe("BillingClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -2697,10 +2706,12 @@ describe("BillingClient", () => { currency: "currency", forInitialPlan: true, forTrialExpiryPlan: true, + ids: ["ids"], interval: "interval", isActive: true, price: 1000000, productId: "product_id", + productIds: ["product_ids"], providerType: "orb", q: "q", tiersMode: "graduated", @@ -2721,6 +2732,7 @@ describe("BillingClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -3195,6 +3207,7 @@ describe("BillingClient", () => { server.mockEndpoint().get("/billing/products").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.billing.listBillingProducts({ + ids: ["ids"], isActive: true, name: "name", priceUsageType: "licensed", @@ -3349,6 +3362,7 @@ describe("BillingClient", () => { .build(); const response = await client.billing.countBillingProducts({ + ids: ["ids"], isActive: true, name: "name", priceUsageType: "licensed", diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index b7072e53..637e5bd7 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -483,7 +483,7 @@ describe("CheckoutClient", () => { { charge_type: "free", company_count: 1000000, - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], description: "description", @@ -507,11 +507,11 @@ describe("CheckoutClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -528,11 +528,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -545,7 +545,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -631,7 +631,7 @@ describe("CheckoutClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -668,11 +668,11 @@ describe("CheckoutClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -689,11 +689,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -706,7 +706,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -980,8 +980,8 @@ describe("CheckoutClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1050,7 +1050,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -1127,7 +1127,7 @@ describe("CheckoutClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -1164,11 +1164,11 @@ describe("CheckoutClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1185,11 +1185,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1202,7 +1202,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1346,6 +1346,7 @@ describe("CheckoutClient", () => { usage_type: "licensed", }, ], + provider_type: "orb", status: "status", subscription_external_id: "subscription_external_id", total_price: 1000000, @@ -1373,7 +1374,7 @@ describe("CheckoutClient", () => { { chargeType: "free", companyCount: 1000000, - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -1401,11 +1402,11 @@ describe("CheckoutClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1427,11 +1428,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1449,7 +1450,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1540,7 +1541,7 @@ describe("CheckoutClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1581,11 +1582,11 @@ describe("CheckoutClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1607,11 +1608,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1629,7 +1630,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1925,8 +1926,8 @@ describe("CheckoutClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2000,7 +2001,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -2084,7 +2085,7 @@ describe("CheckoutClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2125,11 +2126,11 @@ describe("CheckoutClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2151,11 +2152,11 @@ describe("CheckoutClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2173,7 +2174,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2327,6 +2328,7 @@ describe("CheckoutClient", () => { usageType: "licensed", }, ], + providerType: "orb", status: "status", subscriptionExternalId: "subscription_external_id", totalPrice: 1000000, @@ -3140,8 +3142,8 @@ describe("CheckoutClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -3210,7 +3212,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -3451,8 +3453,8 @@ describe("CheckoutClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -3526,7 +3528,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -4482,8 +4484,8 @@ describe("CheckoutClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -4552,7 +4554,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -4776,8 +4778,8 @@ describe("CheckoutClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -4851,7 +4853,7 @@ describe("CheckoutClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], diff --git a/tests/wire/companies.test.ts b/tests/wire/companies.test.ts index e9191ff4..4a4f6956 100644 --- a/tests/wire/companies.test.ts +++ b/tests/wire/companies.test.ts @@ -189,8 +189,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -259,7 +259,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -305,13 +305,18 @@ describe("CompaniesClient", () => { server.mockEndpoint().get("/companies").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listCompanies({ + creditTypeIds: ["credit_type_ids"], hasScheduledDowngrade: true, + ids: ["ids"], monetizedSubscriptions: true, planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", q: "q", sortOrderColumn: "sort_order_column", sortOrderDirection: "asc", + subscriptionStatuses: ["active"], + subscriptionTypes: ["free"], withEntitlementFor: "with_entitlement_for", withoutFeatureOverrideFor: "without_feature_override_for", withoutPlan: true, @@ -508,8 +513,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -583,7 +588,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -919,8 +924,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -997,7 +1002,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -1266,8 +1271,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1349,7 +1354,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -1723,8 +1728,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1801,7 +1806,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -2065,8 +2070,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2148,7 +2153,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -2409,13 +2414,18 @@ describe("CompaniesClient", () => { server.mockEndpoint().get("/companies/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.countCompanies({ + creditTypeIds: ["credit_type_ids"], hasScheduledDowngrade: true, + ids: ["ids"], monetizedSubscriptions: true, planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", q: "q", sortOrderColumn: "sort_order_column", sortOrderDirection: "asc", + subscriptionStatuses: ["active"], + subscriptionTypes: ["free"], withEntitlementFor: "with_entitlement_for", withoutFeatureOverrideFor: "without_feature_override_for", withoutPlan: true, @@ -2742,8 +2752,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2820,7 +2830,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -3089,8 +3099,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -3172,7 +3182,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -4427,7 +4437,7 @@ describe("CompaniesClient", () => { feature_key: "feature_key", metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "first_of_month", + month_reset: "billing_cycle", soft_limit: 1000000, usage: 1000000, value_type: "boolean", @@ -4443,7 +4453,7 @@ describe("CompaniesClient", () => { feature_key: "feature_key", metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "first_of_month", + month_reset: "billing_cycle", soft_limit: 1000000, usage: 1000000, value_type: "boolean", @@ -4536,8 +4546,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", valid_until: "2024-01-15T09:30:00Z", value: 1000000, }, @@ -4549,8 +4559,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", valid_until: "2024-01-15T09:30:00Z", value: 1000000, }, @@ -4796,7 +4806,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4817,7 +4827,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4842,7 +4852,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4863,7 +4873,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4888,7 +4898,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4909,7 +4919,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4922,7 +4932,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, { @@ -4944,7 +4954,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4965,7 +4975,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -4990,7 +5000,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -5011,7 +5021,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -5036,7 +5046,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -5057,7 +5067,7 @@ describe("CompaniesClient", () => { event_subtype: "event_subtype", id: "id", metric_period: "all_time", - metric_period_month_reset: "first_of_month", + metric_period_month_reset: "billing_cycle", metric_value: 1000000, operator: "eq", resource_ids: ["resource_ids", "resource_ids"], @@ -5070,7 +5080,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -6070,7 +6080,7 @@ describe("CompaniesClient", () => { featureKey: "feature_key", metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "first_of_month", + monthReset: "billing_cycle", softLimit: 1000000, usage: 1000000, valueType: "boolean", @@ -6086,7 +6096,7 @@ describe("CompaniesClient", () => { featureKey: "feature_key", metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "first_of_month", + monthReset: "billing_cycle", softLimit: 1000000, usage: 1000000, valueType: "boolean", @@ -6179,8 +6189,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", validUntil: new Date("2024-01-15T09:30:00.000Z"), value: 1000000, }, @@ -6192,8 +6202,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", validUntil: new Date("2024-01-15T09:30:00.000Z"), value: 1000000, }, @@ -6459,7 +6469,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6484,7 +6494,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6513,7 +6523,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6538,7 +6548,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6567,7 +6577,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6592,7 +6602,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6609,7 +6619,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, { @@ -6631,7 +6641,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6656,7 +6666,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6685,7 +6695,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6710,7 +6720,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6739,7 +6749,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6764,7 +6774,7 @@ describe("CompaniesClient", () => { eventSubtype: "event_subtype", id: "id", metricPeriod: "all_time", - metricPeriodMonthReset: "first_of_month", + metricPeriodMonthReset: "billing_cycle", metricValue: 1000000, operator: "eq", resourceIds: ["resource_ids", "resource_ids"], @@ -6781,7 +6791,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -7406,6 +7416,7 @@ describe("CompaniesClient", () => { usage_type: "licensed", }, ], + provider_type: "orb", status: "status", subscription_external_id: "subscription_external_id", total_price: 1000000, @@ -7425,6 +7436,7 @@ describe("CompaniesClient", () => { const response = await client.companies.getActiveCompanySubscription({ companyId: "company_id", + companyIds: ["company_ids"], limit: 1000000, offset: 1000000, }); @@ -7494,6 +7506,7 @@ describe("CompaniesClient", () => { usageType: "licensed", }, ], + providerType: "orb", status: "status", subscriptionExternalId: "subscription_external_id", totalPrice: 1000000, @@ -7829,8 +7842,8 @@ describe("CompaniesClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -7907,7 +7920,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -8177,8 +8190,8 @@ describe("CompaniesClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -8260,7 +8273,7 @@ describe("CompaniesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -8441,6 +8454,7 @@ describe("CompaniesClient", () => { const response = await client.companies.listEntityKeyDefinitions({ entityType: "company", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000, @@ -8579,6 +8593,7 @@ describe("CompaniesClient", () => { const response = await client.companies.countEntityKeyDefinitions({ entityType: "company", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000, @@ -8729,8 +8744,10 @@ describe("CompaniesClient", () => { const response = await client.companies.listEntityTraitDefinitions({ entityType: "company", + ids: ["ids"], q: "q", traitType: "boolean", + traitTypes: ["boolean"], limit: 1000000, offset: 1000000, }); @@ -9320,8 +9337,10 @@ describe("CompaniesClient", () => { const response = await client.companies.countEntityTraitDefinitions({ entityType: "company", + ids: ["ids"], q: "q", traitType: "boolean", + traitTypes: ["boolean"], limit: 1000000, offset: 1000000, }); @@ -9667,6 +9686,8 @@ describe("CompaniesClient", () => { action: "checkout", basePlanAction: "fallback", companyId: "company_id", + companyIds: ["company_ids"], + planIds: ["plan_ids"], limit: 1000000, offset: 1000000, }); @@ -9852,6 +9873,13 @@ describe("CompaniesClient", () => { api_key: { created_at: "2024-01-15T09:30:00Z", description: "description", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", last_used_at: "2024-01-15T09:30:00Z", @@ -9864,6 +9892,13 @@ describe("CompaniesClient", () => { actor_type: "api_key", api_key_id: "api_key_id", ended_at: "2024-01-15T09:30:00Z", + environment: { + created_at: "2024-01-15T09:30:00Z", + environment_type: "development", + id: "id", + name: "name", + updated_at: "2024-01-15T09:30:00Z", + }, environment_id: "environment_id", id: "id", method: "method", @@ -9949,6 +9984,13 @@ describe("CompaniesClient", () => { apiKey: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -9961,6 +10003,13 @@ describe("CompaniesClient", () => { actorType: "api_key", apiKeyId: "api_key_id", endedAt: new Date("2024-01-15T09:30:00.000Z"), + environment: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + environmentType: "development", + id: "id", + name: "name", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, environmentId: "environment_id", id: "id", method: "method", @@ -10142,8 +10191,10 @@ describe("CompaniesClient", () => { server.mockEndpoint().get("/plan-traits").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.listPlanTraits({ + ids: ["ids"], planId: "plan_id", traitId: "trait_id", + traitIds: ["trait_ids"], limit: 1000000, offset: 1000000, }); @@ -10237,177 +10288,6 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Schematic.InternalServerError); }); - test("createPlanTrait (1)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { - data: { - account_id: "account_id", - created_at: "2024-01-15T09:30:00Z", - environment_id: "environment_id", - id: "id", - plan_id: "plan_id", - plan_type: "plan_type", - trait_id: "trait_id", - trait_value: "trait_value", - updated_at: "2024-01-15T09:30:00Z", - }, - params: { key: "value" }, - }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - expect(response).toEqual({ - data: { - accountId: "account_id", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "environment_id", - id: "id", - planId: "plan_id", - planType: "plan_type", - traitId: "trait_id", - traitValue: "trait_value", - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - }, - params: { - key: "value", - }, - }); - }); - - test("createPlanTrait (2)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.BadRequestError); - }); - - test("createPlanTrait (3)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.UnauthorizedError); - }); - - test("createPlanTrait (4)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.ForbiddenError); - }); - - test("createPlanTrait (5)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.NotFoundError); - }); - - test("createPlanTrait (6)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_id: "trait_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .post("/plan-traits") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.createPlanTrait({ - planId: "plan_id", - traitId: "trait_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.InternalServerError); - }); - test("getPlanTrait (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -10530,291 +10410,6 @@ describe("CompaniesClient", () => { }).rejects.toThrow(Schematic.InternalServerError); }); - test("updatePlanTrait (1)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { - data: { - account_id: "account_id", - created_at: "2024-01-15T09:30:00Z", - environment_id: "environment_id", - id: "id", - plan_id: "plan_id", - plan_type: "plan_type", - trait_id: "trait_id", - trait_value: "trait_value", - updated_at: "2024-01-15T09:30:00Z", - }, - params: { key: "value" }, - }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - expect(response).toEqual({ - data: { - accountId: "account_id", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - environmentId: "environment_id", - id: "id", - planId: "plan_id", - planType: "plan_type", - traitId: "trait_id", - traitValue: "trait_value", - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - }, - params: { - key: "value", - }, - }); - }); - - test("updatePlanTrait (2)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.BadRequestError); - }); - - test("updatePlanTrait (3)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.UnauthorizedError); - }); - - test("updatePlanTrait (4)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.ForbiddenError); - }); - - test("updatePlanTrait (5)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.NotFoundError); - }); - - test("updatePlanTrait (6)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - const rawRequestBody = { plan_id: "plan_id", trait_value: "trait_value" }; - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .put("/plan-traits/plan_trait_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.updatePlanTrait("plan_trait_id", { - planId: "plan_id", - traitValue: "trait_value", - }); - }).rejects.toThrow(Schematic.InternalServerError); - }); - - test("deletePlanTrait (1)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { data: { deleted: true }, params: { key: "value" } }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.companies.deletePlanTrait("plan_trait_id"); - expect(response).toEqual({ - data: { - deleted: true, - }, - params: { - key: "value", - }, - }); - }); - - test("deletePlanTrait (2)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deletePlanTrait("plan_trait_id"); - }).rejects.toThrow(Schematic.BadRequestError); - }); - - test("deletePlanTrait (3)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deletePlanTrait("plan_trait_id"); - }).rejects.toThrow(Schematic.UnauthorizedError); - }); - - test("deletePlanTrait (4)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deletePlanTrait("plan_trait_id"); - }).rejects.toThrow(Schematic.ForbiddenError); - }); - - test("deletePlanTrait (5)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deletePlanTrait("plan_trait_id"); - }).rejects.toThrow(Schematic.NotFoundError); - }); - - test("deletePlanTrait (6)", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - const rawResponseBody = { error: "error" }; - - server - .mockEndpoint() - .delete("/plan-traits/plan_trait_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.companies.deletePlanTrait("plan_trait_id"); - }).rejects.toThrow(Schematic.InternalServerError); - }); - test("updatePlanTraitsBulk (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -11098,8 +10693,10 @@ describe("CompaniesClient", () => { server.mockEndpoint().get("/plan-traits/count").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.companies.countPlanTraits({ + ids: ["ids"], planId: "plan_id", traitId: "trait_id", + traitIds: ["trait_ids"], limit: 1000000, offset: 1000000, }); @@ -11484,6 +11081,7 @@ describe("CompaniesClient", () => { const response = await client.companies.listUsers({ companyId: "company_id", + ids: ["ids"], planId: "plan_id", q: "q", limit: 1000000, @@ -12102,6 +11700,7 @@ describe("CompaniesClient", () => { const response = await client.companies.countUsers({ companyId: "company_id", + ids: ["ids"], planId: "plan_id", q: "q", limit: 1000000, diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 365d13cf..39df38cc 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -768,7 +768,7 @@ describe("ComponentsClient", () => { company_can_trial: true, company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], current: true, @@ -807,11 +807,11 @@ describe("ComponentsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -828,11 +828,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -845,7 +845,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -914,7 +914,7 @@ describe("ComponentsClient", () => { company_can_trial: true, company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], current: true, @@ -953,11 +953,11 @@ describe("ComponentsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -974,11 +974,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -991,7 +991,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1243,8 +1243,8 @@ describe("ComponentsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1313,7 +1313,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -1421,7 +1421,7 @@ describe("ComponentsClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -1458,11 +1458,11 @@ describe("ComponentsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1479,11 +1479,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1496,7 +1496,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1656,7 +1656,7 @@ describe("ComponentsClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -1693,11 +1693,11 @@ describe("ComponentsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1714,11 +1714,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1731,7 +1731,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1900,6 +1900,7 @@ describe("ComponentsClient", () => { usage_type: "licensed", }, ], + provider_type: "orb", status: "status", subscription_external_id: "subscription_external_id", total_price: 1000000, @@ -1951,7 +1952,7 @@ describe("ComponentsClient", () => { companyCanTrial: true, companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -1998,11 +1999,11 @@ describe("ComponentsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2024,11 +2025,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2046,7 +2047,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2120,7 +2121,7 @@ describe("ComponentsClient", () => { companyCanTrial: true, companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -2167,11 +2168,11 @@ describe("ComponentsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2193,11 +2194,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2215,7 +2216,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2491,8 +2492,8 @@ describe("ComponentsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2566,7 +2567,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -2678,7 +2679,7 @@ describe("ComponentsClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2719,11 +2720,11 @@ describe("ComponentsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2745,11 +2746,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2767,7 +2768,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2932,7 +2933,7 @@ describe("ComponentsClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2973,11 +2974,11 @@ describe("ComponentsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2999,11 +3000,11 @@ describe("ComponentsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3021,7 +3022,7 @@ describe("ComponentsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -3195,6 +3196,7 @@ describe("ComponentsClient", () => { usageType: "licensed", }, ], + providerType: "orb", status: "status", subscriptionExternalId: "subscription_external_id", totalPrice: 1000000, diff --git a/tests/wire/componentspublic.test.ts b/tests/wire/componentspublic.test.ts index 570e0640..10c8954c 100644 --- a/tests/wire/componentspublic.test.ts +++ b/tests/wire/componentspublic.test.ts @@ -16,7 +16,7 @@ describe("ComponentspublicClient", () => { charge_type: "free", company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], custom: true, @@ -54,11 +54,11 @@ describe("ComponentspublicClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -75,11 +75,11 @@ describe("ComponentspublicClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -92,7 +92,7 @@ describe("ComponentspublicClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -151,7 +151,7 @@ describe("ComponentspublicClient", () => { charge_type: "free", company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], custom: true, @@ -189,11 +189,11 @@ describe("ComponentspublicClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -210,11 +210,11 @@ describe("ComponentspublicClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -227,7 +227,7 @@ describe("ComponentspublicClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -311,7 +311,7 @@ describe("ComponentspublicClient", () => { chargeType: "free", companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -357,11 +357,11 @@ describe("ComponentspublicClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -383,11 +383,11 @@ describe("ComponentspublicClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -405,7 +405,7 @@ describe("ComponentspublicClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -469,7 +469,7 @@ describe("ComponentspublicClient", () => { chargeType: "free", companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -515,11 +515,11 @@ describe("ComponentspublicClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -541,11 +541,11 @@ describe("ComponentspublicClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -563,7 +563,7 @@ describe("ComponentspublicClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, diff --git a/tests/wire/credits.test.ts b/tests/wire/credits.test.ts index 660ab2c0..7130c360 100644 --- a/tests/wire/credits.test.ts +++ b/tests/wire/credits.test.ts @@ -56,6 +56,7 @@ describe("CreditsClient", () => { server.mockEndpoint().get("/billing/credits").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.credits.listBillingCredits({ + ids: ["ids"], name: "name", limit: 1000000, offset: 1000000, @@ -202,6 +203,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -264,6 +266,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -435,6 +438,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -492,6 +496,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -619,6 +624,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -680,6 +686,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1008,6 +1015,7 @@ describe("CreditsClient", () => { .build(); const response = await client.credits.listCreditBundles({ + ids: ["ids"], creditId: "credit_id", status: "active", bundleType: "fixed", @@ -1197,6 +1205,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1210,6 +1219,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1261,6 +1271,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1274,6 +1285,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1463,6 +1475,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1476,6 +1489,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1521,6 +1535,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1534,6 +1549,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1649,6 +1665,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1662,6 +1679,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1711,6 +1729,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1724,6 +1743,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1997,6 +2017,7 @@ describe("CreditsClient", () => { .build(); const response = await client.credits.countCreditBundles({ + ids: ["ids"], creditId: "credit_id", status: "active", bundleType: "fixed", @@ -2131,6 +2152,7 @@ describe("CreditsClient", () => { .build(); const response = await client.credits.countBillingCredits({ + ids: ["ids"], name: "name", limit: 1000000, offset: 1000000, @@ -2266,6 +2288,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2324,6 +2347,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2484,6 +2508,7 @@ describe("CreditsClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2547,6 +2572,7 @@ describe("CreditsClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -3100,6 +3126,7 @@ describe("CreditsClient", () => { const response = await client.credits.countBillingCreditsGrants({ creditId: "credit_id", + ids: ["ids"], limit: 1000000, offset: 1000000, }); @@ -3274,6 +3301,7 @@ describe("CreditsClient", () => { const response = await client.credits.listGrantsForCredit({ creditId: "credit_id", + ids: ["ids"], limit: 1000000, offset: 1000000, }); @@ -3876,7 +3904,9 @@ describe("CreditsClient", () => { const response = await client.credits.listBillingPlanCreditGrants({ creditId: "credit_id", + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", limit: 1000000, offset: 1000000, @@ -5036,7 +5066,9 @@ describe("CreditsClient", () => { const response = await client.credits.countBillingPlanCreditGrants({ creditId: "credit_id", + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", limit: 1000000, offset: 1000000, diff --git a/tests/wire/entitlements.test.ts b/tests/wire/entitlements.test.ts index 052aba2c..196ce7a9 100644 --- a/tests/wire/entitlements.test.ts +++ b/tests/wire/entitlements.test.ts @@ -130,8 +130,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -182,7 +182,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -205,8 +205,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -252,7 +252,10 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.listCompanyOverrides({ companyId: "company_id", + companyIds: ["company_ids"], featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], withoutExpired: true, q: "q", limit: 1000000, @@ -385,8 +388,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -442,7 +445,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -465,8 +468,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -758,8 +761,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -828,7 +831,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -860,7 +863,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -869,8 +872,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -1103,8 +1106,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1178,7 +1181,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -1212,7 +1215,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -1221,8 +1224,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -1560,8 +1563,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1630,7 +1633,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -1662,7 +1665,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -1671,8 +1674,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -1900,8 +1903,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -1975,7 +1978,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -2009,7 +2012,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -2018,8 +2021,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -2313,8 +2316,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2383,7 +2386,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -2415,7 +2418,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -2424,8 +2427,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -2656,8 +2659,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -2731,7 +2734,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -2765,7 +2768,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -2774,8 +2777,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3068,7 +3071,10 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.countCompanyOverrides({ companyId: "company_id", + companyIds: ["company_ids"], featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], withoutExpired: true, q: "q", limit: 1000000, @@ -3315,8 +3321,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -3367,7 +3373,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -3425,11 +3431,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3446,11 +3452,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3463,7 +3469,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -3480,7 +3486,7 @@ describe("EntitlementsClient", () => { has_valid_allocation: true, is_unlimited: true, metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "month_reset", + month_reset: "billing_cycle", monthly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -3502,7 +3508,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percent_used: 1.1, - period: "period", + period: "all_time", plan: { created_at: "2024-01-15T09:30:00Z", description: "description", @@ -3688,8 +3694,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -3745,7 +3751,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -3810,11 +3816,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3836,11 +3842,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3858,7 +3864,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -3880,7 +3886,7 @@ describe("EntitlementsClient", () => { hasValidAllocation: true, isUnlimited: true, metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "month_reset", + monthReset: "billing_cycle", monthlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -3902,7 +3908,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percentUsed: 1.1, - period: "period", + period: "all_time", plan: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -4237,11 +4243,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -4258,11 +4264,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -4275,7 +4281,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -4292,7 +4298,7 @@ describe("EntitlementsClient", () => { has_valid_allocation: true, is_unlimited: true, metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "month_reset", + month_reset: "billing_cycle", monthly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -4314,7 +4320,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percent_used: 1.1, - period: "period", + period: "all_time", plan: { created_at: "2024-01-15T09:30:00Z", description: "description", @@ -4375,6 +4381,7 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.listFeatureUsage({ companyId: "company_id", + featureIds: ["feature_ids"], includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, @@ -4445,11 +4452,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -4471,11 +4478,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -4493,7 +4500,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -4515,7 +4522,7 @@ describe("EntitlementsClient", () => { hasValidAllocation: true, isUnlimited: true, metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "month_reset", + monthReset: "billing_cycle", monthlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -4537,7 +4544,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percentUsed: 1.1, - period: "period", + period: "all_time", plan: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -4857,6 +4864,7 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.countFeatureUsage({ companyId: "company_id", + featureIds: ["feature_ids"], includeUsageAggregation: true, q: "q", withoutNegativeEntitlements: true, @@ -5105,8 +5113,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -5157,7 +5165,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -5185,11 +5193,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -5206,11 +5214,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -5223,7 +5231,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -5238,8 +5246,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", }, metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", plan: { created_at: "2024-01-15T09:30:00Z", description: "description", @@ -5400,8 +5408,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -5457,7 +5465,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -5485,11 +5493,11 @@ describe("EntitlementsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -5511,11 +5519,11 @@ describe("EntitlementsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -5533,7 +5541,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -5553,8 +5561,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", plan: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -5865,8 +5873,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { created_at: "2024-01-15T09:30:00Z", description: "description", @@ -5941,8 +5949,12 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.listPlanEntitlements({ featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", + planVersionIds: ["plan_version_ids"], q: "q", withMeteredProducts: true, limit: 1000000, @@ -6014,8 +6026,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { createdAt: new Date("2024-01-15T09:30:00.000Z"), description: "description", @@ -6180,7 +6192,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -6199,6 +6211,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -6223,6 +6236,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -6237,8 +6251,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { company_id: "company_id", copied_from_plan_id: "copied_from_plan_id", @@ -6363,7 +6377,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -6382,6 +6396,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -6406,6 +6421,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -6420,8 +6436,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { companyId: "company_id", copiedFromPlanId: "copied_from_plan_id", @@ -6659,7 +6675,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -6678,6 +6694,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -6702,6 +6719,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -6716,8 +6734,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { company_id: "company_id", copied_from_plan_id: "copied_from_plan_id", @@ -6837,7 +6855,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -6856,6 +6874,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -6880,6 +6899,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -6894,8 +6914,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { companyId: "company_id", copiedFromPlanId: "copied_from_plan_id", @@ -7089,7 +7109,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -7108,6 +7128,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -7132,6 +7153,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -7146,8 +7168,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { company_id: "company_id", copied_from_plan_id: "copied_from_plan_id", @@ -7270,7 +7292,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -7289,6 +7311,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -7313,6 +7336,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -7327,8 +7351,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { companyId: "company_id", copiedFromPlanId: "copied_from_plan_id", @@ -7682,7 +7706,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -7701,6 +7725,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -7725,6 +7750,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -7739,8 +7765,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { company_id: "company_id", copied_from_plan_id: "copied_from_plan_id", @@ -7867,7 +7893,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -7886,6 +7912,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -7910,6 +7937,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -7924,8 +7952,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { companyId: "company_id", copiedFromPlanId: "copied_from_plan_id", @@ -8210,8 +8238,12 @@ describe("EntitlementsClient", () => { const response = await client.entitlements.countPlanEntitlements({ featureId: "feature_id", + featureIds: ["feature_ids"], + ids: ["ids"], planId: "plan_id", + planIds: ["plan_ids"], planVersionId: "plan_version_id", + planVersionIds: ["plan_version_ids"], q: "q", withMeteredProducts: true, limit: 1000000, @@ -8689,8 +8721,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, { @@ -8701,8 +8733,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -8743,7 +8775,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, { @@ -8754,7 +8786,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -8786,7 +8818,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -8795,8 +8827,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -8902,7 +8934,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -8913,7 +8945,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -8925,7 +8957,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -8950,7 +8982,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -8961,7 +8993,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -8973,7 +9005,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -8984,7 +9016,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [ { description: "description", id: "id", image_url: "image_url", name: "name" }, @@ -9007,7 +9039,7 @@ describe("EntitlementsClient", () => { has_valid_allocation: true, is_unlimited: true, metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "month_reset", + month_reset: "billing_cycle", monthly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -9018,6 +9050,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -9047,7 +9080,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percent_used: 1.1, - period: "period", + period: "all_time", plan: { audience_type: "audience_type", company_id: "company_id", @@ -9162,7 +9195,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -9181,6 +9214,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -9205,6 +9239,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -9219,8 +9254,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { audience_type: "audience_type", company_id: "company_id", @@ -9319,6 +9354,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -9500,8 +9536,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, { @@ -9512,8 +9548,8 @@ describe("EntitlementsClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -9554,7 +9590,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, { @@ -9565,7 +9601,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -9597,7 +9633,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -9606,8 +9642,8 @@ describe("EntitlementsClient", () => { }, feature_id: "feature_id", id: "id", - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", notes: [ { created_at: "2024-01-15T09:30:00Z", @@ -9713,7 +9749,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -9724,7 +9760,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -9736,7 +9772,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -9761,7 +9797,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -9772,7 +9808,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -9784,7 +9820,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -9795,7 +9831,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [ { description: "description", id: "id", image_url: "image_url", name: "name" }, @@ -9818,7 +9854,7 @@ describe("EntitlementsClient", () => { has_valid_allocation: true, is_unlimited: true, metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "month_reset", + month_reset: "billing_cycle", monthly_usage_based_price: { billing_scheme: "per_unit", created_at: "2024-01-15T09:30:00Z", @@ -9829,6 +9865,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -9858,7 +9895,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percent_used: 1.1, - period: "period", + period: "all_time", plan: { audience_type: "audience_type", company_id: "company_id", @@ -9973,7 +10010,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -9992,6 +10029,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -10016,6 +10054,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -10030,8 +10069,8 @@ describe("EntitlementsClient", () => { updated_at: "2024-01-15T09:30:00Z", usage_type: "licensed", }, - metric_period: "metric_period", - metric_period_month_reset: "metric_period_month_reset", + metric_period: "all_time", + metric_period_month_reset: "billing_cycle", plan: { audience_type: "audience_type", company_id: "company_id", @@ -10130,6 +10169,7 @@ describe("EntitlementsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -10344,8 +10384,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, { @@ -10356,8 +10396,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -10408,7 +10448,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, { @@ -10419,7 +10459,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -10455,7 +10495,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -10464,8 +10504,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -10573,7 +10613,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -10584,7 +10624,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -10596,7 +10636,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -10621,7 +10661,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -10632,7 +10672,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -10644,7 +10684,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -10655,7 +10695,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -10688,7 +10728,7 @@ describe("EntitlementsClient", () => { hasValidAllocation: true, isUnlimited: true, metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "month_reset", + monthReset: "billing_cycle", monthlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -10699,6 +10739,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -10728,7 +10769,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percentUsed: 1.1, - period: "period", + period: "all_time", plan: { audienceType: "audience_type", companyId: "company_id", @@ -10843,7 +10884,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -10862,6 +10903,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -10886,6 +10928,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -10900,8 +10943,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { audienceType: "audience_type", companyId: "company_id", @@ -11007,6 +11050,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -11206,8 +11250,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, { @@ -11218,8 +11262,8 @@ describe("EntitlementsClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -11270,7 +11314,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, { @@ -11281,7 +11325,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -11317,7 +11361,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -11326,8 +11370,8 @@ describe("EntitlementsClient", () => { }, featureId: "feature_id", id: "id", - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", notes: [ { createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -11435,7 +11479,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -11446,7 +11490,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -11458,7 +11502,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -11483,7 +11527,7 @@ describe("EntitlementsClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -11494,7 +11538,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -11506,7 +11550,7 @@ describe("EntitlementsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -11517,7 +11561,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -11550,7 +11594,7 @@ describe("EntitlementsClient", () => { hasValidAllocation: true, isUnlimited: true, metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "month_reset", + monthReset: "billing_cycle", monthlyUsageBasedPrice: { billingScheme: "per_unit", createdAt: new Date("2024-01-15T09:30:00.000Z"), @@ -11561,6 +11605,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -11590,7 +11635,7 @@ describe("EntitlementsClient", () => { }, overuse: 1000000, percentUsed: 1.1, - period: "period", + period: "all_time", plan: { audienceType: "audience_type", companyId: "company_id", @@ -11705,7 +11750,7 @@ describe("EntitlementsClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -11724,6 +11769,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -11748,6 +11794,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -11762,8 +11809,8 @@ describe("EntitlementsClient", () => { updatedAt: new Date("2024-01-15T09:30:00.000Z"), usageType: "licensed", }, - metricPeriod: "metric_period", - metricPeriodMonthReset: "metric_period_month_reset", + metricPeriod: "all_time", + metricPeriodMonthReset: "billing_cycle", plan: { audienceType: "audience_type", companyId: "company_id", @@ -11869,6 +11916,7 @@ describe("EntitlementsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index c1c9039d..9ff09c71 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -215,6 +215,7 @@ describe("EventsClient", () => { const response = await client.events.getEventSummaries({ q: "q", + eventSubtypes: ["event_subtypes"], limit: 1000000, offset: 1000000, }); @@ -347,6 +348,7 @@ describe("EventsClient", () => { const response = await client.events.listEvents({ companyId: "company_id", eventSubtype: "event_subtype", + eventTypes: ["flag_check"], flagId: "flag_id", userId: "user_id", limit: 1000000, diff --git a/tests/wire/features.test.ts b/tests/wire/features.test.ts index f5c5457c..4a1f97ed 100644 --- a/tests/wire/features.test.ts +++ b/tests/wire/features.test.ts @@ -43,11 +43,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -64,11 +64,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -81,7 +81,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -92,7 +92,13 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + id: "id", + permissions: { key: ["billing_credits_edit"] }, + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [{ id: "id", name: "name" }], plural_name: "plural_name", @@ -127,6 +133,8 @@ describe("FeaturesClient", () => { const response = await client.features.listFeatures({ booleanRequireEvent: true, + featureType: ["boolean"], + ids: ["ids"], planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -168,11 +176,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -194,11 +202,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -216,7 +224,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -227,7 +235,15 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + id: "id", + permissions: { + key: ["billing_credits_edit"], + }, + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -367,11 +383,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -388,11 +404,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -405,7 +421,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -416,7 +432,17 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [{ id: "id", name: "name" }], plural_name: "plural_name", @@ -484,11 +510,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -510,11 +536,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -532,7 +558,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -543,7 +569,19 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -729,11 +767,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -750,11 +788,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -767,7 +805,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -778,7 +816,17 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [{ id: "id", name: "name" }], plural_name: "plural_name", @@ -841,11 +889,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -867,11 +915,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -889,7 +937,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -900,7 +948,19 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -1042,11 +1102,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1063,11 +1123,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1080,7 +1140,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1091,7 +1151,17 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [{ id: "id", name: "name" }], plural_name: "plural_name", @@ -1155,11 +1225,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1181,11 +1251,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1203,7 +1273,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1214,7 +1284,19 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -1506,11 +1588,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1527,11 +1609,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1544,7 +1626,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1555,7 +1637,17 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plans: [{ id: "id", name: "name" }], plural_name: "plural_name", @@ -1625,11 +1717,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1651,11 +1743,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1673,7 +1765,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1684,7 +1776,19 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", plans: [ { @@ -1895,6 +1999,8 @@ describe("FeaturesClient", () => { const response = await client.features.countFeatures({ booleanRequireEvent: true, + featureType: ["boolean"], + ids: ["ids"], planVersionId: "plan_version_id", q: "q", withoutCompanyOverrideFor: "without_company_override_for", @@ -2009,7 +2115,13 @@ describe("FeaturesClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + id: "id", + permissions: { key: ["billing_credits_edit"] }, + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -2017,11 +2129,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2038,11 +2150,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2055,7 +2167,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2070,6 +2182,7 @@ describe("FeaturesClient", () => { const response = await client.features.listFlags({ featureId: "feature_id", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000, @@ -2094,7 +2207,15 @@ describe("FeaturesClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + id: "id", + permissions: { + key: ["billing_credits_edit"], + }, + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -2102,11 +2223,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2128,11 +2249,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2150,7 +2271,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2256,7 +2377,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -2268,7 +2389,17 @@ describe("FeaturesClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -2276,11 +2407,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2297,11 +2428,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2314,7 +2445,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2353,7 +2484,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -2365,7 +2496,19 @@ describe("FeaturesClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -2373,11 +2516,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2399,11 +2542,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2421,7 +2564,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2611,7 +2754,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -2623,7 +2766,17 @@ describe("FeaturesClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -2631,11 +2784,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2652,11 +2805,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2669,7 +2822,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2695,7 +2848,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -2707,7 +2860,19 @@ describe("FeaturesClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -2715,11 +2880,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2741,11 +2906,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2763,7 +2928,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2851,7 +3016,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecycle_phase: "add_on", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", plural_name: "plural_name", singular_name: "singular_name", @@ -2863,7 +3028,17 @@ describe("FeaturesClient", () => { id: "id", key: "key", last_checked_at: "2024-01-15T09:30:00Z", - maintainer_id: "maintainer_id", + maintainer: { + created_at: "2024-01-15T09:30:00Z", + email: "email", + id: "id", + image_url: "image_url", + name: "name", + permissions: { key: ["billing_credits_edit"] }, + role: "admin", + updated_at: "2024-01-15T09:30:00Z", + }, + maintainer_account_member_id: "maintainer_account_member_id", name: "name", rules: [ { @@ -2871,11 +3046,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2892,11 +3067,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2909,7 +3084,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2948,7 +3123,7 @@ describe("FeaturesClient", () => { icon: "icon", id: "id", lifecyclePhase: "add_on", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", pluralName: "plural_name", singularName: "singular_name", @@ -2960,7 +3135,19 @@ describe("FeaturesClient", () => { id: "id", key: "key", lastCheckedAt: new Date("2024-01-15T09:30:00.000Z"), - maintainerId: "maintainer_id", + maintainer: { + createdAt: new Date("2024-01-15T09:30:00.000Z"), + email: "email", + id: "id", + imageUrl: "image_url", + name: "name", + permissions: { + key: ["billing_credits_edit"], + }, + role: "admin", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", rules: [ { @@ -2968,11 +3155,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2994,11 +3181,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3016,7 +3203,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -3280,9 +3467,13 @@ describe("FeaturesClient", () => { rules: [ { condition_groups: [ - { conditions: [{ condition_type: "company", operator: "eq", resource_ids: ["resource_ids"] }] }, + { + conditions: [ + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids"] }, + ], + }, ], - conditions: [{ condition_type: "company", operator: "eq", resource_ids: ["resource_ids"] }], + conditions: [{ condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids"] }], name: "name", priority: 1000000, value: true, @@ -3299,7 +3490,7 @@ describe("FeaturesClient", () => { flag_type: "boolean", id: "id", key: "key", - maintainer_id: "maintainer_id", + maintainer_account_member_id: "maintainer_account_member_id", name: "name", updated_at: "2024-01-15T09:30:00Z", }, @@ -3309,11 +3500,11 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3330,11 +3521,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3347,7 +3538,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -3372,7 +3563,7 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids"], }, @@ -3381,7 +3572,7 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids"], }, @@ -3402,7 +3593,7 @@ describe("FeaturesClient", () => { flagType: "boolean", id: "id", key: "key", - maintainerId: "maintainer_id", + maintainerAccountMemberId: "maintainer_account_member_id", name: "name", updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, @@ -3412,11 +3603,11 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3438,11 +3629,11 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3460,7 +3651,7 @@ describe("FeaturesClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -3482,12 +3673,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3496,12 +3687,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3509,8 +3700,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3521,12 +3712,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3535,12 +3726,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3548,8 +3739,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3576,12 +3767,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3590,12 +3781,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3604,12 +3795,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3623,12 +3814,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3637,12 +3828,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3651,12 +3842,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3680,12 +3871,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3694,12 +3885,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3707,8 +3898,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3719,12 +3910,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3733,12 +3924,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3746,8 +3937,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3774,12 +3965,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3788,12 +3979,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3802,12 +3993,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3821,12 +4012,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3835,12 +4026,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3849,12 +4040,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3878,12 +4069,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3892,12 +4083,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3905,8 +4096,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3917,12 +4108,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3931,12 +4122,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -3944,8 +4135,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -3972,12 +4163,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -3986,12 +4177,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4000,12 +4191,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4019,12 +4210,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4033,12 +4224,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4047,12 +4238,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4076,12 +4267,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4090,12 +4281,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4103,8 +4294,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -4115,12 +4306,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4129,12 +4320,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4142,8 +4333,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -4170,12 +4361,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4184,12 +4375,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4198,12 +4389,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4217,12 +4408,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4231,12 +4422,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4245,12 +4436,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4274,12 +4465,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4288,12 +4479,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4301,8 +4492,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -4313,12 +4504,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4327,12 +4518,12 @@ describe("FeaturesClient", () => { { conditions: [ { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, { - condition_type: "company", + condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"], }, @@ -4340,8 +4531,8 @@ describe("FeaturesClient", () => { }, ], conditions: [ - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, - { condition_type: "company", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, + { condition_type: "base_plan", operator: "eq", resource_ids: ["resource_ids", "resource_ids"] }, ], name: "name", priority: 1000000, @@ -4368,12 +4559,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4382,12 +4573,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4396,12 +4587,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4415,12 +4606,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4429,12 +4620,12 @@ describe("FeaturesClient", () => { { conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4443,12 +4634,12 @@ describe("FeaturesClient", () => { ], conditions: [ { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, { - conditionType: "company", + conditionType: "base_plan", operator: "eq", resourceIds: ["resource_ids", "resource_ids"], }, @@ -4480,17 +4671,18 @@ describe("FeaturesClient", () => { feature_key: "feature_key", metric_period: "all_time", metric_reset_at: "2024-01-15T09:30:00Z", - month_reset: "first_of_month", + month_reset: "billing_cycle", soft_limit: 1000000, usage: 1000000, value_type: "boolean", }, error: "error", + feature_usage_period: "all_time", flag: "flag", flag_id: "flag_id", reason: "reason", rule_id: "rule_id", - rule_type: "rule_type", + rule_type: "company_override", user_id: "user_id", value: true, }, @@ -4521,17 +4713,18 @@ describe("FeaturesClient", () => { featureKey: "feature_key", metricPeriod: "all_time", metricResetAt: new Date("2024-01-15T09:30:00.000Z"), - monthReset: "first_of_month", + monthReset: "billing_cycle", softLimit: 1000000, usage: 1000000, valueType: "boolean", }, error: "error", + featureUsagePeriod: "all_time", flag: "flag", flagId: "flag_id", reason: "reason", ruleId: "rule_id", - ruleType: "rule_type", + ruleType: "company_override", userId: "user_id", value: true, }, @@ -4949,6 +5142,7 @@ describe("FeaturesClient", () => { const response = await client.features.countFlags({ featureId: "feature_id", + ids: ["ids"], q: "q", limit: 1000000, offset: 1000000, diff --git a/tests/wire/main.test.ts b/tests/wire/main.test.ts deleted file mode 100644 index 1a0955c9..00000000 --- a/tests/wire/main.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import { SchematicClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; - -describe("SchematicClient", () => { - test("putPlanAudiencesPlanAudienceId", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - server.mockEndpoint().put("/plan-audiences/plan_audience_id").respondWith().statusCode(200).build(); - - const response = await client.putPlanAudiencesPlanAudienceId("plan_audience_id"); - expect(response).toEqual(undefined); - }); - - test("deletePlanAudiencesPlanAudienceId", async () => { - const server = mockServerPool.createServer(); - const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); - - server.mockEndpoint().delete("/plan-audiences/plan_audience_id").respondWith().statusCode(200).build(); - - const response = await client.deletePlanAudiencesPlanAudienceId("plan_audience_id"); - expect(response).toEqual(undefined); - }); -}); diff --git a/tests/wire/plangroups.test.ts b/tests/wire/plangroups.test.ts index b4f668f3..5fb31578 100644 --- a/tests/wire/plangroups.test.ts +++ b/tests/wire/plangroups.test.ts @@ -16,7 +16,7 @@ describe("PlangroupsClient", () => { charge_type: "free", company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], description: "description", @@ -53,11 +53,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -74,11 +74,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -91,7 +91,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -190,7 +190,7 @@ describe("PlangroupsClient", () => { company_id: "company_id", company_name: "company_name", compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -245,11 +245,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -266,11 +266,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -283,7 +283,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -411,7 +411,7 @@ describe("PlangroupsClient", () => { company_id: "company_id", company_name: "company_name", compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -466,11 +466,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -487,11 +487,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -504,7 +504,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -634,7 +634,7 @@ describe("PlangroupsClient", () => { company_id: "company_id", company_name: "company_name", compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -689,11 +689,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -710,11 +710,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -727,7 +727,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -818,6 +818,7 @@ describe("PlangroupsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -841,7 +842,7 @@ describe("PlangroupsClient", () => { charge_type: "free", company_count: 1000000, compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], description: "description", @@ -878,11 +879,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -899,11 +900,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -916,7 +917,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1018,7 +1019,7 @@ describe("PlangroupsClient", () => { company_id: "company_id", company_name: "company_name", compatible_plan_ids: ["compatible_plan_ids"], - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -1073,11 +1074,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1094,11 +1095,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1111,7 +1112,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1202,6 +1203,7 @@ describe("PlangroupsClient", () => { meter_event_name: "meter_event_name", meter_event_payload_key: "meter_event_payload_key", meter_id: "meter_id", + nickname: "nickname", package_size: 1000000, price: 1000000, price_decimal: "price_decimal", @@ -1234,7 +1236,7 @@ describe("PlangroupsClient", () => { chargeType: "free", companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -1279,11 +1281,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1305,11 +1307,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1327,7 +1329,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1439,7 +1441,7 @@ describe("PlangroupsClient", () => { companyId: "company_id", companyName: "company_name", compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1502,11 +1504,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1528,11 +1530,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1550,7 +1552,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1683,7 +1685,7 @@ describe("PlangroupsClient", () => { companyId: "company_id", companyName: "company_name", compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1746,11 +1748,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1772,11 +1774,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1794,7 +1796,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1929,7 +1931,7 @@ describe("PlangroupsClient", () => { companyId: "company_id", companyName: "company_name", compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1992,11 +1994,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2018,11 +2020,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2040,7 +2042,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2136,6 +2138,7 @@ describe("PlangroupsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", @@ -2171,7 +2174,7 @@ describe("PlangroupsClient", () => { chargeType: "free", companyCount: 1000000, compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ { @@ -2216,11 +2219,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2242,11 +2245,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2264,7 +2267,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2371,7 +2374,7 @@ describe("PlangroupsClient", () => { companyId: "company_id", companyName: "company_name", compatiblePlanIds: ["compatible_plan_ids"], - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2434,11 +2437,11 @@ describe("PlangroupsClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2460,11 +2463,11 @@ describe("PlangroupsClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2482,7 +2485,7 @@ describe("PlangroupsClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2578,6 +2581,7 @@ describe("PlangroupsClient", () => { meterEventName: "meter_event_name", meterEventPayloadKey: "meter_event_payload_key", meterId: "meter_id", + nickname: "nickname", packageSize: 1000000, price: 1000000, priceDecimal: "price_decimal", diff --git a/tests/wire/plans.test.ts b/tests/wire/plans.test.ts index 5d2454fa..635b0748 100644 --- a/tests/wire/plans.test.ts +++ b/tests/wire/plans.test.ts @@ -230,8 +230,8 @@ describe("PlansClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -308,7 +308,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -575,8 +575,8 @@ describe("PlansClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -658,7 +658,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -797,6 +797,426 @@ describe("PlansClient", () => { }).rejects.toThrow(Schematic.InternalServerError); }); + test("listCustomPlanBillings (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { + data: [ + { + activation_strategy: "on_payment", + company_id: "company_id", + created_at: "2024-01-15T09:30:00Z", + days_until_due: 1000000, + id: "id", + paid_at: "2024-01-15T09:30:00Z", + plan_id: "plan_id", + published_at: "2024-01-15T09:30:00Z", + status: "active", + stripe_invoice_url: "stripe_invoice_url", + updated_at: "2024-01-15T09:30:00Z", + }, + ], + params: { + company_id: "company_id", + limit: 1000000, + offset: 1000000, + plan_id: "plan_id", + status: "active", + statuses: ["active"], + }, + }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.plans.listCustomPlanBillings({ + companyId: "company_id", + planId: "plan_id", + status: "active", + statuses: ["active"], + limit: 1000000, + offset: 1000000, + }); + expect(response).toEqual({ + data: [ + { + activationStrategy: "on_payment", + companyId: "company_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + daysUntilDue: 1000000, + id: "id", + paidAt: new Date("2024-01-15T09:30:00.000Z"), + planId: "plan_id", + publishedAt: new Date("2024-01-15T09:30:00.000Z"), + status: "active", + stripeInvoiceUrl: "stripe_invoice_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + ], + params: { + companyId: "company_id", + limit: 1000000, + offset: 1000000, + planId: "plan_id", + status: "active", + statuses: ["active"], + }, + }); + }); + + test("listCustomPlanBillings (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.listCustomPlanBillings(); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("listCustomPlanBillings (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.listCustomPlanBillings(); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("listCustomPlanBillings (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.listCustomPlanBillings(); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("listCustomPlanBillings (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.listCustomPlanBillings(); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("listCustomPlanBillings (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .get("/custom-plan-billings") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.listCustomPlanBillings(); + }).rejects.toThrow(Schematic.InternalServerError); + }); + + test("retryCustomPlanBilling (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [{ price_id: "price_id", quantity: 1000000 }], + }; + const rawResponseBody = { + data: { + activation_strategy: "on_payment", + company_id: "company_id", + created_at: "2024-01-15T09:30:00Z", + days_until_due: 1000000, + id: "id", + paid_at: "2024-01-15T09:30:00Z", + plan_id: "plan_id", + published_at: "2024-01-15T09:30:00Z", + status: "active", + stripe_invoice_url: "stripe_invoice_url", + updated_at: "2024-01-15T09:30:00Z", + }, + params: { key: "value" }, + }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + expect(response).toEqual({ + data: { + activationStrategy: "on_payment", + companyId: "company_id", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + daysUntilDue: 1000000, + id: "id", + paidAt: new Date("2024-01-15T09:30:00.000Z"), + planId: "plan_id", + publishedAt: new Date("2024-01-15T09:30:00.000Z"), + status: "active", + stripeInvoiceUrl: "stripe_invoice_url", + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + }, + params: { + key: "value", + }, + }); + }); + + test("retryCustomPlanBilling (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [ + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, + ], + }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + }).rejects.toThrow(Schematic.BadRequestError); + }); + + test("retryCustomPlanBilling (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [ + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, + ], + }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + }).rejects.toThrow(Schematic.UnauthorizedError); + }); + + test("retryCustomPlanBilling (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [ + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, + ], + }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + }).rejects.toThrow(Schematic.ForbiddenError); + }); + + test("retryCustomPlanBilling (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [ + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, + ], + }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(404) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + }).rejects.toThrow(Schematic.NotFoundError); + }); + + test("retryCustomPlanBilling (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); + const rawRequestBody = { + customer_email: "customer_email", + pay_in_advance: [ + { price_id: "price_id", quantity: 1000000 }, + { price_id: "price_id", quantity: 1000000 }, + ], + }; + const rawResponseBody = { error: "error" }; + + server + .mockEndpoint() + .put("/custom-plan-billings/custom_plan_billing_id/retry") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.plans.retryCustomPlanBilling("custom_plan_billing_id", { + customerEmail: "customer_email", + payInAdvance: [ + { + priceId: "price_id", + quantity: 1000000, + }, + { + priceId: "price_id", + quantity: 1000000, + }, + ], + }); + }).rejects.toThrow(Schematic.InternalServerError); + }); + test("createCustomPlan (1)", async () => { const server = mockServerPool.createServer(); const client = new SchematicClient({ maxRetries: 0, apiKey: "test", environment: server.baseUrl }); @@ -851,7 +1271,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -889,11 +1309,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -910,11 +1330,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -927,7 +1347,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -965,6 +1385,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -976,6 +1397,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1003,6 +1425,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -1076,7 +1499,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1118,11 +1541,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1144,11 +1567,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1166,7 +1589,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1209,6 +1632,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1220,6 +1644,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1247,6 +1672,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -1432,7 +1858,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -1469,11 +1895,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1490,11 +1916,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -1507,7 +1933,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -1589,6 +2015,7 @@ describe("PlansClient", () => { ], params: { company_id: "company_id", + exclude_company_scoped: true, for_fallback_plan: true, for_initial_plan: true, for_trial_expiry_plan: true, @@ -1609,10 +2036,12 @@ describe("PlansClient", () => { const response = await client.plans.listPlans({ companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + ids: ["ids"], includeDraftVersions: true, planType: "plan", q: "q", @@ -1671,7 +2100,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -1712,11 +2141,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1738,11 +2167,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -1760,7 +2189,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -1847,6 +2276,7 @@ describe("PlansClient", () => { ], params: { companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, @@ -1983,7 +2413,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -2021,11 +2451,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2042,11 +2472,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2059,7 +2489,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2097,6 +2527,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2108,6 +2539,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2135,6 +2567,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2208,7 +2641,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2250,11 +2683,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2276,11 +2709,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2298,7 +2731,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2341,6 +2774,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2352,6 +2786,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2379,6 +2814,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2565,7 +3001,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -2603,11 +3039,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2624,11 +3060,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -2641,7 +3077,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -2679,6 +3115,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2690,6 +3127,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2717,6 +3155,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -2781,7 +3220,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -2823,11 +3262,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2849,11 +3288,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -2871,7 +3310,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -2914,6 +3353,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2925,6 +3365,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -2952,6 +3393,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -3070,7 +3512,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -3108,11 +3550,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3129,11 +3571,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3146,7 +3588,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -3184,6 +3626,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -3195,6 +3638,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -3222,6 +3666,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -3293,7 +3738,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -3335,11 +3780,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3361,11 +3806,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -3383,7 +3828,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -3426,6 +3871,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -3437,6 +3883,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -3464,6 +3911,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -3899,7 +4347,7 @@ describe("PlansClient", () => { company_count: 1000000, company_id: "company_id", company_name: "company_name", - controlled_by: "controlled_by", + controlled_by: "orb", copied_from_plan_id: "copied_from_plan_id", created_at: "2024-01-15T09:30:00Z", currency_prices: [{ currency: "currency" }], @@ -3937,11 +4385,11 @@ describe("PlansClient", () => { { conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3958,11 +4406,11 @@ describe("PlansClient", () => { ], conditions: [ { - condition_type: "condition_type", + condition_type: "base_plan", created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", id: "id", - operator: "operator", + operator: "eq", resource_ids: ["resource_ids"], resources: [{ id: "id", name: "name" }], rule_id: "rule_id", @@ -3975,7 +4423,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "rule_type", + rule_type: "company_override", updated_at: "2024-01-15T09:30:00Z", value: true, }, @@ -4013,6 +4461,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -4024,6 +4473,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -4051,6 +4501,7 @@ describe("PlansClient", () => { external_price_id: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, price_decimal: "price_decimal", provider_type: "orb", @@ -4126,7 +4577,7 @@ describe("PlansClient", () => { companyCount: 1000000, companyId: "company_id", companyName: "company_name", - controlledBy: "controlled_by", + controlledBy: "orb", copiedFromPlanId: "copied_from_plan_id", createdAt: new Date("2024-01-15T09:30:00.000Z"), currencyPrices: [ @@ -4168,11 +4619,11 @@ describe("PlansClient", () => { { conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -4194,11 +4645,11 @@ describe("PlansClient", () => { ], conditions: [ { - conditionType: "condition_type", + conditionType: "base_plan", createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", id: "id", - operator: "operator", + operator: "eq", resourceIds: ["resource_ids"], resources: [ { @@ -4216,7 +4667,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "rule_type", + ruleType: "company_override", updatedAt: new Date("2024-01-15T09:30:00.000Z"), value: true, }, @@ -4259,6 +4710,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -4270,6 +4722,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -4297,6 +4750,7 @@ describe("PlansClient", () => { externalPriceId: "external_price_id", id: "id", interval: "day", + nickname: "nickname", price: 1000000, priceDecimal: "price_decimal", providerType: "orb", @@ -4653,8 +5107,8 @@ describe("PlansClient", () => { created_at: "2024-01-15T09:30:00Z", environment_id: "environment_id", event_subtype: "event_subtype", - month_reset: "month_reset", - period: "period", + month_reset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -4723,7 +5177,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - rule_type: "default", + rule_type: "company_override", value: true, }, ], @@ -4948,8 +5402,8 @@ describe("PlansClient", () => { createdAt: new Date("2024-01-15T09:30:00.000Z"), environmentId: "environment_id", eventSubtype: "event_subtype", - monthReset: "month_reset", - period: "period", + monthReset: "billing_cycle", + period: "all_time", value: 1000000, }, ], @@ -5023,7 +5477,7 @@ describe("PlansClient", () => { id: "id", name: "name", priority: 1000000, - ruleType: "default", + ruleType: "company_override", value: true, }, ], @@ -5308,6 +5762,7 @@ describe("PlansClient", () => { data: { count: 1 }, params: { company_id: "company_id", + exclude_company_scoped: true, for_fallback_plan: true, for_initial_plan: true, for_trial_expiry_plan: true, @@ -5328,10 +5783,12 @@ describe("PlansClient", () => { const response = await client.plans.countPlans({ companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, hasProductId: true, + ids: ["ids"], includeDraftVersions: true, planType: "plan", q: "q", @@ -5347,6 +5804,7 @@ describe("PlansClient", () => { }, params: { companyId: "company_id", + excludeCompanyScoped: true, forFallbackPlan: true, forInitialPlan: true, forTrialExpiryPlan: true, diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index 5069c0e9..0fd71f87 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -39,6 +39,7 @@ describe("WebhooksClient", () => { server.mockEndpoint().get("/webhook-events").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.webhooks.listWebhookEvents({ + ids: ["ids"], q: "q", webhookId: "webhook_id", limit: 1000000, @@ -315,6 +316,7 @@ describe("WebhooksClient", () => { .build(); const response = await client.webhooks.countWebhookEvents({ + ids: ["ids"], q: "q", webhookId: "webhook_id", limit: 1000000, diff --git a/yarn.lock b/yarn.lock index 3f33362f..15841a9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -338,30 +338,30 @@ dependencies: statuses "^2.0.1" -"@cloudflare/workerd-darwin-64@1.20260410.1": - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260410.1.tgz#948ff85d30c7d5acfb6b207171146fadcd175abf" - integrity sha512-0sh6xPmCKUfv/lUklP1dfyeKxCuEZGS0HeduxnucL8ECxSgAdWTOD42h/lQTwZCIiWtyHB+ZNB9hsS2Mlf0tMQ== - -"@cloudflare/workerd-darwin-arm64@1.20260410.1": - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260410.1.tgz#a2b0df54d436dfd60e2b209d816355d1db47a5fc" - integrity sha512-r2On29gPvlk/eiH/OpeUT23xoB8W8D1PHr8lul5nyxElLqvh3yNxZUnJWrbcOl+ubfrvw7+jFwgopMe17xyf0g== - -"@cloudflare/workerd-linux-64@1.20260410.1": - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260410.1.tgz#4a4c80eed2d0c70edfa990814518b8c96f1fe077" - integrity sha512-qWORRcAzPZeHJjrcYBNZTN6Y9l+iZQUz4KBdWbNrM6My4CpNrXS5kErPR373vG//5QPaDGwMXgBqyn9xfzarJQ== - -"@cloudflare/workerd-linux-arm64@1.20260410.1": - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260410.1.tgz#02e93769b596c7d7a2b96240fa567fbd3fa4c0f0" - integrity sha512-jQfuHL4mnGDFyomSS3JNs9TpTvCu6Vzz2QSNCfJRstMzTICUFLMc4Vp/xKK+M5xkb0PoAu/G0hHx7jrxB2j+OQ== - -"@cloudflare/workerd-windows-64@1.20260410.1": - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260410.1.tgz#76dd6f04b269ab388b2340707f872fa1f15acc76" - integrity sha512-h8q/nbheDqpknY7AAOz19MuQkZAR1/bnoZnKipyeUPXt5No+y6HlTtva9Bohx5Fhc1MW2CX2MQVdb55qtkkqZQ== +"@cloudflare/workerd-darwin-64@1.20260421.1": + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260421.1.tgz#35227b588ca6416cffcbf7cf562b700f38253cc4" + integrity sha512-DLU5ZTZ1VHeZZnj0PuVJEMHKGisfLe2XShyImP5P/PPj/m/t7CLEJmPiI7FMxvT7ynArkckJl7m+Z5x7u4Kkdw== + +"@cloudflare/workerd-darwin-arm64@1.20260421.1": + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20260421.1.tgz#8c011faff6bf4ee112b6b69a4b81473c8d10f309" + integrity sha512-Trotq3xRAkIcpC505WoxM8+kIH4JIvOJCNuRatyHcz9uF5S+ukgiVUFUlM+GIjw1uCM/Bda2St+vSniX1RZdpw== + +"@cloudflare/workerd-linux-64@1.20260421.1": + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20260421.1.tgz#b6d4fa15df4dfaeb36aa945eab6bec7f258d396c" + integrity sha512-938QjUv0z+QqK6BAvgwX/lCIZ2b224ZXoXtGTbhyNVMhB+mt4Dj24cj9qca4ekNXjVM7uTKp1yOHZO97fVSacw== + +"@cloudflare/workerd-linux-arm64@1.20260421.1": + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20260421.1.tgz#f7368ffe9d6100a51aa93bd13ebd5a3e189c4469" + integrity sha512-YI4+mLfwnJcKJ+iPyxzx+tp2Jy4o29BxBPSQGZxl/AZyvZ9eTKsmNZmtjEiT4i3O/M0tdO/B/d9ESDHbRCs2rQ== + +"@cloudflare/workerd-windows-64@1.20260421.1": + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20260421.1.tgz#0f2780fec52af191df47f7eec244cf7e5b0f50eb" + integrity sha512-q1SFgwlNH9lFmw74vh7EJbJtduo92Nx51mNOfd3/u6pux6AldcwRviYzKEEv3FEbtv6OBB7J8D5f8vtZj7Z6Sg== "@cspotcode/source-map-support@0.8.1": version "0.8.1" @@ -371,9 +371,9 @@ "@jridgewell/trace-mapping" "0.3.9" "@emnapi/runtime@^1.7.0": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.9.2.tgz#8b469a3db160817cadb1de9050211a9d1ea84fa2" - integrity sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw== + version "1.10.0" + resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.10.0.tgz#4b260c0d3534204e98c6110b8db1a987d26ec87c" + integrity sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA== dependencies: tslib "^2.4.0" @@ -1521,9 +1521,9 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== baseline-browser-mapping@^2.10.12: - version "2.10.18" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.18.tgz#565745085ba7743af7d4072707ad132db3a5a42f" - integrity sha512-VSnGQAOLtP5mib/DPyg2/t+Tlv65NTBz83BJBJvmLVHHuKJVaDOBvJJykiT5TR++em5nfAySPccDZDa4oSrn8A== + version "2.10.21" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.21.tgz#136f9f181ee0d7ca6e3edbf42d9559763d2c1141" + integrity sha512-Q+rUQ7Uz8AHM7DEaNdwvfFCTq7a43lNTzuS94eiWqwyxfV/wJv+oUivef51T91mmRY4d4A1u9rcSvkeufCVXlA== brace-expansion@^1.1.7: version "1.1.14" @@ -1602,9 +1602,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001782: - version "1.0.30001787" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001787.tgz#fd25c5e42e2d35df5c75eddda00d15d9c0c68f81" - integrity sha512-mNcrMN9KeI68u7muanUpEejSLghOKlVhRqS/Za2IeyGllJ9I9otGpR9g3nsw7n4W378TE/LyIteA0+/FOZm4Kg== + version "1.0.30001790" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001790.tgz#04660c7de15f445d86dd10ac88a8936ac0698e45" + integrity sha512-bOoxfJPyYo+ds6W0YfptaCWbFnJYjh2Y1Eow5lRv+vI2u8ganPZqNm1JwNh0t2ELQCqIWg4B3dWEusgAmsoyOw== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1809,9 +1809,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.328: - version "1.5.335" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.335.tgz#0b957cea44ef86795c227c616d16b4803d119daa" - integrity sha512-q9n5T4BR4Xwa2cwbrwcsDJtHD/enpQ5S1xF1IAtdqf5AAgqDFmR/aakqH3ChFdqd/QXJhS3rnnXFtexU7rax6Q== + version "1.5.344" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.344.tgz#6437cc08a7d9b914a98120e182f37793c9eaffd4" + integrity sha512-4MxfbmNDm+KPh066EZy+eUnkcDPcZ35wNmOWzFuh/ijvHsve6kbLTLURy88uCNK5FbpN+yk2nQY6BYh1GEt+wg== emittery@^0.13.1: version "0.13.1" @@ -1824,12 +1824,12 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enhanced-resolve@^5.0.0, enhanced-resolve@^5.20.0: - version "5.20.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz#eeeb3966bea62c348c40a0cc9e7912e2557d0be0" - integrity sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA== + version "5.21.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.21.0.tgz#bb8e6fabaf74930de70e61397798750429e5b1ae" + integrity sha512-otxSQPw4lkOZWkHpB3zaEQs6gWYEsmX4xQF68ElXC/TWvGxGMSGOvoNbaLXm6/cS/fSfHtsEdw90y20PCd+sCA== dependencies: graceful-fs "^4.2.4" - tapable "^2.3.0" + tapable "^2.3.3" entities@^6.0.0: version "6.0.1" @@ -2183,9 +2183,9 @@ has-tostringtag@^1.0.2: has-symbols "^1.0.3" hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + version "2.0.3" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.3.tgz#5e5c2b15b60370a4c7930c383dfb76bf17bc403c" + integrity sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg== dependencies: function-bind "^1.1.2" @@ -2797,7 +2797,7 @@ jsesc@^3.0.2: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== -json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: +json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -2898,7 +2898,12 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.27: +mime-db@^1.54.0: + version "1.54.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" + integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== + +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -2911,14 +2916,14 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== miniflare@^4.20260305.0: - version "4.20260410.0" - resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260410.0.tgz#4ba812fc09e1156ed95ca1ef677255907fa33432" - integrity sha512-94LEU8d+XPVGp18eW4+bu1v7Tnq7srhqWMIsrx2jhSkdbTnGqg1I613R0GKY4eygBYl9MbqXEhzK/bczJb6uMg== + version "4.20260421.0" + resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-4.20260421.0.tgz#adadc9c24f19423bda916c17e477c274830023cb" + integrity sha512-7ZkNQ7brgQ2hh5ha9iQCDUjxBkLvuiG2VdDns9esRL8O8lXg+MoP6E0dO1rtp+ZY2I+vV1tPWr6td5IojkewLw== dependencies: "@cspotcode/source-map-support" "0.8.1" sharp "^0.34.5" - undici "7.24.4" - workerd "1.20260410.1" + undici "7.24.8" + workerd "1.20260421.1" ws "8.18.0" youch "4.1.0-beta.10" @@ -2992,9 +2997,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.36: - version "2.0.37" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.37.tgz#9bd4f10b77ba39c2b9402d4e8399c482a797f671" - integrity sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg== + version "2.0.38" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.38.tgz#791569b9e4424a044e12c3abfad418ed83ce9947" + integrity sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw== normalize-path@^3.0.0: version "3.0.0" @@ -3455,15 +3460,15 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tapable@^2.3.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.2.tgz#86755feabad08d82a26b891db044808c6ad00f15" - integrity sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA== +tapable@^2.3.0, tapable@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.3.tgz#5da7c9992c46038221267985ab28421a8879f160" + integrity sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A== terser-webpack-plugin@^5.3.17: - version "5.4.0" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.4.0.tgz#95fc4cf4437e587be11ecf37d08636089174d76b" - integrity sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g== + version "5.5.0" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.5.0.tgz#d92b8e2c892dd09c683c38120394267e8d8660ef" + integrity sha512-UYhptBwhWvfIjKd/UuFo6D8uq9xpGLDK+z8EDsj/zWhrTaH34cKEbrkMKfV5YWqGBvAYA3tlzZbs2R+qYrbQJA== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -3471,9 +3476,9 @@ terser-webpack-plugin@^5.3.17: terser "^5.31.1" terser@^5.31.1: - version "5.46.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.46.1.tgz#40e4b1e35d5f13130f82793a8b3eeb7ec3a92eee" - integrity sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ== + version "5.46.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.46.2.tgz#b9529672d5b0024c7959571c83b82f65077b2a4f" + integrity sha512-uxfo9fPcSgLDYob/w1FuL0c99MWiJDnv+5qXSQc5+Ki5NjVNsYi66INnMFBjf6uFz6OnX12piJQPF4IpjJTNTw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3608,10 +3613,10 @@ undici-types@~7.19.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.19.2.tgz#1b67fc26d0f157a0cba3a58a5b5c1e2276b8ba2a" integrity sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg== -undici@7.24.4: - version "7.24.4" - resolved "https://registry.yarnpkg.com/undici/-/undici-7.24.4.tgz#873bce680d7c6354c941399fd4e8ea4563de4ea7" - integrity sha512-BM/JzwwaRXxrLdElV2Uo6cTLEjhSb3WXboncJamZ15NgUURmvlXvxa6xkwIOILIjPNo9i8ku136ZvWV0Uly8+w== +undici@7.24.8: + version "7.24.8" + resolved "https://registry.yarnpkg.com/undici/-/undici-7.24.8.tgz#8207d06a68955d4420e50468f2749e940b3eb4cf" + integrity sha512-6KQ/+QxK49Z/p3HO6E5ZCZWNnCasyZLa5ExaVYyvPxUwKtbCPMKELJOqh7EqOle0t9cH/7d2TaaTRRa6Nhs4YQ== universalify@^0.2.0: version "0.2.0" @@ -3676,14 +3681,14 @@ webidl-conversions@^7.0.0: integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== webpack-sources@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.4.tgz#a338b95eb484ecc75fbb196cbe8a2890618b4891" - integrity sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q== + version "3.4.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.4.0.tgz#67cdfdff349ff1e3e7ca5c1ed6a2802b84cf6cf5" + integrity sha512-gHwIe1cgBvvfLeu1Yz/dcFpmHfKDVxxyqI+kzqmuxZED81z2ChxpyqPaWcNqigPywhaEke7AjSGga+kxY55gjQ== webpack@^5.105.4: - version "5.106.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.106.1.tgz#0a3eeb43a50e4f67fbecd206e1e6fc2c89fc2b6f" - integrity sha512-EW8af29ak8Oaf4T8k8YsajjrDBDYgnKZ5er6ljWFJsXABfTNowQfvHLftwcepVgdz+IoLSdEAbBiM9DFXoll9w== + version "5.106.2" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.106.2.tgz#ca8174b4fd80f055cc5a45fcc5577d6db76c8ac5" + integrity sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3701,9 +3706,8 @@ webpack@^5.105.4: events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.11" - json-parse-even-better-errors "^2.3.1" loader-runner "^4.3.1" - mime-types "^2.1.27" + mime-db "^1.54.0" neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" @@ -3751,16 +3755,16 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -workerd@1.20260410.1: - version "1.20260410.1" - resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260410.1.tgz#3b9145d5447fb8aa8dcb50ddbc094233057551e3" - integrity sha512-T/GRD6Y5vN9g4CnGmOlfST1w7bj+1IjRFvX0K7CodZPJuPVPNPGhz8Wppah0WdT6A7I8Kad3zgZ2OkDdWtENrg== +workerd@1.20260421.1: + version "1.20260421.1" + resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20260421.1.tgz#922f46fcf3fc1598531df26060a66cac0cb107d8" + integrity sha512-zTYD+xFR4d7TUCxsyl7FTPth9a8CDgk8pM7xUWbJxo0SGUx+2e5C7Q5LrramBZwmuAErtzXmOjlQ15PtkPAhZA== optionalDependencies: - "@cloudflare/workerd-darwin-64" "1.20260410.1" - "@cloudflare/workerd-darwin-arm64" "1.20260410.1" - "@cloudflare/workerd-linux-64" "1.20260410.1" - "@cloudflare/workerd-linux-arm64" "1.20260410.1" - "@cloudflare/workerd-windows-64" "1.20260410.1" + "@cloudflare/workerd-darwin-64" "1.20260421.1" + "@cloudflare/workerd-darwin-arm64" "1.20260421.1" + "@cloudflare/workerd-linux-64" "1.20260421.1" + "@cloudflare/workerd-linux-arm64" "1.20260421.1" + "@cloudflare/workerd-windows-64" "1.20260421.1" wrap-ansi@^6.2.0: version "6.2.0" From e884d867d7e742dc6c335cc154753d08e7ac9ee8 Mon Sep 17 00:00:00 2001 From: Ben Papillon Date: Thu, 23 Apr 2026 17:02:36 -0700 Subject: [PATCH 2/2] fix: use registered enum types for rulesengine MetricPeriod/RuleType The API spec now emits shared Rulesengine{MetricPeriod,MetricPeriodMonthReset,RuleType} types instead of per-field inline enums like RulesengineFeatureEntitlementMetricPeriod and RulesengineCheckFlagResultRuleType. Update hand-written wrappers accordingly. --- src/rules-engine.ts | 6 +++--- src/wrapper.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rules-engine.ts b/src/rules-engine.ts index 891722da..ebb7a112 100644 --- a/src/rules-engine.ts +++ b/src/rules-engine.ts @@ -9,8 +9,8 @@ export interface WasmFeatureEntitlement { softLimit?: number; usage?: number; eventName?: string; - metricPeriod?: Schematic.RulesengineFeatureEntitlementMetricPeriod; - monthReset?: Schematic.RulesengineFeatureEntitlementMonthReset; + metricPeriod?: Schematic.RulesengineMetricPeriod; + monthReset?: Schematic.RulesengineMetricPeriodMonthReset; metricResetAt?: string; creditId?: string; creditTotal?: number; @@ -27,7 +27,7 @@ export interface WasmCheckFlagResult { flagKey?: string; companyId?: string; userId?: string; - ruleType?: Schematic.RulesengineCheckFlagResultRuleType; + ruleType?: Schematic.RulesengineRuleType; err?: string; entitlement?: WasmFeatureEntitlement; featureAllocation?: number; diff --git a/src/wrapper.ts b/src/wrapper.ts index 7e4e6260..ca492633 100644 --- a/src/wrapper.ts +++ b/src/wrapper.ts @@ -70,7 +70,7 @@ export interface CheckFlagWithEntitlementResponse { flagId?: string; reason: string; ruleId?: string; - ruleType?: api.RulesengineCheckFlagResultRuleType; + ruleType?: api.RulesengineRuleType; userId?: string; value: boolean; } @@ -296,7 +296,7 @@ export class SchematicClient extends BaseClient { flagId: response.data.flagId, reason: response.data.reason, ruleId: response.data.ruleId, - ruleType: response.data.ruleType as api.RulesengineCheckFlagResultRuleType | undefined, + ruleType: response.data.ruleType as api.RulesengineRuleType | undefined, userId: response.data.userId, value: response.data.value, }; @@ -407,7 +407,7 @@ export class SchematicClient extends BaseClient { flagId: apiResult.flagId, reason: apiResult.reason, ruleId: apiResult.ruleId, - ruleType: apiResult.ruleType as api.RulesengineCheckFlagResultRuleType | undefined, + ruleType: apiResult.ruleType as api.RulesengineRuleType | undefined, userId: apiResult.userId, value: apiResult.value, };