@stigg/js-client-sdk 0.54.0 → 0.55.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/PaywallApi.d.ts +1 -0
- package/dist/api/generated/types.d.ts +63 -0
- package/dist/client.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +8 -1
- package/dist/utils/ModelMapper.d.ts +3 -2
- package/package.json +1 -1
package/dist/models.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PackageEntitlementFragment } from './api/generated/types';
|
|
1
|
+
import { BillingModel, BillingPeriod, Currency, PricingType, PromotionalEntitlementStatus, SubscriptionStatus, TrialPeriodUnits, ExperimentGroupType, CustomerPortalEntitlementFragment, CustomerPortalPromotionalEntitlementFragment, CustomerPortalSubscriptionFragment, CustomerPortalSubscriptionAddonFragment, CustomerPortalBillingInformationFragment, PackageEntitlementFragment, PaywallConfigurationFragment, CustomerPortalConfigurationFragment } from './api/generated/types';
|
|
2
2
|
export { PricingType, SubscriptionStatus, PromotionalEntitlementStatus, Currency, BillingPeriod, BillingModel, TrialPeriodUnits, ExperimentGroupType, WidgetType, } from './api/generated/types';
|
|
3
3
|
interface Metadata {
|
|
4
4
|
[key: string]: string;
|
|
@@ -223,6 +223,7 @@ export declare type CustomerPortalSubscriptionAddon = Omit<CustomerPortalSubscri
|
|
|
223
223
|
export declare type CustomerPortalSubscription = Omit<CustomerPortalSubscriptionFragment, '__typename'>;
|
|
224
224
|
export declare type CustomerPortalEntitlement = Omit<CustomerPortalEntitlementFragment, '__typename'>;
|
|
225
225
|
export declare type CustomerPortalPromotionalEntitlement = Omit<CustomerPortalPromotionalEntitlementFragment, '__typename'>;
|
|
226
|
+
export declare type CustomerPortalConfiguration = Omit<CustomerPortalConfigurationFragment, '__typename'>;
|
|
226
227
|
export declare type CustomerPortal = {
|
|
227
228
|
subscriptions: CustomerPortalSubscription[];
|
|
228
229
|
entitlements: CustomerPortalEntitlement[];
|
|
@@ -231,6 +232,12 @@ export declare type CustomerPortal = {
|
|
|
231
232
|
showWatermark: boolean;
|
|
232
233
|
canUpgradeSubscription: boolean;
|
|
233
234
|
billingPortalUrl?: string | null;
|
|
235
|
+
configuration?: CustomerPortalConfiguration;
|
|
236
|
+
};
|
|
237
|
+
export declare type PaywallConfiguration = Omit<PaywallConfigurationFragment, '__typename'>;
|
|
238
|
+
export declare type Paywall = {
|
|
239
|
+
plans: Plan[];
|
|
240
|
+
configuration: PaywallConfiguration;
|
|
234
241
|
};
|
|
235
242
|
export declare type Customer = {
|
|
236
243
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomerFragment, EntitlementCheckResult, EntitlementFragment, EntitlementResetPeriod as ApiEntitlementResetPeriod, FeatureType as ApiFeatureType, FetchCouponsQuery, GetMockPaywallQuery, GetPaywallQuery } from '../api/generated/types';
|
|
2
|
-
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, NumericEntitlement, NumericEntitlementFallback, Plan } from '../models';
|
|
2
|
+
import { BooleanEntitlement, BooleanEntitlementFallback, Coupon, Customer, EntitlementResetPeriod, FeatureType, MeteredEntitlement, MeteredEntitlementFallback, NumericEntitlement, NumericEntitlementFallback, Paywall, Plan } from '../models';
|
|
3
3
|
import CachedEntitlement from '../services/cachedEntitlement';
|
|
4
4
|
import { Decision } from '../services/entitlementDecisionService';
|
|
5
5
|
export declare class ModelMapper {
|
|
@@ -13,7 +13,8 @@ export declare class ModelMapper {
|
|
|
13
13
|
mapCachedEntitlement(entitlement: EntitlementFragment, currentUsage?: number, nextResetDate?: number | null): CachedEntitlement;
|
|
14
14
|
mapCachedEntitlements(updatedEntitlements: EntitlementFragment[]): Map<string, CachedEntitlement>;
|
|
15
15
|
mapPlans(resultData: GetPaywallQuery): Plan[];
|
|
16
|
-
|
|
16
|
+
mapPaywall(resultData: GetPaywallQuery): Paywall;
|
|
17
|
+
mapMockPlans(resultData: GetMockPaywallQuery): Paywall;
|
|
17
18
|
mapCoupons(resultData: FetchCouponsQuery): Coupon[];
|
|
18
19
|
mapCustomer(customer: CustomerFragment): Customer;
|
|
19
20
|
private mapTotalPrice;
|