@stigg/js-client-sdk 1.4.0 → 1.5.1

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.
@@ -4,12 +4,13 @@ import PaywallApi from './PaywallApi';
4
4
  import CustomersApi from './CustomersApi';
5
5
  import CouponsApi from './CouponsApi';
6
6
  import MockPaywallApi from './MockPaywallApi';
7
+ import { EdgeApiClient } from './EdgeApiClient';
7
8
  declare class ApiGateway {
8
9
  sdkConfiguration: SdkConfigurationApi;
9
10
  paywall: PaywallApi;
10
11
  mockPaywall: MockPaywallApi;
11
12
  customers: CustomersApi;
12
13
  coupons: CouponsApi;
13
- constructor(client: ApolloClient<NormalizedCacheObject>);
14
+ constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
14
15
  }
15
16
  export default ApiGateway;
@@ -0,0 +1,14 @@
1
+ declare type EdgeApiClientConfiguration = {
2
+ apiKey: string;
3
+ baseEdgeUri: string;
4
+ customerId?: string | null;
5
+ customerToken?: string | null;
6
+ enableEdge?: boolean;
7
+ };
8
+ export declare class EdgeApiClient {
9
+ private readonly httpClient;
10
+ private constructor();
11
+ static create(config: EdgeApiClientConfiguration): EdgeApiClient | null;
12
+ getPaywall(productId?: string): Promise<any>;
13
+ }
14
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
2
- import { GetPaywallQuery, WidgetType } from './generated/types';
2
+ import { WidgetType } from './generated/types';
3
+ import { EdgeApiClient } from './EdgeApiClient';
3
4
  export declare const TYPOGRAPHY_CONFIGURATION: import("graphql/language/ast").DocumentNode;
4
5
  export declare const PAYWALL_CONFIGURATION: import("graphql/language/ast").DocumentNode;
