@zoho_apptics/apptics-js-sdk 2.0.0-beta → 2.0.0-beta.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.
Files changed (236) hide show
  1. package/CHANGELOG.md +191 -21
  2. package/README.md +519 -333
  3. package/dist/apptics.esm.min.js +2 -2
  4. package/dist/apptics.esm.min.js.map +1 -1
  5. package/dist/apptics.min.js +2 -2
  6. package/dist/apptics.min.js.map +1 -1
  7. package/dist/chunks/lifecycle-C6m1W7jo.min.js +3 -0
  8. package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +1 -0
  9. package/dist/chunks/send-CgUO82ne.min.js +3 -0
  10. package/dist/chunks/send-CgUO82ne.min.js.map +1 -0
  11. package/dist/cjs/core/attempts.js +1 -1
  12. package/dist/cjs/core/batch.js +2 -2
  13. package/dist/cjs/core/consent.d.ts +18 -4
  14. package/dist/cjs/core/consent.js +31 -15
  15. package/dist/cjs/core/constants.d.ts +57 -27
  16. package/dist/cjs/core/constants.js +52 -33
  17. package/dist/cjs/core/db.d.ts +12 -4
  18. package/dist/cjs/core/db.js +167 -34
  19. package/dist/cjs/core/debug.js +1 -1
  20. package/dist/cjs/core/env.d.ts +0 -3
  21. package/dist/cjs/core/env.js +1 -9
  22. package/dist/cjs/core/framework-id.d.ts +1 -1
  23. package/dist/cjs/core/framework-id.js +3 -3
  24. package/dist/cjs/core/guard.d.ts +9 -0
  25. package/dist/cjs/core/guard.js +27 -13
  26. package/dist/cjs/core/hooks.d.ts +7 -4
  27. package/dist/cjs/core/hooks.js +3 -3
  28. package/dist/cjs/core/locks.d.ts +9 -0
  29. package/dist/cjs/core/locks.js +22 -0
  30. package/dist/cjs/core/logger.d.ts +3 -4
  31. package/dist/cjs/core/logger.js +4 -40
  32. package/dist/cjs/core/state.d.ts +9 -6
  33. package/dist/cjs/core/state.js +3 -5
  34. package/dist/cjs/core/storage.d.ts +20 -5
  35. package/dist/cjs/core/storage.js +115 -20
  36. package/dist/cjs/core/stylesheet.d.ts +8 -0
  37. package/dist/cjs/core/stylesheet.js +29 -0
  38. package/dist/cjs/core/transport.d.ts +2 -0
  39. package/dist/cjs/core/transport.js +30 -18
  40. package/dist/cjs/core/utils.js +1 -1
  41. package/dist/cjs/core/validate.js +2 -2
  42. package/dist/cjs/device/appversion.d.ts +10 -6
  43. package/dist/cjs/device/appversion.js +38 -3
  44. package/dist/cjs/device/index.d.ts +28 -2
  45. package/dist/cjs/device/index.js +312 -44
  46. package/dist/cjs/engagement/api-rules.d.ts +32 -67
  47. package/dist/cjs/engagement/api-rules.js +144 -157
  48. package/dist/cjs/engagement/auto-api.js +2 -2
  49. package/dist/cjs/engagement/auto-screen.d.ts +2 -0
  50. package/dist/cjs/engagement/auto-screen.js +67 -3
  51. package/dist/cjs/engagement/defined-events.js +1 -1
  52. package/dist/cjs/engagement/send.js +12 -3
  53. package/dist/cjs/engagement/session.d.ts +29 -3
  54. package/dist/cjs/engagement/session.js +253 -26
  55. package/dist/cjs/engagement/track.d.ts +4 -4
  56. package/dist/cjs/engagement/track.js +58 -30
  57. package/dist/cjs/errors/send.js +2 -2
  58. package/dist/cjs/errors/track.d.ts +2 -1
  59. package/dist/cjs/errors/track.js +49 -7
  60. package/dist/cjs/feedback/controls.d.ts +12 -0
  61. package/dist/cjs/feedback/controls.js +104 -25
  62. package/dist/cjs/feedback/index.d.ts +8 -7
  63. package/dist/cjs/feedback/index.js +32 -13
  64. package/dist/cjs/feedback/logs.d.ts +13 -11
  65. package/dist/cjs/feedback/logs.js +57 -28
  66. package/dist/cjs/feedback/quartz.d.ts +18 -0
  67. package/dist/cjs/feedback/quartz.js +105 -0
  68. package/dist/cjs/feedback/send.d.ts +5 -2
  69. package/dist/cjs/feedback/send.js +30 -28
  70. package/dist/cjs/feedback/styles.d.ts +10 -0
  71. package/dist/cjs/feedback/styles.js +8 -0
  72. package/dist/cjs/feedback/template.d.ts +1 -1
  73. package/dist/cjs/feedback/template.js +20 -12
  74. package/dist/cjs/feedback/ui.d.ts +21 -6
  75. package/dist/cjs/feedback/ui.js +283 -70
  76. package/dist/cjs/heatmap/send.d.ts +2 -0
  77. package/dist/cjs/heatmap/send.js +3 -5
  78. package/dist/cjs/heatmap/track.d.ts +1 -1
  79. package/dist/cjs/heatmap/track.js +87 -16
  80. package/dist/cjs/index.d.ts +16 -63
  81. package/dist/cjs/index.js +144 -95
  82. package/dist/cjs/lifecycle.d.ts +21 -3
  83. package/dist/cjs/lifecycle.js +353 -89
  84. package/dist/cjs/remoteconfig/country.d.ts +4 -0
  85. package/dist/cjs/remoteconfig/country.js +73 -0
  86. package/dist/cjs/remoteconfig/custom.d.ts +7 -7
  87. package/dist/cjs/remoteconfig/custom.js +31 -51
  88. package/dist/cjs/remoteconfig/evaluate.d.ts +3 -3
  89. package/dist/cjs/remoteconfig/evaluate.js +56 -43
  90. package/dist/cjs/remoteconfig/fetch.d.ts +16 -9
  91. package/dist/cjs/remoteconfig/fetch.js +120 -39
  92. package/dist/cjs/remoteconfig/index.d.ts +19 -8
  93. package/dist/cjs/remoteconfig/index.js +81 -39
  94. package/dist/cjs/remoteconfig/store.d.ts +15 -7
  95. package/dist/cjs/remoteconfig/store.js +68 -35
  96. package/dist/cjs/remoteconfig/tz-countries.d.ts +8 -0
  97. package/dist/cjs/remoteconfig/tz-countries.js +13 -0
  98. package/dist/{esm/core → cjs/remotelog}/callsite.d.ts +11 -4
  99. package/dist/cjs/{core → remotelog}/callsite.js +30 -7
  100. package/dist/cjs/remotelog/gate.d.ts +2 -11
  101. package/dist/cjs/remotelog/gate.js +9 -35
  102. package/dist/cjs/remotelog/index.d.ts +4 -21
  103. package/dist/cjs/remotelog/logger.d.ts +11 -17
  104. package/dist/cjs/remotelog/logger.js +31 -59
  105. package/dist/cjs/remotelog/send.js +11 -11
  106. package/dist/cjs/remotelogger/index.d.ts +12 -0
  107. package/dist/cjs/remotelogger/index.js +18 -0
  108. package/dist/cjs/scheduler.d.ts +3 -1
  109. package/dist/cjs/scheduler.js +25 -22
  110. package/dist/cjs/types.d.ts +208 -90
  111. package/dist/cjs/user/index.js +16 -7
  112. package/dist/esm/core/attempts.js +1 -1
  113. package/dist/esm/core/batch.js +2 -2
  114. package/dist/esm/core/consent.d.ts +18 -4
  115. package/dist/esm/core/consent.js +32 -17
  116. package/dist/esm/core/constants.d.ts +57 -27
  117. package/dist/esm/core/constants.js +51 -33
  118. package/dist/esm/core/db.d.ts +12 -4
  119. package/dist/esm/core/db.js +164 -35
  120. package/dist/esm/core/debug.js +1 -1
  121. package/dist/esm/core/env.d.ts +0 -3
  122. package/dist/esm/core/env.js +2 -9
  123. package/dist/esm/core/framework-id.d.ts +1 -1
  124. package/dist/esm/core/framework-id.js +3 -3
  125. package/dist/esm/core/guard.d.ts +9 -0
  126. package/dist/esm/core/guard.js +27 -14
  127. package/dist/esm/core/hooks.d.ts +7 -4
  128. package/dist/esm/core/hooks.js +3 -3
  129. package/dist/esm/core/locks.d.ts +9 -0
  130. package/dist/esm/core/locks.js +20 -0
  131. package/dist/esm/core/logger.d.ts +3 -4
  132. package/dist/esm/core/logger.js +4 -40
  133. package/dist/esm/core/state.d.ts +9 -6
  134. package/dist/esm/core/state.js +3 -5
  135. package/dist/esm/core/storage.d.ts +20 -5
  136. package/dist/esm/core/storage.js +113 -21
  137. package/dist/esm/core/stylesheet.d.ts +8 -0
  138. package/dist/esm/core/stylesheet.js +27 -0
  139. package/dist/esm/core/transport.d.ts +2 -0
  140. package/dist/esm/core/transport.js +30 -19
  141. package/dist/esm/core/utils.js +1 -1
  142. package/dist/esm/core/validate.js +2 -2
  143. package/dist/esm/device/appversion.d.ts +10 -6
  144. package/dist/esm/device/appversion.js +37 -4
  145. package/dist/esm/device/index.d.ts +28 -2
  146. package/dist/esm/device/index.js +313 -49
  147. package/dist/esm/engagement/api-rules.d.ts +32 -67
  148. package/dist/esm/engagement/api-rules.js +143 -155
  149. package/dist/esm/engagement/auto-api.js +3 -3
  150. package/dist/esm/engagement/auto-screen.d.ts +2 -0
  151. package/dist/esm/engagement/auto-screen.js +67 -4
  152. package/dist/esm/engagement/defined-events.js +1 -1
  153. package/dist/esm/engagement/send.js +12 -3
  154. package/dist/esm/engagement/session.d.ts +29 -3
  155. package/dist/esm/engagement/session.js +251 -30
  156. package/dist/esm/engagement/track.d.ts +4 -4
  157. package/dist/esm/engagement/track.js +65 -37
  158. package/dist/esm/errors/send.js +2 -2
  159. package/dist/esm/errors/track.d.ts +2 -1
  160. package/dist/esm/errors/track.js +49 -7
  161. package/dist/esm/feedback/controls.d.ts +12 -0
  162. package/dist/esm/feedback/controls.js +103 -26
  163. package/dist/esm/feedback/index.d.ts +8 -7
  164. package/dist/esm/feedback/index.js +34 -13
  165. package/dist/esm/feedback/logs.d.ts +13 -11
  166. package/dist/esm/feedback/logs.js +59 -30
  167. package/dist/esm/feedback/quartz.d.ts +18 -0
  168. package/dist/esm/feedback/quartz.js +99 -0
  169. package/dist/esm/feedback/send.d.ts +5 -2
  170. package/dist/esm/feedback/send.js +31 -31
  171. package/dist/esm/feedback/styles.d.ts +10 -0
  172. package/dist/esm/feedback/styles.js +4 -0
  173. package/dist/esm/feedback/template.d.ts +1 -1
  174. package/dist/esm/feedback/template.js +20 -12
  175. package/dist/esm/feedback/ui.d.ts +21 -6
  176. package/dist/esm/feedback/ui.js +283 -71
  177. package/dist/esm/heatmap/send.d.ts +2 -0
  178. package/dist/esm/heatmap/send.js +3 -5
  179. package/dist/esm/heatmap/track.d.ts +1 -1
  180. package/dist/esm/heatmap/track.js +87 -16
  181. package/dist/esm/index.d.ts +16 -63
  182. package/dist/esm/index.js +148 -83
  183. package/dist/esm/lifecycle.d.ts +21 -3
  184. package/dist/esm/lifecycle.js +359 -98
  185. package/dist/esm/remoteconfig/country.d.ts +4 -0
  186. package/dist/esm/remoteconfig/country.js +70 -0
  187. package/dist/esm/remoteconfig/custom.d.ts +7 -7
  188. package/dist/esm/remoteconfig/custom.js +32 -52
  189. package/dist/esm/remoteconfig/evaluate.d.ts +3 -3
  190. package/dist/esm/remoteconfig/evaluate.js +57 -44
  191. package/dist/esm/remoteconfig/fetch.d.ts +16 -9
  192. package/dist/esm/remoteconfig/fetch.js +120 -39
  193. package/dist/esm/remoteconfig/index.d.ts +19 -8
  194. package/dist/esm/remoteconfig/index.js +82 -40
  195. package/dist/esm/remoteconfig/store.d.ts +15 -7
  196. package/dist/esm/remoteconfig/store.js +68 -36
  197. package/dist/esm/remoteconfig/tz-countries.d.ts +8 -0
  198. package/dist/esm/remoteconfig/tz-countries.js +11 -0
  199. package/dist/{cjs/core → esm/remotelog}/callsite.d.ts +11 -4
  200. package/dist/esm/{core → remotelog}/callsite.js +30 -8
  201. package/dist/esm/remotelog/gate.d.ts +2 -11
  202. package/dist/esm/remotelog/gate.js +10 -32
  203. package/dist/esm/remotelog/index.d.ts +4 -21
  204. package/dist/esm/remotelog/logger.d.ts +11 -17
  205. package/dist/esm/remotelog/logger.js +33 -61
  206. package/dist/esm/remotelog/send.js +13 -13
  207. package/dist/esm/remotelogger/index.d.ts +12 -0
  208. package/dist/esm/remotelogger/index.js +13 -0
  209. package/dist/esm/scheduler.d.ts +3 -1
  210. package/dist/esm/scheduler.js +26 -24
  211. package/dist/esm/types.d.ts +208 -90
  212. package/dist/esm/user/index.js +18 -8
  213. package/dist/feedback.esm.min.js +2 -2
  214. package/dist/feedback.esm.min.js.map +1 -1
  215. package/dist/remoteconfig.esm.min.js +3 -0
  216. package/dist/remoteconfig.esm.min.js.map +1 -0
  217. package/dist/remotelogger.esm.min.js +3 -0
  218. package/dist/remotelogger.esm.min.js.map +1 -0
  219. package/package.json +16 -17
  220. package/dist/chunks/batch-BU_mTpm1.min.js +0 -3
  221. package/dist/chunks/batch-BU_mTpm1.min.js.map +0 -1
  222. package/dist/chunks/logs-Bea5zUW_.min.js +0 -3
  223. package/dist/chunks/logs-Bea5zUW_.min.js.map +0 -1
  224. package/dist/cjs/auto-init.d.ts +0 -8
  225. package/dist/cjs/auto-init.js +0 -32
  226. package/dist/cjs/heatmap/index.d.ts +0 -16
  227. package/dist/cjs/heatmap/index.js +0 -22
  228. package/dist/cjs/remotelog/index.js +0 -55
  229. package/dist/esm/auto-init.d.ts +0 -8
  230. package/dist/esm/auto-init.js +0 -29
  231. package/dist/esm/heatmap/index.d.ts +0 -16
  232. package/dist/esm/heatmap/index.js +0 -17
  233. package/dist/esm/remotelog/index.js +0 -51
  234. package/dist/heatmap.esm.min.js +0 -3
  235. package/dist/heatmap.esm.min.js.map +0 -1
  236. package/dist/style.css +0 -1
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta | (c) Zoho Corporation Private Limited | see LICENSE */
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
2
  'use strict';
