@stigg/js-client-sdk 1.8.0 → 1.9.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/EdgeApiClient.d.ts +12 -5
- package/dist/api/EntitlementsApi.d.ts +4 -2
- package/dist/api/PaywallApi.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/entitlementsService.d.ts +2 -1
- package/dist/utils/ObservablePoller.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
import { ApolloQueryResult } from '@apollo/client/core';
|
|
2
|
+
import { GetEntitlementsQuery, GetPaywallQuery } from './generated/types';
|
|
3
|
+
import { ObservablePoller } from '../utils/ObservablePoller';
|
|
1
4
|
declare type EdgeApiClientConfiguration = {
|
|
2
5
|
apiKey: string;
|
|
3
6
|
baseEdgeUri: string;
|
|
4
|
-
|
|
5
|
-
customerToken?: string | null;
|
|
6
|
-
enableEdge?: boolean;
|
|
7
|
+
enableEdge: boolean;
|
|
7
8
|
};
|
|
8
9
|
export declare class EdgeApiClient {
|
|
10
|
+
private readonly dynamicData;
|
|
9
11
|
private readonly httpClient;
|
|
10
12
|
private constructor();
|
|
11
|
-
static create(config: EdgeApiClientConfiguration
|
|
12
|
-
|
|
13
|
+
static create(config: EdgeApiClientConfiguration, dynamicData: {
|
|
14
|
+
customerToken?: string | null;
|
|
15
|
+
}): EdgeApiClient | null;
|
|
16
|
+
getPaywall(productId?: string): Promise<ApolloQueryResult<GetPaywallQuery>>;
|
|
17
|
+
getEntitlements(customerId: string): Promise<ApolloQueryResult<GetEntitlementsQuery>>;
|
|
18
|
+
watchEntitlements(customerId: string, interval: number): ObservablePoller<GetEntitlementsQuery>;
|
|
19
|
+
private get;
|
|
13
20
|
}
|
|
14
21
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
2
|
import { GetEntitlementsQuery, EntitlementCheckResult } from './generated/types';
|
|
3
|
+
import { EdgeApiClient } from './EdgeApiClient';
|
|
3
4
|
export declare const RESET_PERIOD_CONFIGURATION_FRAGMENT: import("graphql/language/ast").DocumentNode;
|
|
4
5
|
export declare const FEATURE_FRAGMENT: import("graphql/language/ast").DocumentNode;
|
|
5
6
|
declare class EntitlementsApi {
|
|
6
7
|
private readonly client;
|
|
7
|
-
|
|
8
|
+
private readonly edgeApiClient;
|
|
9
|
+
constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
|
|
8
10
|
getEntitlements(customerId: string): Promise<import("@apollo/client/core").ApolloQueryResult<GetEntitlementsQuery>>;
|
|
9
|
-
pollEntitlements(customerId: string, interval: number): import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("./generated/types").Exact<{
|
|
11
|
+
pollEntitlements(customerId: string, interval: number): import("../utils/ObservablePoller").ObservablePoller<GetEntitlementsQuery> | import("@apollo/client/core").ObservableQuery<GetEntitlementsQuery, import("./generated/types").Exact<{
|
|
10
12
|
query: import("./generated/types").FetchEntitlementsQuery;
|
|
11
13
|
}>>;
|
|
12
14
|
reportEntitlementRequested(featureId: string, customerId: string, entitlementCheckResult: EntitlementCheckResult, requestedUsage?: number): Promise<void>;
|
package/dist/api/PaywallApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
|
2
|
-
import { WidgetType } from './generated/types';
|
|
2
|
+
import { GetPaywallQuery, WidgetType } from './generated/types';
|
|
3
3
|
import { EdgeApiClient } from './EdgeApiClient';
|
|
4
4
|
export declare const TYPOGRAPHY_CONFIGURATION: import("graphql/language/ast").DocumentNode;
|
|
5
5
|
export declare const PAYWALL_CONFIGURATION: import("graphql/language/ast").DocumentNode;
|
|
@@ -12,6 +12,6 @@ declare class PaywallApi {
|
|
|
12
12
|
private readonly client;
|
|
13
13
|
private readonly edgeApiClient;
|
|
14
14
|
constructor(client: ApolloClient<NormalizedCacheObject>, edgeApiClient: EdgeApiClient | null);
|
|
15
|
-
getPaywall({ productId, customerId, context }: GetPaywallProps): Promise<
|
|
15
|
+
getPaywall({ productId, customerId, context }: GetPaywallProps): Promise<import("@apollo/client/core").ApolloQueryResult<GetPaywallQuery>>;
|
|
16
16
|
}
|
|
17
17
|
export default PaywallApi;
|