@stigg/js-client-sdk 0.53.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 +66 -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 +9 -1
- package/dist/utils/ModelMapper.d.ts +3 -2
- package/package.json +1 -1
package/dist/api/PaywallApi.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
2
|
import { GetPaywallQuery } from './generated/types';
|
|
3
|
+
export declare const PAYWALL_CONFIGURATION: import("graphql/language/ast").DocumentNode;
|
|
3
4
|
declare class PaywallApi {
|
|
4
5
|
private readonly client;
|
|
5
6
|
constructor(client: ApolloClient<NormalizedCacheObject>);
|
|
@@ -450,6 +450,18 @@ export declare type CustomerInput = {
|
|
|
450
450
|
refId?: InputMaybe<Scalars['String']>;
|
|
451
451
|
shouldSyncFree?: InputMaybe<Scalars['Boolean']>;
|
|
452
452
|
};
|
|
453
|
+
export declare type CustomerPortalColorsPaletteInput = {
|
|
454
|
+
backgroundColor?: InputMaybe<Scalars['String']>;
|
|
455
|
+
borderColor?: InputMaybe<Scalars['String']>;
|
|
456
|
+
currentPlanBackground?: InputMaybe<Scalars['String']>;
|
|
457
|
+
iconsColor?: InputMaybe<Scalars['String']>;
|
|
458
|
+
paywallBackgroundColor?: InputMaybe<Scalars['String']>;
|
|
459
|
+
primary?: InputMaybe<Scalars['String']>;
|
|
460
|
+
textColor?: InputMaybe<Scalars['String']>;
|
|
461
|
+
};
|
|
462
|
+
export declare type CustomerPortalConfigurationInput = {
|
|
463
|
+
palette?: InputMaybe<CustomerPortalColorsPaletteInput>;
|
|
464
|
+
};
|
|
453
465
|
export declare type CustomerPortalInput = {
|
|
454
466
|
customerId: Scalars['String'];
|
|
455
467
|
};
|
|
@@ -981,6 +993,9 @@ export declare type GetPaywallInput = {
|
|
|
981
993
|
environmentId?: InputMaybe<Scalars['String']>;
|
|
982
994
|
productId?: InputMaybe<Scalars['String']>;
|
|
983
995
|
};
|
|
996
|
+
export declare type GetWidgetConfigurationInput = {
|
|
997
|
+
environmentId?: InputMaybe<Scalars['String']>;
|
|
998
|
+
};
|
|
984
999
|
export declare type HookFilter = {
|
|
985
1000
|
and?: InputMaybe<Array<HookFilter>>;
|
|
986
1001
|
createdAt?: InputMaybe<DateFieldComparison>;
|
|
@@ -1305,6 +1320,7 @@ export declare enum PackageEntitlementSortFields {
|
|
|
1305
1320
|
}
|
|
1306
1321
|
export declare type PackageEntitlementUpdateInput = {
|
|
1307
1322
|
description?: InputMaybe<Scalars['String']>;
|
|
1323
|
+
displayNameOverride?: InputMaybe<Scalars['String']>;
|
|
1308
1324
|
hasUnlimitedUsage?: InputMaybe<Scalars['Boolean']>;
|
|
1309
1325
|
hiddenFromWidgets?: InputMaybe<Array<WidgetType>>;
|
|
1310
1326
|
monthlyResetPeriodConfiguration?: InputMaybe<MonthlyResetPeriodConfigInput>;
|
|
@@ -1350,6 +1366,16 @@ export declare enum PaymentMethodType {
|
|
|
1350
1366
|
Bank = "BANK",
|
|
1351
1367
|
Card = "CARD"
|
|
1352
1368
|
}
|
|
1369
|
+
export declare type PaywallColorsPaletteInput = {
|
|
1370
|
+
backgroundColor?: InputMaybe<Scalars['String']>;
|
|
1371
|
+
borderColor?: InputMaybe<Scalars['String']>;
|
|
1372
|
+
currentPlanBackground?: InputMaybe<Scalars['String']>;
|
|
1373
|
+
primary?: InputMaybe<Scalars['String']>;
|
|
1374
|
+
textColor?: InputMaybe<Scalars['String']>;
|
|
1375
|
+
};
|
|
1376
|
+
export declare type PaywallConfigurationInput = {
|
|
1377
|
+
palette?: InputMaybe<PaywallColorsPaletteInput>;
|
|
1378
|
+
};
|
|
1353
1379
|
export declare type PlanCreateInput = {
|
|
1354
1380
|
additionalMetaData?: InputMaybe<Scalars['JSON']>;
|
|
1355
1381
|
billingId?: InputMaybe<Scalars['String']>;
|
|
@@ -2374,6 +2400,11 @@ export declare enum WeeklyAccordingTo {
|
|
|
2374
2400
|
export declare type WeeklyResetPeriodConfigInput = {
|
|
2375
2401
|
accordingTo: WeeklyAccordingTo;
|
|
2376
2402
|
};
|
|
2403
|
+
export declare type WidgetConfigurationUpdateInput = {
|
|
2404
|
+
customerPortalConfiguration?: InputMaybe<CustomerPortalConfigurationInput>;
|
|
2405
|
+
environmentId?: InputMaybe<Scalars['String']>;
|
|
2406
|
+
paywallConfiguration?: InputMaybe<PaywallConfigurationInput>;
|
|
2407
|
+
};
|
|
2377
2408
|
/** The widget type */
|
|
2378
2409
|
export declare enum WidgetType {
|
|
2379
2410
|
CustomerPortal = "CUSTOMER_PORTAL",
|
|
@@ -2696,6 +2727,19 @@ export declare type CustomerPortalSubscriptionFragment = {
|
|
|
2696
2727
|
__typename?: 'CustomerPortalAddon';
|
|
2697
2728
|
} & CustomerPortalSubscriptionAddonFragment>;
|
|
2698
2729
|
};
|
|
2730
|
+
export declare type CustomerPortalConfigurationFragment = {
|
|
2731
|
+
__typename?: 'CustomerPortalConfiguration';
|
|
2732
|
+
palette: {
|
|
2733
|
+
__typename?: 'CustomerPortalColorsPalette';
|
|
2734
|
+
primary: string;
|
|
2735
|
+
textColor: string;
|
|
2736
|
+
backgroundColor: string;
|
|
2737
|
+
borderColor: string;
|
|
2738
|
+
currentPlanBackground: string;
|
|
2739
|
+
iconsColor: string;
|
|
2740
|
+
paywallBackgroundColor: string;
|
|
2741
|
+
};
|
|
2742
|
+
};
|
|
2699
2743
|
export declare type CustomerPortalFragment = {
|
|
2700
2744
|
__typename?: 'CustomerPortal';
|
|
2701
2745
|
showWatermark: boolean;
|
|
@@ -2713,6 +2757,9 @@ export declare type CustomerPortalFragment = {
|
|
|
2713
2757
|
billingInformation: {
|
|
2714
2758
|
__typename?: 'CustomerPortalBillingInformation';
|
|
2715
2759
|
} & CustomerPortalBillingInformationFragment;
|
|
2760
|
+
configuration: {
|
|
2761
|
+
__typename?: 'CustomerPortalConfiguration';
|
|
2762
|
+
} & CustomerPortalConfigurationFragment;
|
|
2716
2763
|
};
|
|
2717
2764
|
export declare type GetCustomerByRefIdQueryVariables = Exact<{
|
|
2718
2765
|
filter?: Maybe<CustomerFilter>;
|
|
@@ -2805,6 +2852,7 @@ export declare type PaywallPackageEntitlementFragment = {
|
|
|
2805
2852
|
hasUnlimitedUsage: boolean;
|
|
2806
2853
|
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2807
2854
|
hiddenFromWidgets?: Array<WidgetType> | null | undefined;
|
|
2855
|
+
displayNameOverride?: string | null | undefined;
|
|
2808
2856
|
feature?: {
|
|
2809
2857
|
__typename?: 'EntitlementFeature';
|
|
2810
2858
|
featureType: FeatureType;
|
|
@@ -2895,6 +2943,9 @@ export declare type GetMockPaywallQuery = {
|
|
|
2895
2943
|
plans: Array<{
|
|
2896
2944
|
__typename?: 'PaywallPlan';
|
|
2897
2945
|
} & PayWallPlanFragment>;
|
|
2946
|
+
configuration: {
|
|
2947
|
+
__typename?: 'PaywallConfiguration';
|
|
2948
|
+
} & PaywallConfigurationFragment;
|
|
2898
2949
|
};
|
|
2899
2950
|
};
|
|
2900
2951
|
export declare type PackageEntitlementFragment = {
|
|
@@ -2904,6 +2955,7 @@ export declare type PackageEntitlementFragment = {
|
|
|
2904
2955
|
featureId: string;
|
|
2905
2956
|
resetPeriod?: EntitlementResetPeriod | null | undefined;
|
|
2906
2957
|
hiddenFromWidgets?: Array<WidgetType> | null | undefined;
|
|
2958
|
+
displayNameOverride?: string | null | undefined;
|
|
2907
2959
|
feature: {
|
|
2908
2960
|
__typename?: 'Feature';
|
|
2909
2961
|
featureType: FeatureType;
|
|
@@ -2966,6 +3018,17 @@ export declare type PlanFragment = {
|
|
|
2966
3018
|
__typename?: 'Addon';
|
|
2967
3019
|
} & AddonFragment> | null | undefined;
|
|
2968
3020
|
};
|
|
3021
|
+
export declare type PaywallConfigurationFragment = {
|
|
3022
|
+
__typename?: 'PaywallConfiguration';
|
|
3023
|
+
palette: {
|
|
3024
|
+
__typename?: 'PaywallColorsPalette';
|
|
3025
|
+
primary: string;
|
|
3026
|
+
textColor: string;
|
|
3027
|
+
backgroundColor: string;
|
|
3028
|
+
borderColor: string;
|
|
3029
|
+
currentPlanBackground: string;
|
|
3030
|
+
};
|
|
3031
|
+
};
|
|
2969
3032
|
export declare type GetPaywallQueryVariables = Exact<{
|
|
2970
3033
|
input: GetPaywallInput;
|
|
2971
3034
|
}>;
|
|
@@ -2976,6 +3039,9 @@ export declare type GetPaywallQuery = {
|
|
|
2976
3039
|
plans: Array<{
|
|
2977
3040
|
__typename?: 'Plan';
|
|
2978
3041
|
} & PlanFragment>;
|
|
3042
|
+
configuration: {
|
|
3043
|
+
__typename?: 'PaywallConfiguration';
|
|
3044
|
+
} & PaywallConfigurationFragment;
|
|
2979
3045
|
};
|
|
2980
3046
|
};
|
|
2981
3047
|
export declare type SdkConfigurationQueryVariables = Exact<{
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanEntitlement, Coupon, Customer, Entitlement, GetBooleanEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement,
|
|
1
|
+
import { BooleanEntitlement, Coupon, Customer, Entitlement, GetBooleanEntitlement, GetMeteredEntitlement, GetNumericEntitlement, GetPaywall, MeteredEntitlement, NumericEntitlement, Subscription, WaitForCheckoutCompleted, CustomerPortal, Paywall } from './models';
|
|
2
2
|
import { ClientConfiguration } from './configuration';
|
|
3
3
|
import { EventNames, Events } from './services/eventEmitter';
|
|
4
4
|
export interface StiggClient {
|
|
@@ -9,7 +9,7 @@ export interface StiggClient {
|
|
|
9
9
|
getMeteredEntitlement: (params: GetMeteredEntitlement) => MeteredEntitlement;
|
|
10
10
|
setCustomerId: (customerId: string) => Promise<void>;
|
|
11
11
|
clearCustomer: () => void;
|
|
12
|
-
getPaywall: (params?: GetPaywall) => Promise<
|
|
12
|
+
getPaywall: (params?: GetPaywall) => Promise<Paywall>;
|
|
13
13
|
getCustomer: () => Promise<Customer>;
|
|
14
14
|
getCoupons(): Promise<Coupon[]>;
|
|
15
15
|
getEntitlements: () => Promise<Entitlement[]>;
|
|
@@ -96,12 +96,12 @@ export declare class Stigg implements StiggClient {
|
|
|
96
96
|
*/
|
|
97
97
|
getMeteredEntitlement({ featureId, options }: GetMeteredEntitlement): MeteredEntitlement;
|
|
98
98
|
/**
|
|
99
|
-
* Get
|
|
99
|
+
* Get paywall data for rendering the paywall
|
|
100
100
|
* @deprecated *Optional* `productId` is now deprecated and will be changed to a *required* field soon.
|
|
101
101
|
*
|
|
102
|
-
* @returns {Promise<
|
|
102
|
+
* @returns {Promise<Paywall>}
|
|
103
103
|
*/
|
|
104
|
-
getPaywall({ productId }?: GetPaywall): Promise<
|
|
104
|
+
getPaywall({ productId }?: GetPaywall): Promise<Paywall>;
|
|
105
105
|
/**
|
|
106
106
|
* Get a list of coupons
|
|
107
107
|
*
|