3
3
 
4
4
  var constants = require('../core/constants.js');
@@ -25,7 +25,7 @@ function asUserProperties(jsonObj) {
25
25
  ? maybeBuilt
26
26
  : validate.userValidateJSON(jsonObj);
27
27
  built.message.forEach(function (problem) {
28
- logger.logFailure(constants.AP_LOG_MODULE.PROPERTIES, 'AppticsSetUser: dropped ' + problem.keys.join(', ') + ' (error ' + problem.code + ')'); // no i18n
28
+ logger.logFailure(constants.AP_LOG_MODULE.PROPERTIES, 'AppticsUser.setUser: dropped ' + problem.keys.join(', ') + ' (error ' + problem.code + ')'); // no i18n
29
29
  });
30
30
  return built;
31
31
  }
@@ -37,7 +37,7 @@ function setUser(userid, groupid, jsonObj) {
37
37
  return;
38
38
  }
39
39
  if (utils.isEmpty(userid)) {
40
- logger.logFailure(constants.AP_LOG_MODULE.PROPERTIES, 'AppticsSetUser: Invalid userid'); // no i18n
40
+ logger.logFailure(constants.AP_LOG_MODULE.PROPERTIES, 'AppticsUser.setUser: Invalid userid'); // no i18n
41
41
  return;
42
42
  }
