@schematichq/schematic-typescript-node 1.3.0 → 1.3.1

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 (109) hide show
  1. package/dist/Client.d.ts +3 -0
  2. package/dist/api/resources/billing/client/Client.d.ts +0 -3
  3. package/dist/api/resources/billing/client/requests/CountBillingProductsRequest.d.ts +1 -1
  4. package/dist/api/resources/billing/client/requests/CountCustomersRequest.d.ts +0 -2
  5. package/dist/api/resources/billing/client/requests/CreateBillingCustomerRequestBody.d.ts +0 -2
  6. package/dist/api/resources/billing/client/requests/ListBillingProductsRequest.d.ts +1 -1
  7. package/dist/api/resources/billing/client/requests/ListCustomersWithSubscriptionsRequest.d.ts +0 -2
  8. package/dist/api/resources/billing/types/CountBillingProductsParams.d.ts +1 -1
  9. package/dist/api/resources/billing/types/CountCustomersParams.d.ts +0 -1
  10. package/dist/api/resources/billing/types/ListBillingProductsParams.d.ts +1 -1
  11. package/dist/api/resources/billing/types/ListCustomersWithSubscriptionsParams.d.ts +0 -1
  12. package/dist/api/resources/credits/client/Client.d.ts +21 -0
  13. package/dist/api/resources/credits/client/requests/CountCompanyGrantsRequest.d.ts +20 -0
  14. package/dist/api/resources/credits/client/requests/index.d.ts +1 -2
  15. package/dist/api/resources/credits/types/CountCompanyGrantsParams.d.ts +13 -0
  16. package/dist/api/resources/credits/types/CountCompanyGrantsResponse.d.ts +6 -0
  17. package/dist/api/resources/credits/types/index.d.ts +2 -0
  18. package/dist/api/resources/index.d.ts +3 -0
  19. package/dist/api/resources/planbundle/client/Client.d.ts +52 -0
  20. package/dist/api/resources/planbundle/client/index.d.ts +1 -0
  21. package/dist/api/resources/planbundle/client/requests/CreatePlanBundleRequestBody.d.ts +16 -0
  22. package/dist/api/resources/planbundle/client/requests/UpdatePlanBundleRequestBody.d.ts +16 -0
  23. package/dist/api/resources/planbundle/client/requests/index.d.ts +2 -0
  24. package/dist/api/resources/planbundle/index.d.ts +2 -0
  25. package/dist/api/resources/planbundle/types/CreatePlanBundleResponse.d.ts +6 -0
  26. package/dist/api/resources/planbundle/types/UpdatePlanBundleResponse.d.ts +6 -0
  27. package/dist/api/resources/planbundle/types/index.d.ts +2 -0
  28. package/dist/api/resources/plans/client/requests/index.d.ts +0 -3
  29. package/dist/api/types/BillingCreditGrantResponseData.d.ts +2 -0
  30. package/dist/api/types/BillingCustomerResponseData.d.ts +0 -1
  31. package/dist/api/types/BillingCustomerWithSubscriptionsResponseData.d.ts +0 -1
  32. package/dist/api/types/CompanyPlanDetailResponseData.d.ts +1 -0
  33. package/dist/api/types/CompanyPlanWithBillingSubView.d.ts +1 -0
  34. package/dist/api/{resources/credits/client/requests → types}/CreateBillingPlanCreditGrantRequestBody.d.ts +1 -11
  35. package/dist/api/types/CreateEntitlementInBundleRequestBody.d.ts +29 -0
  36. package/dist/api/types/CreateEntitlementInBundleRequestBodyMetricPeriod.d.ts +7 -0
  37. package/dist/api/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.d.ts +5 -0
  38. package/dist/api/types/CreatePlanRequestBody.d.ts +7 -0
  39. package/dist/api/types/CreditCompanyGrantView.d.ts +2 -0
  40. package/dist/api/types/DeleteBillingPlanCreditGrantRequestBody.d.ts +3 -0
  41. package/dist/api/types/EventDetailResponseData.d.ts +1 -1
  42. package/dist/api/types/EventResponseData.d.ts +1 -1
  43. package/dist/api/types/PlanBundleAction.d.ts +6 -0
  44. package/dist/api/types/PlanBundleCreditGrantRequestBody.d.ts +8 -0
  45. package/dist/api/types/PlanBundleEntitlementRequestBody.d.ts +6 -0
  46. package/dist/api/types/PlanBundleResponseData.d.ts +8 -0
  47. package/dist/api/types/PlanChangeSubscriptionAction.d.ts +1 -0
  48. package/dist/api/types/PlanDetailResponseData.d.ts +1 -0
  49. package/dist/api/types/PlanGroupPlanDetailResponseData.d.ts +1 -0
  50. package/dist/api/types/PlanVersionResponseData.d.ts +14 -0
  51. package/dist/api/types/PlanVersionStatus.d.ts +6 -0
  52. package/dist/api/types/RawEventResponseData.d.ts +1 -1
  53. package/dist/api/{resources/credits/client/requests → types}/UpdateBillingPlanCreditGrantRequestBody.d.ts +1 -8
  54. package/dist/api/{resources/plans/client/requests → types}/UpdatePlanRequestBody.d.ts +0 -6
  55. package/dist/api/{resources/plans/client/requests → types}/UpsertBillingProductRequestBody.d.ts +1 -8
  56. package/dist/api/types/WebhookRequestType.d.ts +2 -0
  57. package/dist/api/types/index.d.ts +15 -0
  58. package/dist/index.js +3 -3
  59. package/dist/serialization/resources/billing/client/requests/CreateBillingCustomerRequestBody.d.ts +0 -1
  60. package/dist/serialization/resources/billing/types/CountCustomersParams.d.ts +0 -1
  61. package/dist/serialization/resources/billing/types/ListCustomersWithSubscriptionsParams.d.ts +0 -1
  62. package/dist/serialization/resources/credits/client/requests/index.d.ts +0 -2
  63. package/dist/serialization/resources/credits/types/CountCompanyGrantsParams.d.ts +15 -0
  64. package/dist/serialization/resources/credits/types/CountCompanyGrantsResponse.d.ts +12 -0
  65. package/dist/serialization/resources/credits/types/index.d.ts +2 -0
  66. package/dist/serialization/resources/index.d.ts +3 -0
  67. package/dist/serialization/resources/planbundle/client/index.d.ts +1 -0
  68. package/dist/serialization/resources/planbundle/client/requests/CreatePlanBundleRequestBody.d.ts +18 -0
  69. package/dist/serialization/resources/planbundle/client/requests/UpdatePlanBundleRequestBody.d.ts +18 -0
  70. package/dist/serialization/resources/planbundle/client/requests/index.d.ts +2 -0
  71. package/dist/serialization/resources/planbundle/index.d.ts +2 -0
  72. package/dist/serialization/resources/planbundle/types/CreatePlanBundleResponse.d.ts +11 -0
  73. package/dist/serialization/resources/planbundle/types/UpdatePlanBundleResponse.d.ts +11 -0
  74. package/dist/serialization/resources/planbundle/types/index.d.ts +2 -0
  75. package/dist/serialization/resources/plans/client/requests/index.d.ts +0 -3
  76. package/dist/serialization/types/BillingCreditGrantResponseData.d.ts +3 -0
  77. package/dist/serialization/types/BillingCustomerResponseData.d.ts +0 -1
  78. package/dist/serialization/types/BillingCustomerWithSubscriptionsResponseData.d.ts +0 -1
  79. package/dist/serialization/types/CompanyPlanDetailResponseData.d.ts +2 -0
  80. package/dist/serialization/types/CompanyPlanWithBillingSubView.d.ts +1 -0
  81. package/dist/serialization/{resources/credits/client/requests → types}/CreateBillingPlanCreditGrantRequestBody.d.ts +10 -10
  82. package/dist/serialization/types/CreateEntitlementInBundleRequestBody.d.ts +39 -0
  83. package/dist/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriod.d.ts +7 -0
  84. package/dist/serialization/types/CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset.d.ts +7 -0
  85. package/dist/serialization/types/CreatePlanRequestBody.d.ts +13 -0
  86. package/dist/serialization/types/CreditCompanyGrantView.d.ts +3 -0
  87. package/dist/serialization/types/DeleteBillingPlanCreditGrantRequestBody.d.ts +9 -0
  88. package/dist/serialization/types/EventDetailResponseData.d.ts +1 -1
  89. package/dist/serialization/types/EventResponseData.d.ts +1 -1
  90. package/dist/serialization/types/PlanBundleAction.d.ts +7 -0
  91. package/dist/serialization/types/PlanBundleCreditGrantRequestBody.d.ts +17 -0
  92. package/dist/serialization/types/PlanBundleEntitlementRequestBody.d.ts +13 -0
  93. package/dist/serialization/types/PlanBundleResponseData.d.ts +18 -0
  94. package/dist/serialization/types/PlanChangeSubscriptionAction.d.ts +1 -1
  95. package/dist/serialization/types/PlanDetailResponseData.d.ts +2 -0
  96. package/dist/serialization/types/PlanGroupPlanDetailResponseData.d.ts +2 -0
  97. package/dist/serialization/types/PlanVersionResponseData.d.ts +21 -0
  98. package/dist/serialization/types/PlanVersionStatus.d.ts +7 -0
  99. package/dist/serialization/types/RawEventResponseData.d.ts +1 -1
  100. package/dist/serialization/{resources/credits/client/requests → types}/UpdateBillingPlanCreditGrantRequestBody.d.ts +10 -10
  101. package/dist/serialization/types/UpdatePlanRequestBody.d.ts +11 -0
  102. package/dist/serialization/{resources/plans/client/requests → types}/UpsertBillingProductRequestBody.d.ts +5 -5
  103. package/dist/serialization/types/WebhookRequestType.d.ts +1 -1
  104. package/dist/serialization/types/index.d.ts +15 -0
  105. package/dist/wrapper.d.ts +10 -1
  106. package/package.json +1 -1
  107. package/dist/api/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -15
  108. package/dist/serialization/resources/plans/client/requests/CreatePlanRequestBody.d.ts +0 -13
  109. package/dist/serialization/resources/plans/client/requests/UpdatePlanRequestBody.d.ts +0 -11
