@stigg/js-client-sdk 0.34.0 → 0.35.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.
package/dist/models.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, TrialPeriodUnits } from './api/generated/types';
2
2
  export { PricingType, SubscriptionStatus, PromotionalEntitlementStatus, Currency, BillingPeriod, BillingModel, TrialPeriodUnits, } from './api/generated/types';
3
+ interface Metadata {
4
+ [key: string]: string;
5
+ }
3
6
  export declare enum AccessDeniedReason {
4
7
  InvalidFeatureType = "InvalidFeatureType",
5
8
  CustomerNotFound = "CustomerNotFound",
@@ -87,6 +90,7 @@ export declare type Price = {
87
90
  feature?: {
88
91
  units?: string | null | undefined;
89
92
  unitsPlural?: string | null | undefined;
93
+ unitQuantity?: number | null;
90
94
  displayName: string;
91
95
  } | null;
92
96
  };
@@ -107,11 +111,13 @@ export declare type Plan = {
107
111
  defaultTrialConfig?: DefaultTrialConfig | null;
108
112
  compatibleAddons: Addon[];
109
113
  product: Product;
114
+ metadata?: Metadata | null;
110
115
  };
111
116
  export declare type Product = {
112
117
  id: string;
113
118
  displayName?: string | null;
114
119
  description?: string | null;
120
+ metadata?: Metadata | null;
115
121
  };
116
122
  export declare type DefaultTrialConfig = {
117
123
  duration: number;
@@ -165,6 +171,7 @@ export declare type Addon = {
165
171
  entitlements: PackageEntitlement[];
166
172
  pricePoints: Price[];
167
173
  pricingType?: PricingType | null;
174
+ metadata?: Metadata | null;
168
175
  };
169
176
  export declare type SubscriptionAddon = {
170
177
  quantity: number;
@@ -180,10 +187,15 @@ export declare type Subscription = {
180
187
  billingId?: string;
181
188
  crmId?: string;
182
189
  startDate: Date;
183
- endDate?: Date;
184
190
  currentBillingPeriodEnd?: Date;
191
+ /**
192
+ * The calculated end date after which the subscription will be canceled, which takes trial expiration and scheduled cancellations into consideration
193
+ */
194
+ effectiveEndDate?: Date;
195
+ endDate?: Date;
185
196
  trialEndDate?: Date;
186
197
  cancellationDate?: Date;
198
+ metadata?: Metadata | null;
187
199
  };
188
200
  export declare type Customer = {
189
201
  id: string;
@@ -194,6 +206,7 @@ export declare type Customer = {
194
206
  subscriptions: Subscription[];
195
207
  promotionalEntitlements: PromotionalEntitlement[];
196
208
  hasPaymentMethod: boolean;
209
+ metadata?: Metadata | null;
197
210
  getActiveSubscriptions(): Subscription[];
198
211
  getActivePromotionalEntitlements(): PromotionalEntitlement[];
199
212
  getActiveTrials(): Subscription[];
@@ -207,6 +220,7 @@ export declare class CustomerModel implements Customer {
207
220
  subscriptions: Subscription[];
208
221
  promotionalEntitlements: PromotionalEntitlement[];
209
222
  hasPaymentMethod: boolean;
223
+ metadata?: Metadata | null;
210
224
  constructor(state: CustomerState);
211
225
  getActiveSubscriptions(): Subscription[];
212
226
  getActiveTrials(): Subscription[];
@@ -20,6 +20,7 @@ export declare class ModelMapper {
20
20
  private mapPackageEntitlement;
21
21
  private mapPromotionalEntitlement;
22
22
  private mapSubscription;
23
+ private mapDate;
23
24
  private mapAddon;
24
25
  private sortPlans;
25
26
  private mapAccessDeniedReason;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigg/js-client-sdk",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Stigg client-side SDK for Browser",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",