43
43
  var user_info = {
@@ -68,8 +68,16 @@ function addOrUpdateUser(user_info) {
68
68
  users.push(user_info);
69
69
  }
70
70
  storage.user_defaults.add('users', users); // no i18n
71
+ // the user setUser registered, on its own as well: what this browser is tracking as now
72
+ storage.user_defaults.add('user_info', users[index !== -1 ? index : users.length - 1]); // no i18n
71
73
  }
72
74
  function getUserInfo() {
75
+ var stored = storage.user_defaults.item('user_info'); // no i18n
76
+ if (stored && typeof stored === 'object' && !utils.isEmpty(stored.userid)) { // no i18n
77
+ state._ZAP._user_info = stored;
78
+ return;
79
+ }
80
+ // registered before user_info was kept: the active one of the users list
73
81
  var users = storage.user_defaults.item('users') || []; // no i18n
74
82
  var activeuser = {};
75
83
  if (users.length > 0) {
@@ -96,11 +104,15 @@ function registerUserWithApptics(user_info) {
96
104
  var data = result.data || {};
97
105
  user_info.userid = data.userid;
98
106
  user_info.groupid = data.customergroupid;
99
- consent.setTrackingStatus(constants.AP_TRACKING_STATUS.USAGE_TRACKING_WITH_PII);
107
+ // stored only: user/register has told the server, and the device is registered already
108
+ consent.recordTrackingStatus(constants.AP_TRACKING_STATUS.USAGE_TRACKING_WITH_PII);
100
109
  addOrUpdateUser(user_info);
101
110
  getUserInfo();
102
111
  // the user and their customer group are known now: remote config conditions on them re-apply
103
112
  hooks.hooks.remoteConfigUserChanged();
113
+ // getsdkconfig answers for the user (with every module off for one whose customer group
114
+ // is not tracked, customergrouptracking: false), so it is asked again for them now
115
+ hooks.hooks.askServerSettings();
104
116
  return data;
105
117
  });
106
118
  }
