@stigg/js-client-sdk 1.33.0 → 1.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/client.d.ts +1 -1
- package/dist/index.js +313 -339
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +5 -4
- package/dist/src/client.d.ts +1 -1
- package/dist/src/models.d.ts +5 -4
- package/dist/src/utils/ModelMapper.d.ts +1 -1
- package/dist/src/utils/mapGetEntitlementsFallback.d.ts +1 -1
- package/dist/utils/ModelMapper.d.ts +1 -1
- package/dist/utils/mapGetEntitlementsFallback.d.ts +1 -1
- package/package.json +2 -2
package/dist/models.d.ts
CHANGED
|
@@ -276,6 +276,7 @@ export declare type Paywall = {
|
|
|
276
276
|
configuration?: PaywallConfiguration | null;
|
|
277
277
|
customer: Customer | null;
|
|
278
278
|
resource: CustomerResource | null;
|
|
279
|
+
activeSubscriptions: Subscription[] | null;
|
|
279
280
|
currency: PaywallCurrency;
|
|
280
281
|
};
|
|
281
282
|
export declare type CustomerResource = {
|
|
@@ -295,11 +296,10 @@ export declare type Customer = {
|
|
|
295
296
|
trialedPlans?: TrialedPlan[] | null;
|
|
296
297
|
eligibleForTrial?: EligibleForTrial[] | null;
|
|
297
298
|
experimentInfo?: ExperimentInfo | null;
|
|
298
|
-
/**
|
|
299
|
-
* @deprecated *Optional* `customer level getActiveSubscriptions` is now deprecated. Use native getActiveSubscriptions instead.
|
|
300
|
-
*/
|
|
301
|
-
getActiveSubscriptions(): Subscription[];
|
|
302
299
|
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
300
|
+
/** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.Active} */
|
|
301
|
+
getActiveSubscriptions(): Subscription[];
|
|
302
|
+
/** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
|
|
303
303
|
getActiveTrials(): Subscription[];
|
|
304
304
|
};
|
|
305
305
|
export declare type CustomerState = Omit<Customer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
@@ -358,6 +358,7 @@ export interface SubscriptionPreview {
|
|
|
358
358
|
}
|
|
359
359
|
export declare type EstimateSubscription = {
|
|
360
360
|
customerId: string;
|
|
361
|
+
resourceId?: string;
|
|
361
362
|
planId: string;
|
|
362
363
|
addons?: SubscriptionEstimationAddon[];
|
|
363
364
|
startDate?: Date;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export declare class Stigg implements StiggClient {
|
|
|
149
149
|
*
|
|
150
150
|
* @returns {Promise<Entitlement[]>}
|
|
151
151
|
*/
|
|
152
|
-
getEntitlements(): Promise<Entitlement[]>;
|
|
152
|
+
getEntitlements(resourceId?: string): Promise<Entitlement[]>;
|
|
153
153
|
/**
|
|
154
154
|
* Estimate subscription
|
|
155
155
|
* @return {Promise<SubscriptionPreview>} Preview of the subscription.
|
package/dist/src/models.d.ts
CHANGED
|
@@ -276,6 +276,7 @@ export declare type Paywall = {
|
|
|
276
276
|
configuration?: PaywallConfiguration | null;
|
|
277
277
|
customer: Customer | null;
|
|
278
278
|
resource: CustomerResource | null;
|
|
279
|
+
activeSubscriptions: Subscription[] | null;
|
|
279
280
|
currency: PaywallCurrency;
|
|
280
281
|
};
|
|
281
282
|
export declare type CustomerResource = {
|
|
@@ -295,11 +296,10 @@ export declare type Customer = {
|
|
|
295
296
|
trialedPlans?: TrialedPlan[] | null;
|
|
296
297
|
eligibleForTrial?: EligibleForTrial[] | null;
|
|
297
298
|
experimentInfo?: ExperimentInfo | null;
|
|
298
|
-
/**
|
|
299
|
-
* @deprecated *Optional* `customer level getActiveSubscriptions` is now deprecated. Use native getActiveSubscriptions instead.
|
|
300
|
-
*/
|
|
301
|
-
getActiveSubscriptions(): Subscription[];
|
|
302
299
|
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
300
|
+
/** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.Active} */
|
|
301
|
+
getActiveSubscriptions(): Subscription[];
|
|
302
|
+
/** @deprecated use {@link StiggClient.getActiveSubscriptions} instead with filter for {@link SubscriptionStatus.InTrial} */
|
|
303
303
|
getActiveTrials(): Subscription[];
|
|
304
304
|
};
|
|
305
305
|
export declare type CustomerState = Omit<Customer, 'getActiveSubscriptions' | 'getActivePromotionalEntitlements' | 'getActiveTrials'>;
|
|
@@ -358,6 +358,7 @@ export interface SubscriptionPreview {
|
|
|
358
358
|
}
|
|
359
359
|
export declare type EstimateSubscription = {
|
|
360
360
|
customerId: string;
|
|
361
|
+
resourceId?: string;
|
|
361
362
|
planId: string;
|
|
362
363
|
addons?: SubscriptionEstimationAddon[];
|
|
363
364
|
startDate?: Date;
|
|
@@ -18,7 +18,7 @@ export declare class ModelMapper {
|
|
|
18
18
|
mapCoupons(resultData: GetCouponsQuery): Coupon[];
|
|
19
19
|
mapResource(resource: CustomerResourceFragment): CustomerResource;
|
|
20
20
|
mapCustomerPortal(customerPortal: CustomerPortalFragment): CustomerPortal;
|
|
21
|
-
mapCustomer(customer: CustomerFragment): Customer;
|
|
21
|
+
mapCustomer(customer: CustomerFragment, subscriptions: SubscriptionFragment[]): Customer;
|
|
22
22
|
private mapPaymentDetails;
|
|
23
23
|
private mapTotalPrice;
|
|
24
24
|
private mapPrice;
|
|
@@ -18,7 +18,7 @@ export declare class ModelMapper {
|
|
|
18
18
|
mapCoupons(resultData: GetCouponsQuery): Coupon[];
|
|
19
19
|
mapResource(resource: CustomerResourceFragment): CustomerResource;
|
|
20
20
|
mapCustomerPortal(customerPortal: CustomerPortalFragment): CustomerPortal;
|
|
21
|
-
mapCustomer(customer: CustomerFragment): Customer;
|
|
21
|
+
mapCustomer(customer: CustomerFragment, subscriptions: SubscriptionFragment[]): Customer;
|
|
22
22
|
private mapPaymentDetails;
|
|
23
23
|
private mapTotalPrice;
|
|
24
24
|
private mapPrice;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0",
|
|
4
4
|
"description": "Stigg client-side SDK for Browser",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@apollo/client": "^3.4.17",
|
|
30
30
|
"@sentry/browser": "^7.11.1",
|
|
31
|
-
"@stigg/api-client-js": "0.
|
|
31
|
+
"@stigg/api-client-js": "0.421.0",
|
|
32
32
|
"axios": "^1.2.2",
|
|
33
33
|
"cross-fetch": "^3.1.4",
|
|
34
34
|
"husky": "^7.0.4",
|