@schematichq/schematic-typescript-node 1.2.3 → 1.2.5

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 (94) hide show
  1. package/dist/Client.d.ts +24 -3
  2. package/dist/api/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.d.ts +4 -1
  3. package/dist/api/resources/companies/client/Client.d.ts +35 -0
  4. package/dist/api/resources/companies/client/requests/ListPlanChangesRequest.d.ts +28 -0
  5. package/dist/api/resources/companies/client/requests/index.d.ts +1 -0
  6. package/dist/api/resources/{features/types/CountAudienceCompaniesResponse.d.ts → companies/types/GetPlanChangeResponse.d.ts} +2 -2
  7. package/dist/api/resources/companies/types/ListPlanChangesParams.d.ts +17 -0
  8. package/dist/api/resources/{features/types/CountAudienceUsersResponse.d.ts → companies/types/ListPlanChangesResponse.d.ts} +3 -3
  9. package/dist/api/resources/companies/types/index.d.ts +3 -0
  10. package/dist/api/resources/credits/client/Client.d.ts +24 -24
  11. package/dist/api/resources/features/client/Client.d.ts +0 -112
  12. package/dist/api/resources/features/types/index.d.ts +0 -4
  13. package/dist/api/resources/index.d.ts +3 -3
  14. package/dist/api/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +0 -1
  15. package/dist/api/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +0 -1
  16. package/dist/api/resources/plans/client/Client.d.ts +0 -58
  17. package/dist/api/resources/plans/client/requests/index.d.ts +0 -1
  18. package/dist/api/resources/plans/types/index.d.ts +0 -3
  19. package/dist/api/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +4 -1
  20. package/dist/api/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +4 -1
  21. package/dist/api/types/ApiKeyRequestResponseData.d.ts +2 -0
  22. package/dist/api/types/BillingCreditGrantResponseData.d.ts +1 -0
  23. package/dist/api/types/CreateOrUpdateConditionGroupRequestBody.d.ts +0 -1
  24. package/dist/api/types/CreateOrUpdateRuleRequestBodyRuleType.d.ts +1 -2
  25. package/dist/api/types/PlanChangeResponseData.d.ts +29 -0
  26. package/dist/api/types/PlanChangeResponseDataAction.d.ts +14 -0
  27. package/dist/api/types/PlanChangeResponseDataActorType.d.ts +10 -0
  28. package/dist/api/types/PlanChangeResponseDataBasePlanAction.d.ts +13 -0
  29. package/dist/api/types/PlanChangeResponseDataSubscriptionChangeAction.d.ts +15 -0
  30. package/dist/api/types/PlanSnapshotView.d.ts +10 -0
  31. package/dist/api/types/RuleConditionDetailResponseData.d.ts +0 -1
  32. package/dist/api/types/RuleConditionGroupDetailResponseData.d.ts +0 -1
  33. package/dist/api/types/RuleConditionGroupResponseData.d.ts +0 -1
  34. package/dist/api/types/RuleConditionResponseData.d.ts +0 -1
  35. package/dist/api/types/RuleDetailResponseData.d.ts +0 -1
  36. package/dist/api/types/RuleResponseData.d.ts +0 -1
  37. package/dist/api/types/SubscriptionTraitUpdate.d.ts +12 -0
  38. package/dist/api/types/index.d.ts +7 -4
  39. package/dist/events.d.ts +1 -0
  40. package/dist/index.js +3 -3
  41. package/dist/serialization/resources/accesstokens/client/requests/IssueTemporaryAccessTokenRequestBody.d.ts +1 -0
  42. package/dist/serialization/resources/companies/types/GetPlanChangeResponse.d.ts +14 -0
  43. package/dist/serialization/resources/companies/types/ListPlanChangesParams.d.ts +18 -0
  44. package/dist/serialization/resources/companies/types/ListPlanChangesResponse.d.ts +15 -0
  45. package/dist/serialization/resources/companies/types/index.d.ts +3 -0
  46. package/dist/serialization/resources/features/types/index.d.ts +0 -4
  47. package/dist/serialization/resources/index.d.ts +3 -3
  48. package/dist/serialization/resources/plangroups/client/requests/CreatePlanGroupRequestBody.d.ts +0 -1
  49. package/dist/serialization/resources/plangroups/client/requests/UpdatePlanGroupRequestBody.d.ts +0 -1
  50. package/dist/serialization/resources/plans/client/requests/index.d.ts +0 -1
  51. package/dist/serialization/resources/plans/types/index.d.ts +0 -3
  52. package/dist/serialization/resources/webhooks/types/CreateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
  53. package/dist/serialization/resources/webhooks/types/UpdateWebhookRequestBodyRequestTypesItem.d.ts +1 -1
  54. package/dist/serialization/types/ApiKeyRequestResponseData.d.ts +2 -0
  55. package/dist/serialization/types/BillingCreditGrantResponseData.d.ts +1 -0
  56. package/dist/serialization/types/CreateOrUpdateConditionGroupRequestBody.d.ts +0 -1
  57. package/dist/serialization/types/CreateOrUpdateRuleRequestBodyRuleType.d.ts +1 -1
  58. package/dist/serialization/types/PlanChangeResponseData.d.ts +40 -0
  59. package/dist/serialization/types/PlanChangeResponseDataAction.d.ts +10 -0
  60. package/dist/serialization/types/PlanChangeResponseDataActorType.d.ts +10 -0
  61. package/dist/serialization/types/PlanChangeResponseDataBasePlanAction.d.ts +10 -0
  62. package/dist/serialization/types/PlanChangeResponseDataSubscriptionChangeAction.d.ts +10 -0
  63. package/dist/serialization/types/PlanSnapshotView.d.ts +16 -0
  64. package/dist/serialization/types/RuleConditionDetailResponseData.d.ts +0 -1
  65. package/dist/serialization/types/RuleConditionGroupDetailResponseData.d.ts +0 -1
  66. package/dist/serialization/types/RuleConditionGroupResponseData.d.ts +0 -1
  67. package/dist/serialization/types/RuleConditionResponseData.d.ts +0 -1
  68. package/dist/serialization/types/RuleDetailResponseData.d.ts +0 -1
  69. package/dist/serialization/types/RuleResponseData.d.ts +0 -1
  70. package/dist/serialization/types/SubscriptionTraitUpdate.d.ts +18 -0
  71. package/dist/serialization/types/index.d.ts +7 -4
  72. package/package.json +1 -1
  73. package/dist/api/resources/features/types/ListAudienceCompaniesResponse.d.ts +0 -9
  74. package/dist/api/resources/features/types/ListAudienceUsersResponse.d.ts +0 -9
  75. package/dist/api/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +0 -25
  76. package/dist/api/resources/plans/types/DeleteAudienceResponse.d.ts +0 -9
  77. package/dist/api/resources/plans/types/GetAudienceResponse.d.ts +0 -9
  78. package/dist/api/resources/plans/types/UpdateAudienceResponse.d.ts +0 -9
  79. package/dist/api/types/AudienceRequestBody.d.ts +0 -13
  80. package/dist/api/types/PaginationFilter.d.ts +0 -9
  81. package/dist/api/types/PlanAudienceDetailResponseData.d.ts +0 -18
  82. package/dist/api/types/PlanAudienceResponseData.d.ts +0 -15
  83. package/dist/serialization/resources/features/types/CountAudienceCompaniesResponse.d.ts +0 -14
  84. package/dist/serialization/resources/features/types/CountAudienceUsersResponse.d.ts +0 -14
  85. package/dist/serialization/resources/features/types/ListAudienceCompaniesResponse.d.ts +0 -14
  86. package/dist/serialization/resources/features/types/ListAudienceUsersResponse.d.ts +0 -14
  87. package/dist/serialization/resources/plans/client/requests/UpdateAudienceRequestBody.d.ts +0 -15
  88. package/dist/serialization/resources/plans/types/DeleteAudienceResponse.d.ts +0 -14
  89. package/dist/serialization/resources/plans/types/GetAudienceResponse.d.ts +0 -14
  90. package/dist/serialization/resources/plans/types/UpdateAudienceResponse.d.ts +0 -14
  91. package/dist/serialization/types/AudienceRequestBody.d.ts +0 -18
  92. package/dist/serialization/types/PaginationFilter.d.ts +0 -13
  93. package/dist/serialization/types/PlanAudienceDetailResponseData.d.ts +0 -25
  94. package/dist/serialization/types/PlanAudienceResponseData.d.ts +0 -21
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type UpdateWebhookRequestBodyRequestTypesItem = "company.updated" | "user.updated" | "plan.updated" | "plan.entitlement.updated" | "company.override.updated" | "feature.updated" | "flag.updated" | "flag_rules.updated" | "company.created" | "user.created" | "plan.created" | "plan.entitlement.created" | "company.override.created" | "feature.created" | "flag.created" | "company.deleted" | "user.deleted" | "plan.deleted" | "plan.entitlement.deleted" | "company.override.deleted" | "feature.deleted" | "flag.deleted" | "test.send" | "subscription.trial.ended" | "entitlement.limit.warning" | "entitlement.limit.reached" | "entitlement.soft_limit.warning" | "entitlement.soft_limit.reached" | "credit.limit.warning" | "credit.limit.reached";
4
+ export type UpdateWebhookRequestBodyRequestTypesItem = "company.updated" | "user.updated" | "plan.updated" | "plan.entitlement.updated" | "company.override.updated" | "feature.updated" | "flag.updated" | "flag_rules.updated" | "company.created" | "user.created" | "plan.created" | "plan.entitlement.created" | "company.override.created" | "feature.created" | "flag.created" | "company.deleted" | "user.deleted" | "plan.deleted" | "plan.entitlement.deleted" | "company.override.deleted" | "feature.deleted" | "flag.deleted" | "test.send" | "subscription.trial.ended" | "entitlement.limit.warning" | "entitlement.limit.reached" | "entitlement.soft_limit.warning" | "entitlement.soft_limit.reached" | "entitlement.tier_limit.warning" | "entitlement.tier_limit.reached" | "credit.limit.warning" | "credit.limit.reached" | "company.plan_change";
5
5
  export declare const UpdateWebhookRequestBodyRequestTypesItem: {
6
6
  readonly CompanyUpdated: "company.updated";
7
7
  readonly UserUpdated: "user.updated";
@@ -31,6 +31,9 @@ export declare const UpdateWebhookRequestBodyRequestTypesItem: {
31
31
  readonly EntitlementLimitReached: "entitlement.limit.reached";
32
32
  readonly EntitlementSoftLimitWarning: "entitlement.soft_limit.warning";
33
33
  readonly EntitlementSoftLimitReached: "entitlement.soft_limit.reached";
34
+ readonly EntitlementTierLimitWarning: "entitlement.tier_limit.warning";
35
+ readonly EntitlementTierLimitReached: "entitlement.tier_limit.reached";
34
36
  readonly CreditLimitWarning: "credit.limit.warning";
35
37
  readonly CreditLimitReached: "credit.limit.reached";
38
+ readonly CompanyPlanChange: "company.plan_change";
36
39
  };
@@ -1,7 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Schematic from "../index";
4
5
  export interface ApiKeyRequestResponseData {
6
+ apiKey?: Schematic.ApiKeyResponseData;
5
7
  apiKeyId: string;
6
8
  endedAt?: Date;
7
9
  environmentId?: string;
@@ -7,6 +7,7 @@ export interface BillingCreditGrantResponseData {
7
7
  companyName: string;
8
8
  createdAt: Date;
9
9
  creditIcon?: string;
10
+ creditId: string;
10
11
  creditName: string;
11
12
  expiresAt?: Date;
12
13
  grantReason: string;
@@ -6,5 +6,4 @@ export interface CreateOrUpdateConditionGroupRequestBody {
6
6
  conditions: Schematic.CreateOrUpdateConditionRequestBody[];
7
7
  flagId?: string;
8
8
  id?: string;
9
- planId?: string;
10
9
  }
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type CreateOrUpdateRuleRequestBodyRuleType = "global_override" | "company_override" | "plan_entitlement" | "standard" | "default" | "plan_audience";
4
+ export type CreateOrUpdateRuleRequestBodyRuleType = "global_override" | "company_override" | "plan_entitlement" | "standard" | "default";
5
5
  export declare const CreateOrUpdateRuleRequestBodyRuleType: {
6
6
  readonly GlobalOverride: "global_override";
7
7
  readonly CompanyOverride: "company_override";
8
8
  readonly PlanEntitlement: "plan_entitlement";
9
9
  readonly Standard: "standard";
10
10
  readonly Default: "default";
11
- readonly PlanAudience: "plan_audience";
12
11
  };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Schematic from "../index";
5
+ export interface PlanChangeResponseData {
6
+ action: Schematic.PlanChangeResponseDataAction;
7
+ actorType: Schematic.PlanChangeResponseDataActorType;
8
+ addOnsAdded: Schematic.PlanSnapshotView[];
9
+ addOnsRemoved: Schematic.PlanSnapshotView[];
10
+ apiKey?: Schematic.ApiKeyResponseData;
11
+ apiKeyRequest?: Schematic.ApiKeyRequestListResponseData;
12
+ basePlan?: Schematic.PlanSnapshotView;
13
+ /** Any special behavior that affected the assignment of the base plan during this change. */
14
+ basePlanAction?: Schematic.PlanChangeResponseDataBasePlanAction;
15
+ company?: Schematic.CompanyResponseData;
16
+ companyId: string;
17
+ createdAt: Date;
18
+ environmentId: string;
19
+ id: string;
20
+ previousBasePlan?: Schematic.PlanSnapshotView;
21
+ requestId?: string;
22
+ /** If a subscription was changed as a part of this plan change, indicates the type of change that was made. */
23
+ subscriptionChangeAction?: Schematic.PlanChangeResponseDataSubscriptionChangeAction;
24
+ /** Any traits were updated as part of this plan change (via pay-in-advance entitlements). */
25
+ traitsUpdated: Schematic.SubscriptionTraitUpdate[];
26
+ updatedAt: Date;
27
+ userId?: string;
28
+ userName?: string;
29
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type PlanChangeResponseDataAction = "checkout" | "company_upsert" | "fallback_plan" | "manage_plan" | "plan_billing_product_changed" | "plan_deleted" | "quickstart" | "subscription_change";
5
+ export declare const PlanChangeResponseDataAction: {
6
+ readonly Checkout: "checkout";
7
+ readonly CompanyUpsert: "company_upsert";
8
+ readonly FallbackPlan: "fallback_plan";
9
+ readonly ManagePlan: "manage_plan";
10
+ readonly PlanBillingProductChanged: "plan_billing_product_changed";
11
+ readonly PlanDeleted: "plan_deleted";
12
+ readonly Quickstart: "quickstart";
13
+ readonly SubscriptionChange: "subscription_change";
14
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type PlanChangeResponseDataActorType = "app_user" | "api_key" | "system" | "temporary_access_token";
5
+ export declare const PlanChangeResponseDataActorType: {
6
+ readonly AppUser: "app_user";
7
+ readonly ApiKey: "api_key";
8
+ readonly System: "system";
9
+ readonly TemporaryAccessToken: "temporary_access_token";
10
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Any special behavior that affected the assignment of the base plan during this change.
6
+ */
7
+ export type PlanChangeResponseDataBasePlanAction = "fallback" | "initial" | "trait" | "trial_expiry";
8
+ export declare const PlanChangeResponseDataBasePlanAction: {
9
+ readonly Fallback: "fallback";
10
+ readonly Initial: "initial";
11
+ readonly Trait: "trait";
12
+ readonly TrialExpiry: "trial_expiry";
13
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * If a subscription was changed as a part of this plan change, indicates the type of change that was made.
6
+ */
7
+ export type PlanChangeResponseDataSubscriptionChangeAction = "downgrade" | "invalid" | "subscribe" | "unsubscribe" | "upgrade" | "upgrade_trial";
8
+ export declare const PlanChangeResponseDataSubscriptionChangeAction: {
9
+ readonly Downgrade: "downgrade";
10
+ readonly Invalid: "invalid";
11
+ readonly Subscribe: "subscribe";
12
+ readonly Unsubscribe: "unsubscribe";
13
+ readonly Upgrade: "upgrade";
14
+ readonly UpgradeTrial: "upgrade_trial";
15
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface PlanSnapshotView {
5
+ deleted: boolean;
6
+ description: string;
7
+ icon: string;
8
+ id: string;
9
+ name: string;
10
+ }
@@ -16,7 +16,6 @@ export interface RuleConditionDetailResponseData {
16
16
  metricPeriodMonthReset?: string;
17
17
  metricValue?: number;
18
18
  operator: string;
19
- planId?: string;
20
19
  resourceIds: string[];
21
20
  resources: Schematic.PreviewObjectResponseData[];
22
21
  ruleId: string;
@@ -8,7 +8,6 @@ export interface RuleConditionGroupDetailResponseData {
8
8
  environmentId: string;
9
9
  flagId?: string;
10
10
  id: string;
11
- planId?: string;
12
11
  ruleId: string;
13
12
  updatedAt: Date;
14
13
  }
@@ -6,7 +6,6 @@ export interface RuleConditionGroupResponseData {
6
6
  environmentId: string;
7
7
  flagId?: string;
8
8
  id: string;
9
- planId?: string;
10
9
  ruleId: string;
11
10
  updatedAt: Date;
12
11
  }
@@ -14,7 +14,6 @@ export interface RuleConditionResponseData {
14
14
  metricPeriodMonthReset?: string;
15
15
  metricValue?: number;
16
16
  operator: string;
17
- planId?: string;
18
17
  resourceIds: string[];
19
18
  ruleId: string;
20
19
  traitEntityType?: string;
@@ -10,7 +10,6 @@ export interface RuleDetailResponseData {
10
10
  flagId?: string;
11
11
  id: string;
12
12
  name: string;
13
- planId?: string;
14
13
  priority: number;
15
14
  ruleType: string;
16
15
  updatedAt: Date;
@@ -7,7 +7,6 @@ export interface RuleResponseData {
7
7
  flagId?: string;
8
8
  id: string;
9
9
  name: string;
10
- planId?: string;
11
10
  priority: number;
12
11
  ruleType: string;
13
12
  updatedAt: Date;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface SubscriptionTraitUpdate {
5
+ featureId: string;
6
+ hierarchy: string[];
7
+ reason: string;
8
+ traitId: string;
9
+ traitName: string;
10
+ traitType: string;
11
+ value: string;
12
+ }
@@ -3,7 +3,6 @@ export * from "./ApiKeyCreateResponseData";
3
3
  export * from "./ApiKeyRequestListResponseData";
4
4
  export * from "./ApiKeyRequestResponseData";
5
5
  export * from "./ApiKeyResponseData";
6
- export * from "./AudienceRequestBody";
7
6
  export * from "./BillingCouponResponseData";
8
7
  export * from "./BillingCreditBundleResponseData";
9
8
  export * from "./BillingCreditBundleView";
@@ -140,11 +139,13 @@ export * from "./ManagePlanRequest";
140
139
  export * from "./ManagePlanResponseResponseData";
141
140
  export * from "./MeterRequestBody";
142
141
  export * from "./OrderedPlansInGroup";
143
- export * from "./PaginationFilter";
144
142
  export * from "./PaymentMethodRequestBody";
145
143
  export * from "./PaymentMethodResponseData";
146
- export * from "./PlanAudienceDetailResponseData";
147
- export * from "./PlanAudienceResponseData";
144
+ export * from "./PlanChangeResponseDataAction";
145
+ export * from "./PlanChangeResponseDataActorType";
146
+ export * from "./PlanChangeResponseDataBasePlanAction";
147
+ export * from "./PlanChangeResponseDataSubscriptionChangeAction";
148
+ export * from "./PlanChangeResponseData";
148
149
  export * from "./PlanCreditGrantView";
149
150
  export * from "./PlanDetailResponseData";
150
151
  export * from "./PlanEntitlementResponseData";
@@ -157,6 +158,7 @@ export * from "./PlanGroupResponseData";
157
158
  export * from "./PlanIssueResponseData";
158
159
  export * from "./PlanResponseData";
159
160
  export * from "./PlanSelection";
161
+ export * from "./PlanSnapshotView";
160
162
  export * from "./PlanTraitResponseData";
161
163
  export * from "./PreviewObject";
162
164
  export * from "./PreviewObjectResponseData";
@@ -176,6 +178,7 @@ export * from "./RuleResponseData";
176
178
  export * from "./RulesDetailResponseData";
177
179
  export * from "./SegmentStatusResp";
178
180
  export * from "./StripeEmbedInfo";
181
+ export * from "./SubscriptionTraitUpdate";
179
182
  export * from "./TemporaryAccessTokenResponseData";
180
183
  export * from "./TraitDefinition";
181
184
  export * from "./UpdateAddOnRequestBody";
package/dist/events.d.ts CHANGED
@@ -21,6 +21,7 @@ declare class EventBuffer {
21
21
  private initialRetryDelay;
22
22
  private shutdown;
23
23
  private stopped;
24
+ private flushing;
24
25
  constructor(eventsApi: Events, opts?: EventBufferOptions);
25
26
  flush(): Promise<void>;
26
27
  push(event: CreateEventRequestBody): Promise<void>;