@zoho_apptics/apptics-js-sdk 2.0.0-beta.1 → 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 (253) hide show
  1. package/CHANGELOG.md +127 -16
  2. package/README.md +357 -215
  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 -4
  19. package/dist/cjs/core/consent.d.ts +17 -4
  20. package/dist/cjs/core/consent.js +81 -14
  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 +66 -17
  24. package/dist/cjs/core/constants.js +76 -19
  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.d.ts +0 -3
  29. package/dist/cjs/core/env.js +1 -9
  30. package/dist/cjs/core/framework-id.d.ts +1 -1
  31. package/dist/cjs/core/framework-id.js +3 -3
  32. package/dist/cjs/core/guard.js +19 -4
  33. package/dist/cjs/core/hooks.d.ts +29 -0
  34. package/dist/cjs/core/hooks.js +12 -1
  35. package/dist/cjs/core/locks.js +1 -1
  36. package/dist/cjs/core/logger.js +1 -1
  37. package/dist/cjs/core/shield.d.ts +31 -0
  38. package/dist/cjs/core/shield.js +129 -0
  39. package/dist/cjs/core/state.d.ts +11 -5
  40. package/dist/cjs/core/state.js +4 -4
  41. package/dist/cjs/core/storage.d.ts +7 -0
  42. package/dist/cjs/core/storage.js +28 -9
  43. package/dist/cjs/core/stylesheet.js +1 -1
  44. package/dist/cjs/core/transport.d.ts +15 -4
  45. package/dist/cjs/core/transport.js +72 -25
  46. package/dist/cjs/core/utils.js +1 -1
  47. package/dist/cjs/core/validate.js +6 -5
  48. package/dist/cjs/device/appversion.d.ts +10 -1
  49. package/dist/cjs/device/appversion.js +26 -3
  50. package/dist/cjs/device/index.d.ts +17 -2
  51. package/dist/cjs/device/index.js +251 -35
  52. package/dist/cjs/engagement/api-rules.js +1 -1
  53. package/dist/cjs/engagement/auto-api.js +4 -3
  54. package/dist/cjs/engagement/auto-screen.js +10 -6
  55. package/dist/cjs/engagement/defined-events.d.ts +2 -3
  56. package/dist/cjs/engagement/defined-events.js +10 -16
  57. package/dist/cjs/engagement/send.js +7 -3
  58. package/dist/cjs/engagement/session.d.ts +17 -0
  59. package/dist/cjs/engagement/session.js +154 -23
  60. package/dist/cjs/engagement/track.d.ts +4 -4
  61. package/dist/cjs/engagement/track.js +23 -17
  62. package/dist/cjs/errors/send.js +2 -2
  63. package/dist/cjs/errors/track.d.ts +2 -1
  64. package/dist/cjs/errors/track.js +8 -5
  65. package/dist/cjs/feedback/controls.d.ts +36 -4
  66. package/dist/cjs/feedback/controls.js +302 -67
  67. package/dist/cjs/feedback/i18n/index.d.ts +31 -0
  68. package/dist/cjs/feedback/i18n/index.js +187 -0
  69. package/dist/cjs/feedback/i18n/strings.d.ts +9 -0
  70. package/dist/cjs/feedback/i18n/strings.js +8 -0
  71. package/dist/cjs/feedback/index.js +1 -1
  72. package/dist/cjs/feedback/logs.d.ts +3 -6
  73. package/dist/cjs/feedback/logs.js +12 -21
  74. package/dist/cjs/feedback/quartz.js +5 -2
  75. package/dist/cjs/feedback/send.d.ts +6 -3
  76. package/dist/cjs/feedback/send.js +59 -41
  77. package/dist/cjs/feedback/styles.js +2 -2
  78. package/dist/cjs/feedback/template.d.ts +4 -2
  79. package/dist/cjs/feedback/template.js +73 -44
  80. package/dist/cjs/feedback/ui.d.ts +47 -4
  81. package/dist/cjs/feedback/ui.js +351 -97
  82. package/dist/cjs/heatmap/send.d.ts +2 -0
  83. package/dist/cjs/heatmap/send.js +3 -5
  84. package/dist/cjs/heatmap/track.js +13 -9
  85. package/dist/cjs/index.d.ts +1 -2
  86. package/dist/cjs/index.js +55 -18
  87. package/dist/cjs/lifecycle.d.ts +13 -2
  88. package/dist/cjs/lifecycle.js +233 -118
  89. package/dist/cjs/pushnotification/display.d.ts +65 -0
  90. package/dist/cjs/pushnotification/display.js +112 -0
  91. package/dist/cjs/pushnotification/index.d.ts +20 -0
  92. package/dist/cjs/pushnotification/index.js +96 -0
  93. package/dist/cjs/pushnotification/kept-opens.d.ts +23 -0
  94. package/dist/cjs/pushnotification/kept-opens.js +64 -0
  95. package/dist/cjs/pushnotification/notify.d.ts +45 -0
  96. package/dist/cjs/pushnotification/notify.js +476 -0
  97. package/dist/cjs/pushnotification/payload.d.ts +65 -0
  98. package/dist/cjs/pushnotification/payload.js +279 -0
  99. package/dist/cjs/pushnotification/session.d.ts +46 -0
  100. package/dist/cjs/pushnotification/session.js +413 -0
  101. package/dist/cjs/pushnotification/stats.d.ts +45 -0
  102. package/dist/cjs/pushnotification/stats.js +244 -0
  103. package/dist/cjs/pushnotification/wms.d.ts +30 -0
  104. package/dist/cjs/pushnotification/wms.js +374 -0
  105. package/dist/cjs/remoteconfig/country.js +1 -1
  106. package/dist/cjs/remoteconfig/custom.js +4 -3
  107. package/dist/cjs/remoteconfig/evaluate.js +1 -1
  108. package/dist/cjs/remoteconfig/fetch.d.ts +17 -10
  109. package/dist/cjs/remoteconfig/fetch.js +146 -32
  110. package/dist/cjs/remoteconfig/index.d.ts +9 -5
  111. package/dist/cjs/remoteconfig/index.js +24 -32
  112. package/dist/cjs/remoteconfig/store.d.ts +15 -7
  113. package/dist/cjs/remoteconfig/store.js +68 -35
  114. package/dist/cjs/remoteconfig/tz-countries.js +1 -1
  115. package/dist/cjs/{core → remotelog}/callsite.d.ts +5 -4
  116. package/dist/cjs/{core → remotelog}/callsite.js +6 -5
  117. package/dist/cjs/remotelog/gate.js +1 -1
  118. package/dist/cjs/remotelog/logger.js +2 -2
  119. package/dist/cjs/remotelog/send.js +6 -5
  120. package/dist/cjs/remotelogger/index.js +1 -1
  121. package/dist/cjs/scheduler.d.ts +3 -1
  122. package/dist/cjs/scheduler.js +34 -25
  123. package/dist/cjs/sw/apptics-pn-sw.d.ts +83 -0
  124. package/dist/cjs/sw/timers.d.ts +44 -0
  125. package/dist/cjs/types.d.ts +90 -29
  126. package/dist/cjs/user/index.d.ts +7 -0
  127. package/dist/cjs/user/index.js +25 -3
  128. package/dist/esm/core/attempts.js +1 -1
  129. package/dist/esm/core/batch.js +4 -4
  130. package/dist/esm/core/consent.d.ts +17 -4
  131. package/dist/esm/core/consent.js +84 -20
  132. package/dist/esm/core/console-call.d.ts +23 -0
  133. package/dist/esm/core/console-call.js +60 -0
  134. package/dist/esm/core/constants.d.ts +66 -17
  135. package/dist/esm/core/constants.js +73 -20
  136. package/dist/esm/core/db.js +31 -7
  137. package/dist/esm/core/debug.d.ts +6 -4
  138. package/dist/esm/core/debug.js +37 -13
  139. package/dist/esm/core/env.d.ts +0 -3
  140. package/dist/esm/core/env.js +2 -9
  141. package/dist/esm/core/framework-id.d.ts +1 -1
  142. package/dist/esm/core/framework-id.js +3 -3
  143. package/dist/esm/core/guard.js +19 -4
  144. package/dist/esm/core/hooks.d.ts +29 -0
  145. package/dist/esm/core/hooks.js +12 -1
  146. package/dist/esm/core/locks.js +1 -1
  147. package/dist/esm/core/logger.js +1 -1
  148. package/dist/esm/core/shield.d.ts +31 -0
  149. package/dist/esm/core/shield.js +119 -0
  150. package/dist/esm/core/state.d.ts +11 -5
  151. package/dist/esm/core/state.js +4 -4
  152. package/dist/esm/core/storage.d.ts +7 -0
  153. package/dist/esm/core/storage.js +28 -11
  154. package/dist/esm/core/stylesheet.js +1 -1
  155. package/dist/esm/core/transport.d.ts +15 -4
  156. package/dist/esm/core/transport.js +73 -28
  157. package/dist/esm/core/utils.js +1 -1
  158. package/dist/esm/core/validate.js +6 -5
  159. package/dist/esm/device/appversion.d.ts +10 -1
  160. package/dist/esm/device/appversion.js +26 -4
  161. package/dist/esm/device/index.d.ts +17 -2
  162. package/dist/esm/device/index.js +255 -42
  163. package/dist/esm/engagement/api-rules.js +1 -1
  164. package/dist/esm/engagement/auto-api.js +4 -3
  165. package/dist/esm/engagement/auto-screen.js +10 -6
  166. package/dist/esm/engagement/defined-events.d.ts +2 -3
  167. package/dist/esm/engagement/defined-events.js +10 -16
  168. package/dist/esm/engagement/send.js +7 -3
  169. package/dist/esm/engagement/session.d.ts +17 -0
  170. package/dist/esm/engagement/session.js +152 -24
  171. package/dist/esm/engagement/track.d.ts +4 -4
  172. package/dist/esm/engagement/track.js +24 -18
  173. package/dist/esm/errors/send.js +2 -2
  174. package/dist/esm/errors/track.d.ts +2 -1
  175. package/dist/esm/errors/track.js +8 -5
  176. package/dist/esm/feedback/controls.d.ts +36 -4
  177. package/dist/esm/feedback/controls.js +298 -68
  178. package/dist/esm/feedback/i18n/index.d.ts +31 -0
  179. package/dist/esm/feedback/i18n/index.js +178 -0
  180. package/dist/esm/feedback/i18n/strings.d.ts +9 -0
  181. package/dist/esm/feedback/i18n/strings.js +4 -0
  182. package/dist/esm/feedback/index.js +1 -1
  183. package/dist/esm/feedback/logs.d.ts +3 -6
  184. package/dist/esm/feedback/logs.js +12 -21
  185. package/dist/esm/feedback/quartz.js +5 -2
  186. package/dist/esm/feedback/send.d.ts +6 -3
  187. package/dist/esm/feedback/send.js +61 -44
  188. package/dist/esm/feedback/styles.js +2 -2
  189. package/dist/esm/feedback/template.d.ts +4 -2
  190. package/dist/esm/feedback/template.js +73 -44
  191. package/dist/esm/feedback/ui.d.ts +47 -4
  192. package/dist/esm/feedback/ui.js +353 -99
  193. package/dist/esm/heatmap/send.d.ts +2 -0
  194. package/dist/esm/heatmap/send.js +3 -5
  195. package/dist/esm/heatmap/track.js +13 -9
  196. package/dist/esm/index.d.ts +1 -2
  197. package/dist/esm/index.js +58 -21
  198. package/dist/esm/lifecycle.d.ts +13 -2
  199. package/dist/esm/lifecycle.js +238 -125
  200. package/dist/esm/pushnotification/display.d.ts +65 -0
  201. package/dist/esm/pushnotification/display.js +95 -0
  202. package/dist/esm/pushnotification/index.d.ts +20 -0
  203. package/dist/esm/pushnotification/index.js +91 -0
  204. package/dist/esm/pushnotification/kept-opens.d.ts +23 -0
  205. package/dist/esm/pushnotification/kept-opens.js +62 -0
  206. package/dist/esm/pushnotification/notify.d.ts +45 -0
  207. package/dist/esm/pushnotification/notify.js +469 -0
  208. package/dist/esm/pushnotification/payload.d.ts +65 -0
  209. package/dist/esm/pushnotification/payload.js +272 -0
  210. package/dist/esm/pushnotification/session.d.ts +46 -0
  211. package/dist/esm/pushnotification/session.js +402 -0
  212. package/dist/esm/pushnotification/stats.d.ts +45 -0
  213. package/dist/esm/pushnotification/stats.js +238 -0
  214. package/dist/esm/pushnotification/wms.d.ts +30 -0
  215. package/dist/esm/pushnotification/wms.js +368 -0
  216. package/dist/esm/remoteconfig/country.js +1 -1
  217. package/dist/esm/remoteconfig/custom.js +4 -3
  218. package/dist/esm/remoteconfig/evaluate.js +1 -1
  219. package/dist/esm/remoteconfig/fetch.d.ts +17 -10
  220. package/dist/esm/remoteconfig/fetch.js +147 -33
  221. package/dist/esm/remoteconfig/index.d.ts +9 -5
  222. package/dist/esm/remoteconfig/index.js +24 -32
  223. package/dist/esm/remoteconfig/store.d.ts +15 -7
  224. package/dist/esm/remoteconfig/store.js +68 -36
  225. package/dist/esm/remoteconfig/tz-countries.js +1 -1
  226. package/dist/esm/{core → remotelog}/callsite.d.ts +5 -4
  227. package/dist/esm/{core → remotelog}/callsite.js +6 -5
  228. package/dist/esm/remotelog/gate.js +1 -1
  229. package/dist/esm/remotelog/logger.js +2 -2
  230. package/dist/esm/remotelog/send.js +6 -5
  231. package/dist/esm/remotelogger/index.js +1 -1
  232. package/dist/esm/scheduler.d.ts +3 -1
  233. package/dist/esm/scheduler.js +35 -27
  234. package/dist/esm/sw/apptics-pn-sw.d.ts +83 -0
  235. package/dist/esm/sw/timers.d.ts +44 -0
  236. package/dist/esm/types.d.ts +90 -29
  237. package/dist/esm/user/index.d.ts +7 -0
  238. package/dist/esm/user/index.js +26 -5
  239. package/dist/feedback.esm.min.js +2 -2
  240. package/dist/feedback.esm.min.js.map +1 -1
  241. package/dist/pushnotification.esm.min.js +3 -0
  242. package/dist/pushnotification.esm.min.js.map +1 -0
  243. package/dist/remoteconfig.esm.min.js +3 -0
  244. package/dist/remoteconfig.esm.min.js.map +1 -0
  245. package/dist/remotelogger.esm.min.js +3 -0
  246. package/dist/remotelogger.esm.min.js.map +1 -0
  247. package/package.json +17 -3
  248. package/dist/chunks/lifecycle-VYr43KcB.min.js +0 -3
  249. package/dist/chunks/lifecycle-VYr43KcB.min.js.map +0 -1
  250. package/dist/cjs/auto-init.d.ts +0 -8
  251. package/dist/cjs/auto-init.js +0 -32
  252. package/dist/esm/auto-init.d.ts +0 -8
  253. package/dist/esm/auto-init.js +0 -29
