@schematichq/schematic-typescript-node 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -2
- package/dist/Client.d.ts +9 -0
- package/dist/api/resources/accounts/client/Client.d.ts +33 -16
- package/dist/api/resources/accounts/client/requests/CountAuditLogsRequest.d.ts +24 -0
- package/dist/api/resources/accounts/client/requests/CreateApiKeyRequestBody.d.ts +1 -0
- package/dist/api/resources/accounts/client/requests/ListAuditLogsRequest.d.ts +24 -0
- package/dist/api/resources/accounts/client/requests/index.d.ts +2 -2
- package/dist/api/resources/accounts/types/{ListApiRequestsParams.d.ts → CountAuditLogsParams.d.ts} +5 -2
- package/dist/api/resources/accounts/types/{CountApiRequestsResponse.d.ts → CountAuditLogsResponse.d.ts} +2 -2
- package/dist/api/resources/accounts/types/{GetApiRequestResponse.d.ts → GetAuditLogResponse.d.ts} +2 -2
- package/dist/api/resources/accounts/types/GetWhoAmIResponse.d.ts +6 -0
- package/dist/api/resources/accounts/types/{CountApiRequestsParams.d.ts → ListAuditLogsParams.d.ts} +5 -2
- package/dist/api/resources/accounts/types/ListAuditLogsResponse.d.ts +6 -0
- package/dist/api/resources/accounts/types/index.d.ts +6 -5
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +2 -0
- package/dist/api/resources/companies/client/Client.d.ts +12 -48
- package/dist/api/resources/companies/client/requests/CountCompaniesRequest.d.ts +27 -0
- package/dist/api/resources/companies/client/requests/ListCompaniesRequest.d.ts +27 -0
- package/dist/api/resources/companies/client/requests/index.d.ts +0 -2
- package/dist/api/resources/companies/types/CountCompaniesParams.d.ts +21 -0
- package/dist/api/resources/companies/types/ListCompaniesParams.d.ts +21 -0
- package/dist/api/resources/companies/types/index.d.ts +0 -4
- package/dist/api/resources/componentspublic/client/Client.d.ts +26 -0
- package/dist/api/resources/componentspublic/client/index.d.ts +1 -0
- package/dist/api/resources/componentspublic/index.d.ts +2 -0
- package/dist/api/resources/componentspublic/types/GetPublicPlansResponse.d.ts +6 -0
- package/dist/api/resources/componentspublic/types/index.d.ts +1 -0
- package/dist/api/resources/credits/client/Client.d.ts +50 -0
- package/dist/api/resources/credits/client/requests/CountBillingPlanCreditGrantsRequest.d.ts +3 -1
- package/dist/api/resources/credits/client/requests/CountCreditEventLedgerRequest.d.ts +26 -0
- package/dist/api/resources/credits/client/requests/ListBillingPlanCreditGrantsRequest.d.ts +3 -1
- package/dist/api/resources/credits/client/requests/ListCreditEventLedgerRequest.d.ts +26 -0
- package/dist/api/resources/credits/client/requests/index.d.ts +2 -0
- package/dist/api/resources/credits/types/CountBillingPlanCreditGrantsParams.d.ts +1 -0
- package/dist/api/resources/credits/types/CountCreditEventLedgerParams.d.ts +16 -0
- package/dist/api/resources/credits/types/CountCreditEventLedgerResponse.d.ts +6 -0
- package/dist/api/resources/credits/types/ListBillingPlanCreditGrantsParams.d.ts +1 -0
- package/dist/api/resources/credits/types/ListCreditEventLedgerParams.d.ts +16 -0
- package/dist/api/resources/credits/types/ListCreditEventLedgerResponse.d.ts +6 -0
- package/dist/api/resources/credits/types/index.d.ts +4 -0
- package/dist/api/resources/entitlements/client/Client.d.ts +22 -0
- package/dist/api/resources/entitlements/client/requests/CountPlanEntitlementsRequest.d.ts +5 -0
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +1 -0
- package/dist/api/resources/entitlements/client/requests/GetFeatureUsageTimeSeriesRequest.d.ts +18 -0
- package/dist/api/resources/entitlements/client/requests/ListPlanEntitlementsRequest.d.ts +5 -0
- package/dist/api/resources/entitlements/client/requests/index.d.ts +1 -0
- package/dist/api/resources/entitlements/types/CountPlanEntitlementsParams.d.ts +4 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageTimeSeriesParams.d.ts +11 -0
- package/dist/api/resources/entitlements/types/GetFeatureUsageTimeSeriesResponse.d.ts +6 -0
- package/dist/api/resources/entitlements/types/ListPlanEntitlementsParams.d.ts +4 -0
- package/dist/api/resources/entitlements/types/index.d.ts +2 -0
- package/dist/api/resources/features/client/Client.d.ts +2 -0
- package/dist/api/resources/features/client/requests/CountFeaturesRequest.d.ts +3 -0
- package/dist/api/resources/features/client/requests/ListFeaturesRequest.d.ts +3 -0
- package/dist/api/resources/features/types/CountFeaturesParams.d.ts +2 -0
- package/dist/api/resources/features/types/ListFeaturesParams.d.ts +2 -0
- package/dist/api/resources/index.d.ts +8 -0
- package/dist/api/resources/planbundle/client/requests/UpdatePlanBundleRequestBody.d.ts +1 -0
- package/dist/api/resources/plangroups/client/Client.d.ts +4 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +6 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +6 -0
- package/dist/api/resources/planmigrations/client/Client.d.ts +109 -0
- package/dist/api/resources/planmigrations/client/index.d.ts +1 -0
- package/dist/api/resources/planmigrations/client/requests/CountCompanyMigrationsRequest.d.ts +20 -0
- package/dist/api/resources/planmigrations/client/requests/CountMigrationsRequest.d.ts +18 -0
- package/dist/api/resources/planmigrations/client/requests/ListCompanyMigrationsRequest.d.ts +20 -0
- package/dist/api/resources/planmigrations/client/requests/ListMigrationsRequest.d.ts +18 -0
- package/dist/api/resources/planmigrations/client/requests/index.d.ts +4 -0
- package/dist/api/resources/planmigrations/index.d.ts +2 -0
- package/dist/api/resources/planmigrations/types/CountCompanyMigrationsParams.d.ts +13 -0
- package/dist/api/resources/planmigrations/types/CountCompanyMigrationsResponse.d.ts +6 -0
- package/dist/api/resources/planmigrations/types/CountMigrationsParams.d.ts +12 -0
- package/dist/api/resources/planmigrations/types/CountMigrationsResponse.d.ts +6 -0
- package/dist/api/resources/planmigrations/types/GetMigrationResponse.d.ts +6 -0
- package/dist/api/resources/planmigrations/types/ListCompanyMigrationsParams.d.ts +13 -0
- package/dist/api/resources/planmigrations/types/ListCompanyMigrationsResponse.d.ts +6 -0
- package/dist/api/resources/planmigrations/types/ListMigrationsParams.d.ts +12 -0
- package/dist/api/resources/planmigrations/types/ListMigrationsResponse.d.ts +6 -0
- package/dist/api/resources/planmigrations/types/index.d.ts +9 -0
- package/dist/api/resources/plans/client/Client.d.ts +41 -3
- package/dist/api/resources/plans/client/requests/GetPlanRequest.d.ts +10 -0
- package/dist/api/resources/plans/client/requests/ListPlanIssuesRequest.d.ts +3 -1
- package/dist/api/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +12 -0
- package/dist/api/resources/plans/client/requests/index.d.ts +2 -0
- package/dist/api/resources/plans/types/CountPlansParams.d.ts +1 -0
- package/dist/api/resources/plans/types/DeletePlanVersionResponse.d.ts +6 -0
- package/dist/api/resources/plans/types/GetPlanParams.d.ts +7 -0
- package/dist/api/resources/plans/types/GetPlanResponse.d.ts +1 -1
- package/dist/api/resources/plans/types/ListPlanIssuesParams.d.ts +1 -0
- package/dist/api/resources/plans/types/ListPlansParams.d.ts +1 -0
- package/dist/api/resources/plans/types/PublishPlanVersionResponse.d.ts +6 -0
- package/dist/api/resources/plans/types/index.d.ts +3 -0
- package/dist/api/resources/scheduledcheckout/client/Client.d.ts +83 -0
- package/dist/api/resources/scheduledcheckout/client/index.d.ts +1 -0
- package/dist/api/resources/scheduledcheckout/client/requests/CreateScheduledCheckoutRequest.d.ts +15 -0
- package/dist/api/resources/scheduledcheckout/client/requests/ListScheduledCheckoutsRequest.d.ts +18 -0
- package/dist/api/resources/scheduledcheckout/client/requests/UpdateScheduledCheckoutRequest.d.ts +9 -0
- package/dist/api/resources/scheduledcheckout/client/requests/index.d.ts +3 -0
- package/dist/api/resources/scheduledcheckout/index.d.ts +2 -0
- package/dist/api/resources/scheduledcheckout/types/CreateScheduledCheckoutResponse.d.ts +6 -0
- package/dist/api/resources/scheduledcheckout/types/GetScheduledCheckoutResponse.d.ts +6 -0
- package/dist/api/resources/scheduledcheckout/types/ListScheduledCheckoutsParams.d.ts +12 -0
- package/dist/api/resources/scheduledcheckout/types/ListScheduledCheckoutsResponse.d.ts +6 -0
- package/dist/api/resources/scheduledcheckout/types/UpdateScheduledCheckoutResponse.d.ts +6 -0
- package/dist/api/resources/scheduledcheckout/types/index.d.ts +5 -0
- package/dist/api/types/{PlanChangeActorType.d.ts → ActorType.d.ts} +3 -2
- package/dist/api/types/ApiKeyCreateResponseData.d.ts +1 -0
- package/dist/api/types/ApiKeyResponseData.d.ts +1 -0
- package/dist/api/types/{ApiKeyRequestListResponseData.d.ts → AuditLogListResponseData.d.ts} +4 -4
- package/dist/api/types/{ApiKeyRequestResponseData.d.ts → AuditLogResponseData.d.ts} +3 -5
- package/dist/api/types/BillingCreditResponseData.d.ts +1 -0
- package/dist/api/types/BillingCreditView.d.ts +22 -0
- package/dist/api/types/BillingPlanCreditGrantResponseData.d.ts +9 -2
- package/dist/api/types/CheckFlagResponseData.d.ts +8 -5
- package/dist/api/types/CompanyDetailResponseData.d.ts +2 -0
- package/dist/api/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/ComponentDisplaySettings.d.ts +2 -0
- package/dist/api/types/ComponentHydrateResponseData.d.ts +1 -0
- package/dist/api/types/ComponentPreviewResponseData.d.ts +1 -0
- package/dist/api/types/ComponentSettingsResponseData.d.ts +2 -0
- package/dist/api/types/ConditionConditionType.d.ts +1 -1
- package/dist/api/types/ConditionGroupResponseData.d.ts +10 -0
- package/dist/api/types/ConditionGroupView.d.ts +12 -0
- package/dist/api/types/ConditionResponseData.d.ts +28 -0
- package/dist/api/types/ConditionView.d.ts +35 -0
- package/dist/api/types/CreateBillingPlanCreditGrantRequestBody.d.ts +1 -0
- package/dist/api/types/CreateEntitlementInBundleRequestBody.d.ts +2 -0
- package/dist/api/types/CreateEventRequestBody.d.ts +1 -0
- package/dist/api/types/CreditEventLedgerResponseData.d.ts +34 -0
- package/dist/api/types/CreditEventType.d.ts +7 -0
- package/dist/api/types/CreditsAutoTopupCompanySummary.d.ts +4 -0
- package/dist/api/types/CreditsAutoTopupCreditSummary.d.ts +4 -0
- package/dist/api/types/CreditsAutoTopupHardFailure.d.ts +7 -0
- package/dist/api/types/CreditsAutoTopupRetryFailure.d.ts +8 -0
- package/dist/api/types/FeatureCompanyResponseData.d.ts +3 -0
- package/dist/api/types/FeatureCompanyUserResponseData.d.ts +1 -0
- package/dist/api/types/FeatureEntitlement.d.ts +31 -0
- package/dist/api/types/FeatureEntitlementMetricPeriod.d.ts +8 -0
- package/dist/api/types/FeatureEntitlementMonthReset.d.ts +6 -0
- package/dist/api/types/FeatureUsageLegacyResponseData.d.ts +9 -0
- package/dist/api/types/FeatureUsageResponseData.d.ts +3 -0
- package/dist/api/types/FeatureUsageTimeSeriesResponseData.d.ts +8 -0
- package/dist/api/types/FeatureView.d.ts +21 -0
- package/dist/api/types/FlagView.d.ts +17 -0
- package/dist/api/types/InvoiceRequestBody.d.ts +2 -0
- package/dist/api/types/InvoiceResponseData.d.ts +1 -0
- package/dist/api/types/InvoiceStatus.d.ts +8 -0
- package/dist/api/types/LimitTimeSeriesPointResponseData.d.ts +9 -0
- package/dist/api/types/PlanChangeAction.d.ts +1 -0
- package/dist/api/types/PlanChangeResponseData.d.ts +4 -2
- package/dist/api/types/PlanCreditGrantView.d.ts +10 -3
- package/dist/api/types/PlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/PlanGroupDetailResponseData.d.ts +2 -0
- package/dist/api/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/dist/api/types/PlanGroupResponseData.d.ts +2 -0
- package/dist/api/types/PlanVersionCompanyMigrationResponseData.d.ts +14 -0
- package/dist/api/types/PlanVersionCompanyMigrationStatus.d.ts +8 -0
- package/dist/api/types/PlanVersionMigrationResponseData.d.ts +18 -0
- package/dist/api/types/PlanVersionMigrationStatus.d.ts +7 -0
- package/dist/api/types/PlanVersionMigrationStrategy.d.ts +5 -0
- package/dist/api/types/PlanViewPublicResponseData.d.ts +32 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.d.ts +2 -0
- package/dist/api/types/PublicPlansResponseData.d.ts +12 -0
- package/dist/api/types/RuleView.d.ts +16 -0
- package/dist/api/types/RulesEngineSchemaVersion.d.ts +1 -1
- package/dist/api/types/RulesengineCheckFlagResult.d.ts +1 -0
- package/dist/api/types/RulesengineCompany.d.ts +2 -1
- package/dist/api/types/RulesengineConditionConditionType.d.ts +1 -1
- package/dist/api/types/RulesengineEntitlementValueType.d.ts +9 -0
- package/dist/api/types/RulesengineFeatureEntitlement.d.ts +31 -0
- package/dist/api/types/RulesengineFeatureEntitlementMetricPeriod.d.ts +8 -0
- package/dist/api/types/RulesengineFeatureEntitlementMonthReset.d.ts +6 -0
- package/dist/api/types/ScheduledCheckoutResponseData.d.ts +17 -0
- package/dist/api/types/ScheduledCheckoutStatus.d.ts +8 -0
- package/dist/api/types/ScheduledDowngradeConfigBehavior.d.ts +5 -0
- package/dist/api/types/ScheduledDowngradeResponseData.d.ts +13 -0
- package/dist/api/types/TimeSeriesGranularity.d.ts +7 -0
- package/dist/api/types/UpsertCompanyRequestBody.d.ts +1 -0
- package/dist/api/types/UsageTimeSeriesPointResponseData.d.ts +6 -0
- package/dist/api/types/WebFeatureUsageWebhookOutput.d.ts +10 -0
- package/dist/api/types/WebhookRequestType.d.ts +1 -0
- package/dist/api/types/WhoAmIResponseData.d.ts +12 -0
- package/dist/api/types/index.d.ts +43 -6
- package/dist/cache/index.d.ts +3 -0
- package/dist/{cache.d.ts → cache/local.d.ts} +9 -10
- package/dist/cache/redis.d.ts +38 -0
- package/dist/cache/types.d.ts +19 -0
- package/dist/datastream/datastream-client.d.ts +239 -0
- package/dist/datastream/index.d.ts +2 -0
- package/dist/datastream/types.d.ts +48 -0
- package/dist/datastream/websocket-client.d.ts +127 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/rules-engine.d.ts +54 -0
- package/dist/serialization/resources/accounts/client/requests/CreateApiKeyRequestBody.d.ts +1 -0
- package/dist/serialization/resources/accounts/types/CountAuditLogsParams.d.ts +16 -0
- package/dist/serialization/resources/accounts/types/CountAuditLogsResponse.d.ts +12 -0
- package/dist/serialization/resources/accounts/types/GetAuditLogResponse.d.ts +11 -0
- package/dist/serialization/resources/accounts/types/GetWhoAmIResponse.d.ts +11 -0
- package/dist/serialization/resources/accounts/types/ListAuditLogsParams.d.ts +16 -0
- package/dist/serialization/resources/accounts/types/ListAuditLogsResponse.d.ts +12 -0
- package/dist/serialization/resources/accounts/types/index.d.ts +6 -5
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +2 -0
- package/dist/serialization/resources/companies/types/CountCompaniesParams.d.ts +13 -0
- package/dist/serialization/resources/companies/types/ListCompaniesParams.d.ts +13 -0
- package/dist/serialization/resources/companies/types/index.d.ts +0 -4
- package/dist/serialization/resources/componentspublic/index.d.ts +1 -0
- package/dist/serialization/resources/componentspublic/types/GetPublicPlansResponse.d.ts +11 -0
- package/dist/serialization/resources/componentspublic/types/index.d.ts +1 -0
- package/dist/serialization/resources/credits/types/CountBillingPlanCreditGrantsParams.d.ts +1 -0
- package/dist/serialization/resources/credits/types/CountCreditEventLedgerParams.d.ts +17 -0
- package/dist/serialization/resources/credits/types/CountCreditEventLedgerResponse.d.ts +12 -0
- package/dist/serialization/resources/credits/types/ListBillingPlanCreditGrantsParams.d.ts +1 -0
- package/dist/serialization/resources/credits/types/ListCreditEventLedgerParams.d.ts +17 -0
- package/dist/serialization/resources/credits/types/ListCreditEventLedgerResponse.d.ts +12 -0
- package/dist/serialization/resources/credits/types/index.d.ts +4 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +1 -0
- package/dist/serialization/resources/entitlements/types/CountPlanEntitlementsParams.d.ts +2 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageTimeSeriesParams.d.ts +14 -0
- package/dist/serialization/resources/entitlements/types/GetFeatureUsageTimeSeriesResponse.d.ts +12 -0
- package/dist/serialization/resources/entitlements/types/ListPlanEntitlementsParams.d.ts +2 -0
- package/dist/serialization/resources/entitlements/types/index.d.ts +2 -0
- package/dist/serialization/resources/features/types/CountFeaturesParams.d.ts +1 -0
- package/dist/serialization/resources/features/types/ListFeaturesParams.d.ts +1 -0
- package/dist/serialization/resources/index.d.ts +7 -0
- package/dist/serialization/resources/planbundle/client/requests/UpdatePlanBundleRequestBody.d.ts +1 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +5 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +5 -0
- package/dist/serialization/resources/planmigrations/index.d.ts +1 -0
- package/dist/serialization/resources/planmigrations/types/CountCompanyMigrationsParams.d.ts +14 -0
- package/dist/serialization/resources/planmigrations/types/CountCompanyMigrationsResponse.d.ts +12 -0
- package/dist/serialization/resources/planmigrations/types/CountMigrationsParams.d.ts +13 -0
- package/dist/serialization/resources/planmigrations/types/CountMigrationsResponse.d.ts +12 -0
- package/dist/serialization/resources/planmigrations/types/GetMigrationResponse.d.ts +11 -0
- package/dist/serialization/resources/planmigrations/types/ListCompanyMigrationsParams.d.ts +14 -0
- package/dist/serialization/resources/planmigrations/types/ListCompanyMigrationsResponse.d.ts +12 -0
- package/dist/serialization/resources/planmigrations/types/ListMigrationsParams.d.ts +13 -0
- package/dist/serialization/resources/planmigrations/types/ListMigrationsResponse.d.ts +12 -0
- package/dist/serialization/resources/planmigrations/types/index.d.ts +9 -0
- package/dist/serialization/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +11 -0
- package/dist/serialization/resources/plans/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/plans/types/DeletePlanVersionResponse.d.ts +11 -0
- package/dist/serialization/resources/plans/types/GetPlanParams.d.ts +9 -0
- package/dist/serialization/resources/plans/types/GetPlanResponse.d.ts +2 -1
- package/dist/serialization/resources/plans/types/ListPlanIssuesParams.d.ts +1 -0
- package/dist/serialization/resources/plans/types/PublishPlanVersionResponse.d.ts +11 -0
- package/dist/serialization/resources/plans/types/index.d.ts +3 -0
- package/dist/serialization/resources/scheduledcheckout/client/index.d.ts +1 -0
- package/dist/serialization/resources/scheduledcheckout/client/requests/CreateScheduledCheckoutRequest.d.ts +12 -0
- package/dist/serialization/resources/scheduledcheckout/client/requests/UpdateScheduledCheckoutRequest.d.ts +11 -0
- package/dist/serialization/resources/scheduledcheckout/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/scheduledcheckout/index.d.ts +2 -0
- package/dist/serialization/resources/scheduledcheckout/types/CreateScheduledCheckoutResponse.d.ts +11 -0
- package/dist/serialization/resources/scheduledcheckout/types/GetScheduledCheckoutResponse.d.ts +11 -0
- package/dist/serialization/resources/scheduledcheckout/types/ListScheduledCheckoutsParams.d.ts +13 -0
- package/dist/serialization/resources/scheduledcheckout/types/ListScheduledCheckoutsResponse.d.ts +12 -0
- package/dist/serialization/resources/scheduledcheckout/types/UpdateScheduledCheckoutResponse.d.ts +11 -0
- package/dist/serialization/resources/scheduledcheckout/types/index.d.ts +5 -0
- package/dist/serialization/types/ActorType.d.ts +7 -0
- package/dist/serialization/types/ApiKeyCreateResponseData.d.ts +1 -0
- package/dist/serialization/types/ApiKeyResponseData.d.ts +1 -0
- package/dist/serialization/types/{ApiKeyRequestListResponseData.d.ts → AuditLogListResponseData.d.ts} +5 -5
- package/dist/serialization/types/{ApiKeyRequestResponseData.d.ts → AuditLogResponseData.d.ts} +5 -7
- package/dist/serialization/types/BillingCreditResponseData.d.ts +1 -0
- package/dist/serialization/types/BillingCreditView.d.ts +32 -0
- package/dist/serialization/types/BillingPlanCreditGrantResponseData.d.ts +7 -2
- package/dist/serialization/types/CheckFlagResponseData.d.ts +2 -0
- package/dist/serialization/types/CompanyDetailResponseData.d.ts +4 -0
- package/dist/serialization/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/ComponentDisplaySettings.d.ts +2 -0
- package/dist/serialization/types/ComponentHydrateResponseData.d.ts +2 -0
- package/dist/serialization/types/ComponentPreviewResponseData.d.ts +2 -0
- package/dist/serialization/types/ComponentSettingsResponseData.d.ts +2 -0
- package/dist/serialization/types/ConditionConditionType.d.ts +1 -1
- package/dist/serialization/types/ConditionGroupResponseData.d.ts +16 -0
- package/dist/serialization/types/ConditionGroupView.d.ts +18 -0
- package/dist/serialization/types/ConditionResponseData.d.ts +34 -0
- package/dist/serialization/types/ConditionView.d.ts +43 -0
- package/dist/serialization/types/CreateBillingPlanCreditGrantRequestBody.d.ts +1 -0
- package/dist/serialization/types/CreateEntitlementInBundleRequestBody.d.ts +2 -0
- package/dist/serialization/types/CreditEventLedgerResponseData.d.ts +47 -0
- package/dist/serialization/types/CreditEventType.d.ts +7 -0
- package/dist/serialization/types/CreditsAutoTopupCompanySummary.d.ts +10 -0
- package/dist/serialization/types/CreditsAutoTopupCreditSummary.d.ts +10 -0
- package/dist/serialization/types/CreditsAutoTopupHardFailure.d.ts +14 -0
- package/dist/serialization/types/CreditsAutoTopupRetryFailure.d.ts +15 -0
- package/dist/serialization/types/FeatureEntitlement.d.ts +25 -0
- package/dist/serialization/types/FeatureEntitlementMetricPeriod.d.ts +7 -0
- package/dist/serialization/types/FeatureEntitlementMonthReset.d.ts +7 -0
- package/dist/serialization/types/FeatureUsageLegacyResponseData.d.ts +16 -0
- package/dist/serialization/types/FeatureUsageTimeSeriesResponseData.d.ts +16 -0
- package/dist/serialization/types/FeatureView.d.ts +32 -0
- package/dist/serialization/types/FlagView.d.ts +25 -0
- package/dist/serialization/types/InvoiceRequestBody.d.ts +2 -0
- package/dist/serialization/types/InvoiceResponseData.d.ts +2 -0
- package/dist/serialization/types/InvoiceStatus.d.ts +7 -0
- package/dist/serialization/types/LimitTimeSeriesPointResponseData.d.ts +16 -0
- package/dist/serialization/types/PlanChangeAction.d.ts +1 -1
- package/dist/serialization/types/PlanChangeResponseData.d.ts +4 -4
- package/dist/serialization/types/PlanCreditGrantView.d.ts +7 -3
- package/dist/serialization/types/PlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanGroupDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanGroupResponseData.d.ts +2 -0
- package/dist/serialization/types/PlanVersionCompanyMigrationResponseData.d.ts +20 -0
- package/dist/serialization/types/PlanVersionCompanyMigrationStatus.d.ts +7 -0
- package/dist/serialization/types/PlanVersionMigrationResponseData.d.ts +25 -0
- package/dist/serialization/types/PlanVersionMigrationStatus.d.ts +7 -0
- package/dist/serialization/types/PlanVersionMigrationStrategy.d.ts +7 -0
- package/dist/serialization/types/PlanViewPublicResponseData.d.ts +47 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +2 -0
- package/dist/serialization/types/PublicPlansResponseData.d.ts +21 -0
- package/dist/serialization/types/RuleView.d.ts +23 -0
- package/dist/serialization/types/RulesEngineSchemaVersion.d.ts +1 -1
- package/dist/serialization/types/RulesengineCheckFlagResult.d.ts +2 -0
- package/dist/serialization/types/RulesengineCompany.d.ts +3 -1
- package/dist/serialization/types/RulesengineConditionConditionType.d.ts +1 -1
- package/dist/serialization/types/RulesengineEntitlementValueType.d.ts +7 -0
- package/dist/serialization/types/RulesengineFeatureEntitlement.d.ts +25 -0
- package/dist/serialization/types/RulesengineFeatureEntitlementMetricPeriod.d.ts +7 -0
- package/dist/serialization/types/RulesengineFeatureEntitlementMonthReset.d.ts +7 -0
- package/dist/serialization/types/ScheduledCheckoutResponseData.d.ts +23 -0
- package/dist/serialization/types/ScheduledCheckoutStatus.d.ts +7 -0
- package/dist/serialization/types/ScheduledDowngradeConfigBehavior.d.ts +7 -0
- package/dist/serialization/types/ScheduledDowngradeResponseData.d.ts +19 -0
- package/dist/serialization/types/TimeSeriesGranularity.d.ts +7 -0
- package/dist/serialization/types/UpsertCompanyRequestBody.d.ts +1 -0
- package/dist/serialization/types/UsageTimeSeriesPointResponseData.d.ts +12 -0
- package/dist/serialization/types/WebFeatureUsageWebhookOutput.d.ts +18 -0
- package/dist/serialization/types/WebhookRequestType.d.ts +1 -1
- package/dist/serialization/types/WhoAmIResponseData.d.ts +18 -0
- package/dist/serialization/types/index.d.ts +43 -6
- package/dist/wrapper.d.ts +48 -4
- package/package.json +4 -2
- package/dist/api/resources/accounts/client/requests/CountApiRequestsRequest.d.ts +0 -19
- package/dist/api/resources/accounts/client/requests/ListApiRequestsRequest.d.ts +0 -19
- package/dist/api/resources/accounts/types/ListApiRequestsResponse.d.ts +0 -6
- package/dist/api/resources/companies/client/requests/CountCompaniesForAdvancedFilterRequest.d.ts +0 -46
- package/dist/api/resources/companies/client/requests/ListCompaniesForAdvancedFilterRequest.d.ts +0 -46
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterParams.d.ts +0 -35
- package/dist/api/resources/companies/types/CountCompaniesForAdvancedFilterResponse.d.ts +0 -6
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterParams.d.ts +0 -35
- package/dist/api/resources/companies/types/ListCompaniesForAdvancedFilterResponse.d.ts +0 -6
- package/dist/api/types/CompanyViewWithFeatureUsageResponseData.d.ts +0 -26
- package/dist/api/types/CreditUsageResponseData.d.ts +0 -12
- package/dist/api/types/FeatureUsageDataResponseData.d.ts +0 -19
- package/dist/serialization/resources/accounts/types/CountApiRequestsParams.d.ts +0 -13
- package/dist/serialization/resources/accounts/types/CountApiRequestsResponse.d.ts +0 -12
- package/dist/serialization/resources/accounts/types/GetApiRequestResponse.d.ts +0 -11
- package/dist/serialization/resources/accounts/types/ListApiRequestsParams.d.ts +0 -13
- package/dist/serialization/resources/accounts/types/ListApiRequestsResponse.d.ts +0 -12
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterParams.d.ts +0 -26
- package/dist/serialization/resources/companies/types/CountCompaniesForAdvancedFilterResponse.d.ts +0 -12
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterParams.d.ts +0 -26
- package/dist/serialization/resources/companies/types/ListCompaniesForAdvancedFilterResponse.d.ts +0 -12
- package/dist/serialization/types/CompanyViewWithFeatureUsageResponseData.d.ts +0 -39
- package/dist/serialization/types/CreditUsageResponseData.d.ts +0 -17
- package/dist/serialization/types/FeatureUsageDataResponseData.d.ts +0 -27
- package/dist/serialization/types/PlanChangeActorType.d.ts +0 -7
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface WebFeatureUsageWebhookOutput {
|
|
3
|
+
allocation?: number;
|
|
4
|
+
creditUsage?: Schematic.CreditUsage;
|
|
5
|
+
entitlement: string;
|
|
6
|
+
feature?: Schematic.FeatureView;
|
|
7
|
+
metricResetAt?: Date;
|
|
8
|
+
usage?: number;
|
|
9
|
+
company?: Schematic.CompanyDetailResponseData;
|
|
10
|
+
}
|
|
@@ -29,6 +29,7 @@ export declare const WebhookRequestType: {
|
|
|
29
29
|
readonly PlanEntitlementDeleted: "plan.entitlement.deleted";
|
|
30
30
|
readonly PlanEntitlementUpdated: "plan.entitlement.updated";
|
|
31
31
|
readonly PlanUpdated: "plan.updated";
|
|
32
|
+
readonly PlanVersionDeleted: "plan_version.deleted";
|
|
32
33
|
readonly RuleDeleted: "rule.deleted";
|
|
33
34
|
readonly TestSend: "test.send";
|
|
34
35
|
readonly UserCreated: "user.created";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface WhoAmIResponseData {
|
|
3
|
+
accountId: string;
|
|
4
|
+
accountName: string;
|
|
5
|
+
actorType: string;
|
|
6
|
+
apiKeyId?: string;
|
|
7
|
+
environmentId?: string;
|
|
8
|
+
environments: Schematic.EnvironmentResponseData[];
|
|
9
|
+
stripeUserId?: string;
|
|
10
|
+
userId?: string;
|
|
11
|
+
userName?: string;
|
|
12
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
export * from "./ActorType";
|
|
1
2
|
export * from "./ApiError";
|
|
2
3
|
export * from "./ApiKeyCreateResponseData";
|
|
3
|
-
export * from "./ApiKeyRequestListResponseData";
|
|
4
|
-
export * from "./ApiKeyRequestResponseData";
|
|
5
4
|
export * from "./ApiKeyResponseData";
|
|
6
5
|
export * from "./ApiKeyScope";
|
|
6
|
+
export * from "./AuditLogListResponseData";
|
|
7
|
+
export * from "./AuditLogResponseData";
|
|
7
8
|
export * from "./BillingCouponResponseData";
|
|
8
9
|
export * from "./BillingCreditBundleResponseData";
|
|
9
10
|
export * from "./BillingCreditBundleStatus";
|
|
@@ -18,6 +19,7 @@ export * from "./BillingCreditGrantZeroedOutReason";
|
|
|
18
19
|
export * from "./BillingCreditLedgerResponseData";
|
|
19
20
|
export * from "./BillingCreditResponseData";
|
|
20
21
|
export * from "./BillingCreditRolloverPolicy";
|
|
22
|
+
export * from "./BillingCreditView";
|
|
21
23
|
export * from "./BillingCustomerResponseData";
|
|
22
24
|
export * from "./BillingCustomerSubscription";
|
|
23
25
|
export * from "./BillingCustomerWithSubscriptionsResponseData";
|
|
@@ -67,7 +69,6 @@ export * from "./CompanyPlanInvalidReason";
|
|
|
67
69
|
export * from "./CompanyPlanWithBillingSubView";
|
|
68
70
|
export * from "./CompanyResponseData";
|
|
69
71
|
export * from "./CompanySubscriptionResponseData";
|
|
70
|
-
export * from "./CompanyViewWithFeatureUsageResponseData";
|
|
71
72
|
export * from "./CompatiblePlans";
|
|
72
73
|
export * from "./CompatiblePlansResponseData";
|
|
73
74
|
export * from "./ComponentCapabilities";
|
|
@@ -82,9 +83,13 @@ export * from "./ComponentState";
|
|
|
82
83
|
export * from "./Condition";
|
|
83
84
|
export * from "./ConditionConditionType";
|
|
84
85
|
export * from "./ConditionGroup";
|
|
86
|
+
export * from "./ConditionGroupResponseData";
|
|
87
|
+
export * from "./ConditionGroupView";
|
|
85
88
|
export * from "./ConditionMetricPeriod";
|
|
86
89
|
export * from "./ConditionMetricPeriodMonthReset";
|
|
87
90
|
export * from "./ConditionOperator";
|
|
91
|
+
export * from "./ConditionResponseData";
|
|
92
|
+
export * from "./ConditionView";
|
|
88
93
|
export * from "./CountResponse";
|
|
89
94
|
export * from "./CouponRequestBody";
|
|
90
95
|
export * from "./CreateBillingPlanCreditGrantRequestBody";
|
|
@@ -111,17 +116,22 @@ export * from "./CreatePriceTierRequestBody";
|
|
|
111
116
|
export * from "./CreditAutoTopupAmountType";
|
|
112
117
|
export * from "./CreditBundlePurchaseResponseData";
|
|
113
118
|
export * from "./CreditCompanyGrantView";
|
|
119
|
+
export * from "./CreditEventLedgerResponseData";
|
|
120
|
+
export * from "./CreditEventType";
|
|
114
121
|
export * from "./CreditGrantDetail";
|
|
115
122
|
export * from "./CreditGrantExpiryRequestBody";
|
|
116
123
|
export * from "./CreditGrantSortOrder";
|
|
117
124
|
export * from "./CreditLedgerEnrichedEntryResponseData";
|
|
118
125
|
export * from "./CreditLedgerPeriod";
|
|
126
|
+
export * from "./CreditsAutoTopupCompanySummary";
|
|
127
|
+
export * from "./CreditsAutoTopupCreditSummary";
|
|
128
|
+
export * from "./CreditsAutoTopupHardFailure";
|
|
129
|
+
export * from "./CreditsAutoTopupRetryFailure";
|
|
119
130
|
export * from "./CreditTransferResponseData";
|
|
120
131
|
export * from "./CreditTransferView";
|
|
121
132
|
export * from "./CreditTriggerConfig";
|
|
122
133
|
export * from "./CreditUsage";
|
|
123
134
|
export * from "./CreditUsageAggregation";
|
|
124
|
-
export * from "./CreditUsageResponseData";
|
|
125
135
|
export * from "./CustomPlanConfig";
|
|
126
136
|
export * from "./CustomPlanViewConfigResponseData";
|
|
127
137
|
export * from "./DataExportOutputFileType";
|
|
@@ -160,21 +170,29 @@ export * from "./EventType";
|
|
|
160
170
|
export * from "./FeatureCompanyResponseData";
|
|
161
171
|
export * from "./FeatureCompanyUserResponseData";
|
|
162
172
|
export * from "./FeatureDetailResponseData";
|
|
173
|
+
export * from "./FeatureEntitlement";
|
|
174
|
+
export * from "./FeatureEntitlementMetricPeriod";
|
|
175
|
+
export * from "./FeatureEntitlementMonthReset";
|
|
163
176
|
export * from "./FeatureLedgerResponseData";
|
|
164
177
|
export * from "./FeatureLifecyclePhase";
|
|
165
178
|
export * from "./FeatureResponseData";
|
|
166
179
|
export * from "./FeatureType";
|
|
167
|
-
export * from "./FeatureUsageDataResponseData";
|
|
168
180
|
export * from "./FeatureUsageDetailResponseData";
|
|
181
|
+
export * from "./FeatureUsageLegacyResponseData";
|
|
169
182
|
export * from "./FeatureUsageResponseData";
|
|
183
|
+
export * from "./FeatureUsageTimeSeriesResponseData";
|
|
184
|
+
export * from "./FeatureView";
|
|
170
185
|
export * from "./FlagDetailResponseData";
|
|
171
186
|
export * from "./FlagResponseData";
|
|
172
187
|
export * from "./FlagType";
|
|
188
|
+
export * from "./FlagView";
|
|
173
189
|
export * from "./GenericPreviewObject";
|
|
174
190
|
export * from "./InvoiceRequestBody";
|
|
175
191
|
export * from "./InvoiceResponseData";
|
|
192
|
+
export * from "./InvoiceStatus";
|
|
176
193
|
export * from "./IssueTemporaryAccessTokenResponseData";
|
|
177
194
|
export * from "./KeysRequestBody";
|
|
195
|
+
export * from "./LimitTimeSeriesPointResponseData";
|
|
178
196
|
export * from "./ManagePlanPreviewResponseResponseData";
|
|
179
197
|
export * from "./ManagePlanRequest";
|
|
180
198
|
export * from "./ManagePlanResponseResponseData";
|
|
@@ -187,7 +205,6 @@ export * from "./PlanBundleCreditGrantRequestBody";
|
|
|
187
205
|
export * from "./PlanBundleEntitlementRequestBody";
|
|
188
206
|
export * from "./PlanBundleResponseData";
|
|
189
207
|
export * from "./PlanChangeAction";
|
|
190
|
-
export * from "./PlanChangeActorType";
|
|
191
208
|
export * from "./PlanChangeBasePlanAction";
|
|
192
209
|
export * from "./PlanChangeResponseData";
|
|
193
210
|
export * from "./PlanChangeSubscriptionAction";
|
|
@@ -207,14 +224,21 @@ export * from "./PlanSelection";
|
|
|
207
224
|
export * from "./PlanSnapshotView";
|
|
208
225
|
export * from "./PlanTraitResponseData";
|
|
209
226
|
export * from "./PlanType";
|
|
227
|
+
export * from "./PlanVersionCompanyMigrationResponseData";
|
|
228
|
+
export * from "./PlanVersionCompanyMigrationStatus";
|
|
229
|
+
export * from "./PlanVersionMigrationResponseData";
|
|
230
|
+
export * from "./PlanVersionMigrationStatus";
|
|
231
|
+
export * from "./PlanVersionMigrationStrategy";
|
|
210
232
|
export * from "./PlanVersionResponseData";
|
|
211
233
|
export * from "./PlanVersionStatus";
|
|
234
|
+
export * from "./PlanViewPublicResponseData";
|
|
212
235
|
export * from "./PreviewObject";
|
|
213
236
|
export * from "./PreviewObjectResponseData";
|
|
214
237
|
export * from "./PreviewSubscriptionChangeResponseData";
|
|
215
238
|
export * from "./PreviewSubscriptionFinanceResponseData";
|
|
216
239
|
export * from "./PreviewSubscriptionUpcomingInvoiceLineItems";
|
|
217
240
|
export * from "./ProrationBehavior";
|
|
241
|
+
export * from "./PublicPlansResponseData";
|
|
218
242
|
export * from "./QuickstartResp";
|
|
219
243
|
export * from "./RawEventBatchResponseData";
|
|
220
244
|
export * from "./RawEventResponseData";
|
|
@@ -241,7 +265,11 @@ export * from "./RulesengineConditionGroup";
|
|
|
241
265
|
export * from "./RulesengineConditionMetricPeriod";
|
|
242
266
|
export * from "./RulesengineConditionMetricPeriodMonthReset";
|
|
243
267
|
export * from "./RulesengineConditionOperator";
|
|
268
|
+
export * from "./RulesengineEntitlementValueType";
|
|
244
269
|
export * from "./RulesengineEntityType";
|
|
270
|
+
export * from "./RulesengineFeatureEntitlement";
|
|
271
|
+
export * from "./RulesengineFeatureEntitlementMetricPeriod";
|
|
272
|
+
export * from "./RulesengineFeatureEntitlementMonthReset";
|
|
245
273
|
export * from "./RulesengineFlag";
|
|
246
274
|
export * from "./RulesengineRule";
|
|
247
275
|
export * from "./RulesengineRuleRuleType";
|
|
@@ -250,6 +278,11 @@ export * from "./RulesengineTrait";
|
|
|
250
278
|
export * from "./RulesengineTraitDefinition";
|
|
251
279
|
export * from "./RulesengineTraitDefinitionComparableType";
|
|
252
280
|
export * from "./RulesengineUser";
|
|
281
|
+
export * from "./RuleView";
|
|
282
|
+
export * from "./ScheduledCheckoutResponseData";
|
|
283
|
+
export * from "./ScheduledCheckoutStatus";
|
|
284
|
+
export * from "./ScheduledDowngradeConfigBehavior";
|
|
285
|
+
export * from "./ScheduledDowngradeResponseData";
|
|
253
286
|
export * from "./SegmentStatusResp";
|
|
254
287
|
export * from "./SkippedEntitlementErrorResponseData";
|
|
255
288
|
export * from "./SkippedEntitlementResponseData";
|
|
@@ -260,6 +293,7 @@ export * from "./SubscriptionTraitUpdate";
|
|
|
260
293
|
export * from "./SubscriptionType";
|
|
261
294
|
export * from "./TemporaryAccessTokenResourceType";
|
|
262
295
|
export * from "./TemporaryAccessTokenResponseData";
|
|
296
|
+
export * from "./TimeSeriesGranularity";
|
|
263
297
|
export * from "./TraitDefinition";
|
|
264
298
|
export * from "./TraitDefinitionComparableType";
|
|
265
299
|
export * from "./TraitType";
|
|
@@ -280,11 +314,14 @@ export * from "./UpsertUserRequestBody";
|
|
|
280
314
|
export * from "./UpsertUserSubRequestBody";
|
|
281
315
|
export * from "./UsageBasedEntitlementRequestBody";
|
|
282
316
|
export * from "./UsageBasedEntitlementResponseData";
|
|
317
|
+
export * from "./UsageTimeSeriesPointResponseData";
|
|
283
318
|
export * from "./UserDetailResponseData";
|
|
284
319
|
export * from "./UserResponseData";
|
|
320
|
+
export * from "./WebFeatureUsageWebhookOutput";
|
|
285
321
|
export * from "./WebhookEventDetailResponseData";
|
|
286
322
|
export * from "./WebhookEventResponseData";
|
|
287
323
|
export * from "./WebhookEventStatus";
|
|
288
324
|
export * from "./WebhookRequestType";
|
|
289
325
|
export * from "./WebhookResponseData";
|
|
290
326
|
export * from "./WebhookStatus";
|
|
327
|
+
export * from "./WhoAmIResponseData";
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface CacheOptions {
|
|
6
|
-
maxItems?: number;
|
|
7
|
-
ttl?: number;
|
|
8
|
-
}
|
|
1
|
+
import { CacheProvider, CacheOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* In-memory cache implementation with LRU eviction and TTL support
|
|
4
|
+
*/
|
|
9
5
|
declare class LocalCache<T> implements CacheProvider<T> {
|
|
10
6
|
private cache;
|
|
11
7
|
private maxItems;
|
|
12
8
|
private accessCounter;
|
|
13
9
|
private defaultTTL;
|
|
14
10
|
constructor({ maxItems, ttl }?: CacheOptions);
|
|
15
|
-
get(key: string): Promise<T |
|
|
11
|
+
get(key: string): Promise<T | null>;
|
|
16
12
|
set(key: string, value: T, ttlOverride?: number): Promise<void>;
|
|
17
|
-
|
|
13
|
+
delete(key: string): Promise<void>;
|
|
14
|
+
deleteMissing(keysToKeep: string[], _?: {
|
|
15
|
+
scanPattern?: string;
|
|
16
|
+
}): Promise<void>;
|
|
18
17
|
private evictItem;
|
|
19
18
|
private evictExpiredItems;
|
|
20
19
|
private evictLRUItems;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CacheProvider, CacheOptions } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal interface describing the redis client methods used by RedisCacheProvider.
|
|
4
|
+
* Compatible with the 'redis' package's RedisClientType.
|
|
5
|
+
*/
|
|
6
|
+
export interface RedisClient {
|
|
7
|
+
get(key: string): Promise<string | null>;
|
|
8
|
+
set(key: string, value: string): Promise<unknown>;
|
|
9
|
+
setEx(key: string, seconds: number, value: string): Promise<unknown>;
|
|
10
|
+
del(key: string | string[]): Promise<unknown>;
|
|
11
|
+
scanIterator(options: {
|
|
12
|
+
MATCH: string;
|
|
13
|
+
COUNT: number;
|
|
14
|
+
}): AsyncIterable<string>;
|
|
15
|
+
}
|
|
16
|
+
export interface RedisOptions extends CacheOptions {
|
|
17
|
+
/** Pre-created, connected redis client */
|
|
18
|
+
client: RedisClient;
|
|
19
|
+
/** Redis key prefix for all cache keys (default: 'schematic:') */
|
|
20
|
+
keyPrefix?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Redis-based cache provider implementation
|
|
24
|
+
* Accepts a pre-created redis client (e.g. from the 'redis' package)
|
|
25
|
+
*/
|
|
26
|
+
export declare class RedisCacheProvider<T> implements CacheProvider<T> {
|
|
27
|
+
private client;
|
|
28
|
+
private defaultTTL;
|
|
29
|
+
private keyPrefix;
|
|
30
|
+
constructor(options: RedisOptions);
|
|
31
|
+
private getFullKey;
|
|
32
|
+
get(key: string): Promise<T | null>;
|
|
33
|
+
set(key: string, value: T, ttl?: number): Promise<void>;
|
|
34
|
+
delete(key: string): Promise<void>;
|
|
35
|
+
deleteMissing(keysToKeep: string[], options?: {
|
|
36
|
+
scanPattern?: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache provider interface for storing and retrieving entities
|
|
3
|
+
*/
|
|
4
|
+
export interface CacheProvider<T> {
|
|
5
|
+
/** Get a value from cache */
|
|
6
|
+
get(key: string): Promise<T | null>;
|
|
7
|
+
/** Set a value in cache */
|
|
8
|
+
set(key: string, value: T, ttl?: number): Promise<void>;
|
|
9
|
+
/** Delete a value from cache */
|
|
10
|
+
delete(key: string): Promise<void>;
|
|
11
|
+
/** Delete all keys not in the keysToKeep array (optional, for bulk operations) */
|
|
12
|
+
deleteMissing?(keysToKeep: string[], options?: {
|
|
13
|
+
scanPattern?: string;
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export interface CacheOptions {
|
|
17
|
+
maxItems?: number;
|
|
18
|
+
ttl?: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import * as Schematic from '../api/types';
|
|
3
|
+
import { Logger } from '../logger';
|
|
4
|
+
import type { CacheProvider } from '../cache/types';
|
|
5
|
+
import { type RedisClient } from '../cache/redis';
|
|
6
|
+
/**
|
|
7
|
+
* Options for configuring the DataStream client
|
|
8
|
+
*/
|
|
9
|
+
export interface DataStreamClientOptions {
|
|
10
|
+
/** Schematic API key for authentication */
|
|
11
|
+
apiKey: string;
|
|
12
|
+
/** Base URL for the API (will be converted to WebSocket URL) */
|
|
13
|
+
baseURL?: string;
|
|
14
|
+
/** Logger for debug/info/error messages */
|
|
15
|
+
logger: Logger;
|
|
16
|
+
/** Cache TTL in milliseconds (default: 5 minutes) */
|
|
17
|
+
cacheTTL?: number;
|
|
18
|
+
/** Pre-created, connected redis client for all cache providers (if not provided, uses memory cache) */
|
|
19
|
+
redisClient?: RedisClient;
|
|
20
|
+
/** Redis key prefix for all cache keys (default: 'schematic:') */
|
|
21
|
+
redisKeyPrefix?: string;
|
|
22
|
+
/** Custom cache provider for company entities (overrides Redis config if provided) */
|
|
23
|
+
companyCache?: CacheProvider<Schematic.RulesengineCompany>;
|
|
24
|
+
/** Custom cache provider for user entities (overrides Redis config if provided) */
|
|
25
|
+
userCache?: CacheProvider<Schematic.RulesengineUser>;
|
|
26
|
+
/** Custom cache provider for flag entities (overrides Redis config if provided) */
|
|
27
|
+
flagCache?: CacheProvider<Schematic.RulesengineFlag>;
|
|
28
|
+
/** Enable replicator mode for external data synchronization */
|
|
29
|
+
replicatorMode?: boolean;
|
|
30
|
+
/** Health check URL for replicator mode */
|
|
31
|
+
replicatorHealthURL?: string;
|
|
32
|
+
/** Health check interval for replicator mode in milliseconds */
|
|
33
|
+
replicatorHealthCheck?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* DataStreamClient provides a comprehensive client for Schematic's datastream
|
|
37
|
+
* with caching, flag evaluation, and entity management matching the Go implementation
|
|
38
|
+
*/
|
|
39
|
+
export declare class DataStreamClient extends EventEmitter {
|
|
40
|
+
private readonly apiKey;
|
|
41
|
+
private readonly baseURL?;
|
|
42
|
+
private readonly logger;
|
|
43
|
+
private readonly cacheTTL;
|
|
44
|
+
private readonly companyCacheProvider;
|
|
45
|
+
private readonly userCacheProvider;
|
|
46
|
+
private readonly flagsCacheProvider;
|
|
47
|
+
private readonly companyKeyCacheProvider;
|
|
48
|
+
private readonly userKeyCacheProvider;
|
|
49
|
+
private wsClient?;
|
|
50
|
+
private rulesEngine;
|
|
51
|
+
private readonly replicatorMode;
|
|
52
|
+
private readonly replicatorHealthURL?;
|
|
53
|
+
private readonly replicatorHealthCheck;
|
|
54
|
+
private replicatorReady;
|
|
55
|
+
private replicatorHealthInterval?;
|
|
56
|
+
private replicatorCacheVersion?;
|
|
57
|
+
private pendingCompanyRequests;
|
|
58
|
+
private pendingUserRequests;
|
|
59
|
+
private pendingFlagRequest?;
|
|
60
|
+
constructor(options: DataStreamClientOptions);
|
|
61
|
+
/**
|
|
62
|
+
* Creates cache providers based on configuration options
|
|
63
|
+
* Priority: custom cache provider > Redis client > memory cache
|
|
64
|
+
* Flag cache uses special TTL logic matching Go implementation
|
|
65
|
+
*/
|
|
66
|
+
private createCacheProvider;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a key→ID mapping cache provider (always string values)
|
|
69
|
+
* Uses Redis if available, otherwise memory cache
|
|
70
|
+
*/
|
|
71
|
+
private createKeyCacheProvider;
|
|
72
|
+
/**
|
|
73
|
+
* Calculates cache TTL based on cache type, matching Go implementation
|
|
74
|
+
* - Flag cache: use the greater of maxCacheTTL (30 days) or configured cacheTTL
|
|
75
|
+
* - Other caches: use configured cacheTTL (defaults to 24 hours)
|
|
76
|
+
*/
|
|
77
|
+
private calculateCacheTTL;
|
|
78
|
+
/**
|
|
79
|
+
* Start initializes and starts the datastream client
|
|
80
|
+
*/
|
|
81
|
+
start(): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* IsConnected returns whether the client is connected to the datastream
|
|
84
|
+
* In replicator mode, returns true if the external replicator is ready
|
|
85
|
+
*/
|
|
86
|
+
isConnected(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* GetCompany retrieves a company by keys, using cache or datastream
|
|
89
|
+
*/
|
|
90
|
+
getCompany(keys: Record<string, string>): Promise<Schematic.RulesengineCompany>;
|
|
91
|
+
/**
|
|
92
|
+
* GetUser retrieves a user by keys, using cache or datastream
|
|
93
|
+
*/
|
|
94
|
+
getUser(keys: Record<string, string>): Promise<Schematic.RulesengineUser>;
|
|
95
|
+
/**
|
|
96
|
+
* GetFlag retrieves a flag by key from cache
|
|
97
|
+
*/
|
|
98
|
+
getFlag(flagKey: string): Promise<Schematic.RulesengineFlag | null>;
|
|
99
|
+
/**
|
|
100
|
+
* GetAllFlags requests a refresh of all flags from the datastream
|
|
101
|
+
*/
|
|
102
|
+
getAllFlags(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* CheckFlag evaluates a flag for a company and/or user context
|
|
105
|
+
*/
|
|
106
|
+
checkFlag(evalCtx: {
|
|
107
|
+
company?: Record<string, string>;
|
|
108
|
+
user?: Record<string, string>;
|
|
109
|
+
}, flagKey: string): Promise<Schematic.RulesengineCheckFlagResult>;
|
|
110
|
+
/**
|
|
111
|
+
* UpdateCompanyMetrics updates company metrics locally (for track events)
|
|
112
|
+
*/
|
|
113
|
+
updateCompanyMetrics(keys: Record<string, string>, event: string, quantity: number): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Close gracefully closes the datastream client
|
|
116
|
+
*/
|
|
117
|
+
close(): void;
|
|
118
|
+
/**
|
|
119
|
+
* IsReplicatorReady returns whether the external replicator is ready
|
|
120
|
+
*/
|
|
121
|
+
isReplicatorReady(): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* IsReplicatorMode returns whether the client is running in replicator mode
|
|
124
|
+
*/
|
|
125
|
+
isReplicatorMode(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* GetReplicatorCacheVersion returns the current cache version from the replicator
|
|
128
|
+
*/
|
|
129
|
+
getReplicatorCacheVersion(): string | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* GetReplicatorCacheVersionAsync attempts to fetch cache version immediately if not available
|
|
132
|
+
*/
|
|
133
|
+
getReplicatorCacheVersionAsync(timeoutMs?: number): Promise<string | undefined>;
|
|
134
|
+
/**
|
|
135
|
+
* handleMessage processes incoming datastream messages
|
|
136
|
+
*/
|
|
137
|
+
private handleMessage;
|
|
138
|
+
/**
|
|
139
|
+
* handleCompanyMessage processes company-specific datastream messages
|
|
140
|
+
*/
|
|
141
|
+
private handleCompanyMessage;
|
|
142
|
+
/**
|
|
143
|
+
* handleUserMessage processes user-specific datastream messages
|
|
144
|
+
*/
|
|
145
|
+
private handleUserMessage;
|
|
146
|
+
/**
|
|
147
|
+
* handleFlagsMessage processes bulk flags messages
|
|
148
|
+
*/
|
|
149
|
+
private handleFlagsMessage;
|
|
150
|
+
/**
|
|
151
|
+
* handleFlagMessage processes single flag messages
|
|
152
|
+
*/
|
|
153
|
+
private handleFlagMessage;
|
|
154
|
+
/**
|
|
155
|
+
* handleErrorMessage processes error messages
|
|
156
|
+
*/
|
|
157
|
+
private handleErrorMessage;
|
|
158
|
+
/**
|
|
159
|
+
* handleConnectionReady is called when the WebSocket connection is ready
|
|
160
|
+
*/
|
|
161
|
+
private handleConnectionReady;
|
|
162
|
+
/**
|
|
163
|
+
* sendDataStreamRequest sends a request to the datastream
|
|
164
|
+
*/
|
|
165
|
+
private sendDataStreamRequest;
|
|
166
|
+
/**
|
|
167
|
+
* getCompanyFromCache attempts to retrieve a company from cache using any of the provided keys
|
|
168
|
+
*/
|
|
169
|
+
private getCompanyFromCache;
|
|
170
|
+
/**
|
|
171
|
+
* getUserFromCache attempts to retrieve a user from cache using any of the provided keys
|
|
172
|
+
*/
|
|
173
|
+
private getUserFromCache;
|
|
174
|
+
/**
|
|
175
|
+
* cacheCompanyForKeys caches a company for all of its keys
|
|
176
|
+
*/
|
|
177
|
+
private cacheCompanyForKeys;
|
|
178
|
+
/**
|
|
179
|
+
* cacheUserForKeys caches a user for all of its keys using two-level indirection
|
|
180
|
+
*/
|
|
181
|
+
private cacheUserForKeys;
|
|
182
|
+
/**
|
|
183
|
+
* generateCacheKeysForCompany generates all cache keys for a company's keys
|
|
184
|
+
*/
|
|
185
|
+
private generateCacheKeysForCompany;
|
|
186
|
+
/**
|
|
187
|
+
* generateCacheKeysForUser generates all cache keys for a user's keys
|
|
188
|
+
*/
|
|
189
|
+
private generateCacheKeysForUser;
|
|
190
|
+
/**
|
|
191
|
+
* notifyPendingCompanyRequests notifies all pending company requests
|
|
192
|
+
*/
|
|
193
|
+
private notifyPendingCompanyRequests;
|
|
194
|
+
/**
|
|
195
|
+
* notifyPendingUserRequests notifies all pending user requests
|
|
196
|
+
*/
|
|
197
|
+
private notifyPendingUserRequests;
|
|
198
|
+
/**
|
|
199
|
+
* cleanupPendingCompanyRequests removes a specific handler from pending company requests
|
|
200
|
+
*/
|
|
201
|
+
private cleanupPendingCompanyRequests;
|
|
202
|
+
/**
|
|
203
|
+
* cleanupPendingUserRequests removes a specific handler from pending user requests
|
|
204
|
+
*/
|
|
205
|
+
private cleanupPendingUserRequests;
|
|
206
|
+
/**
|
|
207
|
+
* clearPendingRequests clears all pending requests
|
|
208
|
+
*/
|
|
209
|
+
private clearPendingRequests;
|
|
210
|
+
/**
|
|
211
|
+
* startReplicatorHealthCheck starts periodic health checks for replicator mode
|
|
212
|
+
*/
|
|
213
|
+
private startReplicatorHealthCheck;
|
|
214
|
+
/**
|
|
215
|
+
* checkReplicatorHealth performs a single health check against the external replicator
|
|
216
|
+
*/
|
|
217
|
+
private checkReplicatorHealth;
|
|
218
|
+
/**
|
|
219
|
+
* flagCacheKey generates a cache key for a flag
|
|
220
|
+
*/
|
|
221
|
+
private flagCacheKey;
|
|
222
|
+
/**
|
|
223
|
+
* resourceIdCacheKey generates a cache key for an ID-based resource lookup
|
|
224
|
+
*/
|
|
225
|
+
private resourceIdCacheKey;
|
|
226
|
+
/**
|
|
227
|
+
* resourceKeyToCacheKey generates a cache key for a resource
|
|
228
|
+
*/
|
|
229
|
+
private resourceKeyToCacheKey;
|
|
230
|
+
/**
|
|
231
|
+
* deepCopyCompany creates a complete deep copy of a Company struct
|
|
232
|
+
*/
|
|
233
|
+
private deepCopyCompany;
|
|
234
|
+
private evaluateFlag;
|
|
235
|
+
/**
|
|
236
|
+
* getRulesEngineVersionKey gets the version key from the rules engine
|
|
237
|
+
*/
|
|
238
|
+
private getRulesEngineVersionKey;
|
|
239
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Datastream message types for WebSocket communication
|
|
3
|
+
*/
|
|
4
|
+
export type Action = "start" | "stop";
|
|
5
|
+
export declare enum EntityType {
|
|
6
|
+
COMPANY = "rulesengine.Company",
|
|
7
|
+
COMPANIES = "rulesengine.Companies",
|
|
8
|
+
USER = "rulesengine.User",
|
|
9
|
+
USERS = "rulesengine.Users",
|
|
10
|
+
FLAG = "rulesengine.Flag",
|
|
11
|
+
FLAGS = "rulesengine.Flags"
|
|
12
|
+
}
|
|
13
|
+
export declare enum MessageType {
|
|
14
|
+
FULL = "full",
|
|
15
|
+
PARTIAL = "partial",
|
|
16
|
+
DELETE = "delete",
|
|
17
|
+
ERROR = "error",
|
|
18
|
+
UNKNOWN = "unknown"
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* DataStreamReq represents a request message to the datastream
|
|
22
|
+
*/
|
|
23
|
+
export interface DataStreamReq {
|
|
24
|
+
entity_type: EntityType;
|
|
25
|
+
keys?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* DataStreamBaseReq wraps the request data
|
|
29
|
+
*/
|
|
30
|
+
export interface DataStreamBaseReq {
|
|
31
|
+
data: DataStreamReq;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* DataStreamResp represents a response message from the datastream
|
|
35
|
+
*/
|
|
36
|
+
export interface DataStreamResp {
|
|
37
|
+
data: unknown;
|
|
38
|
+
entity_type: string;
|
|
39
|
+
message_type: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* DataStreamError represents an error message from the datastream
|
|
43
|
+
*/
|
|
44
|
+
export interface DataStreamError {
|
|
45
|
+
error: string;
|
|
46
|
+
keys?: Record<string, string>;
|
|
47
|
+
entity_type?: EntityType;
|
|
48
|
+
}
|