@zoho_apptics/apptics-js-sdk 2.0.0-beta.2 → 2.0.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/CHANGELOG.md +47 -0
- package/README.md +229 -174
- package/dist/apptics-pn-sw.js +3 -0
- package/dist/apptics-pn-sw.js.map +1 -0
- package/dist/apptics.esm.min.js +2 -2
- package/dist/apptics.esm.min.js.map +1 -1
- package/dist/apptics.min.js +2 -2
- package/dist/apptics.min.js.map +1 -1
- package/dist/chunks/batch-Axq9sTzR.min.js +3 -0
- package/dist/chunks/batch-Axq9sTzR.min.js.map +1 -0
- package/dist/chunks/lifecycle-Cvg78jN_.min.js +3 -0
- package/dist/chunks/lifecycle-Cvg78jN_.min.js.map +1 -0
- package/dist/chunks/send-DBpesydB.min.js +3 -0
- package/dist/chunks/send-DBpesydB.min.js.map +1 -0
- package/dist/chunks/transport-B21X39p4.min.js +3 -0
- package/dist/chunks/transport-B21X39p4.min.js.map +1 -0
- package/dist/cjs/core/attempts.js +1 -1
- package/dist/cjs/core/batch.js +4 -3
- package/dist/cjs/core/consent.d.ts +9 -6
- package/dist/cjs/core/consent.js +63 -10
- package/dist/cjs/core/console-call.d.ts +23 -0
- package/dist/cjs/core/console-call.js +63 -0
- package/dist/cjs/core/constants.d.ts +44 -0
- package/dist/cjs/core/constants.js +55 -1
- package/dist/cjs/core/db.js +31 -7
- package/dist/cjs/core/debug.d.ts +6 -4
- package/dist/cjs/core/debug.js +36 -12
- package/dist/cjs/core/env.js +1 -1
- package/dist/cjs/core/framework-id.d.ts +1 -1
- package/dist/cjs/core/framework-id.js +3 -3
- package/dist/cjs/core/guard.js +19 -4
- package/dist/cjs/core/hooks.d.ts +25 -1
- package/dist/cjs/core/hooks.js +11 -1
- package/dist/cjs/core/locks.js +1 -1
- package/dist/cjs/core/logger.js +1 -1
- package/dist/cjs/core/shield.d.ts +31 -0
- package/dist/cjs/core/shield.js +129 -0
- package/dist/cjs/core/state.d.ts +5 -1
- package/dist/cjs/core/state.js +3 -1
- package/dist/cjs/core/storage.d.ts +7 -0
- package/dist/cjs/core/storage.js +28 -6
- package/dist/cjs/core/stylesheet.js +1 -1
- package/dist/cjs/core/transport.d.ts +15 -4
- package/dist/cjs/core/transport.js +63 -13
- package/dist/cjs/core/utils.js +1 -1
- package/dist/cjs/core/validate.js +6 -5
- package/dist/cjs/device/appversion.js +1 -1
- package/dist/cjs/device/index.js +63 -15
- package/dist/cjs/engagement/api-rules.js +1 -1
- package/dist/cjs/engagement/auto-api.js +4 -3
- package/dist/cjs/engagement/auto-screen.js +10 -6
- package/dist/cjs/engagement/defined-events.d.ts +2 -3
- package/dist/cjs/engagement/defined-events.js +10 -16
- package/dist/cjs/engagement/send.js +1 -1
- package/dist/cjs/engagement/session.js +77 -37
- package/dist/cjs/engagement/track.js +9 -6
- package/dist/cjs/errors/send.js +1 -1
- package/dist/cjs/errors/track.js +3 -2
- package/dist/cjs/feedback/controls.d.ts +30 -4
- package/dist/cjs/feedback/controls.js +237 -51
- package/dist/cjs/feedback/i18n/index.d.ts +31 -0
- package/dist/cjs/feedback/i18n/index.js +187 -0
- package/dist/cjs/feedback/i18n/strings.d.ts +9 -0
- package/dist/cjs/feedback/i18n/strings.js +8 -0
- package/dist/cjs/feedback/index.js +1 -1
- package/dist/cjs/feedback/logs.js +5 -4
- package/dist/cjs/feedback/quartz.js +5 -2
- package/dist/cjs/feedback/send.d.ts +4 -1
- package/dist/cjs/feedback/send.js +56 -15
- package/dist/cjs/feedback/styles.js +2 -2
- package/dist/cjs/feedback/template.d.ts +4 -2
- package/dist/cjs/feedback/template.js +67 -46
- package/dist/cjs/feedback/ui.d.ts +40 -4
- package/dist/cjs/feedback/ui.js +208 -89
- package/dist/cjs/heatmap/send.js +1 -1
- package/dist/cjs/heatmap/track.js +13 -9
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/lifecycle.js +119 -72
- package/dist/cjs/pushnotification/display.d.ts +65 -0
- package/dist/cjs/pushnotification/display.js +112 -0
- package/dist/cjs/pushnotification/index.d.ts +20 -0
- package/dist/cjs/pushnotification/index.js +96 -0
- package/dist/cjs/pushnotification/kept-opens.d.ts +23 -0
- package/dist/cjs/pushnotification/kept-opens.js +64 -0
- package/dist/cjs/pushnotification/notify.d.ts +45 -0
- package/dist/cjs/pushnotification/notify.js +476 -0
- package/dist/cjs/pushnotification/payload.d.ts +65 -0
- package/dist/cjs/pushnotification/payload.js +279 -0
- package/dist/cjs/pushnotification/session.d.ts +46 -0
- package/dist/cjs/pushnotification/session.js +413 -0
- package/dist/cjs/pushnotification/stats.d.ts +45 -0
- package/dist/cjs/pushnotification/stats.js +244 -0
- package/dist/cjs/pushnotification/wms.d.ts +30 -0
- package/dist/cjs/pushnotification/wms.js +374 -0
- package/dist/cjs/remoteconfig/country.js +1 -1
- package/dist/cjs/remoteconfig/custom.js +4 -3
- package/dist/cjs/remoteconfig/evaluate.js +1 -1
- package/dist/cjs/remoteconfig/fetch.js +27 -8
- package/dist/cjs/remoteconfig/index.d.ts +1 -6
- package/dist/cjs/remoteconfig/index.js +4 -28
- package/dist/cjs/remoteconfig/store.js +1 -1
- package/dist/cjs/remoteconfig/tz-countries.js +1 -1
- package/dist/cjs/remotelog/callsite.js +1 -1
- package/dist/cjs/remotelog/gate.js +1 -1
- package/dist/cjs/remotelog/logger.js +1 -1
- package/dist/cjs/remotelog/send.js +5 -4
- package/dist/cjs/remotelogger/index.js +1 -1
- package/dist/cjs/scheduler.js +11 -5
- package/dist/cjs/sw/apptics-pn-sw.d.ts +83 -0
- package/dist/cjs/sw/timers.d.ts +44 -0
- package/dist/cjs/types.d.ts +31 -15
- package/dist/cjs/user/index.d.ts +7 -0
- package/dist/cjs/user/index.js +25 -7
- package/dist/esm/core/attempts.js +1 -1
- package/dist/esm/core/batch.js +4 -3
- package/dist/esm/core/consent.d.ts +9 -6
- package/dist/esm/core/consent.js +67 -16
- package/dist/esm/core/console-call.d.ts +23 -0
- package/dist/esm/core/console-call.js +60 -0
- package/dist/esm/core/constants.d.ts +44 -0
- package/dist/esm/core/constants.js +52 -2
- package/dist/esm/core/db.js +31 -7
- package/dist/esm/core/debug.d.ts +6 -4
- package/dist/esm/core/debug.js +37 -13
- package/dist/esm/core/env.js +1 -1
- package/dist/esm/core/framework-id.d.ts +1 -1
- package/dist/esm/core/framework-id.js +3 -3
- package/dist/esm/core/guard.js +19 -4
- package/dist/esm/core/hooks.d.ts +25 -1
- package/dist/esm/core/hooks.js +11 -1
- package/dist/esm/core/locks.js +1 -1
- package/dist/esm/core/logger.js +1 -1
- package/dist/esm/core/shield.d.ts +31 -0
- package/dist/esm/core/shield.js +119 -0
- package/dist/esm/core/state.d.ts +5 -1
- package/dist/esm/core/state.js +3 -1
- package/dist/esm/core/storage.d.ts +7 -0
- package/dist/esm/core/storage.js +28 -8
- package/dist/esm/core/stylesheet.js +1 -1
- package/dist/esm/core/transport.d.ts +15 -4
- package/dist/esm/core/transport.js +64 -16
- package/dist/esm/core/utils.js +1 -1
- package/dist/esm/core/validate.js +6 -5
- package/dist/esm/device/appversion.js +1 -1
- package/dist/esm/device/index.js +67 -19
- package/dist/esm/engagement/api-rules.js +1 -1
- package/dist/esm/engagement/auto-api.js +4 -3
- package/dist/esm/engagement/auto-screen.js +10 -6
- package/dist/esm/engagement/defined-events.d.ts +2 -3
- package/dist/esm/engagement/defined-events.js +10 -16
- package/dist/esm/engagement/send.js +1 -1
- package/dist/esm/engagement/session.js +77 -37
- package/dist/esm/engagement/track.js +9 -6
- package/dist/esm/errors/send.js +1 -1
- package/dist/esm/errors/track.js +3 -2
- package/dist/esm/feedback/controls.d.ts +30 -4
- package/dist/esm/feedback/controls.js +234 -52
- package/dist/esm/feedback/i18n/index.d.ts +31 -0
- package/dist/esm/feedback/i18n/index.js +178 -0
- package/dist/esm/feedback/i18n/strings.d.ts +9 -0
- package/dist/esm/feedback/i18n/strings.js +4 -0
- package/dist/esm/feedback/index.js +1 -1
- package/dist/esm/feedback/logs.js +5 -4
- package/dist/esm/feedback/quartz.js +5 -2
- package/dist/esm/feedback/send.d.ts +4 -1
- package/dist/esm/feedback/send.js +56 -16
- package/dist/esm/feedback/styles.js +2 -2
- package/dist/esm/feedback/template.d.ts +4 -2
- package/dist/esm/feedback/template.js +67 -46
- package/dist/esm/feedback/ui.d.ts +40 -4
- package/dist/esm/feedback/ui.js +210 -91
- package/dist/esm/heatmap/send.js +1 -1
- package/dist/esm/heatmap/track.js +13 -9
- package/dist/esm/index.js +2 -2
- package/dist/esm/lifecycle.js +120 -73
- package/dist/esm/pushnotification/display.d.ts +65 -0
- package/dist/esm/pushnotification/display.js +95 -0
- package/dist/esm/pushnotification/index.d.ts +20 -0
- package/dist/esm/pushnotification/index.js +91 -0
- package/dist/esm/pushnotification/kept-opens.d.ts +23 -0
- package/dist/esm/pushnotification/kept-opens.js +62 -0
- package/dist/esm/pushnotification/notify.d.ts +45 -0
- package/dist/esm/pushnotification/notify.js +469 -0
- package/dist/esm/pushnotification/payload.d.ts +65 -0
- package/dist/esm/pushnotification/payload.js +272 -0
- package/dist/esm/pushnotification/session.d.ts +46 -0
- package/dist/esm/pushnotification/session.js +402 -0
- package/dist/esm/pushnotification/stats.d.ts +45 -0
- package/dist/esm/pushnotification/stats.js +238 -0
- package/dist/esm/pushnotification/wms.d.ts +30 -0
- package/dist/esm/pushnotification/wms.js +368 -0
- package/dist/esm/remoteconfig/country.js +1 -1
- package/dist/esm/remoteconfig/custom.js +4 -3
- package/dist/esm/remoteconfig/evaluate.js +1 -1
- package/dist/esm/remoteconfig/fetch.js +27 -8
- package/dist/esm/remoteconfig/index.d.ts +1 -6
- package/dist/esm/remoteconfig/index.js +4 -28
- package/dist/esm/remoteconfig/store.js +1 -1
- package/dist/esm/remoteconfig/tz-countries.js +1 -1
- package/dist/esm/remotelog/callsite.js +1 -1
- package/dist/esm/remotelog/gate.js +1 -1
- package/dist/esm/remotelog/logger.js +1 -1
- package/dist/esm/remotelog/send.js +5 -4
- package/dist/esm/remotelogger/index.js +1 -1
- package/dist/esm/scheduler.js +11 -5
- package/dist/esm/sw/apptics-pn-sw.d.ts +83 -0
- package/dist/esm/sw/timers.d.ts +44 -0
- package/dist/esm/types.d.ts +31 -15
- package/dist/esm/user/index.d.ts +7 -0
- package/dist/esm/user/index.js +26 -9
- package/dist/feedback.esm.min.js +2 -2
- package/dist/feedback.esm.min.js.map +1 -1
- package/dist/pushnotification.esm.min.js +3 -0
- package/dist/pushnotification.esm.min.js.map +1 -0
- package/dist/remoteconfig.esm.min.js +2 -2
- package/dist/remoteconfig.esm.min.js.map +1 -1
- package/dist/remotelogger.esm.min.js +2 -2
- package/dist/remotelogger.esm.min.js.map +1 -1
- package/package.json +15 -2
- package/dist/chunks/lifecycle-C6m1W7jo.min.js +0 -3
- package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +0 -1
- package/dist/chunks/send-CgUO82ne.min.js +0 -3
- package/dist/chunks/send-CgUO82ne.min.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @zoho_apptics/apptics-js-sdk v2.0.0
|
|
1
|
+
/*! @zoho_apptics/apptics-js-sdk v2.0.0 | (c) Zoho Corporation Private Limited | see LICENSE */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var constants = require('../core/constants.js');
|
|
@@ -9,6 +9,7 @@ var storage = require('../core/storage.js');
|
|
|
9
9
|
var env = require('../core/env.js');
|
|
10
10
|
var consent = require('../core/consent.js');
|
|
11
11
|
var locks = require('../core/locks.js');
|
|
12
|
+
var shield = require('../core/shield.js');
|
|
12
13
|
|
|
13
14
|
/** The most recently started item of `type` that is still open (endtime 0). */
|
|
14
15
|
function latestOpen(type, items) {
|
|
@@ -151,13 +152,12 @@ function holdTabLock() {
|
|
|
151
152
|
holdingTabLock = false;
|
|
152
153
|
});
|
|
153
154
|
}
|
|
154
|
-
/**
|
|
155
|
-
function
|
|
155
|
+
/** The ids of tabs whose lock is held or waiting, or null without Web Locks (or if asking fails). */
|
|
156
|
+
function liveTabIds() {
|
|
156
157
|
var locks = tabLocks();
|
|
157
158
|
if (!locks) {
|
|
158
|
-
return Promise.resolve();
|
|
159
|
+
return Promise.resolve(null);
|
|
159
160
|
}
|
|
160
|
-
var mine = tabId();
|
|
161
161
|
return locks.query().then(function (state) {
|
|
162
162
|
var alive = {};
|
|
163
163
|
(state.held || []).concat(state.pending || []).forEach(function (lock) {
|
|
@@ -165,6 +165,42 @@ function closeScreensOfGoneTabs() {
|
|
|
165
165
|
alive[lock.name.slice(TAB_LOCK_PREFIX.length)] = true;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
+
return alive;
|
|
169
|
+
}, function () {
|
|
170
|
+
return null;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The other tabs still on a session. A tab that reloaded or closed before its leave was written
|
|
175
|
+
* stays listed, and would keep the session open for good: with Web Locks, a listed tab counts only
|
|
176
|
+
* while its lock is held. Without them every listed tab counts, as before.
|
|
177
|
+
*/
|
|
178
|
+
function otherLiveTabs(session) {
|
|
179
|
+
var others = tabsOf(session).filter(function (tab) { return tab !== tabId(); });
|
|
180
|
+
if (!others.length) {
|
|
181
|
+
return Promise.resolve(others);
|
|
182
|
+
}
|
|
183
|
+
return liveTabIds().then(function (alive) {
|
|
184
|
+
if (!alive) {
|
|
185
|
+
return others;
|
|
186
|
+
}
|
|
187
|
+
var live = others.filter(function (tab) { return alive[tab] === true; });
|
|
188
|
+
if (live.length < others.length) {
|
|
189
|
+
logger.Console.log('session: ' + (others.length - live.length) + ' tab(s) listed on it are gone'); // no i18n
|
|
190
|
+
}
|
|
191
|
+
return live;
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/** Ends the open screen views of tabs that are gone. Resolves right away without Web Locks. */
|
|
195
|
+
function closeScreensOfGoneTabs() {
|
|
196
|
+
if (!tabLocks()) {
|
|
197
|
+
return Promise.resolve();
|
|
198
|
+
}
|
|
199
|
+
var mine = tabId();
|
|
200
|
+
return liveTabIds().then(function (alive) {
|
|
201
|
+
if (!alive) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
168
204
|
var now = utils.nowMs();
|
|
169
205
|
return storage.engagement_transactions.all().then(function (items) {
|
|
170
206
|
var gone = items.filter(function (item) {
|
|
@@ -307,10 +343,10 @@ function startNewSession(time) {
|
|
|
307
343
|
// held, not stored: see pendingSession above
|
|
308
344
|
pendingSession = state._ZAP._current_session;
|
|
309
345
|
clearPendingTimer();
|
|
310
|
-
pendingTimer = setTimeout(function () {
|
|
346
|
+
pendingTimer = setTimeout(shield.shield('session', function () {
|
|
311
347
|
pendingTimer = null;
|
|
312
|
-
commitPendingSession();
|
|
313
|
-
}, minimum);
|
|
348
|
+
shield.quietly('session', commitPendingSession()); // no i18n
|
|
349
|
+
}), minimum);
|
|
314
350
|
return Promise.resolve();
|
|
315
351
|
}
|
|
316
352
|
/** The un-deferred path, for a minimum of 0. */
|
|
@@ -335,14 +371,14 @@ function markTabInactive(onEnded) {
|
|
|
335
371
|
if (inactivityTimer !== null) {
|
|
336
372
|
clearTimeout(inactivityTimer);
|
|
337
373
|
}
|
|
338
|
-
inactivityTimer = setTimeout(function () {
|
|
374
|
+
inactivityTimer = setTimeout(shield.shield('inactive session', function () {
|
|
339
375
|
inactivityTimer = null;
|
|
340
|
-
endInactiveSession().then(function (ended) {
|
|
376
|
+
shield.quietly('inactive session', endInactiveSession().then(function (ended) {
|
|
341
377
|
if (ended) {
|
|
342
378
|
onEnded();
|
|
343
379
|
}
|
|
344
|
-
});
|
|
345
|
-
}, state._ZAP.inactiveduration * 60 * 1000 + 1000);
|
|
380
|
+
}));
|
|
381
|
+
}), state._ZAP.inactiveduration * 60 * 1000 + 1000);
|
|
346
382
|
return first ? updateLastActiveTimeOfSession() : Promise.resolve();
|
|
347
383
|
}
|
|
348
384
|
/**
|
|
@@ -380,19 +416,21 @@ function endInactiveSession() {
|
|
|
380
416
|
if (utils.nowMs() - lastActive < state._ZAP.inactiveduration * 60 * 1000) {
|
|
381
417
|
return;
|
|
382
418
|
}
|
|
383
|
-
var
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
return
|
|
419
|
+
var session = _currentSession;
|
|
420
|
+
return otherLiveTabs(session).then(function (others) {
|
|
421
|
+
if (others.length > 0) {
|
|
422
|
+
var left = Object.assign({}, session, { tabs: others });
|
|
423
|
+
state._ZAP._current_session = left;
|
|
424
|
+
return storage.engagement_transactions.update(left);
|
|
425
|
+
}
|
|
426
|
+
var endAt = Math.max(lastActive, Number(session.starttime) || lastActive);
|
|
427
|
+
var closed = Object.assign({}, session, { endtime: endAt, tabs: [] });
|
|
428
|
+
state._ZAP._current_session = closed;
|
|
429
|
+
ended = true;
|
|
430
|
+
logger.Console.log('session: inactive for ' + state._ZAP.inactiveduration + ' minutes, so it ends when the user left, ' + endAt); // no i18n
|
|
431
|
+
return storage.engagement_transactions.update(closed).then(function () {
|
|
432
|
+
return closeScreensOf(closed, endAt);
|
|
433
|
+
});
|
|
396
434
|
});
|
|
397
435
|
});
|
|
398
436
|
}).then(function () {
|
|
@@ -428,18 +466,20 @@ function closeOrLeaveSession(now, wasInactive) {
|
|
|
428
466
|
var time = wasInactive && lastActive > 0
|
|
429
467
|
? Math.max(Math.min(lastActive, now), Number(_currentSession.starttime) || 0)
|
|
430
468
|
: now;
|
|
431
|
-
var
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
return
|
|
469
|
+
var session = _currentSession;
|
|
470
|
+
return otherLiveTabs(session).then(function (others) {
|
|
471
|
+
if (others.length > 0) {
|
|
472
|
+
var left = Object.assign({}, session, { tabs: others, lastactivetime: time });
|
|
473
|
+
state._ZAP._current_session = left;
|
|
474
|
+
logger.Console.log('endCurrentSession: ' + others.length + ' other tab(s) still on this session, so it stays open'); // no i18n
|
|
475
|
+
return storage.engagement_transactions.update(left);
|
|
476
|
+
}
|
|
477
|
+
var closed = Object.assign({}, session, { endtime: time, lastactivetime: time, tabs: [] });
|
|
478
|
+
state._ZAP._current_session = closed;
|
|
479
|
+
logger.Console.log('endCurrentSession: closing the session opened at ' + closed.starttime); // no i18n
|
|
480
|
+
return storage.engagement_transactions.update(closed).then(function () {
|
|
481
|
+
return closeScreensOf(closed, time);
|
|
482
|
+
});
|
|
443
483
|
});
|
|
444
484
|
});
|
|
445
485
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @zoho_apptics/apptics-js-sdk v2.0.0
|
|
1
|
+
/*! @zoho_apptics/apptics-js-sdk v2.0.0 | (c) Zoho Corporation Private Limited | see LICENSE */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var constants = require('../core/constants.js');
|
|
@@ -15,6 +15,7 @@ var hooks = require('../core/hooks.js');
|
|
|
15
15
|
var apiRules = require('./api-rules.js');
|
|
16
16
|
var definedEvents = require('./defined-events.js');
|
|
17
17
|
var autoScreen = require('./auto-screen.js');
|
|
18
|
+
var shield = require('../core/shield.js');
|
|
18
19
|
|
|
19
20
|
/** Messages already printed, so a name refused in a loop says so once. */
|
|
20
21
|
var refusedSaid = {};
|
|
@@ -84,9 +85,11 @@ function trackEvent(eventName, groupName, jsonObj) {
|
|
|
84
85
|
};
|
|
85
86
|
// save the event
|
|
86
87
|
// the session may still be waiting out its minimum; this event is what earns it
|
|
87
|
-
session.commitPendingSession();
|
|
88
|
+
shield.quietly('session', session.commitPendingSession()); // no i18n
|
|
88
89
|
debug.noteDebugActivity();
|
|
89
90
|
storage.engagement_transactions.add(eventData);
|
|
91
|
+
// a push notification opened earlier may count this event as its conversion
|
|
92
|
+
hooks.hooks.pushEventTracked(String(eventName), String(groupName));
|
|
90
93
|
logger.Console.log('AppticsEvent.addEvent(\'' + eventName + '\',' + '\'' + groupName + '\'' + ',' + JSON.stringify(_jsonObj || {}) + ')'); // no i18n
|
|
91
94
|
logger.Console.dir(eventData);
|
|
92
95
|
}
|
|
@@ -110,7 +113,7 @@ function outScreenAt(id, endedAt) {
|
|
|
110
113
|
logger.logFailure(constants.AP_LOG_MODULE.SCREEN, 'AppticsScreen.outScreen: no screen id given'); // no i18n
|
|
111
114
|
return;
|
|
112
115
|
}
|
|
113
|
-
session.closeScreen(id, endedAt);
|
|
116
|
+
shield.quietly('screen', session.closeScreen(id, endedAt)); // no i18n
|
|
114
117
|
}
|
|
115
118
|
/**
|
|
116
119
|
* Queues a screen view and makes it the current screen.
|
|
@@ -149,9 +152,9 @@ function recordScreen(screenName, jsonObj, id, startedAt, implicit) {
|
|
|
149
152
|
// the screen being left ends where this one starts
|
|
150
153
|
var previous = state._ZAP._current_screen && state._ZAP._current_screen.id;
|
|
151
154
|
if (previous && previous !== screenData.id) {
|
|
152
|
-
session.closeScreen(previous, time);
|
|
155
|
+
shield.quietly('screen', session.closeScreen(previous, time)); // no i18n
|
|
153
156
|
}
|
|
154
|
-
session.commitPendingSession();
|
|
157
|
+
shield.quietly('session', session.commitPendingSession()); // no i18n
|
|
155
158
|
debug.noteDebugActivity();
|
|
156
159
|
storage.engagement_transactions.add(screenData);
|
|
157
160
|
// `implicit`: a view recorded only so a heatmap record has one to belong to. Kept on the
|
|
@@ -321,7 +324,7 @@ function trackApi(jsonObj) {
|
|
|
321
324
|
edge: state._ZAP._device_info.connectionType || env.getConnectionType()
|
|
322
325
|
};
|
|
323
326
|
// save the api
|
|
324
|
-
session.commitPendingSession();
|
|
327
|
+
shield.quietly('session', session.commitPendingSession()); // no i18n
|
|
325
328
|
debug.noteDebugActivity();
|
|
326
329
|
storage.engagement_transactions.add(apiData);
|
|
327
330
|
logger.Console.log('AppticsApi(\'' + method + ' ' + scheme + '://' + hostname + path + '\')'); // no i18n
|
package/dist/cjs/errors/send.js
CHANGED
package/dist/cjs/errors/track.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @zoho_apptics/apptics-js-sdk v2.0.0
|
|
1
|
+
/*! @zoho_apptics/apptics-js-sdk v2.0.0 | (c) Zoho Corporation Private Limited | see LICENSE */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var constants = require('../core/constants.js');
|
|
@@ -11,6 +11,7 @@ var env = require('../core/env.js');
|
|
|
11
11
|
var consent = require('../core/consent.js');
|
|
12
12
|
var validate = require('../core/validate.js');
|
|
13
13
|
var debug = require('../core/debug.js');
|
|
14
|
+
var shield = require('../core/shield.js');
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* The stack to report. Three sources, in order of how much they tell us:
|
|
@@ -113,7 +114,7 @@ function trackError(errorEvent, jsonObj) {
|
|
|
113
114
|
};
|
|
114
115
|
// save the error
|
|
115
116
|
// an error is worth a session even in the first seconds of a visit
|
|
116
|
-
session.commitPendingSession();
|
|
117
|
+
shield.quietly('session', session.commitPendingSession()); // no i18n
|
|
117
118
|
debug.noteDebugActivity();
|
|
118
119
|
storage.error_transactions.add(errorData);
|
|
119
120
|
logger.Console.log('AppticsError.trackError(\'' + issuetype + '\',\'' + message + '\',' + JSON.stringify(_jsonObj || {}) + ')'); // no i18n
|
|
@@ -12,6 +12,21 @@ export declare const logChoice: {
|
|
|
12
12
|
includeLog?: boolean;
|
|
13
13
|
includeDyninfo?: boolean;
|
|
14
14
|
};
|
|
15
|
+
/** The entry the user picker has selected, for the same form rebuilt in another language. */
|
|
16
|
+
export declare function pickedUser(): string;
|
|
17
|
+
/** What the data viewer shows, while it is open: the same form rebuilt in another language shows it again. */
|
|
18
|
+
export interface ViewerShown {
|
|
19
|
+
titleKey: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
/** The viewer's title key and content while it is open, else null. */
|
|
23
|
+
export declare function shownViewer(): ViewerShown | null;
|
|
24
|
+
/** What a form rebuilt in another language keeps of the switches and the viewer. Unset decides as a new form does. */
|
|
25
|
+
export interface LogKeep {
|
|
26
|
+
includeLog?: boolean;
|
|
27
|
+
includeDyninfo?: boolean;
|
|
28
|
+
viewer?: ViewerShown | null;
|
|
29
|
+
}
|
|
15
30
|
/**
|
|
16
31
|
* Who a sendFeedback() report, made without the form, is attributed to: nobody when `anonymous`,
|
|
17
32
|
* else the user AppticsUser.setUser set (or the active registered one, status 1). Returns a function
|
|
@@ -20,15 +35,26 @@ export declare const logChoice: {
|
|
|
20
35
|
export declare function chooseUserForSend(anonymous: boolean): () => void;
|
|
21
36
|
/**
|
|
22
37
|
* The "User" dropdown above the description. It lists Anonymous plus every registered user, and
|
|
23
|
-
* starts on the active one (status 1) unless the caller asked for anonymous
|
|
38
|
+
* starts on the active one (status 1) unless the caller asked for anonymous; `keep`, the entry a
|
|
39
|
+
* form rebuilt in another language had selected, wins over both while it is still listed.
|
|
40
|
+
*/
|
|
41
|
+
export declare function wireUserPicker(modal: HTMLElement, forceAnonymous: boolean, keep?: string): void;
|
|
42
|
+
/** A language's own name, its label without the English name in brackets: Deutsch, Español – México. */
|
|
43
|
+
export declare function ownName(label: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* The language dropdown in the header. It lists every language the form has, English first, each
|
|
46
|
+
* by its own name; picking one is remembered for the next form and hands over to `picked`, which
|
|
47
|
+
* builds this one again in it. Built as the user picker is, and closed the same way (focusout, so
|
|
48
|
+
* it works in a shadow root), with the keys a listbox takes: arrows to move, Enter or Space to
|
|
49
|
+
* pick, Escape to close.
|
|
24
50
|
*/
|
|
25
|
-
export declare function
|
|
51
|
+
export declare function wireLangPicker(modal: HTMLElement, picked: () => void): void;
|
|
26
52
|
/**
|
|
27
53
|
* The two "Include …" switches and the viewer behind their View links. A row is shown only when
|
|
28
54
|
* there is something to include, and is then on by default, so a submission carries what the app
|
|
29
|
-
* recorded unless the user turns it off.
|
|
55
|
+
* recorded unless the user turns it off. `keep` is what a form rebuilt in another language had.
|
|
30
56
|
*/
|
|
31
|
-
export declare function wireLogControls(modal: HTMLElement, opts: Dict): void;
|
|
57
|
+
export declare function wireLogControls(modal: HTMLElement, opts: Dict, keep?: LogKeep): void;
|
|
32
58
|
/**
|
|
33
59
|
* Drags the dialog by its header. The right/bottom placement from the stylesheet is converted to
|
|
34
60
|
* an explicit left/top on the first drag, so the offsets have something to add to, and the box is
|