@@ -87,7 +87,11 @@ export * from "./ConditionMetricPeriodMonthReset";
87
87
  export * from "./ConditionOperator";
88
88
  export * from "./CountResponse";
89
89
  export * from "./CouponRequestBody";
90
+ export * from "./CreateBillingPlanCreditGrantRequestBody";
90
91
  export * from "./CreateBillingPriceTierRequestBody";
92
+ export * from "./CreateEntitlementInBundleRequestBody";
93
+ export * from "./CreateEntitlementInBundleRequestBodyMetricPeriod";
94
+ export * from "./CreateEntitlementInBundleRequestBodyMetricPeriodMonthReset";
91
95
  export * from "./CreateEntitlementReqCommon";
92
96
  export * from "./CreateEntitlementReqCommonMetricPeriod";
93
97
  export * from "./CreateEntitlementReqCommonMetricPeriodMonthReset";
@@ -102,6 +106,7 @@ export * from "./CreateOrUpdateConditionRequestBodyOperator";
102
106
  export * from "./CreateOrUpdateFlagRequestBody";
103
107
  export * from "./CreateOrUpdateRuleRequestBody";
104
108
  export * from "./CreateOrUpdateRuleRequestBodyRuleType";
109
+ export * from "./CreatePlanRequestBody";
105
110
  export * from "./CreatePriceTierRequestBody";
