@stigg/js-client-sdk 1.4.0 → 1.5.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.
@@ -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;
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>;