@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.
Files changed (223) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +229 -174
  3. package/dist/apptics-pn-sw.js +3 -0
  4. package/dist/apptics-pn-sw.js.map +1 -0
  5. package/dist/apptics.esm.min.js +2 -2
  6. package/dist/apptics.esm.min.js.map +1 -1
  7. package/dist/apptics.min.js +2 -2
  8. package/dist/apptics.min.js.map +1 -1
  9. package/dist/chunks/batch-Axq9sTzR.min.js +3 -0
  10. package/dist/chunks/batch-Axq9sTzR.min.js.map +1 -0
  11. package/dist/chunks/lifecycle-Cvg78jN_.min.js +3 -0
  12. package/dist/chunks/lifecycle-Cvg78jN_.min.js.map +1 -0
  13. package/dist/chunks/send-DBpesydB.min.js +3 -0
  14. package/dist/chunks/send-DBpesydB.min.js.map +1 -0
  15. package/dist/chunks/transport-B21X39p4.min.js +3 -0
  16. package/dist/chunks/transport-B21X39p4.min.js.map +1 -0
  17. package/dist/cjs/core/attempts.js +1 -1
  18. package/dist/cjs/core/batch.js +4 -3
  19. package/dist/cjs/core/consent.d.ts +9 -6
  20. package/dist/cjs/core/consent.js +63 -10
  21. package/dist/cjs/core/console-call.d.ts +23 -0
  22. package/dist/cjs/core/console-call.js +63 -0
  23. package/dist/cjs/core/constants.d.ts +44 -0
  24. package/dist/cjs/core/constants.js +55 -1
  25. package/dist/cjs/core/db.js +31 -7
  26. package/dist/cjs/core/debug.d.ts +6 -4
  27. package/dist/cjs/core/debug.js +36 -12
  28. package/dist/cjs/core/env.js +1 -1
  29. package/dist/cjs/core/framework-id.d.ts +1 -1
  30. package/dist/cjs/core/framework-id.js +3 -3
  31. package/dist/cjs/core/guard.js +19 -4
  32. package/dist/cjs/core/hooks.d.ts +25 -1
  33. package/dist/cjs/core/hooks.js +11 -1
  34. package/dist/cjs/core/locks.js +1 -1
  35. package/dist/cjs/core/logger.js +1 -1
  36. package/dist/cjs/core/shield.d.ts +31 -0
  37. package/dist/cjs/core/shield.js +129 -0
  38. package/dist/cjs/core/state.d.ts +5 -1
  39. package/dist/cjs/core/state.js +3 -1
  40. package/dist/cjs/core/storage.d.ts +7 -0
  41. package/dist/cjs/core/storage.js +28 -6
  42. package/dist/cjs/core/stylesheet.js +1 -1
  43. package/dist/cjs/core/transport.d.ts +15 -4
  44. package/dist/cjs/core/transport.js +63 -13
  45. package/dist/cjs/core/utils.js +1 -1
  46. package/dist/cjs/core/validate.js +6 -5
  47. package/dist/cjs/device/appversion.js +1 -1
  48. package/dist/cjs/device/index.js +63 -15
  49. package/dist/cjs/engagement/api-rules.js +1 -1
  50. package/dist/cjs/engagement/auto-api.js +4 -3
  51. package/dist/cjs/engagement/auto-screen.js +10 -6
  52. package/dist/cjs/engagement/defined-events.d.ts +2 -3
  53. package/dist/cjs/engagement/defined-events.js +10 -16
  54. package/dist/cjs/engagement/send.js +1 -1
  55. package/dist/cjs/engagement/session.js +77 -37
  56. package/dist/cjs/engagement/track.js +9 -6
  57. package/dist/cjs/errors/send.js +1 -1
  58. package/dist/cjs/errors/track.js +3 -2
  59. package/dist/cjs/feedback/controls.d.ts +30 -4
  60. package/dist/cjs/feedback/controls.js +237 -51
  61. package/dist/cjs/feedback/i18n/index.d.ts +31 -0
  62. package/dist/cjs/feedback/i18n/index.js +187 -0
  63. package/dist/cjs/feedback/i18n/strings.d.ts +9 -0
  64. package/dist/cjs/feedback/i18n/strings.js +8 -0
  65. package/dist/cjs/feedback/index.js +1 -1
  66. package/dist/cjs/feedback/logs.js +5 -4
  67. package/dist/cjs/feedback/quartz.js +5 -2
  68. package/dist/cjs/feedback/send.d.ts +4 -1
  69. package/dist/cjs/feedback/send.js +56 -15
  70. package/dist/cjs/feedback/styles.js +2 -2
  71. package/dist/cjs/feedback/template.d.ts +4 -2
  72. package/dist/cjs/feedback/template.js +67 -46
  73. package/dist/cjs/feedback/ui.d.ts +40 -4
  74. package/dist/cjs/feedback/ui.js +208 -89
  75. package/dist/cjs/heatmap/send.js +1 -1
  76. package/dist/cjs/heatmap/track.js +13 -9
  77. package/dist/cjs/index.js +2 -2
  78. package/dist/cjs/lifecycle.js +119 -72
  79. package/dist/cjs/pushnotification/display.d.ts +65 -0
  80. package/dist/cjs/pushnotification/display.js +112 -0
  81. package/dist/cjs/pushnotification/index.d.ts +20 -0
  82. package/dist/cjs/pushnotification/index.js +96 -0
  83. package/dist/cjs/pushnotification/kept-opens.d.ts +23 -0
  84. package/dist/cjs/pushnotification/kept-opens.js +64 -0
  85. package/dist/cjs/pushnotification/notify.d.ts +45 -0
  86. package/dist/cjs/pushnotification/notify.js +476 -0
  87. package/dist/cjs/pushnotification/payload.d.ts +65 -0
  88. package/dist/cjs/pushnotification/payload.js +279 -0
  89. package/dist/cjs/pushnotification/session.d.ts +46 -0
  90. package/dist/cjs/pushnotification/session.js +413 -0
  91. package/dist/cjs/pushnotification/stats.d.ts +45 -0
  92. package/dist/cjs/pushnotification/stats.js +244 -0
  93. package/dist/cjs/pushnotification/wms.d.ts +30 -0
  94. package/dist/cjs/pushnotification/wms.js +374 -0
  95. package/dist/cjs/remoteconfig/country.js +1 -1
  96. package/dist/cjs/remoteconfig/custom.js +4 -3
  97. package/dist/cjs/remoteconfig/evaluate.js +1 -1
  98. package/dist/cjs/remoteconfig/fetch.js +27 -8
  99. package/dist/cjs/remoteconfig/index.d.ts +1 -6
  100. package/dist/cjs/remoteconfig/index.js +4 -28
  101. package/dist/cjs/remoteconfig/store.js +1 -1
  102. package/dist/cjs/remoteconfig/tz-countries.js +1 -1
  103. package/dist/cjs/remotelog/callsite.js +1 -1
  104. package/dist/cjs/remotelog/gate.js +1 -1
  105. package/dist/cjs/remotelog/logger.js +1 -1
  106. package/dist/cjs/remotelog/send.js +5 -4
  107. package/dist/cjs/remotelogger/index.js +1 -1
  108. package/dist/cjs/scheduler.js +11 -5
  109. package/dist/cjs/sw/apptics-pn-sw.d.ts +83 -0
  110. package/dist/cjs/sw/timers.d.ts +44 -0
  111. package/dist/cjs/types.d.ts +31 -15
  112. package/dist/cjs/user/index.d.ts +7 -0
  113. package/dist/cjs/user/index.js +25 -7
  114. package/dist/esm/core/attempts.js +1 -1
  115. package/dist/esm/core/batch.js +4 -3
  116. package/dist/esm/core/consent.d.ts +9 -6
  117. package/dist/esm/core/consent.js +67 -16
  118. package/dist/esm/core/console-call.d.ts +23 -0
  119. package/dist/esm/core/console-call.js +60 -0
  120. package/dist/esm/core/constants.d.ts +44 -0
  121. package/dist/esm/core/constants.js +52 -2
  122. package/dist/esm/core/db.js +31 -7
  123. package/dist/esm/core/debug.d.ts +6 -4
  124. package/dist/esm/core/debug.js +37 -13
  125. package/dist/esm/core/env.js +1 -1
  126. package/dist/esm/core/framework-id.d.ts +1 -1
  127. package/dist/esm/core/framework-id.js +3 -3
  128. package/dist/esm/core/guard.js +19 -4
  129. package/dist/esm/core/hooks.d.ts +25 -1
  130. package/dist/esm/core/hooks.js +11 -1
  131. package/dist/esm/core/locks.js +1 -1
  132. package/dist/esm/core/logger.js +1 -1
  133. package/dist/esm/core/shield.d.ts +31 -0
  134. package/dist/esm/core/shield.js +119 -0
  135. package/dist/esm/core/state.d.ts +5 -1
  136. package/dist/esm/core/state.js +3 -1
  137. package/dist/esm/core/storage.d.ts +7 -0
  138. package/dist/esm/core/storage.js +28 -8
  139. package/dist/esm/core/stylesheet.js +1 -1
  140. package/dist/esm/core/transport.d.ts +15 -4
  141. package/dist/esm/core/transport.js +64 -16
  142. package/dist/esm/core/utils.js +1 -1
  143. package/dist/esm/core/validate.js +6 -5
  144. package/dist/esm/device/appversion.js +1 -1
  145. package/dist/esm/device/index.js +67 -19
  146. package/dist/esm/engagement/api-rules.js +1 -1
  147. package/dist/esm/engagement/auto-api.js +4 -3
  148. package/dist/esm/engagement/auto-screen.js +10 -6
  149. package/dist/esm/engagement/defined-events.d.ts +2 -3
  150. package/dist/esm/engagement/defined-events.js +10 -16
  151. package/dist/esm/engagement/send.js +1 -1
  152. package/dist/esm/engagement/session.js +77 -37
  153. package/dist/esm/engagement/track.js +9 -6
  154. package/dist/esm/errors/send.js +1 -1
  155. package/dist/esm/errors/track.js +3 -2
  156. package/dist/esm/feedback/controls.d.ts +30 -4
  157. package/dist/esm/feedback/controls.js +234 -52
  158. package/dist/esm/feedback/i18n/index.d.ts +31 -0
  159. package/dist/esm/feedback/i18n/index.js +178 -0
  160. package/dist/esm/feedback/i18n/strings.d.ts +9 -0
  161. package/dist/esm/feedback/i18n/strings.js +4 -0
  162. package/dist/esm/feedback/index.js +1 -1
  163. package/dist/esm/feedback/logs.js +5 -4
  164. package/dist/esm/feedback/quartz.js +5 -2
  165. package/dist/esm/feedback/send.d.ts +4 -1
  166. package/dist/esm/feedback/send.js +56 -16
  167. package/dist/esm/feedback/styles.js +2 -2
  168. package/dist/esm/feedback/template.d.ts +4 -2
  169. package/dist/esm/feedback/template.js +67 -46
  170. package/dist/esm/feedback/ui.d.ts +40 -4
  171. package/dist/esm/feedback/ui.js +210 -91
  172. package/dist/esm/heatmap/send.js +1 -1
  173. package/dist/esm/heatmap/track.js +13 -9
  174. package/dist/esm/index.js +2 -2
  175. package/dist/esm/lifecycle.js +120 -73
  176. package/dist/esm/pushnotification/display.d.ts +65 -0
  177. package/dist/esm/pushnotification/display.js +95 -0
  178. package/dist/esm/pushnotification/index.d.ts +20 -0
  179. package/dist/esm/pushnotification/index.js +91 -0
  180. package/dist/esm/pushnotification/kept-opens.d.ts +23 -0
  181. package/dist/esm/pushnotification/kept-opens.js +62 -0
  182. package/dist/esm/pushnotification/notify.d.ts +45 -0
  183. package/dist/esm/pushnotification/notify.js +469 -0
  184. package/dist/esm/pushnotification/payload.d.ts +65 -0
  185. package/dist/esm/pushnotification/payload.js +272 -0
  186. package/dist/esm/pushnotification/session.d.ts +46 -0
  187. package/dist/esm/pushnotification/session.js +402 -0
  188. package/dist/esm/pushnotification/stats.d.ts +45 -0
  189. package/dist/esm/pushnotification/stats.js +238 -0
  190. package/dist/esm/pushnotification/wms.d.ts +30 -0
  191. package/dist/esm/pushnotification/wms.js +368 -0
  192. package/dist/esm/remoteconfig/country.js +1 -1
  193. package/dist/esm/remoteconfig/custom.js +4 -3
  194. package/dist/esm/remoteconfig/evaluate.js +1 -1
  195. package/dist/esm/remoteconfig/fetch.js +27 -8
  196. package/dist/esm/remoteconfig/index.d.ts +1 -6
  197. package/dist/esm/remoteconfig/index.js +4 -28
  198. package/dist/esm/remoteconfig/store.js +1 -1
  199. package/dist/esm/remoteconfig/tz-countries.js +1 -1
  200. package/dist/esm/remotelog/callsite.js +1 -1
  201. package/dist/esm/remotelog/gate.js +1 -1
  202. package/dist/esm/remotelog/logger.js +1 -1
  203. package/dist/esm/remotelog/send.js +5 -4
  204. package/dist/esm/remotelogger/index.js +1 -1
  205. package/dist/esm/scheduler.js +11 -5
  206. package/dist/esm/sw/apptics-pn-sw.d.ts +83 -0
  207. package/dist/esm/sw/timers.d.ts +44 -0
  208. package/dist/esm/types.d.ts +31 -15
  209. package/dist/esm/user/index.d.ts +7 -0
  210. package/dist/esm/user/index.js +26 -9
  211. package/dist/feedback.esm.min.js +2 -2
  212. package/dist/feedback.esm.min.js.map +1 -1
  213. package/dist/pushnotification.esm.min.js +3 -0
  214. package/dist/pushnotification.esm.min.js.map +1 -0
  215. package/dist/remoteconfig.esm.min.js +2 -2
  216. package/dist/remoteconfig.esm.min.js.map +1 -1
  217. package/dist/remotelogger.esm.min.js +2 -2
  218. package/dist/remotelogger.esm.min.js.map +1 -1
  219. package/package.json +15 -2
  220. package/dist/chunks/lifecycle-C6m1W7jo.min.js +0 -3
  221. package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +0 -1
  222. package/dist/chunks/send-CgUO82ne.min.js +0 -3
  223. package/dist/chunks/send-CgUO82ne.min.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
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
- /** Ends the open screen views of tabs that are gone. Resolves right away without Web Locks. */
155
- function closeScreensOfGoneTabs() {
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 others = tabsOf(_currentSession).filter(function (tab) { return tab !== tabId(); });
384
- if (others.length > 0) {
385
- var left = Object.assign({}, _currentSession, { tabs: others });
386
- state._ZAP._current_session = left;
387
- return storage.engagement_transactions.update(left);
388
- }
389
- var endAt = Math.max(lastActive, Number(_currentSession.starttime) || lastActive);
390
- var closed = Object.assign({}, _currentSession, { endtime: endAt, tabs: [] });
391
- state._ZAP._current_session = closed;
392
- ended = true;
393
- logger.Console.log('session: inactive for ' + state._ZAP.inactiveduration + ' minutes, so it ends when the user left, ' + endAt); // no i18n
394
- return storage.engagement_transactions.update(closed).then(function () {
395
- return closeScreensOf(closed, endAt);
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 others = tabsOf(_currentSession).filter(function (tab) { return tab !== tabId(); });
432
- if (others.length > 0) {
433
- var left = Object.assign({}, _currentSession, { tabs: others, lastactivetime: time });
434
- state._ZAP._current_session = left;
435
- logger.Console.log('endCurrentSession: ' + others.length + ' other tab(s) still on this session, so it stays open'); // no i18n
436
- return storage.engagement_transactions.update(left);
437
- }
438
- var closed = Object.assign({}, _currentSession, { endtime: time, lastactivetime: time, tabs: [] });
439
- state._ZAP._current_session = closed;
440
- logger.Console.log('endCurrentSession: closing the session opened at ' + closed.starttime); // no i18n
441
- return storage.engagement_transactions.update(closed).then(function () {
442
- return closeScreensOf(closed, time);
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-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
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
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
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 state = require('../core/state.js');
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
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 wireUserPicker(modal: HTMLElement, forceAnonymous: boolean): void;
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