@stigg/js-client-sdk 1.31.1 → 1.32.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/CustomersApi.d.ts +2 -1
- package/dist/client.d.ts +2 -0
- package/dist/index.js +161 -74
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +3 -0
- package/dist/src/api/CustomersApi.d.ts +2 -1
- package/dist/src/client.d.ts +2 -0
- package/dist/src/models.d.ts +3 -0
- package/dist/src/utils/ModelMapper.d.ts +5 -2
- package/dist/utils/ModelMapper.d.ts +5 -2
- package/package.json +2 -2
package/dist/models.d.ts
CHANGED
|
@@ -289,6 +289,9 @@ export declare type Customer = {
|
|
|
289
289
|
trialedPlans?: TrialedPlan[] | null;
|
|
290
290
|
eligibleForTrial?: EligibleForTrial[] | null;
|
|
291
291
|
experimentInfo?: ExperimentInfo | null;
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated *Optional* `customer level getActiveSubscriptions` is now deprecated. Use native getActiveSubscriptions instead.
|
|
294
|
+
*/
|
|
292
295
|
getActiveSubscriptions(): Subscription[];
|
|
293
296
|
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
294
297
|
getActiveTrials(): Subscription[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { GetCustomerPortalByRefIdQuery, GetCustomerByIdQuery } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
+
import { GetCustomerPortalByRefIdQuery, GetCustomerByIdQuery, GetActiveSubscriptionsQuery } from '@stigg/api-client-js/src/generated/sdk';
|
|
3
3
|
declare class CustomersApi {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
6
6
|
getCustomer(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerByIdQuery>>;
|
|
7
|
+
getActiveSubscriptions(customerId: string, resourceId?: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetActiveSubscriptionsQuery>>;
|
|
7
8
|
getCustomerPortal(customerId: string, resourceId: string | undefined): Promise<import("@apollo/client/core").ApolloQueryResult<GetCustomerPortalByRefIdQuery>>;
|
|
8
9
|
}
|
|
9
10
|
export default CustomersApi;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface StiggClient {
|
|
|
13
13
|
clearResource: () => Promise<void>;
|
|
14
14
|
getPaywall: (params?: GetPaywall) => Promise<Paywall>;
|
|
15
15
|
getCustomer: () => Promise<Customer>;
|
|
16
|
+
getActiveSubscriptions: () => Promise<Subscription[]>;
|
|
16
17
|
getCoupons(): Promise<Coupon[]>;
|
|
17
18
|
getEntitlements: (resourceId?: string) => Promise<Entitlement[]>;
|
|
18
19
|
refresh: () => Promise<void>;
|
|
@@ -168,4 +169,5 @@ export declare class Stigg implements StiggClient {
|
|
|
168
169
|
* @param refreshOnComplete should refresh entitlements if subscription was found
|
|
169
170
|
*/
|
|
170
171
|
waitForCheckoutCompleted({ timeoutMs, refreshOnComplete, }?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
172
|
+
getActiveSubscriptions(): Promise<Subscription[]>;
|
|
171
173
|
}
|
package/dist/src/models.d.ts
CHANGED
|
@@ -289,6 +289,9 @@ export declare type Customer = {
|
|
|
289
289
|
trialedPlans?: TrialedPlan[] | null;
|
|
290
290
|
eligibleForTrial?: EligibleForTrial[] | null;
|
|
291
291
|
experimentInfo?: ExperimentInfo | null;
|
|
292
|
+
/**
|
|
293
|
+
* @deprecated *Optional* `customer level getActiveSubscriptions` is now deprecated. Use native getActiveSubscriptions instead.
|
|
294
|
+
*/
|
|
292
295
|
getActiveSubscriptions(): Subscription[];
|
|
293
296
|
getActivePromotionalEntitlements(): PromotionalEntitlement[];
|
|
294
297
|
getActiveTrials(): Subscription[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomerFragment, EntitlementFragment, GetPaywallQuery, SubscriptionPreviewFragment, EntitlementCheckResult, EntitlementResetPeriod as ApiEntitlementResetPeriod, FeatureType as ApiFeatureType, GetCouponsQuery, GetMockPaywallQuery, CustomerResourceFragment, CustomerPortalFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
-
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, CustomerPortal, CustomerResource, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, Money, NumericEntitlement, NumericEntitlementFallback, Paywall, Plan, SubscriptionPreview, SubscriptionPreviewDiscount } from '../models';
|
|
1
|
+
import { CustomerFragment, EntitlementFragment, GetPaywallQuery, SubscriptionFragment, SubscriptionPreviewFragment, EntitlementCheckResult, EntitlementResetPeriod as ApiEntitlementResetPeriod, FeatureType as ApiFeatureType, GetCouponsQuery, GetMockPaywallQuery, CustomerResourceFragment, CustomerPortalFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
+
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, CustomerPortal, CustomerResource, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, Money, NumericEntitlement, NumericEntitlementFallback, Paywall, Plan, Subscription, SubscriptionPreview, SubscriptionPreviewDiscount } from '../models';
|
|
3
3
|
import CachedEntitlement from '../services/cachedEntitlement';
|
|
4
4
|
import { Decision } from '../services/entitlementDecisionService';
|
|
5
5
|
export declare class ModelMapper {
|
|
@@ -42,4 +42,7 @@ export declare class ModelMapper {
|
|
|
42
42
|
currency: string;
|
|
43
43
|
}): Money;
|
|
44
44
|
private mapCoupon;
|
|
45
|
+
mapSubscriptions(activeSubscriptions: Array<{
|
|
46
|
+
__typename?: 'CustomerSubscription';
|
|
47
|
+
} & SubscriptionFragment>): Subscription[];
|
|
45
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CustomerFragment, EntitlementFragment, GetPaywallQuery, SubscriptionPreviewFragment, EntitlementCheckResult, EntitlementResetPeriod as ApiEntitlementResetPeriod, FeatureType as ApiFeatureType, GetCouponsQuery, GetMockPaywallQuery, CustomerResourceFragment, CustomerPortalFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
-
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, CustomerPortal, CustomerResource, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, Money, NumericEntitlement, NumericEntitlementFallback, Paywall, Plan, SubscriptionPreview, SubscriptionPreviewDiscount } from '../models';
|
|
1
|
+
import { CustomerFragment, EntitlementFragment, GetPaywallQuery, SubscriptionFragment, SubscriptionPreviewFragment, EntitlementCheckResult, EntitlementResetPeriod as ApiEntitlementResetPeriod, FeatureType as ApiFeatureType, GetCouponsQuery, GetMockPaywallQuery, CustomerResourceFragment, CustomerPortalFragment } from '@stigg/api-client-js/src/generated/sdk';
|
|
2
|
+
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, CustomerPortal, CustomerResource, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, Money, NumericEntitlement, NumericEntitlementFallback, Paywall, Plan, Subscription, SubscriptionPreview, SubscriptionPreviewDiscount } from '../models';
|
|
3
3
|
import CachedEntitlement from '../services/cachedEntitlement';
|
|
4
4
|
import { Decision } from '../services/entitlementDecisionService';
|
|
5
5
|
export declare class ModelMapper {
|
|
@@ -42,4 +42,7 @@ export declare class ModelMapper {
|
|
|
42
42
|
currency: string;
|
|
43
43
|
}): Money;
|
|
44
44
|
private mapCoupon;
|
|
45
|
+
mapSubscriptions(activeSubscriptions: Array<{
|
|
46
|
+
__typename?: 'CustomerSubscription';
|
|
47
|
+
} & SubscriptionFragment>): Subscription[];
|
|
45
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigg/js-client-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.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.395.0",
|
|
32
32
|
"axios": "^1.2.2",
|
|
33
33
|
"cross-fetch": "^3.1.4",
|
|
34
34
|
"husky": "^7.0.4",
|