wisetrack 2.0.9 → 2.1.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/README.md +75 -24
- package/dist/cdn/sdk.bundle.min.js +1 -1
- package/dist/cjs/constants/constants.d.ts +3 -1
- package/dist/cjs/constants/endpoints.d.ts +9 -6
- package/dist/cjs/constants/environments.d.ts +1 -1
- package/dist/cjs/core/caching/queue-data.d.ts +0 -1
- package/dist/cjs/core/caching/request-queue-manager.d.ts +16 -31
- package/dist/cjs/core/fields/click-match-fields-builder.d.ts +7 -0
- package/dist/cjs/core/fields/heartbeat-fields-builder.d.ts +7 -0
- package/dist/cjs/core/network/api-client.d.ts +16 -4
- package/dist/cjs/core/network/network-error.d.ts +32 -16
- package/dist/cjs/core/network/network-manager.d.ts +9 -4
- package/dist/cjs/core/storage/storage-manager.d.ts +23 -2
- package/dist/cjs/core/wisetrack.d.ts +31 -9
- package/dist/cjs/core/wt-configure.d.ts +18 -0
- package/dist/cjs/core/wt-tracker.d.ts +5 -2
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/config/initial-config.d.ts +8 -0
- package/dist/cjs/types/config/secure-config.d.ts +11 -0
- package/dist/cjs/types/config/wt-auth.d.ts +7 -0
- package/dist/cjs/types/config/wt-config-endpoints.d.ts +15 -0
- package/dist/cjs/types/config/wt-config.d.ts +4 -6
- package/dist/cjs/types/wt-deferred-lookup.d.ts +6 -0
- package/dist/cjs/utils/country-finder.d.ts +1 -0
- package/dist/cjs/utils/crypto-helper.d.ts +1 -1
- package/dist/cjs/utils/heartbeat-manager.d.ts +0 -0
- package/dist/cjs/utils/lifecycle-observer.d.ts +32 -0
- package/dist/cjs/utils/utils.d.ts +1 -0
- package/dist/cjs/utils/webgl-fingerprint.d.ts +3 -3
- package/dist/esm/constants/constants.d.ts +3 -1
- package/dist/esm/constants/endpoints.d.ts +9 -6
- package/dist/esm/constants/environments.d.ts +1 -1
- package/dist/esm/core/caching/queue-data.d.ts +0 -1
- package/dist/esm/core/caching/request-queue-manager.d.ts +16 -31
- package/dist/esm/core/fields/click-match-fields-builder.d.ts +7 -0
- package/dist/esm/core/fields/heartbeat-fields-builder.d.ts +7 -0
- package/dist/esm/core/network/api-client.d.ts +16 -4
- package/dist/esm/core/network/network-error.d.ts +32 -16
- package/dist/esm/core/network/network-manager.d.ts +9 -4
- package/dist/esm/core/storage/storage-manager.d.ts +23 -2
- package/dist/esm/core/wisetrack.d.ts +31 -9
- package/dist/esm/core/wt-configure.d.ts +18 -0
- package/dist/esm/core/wt-tracker.d.ts +5 -2
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/types/config/initial-config.d.ts +8 -0
- package/dist/esm/types/config/secure-config.d.ts +11 -0
- package/dist/esm/types/config/wt-auth.d.ts +7 -0
- package/dist/esm/types/config/wt-config-endpoints.d.ts +15 -0
- package/dist/esm/types/config/wt-config.d.ts +4 -6
- package/dist/esm/types/wt-deferred-lookup.d.ts +6 -0
- package/dist/esm/utils/country-finder.d.ts +1 -0
- package/dist/esm/utils/crypto-helper.d.ts +1 -1
- package/dist/esm/utils/heartbeat-manager.d.ts +0 -0
- package/dist/esm/utils/lifecycle-observer.d.ts +32 -0
- package/dist/esm/utils/utils.d.ts +1 -0
- package/dist/esm/utils/webgl-fingerprint.d.ts +3 -3
- package/package.json +15 -13
- package/dist/cjs/utils/activity-ticker.d.ts +0 -12
- package/dist/esm/utils/activity-ticker.d.ts +0 -12
|
@@ -8,6 +8,10 @@ export interface WTInitialConfig {
|
|
|
8
8
|
* The unique application token provided by WiseTrack Panel.
|
|
9
9
|
*/
|
|
10
10
|
appToken: string;
|
|
11
|
+
/**
|
|
12
|
+
* The client secret provided by WiseTrack Panel.
|
|
13
|
+
*/
|
|
14
|
+
clientSecret: string;
|
|
11
15
|
/**
|
|
12
16
|
* The version of your application.
|
|
13
17
|
*/
|
|
@@ -40,4 +44,8 @@ export interface WTInitialConfig {
|
|
|
40
44
|
* Sets the log level for SDK logging.
|
|
41
45
|
*/
|
|
42
46
|
logLevel?: WTLogLevel;
|
|
47
|
+
/**
|
|
48
|
+
* Whether to enable deepLinks controls, if specified. Defaults to `true`.
|
|
49
|
+
*/
|
|
50
|
+
deeplinkEnabled?: boolean;
|
|
43
51
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
export declare class SecureConfig {
|
|
2
2
|
private static decode;
|
|
3
3
|
static get CONFIG_PATH(): string;
|
|
4
|
+
static get LOCAL_BASE_URL(): string;
|
|
4
5
|
static get DEBUG_BASE_URL(): string;
|
|
5
6
|
static get STAGE_BASE_URL(): string;
|
|
6
7
|
static get PRODUCTION_BASE_URL(): string;
|
|
8
|
+
static get NOTIFICATION_KEY(): string;
|
|
9
|
+
static get EVENTS_PATH(): string;
|
|
10
|
+
static get SESSIONS_PATH(): string;
|
|
11
|
+
static get SDK_CLICKS_PATH(): string;
|
|
12
|
+
static get PUSH_TOKENS_PATH(): string;
|
|
13
|
+
static get ATTRIBUTIONS_PATH(): string;
|
|
14
|
+
static get CLICK_MATCHES_PATH(): string;
|
|
15
|
+
static get DEFERRED_LOOKUPS_PATH(): string;
|
|
16
|
+
static get AUTH_PATH(): string;
|
|
17
|
+
static get HEARTBEATS_PATH(): string;
|
|
7
18
|
}
|
|
8
19
|
export default SecureConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export declare class WTConfigEndpoints {
|
|
3
|
+
events: string;
|
|
4
|
+
sessions: string;
|
|
5
|
+
sdkClicks: string;
|
|
6
|
+
pushTokens: string;
|
|
7
|
+
attributions: string;
|
|
8
|
+
clickMatches: string;
|
|
9
|
+
deferredLookups: string;
|
|
10
|
+
heartbeats: string;
|
|
11
|
+
auth: string;
|
|
12
|
+
constructor(events: string, sessions: string, sdkClicks: string, pushTokens: string, attributions: string, clickMatches: string, deferredLookups: string, heartbeats: string, auth: string);
|
|
13
|
+
static fromJson(json: any): WTConfigEndpoints;
|
|
14
|
+
static get defaultValue(): WTConfigEndpoints;
|
|
15
|
+
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import { WTConfigEndpoints } from "./wt-config-endpoints";
|
|
1
2
|
/** @internal */
|
|
2
3
|
export declare class WTConfig {
|
|
3
|
-
|
|
4
|
-
sessions: string;
|
|
5
|
-
sdkClicks: string;
|
|
6
|
-
sdkInfos: string;
|
|
7
|
-
attributions: string;
|
|
4
|
+
endpoints: WTConfigEndpoints;
|
|
8
5
|
sdkEnabled: boolean;
|
|
9
6
|
sdkUpdate: boolean;
|
|
10
7
|
sessionInterval: string;
|
|
11
8
|
subsessionInterval: string;
|
|
12
|
-
|
|
9
|
+
heartbeatInterval: string;
|
|
10
|
+
constructor(endpoints: WTConfigEndpoints, sdkEnabled?: boolean, sdkUpdate?: boolean, sessionInterval?: string, subsessionInterval?: string, heartbeatInterval?: string);
|
|
13
11
|
static fromJson(json: any): WTConfig;
|
|
14
12
|
static get defaultValue(): WTConfig;
|
|
15
13
|
}
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type DeeplinkHandler = (uri: string, isDeferred: boolean) => void;
|
|
2
|
+
declare class LifecycleOvserver {
|
|
3
|
+
private tickerDelay;
|
|
4
|
+
private isPaused;
|
|
5
|
+
private tickerJob?;
|
|
6
|
+
onStartHandler: (() => any) | null;
|
|
7
|
+
deeplinkHandler: DeeplinkHandler | null;
|
|
8
|
+
onClickMatchHandler: ((url: string) => any) | null;
|
|
9
|
+
private visibilityListener;
|
|
10
|
+
private pageHideListener;
|
|
11
|
+
private originalPushState;
|
|
12
|
+
private originalReplaceState;
|
|
13
|
+
private popstateHandler;
|
|
14
|
+
private hashchangeHandler;
|
|
15
|
+
registerListeners(): void;
|
|
16
|
+
private setupUrlChangeListener;
|
|
17
|
+
private removeUrlChangeListener;
|
|
18
|
+
unregisterListeners(): void;
|
|
19
|
+
private checkForDeepLink;
|
|
20
|
+
onDeeplinkReceived(data: {
|
|
21
|
+
uri: string;
|
|
22
|
+
isDeferred: boolean;
|
|
23
|
+
}): void;
|
|
24
|
+
private isVisibleFocused;
|
|
25
|
+
startTicking(): void;
|
|
26
|
+
stopTicking(): void;
|
|
27
|
+
pauseTicking(): void;
|
|
28
|
+
resumeTicking(): void;
|
|
29
|
+
}
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const lifecycleOvserver: LifecycleOvserver;
|
|
32
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @internal */
|
|
2
1
|
export declare class DeviceFingerprint {
|
|
3
2
|
static isWebGLSupported(): boolean;
|
|
4
|
-
static
|
|
5
|
-
static
|
|
3
|
+
static generateFingerprint(): Promise<string>;
|
|
4
|
+
private static getWebGLFingerprint;
|
|
5
|
+
private static getCanvasFingerprint;
|
|
6
6
|
private static hashData;
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ import { WTSDKEnvironment } from "./environments";
|
|
|
4
4
|
export declare const WTConstants: {
|
|
5
5
|
readonly SDK: {
|
|
6
6
|
readonly PLATFORM: "web";
|
|
7
|
-
readonly VERSION: "2.0
|
|
7
|
+
readonly VERSION: "2.1.0";
|
|
8
8
|
};
|
|
9
9
|
readonly CONFIG: {
|
|
10
10
|
readonly DEFAULT_ENVIRONMENT: WTSDKEnvironment;
|
|
@@ -13,6 +13,8 @@ export declare const WTConstants: {
|
|
|
13
13
|
readonly LOG_LEVEL: WTLogLevel;
|
|
14
14
|
readonly SESSION_INTERVAL: "1800";
|
|
15
15
|
readonly SUBSESSION_INTERVAL: "300";
|
|
16
|
+
readonly HEARTBEAT_INTERVAL: "21600";
|
|
16
17
|
readonly PARAMETERS_VALUE: string | undefined;
|
|
17
18
|
};
|
|
19
|
+
readonly WT_DEEPLINK_PARAM: "wt_click_id";
|
|
18
20
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/** @internal */
|
|
2
2
|
export declare const WTEndpoints: {
|
|
3
|
-
readonly EVENTS:
|
|
4
|
-
readonly SESSIONS:
|
|
5
|
-
readonly SDK_CLICKS:
|
|
6
|
-
readonly
|
|
7
|
-
readonly ATTRIBUTIONS:
|
|
8
|
-
readonly
|
|
3
|
+
readonly EVENTS: string;
|
|
4
|
+
readonly SESSIONS: string;
|
|
5
|
+
readonly SDK_CLICKS: string;
|
|
6
|
+
readonly PUSH_TOKENS: string;
|
|
7
|
+
readonly ATTRIBUTIONS: string;
|
|
8
|
+
readonly CLICK_MATCHES: string;
|
|
9
|
+
readonly DEFERRED_LOOKUPS: string;
|
|
10
|
+
readonly HEARTBEATS: string;
|
|
11
|
+
readonly AUTH: string;
|
|
9
12
|
};
|
|
10
13
|
/** @internal */
|
|
11
14
|
export type WTEndpoints = (typeof WTEndpoints)[keyof typeof WTEndpoints];
|
|
@@ -11,6 +11,7 @@ export declare const WTUserEnvironment: {
|
|
|
11
11
|
export type WTUserEnvironment = (typeof WTUserEnvironment)[keyof typeof WTUserEnvironment];
|
|
12
12
|
/** @internal */
|
|
13
13
|
export declare const WTSDKEnvironment: {
|
|
14
|
+
readonly LOCAL: "local";
|
|
14
15
|
readonly DEBUG: "debug";
|
|
15
16
|
readonly STAGE: "stage";
|
|
16
17
|
readonly PRODUCTION: "production";
|
|
@@ -20,6 +21,5 @@ export type WTSDKEnvironment = (typeof WTSDKEnvironment)[keyof typeof WTSDKEnvir
|
|
|
20
21
|
/** @internal */
|
|
21
22
|
export declare const EnvironmentUtils: {
|
|
22
23
|
readonly sdkEnvironment: WTSDKEnvironment;
|
|
23
|
-
readonly needResponseDetails: boolean;
|
|
24
24
|
readonly baseUrl: string;
|
|
25
25
|
};
|
|
@@ -3,52 +3,37 @@ import { RequestRecord } from "./queue-data";
|
|
|
3
3
|
export declare class RequestsQueueManager {
|
|
4
4
|
private isInitialized;
|
|
5
5
|
private isProcessing;
|
|
6
|
-
private isCurrentlyProcessing;
|
|
7
6
|
private mutex;
|
|
8
7
|
private processingInterval;
|
|
9
8
|
private readonly PROCESSING_INTERVAL_MS;
|
|
9
|
+
private activeRequests;
|
|
10
10
|
private failedRequestDelay;
|
|
11
11
|
private readonly MAX_DELAY_MS;
|
|
12
12
|
private readonly BACKOFF_MULTIPLIER;
|
|
13
13
|
private readonly BASE_DELAY_MS;
|
|
14
|
+
private readonly MAX_CONCURRENT_REQUESTS;
|
|
14
15
|
constructor();
|
|
15
16
|
initialize(): Promise<void>;
|
|
16
17
|
shutdown(): Promise<void>;
|
|
17
|
-
private startProcessing;
|
|
18
|
-
private stopProcessing;
|
|
19
|
-
addRequest(request: RequestRecord): Promise<void>;
|
|
20
|
-
addPendingRequest(request: RequestRecord): Promise<void>;
|
|
21
|
-
private processQueues;
|
|
22
|
-
private processMainQueue;
|
|
23
|
-
private calculateBackoffDelay;
|
|
24
|
-
private processPendingQueue;
|
|
25
|
-
private sendRequest;
|
|
26
|
-
private getMainQueue;
|
|
27
|
-
private saveMainQueue;
|
|
28
|
-
private getPendingQueue;
|
|
29
|
-
private savePendingQueue;
|
|
30
|
-
private getMainRequestsSentFlag;
|
|
31
|
-
private postRequestCheck;
|
|
32
18
|
getQueueStatus(): {
|
|
33
|
-
|
|
34
|
-
pendingQueueLength: number;
|
|
19
|
+
queueLength: number;
|
|
35
20
|
isProcessing: boolean;
|
|
36
|
-
|
|
21
|
+
activeRequests: number;
|
|
37
22
|
isInBackoffDelay: boolean;
|
|
38
23
|
backoffEndsAt: number | null;
|
|
39
24
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
private startProcessing;
|
|
26
|
+
private stopProcessing;
|
|
27
|
+
addRequest(request: RequestRecord): Promise<void>;
|
|
28
|
+
private processQueues;
|
|
29
|
+
private canProcessNext;
|
|
30
|
+
private processNextRequest;
|
|
31
|
+
private finishRequest;
|
|
32
|
+
private sendRequest;
|
|
33
|
+
private calculateBackoffDelay;
|
|
34
|
+
private getQueue;
|
|
35
|
+
private saveQueue;
|
|
36
|
+
private canAddRequest;
|
|
52
37
|
}
|
|
53
38
|
/** @internal */
|
|
54
39
|
export declare const queueManager: RequestsQueueManager;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { WTEndpoints } from "../../constants/endpoints";
|
|
2
2
|
import { WTConfig } from "../../types/config/wt-config";
|
|
3
|
+
import { WTDeferredLookup } from "../../types/wt-deferred-lookup";
|
|
4
|
+
import { WTApiError } from "./network-error";
|
|
5
|
+
import { ApiResponseWrapper } from "./network-manager";
|
|
3
6
|
/** @internal */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
declare class ApiClient {
|
|
8
|
+
constructor();
|
|
9
|
+
doGetConfig(): Promise<WTConfig | WTApiError>;
|
|
10
|
+
doGetAuthToken(): Promise<Boolean | WTApiError>;
|
|
11
|
+
doGetDeferredData(): Promise<WTDeferredLookup | WTApiError>;
|
|
12
|
+
doSendHeartbeat(params: Record<string, any>): Promise<Boolean>;
|
|
13
|
+
doCallRequest(endpoint: WTEndpoints, params: Record<string, any>): Promise<ApiResponseWrapper | WTApiError>;
|
|
14
|
+
private refreshTokenPromise;
|
|
15
|
+
refreshToken(): Promise<Boolean | WTApiError>;
|
|
16
|
+
get isRefreshingToken(): boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const apiClient: ApiClient;
|
|
19
|
+
export {};
|
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
export declare abstract class WTApiError extends Error {
|
|
2
|
+
abstract readonly statusCode: number | null;
|
|
3
|
+
abstract readonly shouldRetryRequest: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Message suitable for showing to end users
|
|
6
|
+
*/
|
|
7
|
+
abstract readonly localizedMessage: string;
|
|
8
|
+
protected constructor(message?: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class ConnectionError extends WTApiError {
|
|
11
|
+
readonly statusCode: null;
|
|
12
|
+
readonly shouldRetryRequest = true;
|
|
13
|
+
readonly localizedMessage: string;
|
|
14
|
+
constructor(message?: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class HttpError extends WTApiError {
|
|
17
|
+
readonly statusCode: number;
|
|
18
|
+
readonly shouldRetryRequest: boolean;
|
|
19
|
+
readonly localizedMessage: string;
|
|
20
|
+
constructor(statusCode: number, message?: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class DecodingError extends WTApiError {
|
|
23
|
+
readonly statusCode: null;
|
|
24
|
+
readonly shouldRetryRequest = true;
|
|
25
|
+
readonly localizedMessage: string;
|
|
26
|
+
constructor(message?: string);
|
|
27
|
+
}
|
|
28
|
+
export declare class UnknownError extends WTApiError {
|
|
29
|
+
readonly statusCode: number | null;
|
|
30
|
+
readonly shouldRetryRequest = false;
|
|
31
|
+
readonly localizedMessage: string;
|
|
32
|
+
constructor(message?: string, statusCode?: number | null);
|
|
17
33
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WTApiError } from "./network-error";
|
|
1
2
|
import { RetryPolicy } from "./retry-policy";
|
|
2
3
|
type HttpMethod = "GET" | "POST" | "PUT";
|
|
3
4
|
/** @internal */
|
|
@@ -6,6 +7,7 @@ export interface RequestOptions {
|
|
|
6
7
|
headers?: Record<string, string>;
|
|
7
8
|
params?: Record<string, any>;
|
|
8
9
|
retryAttempt?: number;
|
|
10
|
+
needsAuthentication?: boolean;
|
|
9
11
|
}
|
|
10
12
|
/** @internal */
|
|
11
13
|
export interface ApiResponseWrapper {
|
|
@@ -14,8 +16,11 @@ export interface ApiResponseWrapper {
|
|
|
14
16
|
result?: any;
|
|
15
17
|
}
|
|
16
18
|
/** @internal */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
declare class NetworkManager {
|
|
20
|
+
private refreshHandler;
|
|
21
|
+
setRefreshHandler(handler: () => Promise<Boolean | WTApiError>): void;
|
|
22
|
+
retryPolicy(): RetryPolicy;
|
|
23
|
+
sendRequest(endpoint: string, options?: RequestOptions): Promise<ApiResponseWrapper | WTApiError>;
|
|
24
|
+
}
|
|
25
|
+
export declare const networkManager: NetworkManager;
|
|
21
26
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WTSDKEnvironment } from "../../constants/environments";
|
|
2
2
|
import { WTInitialConfig } from "../../types/config/initial-config";
|
|
3
3
|
import { WTConfig } from "../../types/config/wt-config";
|
|
4
|
+
import { WTDeferredLookup } from "../../types/wt-deferred-lookup";
|
|
4
5
|
import { RequestRecord } from "../caching/queue-data";
|
|
5
6
|
declare class StorageManager {
|
|
6
7
|
clear(): void;
|
|
@@ -36,8 +37,8 @@ declare class StorageManager {
|
|
|
36
37
|
set inactiveDuration(value: number);
|
|
37
38
|
get inactiveTime(): number | null;
|
|
38
39
|
set inactiveTime(value: number | null);
|
|
39
|
-
get
|
|
40
|
-
set
|
|
40
|
+
get lastActiveTime(): number | null;
|
|
41
|
+
set lastActiveTime(value: number | null);
|
|
41
42
|
get requestRecords(): RequestRecord[];
|
|
42
43
|
set requestRecords(value: RequestRecord[]);
|
|
43
44
|
get pendingRequestRecords(): RequestRecord[];
|
|
@@ -48,6 +49,26 @@ declare class StorageManager {
|
|
|
48
49
|
set sdkEnvironment(value: string);
|
|
49
50
|
get sdkVersion(): string;
|
|
50
51
|
set sdkVersion(value: string);
|
|
52
|
+
get clientSessionId(): string | null;
|
|
53
|
+
set clientSessionId(value: string | null);
|
|
54
|
+
get appStartTime(): number | null;
|
|
55
|
+
set appStartTime(value: number | null);
|
|
56
|
+
get deferredLinkHandled(): boolean;
|
|
57
|
+
set deferredLinkHandled(value: boolean);
|
|
58
|
+
get unmatchedDeeplinks(): string[];
|
|
59
|
+
set unmatchedDeeplinks(value: string[]);
|
|
60
|
+
get deferredData(): WTDeferredLookup | null;
|
|
61
|
+
set deferredData(value: WTDeferredLookup | null);
|
|
62
|
+
get appDeeplink(): string | null;
|
|
63
|
+
set appDeeplink(value: string | null);
|
|
64
|
+
get wiseId(): string | null;
|
|
65
|
+
set wiseId(value: string | null);
|
|
66
|
+
get nextClientSessionId(): string | null;
|
|
67
|
+
set nextClientSessionId(value: string | null);
|
|
68
|
+
get lastSessionStart(): string | null;
|
|
69
|
+
set lastSessionStart(value: string | null);
|
|
70
|
+
get authToken(): string | null;
|
|
71
|
+
set authToken(value: string | null);
|
|
51
72
|
}
|
|
52
73
|
/** @internal */
|
|
53
74
|
export declare const storageManager: StorageManager;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { WTInitialConfig } from "../types/config/initial-config";
|
|
2
2
|
import { WTEvent } from "../types/event/wt-event";
|
|
3
|
+
import { DeeplinkHandler } from "../utils/lifecycle-observer";
|
|
3
4
|
import { WTLogLevel } from "../utils/logger";
|
|
4
5
|
/**
|
|
5
6
|
* The main entry point for the WiseTrack Web SDK.
|
|
@@ -9,7 +10,8 @@ import { WTLogLevel } from "../utils/logger";
|
|
|
9
10
|
* @example
|
|
10
11
|
* ```ts
|
|
11
12
|
* const initialConfig: WTInitialConfig = {
|
|
12
|
-
* appToken: appToken
|
|
13
|
+
* appToken: appToken,
|
|
14
|
+
* clientSecret: clientSecret,
|
|
13
15
|
* appFrameWork: "native",
|
|
14
16
|
* appVersion: "1.0.0",
|
|
15
17
|
* };
|
|
@@ -24,7 +26,7 @@ export declare class WiseTrack {
|
|
|
24
26
|
static get instance(): WiseTrack;
|
|
25
27
|
private constructor();
|
|
26
28
|
private sdkInitialized;
|
|
27
|
-
private
|
|
29
|
+
private initializationPromise;
|
|
28
30
|
/**
|
|
29
31
|
* Initializes the WiseTrack SDK with the given configuration.
|
|
30
32
|
*
|
|
@@ -35,7 +37,8 @@ export declare class WiseTrack {
|
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
37
39
|
* const initialConfig: WTInitialConfig = {
|
|
38
|
-
* appToken: appToken
|
|
40
|
+
* appToken: appToken,
|
|
41
|
+
* clientSecret: clientSecret,
|
|
39
42
|
* appFrameWork: "native", // your current web app framework (native, reactjs, nextjs, ...)
|
|
40
43
|
* appVersion: "1.0.0", // your current web app version
|
|
41
44
|
* };
|
|
@@ -43,6 +46,11 @@ export declare class WiseTrack {
|
|
|
43
46
|
* ```
|
|
44
47
|
*/
|
|
45
48
|
init(initConfig: WTInitialConfig): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Performs the actual SDK initialization.
|
|
51
|
+
* Runs asynchronously without blocking the main thread.
|
|
52
|
+
*/
|
|
53
|
+
private performInitialization;
|
|
46
54
|
/**
|
|
47
55
|
* Sets the log level for internal SDK logging.
|
|
48
56
|
*
|
|
@@ -117,10 +125,24 @@ export declare class WiseTrack {
|
|
|
117
125
|
* ```
|
|
118
126
|
*/
|
|
119
127
|
trackEvent(event: WTEvent): Promise<void>;
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Sets a callback listener for deeplink events.
|
|
130
|
+
* The callback will be invoked when a deeplink is received, providing the intent and whether it's a deferred deeplink.
|
|
131
|
+
*
|
|
132
|
+
* @param callback The callback to be invoked when a deeplink is received.
|
|
133
|
+
*/
|
|
134
|
+
setOnDeeplinkListener(callback: DeeplinkHandler): void;
|
|
135
|
+
/**
|
|
136
|
+
* Retrieves the last recorded deeplink, if available.
|
|
137
|
+
*
|
|
138
|
+
* @return The last deeplink string, or null if not available.
|
|
139
|
+
*/
|
|
140
|
+
getLastDeeplink(): string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves the deferred deeplink from storage, if available.
|
|
143
|
+
* Deferred deeplinks are used for attribution of app installs.
|
|
144
|
+
*
|
|
145
|
+
* @return The deferred deeplink string, or null if not available.
|
|
146
|
+
*/
|
|
147
|
+
getDeferredDeeplink(): string | null;
|
|
126
148
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WTInitialConfig } from "../types/config/initial-config";
|
|
2
|
+
/** @internal */
|
|
3
|
+
declare class WTConfigure {
|
|
4
|
+
configureSDK(initConfig: WTInitialConfig): Promise<void>;
|
|
5
|
+
/** @internal */
|
|
6
|
+
private getConfig;
|
|
7
|
+
/** @internal */
|
|
8
|
+
private getAuth;
|
|
9
|
+
/** @internal */
|
|
10
|
+
private deferredLookup;
|
|
11
|
+
/** @internal */
|
|
12
|
+
private checkSdkEnabled;
|
|
13
|
+
/** @internal */
|
|
14
|
+
private checkSdkUpdate;
|
|
15
|
+
}
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare const configure: WTConfigure;
|
|
18
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WTEvent } from "../types/event/wt-event";
|
|
2
|
+
import { DeeplinkHandler } from "../utils/lifecycle-observer";
|
|
2
3
|
/** @internal */
|
|
3
4
|
declare class WTTracker {
|
|
4
5
|
private isRunning;
|
|
@@ -7,17 +8,19 @@ declare class WTTracker {
|
|
|
7
8
|
initialize(): Promise<void>;
|
|
8
9
|
startTracking(): Promise<void>;
|
|
9
10
|
stopTracking(): Promise<void>;
|
|
11
|
+
destroy(): Promise<void>;
|
|
10
12
|
checkPushToken(token: string): Promise<void>;
|
|
11
13
|
trackEvent(event: WTEvent): Promise<void>;
|
|
14
|
+
setOnDeeplinkListener(callback: DeeplinkHandler): void;
|
|
12
15
|
private getCountryCode;
|
|
13
16
|
private createAttribution;
|
|
14
17
|
private checkFirstSession;
|
|
15
18
|
private checkSdkClicks;
|
|
16
19
|
private createRequest;
|
|
17
20
|
private createDeviceID;
|
|
21
|
+
private checkDeepLinks;
|
|
22
|
+
private createClickMatch;
|
|
18
23
|
private setActivityTimes;
|
|
19
|
-
private checkSessionIntervals;
|
|
20
|
-
private isVisibleFocused;
|
|
21
24
|
private addObservers;
|
|
22
25
|
}
|
|
23
26
|
/** @internal */
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { WTUserEnvironment } from "./constants/environments";
|
|
2
2
|
export { ResourceWrapper } from "./constants/resource-wrapper";
|
|
3
3
|
export { WiseTrack } from "./core/wisetrack";
|
|
4
|
-
export { WTInitialConfig } from "./types/config/initial-config";
|
|
4
|
+
export type { WTInitialConfig } from "./types/config/initial-config";
|
|
5
5
|
export { RevenueCurrency } from "./types/event/revenue-currency";
|
|
6
|
-
export { EventParam
|
|
6
|
+
export type { EventParam } from "./types/event/wt-event";
|
|
7
|
+
export { WTEvent } from "./types/event/wt-event";
|
|
7
8
|
export { WTLogger, WTLogLevel } from "./utils/logger";
|
|
9
|
+
export type { DeeplinkHandler } from "./utils/lifecycle-observer";
|