@@ -1,11 +1,40 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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
+ /**
5
+ * The visitor's tracking status: what setTrackingStatus takes and getTrackingStatus returns. Each
6
+ * value is its own name, so an app never deals in the numbers it is stored as (TRACKING_STATUS_CODE).
7
+ */
4
8
  const AP_TRACKING_STATUS = Object.freeze({
9
+ USAGE_TRACKING_WITH_PII: 'USAGE_TRACKING_WITH_PII', // no i18n
10
+ USAGE_TRACKING_WITHOUT_PII: 'USAGE_TRACKING_WITHOUT_PII', // no i18n
11
+ ANONYMOUS: 'ANONYMOUS', // no i18n
12
+ NO_TRACKING: 'NO_TRACKING', // no i18n
13
+ });
14
+ /**
15
+ * The number each tracking status is stored as, in trackinfo's tracking_status, and the number an
16
+ * app passed to setTrackingStatus before the status had names. These are the SDK's own values, not
17
+ * the server's device preference: deviceStatusFor() turns one into the devicestatus device/add
18
+ * sends. ANONYMOUS is 7, past the server's 1–6, because 4 is already stored by browsers that chose
19
+ * without PII and must keep meaning that.
20
+ */
21
+ const TRACKING_STATUS_CODE = Object.freeze({
5
22
  USAGE_TRACKING_WITH_PII: 1,
6
23
  USAGE_TRACKING_WITHOUT_PII: 4,
24
+ ANONYMOUS: 7,
7
25
  NO_TRACKING: -1,
8
26
  });
