@schematichq/schematic-typescript-node 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/api/resources/credits/client/requests/AcquireCreditLeaseRequestBody.d.ts +1 -0
- package/dist/api/resources/credits/client/requests/ExtendCreditLeaseRequestBody.d.ts +3 -0
- package/dist/api/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.d.ts +4 -0
- package/dist/api/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +4 -0
- package/dist/api/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +4 -0
- package/dist/api/resources/features/client/requests/CheckAndReserveFlagRequestBody.d.ts +4 -2
- package/dist/api/types/BillingArrearsCadence.d.ts +1 -0
- package/dist/api/types/BillingCreditGrantReason.d.ts +3 -0
- package/dist/api/types/BillingCreditResponseData.d.ts +1 -0
- package/dist/api/types/BillingPlanCreditGrantBillingMode.d.ts +5 -0
- package/dist/api/types/BillingPlanCreditGrantPriceTierResponseData.d.ts +10 -0
- package/dist/api/types/BillingPlanCreditGrantResponseData.d.ts +12 -0
- package/dist/api/types/CompanyPlanCreditGrantView.d.ts +3 -0
- package/dist/api/types/CreateBillingPlanCreditGrantRequestBody.d.ts +11 -1
- package/dist/api/types/CreateEntitlementInBundleRequestBody.d.ts +4 -0
- package/dist/api/types/CreditEventLedgerResponseData.d.ts +1 -0
- package/dist/api/types/CreditGrantPriceTierRequestBody.d.ts +8 -0
- package/dist/api/types/CreditTransferReason.d.ts +7 -0
- package/dist/api/types/PlanCreditGrantView.d.ts +3 -0
- package/dist/api/types/PlanEntitlementResponseData.d.ts +4 -0
- package/dist/api/types/UpdateBillingPlanCreditGrantRequestBody.d.ts +11 -1
- package/dist/api/types/UsageBasedEntitlementRequestBody.d.ts +4 -0
- package/dist/api/types/index.d.ts +4 -0
- package/dist/cache/redis.d.ts +11 -0
- package/dist/credits/check.d.ts +10 -5
- package/dist/credits/index.d.ts +3 -3
- package/dist/credits/lease-manager.d.ts +74 -2
- package/dist/credits/lease-store.d.ts +27 -11
- package/dist/credits/redis-lease-store.d.ts +2 -2
- package/dist/credits/types.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/serialization/resources/credits/client/requests/ExtendCreditLeaseRequestBody.d.ts +1 -0
- package/dist/serialization/resources/entitlements/client/requests/CreateBillingLinkedPlanEntitlementRequestBody.d.ts +4 -0
- package/dist/serialization/resources/entitlements/client/requests/CreatePlanEntitlementRequestBody.d.ts +4 -0
- package/dist/serialization/resources/entitlements/client/requests/UpdatePlanEntitlementRequestBody.d.ts +4 -0
- package/dist/serialization/resources/features/client/requests/CheckAndReserveFlagRequestBody.d.ts +1 -0
- package/dist/serialization/types/BillingArrearsCadence.d.ts +1 -1
- package/dist/serialization/types/BillingCreditGrantReason.d.ts +1 -1
- package/dist/serialization/types/BillingCreditResponseData.d.ts +2 -0
- package/dist/serialization/types/BillingPlanCreditGrantBillingMode.d.ts +7 -0
- package/dist/serialization/types/BillingPlanCreditGrantPriceTierResponseData.d.ts +12 -0
- package/dist/serialization/types/BillingPlanCreditGrantResponseData.d.ts +10 -0
- package/dist/serialization/types/CompanyPlanCreditGrantView.d.ts +5 -0
- package/dist/serialization/types/CreateBillingPlanCreditGrantRequestBody.d.ts +8 -0
- package/dist/serialization/types/CreateEntitlementInBundleRequestBody.d.ts +4 -0
- package/dist/serialization/types/CreditEventLedgerResponseData.d.ts +2 -0
- package/dist/serialization/types/CreditGrantPriceTierRequestBody.d.ts +11 -0
- package/dist/serialization/types/CreditTransferReason.d.ts +7 -0
- package/dist/serialization/types/PlanCreditGrantView.d.ts +5 -0
- package/dist/serialization/types/PlanEntitlementResponseData.d.ts +4 -0
- package/dist/serialization/types/UpdateBillingPlanCreditGrantRequestBody.d.ts +8 -0
- package/dist/serialization/types/UsageBasedEntitlementRequestBody.d.ts +4 -0
- package/dist/serialization/types/index.d.ts +4 -0
- package/dist/wrapper.d.ts +50 -16
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../../../../api/index";
|
|
2
2
|
import * as core from "../../../../../core";
|
|
3
3
|
import type * as serializers from "../../../../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "../../../../types/BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "../../../../types/BillingArrearsCadence";
|
|
4
6
|
import { BillingProviderType } from "../../../../types/BillingProviderType";
|
|
5
7
|
import { BillingTiersMode } from "../../../../types/BillingTiersMode";
|
|
6
8
|
import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierRequestBody";
|
|
@@ -27,7 +29,9 @@ export declare namespace CreateBillingLinkedPlanEntitlementRequestBody {
|
|
|
27
29
|
monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
28
30
|
monthly_unit_price?: number | null;
|
|
29
31
|
monthly_unit_price_decimal?: string | null;
|
|
32
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
30
33
|
overage_billing_product_id?: string | null;
|
|
34
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
31
35
|
plan_id: string;
|
|
32
36
|
plan_version_id?: string | null;
|
|
33
37
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../../../../api/index";
|
|
2
2
|
import * as core from "../../../../../core";
|
|
3
3
|
import type * as serializers from "../../../../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "../../../../types/BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "../../../../types/BillingArrearsCadence";
|
|
4
6
|
import { BillingTiersMode } from "../../../../types/BillingTiersMode";
|
|
5
7
|
import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierRequestBody";
|
|
6
8
|
import { CurrencyPriceRequestBody } from "../../../../types/CurrencyPriceRequestBody";
|
|
@@ -24,7 +26,9 @@ export declare namespace CreatePlanEntitlementRequestBody {
|
|
|
24
26
|
monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
25
27
|
monthly_unit_price?: number | null;
|
|
26
28
|
monthly_unit_price_decimal?: string | null;
|
|
29
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
27
30
|
overage_billing_product_id?: string | null;
|
|
31
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
28
32
|
plan_id: string;
|
|
29
33
|
plan_version_id?: string | null;
|
|
30
34
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../../../../api/index";
|
|
2
2
|
import * as core from "../../../../../core";
|
|
3
3
|
import type * as serializers from "../../../../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "../../../../types/BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "../../../../types/BillingArrearsCadence";
|
|
4
6
|
import { BillingTiersMode } from "../../../../types/BillingTiersMode";
|
|
5
7
|
import { CreatePriceTierRequestBody } from "../../../../types/CreatePriceTierRequestBody";
|
|
6
8
|
import { CurrencyPriceRequestBody } from "../../../../types/CurrencyPriceRequestBody";
|
|
@@ -23,7 +25,9 @@ export declare namespace UpdatePlanEntitlementRequestBody {
|
|
|
23
25
|
monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
24
26
|
monthly_unit_price?: number | null;
|
|
25
27
|
monthly_unit_price_decimal?: string | null;
|
|
28
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
26
29
|
overage_billing_product_id?: string | null;
|
|
30
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
27
31
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
28
32
|
price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
29
33
|
quarterly_metered_price_id?: string | null;
|
package/dist/serialization/resources/features/client/requests/CheckAndReserveFlagRequestBody.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare namespace CheckAndReserveFlagRequestBody {
|
|
|
7
7
|
interface Raw {
|
|
8
8
|
company?: Record<string, string> | null;
|
|
9
9
|
expires_at?: string | null;
|
|
10
|
+
idempotency_key?: string | null;
|
|
10
11
|
preflight?: PreflightRequestBody.Raw | null;
|
|
11
12
|
quantity?: number | null;
|
|
12
13
|
user?: Record<string, string> | null;
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core";
|
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
4
|
export declare const BillingArrearsCadence: core.serialization.Schema<serializers.BillingArrearsCadence.Raw, Schematic.BillingArrearsCadence>;
|
|
5
5
|
export declare namespace BillingArrearsCadence {
|
|
6
|
-
type Raw = "end_of_billing_period" | "monthly";
|
|
6
|
+
type Raw = "end_of_billing_period" | "monthly" | "quarterly";
|
|
7
7
|
}
|
|
@@ -3,5 +3,5 @@ import * as core from "../../core";
|
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
4
|
export declare const BillingCreditGrantReason: core.serialization.Schema<serializers.BillingCreditGrantReason.Raw, Schematic.BillingCreditGrantReason>;
|
|
5
5
|
export declare namespace BillingCreditGrantReason {
|
|
6
|
-
type Raw = "adjustment" | "billing_credit_auto_topup" | "free" | "plan" | "purchased" | "rollover";
|
|
6
|
+
type Raw = "adjustment" | "billing_credit_auto_topup" | "free" | "plan" | "postpaid_forgiven" | "postpaid_overdraft" | "postpaid_settlement" | "purchased" | "rollover";
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import * as core from "../../core";
|
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
4
|
import { BillingCreditBurnStrategy } from "./BillingCreditBurnStrategy";
|
|
5
5
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
6
|
+
import { BillingCreditLedgerAuthority } from "./BillingCreditLedgerAuthority";
|
|
6
7
|
import { BillingCreditRolloverPolicy } from "./BillingCreditRolloverPolicy";
|
|
7
8
|
import { BillingPriceResponseData } from "./BillingPriceResponseData";
|
|
8
9
|
import { BillingProductResponseData } from "./BillingProductResponseData";
|
|
@@ -20,6 +21,7 @@ export declare namespace BillingCreditResponseData {
|
|
|
20
21
|
description: string;
|
|
21
22
|
icon?: string | null;
|
|
22
23
|
id: string;
|
|
24
|
+
ledger_authority: BillingCreditLedgerAuthority.Raw;
|
|
23
25
|
name: string;
|
|
24
26
|
plural_name?: string | null;
|
|
25
27
|
price?: BillingPriceResponseData.Raw | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Schematic from "../../api/index";
|
|
2
|
+
import * as core from "../../core";
|
|
3
|
+
import type * as serializers from "../index";
|
|
4
|
+
export declare const BillingPlanCreditGrantBillingMode: core.serialization.Schema<serializers.BillingPlanCreditGrantBillingMode.Raw, Schematic.BillingPlanCreditGrantBillingMode>;
|
|
5
|
+
export declare namespace BillingPlanCreditGrantBillingMode {
|
|
6
|
+
type Raw = "granted" | "billed";
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Schematic from "../../api/index";
|
|
2
|
+
import * as core from "../../core";
|
|
3
|
+
import type * as serializers from "../index";
|
|
4
|
+
export declare const BillingPlanCreditGrantPriceTierResponseData: core.serialization.ObjectSchema<serializers.BillingPlanCreditGrantPriceTierResponseData.Raw, Schematic.BillingPlanCreditGrantPriceTierResponseData>;
|
|
5
|
+
export declare namespace BillingPlanCreditGrantPriceTierResponseData {
|
|
6
|
+
interface Raw {
|
|
7
|
+
from: number;
|
|
8
|
+
per_unit_price?: number | null;
|
|
9
|
+
per_unit_price_decimal?: string | null;
|
|
10
|
+
to?: number | null;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -7,9 +7,13 @@ import { BillingCreditAutoTopupAvailability } from "./BillingCreditAutoTopupAvai
|
|
|
7
7
|
import { BillingCreditExpiryType } from "./BillingCreditExpiryType";
|
|
8
8
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
9
9
|
import { BillingCreditResponseData } from "./BillingCreditResponseData";
|
|
10
|
+
import { BillingPlanCreditGrantBillingMode } from "./BillingPlanCreditGrantBillingMode";
|
|
11
|
+
import { BillingPlanCreditGrantPriceTierResponseData } from "./BillingPlanCreditGrantPriceTierResponseData";
|
|
10
12
|
import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence";
|
|
11
13
|
import { BillingPlanCreditGrantResetStart } from "./BillingPlanCreditGrantResetStart";
|
|
12
14
|
import { BillingPlanCreditGrantResetType } from "./BillingPlanCreditGrantResetType";
|
|
15
|
+
import { BillingPriceResponseData } from "./BillingPriceResponseData";
|
|
16
|
+
import { BillingTiersMode } from "./BillingTiersMode";
|
|
13
17
|
import { PlanCreditGrantScaling } from "./PlanCreditGrantScaling";
|
|
14
18
|
import { PreviewObjectResponseData } from "./PreviewObjectResponseData";
|
|
15
19
|
export declare const BillingPlanCreditGrantResponseData: core.serialization.ObjectSchema<serializers.BillingPlanCreditGrantResponseData.Raw, Schematic.BillingPlanCreditGrantResponseData>;
|
|
@@ -27,6 +31,7 @@ export declare namespace BillingPlanCreditGrantResponseData {
|
|
|
27
31
|
auto_topup_self_service: boolean;
|
|
28
32
|
auto_topup_threshold_credits?: number | null;
|
|
29
33
|
auto_topup_threshold_percent?: number | null;
|
|
34
|
+
billing_mode: BillingPlanCreditGrantBillingMode.Raw;
|
|
30
35
|
can_buy_bundles: boolean;
|
|
31
36
|
company_credit_amount: number;
|
|
32
37
|
created_at: string;
|
|
@@ -49,11 +54,16 @@ export declare namespace BillingPlanCreditGrantResponseData {
|
|
|
49
54
|
postpaid_enabled: boolean;
|
|
50
55
|
postpaid_rate_per_unit?: number | null;
|
|
51
56
|
postpaid_rate_per_unit_decimal?: string | null;
|
|
57
|
+
price?: BillingPriceResponseData.Raw | null;
|
|
58
|
+
price_tiers: BillingPlanCreditGrantPriceTierResponseData.Raw[];
|
|
52
59
|
reset_cadence?: BillingPlanCreditGrantResetCadence.Raw | null;
|
|
53
60
|
reset_start?: BillingPlanCreditGrantResetStart.Raw | null;
|
|
54
61
|
reset_type?: BillingPlanCreditGrantResetType.Raw | null;
|
|
55
62
|
rollover_percentage: number;
|
|
56
63
|
scaling: PlanCreditGrantScaling.Raw;
|
|
64
|
+
tier_mode?: BillingTiersMode.Raw | null;
|
|
65
|
+
unit_price?: number | null;
|
|
66
|
+
unit_price_decimal?: string | null;
|
|
57
67
|
updated_at: string;
|
|
58
68
|
}
|
|
59
69
|
}
|
|
@@ -7,9 +7,11 @@ import { BillingCreditAutoTopupAvailability } from "./BillingCreditAutoTopupAvai
|
|
|
7
7
|
import { BillingCreditExpiryType } from "./BillingCreditExpiryType";
|
|
8
8
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
9
9
|
import { BillingCreditView } from "./BillingCreditView";
|
|
10
|
+
import { BillingPlanCreditGrantBillingMode } from "./BillingPlanCreditGrantBillingMode";
|
|
10
11
|
import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence";
|
|
11
12
|
import { BillingPlanCreditGrantResetStart } from "./BillingPlanCreditGrantResetStart";
|
|
12
13
|
import { BillingPlanCreditGrantResetType } from "./BillingPlanCreditGrantResetType";
|
|
14
|
+
import { BillingPriceView } from "./BillingPriceView";
|
|
13
15
|
import { GenericPreviewObject } from "./GenericPreviewObject";
|
|
14
16
|
import { PlanCreditGrantScaling } from "./PlanCreditGrantScaling";
|
|
15
17
|
export declare const CompanyPlanCreditGrantView: core.serialization.ObjectSchema<serializers.CompanyPlanCreditGrantView.Raw, Schematic.CompanyPlanCreditGrantView>;
|
|
@@ -32,6 +34,8 @@ export declare namespace CompanyPlanCreditGrantView {
|
|
|
32
34
|
billing_credit_postpaid_enabled: boolean;
|
|
33
35
|
billing_credit_postpaid_rate_per_unit?: number | null;
|
|
34
36
|
billing_credit_postpaid_rate_per_unit_decimal?: string | null;
|
|
37
|
+
billing_mode: BillingPlanCreditGrantBillingMode.Raw;
|
|
38
|
+
billing_product_price_id?: string | null;
|
|
35
39
|
company_auto_topup_amount?: number | null;
|
|
36
40
|
company_auto_topup_enabled?: boolean | null;
|
|
37
41
|
company_auto_topup_threshold_credits?: number | null;
|
|
@@ -52,6 +56,7 @@ export declare namespace CompanyPlanCreditGrantView {
|
|
|
52
56
|
plan_id: string;
|
|
53
57
|
plan_version_id?: string | null;
|
|
54
58
|
plural_name?: string | null;
|
|
59
|
+
price?: BillingPriceView.Raw | null;
|
|
55
60
|
reset_cadence?: BillingPlanCreditGrantResetCadence.Raw | null;
|
|
56
61
|
reset_start?: BillingPlanCreditGrantResetStart.Raw | null;
|
|
57
62
|
reset_type: BillingPlanCreditGrantResetType.Raw;
|
|
@@ -6,10 +6,13 @@ import { BillingArrearsCadence } from "./BillingArrearsCadence";
|
|
|
6
6
|
import { BillingCreditAutoTopupAvailability } from "./BillingCreditAutoTopupAvailability";
|
|
7
7
|
import { BillingCreditExpiryType } from "./BillingCreditExpiryType";
|
|
8
8
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
9
|
+
import { BillingPlanCreditGrantBillingMode } from "./BillingPlanCreditGrantBillingMode";
|
|
9
10
|
import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence";
|
|
10
11
|
import { BillingPlanCreditGrantResetStart } from "./BillingPlanCreditGrantResetStart";
|
|
11
12
|
import { BillingPlanCreditGrantResetType } from "./BillingPlanCreditGrantResetType";
|
|
13
|
+
import { BillingTiersMode } from "./BillingTiersMode";
|
|
12
14
|
import { CreditAutoTopupAmountType } from "./CreditAutoTopupAmountType";
|
|
15
|
+
import { CreditGrantPriceTierRequestBody } from "./CreditGrantPriceTierRequestBody";
|
|
13
16
|
import { PlanCreditGrantScaling } from "./PlanCreditGrantScaling";
|
|
14
17
|
export declare const CreateBillingPlanCreditGrantRequestBody: core.serialization.ObjectSchema<serializers.CreateBillingPlanCreditGrantRequestBody.Raw, Schematic.CreateBillingPlanCreditGrantRequestBody>;
|
|
15
18
|
export declare namespace CreateBillingPlanCreditGrantRequestBody {
|
|
@@ -27,6 +30,7 @@ export declare namespace CreateBillingPlanCreditGrantRequestBody {
|
|
|
27
30
|
auto_topup_self_service?: boolean | null;
|
|
28
31
|
auto_topup_threshold_credits?: number | null;
|
|
29
32
|
auto_topup_threshold_percent?: number | null;
|
|
33
|
+
billing_mode?: BillingPlanCreditGrantBillingMode.Raw | null;
|
|
30
34
|
can_buy_bundles?: boolean | null;
|
|
31
35
|
company_credit_amount?: number | null;
|
|
32
36
|
credit_amount: number;
|
|
@@ -41,10 +45,14 @@ export declare namespace CreateBillingPlanCreditGrantRequestBody {
|
|
|
41
45
|
postpaid_enabled?: boolean | null;
|
|
42
46
|
postpaid_rate_per_unit?: number | null;
|
|
43
47
|
postpaid_rate_per_unit_decimal?: string | null;
|
|
48
|
+
price_tiers?: CreditGrantPriceTierRequestBody.Raw[] | null;
|
|
44
49
|
reset_cadence: BillingPlanCreditGrantResetCadence.Raw;
|
|
45
50
|
reset_start: BillingPlanCreditGrantResetStart.Raw;
|
|
46
51
|
reset_type?: BillingPlanCreditGrantResetType.Raw | null;
|
|
47
52
|
rollover_percentage?: number | null;
|
|
48
53
|
scaling?: PlanCreditGrantScaling.Raw | null;
|
|
54
|
+
tier_mode?: BillingTiersMode.Raw | null;
|
|
55
|
+
unit_price?: number | null;
|
|
56
|
+
unit_price_decimal?: string | null;
|
|
49
57
|
}
|
|
50
58
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../api/index";
|
|
2
2
|
import * as core from "../../core";
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "./BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "./BillingArrearsCadence";
|
|
4
6
|
import { BillingTiersMode } from "./BillingTiersMode";
|
|
5
7
|
import { CreatePriceTierRequestBody } from "./CreatePriceTierRequestBody";
|
|
6
8
|
import { CurrencyPriceRequestBody } from "./CurrencyPriceRequestBody";
|
|
@@ -24,7 +26,9 @@ export declare namespace CreateEntitlementInBundleRequestBody {
|
|
|
24
26
|
monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
25
27
|
monthly_unit_price?: number | null;
|
|
26
28
|
monthly_unit_price_decimal?: string | null;
|
|
29
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
27
30
|
overage_billing_product_id?: string | null;
|
|
31
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
28
32
|
plan_id: string;
|
|
29
33
|
plan_version_id?: string | null;
|
|
30
34
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
@@ -8,6 +8,7 @@ import { BillingCreditGrantZeroedOutReason } from "./BillingCreditGrantZeroedOut
|
|
|
8
8
|
import { BillingCreditLedgerResponseData } from "./BillingCreditLedgerResponseData";
|
|
9
9
|
import { CompanyLedgerResponseData } from "./CompanyLedgerResponseData";
|
|
10
10
|
import { CreditEventType } from "./CreditEventType";
|
|
11
|
+
import { CreditTransferReason } from "./CreditTransferReason";
|
|
11
12
|
import { CreditUsageReason } from "./CreditUsageReason";
|
|
12
13
|
import { FeatureLedgerResponseData } from "./FeatureLedgerResponseData";
|
|
13
14
|
export declare const CreditEventLedgerResponseData: core.serialization.ObjectSchema<serializers.CreditEventLedgerResponseData.Raw, Schematic.CreditEventLedgerResponseData>;
|
|
@@ -42,6 +43,7 @@ export declare namespace CreditEventLedgerResponseData {
|
|
|
42
43
|
quantity_remaining_at_zero_out?: number | null;
|
|
43
44
|
source_id: number;
|
|
44
45
|
to_grant_id?: string | null;
|
|
46
|
+
transfer_reason?: CreditTransferReason.Raw | null;
|
|
45
47
|
usage_event_id?: string | null;
|
|
46
48
|
usage_reason?: CreditUsageReason.Raw | null;
|
|
47
49
|
zeroed_out_reason?: BillingCreditGrantZeroedOutReason.Raw | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as Schematic from "../../api/index";
|
|
2
|
+
import * as core from "../../core";
|
|
3
|
+
import type * as serializers from "../index";
|
|
4
|
+
export declare const CreditGrantPriceTierRequestBody: core.serialization.ObjectSchema<serializers.CreditGrantPriceTierRequestBody.Raw, Schematic.CreditGrantPriceTierRequestBody>;
|
|
5
|
+
export declare namespace CreditGrantPriceTierRequestBody {
|
|
6
|
+
interface Raw {
|
|
7
|
+
per_unit_price?: number | null;
|
|
8
|
+
per_unit_price_decimal?: string | null;
|
|
9
|
+
up_to?: number | null;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Schematic from "../../api/index";
|
|
2
|
+
import * as core from "../../core";
|
|
3
|
+
import type * as serializers from "../index";
|
|
4
|
+
export declare const CreditTransferReason: core.serialization.Schema<serializers.CreditTransferReason.Raw, Schematic.CreditTransferReason>;
|
|
5
|
+
export declare namespace CreditTransferReason {
|
|
6
|
+
type Raw = "overdraft_recovery" | "postpaid_debt_moved" | "postpaid_forgiven" | "postpaid_paid";
|
|
7
|
+
}
|
|
@@ -7,9 +7,11 @@ import { BillingCreditAutoTopupAvailability } from "./BillingCreditAutoTopupAvai
|
|
|
7
7
|
import { BillingCreditExpiryType } from "./BillingCreditExpiryType";
|
|
8
8
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
9
9
|
import { BillingCreditView } from "./BillingCreditView";
|
|
10
|
+
import { BillingPlanCreditGrantBillingMode } from "./BillingPlanCreditGrantBillingMode";
|
|
10
11
|
import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence";
|
|
11
12
|
import { BillingPlanCreditGrantResetStart } from "./BillingPlanCreditGrantResetStart";
|
|
12
13
|
import { BillingPlanCreditGrantResetType } from "./BillingPlanCreditGrantResetType";
|
|
14
|
+
import { BillingPriceView } from "./BillingPriceView";
|
|
13
15
|
import { GenericPreviewObject } from "./GenericPreviewObject";
|
|
14
16
|
import { PlanCreditGrantScaling } from "./PlanCreditGrantScaling";
|
|
15
17
|
export declare const PlanCreditGrantView: core.serialization.ObjectSchema<serializers.PlanCreditGrantView.Raw, Schematic.PlanCreditGrantView>;
|
|
@@ -32,6 +34,8 @@ export declare namespace PlanCreditGrantView {
|
|
|
32
34
|
billing_credit_postpaid_enabled: boolean;
|
|
33
35
|
billing_credit_postpaid_rate_per_unit?: number | null;
|
|
34
36
|
billing_credit_postpaid_rate_per_unit_decimal?: string | null;
|
|
37
|
+
billing_mode: BillingPlanCreditGrantBillingMode.Raw;
|
|
38
|
+
billing_product_price_id?: string | null;
|
|
35
39
|
company_credit_amount: number;
|
|
36
40
|
created_at: string;
|
|
37
41
|
credit?: BillingCreditView.Raw | null;
|
|
@@ -49,6 +53,7 @@ export declare namespace PlanCreditGrantView {
|
|
|
49
53
|
plan_id: string;
|
|
50
54
|
plan_version_id?: string | null;
|
|
51
55
|
plural_name?: string | null;
|
|
56
|
+
price?: BillingPriceView.Raw | null;
|
|
52
57
|
reset_cadence?: BillingPlanCreditGrantResetCadence.Raw | null;
|
|
53
58
|
reset_start?: BillingPlanCreditGrantResetStart.Raw | null;
|
|
54
59
|
reset_type: BillingPlanCreditGrantResetType.Raw;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../api/index";
|
|
2
2
|
import * as core from "../../core";
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "./BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "./BillingArrearsCadence";
|
|
4
6
|
import { BillingCreditResponseData } from "./BillingCreditResponseData";
|
|
5
7
|
import { BillingLinkedResourceResponseData } from "./BillingLinkedResourceResponseData";
|
|
6
8
|
import { BillingPriceView } from "./BillingPriceView";
|
|
@@ -31,6 +33,8 @@ export declare namespace PlanEntitlementResponseData {
|
|
|
31
33
|
metered_yearly_price?: BillingPriceView.Raw | null;
|
|
32
34
|
metric_period?: MetricPeriod.Raw | null;
|
|
33
35
|
metric_period_month_reset?: MetricPeriodMonthReset.Raw | null;
|
|
36
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
37
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
34
38
|
plan?: PlanResponseData.Raw | null;
|
|
35
39
|
plan_id: string;
|
|
36
40
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
@@ -6,10 +6,13 @@ import { BillingArrearsCadence } from "./BillingArrearsCadence";
|
|
|
6
6
|
import { BillingCreditAutoTopupAvailability } from "./BillingCreditAutoTopupAvailability";
|
|
7
7
|
import { BillingCreditExpiryType } from "./BillingCreditExpiryType";
|
|
8
8
|
import { BillingCreditExpiryUnit } from "./BillingCreditExpiryUnit";
|
|
9
|
+
import { BillingPlanCreditGrantBillingMode } from "./BillingPlanCreditGrantBillingMode";
|
|
9
10
|
import { BillingPlanCreditGrantResetCadence } from "./BillingPlanCreditGrantResetCadence";
|
|
10
11
|
import { BillingPlanCreditGrantResetStart } from "./BillingPlanCreditGrantResetStart";
|
|
11
12
|
import { BillingPlanCreditGrantResetType } from "./BillingPlanCreditGrantResetType";
|
|
13
|
+
import { BillingTiersMode } from "./BillingTiersMode";
|
|
12
14
|
import { CreditAutoTopupAmountType } from "./CreditAutoTopupAmountType";
|
|
15
|
+
import { CreditGrantPriceTierRequestBody } from "./CreditGrantPriceTierRequestBody";
|
|
13
16
|
import { PlanCreditGrantScaling } from "./PlanCreditGrantScaling";
|
|
14
17
|
export declare const UpdateBillingPlanCreditGrantRequestBody: core.serialization.ObjectSchema<serializers.UpdateBillingPlanCreditGrantRequestBody.Raw, Schematic.UpdateBillingPlanCreditGrantRequestBody>;
|
|
15
18
|
export declare namespace UpdateBillingPlanCreditGrantRequestBody {
|
|
@@ -27,6 +30,7 @@ export declare namespace UpdateBillingPlanCreditGrantRequestBody {
|
|
|
27
30
|
auto_topup_self_service?: boolean | null;
|
|
28
31
|
auto_topup_threshold_credits?: number | null;
|
|
29
32
|
auto_topup_threshold_percent?: number | null;
|
|
33
|
+
billing_mode?: BillingPlanCreditGrantBillingMode.Raw | null;
|
|
30
34
|
can_buy_bundles?: boolean | null;
|
|
31
35
|
company_credit_amount?: number | null;
|
|
32
36
|
credit_amount?: number | null;
|
|
@@ -38,10 +42,14 @@ export declare namespace UpdateBillingPlanCreditGrantRequestBody {
|
|
|
38
42
|
postpaid_enabled?: boolean | null;
|
|
39
43
|
postpaid_rate_per_unit?: number | null;
|
|
40
44
|
postpaid_rate_per_unit_decimal?: string | null;
|
|
45
|
+
price_tiers?: CreditGrantPriceTierRequestBody.Raw[] | null;
|
|
41
46
|
reset_cadence: BillingPlanCreditGrantResetCadence.Raw;
|
|
42
47
|
reset_start: BillingPlanCreditGrantResetStart.Raw;
|
|
43
48
|
reset_type?: BillingPlanCreditGrantResetType.Raw | null;
|
|
44
49
|
rollover_percentage?: number | null;
|
|
45
50
|
scaling?: PlanCreditGrantScaling.Raw | null;
|
|
51
|
+
tier_mode?: BillingTiersMode.Raw | null;
|
|
52
|
+
unit_price?: number | null;
|
|
53
|
+
unit_price_decimal?: string | null;
|
|
46
54
|
}
|
|
47
55
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as Schematic from "../../api/index";
|
|
2
2
|
import * as core from "../../core";
|
|
3
3
|
import type * as serializers from "../index";
|
|
4
|
+
import { BillingArrearsAnchor } from "./BillingArrearsAnchor";
|
|
5
|
+
import { BillingArrearsCadence } from "./BillingArrearsCadence";
|
|
4
6
|
import { BillingTiersMode } from "./BillingTiersMode";
|
|
5
7
|
import { CreatePriceTierRequestBody } from "./CreatePriceTierRequestBody";
|
|
6
8
|
import { CurrencyPriceRequestBody } from "./CurrencyPriceRequestBody";
|
|
@@ -16,7 +18,9 @@ export declare namespace UsageBasedEntitlementRequestBody {
|
|
|
16
18
|
monthly_price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
17
19
|
monthly_unit_price?: number | null;
|
|
18
20
|
monthly_unit_price_decimal?: string | null;
|
|
21
|
+
overage_billing_cadence?: BillingArrearsCadence.Raw | null;
|
|
19
22
|
overage_billing_product_id?: string | null;
|
|
23
|
+
overage_invoice_anchor?: BillingArrearsAnchor.Raw | null;
|
|
20
24
|
price_behavior?: EntitlementPriceBehavior.Raw | null;
|
|
21
25
|
price_tiers?: CreatePriceTierRequestBody.Raw[] | null;
|
|
22
26
|
quarterly_metered_price_id?: string | null;
|
|
@@ -37,6 +37,8 @@ export * from "./BillingCustomerSubscription";
|
|
|
37
37
|
export * from "./BillingCustomerWithSubscriptionsResponseData";
|
|
38
38
|
export * from "./BillingLinkedResourceResponseData";
|
|
39
39
|
export * from "./BillingMeterResponseData";
|
|
40
|
+
export * from "./BillingPlanCreditGrantBillingMode";
|
|
41
|
+
export * from "./BillingPlanCreditGrantPriceTierResponseData";
|
|
40
42
|
export * from "./BillingPlanCreditGrantResetCadence";
|
|
41
43
|
export * from "./BillingPlanCreditGrantResetStart";
|
|
42
44
|
export * from "./BillingPlanCreditGrantResetType";
|
|
@@ -168,6 +170,7 @@ export * from "./CreditEventLedgerResponseData";
|
|
|
168
170
|
export * from "./CreditEventType";
|
|
169
171
|
export * from "./CreditGrantDetail";
|
|
170
172
|
export * from "./CreditGrantExpiryRequestBody";
|
|
173
|
+
export * from "./CreditGrantPriceTierRequestBody";
|
|
171
174
|
export * from "./CreditGrantSortOrder";
|
|
172
175
|
export * from "./CreditLeaseResponseData";
|
|
173
176
|
export * from "./CreditReservationResponseData";
|
|
@@ -181,6 +184,7 @@ export * from "./CreditsAutoTopupSuccess";
|
|
|
181
184
|
export * from "./CreditsCreditPurchaseSuccess";
|
|
182
185
|
export * from "./CreditsWebhookCompanySummary";
|
|
183
186
|
export * from "./CreditsWebhookCreditSummary";
|
|
187
|
+
export * from "./CreditTransferReason";
|
|
184
188
|
export * from "./CreditTransferResponseData";
|
|
185
189
|
export * from "./CreditTransferView";
|
|
186
190
|
export * from "./CreditTriggerConfig";
|
package/dist/wrapper.d.ts
CHANGED
|
@@ -66,27 +66,40 @@ export interface SchematicOptions {
|
|
|
66
66
|
*/
|
|
67
67
|
creditLeases?: CreditLeaseConfig;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Options for a single flag check.
|
|
71
|
+
*
|
|
72
|
+
* `creditCost`, `usage` and `eventUsage` are preflight inputs: they ask
|
|
73
|
+
* "would this action be allowed?" rather than "is it allowed now". They apply
|
|
74
|
+
* on every evaluation path, forwarded to the WASM rules engine's
|
|
75
|
+
* `checkFlagWithOptions` when the flag is evaluated locally (DataStream) and
|
|
76
|
+
* sent as the request body's `preflight` when it is evaluated over the REST
|
|
77
|
+
* API. The engine picks the most specific knob for each condition it
|
|
78
|
+
* evaluates. No reservation is issued; for lease-backed gating use `check()`.
|
|
79
|
+
*/
|
|
69
80
|
export interface CheckFlagOptions {
|
|
70
81
|
/** Default value to return on error. Can be a boolean or a function returning a boolean. If not provided, uses configured flag defaults */
|
|
71
82
|
defaultValue?: boolean | (() => boolean);
|
|
72
83
|
/** The maximum time to wait for a response in milliseconds */
|
|
73
84
|
timeoutMs?: number;
|
|
74
85
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* (DataStream); the REST fallback path does not support preflight and
|
|
79
|
-
* ignores these. No reservation is issued — for lease-backed gating use
|
|
80
|
-
* `check()` instead.
|
|
86
|
+
* Pre-computed cost of the action, keyed by credit id. Highest precedence
|
|
87
|
+
* for credit-balance gates. A cost of zero means the action is free, not
|
|
88
|
+
* that the input is absent.
|
|
81
89
|
*/
|
|
82
|
-
/** Pre-computed per-credit-id cost. Highest precedence for credit-balance gates. */
|
|
83
90
|
creditCost?: Record<string, number>;
|
|
84
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Quantity applied to whatever numeric condition is being evaluated. Zero
|
|
93
|
+
* has no effect. Both the REST request body and the local (WASM) engine
|
|
94
|
+
* take an integer, so a fraction rounds up rather than letting the check
|
|
95
|
+
* pass on less usage than the action is about to record.
|
|
96
|
+
*/
|
|
85
97
|
usage?: number;
|
|
86
98
|
/**
|
|
87
99
|
* Simulated quantity scoped to a specific event subtype. Preferred over
|
|
88
100
|
* `usage` when the subtype is known. Deliberately singular: one check
|
|
89
|
-
* preflights one action.
|
|
101
|
+
* preflights one action. `quantity` rounds up the same way `usage` does,
|
|
102
|
+
* and zero has no effect.
|
|
90
103
|
*/
|
|
91
104
|
eventUsage?: {
|
|
92
105
|
eventSubtype: string;
|
|
@@ -149,6 +162,8 @@ export declare class SchematicClient extends BaseClient {
|
|
|
149
162
|
private prewarmResolveTimeoutMs;
|
|
150
163
|
private creditLeaseMode?;
|
|
151
164
|
private serverReservationTTL;
|
|
165
|
+
private closing;
|
|
166
|
+
private readonly pendingPrewarms;
|
|
152
167
|
/**
|
|
153
168
|
* Creates a new instance of the SchematicClient
|
|
154
169
|
* @param opts - Configuration options for the client
|
|
@@ -222,6 +237,11 @@ export declare class SchematicClient extends BaseClient {
|
|
|
222
237
|
* are still drawing on — doing so would refund the grant server-side and
|
|
223
238
|
* pull the balance out from under them. Shared leases reclaim themselves:
|
|
224
239
|
* they expire (client- and server-side) or are fully consumed.
|
|
240
|
+
*
|
|
241
|
+
* Lease work already in flight is waited out before the release, so an
|
|
242
|
+
* acquire that lands mid-shutdown is one the release can see. The wait and
|
|
243
|
+
* the release share one `SHUTDOWN_DRAIN_TIMEOUT_MS` budget, so close()
|
|
244
|
+
* stays bounded however slow the store or the wire is.
|
|
225
245
|
* @returns Promise that resolves when everything has been stopped
|
|
226
246
|
*/
|
|
227
247
|
close(): Promise<void>;
|
|
@@ -239,10 +259,10 @@ export declare class SchematicClient extends BaseClient {
|
|
|
239
259
|
*/
|
|
240
260
|
prewarm(evalCtx: api.CheckFlagRequestBody, creditTypeIds: string[]): Promise<void>;
|
|
241
261
|
/**
|
|
242
|
-
* Like `resolveCompanyId` but
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* surfaced within `prewarmResolveTimeoutMs
|
|
262
|
+
* Like `resolveCompanyId` but, on a cache miss, actively fetches the
|
|
263
|
+
* company over the datastream, warming the cache as a side effect. Returns
|
|
264
|
+
* the resolved id, the `comp_`-prefixed id the keys carry if the company
|
|
265
|
+
* never surfaced within `prewarmResolveTimeoutMs`, or undefined.
|
|
246
266
|
*
|
|
247
267
|
* `identify` does not push a company into the datastream cache — companies
|
|
248
268
|
* are only streamed in response to a request. So we call `getCompany`
|
|
@@ -269,9 +289,8 @@ export declare class SchematicClient extends BaseClient {
|
|
|
269
289
|
* through to a plain flag check and returns `{allowed: value}` with no
|
|
270
290
|
* reservation, byte-compatible with `checkFlag` semantics. The caller's
|
|
271
291
|
* preflight (`usage` / `eventSubtype`) is still threaded through the plain
|
|
272
|
-
* check, so
|
|
273
|
-
*
|
|
274
|
-
* REST fallback ignores preflight.
|
|
292
|
+
* check, so every evaluation path (datastream, replicator, REST) gates on
|
|
293
|
+
* the post-call balance — just without a reservation.
|
|
275
294
|
*/
|
|
276
295
|
check(evalCtx: api.CheckFlagRequestBody, key: string, options?: CheckOptions): Promise<CheckResult>;
|
|
277
296
|
/**
|
|
@@ -301,6 +320,14 @@ export declare class SchematicClient extends BaseClient {
|
|
|
301
320
|
* event — across pods and process restarts, not just within one process.
|
|
302
321
|
*/
|
|
303
322
|
trackWithReservation(reservation: Reservation | undefined, actualQuantity: number, options?: TrackWithReservationOptions): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* The Schematic company id for an evaluation context, resolved in the
|
|
325
|
+
* server's order: every supplied key/value pair is an ordinary entity key
|
|
326
|
+
* and gets looked up first; only when nothing matches is a value read as
|
|
327
|
+
* the company's own id, by its `comp_` prefix rather than by the name of
|
|
328
|
+
* the key it sits under. An account is free to define a key called `id`
|
|
329
|
+
* holding its own identifier, so the name alone settles nothing.
|
|
330
|
+
*/
|
|
304
331
|
private resolveCompanyId;
|
|
305
332
|
/**
|
|
306
333
|
* Send a non-blocking event to create or update companies and users.
|
|
@@ -317,6 +344,13 @@ export declare class SchematicClient extends BaseClient {
|
|
|
317
344
|
* @throws Will log error if event enqueueing fails
|
|
318
345
|
*/
|
|
319
346
|
track(body: api.EventBodyTrack, options?: TrackOptions): Promise<void>;
|
|
347
|
+
/**
|
|
348
|
+
* Enqueue a track event, optimistically bumping the cached company metric
|
|
349
|
+
* with it unless `updateMetrics` says not to. The bump is a local
|
|
350
|
+
* prediction of what the stream will push back, so it belongs only to an
|
|
351
|
+
* event that records usage the server has not already counted.
|
|
352
|
+
*/
|
|
353
|
+
private emitTrack;
|
|
320
354
|
/**
|
|
321
355
|
* Sets the default value for a specific feature flag
|
|
322
356
|
* @param flag - The feature flag identifier
|