@schematichq/schematic-typescript-node 1.5.12 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/api/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.d.ts +1 -0
  2. package/dist/api/resources/credits/client/Client.d.ts +41 -5
  3. package/dist/api/resources/credits/client/requests/CreateCompanyCreditGrant.d.ts +1 -0
  4. package/dist/api/resources/credits/client/requests/ReserveCreditsRequestBody.d.ts +18 -0
  5. package/dist/api/resources/credits/client/requests/index.d.ts +1 -0
  6. package/dist/api/resources/credits/types/ReleaseCreditReservationResponse.d.ts +6 -0
  7. package/dist/api/resources/credits/types/ReserveCreditsResponse.d.ts +6 -0
  8. package/dist/api/resources/credits/types/index.d.ts +2 -0
  9. package/dist/api/resources/features/client/Client.d.ts +18 -0
  10. package/dist/api/resources/features/client/requests/CheckAndReserveFlagRequestBody.d.ts +15 -0
  11. package/dist/api/resources/features/client/requests/index.d.ts +1 -0
  12. package/dist/api/resources/features/types/CheckAndReserveFlagResponse.d.ts +6 -0
  13. package/dist/api/resources/features/types/index.d.ts +1 -0
  14. package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +1 -0
  15. package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +1 -0
  16. package/dist/api/resources/plans/client/Client.d.ts +2 -0
  17. package/dist/api/resources/plans/client/requests/CountPlansRequest.d.ts +3 -0
  18. package/dist/api/resources/plans/client/requests/ListPlansRequest.d.ts +3 -0
  19. package/dist/api/resources/plans/types/CountPlansParams.d.ts +2 -0
  20. package/dist/api/resources/plans/types/ListPlansParams.d.ts +2 -0
  21. package/dist/api/types/BillingArrearsAnchor.d.ts +5 -0
  22. package/dist/api/types/BillingArrearsCadence.d.ts +5 -0
  23. package/dist/api/types/BillingCreditGrantResponseData.d.ts +7 -0
  24. package/dist/api/types/BillingPlanCreditGrantResponseData.d.ts +12 -0
  25. package/dist/api/types/CheckAndReserveFlagResponseData.d.ts +35 -0
  26. package/dist/api/types/CheckoutDataResponseData.d.ts +2 -0
  27. package/dist/api/types/CompanyPlanCreditGrantView.d.ts +6 -0
  28. package/dist/api/types/CreateBillingPlanCreditGrantRequestBody.d.ts +12 -0
  29. package/dist/api/types/CreditCompanyGrantView.d.ts +7 -0
  30. package/dist/api/types/CreditReservationResponseData.d.ts +15 -0
  31. package/dist/api/types/CreditUsageReason.d.ts +2 -0
  32. package/dist/api/types/EventBodyTrack.d.ts +2 -0
  33. package/dist/api/types/EventDetailResponseData.d.ts +1 -0
  34. package/dist/api/types/EventResponseData.d.ts +1 -0
  35. package/dist/api/types/FlagCheckReservationResponseData.d.ts +15 -0
  36. package/dist/api/types/GetOnboardingStateResp.d.ts +2 -0
  37. package/dist/api/types/IssueTemporaryAccessTokenResponseData.d.ts +2 -1
  38. package/dist/api/types/OnboardingRequirement.d.ts +1 -0
  39. package/dist/api/types/OnboardingRoadmapView.d.ts +4 -0
  40. package/dist/api/types/PlanCreditGrantView.d.ts +6 -0
  41. package/dist/api/types/PlanGroupDetailResponseData.d.ts +1 -0
  42. package/dist/api/types/PlanGroupResponseData.d.ts +1 -0
  43. package/dist/api/types/RulesEngineSchemaVersion.d.ts +1 -1
  44. package/dist/api/types/RulesengineCompany.d.ts +1 -0
  45. package/dist/api/types/RulesengineCreditPostpaidConfig.d.ts +3 -0
  46. package/dist/api/types/SlackConnectInviteStatus.d.ts +8 -0
  47. package/dist/api/types/SlackConnectInviteView.d.ts +7 -0
  48. package/dist/api/types/TemporaryAccessTokenIssuerType.d.ts +5 -0
  49. package/dist/api/types/TemporaryAccessTokenResponseData.d.ts +2 -1
  50. package/dist/api/types/UpdateBillingPlanCreditGrantRequestBody.d.ts +12 -0
  51. package/dist/api/types/WebhookEventDetailResponseData.d.ts +1 -0
  52. package/dist/api/types/WebhookEventResponseData.d.ts +1 -0
  53. package/dist/api/types/index.d.ts +10 -1
  54. package/dist/index.js +9 -9
  55. package/dist/serialization/resources/billing/client/requests/CreateBillingSubscriptionRequestBody.d.ts +1 -0
  56. package/dist/serialization/resources/credits/client/requests/CreateCompanyCreditGrant.d.ts +1 -0
  57. package/dist/serialization/resources/credits/client/requests/ReserveCreditsRequestBody.d.ts +13 -0
  58. package/dist/serialization/resources/credits/client/requests/index.d.ts +1 -0
  59. package/dist/serialization/resources/credits/types/ReleaseCreditReservationResponse.d.ts +11 -0
  60. package/dist/serialization/resources/credits/types/ReserveCreditsResponse.d.ts +11 -0
  61. package/dist/serialization/resources/credits/types/index.d.ts +2 -0
  62. package/dist/serialization/resources/features/client/requests/CheckAndReserveFlagRequestBody.d.ts +14 -0
  63. package/dist/serialization/resources/features/client/requests/index.d.ts +1 -0
  64. package/dist/serialization/resources/features/types/CheckAndReserveFlagResponse.d.ts +11 -0
  65. package/dist/serialization/resources/features/types/index.d.ts +1 -0
  66. package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +1 -0
  67. package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +1 -0
  68. package/dist/serialization/resources/plans/types/CountPlansParams.d.ts +1 -0
  69. package/dist/serialization/resources/plans/types/ListPlansParams.d.ts +1 -0
  70. package/dist/serialization/types/BillingArrearsAnchor.d.ts +7 -0
  71. package/dist/serialization/types/BillingArrearsCadence.d.ts +7 -0
  72. package/dist/serialization/types/BillingCreditGrantResponseData.d.ts +4 -0
  73. package/dist/serialization/types/BillingPlanCreditGrantResponseData.d.ts +8 -0
  74. package/dist/serialization/types/CheckAndReserveFlagResponseData.d.ts +28 -0
  75. package/dist/serialization/types/CheckoutDataResponseData.d.ts +2 -0
  76. package/dist/serialization/types/CompanyPlanCreditGrantView.d.ts +8 -0
  77. package/dist/serialization/types/CreateBillingPlanCreditGrantRequestBody.d.ts +8 -0
  78. package/dist/serialization/types/CreditCompanyGrantView.d.ts +8 -0
  79. package/dist/serialization/types/CreditReservationResponseData.d.ts +17 -0
  80. package/dist/serialization/types/CreditUsageReason.d.ts +1 -1
  81. package/dist/serialization/types/EventBodyTrack.d.ts +1 -0
  82. package/dist/serialization/types/EventDetailResponseData.d.ts +1 -0
  83. package/dist/serialization/types/EventResponseData.d.ts +1 -0
  84. package/dist/serialization/types/FlagCheckReservationResponseData.d.ts +16 -0
  85. package/dist/serialization/types/GetOnboardingStateResp.d.ts +4 -0
  86. package/dist/serialization/types/IssueTemporaryAccessTokenResponseData.d.ts +3 -1
  87. package/dist/serialization/types/OnboardingRequirement.d.ts +1 -1
  88. package/dist/serialization/types/OnboardingRoadmapView.d.ts +10 -0
  89. package/dist/serialization/types/PlanCreditGrantView.d.ts +8 -0
  90. package/dist/serialization/types/PlanGroupDetailResponseData.d.ts +1 -0
  91. package/dist/serialization/types/PlanGroupResponseData.d.ts +1 -0
  92. package/dist/serialization/types/RulesEngineSchemaVersion.d.ts +1 -1
  93. package/dist/serialization/types/RulesengineCompany.d.ts +2 -0
  94. package/dist/serialization/types/RulesengineCreditPostpaidConfig.d.ts +9 -0
  95. package/dist/serialization/types/SlackConnectInviteStatus.d.ts +7 -0
  96. package/dist/serialization/types/SlackConnectInviteView.d.ts +13 -0
  97. package/dist/serialization/types/TemporaryAccessTokenIssuerType.d.ts +7 -0
  98. package/dist/serialization/types/TemporaryAccessTokenResponseData.d.ts +3 -1
  99. package/dist/serialization/types/UpdateBillingPlanCreditGrantRequestBody.d.ts +8 -0
  100. package/dist/serialization/types/WebhookEventDetailResponseData.d.ts +1 -0
  101. package/dist/serialization/types/WebhookEventResponseData.d.ts +1 -0
  102. package/dist/serialization/types/index.d.ts +10 -1
  103. package/dist/wasm/rulesengine.js +1 -1
  104. package/package.json +5 -4
  105. package/dist/api/types/ReleaseCreditLeaseRequestBody.d.ts +0 -1
  106. package/dist/serialization/types/ReleaseCreditLeaseRequestBody.d.ts +0 -7