@@ -166,8 +178,6 @@ class UserBuilder {
166
178
  return validate.userValidateJSON(user);
167
179
  }
168
180
  }
169
- // Users module for user management
170
- const users = { UserBuilder: UserBuilder };
171
181
 
172
182
  exports.UserBuilder = UserBuilder;
173
183
  exports.addOrUpdateUser = addOrUpdateUser;
@@ -175,4 +185,3 @@ exports.getUser = getUser;
175
185
  exports.getUserInfo = getUserInfo;
176
186
  exports.registerUserWithApptics = registerUserWithApptics;
177
187
  exports.setUser = setUser;
178
- exports.users = users;
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta | (c) Zoho Corporation Private Limited | see LICENSE */
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
2
  import { RETRY_CAPABLE_PATHS } from './constants.js';
3
3
  import { user_defaults } from './storage.js';
4
4
  import { nowMs } from './utils.js';
@@ -1,8 +1,8 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta | (c) Zoho Corporation Private Limited | see LICENSE */
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
2
  import { _ZAP, isExpired } from './state.js';
3
3
  import { Console, warnAlways } from './logger.js';
4
4
  import { isEmptyObj, sizeof } from './utils.js';
5
- import './constants.js';
5
+ import './db.js';
6
6
  import { shouldTrackOrSendData } from './consent.js';
7
7
  import { attemptsExhausted, MAX_ATTEMPTS, resetAttempts } from './attempts.js';
8
8
  import { rejectIfDisabled, rejectIfNoDeviceIds, getMetaObj, postKeepalive, apiHeaders, postToApptics } from './transport.js';
@@ -1,5 +1,10 @@
1
+ import { type EngagementType } from './constants.js';
1
2
  import type { TrackingStatus } from '../types.js';
2
- /** DNT counts only when not ignored; when it counts, tracking switches to NO_TRACKING. */
3
+ /**
4
+ * DNT counts only when not ignored; while it counts, tracking is NO_TRACKING (opt_in_status).
5
+ * Decided on every visit and never stored: storing it made one visit with DNT on look like the
6
+ * visitor's own choice, so tracking stayed off after DNT was turned off or ignore_do_not_track set.
7
+ */
3
8
  export declare function hasDoNotTrackEnabled(): boolean;
4
9
  export declare function opt_in_status(): TrackingStatus;
5
10
  export declare function shouldTrackOrSendData(): boolean;
@@ -8,8 +13,11 @@ export declare function shouldTrackOrSendData(): boolean;
8
13
  * and consent / server flags allow tracking.
9
14
  */
10
15
  export declare function canTrack(caller: string): boolean;
11
- /** canTrack plus the server's `engagementtracking` flag from getupdates (events, screens, sessions, api calls). */
12
- export declare function canTrackEngagement(caller: string): boolean;
16
+ /**
17
+ * canTrack plus the server's flag for this kind of item: getsdkconfig's event (5), api (6),
18
+ * screen (10) and session (11) modules, each switched on its own.
19
+ */
20
+ export declare function canTrackEngagement(caller: string, type: EngagementType): boolean;
13
21
  /**
14
22
  * canTrack plus the server's heatmap flag (getsdkconfig module 18).
15
23
  *
@@ -17,7 +25,13 @@ export declare function canTrackEngagement(caller: string): boolean;
17
25
  * well want events while declining to have every click's coordinates recorded.
18
26
  */
19
27
  export declare function canTrackHeatmap(caller: string): boolean;
20
- /** canTrack plus the server's `errortracking` flag from getupdates. */
28
+ /** canTrack plus the server's js_error module (15) from getsdkconfig. */
21
29
  export declare function canTrackErrors(caller: string): boolean;
30
+ /**
31
+ * Stores the visitor's tracking status without telling the server. True when it changed.
32
+ * user/register uses this alone: the server learns of the user from that call, so a device/add
33
+ * after it would only repeat a registration the device already has.
34
+ */
35
+ export declare function recordTrackingStatus(trackingState: TrackingStatus): boolean;
22
36
  export declare function setTrackingStatus(trackingState: TrackingStatus): void;
23
37
  export declare function getTrackingStatus(): TrackingStatus;
@@ -1,21 +1,23 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta | (c) Zoho Corporation Private Limited | see LICENSE */
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
2
  import { AP_TRACKING_STATUS } from './constants.js';
3
3
  import { _ZAP } from './state.js';
4
4
  import { Console } from './logger.js';
5
5
  import { isEmpty, isSuccess } from './utils.js';
6
6
  import { tracking_preference } from './storage.js';
7
- import { isDntOn, is_apptics_disabled } from './env.js';
7
+ import { is_apptics_disabled, isDntOn } from './env.js';
8
8
  import { hooks } from './hooks.js';
9
9
 
