@stigg/js-client-sdk 0.54.0 → 1.0.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/README.md CHANGED
@@ -1,4 +1,3 @@
1
1
  # js-client-sdk
2
2
 
3
3
  Stigg client-side SDK for Browser
4
-
@@ -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>;
@@ -1351,6 +1366,16 @@ export declare enum PaymentMethodType {
1351
1366
  Bank = "BANK",
1352
1367
  Card = "CARD"
1353
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
+ };
1354
1379
  export declare type PlanCreateInput = {
1355
1380
  additionalMetaData?: InputMaybe<Scalars['JSON']>;
1356
1381
  billingId?: InputMaybe<Scalars['String']>;
@@ -2375,6 +2400,11 @@ export declare enum WeeklyAccordingTo {
2375
2400
  export declare type WeeklyResetPeriodConfigInput = {
2376
2401
  accordingTo: WeeklyAccordingTo;
2377
2402
  };
2403
+ export declare type WidgetConfigurationUpdateInput = {
2404
+ customerPortalConfiguration?: InputMaybe<CustomerPortalConfigurationInput>;
2405
+ environmentId?: InputMaybe<Scalars['String']>;
2406
+ paywallConfiguration?: InputMaybe<PaywallConfigurationInput>;
2407
+ };
2378
2408
  /** The widget type */
2379
2409
  export declare enum WidgetType {
2380
2410
  CustomerPortal = "CUSTOMER_PORTAL",
@@ -2697,6 +2727,19 @@ export declare type CustomerPortalSubscriptionFragment = {
2697
2727
  __typename?: 'CustomerPortalAddon';
2698
2728
  } & CustomerPortalSubscriptionAddonFragment>;
2699
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
+ };
2700
2743
  export declare type CustomerPortalFragment = {
2701
2744
  __typename?: 'CustomerPortal';
2702
2745
  showWatermark: boolean;
@@ -2714,6 +2757,9 @@ export declare type CustomerPortalFragment = {
2714
2757
  billingInformation: {
2715
2758
  __typename?: 'CustomerPortalBillingInformation';
2716
2759
  } & CustomerPortalBillingInformationFragment;
2760
+ configuration: {
2761
+ __typename?: 'CustomerPortalConfiguration';
2762
+ } & CustomerPortalConfigurationFragment;
2717
2763
  };
2718
2764
  export declare type GetCustomerByRefIdQueryVariables = Exact<{
2719
2765
  filter?: Maybe<CustomerFilter>;
@@ -2897,6 +2943,9 @@ export declare type GetMockPaywallQuery = {
2897
2943
  plans: Array<{
2898
2944
  __typename?: 'PaywallPlan';
2899
2945
  } & PayWallPlanFragment>;
2946
+ configuration: {
2947
+ __typename?: 'PaywallConfiguration';
2948
+ } & PaywallConfigurationFragment;
2900
2949
  };
2901
2950
  };
2902
2951
  export declare type PackageEntitlementFragment = {
@@ -2969,6 +3018,17 @@ export declare type PlanFragment = {
2969
3018
  __typename?: 'Addon';
2970
3019
  } & AddonFragment> | null | undefined;
2971
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
+ };
2972
3032
  export declare type GetPaywallQueryVariables = Exact<{
2973
3033
  input: GetPaywallInput;
2974
3034
  }>;
@@ -2979,6 +3039,9 @@ export declare type GetPaywallQuery = {
2979
3039
  plans: Array<{
2980
3040
  __typename?: 'Plan';
2981
3041
  } & PlanFragment>;
3042
+ configuration: {
3043
+ __typename?: 'PaywallConfiguration';
3044
+ } & PaywallConfigurationFragment;
2982
3045
  };
2983
3046
  };
2984
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, Plan, Subscription, WaitForCheckoutCompleted, CustomerPortal } from './models';
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<Plan[]>;
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 a list of plans for rendering the paywall
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<Plan[]>}
102
+ * @returns {Promise<Paywall>}
103
103
  */
104
- getPaywall({ productId }?: GetPaywall): Promise<Plan[]>;
104
+ getPaywall({ productId }?: GetPaywall): Promise<Paywall>;
105
105
  /**
106
106
  * Get a list of coupons
107
107
  *