@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.
Files changed (89) hide show
  1. package/dist/Client.d.ts +8 -0
  2. package/dist/api/resources/billing/client/Client.d.ts +47 -0
  3. package/dist/api/resources/billing/client/requests/ListBillingPricesRequest.d.ts +3 -0
  4. package/dist/api/resources/billing/client/requests/ListBillingProductPricesRequest.d.ts +3 -0
  5. package/dist/api/resources/billing/types/DeleteBillingCouponResponse.d.ts +6 -0
  6. package/dist/api/resources/billing/types/DeleteBillingCustomerResponse.d.ts +6 -0
  7. package/dist/api/resources/billing/types/DeleteBillingInvoiceResponse.d.ts +6 -0
  8. package/dist/api/resources/billing/types/ListBillingPricesParams.d.ts +2 -0
  9. package/dist/api/resources/billing/types/ListBillingProductPricesParams.d.ts +2 -0
  10. package/dist/api/resources/billing/types/index.d.ts +3 -0
  11. package/dist/api/resources/credits/client/Client.d.ts +0 -48
  12. package/dist/api/resources/credits/client/requests/index.d.ts +0 -2
  13. package/dist/api/resources/credits/types/index.d.ts +0 -4
  14. package/dist/api/resources/plangroups/client/Client.d.ts +2 -0
  15. package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +4 -0
  16. package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +4 -0
  17. package/dist/api/resources/plans/client/Client.d.ts +2 -10
  18. package/dist/api/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +1 -6
  19. package/dist/api/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +1 -6
  20. package/dist/api/resources/webhooks/client/Client.d.ts +18 -0
  21. package/dist/api/resources/webhooks/client/requests/TestWebhookRequestBody.d.ts +10 -0
  22. package/dist/api/resources/webhooks/client/requests/index.d.ts +1 -0
  23. package/dist/api/resources/webhooks/types/SendTestWebhookActionResponse.d.ts +6 -0
  24. package/dist/api/resources/webhooks/types/index.d.ts +1 -0
  25. package/dist/api/types/AccountMemberPermission.d.ts +0 -1
  26. package/dist/api/types/BillingCreditGrantZeroedOutReason.d.ts +1 -0
  27. package/dist/api/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
  28. package/dist/api/types/ChangeSubscriptionRequestBody.d.ts +1 -0
  29. package/dist/api/types/CheckFlagsResponseData.d.ts +2 -0
  30. package/dist/api/types/CheckoutSettingsResponseData.d.ts +3 -0
  31. package/dist/api/types/CompanyCreditBalance.d.ts +8 -0
  32. package/dist/api/types/CompanySubscriptionResponseData.d.ts +1 -0
  33. package/dist/api/types/FeatureEntitlement.d.ts +9 -1
  34. package/dist/api/types/PlanChangeResponseData.d.ts +2 -0
  35. package/dist/api/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
  36. package/dist/api/types/RulesengineFeatureEntitlement.d.ts +9 -1
  37. package/dist/api/types/TestWebhookResponseData.d.ts +4 -0
  38. package/dist/api/types/index.d.ts +2 -2
  39. package/dist/credits/check.d.ts +9 -5
  40. package/dist/credits/types.d.ts +11 -9
  41. package/dist/datastream/merge.d.ts +1 -1
  42. package/dist/index.js +9 -9
  43. package/dist/rules-engine.d.ts +4 -0
  44. package/dist/serialization/resources/billing/types/DeleteBillingCouponResponse.d.ts +11 -0
  45. package/dist/serialization/resources/billing/types/DeleteBillingCustomerResponse.d.ts +11 -0
  46. package/dist/serialization/resources/billing/types/DeleteBillingInvoiceResponse.d.ts +11 -0
  47. package/dist/serialization/resources/billing/types/ListBillingPricesParams.d.ts +1 -0
  48. package/dist/serialization/resources/billing/types/ListBillingProductPricesParams.d.ts +1 -0
  49. package/dist/serialization/resources/billing/types/index.d.ts +3 -0
  50. package/dist/serialization/resources/credits/types/index.d.ts +0 -4
  51. package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +3 -0
  52. package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +3 -0
  53. package/dist/serialization/resources/plans/client/requests/PublishPlanVersionRequestBody.d.ts +0 -2
  54. package/dist/serialization/resources/plans/client/requests/RetryCustomPlanBillingRequestBody.d.ts +0 -2
  55. package/dist/serialization/resources/webhooks/client/requests/TestWebhookRequestBody.d.ts +10 -0
  56. package/dist/serialization/resources/webhooks/client/requests/index.d.ts +1 -0
  57. package/dist/serialization/resources/webhooks/types/SendTestWebhookActionResponse.d.ts +11 -0
  58. package/dist/serialization/resources/webhooks/types/index.d.ts +1 -0
  59. package/dist/serialization/types/AccountMemberPermission.d.ts +1 -1
  60. package/dist/serialization/types/BillingCreditGrantZeroedOutReason.d.ts +1 -1
  61. package/dist/serialization/types/ChangeSubscriptionInternalRequestBody.d.ts +1 -0
  62. package/dist/serialization/types/ChangeSubscriptionRequestBody.d.ts +1 -0
  63. package/dist/serialization/types/CheckFlagsResponseData.d.ts +2 -0
  64. package/dist/serialization/types/CheckoutSettingsResponseData.d.ts +3 -0
  65. package/dist/serialization/types/CompanyCreditBalance.d.ts +11 -0
  66. package/dist/serialization/types/CompanySubscriptionResponseData.d.ts +1 -0
  67. package/dist/serialization/types/FeatureEntitlement.d.ts +4 -0
  68. package/dist/serialization/types/PlanChangeResponseData.d.ts +1 -0
  69. package/dist/serialization/types/PreviewSubscriptionChangeResponseData.d.ts +3 -0
  70. package/dist/serialization/types/RulesengineFeatureEntitlement.d.ts +4 -0
  71. package/dist/serialization/types/TestWebhookResponseData.d.ts +10 -0
  72. package/dist/serialization/types/index.d.ts +2 -2
  73. package/dist/wasm/rulesengine.js +4 -4
  74. package/dist/wrapper.d.ts +0 -30
  75. package/package.json +1 -1
  76. package/dist/api/resources/credits/client/requests/CountCreditLedgerRequest.d.ts +0 -26
  77. package/dist/api/resources/credits/client/requests/GetEnrichedCreditLedgerRequest.d.ts +0 -26
  78. package/dist/api/resources/credits/types/CountCreditLedgerParams.d.ts +0 -16
  79. package/dist/api/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -6
  80. package/dist/api/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -16
  81. package/dist/api/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -6
  82. package/dist/api/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -25
  83. package/dist/api/types/CreditLedgerPeriod.d.ts +0 -7
  84. package/dist/serialization/resources/credits/types/CountCreditLedgerParams.d.ts +0 -17
  85. package/dist/serialization/resources/credits/types/CountCreditLedgerResponse.d.ts +0 -12
  86. package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerParams.d.ts +0 -17
  87. package/dist/serialization/resources/credits/types/GetEnrichedCreditLedgerResponse.d.ts +0 -12
  88. package/dist/serialization/types/CreditLedgerEnrichedEntryResponseData.d.ts +0 -33
  89. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-typescript-node",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -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,6 +0,0 @@
1
- import type * as Schematic from "../../../index";
2
- export interface CountCreditLedgerResponse {
3
- data: Schematic.CountResponse;
4
- /** Input parameters */
5
- params: Schematic.CountCreditLedgerParams;
6
- }
@@ -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,6 +0,0 @@
1
- import type * as Schematic from "../../../index";
2
- export interface GetEnrichedCreditLedgerResponse {
3
- data: Schematic.CreditLedgerEnrichedEntryResponseData[];
4
- /** Input parameters */
5
- params: Schematic.GetEnrichedCreditLedgerParams;
6
- }
@@ -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,7 +0,0 @@
1
- export declare const CreditLedgerPeriod: {
2
- readonly Daily: "daily";
3
- readonly Monthly: "monthly";
4
- readonly Raw: "raw";
5
- readonly Weekly: "weekly";
6
- };
7
- export type CreditLedgerPeriod = (typeof CreditLedgerPeriod)[keyof typeof CreditLedgerPeriod];
@@ -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
- }