10
- /** DNT counts only when not ignored; when it counts, tracking switches to NO_TRACKING. */
10
+ /**
11
+ * DNT counts only when not ignored; while it counts, tracking is NO_TRACKING (opt_in_status).
12
+ * Decided on every visit and never stored: storing it made one visit with DNT on look like the
13
+ * visitor's own choice, so tracking stayed off after DNT was turned off or ignore_do_not_track set.
14
+ */
11
15
  function hasDoNotTrackEnabled() {
12
16
  if (_ZAP._ignoreDnt) {
13
17
  return false;
14
18
  }
15
19
  if (isDntOn()) {
16
- Console.warn('hasDoNotTrackEnabled: DoNotTrack is enabled'); // no i18n
17
- setTrackingStatus(AP_TRACKING_STATUS.NO_TRACKING);
18
- Console.log('hasDoNotTrackEnabled: Setting tracking status to NO_TRACKING'); // no i18n
20
+ Console.warn('hasDoNotTrackEnabled: DoNotTrack is enabled, so nothing is tracked'); // no i18n
19
21
  return true;
20
22
  }
21
23
  return false;
@@ -41,7 +43,7 @@ function shouldTrackOrSendData() {
41
43
  */
42
44
  function canTrack(caller) {
43
45
  if (!_ZAP._token) {
44
- Console.warn('apptics.' + caller + ': You must call apptics.init() first'); // no i18n
46
+ Console.warn('apptics.' + caller + ': You must call Apptics.init() first'); // no i18n
45
47
  return false;
46
48
  }
47
49
  if (is_apptics_disabled()) {
@@ -49,13 +51,16 @@ function canTrack(caller) {
49
51
  }
50
52
  return shouldTrackOrSendData();
51
53
  }
52
- /** canTrack plus the server's `engagementtracking` flag from getupdates (events, screens, sessions, api calls). */
53
- function canTrackEngagement(caller) {
54
+ /**
55
+ * canTrack plus the server's flag for this kind of item: getsdkconfig's event (5), api (6),
56
+ * screen (10) and session (11) modules, each switched on its own.
57
+ */
58
+ function canTrackEngagement(caller, type) {
54
59
  if (!canTrack(caller)) {
55
60
  return false;
56
61
  }
57
- if (!_ZAP._engagementTracking) {
58
- Console.log('apptics.' + caller + ': engagement tracking is turned off by the server'); // no i18n
62
+ if (!_ZAP._engagementTracking[type]) {
63
+ Console.log('apptics.' + caller + ': ' + type + ' tracking is turned off by the server'); // no i18n
59
64
  return false;
60
65
  }
61
66
  return true;
@@ -76,7 +81,7 @@ function canTrackHeatmap(caller) {
76
81
  }
77
82
  return true;
78
83
  }
79
- /** canTrack plus the server's `errortracking` flag from getupdates. */
84
+ /** canTrack plus the server's js_error module (15) from getsdkconfig. */
80
85
  function canTrackErrors(caller) {
81
86
  if (!canTrack(caller)) {
82
87
  return false;
@@ -87,17 +92,27 @@ function canTrackErrors(caller) {
87
92
  }
88
93
  return true;
89
94
  }
95
+ /**
96
+ * Stores the visitor's tracking status without telling the server. True when it changed.
97
+ * user/register uses this alone: the server learns of the user from that call, so a device/add
98
+ * after it would only repeat a registration the device already has.
99
+ */
100
+ function recordTrackingStatus(trackingState) {
101
+ if (tracking_preference.opt_in_status() == trackingState) {
102
+ return false;
103
+ }
104
+ tracking_preference.update_status(trackingState);
105
+ _ZAP._devicestatus = tracking_preference.opt_in_status();
106
+ return true;
107
+ }
90
108
  function setTrackingStatus(trackingState) {
91
109
  if (isEmpty(trackingState)) {
92
110
  Console.warn('setTrackingStatus: trackingStatus is Empty'); // no i18n
93
111
  return;
94
112
  }
95
- if (tracking_preference.opt_in_status() == trackingState) {
113
+ if (!recordTrackingStatus(trackingState)) {
96
114
  return;
97
115
  }
98
- tracking_preference.update_status(trackingState);
99
- _ZAP._devicestatus = tracking_preference.opt_in_status();
100
- _ZAP._isanonrequired = tracking_preference.opt_in_status() == AP_TRACKING_STATUS.USAGE_TRACKING_WITH_PII ? false : _ZAP._isanonrequired;
101
116
  if (tracking_preference.opt_in_status() != AP_TRACKING_STATUS.NO_TRACKING) {
102
117
  Console.log('setTrackingStatus: Updating device info with new tracking status'); // no i18n
103
118
  hooks.updateDevice(_ZAP._device_info).then(function (result) {
@@ -117,4 +132,4 @@ function getTrackingStatus() {
117
132
  return opt_in_status();
118
133
  }
119
134
 
120
- export { canTrack, canTrackEngagement, canTrackErrors, canTrackHeatmap, getTrackingStatus, hasDoNotTrackEnabled, opt_in_status, setTrackingStatus, shouldTrackOrSendData };
135
+ export { canTrack, canTrackEngagement, canTrackErrors, canTrackHeatmap, getTrackingStatus, hasDoNotTrackEnabled, opt_in_status, recordTrackingStatus, setTrackingStatus, shouldTrackOrSendData };
@@ -1,3 +1,19 @@
1
+ /**
2
+ * A screen_routes entry as init() keeps it, ready to match: a route pattern, or an exact path or a
3
+ * regular expression with the name it records.
4
+ */
5
+ export type ScreenRouteRule = {
6
+ kind: 'pattern';
7
+ pattern: string;
8
+ } | {
9
+ kind: 'equals';
10
+ path: string;
11
+ name: string;
12
+ } | {
13
+ kind: 'regex';
14
+ regex: RegExp;
15
+ name: string;
16
+ };
1
17
  export declare const AP_TRACKING_STATUS: Readonly<{
2
18
  readonly USAGE_TRACKING_WITH_PII: 1;
3
19
  readonly USAGE_TRACKING_WITHOUT_PII: 4;
@@ -18,6 +34,8 @@ export declare const AP_CONSTANTS: Readonly<{
18
34
  readonly SUCCESS: "success";
19
35
  readonly BROWSER: "Browser";
20
36
  }>;
37
+ /** The kinds of engagement item, each with its own getsdkconfig module: AP_CONSTANTS' type values. */
38
+ export type EngagementType = 'event' | 'screen' | 'session' | 'api';
21
39
  export declare const DEFAULT_API_PATHS: Readonly<{
22
40
  readonly addversion: "app/addversion";
23
41
  readonly regdevice: "device/add";
@@ -63,9 +81,13 @@ export declare const SDK_MODULE: Readonly<{
63
81
  * authority. Where they disagree, getsdkconfig wins.
64
82
  */
65
83
  readonly REMOTE_CONFIG: "2";
84
+ readonly EVENT: "5";
85
+ readonly API: "6";
86
+ readonly SCREEN: "10";
66
87
  readonly SESSION: "11";
67
88
  readonly FEEDBACK: "12";
68
- readonly CRASH: "13";
89
+ /** Uncaught and reported JavaScript errors: js_error. 13 (crash) and 14 (nonfatal) are the native SDKs'. */
90
+ readonly JS_ERROR: "15";
69
91
  readonly REMOTE_LOGGER: "17";
70
92
  readonly HEATMAP: "18";
71
93
  }>;
@@ -81,9 +103,10 @@ export declare const LOG_FILENAME_MAX = 100;
81
103
  */
82
104
  export declare const DEVICE_NAME_MAX = 100;
83
105
  /**
84
- * The `level` every line goes out with. Everything the remote logger carries is a failure inside
85
- * the SDK — logFailure is its only caller — so the level never varies. 3 is what the v2 reference
86
- * shows in its only example; the scale itself is not documented anywhere we can see.
106
+ * The `level` a remote log line goes out with when it has none of its own: 3, Info. Every line an
107
+ * app writes with AppticsLogger carries its level (1 verbose to 5 error, see LOG_LEVEL in
108
+ * remotelog/logger.ts). Only a line an older SDK stored, when the SDK logged its own failures
109
+ * there, has none; it is sent as Info rather than having the batch refused for a missing level.
87
110
  */
88
111
  export declare const REMOTE_LOG_LEVEL = 3;
89
112
  /**
@@ -93,31 +116,18 @@ export declare const REMOTE_LOG_LEVEL = 3;
93
116
  * enough that a tab left open overnight is not still sending every call to its debug twin.
94
117
  */
95
118
  export declare const DEBUG_IDLE_MS: number;
96
- /** Idle minutes that end a session. Lives on state, not in _config, but defaults here. */
119
+ /** Minutes a tab can be inactive before its session ends. Lives on state, not in _config, but defaults here. */
97
120
  export declare const DEFAULT_INACTIVE_MINUTES = 30;
98
121
  /** Global defaults. `state._config` holds a mutable copy per init. */
99
122
  export declare const AP_CONFIG: Readonly<{
100
123
  endpoint: "/sdk/web/";
101
124
  method: "POST";
102
- transport: "XHR";
103
- track_link_timeout: 300;
104
- cookie_expiration_days: 365;
105
- storage_type: "localStorage";
106
- enable_batch_requests: true;
107
125
  batch_size: 50;
108
126
  batch_flush_interval: 30000;
109
127
  getupdates_interval: 120000;
110
128
  batch_request_timeout: 7;
111
- auto_starts_batch: true;
112
- mode: 1;
113
- default_group_name: "default";
114
- default_optin_status: number;
115
- enable_pageview_tracking: false;
116
- save_referrer: true;
117
129
  debug: boolean;
118
- track_by_default: true;
119
130
  ignore_do_not_track: boolean;
120
- remote_log: boolean;
121
131
  /**
122
132
  * Wrap XHR and fetch to record the app's API calls without it calling startTrackApi(). Off by
123
133
  * default: the hostnames and paths of every request an app makes is a wider grant than events
@@ -130,15 +140,26 @@ export declare const AP_CONFIG: Readonly<{
130
140
  */
131
141
  track_screen: boolean;
132
142
  /**
133
- * Print each app logger line to the browser console as well, as Android's showLogs prints to
134
- * Logcat. Off by default; console_log is the SDK's own activity, this is the app's lines.
143
+ * Record uncaught errors and unhandled promise rejections, from the window's `error` and
144
+ * `unhandledrejection` events. On by default; AppticsError.setErrorTracking() switches it later.
135
145
  */
136
- show_logs: boolean;
146
+ track_error: boolean;
137
147
  /**
138
- * Record sessions automatically. On by default; false is Android's
139
- * automaticSessionsTrackingStatus = false: no sessions, while events and screens still are.
148
+ * Record clicks on elements tagged `apeventaction` (or `data-apeventaction`) as events. On by
149
+ * default; AppticsEvent.setClickTracking() switches it later.
140
150
  */
141
- track_session: boolean;
151
+ track_click: boolean;
152
+ /**
153
+ * How automatic screen tracking names a path, as init() keeps the config's screen_routes: route
154
+ * patterns (`/users/{id}/orders`, each id recorded as a star), exact paths and regular
155
+ * expressions with a name. Tried in order; a path none matches keeps its own name.
156
+ */
157
+ screen_routes: ScreenRouteRule[];
158
+ /**
159
+ * The feedback form's theme: 'light', 'dark', or 'auto' to follow the visitor's system setting.
160
+ * 'auto' by default.
161
+ */
162
+ feedback_theme: "light" | "dark" | "auto";
142
163
  /**
143
164
  * How long a visit must last before its session is stored, in milliseconds. A shorter visit with
144
165
  * nothing tracked in it is dropped: a bounce or a crawler is not a session. Anything tracked
@@ -187,7 +208,13 @@ export type ApConfig = {
187
208
  * What init() must be given. Everything else the SDK needs — aaid, the portal and project ids that
188
209
  * go in every url — comes back from app/addversion, which these four are enough to call.
189
210
  */
190
- export declare const REQUIRED_CONFIG: readonly ["serviceUrl", "zak", "identifier", "appversion"];
211
+ export declare const REQUIRED_CONFIG: readonly ["base_url", "auth_key", "app_domain", "appversion"];
212
+ /**
213
+ * The init() keys and the names the SDK keeps them under inside (and in app_version_info, which
214
+ * already-visited browsers have stored): base_url is the host, auth_key the `zak` header, and
215
+ * app_domain the app's identifier.
216
+ */
217
+ export declare const CONFIG_KEYS: Readonly<Record<string, string>>;
191
218
  /**
192
219
  * Paths with a `debug/` twin. The debug endpoints take the same body and answer with a request id
193
220
  * and a link to the server-side logs for that request, which is how a payload is traced end to
@@ -207,6 +234,9 @@ export declare const RETRY_CAPABLE_PATHS: Readonly<Record<string, boolean>>;
207
234
  * called before those ids are known, so it cannot carry them.
208
235
  */
209
236
  export declare const PATHS_WITHOUT_ORG: Readonly<Record<string, boolean>>;
210
- /** Console-snippet names accepted for the canonical keys above. */
211
- export declare const CONFIG_ALIASES: Readonly<Record<string, string>>;
237
+ /**
238
+ * Earlier names of the init() keys: 2.0.0-beta's serviceUrl, zak and identifier, and the 1.x
239
+ * console snippet's base_domain and token. Still read, with a warning naming the key to use.
240
+ */
241
+ export declare const RETIRED_CONFIG_NAMES: Readonly<Record<string, string>>;
212
242
  export declare const BLOCKED_WS: readonly string[];
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta | (c) Zoho Corporation Private Limited | see LICENSE */
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
2
  const AP_TRACKING_STATUS = Object.freeze({
3
3
  USAGE_TRACKING_WITH_PII: 1,
4
4
  USAGE_TRACKING_WITHOUT_PII: 4,
@@ -83,9 +83,13 @@ const SDK_MODULE = Object.freeze({
83
83
  * authority. Where they disagree, getsdkconfig wins.
84
84
  */
85
85
  REMOTE_CONFIG: '2', // no i18n
86
+ EVENT: '5', // no i18n
87
+ API: '6', // no i18n
88
+ SCREEN: '10', // no i18n
86
89
  SESSION: '11', // no i18n
87
90
  FEEDBACK: '12', // no i18n
88
- CRASH: '13', // no i18n
91
+ /** Uncaught and reported JavaScript errors: js_error. 13 (crash) and 14 (nonfatal) are the native SDKs'. */
92
+ JS_ERROR: '15', // no i18n
89
93
  REMOTE_LOGGER: '17', // no i18n
90
94
  HEATMAP: '18', // no i18n
91
95
  });
@@ -101,9 +105,10 @@ const LOG_FILENAME_MAX = 100;
101
105
  */
102
106
  const DEVICE_NAME_MAX = 100;
103
107
  /**
104
- * The `level` every line goes out with. Everything the remote logger carries is a failure inside
105
- * the SDK — logFailure is its only caller — so the level never varies. 3 is what the v2 reference
106
- * shows in its only example; the scale itself is not documented anywhere we can see.
108
+ * The `level` a remote log line goes out with when it has none of its own: 3, Info. Every line an
109
+ * app writes with AppticsLogger carries its level (1 verbose to 5 error, see LOG_LEVEL in
110
+ * remotelog/logger.ts). Only a line an older SDK stored, when the SDK logged its own failures
111
+ * there, has none; it is sent as Info rather than having the batch refused for a missing level.
107
112
  */
108
113
  const REMOTE_LOG_LEVEL = 3;
109
114
  /**
@@ -113,33 +118,19 @@ const REMOTE_LOG_LEVEL = 3;
113
118
  * enough that a tab left open overnight is not still sending every call to its debug twin.
114
119
  */
115
120
  const DEBUG_IDLE_MS = 60 * 60 * 1000;
116
- /** Idle minutes that end a session. Lives on state, not in _config, but defaults here. */
121
+ /** Minutes a tab can be inactive before its session ends. Lives on state, not in _config, but defaults here. */
117
122
  const DEFAULT_INACTIVE_MINUTES = 30;
118
123
  /** Global defaults. `state._config` holds a mutable copy per init. */
119
124
  const AP_CONFIG = Object.freeze({
120
125
  // the version is per path (API_VERSIONS); this is only the part before it
121
126
  endpoint: '/sdk/web/', // no i18n
122
127
  method: 'POST', // no i18n
123
- transport: 'XHR', // no i18n
124
- track_link_timeout: 300,
125
- cookie_expiration_days: 365,
126
- storage_type: 'localStorage', // no i18n
127
- enable_batch_requests: true,
128
128
  batch_size: 50,
129
129
  batch_flush_interval: 30000,
130
- getupdates_interval: 120000, // 2 minutes in milliseconds
130
+ getupdates_interval: 120000, // 2 minutes in milliseconds, when getsdkconfig gives no next_check_after
131
131
  batch_request_timeout: 7,
132
- auto_starts_batch: true,
133
- mode: 1,
134
- default_group_name: 'default', // no i18n
135
- default_optin_status: AP_TRACKING_STATUS.USAGE_TRACKING_WITHOUT_PII,
136
- enable_pageview_tracking: false,
137
- save_referrer: true,
138
132
  debug: false,
139
- track_by_default: true,
140
133
  ignore_do_not_track: false,
141
- // the SDK's own failure reports to the Remote Logger page: off unless the app passes remote_log: true
142
- remote_log: false,
143
134
  /**
144
135
  * Wrap XHR and fetch to record the app's API calls without it calling startTrackApi(). Off by
145
136
  * default: the hostnames and paths of every request an app makes is a wider grant than events
@@ -152,15 +143,26 @@ const AP_CONFIG = Object.freeze({
152
143
  */
153
144
  track_screen: true,
154
145
  /**
155
- * Print each app logger line to the browser console as well, as Android's showLogs prints to
156
- * Logcat. Off by default; console_log is the SDK's own activity, this is the app's lines.
146
+ * Record uncaught errors and unhandled promise rejections, from the window's `error` and
147
+ * `unhandledrejection` events. On by default; AppticsError.setErrorTracking() switches it later.
157
148
  */
158
- show_logs: false,
149
+ track_error: true,
159
150
  /**
160
- * Record sessions automatically. On by default; false is Android's
161
- * automaticSessionsTrackingStatus = false: no sessions, while events and screens still are.
151
+ * Record clicks on elements tagged `apeventaction` (or `data-apeventaction`) as events. On by
152
+ * default; AppticsEvent.setClickTracking() switches it later.
162
153
  */
163
- track_session: true,
154
+ track_click: true,
155
+ /**
156
+ * How automatic screen tracking names a path, as init() keeps the config's screen_routes: route
157
+ * patterns (`/users/{id}/orders`, each id recorded as a star), exact paths and regular
158
+ * expressions with a name. Tried in order; a path none matches keeps its own name.
159
+ */
160
+ screen_routes: [],
161
+ /**
162
+ * The feedback form's theme: 'light', 'dark', or 'auto' to follow the visitor's system setting.
163
+ * 'auto' by default.
164
+ */
165
+ feedback_theme: 'auto',
164
166
  /**
165
167
  * How long a visit must last before its session is stored, in milliseconds. A shorter visit with
166
168
  * nothing tracked in it is dropped: a bounce or a crawler is not a session. Anything tracked
@@ -206,7 +208,17 @@ const AP_CONFIG = Object.freeze({
206
208
  * What init() must be given. Everything else the SDK needs — aaid, the portal and project ids that
207
209
  * go in every url — comes back from app/addversion, which these four are enough to call.
208
210
  */
209
- const REQUIRED_CONFIG = Object.freeze(['serviceUrl', 'zak', 'identifier', 'appversion']); // no i18n
211
+ const REQUIRED_CONFIG = Object.freeze(['base_url', 'auth_key', 'app_domain', 'appversion']); // no i18n
212
+ /**
213
+ * The init() keys and the names the SDK keeps them under inside (and in app_version_info, which
214
+ * already-visited browsers have stored): base_url is the host, auth_key the `zak` header, and
215
+ * app_domain the app's identifier.
216
+ */
217
+ const CONFIG_KEYS = Object.freeze({
218
+ base_url: 'serviceUrl', // no i18n
219
+ auth_key: 'zak', // no i18n
220
+ app_domain: 'identifier', // no i18n
221
+ });
210
222
  /**
211
223
  * Paths with a `debug/` twin. The debug endpoints take the same body and answer with a request id
212
224
  * and a link to the server-side logs for that request, which is how a payload is traced end to
@@ -241,10 +253,16 @@ const RETRY_CAPABLE_PATHS = Object.freeze({
241
253
  const PATHS_WITHOUT_ORG = Object.freeze({
242
254
  addversion: true, // no i18n
243
255
  });
244
- /** Console-snippet names accepted for the canonical keys above. */
245
- const CONFIG_ALIASES = Object.freeze({
246
- serviceUrl: 'base_domain', // no i18n
247
- zak: 'token', // no i18n
256
+ /**
257
+ * Earlier names of the init() keys: 2.0.0-beta's serviceUrl, zak and identifier, and the 1.x
258
+ * console snippet's base_domain and token. Still read, with a warning naming the key to use.
259
+ */
260
+ const RETIRED_CONFIG_NAMES = Object.freeze({
261
+ serviceUrl: 'base_url', // no i18n
262
+ base_domain: 'base_url', // no i18n
263
+ zak: 'auth_key', // no i18n
264
+ token: 'auth_key', // no i18n
265
+ identifier: 'app_domain', // no i18n
248
266
  });
249
267
  // crawlers reference
250
268
  // https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers
@@ -274,4 +292,4 @@ const BLOCKED_WS = Object.freeze([
274
292
  'storebot-google', // no i18n
275
293
  ]);
276
294
 
277
- export { API_VERSIONS, AP_CONFIG, AP_CONSTANTS, AP_FEEDBACK_TYPE, AP_LOG_MODULE, AP_TRACKING_STATUS, BLOCKED_WS, CONFIG_ALIASES, CONSOLE_LOG_MAX_BODY, DEBUG_CAPABLE_PATHS, DEBUG_IDLE_MS, DEFAULT_API_PATHS, DEFAULT_INACTIVE_MINUTES, DEVICE_NAME_MAX, LOG_FILENAME_MAX, LOG_FUNCTION_MAX, PATHS_WITHOUT_ORG, REMOTE_LOG_LEVEL, REQUIRED_CONFIG, RETRY_CAPABLE_PATHS, SDK_MODULE };
295
+ export { API_VERSIONS, AP_CONFIG, AP_CONSTANTS, AP_FEEDBACK_TYPE, AP_LOG_MODULE, AP_TRACKING_STATUS, BLOCKED_WS, CONFIG_KEYS, CONSOLE_LOG_MAX_BODY, DEBUG_CAPABLE_PATHS, DEBUG_IDLE_MS, DEFAULT_API_PATHS, DEFAULT_INACTIVE_MINUTES, DEVICE_NAME_MAX, LOG_FILENAME_MAX, LOG_FUNCTION_MAX, PATHS_WITHOUT_ORG, REMOTE_LOG_LEVEL, REQUIRED_CONFIG, RETIRED_CONFIG_NAMES, RETRY_CAPABLE_PATHS, SDK_MODULE };
@@ -1,10 +1,12 @@
1
1
  import type { Dict, QueueItem } from '../types.js';
2
- export type QueueName = 'engagements' | 'errors' | 'logs' | 'consolelogs' | 'heatmaps';
2
+ export type QueueName = 'engagements' | 'errors' | 'feedbacklogs' | 'remotelogs' | 'heatmaps';
3
3
  /** One storage implementation. storage.ts talks only to this interface. */
4
4
  export interface Backend {
5
5
  readonly kind: 'indexeddb' | 'localstorage';
6
6
  loadSettings(): Promise<Dict>;
7
7
  putSetting(key: string, value: unknown): Promise<void>;
8
+ /** Removes the key itself, so it is no longer in storage at all. */
9
+ deleteSetting(key: string): Promise<void>;
8
10
  clearSettings(): Promise<void>;
9
11
  /** Items in insertion order. */
10
12
  queueAll(store: QueueName): Promise<QueueItem[]>;
@@ -16,16 +18,22 @@ export interface Backend {
16
18
  importAll?(settings: Dict, queues: Record<QueueName, QueueItem[]>): Promise<void>;
17
19
  }
18
20
  export declare const DB_NAME = "apptics";
19
- export declare const DB_VERSION = 3;
20
- /** 1.x localStorage keys; also the layout of the localStorage backend. */
21
+ export declare const DB_VERSION = 4;
22
+ /** The types a feedback entry is stored under: an addFeedbackLog() line, an addDiagnosticsInfo() entry. */
23
+ export declare const FEEDBACK_LOG = "feedbacklog";
24
+ export declare const FEEDBACK_DIAGNOSTICS = "feedbackdiagnostics";
25
+ /** A feedback entry from 1.x or 2.0.0-beta, with the type it is stored under now. */
26
+ export declare function renameFeedbackType(item: QueueItem): QueueItem;
27
+ /** 1.x localStorage keys, read once to bring 1.x data into IndexedDB (see migrateLegacy). */
21
28
  export declare const LEGACY_KEYS: Readonly<{
22
29
  readonly settings: "apptics-device-info";
23
30
  readonly engagements: "apptics-engagements-transactions";
24
31
  readonly errors: "apptics-errors-transactions";
25
32
  readonly logs: "apptics-log-transactions";
26
33
  readonly consolelogs: "apptics-consolelog-transactions";
27
- readonly heatmaps: "apptics-heatmap-transactions";
28
34
  }>;
35
+ /** The localStorage backend's layout, for a browser where IndexedDB will not open. */
36
+ export declare const LOCAL_KEYS: Readonly<Record<'settings' | QueueName, string>>;
29
37
  /** Shape guards shared by both backends and the 1.x migration. */
30
38
  export declare function asList(value: unknown): QueueItem[];
31
39
  export declare function asDict(value: unknown): Dict;