@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');
@@ -42,7 +42,7 @@ function entryFor(item) {
42
42
  var entry = {
43
43
  sessionstarttime: state._ZAP._current_session.starttime || item.happenedat || utils.nowMs(),
44
44
  logtime: item.happenedat || utils.nowMs(),
45
- // an app's line carries the level it was logged at; the SDK's own failures carry none
45
+ // an app's line carries the level it was logged at; only a line an older SDK stored has none
46
46
  level: Number(item.level) || constants.REMOTE_LOG_LEVEL,
47
47
  logmessage: String(item.exceptionlog).slice(0, constants.CONSOLE_LOG_MAX_BODY),
48
48
  function: String(item.module || 'SDK').slice(0, constants.LOG_FUNCTION_MAX), // no i18n
@@ -87,7 +87,7 @@ function trim(items) {
87
87
  if (keepFrom === 0) {
88
88
  return items;
89
89
  }
90
- storage.consolelog_transactions.remove(items.slice(0, keepFrom));
90
+ storage.remotelog_transactions.remove(items.slice(0, keepFrom));
91
91
  return items.slice(keepFrom);
92
92
  }
93
93
  /**
@@ -95,21 +95,21 @@ function trim(items) {
95
95
  * retrying it could only fail the same way and would hold every later line behind it.
96
96
  */
97
97
  function sendStoredLogs() {
98
- if (sending || !gate.remoteLogSendable() || navigator.onLine === false) {
98
+ if (sending || !gate.remoteLoggerReachable() || navigator.onLine === false) {
99
99
  return Promise.resolve();
100
100
  }
101
101
  sending = true;
102
- return storage.consolelog_transactions.all().then(function (stored) {
102
+ return storage.remotelog_transactions.all().then(function (stored) {
103
103
  var batch = trim(stored).slice(0, MAX_PER_BATCH);
104
104
  if (batch.length === 0) {
105
105
  return undefined;
106
106
  }
107
107
  return transport.postToApptics('consolelog', bodyFor(batch), transport.apiHeaders(), LABEL).then(function () {
108
- return storage.consolelog_transactions.remove(batch);
108
+ return storage.remotelog_transactions.remove(batch);
109
109
  }, function (err) {
110
110
  if (transport.isPermanentRefusal(err)) {
111
111
  logger.warnAlways('apptics: the server refused these log lines, so they were dropped: ' + String(err && err.message)); // no i18n
112
- return storage.consolelog_transactions.remove(batch);
112
+ return storage.remotelog_transactions.remove(batch);
113
113
  }
114
114
  logger.Console.log(LABEL + ': ' + String(err)); // no i18n
115
115
  return undefined;
@@ -126,20 +126,20 @@ function sendStoredLogs() {
126
126
  * stay stored until the server has confirmed them.
127
127
  */
128
128
  function forgetStoredLogs() {
129
- if (!gate.remoteLogSendable()) {
129
+ if (!gate.remoteLoggerReachable()) {
130
130
  return Promise.resolve();
131
131
  }
132
- return storage.consolelog_transactions.all().then(function (stored) {
132
+ return storage.remotelog_transactions.all().then(function (stored) {
133
133
  if (stored.length === 0) {
134
134
  return undefined;
135
135
  }
136
136
  var batch = stored.slice(0, MAX_PER_BATCH);
137
137
  // removed once the server has them; lines whose answer never comes go on the next visit
138
138
  transport.postKeepalive('consolelog', bodyFor(batch), transport.apiHeaders(), LABEL).then(function () {
139
- return storage.consolelog_transactions.remove(batch);
139
+ return storage.remotelog_transactions.remove(batch);
140
140
  }, function (err) {
141
141
  if (transport.isPermanentRefusal(err)) {
142
- return storage.consolelog_transactions.remove(batch);
142
+ return storage.remotelog_transactions.remove(batch);
143
143
  }
144
144
  logger.Console.log(LABEL + ': ' + String(err)); // no i18n
145
145
  return undefined;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The app logger, shipped as its own entry point:
3
+ * import { AppticsLogger } from '@zoho_apptics/apptics-js-sdk/remote-logger';
4
+ *
5
+ * AppticsLogger: verbose / debug / info / warn / error(message, props?), shown on the
6
+ * console's Remote Logger page. A line is recorded as it is written, with no switch to turn on.
7
+ * Apps that don't import it don't ship it.
8
+ */
9
+ import { AppticsLogger } from '../remotelog/logger.js';
10
+ export { AppticsLogger };
11
+ export type { AppticsLogger as AppticsLoggerApi } from '../remotelog/logger.js';
12
+ export default AppticsLogger;
@@ -0,0 +1,18 @@
1
+ /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var logger = require('../remotelog/logger.js');
7
+
8
+ /**
9
+ * The app logger, shipped as its own entry point:
10
+ * import { AppticsLogger } from '@zoho_apptics/apptics-js-sdk/remote-logger';
11
+ *
12
+ * AppticsLogger: verbose / debug / info / warn / error(message, props?), shown on the
13
+ * console's Remote Logger page. A line is recorded as it is written, with no switch to turn on.
14
+ * Apps that don't import it don't ship it.
15
+ */
16
+
17
+ exports.AppticsLogger = logger.AppticsLogger;
18
+ exports.default = logger.AppticsLogger;
@@ -3,6 +3,8 @@
3
3
  * response (page hide), so they survive the page going away.
4
4
  */
5
5
  export declare function flush(forget?: boolean): Promise<void>;
6
- /** Starts the flush and getupdates intervals once; later calls do nothing until stopTimers(). */
6
+ /** Apptics.flush(): flush(), at most once every CALLED_FLUSH_GAP_MS. A call sooner sends nothing. */
7
+ export declare function calledFlush(): Promise<void>;
8
+ /** Starts the flush interval once; later calls do nothing until stopTimers(). */
7
9
  export declare function startTimers(): void;
8
10
  export declare function stopTimers(): void;
@@ -1,9 +1,9 @@
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 state = require('./core/state.js');
5
- var utils = require('./core/utils.js');
6
5
  var logger = require('./core/logger.js');
6
+ var utils = require('./core/utils.js');
7
7
  var consent = require('./core/consent.js');
8
8
  var batch = require('./core/batch.js');
9
9
  var send = require('./engagement/send.js');
@@ -25,13 +25,30 @@ function flush(forget) {
25
25
  return send.sendEngagementData(forget).then(function () {
26
26
  return send$1.sendErrorData(forget);
27
27
  }).then(function () {
28
- // no-op unless the heatmap entry was imported, which is what sets the hook
28
+ // the hook heatmap/send.ts sets
29
29
  return hooks.hooks.sendHeatmaps(forget);
30
30
  });
31
31
  }
32
+ /**
33
+ * How often Apptics.flush() sends when it is called by hand, from the console or the app's own
34
+ * code: once every 15 seconds, however often it is called. The SDK's own sends (the flush
35
+ * interval, page hide and close, back online) call flush() directly and are not held to it.
36
+ */
37
+ const CALLED_FLUSH_GAP_MS = 15 * 1000;
38
+ /** When Apptics.flush() last sent; 0 until it has. */
39
+ var calledFlushAt = 0;
40
+ /** Apptics.flush(): flush(), at most once every CALLED_FLUSH_GAP_MS. A call sooner sends nothing. */
41
+ function calledFlush() {
42
+ var now = utils.nowMs();
43
+ if (calledFlushAt > 0 && now - calledFlushAt < CALLED_FLUSH_GAP_MS) {
44
+ logger.Console.log('Apptics.flush: sent ' + (now - calledFlushAt) + ' ms ago; it sends at most once every ' + CALLED_FLUSH_GAP_MS + ' ms, and the timer sends the rest'); // no i18n
45
+ return Promise.resolve();
46
+ }
47
+ calledFlushAt = now;
48
+ return flush();
49
+ }
32
50
  var sendingInterval = null;
33
- var getUpdatesInterval = null;
34
- /** Starts the flush and getupdates intervals once; later calls do nothing until stopTimers(). */
51
+ /** Starts the flush interval once; later calls do nothing until stopTimers(). */
35
52
  function startTimers() {
36
53
  if (sendingInterval === null) {
37
54
  sendingInterval = setInterval(function () {
@@ -48,31 +65,17 @@ function startTimers() {
48
65
  });
49
66
  }, state.getConfig('batch_flush_interval')); // no i18n
50
67
  }
51
- if (getUpdatesInterval === null) {
52
- // the interval is the floor, not the schedule: getsdkconfig answers with next_check_after,
53
- // and asking again before then is a call the server has already told us it will not answer
54
- // differently. The timer still ticks so a server that sends no hint behaves as before.
55
- getUpdatesInterval = setInterval(function () {
56
- if (state._ZAP._nextConfigCheck > 0 && utils.nowMs() < state._ZAP._nextConfigCheck) {
57
- return;
58
- }
59
- logger.Console.log('scheduleToGetUpdatesFromServer: asking the server for its config'); // no i18n
60
- index.getUpdatesFromServer().catch(function (err) {
61
- logger.Console.log(err);
62
- });
63
- }, state.getConfig('getupdates_interval')); // no i18n
64
- }
65
68
  }
66
69
  function stopTimers() {
67
70
  if (sendingInterval !== null)
68
71
  clearInterval(sendingInterval);
69
- if (getUpdatesInterval !== null)
70
- clearInterval(getUpdatesInterval);
71
72
  sendingInterval = null;
72
- getUpdatesInterval = null;
73
73
  batch.clearDefer();
74
+ index.stopServerSettingChecks();
75
+ calledFlushAt = 0;
74
76
  }
75
77
 
78
+ exports.calledFlush = calledFlush;
76
79
  exports.flush = flush;
77
80
  exports.startTimers = startTimers;
78
81
  exports.stopTimers = stopTimers;
@@ -1,8 +1,15 @@
1
1
  import type { AP_FEEDBACK_TYPE, AP_TRACKING_STATUS } from './core/constants.js';
2
2
  import type { UserBuilder } from './user/index.js';
3
3
  import type { ApiTrackingBuilder, ApiTrackingConfig } from './engagement/api-rules.js';
4
- import type { DefinedEvent } from './engagement/defined-events.js';
5
- import type { AppticsLogger } from './remotelog/logger.js';
4
+ import type { DefinedEvent, DefinedEvents } from './engagement/defined-events.js';
5
+ /** One entry of screen_routes: a route pattern, or an exact path or a regular expression with the name to record. */
6
+ export type ScreenRoute = string | {
7
+ equals: string;
8
+ name: string;
9
+ } | {
10
+ regex: RegExp | string;
11
+ name: string;
12
+ };
6
13
  /** Loose record for legacy payloads and server JSON that are built and sent as-is. */
7
14
  export type Dict = Record<string, any>;
8
15
  /** An item in the engagement or error queue. */
@@ -30,14 +37,14 @@ export interface ServerResult<T = Dict> {
30
37
  export type TrackingStatus = (typeof AP_TRACKING_STATUS)[keyof typeof AP_TRACKING_STATUS];
31
38
  export type FeedbackType = (typeof AP_FEEDBACK_TYPE)[keyof typeof AP_FEEDBACK_TYPE];
32
39
  export type Properties = Record<string, unknown>;
33
- /** The config init() requires. The console snippet provides the same shape as window.appticssettings._defaultoptions. */
40
+ /** The config init() requires. */
34
41
  export interface AppticsConfig {
35
- /** Apptics host every request goes to, e.g. https://apptics.localzoho.com (a trailing slash is ignored). */
36
- serviceUrl: string;
37
- /** The app's token, sent as the `zak` header on app/addversion and device registration. */
38
- zak: string;
39
- /** App identifier, e.g. com.zoho.web.zylker. */
40
- identifier: string;
42
+ /** Apptics host every request goes to, e.g. https://apptics.zoho.com (a trailing slash is ignored). Was `serviceUrl`. */
43
+ base_url: string;
44
+ /** The app's key from the console, sent as the `zak` header on app/addversion and device registration. Was `zak`. */
45
+ auth_key: string;
46
+ /** The app's domain as registered in the console, e.g. com.zoho.web.zylker. Was `identifier`. */
47
+ app_domain: string;
41
48
  /**
42
49
  * Your app's version or build number, e.g. '2.4.0' or 512. Required: everything the SDK reports
43
50
  * is only meaningful against the build it came from, so there is no default. Changing it
@@ -54,12 +61,10 @@ export interface AppticsConfig {
54
61
  zsoid?: string;
55
62
  /** @deprecated ignored: app/addversion answers with the project id */
56
63
  projectID?: string;
57
- /** @deprecated console-snippet name for serviceUrl */
64
+ /** @deprecated 1.x console-snippet name for base_url: still read, with a warning */
58
65
  base_domain?: string;
59
- /** @deprecated console-snippet name for zak */
66
+ /** @deprecated 1.x console-snippet name for auth_key: still read, with a warning */
60
67
  token?: string;
61
- /** Data centre key for Quartz screen recording: US, EU, IN, AU, CN, CA, JP, SA, AE, Local, or '-' to disable. */
62
- DC?: string;
63
68
  /**
64
69
  * Debug mode: send engagement, exception and log payloads to their `debug/` twins, which answer
65
70
  * with a request id and a link to the server's own logs, for following in the Apptics web
@@ -69,17 +74,10 @@ export interface AppticsConfig {
69
74
  /** Log the SDK's own activity to the browser console. Off by default. */
70
75
  console_log?: boolean;
71
76
  ignore_do_not_track?: boolean;
72
- /**
73
- * Send the SDK's own failures to console/addlog, so they can be read from the Apptics console.
74
- * This carries no app data: one line per failure, tagged with the SDK module it happened in.
75
- */
76
- remote_log?: boolean;
77
- quartz_workspace_key?: string;
78
- quartz_department_key?: string;
79
77
  /**
80
78
  * Record the app's API calls automatically, by wrapping XHR and fetch. Off by default. The SDK's
81
79
  * own requests are never recorded. Which hosts and endpoints are recorded, and under what path,
82
- * is set with configureApiTracking(new ApiTrackingBuilder()...build()).
80
+ * is set with AppticsApi.configure(new AppticsApi.ApiTrackingBuilder()...build()).
83
81
  */
84
82
  track_api?: boolean;
85
83
  /**
@@ -90,24 +88,48 @@ export interface AppticsConfig {
90
88
  */
91
89
  track_screen?: boolean;
92
90
  /**
93
- * Print each `logger` line to the browser console too, at its level, as Android's showLogs
94
- * prints to Logcat. Off by default. `console_log` is the SDK's own activity; this is the app's lines.
91
+ * Record uncaught errors and unhandled promise rejections automatically. On by default; set this
92
+ * false to record only the errors the app hands to AppticsError.trackError(). Switched later with
93
+ * AppticsError.setErrorTracking().
94
+ */
95
+ track_error?: boolean;
96
+ /**
97
+ * Record clicks on elements tagged `apeventaction` (or `data-apeventaction`) as events, in the
98
+ * group of the nearest `apgroupaction` around them. On by default; switched later with
99
+ * AppticsEvent.setClickTracking().
95
100
  */
96
- show_logs?: boolean;
101
+ track_click?: boolean;
97
102
  /**
98
- * Record sessions automatically. On by default; `false` records no sessions, while events,
99
- * screens and the rest still are — Android's `automaticSessionsTrackingStatus = false`.
103
+ * How automatic screen tracking names a path, tried in order; the first that matches wins, and a
104
+ * path none matches keeps its own name. Each entry is one of:
105
+ * - a route pattern, `'/users/{id}/orders'`: `{name}`, `:name` and `*` each match one segment,
106
+ * recorded as a star, so `/users/42/orders` and `/users/43/orders` are one screen;
107
+ * - `{ equals: '/', name: 'Home' }`: that path exactly;
108
+ * - `{ regex: /^\/orders\/\d+$/, name: 'Order detail' }`: any path the regular expression matches.
109
+ * Paths are matched without their query string.
100
110
  */
101
- track_session?: boolean;
111
+ screen_routes?: ScreenRoute[];
112
+ /**
113
+ * The feedback form's theme: 'light', 'dark', or 'auto' (the default) to follow the visitor's
114
+ * system setting. The colors are CSS variables on the form (`--zasdk-primary-color` and the rest
115
+ * of the `--zasdk-*` set), which a page may override.
116
+ */
117
+ feedback_theme?: 'light' | 'dark' | 'auto';
102
118
  /** How often queued data is sent, in milliseconds. Default 30000, at least 1000. */
103
119
  batch_flush_interval?: number;
104
- /** How often the server's tracking flags are fetched, in milliseconds. Default 120000, at least 10000. */
120
+ /**
121
+ * How long to wait before reading the server's tracking settings again, in milliseconds, when its
122
+ * answer gives no time for the next check (next_check_after). Default 120000, at least 10000.
123
+ */
105
124
  getupdates_interval?: number;
106
125
  /** Most items in one batch. Default 50, between 1 and 500. */
107
126
  batch_size?: number;
108
127
  /** Days an unsent item is kept before it is dropped. Default 7, between 1 and 30. */
109
128
  batch_request_timeout?: number;
110
- /** Idle minutes that end a session. Default 30, between 1 and 1440. */
129
+ /**
130
+ * Minutes a tab can be inactive (hidden, minimised, in the background) before its session ends,
131
+ * at the moment the user left. Default 30, between 1 and 1440.
132
+ */
111
133
  inactiveduration?: number;
112
134
  /**
113
135
  * How long a visit must last before its session is recorded, in milliseconds. Default 5000, at
@@ -116,8 +138,8 @@ export interface AppticsConfig {
116
138
  */
117
139
  min_session_duration?: number;
118
140
  /**
119
- * Record where people click and how far they scroll. Off by default, and it does nothing unless
120
- * the app also imports '@zoho_apptics/apptics-js-sdk/heatmap'.
141
+ * Record where people click and how far they scroll. Off by default;
142
+ * AppticsHeatmap.setHeatmapTracking() switches it later.
121
143
  */
122
144
  track_heatmap?: boolean;
123
145
  /** Most heatmap records one visit may produce. Default 500; capture pauses past it. */
@@ -140,6 +162,26 @@ export interface UserValidationResult {
140
162
  keys: string[];
141
163
  }>;
142
164
  }
165
+ /**
166
+ * Screen recording in the feedback form, as getsdkconfig's `quartz` block sets it up:
167
+ * { quartz_enabled, quartz_workspace, quartz_department, quartz_domain, quartz_cdn_url }
168
+ * The app passes none of it; the console's settings for the app decide.
169
+ */
170
+ export interface QuartzSettings {
171
+ enabled: boolean;
172
+ /** quartz_workspace: the workspace the recording is filed under. */
173
+ workspace: string;
174
+ /** quartz_department: the department within it. */
175
+ department: string;
176
+ /** quartz_domain, e.g. zoho.com: recordings go to https://quartz.<domain>. */
177
+ domain: string;
178
+ /**
179
+ * quartz_cdn_url: the Quartz script, loaded by the SDK when the form needs it. When the answer
180
+ * has none, the SDK uses Zoho's CDN for the serviceUrl (static.localzohocdn.com for localzoho,
181
+ * static.zohocdn.com otherwise).
182
+ */
183
+ cdnUrl: string;
184
+ }
143
185
  export interface QuartzApi {
144
186
  startRecording(details: {
145
187
  workspaceLinkName: string;
@@ -151,8 +193,9 @@ export interface QuartzApi {
151
193
  quartzBranding: boolean;
152
194
  }): void;
153
195
  clearFeedback(): void;
154
- endRecording(): void;
155
- setVideoContent(element: Element | null): void;
196
+ /** Resolves once the recording has ended and is stored; Quartz's own build returns a Promise. */
197
+ endRecording(): Promise<unknown> | void;
198
+ setVideoContent(element: Element | null): Promise<unknown> | void;
156
199
  submitRecording(details: {
157
200
  email: string;
158
201
  subject: string;
@@ -216,97 +259,172 @@ export interface HeatmapRecord {
216
259
  is_rage_click: 0 | 1;
217
260
  is_dead_click: 0 | 1;
218
261
  }
219
- /** What `AppticsTrackError` accepts: a window `error` / `unhandledrejection` event or the same shape. */
262
+ /** What `AppticsError.trackError` accepts: a window `error` / `unhandledrejection` event or the same shape. */
220
263
  export type ErrorLike = Event | {
221
264
  type?: string;
222
265
  error?: unknown;
223
266
  reason?: unknown;
224
267
  };
268
+ /** What sendFeedback() sends. Every key is optional. */
269
+ export interface SendFeedbackOptions {
270
+ /** AppticsFeedback.AP_FEEDBACK_TYPE: BUG (0), FEEDBACK (1, the default), HELP (2), REPORT (3). */
271
+ type?: FeedbackType;
272
+ /** The feedback's text. */
273
+ message?: string;
274
+ /** Files to attach: at most 5, 10 MB in all. */
275
+ attachments?: FileList | File[] | null;
276
+ /** Log files of the app's own to send along. */
277
+ logFiles?: FileList | File[] | null;
278
+ /** The addDiagnosticsInfo() entries: unset sends them when there are any, false never does. */
279
+ includeDiagnostics?: boolean;
280
+ /** The addFeedbackLog() lines: unset sends them when there are any, false never does. */
281
+ includeLog?: boolean;
282
+ /** Sends it from nobody. Unset, it is from the active user AppticsUser.setUser registered. */
283
+ isAnonymous?: boolean;
284
+ }
285
+ /** What feedbackFormOpen() fills the form in with. Every key is optional. */
286
+ export interface FeedbackOpenOptions {
287
+ /** The tab the form opens on: AppticsFeedback.AP_FEEDBACK_TYPE.BUG, FEEDBACK, HELP or REPORT. */
288
+ type?: FeedbackType;
289
+ /** Text already in the description. */
290
+ message?: string;
291
+ /** Starts the logs toggle on. */
292
+ includeLog?: boolean;
293
+ /** Starts the diagnostics toggle on. */
294
+ includeDiagnostics?: boolean;
295
+ /** Files already attached: at most 5, 10 MB in all. */
296
+ attachments?: FileList | File[] | null;
297
+ /** Log files of the app's own already attached. */
298
+ logFiles?: FileList | File[] | null;
299
+ /** Starts the user picker on Anonymous, even with a user registered. */
300
+ isAnonymous?: boolean;
301
+ }
225
302
  /** The optional feedback modal, from '@zoho_apptics/apptics-js-sdk/feedback'. */
226
303
  export interface AppticsFeedbackApi {
227
304
  /**
228
305
  * Sends feedback without the form. Resolves once it is sent; rejects when it wasn't: the SDK
229
306
  * has not started (no init()), the browser is offline, or the server refused it.
230
307
  */
231
- sendFeedback(type?: FeedbackType, message?: string, attachments?: FileList | File[] | null, logFiles?: FileList | File[] | null,
232
- /** dyninfo.txt (diagnostics entries + device info): unset sends it when diagnostics are waiting. */
233
- includeDyninfo?: boolean,
234
- /** Stored addFeedbackLog() lines: unset sends them when there are any, false never does. */
235
- includeLog?: boolean): Promise<void>;
308
+ sendFeedback(options?: SendFeedbackOptions): Promise<void>;
309
+ /** Opens the form, filled in with `options` when they are given. */
310
+ feedbackFormOpen(options?: FeedbackOpenOptions): void;
311
+ feedbackFormClose(): void;
312
+ /** The feedback types: BUG, FEEDBACK, HELP, REPORT. */
313
+ AP_FEEDBACK_TYPE: typeof AP_FEEDBACK_TYPE;
314
+ /** Records a timestamped line, sent as feedbacklog.txt with the next feedback submission. */
315
+ addFeedbackLog(message: string): void;
316
+ /** Records a diagnostics key/value under `heading`, sent inside dyninfo.txt with the next feedback. */
317
+ addDiagnosticsInfo(heading: string, key: string, value: unknown): void;
236
318
  /**
237
- * Opens the form. Every argument is optional: `type` and `message` pre-fill it, the include
238
- * flags start the log and diagnostics toggles on, and `isAnonymous` starts the user picker on
239
- * Anonymous even when a user is registered.
319
+ * The form's theme from now on, restyling one open now: 'light', 'dark', or 'auto' to follow
320
+ * the visitor's system setting. For a page with its own theme switch, called as it changes.
240
321
  */
241
- feedbackOpen(type?: FeedbackType, message?: string, includeLog?: boolean, includeDyninfo?: boolean, attachments?: FileList | File[] | null, logFiles?: FileList | File[] | null, isAnonymous?: boolean): void;
242
- feedbackClose(): void;
322
+ setFeedbackTheme(theme: 'light' | 'dark' | 'auto'): void;
243
323
  }
244
- export interface AppticsApi {
245
- /** Android's Apptics. */
324
+ export interface AppticsSdk {
325
+ /** Android's Apptics: starting the SDK, and what applies to all of it. */
246
326
  Apptics: {
247
- /** Starts the SDK. The config object is required; the console snippet supplies it via auto-init. */
327
+ /** Starts the SDK with the app's config object, which is required. */
248
328
  init(config: AppticsConfig): boolean;
329
+ /** Resolves true once start-up (storage load, device, session) has finished; false if it can't start. */
330
+ ready(): Promise<boolean>;
331
+ /**
332
+ * Sends stored engagements, errors and heatmap records now; resolves once they have gone out.
333
+ * At most once every 15 seconds: a call sooner than that sends nothing and resolves at once,
334
+ * and what is queued goes with the next timed send.
335
+ */
336
+ flush(): Promise<void>;
337
+ /** Clears stored identity, queued data and remote config values, then starts again. */
338
+ reset(): void;
339
+ /**
340
+ * Turns debug mode on, before or after Apptics.init(). Engagement, exception and log then go to
341
+ * their `debug/` twins, whose answers carry a request id and a link into the server's own logs. It
342
+ * switches itself off after an hour with nothing tracked.
343
+ */
344
+ enableDebug(): void;
345
+ /** Turns debug mode off, before or after Apptics.init(); wins over `debug` in init(). */
346
+ disableDebug(): void;
249
347
  };
250
348
  /** Android's AppticsEvents. */
251
- AppticsEvents: {
252
- /** An event. An invalid name or group is not logged; a group left out is `default`. */
253
- addEvent(eventName: string, groupName?: string, properties?: Properties): void;
254
- /** A defined event (DefinedEvents.AP_USER_LOGIN, …), which brings its own group. */
349
+ AppticsEvent: {
350
+ /** Apptics' defined events, as Android's DefinedEvents, to log with addEvent. */
351
+ DefinedEvents: typeof DefinedEvents;
352
+ /** An event. The group is required: an event without one, or with an invalid name or group, is not logged, and the console says why. */
353
+ addEvent(eventName: string, groupName: string, properties?: Properties): void;
354
+ /** A defined event (AppticsEvent.DefinedEvents.AP_USER_LOGIN, …), which brings its own group. */
255
355
  addEvent(definedEvent: DefinedEvent, properties?: Properties): void;
356
+ /**
357
+ * Turns click tracking from markup (`apeventaction`) on or off after Apptics.init(); `enabled`
358
+ * defaults to true. The `track_click` config flag sets it at start-up.
359
+ */
360
+ setClickTracking(enabled?: boolean): void;
256
361
  };
257
- /** Apptics' defined events, as Android's DefinedEvents. */
258
- DefinedEvents: Readonly<Record<string, DefinedEvent>>;
259
362
  /** Android's AppticsScreenTracker. */
260
- AppticsScreenTracker: {
363
+ AppticsScreen: {
261
364
  /** Records a screen view and returns its id, for outScreen; '' for an invalid name. */
262
365
  inScreen(screenName: string, properties?: Properties): string;
263
366
  /** Ends the screen view inScreen began, before the next screen would. */
264
367
  outScreen(id: string): void;
368
+ /**
369
+ * Turns automatic screen tracking on or off after Apptics.init(); `enabled` defaults to true.
370
+ * The `track_screen` config flag sets it at start-up. inScreen() records either way.
371
+ */
372
+ setScreenTracking(enabled?: boolean): void;
265
373
  };
266
374
  /** Android's AppticsApiTracker. */
267
- AppticsApiTracker: {
375
+ AppticsApi: {
376
+ /** Builds the rules configure takes: `new AppticsApi.ApiTrackingBuilder()…build()`. */
377
+ ApiTrackingBuilder: typeof ApiTrackingBuilder;
268
378
  /** Begins timing one call; returns the id endTrackApi takes. */
269
379
  startTrackApi(url: string, method?: string): string;
270
380
  /** Finishes the call startTrackApi began, and records it. */
271
381
  endTrackApi(id: string, responseCode: number, responseMessage?: string): void;
272
382
  /** The rules API tracking records by, from ApiTrackingBuilder. Works before Apptics.init(). */
273
383
  configure(config: ApiTrackingConfig | ApiTrackingBuilder): void;
384
+ /**
385
+ * Turns automatic API tracking on or off after Apptics.init(); `enabled` defaults to true.
386
+ * The `track_api` config flag sets it at start-up.
387
+ */
388
+ setApiTracking(enabled?: boolean): void;
389
+ /** @deprecated renamed setApiTracking; this name still works, with a console warning */
390
+ enableApiTracking(enabled?: boolean): void;
274
391
  };
275
- ApiTrackingBuilder: typeof ApiTrackingBuilder;
276
- /** Android's AppticsLogger: off until enable(), then v / d / i / w / e(tag, message). */
277
- AppticsLogger: AppticsLogger;
278
- /** Resolves true once start-up (storage load, device, session) has finished; false if it can't start. */
279
- ready(): Promise<boolean>;
280
- /**
281
- * Turns debug mode on, before or after Apptics.init(). Engagement, exception and log then go to
282
- * their `debug/` twins, whose answers carry a request id and a link into the server's own logs. It
283
- * switches itself off after an hour with nothing tracked.
284
- */
285
- enableDebug(): void;
286
- /** Turns debug mode off, before or after Apptics.init(); wins over `debug` in init(). */
287
- disableDebug(): void;
288
- /**
289
- * Turns automatic API tracking on or off after Apptics.init(). Equivalent to the `track_api`
290
- * config flag, which is the usual way to set it.
291
- */
292
- enableApiTracking(enabled?: boolean): void;
293
- /** Reports an error the app caught, or an `error` / `unhandledrejection` event. */
294
- AppticsTrackError(error: ErrorLike, properties?: Properties): void;
295
- enableGlobalErrorHandler(enabled?: boolean): void;
296
- /** Properties may be a plain object, or the result of UserBuilder.build(). */
297
- AppticsSetUser(userid: string, groupid?: string, properties?: Properties | UserValidationResult): void;
298
- getUser(): UserInfo;
299
- users: {
392
+ /** Errors the app caught, and the switch for tracking uncaught ones. */
393
+ AppticsError: {
394
+ /** Reports an error the app caught, or an `error` / `unhandledrejection` event. */
395
+ trackError(error: ErrorLike, properties?: Properties): void;
396
+ /**
397
+ * Turns the automatic tracking of uncaught errors and unhandled rejections on or off after
398
+ * Apptics.init(); `enabled` defaults to true. The `track_error` config flag sets it at start-up.
399
+ */
400
+ setErrorTracking(enabled?: boolean): void;
401
+ /** @deprecated renamed setErrorTracking; this name still works, with a console warning */
402
+ trackGlobalErrorHandler(enabled?: boolean): void;
403
+ };
404
+ /** Android's AppticsUser. */
405
+ AppticsUser: {
406
+ /** Registers the signed-in user. Properties may be a plain object, or the result of UserBuilder.build(). */
407
+ setUser(userid: string, groupid?: string, properties?: Properties | UserValidationResult): void;
408
+ /** The registered user, or {} when there is none. */
409
+ getUser(): UserInfo;
410
+ /** Builds the user's properties for setUser. */
300
411
  UserBuilder: typeof UserBuilder;
301
412
  };
302
- setTrackingStatus(status: TrackingStatus): void;
303
- getTrackingStatus(): TrackingStatus;
304
- flush(): void;
305
- /** Records a timestamped line, sent as feedbacklog.txt with the next feedback submission. */
306
- addFeedbackLog(message: string): void;
307
- /** Records a diagnostics key/value under `heading`, sent inside dyninfo.txt with the next feedback. */
308
- addDiagnosticsInfo(heading: string, key: string, value?: unknown): void;
309
- reset(): void;
310
- AP_TRACKING_STATUS: typeof AP_TRACKING_STATUS;
311
- AP_FEEDBACK_TYPE: typeof AP_FEEDBACK_TYPE;
413
+ /** Click and scroll capture for the console's heatmaps. */
414
+ AppticsHeatmap: {
415
+ /**
416
+ * Starts or stops recording clicks and scrolls; `enabled` defaults to true. The
417
+ * `track_heatmap` config flag sets it at start-up.
418
+ */
419
+ setHeatmapTracking(enabled?: boolean): void;
420
+ /** @deprecated renamed setHeatmapTracking; this name still works, with a console warning */
421
+ trackHeatmap(on?: boolean): void;
422
+ };
423
+ /** Android's AppticsSettings: what the SDK may track for this visitor. */
424
+ AppticsSettings: {
425
+ /** The states setTrackingStatus takes. */
426
+ AP_TRACKING_STATUS: typeof AP_TRACKING_STATUS;
427
+ setTrackingStatus(status: TrackingStatus): void;
428
+ getTrackingStatus(): TrackingStatus;
429
+ };
312
430
  }