5
6
  export declare type GetPaywallProps = {
@@ -9,7 +10,8 @@ export declare type GetPaywallProps = {
9
10
  };
10
11
  declare class PaywallApi {
11
12
  private readonly client;
12
- constructor(client: ApolloClient<NormalizedCacheObject>);
13
- getPaywall({ productId, customerId, context }: GetPaywallProps): Promise<import("@apollo/client/core").ApolloQueryResult<GetPaywallQuery>>;
13
+ private readonly edgeApiClient;
14
+ constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
15
+ getPaywall({ productId, customerId, context }: GetPaywallProps): Promise<any>;
14
16
  }
15
17
  export default PaywallApi;
@@ -789,6 +789,7 @@ export declare enum ErrorCode {
789
789
  UncompatibleSubscriptionAddon = "UncompatibleSubscriptionAddon",
790
790
  UnexpectedError = "UnexpectedError",
791
791
  UnsupportedFeatureType = "UnsupportedFeatureType",
792
+ UnsupportedSubscriptionScheduleType = "UnsupportedSubscriptionScheduleType",
792
793
  UnsupportedVendorIdentifier = "UnsupportedVendorIdentifier"
793
794
  }
794
795
  export declare type EstimateSubscriptionInput = {
@@ -1528,6 +1529,7 @@ export declare type PlanUpdateInput = {
1528
1529
  };
1529
1530
  export declare type PriceFilter = {
1530
1531
  and?: InputMaybe<Array<PriceFilter>>;
1532
+ billingId?: InputMaybe<StringFieldComparison>;
1531
1533
  billingModel?: InputMaybe<BillingModelFilterComparison>;
1532
1534
  billingPeriod?: InputMaybe<BillingPeriodFilterComparison>;
1533
1535
  createdAt?: InputMaybe<DateFieldComparison>;
@@ -1562,6 +1564,7 @@ export declare type PriceSort = {
1562
1564
  nulls?: InputMaybe<SortNulls>;
1563
1565
  };
1564
1566
  export declare enum PriceSortFields {
1567
+ BillingId = "billingId",
1565
1568
  BillingModel = "billingModel",
1566
1569
  BillingPeriod = "billingPeriod",
1567
1570
  CreatedAt = "createdAt",
@@ -1980,6 +1983,7 @@ export declare type SubscriptionAddonFilterCustomerSubscriptionFilter = {
1980
1983
  };
1981
1984
  export declare type SubscriptionAddonFilterPriceFilter = {
1982
1985
  and?: InputMaybe<Array<SubscriptionAddonFilterPriceFilter>>;
1986
+ billingId?: InputMaybe<StringFieldComparison>;
1983
1987
  billingModel?: InputMaybe<BillingModelFilterComparison>;
1984
1988
  billingPeriod?: InputMaybe<BillingPeriodFilterComparison>;
1985
1989
  createdAt?: InputMaybe<DateFieldComparison>;
@@ -2076,6 +2080,7 @@ export declare type SubscriptionInput = {
2076
2080
  subscriptionId?: InputMaybe<Scalars['String']>;
2077
2081
  };
2078
2082
  export declare type SubscriptionMigrationInput = {
2083
+ environmentId?: InputMaybe<Scalars['String']>;
2079
2084
  subscriptionId: Scalars['String'];
2080
2085
  };
2081
2086
  export declare type SubscriptionMigrationTaskFilter = {
@@ -2132,6 +2137,7 @@ export declare type SubscriptionPriceFilterCustomerSubscriptionFilter = {
2132
2137
  };
2133
2138
  export declare type SubscriptionPriceFilterPriceFilter = {
2134
2139
  and?: InputMaybe<Array<SubscriptionPriceFilterPriceFilter>>;
2140
+ billingId?: InputMaybe<StringFieldComparison>;
2135
2141
  billingModel?: InputMaybe<BillingModelFilterComparison>;
2136
2142
  billingPeriod?: InputMaybe<BillingPeriodFilterComparison>;
2137
2143
  createdAt?: InputMaybe<DateFieldComparison>;
@@ -2162,43 +2168,6 @@ export declare enum SubscriptionScheduleType {
2162
2168
  Downgrade = "Downgrade",
2163
2169
  UnitAmount = "UnitAmount"
2164
2170
  }
2165
- export declare type SubscriptionScheduledUpdateFilter = {
2166
- and?: InputMaybe<Array<SubscriptionScheduledUpdateFilter>>;
2167
- createdAt?: InputMaybe<DateFieldComparison>;
2168
- or?: InputMaybe<Array<SubscriptionScheduledUpdateFilter>>;
2169
- scheduledExecutionTime?: InputMaybe<DateFieldComparison>;
2170
- subscription?: InputMaybe<SubscriptionScheduledUpdateFilterCustomerSubscriptionFilter>;
2171
- };
2172
- export declare type SubscriptionScheduledUpdateFilterCustomerSubscriptionFilter = {
2173
- and?: InputMaybe<Array<SubscriptionScheduledUpdateFilterCustomerSubscriptionFilter>>;
2174
- billingId?: InputMaybe<StringFieldComparison>;
2175
- cancelReason?: InputMaybe<SubscriptionCancelReasonFilterComparison>;
2176
- cancellationDate?: InputMaybe<DateFieldComparison>;
2177
- createdAt?: InputMaybe<DateFieldComparison>;
2178
- crmId?: InputMaybe<StringFieldComparison>;
2179
- crmLinkUrl?: InputMaybe<StringFieldComparison>;
2180
- effectiveEndDate?: InputMaybe<DateFieldComparison>;
2181
- endDate?: InputMaybe<DateFieldComparison>;
2182
- environmentId?: InputMaybe<StringFieldComparison>;
2183
- id?: InputMaybe<StringFieldComparison>;
2184
- oldBillingId?: InputMaybe<StringFieldComparison>;
2185
- or?: InputMaybe<Array<SubscriptionScheduledUpdateFilterCustomerSubscriptionFilter>>;
2186
- pricingType?: InputMaybe<PricingTypeFilterComparison>;
2187
- refId?: InputMaybe<StringFieldComparison>;
2188
- startDate?: InputMaybe<DateFieldComparison>;
2189
- status?: InputMaybe<SubscriptionStatusFilterComparison>;
2190
- subscriptionId?: InputMaybe<StringFieldComparison>;
2191
- trialEndDate?: InputMaybe<DateFieldComparison>;
2192
- };
2193
- export declare type SubscriptionScheduledUpdateSort = {
2194
- direction: SortDirection;
2195
- field: SubscriptionScheduledUpdateSortFields;
2196
- nulls?: InputMaybe<SortNulls>;
2197
- };
2198
- export declare enum SubscriptionScheduledUpdateSortFields {
2199
- CreatedAt = "createdAt",
2200
- ScheduledExecutionTime = "scheduledExecutionTime"
2201
- }
2202
2171
  export declare enum SubscriptionStartSetup {
2203
2172
  FreePlan = "FREE_PLAN",
2204
2173
  PlanSelection = "PLAN_SELECTION",
@@ -2229,6 +2198,10 @@ export declare type SubscriptionStatusFilterComparison = {
2229
2198
  notIn?: InputMaybe<Array<SubscriptionStatus>>;
2230
2199
  notLike?: InputMaybe<SubscriptionStatus>;
2231
2200
  };
2201
+ export declare type SubscriptionUpdateScheduleCancellationInput = {
2202
+ environmentId?: InputMaybe<Scalars['String']>;
2203
+ subscriptionId: Scalars['String'];
2204
+ };
2232
2205
  /** Status of the integration sync */
2233
2206
  export declare enum SyncStatus {
2234
2207
  Error = "ERROR",
@@ -2840,6 +2813,7 @@ export declare type PaywallAddonFragment = {
2840
2813
  displayName: string;
2841
2814
  description?: string | null | undefined;
2842
2815
  additionalMetaData?: any | null | undefined;
2816
+ billingId?: string | null | undefined;
2843
2817
  pricingType?: PricingType | null | undefined;
2844
2818
  entitlements: Array<{
2845
2819
  __typename?: 'Entitlement';
@@ -2852,6 +2826,7 @@ export declare type PaywallPriceFragment = {
2852
2826
  __typename?: 'PaywallPrice';
2853
2827
  billingModel: BillingModel;
2854
2828
  billingPeriod: BillingPeriod;
2829
+ billingId?: string | null | undefined;
2855
2830
  minUnitQuantity?: number | null | undefined;
2856
2831
  maxUnitQuantity?: number | null | undefined;
2857
2832
  price: {
@@ -2871,6 +2846,7 @@ export declare type PayWallPlanFragment = {
2871
2846
  refId: string;
2872
2847
  description?: string | null | undefined;
2873
2848
  displayName: string;
2849
+ billingId?: string | null | undefined;
2874
2850
  additionalMetaData?: any | null | undefined;
2875
2851
  pricingType?: PricingType | null | undefined;
2876
2852
  product: {
@@ -2941,6 +2917,7 @@ export declare type AddonFragment = {
2941
2917
  __typename?: 'Addon';
2942
2918
  refId: string;
2943
2919
  displayName: string;
2920
+ billingId?: string | null | undefined;
2944
2921
  description?: string | null | undefined;
2945
2922
  additionalMetaData?: any | null | undefined;
2946
2923
  pricingType?: PricingType | null | undefined;
@@ -2956,6 +2933,7 @@ export declare type PlanFragment = {
2956
2933
  refId: string;
2957
2934
  description?: string | null | undefined;
2958
2935
  displayName: string;
2936
+ billingId?: string | null | undefined;
2959
2937
  additionalMetaData?: any | null | undefined;
2960
2938
  pricingType?: PricingType | null | undefined;
2961
2939
  product: {
@@ -3109,6 +3087,7 @@ export declare type SubscriptionFragment = {
3109
3087
  __typename?: 'Plan';
3110
3088
  id: string;
3111
3089
  refId: string;
3090
+ billingId?: string | null | undefined;
3112
3091
  displayName: string;
3113
3092
  description?: string | null | undefined;
3114
3093
  additionalMetaData?: any | null | undefined;
@@ -3165,6 +3144,7 @@ export declare type SubscriptionFragment = {
3165
3144
  __typename?: 'Addon';
3166
3145
  id: string;
3167
3146
  refId: string;
3147
+ billingId?: string | null | undefined;
3168
3148
  displayName: string;
3169
3149
  description?: string | null | undefined;
3170
3150
  additionalMetaData?: any | null | undefined;
@@ -3251,6 +3231,7 @@ export declare type PriceFragment = {
3251
3231
  __typename?: 'Price';
3252
3232
  billingModel: BillingModel;
3253
3233
  billingPeriod: BillingPeriod;
3234
+ billingId?: string | null | undefined;
3254
3235
  minUnitQuantity?: number | null | undefined;
3255
3236
  maxUnitQuantity?: number | null | undefined;
3256
3237
  price: {
package/dist/client.d.ts CHANGED
@@ -22,6 +22,7 @@ export interface StiggClient {
22
22
  }
23
23
  export declare class Stigg implements StiggClient {
24
24
  private readonly apiGateway;
25
+ private readonly edgeApiClient;
25
26
  private readonly graphClient;
26
27
  private readonly batchedGraphClient;
27
28
  private readonly configuration;
@@ -5,12 +5,14 @@ export declare const SDK_NAME = "js-client-sdk";
5
5
  export declare type ClientConfiguration = {
6
6
  apiKey: string;
7
7
  baseUri?: string;
8
+ baseEdgeUri?: string;
8
9
  customerId?: string | null;
9
10
  customerToken?: string | null;
10
11
  entitlementPollingInterval?: number;
11
12
  useEntitlementPolling?: boolean;
12
13
  logConfiguration?: LogConfiguration;
13
14
  lazyLoad?: boolean;
15
+ enableEdge?: boolean;
14
16
  };
15
17
  export declare function validateConfiguration(configuration: ClientConfiguration, loggerService: LoggerService): void;
16
18
  export declare function getConfiguration(configuration: ClientConfiguration): Required<ClientConfiguration>;