@stigg/js-client-sdk 0.34.1 → 0.36.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/api/generated/types.d.ts +152 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +19 -1
- package/dist/utils/ModelMapper.d.ts +1 -0
- package/package.json +1 -1
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",
|
|
@@ -108,11 +111,13 @@ export declare type Plan = {
|
|
|
108
111
|
defaultTrialConfig?: DefaultTrialConfig | null;
|
|
109
112
|
compatibleAddons: Addon[];
|
|
110
113
|
product: Product;
|
|
114
|
+
metadata?: Metadata | null;
|
|
111
115
|
};
|
|
112
116
|
export declare type Product = {
|
|
113
117
|
id: string;
|
|
114
118
|
displayName?: string | null;
|
|
115
119
|
description?: string | null;
|
|
120
|
+
metadata?: Metadata | null;
|
|
116
121
|
};
|
|
117
122
|
export declare type DefaultTrialConfig = {
|
|
118
123
|
duration: number;
|
|
@@ -166,6 +171,7 @@ export declare type Addon = {
|
|
|
166
171
|
entitlements: PackageEntitlement[];
|
|
167
172
|
pricePoints: Price[];
|
|
168
173
|
pricingType?: PricingType | null;
|
|
174
|
+
metadata?: Metadata | null;
|
|
169
175
|
};
|
|
170
176
|
export declare type SubscriptionAddon = {
|
|
171
177
|
quantity: number;
|
|
@@ -181,10 +187,15 @@ export declare type Subscription = {
|
|
|
181
187
|
billingId?: string;
|
|
182
188
|
crmId?: string;
|
|
183
189
|
startDate: Date;
|
|
184
|
-
endDate?: Date;
|
|
185
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;
|
|
186
196
|
trialEndDate?: Date;
|
|
187
197
|
cancellationDate?: Date;
|
|
198
|
+
metadata?: Metadata | null;
|
|
188
199
|
};
|
|
189
200
|
export declare type Customer = {
|
|
190
201
|
id: string;
|
|
@@ -195,11 +206,17 @@ export declare type Customer = {
|
|
|
195
206
|
subscriptions: Subscription[];
|
|
196
207
|
promotionalEntitlements: PromotionalEntitlement[];
|
|
197
208
|
hasPaymentMethod: boolean;
|
|
209
|
+
metadata?: Metadata | null;
|
|
210
|
+
trialedPlans?: TrialedPlan[] | null;
|
|
198
211
|
getActiveSubscriptions(): Subscription[];
|
|
199
212
|
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
200
213
|
getActiveTrials(): Subscription[];
|
|
201
214
|
};
|
|
202
215
|
export declare type CustomerState = Omit<Customer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
216
|
+
export declare type TrialedPlan = {
|
|
217
|
+
productId?: string | null;
|
|
218
|
+
planId?: string | null;
|
|
219
|
+
};
|
|
203
220
|
/** @hidden */
|
|
204
221
|
export declare class CustomerModel implements Customer {
|
|
205
222
|
id: string;
|
|
@@ -208,6 +225,7 @@ export declare class CustomerModel implements Customer {
|
|
|
208
225
|
subscriptions: Subscription[];
|
|
209
226
|
promotionalEntitlements: PromotionalEntitlement[];
|
|
210
227
|
hasPaymentMethod: boolean;
|
|
228
|
+
metadata?: Metadata | null;
|
|
211
229
|
constructor(state: CustomerState);
|
|
212
230
|
getActiveSubscriptions(): Subscription[];
|
|
213
231
|
getActiveTrials(): Subscription[];
|