27
+ /**
28
+ * The server's device preferences, devicestatus on device/add. With and without PII are both
29
+ * "all tracking with PII" (1): without PII only means no user is attached to the data. ANONYMOUS
30
+ * is "all tracking, anonymous" (4). The usage-only and crash-only preferences (2, 3, 5, 6) have no
31
+ * SDK status yet.
32
+ */
33
+ const AP_DEVICE_STATUS = Object.freeze({
34
+ ALL_WITH_PII: 1,
35
+ ALL_ANONYMOUS: 4,
36
+ TRACKING_OFF: -1,
37
+ });
9
38
  const AP_FEEDBACK_TYPE = Object.freeze({
10
39
  BUG: 0,
11
40
  FEEDBACK: 1,
@@ -40,6 +69,10 @@ const DEFAULT_API_PATHS = Object.freeze({
40
69
  // v2 replaced console/addlog: one call now carries a batch of lines, not one line
41
70
  consolelog: 'log/add', // no i18n
42
71
  heatmap: 'heatmap/add', // no i18n
72
+ // registers this browser for push messages over WMS (status=register|unregister)
73
+ pushnotification: 'pushnotification/device', // no i18n
74
+ // push notification stats: received, opened, conversion
75
+ pnstats: 'channel/add', // no i18n
43
76
  });
44
77
  /**
45
78
  * Which API version each path lives under.
@@ -61,6 +94,8 @@ const API_VERSIONS = Object.freeze({
61
94
  getupdates: 'v2', // no i18n
62
95
  consolelog: 'v2', // no i18n
63
96
  heatmap: 'v2', // no i18n
97
+ pushnotification: 'v2', // no i18n
98
+ pnstats: 'v2', // no i18n
64
99
  });
65
100
  /**
66
101
  * The SDK subsystem a remote log line is about, as console/addlog's `module` param.
@@ -85,9 +120,18 @@ const SDK_MODULE = Object.freeze({
85
120
  * authority. Where they disagree, getsdkconfig wins.
86
121
  */
87
122
  REMOTE_CONFIG: '2', // no i18n
123
+ EVENT: '5', // no i18n
124
+ API: '6', // no i18n
125
+ SCREEN: '10', // no i18n
88
126
  SESSION: '11', // no i18n
89
127
  FEEDBACK: '12', // no i18n
90
- CRASH: '13', // no i18n
128
+ /**
129
+ * Push notification over WMS. getsdkconfig answers with the `wms` block only when it is asked
130
+ * for this id in `moduleids` and push is on for the app.
131
+ */
132
+ PUSH_NOTIFICATION: '16', // no i18n
133
+ /** Uncaught and reported JavaScript errors: js_error. 13 (crash) and 14 (nonfatal) are the native SDKs'. */
134
+ JS_ERROR: '15', // no i18n
91
135
  REMOTE_LOGGER: '17', // no i18n
92
136
  HEATMAP: '18', // no i18n
93
137
  });
