@schematichq/schematic-typescript-node 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.d.ts +8 -0
- package/dist/api/resources/billing/client/Client.d.ts +47 -0
- package/dist/api/resources/billing/client/requests/ListBillingPricesRequest.d.ts +3 -0
- package/dist/api/resources/billing/client/requests/ListBillingProductPricesRequest.d.ts +3 -0
- package/dist/api/resources/billing/types/DeleteBillingCouponResponse.d.ts +6 -0
- package/dist/api/resources/billing/types/DeleteBillingCustomerResponse.d.ts +6 -0
- package/dist/api/resources/billing/types/DeleteBillingInvoiceResponse.d.ts +6 -0
- package/dist/api/resources/billing/types/ListBillingPricesParams.d.ts +2 -0
- package/dist/api/resources/billing/types/ListBillingProductPricesParams.d.ts +2 -0
- package/dist/api/resources/billing/types/index.d.ts +3 -0
- package/dist/api/resources/credits/client/Client.d.ts +0 -48
- package/dist/api/resources/credits/client/requests/index.d.ts +0 -2
- package/dist/api/resources/credits/types/index.d.ts +0 -4
- package/dist/api/resources/plangroups/client/Client.d.ts +2 -0
- package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +4 -0
- package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +4 -0
- package/dist/api/resources/plans/client/Client.d.ts +2 -10
- package/dist/api/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +1 -6
- package/dist/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +1 -6
- package/dist/api/resources/webhooks/client/Client.d.ts +18 -0
- package/dist/api/resources/webhooks/client/requests/TestWebhookRequestBody.d.ts +10 -0
- package/dist/api/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/api/resources/webhooks/types/SendTestWebhookActionResponse.d.ts +6 -0
- package/dist/api/resources/webhooks/types/index.d.ts +1 -0
- package/dist/api/types/AccountMemberPermission.d.ts +0 -1
- package/dist/api/types/BillingCreditGrantZeroedOutReason.d.ts +1 -0
- package/dist/api/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
- package/dist/api/types/ChangeSubscriptionRequestBody.d.ts +1 -0
- package/dist/api/types/CheckFlagsResponseData.d.ts +2 -0
- package/dist/api/types/CheckoutSettingsResponseData.d.ts +3 -0
- package/dist/api/types/CompanyCreditBalance.d.ts +8 -0
- package/dist/api/types/CompanySubscriptionResponseData.d.ts +1 -0
- package/dist/api/types/FeatureEntitlement.d.ts +9 -1
- package/dist/api/types/PlanChangeResponseData.d.ts +2 -0
- package/dist/api/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/dist/api/types/RulesengineFeatureEntitlement.d.ts +9 -1
- package/dist/api/types/TestWebhookResponseData.d.ts +4 -0
- package/dist/api/types/index.d.ts +2 -2
- package/dist/credits/check.d.ts +9 -5
- package/dist/credits/types.d.ts +11 -9
- package/dist/datastream/merge.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/rules-engine.d.ts +4 -0
- package/dist/serialization/resources/billing/types/DeleteBillingCouponResponse.d.ts +11 -0
- package/dist/serialization/resources/billing/types/DeleteBillingCustomerResponse.d.ts +11 -0
- package/dist/serialization/resources/billing/types/DeleteBillingInvoiceResponse.d.ts +11 -0
- package/dist/serialization/resources/billing/types/ListBillingPricesParams.d.ts +1 -0
- package/dist/serialization/resources/billing/types/ListBillingProductPricesParams.d.ts +1 -0
- package/dist/serialization/resources/billing/types/index.d.ts +3 -0
- package/dist/serialization/resources/credits/types/index.d.ts +0 -4
- package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +3 -0
- package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +3 -0
- package/dist/serialization/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +0 -2
- package/dist/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +0 -2
- package/dist/serialization/resources/webhooks/client/requests/TestWebhookRequestBody.d.ts +10 -0
- package/dist/serialization/resources/webhooks/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/webhooks/types/SendTestWebhookActionResponse.d.ts +11 -0
- package/dist/serialization/resources/webhooks/types/index.d.ts +1 -0
- package/dist/serialization/types/AccountMemberPermission.d.ts +1 -1
- package/dist/serialization/types/BillingCreditGrantZeroedOutReason.d.ts +1 -1
- 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/CheckoutSettingsResponseData.d.ts +3 -0
- package/dist/serialization/types/CompanyCreditBalance.d.ts +11 -0
- package/dist/serialization/types/CompanySubscriptionResponseData.d.ts +1 -0
- package/dist/serialization/types/FeatureEntitlement.d.ts +4 -0
- package/dist/serialization/types/PlanChangeResponseData.d.ts +1 -0
- package/dist/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
- package/dist/serialization/types/RulesengineFeatureEntitlement.d.ts +4 -0
- package/dist/serialization/types/TestWebhookResponseData.d.ts +10 -0
- package/dist/serialization/types/index.d.ts +2 -2
- package/dist/wasm/rulesengine.js +4 -4
- package/dist/wrapper.d.ts +0 -30
- package/package.json +1 -1
- package/dist/api/resources/credits/client/requests/CountCreditLedgerRequest.d.ts +0 -26
- package/dist/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.d.ts +0 -26
- package/dist/api/resources/credits/types/CountCreditLedgerParams.d.ts +0 -16
- package/dist/api/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -6
- package/dist/api/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -16
- package/dist/api/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -6
- package/dist/api/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -25
- package/dist/api/types/CreditLedgerPeriod.d.ts +0 -7
- package/dist/serialization/resources/credits/types/CountCreditLedgerParams.d.ts +0 -17
- package/dist/serialization/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -12
- package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -17
- package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -12
- package/dist/serialization/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -33
- package/dist/serialization/types/CreditLedgerPeriod.d.ts +0 -7
package/dist/wrapper.d.ts
CHANGED
|
@@ -270,36 +270,6 @@ export declare class SchematicClient extends BaseClient {
|
|
|
270
270
|
* event — across pods and process restarts, not just within one process.
|
|
271
271
|
*/
|
|
272
272
|
trackWithReservation(reservation: Reservation, actualQuantity: number, options?: TrackWithReservationOptions): Promise<void>;
|
|
273
|
-
/**
|
|
274
|
-
* Lease-aware credit balance for display, in the same three-way split the
|
|
275
|
-
* server exposes on `listCompanyCreditBalances`:
|
|
276
|
-
*
|
|
277
|
-
* - `remaining`: credits available to draw right now — the server balance
|
|
278
|
-
* (`company.creditBalances[creditId]`, already net of any active lease
|
|
279
|
-
* tranche): `B − L`.
|
|
280
|
-
* - `reserved`: the active lease's unsettled hold — its unspent local
|
|
281
|
-
* balance plus open reservations (`L − spent`), reported as the
|
|
282
|
-
* aggregate the server models.
|
|
283
|
-
* - `settled`: the economic balance the end user should see —
|
|
284
|
-
* `remaining + reserved = B − spent`. Invariant to in-flight holds, so
|
|
285
|
-
* a counter bound to it doesn't dip mid-call.
|
|
286
|
-
*
|
|
287
|
-
* Bind a user-facing "credits remaining" counter to `settled`: the server
|
|
288
|
-
* balance alone reads low (or 0) while a lease still has unspent balance.
|
|
289
|
-
*
|
|
290
|
-
* `reserved` is 0 when no lease is held or the held lease has expired — the
|
|
291
|
-
* server refunds an expired lease's unspent hold into the balance, so
|
|
292
|
-
* counting a stale local entry would double-count. Returns zeros when
|
|
293
|
-
* credit leases / datastream aren't configured or the company can't be
|
|
294
|
-
* resolved. The `reserved` term comes from this process's lease +
|
|
295
|
-
* reservation stores, so it (and `settled`) is per-process unless
|
|
296
|
-
* Redis-backed stores are configured.
|
|
297
|
-
*/
|
|
298
|
-
getCreditBalance(company: Record<string, string>, creditId: string): Promise<{
|
|
299
|
-
remaining: number;
|
|
300
|
-
reserved: number;
|
|
301
|
-
settled: number;
|
|
302
|
-
}>;
|
|
303
273
|
private resolveCompanyId;
|
|
304
274
|
/**
|
|
305
275
|
* Send a non-blocking event to create or update companies and users.
|
package/package.json
CHANGED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* companyId: "company_id",
|
|
6
|
-
* billingCreditId: "billing_credit_id",
|
|
7
|
-
* featureId: "feature_id",
|
|
8
|
-
* period: "daily",
|
|
9
|
-
* startTime: "start_time",
|
|
10
|
-
* endTime: "end_time",
|
|
11
|
-
* limit: 1000000,
|
|
12
|
-
* offset: 1000000
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export interface CountCreditLedgerRequest {
|
|
16
|
-
companyId: string;
|
|
17
|
-
billingCreditId?: string;
|
|
18
|
-
featureId?: string;
|
|
19
|
-
period: Schematic.CreditLedgerPeriod;
|
|
20
|
-
startTime?: string;
|
|
21
|
-
endTime?: string;
|
|
22
|
-
/** Page limit (default 100) */
|
|
23
|
-
limit?: number;
|
|
24
|
-
/** Page offset (default 0) */
|
|
25
|
-
offset?: number;
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* @example
|
|
4
|
-
* {
|
|
5
|
-
* companyId: "company_id",
|
|
6
|
-
* billingCreditId: "billing_credit_id",
|
|
7
|
-
* featureId: "feature_id",
|
|
8
|
-
* period: "daily",
|
|
9
|
-
* startTime: "start_time",
|
|
10
|
-
* endTime: "end_time",
|
|
11
|
-
* limit: 1000000,
|
|
12
|
-
* offset: 1000000
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export interface GetEnrichedCreditLedgerRequest {
|
|
16
|
-
companyId: string;
|
|
17
|
-
billingCreditId?: string;
|
|
18
|
-
featureId?: string;
|
|
19
|
-
period: Schematic.CreditLedgerPeriod;
|
|
20
|
-
startTime?: string;
|
|
21
|
-
endTime?: string;
|
|
22
|
-
/** Page limit (default 100) */
|
|
23
|
-
limit?: number;
|
|
24
|
-
/** Page offset (default 0) */
|
|
25
|
-
offset?: number;
|
|
26
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* Input parameters
|
|
4
|
-
*/
|
|
5
|
-
export interface CountCreditLedgerParams {
|
|
6
|
-
billingCreditId?: string;
|
|
7
|
-
companyId?: string;
|
|
8
|
-
endTime?: string;
|
|
9
|
-
featureId?: string;
|
|
10
|
-
/** Page limit (default 100) */
|
|
11
|
-
limit?: number;
|
|
12
|
-
/** Page offset (default 0) */
|
|
13
|
-
offset?: number;
|
|
14
|
-
period?: Schematic.CreditLedgerPeriod;
|
|
15
|
-
startTime?: string;
|
|
16
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../index";
|
|
2
|
-
/**
|
|
3
|
-
* Input parameters
|
|
4
|
-
*/
|
|
5
|
-
export interface GetEnrichedCreditLedgerParams {
|
|
6
|
-
billingCreditId?: string;
|
|
7
|
-
companyId?: string;
|
|
8
|
-
endTime?: string;
|
|
9
|
-
featureId?: string;
|
|
10
|
-
/** Page limit (default 100) */
|
|
11
|
-
limit?: number;
|
|
12
|
-
/** Page offset (default 0) */
|
|
13
|
-
offset?: number;
|
|
14
|
-
period?: Schematic.CreditLedgerPeriod;
|
|
15
|
-
startTime?: string;
|
|
16
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../index";
|
|
2
|
-
export interface CreditLedgerEnrichedEntryResponseData {
|
|
3
|
-
billingCreditAutoTopupGrantCount: number;
|
|
4
|
-
billingCreditId: string;
|
|
5
|
-
company?: Schematic.CompanyLedgerResponseData;
|
|
6
|
-
companyId: string;
|
|
7
|
-
credit?: Schematic.BillingCreditLedgerResponseData;
|
|
8
|
-
expiredGrantCount: number;
|
|
9
|
-
feature?: Schematic.FeatureLedgerResponseData;
|
|
10
|
-
featureId?: string;
|
|
11
|
-
firstTransactionAt: Date;
|
|
12
|
-
freeGrantCount: number;
|
|
13
|
-
grantCount: number;
|
|
14
|
-
lastTransactionAt: Date;
|
|
15
|
-
manuallyZeroedCount: number;
|
|
16
|
-
netChange: number;
|
|
17
|
-
planGrantCount: number;
|
|
18
|
-
purchasedGrantCount: number;
|
|
19
|
-
timeBucket: Date;
|
|
20
|
-
totalConsumed: number;
|
|
21
|
-
totalGranted: number;
|
|
22
|
-
transactionCount: number;
|
|
23
|
-
usageCount: number;
|
|
24
|
-
zeroedOutCount: number;
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerPeriod } from "../../../types/CreditLedgerPeriod";
|
|
5
|
-
export declare const CountCreditLedgerParams: core.serialization.ObjectSchema<serializers.CountCreditLedgerParams.Raw, Schematic.CountCreditLedgerParams>;
|
|
6
|
-
export declare namespace CountCreditLedgerParams {
|
|
7
|
-
interface Raw {
|
|
8
|
-
billing_credit_id?: string | null;
|
|
9
|
-
company_id?: string | null;
|
|
10
|
-
end_time?: string | null;
|
|
11
|
-
feature_id?: string | null;
|
|
12
|
-
limit?: number | null;
|
|
13
|
-
offset?: number | null;
|
|
14
|
-
period?: CreditLedgerPeriod.Raw | null;
|
|
15
|
-
start_time?: string | null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CountResponse } from "../../../types/CountResponse";
|
|
5
|
-
import { CountCreditLedgerParams } from "./CountCreditLedgerParams";
|
|
6
|
-
export declare const CountCreditLedgerResponse: core.serialization.ObjectSchema<serializers.CountCreditLedgerResponse.Raw, Schematic.CountCreditLedgerResponse>;
|
|
7
|
-
export declare namespace CountCreditLedgerResponse {
|
|
8
|
-
interface Raw {
|
|
9
|
-
data: CountResponse.Raw;
|
|
10
|
-
params: CountCreditLedgerParams.Raw;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerPeriod } from "../../../types/CreditLedgerPeriod";
|
|
5
|
-
export declare const GetEnrichedCreditLedgerParams: core.serialization.ObjectSchema<serializers.GetEnrichedCreditLedgerParams.Raw, Schematic.GetEnrichedCreditLedgerParams>;
|
|
6
|
-
export declare namespace GetEnrichedCreditLedgerParams {
|
|
7
|
-
interface Raw {
|
|
8
|
-
billing_credit_id?: string | null;
|
|
9
|
-
company_id?: string | null;
|
|
10
|
-
end_time?: string | null;
|
|
11
|
-
feature_id?: string | null;
|
|
12
|
-
limit?: number | null;
|
|
13
|
-
offset?: number | null;
|
|
14
|
-
period?: CreditLedgerPeriod.Raw | null;
|
|
15
|
-
start_time?: string | null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../../../api/index";
|
|
2
|
-
import * as core from "../../../../core";
|
|
3
|
-
import type * as serializers from "../../../index";
|
|
4
|
-
import { CreditLedgerEnrichedEntryResponseData } from "../../../types/CreditLedgerEnrichedEntryResponseData";
|
|
5
|
-
import { GetEnrichedCreditLedgerParams } from "./GetEnrichedCreditLedgerParams";
|
|
6
|
-
export declare const GetEnrichedCreditLedgerResponse: core.serialization.ObjectSchema<serializers.GetEnrichedCreditLedgerResponse.Raw, Schematic.GetEnrichedCreditLedgerResponse>;
|
|
7
|
-
export declare namespace GetEnrichedCreditLedgerResponse {
|
|
8
|
-
interface Raw {
|
|
9
|
-
data: CreditLedgerEnrichedEntryResponseData.Raw[];
|
|
10
|
-
params: GetEnrichedCreditLedgerParams.Raw;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type * as Schematic from "../../api/index";
|
|
2
|
-
import * as core from "../../core";
|
|
3
|
-
import type * as serializers from "../index";
|
|
4
|
-
import { BillingCreditLedgerResponseData } from "./BillingCreditLedgerResponseData";
|
|
5
|
-
import { CompanyLedgerResponseData } from "./CompanyLedgerResponseData";
|
|
6
|
-
import { FeatureLedgerResponseData } from "./FeatureLedgerResponseData";
|
|
7
|
-
export declare const CreditLedgerEnrichedEntryResponseData: core.serialization.ObjectSchema<serializers.CreditLedgerEnrichedEntryResponseData.Raw, Schematic.CreditLedgerEnrichedEntryResponseData>;
|
|
8
|
-
export declare namespace CreditLedgerEnrichedEntryResponseData {
|
|
9
|
-
interface Raw {
|
|
10
|
-
billing_credit_auto_topup_grant_count: number;
|
|
11
|
-
billing_credit_id: string;
|
|
12
|
-
company?: CompanyLedgerResponseData.Raw | null;
|
|
13
|
-
company_id: string;
|
|
14
|
-
credit?: BillingCreditLedgerResponseData.Raw | null;
|
|
15
|
-
expired_grant_count: number;
|
|
16
|
-
feature?: FeatureLedgerResponseData.Raw | null;
|
|
17
|
-
feature_id?: string | null;
|
|
18
|
-
first_transaction_at: string;
|
|
19
|
-
free_grant_count: number;
|
|
20
|
-
grant_count: number;
|
|
21
|
-
last_transaction_at: string;
|
|
22
|
-
manually_zeroed_count: number;
|
|
23
|
-
net_change: number;
|
|
24
|
-
plan_grant_count: number;
|
|
25
|
-
purchased_grant_count: number;
|
|
26
|
-
time_bucket: string;
|
|
27
|
-
total_consumed: number;
|
|
28
|
-
total_granted: number;
|
|
29
|
-
transaction_count: number;
|
|
30
|
-
usage_count: number;
|
|
31
|
-
zeroed_out_count: number;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
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 CreditLedgerPeriod: core.serialization.Schema<serializers.CreditLedgerPeriod.Raw, Schematic.CreditLedgerPeriod>;
|
|
5
|
-
export declare namespace CreditLedgerPeriod {
|
|
6
|
-
type Raw = "daily" | "monthly" | "raw" | "weekly";
|
|
7
|
-
}
|