106
111
  export * from "./CreditAutoTopupAmountType";
107
112
  export * from "./CreditBundlePurchaseResponseData";
@@ -123,6 +128,7 @@ export * from "./DataExportOutputFileType";
123
128
  export * from "./DataExportResponseData";
124
129
  export * from "./DataExportStatus";
125
130
  export * from "./DataExportType";
131
+ export * from "./DeleteBillingPlanCreditGrantRequestBody";
126
132
  export * from "./DeleteResponse";
127
133
  export * from "./DuplicatePlanEntitlementsResponseResponseData";
128
134
  export * from "./EntitlementPriceBehavior";
@@ -176,6 +182,10 @@ export * from "./MeterRequestBody";
176
182
  export * from "./OrderedPlansInGroup";
177
183
  export * from "./PaymentMethodRequestBody";
178
184
  export * from "./PaymentMethodResponseData";
185
+ export * from "./PlanBundleAction";
186
+ export * from "./PlanBundleCreditGrantRequestBody";
187
+ export * from "./PlanBundleEntitlementRequestBody";
188
+ export * from "./PlanBundleResponseData";
179
189
  export * from "./PlanChangeAction";
180
190
  export * from "./PlanChangeActorType";
181
191
  export * from "./PlanChangeBasePlanAction";
@@ -197,6 +207,8 @@ export * from "./PlanSelection";
197
207
  export * from "./PlanSnapshotView";
198
208
  export * from "./PlanTraitResponseData";
199
209
  export * from "./PlanType";