@@ -42,6 +42,7 @@ export interface CreateBillingSubscriptionRequestBody {
42
42
  periodStart?: number;
43
43
  productExternalIds: Schematic.BillingProductPricing[];
44
44
  providerType?: Schematic.BillingProviderType;
45
+ startedAt?: Date;
45
46
  status?: string;
46
47
  subscriptionExternalId: string;
47
48
  totalPrice: number;
@@ -447,7 +447,6 @@ export declare class CreditsClient {
447
447
  private __extendCreditLease;
448
448
  /**
449
449
  * @param {string} lease_id - lease_id
450
- * @param {Schematic.ReleaseCreditLeaseRequestBody} request
451
450
  * @param {CreditsClient.RequestOptions} requestOptions - Request-specific configuration.
452
451
  *
453
452
  * @throws {@link Schematic.BadRequestError}
@@ -459,11 +458,9 @@ export declare class CreditsClient {
459
458
  * @throws {@link errors.SchematicTimeoutError}
460
459
  *
461
460
  * @example
462
- * await client.credits.releaseCreditLease("lease_id", {
463
- * "key": "value"
464
- * })
461
+ * await client.credits.releaseCreditLease("lease_id")
465
462
  */
466
- releaseCreditLease(lease_id: string, request: Schematic.ReleaseCreditLeaseRequestBody, requestOptions?: CreditsClient.RequestOptions): core.HttpResponsePromise<Schematic.ReleaseCreditLeaseResponse>;
463
+ releaseCreditLease(lease_id: string, requestOptions?: CreditsClient.RequestOptions): core.HttpResponsePromise<Schematic.ReleaseCreditLeaseResponse>;
467
464
  private __releaseCreditLease;
468
465
  /**
469
466
  * @param {Schematic.ListBillingPlanCreditGrantsRequest} request
@@ -597,6 +594,45 @@ export declare class CreditsClient {
597
594
  */
598
595
  countBillingPlanCreditGrants(request?: Schematic.CountBillingPlanCreditGrantsRequest, requestOptions?: CreditsClient.RequestOptions): core.HttpResponsePromise<Schematic.CountBillingPlanCreditGrantsResponse>;
599
596
  private __countBillingPlanCreditGrants;
597
+ /**
598
+ * @param {Schematic.ReserveCreditsRequestBody} request
599
+ * @param {CreditsClient.RequestOptions} requestOptions - Request-specific configuration.
600
+ *
601
+ * @throws {@link Schematic.BadRequestError}
602
+ * @throws {@link Schematic.UnauthorizedError}
603
+ * @throws {@link Schematic.PaymentRequiredError}
604
+ * @throws {@link Schematic.ForbiddenError}
605
+ * @throws {@link Schematic.NotFoundError}
606
+ * @throws {@link Schematic.InternalServerError}
607
+ * @throws {@link errors.SchematicError}
608
+ * @throws {@link errors.SchematicTimeoutError}
609
+ *
610
+ * @example
611
+ * await client.credits.reserveCredits({
612
+ * amount: 1.1,
613
+ * companyId: "company_id",
614
+ * creditTypeId: "credit_type_id"
615
+ * })
616
+ */
617
+ reserveCredits(request: Schematic.ReserveCreditsRequestBody, requestOptions?: CreditsClient.RequestOptions): core.HttpResponsePromise<Schematic.ReserveCreditsResponse>;
618
+ private __reserveCredits;
619
+ /**
620
+ * @param {string} reservation_id - reservation_id
621
+ * @param {CreditsClient.RequestOptions} requestOptions - Request-specific configuration.
622
+ *
623
+ * @throws {@link Schematic.BadRequestError}
624
+ * @throws {@link Schematic.UnauthorizedError}
625
+ * @throws {@link Schematic.ForbiddenError}
626
+ * @throws {@link Schematic.NotFoundError}
627
+ * @throws {@link Schematic.InternalServerError}
628
+ * @throws {@link errors.SchematicError}
629
+ * @throws {@link errors.SchematicTimeoutError}
630
+ *
631
+ * @example
632
+ * await client.credits.releaseCreditReservation("reservation_id")
633
+ */
634
+ releaseCreditReservation(reservation_id: string, requestOptions?: CreditsClient.RequestOptions): core.HttpResponsePromise<Schematic.ReleaseCreditReservationResponse>;
635
+ private __releaseCreditReservation;
600
636
  /**
601
637
  * @param {Schematic.ListCreditSpendPoliciesRequest} request
602
638
  * @param {CreditsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -11,6 +11,7 @@ import type * as Schematic from "../../../../index";
11
11
  export interface CreateCompanyCreditGrant {
12
12
  billingPeriodsCount?: number;
13
13
  companyId: string;
14
+ creditBundleId?: string;
14
15
  creditId: string;
15
16
  currency?: string;
16
17
  expiresAt?: Date;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * amount: 1.1,
5
+ * companyId: "company_id",
6
+ * creditTypeId: "credit_type_id"
7
+ * }
8
+ */
9
+ export interface ReserveCreditsRequestBody {
10
+ /** Credits to hold for the operation. The full amount must be available; a partial hold is never taken */
11
+ amount: number;
12
+ companyId: string;
13
+ creditTypeId: string;
14
+ /** When the hold lapses if no track event settles it; defaults to one minute from now and may be at most one hour out. The unspent hold is refunded on expiry */
15
+ expiresAt?: Date;
16
+ /** A caller-chosen key for safe retries: a second request with the same key returns the original reservation instead of taking another hold */
17
+ idempotencyKey?: string;
18
+ }
@@ -20,6 +20,7 @@ export type { ListCreditBundlesRequest } from "./ListCreditBundlesRequest";
20
20
  export type { ListCreditEventLedgerRequest } from "./ListCreditEventLedgerRequest";
21
21
  export type { ListCreditSpendPoliciesRequest } from "./ListCreditSpendPoliciesRequest";
22
22
  export type { ListGrantsForCreditRequest } from "./ListGrantsForCreditRequest";
23
+ export type { ReserveCreditsRequestBody } from "./ReserveCreditsRequestBody";
23
24
  export type { UpdateBillingCreditRequestBody } from "./UpdateBillingCreditRequestBody";
24
25
  export type { UpdateCreditBundleDetailsRequestBody } from "./UpdateCreditBundleDetailsRequestBody";
25
26
  export type { UpdateCreditSpendPolicyRequestBody } from "./UpdateCreditSpendPolicyRequestBody";
@@ -0,0 +1,6 @@
1
+ import type * as Schematic from "../../../index";
2
+ export interface ReleaseCreditReservationResponse {
3
+ data: Schematic.CreditReservationResponseData;
4
+ /** Input parameters */
5
+ params: Record<string, unknown>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import type * as Schematic from "../../../index";
2
+ export interface ReserveCreditsResponse {
3
+ data: Schematic.CreditReservationResponseData;
4
+ /** Input parameters */
5
+ params: Record<string, unknown>;
6
+ }
@@ -44,6 +44,8 @@ export * from "./ListCreditSpendPoliciesResponse";
44
44
  export * from "./ListGrantsForCreditParams";
45
45
  export * from "./ListGrantsForCreditResponse";
46
46
  export * from "./ReleaseCreditLeaseResponse";
47
+ export * from "./ReleaseCreditReservationResponse";
48
+ export * from "./ReserveCreditsResponse";
47
49
  export * from "./SoftDeleteBillingCreditResponse";
48
50
  export * from "./UpdateBillingCreditResponse";
49
51
  export * from "./UpdateBillingPlanCreditGrantResponse";
@@ -318,6 +318,24 @@ export declare class FeaturesClient {
318
318
  */
319
319
  checkFlag(key: string, request: Schematic.CheckFlagRequestBody, requestOptions?: FeaturesClient.RequestOptions): core.HttpResponsePromise<Schematic.CheckFlagResponse>;
320
320
  private __checkFlag;
321
+ /**
322
+ * @param {string} key - key
323
+ * @param {Schematic.CheckAndReserveFlagRequestBody} request
324
+ * @param {FeaturesClient.RequestOptions} requestOptions - Request-specific configuration.
325
+ *
326
+ * @throws {@link Schematic.BadRequestError}
327
+ * @throws {@link Schematic.UnauthorizedError}
328
+ * @throws {@link Schematic.ForbiddenError}
329
+ * @throws {@link Schematic.NotFoundError}
330
+ * @throws {@link Schematic.InternalServerError}
331
+ * @throws {@link errors.SchematicError}
332
+ * @throws {@link errors.SchematicTimeoutError}
333
+ *
334
+ * @example
335
+ * await client.features.checkAndReserveFlag("key")
336
+ */
337
+ checkAndReserveFlag(key: string, request?: Schematic.CheckAndReserveFlagRequestBody, requestOptions?: FeaturesClient.RequestOptions): core.HttpResponsePromise<Schematic.CheckAndReserveFlagResponse>;
338
+ private __checkAndReserveFlag;
321
339
  /**
322
340
  * @param {Schematic.CheckFlagRequestBody} request
323
341
  * @param {FeaturesClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -0,0 +1,15 @@
1
+ import type * as Schematic from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface CheckAndReserveFlagRequestBody {
7
+ company?: Record<string, string>;
8
+ /** When the hold lapses if no track event settles it; defaults to one minute from now and may be at most one hour out. The unspent hold is refunded on expiry */
9
+ expiresAt?: Date;
10
+ /** Hypothetical usage to evaluate the flag against. When credit_cost names the entitlement's credit, that cost is what gets held; otherwise the hold is quantity times the entitlement's consumption rate */
11
+ preflight?: Schematic.PreflightRequestBody;
12
+ /** Units of the feature the operation will consume; defaults to 1. Sets the hold size together with the entitlement's consumption rate, and is echoed back on the reservation for the settling track event */
13
+ quantity?: number;
14
+ user?: Record<string, string>;
15
+ }
@@ -1,3 +1,4 @@
1
+ export type { CheckAndReserveFlagRequestBody } from "./CheckAndReserveFlagRequestBody";
1
2
  export type { CheckFlagsBulkRequestBody } from "./CheckFlagsBulkRequestBody";
2
3
  export type { CountFeaturesRequest } from "./CountFeaturesRequest";
3
4
  export type { CountFlagsRequest } from "./CountFlagsRequest";
@@ -0,0 +1,6 @@
1
+ import type * as Schematic from "../../../index";
2
+ export interface CheckAndReserveFlagResponse {
3
+ data: Schematic.CheckAndReserveFlagResponseData;
4
+ /** Input parameters */
5
+ params: Record<string, unknown>;
6
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./CheckAndReserveFlagResponse";
1
2
  export * from "./CheckFlagResponse";
2
3
  export * from "./CheckFlagsBulkResponse";
3
4
  export * from "./CheckFlagsResponse";
@@ -67,6 +67,7 @@ export interface CreatePlanGroupRequestBody {
67
67
  showZeroPriceAsFree: boolean;
68
68
  syncCustomerBillingDetails: boolean;
69
69
  trialDays?: number;
70
+ trialEligibilityPerPlan?: boolean;
70
71
  trialExpiryPlanId?: string;
71
72
  trialExpiryPlanPriceId?: string;
72
73
  trialPaymentMethodRequired?: boolean;
@@ -67,6 +67,7 @@ export interface UpdatePlanGroupRequestBody {
67
67
  showZeroPriceAsFree: boolean;
68
68
  syncCustomerBillingDetails: boolean;
69
69
  trialDays?: number;
70
+ trialEligibilityPerPlan?: boolean;
70
71
  trialExpiryPlanId?: string;
71
72
  trialExpiryPlanPriceId?: string;
72
73
  trialPaymentMethodRequired?: boolean;
@@ -132,6 +132,7 @@ export declare class PlansClient {
132
132
  * companyId: "company_id",
133
133
  * companyScopedOnly: true,
134
134
  * excludeCompanyScoped: true,
135
+ * excludeUnused: true,
135
136
  * forFallbackPlan: true,
136
137
  * forInitialPlan: true,
137
138
  * forTrialExpiryPlan: true,
@@ -330,6 +331,7 @@ export declare class PlansClient {
330
331
  * companyId: "company_id",
331
332
  * companyScopedOnly: true,
332
333
  * excludeCompanyScoped: true,
334
+ * excludeUnused: true,
333
335
  * forFallbackPlan: true,
334
336
  * forInitialPlan: true,
335
337
  * forTrialExpiryPlan: true,
@@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index";
5
5
  * companyId: "company_id",
6
6
  * companyScopedOnly: true,
7
7
  * excludeCompanyScoped: true,
8
+ * excludeUnused: true,
8
9
  * forFallbackPlan: true,
9
10
  * forInitialPlan: true,
10
11
  * forTrialExpiryPlan: true,
@@ -27,6 +28,8 @@ export interface CountPlansRequest {
27
28
  companyScopedOnly?: boolean;
28
29
  /** Exclude plans that are scoped to a company (custom plans assigned to a company) */
29
30
  excludeCompanyScoped?: boolean;
31
+ /** Exclude plans that nothing is using: no company is on the plan and it has no draft version */
32
+ excludeUnused?: boolean;
30
33
  /** Filter for plans valid as fallback plans (not linked to billing) */
31
34
  forFallbackPlan?: boolean;
32
35
  /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */
@@ -5,6 +5,7 @@ import type * as Schematic from "../../../../index";
5
5
  * companyId: "company_id",
6
6
  * companyScopedOnly: true,
7
7
  * excludeCompanyScoped: true,
8
+ * excludeUnused: true,
8
9
  * forFallbackPlan: true,
9
10
  * forInitialPlan: true,
10
11
  * forTrialExpiryPlan: true,
@@ -27,6 +28,8 @@ export interface ListPlansRequest {
27
28
  companyScopedOnly?: boolean;
28
29
  /** Exclude plans that are scoped to a company (custom plans assigned to a company) */
29
30
  excludeCompanyScoped?: boolean;
31
+ /** Exclude plans that nothing is using: no company is on the plan and it has no draft version */
32
+ excludeUnused?: boolean;
30
33
  /** Filter for plans valid as fallback plans (not linked to billing) */
31
34
  forFallbackPlan?: boolean;
32
35
  /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */
@@ -8,6 +8,8 @@ export interface CountPlansParams {
8
8
  companyScopedOnly?: boolean;
9
9
  /** Exclude plans that are scoped to a company (custom plans assigned to a company) */
10
10
  excludeCompanyScoped?: boolean;
11
+ /** Exclude plans that nothing is using: no company is on the plan and it has no draft version */
12
+ excludeUnused?: boolean;
11
13
  /** Filter for plans valid as fallback plans (not linked to billing) */
12
14
  forFallbackPlan?: boolean;
13
15
  /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */
@@ -8,6 +8,8 @@ export interface ListPlansParams {
8
8
  companyScopedOnly?: boolean;
9
9
  /** Exclude plans that are scoped to a company (custom plans assigned to a company) */
10
10
  excludeCompanyScoped?: boolean;
11
+ /** Exclude plans that nothing is using: no company is on the plan and it has no draft version */
12
+ excludeUnused?: boolean;
11
13
  /** Filter for plans valid as fallback plans (not linked to billing) */
12
14
  forFallbackPlan?: boolean;
13
15
  /** Filter for plans valid as initial plans (not linked to billing, free, or auto-cancelling trial) */
@@ -0,0 +1,5 @@
1
+ export declare const BillingArrearsAnchor: {
2
+ readonly BillingPeriodStart: "billing_period_start";
3
+ readonly MonthEnd: "month_end";
4
+ };
5
+ export type BillingArrearsAnchor = (typeof BillingArrearsAnchor)[keyof typeof BillingArrearsAnchor];
@@ -0,0 +1,5 @@
1
+ export declare const BillingArrearsCadence: {
2
+ readonly EndOfBillingPeriod: "end_of_billing_period";
3
+ readonly Monthly: "monthly";
4
+ };
5
+ export type BillingArrearsCadence = (typeof BillingArrearsCadence)[keyof typeof BillingArrearsCadence];
@@ -5,6 +5,8 @@ export interface BillingCreditGrantResponseData {
5
5
  companyLicenseId?: string;
6
6
  companyName: string;
7
7
  createdAt: Date;
8
+ /** The catalog bundle this grant was issued from, when the company bought one. */
9
+ creditBundleId?: string;
8
10
  creditIcon?: string;
9
11
  creditId: string;
10
12
  creditName: string;
@@ -16,6 +18,11 @@ export interface BillingCreditGrantResponseData {
16
18
  licenseName?: string;
17
19
  planId?: string;
18
20
  planName?: string;
21
+ /** What the postpaid charges costs, in the currency's minor unit. */
22
+ postpaidChargeAmount?: number;
23
+ postpaidChargeCurrency?: string;
24
+ /** Credits consumed past a zero balance in the window still open. */
25
+ postpaidChargedCredits?: number;
19
26
  price?: Schematic.BillingPriceResponseData;
20
27
  quantity: number;
21
28
  quantityRemaining: number;
@@ -1,5 +1,9 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface BillingPlanCreditGrantResponseData {
3
+ /** Which boundary closes a monthly arrears window. Only meaningful when arrears_cadence is monthly. */
4
+ arrearsAnchor?: Schematic.BillingArrearsAnchor;
5
+ /** How often postpaid charges are closed and invoiced. Defaults to end_of_billing_period. */
6
+ arrearsCadence?: Schematic.BillingArrearsCadence;
3
7
  autoTopupAmount?: number;
4
8
  autoTopupAmountType?: string;
5
9
  autoTopupAvailability: Schematic.BillingCreditAutoTopupAvailability;
@@ -32,11 +36,19 @@ export interface BillingPlanCreditGrantResponseData {
32
36
  id: string;
33
37
  /** The license whose quantity scales this grant. Set only when scaling is per_license. */
34
38
  licenseId?: string;
39
+ /** Optional limit on how far the balance may go below zero, in credits. A floor on the balance, not an allowance per invoice window: consumption is denied once the balance would fall below minus this figure, and stays denied until a new grant lands or the negative balance is settled. Absent means no limit. */
40
+ overdraftLimit?: number;
35
41
  plan?: Schematic.PreviewObjectResponseData;
36
42
  planId: string;
37
43
  /** Use plan.name from the nested plan object instead */
38
44
  planName: string;
39
45
  planVersionId?: string;
46
+ /** Whether consumption may continue past a zero balance, accruing at postpaid_rate_per_unit rather than being denied. */
47
+ postpaidEnabled: boolean;
48
+ /** Amount charged per credit consumed past zero, in the currency's minor unit. Defaults to the credit's own cost basis when postpaid is enabled without one. */
49
+ postpaidRatePerUnit?: number;
50
+ /** Decimal form of postpaid_rate_per_unit, for rates finer than one minor unit. */
51
+ postpaidRatePerUnitDecimal?: string;
40
52
  resetCadence?: Schematic.BillingPlanCreditGrantResetCadence;
41
53
  resetStart?: Schematic.BillingPlanCreditGrantResetStart;
42
54
  resetType?: Schematic.BillingPlanCreditGrantResetType;
@@ -0,0 +1,35 @@
1
+ import type * as Schematic from "../index";
2
+ export interface CheckAndReserveFlagResponseData {
3
+ /** If company keys were provided and matched a company, its ID */
4
+ companyId?: string;
5
+ /** If a feature entitlement rule was matched, its entitlement details */
6
+ entitlement?: Schematic.FeatureEntitlement;
7
+ /** If an error occurred while checking the flag, the error message */
8
+ error?: string;
9
+ /** Deprecated: Use Entitlement.Allocation instead. */
10
+ featureAllocation?: number;
11
+ /** Deprecated: Use Entitlement.Usage instead. */
12
+ featureUsage?: number;
13
+ /** Deprecated: Use Entitlement.EventName instead. */
14
+ featureUsageEvent?: string;
15
+ /** Deprecated: Use Entitlement.MetricPeriod instead. */
16
+ featureUsagePeriod?: Schematic.MetricPeriod;
17
+ /** Deprecated: Use Entitlement.MetricResetAt instead. */
18
+ featureUsageResetAt?: Date;
19
+ /** The key used to check the flag */
20
+ flag: string;
21
+ /** If a flag was found, its ID */
22
+ flagId?: string;
23
+ /** A human-readable explanation of the result */
24
+ reason: string;
25
+ /** The hold taken on the company's credit balance for this operation, when the flag allowed it and the feature is credit-metered. Settle it by sending a track event carrying its ID as reservation_id; the unspent hold is refunded at expires_at otherwise */
26
+ reservation?: Schematic.FlagCheckReservationResponseData;
27
+ /** If a rule was found, its ID */
28
+ ruleId?: string;
29
+ /** If a rule was found, its type */
30
+ ruleType?: Schematic.RuleType;
31
+ /** If user keys were provided and matched a user, its ID */
32
+ userId?: string;
33
+ /** A boolean flag check result; for feature entitlements, this represents whether further consumption of the feature is permitted */
34
+ value: boolean;
35
+ }
@@ -5,10 +5,12 @@ export interface CheckoutDataResponseData {
5
5
  activeUsageBasedEntitlements: Schematic.UsageBasedEntitlementResponseData[];
6
6
  availableCreditBundles: Schematic.BillingCreditBundleResponseData[];
7
7
  company?: Schematic.CompanyDetailResponseData;
8
+ companyCanTrialSelectedPlan: boolean;
8
9
  customCheckoutFields: Schematic.CheckoutFieldWithValue[];
9
10
  featureUsage?: Schematic.FeatureUsageDetailResponseData;
10
11
  selectedCreditBundles: Schematic.CreditBundlePurchaseResponseData[];
11
12
  selectedPlan?: Schematic.PlanDetailResponseData;
13
+ selectedPlanAlreadyTrialed: boolean;
12
14
  selectedUsageBasedEntitlements: Schematic.UsageBasedEntitlementResponseData[];
13
15
  subscription?: Schematic.CompanySubscriptionResponseData;
14
16
  }
@@ -1,5 +1,7 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface CompanyPlanCreditGrantView {
3
+ billingCreditArrearsAnchor?: Schematic.BillingArrearsAnchor;
4
+ billingCreditArrearsCadence?: Schematic.BillingArrearsCadence;
3
5
  billingCreditAutoTopupAmount?: number;
4
6
  billingCreditAutoTopupAmountType?: string;
5
7
  billingCreditAutoTopupAvailability?: Schematic.BillingCreditAutoTopupAvailability;
@@ -11,6 +13,10 @@ export interface CompanyPlanCreditGrantView {
11
13
  billingCreditAutoTopupThresholdCredits?: number;
12
14
  billingCreditAutoTopupThresholdPercent?: number;
13
15
  billingCreditCanBuyBundles: boolean;
16
+ billingCreditOverdraftLimit?: number;
17
+ billingCreditPostpaidEnabled: boolean;
18
+ billingCreditPostpaidRatePerUnit?: number;
19
+ billingCreditPostpaidRatePerUnitDecimal?: string;
14
20
  companyAutoTopupAmount?: number;
15
21
  companyAutoTopupEnabled?: boolean;
16
22
  companyAutoTopupThresholdCredits?: number;
@@ -1,6 +1,10 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface CreateBillingPlanCreditGrantRequestBody {
3
3
  applyToExisting?: boolean;
4
+ /** Which boundary closes a monthly arrears window: the subscription's own recurrence (billing_period_start) or the calendar month (month_end). Only applies when arrears_cadence is monthly; defaults to billing_period_start. */
5
+ arrearsAnchor?: Schematic.BillingArrearsAnchor;
6
+ /** How often postpaid charges are closed and invoiced: end_of_billing_period (the default) or monthly. */
7
+ arrearsCadence?: Schematic.BillingArrearsCadence;
4
8
  autoTopupAmount?: number;
5
9
  autoTopupAmountType?: Schematic.CreditAutoTopupAmountType;
6
10
  autoTopupAvailability?: Schematic.BillingCreditAutoTopupAvailability;
@@ -22,8 +26,16 @@ export interface CreateBillingPlanCreditGrantRequestBody {
22
26
  expiryUnitCount?: number;
23
27
  /** The license whose quantity scales this grant. Required when scaling is per_license. */
24
28
  licenseId?: string;
29
+ /** Optional limit on how far the balance may go below zero, in credits. It is a floor on the balance rather than an allowance per invoice window: the balance may run down to minus this figure, and beyond it the flag check denies the same way an exhausted balance does with postpaid off. Nothing resets when an invoice window rolls, so a company that reaches the limit stays denied until a new grant lands or the negative balance is settled. Omit for no limit. */
30
+ overdraftLimit?: number;
25
31
  planId: string;
26
32
  planVersionId?: string;
33
+ /** Whether consumption may continue past a zero balance. When false (the default) the flag check denies once the balance is exhausted, which is the existing behavior. When true, consumption continues and accrues at postpaid_rate_per_unit, settled on arrears_cadence. Intended for invoice-billed customers on net terms, who have no card for auto top-up to charge. */
34
+ postpaidEnabled?: boolean;
35
+ /** Amount charged per credit consumed past a zero balance, in the currency's minor unit. Optional: defaults to the credit's own cost basis (price_per_unit) when postpaid_enabled is true. */
36
+ postpaidRatePerUnit?: number;
37
+ /** Decimal string form of postpaid_rate_per_unit, for rates finer than one minor unit (for example 0.0002). Takes precedence over postpaid_rate_per_unit when both are set, matching how the credit's own price_per_unit_decimal behaves. */
38
+ postpaidRatePerUnitDecimal?: string;
27
39
  resetCadence: Schematic.BillingPlanCreditGrantResetCadence;
28
40
  resetStart: Schematic.BillingPlanCreditGrantResetStart;
29
41
  resetType?: Schematic.BillingPlanCreditGrantResetType;
@@ -1,5 +1,6 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface CreditCompanyGrantView {
3
+ arrearsCadence?: Schematic.BillingArrearsCadence;
3
4
  billingCreditBundleId?: string;
4
5
  billingCreditId: string;
5
6
  companyId: string;
@@ -21,6 +22,12 @@ export interface CreditCompanyGrantView {
21
22
  planId?: string;
22
23
  planName?: string;
23
24
  pluralName?: string;
25
+ postpaidChargeAmount?: number;
26
+ postpaidChargeCurrency?: string;
27
+ postpaidChargedCredits?: number;
28
+ postpaidPeriodEnd?: Date;
29
+ postpaidRate?: number;
30
+ postpaidRateDecimal?: string;
24
31
  price?: Schematic.BillingProductPriceResponseData;
25
32
  quantity: number;
26
33
  quantityRemaining: number;
@@ -0,0 +1,15 @@
1
+ export interface CreditReservationResponseData {
2
+ companyId: string;
3
+ createdAt: Date;
4
+ creditTypeId: string;
5
+ /** When the unspent hold is refunded if no track event settles it */
6
+ expiresAt: Date;
7
+ id: string;
8
+ /** When the reservation was settled, released, or expired; null while the hold is open */
9
+ releasedAt?: Date;
10
+ /** Credits held from the company's balance for the operation */
11
+ reservedAmount: number;
12
+ /** Credits the settling track event recorded against the hold; zero until settled. May exceed reserved_amount, in which case the overage was debited from the balance, up to the overdraft limit when one is set */
13
+ settledAmount: number;
14
+ updatedAt: Date;
15
+ }
@@ -3,6 +3,8 @@ export declare const CreditUsageReason: {
3
3
  readonly LeaseRelease: "lease_release";
4
4
  readonly ManualAdjustment: "manual_adjustment";
5
5
  readonly Reconciliation: "reconciliation";
6
+ readonly ReservationHold: "reservation_hold";
7
+ readonly ReservationRelease: "reservation_release";
6
8
  readonly Track: "track";
7
9
  };
8
10
  export type CreditUsageReason = (typeof CreditUsageReason)[keyof typeof CreditUsageReason];
@@ -7,6 +7,8 @@ export interface EventBodyTrack {
7
7
  leaseId?: string;
8
8
  /** Optionally specify the quantity of the event */
9
9
  quantity?: number;
10
+ /** Credit reservation ID this track event settles. lease_id takes precedence when both are set */
11
+ reservationId?: string;
10
12
  /** A map of trait names to trait values */
11
13
  traits?: Record<string, unknown>;
12
14
  /** Key-value pairs to identify user associated with track event */
@@ -18,6 +18,7 @@ export interface EventDetailResponseData {
18
18
  loadedAt?: Date;
19
19
  processedAt?: Date;
20
20
  quantity: number;
21
+ reservationId?: string;
21
22
  sentAt?: Date;
22
23
  status: Schematic.EventStatus;
23
24
  subtype?: string;
@@ -15,6 +15,7 @@ export interface EventResponseData {
15
15
  loadedAt?: Date;
16
16
  processedAt?: Date;
17
17
  quantity: number;
18
+ reservationId?: string;
18
19
  sentAt?: Date;
19
20
  status: Schematic.EventStatus;
20
21
  subtype?: string;
@@ -0,0 +1,15 @@
1
+ export interface FlagCheckReservationResponseData {
2
+ companyId: string;
3
+ /** Credits per unit of usage the hold was priced at */
4
+ consumptionRate: number;
5
+ creditTypeId: string;
6
+ /** Credits held from the company's balance */
7
+ creditsReserved: number;
8
+ /** The event subtype the settling track event should carry */
9
+ eventSubtype?: string;
10
+ /** When the unspent hold is refunded if no track event settles it */
11
+ expiresAt: Date;
12
+ id: string;
13
+ /** Units of usage the hold covers, as requested */
14
+ quantityReserved: number;
15
+ }
@@ -8,6 +8,8 @@ export interface GetOnboardingStateResp {
8
8
  path?: Schematic.OnboardingPath;
9
9
  pricingPageUrl?: string;
10
10
  requirements: Schematic.OnboardingRequirementView[];
11
+ roadmap?: Schematic.OnboardingRoadmapView;
12
+ slackConnect?: Schematic.SlackConnectInviteView;
11
13
  stripeImport?: Schematic.OnboardingStripeImport;
12
14
  suggestedNext: Schematic.OnboardingRequirement[];
13
15
  track?: Schematic.OnboardingTrack;
@@ -1,10 +1,11 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface IssueTemporaryAccessTokenResponseData {
3
- apiKeyId: string;
3
+ apiKeyId?: string;
4
4
  createdAt: Date;
5
5
  environmentId: string;
6
6
  expiredAt: Date;
7
7
  id: string;
8
+ issuerType: Schematic.TemporaryAccessTokenIssuerType;
8
9
  resourceType: Schematic.TemporaryAccessTokenResourceType;
9
10
  token: string;
10
11
  updatedAt: Date;
@@ -3,6 +3,7 @@ export declare const OnboardingRequirement: {
3
3
  readonly ConnectBilling: "connect_billing";
4
4
  readonly CreateApiKey: "create_api_key";
5
5
  readonly FirstFlagCheck: "first_flag_check";
6
+ readonly GenerateRoadmap: "generate_roadmap";
6
7
  readonly ImportCompanies: "import_companies";
7
8
  readonly ModelPackaging: "model_packaging";
8
9
  readonly SendEvents: "send_events";
@@ -0,0 +1,4 @@
1
+ export interface OnboardingRoadmapView {
2
+ publishedAt?: Date;
3
+ slug: string;
4
+ }
@@ -1,5 +1,7 @@
1
1
  import type * as Schematic from "../index";
2
2
  export interface PlanCreditGrantView {
3
+ billingCreditArrearsAnchor?: Schematic.BillingArrearsAnchor;
4
+ billingCreditArrearsCadence?: Schematic.BillingArrearsCadence;
3
5
  billingCreditAutoTopupAmount?: number;
4
6
  billingCreditAutoTopupAmountType?: string;
5
7
  billingCreditAutoTopupAvailability?: Schematic.BillingCreditAutoTopupAvailability;
@@ -11,6 +13,10 @@ export interface PlanCreditGrantView {
11
13
  billingCreditAutoTopupThresholdCredits?: number;
12
14
  billingCreditAutoTopupThresholdPercent?: number;
13
15
  billingCreditCanBuyBundles: boolean;
16
+ billingCreditOverdraftLimit?: number;
17
+ billingCreditPostpaidEnabled: boolean;
18
+ billingCreditPostpaidRatePerUnit?: number;
19
+ billingCreditPostpaidRatePerUnitDecimal?: string;
14
20
  companyCreditAmount: number;
15
21
  createdAt: Date;
16
22
  credit?: Schematic.BillingCreditView;
@@ -33,6 +33,7 @@ export interface PlanGroupDetailResponseData {
33
33
  syncCustomerBillingDetails: boolean;
34
34
  taxCollectionEnabled: boolean;
35
35
  trialDays?: number;
36
+ trialEligibilityPerPlan: boolean;
36
37
  trialExpiryPlan?: Schematic.PlanGroupPlanDetailResponseData;
37
38
  trialExpiryPlanId?: string;
38
39
  trialExpiryPlanPrice?: Schematic.BillingPriceView;
@@ -25,6 +25,7 @@ export interface PlanGroupResponseData {
25
25
  syncCustomerBillingDetails: boolean;
26
26
  taxCollectionEnabled: boolean;
27
27
  trialDays?: number;
28
+ trialEligibilityPerPlan: boolean;
28
29
  trialExpiryPlanId?: string;
29
30
  trialExpiryPlanPriceId?: string;
30
31
  trialPaymentMethodRequired?: boolean;