@@ -103,9 +147,10 @@ const LOG_FILENAME_MAX = 100;
103
147
  */
104
148
  const DEVICE_NAME_MAX = 100;
105
149
  /**
106
- * The `level` every line goes out with. Everything the remote logger carries is a failure inside
107
- * the SDK — logFailure is its only caller — so the level never varies. 3 is what the v2 reference
108
- * shows in its only example; the scale itself is not documented anywhere we can see.
150
+ * The `level` a remote log line goes out with when it has none of its own: 3, Info. Every line an
151
+ * app writes with AppticsLogger carries its level (1 verbose to 5 error, see LOG_LEVEL in
152
+ * remotelog/logger.ts). Only a line an older SDK stored, when the SDK logged its own failures
153
+ * there, has none; it is sent as Info rather than having the batch refused for a missing level.
109
154
  */
110
155
  const REMOTE_LOG_LEVEL = 3;
111
156
  /**
@@ -115,30 +160,25 @@ const REMOTE_LOG_LEVEL = 3;
115
160
  * enough that a tab left open overnight is not still sending every call to its debug twin.
116
161
  */
117
162
  const DEBUG_IDLE_MS = 60 * 60 * 1000;
118
- /** Idle minutes that end a session. Lives on state, not in _config, but defaults here. */
163
+ /** Minutes a tab can be inactive before its session ends. Lives on state, not in _config, but defaults here. */
119
164
  const DEFAULT_INACTIVE_MINUTES = 30;
165
+ /**
166
+ * The range both session timings may be set in: min_session_duration (how long a visit must last
167
+ * before its session is recorded) and max_session_duration (how long a tab may be inactive before its
168
+ * session ends). 5 seconds to 30 minutes; a value outside it is ignored and the default kept.
169
+ */
170
+ const SESSION_TIMING_MIN_MS = 5 * 1000;
171
+ const SESSION_TIMING_MAX_MS = 30 * 60 * 1000;
120
172
  /** Global defaults. `state._config` holds a mutable copy per init. */
