@stigg/js-client-sdk 0.44.0 → 0.45.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.
package/dist/client.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface StiggClient {
|
|
|
12
12
|
getEntitlements: () => Promise<Entitlement[]>;
|
|
13
13
|
refresh: () => Promise<void>;
|
|
14
14
|
waitForCheckoutCompleted(params?: WaitForCheckoutCompleted): Promise<Subscription | null>;
|
|
15
|
+
waitForInitialization(): Promise<StiggClient>;
|
|
15
16
|
addListener: <K extends EventNames>(eventName: K, callback: Events[K]) => void;
|
|
16
17
|
removeListener: <K extends EventNames>(eventName: K, callback: Events[K]) => void;
|
|
17
18
|
}
|
|
@@ -24,6 +25,7 @@ export declare class Stigg implements StiggClient {
|
|
|
24
25
|
private entitlementsService;
|
|
25
26
|
private readonly modelMapper;
|
|
26
27
|
private readonly eventEmitter;
|
|
28
|
+
private readonly initializationStateTracker;
|
|
27
29
|
private constructor();
|
|
28
30
|
/**
|
|
29
31
|
* Creates an instance of Stigg client.
|
|
@@ -31,7 +33,17 @@ export declare class Stigg implements StiggClient {
|
|
|
31
33
|
* @param configuration configuration settings.
|
|
32
34
|
* @returns The new client instance.
|
|
33
35
|
*/
|
|
34
|
-
static initialize(configuration: ClientConfiguration):
|
|
36
|
+
static initialize(configuration: ClientConfiguration): StiggClient;
|
|
37
|
+
private static loadCustomerById;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a Promise that tracks the client's initialization state.
|
|
40
|
+
*
|
|
41
|
+
* The Promise will be resolved if the client successfully initializes, or rejected if client
|
|
42
|
+
* initialization has irrevocably failed.
|
|
43
|
+
*
|
|
44
|
+
* @returns Stigg client instance.
|
|
45
|
+
*/
|
|
46
|
+
waitForInitialization(): Promise<StiggClient>;
|
|
35
47
|
private static initializeSdk;
|
|
36
48
|
get isCustomerLoaded(): boolean;
|
|
37
49
|
/**
|
package/dist/configuration.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export declare type ClientConfiguration = {
|
|
|
7
7
|
baseUri?: string;
|
|
8
8
|
customerId?: string;
|
|
9
9
|
entitlementPollingInterval?: number;
|
|
10
|
+
useEntitlementPolling?: boolean;
|
|
10
11
|
logConfiguration?: LogConfiguration;
|
|
11
12
|
};
|
|
12
|
-
export declare function validateConfiguration(configuration: ClientConfiguration, loggerService: LoggerService):
|
|
13
|
+
export declare function validateConfiguration(configuration: ClientConfiguration, loggerService: LoggerService): void;
|
|
13
14
|
export declare function getConfiguration(configuration: ClientConfiguration): Required<ClientConfiguration>;
|
|
14
15
|
export declare function ensureCustomerRefIdExists({ customerId }: ClientConfiguration): string;
|