@stigg/js-client-sdk 1.1.1 → 1.3.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/MockPaywallApi.d.ts +3 -1
- package/dist/api/PaywallApi.d.ts +7 -2
- package/dist/api/fragments/customerFragment.d.ts +1 -0
- package/dist/api/generated/types.d.ts +239 -193
- package/dist/api/initApolloClient.d.ts +4 -2
- package/dist/client.d.ts +3 -3
- package/dist/configuration.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +4 -1
- package/package.json +2 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
2
|
import { GetMockPaywallQuery } from './generated/types';
|
|
3
|
+
import { GetPaywallProps } from './PaywallApi';
|
|
4
|
+
declare type GetMockPaywallProps = GetPaywallProps;
|
|
3
5
|
declare class MockPaywallApi {
|
|
4
6
|
private readonly client;
|
|
5
7
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
6
|
-
getMockPaywall(productId
|
|
8
|
+
getMockPaywall({ productId, customerId, context }: GetMockPaywallProps): Promise<import("@apollo/client/core").ApolloQueryResult<GetMockPaywallQuery>>;
|
|
7
9
|
}
|
|
8
10
|
export default MockPaywallApi;
|
package/dist/api/PaywallApi.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { GetPaywallQuery } from './generated/types';
|
|
2
|
+
import { GetPaywallQuery, WidgetType } from './generated/types';
|
|
3
3
|
export declare const TYPOGRAPHY_CONFIGURATION: import("graphql/language/ast").DocumentNode;
|
|
4
4
|
export declare const PAYWALL_CONFIGURATION: import("graphql/language/ast").DocumentNode;
|
|
5
|
+
export declare type GetPaywallProps = {
|
|
6
|
+
productId?: string;
|
|
7
|
+
customerId?: string | null;
|
|
8
|
+
context?: WidgetType;
|
|
9
|
+
};
|
|
5
10
|
declare class PaywallApi {
|
|
6
11
|
private readonly client;
|
|
7
12
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
8
|
-
getPaywall(productId
|
|
13
|
+
getPaywall({ productId, customerId, context }: GetPaywallProps): Promise<import("@apollo/client/core").ApolloQueryResult<GetPaywallQuery>>;
|
|
9
14
|
}
|
|
10
15
|
export default PaywallApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CUSTOMER_FRAGMENT: import("graphql/language/ast").DocumentNode;
|
|
@@ -34,6 +34,10 @@ export declare enum AccessDeniedReason {
|
|
|
34
34
|
RequestedUsageExceedingLimit = "RequestedUsageExceedingLimit",
|
|
35
35
|
Unknown = "Unknown"
|
|
36
36
|
}
|
|
37
|
+
export declare enum AccountStatus {
|
|
38
|
+
Active = "ACTIVE",
|
|
39
|
+
Blocked = "BLOCKED"
|
|
40
|
+
}
|
|
37
41
|
export declare type AddCompatibleAddonsToPlanInput = {
|
|
38
42
|
/** The id of the record. */
|
|
39
43
|
id: Scalars['String'];
|
|
@@ -46,6 +50,7 @@ export declare type AddonCreateInput = {
|
|
|
46
50
|
description?: InputMaybe<Scalars['String']>;
|
|
47
51
|
displayName: Scalars['String'];
|
|
48
52
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
53
|
+
hiddenFromWidgets?: InputMaybe<Array<WidgetType>>;
|
|
49
54
|
productId: Scalars['String'];
|
|
50
55
|
refId?: InputMaybe<Scalars['String']>;
|
|
51
56
|
status?: InputMaybe<PackageStatus>;
|
|
@@ -92,6 +97,7 @@ export declare type AddonUpdateInput = {
|
|
|
92
97
|
billingId?: InputMaybe<Scalars['String']>;
|
|
93
98
|
description?: InputMaybe<Scalars['String']>;
|
|
94
99
|
displayName: Scalars['String'];
|
|
100
|
+
hiddenFromWidgets?: InputMaybe<Array<WidgetType>>;
|
|
95
101
|
id: Scalars['String'];
|
|
96
102
|
status?: InputMaybe<PackageStatus>;
|
|
97
103
|
};
|
|
@@ -203,6 +209,7 @@ export declare type CheckoutOptions = {
|
|
|
203
209
|
allowPromoCodes?: InputMaybe<Scalars['Boolean']>;
|
|
204
210
|
cancelUrl: Scalars['String'];
|
|
205
211
|
collectBillingAddress?: InputMaybe<Scalars['Boolean']>;
|
|
212
|
+
referenceId?: InputMaybe<Scalars['String']>;
|
|
206
213
|
successUrl: Scalars['String'];
|
|
207
214
|
};
|
|
208
215
|
export declare type CouponFilter = {
|
|
@@ -709,6 +716,7 @@ export declare enum ErrorCode {
|
|
|
709
716
|
CheckoutIsNotSupported = "CheckoutIsNotSupported",
|
|
710
717
|
CheckoutOptionsMissing = "CheckoutOptionsMissing",
|
|
711
718
|
CouponNotFound = "CouponNotFound",
|
|
719
|
+
CustomerAlreadyHaveCustomerCoupon = "CustomerAlreadyHaveCustomerCoupon",
|
|
712
720
|
CustomerAlreadyUsesCoupon = "CustomerAlreadyUsesCoupon",
|
|
713
721
|
CustomerHasNoPaymentMethod = "CustomerHasNoPaymentMethod",
|
|
714
722
|
CustomerNoBillingId = "CustomerNoBillingId",
|
|
@@ -753,6 +761,12 @@ export declare enum ErrorCode {
|
|
|
753
761
|
PlanWithChildCantBeDeleted = "PlanWithChildCantBeDeleted",
|
|
754
762
|
PlansCircularDependencyError = "PlansCircularDependencyError",
|
|
755
763
|
PriceNotFound = "PriceNotFound",
|
|
764
|
+
PromotionCodeCustomerNotFirstPurchase = "PromotionCodeCustomerNotFirstPurchase",
|
|
765
|
+
PromotionCodeMaxRedemptionsReached = "PromotionCodeMaxRedemptionsReached",
|
|
766
|
+
PromotionCodeMinimumAmountNotReached = "PromotionCodeMinimumAmountNotReached",
|
|
767
|
+
PromotionCodeNotActive = "PromotionCodeNotActive",
|
|
768
|
+
PromotionCodeNotForCustomer = "PromotionCodeNotForCustomer",
|
|
769
|
+
PromotionCodeNotFound = "PromotionCodeNotFound",
|
|
756
770
|
RateLimitExceeded = "RateLimitExceeded",
|
|
757
771
|
ResyncAlreadyInProgress = "ResyncAlreadyInProgress",
|
|
758
772
|
SelectedBillingModelDoesntMatchImportedItemError = "SelectedBillingModelDoesntMatchImportedItemError",
|
|
@@ -775,13 +789,15 @@ export declare type EstimateSubscriptionInput = {
|
|
|
775
789
|
billingPeriod?: InputMaybe<BillingPeriod>;
|
|
776
790
|
customerId: Scalars['String'];
|
|
777
791
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
778
|
-
planId
|
|
792
|
+
planId: Scalars['String'];
|
|
779
793
|
priceUnitAmount?: InputMaybe<Scalars['Float']>;
|
|
794
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
780
795
|
startDate?: InputMaybe<Scalars['DateTime']>;
|
|
781
796
|
};
|
|
782
797
|
export declare type EstimateSubscriptionUpdateInput = {
|
|
783
798
|
addons?: InputMaybe<Array<SubscriptionAddonInput>>;
|
|
784
799
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
800
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
785
801
|
subscriptionId: Scalars['String'];
|
|
786
802
|
unitQuantity?: InputMaybe<Scalars['Float']>;
|
|
787
803
|
};
|
|
@@ -1000,12 +1016,18 @@ export declare enum FontWeight {
|
|
|
1000
1016
|
Bold = "BOLD",
|
|
1001
1017
|
Normal = "NORMAL"
|
|
1002
1018
|
}
|
|
1019
|
+
export declare type GetCustomerByRefIdInput = {
|
|
1020
|
+
customerId: Scalars['String'];
|
|
1021
|
+
environmentId?: InputMaybe<Scalars['String']>;
|
|
1022
|
+
};
|
|
1003
1023
|
export declare type GetPackageByRefIdInput = {
|
|
1004
1024
|
environmentId: Scalars['String'];
|
|
1005
1025
|
refId: Scalars['String'];
|
|
1006
1026
|
versionNumber?: InputMaybe<Scalars['Float']>;
|
|
1007
1027
|
};
|
|
1008
1028
|
export declare type GetPaywallInput = {
|
|
1029
|
+
context?: InputMaybe<WidgetType>;
|
|
1030
|
+
customerId?: InputMaybe<Scalars['String']>;
|
|
1009
1031
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
1010
1032
|
productId?: InputMaybe<Scalars['String']>;
|
|
1011
1033
|
};
|
|
@@ -1406,6 +1428,7 @@ export declare type PlanCreateInput = {
|
|
|
1406
1428
|
description?: InputMaybe<Scalars['String']>;
|
|
1407
1429
|
displayName: Scalars['String'];
|
|
1408
1430
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
1431
|
+
hiddenFromWidgets?: InputMaybe<Array<WidgetType>>;
|
|
1409
1432
|
parentPlanId?: InputMaybe<Scalars['String']>;
|
|
1410
1433
|
productId: Scalars['String'];
|
|
1411
1434
|
refId?: InputMaybe<Scalars['String']>;
|
|
@@ -1485,6 +1508,7 @@ export declare type PlanUpdateInput = {
|
|
|
1485
1508
|
defaultTrialConfig?: InputMaybe<DefaultTrialConfigInputDto>;
|
|
1486
1509
|
description?: InputMaybe<Scalars['String']>;
|
|
1487
1510
|
displayName?: InputMaybe<Scalars['String']>;
|
|
1511
|
+
hiddenFromWidgets?: InputMaybe<Array<WidgetType>>;
|
|
1488
1512
|
id: Scalars['String'];
|
|
1489
1513
|
parentPlanId?: InputMaybe<Scalars['String']>;
|
|
1490
1514
|
status?: InputMaybe<PackageStatus>;
|
|
@@ -1683,6 +1707,10 @@ export declare type PromotionalEntitlementUpdateInput = {
|
|
|
1683
1707
|
usageLimit?: InputMaybe<Scalars['Float']>;
|
|
1684
1708
|
weeklyResetPeriodConfiguration?: InputMaybe<WeeklyResetPeriodConfigInput>;
|
|
1685
1709
|
};
|
|
1710
|
+
export declare enum ProrationBehavior {
|
|
1711
|
+
CreateProrations = "CREATE_PRORATIONS",
|
|
1712
|
+
InvoiceImmediately = "INVOICE_IMMEDIATELY"
|
|
1713
|
+
}
|
|
1686
1714
|
export declare type ProvisionCustomerInput = {
|
|
1687
1715
|
additionalMetaData?: InputMaybe<Scalars['JSON']>;
|
|
1688
1716
|
billingId?: InputMaybe<Scalars['String']>;
|
|
@@ -1705,8 +1733,9 @@ export declare type ProvisionCustomerSubscriptionInput = {
|
|
|
1705
1733
|
awaitPaymentConfirmation?: InputMaybe<Scalars['Boolean']>;
|
|
1706
1734
|
billingInformation?: InputMaybe<SubscriptionBillingInfo>;
|
|
1707
1735
|
billingPeriod?: InputMaybe<BillingPeriod>;
|
|
1708
|
-
planId
|
|
1736
|
+
planId: Scalars['String'];
|
|
1709
1737
|
priceUnitAmount?: InputMaybe<Scalars['Float']>;
|
|
1738
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
1710
1739
|
refId?: InputMaybe<Scalars['String']>;
|
|
1711
1740
|
startDate?: InputMaybe<Scalars['DateTime']>;
|
|
1712
1741
|
subscriptionId?: InputMaybe<Scalars['String']>;
|
|
@@ -1719,8 +1748,25 @@ export declare type ProvisionSubscription = {
|
|
|
1719
1748
|
billingPeriod?: InputMaybe<BillingPeriod>;
|
|
1720
1749
|
checkoutOptions?: InputMaybe<CheckoutOptions>;
|
|
1721
1750
|
customerId: Scalars['String'];
|
|
1722
|
-
planId
|
|
1751
|
+
planId: Scalars['String'];
|
|
1723
1752
|
priceUnitAmount?: InputMaybe<Scalars['Float']>;
|
|
1753
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
1754
|
+
refId?: InputMaybe<Scalars['String']>;
|
|
1755
|
+
skipTrial?: InputMaybe<Scalars['Boolean']>;
|
|
1756
|
+
startDate?: InputMaybe<Scalars['DateTime']>;
|
|
1757
|
+
subscriptionId?: InputMaybe<Scalars['String']>;
|
|
1758
|
+
};
|
|
1759
|
+
export declare type ProvisionSubscriptionInput = {
|
|
1760
|
+
additionalMetaData?: InputMaybe<Scalars['JSON']>;
|
|
1761
|
+
addons?: InputMaybe<Array<SubscriptionAddonInput>>;
|
|
1762
|
+
awaitPaymentConfirmation?: InputMaybe<Scalars['Boolean']>;
|
|
1763
|
+
billingInformation?: InputMaybe<SubscriptionBillingInfo>;
|
|
1764
|
+
billingPeriod?: InputMaybe<BillingPeriod>;
|
|
1765
|
+
checkoutOptions?: InputMaybe<CheckoutOptions>;
|
|
1766
|
+
customerId: Scalars['String'];
|
|
1767
|
+
planId: Scalars['String'];
|
|
1768
|
+
priceUnitAmount?: InputMaybe<Scalars['Float']>;
|
|
1769
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
1724
1770
|
refId?: InputMaybe<Scalars['String']>;
|
|
1725
1771
|
skipTrial?: InputMaybe<Scalars['Boolean']>;
|
|
1726
1772
|
startDate?: InputMaybe<Scalars['DateTime']>;
|
|
@@ -2007,8 +2053,9 @@ export declare type SubscriptionInput = {
|
|
|
2007
2053
|
isCustomPriceSubscription?: InputMaybe<Scalars['Boolean']>;
|
|
2008
2054
|
isOverridingTrialConfig?: InputMaybe<Scalars['Boolean']>;
|
|
2009
2055
|
isTrial?: InputMaybe<Scalars['Boolean']>;
|
|
2010
|
-
planId
|
|
2056
|
+
planId: Scalars['String'];
|
|
2011
2057
|
priceUnitAmount?: InputMaybe<Scalars['Float']>;
|
|
2058
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
2012
2059
|
refId?: InputMaybe<Scalars['String']>;
|
|
2013
2060
|
startDate?: InputMaybe<Scalars['DateTime']>;
|
|
2014
2061
|
subscriptionId?: InputMaybe<Scalars['String']>;
|
|
@@ -2193,6 +2240,7 @@ export declare type UpdateAccountInput = {
|
|
|
2193
2240
|
displayName: Scalars['String'];
|
|
2194
2241
|
id: Scalars['String'];
|
|
2195
2242
|
subscriptionBillingAnchor?: InputMaybe<BillingAnchor>;
|
|
2243
|
+
subscriptionProrationBehavior?: InputMaybe<ProrationBehavior>;
|
|
2196
2244
|
timezone?: InputMaybe<Scalars['String']>;
|
|
2197
2245
|
};
|
|
2198
2246
|
export declare type UpdateCouponInput = {
|
|
@@ -2325,6 +2373,7 @@ export declare type UpdateSubscriptionInput = {
|
|
|
2325
2373
|
additionalMetaData?: InputMaybe<Scalars['JSON']>;
|
|
2326
2374
|
addons?: InputMaybe<Array<SubscriptionAddonInput>>;
|
|
2327
2375
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
2376
|
+
promotionCode?: InputMaybe<Scalars['String']>;
|
|
2328
2377
|
refId?: InputMaybe<Scalars['String']>;
|
|
2329
2378
|
subscriptionId?: InputMaybe<Scalars['String']>;
|
|
2330
2379
|
trialEndDate?: InputMaybe<Scalars['DateTime']>;
|
|
@@ -2492,185 +2541,6 @@ export declare type FetchCouponsQuery = {
|
|
|
2492
2541
|
}>;
|
|
2493
2542
|
};
|
|
2494
2543
|
};
|
|
2495
|
-
export declare type TotalPriceFragment = {
|
|
2496
|
-
__typename?: 'CustomerSubscriptionTotalPrice';
|
|
2497
|
-
subTotal: {
|
|
2498
|
-
__typename?: 'Money';
|
|
2499
|
-
amount: number;
|
|
2500
|
-
currency: Currency;
|
|
2501
|
-
};
|
|
2502
|
-
total: {
|
|
2503
|
-
__typename?: 'Money';
|
|
2504
|
-
amount: number;
|
|
2505
|
-
currency: Currency;
|
|
2506
|
-
};
|
|
2507
|
-
};
|
|
2508
|
-
export declare type SubscriptionFragment = {
|
|
2509
|
-
__typename?: 'CustomerSubscription';
|
|
2510
|
-
id: string;
|
|
2511
|
-
startDate: any;
|
|
2512
|
-
endDate?: any | null | undefined;
|
|
2513
|
-
trialEndDate?: any | null | undefined;
|
|
2514
|
-
cancellationDate?: any | null | undefined;
|
|
2515
|
-
effectiveEndDate?: any | null | undefined;
|
|
2516
|
-
status: SubscriptionStatus;
|
|
2517
|
-
refId: string;
|
|
2518
|
-
currentBillingPeriodEnd?: any | null | undefined;
|
|
2519
|
-
additionalMetaData?: any | null | undefined;
|
|
2520
|
-
pricingType: PricingType;
|
|
2521
|
-
experimentInfo?: {
|
|
2522
|
-
__typename?: 'experimentInfo';
|
|
2523
|
-
name: string;
|
|
2524
|
-
groupName: string;
|
|
2525
|
-
groupType: ExperimentGroupType;
|
|
2526
|
-
id: string;
|
|
2527
|
-
} | null | undefined;
|
|
2528
|
-
prices?: Array<{
|
|
2529
|
-
__typename?: 'SubscriptionPrice';
|
|
2530
|
-
usageLimit?: number | null | undefined;
|
|
2531
|
-
price?: ({
|
|
2532
|
-
__typename?: 'Price';
|
|
2533
|
-
} & PriceFragment) | null | undefined;
|
|
2534
|
-
}> | null | undefined;
|
|
2535
|
-
totalPrice?: ({
|
|
2536
|
-
__typename?: 'CustomerSubscriptionTotalPrice';
|
|
2537
|
-
} & TotalPriceFragment) | null | undefined;
|
|
2538
|
-
plan: {
|
|
2539
|
-
__typename?: 'Plan';
|
|
2540
|
-
id: string;
|
|
2541
|
-
refId: string;
|
|
2542
|
-
displayName: string;
|
|
2543
|
-
description?: string | null | undefined;
|
|
2544
|
-
additionalMetaData?: any | null | undefined;
|
|
2545
|
-
product: {
|
|
2546
|
-
__typename?: 'Product';
|
|
2547
|
-
refId: string;
|
|
2548
|
-
displayName?: string | null | undefined;
|
|
2549
|
-
};
|
|
2550
|
-
entitlements?: Array<{
|
|
2551
|
-
__typename?: 'PackageEntitlement';
|
|
2552
|
-
usageLimit?: number | null | undefined;
|
|
2553
|
-
featureId: string;
|
|
2554
|
-
hasUnlimitedUsage?: boolean | null | undefined;
|
|
2555
|
-
packageId: string;
|
|
2556
|
-
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2557
|
-
feature: {
|
|
2558
|
-
__typename?: 'Feature';
|
|
2559
|
-
featureType: FeatureType;
|
|
2560
|
-
meterType?: MeterType | null | undefined;
|
|
2561
|
-
featureUnits?: string | null | undefined;
|
|
2562
|
-
featureUnitsPlural?: string | null | undefined;
|
|
2563
|
-
displayName: string;
|
|
2564
|
-
description?: string | null | undefined;
|
|
2565
|
-
refId: string;
|
|
2566
|
-
};
|
|
2567
|
-
}> | null | undefined;
|
|
2568
|
-
inheritedEntitlements?: Array<{
|
|
2569
|
-
__typename?: 'PackageEntitlement';
|
|
2570
|
-
usageLimit?: number | null | undefined;
|
|
2571
|
-
featureId: string;
|
|
2572
|
-
hasUnlimitedUsage?: boolean | null | undefined;
|
|
2573
|
-
packageId: string;
|
|
2574
|
-
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2575
|
-
feature: {
|
|
2576
|
-
__typename?: 'Feature';
|
|
2577
|
-
featureType: FeatureType;
|
|
2578
|
-
meterType?: MeterType | null | undefined;
|
|
2579
|
-
featureUnits?: string | null | undefined;
|
|
2580
|
-
featureUnitsPlural?: string | null | undefined;
|
|
2581
|
-
displayName: string;
|
|
2582
|
-
description?: string | null | undefined;
|
|
2583
|
-
refId: string;
|
|
2584
|
-
};
|
|
2585
|
-
}> | null | undefined;
|
|
2586
|
-
prices?: Array<{
|
|
2587
|
-
__typename?: 'Price';
|
|
2588
|
-
} & PriceFragment> | null | undefined;
|
|
2589
|
-
};
|
|
2590
|
-
addons?: Array<{
|
|
2591
|
-
__typename?: 'SubscriptionAddon';
|
|
2592
|
-
id: string;
|
|
2593
|
-
quantity: number;
|
|
2594
|
-
addon: {
|
|
2595
|
-
__typename?: 'Addon';
|
|
2596
|
-
id: string;
|
|
2597
|
-
refId: string;
|
|
2598
|
-
displayName: string;
|
|
2599
|
-
description?: string | null | undefined;
|
|
2600
|
-
additionalMetaData?: any | null | undefined;
|
|
2601
|
-
entitlements?: Array<{
|
|
2602
|
-
__typename?: 'PackageEntitlement';
|
|
2603
|
-
usageLimit?: number | null | undefined;
|
|
2604
|
-
hasUnlimitedUsage?: boolean | null | undefined;
|
|
2605
|
-
featureId: string;
|
|
2606
|
-
feature: {
|
|
2607
|
-
__typename?: 'Feature';
|
|
2608
|
-
featureType: FeatureType;
|
|
2609
|
-
meterType?: MeterType | null | undefined;
|
|
2610
|
-
featureUnits?: string | null | undefined;
|
|
2611
|
-
featureUnitsPlural?: string | null | undefined;
|
|
2612
|
-
displayName: string;
|
|
2613
|
-
description?: string | null | undefined;
|
|
2614
|
-
refId: string;
|
|
2615
|
-
};
|
|
2616
|
-
}> | null | undefined;
|
|
2617
|
-
};
|
|
2618
|
-
}> | null | undefined;
|
|
2619
|
-
};
|
|
2620
|
-
export declare type PromotionalEntitlementFragment = {
|
|
2621
|
-
__typename?: 'PromotionalEntitlement';
|
|
2622
|
-
status: PromotionalEntitlementStatus;
|
|
2623
|
-
usageLimit?: number | null | undefined;
|
|
2624
|
-
featureId: string;
|
|
2625
|
-
hasUnlimitedUsage?: boolean | null | undefined;
|
|
2626
|
-
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2627
|
-
endDate?: any | null | undefined;
|
|
2628
|
-
isVisible: boolean;
|
|
2629
|
-
feature: {
|
|
2630
|
-
__typename?: 'Feature';
|
|
2631
|
-
featureType: FeatureType;
|
|
2632
|
-
meterType?: MeterType | null | undefined;
|
|
2633
|
-
featureUnits?: string | null | undefined;
|
|
2634
|
-
featureUnitsPlural?: string | null | undefined;
|
|
2635
|
-
displayName: string;
|
|
2636
|
-
description?: string | null | undefined;
|
|
2637
|
-
refId: string;
|
|
2638
|
-
};
|
|
2639
|
-
};
|
|
2640
|
-
export declare type CustomerFragment = {
|
|
2641
|
-
__typename?: 'Customer';
|
|
2642
|
-
id: string;
|
|
2643
|
-
name?: string | null | undefined;
|
|
2644
|
-
email?: string | null | undefined;
|
|
2645
|
-
createdAt?: any | null | undefined;
|
|
2646
|
-
updatedAt: any;
|
|
2647
|
-
hasPaymentMethod: boolean;
|
|
2648
|
-
refId: string;
|
|
2649
|
-
additionalMetaData?: any | null | undefined;
|
|
2650
|
-
defaultPaymentExpirationMonth?: number | null | undefined;
|
|
2651
|
-
defaultPaymentExpirationYear?: number | null | undefined;
|
|
2652
|
-
defaultPaymentMethodLast4Digits?: string | null | undefined;
|
|
2653
|
-
experimentInfo?: {
|
|
2654
|
-
__typename?: 'experimentInfo';
|
|
2655
|
-
name: string;
|
|
2656
|
-
groupType: ExperimentGroupType;
|
|
2657
|
-
groupName: string;
|
|
2658
|
-
id: string;
|
|
2659
|
-
} | null | undefined;
|
|
2660
|
-
trialedPlans?: Array<{
|
|
2661
|
-
__typename?: 'TrialedPlan';
|
|
2662
|
-
productId?: string | null | undefined;
|
|
2663
|
-
productRefId?: string | null | undefined;
|
|
2664
|
-
planRefId?: string | null | undefined;
|
|
2665
|
-
planId?: string | null | undefined;
|
|
2666
|
-
}> | null | undefined;
|
|
2667
|
-
promotionalEntitlements: Array<{
|
|
2668
|
-
__typename?: 'PromotionalEntitlement';
|
|
2669
|
-
} & PromotionalEntitlementFragment>;
|
|
2670
|
-
subscriptions?: Array<{
|
|
2671
|
-
__typename?: 'CustomerSubscription';
|
|
2672
|
-
} & SubscriptionFragment> | null | undefined;
|
|
2673
|
-
};
|
|
2674
2544
|
export declare type CustomerPortalEntitlementFragment = {
|
|
2675
2545
|
__typename?: 'Entitlement';
|
|
2676
2546
|
isGranted: boolean;
|
|
@@ -2799,19 +2669,13 @@ export declare type CustomerPortalFragment = {
|
|
|
2799
2669
|
} & CustomerPortalConfigurationFragment) | null | undefined;
|
|
2800
2670
|
};
|
|
2801
2671
|
export declare type GetCustomerByRefIdQueryVariables = Exact<{
|
|
2802
|
-
|
|
2672
|
+
input: GetCustomerByRefIdInput;
|
|
2803
2673
|
}>;
|
|
2804
2674
|
export declare type GetCustomerByRefIdQuery = {
|
|
2805
2675
|
__typename?: 'Query';
|
|
2806
|
-
|
|
2807
|
-
__typename?: '
|
|
2808
|
-
|
|
2809
|
-
__typename?: 'CustomerEdge';
|
|
2810
|
-
node: {
|
|
2811
|
-
__typename?: 'Customer';
|
|
2812
|
-
} & CustomerFragment;
|
|
2813
|
-
}>;
|
|
2814
|
-
};
|
|
2676
|
+
getCustomerByRefId?: ({
|
|
2677
|
+
__typename?: 'Customer';
|
|
2678
|
+
} & CustomerFragment) | null | undefined;
|
|
2815
2679
|
};
|
|
2816
2680
|
export declare type GetCustomerPortalByRefIdQueryVariables = Exact<{
|
|
2817
2681
|
input: CustomerPortalInput;
|
|
@@ -3113,6 +2977,9 @@ export declare type GetPaywallQuery = {
|
|
|
3113
2977
|
configuration?: ({
|
|
3114
2978
|
__typename?: 'PaywallConfiguration';
|
|
3115
2979
|
} & PaywallConfigurationFragment) | null | undefined;
|
|
2980
|
+
customer?: ({
|
|
2981
|
+
__typename?: 'Customer';
|
|
2982
|
+
} & CustomerFragment) | null | undefined;
|
|
3116
2983
|
};
|
|
3117
2984
|
};
|
|
3118
2985
|
export declare type SdkConfigurationQueryVariables = Exact<{
|
|
@@ -3126,6 +2993,185 @@ export declare type SdkConfigurationQuery = {
|
|
|
3126
2993
|
isWidgetWatermarkEnabled?: boolean | null | undefined;
|
|
3127
2994
|
} | null | undefined;
|
|
3128
2995
|
};
|
|
2996
|
+
export declare type TotalPriceFragment = {
|
|
2997
|
+
__typename?: 'CustomerSubscriptionTotalPrice';
|
|
2998
|
+
subTotal: {
|
|
2999
|
+
__typename?: 'Money';
|
|
3000
|
+
amount: number;
|
|
3001
|
+
currency: Currency;
|
|
3002
|
+
};
|
|
3003
|
+
total: {
|
|
3004
|
+
__typename?: 'Money';
|
|
3005
|
+
amount: number;
|
|
3006
|
+
currency: Currency;
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
export declare type SubscriptionFragment = {
|
|
3010
|
+
__typename?: 'CustomerSubscription';
|
|
3011
|
+
id: string;
|
|
3012
|
+
startDate: any;
|
|
3013
|
+
endDate?: any | null | undefined;
|
|
3014
|
+
trialEndDate?: any | null | undefined;
|
|
3015
|
+
cancellationDate?: any | null | undefined;
|
|
3016
|
+
effectiveEndDate?: any | null | undefined;
|
|
3017
|
+
status: SubscriptionStatus;
|
|
3018
|
+
refId: string;
|
|
3019
|
+
currentBillingPeriodEnd?: any | null | undefined;
|
|
3020
|
+
additionalMetaData?: any | null | undefined;
|
|
3021
|
+
pricingType: PricingType;
|
|
3022
|
+
experimentInfo?: {
|
|
3023
|
+
__typename?: 'experimentInfo';
|
|
3024
|
+
name: string;
|
|
3025
|
+
groupName: string;
|
|
3026
|
+
groupType: ExperimentGroupType;
|
|
3027
|
+
id: string;
|
|
3028
|
+
} | null | undefined;
|
|
3029
|
+
prices?: Array<{
|
|
3030
|
+
__typename?: 'SubscriptionPrice';
|
|
3031
|
+
usageLimit?: number | null | undefined;
|
|
3032
|
+
price?: ({
|
|
3033
|
+
__typename?: 'Price';
|
|
3034
|
+
} & PriceFragment) | null | undefined;
|
|
3035
|
+
}> | null | undefined;
|
|
3036
|
+
totalPrice?: ({
|
|
3037
|
+
__typename?: 'CustomerSubscriptionTotalPrice';
|
|
3038
|
+
} & TotalPriceFragment) | null | undefined;
|
|
3039
|
+
plan: {
|
|
3040
|
+
__typename?: 'Plan';
|
|
3041
|
+
id: string;
|
|
3042
|
+
refId: string;
|
|
3043
|
+
displayName: string;
|
|
3044
|
+
description?: string | null | undefined;
|
|
3045
|
+
additionalMetaData?: any | null | undefined;
|
|
3046
|
+
product: {
|
|
3047
|
+
__typename?: 'Product';
|
|
3048
|
+
refId: string;
|
|
3049
|
+
displayName?: string | null | undefined;
|
|
3050
|
+
};
|
|
3051
|
+
entitlements?: Array<{
|
|
3052
|
+
__typename?: 'PackageEntitlement';
|
|
3053
|
+
usageLimit?: number | null | undefined;
|
|
3054
|
+
featureId: string;
|
|
3055
|
+
hasUnlimitedUsage?: boolean | null | undefined;
|
|
3056
|
+
packageId: string;
|
|
3057
|
+
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
3058
|
+
feature: {
|
|
3059
|
+
__typename?: 'Feature';
|
|
3060
|
+
featureType: FeatureType;
|
|
3061
|
+
meterType?: MeterType | null | undefined;
|
|
3062
|
+
featureUnits?: string | null | undefined;
|
|
3063
|
+
featureUnitsPlural?: string | null | undefined;
|
|
3064
|
+
displayName: string;
|
|
3065
|
+
description?: string | null | undefined;
|
|
3066
|
+
refId: string;
|
|
3067
|
+
};
|
|
3068
|
+
}> | null | undefined;
|
|
3069
|
+
inheritedEntitlements?: Array<{
|
|
3070
|
+
__typename?: 'PackageEntitlement';
|
|
3071
|
+
usageLimit?: number | null | undefined;
|
|
3072
|
+
featureId: string;
|
|
3073
|
+
hasUnlimitedUsage?: boolean | null | undefined;
|
|
3074
|
+
packageId: string;
|
|
3075
|
+
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
3076
|
+
feature: {
|
|
3077
|
+
__typename?: 'Feature';
|
|
3078
|
+
featureType: FeatureType;
|
|
3079
|
+
meterType?: MeterType | null | undefined;
|
|
3080
|
+
featureUnits?: string | null | undefined;
|
|
3081
|
+
featureUnitsPlural?: string | null | undefined;
|
|
3082
|
+
displayName: string;
|
|
3083
|
+
description?: string | null | undefined;
|
|
3084
|
+
refId: string;
|
|
3085
|
+
};
|
|
3086
|
+
}> | null | undefined;
|
|
3087
|
+
prices?: Array<{
|
|
3088
|
+
__typename?: 'Price';
|
|
3089
|
+
} & PriceFragment> | null | undefined;
|
|
3090
|
+
};
|
|
3091
|
+
addons?: Array<{
|
|
3092
|
+
__typename?: 'SubscriptionAddon';
|
|
3093
|
+
id: string;
|
|
3094
|
+
quantity: number;
|
|
3095
|
+
addon: {
|
|
3096
|
+
__typename?: 'Addon';
|
|
3097
|
+
id: string;
|
|
3098
|
+
refId: string;
|
|
3099
|
+
displayName: string;
|
|
3100
|
+
description?: string | null | undefined;
|
|
3101
|
+
additionalMetaData?: any | null | undefined;
|
|
3102
|
+
entitlements?: Array<{
|
|
3103
|
+
__typename?: 'PackageEntitlement';
|
|
3104
|
+
usageLimit?: number | null | undefined;
|
|
3105
|
+
hasUnlimitedUsage?: boolean | null | undefined;
|
|
3106
|
+
featureId: string;
|
|
3107
|
+
feature: {
|
|
3108
|
+
__typename?: 'Feature';
|
|
3109
|
+
featureType: FeatureType;
|
|
3110
|
+
meterType?: MeterType | null | undefined;
|
|
3111
|
+
featureUnits?: string | null | undefined;
|
|
3112
|
+
featureUnitsPlural?: string | null | undefined;
|
|
3113
|
+
displayName: string;
|
|
3114
|
+
description?: string | null | undefined;
|
|
3115
|
+
refId: string;
|
|
3116
|
+
};
|
|
3117
|
+
}> | null | undefined;
|
|
3118
|
+
};
|
|
3119
|
+
}> | null | undefined;
|
|
3120
|
+
};
|
|
3121
|
+
export declare type PromotionalEntitlementFragment = {
|
|
3122
|
+
__typename?: 'PromotionalEntitlement';
|
|
3123
|
+
status: PromotionalEntitlementStatus;
|
|
3124
|
+
usageLimit?: number | null | undefined;
|
|
3125
|
+
featureId: string;
|
|
3126
|
+
hasUnlimitedUsage?: boolean | null | undefined;
|
|
3127
|
+
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
3128
|
+
endDate?: any | null | undefined;
|
|
3129
|
+
isVisible: boolean;
|
|
3130
|
+
feature: {
|
|
3131
|
+
__typename?: 'Feature';
|
|
3132
|
+
featureType: FeatureType;
|
|
3133
|
+
meterType?: MeterType | null | undefined;
|
|
3134
|
+
featureUnits?: string | null | undefined;
|
|
3135
|
+
featureUnitsPlural?: string | null | undefined;
|
|
3136
|
+
displayName: string;
|
|
3137
|
+
description?: string | null | undefined;
|
|
3138
|
+
refId: string;
|
|
3139
|
+
};
|
|
3140
|
+
};
|
|
3141
|
+
export declare type CustomerFragment = {
|
|
3142
|
+
__typename?: 'Customer';
|
|
3143
|
+
id: string;
|
|
3144
|
+
name?: string | null | undefined;
|
|
3145
|
+
email?: string | null | undefined;
|
|
3146
|
+
createdAt?: any | null | undefined;
|
|
3147
|
+
updatedAt: any;
|
|
3148
|
+
hasPaymentMethod: boolean;
|
|
3149
|
+
refId: string;
|
|
3150
|
+
additionalMetaData?: any | null | undefined;
|
|
3151
|
+
defaultPaymentExpirationMonth?: number | null | undefined;
|
|
3152
|
+
defaultPaymentExpirationYear?: number | null | undefined;
|
|
3153
|
+
defaultPaymentMethodLast4Digits?: string | null | undefined;
|
|
3154
|
+
experimentInfo?: {
|
|
3155
|
+
__typename?: 'experimentInfo';
|
|
3156
|
+
name: string;
|
|
3157
|
+
groupType: ExperimentGroupType;
|
|
3158
|
+
groupName: string;
|
|
3159
|
+
id: string;
|
|
3160
|
+
} | null | undefined;
|
|
3161
|
+
trialedPlans?: Array<{
|
|
3162
|
+
__typename?: 'TrialedPlan';
|
|
3163
|
+
productId?: string | null | undefined;
|
|
3164
|
+
productRefId?: string | null | undefined;
|
|
3165
|
+
planRefId?: string | null | undefined;
|
|
3166
|
+
planId?: string | null | undefined;
|
|
3167
|
+
}> | null | undefined;
|
|
3168
|
+
promotionalEntitlements: Array<{
|
|
3169
|
+
__typename?: 'PromotionalEntitlement';
|
|
3170
|
+
} & PromotionalEntitlementFragment>;
|
|
3171
|
+
subscriptions?: Array<{
|
|
3172
|
+
__typename?: 'CustomerSubscription';
|
|
3173
|
+
} & SubscriptionFragment> | null | undefined;
|
|
3174
|
+
};
|
|
3129
3175
|
export declare type PriceFragment = {
|
|
3130
3176
|
__typename?: 'Price';
|
|
3131
3177
|
billingModel: BillingModel;
|
|
@@ -2,7 +2,9 @@ import { ApolloClient } from '@apollo/client/core';
|
|
|
2
2
|
declare type ApolloClientConfiguration = {
|
|
3
3
|
apiKey: string;
|
|
4
4
|
baseUri: string;
|
|
5
|
+
customerId?: string | null;
|
|
6
|
+
customerToken?: string | null;
|
|
5
7
|
};
|
|
6
|
-
declare const initApolloClient: (
|
|
7
|
-
export declare const initBatchedApolloClient: (
|
|
8
|
+
declare const initApolloClient: (config: Partial<ApolloClientConfiguration>) => ApolloClient<import("@apollo/client/core").NormalizedCacheObject>;
|
|
9
|
+
export declare const initBatchedApolloClient: (config: ApolloClientConfiguration) => ApolloClient<import("@apollo/client/core").NormalizedCacheObject>;
|
|
8
10
|
export default initApolloClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface StiggClient {
|
|
|
7
7
|
getBooleanEntitlement: (params: GetBooleanEntitlement) => BooleanEntitlement;
|
|
8
8
|
getNumericEntitlement: (params: GetNumericEntitlement) => NumericEntitlement;
|
|
9
9
|
getMeteredEntitlement: (params: GetMeteredEntitlement) => MeteredEntitlement;
|
|
10
|
-
setCustomerId: (customerId: string) => Promise<void>;
|
|
10
|
+
setCustomerId: (customerId: string, customerToken?: string | null) => Promise<void>;
|
|
11
11
|
clearCustomer: () => void;
|
|
12
12
|
getPaywall: (params?: GetPaywall) => Promise<Paywall>;
|
|
13
13
|
getCustomer: () => Promise<Customer>;
|
|
@@ -66,7 +66,7 @@ export declare class Stigg implements StiggClient {
|
|
|
66
66
|
/**
|
|
67
67
|
* Set the customer ID, usually after the customer signs in or restores a session
|
|
68
68
|
*/
|
|
69
|
-
setCustomerId(customerId: string): Promise<void>;
|
|
69
|
+
setCustomerId(customerId: string, customerToken?: string | null): Promise<void>;
|
|
70
70
|
/**
|
|
71
71
|
* Clear the customer ID, usually after the customer signs out
|
|
72
72
|
*/
|
|
@@ -101,7 +101,7 @@ export declare class Stigg implements StiggClient {
|
|
|
101
101
|
*
|
|
102
102
|
* @returns {Promise<Paywall>}
|
|
103
103
|
*/
|
|
104
|
-
getPaywall({ productId }?: GetPaywall): Promise<Paywall>;
|
|
104
|
+
getPaywall({ productId, context }?: GetPaywall): Promise<Paywall>;
|
|
105
105
|
/**
|
|
106
106
|
* Get a list of coupons
|
|
107
107
|
*
|
package/dist/configuration.d.ts
CHANGED