121
173
  const AP_CONFIG = Object.freeze({
122
174
  // the version is per path (API_VERSIONS); this is only the part before it
123
175
  endpoint: '/sdk/web/', // no i18n
124
176
  method: 'POST', // no i18n
125
- transport: 'XHR', // no i18n
126
- track_link_timeout: 300,
127
- cookie_expiration_days: 365,
128
- storage_type: 'localStorage', // no i18n
129
- enable_batch_requests: true,
130
177
  batch_size: 50,
131
178
  batch_flush_interval: 30000,
132
- getupdates_interval: 120000, // 2 minutes in milliseconds
179
+ getupdates_interval: 120000, // 2 minutes in milliseconds, when getsdkconfig gives no next_check_after
133
180
  batch_request_timeout: 7,
134
- auto_starts_batch: true,
135
- mode: 1,
136
- default_group_name: 'default', // no i18n
137
- default_optin_status: AP_TRACKING_STATUS.USAGE_TRACKING_WITHOUT_PII,
138
- enable_pageview_tracking: false,
139
- save_referrer: true,
140
181
  debug: false,
141
- track_by_default: true,
142
182
  ignore_do_not_track: false,
143
183
  /**
144
184
  * Wrap XHR and fetch to record the app's API calls without it calling startTrackApi(). Off by
@@ -151,6 +191,16 @@ const AP_CONFIG = Object.freeze({
151
191
  * default; the app's own inScreen() during a navigation replaces that navigation's view.
152
192
  */
153
193
  track_screen: true,
194
+ /**
195
+ * Record uncaught errors and unhandled promise rejections, from the window's `error` and
196
+ * `unhandledrejection` events. On by default; AppticsError.setErrorTracking() switches it later.
197
+ */
198
+ track_error: true,
199
+ /**
200
+ * Record clicks on elements tagged `apeventaction` (or `data-apeventaction`) as events. On by
201
+ * default; AppticsEvent.setClickTracking() switches it later.
202
+ */
203
+ track_click: true,
154
204
  /**
155
205
  * How automatic screen tracking names a path, as init() keeps the config's screen_routes: route
156
206
  * patterns (`/users/{id}/orders`, each id recorded as a star), exact paths and regular
@@ -189,6 +239,7 @@ const AP_CONFIG = Object.freeze({
189
239
  * debug stream is no use to whoever is reading it.
190
240
  */
191
241
  device_name: '',
242
+ /** Path of the site's service worker for push notifications (it imports apptics-pn-sw.js); '' for none. */
192
243
  /**
193
244
  * Most heatmap records one visit may produce. Clicks are cheap, but a page that scrolls a lot
194
245
  * can produce them faster than they are sent, and an unbounded queue is a memory leak on a tab
@@ -244,6 +295,8 @@ const RETRY_CAPABLE_PATHS = Object.freeze({
244
295
  consolelog: true, // no i18n
245
296
  feedback: true, // no i18n
246
297
  getupdates: true, // no i18n
298
+ pushnotification: true, // no i18n
299
+ pnstats: true, // no i18n
247
300
  });
248
301
  /**
249
302
  * Paths that live directly under the version, with no org and project segments. app/addversion is
@@ -294,6 +347,7 @@ const BLOCKED_WS = Object.freeze([
294
347
  exports.API_VERSIONS = API_VERSIONS;
295
348
  exports.AP_CONFIG = AP_CONFIG;
296
349
  exports.AP_CONSTANTS = AP_CONSTANTS;
350
+ exports.AP_DEVICE_STATUS = AP_DEVICE_STATUS;
297
351
  exports.AP_FEEDBACK_TYPE = AP_FEEDBACK_TYPE;
298
352
  exports.AP_LOG_MODULE = AP_LOG_MODULE;
299
353
  exports.AP_TRACKING_STATUS = AP_TRACKING_STATUS;
@@ -313,3 +367,6 @@ exports.REQUIRED_CONFIG = REQUIRED_CONFIG;
313
367
  exports.RETIRED_CONFIG_NAMES = RETIRED_CONFIG_NAMES;
314
368
  exports.RETRY_CAPABLE_PATHS = RETRY_CAPABLE_PATHS;
315
369
  exports.SDK_MODULE = SDK_MODULE;
370
+ exports.SESSION_TIMING_MAX_MS = SESSION_TIMING_MAX_MS;
371
+ exports.SESSION_TIMING_MIN_MS = SESSION_TIMING_MIN_MS;
372
+ exports.TRACKING_STATUS_CODE = TRACKING_STATUS_CODE;
@@ -1,8 +1,9 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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 logger = require('./logger.js');
5
5
  var utils = require('./utils.js');
6
+ var shield = require('./shield.js');
6
7
 
7
8
  const DB_NAME = 'apptics'; // no i18n
8
9
  // 3 added the heatmaps store. 4 renamed: each record's order key `seq` to `queue`, the logs store
@@ -189,12 +190,33 @@ function recordType(storeName, item) {
189
190
  function putRecord(store, item, keepExisting) {
190
191
  const id = String(item.id);
191
192
  const lookup = store.get(id);
192
- lookup.onsuccess = function () {
193
+ lookup.onsuccess = inTransaction(store.transaction, function () {
193
194
  const existing = lookup.result;
194
195
  if (existing && keepExisting) {
195
196
  return;
196
197
  }
197
198
  store.put({ id: id, queue: existing ? existing.queue : nextQueue(), type: recordType(store.name, item), item: item });
199
+ });
200
+ }
201
+ /**
202
+ * An IndexedDB callback that never throws into the page (core/shield.ts). A throw in one aborts its
203
+ * transaction, which is how its caller hears that the write failed; that is kept, by aborting it here.
204
+ */
205
+ function inTransaction(tx, fn) {
206
+ return function () {
207
+ try {
208
+ fn();
209
+ }
210
+ catch (err) {
211
+ shield.sdkFailed('storage', err); // no i18n
212
+ try {
213
+ if (tx)
214
+ tx.abort();
215
+ }
216
+ catch (e) {
217
+ // already finished: nothing left to undo
218
+ }
219
+ }
198
220
  };
199
221
  }
200
222
  /** Our stores, as created by onupgradeneeded. */
@@ -255,7 +277,9 @@ function openOnce(factory, timeoutMs) {
255
277
  return;
256
278
  }
257
279
  req.onupgradeneeded = function () {
258
- upgrade(req.result, req.transaction);
280
+ inTransaction(req.transaction, function () {
281
+ upgrade(req.result, req.transaction);
282
+ })();
259
283
  };
260
284
  req.onsuccess = function () {
261
285
  if (settled) {
@@ -333,7 +357,7 @@ function upgrade(db, tx) {
333
357
  /** Calls `each` for every record of `store`, then `done`, inside the transaction `store` is in. */
334
358
  function eachRecord(store, each, done) {
335
359
  const req = store.openCursor();
336
- req.onsuccess = function () {
360
+ req.onsuccess = inTransaction(store.transaction, function () {
337
361
  const cursor = req.result;
338
362
  if (!cursor) {
339
363
  if (done)
@@ -342,7 +366,7 @@ function eachRecord(store, each, done) {
342
366
  }
343
367
  each(cursor.value, cursor);
344
368
  cursor.continue();
345
- };
369
+ });
346
370
  }
347
371
  /** A version 3 record under version 4's names: `queue` for `seq`, and the feedback types renamed. */
348
372
  function renamedRecord(record, feedback, storeName) {
@@ -408,11 +432,11 @@ function createIndexedDBBackend(db) {
408
432
  const settingsStore = tx.objectStore('settings'); // no i18n
409
433
  Object.keys(settings).forEach(function (key) {
410
434
  const lookup = settingsStore.get(key);
411
- lookup.onsuccess = function () {
435
+ lookup.onsuccess = inTransaction(tx, function () {
412
436
  if (lookup.result === undefined) {
413
437
  settingsStore.put(settings[key], key);
414
438
  }
415
- };
439
+ });
416
440
  });
417
441
  QUEUES.forEach(function (name) {
418
442
  const objectStore = tx.objectStore(name);
@@ -13,10 +13,12 @@ export declare function noteDebugActivity(): void;
13
13
  export declare function expireDebugIfIdle(): void;
14
14
  /**
15
15
  * Turns debug mode on, at any time: before init(), during start-up or while the SDK runs. The
16
- * choice holds over `debug` in init() for the rest of the page's life.
16
+ * choice holds through init() and reset() for the rest of the page's life. Only from the console.
17
17
  */
18
18
  export declare function enableDebug(): void;
19
- /** Turns debug mode off, at any time, with the same hold over `debug` as enableDebug(). */
19
+ /**
20
+ * Turns debug mode off, at any time, holding as enableDebug() does. Only from the console.
21
+ */
20
22
  export declare function disableDebug(): void;
21
- /** What init() applies for `debug`: the config's value, unless the app has already chosen. */
22
- export declare function applyDebugConfig(configured: boolean): void;
23
+ /** What init() applies: off, unless enableDebug() or disableDebug() already chose. */
24
+ export declare function applyDebugConfig(): void;
@@ -1,9 +1,10 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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('./constants.js');
5
5
  var state = require('./state.js');
6
6
  var logger = require('./logger.js');
7
+ var consoleCall = require('./console-call.js');
7
8
  var utils = require('./utils.js');
8
9
 
9
10
  /**
@@ -16,8 +17,8 @@ var utils = require('./utils.js');
16
17
  * not a deliberate switch-off. So the SDK closes it: an hour with nothing tracked turns debug
17
18
  * back off by itself, and anything tracked pushes that hour out again.
18
19
  *
19
- * It lives in core because every send asks it: `debug: true` in init(), or enableDebug(), is
20
- * enough to turn the twins on, and that alone must expire.
20
+ * It lives in core because every send asks it: enableDebug(), typed in the browser console, is
21
+ * the only way to turn the twins on, and that alone must expire.
21
22
  */
22
23
  /** Whether debug mode is on right now, idle hour included. */
23
24
  function debugEnabled() {
@@ -50,10 +51,9 @@ function expireDebugIfIdle() {
50
51
  setDebug(false);
51
52
  }
52
53
  /**
53
- * The app's own choice, from enableDebug() or disableDebug(). It wins over `debug` in init(),
54
- * so debug mode can be switched on or off with one call, before init() runs or while the SDK is
55
- * running, and an init() or reset() that comes after doesn't switch it back. null until the app
56
- * has chosen.
54
+ * The choice made in the console, by enableDebug() or disableDebug(): before init() runs or while
55
+ * the SDK is running, and an init() or reset() that comes after doesn't switch it back. null until
56
+ * one is called.
57
57
  */
58
58
  var chosen = null;
59
59
  /** Turning it on starts the idle hour; turning it off clears it, so the next on gets a whole hour. */
@@ -62,22 +62,46 @@ function setDebug(on) {
62
62
  state._ZAP._debugUntil = on ? utils.nowMs() + constants.DEBUG_IDLE_MS : 0;
63
63
  logger.Console.log('apptics: debug mode ' + (on ? 'on' : 'off')); // no i18n
64
64
  }
65
+ /** The calls already refused for coming from code: said once per page each, not once per call. */
66
+ var refusedSaid = {};
67
+ /**
68
+ * Whether `call` was typed into the browser console. A call from the page's code is ignored and
69
+ * said once, debug or not, so a debug switch left in an app's code does nothing in production.
70
+ */
71
+ function fromConsole(call) {
72
+ if (consoleCall.calledFromConsole()) {
73
+ return true;
74
+ }
75
+ if (!refusedSaid[call]) {
76
+ refusedSaid[call] = true;
77
+ logger.warnAlways('apptics: ' + call + '() works only when typed in the browser console; this call from code is ignored'); // no i18n
78
+ }
79
+ return false;
80
+ }
65
81
  /**
66
82
  * Turns debug mode on, at any time: before init(), during start-up or while the SDK runs. The
67
- * choice holds over `debug` in init() for the rest of the page's life.
83
+ * choice holds through init() and reset() for the rest of the page's life. Only from the console.
68
84
  */
69
85
  function enableDebug() {
86
+ if (!fromConsole('Apptics.enableDebug')) { // no i18n
87
+ return;
88
+ }
70
89
  chosen = true;
71
90
  setDebug(true);
72
91
  }
73
- /** Turns debug mode off, at any time, with the same hold over `debug` as enableDebug(). */
92
+ /**
93
+ * Turns debug mode off, at any time, holding as enableDebug() does. Only from the console.
94
+ */
74
95
  function disableDebug() {
96
+ if (!fromConsole('Apptics.disableDebug')) { // no i18n
97
+ return;
98
+ }
75
99
  chosen = false;
76
100
  setDebug(false);
77
101
  }
78
- /** What init() applies for `debug`: the config's value, unless the app has already chosen. */
79
- function applyDebugConfig(configured) {
80
- setDebug(chosen !== null ? chosen : configured);
102
+ /** What init() applies: off, unless enableDebug() or disableDebug() already chose. */
103
+ function applyDebugConfig() {
104
+ setDebug(chosen === true);
81
105
  }
82
106
 
83
107
  exports.applyDebugConfig = applyDebugConfig;
@@ -1,4 +1,3 @@
1
- import type { AppticsConfig } from '../types.js';
2
1
  export declare function isBlockedWS(ua: string): boolean;
3
2
  /** Device RAM as the API wants it ("4 GB"). Chromium only; empty elsewhere. */
4
3
  export declare function getRam(): string;
@@ -24,5 +23,3 @@ export declare function getTimeZone(): string;
24
23
  export declare function is_apptics_disabled(): boolean;
25
24
  /** Pure DNT check (no side effects). consent.hasDoNotTrackEnabled() applies NO_TRACKING. */
26
25
  export declare function isDntOn(): boolean;
27
- /** The console snippet's config (window.appticssettings._defaultoptions), if the page defines one. */
28
- export declare function getSnippetOptions(): AppticsConfig | undefined;
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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('./constants.js');
@@ -242,13 +242,6 @@ function isDntOn() {
242
242
  return utils.includes(dntValues, dntValue);
243
243
  });
244
244
  }
245
- /** The console snippet's config (window.appticssettings._defaultoptions), if the page defines one. */
246
- function getSnippetOptions() {
247
- if (typeof window === 'undefined' || !window.appticssettings) { // no i18n
248
- return undefined;
249
- }
250
- return window.appticssettings._defaultoptions;
251
- }
252
245
 
253
246
  exports.getBatteryPercent = getBatteryPercent;
254
247
  exports.getBrowser = getBrowser;
@@ -260,7 +253,6 @@ exports.getOS = getOS;
260
253
  exports.getOrientation = getOrientation;
261
254
  exports.getRam = getRam;
262
255
  exports.getReferringURL = getReferringURL;
263
- exports.getSnippetOptions = getSnippetOptions;
264
256
  exports.getTimeZone = getTimeZone;
265
257
  exports.isBlockedWS = isBlockedWS;
266
258
  exports.isDntOn = isDntOn;
@@ -1 +1 @@
1
- export declare const FRAMEWORK_ID = 6002;
1
+ export declare const FRAMEWORK_ID = 6012;
@@ -1,9 +1,9 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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
  // Generated by scripts/register-version.mjs — do not edit by hand.
5
5
  // The framework id Apptics issued for this SDK, from POST /sdk/web/v1/framework/addversion
6
- // (version 2.0.0-beta.1, platform Browser). Regenerated on every npm pack.
7
- const FRAMEWORK_ID = 6002;
6
+ // (version 2.0.0, platform Browser). Regenerated on every npm pack.
7
+ const FRAMEWORK_ID = 6012;
8
8
 
9
9
  exports.FRAMEWORK_ID = FRAMEWORK_ID;
@@ -1,8 +1,9 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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('./state.js');
5
5
  var logger = require('./logger.js');
6
+ var shield = require('./shield.js');
6
7
 
7
8
  /**
8
9
  * Calls that run immediately while storage is loading. Everything else is buffered and replayed in order.
@@ -18,9 +19,14 @@ const RUN_BEFORE_READY = {
18
19
  // a switch, and a call that hands back the id endTrackApi needs: neither can wait in a queue
19
20
  'AppticsApi.configure': true, 'AppticsApi.startTrackApi': true,
20
21
  // these wait for ready() themselves, and a queued call would hand back undefined, not a Promise
21
- 'AppticsRemoteConfig.fetchValue': true, 'AppticsRemoteConfig.fetchValues': true,
22
+ 'AppticsRemoteConfig.fetchValues': true,
22
23
  'AppticsRemoteConfig.setCustomConditionValue': true,
23
24
  'Apptics.enableDebug': true, 'Apptics.disableDebug': true,
25
+ // these wait for start-up themselves, for the same reason as remote config's
26
+ 'AppticsPushNotification.setEnabled': true,
27
+ 'AppticsPushNotification.isEnabled': true,
28
+ 'AppticsPushNotification.requestPermission': true,
29
+ // 'AppticsPushNotification.onNotificationClick': true, (held back; see pushnotification/index.ts)
24
30
  };
25
31
  /**
26
32
  * Calls that record or send something, and so are lost when the SDK hasn't started. Calls that only
@@ -31,7 +37,7 @@ const RUN_BEFORE_READY = {
31
37
  const NEEDS_INIT = {
32
38
  'AppticsEvent.addEvent': true, 'AppticsScreen.inScreen': true, 'AppticsScreen.outScreen': true,
33
39
  'AppticsApi.endTrackApi': true, 'AppticsError.trackError': true, 'AppticsUser.setUser': true,
34
- 'Apptics.flush': true, AppticsLogger: true, 'AppticsFeedback.sendFeedback': true, 'AppticsRemoteConfig.fetchValue': true,
40
+ 'Apptics.flush': true, AppticsLogger: true, 'AppticsFeedback.sendFeedback': true,
35
41
  'AppticsRemoteConfig.fetchValues': true,
36
42
  };
37
43
  /** How a call is named in a message: every public call is named after its object, as `AppticsEvent.addEvent`. */
@@ -56,7 +62,16 @@ function guard(name, fn) {
56
62
  return undefined;
57
63
  }
58
64
  try {
59
- return fn(...args);
65
+ var result = fn(...args);
66
+ if (result && typeof result.then === 'function') { // no i18n
67
+ // a rejection the app leaves unhandled is still the SDK's failure, not the app's
68
+ // JS error (lifecycle's unhandledrejection listener)
69
+ return result.then(undefined, function (reason) {
70
+ shield.markSdkRejection(reason);
71
+ throw reason;
72
+ });
73
+ }
74
+ return result;
60
75
  }
61
76
  catch (err) {
62
77
  // a public call swallowing its own exception into a debug-gated console line is how
@@ -36,4 +36,33 @@ export declare const hooks: {
36
36
  remoteConfigStarted: () => void;
37
37
  /** Set by remoteconfig/fetch.ts: AppticsUser.setUser changed who this is, so conditions on the user re-apply. */
38
38
  remoteConfigUserChanged: () => void;
39
+ /**
40
+ * Set by device/index.ts: getsdkconfig is asked now, outside its next_check_after. setUser calls
41
+ * it for a user whose customer group is not tracked, setTrackingStatus for that user when PII
42
+ * starts or stops, and remote config when getupdates reports a module changed.
43
+ */
44
+ askServerSettings: () => void;
45
+ /** Set by user/index.ts: whether user/register answered customergrouptracking: false for the active user. */
46
+ activeUserGroupUntracked: () => boolean;
47
+ /**
48
+ * Set by pushnotification/session.ts: the module ids getsdkconfig is asked about in `moduleids`.
49
+ * Push's 16 is what makes the answer carry the `wms` block; without the push entry, none.
50
+ */
51
+ sdkConfigModuleIds: () => string[];
52
+ /** Set by pushnotification/session.ts: getsdkconfig's push flag or wms block was applied, live or restored. */
53
+ pushConfigChanged: () => void;
54
+ /** Set by pushnotification/session.ts: the visitor's tracking status changed. */
55
+ pushTrackingChanged: () => void;
56
+ /** Set by pushnotification/session.ts: start-up has finished. */
57
+ pushStarted: () => void;
58
+ /** Set by pushnotification/session.ts, so reset() can forget the push session without importing it. */
59
+ resetPush: () => void;
60
+ /** Set by pushnotification/session.ts: device/add's ids are stored, the anonymousid among them. */
61
+ pushDeviceIdsChanged: () => void;
62
+ /** Set by pushnotification/session.ts: init() has begun start-up, so _ZAP._readyPromise exists. */
63
+ pushInitCalled: () => void;
64
+ /** Set by pushnotification/stats.ts, so flush() and the send interval send push stats too. */
65
+ sendPushStats: (forget?: boolean) => Promise<void>;
66
+ /** Set by pushnotification/stats.ts: the app tracked an event, which may be a push's conversion. */
67
+ pushEventTracked: (eventName: string, groupName: string) => void;
39
68
  };
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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
  /**
@@ -17,6 +17,17 @@ const hooks = {
17
17
  screenTrackedByApp: () => { },
18
18
  remoteConfigStarted: () => { },
19
19
  remoteConfigUserChanged: () => { },
20
+ askServerSettings: () => { },
21
+ activeUserGroupUntracked: () => false,
22
+ sdkConfigModuleIds: () => [],
23
+ pushConfigChanged: () => { },
24
+ pushTrackingChanged: () => { },
25
+ pushStarted: () => { },
26
+ resetPush: () => { },
27
+ pushDeviceIdsChanged: () => { },
28
+ pushInitCalled: () => { },
29
+ sendPushStats: () => Promise.resolve(),
30
+ pushEventTracked: () => { },
20
31
  };
21
32
 
22
33
  exports.hooks = hooks;
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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
  /**
@@ -1,4 +1,4 @@
1
- /*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.1 | (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('./state.js');
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The SDK's own failures stay the SDK's. A throw in one of its timers or listeners, or a rejection
3
+ * no one in the SDK waits on, would otherwise reach the page's `error` and `unhandledrejection`
4
+ * events, where the SDK's error tracking records it as the app's JS error and sends it.
5
+ *
6
+ * guard() shields the public calls; shield() and quietly() shield everything the SDK runs later.
7
+ * Element errors (the SDK's script, style and form elements) are told apart by isSdkElement.
8
+ */
9
+ /**
10
+ * Said in the console and nowhere else. An Error is a real failure (a bug, storage refusing), said
11
+ * whether or not debug is on; anything else is one of the SDK's own reasons for not doing
12
+ * something, as "nothing to send", said in debug mode.
13
+ */
14
+ export declare function sdkFailed(label: string, err: unknown): void;
15
+ /**
16
+ * A callback the SDK hands to the browser (a timer, a listener, a storage or network callback)
17
+ * that never throws into it. A promise it returns is waited on the same way, so an async
18
+ * listener's rejection is not left unhandled either. Wrap once and keep the wrapped function where
19
+ * it is removed again later: removeEventListener needs the same reference.
20
+ */
21
+ export declare function shield<F extends (...args: any[]) => any>(label: string, fn: F): F;
22
+ /** A promise the SDK starts and does not wait on: its rejection is said in the console, not left unhandled. */
23
+ export declare function quietly(label: string, promise: PromiseLike<unknown> | unknown): void;
24
+ export declare function markSdkRejection(reason: unknown): void;
25
+ export declare function isSdkRejection(reason: unknown): boolean;
26
+ /** Marks the elements the SDK adds to the page; isSdkElement knows them and what is inside them. */
27
+ export declare const SDK_ELEMENT_ATTR = "data-apptics";
28
+ /** Whether an element is the SDK's own: its style, the Quartz script, the feedback form or the recording timer. */
29
+ export declare function isSdkElement(target: unknown): boolean;
30
+ export declare function noteSdkScript(src: string | null | undefined): void;
31
+ export declare function isSdkScript(filename: string | null | undefined): boolean;