210
+ export * from "./PlanVersionResponseData";
211
+ export * from "./PlanVersionStatus";
200
212
  export * from "./PreviewObject";
201
213
  export * from "./PreviewObjectResponseData";
202
214
  export * from "./PreviewSubscriptionChangeResponseData";
@@ -252,13 +264,16 @@ export * from "./TraitDefinition";
252
264
  export * from "./TraitDefinitionComparableType";
253
265
  export * from "./TraitType";
254
266
  export * from "./UpdateAddOnRequestBody";
267
+ export * from "./UpdateBillingPlanCreditGrantRequestBody";
255
268
  export * from "./UpdateCreditBundleRequestBody";
256
269
  export * from "./UpdateEntitlementReqCommon";
257
270
  export * from "./UpdateEntitlementReqCommonMetricPeriod";
258
271
  export * from "./UpdateEntitlementReqCommonMetricPeriodMonthReset";
259
272
  export * from "./UpdatePayInAdvanceRequestBody";
273
+ export * from "./UpdatePlanRequestBody";
260
274
  export * from "./UpdatePlanTraitTraitRequestBody";
261
275
  export * from "./UpdateRuleRequestBody";
276
+ export * from "./UpsertBillingProductRequestBody";
262
277
  export * from "./UpsertCompanyRequestBody";
263
278
  export * from "./UpsertTraitRequestBody";
264
279
  export * from "./UpsertUserRequestBody";
package/dist/wrapper.d.ts CHANGED
@@ -29,6 +29,14 @@ export interface SchematicOptions {
29
29
  logger?: Logger;
30
30
  /** Enable offline mode to prevent network activity */
31
31
  offline?: boolean;
32
+ /** The default maximum time to wait for a response in milliseconds */
33
+ timeoutMs?: number;
34
+ }
35
+ export interface CheckFlagOptions {
36
+ /** Default value to return on error. Can be a boolean or a function returning a boolean. If not provided, uses configured flag defaults */
37
+ defaultValue?: boolean | (() => boolean);
38
+ /** The maximum time to wait for a response in milliseconds */
39
+ timeoutMs?: number;
32
40
  }
33
41
  export declare class SchematicClient extends BaseClient {
34
42
  private eventBuffer;
@@ -45,10 +53,11 @@ export declare class SchematicClient extends BaseClient {
45
53
  * Checks the value of a feature flag for the given evaluation context
46
54
  * @param evalCtx - The context (company and/or user) for evaluating the feature flag
47
55
  * @param key - The unique identifier of the feature flag
56
+ * @param options - Optional configuration for the flag check
48
57
  * @returns Promise resolving to the flag's boolean value, falling back to default if unavailable
49
58
  * @throws Will log error and return flag default if check fails
50
59
  */
51
- checkFlag(evalCtx: api.CheckFlagRequestBody, key: string): Promise<boolean>;
60
+ checkFlag(evalCtx: api.CheckFlagRequestBody, key: string, options?: CheckFlagOptions): Promise<boolean>;
52
61
  /**
53
62
  * Checks multiple feature flags with caching optimization
54
63
  * @param evalCtx - The context (company and/or user) for evaluating the feature flags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-typescript-node",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,15 +0,0 @@
1
- import type * as Schematic from "../../../../index";
2
- /**
3
- * @example
4
- * {
5
- * description: "description",
6
- * name: "name",
7
- * planType: "plan"
8
- * }
9
- */
10
- export interface CreatePlanRequestBody {
11
- description: string;
12
- icon?: string;
13
- name: string;
14
- planType: Schematic.PlanType;
15
- }
@@ -1,13 +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 { PlanType } from "../../../../types/PlanType";
5
- export declare const CreatePlanRequestBody: core.serialization.Schema<serializers.CreatePlanRequestBody.Raw, Schematic.CreatePlanRequestBody>;
6
- export declare namespace CreatePlanRequestBody {
7
- interface Raw {
8
- description: string;
9
- icon?: string | null;
10
- name: string;
11
- plan_type: PlanType.Raw;
12
- }
13
- }
@@ -1,11 +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 UpdatePlanRequestBody: core.serialization.Schema<serializers.UpdatePlanRequestBody.Raw, Schematic.UpdatePlanRequestBody>;
5
- export declare namespace UpdatePlanRequestBody {
6
- interface Raw {
7
- description?: string | null;
8
- icon?: string | null;
9
- name: string;
10
- }
11
- }