@schematichq/schematic-typescript-node 1.6.2 → 1.6.4
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 +18 -3
- package/dist/api/resources/accounts/client/requests/UpdateEnvironmentRequestBody.d.ts +1 -0
- package/dist/api/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +1 -0
- package/dist/api/resources/credits/client/Client.d.ts +24 -4
- package/dist/api/resources/credits/client/requests/AcquireCreditLeaseRequestBody.d.ts +2 -0
- package/dist/api/resources/credits/client/requests/CountCreditEventLedgerRequest.d.ts +1 -1
- package/dist/api/resources/credits/client/requests/CreateCreditSpendPolicyRequestBody.d.ts +8 -4
- package/dist/api/resources/credits/client/requests/ExtendCreditLeaseRequestBody.d.ts +2 -0
- package/dist/api/resources/credits/client/requests/GetCreditSpendPolicyUsageRequest.d.ts +13 -0
- package/dist/api/resources/credits/client/requests/ListCreditEventLedgerRequest.d.ts +1 -1
- package/dist/api/resources/credits/client/requests/UpdateCreditSpendPolicyRequestBody.d.ts +3 -0
- package/dist/api/resources/credits/client/requests/index.d.ts +1 -0
- package/dist/api/resources/credits/types/GetCreditSpendPolicyUsageParams.d.ts +8 -0
- package/dist/api/resources/credits/types/GetCreditSpendPolicyUsageResponse.d.ts +6 -0
- package/dist/api/resources/credits/types/index.d.ts +2 -0
- package/dist/api/resources/entitlements/client/Client.d.ts +69 -0
- package/dist/api/resources/entitlements/client/requests/CountCompanyUserUsageRequest.d.ts +29 -0
- package/dist/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/GetCompanyUserUsageMetricsRequest.d.ts +16 -0
- package/dist/api/resources/entitlements/client/requests/ListCompanyUserUsageRequest.d.ts +29 -0
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +1 -1
- package/dist/api/resources/entitlements/client/requests/index.d.ts +3 -0
- package/dist/api/resources/entitlements/types/CountCompanyUserUsageParams.d.ts +20 -0
- package/dist/api/resources/entitlements/types/CountCompanyUserUsageResponse.d.ts +6 -0
- package/dist/api/resources/entitlements/types/GetCompanyUserUsageMetricsParams.d.ts +11 -0
- package/dist/api/resources/entitlements/types/GetCompanyUserUsageMetricsResponse.d.ts +6 -0
- package/dist/api/resources/entitlements/types/ListCompanyUserUsageParams.d.ts +20 -0
- package/dist/api/resources/entitlements/types/ListCompanyUserUsageResponse.d.ts +6 -0
- package/dist/api/resources/entitlements/types/index.d.ts +6 -0
- package/dist/api/resources/plangroups/client/Client.d.ts +2 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +2 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +2 -0
- package/dist/api/resources/planmigrations/client/Client.d.ts +2 -0
- package/dist/api/resources/planmigrations/client/requests/CountMigrationsRequest.d.ts +2 -0
- package/dist/api/resources/planmigrations/client/requests/CreateMigrationInput.d.ts +3 -0
- package/dist/api/resources/planmigrations/client/requests/ListMigrationsRequest.d.ts +2 -0
- package/dist/api/resources/planmigrations/types/CountMigrationsParams.d.ts +1 -0
- package/dist/api/resources/planmigrations/types/ListMigrationsParams.d.ts +1 -0
- package/dist/api/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +5 -0
- package/dist/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +2 -0
- package/dist/api/types/CaptureRawEvent.d.ts +2 -0
- package/dist/api/types/ChangeSubscriptionInternalRequestBody.d.ts +2 -0
- package/dist/api/types/ChangeSubscriptionRequestBody.d.ts +2 -0
- package/dist/api/types/CheckFlagsResponseData.d.ts +2 -0
- package/dist/api/types/CompanyDetailResponseData.d.ts +1 -0
- package/dist/api/types/CompanyFeatureUsageExportMetadataVisibleColumnsItem.d.ts +1 -0
- package/dist/api/types/CompanyPlanDetailResponseData.d.ts +1 -0
- package/dist/api/types/CompanyUserUsageMetricsResponseData.d.ts +11 -0
- package/dist/api/types/CompanyUserUsageResponseData.d.ts +15 -0
- package/dist/api/types/CompanyUserUsageRowResponseData.d.ts +13 -0
- package/dist/api/types/ComponentDisplaySettings.d.ts +1 -0
- package/dist/api/types/ComponentSettingsResponseData.d.ts +1 -0
- package/dist/api/types/CreateEntitlementInBundleRequestBody.d.ts +1 -1
- package/dist/api/types/CreditEventLedgerResponseData.d.ts +4 -1
- package/dist/api/types/CreditEventType.d.ts +3 -0
- package/dist/api/types/CreditLedgerEntryKind.d.ts +10 -0
- package/dist/api/types/CreditSpendPolicy.d.ts +21 -0
- package/dist/api/types/CreditSpendPolicyResponseData.d.ts +9 -0
- package/dist/api/types/CreditSpendWindow.d.ts +6 -0
- package/dist/api/types/CreditSpendWindowUnit.d.ts +6 -0
- package/dist/api/types/CustomPlanBillingResponseData.d.ts +2 -0
- package/dist/api/types/EnvironmentDetailResponseData.d.ts +1 -0
- package/dist/api/types/EnvironmentResponseData.d.ts +1 -0
- package/dist/api/types/EstimatedPlanTotal.d.ts +6 -0
- package/dist/api/types/InvoiceRequestBody.d.ts +1 -0
- package/dist/api/types/InvoiceResponseData.d.ts +2 -0
- package/dist/api/types/ManagePlanRequest.d.ts +2 -0
- package/dist/api/types/PendingMigrationResponseData.d.ts +8 -0
- package/dist/api/types/PlanEntitlementResponseData.d.ts +1 -1
- package/dist/api/types/PlanVersionMigrationResponseData.d.ts +1 -0
- package/dist/api/types/PlanVersionMigrationStrategy.d.ts +1 -0
- package/dist/api/types/PreviewSubscriptionFinanceResponseData.d.ts +2 -0
- package/dist/api/types/RulesEngineSchemaVersion.d.ts +1 -1
- package/dist/api/types/RulesengineCompany.d.ts +1 -0
- package/dist/api/types/RulesengineComparableOperator.d.ts +11 -0
- package/dist/api/types/RulesengineCondition.d.ts +1 -1
- package/dist/api/types/RulesengineCreditSpendPolicy.d.ts +21 -0
- package/dist/api/types/RulesengineCreditSpendPolicyScope.d.ts +6 -0
- package/dist/api/types/RulesengineCreditSpendWindow.d.ts +6 -0
- package/dist/api/types/RulesengineUser.d.ts +1 -0
- package/dist/api/types/UpcomingInvoiceResponseData.d.ts +2 -0
- package/dist/api/types/UsageBasedEntitlementRequestBody.d.ts +1 -1
- package/dist/api/types/UsageBasedEntitlementResponseData.d.ts +1 -1
- package/dist/api/types/UserUsageMetric.d.ts +5 -0
- package/dist/api/types/index.d.ts +13 -0
- package/dist/datastream/datastream-client.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/serialization/resources/accounts/client/requests/UpdateEnvironmentRequestBody.d.ts +1 -0
- package/dist/serialization/resources/billing/client/requests/CreateInvoiceRequestBody.d.ts +1 -0
- package/dist/serialization/resources/credits/client/requests/AcquireCreditLeaseRequestBody.d.ts +1 -0
- package/dist/serialization/resources/credits/client/requests/CreateCreditSpendPolicyRequestBody.d.ts +4 -1
- package/dist/serialization/resources/credits/client/requests/ExtendCreditLeaseRequestBody.d.ts +1 -0
- package/dist/serialization/resources/credits/client/requests/UpdateCreditSpendPolicyRequestBody.d.ts +3 -0
- package/dist/serialization/resources/credits/types/GetCreditSpendPolicyUsageParams.d.ts +11 -0
- package/dist/serialization/resources/credits/types/GetCreditSpendPolicyUsageResponse.d.ts +12 -0
- package/dist/serialization/resources/credits/types/index.d.ts +2 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyUserUsageParams.d.ts +16 -0
- package/dist/serialization/resources/entitlements/types/CountCompanyUserUsageResponse.d.ts +12 -0
- package/dist/serialization/resources/entitlements/types/GetCompanyUserUsageMetricsParams.d.ts +11 -0
- package/dist/serialization/resources/entitlements/types/GetCompanyUserUsageMetricsResponse.d.ts +12 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyUserUsageParams.d.ts +16 -0
- package/dist/serialization/resources/entitlements/types/ListCompanyUserUsageResponse.d.ts +12 -0
- package/dist/serialization/resources/entitlements/types/index.d.ts +6 -0
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +1 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +1 -0
- package/dist/serialization/resources/planmigrations/client/requests/CreateMigrationInput.d.ts +1 -0
- package/dist/serialization/resources/planmigrations/types/CountMigrationsParams.d.ts +1 -0
- package/dist/serialization/resources/planmigrations/types/ListMigrationsParams.d.ts +1 -0
- package/dist/serialization/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +2 -0
- package/dist/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +1 -0
- package/dist/serialization/types/CaptureRawEvent.d.ts +2 -0
- package/dist/serialization/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
- package/dist/serialization/types/ChangeSubscriptionRequestBody.d.ts +1 -0
- package/dist/serialization/types/CheckFlagsResponseData.d.ts +2 -0
- package/dist/serialization/types/CompanyDetailResponseData.d.ts +1 -0
- package/dist/serialization/types/CompanyFeatureUsageExportMetadataVisibleColumnsItem.d.ts +1 -1
- package/dist/serialization/types/CompanyPlanDetailResponseData.d.ts +2 -0
- package/dist/serialization/types/CompanyUserUsageMetricsResponseData.d.ts +13 -0
- package/dist/serialization/types/CompanyUserUsageResponseData.d.ts +15 -0
- package/dist/serialization/types/CompanyUserUsageRowResponseData.d.ts +14 -0
- package/dist/serialization/types/ComponentDisplaySettings.d.ts +1 -0
- package/dist/serialization/types/ComponentSettingsResponseData.d.ts +1 -0
- package/dist/serialization/types/CreditEventLedgerResponseData.d.ts +5 -1
- package/dist/serialization/types/CreditEventType.d.ts +1 -1
- package/dist/serialization/types/CreditLedgerEntryKind.d.ts +7 -0
- package/dist/serialization/types/CreditSpendPolicy.d.ts +19 -0
- package/dist/serialization/types/CreditSpendPolicyResponseData.d.ts +7 -0
- package/dist/serialization/types/CreditSpendWindow.d.ts +10 -0
- package/dist/serialization/types/CreditSpendWindowUnit.d.ts +7 -0
- package/dist/serialization/types/CustomPlanBillingResponseData.d.ts +1 -0
- package/dist/serialization/types/EnvironmentDetailResponseData.d.ts +1 -0
- package/dist/serialization/types/EnvironmentResponseData.d.ts +1 -0
- package/dist/serialization/types/EstimatedPlanTotal.d.ts +12 -0
- package/dist/serialization/types/InvoiceRequestBody.d.ts +1 -0
- package/dist/serialization/types/InvoiceResponseData.d.ts +1 -0
- package/dist/serialization/types/ManagePlanRequest.d.ts +1 -0
- package/dist/serialization/types/PendingMigrationResponseData.d.ts +5 -0
- package/dist/serialization/types/PlanVersionMigrationResponseData.d.ts +1 -0
- package/dist/serialization/types/PlanVersionMigrationStrategy.d.ts +1 -1
- package/dist/serialization/types/PreviewSubscriptionFinanceResponseData.d.ts +1 -0
- package/dist/serialization/types/RulesEngineSchemaVersion.d.ts +1 -1
- package/dist/serialization/types/RulesengineCompany.d.ts +2 -0
- package/dist/serialization/types/RulesengineComparableOperator.d.ts +7 -0
- package/dist/serialization/types/RulesengineCondition.d.ts +2 -2
- package/dist/serialization/types/RulesengineCreditSpendPolicy.d.ts +19 -0
- package/dist/serialization/types/RulesengineCreditSpendPolicyScope.d.ts +7 -0
- package/dist/serialization/types/RulesengineCreditSpendWindow.d.ts +10 -0
- package/dist/serialization/types/RulesengineUser.d.ts +2 -0
- package/dist/serialization/types/UpcomingInvoiceResponseData.d.ts +1 -0
- package/dist/serialization/types/UserUsageMetric.d.ts +7 -0
- package/dist/serialization/types/index.d.ts +13 -0
- package/dist/wasm/rulesengine.d.ts +1 -0
- package/dist/wasm/rulesengine.js +34 -4
- package/dist/wasm/rulesengine_bg.wasm.d.ts +2 -0
- package/dist/wrapper.d.ts +2 -2
- package/package.json +1 -1
|
@@ -14,7 +14,10 @@ export interface CreateMigrationInput {
|
|
|
14
14
|
planId: string;
|
|
15
15
|
planVersionIdTo: string;
|
|
16
16
|
planVersionIdsFrom?: string[];
|
|
17
|
+
/** How Stripe handles the price difference when companies are migrated. With strategy immediate, omitted means create_prorations. With end_of_billing_period only none is accepted and means the same as omitting it: the change lands on the renewal boundary, so there is nothing to prorate. With scheduled any value is accepted and omitted means none. */
|
|
17
18
|
prorationBehavior?: Schematic.MigrationProrationBehavior;
|
|
19
|
+
/** When every company moves, for strategy scheduled. Must be in the future; the migration runs within about a minute of this time. Not accepted with other strategies. */
|
|
20
|
+
scheduledAt?: Date;
|
|
18
21
|
strategy: Schematic.PlanVersionMigrationStrategy;
|
|
19
22
|
targetPlanType: Schematic.PlanType;
|
|
20
23
|
}
|
|
@@ -3,6 +3,7 @@ import type * as Schematic from "../../../../index";
|
|
|
3
3
|
* @example
|
|
4
4
|
* {
|
|
5
5
|
* featureId: "feature_id",
|
|
6
|
+
* featurePlanRolloutId: "feature_plan_rollout_id",
|
|
6
7
|
* planVersionId: "plan_version_id",
|
|
7
8
|
* status: "cancelled",
|
|
8
9
|
* limit: 1000000,
|
|
@@ -11,6 +12,7 @@ import type * as Schematic from "../../../../index";
|
|
|
11
12
|
*/
|
|
12
13
|
export interface ListMigrationsRequest {
|
|
13
14
|
featureId?: string;
|
|
15
|
+
featurePlanRolloutId?: string;
|
|
14
16
|
planVersionId?: string;
|
|
15
17
|
status?: Schematic.PlanVersionMigrationStatus;
|
|
16
18
|
/** Page limit (default 100) */
|
|
@@ -11,6 +11,8 @@ export interface PublishPlanVersionRequestBody {
|
|
|
11
11
|
address?: Schematic.CustomerBillingAddress;
|
|
12
12
|
/** The date the subscription's billing period renews on. Only honored on a first publish that starts a subscription. */
|
|
13
13
|
billingCycleAnchor?: Date;
|
|
14
|
+
/** The date the contract term starts. A past date backdates the subscription so the first invoice covers the term from this date to the renewal date. Requires billing_cycle_anchor. Only honored on a first publish that starts a subscription. */
|
|
15
|
+
billingStartDate?: Date;
|
|
14
16
|
couponExternalId?: string;
|
|
15
17
|
customFieldValues?: Schematic.CheckoutFieldValue[];
|
|
16
18
|
customerEmail?: string;
|
|
@@ -20,9 +22,12 @@ export interface PublishPlanVersionRequestBody {
|
|
|
20
22
|
phone?: string;
|
|
21
23
|
/** When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true. */
|
|
22
24
|
prorateFirstPeriod?: boolean;
|
|
25
|
+
/** How Stripe handles the price difference when companies are migrated. With migration_strategy immediate, omitted means create_prorations. With end_of_billing_period only none is accepted and means the same as omitting it: the change lands on the renewal boundary, so there is nothing to prorate. With scheduled any value is accepted and omitted means none. Not accepted with leave. */
|
|
23
26
|
prorationBehavior?: Schematic.MigrationProrationBehavior;
|
|
24
27
|
/** Refuse the publish if any company would be migrated onto the new version */
|
|
25
28
|
requireNoMigration?: boolean;
|
|
29
|
+
/** When every company moves, for migration_strategy scheduled. Must be in the future; the migration runs within about a minute of this time. Not accepted with other strategies. */
|
|
30
|
+
scheduledAt?: Date;
|
|
26
31
|
/** Whether Stripe emails the invoice when it is finalized. Defaults to true. */
|
|
27
32
|
sendInvoice?: boolean;
|
|
28
33
|
taxId?: Schematic.TaxIdInput;
|
|
@@ -9,6 +9,8 @@ export interface RetryCustomPlanBillingRequestBody {
|
|
|
9
9
|
activationStrategy?: Schematic.CustomPlanActivationStrategy;
|
|
10
10
|
/** The date the subscription's billing period renews on. Only honored when the retry creates a subscription. */
|
|
11
11
|
billingCycleAnchor?: Date;
|
|
12
|
+
/** The date the contract term starts. A past date backdates the subscription so the first invoice covers the term from this date to the renewal date. Requires billing_cycle_anchor. When both are omitted, the term pinned at finalize is reissued. Only honored when the retry creates a subscription. */
|
|
13
|
+
billingStartDate?: Date;
|
|
12
14
|
customerEmail: string;
|
|
13
15
|
daysUntilDue?: number;
|
|
14
16
|
/** When true, the partial period between the subscription starting and its renewal date is billed pro rata straight away. When false that period is free and no invoice is raised until the renewal date. Only applies alongside billing_cycle_anchor. Defaults to true. */
|
|
@@ -6,6 +6,8 @@ export interface ChangeSubscriptionInternalRequestBody {
|
|
|
6
6
|
companyId: string;
|
|
7
7
|
couponExternalId?: string;
|
|
8
8
|
creditBundles: Schematic.UpdateCreditBundleRequestBody[];
|
|
9
|
+
/** ISO 4217 currency this cart is being built in. Prices are still selected by id; this records the intent, and a cart that prices in another currency is reported as a problem. */
|
|
10
|
+
currency?: string;
|
|
9
11
|
customFieldValues: Schematic.CheckoutFieldValue[];
|
|
10
12
|
newPlanId: string;
|
|
11
13
|
newPriceId: string;
|
|
@@ -5,6 +5,8 @@ export interface ChangeSubscriptionRequestBody {
|
|
|
5
5
|
billingEntityId?: string;
|
|
6
6
|
couponExternalId?: string;
|
|
7
7
|
creditBundles: Schematic.UpdateCreditBundleRequestBody[];
|
|
8
|
+
/** ISO 4217 currency this cart is being built in. Prices are still selected by id; this records the intent, and a cart that prices in another currency is reported as a problem. */
|
|
9
|
+
currency?: string;
|
|
8
10
|
customFieldValues: Schematic.CheckoutFieldValue[];
|
|
9
11
|
newPlanId: string;
|
|
10
12
|
newPriceId: string;
|
|
@@ -2,6 +2,8 @@ import type * as Schematic from "../index";
|
|
|
2
2
|
export interface CheckFlagsResponseData {
|
|
3
3
|
/** Lease-aware credit balances keyed by credit ID, covering every credit type the company holds a balance in */
|
|
4
4
|
creditBalances?: Record<string, Schematic.CompanyCreditBalance>;
|
|
5
|
+
/** Credit spend policies binding the evaluated company and user; empty when none bind. Each response carries the whole set, so replace any previously received set with it. Advisory: the flag values do not reflect them, since a check names no draw amount */
|
|
6
|
+
creditSpendPolicies: Schematic.CreditSpendPolicy[];
|
|
5
7
|
flags: Schematic.CheckFlagResponseData[];
|
|
6
8
|
plan?: Schematic.DatastreamCompanyPlan;
|
|
7
9
|
}
|
|
@@ -2,6 +2,7 @@ import type * as Schematic from "../index";
|
|
|
2
2
|
export interface CompanyDetailResponseData {
|
|
3
3
|
addOns: Schematic.CompanyPlanWithBillingSubView[];
|
|
4
4
|
billingCreditBalances?: Record<string, number>;
|
|
5
|
+
billingEmail?: string;
|
|
5
6
|
billingProfile?: Schematic.CompanyBillingProfileResponseData;
|
|
6
7
|
billingProfiles?: Schematic.CompanyBillingProfileResponseData[];
|
|
7
8
|
billingSubscription?: Schematic.BillingSubscriptionView;
|
|
@@ -3,5 +3,6 @@ export declare const CompanyFeatureUsageExportMetadataVisibleColumnsItem: {
|
|
|
3
3
|
readonly Subscription: "subscription";
|
|
4
4
|
readonly Users: "users";
|
|
5
5
|
readonly LastSeenAt: "last_seen_at";
|
|
6
|
+
readonly CreatedAt: "created_at";
|
|
6
7
|
};
|
|
7
8
|
export type CompanyFeatureUsageExportMetadataVisibleColumnsItem = (typeof CompanyFeatureUsageExportMetadataVisibleColumnsItem)[keyof typeof CompanyFeatureUsageExportMetadataVisibleColumnsItem];
|
|
@@ -25,6 +25,7 @@ export interface CompanyPlanDetailResponseData {
|
|
|
25
25
|
description: string;
|
|
26
26
|
draftVersion?: Schematic.PlanVersionResponseData;
|
|
27
27
|
entitlements?: Schematic.PlanEntitlementResponseData[];
|
|
28
|
+
estimatedTotals?: Schematic.EstimatedPlanTotal[];
|
|
28
29
|
features: Schematic.FeatureInPlanResponseData[];
|
|
29
30
|
icon: Schematic.PlanIcon;
|
|
30
31
|
id: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface CompanyUserUsageMetricsResponseData {
|
|
3
|
+
/** End of the usage window (exclusive) */
|
|
4
|
+
endTime: Date;
|
|
5
|
+
/** Event-based features the company has user-attributed usage for in the window; a feature with usage but no entitlement is still listed */
|
|
6
|
+
features: Schematic.FeatureResponseData[];
|
|
7
|
+
/** Whether the company consumed any credits in the window */
|
|
8
|
+
hasCredits: boolean;
|
|
9
|
+
/** Start of the usage window */
|
|
10
|
+
startTime: Date;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface CompanyUserUsageResponseData {
|
|
3
|
+
/** End of the usage window (exclusive) */
|
|
4
|
+
endTime: Date;
|
|
5
|
+
/** This page of per-user consumption within the window, heaviest first */
|
|
6
|
+
rows: Schematic.CompanyUserUsageRowResponseData[];
|
|
7
|
+
/** Start of the usage window */
|
|
8
|
+
startTime: Date;
|
|
9
|
+
/** The heaviest user's fraction (0-1) of consumption, measured across every user in the window and not just this page */
|
|
10
|
+
topUserShare: number;
|
|
11
|
+
/** Consumption across every user in the window including unattributed, not just this page */
|
|
12
|
+
total: number;
|
|
13
|
+
/** Consumption from events sent without a user; not a user, so it is excluded from rows and from the count, and returned on every page. Null when the window has none */
|
|
14
|
+
unattributed?: Schematic.CompanyUserUsageRowResponseData;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface CompanyUserUsageRowResponseData {
|
|
3
|
+
/** When the user last used the feature within the window; null for the credits metric, which aggregates balances rather than timestamped events */
|
|
4
|
+
lastSeen?: Date;
|
|
5
|
+
/** This row's fraction (0-1) of consumption within the window, including unattributed consumption */
|
|
6
|
+
share: number;
|
|
7
|
+
/** The user the consumption is attributed to; null for consumption from events sent without a user */
|
|
8
|
+
user?: Schematic.UserResponseData;
|
|
9
|
+
/** The user the consumption is attributed to; null for unattributed consumption */
|
|
10
|
+
userId?: string;
|
|
11
|
+
/** The user's consumption of the metric within the window */
|
|
12
|
+
value: number;
|
|
13
|
+
}
|
|
@@ -28,7 +28,7 @@ export interface CreateEntitlementInBundleRequestBody {
|
|
|
28
28
|
quarterlyUnitPriceDecimal?: string;
|
|
29
29
|
softLimit?: number;
|
|
30
30
|
tierMode?: Schematic.BillingTiersMode;
|
|
31
|
-
/** The committed unit quantity for this entitlement. For custom plans this is the
|
|
31
|
+
/** The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. */
|
|
32
32
|
usageQuantity?: number;
|
|
33
33
|
valueBool?: boolean;
|
|
34
34
|
valueCreditId?: string;
|
|
@@ -3,11 +3,12 @@ export interface CreditEventLedgerResponseData {
|
|
|
3
3
|
amount: number;
|
|
4
4
|
autoTopupLogId?: string;
|
|
5
5
|
billingCreditBundleId?: string;
|
|
6
|
-
billingCreditId
|
|
6
|
+
billingCreditId?: string;
|
|
7
7
|
company?: Schematic.CompanyLedgerResponseData;
|
|
8
8
|
companyId: string;
|
|
9
9
|
credit?: Schematic.BillingCreditLedgerResponseData;
|
|
10
10
|
creditName: string;
|
|
11
|
+
currency?: string;
|
|
11
12
|
environmentId: string;
|
|
12
13
|
eventAt: Date;
|
|
13
14
|
eventId: string;
|
|
@@ -24,6 +25,7 @@ export interface CreditEventLedgerResponseData {
|
|
|
24
25
|
grantQuantityRemaining?: number;
|
|
25
26
|
grantReason?: Schematic.BillingCreditGrantReason;
|
|
26
27
|
grantValidFrom?: Date;
|
|
28
|
+
kind: Schematic.CreditLedgerEntryKind;
|
|
27
29
|
planId?: string;
|
|
28
30
|
quantityConsumed?: number;
|
|
29
31
|
quantityRemainingAtZeroOut?: number;
|
|
@@ -32,5 +34,6 @@ export interface CreditEventLedgerResponseData {
|
|
|
32
34
|
transferReason?: Schematic.CreditTransferReason;
|
|
33
35
|
usageEventId?: string;
|
|
34
36
|
usageReason?: Schematic.CreditUsageReason;
|
|
37
|
+
userId?: string;
|
|
35
38
|
zeroedOutReason?: Schematic.BillingCreditGrantZeroedOutReason;
|
|
36
39
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const CreditLedgerEntryKind: {
|
|
2
|
+
readonly Adjustment: "adjustment";
|
|
3
|
+
readonly Charge: "charge";
|
|
4
|
+
readonly Drawdown: "drawdown";
|
|
5
|
+
readonly Grant: "grant";
|
|
6
|
+
readonly Settlement: "settlement";
|
|
7
|
+
readonly Transfer: "transfer";
|
|
8
|
+
readonly ZeroOut: "zero_out";
|
|
9
|
+
};
|
|
10
|
+
export type CreditLedgerEntryKind = (typeof CreditLedgerEntryKind)[keyof typeof CreditLedgerEntryKind];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface CreditSpendPolicy {
|
|
3
|
+
/** How much of the limit is already spent in the current period */
|
|
4
|
+
consumed?: number;
|
|
5
|
+
/** The credit the policy limits */
|
|
6
|
+
creditId: string;
|
|
7
|
+
/** The ID of the policy */
|
|
8
|
+
id: string;
|
|
9
|
+
/** How the limit is applied */
|
|
10
|
+
kind: string;
|
|
11
|
+
/** The name the account gave the policy */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** The ceiling, in credits */
|
|
14
|
+
limit: number;
|
|
15
|
+
/** For a windowed limit, when the current period ends and consumed no longer applies */
|
|
16
|
+
resetsAt?: Date;
|
|
17
|
+
/** Whether the policy limits the company or one user */
|
|
18
|
+
scope: Schematic.CreditSpendPolicyScope;
|
|
19
|
+
/** For a windowed limit, the period it accumulates over */
|
|
20
|
+
window?: Schematic.CreditSpendWindow;
|
|
21
|
+
}
|
|
@@ -2,11 +2,20 @@ import type * as Schematic from "../index";
|
|
|
2
2
|
export interface CreditSpendPolicyResponseData {
|
|
3
3
|
billingCreditId: string;
|
|
4
4
|
companyId?: string;
|
|
5
|
+
/** Credits spent in the current window. Set only by the usage route, and only for a window cap. */
|
|
6
|
+
consumed?: number;
|
|
5
7
|
createdAt: Date;
|
|
8
|
+
/** Credits left in the current window. Set only by the usage route, and only for a window cap. */
|
|
9
|
+
headroom?: number;
|
|
6
10
|
id: string;
|
|
7
11
|
label?: string;
|
|
8
12
|
maxPerDraw?: number;
|
|
13
|
+
/** When the current window ends. Set only by the usage route, and only for a window cap. */
|
|
14
|
+
resetsAt?: Date;
|
|
9
15
|
scopeType: Schematic.CreditSpendPolicyScope;
|
|
10
16
|
updatedAt: Date;
|
|
11
17
|
userId?: string;
|
|
18
|
+
windowAmount?: number;
|
|
19
|
+
windowCount: number;
|
|
20
|
+
windowUnit?: Schematic.CreditSpendWindowUnit;
|
|
12
21
|
}
|
|
@@ -3,6 +3,8 @@ export interface CustomPlanBillingResponseData {
|
|
|
3
3
|
activationStrategy: Schematic.CustomPlanActivationStrategy;
|
|
4
4
|
/** The billing period renewal date pinned when the subscription started, when one was set. When no invoice exists yet, the first invoice is raised on this date. */
|
|
5
5
|
billingCycleAnchor?: Date;
|
|
6
|
+
/** The date the contract term starts, when the operator pinned one. A past date was backdated onto the subscription so the first period runs from the contract date rather than from finalization. */
|
|
7
|
+
billingStartDate?: Date;
|
|
6
8
|
companyId: string;
|
|
7
9
|
createdAt: Date;
|
|
8
10
|
daysUntilDue: number;
|
|
@@ -19,6 +19,8 @@ export interface InvoiceResponseData {
|
|
|
19
19
|
status?: Schematic.InvoiceStatus;
|
|
20
20
|
subscriptionExternalId?: string;
|
|
21
21
|
subtotal: number;
|
|
22
|
+
/** Amount after discounts and tax, before applying the customer balance. Null when the provider has not reported it: rows synced before the column existed, or pushed without one. */
|
|
23
|
+
total?: number;
|
|
22
24
|
updatedAt: Date;
|
|
23
25
|
url?: string;
|
|
24
26
|
}
|
|
@@ -19,6 +19,8 @@ export interface ManagePlanRequest {
|
|
|
19
19
|
companyId: string;
|
|
20
20
|
couponExternalId?: string;
|
|
21
21
|
creditBundles: Schematic.UpdateCreditBundleRequestBody[];
|
|
22
|
+
/** ISO 4217 currency this change is being built in. Prices are still selected by id; this records the intent. */
|
|
23
|
+
currency?: string;
|
|
22
24
|
customFieldValues: Schematic.CheckoutFieldValue[];
|
|
23
25
|
/** Payment terms in days for an invoiced subscription. Defaults to 30. */
|
|
24
26
|
daysUntilDue?: number;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
1
2
|
export interface PendingMigrationResponseData {
|
|
3
|
+
/** When the company moves to the new version: the migration's date for a scheduled migration, or the end of the company's current billing period. Null when no date can be named yet, for example when the company's only subscription is past due or set to cancel; the company then moves at the next opportunity. */
|
|
4
|
+
effectiveAt?: Date;
|
|
2
5
|
migrationId: string;
|
|
6
|
+
/** How the price difference is billed when the company moves. Always none for an end-of-billing-period migration. */
|
|
7
|
+
prorationBehavior?: Schematic.MigrationProrationBehavior;
|
|
8
|
+
/** Deprecated; use effective_at, which carries the same value. */
|
|
3
9
|
scheduledFor?: Date;
|
|
10
|
+
/** Whether the company moves at the end of its billing period (end_of_billing_period) or on a specific date (scheduled). The type is shared with plan version migrations, but only those two values appear here: an immediate migration never pends. */
|
|
11
|
+
strategy: Schematic.PlanVersionMigrationStrategy;
|
|
4
12
|
toPlanId: string;
|
|
5
13
|
toPlanName: string;
|
|
6
14
|
toPlanVersionId: string;
|
|
@@ -26,7 +26,7 @@ export interface PlanEntitlementResponseData {
|
|
|
26
26
|
softLimit?: number;
|
|
27
27
|
updatedAt: Date;
|
|
28
28
|
usageBasedProduct?: Schematic.BillingProductResponseData;
|
|
29
|
-
/** The committed unit quantity for this entitlement. For custom plans this is the
|
|
29
|
+
/** The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. */
|
|
30
30
|
usageQuantity?: number;
|
|
31
31
|
valueBool?: boolean;
|
|
32
32
|
valueCredit?: Schematic.BillingCreditResponseData;
|
|
@@ -14,6 +14,7 @@ export interface PlanVersionMigrationResponseData {
|
|
|
14
14
|
planVersionIdTo: string;
|
|
15
15
|
planVersionIdsFrom: string[];
|
|
16
16
|
prorationBehavior?: Schematic.MigrationProrationBehavior;
|
|
17
|
+
scheduledAt?: Date;
|
|
17
18
|
skippedCompanies: number;
|
|
18
19
|
startedAt?: Date;
|
|
19
20
|
status: Schematic.PlanVersionMigrationStatus;
|
|
@@ -2,5 +2,6 @@ export declare const PlanVersionMigrationStrategy: {
|
|
|
2
2
|
readonly EndOfBillingPeriod: "end_of_billing_period";
|
|
3
3
|
readonly Immediate: "immediate";
|
|
4
4
|
readonly Leave: "leave";
|
|
5
|
+
readonly Scheduled: "scheduled";
|
|
5
6
|
};
|
|
6
7
|
export type PlanVersionMigrationStrategy = (typeof PlanVersionMigrationStrategy)[keyof typeof PlanVersionMigrationStrategy];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../index";
|
|
2
2
|
export interface PreviewSubscriptionFinanceResponseData {
|
|
3
3
|
amountOff: number;
|
|
4
|
+
/** ISO 4217 currency every amount in this block is denominated in. */
|
|
5
|
+
currency: string;
|
|
4
6
|
discountAmount: number;
|
|
5
7
|
discounts: Schematic.PreviewSubscriptionDiscountResponseData[];
|
|
6
8
|
dueNow: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The current schema version hash for rules engine types. The first enum value is always the current version. */
|
|
2
2
|
export declare const RulesEngineSchemaVersion: {
|
|
3
|
-
readonly
|
|
3
|
+
readonly Vf4A06160: "vf4a06160";
|
|
4
4
|
readonly PlaceholderForFernCompatibility: "placeholder-for-fern-compatibility";
|
|
5
5
|
};
|
|
6
6
|
export type RulesEngineSchemaVersion = (typeof RulesEngineSchemaVersion)[keyof typeof RulesEngineSchemaVersion];
|
|
@@ -5,6 +5,7 @@ export interface RulesengineCompany {
|
|
|
5
5
|
billingProductIds: string[];
|
|
6
6
|
creditBalances: Record<string, number>;
|
|
7
7
|
creditPostpaid?: Record<string, Schematic.RulesengineCreditPostpaidConfig>;
|
|
8
|
+
creditSpendPolicies?: Schematic.RulesengineCreditSpendPolicy[];
|
|
8
9
|
entitlements?: Schematic.RulesengineFeatureEntitlement[];
|
|
9
10
|
environmentId: string;
|
|
10
11
|
id: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const RulesengineComparableOperator: {
|
|
2
|
+
readonly Eq: "eq";
|
|
3
|
+
readonly Gt: "gt";
|
|
4
|
+
readonly Gte: "gte";
|
|
5
|
+
readonly IsEmpty: "is_empty";
|
|
6
|
+
readonly Lt: "lt";
|
|
7
|
+
readonly Lte: "lte";
|
|
8
|
+
readonly NotEmpty: "not_empty";
|
|
9
|
+
readonly Ne: "ne";
|
|
10
|
+
};
|
|
11
|
+
export type RulesengineComparableOperator = (typeof RulesengineComparableOperator)[keyof typeof RulesengineComparableOperator];
|
|
@@ -11,7 +11,7 @@ export interface RulesengineCondition {
|
|
|
11
11
|
metricPeriod?: Schematic.RulesengineMetricPeriod;
|
|
12
12
|
metricPeriodMonthReset?: Schematic.RulesengineMetricPeriodMonthReset;
|
|
13
13
|
metricValue?: number;
|
|
14
|
-
operator: Schematic.
|
|
14
|
+
operator: Schematic.RulesengineComparableOperator;
|
|
15
15
|
resourceIds: string[];
|
|
16
16
|
traitDefinition?: Schematic.RulesengineTraitDefinition;
|
|
17
17
|
traitValue: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type * as Schematic from "../index";
|
|
2
|
+
export interface RulesengineCreditSpendPolicy {
|
|
3
|
+
/** How much of the limit is already spent in the current period */
|
|
4
|
+
consumed?: number;
|
|
5
|
+
/** The credit the policy limits */
|
|
6
|
+
creditId: string;
|
|
7
|
+
/** The ID of the policy */
|
|
8
|
+
id: string;
|
|
9
|
+
/** How the limit is applied */
|
|
10
|
+
kind: string;
|
|
11
|
+
/** The name the account gave the policy */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** The ceiling, in credits */
|
|
14
|
+
limit: number;
|
|
15
|
+
/** For a windowed limit, when the current period ends and consumed no longer applies */
|
|
16
|
+
resetsAt?: Date;
|
|
17
|
+
/** Whether the policy limits the company or one user */
|
|
18
|
+
scope: Schematic.RulesengineCreditSpendPolicyScope;
|
|
19
|
+
/** For a windowed limit, the period it accumulates over */
|
|
20
|
+
window?: Schematic.RulesengineCreditSpendWindow;
|
|
21
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RulesengineCreditSpendPolicyScope: {
|
|
2
|
+
readonly Company: "company";
|
|
3
|
+
readonly User: "user";
|
|
4
|
+
readonly Group: "group";
|
|
5
|
+
};
|
|
6
|
+
export type RulesengineCreditSpendPolicyScope = (typeof RulesengineCreditSpendPolicyScope)[keyof typeof RulesengineCreditSpendPolicyScope];
|
|
@@ -18,6 +18,8 @@ export interface UpcomingInvoiceResponseData {
|
|
|
18
18
|
status?: Schematic.InvoiceStatus;
|
|
19
19
|
subscriptionExternalId?: string;
|
|
20
20
|
subtotal: number;
|
|
21
|
+
/** Amount after discounts and tax, before applying the customer balance. Null when the provider has not reported it. */
|
|
22
|
+
total?: number;
|
|
21
23
|
updatedAt: Date;
|
|
22
24
|
url?: string;
|
|
23
25
|
}
|
|
@@ -22,7 +22,7 @@ export interface UsageBasedEntitlementRequestBody {
|
|
|
22
22
|
quarterlyUnitPriceDecimal?: string;
|
|
23
23
|
softLimit?: number;
|
|
24
24
|
tierMode?: Schematic.BillingTiersMode;
|
|
25
|
-
/** The committed unit quantity for this entitlement. For custom plans this is the
|
|
25
|
+
/** The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. */
|
|
26
26
|
usageQuantity?: number;
|
|
27
27
|
yearlyMeteredPriceId?: string;
|
|
28
28
|
yearlyPriceTiers?: Schematic.CreatePriceTierRequestBody[];
|
|
@@ -9,7 +9,7 @@ export interface UsageBasedEntitlementResponseData {
|
|
|
9
9
|
monthlyUsageBasedPrice?: Schematic.BillingPriceView;
|
|
10
10
|
priceBehavior?: Schematic.EntitlementPriceBehavior;
|
|
11
11
|
quarterlyUsageBasedPrice?: Schematic.BillingPriceView;
|
|
12
|
-
/** The committed unit quantity for this entitlement. For custom plans this is the
|
|
12
|
+
/** The committed unit quantity for this entitlement. For custom plans this is the minimum the company is contractually committed to: the company can buy more, and finalizing a new plan version sets the subscription quantity to the larger of this value and what the subscription already holds. For standard plans it is the quantity pre-filled when subscribing. Only applies to pay-in-advance entitlements. */
|
|
13
13
|
usageQuantity?: number;
|
|
14
14
|
valueBool?: boolean;
|
|
15
15
|
valueNumeric?: number;
|