wisetrack 2.0.1 → 2.0.2
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 +9 -10
- package/dist/cdn/sdk.bundle.min.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +4 -2
- package/dist/constants/constants.d.ts +0 -20
- package/dist/constants/constants.js +0 -19
- package/dist/constants/constants.js.map +0 -1
- package/dist/constants/endpoints.d.ts +0 -11
- package/dist/constants/endpoints.js +0 -10
- package/dist/constants/endpoints.js.map +0 -1
- package/dist/constants/environments.d.ts +0 -25
- package/dist/constants/environments.js +0 -37
- package/dist/constants/environments.js.map +0 -1
- package/dist/core/caching/queue-data.d.ts +0 -25
- package/dist/core/caching/queue-data.js +0 -50
- package/dist/core/caching/queue-data.js.map +0 -1
- package/dist/core/caching/request-queue-manager.d.ts +0 -54
- package/dist/core/caching/request-queue-manager.js +0 -333
- package/dist/core/caching/request-queue-manager.js.map +0 -1
- package/dist/core/fields/event-fields-builder.d.ts +0 -8
- package/dist/core/fields/event-fields-builder.js +0 -29
- package/dist/core/fields/event-fields-builder.js.map +0 -1
- package/dist/core/fields/fields-builder.d.ts +0 -9
- package/dist/core/fields/fields-builder.js +0 -120
- package/dist/core/fields/fields-builder.js.map +0 -1
- package/dist/core/network/api-client.d.ts +0 -9
- package/dist/core/network/api-client.js +0 -88
- package/dist/core/network/api-client.js.map +0 -1
- package/dist/core/network/network-error.d.ts +0 -17
- package/dist/core/network/network-error.js +0 -35
- package/dist/core/network/network-error.js.map +0 -1
- package/dist/core/network/network-manager.d.ts +0 -22
- package/dist/core/network/network-manager.js +0 -72
- package/dist/core/network/network-manager.js.map +0 -1
- package/dist/core/network/retry-policy.d.ts +0 -8
- package/dist/core/network/retry-policy.js +0 -26
- package/dist/core/network/retry-policy.js.map +0 -1
- package/dist/core/storage/storage-manager.d.ts +0 -52
- package/dist/core/storage/storage-manager.js +0 -221
- package/dist/core/storage/storage-manager.js.map +0 -1
- package/dist/core/wisetrack.d.ts +0 -125
- package/dist/core/wisetrack.js +0 -277
- package/dist/core/wisetrack.js.map +0 -1
- package/dist/core/wt-tracker.d.ts +0 -25
- package/dist/core/wt-tracker.js +0 -239
- package/dist/core/wt-tracker.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -4
- package/dist/index.js.map +0 -1
- package/dist/types/config/initial-config.d.ts +0 -43
- package/dist/types/config/initial-config.js +0 -2
- package/dist/types/config/initial-config.js.map +0 -1
- package/dist/types/config/wt-app-settings.d.ts +0 -15
- package/dist/types/config/wt-app-settings.js +0 -25
- package/dist/types/config/wt-app-settings.js.map +0 -1
- package/dist/types/config/wt-config.d.ts +0 -18
- package/dist/types/config/wt-config.js +0 -28
- package/dist/types/config/wt-config.js.map +0 -1
- package/dist/types/event/revenue-currency.d.ts +0 -39
- package/dist/types/event/revenue-currency.js +0 -39
- package/dist/types/event/revenue-currency.js.map +0 -1
- package/dist/types/event/wt-event.d.ts +0 -94
- package/dist/types/event/wt-event.js +0 -93
- package/dist/types/event/wt-event.js.map +0 -1
- package/dist/utils/activity-ticker.d.ts +0 -12
- package/dist/utils/activity-ticker.js +0 -37
- package/dist/utils/activity-ticker.js.map +0 -1
- package/dist/utils/country-finder.d.ts +0 -9
- package/dist/utils/country-finder.js +0 -71
- package/dist/utils/country-finder.js.map +0 -1
- package/dist/utils/crypto-helper.d.ts +0 -4
- package/dist/utils/crypto-helper.js +0 -7
- package/dist/utils/crypto-helper.js.map +0 -1
- package/dist/utils/device-detector.d.ts +0 -41
- package/dist/utils/device-detector.js +0 -101
- package/dist/utils/device-detector.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -36
- package/dist/utils/logger.js +0 -84
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/storage-support.d.ts +0 -16
- package/dist/utils/storage-support.js +0 -86
- package/dist/utils/storage-support.js.map +0 -1
- package/dist/utils/utils.d.ts +0 -5
- package/dist/utils/utils.js +0 -95
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/webgl-fingerprint.d.ts +0 -7
- package/dist/utils/webgl-fingerprint.js +0 -100
- package/dist/utils/webgl-fingerprint.js.map +0 -1
package/dist/core/wt-tracker.js
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { WTEndpoints } from "../constants/endpoints";
|
|
11
|
-
import { activityTicker } from "../utils/activity-ticker";
|
|
12
|
-
import { countryFinder } from "../utils/country-finder";
|
|
13
|
-
import { cryptoHelper } from "../utils/crypto-helper";
|
|
14
|
-
import { WTLogger } from "../utils/logger";
|
|
15
|
-
import { RequestRecord } from "./caching/queue-data";
|
|
16
|
-
import { queueManager } from "./caching/request-queue-manager";
|
|
17
|
-
import { EventFieldsBuilder } from "./fields/event-fields-builder";
|
|
18
|
-
import { fieldsBuilder } from "./fields/fields-builder";
|
|
19
|
-
import { storageManager } from "./storage/storage-manager";
|
|
20
|
-
/** @internal */
|
|
21
|
-
class WTTracker {
|
|
22
|
-
constructor() {
|
|
23
|
-
this.isRunning = false;
|
|
24
|
-
this.initialized = false;
|
|
25
|
-
}
|
|
26
|
-
get isEnabled() {
|
|
27
|
-
return storageManager.sdkEnabled;
|
|
28
|
-
}
|
|
29
|
-
initialize() {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
this.getCountryCode();
|
|
32
|
-
yield this.setActivityTimes();
|
|
33
|
-
this.createDeviceID();
|
|
34
|
-
this.addObservers();
|
|
35
|
-
this.initialized = true;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
startTracking() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
if (!this.isEnabled) {
|
|
41
|
-
WTLogger.warn("SDK is not enabled to start tracking!");
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
WTLogger.debug("WT Tracker started");
|
|
45
|
-
yield queueManager.initialize();
|
|
46
|
-
yield this.checkSdkClicks();
|
|
47
|
-
yield this.checkFirstSession();
|
|
48
|
-
yield this.createAttribution();
|
|
49
|
-
this.isRunning = true;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
stopTracking() {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
this.isRunning = false;
|
|
55
|
-
activityTicker.stop();
|
|
56
|
-
yield queueManager.shutdown();
|
|
57
|
-
WTLogger.debug("WT Tracker stopped");
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
checkPushToken(token) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
storageManager.pushToken = token;
|
|
63
|
-
if (!this.isEnabled) {
|
|
64
|
-
WTLogger.warn("CheckPushToken: SDK is not enabled");
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (storageManager.fcmToken === token) {
|
|
68
|
-
WTLogger.info("This Notification token has sent to server previously");
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
yield this.createRequest({
|
|
72
|
-
endpoint: WTEndpoints.SDK_INFOS,
|
|
73
|
-
queueType: "pending",
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
trackEvent(event) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
if (!this.isEnabled) {
|
|
80
|
-
WTLogger.warn("trackEvent: SDK is not enabled");
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (!this.initialized) {
|
|
84
|
-
WTLogger.warn("trackEvent: SDK is not initialized yet");
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
storageManager.eventCount += 1;
|
|
88
|
-
yield this.createRequest({
|
|
89
|
-
endpoint: WTEndpoints.EVENTS,
|
|
90
|
-
fBuilder: new EventFieldsBuilder(event),
|
|
91
|
-
queueType: "pending",
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
// =======================================================================
|
|
96
|
-
getCountryCode() {
|
|
97
|
-
countryFinder.getCountryCode();
|
|
98
|
-
}
|
|
99
|
-
createAttribution() {
|
|
100
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
if (!this.isEnabled) {
|
|
102
|
-
WTLogger.warn("Creating Attribution: SDK is not enabled!");
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
yield this.createRequest({
|
|
106
|
-
endpoint: WTEndpoints.ATTRIBUTIONS,
|
|
107
|
-
queueType: "pending",
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
checkFirstSession() {
|
|
112
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
if (!this.isEnabled) {
|
|
114
|
-
WTLogger.warn("Creating First Session: SDK is not enabled!");
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (storageManager.firstSessionSubmit) {
|
|
118
|
-
WTLogger.debug("Creating Session: First-Session has already submitted");
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
yield this.createRequest({
|
|
122
|
-
endpoint: WTEndpoints.SESSIONS,
|
|
123
|
-
queueType: storageManager.sdkClickSubmit ? "main" : "pending",
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
checkSdkClicks() {
|
|
128
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
-
if (!this.isEnabled) {
|
|
130
|
-
WTLogger.warn("Creating Install: SDK is not enabled!");
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (storageManager.sdkClickSubmit) {
|
|
134
|
-
WTLogger.debug("Creating Install: SDK-Clicks has already submitted");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
yield this.createRequest({
|
|
138
|
-
endpoint: WTEndpoints.SDK_CLICKS,
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
createRequest(_a) {
|
|
143
|
-
return __awaiter(this, arguments, void 0, function* ({ endpoint, fBuilder = fieldsBuilder, queueType = "main", }) {
|
|
144
|
-
const fields = yield fBuilder.build();
|
|
145
|
-
const request = new RequestRecord(endpoint, fields);
|
|
146
|
-
if (queueType === "pending") {
|
|
147
|
-
WTLogger.info(`Add ${endpoint} request to pending queue`);
|
|
148
|
-
yield queueManager.addPendingRequest(request);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
WTLogger.info(`Add ${endpoint} request to main queue`);
|
|
152
|
-
yield queueManager.addRequest(request);
|
|
153
|
-
}
|
|
154
|
-
const queueStatus = queueManager.getQueueStatus();
|
|
155
|
-
console.log(JSON.stringify(queueStatus));
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
createDeviceID() {
|
|
159
|
-
if (!storageManager.deviceId) {
|
|
160
|
-
storageManager.deviceId = cryptoHelper.generateDeviceUUID();
|
|
161
|
-
}
|
|
162
|
-
if (!storageManager.initialDate) {
|
|
163
|
-
storageManager.initialDate = new Date().toISOString();
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
setActivityTimes() {
|
|
167
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
-
// Update inactive time to last stored active time
|
|
169
|
-
if (storageManager.activeTime) {
|
|
170
|
-
storageManager.inactiveTime = storageManager.activeTime;
|
|
171
|
-
const inteval = Date.now() - storageManager.inactiveTime;
|
|
172
|
-
storageManager.inactiveDuration += inteval;
|
|
173
|
-
console.log(`User was inactived for ${inteval / 1000}s | (${storageManager.inactiveDuration / 1000}s Totaly)`);
|
|
174
|
-
yield this.checkSessionIntervals();
|
|
175
|
-
}
|
|
176
|
-
// update active time to now and start ticker for update active time/duration per 1s
|
|
177
|
-
storageManager.activeTime = Date.now();
|
|
178
|
-
activityTicker.start();
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
checkSessionIntervals() {
|
|
182
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
var _a, _b;
|
|
184
|
-
const inactiveTime = storageManager.inactiveTime;
|
|
185
|
-
const sessionInterval = (_a = storageManager.appSettings) === null || _a === void 0 ? void 0 : _a.sessionInterval;
|
|
186
|
-
const subsessionInterval = (_b = storageManager.appSettings) === null || _b === void 0 ? void 0 : _b.subsessionInterval;
|
|
187
|
-
if (!this.isEnabled) {
|
|
188
|
-
WTLogger.warn("Creating Session: SDK is not enabled!");
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
if (!inactiveTime || !sessionInterval || !subsessionInterval) {
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
const interval = Date.now() - inactiveTime;
|
|
195
|
-
if (interval > parseInt(sessionInterval)) {
|
|
196
|
-
storageManager.sessionCount += 1;
|
|
197
|
-
yield this.createRequest({
|
|
198
|
-
endpoint: WTEndpoints.SESSIONS,
|
|
199
|
-
queueType: storageManager.sdkClickSubmit ? "main" : "pending",
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
else if (interval > parseInt(subsessionInterval)) {
|
|
203
|
-
storageManager.subSessionCount += 1;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
isVisibleFocused() {
|
|
208
|
-
return document.visibilityState === "visible" && document.hasFocus();
|
|
209
|
-
}
|
|
210
|
-
addObservers() {
|
|
211
|
-
// document.addEventListener("load", () => {
|
|
212
|
-
// this.setActivityTimes();
|
|
213
|
-
// });
|
|
214
|
-
window.addEventListener("beforeunload", () => {
|
|
215
|
-
activityTicker.stop();
|
|
216
|
-
});
|
|
217
|
-
document.addEventListener("visibilitychange", () => {
|
|
218
|
-
if (this.isVisibleFocused()) {
|
|
219
|
-
this.createAttribution();
|
|
220
|
-
this.setActivityTimes();
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
activityTicker.stop();
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
window.addEventListener("focus", () => {
|
|
227
|
-
if (this.isVisibleFocused()) {
|
|
228
|
-
this.createAttribution();
|
|
229
|
-
this.setActivityTimes();
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
window.addEventListener("blur", () => {
|
|
233
|
-
activityTicker.stop();
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/** @internal */
|
|
238
|
-
export const tracker = new WTTracker();
|
|
239
|
-
//# sourceMappingURL=wt-tracker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wt-tracker.js","sourceRoot":"","sources":["../../src/core/wt-tracker.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,gBAAgB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IAAI,EAAE,CAAC;YACxB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACpC,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;gBAC5B,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACzB,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;YACnC,cAAc,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { WTUserEnvironment } from "../../constants/environments";
|
|
2
|
-
import { WTLogLevel } from "../../utils/logger";
|
|
3
|
-
/**
|
|
4
|
-
* The initial configuration required to initialize the WiseTrack SDK.
|
|
5
|
-
*/
|
|
6
|
-
export interface WTInitialConfig {
|
|
7
|
-
/**
|
|
8
|
-
* The unique application token provided by WiseTrack Panel.
|
|
9
|
-
*/
|
|
10
|
-
appToken: string;
|
|
11
|
-
/**
|
|
12
|
-
* The version of your application.
|
|
13
|
-
*/
|
|
14
|
-
appVersion: String;
|
|
15
|
-
/**
|
|
16
|
-
* The framework or platform name (e.g., `native`, `react`, `next.js`).
|
|
17
|
-
*/
|
|
18
|
-
appFrameWork: String;
|
|
19
|
-
/**
|
|
20
|
-
* The user environment (sandbox or production). Defaults to `PRODUCTION`.
|
|
21
|
-
*/
|
|
22
|
-
userEnvironment?: WTUserEnvironment;
|
|
23
|
-
/**
|
|
24
|
-
* The waiting time in seconds before the tracker starts automatically.
|
|
25
|
-
*/
|
|
26
|
-
trackingWaitingTime?: number;
|
|
27
|
-
/**
|
|
28
|
-
* If `true` (default), the tracker will start automatically after initialization.
|
|
29
|
-
*/
|
|
30
|
-
startTrackerAutomatically?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* A custom device identifier.
|
|
33
|
-
*/
|
|
34
|
-
customDeviceId?: string;
|
|
35
|
-
/**
|
|
36
|
-
* An optional default tracker name.
|
|
37
|
-
*/
|
|
38
|
-
defaultTracker?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Sets the log level for SDK logging.
|
|
41
|
-
*/
|
|
42
|
-
logLevel?: WTLogLevel;
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initial-config.js","sourceRoot":"","sources":["../../../src/types/config/initial-config.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { WTConfig } from "./wt-config";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare class WTAppSettings {
|
|
4
|
-
events: string;
|
|
5
|
-
sessions: string;
|
|
6
|
-
sdkClicks: string;
|
|
7
|
-
sdkInfos: string;
|
|
8
|
-
attributions: string;
|
|
9
|
-
sessionInterval: string;
|
|
10
|
-
subsessionInterval: string;
|
|
11
|
-
constructor(events: string, sessions: string, sdkClicks: string, sdkInfos: string, attributions: string, sessionInterval?: string, subsessionInterval?: string);
|
|
12
|
-
static fromConfig(config: WTConfig): WTAppSettings;
|
|
13
|
-
static fromJson(json: any): WTAppSettings;
|
|
14
|
-
static get defaultValue(): WTAppSettings;
|
|
15
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { WTConstants } from "../../constants/constants";
|
|
2
|
-
import { WTEndpoints } from "../../constants/endpoints";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export class WTAppSettings {
|
|
5
|
-
constructor(events, sessions, sdkClicks, sdkInfos, attributions, sessionInterval = WTConstants.DEFAULTS.SESSION_INTERVAL, subsessionInterval = WTConstants.DEFAULTS.SUBSESSION_INTERVAL) {
|
|
6
|
-
this.events = events;
|
|
7
|
-
this.sessions = sessions;
|
|
8
|
-
this.sdkClicks = sdkClicks;
|
|
9
|
-
this.sdkInfos = sdkInfos;
|
|
10
|
-
this.attributions = attributions;
|
|
11
|
-
this.sessionInterval = sessionInterval;
|
|
12
|
-
this.subsessionInterval = subsessionInterval;
|
|
13
|
-
}
|
|
14
|
-
static fromConfig(config) {
|
|
15
|
-
return new WTAppSettings(config.events, config.sessions, config.sdkClicks, config.sdkInfos, config.attributions, config.sessionInterval, config.subsessionInterval);
|
|
16
|
-
}
|
|
17
|
-
static fromJson(json) {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
return new WTAppSettings(json.events, json.sessions, json.sdk_clicks, json.sdk_infos, json.attributions, (_a = json.session_interval) !== null && _a !== void 0 ? _a : WTConstants.DEFAULTS.SESSION_INTERVAL, (_b = json.subsession_interval) !== null && _b !== void 0 ? _b : WTConstants.DEFAULTS.SUBSESSION_INTERVAL);
|
|
20
|
-
}
|
|
21
|
-
static get defaultValue() {
|
|
22
|
-
return new WTAppSettings(WTEndpoints.EVENTS, WTEndpoints.SESSIONS, WTEndpoints.SDK_CLICKS, WTEndpoints.SDK_INFOS, WTEndpoints.ATTRIBUTIONS, WTConstants.DEFAULTS.SESSION_INTERVAL, WTConstants.DEFAULTS.SUBSESSION_INTERVAL);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=wt-app-settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wt-app-settings.js","sourceRoot":"","sources":["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,CAAC,mBAAmB,CACrE,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,IAAI,aAAa,CACtB,WAAW,CAAC,MAAM,EAClB,WAAW,CAAC,QAAQ,EACpB,WAAW,CAAC,UAAU,EACtB,WAAW,CAAC,SAAS,EACrB,WAAW,CAAC,YAAY,EACxB,WAAW,CAAC,QAAQ,CAAC,gBAAgB,EACrC,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CACzC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
export declare class WTConfig {
|
|
3
|
-
baseUrl: string;
|
|
4
|
-
events?: string;
|
|
5
|
-
sessions?: string;
|
|
6
|
-
sdkClicks?: string;
|
|
7
|
-
sdkInfos?: string;
|
|
8
|
-
attributions?: string;
|
|
9
|
-
appSettings?: string;
|
|
10
|
-
sdkEnabled: boolean;
|
|
11
|
-
forceUpdate: boolean;
|
|
12
|
-
sdkUpdate: boolean;
|
|
13
|
-
sessionInterval: string;
|
|
14
|
-
subsessionInterval: string;
|
|
15
|
-
constructor(baseUrl: string, events?: string, sessions?: string, sdkClicks?: string, sdkInfos?: string, attributions?: string, appSettings?: string, sdkEnabled?: boolean, forceUpdate?: boolean, sdkUpdate?: boolean, sessionInterval?: string, subsessionInterval?: string);
|
|
16
|
-
static fromJson(json: any): WTConfig;
|
|
17
|
-
static get defaultValue(): WTConfig;
|
|
18
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { WTConstants } from "../../constants/constants";
|
|
2
|
-
import { WTEndpoints } from "../../constants/endpoints";
|
|
3
|
-
import { EnvironmentUtils } from "../../constants/environments";
|
|
4
|
-
/** @internal */
|
|
5
|
-
export class WTConfig {
|
|
6
|
-
constructor(baseUrl, events, sessions, sdkClicks, sdkInfos, attributions, appSettings, sdkEnabled = true, forceUpdate = false, sdkUpdate = false, sessionInterval = WTConstants.DEFAULTS.SESSION_INTERVAL, subsessionInterval = WTConstants.DEFAULTS.SUBSESSION_INTERVAL) {
|
|
7
|
-
this.baseUrl = baseUrl;
|
|
8
|
-
this.events = events;
|
|
9
|
-
this.sessions = sessions;
|
|
10
|
-
this.sdkClicks = sdkClicks;
|
|
11
|
-
this.sdkInfos = sdkInfos;
|
|
12
|
-
this.attributions = attributions;
|
|
13
|
-
this.appSettings = appSettings;
|
|
14
|
-
this.sdkEnabled = sdkEnabled;
|
|
15
|
-
this.forceUpdate = forceUpdate;
|
|
16
|
-
this.sdkUpdate = sdkUpdate;
|
|
17
|
-
this.sessionInterval = sessionInterval;
|
|
18
|
-
this.subsessionInterval = subsessionInterval;
|
|
19
|
-
}
|
|
20
|
-
static fromJson(json) {
|
|
21
|
-
var _a, _b, _c, _d, _e;
|
|
22
|
-
return new WTConfig(json.base_url, json.events, json.sessions, json.sdk_clicks, json.sdk_infos, json.attributions, json.app_settings, (_a = json.sdk_enabled) !== null && _a !== void 0 ? _a : true, (_b = json.force_update) !== null && _b !== void 0 ? _b : false, (_c = json.sdk_update) !== null && _c !== void 0 ? _c : false, (_d = json.session_interval) !== null && _d !== void 0 ? _d : WTConstants.DEFAULTS.SESSION_INTERVAL, (_e = json.subsession_interval) !== null && _e !== void 0 ? _e : WTConstants.DEFAULTS.SUBSESSION_INTERVAL);
|
|
23
|
-
}
|
|
24
|
-
static get defaultValue() {
|
|
25
|
-
return new WTConfig(EnvironmentUtils.baseUrl(), WTEndpoints.EVENTS, WTEndpoints.SESSIONS, WTEndpoints.SDK_CLICKS, WTEndpoints.SDK_INFOS, WTEndpoints.ATTRIBUTIONS, WTEndpoints.APP_SETTINGS);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=wt-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wt-config.js","sourceRoot":"","sources":["../../../src/types/config/wt-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,C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YAAY,mCAAI,KAAK,EAC1B,MAAA,IAAI,CAAC,UAAU,mCAAI,KAAK,EACxB,MAAA,IAAI,CAAC,gBAAgB,mCAAI,WAAW,CAAC,QAAQ,CAAC,gBAAgB,EAC9D,MAAA,IAAI,CAAC,mBAAmB,mCAAI,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CACrE,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,IAAI,QAAQ,CACjB,gBAAgB,CAAC,OAAO,EAAE,EAC1B,WAAW,CAAC,MAAM,EAClB,WAAW,CAAC,QAAQ,EACpB,WAAW,CAAC,UAAU,EACtB,WAAW,CAAC,SAAS,EACrB,WAAW,CAAC,YAAY,EACxB,WAAW,CAAC,YAAY,CACzB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported currencies for revenue events.
|
|
3
|
-
*
|
|
4
|
-
* Use one of these standard ISO currency codes when tracking revenue.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* RevenueCurrency.USD // "USD"
|
|
8
|
-
*/
|
|
9
|
-
export declare const RevenueCurrency: {
|
|
10
|
-
readonly USD: "USD";
|
|
11
|
-
readonly EUR: "EUR";
|
|
12
|
-
readonly JPY: "JPY";
|
|
13
|
-
readonly GBP: "GBP";
|
|
14
|
-
readonly AUD: "AUD";
|
|
15
|
-
readonly CAD: "CAD";
|
|
16
|
-
readonly CHF: "CHF";
|
|
17
|
-
readonly CNY: "CNY";
|
|
18
|
-
readonly SEK: "SEK";
|
|
19
|
-
readonly NZD: "NZD";
|
|
20
|
-
readonly MXN: "MXN";
|
|
21
|
-
readonly SGD: "SGD";
|
|
22
|
-
readonly HKD: "HKD";
|
|
23
|
-
readonly NOK: "NOK";
|
|
24
|
-
readonly KRW: "KRW";
|
|
25
|
-
readonly TRY: "TRY";
|
|
26
|
-
readonly RUB: "RUB";
|
|
27
|
-
readonly INR: "INR";
|
|
28
|
-
readonly BRL: "BRL";
|
|
29
|
-
readonly ZAR: "ZAR";
|
|
30
|
-
readonly IRR: "IRR";
|
|
31
|
-
readonly AED: "AED";
|
|
32
|
-
readonly IQD: "IQD";
|
|
33
|
-
readonly SAR: "SAR";
|
|
34
|
-
readonly OMR: "OMR";
|
|
35
|
-
readonly BTC: "BTC";
|
|
36
|
-
readonly EHT: "EHT";
|
|
37
|
-
readonly LTC: "LTC";
|
|
38
|
-
};
|
|
39
|
-
export type RevenueCurrency = (typeof RevenueCurrency)[keyof typeof RevenueCurrency];
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported currencies for revenue events.
|
|
3
|
-
*
|
|
4
|
-
* Use one of these standard ISO currency codes when tracking revenue.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* RevenueCurrency.USD // "USD"
|
|
8
|
-
*/
|
|
9
|
-
export const RevenueCurrency = {
|
|
10
|
-
USD: "USD",
|
|
11
|
-
EUR: "EUR",
|
|
12
|
-
JPY: "JPY",
|
|
13
|
-
GBP: "GBP",
|
|
14
|
-
AUD: "AUD",
|
|
15
|
-
CAD: "CAD",
|
|
16
|
-
CHF: "CHF",
|
|
17
|
-
CNY: "CNY",
|
|
18
|
-
SEK: "SEK",
|
|
19
|
-
NZD: "NZD",
|
|
20
|
-
MXN: "MXN",
|
|
21
|
-
SGD: "SGD",
|
|
22
|
-
HKD: "HKD",
|
|
23
|
-
NOK: "NOK",
|
|
24
|
-
KRW: "KRW",
|
|
25
|
-
TRY: "TRY",
|
|
26
|
-
RUB: "RUB",
|
|
27
|
-
INR: "INR",
|
|
28
|
-
BRL: "BRL",
|
|
29
|
-
ZAR: "ZAR",
|
|
30
|
-
IRR: "IRR",
|
|
31
|
-
AED: "AED",
|
|
32
|
-
IQD: "IQD",
|
|
33
|
-
SAR: "SAR",
|
|
34
|
-
OMR: "OMR",
|
|
35
|
-
BTC: "BTC",
|
|
36
|
-
EHT: "EHT",
|
|
37
|
-
LTC: "LTC",
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=revenue-currency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revenue-currency.js","sourceRoot":"","sources":["../../../src/types/event/revenue-currency.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;CACF,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { RevenueCurrency } from "./revenue-currency";
|
|
2
|
-
type WTEventType = "default" | "revenue";
|
|
3
|
-
type EventParam = string | number | boolean;
|
|
4
|
-
export declare namespace WTEvent {
|
|
5
|
-
/**
|
|
6
|
-
* Represents a generic custom event.
|
|
7
|
-
*
|
|
8
|
-
* Use this class to log custom actions performed by the user.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const event = new WTEvent.Default("signup");
|
|
13
|
-
* event.addParam("method", "Google");
|
|
14
|
-
* WiseTrack.instance.trackEvent(event);
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
class Default {
|
|
18
|
-
/**
|
|
19
|
-
* The type of event.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
readonly type: WTEventType;
|
|
23
|
-
/**
|
|
24
|
-
* Optional custom key-value parameters for the event.
|
|
25
|
-
*/
|
|
26
|
-
params?: Record<string, EventParam>;
|
|
27
|
-
/**
|
|
28
|
-
* The name of the event.
|
|
29
|
-
*/
|
|
30
|
-
name: string;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a new custom event.
|
|
33
|
-
* @param name - The name of the event.
|
|
34
|
-
*/
|
|
35
|
-
constructor(name: string);
|
|
36
|
-
/**
|
|
37
|
-
* Adds a parameter to the event.
|
|
38
|
-
*
|
|
39
|
-
* @param key - The parameter key.
|
|
40
|
-
* @param value - The parameter value.
|
|
41
|
-
*/
|
|
42
|
-
addParam(key: string, value: EventParam): void;
|
|
43
|
-
/** @internal */
|
|
44
|
-
toJSON(): {
|
|
45
|
-
event_type: WTEventType;
|
|
46
|
-
event_name: string;
|
|
47
|
-
partner_params: Record<string, EventParam> | undefined;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Represents a revenue event with an amount and currency.
|
|
52
|
-
*
|
|
53
|
-
* Use this class to log purchases or monetary transactions.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const purchase = new WTEvent.Revenue("order_complete", 49.99, RevenueCurrency.USD);
|
|
58
|
-
* purchase.addParam("item_count", "3");
|
|
59
|
-
* WiseTrack.instance.trackEvent(purchase);
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
class Revenue extends Default {
|
|
63
|
-
/**
|
|
64
|
-
* The type of event.
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
readonly type: WTEventType;
|
|
68
|
-
/**
|
|
69
|
-
* The revenue amount.
|
|
70
|
-
*/
|
|
71
|
-
amount: number;
|
|
72
|
-
/**
|
|
73
|
-
* The currency of the revenue.
|
|
74
|
-
*/
|
|
75
|
-
currency: RevenueCurrency;
|
|
76
|
-
/**
|
|
77
|
-
* Creates a new revenue event.
|
|
78
|
-
*
|
|
79
|
-
* @param name - The name of the revenue event.
|
|
80
|
-
* @param amount - The amount of revenue.
|
|
81
|
-
* @param currency - The currency of the revenue.
|
|
82
|
-
*/
|
|
83
|
-
constructor(name: string, amount: number, currency: RevenueCurrency);
|
|
84
|
-
/** @internal */
|
|
85
|
-
toJSON(): {
|
|
86
|
-
event_type: WTEventType;
|
|
87
|
-
event_name: string;
|
|
88
|
-
revenue: number;
|
|
89
|
-
currency: RevenueCurrency;
|
|
90
|
-
partner_params: Record<string, EventParam> | undefined;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export {};
|