@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.
- package/CHANGELOG.md +191 -21
- package/README.md +519 -333
- package/dist/apptics.esm.min.js +2 -2
- package/dist/apptics.esm.min.js.map +1 -1
- package/dist/apptics.min.js +2 -2
- package/dist/apptics.min.js.map +1 -1
- package/dist/chunks/lifecycle-C6m1W7jo.min.js +3 -0
- package/dist/chunks/lifecycle-C6m1W7jo.min.js.map +1 -0
- package/dist/chunks/send-CgUO82ne.min.js +3 -0
- package/dist/chunks/send-CgUO82ne.min.js.map +1 -0
- package/dist/cjs/core/attempts.js +1 -1
- package/dist/cjs/core/batch.js +2 -2
- package/dist/cjs/core/consent.d.ts +18 -4
- package/dist/cjs/core/consent.js +31 -15
- package/dist/cjs/core/constants.d.ts +57 -27
- package/dist/cjs/core/constants.js +52 -33
- package/dist/cjs/core/db.d.ts +12 -4
- package/dist/cjs/core/db.js +167 -34
- package/dist/cjs/core/debug.js +1 -1
- package/dist/cjs/core/env.d.ts +0 -3
- package/dist/cjs/core/env.js +1 -9
- package/dist/cjs/core/framework-id.d.ts +1 -1
- package/dist/cjs/core/framework-id.js +3 -3
- package/dist/cjs/core/guard.d.ts +9 -0
- package/dist/cjs/core/guard.js +27 -13
- package/dist/cjs/core/hooks.d.ts +7 -4
- package/dist/cjs/core/hooks.js +3 -3
- package/dist/cjs/core/locks.d.ts +9 -0
- package/dist/cjs/core/locks.js +22 -0
- package/dist/cjs/core/logger.d.ts +3 -4
- package/dist/cjs/core/logger.js +4 -40
- package/dist/cjs/core/state.d.ts +9 -6
- package/dist/cjs/core/state.js +3 -5
- package/dist/cjs/core/storage.d.ts +20 -5
- package/dist/cjs/core/storage.js +115 -20
- package/dist/cjs/core/stylesheet.d.ts +8 -0
- package/dist/cjs/core/stylesheet.js +29 -0
- package/dist/cjs/core/transport.d.ts +2 -0
- package/dist/cjs/core/transport.js +30 -18
- package/dist/cjs/core/utils.js +1 -1
- package/dist/cjs/core/validate.js +2 -2
- package/dist/cjs/device/appversion.d.ts +10 -6
- package/dist/cjs/device/appversion.js +38 -3
- package/dist/cjs/device/index.d.ts +28 -2
- package/dist/cjs/device/index.js +312 -44
- package/dist/cjs/engagement/api-rules.d.ts +32 -67
- package/dist/cjs/engagement/api-rules.js +144 -157
- package/dist/cjs/engagement/auto-api.js +2 -2
- package/dist/cjs/engagement/auto-screen.d.ts +2 -0
- package/dist/cjs/engagement/auto-screen.js +67 -3
- package/dist/cjs/engagement/defined-events.js +1 -1
- package/dist/cjs/engagement/send.js +12 -3
- package/dist/cjs/engagement/session.d.ts +29 -3
- package/dist/cjs/engagement/session.js +253 -26
- package/dist/cjs/engagement/track.d.ts +4 -4
- package/dist/cjs/engagement/track.js +58 -30
- package/dist/cjs/errors/send.js +2 -2
- package/dist/cjs/errors/track.d.ts +2 -1
- package/dist/cjs/errors/track.js +49 -7
- package/dist/cjs/feedback/controls.d.ts +12 -0
- package/dist/cjs/feedback/controls.js +104 -25
- package/dist/cjs/feedback/index.d.ts +8 -7
- package/dist/cjs/feedback/index.js +32 -13
- package/dist/cjs/feedback/logs.d.ts +13 -11
- package/dist/cjs/feedback/logs.js +57 -28
- package/dist/cjs/feedback/quartz.d.ts +18 -0
- package/dist/cjs/feedback/quartz.js +105 -0
- package/dist/cjs/feedback/send.d.ts +5 -2
- package/dist/cjs/feedback/send.js +30 -28
- package/dist/cjs/feedback/styles.d.ts +10 -0
- package/dist/cjs/feedback/styles.js +8 -0
- package/dist/cjs/feedback/template.d.ts +1 -1
- package/dist/cjs/feedback/template.js +20 -12
- package/dist/cjs/feedback/ui.d.ts +21 -6
- package/dist/cjs/feedback/ui.js +283 -70
- package/dist/cjs/heatmap/send.d.ts +2 -0
- package/dist/cjs/heatmap/send.js +3 -5
- package/dist/cjs/heatmap/track.d.ts +1 -1
- package/dist/cjs/heatmap/track.js +87 -16
- package/dist/cjs/index.d.ts +16 -63
- package/dist/cjs/index.js +144 -95
- package/dist/cjs/lifecycle.d.ts +21 -3
- package/dist/cjs/lifecycle.js +353 -89
- package/dist/cjs/remoteconfig/country.d.ts +4 -0
- package/dist/cjs/remoteconfig/country.js +73 -0
- package/dist/cjs/remoteconfig/custom.d.ts +7 -7
- package/dist/cjs/remoteconfig/custom.js +31 -51
- package/dist/cjs/remoteconfig/evaluate.d.ts +3 -3
- package/dist/cjs/remoteconfig/evaluate.js +56 -43
- package/dist/cjs/remoteconfig/fetch.d.ts +16 -9
- package/dist/cjs/remoteconfig/fetch.js +120 -39
- package/dist/cjs/remoteconfig/index.d.ts +19 -8
- package/dist/cjs/remoteconfig/index.js +81 -39
- package/dist/cjs/remoteconfig/store.d.ts +15 -7
- package/dist/cjs/remoteconfig/store.js +68 -35
- package/dist/cjs/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/cjs/remoteconfig/tz-countries.js +13 -0
- package/dist/{esm/core → cjs/remotelog}/callsite.d.ts +11 -4
- package/dist/cjs/{core → remotelog}/callsite.js +30 -7
- package/dist/cjs/remotelog/gate.d.ts +2 -11
- package/dist/cjs/remotelog/gate.js +9 -35
- package/dist/cjs/remotelog/index.d.ts +4 -21
- package/dist/cjs/remotelog/logger.d.ts +11 -17
- package/dist/cjs/remotelog/logger.js +31 -59
- package/dist/cjs/remotelog/send.js +11 -11
- package/dist/cjs/remotelogger/index.d.ts +12 -0
- package/dist/cjs/remotelogger/index.js +18 -0
- package/dist/cjs/scheduler.d.ts +3 -1
- package/dist/cjs/scheduler.js +25 -22
- package/dist/cjs/types.d.ts +208 -90
- package/dist/cjs/user/index.js +16 -7
- package/dist/esm/core/attempts.js +1 -1
- package/dist/esm/core/batch.js +2 -2
- package/dist/esm/core/consent.d.ts +18 -4
- package/dist/esm/core/consent.js +32 -17
- package/dist/esm/core/constants.d.ts +57 -27
- package/dist/esm/core/constants.js +51 -33
- package/dist/esm/core/db.d.ts +12 -4
- package/dist/esm/core/db.js +164 -35
- package/dist/esm/core/debug.js +1 -1
- package/dist/esm/core/env.d.ts +0 -3
- package/dist/esm/core/env.js +2 -9
- package/dist/esm/core/framework-id.d.ts +1 -1
- package/dist/esm/core/framework-id.js +3 -3
- package/dist/esm/core/guard.d.ts +9 -0
- package/dist/esm/core/guard.js +27 -14
- package/dist/esm/core/hooks.d.ts +7 -4
- package/dist/esm/core/hooks.js +3 -3
- package/dist/esm/core/locks.d.ts +9 -0
- package/dist/esm/core/locks.js +20 -0
- package/dist/esm/core/logger.d.ts +3 -4
- package/dist/esm/core/logger.js +4 -40
- package/dist/esm/core/state.d.ts +9 -6
- package/dist/esm/core/state.js +3 -5
- package/dist/esm/core/storage.d.ts +20 -5
- package/dist/esm/core/storage.js +113 -21
- package/dist/esm/core/stylesheet.d.ts +8 -0
- package/dist/esm/core/stylesheet.js +27 -0
- package/dist/esm/core/transport.d.ts +2 -0
- package/dist/esm/core/transport.js +30 -19
- package/dist/esm/core/utils.js +1 -1
- package/dist/esm/core/validate.js +2 -2
- package/dist/esm/device/appversion.d.ts +10 -6
- package/dist/esm/device/appversion.js +37 -4
- package/dist/esm/device/index.d.ts +28 -2
- package/dist/esm/device/index.js +313 -49
- package/dist/esm/engagement/api-rules.d.ts +32 -67
- package/dist/esm/engagement/api-rules.js +143 -155
- package/dist/esm/engagement/auto-api.js +3 -3
- package/dist/esm/engagement/auto-screen.d.ts +2 -0
- package/dist/esm/engagement/auto-screen.js +67 -4
- package/dist/esm/engagement/defined-events.js +1 -1
- package/dist/esm/engagement/send.js +12 -3
- package/dist/esm/engagement/session.d.ts +29 -3
- package/dist/esm/engagement/session.js +251 -30
- package/dist/esm/engagement/track.d.ts +4 -4
- package/dist/esm/engagement/track.js +65 -37
- package/dist/esm/errors/send.js +2 -2
- package/dist/esm/errors/track.d.ts +2 -1
- package/dist/esm/errors/track.js +49 -7
- package/dist/esm/feedback/controls.d.ts +12 -0
- package/dist/esm/feedback/controls.js +103 -26
- package/dist/esm/feedback/index.d.ts +8 -7
- package/dist/esm/feedback/index.js +34 -13
- package/dist/esm/feedback/logs.d.ts +13 -11
- package/dist/esm/feedback/logs.js +59 -30
- package/dist/esm/feedback/quartz.d.ts +18 -0
- package/dist/esm/feedback/quartz.js +99 -0
- package/dist/esm/feedback/send.d.ts +5 -2
- package/dist/esm/feedback/send.js +31 -31
- package/dist/esm/feedback/styles.d.ts +10 -0
- package/dist/esm/feedback/styles.js +4 -0
- package/dist/esm/feedback/template.d.ts +1 -1
- package/dist/esm/feedback/template.js +20 -12
- package/dist/esm/feedback/ui.d.ts +21 -6
- package/dist/esm/feedback/ui.js +283 -71
- package/dist/esm/heatmap/send.d.ts +2 -0
- package/dist/esm/heatmap/send.js +3 -5
- package/dist/esm/heatmap/track.d.ts +1 -1
- package/dist/esm/heatmap/track.js +87 -16
- package/dist/esm/index.d.ts +16 -63
- package/dist/esm/index.js +148 -83
- package/dist/esm/lifecycle.d.ts +21 -3
- package/dist/esm/lifecycle.js +359 -98
- package/dist/esm/remoteconfig/country.d.ts +4 -0
- package/dist/esm/remoteconfig/country.js +70 -0
- package/dist/esm/remoteconfig/custom.d.ts +7 -7
- package/dist/esm/remoteconfig/custom.js +32 -52
- package/dist/esm/remoteconfig/evaluate.d.ts +3 -3
- package/dist/esm/remoteconfig/evaluate.js +57 -44
- package/dist/esm/remoteconfig/fetch.d.ts +16 -9
- package/dist/esm/remoteconfig/fetch.js +120 -39
- package/dist/esm/remoteconfig/index.d.ts +19 -8
- package/dist/esm/remoteconfig/index.js +82 -40
- package/dist/esm/remoteconfig/store.d.ts +15 -7
- package/dist/esm/remoteconfig/store.js +68 -36
- package/dist/esm/remoteconfig/tz-countries.d.ts +8 -0
- package/dist/esm/remoteconfig/tz-countries.js +11 -0
- package/dist/{cjs/core → esm/remotelog}/callsite.d.ts +11 -4
- package/dist/esm/{core → remotelog}/callsite.js +30 -8
- package/dist/esm/remotelog/gate.d.ts +2 -11
- package/dist/esm/remotelog/gate.js +10 -32
- package/dist/esm/remotelog/index.d.ts +4 -21
- package/dist/esm/remotelog/logger.d.ts +11 -17
- package/dist/esm/remotelog/logger.js +33 -61
- package/dist/esm/remotelog/send.js +13 -13
- package/dist/esm/remotelogger/index.d.ts +12 -0
- package/dist/esm/remotelogger/index.js +13 -0
- package/dist/esm/scheduler.d.ts +3 -1
- package/dist/esm/scheduler.js +26 -24
- package/dist/esm/types.d.ts +208 -90
- package/dist/esm/user/index.js +18 -8
- package/dist/feedback.esm.min.js +2 -2
- package/dist/feedback.esm.min.js.map +1 -1
- package/dist/remoteconfig.esm.min.js +3 -0
- package/dist/remoteconfig.esm.min.js.map +1 -0
- package/dist/remotelogger.esm.min.js +3 -0
- package/dist/remotelogger.esm.min.js.map +1 -0
- package/package.json +16 -17
- package/dist/chunks/batch-BU_mTpm1.min.js +0 -3
- package/dist/chunks/batch-BU_mTpm1.min.js.map +0 -1
- package/dist/chunks/logs-Bea5zUW_.min.js +0 -3
- package/dist/chunks/logs-Bea5zUW_.min.js.map +0 -1
- package/dist/cjs/auto-init.d.ts +0 -8
- package/dist/cjs/auto-init.js +0 -32
- package/dist/cjs/heatmap/index.d.ts +0 -16
- package/dist/cjs/heatmap/index.js +0 -22
- package/dist/cjs/remotelog/index.js +0 -55
- package/dist/esm/auto-init.d.ts +0 -8
- package/dist/esm/auto-init.js +0 -29
- package/dist/esm/heatmap/index.d.ts +0 -16
- package/dist/esm/heatmap/index.js +0 -17
- package/dist/esm/remotelog/index.js +0 -51
- package/dist/heatmap.esm.min.js +0 -3
- package/dist/heatmap.esm.min.js.map +0 -1
- package/dist/style.css +0 -1
|
@@ -1,21 +1,22 @@
|
|
|
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 logger = require('../core/logger.js');
|
|
5
5
|
var storage = require('../core/storage.js');
|
|
6
|
+
var utils = require('../core/utils.js');
|
|
6
7
|
var evaluate = require('./evaluate.js');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* What remote config keeps between visits.
|
|
10
11
|
*
|
|
11
|
-
* The rule set is stored, not just the resolved values
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* flagtime 0 on every visit. And the resolved values depend on the device: an app version or a
|
|
15
|
-
* customer group that changed since the last visit has to re-resolve against the same rules.
|
|
12
|
+
* The rule set is stored, not just the resolved values: the values depend on the device, so an
|
|
13
|
+
* app version or a customer group that changed has to re-resolve against the same rules, and a
|
|
14
|
+
* visit that cannot reach the server still has the last visit's values to read.
|
|
16
15
|
*
|
|
17
|
-
* `flagtime` is the whole protocol here
|
|
18
|
-
*
|
|
16
|
+
* `flagtime` is the whole protocol here. The first getupdates of a page load sends 0 and gets the
|
|
17
|
+
* whole rule set, which replaces what is stored. Each later one sends the time the last answered
|
|
18
|
+
* request went out, and gets only what was added or changed since: those parameters and
|
|
19
|
+
* conditions are merged into the stored set, and one that did not change is kept as it was.
|
|
19
20
|
*/
|
|
20
21
|
const STORE_KEY = 'remoteconfig'; // no i18n
|
|
21
22
|
var values = {};
|
|
@@ -24,55 +25,86 @@ function read() {
|
|
|
24
25
|
var saved = storage.user_defaults.item(STORE_KEY);
|
|
25
26
|
return saved && typeof saved === 'object' ? saved : null;
|
|
26
27
|
}
|
|
27
|
-
/**
|
|
28
|
+
/** When the last answered getupdates went out; 0 when nothing is stored. */
|
|
28
29
|
function flagtime() {
|
|
29
30
|
var saved = read();
|
|
30
31
|
return saved && typeof saved.flagtime === 'number' ? saved.flagtime : 0;
|
|
31
32
|
}
|
|
32
|
-
/**
|
|
33
|
-
* The newest `version[].date` in a rule set, which is what the next fetch sends as flagtime.
|
|
34
|
-
*
|
|
35
|
-
* The array is a publication history and is not promised to be in order, so it is the highest
|
|
36
|
-
* date that matters rather than the first or last entry.
|
|
37
|
-
*/
|
|
38
|
-
function publishedAt(rules) {
|
|
39
|
-
var versions = Array.isArray(rules.version) ? rules.version : [];
|
|
40
|
-
var newest = 0;
|
|
41
|
-
versions.forEach(function (one) {
|
|
42
|
-
var at = Number(one.date);
|
|
43
|
-
if (isFinite(at) && at > newest) {
|
|
44
|
-
newest = at;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return newest;
|
|
48
|
-
}
|
|
49
33
|
/** Re-resolves the stored rules against this device, without fetching. */
|
|
50
34
|
function reresolve() {
|
|
51
35
|
var saved = read();
|
|
52
36
|
values = saved && saved.rules ? evaluate.resolveAll(saved.rules) : {};
|
|
53
37
|
loaded = true;
|
|
54
38
|
}
|
|
55
|
-
/**
|
|
56
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Stores a whole rule set, the answer to flagtime 0, in place of what was stored, and resolves
|
|
41
|
+
* it. `askedAt` is when the request went out: the next one asks for what changed since then.
|
|
42
|
+
*/
|
|
43
|
+
function store(rules, askedAt) {
|
|
57
44
|
evaluate.resetEvaluationWarnings();
|
|
58
|
-
var record = { flagtime:
|
|
45
|
+
var record = { flagtime: askedAt, rules: rules, fetchedat: utils.nowMs() };
|
|
59
46
|
storage.user_defaults.add(STORE_KEY, record);
|
|
60
47
|
values = evaluate.resolveAll(rules);
|
|
61
48
|
loaded = true;
|
|
62
|
-
logger.Console.log('AppticsRemoteConfig: ' + Object.keys(values).length + ' parameters,
|
|
49
|
+
logger.Console.log('AppticsRemoteConfig: ' + Object.keys(values).length + ' parameters, as of ' + askedAt); // no i18n
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `changed` laid over `stored`, matched by `key`: an entry the server resent replaces the one
|
|
53
|
+
* with the same key, in its place; a new one goes on the end; the rest stay as they were.
|
|
54
|
+
*/
|
|
55
|
+
function mergeList(stored, changed, key) {
|
|
56
|
+
var out = Array.isArray(stored) ? stored.slice() : [];
|
|
57
|
+
if (!Array.isArray(changed)) {
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
changed.forEach(function (entry) {
|
|
61
|
+
if (!entry || typeof entry !== 'object') {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
var id = key(entry);
|
|
65
|
+
var at = id === '' ? -1 : out.findIndex(function (one) { return key(one) === id; });
|
|
66
|
+
if (at >= 0) {
|
|
67
|
+
out[at] = entry;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
out.push(entry);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
/** An entry's id, or its name when it has none, as the key to match a resent entry by. */
|
|
76
|
+
function idOr(idKey, nameKey) {
|
|
77
|
+
return function (entry) {
|
|
78
|
+
var id = entry[idKey] !== undefined && entry[idKey] !== null ? entry[idKey] : entry[nameKey];
|
|
79
|
+
return id === undefined || id === null ? '' : String(id); // no i18n
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Merges what a later getupdates sent, everything added or changed since its flagtime, into the
|
|
84
|
+
* stored rule set, and resolves the result. With nothing stored, it is the whole set.
|
|
85
|
+
*/
|
|
86
|
+
function merge(changes, askedAt) {
|
|
87
|
+
var saved = read();
|
|
88
|
+
var base = saved && saved.rules && typeof saved.rules === 'object' ? saved.rules : {};
|
|
89
|
+
var rules = Object.assign({}, base, changes);
|
|
90
|
+
rules.all_parameter = mergeList(base.all_parameter, changes.all_parameter, idOr('paramid', 'paramname')); // no i18n
|
|
91
|
+
rules.all_condition = mergeList(base.all_condition, changes.all_condition, idOr('conditionid', 'conditionname')); // no i18n
|
|
92
|
+
rules.version = mergeList(base.version, changes.version, idOr('versionid', 'date')); // no i18n
|
|
93
|
+
store(rules, askedAt);
|
|
63
94
|
}
|
|
64
95
|
/**
|
|
65
|
-
* Records a fetch that brought no
|
|
96
|
+
* Records a later fetch that brought no changes.
|
|
66
97
|
*
|
|
67
|
-
* That is the normal answer
|
|
68
|
-
*
|
|
98
|
+
* That is the normal answer, and it is not a failure: what is stored stays, and the next request
|
|
99
|
+
* asks for what changed since this one went out.
|
|
69
100
|
*/
|
|
70
|
-
function storeUnchanged(
|
|
101
|
+
function storeUnchanged(askedAt) {
|
|
71
102
|
var saved = read();
|
|
72
103
|
if (saved === null) {
|
|
73
104
|
return;
|
|
74
105
|
}
|
|
75
|
-
saved.
|
|
106
|
+
saved.flagtime = askedAt;
|
|
107
|
+
saved.fetchedat = utils.nowMs();
|
|
76
108
|
storage.user_defaults.add(STORE_KEY, saved);
|
|
77
109
|
}
|
|
78
110
|
/** Forgets the rule set and its values, so the next fetch asks with flagtime 0. */
|
|
@@ -93,6 +125,7 @@ function all() {
|
|
|
93
125
|
exports.all = all;
|
|
94
126
|
exports.clearRemoteConfig = clearRemoteConfig;
|
|
95
127
|
exports.flagtime = flagtime;
|
|
128
|
+
exports.merge = merge;
|
|
96
129
|
exports.reresolve = reresolve;
|
|
97
130
|
exports.store = store;
|
|
98
131
|
exports.storeUnchanged = storeUnchanged;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The country of every IANA time zone, by its ISO 3166 code: generated by
|
|
3
|
+
* scripts/tz-countries.mjs from tzdata 2026d-rearguard (zone.tab, and the old names its links keep).
|
|
4
|
+
* Do not edit by hand.
|
|
5
|
+
*
|
|
6
|
+
* Packed as "CC:Area/City,City|Area/City;CC:...": a country, then its zones grouped by area.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TZ_COUNTRIES = "AD:Europe/Andorra;AE:Asia/Dubai;AF:Asia/Kabul;AG:America/Antigua;AI:America/Anguilla;AL:Europe/Tirane;AM:Asia/Yerevan;AO:Africa/Luanda;AQ:Antarctica/Casey,Davis,DumontDUrville,Mawson,McMurdo,Palmer,Rothera,Syowa,Troll,Vostok;AR:America/Argentina/Buenos_Aires,Argentina/Catamarca,Argentina/ComodRivadavia,Argentina/Cordoba,Argentina/Jujuy,Argentina/La_Rioja,Argentina/Mendoza,Argentina/Rio_Gallegos,Argentina/Salta,Argentina/San_Juan,Argentina/San_Luis,Argentina/Tucuman,Argentina/Ushuaia,Buenos_Aires,Catamarca,Cordoba,Jujuy,Mendoza,Rosario;AS:Pacific/Pago_Pago,Samoa|US/Samoa;AT:Europe/Vienna;AU:Antarctica/Macquarie|Australia/ACT,Adelaide,Brisbane,Broken_Hill,Canberra,Currie,Darwin,Eucla,Hobart,LHI,Lindeman,Lord_Howe,Melbourne,NSW,North,Perth,Queensland,South,Sydney,Tasmania,Victoria,West,Yancowinna;AW:America/Aruba;AX:Europe/Mariehamn;AZ:Asia/Baku;BA:Europe/Sarajevo;BB:America/Barbados;BD:Asia/Dacca,Dhaka;BE:CET,MET|Europe/Brussels;BF:Africa/Ouagadougou;BG:Europe/Sofia;BH:Asia/Bahrain;BI:Africa/Bujumbura;BJ:Africa/Porto-Novo;BL:America/St_Barthelemy;BM:Atlantic/Bermuda;BN:Asia/Brunei;BO:America/La_Paz;BQ:America/Kralendijk;BR:America/Araguaina,Bahia,Belem,Boa_Vista,Campo_Grande,Cuiaba,Eirunepe,Fortaleza,Maceio,Manaus,Noronha,Porto_Acre,Porto_Velho,Recife,Rio_Branco,Santarem,Sao_Paulo|Brazil/Acre,DeNoronha,East,West;BS:America/Nassau;BT:Asia/Thimbu,Thimphu;BW:Africa/Gaborone;BY:Europe/Minsk;BZ:America/Belize;CA:America/Atikokan,Blanc-Sablon,Cambridge_Bay,Creston,Dawson,Dawson_Creek,Edmonton,Fort_Nelson,Glace_Bay,Goose_Bay,Halifax,Inuvik,Iqaluit,Moncton,Montreal,Nipigon,Pangnirtung,Rainy_River,Rankin_Inlet,Regina,Resolute,St_Johns,Swift_Current,Thunder_Bay,Toronto,Vancouver,Whitehorse,Winnipeg,Yellowknife|Canada/Atlantic,Central,Eastern,Mountain,Newfoundland,Pacific,Saskatchewan,Yukon;CC:Indian/Cocos;CD:Africa/Kinshasa,Lubumbashi;CF:Africa/Bangui;CG:Africa/Brazzaville;CH:Europe/Zurich;CI:Africa/Abidjan,Timbuktu|Iceland;CK:Pacific/Rarotonga;CL:America/Coyhaique,Punta_Arenas,Santiago|Chile/Continental,EasterIsland|Pacific/Easter;CM:Africa/Douala;CN:Asia/Chongqing,Chungking,Harbin,Kashgar,Shanghai,Urumqi|PRC;CO:America/Bogota;CR:America/Costa_Rica;CU:America/Havana|Cuba;CV:Atlantic/Cape_Verde;CW:America/Curacao;CX:Indian/Christmas;CY:Asia/Famagusta,Nicosia|Europe/Nicosia;CZ:Europe/Prague;DE:Atlantic/Jan_Mayen|Europe/Berlin,Busingen;DJ:Africa/Djibouti;DK:Europe/Copenhagen;DM:America/Dominica;DO:America/Santo_Domingo;DZ:Africa/Algiers;EC:America/Guayaquil|Pacific/Galapagos;EE:Europe/Tallinn;EG:Africa/Cairo|Egypt;EH:Africa/El_Aaiun;ER:Africa/Asmara;ES:Africa/Ceuta|Atlantic/Canary|Europe/Madrid;ET:Africa/Addis_Ababa;FI:Europe/Helsinki;FJ:Pacific/Fiji;FK:Atlantic/Stanley;FM:Pacific/Chuuk,Kosrae,Pohnpei;FO:Atlantic/Faeroe,Faroe;FR:Europe/Paris;GA:Africa/Libreville;GB:Europe/Belfast,London|GB,GB-Eire;GD:America/Grenada;GE:Asia/Tbilisi;GF:America/Cayenne;GG:Europe/Guernsey;GH:Africa/Accra;GI:Europe/Gibraltar;GL:America/Danmarkshavn,Godthab,Nuuk,Scoresbysund,Thule;GM:Africa/Banjul;GN:Africa/Conakry;GP:America/Guadeloupe;GQ:Africa/Malabo;GR:EET|Europe/Athens;GS:Atlantic/South_Georgia;GT:America/Guatemala;GU:Pacific/Guam;GW:Africa/Bissau;GY:America/Guyana;HK:Asia/Hong_Kong|Hongkong;HN:America/Tegucigalpa;HR:Europe/Zagreb;HT:America/Port-au-Prince;HU:Europe/Budapest;ID:Asia/Jakarta,Jayapura,Makassar,Pontianak,Ujung_Pandang;IE:Eire|Europe/Dublin;IL:Asia/Jerusalem,Tel_Aviv|Israel;IM:Europe/Isle_of_Man;IN:Asia/Calcutta,Kolkata;IO:Indian/Chagos;IQ:Asia/Baghdad;IR:Asia/Tehran|Iran;IS:Atlantic/Reykjavik;IT:Europe/Rome;JE:Europe/Jersey;JM:America/Jamaica|Jamaica;JO:Asia/Amman;JP:Asia/Tokyo|Japan;KE:Africa/Asmera,Nairobi;KG:Asia/Bishkek;KH:Asia/Phnom_Penh;KI:Pacific/Enderbury,Kanton,Kiritimati,Tarawa;KM:Indian/Comoro;KN:America/St_Kitts;KP:Asia/Pyongyang;KR:Asia/Seoul|ROK;KW:Asia/Kuwait;KY:America/Cayman;KZ:Asia/Almaty,Aqtau,Aqtobe,Atyrau,Oral,Qostanay,Qyzylorda;LA:Asia/Vientiane;LB:Asia/Beirut;LC:America/St_Lucia;LI:Europe/Vaduz;LK:Asia/Colombo;LR:Africa/Monrovia;LS:Africa/Maseru;LT:Europe/Vilnius;LU:Europe/Luxembourg;LV:Europe/Riga;LY:Africa/Tripoli|Libya;MA:Africa/Casablanca;MC:Europe/Monaco;MD:Europe/Chisinau,Tiraspol;ME:Europe/Podgorica;MF:America/Marigot;MG:Indian/Antananarivo;MH:Kwajalein|Pacific/Kwajalein,Majuro;MK:Europe/Skopje;ML:Africa/Bamako;MM:Asia/Rangoon,Yangon;MN:Asia/Choibalsan,Hovd,Ulaanbaatar,Ulan_Bator;MO:Asia/Macao,Macau;MP:Pacific/Saipan;MQ:America/Martinique;MR:Africa/Nouakchott;MS:America/Montserrat;MT:Europe/Malta;MU:Indian/Mauritius;MV:Indian/Maldives;MW:Africa/Blantyre;MX:America/Bahia_Banderas,Cancun,Chihuahua,Ciudad_Juarez,Ensenada,Hermosillo,Matamoros,Mazatlan,Merida,Mexico_City,Monterrey,Ojinaga,Santa_Isabel,Tijuana|Mexico/BajaNorte,BajaSur,General;MY:Asia/Kuala_Lumpur,Kuching;MZ:Africa/Maputo;NA:Africa/Windhoek;NC:Pacific/Noumea;NE:Africa/Niamey;NF:Pacific/Norfolk;NG:Africa/Lagos;NI:America/Managua;NL:Europe/Amsterdam;NO:Europe/Oslo;NP:Asia/Kathmandu,Katmandu;NR:Pacific/Nauru;NU:Pacific/Niue;NZ:Antarctica/South_Pole|NZ,NZ-CHAT|Pacific/Auckland,Chatham;OM:Asia/Muscat;PA:America/Coral_Harbour,Panama|EST;PE:America/Lima;PF:Pacific/Gambier,Marquesas,Tahiti;PG:Pacific/Bougainville,Port_Moresby,Truk,Yap;PH:Asia/Manila;PK:Asia/Karachi;PL:Europe/Warsaw|Poland;PM:America/Miquelon;PN:Pacific/Pitcairn;PR:America/Puerto_Rico,Virgin;PS:Asia/Gaza,Hebron;PT:Atlantic/Azores,Madeira|Europe/Lisbon|Portugal,WET;PW:Pacific/Palau;PY:America/Asuncion;QA:Asia/Qatar;RE:Indian/Reunion;RO:Europe/Bucharest;RS:Europe/Belgrade;RU:Asia/Anadyr,Barnaul,Chita,Irkutsk,Kamchatka,Khandyga,Krasnoyarsk,Magadan,Novokuznetsk,Novosibirsk,Omsk,Sakhalin,Srednekolymsk,Tomsk,Ust-Nera,Vladivostok,Yakutsk,Yekaterinburg|Europe/Astrakhan,Kaliningrad,Kirov,Moscow,Samara,Saratov,Ulyanovsk,Volgograd|W-SU;RW:Africa/Kigali;SA:Asia/Riyadh;SB:Pacific/Guadalcanal,Ponape;SC:Indian/Mahe;SD:Africa/Khartoum;SE:Europe/Stockholm;SG:Asia/Singapore|Singapore;SH:Atlantic/St_Helena;SI:Europe/Ljubljana;SJ:Arctic/Longyearbyen;SK:Europe/Bratislava;SL:Africa/Freetown;SM:Europe/San_Marino;SN:Africa/Dakar;SO:Africa/Mogadishu;SR:America/Paramaribo;SS:Africa/Juba;ST:Africa/Sao_Tome;SV:America/El_Salvador;SX:America/Lower_Princes;SY:Asia/Damascus;SZ:Africa/Mbabane;TC:America/Grand_Turk;TD:Africa/Ndjamena;TF:Indian/Kerguelen;TG:Africa/Lome;TH:Asia/Bangkok;TJ:Asia/Dushanbe;TK:Pacific/Fakaofo;TL:Asia/Dili;TM:Asia/Ashgabat,Ashkhabad;TN:Africa/Tunis;TO:Pacific/Tongatapu;TR:Asia/Istanbul|Europe/Istanbul|Turkey;TT:America/Port_of_Spain;TV:Pacific/Funafuti;TW:Asia/Taipei|ROC;TZ:Africa/Dar_es_Salaam;UA:Europe/Kiev,Kyiv,Simferopol,Uzhgorod,Zaporozhye;UG:Africa/Kampala;UM:Pacific/Midway,Wake;US:America/Adak,Anchorage,Atka,Boise,Chicago,Denver,Detroit,Fort_Wayne,Indiana/Indianapolis,Indiana/Knox,Indiana/Marengo,Indiana/Petersburg,Indiana/Tell_City,Indiana/Vevay,Indiana/Vincennes,Indiana/Winamac,Indianapolis,Juneau,Kentucky/Louisville,Kentucky/Monticello,Knox_IN,Los_Angeles,Louisville,Menominee,Metlakatla,New_York,Nome,North_Dakota/Beulah,North_Dakota/Center,North_Dakota/New_Salem,Phoenix,Shiprock,Sitka,Yakutat|HST,MST,Navajo|Pacific/Honolulu,Johnston|US/Alaska,Aleutian,Arizona,Central,East-Indiana,Eastern,Hawaii,Indiana-Starke,Michigan,Mountain,Pacific;UY:America/Montevideo;UZ:Asia/Samarkand,Tashkent;VA:Europe/Vatican;VC:America/St_Vincent;VE:America/Caracas;VG:America/Tortola;VI:America/St_Thomas;VN:Asia/Ho_Chi_Minh,Saigon;VU:Pacific/Efate;WF:Pacific/Wallis;WS:Pacific/Apia;YE:Asia/Aden;YT:Indian/Mayotte;ZA:Africa/Johannesburg;ZM:Africa/Lusaka;ZW:Africa/Harare";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*! @zoho_apptics/apptics-js-sdk v2.0.0-beta.2 | (c) Zoho Corporation Private Limited | see LICENSE */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The country of every IANA time zone, by its ISO 3166 code: generated by
|
|
6
|
+
* scripts/tz-countries.mjs from tzdata 2026d-rearguard (zone.tab, and the old names its links keep).
|
|
7
|
+
* Do not edit by hand.
|
|
8
|
+
*
|
|
9
|
+
* Packed as "CC:Area/City,City|Area/City;CC:...": a country, then its zones grouped by area.
|
|
10
|
+
*/
|
|
11
|
+
const TZ_COUNTRIES = 'AD:Europe/Andorra;AE:Asia/Dubai;AF:Asia/Kabul;AG:America/Antigua;AI:America/Anguilla;AL:Europe/Tirane;AM:Asia/Yerevan;AO:Africa/Luanda;AQ:Antarctica/Casey,Davis,DumontDUrville,Mawson,McMurdo,Palmer,Rothera,Syowa,Troll,Vostok;AR:America/Argentina/Buenos_Aires,Argentina/Catamarca,Argentina/ComodRivadavia,Argentina/Cordoba,Argentina/Jujuy,Argentina/La_Rioja,Argentina/Mendoza,Argentina/Rio_Gallegos,Argentina/Salta,Argentina/San_Juan,Argentina/San_Luis,Argentina/Tucuman,Argentina/Ushuaia,Buenos_Aires,Catamarca,Cordoba,Jujuy,Mendoza,Rosario;AS:Pacific/Pago_Pago,Samoa|US/Samoa;AT:Europe/Vienna;AU:Antarctica/Macquarie|Australia/ACT,Adelaide,Brisbane,Broken_Hill,Canberra,Currie,Darwin,Eucla,Hobart,LHI,Lindeman,Lord_Howe,Melbourne,NSW,North,Perth,Queensland,South,Sydney,Tasmania,Victoria,West,Yancowinna;AW:America/Aruba;AX:Europe/Mariehamn;AZ:Asia/Baku;BA:Europe/Sarajevo;BB:America/Barbados;BD:Asia/Dacca,Dhaka;BE:CET,MET|Europe/Brussels;BF:Africa/Ouagadougou;BG:Europe/Sofia;BH:Asia/Bahrain;BI:Africa/Bujumbura;BJ:Africa/Porto-Novo;BL:America/St_Barthelemy;BM:Atlantic/Bermuda;BN:Asia/Brunei;BO:America/La_Paz;BQ:America/Kralendijk;BR:America/Araguaina,Bahia,Belem,Boa_Vista,Campo_Grande,Cuiaba,Eirunepe,Fortaleza,Maceio,Manaus,Noronha,Porto_Acre,Porto_Velho,Recife,Rio_Branco,Santarem,Sao_Paulo|Brazil/Acre,DeNoronha,East,West;BS:America/Nassau;BT:Asia/Thimbu,Thimphu;BW:Africa/Gaborone;BY:Europe/Minsk;BZ:America/Belize;CA:America/Atikokan,Blanc-Sablon,Cambridge_Bay,Creston,Dawson,Dawson_Creek,Edmonton,Fort_Nelson,Glace_Bay,Goose_Bay,Halifax,Inuvik,Iqaluit,Moncton,Montreal,Nipigon,Pangnirtung,Rainy_River,Rankin_Inlet,Regina,Resolute,St_Johns,Swift_Current,Thunder_Bay,Toronto,Vancouver,Whitehorse,Winnipeg,Yellowknife|Canada/Atlantic,Central,Eastern,Mountain,Newfoundland,Pacific,Saskatchewan,Yukon;CC:Indian/Cocos;CD:Africa/Kinshasa,Lubumbashi;CF:Africa/Bangui;CG:Africa/Brazzaville;CH:Europe/Zurich;CI:Africa/Abidjan,Timbuktu|Iceland;CK:Pacific/Rarotonga;CL:America/Coyhaique,Punta_Arenas,Santiago|Chile/Continental,EasterIsland|Pacific/Easter;CM:Africa/Douala;CN:Asia/Chongqing,Chungking,Harbin,Kashgar,Shanghai,Urumqi|PRC;CO:America/Bogota;CR:America/Costa_Rica;CU:America/Havana|Cuba;CV:Atlantic/Cape_Verde;CW:America/Curacao;CX:Indian/Christmas;CY:Asia/Famagusta,Nicosia|Europe/Nicosia;CZ:Europe/Prague;DE:Atlantic/Jan_Mayen|Europe/Berlin,Busingen;DJ:Africa/Djibouti;DK:Europe/Copenhagen;DM:America/Dominica;DO:America/Santo_Domingo;DZ:Africa/Algiers;EC:America/Guayaquil|Pacific/Galapagos;EE:Europe/Tallinn;EG:Africa/Cairo|Egypt;EH:Africa/El_Aaiun;ER:Africa/Asmara;ES:Africa/Ceuta|Atlantic/Canary|Europe/Madrid;ET:Africa/Addis_Ababa;FI:Europe/Helsinki;FJ:Pacific/Fiji;FK:Atlantic/Stanley;FM:Pacific/Chuuk,Kosrae,Pohnpei;FO:Atlantic/Faeroe,Faroe;FR:Europe/Paris;GA:Africa/Libreville;GB:Europe/Belfast,London|GB,GB-Eire;GD:America/Grenada;GE:Asia/Tbilisi;GF:America/Cayenne;GG:Europe/Guernsey;GH:Africa/Accra;GI:Europe/Gibraltar;GL:America/Danmarkshavn,Godthab,Nuuk,Scoresbysund,Thule;GM:Africa/Banjul;GN:Africa/Conakry;GP:America/Guadeloupe;GQ:Africa/Malabo;GR:EET|Europe/Athens;GS:Atlantic/South_Georgia;GT:America/Guatemala;GU:Pacific/Guam;GW:Africa/Bissau;GY:America/Guyana;HK:Asia/Hong_Kong|Hongkong;HN:America/Tegucigalpa;HR:Europe/Zagreb;HT:America/Port-au-Prince;HU:Europe/Budapest;ID:Asia/Jakarta,Jayapura,Makassar,Pontianak,Ujung_Pandang;IE:Eire|Europe/Dublin;IL:Asia/Jerusalem,Tel_Aviv|Israel;IM:Europe/Isle_of_Man;IN:Asia/Calcutta,Kolkata;IO:Indian/Chagos;IQ:Asia/Baghdad;IR:Asia/Tehran|Iran;IS:Atlantic/Reykjavik;IT:Europe/Rome;JE:Europe/Jersey;JM:America/Jamaica|Jamaica;JO:Asia/Amman;JP:Asia/Tokyo|Japan;KE:Africa/Asmera,Nairobi;KG:Asia/Bishkek;KH:Asia/Phnom_Penh;KI:Pacific/Enderbury,Kanton,Kiritimati,Tarawa;KM:Indian/Comoro;KN:America/St_Kitts;KP:Asia/Pyongyang;KR:Asia/Seoul|ROK;KW:Asia/Kuwait;KY:America/Cayman;KZ:Asia/Almaty,Aqtau,Aqtobe,Atyrau,Oral,Qostanay,Qyzylorda;LA:Asia/Vientiane;LB:Asia/Beirut;LC:America/St_Lucia;LI:Europe/Vaduz;LK:Asia/Colombo;LR:Africa/Monrovia;LS:Africa/Maseru;LT:Europe/Vilnius;LU:Europe/Luxembourg;LV:Europe/Riga;LY:Africa/Tripoli|Libya;MA:Africa/Casablanca;MC:Europe/Monaco;MD:Europe/Chisinau,Tiraspol;ME:Europe/Podgorica;MF:America/Marigot;MG:Indian/Antananarivo;MH:Kwajalein|Pacific/Kwajalein,Majuro;MK:Europe/Skopje;ML:Africa/Bamako;MM:Asia/Rangoon,Yangon;MN:Asia/Choibalsan,Hovd,Ulaanbaatar,Ulan_Bator;MO:Asia/Macao,Macau;MP:Pacific/Saipan;MQ:America/Martinique;MR:Africa/Nouakchott;MS:America/Montserrat;MT:Europe/Malta;MU:Indian/Mauritius;MV:Indian/Maldives;MW:Africa/Blantyre;MX:America/Bahia_Banderas,Cancun,Chihuahua,Ciudad_Juarez,Ensenada,Hermosillo,Matamoros,Mazatlan,Merida,Mexico_City,Monterrey,Ojinaga,Santa_Isabel,Tijuana|Mexico/BajaNorte,BajaSur,General;MY:Asia/Kuala_Lumpur,Kuching;MZ:Africa/Maputo;NA:Africa/Windhoek;NC:Pacific/Noumea;NE:Africa/Niamey;NF:Pacific/Norfolk;NG:Africa/Lagos;NI:America/Managua;NL:Europe/Amsterdam;NO:Europe/Oslo;NP:Asia/Kathmandu,Katmandu;NR:Pacific/Nauru;NU:Pacific/Niue;NZ:Antarctica/South_Pole|NZ,NZ-CHAT|Pacific/Auckland,Chatham;OM:Asia/Muscat;PA:America/Coral_Harbour,Panama|EST;PE:America/Lima;PF:Pacific/Gambier,Marquesas,Tahiti;PG:Pacific/Bougainville,Port_Moresby,Truk,Yap;PH:Asia/Manila;PK:Asia/Karachi;PL:Europe/Warsaw|Poland;PM:America/Miquelon;PN:Pacific/Pitcairn;PR:America/Puerto_Rico,Virgin;PS:Asia/Gaza,Hebron;PT:Atlantic/Azores,Madeira|Europe/Lisbon|Portugal,WET;PW:Pacific/Palau;PY:America/Asuncion;QA:Asia/Qatar;RE:Indian/Reunion;RO:Europe/Bucharest;RS:Europe/Belgrade;RU:Asia/Anadyr,Barnaul,Chita,Irkutsk,Kamchatka,Khandyga,Krasnoyarsk,Magadan,Novokuznetsk,Novosibirsk,Omsk,Sakhalin,Srednekolymsk,Tomsk,Ust-Nera,Vladivostok,Yakutsk,Yekaterinburg|Europe/Astrakhan,Kaliningrad,Kirov,Moscow,Samara,Saratov,Ulyanovsk,Volgograd|W-SU;RW:Africa/Kigali;SA:Asia/Riyadh;SB:Pacific/Guadalcanal,Ponape;SC:Indian/Mahe;SD:Africa/Khartoum;SE:Europe/Stockholm;SG:Asia/Singapore|Singapore;SH:Atlantic/St_Helena;SI:Europe/Ljubljana;SJ:Arctic/Longyearbyen;SK:Europe/Bratislava;SL:Africa/Freetown;SM:Europe/San_Marino;SN:Africa/Dakar;SO:Africa/Mogadishu;SR:America/Paramaribo;SS:Africa/Juba;ST:Africa/Sao_Tome;SV:America/El_Salvador;SX:America/Lower_Princes;SY:Asia/Damascus;SZ:Africa/Mbabane;TC:America/Grand_Turk;TD:Africa/Ndjamena;TF:Indian/Kerguelen;TG:Africa/Lome;TH:Asia/Bangkok;TJ:Asia/Dushanbe;TK:Pacific/Fakaofo;TL:Asia/Dili;TM:Asia/Ashgabat,Ashkhabad;TN:Africa/Tunis;TO:Pacific/Tongatapu;TR:Asia/Istanbul|Europe/Istanbul|Turkey;TT:America/Port_of_Spain;TV:Pacific/Funafuti;TW:Asia/Taipei|ROC;TZ:Africa/Dar_es_Salaam;UA:Europe/Kiev,Kyiv,Simferopol,Uzhgorod,Zaporozhye;UG:Africa/Kampala;UM:Pacific/Midway,Wake;US:America/Adak,Anchorage,Atka,Boise,Chicago,Denver,Detroit,Fort_Wayne,Indiana/Indianapolis,Indiana/Knox,Indiana/Marengo,Indiana/Petersburg,Indiana/Tell_City,Indiana/Vevay,Indiana/Vincennes,Indiana/Winamac,Indianapolis,Juneau,Kentucky/Louisville,Kentucky/Monticello,Knox_IN,Los_Angeles,Louisville,Menominee,Metlakatla,New_York,Nome,North_Dakota/Beulah,North_Dakota/Center,North_Dakota/New_Salem,Phoenix,Shiprock,Sitka,Yakutat|HST,MST,Navajo|Pacific/Honolulu,Johnston|US/Alaska,Aleutian,Arizona,Central,East-Indiana,Eastern,Hawaii,Indiana-Starke,Michigan,Mountain,Pacific;UY:America/Montevideo;UZ:Asia/Samarkand,Tashkent;VA:Europe/Vatican;VC:America/St_Vincent;VE:America/Caracas;VG:America/Tortola;VI:America/St_Thomas;VN:Asia/Ho_Chi_Minh,Saigon;VU:Pacific/Efate;WF:Pacific/Wallis;WS:Pacific/Apia;YE:Asia/Aden;YT:Indian/Mayotte;ZA:Africa/Johannesburg;ZM:Africa/Lusaka;ZW:Africa/Harare'; // no i18n
|
|
12
|
+
|
|
13
|
+
exports.TZ_COUNTRIES = TZ_COUNTRIES;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where
|
|
2
|
+
* Where in the app an AppticsLogger line was written, for logSDK's `filename`, `linenumber` and
|
|
3
|
+
* `function`: the Remote Logger page shows each line with them.
|
|
3
4
|
*
|
|
4
5
|
* There is no caller introspection in a browser, so the only way to answer "which line was this"
|
|
5
|
-
* is to
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* is to make an Error and read its stack, skipping the SDK's own frames. That costs a little on
|
|
7
|
+
* every line the app logs, and nothing on any other call. Everything here is wrapped so a stack
|
|
8
|
+
* that cannot be parsed costs a line its call site and nothing more: the line is still logged.
|
|
8
9
|
*/
|
|
9
10
|
export interface CallSite {
|
|
10
11
|
/** The script's basename, not its url: logSDK caps filename at 100 characters. */
|
|
@@ -15,6 +16,12 @@ export interface CallSite {
|
|
|
15
16
|
fn?: string;
|
|
16
17
|
}
|
|
17
18
|
export declare const NO_CALL_SITE: CallSite;
|
|
19
|
+
/**
|
|
20
|
+
* A call typed in the browser's developer console: there is no file, line or function to report,
|
|
21
|
+
* only the console's own placeholder for its input, so the line says plainly that it came from
|
|
22
|
+
* nowhere in the app. file_name and the function field both accept `-`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CONSOLE_CALL_SITE: CallSite;
|
|
18
25
|
/**
|
|
19
26
|
* The frame `skip` frames down a stack, counting only the ones that name a file — V8 heads its
|
|
20
27
|
* stacks with an `Error` line and Firefox does not, so counting raw lines would read a different
|
|
@@ -1,15 +1,32 @@
|
|
|
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
|
/**
|
|
5
|
-
* Where
|
|
5
|
+
* Where in the app an AppticsLogger line was written, for logSDK's `filename`, `linenumber` and
|
|
6
|
+
* `function`: the Remote Logger page shows each line with them.
|
|
6
7
|
*
|
|
7
8
|
* There is no caller introspection in a browser, so the only way to answer "which line was this"
|
|
8
|
-
* is to
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* is to make an Error and read its stack, skipping the SDK's own frames. That costs a little on
|
|
10
|
+
* every line the app logs, and nothing on any other call. Everything here is wrapped so a stack
|
|
11
|
+
* that cannot be parsed costs a line its call site and nothing more: the line is still logged.
|
|
11
12
|
*/
|
|
12
13
|
const NO_CALL_SITE = { filename: '', linenumber: 0, fn: '' };
|
|
14
|
+
/**
|
|
15
|
+
* A call typed in the browser's developer console: there is no file, line or function to report,
|
|
16
|
+
* only the console's own placeholder for its input, so the line says plainly that it came from
|
|
17
|
+
* nowhere in the app. file_name and the function field both accept `-`.
|
|
18
|
+
*/
|
|
19
|
+
const CONSOLE_CALL_SITE = { filename: '-', linenumber: 0, fn: '-' };
|
|
20
|
+
/**
|
|
21
|
+
* The frame of code run from the developer console, in each browser:
|
|
22
|
+
* V8 (Chrome, Edge): ` at <anonymous>:1:15` (the file is <anonymous>)
|
|
23
|
+
* Firefox: `@debugger eval code:1:15`
|
|
24
|
+
* Safari: `global code` or `eval code`, with no location at all
|
|
25
|
+
* V8 names a string run through eval or new Function <anonymous> too; it is no file either.
|
|
26
|
+
*/
|
|
27
|
+
const CONSOLE_FILE_V8 = '<anonymous>'; // no i18n
|
|
28
|
+
const CONSOLE_FIREFOX = /debugger eval code/; // no i18n
|
|
29
|
+
const CONSOLE_SAFARI = /^(global|eval) code(@|$)/; // no i18n
|
|
13
30
|
/** logSDK declares max-len="100" on filename. */
|
|
14
31
|
const FILENAME_MAX = 100;
|
|
15
32
|
/**
|
|
@@ -63,14 +80,19 @@ function callSiteFromStack(stack, skip) {
|
|
|
63
80
|
var lines = stack.split('\n');
|
|
64
81
|
var seen = 0;
|
|
65
82
|
for (var i = 0; i < lines.length; i++) {
|
|
66
|
-
var
|
|
83
|
+
var raw = (lines[i] || '').trim(); // no i18n
|
|
84
|
+
var frame = parseFrame(raw);
|
|
67
85
|
if (frame === null) {
|
|
86
|
+
// Safari's console frame has no location, so it is never a frame parseFrame reads
|
|
87
|
+
if (seen === skip && CONSOLE_SAFARI.test(raw)) {
|
|
88
|
+
return CONSOLE_CALL_SITE;
|
|
89
|
+
}
|
|
68
90
|
continue;
|
|
69
91
|
}
|
|
70
92
|
if (seen++ < skip) {
|
|
71
93
|
continue;
|
|
72
94
|
}
|
|
73
|
-
return frame;
|
|
95
|
+
return frame.filename === CONSOLE_FILE_V8 || CONSOLE_FIREFOX.test(raw) ? CONSOLE_CALL_SITE : frame;
|
|
74
96
|
}
|
|
75
97
|
return NO_CALL_SITE;
|
|
76
98
|
}
|
|
@@ -88,6 +110,7 @@ function callSite(skip) {
|
|
|
88
110
|
}
|
|
89
111
|
}
|
|
90
112
|
|
|
113
|
+
exports.CONSOLE_CALL_SITE = CONSOLE_CALL_SITE;
|
|
91
114
|
exports.NO_CALL_SITE = NO_CALL_SITE;
|
|
92
115
|
exports.callSite = callSite;
|
|
93
116
|
exports.callSiteFromStack = callSiteFromStack;
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
/** The SDK's own diagnostics may be recorded: `remote_log` is on and the logger is reachable. */
|
|
4
|
-
export declare function remoteLogEnabled(): boolean;
|
|
5
|
-
/** An app's own log line may be recorded: the app enabled the logger and it is reachable. */
|
|
6
|
-
export declare function appLogEnabled(): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* What is stored may be sent. Either writer is enough: app logging works with `remote_log`
|
|
9
|
-
* off, since that switch covers only the SDK's own diagnostics.
|
|
10
|
-
*/
|
|
11
|
-
export declare function remoteLogSendable(): boolean;
|
|
1
|
+
/** Whether a remote log line may be recorded and sent now. */
|
|
2
|
+
export declare function remoteLoggerReachable(): boolean;
|
|
@@ -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 state = require('../core/state.js');
|
|
@@ -6,21 +6,14 @@ var env = require('../core/env.js');
|
|
|
6
6
|
var consent = require('../core/consent.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* The one switch both halves of the remote logger ask: may this line be recorded, and may
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
appLoggerOn = on;
|
|
16
|
-
}
|
|
17
|
-
function appLoggerEnabled() {
|
|
18
|
-
return appLoggerOn;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* What every remote-log line needs, whoever wrote it: a running SDK, a client we send anything
|
|
22
|
-
* for, the server's remote logger switch, and consent.
|
|
9
|
+
* The one switch both halves of the remote logger ask: may this line be recorded, and may what is
|
|
10
|
+
* stored be sent? It lives on its own so recording and sending don't import each other.
|
|
11
|
+
*
|
|
12
|
+
* There is no switch of the app's own: a line the app writes with AppticsLogger is recorded,
|
|
13
|
+
* whenever the SDK is running, the server has the remote logger on for the app, and the visitor
|
|
14
|
+
* allows tracking.
|
|
23
15
|
*/
|
|
16
|
+
/** Whether a remote log line may be recorded and sent now. */
|
|
24
17
|
function remoteLoggerReachable() {
|
|
25
18
|
if (!state._ZAP._token || env.is_apptics_disabled()) {
|
|
26
19
|
return false;
|
|
@@ -31,24 +24,5 @@ function remoteLoggerReachable() {
|
|
|
31
24
|
}
|
|
32
25
|
return consent.shouldTrackOrSendData();
|
|
33
26
|
}
|
|
34
|
-
/** The SDK's own diagnostics may be recorded: `remote_log` is on and the logger is reachable. */
|
|
35
|
-
function remoteLogEnabled() {
|
|
36
|
-
return state.getConfig('remote_log') && remoteLoggerReachable(); // no i18n
|
|
37
|
-
}
|
|
38
|
-
/** An app's own log line may be recorded: the app enabled the logger and it is reachable. */
|
|
39
|
-
function appLogEnabled() {
|
|
40
|
-
return appLoggerOn && remoteLoggerReachable();
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* What is stored may be sent. Either writer is enough: app logging works with `remote_log`
|
|
44
|
-
* off, since that switch covers only the SDK's own diagnostics.
|
|
45
|
-
*/
|
|
46
|
-
function remoteLogSendable() {
|
|
47
|
-
return (state.getConfig('remote_log') || appLoggerOn) && remoteLoggerReachable(); // no i18n
|
|
48
|
-
}
|
|
49
27
|
|
|
50
|
-
exports.
|
|
51
|
-
exports.appLoggerEnabled = appLoggerEnabled;
|
|
52
|
-
exports.remoteLogEnabled = remoteLogEnabled;
|
|
53
|
-
exports.remoteLogSendable = remoteLogSendable;
|
|
54
|
-
exports.setAppLogger = setAppLogger;
|
|
28
|
+
exports.remoteLoggerReachable = remoteLoggerReachable;
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Remote logger: the
|
|
2
|
+
* Remote logger delivery: the AppticsLogger lines (logger.ts) are stored in the remotelogs queue
|
|
3
|
+
* and sent from it to log/add by send.ts. gate.ts holds the switch both ask.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* actually doing on the user's machine?", so what it carries is the SDK's own failures, each
|
|
7
|
-
* tagged with the module that was mid-flight (Session, Screen, Event, API, Properties).
|
|
8
|
-
* App errors belong to exception/error, an app's remote log lines to logger.ts, and lines meant
|
|
9
|
-
* for a feedback report to feedback/logs.ts.
|
|
10
|
-
*
|
|
11
|
-
* This file records lines, send.ts delivers them, and gate.ts holds the switch both ask.
|
|
12
|
-
* Nothing here is exported to apps: the SDK writes these lines itself, through logFailure()
|
|
13
|
-
* in core/logger.ts.
|
|
14
|
-
*/
|
|
15
|
-
import { AP_LOG_MODULE } from '../core/constants.js';
|
|
16
|
-
import { type CallSite } from '../core/callsite.js';
|
|
17
|
-
/** One of console/addlog's `module` values. */
|
|
18
|
-
export type LogModule = (typeof AP_LOG_MODULE)[keyof typeof AP_LOG_MODULE];
|
|
19
|
-
/**
|
|
20
|
-
* Records one line about `module` for console/addlog. Never throws and never blocks the caller:
|
|
21
|
-
* a diagnostics channel that breaks the flow it reports on would be worse than no channel.
|
|
5
|
+
* The SDK writes nothing of its own here: its failures go to the browser console (core/logger.ts,
|
|
6
|
+
* in debug mode), and only the lines an app logs reach the Remote Logger page.
|
|
22
7
|
*/
|
|
23
|
-
export declare function remoteLog(module: LogModule, message: unknown, site?: CallSite): void;
|
|
24
|
-
export { remoteLogEnabled } from './gate.js';
|
|
25
8
|
export { forgetStoredLogs, sendStoredLogs } from './send.js';
|
|
@@ -7,22 +7,16 @@ export declare const LOG_LEVEL: Readonly<{
|
|
|
7
7
|
ERROR: 5;
|
|
8
8
|
}>;
|
|
9
9
|
export interface AppticsLogger {
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** Info, level 3. */
|
|
21
|
-
i(tag: string, message: unknown, ...details: unknown[]): void;
|
|
22
|
-
/** Warning, level 4. */
|
|
23
|
-
w(tag: string, message: unknown, ...details: unknown[]): void;
|
|
24
|
-
/** Error, level 5. */
|
|
25
|
-
e(tag: string, message: unknown, ...details: unknown[]): void;
|
|
10
|
+
/** Verbose, level 1 (Android's v). `properties` (an object, as JSON; an Error, as its stack) is appended to the message. */
|
|
11
|
+
verbose(message: unknown, properties?: unknown): void;
|
|
12
|
+
/** Debug, level 2 (Android's d). */
|
|
13
|
+
debug(message: unknown, properties?: unknown): void;
|
|
14
|
+
/** Info, level 3 (Android's i). */
|
|
15
|
+
info(message: unknown, properties?: unknown): void;
|
|
16
|
+
/** Warning, level 4 (Android's w). */
|
|
17
|
+
warn(message: unknown, properties?: unknown): void;
|
|
18
|
+
/** Error, level 5 (Android's e). */
|
|
19
|
+
error(message: unknown, properties?: unknown): void;
|
|
26
20
|
}
|
|
27
|
-
/**
|
|
21
|
+
/** AppticsLogger: verbose / debug / info / warn / error(message, properties?). */
|
|
28
22
|
export declare const AppticsLogger: AppticsLogger;
|
|
@@ -1,30 +1,26 @@
|
|
|
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');
|
|
5
|
-
var callsite = require('
|
|
5
|
+
var callsite = require('./callsite.js');
|
|
6
6
|
var storage = require('../core/storage.js');
|
|
7
7
|
var guard = require('../core/guard.js');
|
|
8
8
|
var utils = require('../core/utils.js');
|
|
9
|
-
var state = require('../core/state.js');
|
|
10
9
|
var gate = require('./gate.js');
|
|
11
10
|
var send = require('./send.js');
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
|
-
* AppticsLogger
|
|
13
|
+
* AppticsLogger: lines the app writes, shown on the console's Remote Logger page.
|
|
15
14
|
*
|
|
16
|
-
* AppticsLogger.
|
|
17
|
-
* AppticsLogger.
|
|
18
|
-
* AppticsLogger.e('Checkout', 'Payment failed', err);
|
|
15
|
+
* AppticsLogger.info('Payment started');
|
|
16
|
+
* AppticsLogger.error('Payment failed', err);
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* Nothing is logged on its own: only the lines the app writes, at five levels in the native SDKs'
|
|
19
|
+
* order (verbose, debug, info, warn, error, sent as 1 to 5, the scale the Remote Logger page reads
|
|
20
|
+
* back). A line is recorded as it is written, with no switch to turn on first, whenever the server
|
|
21
|
+
* has the remote logger on for the app and the visitor allows tracking.
|
|
24
22
|
*
|
|
25
|
-
* Lines
|
|
26
|
-
* they are sent and survive a failed send and a reload. They are a separate switch, though:
|
|
27
|
-
* `remote_log: false` silences the SDK's own failures, not the app's logging.
|
|
23
|
+
* Lines are stored before they are sent (send.ts), so they survive a failed send and a reload.
|
|
28
24
|
*/
|
|
29
25
|
/** The level numbers log/add takes and the Remote Logger page names, in the native SDKs' order. */
|
|
30
26
|
const LOG_LEVEL = Object.freeze({ VERBOSE: 1, DEBUG: 2, INFO: 3, WARN: 4, ERROR: 5 });
|
|
@@ -63,11 +59,12 @@ function describe(value) {
|
|
|
63
59
|
* it — which is why the time and call site are taken by the caller, not here.
|
|
64
60
|
*/
|
|
65
61
|
function record(level, message, details, at, site) {
|
|
66
|
-
if (!gate.
|
|
62
|
+
if (!gate.remoteLoggerReachable()) {
|
|
67
63
|
return;
|
|
68
64
|
}
|
|
69
65
|
var text = [message].concat(details).map(describe).join(' '); // no i18n
|
|
70
|
-
storage.
|
|
66
|
+
storage.remotelog_transactions.add({
|
|
67
|
+
type: 'remotelog', // no i18n
|
|
71
68
|
module: functionName(site),
|
|
72
69
|
level: level,
|
|
73
70
|
happenedat: at,
|
|
@@ -79,60 +76,35 @@ function record(level, message, details, at, site) {
|
|
|
79
76
|
send.scheduleSend();
|
|
80
77
|
}
|
|
81
78
|
const recordLine = guard.guard('AppticsLogger', record); // no i18n
|
|
82
|
-
/** The browser console method each level prints with under `show_logs`, as Logcat shows them. */
|
|
83
|
-
const CONSOLE_METHOD = Object.freeze({
|
|
84
|
-
1: 'debug', 2: 'debug', 3: 'info', 4: 'warn', 5: 'error', // no i18n
|
|
85
|
-
});
|
|
86
79
|
/**
|
|
87
|
-
*
|
|
88
|
-
* the
|
|
89
|
-
*
|
|
80
|
+
* A level's method, `verbose/debug/info/warn/error(message, properties?)` (Android's v/d/i/w/e,
|
|
81
|
+
* without the tag, which the Remote Logger page does not use). The function, file and line are
|
|
82
|
+
* the caller's.
|
|
90
83
|
*/
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
var method = CONSOLE_METHOD[level] || 'log'; // no i18n
|
|
96
|
-
if (typeof console !== 'undefined' && typeof console[method] === 'function') { // no i18n
|
|
97
|
-
console[method].apply(console, args);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* A level's Android-style method, `v/d/i/w/e(tag, message, ...details)`. The tag leads the
|
|
102
|
-
* message as `[tag]`; the function, file and line are still the caller's, as with the long names.
|
|
103
|
-
*/
|
|
104
|
-
function tagged(level) {
|
|
105
|
-
return function (tag, message, ...details) {
|
|
84
|
+
function atLevel(level) {
|
|
85
|
+
return function log(message, properties) {
|
|
106
86
|
try {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
void properties;
|
|
88
|
+
// everything after the message is appended to it: properties, and anything else a caller
|
|
89
|
+
// passed (an Error as well, say), as before
|
|
90
|
+
var details = Array.prototype.slice.call(arguments, 1);
|
|
110
91
|
// skip 1: this function's own frame, so the site is the app's line that logged
|
|
111
|
-
recordLine(level,
|
|
92
|
+
recordLine(level, message, details, utils.nowMs(), callsite.callSite(1));
|
|
112
93
|
}
|
|
113
94
|
catch (err) {
|
|
114
95
|
// logging must never be the thing that breaks the app
|
|
115
96
|
}
|
|
116
97
|
};
|
|
117
98
|
}
|
|
118
|
-
/**
|
|
119
|
-
function enable(on) {
|
|
120
|
-
gate.setAppLogger(on !== false);
|
|
121
|
-
}
|
|
122
|
-
/** Turns the app logger off, as AppticsLogger.disable() does; the same as enable(false). */
|
|
123
|
-
function disable() {
|
|
124
|
-
gate.setAppLogger(false);
|
|
125
|
-
}
|
|
126
|
-
/** Android's AppticsLogger: enable, disable, isEnabled and v / d / i / w / e(tag, message). */
|
|
99
|
+
/** AppticsLogger: verbose / debug / info / warn / error(message, properties?). */
|
|
127
100
|
const AppticsLogger = {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
e: tagged(LOG_LEVEL.ERROR),
|
|
101
|
+
// not wrapped in a guard of their own: the call site is read a fixed number of frames up, and
|
|
102
|
+
// a frame more would report the SDK's own line instead of the app's
|
|
103
|
+
verbose: atLevel(LOG_LEVEL.VERBOSE),
|
|
104
|
+
debug: atLevel(LOG_LEVEL.DEBUG),
|
|
105
|
+
info: atLevel(LOG_LEVEL.INFO),
|
|
106
|
+
warn: atLevel(LOG_LEVEL.WARN),
|
|
107
|
+
error: atLevel(LOG_LEVEL.ERROR),
|
|
136
108
|
};
|
|
137
109
|
|
|
138
110
|
exports.AppticsLogger = AppticsLogger;
|