@braze/web-sdk 4.9.0 → 4.10.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.
- package/index.d.ts +2289 -2228
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +1 -1
- package/shared-lib/event-types.js +9 -9
- package/shared-lib/indexed-db-adapter.js +1 -1
- package/shared-lib/logger.js +2 -2
- package/shared-lib/supported-options.js +5 -4
- package/src/Core/get-device-id.js +9 -7
- package/src/User/user.js +10 -9
- package/src/managers/braze-instance.js +68 -66
- package/src/managers/device-manager.js +15 -15
- package/src/managers/network-manager.js +64 -61
- package/src/managers/session-manager.js +1 -1
- package/src/managers/storage-manager-factory.js +8 -8
- package/src/managers/storage-manager.js +15 -15
- package/src/managers/subscription-manager.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +2 -2
- package/src/models/device.js +1 -1
- package/src/models/server-config.js +2 -2
- package/src/request-controller.js +112 -108
- package/src/triggers/models/filter.js +7 -7
- package/src/triggers/models/trigger-condition.js +17 -17
- package/src/triggers/models/trigger.js +25 -25
- package/src/triggers/triggers-provider.js +21 -21
- package/src/ui/js/attach-css.js +1 -1
- package/src/ui/js/load-font-awesome.js +1 -1
- package/src/util/base-device-parser.js +1 -1
- package/src/util/browser-detector.js +5 -5
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/date-utils.js +2 -2
- package/src/util/device-constants.js +1 -1
- package/src/util/dom-utils.js +5 -5
- package/src/util/net.js +1 -1
- package/src/util/request-header-utils.js +14 -14
- package/src/util/user-agent-parser.js +5 -5
- package/src/util/validation-utils.js +9 -9
|
@@ -10,48 +10,51 @@ import r from "../../shared-lib/braze-shared-lib.js";
|
|
|
10
10
|
import { STORAGE_KEYS as i } from "./storage-manager.js";
|
|
11
11
|
import T from "../util/request-header-utils.js";
|
|
12
12
|
import { LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT as Ht } from "../common/constants.js";
|
|
13
|
-
export default class
|
|
14
|
-
constructor(t, e, s, i, r, o, n,
|
|
13
|
+
export default class Rt {
|
|
14
|
+
constructor(t, e, s, i, r, o, n, h, a, u, c, l) {
|
|
15
15
|
(this.fn = t),
|
|
16
16
|
(this.u = e),
|
|
17
|
-
(this.
|
|
17
|
+
(this.Uo = s),
|
|
18
18
|
(this.ft = i),
|
|
19
19
|
(this._e = r),
|
|
20
20
|
(this.wt = o),
|
|
21
21
|
(this.cn = n),
|
|
22
|
-
(this.
|
|
23
|
-
(this.
|
|
24
|
-
(this.
|
|
22
|
+
(this.Bo = h),
|
|
23
|
+
(this.jo = a),
|
|
24
|
+
(this.Do = u),
|
|
25
25
|
(this.appVersion = c),
|
|
26
|
+
(this.Xh = l),
|
|
26
27
|
(this.fn = t),
|
|
27
28
|
(this.u = e),
|
|
28
|
-
(this.
|
|
29
|
+
(this.Uo = s),
|
|
29
30
|
(this.ft = i),
|
|
30
31
|
(this._e = r),
|
|
31
32
|
(this.wt = o),
|
|
32
33
|
(this.cn = n),
|
|
33
|
-
(this.
|
|
34
|
-
(this.
|
|
35
|
-
(this.
|
|
34
|
+
(this.Bo = h),
|
|
35
|
+
(this.jo = a),
|
|
36
|
+
(this.Do = u),
|
|
36
37
|
(this.appVersion = c),
|
|
37
|
-
(this.
|
|
38
|
+
(this.Xh = l),
|
|
39
|
+
(this.$h = ["npm"]);
|
|
38
40
|
}
|
|
39
41
|
Bs(t, e = !1, s = !1) {
|
|
40
42
|
const r = this.fn.ce(!s),
|
|
41
43
|
o = r.Kr(),
|
|
42
|
-
n = this.u.v(i.k.
|
|
44
|
+
n = this.u.v(i.k.Fa);
|
|
43
45
|
ii(n, o) || (t.device = o),
|
|
44
46
|
(t.api_key = this.cn),
|
|
45
47
|
(t.time = h(new Date().valueOf(), !0));
|
|
46
|
-
const a = this.u.v(i.k.
|
|
47
|
-
u = this.u.v(i.k.
|
|
48
|
+
const a = this.u.v(i.k.Kh) || [],
|
|
49
|
+
u = this.u.v(i.k.Wh) || "";
|
|
48
50
|
if (
|
|
49
|
-
(this.
|
|
50
|
-
(!ii(a, this
|
|
51
|
-
(t.sdk_metadata = this
|
|
52
|
-
(t.sdk_version = this.
|
|
53
|
-
this.
|
|
51
|
+
(this.$h.length > 0 &&
|
|
52
|
+
(!ii(a, this.$h) || u !== this._e.Yh()) &&
|
|
53
|
+
(t.sdk_metadata = this.$h),
|
|
54
|
+
(t.sdk_version = this.jo),
|
|
55
|
+
this.Do && (t.sdk_flavor = this.Do),
|
|
54
56
|
(t.app_version = this.appVersion),
|
|
57
|
+
(t.app_version_code = this.Xh),
|
|
55
58
|
(t.device_id = r.id),
|
|
56
59
|
e)
|
|
57
60
|
) {
|
|
@@ -66,7 +69,7 @@ export default class Pt {
|
|
|
66
69
|
if (!o && !n) return !0;
|
|
67
70
|
if (o) {
|
|
68
71
|
let e;
|
|
69
|
-
this.
|
|
72
|
+
this.Uo.Hh();
|
|
70
73
|
const s = { errorCode: o.error_code };
|
|
71
74
|
for (const t of i)
|
|
72
75
|
p(t) && "X-Braze-Auth-Signature" === t[0] && (s.signature = t[1]);
|
|
@@ -78,12 +81,12 @@ export default class Pt {
|
|
|
78
81
|
n
|
|
79
82
|
? ((s.reason = n), (e = `due to ${n}`))
|
|
80
83
|
: (e = `with error code ${o.error_code}.`),
|
|
81
|
-
this.
|
|
84
|
+
this.Uo.wh() ||
|
|
82
85
|
(e +=
|
|
83
86
|
' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),
|
|
84
87
|
r.j.error(`SDK Authentication failed ${e}`),
|
|
85
|
-
this
|
|
86
|
-
this.
|
|
88
|
+
this.Qh(t.events || [], t.attributes || []),
|
|
89
|
+
this.Uo.Bh(s),
|
|
87
90
|
!1
|
|
88
91
|
);
|
|
89
92
|
}
|
|
@@ -91,42 +94,42 @@ export default class Pt {
|
|
|
91
94
|
let i,
|
|
92
95
|
o = n;
|
|
93
96
|
switch (o) {
|
|
94
|
-
case qt.
|
|
97
|
+
case qt.Vh:
|
|
95
98
|
return (
|
|
96
99
|
(i = "Received successful response with empty body."),
|
|
97
100
|
s.N(r.q.qs, { e: i }),
|
|
98
101
|
r.j.info(i),
|
|
99
102
|
!1
|
|
100
103
|
);
|
|
101
|
-
case qt.
|
|
104
|
+
case qt.Zh:
|
|
102
105
|
return (
|
|
103
106
|
(i = "Received successful response with invalid JSON"),
|
|
104
107
|
s.N(r.q.qs, { e: i + ": " + e.response }),
|
|
105
108
|
r.j.info(i),
|
|
106
109
|
!1
|
|
107
110
|
);
|
|
108
|
-
case qt.
|
|
109
|
-
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.
|
|
111
|
+
case qt.Ra:
|
|
112
|
+
o = `The API key "${t.api_key}" is invalid for the baseUrl ${this.Bo}`;
|
|
110
113
|
break;
|
|
111
|
-
case qt.
|
|
114
|
+
case qt.Xa:
|
|
112
115
|
o =
|
|
113
116
|
"Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";
|
|
114
117
|
break;
|
|
115
|
-
case qt.
|
|
118
|
+
case qt.Ea:
|
|
116
119
|
o = "No device identifier. Please contact support@braze.com";
|
|
117
120
|
}
|
|
118
121
|
r.j.error("Backend error: " + o);
|
|
119
122
|
}
|
|
120
123
|
return !1;
|
|
121
124
|
}
|
|
122
|
-
|
|
125
|
+
Pa(t, e, s, i) {
|
|
123
126
|
return !!((t && 0 !== t.length) || (e && 0 !== e.length) || s || i);
|
|
124
127
|
}
|
|
125
|
-
|
|
128
|
+
$a(t, e, s, i, r = !1) {
|
|
126
129
|
const o = [],
|
|
127
130
|
n = (t) => t || "",
|
|
128
|
-
|
|
129
|
-
let
|
|
131
|
+
h = n(this.ft.getUserId());
|
|
132
|
+
let a = this.Jr(t, e);
|
|
130
133
|
const u = [],
|
|
131
134
|
c = [];
|
|
132
135
|
let l,
|
|
@@ -134,36 +137,36 @@ export default class Pt {
|
|
|
134
137
|
if (s.length > 0) {
|
|
135
138
|
const t = [];
|
|
136
139
|
for (const e of s) {
|
|
137
|
-
if (((l = e.Kr()), this.
|
|
138
|
-
if (
|
|
140
|
+
if (((l = e.Kr()), this.Uo.wh())) {
|
|
141
|
+
if (h && !l.user_id) {
|
|
139
142
|
f || (f = {}), f.events || (f.events = []), f.events.push(l);
|
|
140
143
|
continue;
|
|
141
144
|
}
|
|
142
|
-
if (n(l.user_id) !==
|
|
145
|
+
if (n(l.user_id) !== h) {
|
|
143
146
|
c.push(l);
|
|
144
147
|
continue;
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
150
|
t.push(l);
|
|
148
151
|
}
|
|
149
|
-
t.length > 0 && (
|
|
152
|
+
t.length > 0 && (a.events = t);
|
|
150
153
|
}
|
|
151
154
|
if (i.length > 0) {
|
|
152
155
|
const t = [];
|
|
153
156
|
for (const e of i)
|
|
154
|
-
e && (this.
|
|
155
|
-
t.length > 0 && (
|
|
157
|
+
e && (this.Uo.wh() && n(e.user_id) !== h ? u.push(e) : t.push(e));
|
|
158
|
+
t.length > 0 && (a.attributes = t);
|
|
156
159
|
}
|
|
157
|
-
if ((this
|
|
160
|
+
if ((this.Qh(c, u), (a = this.Bs(a, !0, r)), f)) {
|
|
158
161
|
f = this.Bs(f, !1, r);
|
|
159
|
-
const t = { requestData: f, headers: this.Hs(f, T.Os.
|
|
162
|
+
const t = { requestData: f, headers: this.Hs(f, T.Os.Na) };
|
|
160
163
|
o.push(t);
|
|
161
164
|
}
|
|
162
|
-
if (
|
|
163
|
-
const d = { requestData:
|
|
165
|
+
if (a && !this.Pa(a.events, a.attributes, t, e)) return f ? o : null;
|
|
166
|
+
const d = { requestData: a, headers: this.Hs(a, T.Os.Na) };
|
|
164
167
|
return o.push(d), o;
|
|
165
168
|
}
|
|
166
|
-
|
|
169
|
+
Qh(t, e) {
|
|
167
170
|
if (t) {
|
|
168
171
|
const e = [];
|
|
169
172
|
for (const s of t) {
|
|
@@ -172,14 +175,14 @@ export default class Pt {
|
|
|
172
175
|
}
|
|
173
176
|
this.u.bo(e);
|
|
174
177
|
}
|
|
175
|
-
if (e) for (const t of e) this.u.
|
|
178
|
+
if (e) for (const t of e) this.u.Ha(t);
|
|
176
179
|
}
|
|
177
180
|
ii(t, e) {
|
|
178
181
|
let s = "HTTP error ";
|
|
179
182
|
null != t && (s += t + " "), (s += e), r.j.error(s);
|
|
180
183
|
}
|
|
181
184
|
qr(t) {
|
|
182
|
-
return s.N(r.q.
|
|
185
|
+
return s.N(r.q.Ka, { n: t });
|
|
183
186
|
}
|
|
184
187
|
Jr(t, e, s) {
|
|
185
188
|
const i = {};
|
|
@@ -191,10 +194,10 @@ export default class Pt {
|
|
|
191
194
|
{ respond_with: i }
|
|
192
195
|
);
|
|
193
196
|
}
|
|
194
|
-
|
|
197
|
+
Ua(t) {
|
|
195
198
|
const e = new Date().valueOf();
|
|
196
199
|
let s = Ht.toString();
|
|
197
|
-
const i = T.
|
|
200
|
+
const i = T.La(this.u, t);
|
|
198
201
|
if (-1 !== i) {
|
|
199
202
|
s = (e - i).toString();
|
|
200
203
|
}
|
|
@@ -202,33 +205,33 @@ export default class Pt {
|
|
|
202
205
|
}
|
|
203
206
|
Hs(t, e, s = !1) {
|
|
204
207
|
const r = [["X-Braze-Api-Key", this.cn]],
|
|
205
|
-
o = this.
|
|
208
|
+
o = this.Ua(e);
|
|
206
209
|
r.push(["X-Braze-Last-Req-Ms-Ago", o]);
|
|
207
|
-
const n = T.
|
|
210
|
+
const n = T.Wa(this.u, e).toString();
|
|
208
211
|
r.push(["X-Braze-Req-Attempt", n]);
|
|
209
|
-
let
|
|
212
|
+
let h = !1;
|
|
210
213
|
if (
|
|
211
214
|
(null != t.respond_with &&
|
|
212
215
|
t.respond_with.triggers &&
|
|
213
|
-
(r.push(["X-Braze-TriggersRequest", "true"]), (
|
|
216
|
+
(r.push(["X-Braze-TriggersRequest", "true"]), (h = !0)),
|
|
214
217
|
null != t.respond_with &&
|
|
215
218
|
t.respond_with.feed &&
|
|
216
|
-
(r.push(["X-Braze-FeedRequest", "true"]), (
|
|
219
|
+
(r.push(["X-Braze-FeedRequest", "true"]), (h = !0)),
|
|
217
220
|
e === T.Os.Ks)
|
|
218
221
|
) {
|
|
219
222
|
r.push(["X-Braze-ContentCardsRequest", "true"]);
|
|
220
223
|
let t = this.u.v(i.k.Ls);
|
|
221
224
|
(t && s) || ((t = 0), this.u.D(i.k.Ls, t)),
|
|
222
225
|
r.push(["BRAZE-SYNC-RETRY-COUNT", t.toString()]),
|
|
223
|
-
(
|
|
226
|
+
(h = !0);
|
|
224
227
|
}
|
|
225
228
|
if (
|
|
226
229
|
(e === T.Os.Si &&
|
|
227
|
-
(r.push(["X-Braze-FeatureFlagsRequest", "true"]), (
|
|
228
|
-
|
|
229
|
-
this.
|
|
230
|
+
(r.push(["X-Braze-FeatureFlagsRequest", "true"]), (h = !0)),
|
|
231
|
+
h && r.push(["X-Braze-DataRequest", "true"]),
|
|
232
|
+
this.Uo.wh())
|
|
230
233
|
) {
|
|
231
|
-
const t = this.
|
|
234
|
+
const t = this.Uo.jh();
|
|
232
235
|
null != t && r.push(["X-Braze-Auth-Signature", t]);
|
|
233
236
|
}
|
|
234
237
|
return r;
|
|
@@ -242,12 +245,12 @@ export default class Pt {
|
|
|
242
245
|
: e();
|
|
243
246
|
}
|
|
244
247
|
ti() {
|
|
245
|
-
this.
|
|
248
|
+
this.Uo.ti();
|
|
246
249
|
}
|
|
247
250
|
Ys() {
|
|
248
|
-
return this.
|
|
251
|
+
return this.Bo;
|
|
249
252
|
}
|
|
250
253
|
addSdkMetadata(t) {
|
|
251
|
-
for (const e of t) -1 === this.
|
|
254
|
+
for (const e of t) -1 === this.$h.indexOf(e) && this.$h.push(e);
|
|
252
255
|
}
|
|
253
256
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import O, { STORAGE_KEYS as i } from "./storage-manager.js";
|
|
2
2
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
3
3
|
const Bt = {
|
|
4
|
-
|
|
4
|
+
xo: function (e, o = !1) {
|
|
5
5
|
let t = !1;
|
|
6
6
|
try {
|
|
7
7
|
if (localStorage && localStorage.getItem)
|
|
8
8
|
try {
|
|
9
|
-
localStorage.setItem(i.k.
|
|
10
|
-
localStorage.getItem(i.k.
|
|
11
|
-
(localStorage.removeItem(i.k.
|
|
9
|
+
localStorage.setItem(i.k.Qa, "true"),
|
|
10
|
+
localStorage.getItem(i.k.Qa) &&
|
|
11
|
+
(localStorage.removeItem(i.k.Qa), (t = !0));
|
|
12
12
|
} catch (e) {
|
|
13
13
|
if (
|
|
14
14
|
!(
|
|
@@ -24,12 +24,12 @@ const Bt = {
|
|
|
24
24
|
} catch (e) {
|
|
25
25
|
r.j.info("Local Storage not supported!");
|
|
26
26
|
}
|
|
27
|
-
const a = Bt.
|
|
28
|
-
n = new O.
|
|
27
|
+
const a = Bt.Ja(),
|
|
28
|
+
n = new O.Va(e, a && !o, t);
|
|
29
29
|
let c;
|
|
30
|
-
return (c = t ? new O.
|
|
30
|
+
return (c = t ? new O.Ya(e) : new O.Za()), new O(n, c);
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
Ja: function () {
|
|
33
33
|
return (
|
|
34
34
|
navigator.cookieEnabled ||
|
|
35
35
|
("cookie" in document &&
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isArray as p,
|
|
5
5
|
keys as oo,
|
|
6
6
|
validateValueIsFromEnum as H,
|
|
7
|
-
values as
|
|
7
|
+
values as Pt,
|
|
8
8
|
} from "../util/code-utils.js";
|
|
9
9
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
10
10
|
import { User } from "../User/index.js";
|
|
@@ -13,17 +13,17 @@ import { getErrorMessage as ei } from "../util/error-utils.js";
|
|
|
13
13
|
export const STORAGE_KEYS = {
|
|
14
14
|
eu: {
|
|
15
15
|
su: "ab.storage.userId",
|
|
16
|
-
|
|
16
|
+
Zo: "ab.storage.deviceId",
|
|
17
17
|
Dl: "ab.storage.sessionId",
|
|
18
18
|
},
|
|
19
19
|
k: {
|
|
20
|
-
|
|
20
|
+
Qa: "ab.test",
|
|
21
21
|
tE: "ab.storage.events",
|
|
22
22
|
eE: "ab.storage.attributes",
|
|
23
23
|
sE: "ab.storage.attributes.anonymous_user",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Fa: "ab.storage.device",
|
|
25
|
+
Kh: "ab.storage.sdk_metadata",
|
|
26
|
+
Wh: "ab.storage.session_id_for_cached_metadata",
|
|
27
27
|
Bn: "ab.storage.pushToken",
|
|
28
28
|
Bi: "ab.storage.newsFeed",
|
|
29
29
|
Ei: "ab.storage.lastNewsFeedRefresh",
|
|
@@ -59,7 +59,7 @@ export default class O {
|
|
|
59
59
|
constructor(t, e) {
|
|
60
60
|
(this.SE = t), (this._E = e), (this.SE = t), (this._E = e);
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
Jo(t) {
|
|
63
63
|
const e = oo(STORAGE_KEYS.eu),
|
|
64
64
|
s = new O.ee(t);
|
|
65
65
|
for (const t of e) s.remove(STORAGE_KEYS.eu[t]);
|
|
@@ -160,7 +160,7 @@ export default class O {
|
|
|
160
160
|
hE(t) {
|
|
161
161
|
return t || STORAGE_KEYS.k.sE;
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
Ha(t) {
|
|
164
164
|
let e = this._E.jr(STORAGE_KEYS.k.eE);
|
|
165
165
|
null == e && (e = {});
|
|
166
166
|
const s = this.hE(t[User.bu]),
|
|
@@ -199,7 +199,7 @@ export default class O {
|
|
|
199
199
|
((e[s] = void 0),
|
|
200
200
|
this._E.store(STORAGE_KEYS.k.eE, e),
|
|
201
201
|
(r[User.bu] = t),
|
|
202
|
-
this.
|
|
202
|
+
this.Ha(r));
|
|
203
203
|
}
|
|
204
204
|
const s = this.tu(STORAGE_KEYS.eu.Dl);
|
|
205
205
|
let r = null;
|
|
@@ -215,7 +215,7 @@ export default class O {
|
|
|
215
215
|
return this._E.gE;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
(O.
|
|
218
|
+
(O.Ya = class {
|
|
219
219
|
constructor(t) {
|
|
220
220
|
(this.cn = t), (this.cn = t), (this.gE = V.OE() ? 3 : 10);
|
|
221
221
|
}
|
|
@@ -247,7 +247,7 @@ export default class O {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
}),
|
|
250
|
-
(O.
|
|
250
|
+
(O.Za = class {
|
|
251
251
|
constructor() {
|
|
252
252
|
(this.fE = {}), (this.bE = 5242880), (this.gE = 3);
|
|
253
253
|
}
|
|
@@ -321,7 +321,7 @@ export default class O {
|
|
|
321
321
|
return t.setTime(t.getTime() + 60 * this.NE * 1e3), t.getFullYear();
|
|
322
322
|
}
|
|
323
323
|
DE() {
|
|
324
|
-
const t =
|
|
324
|
+
const t = Pt(STORAGE_KEYS.eu),
|
|
325
325
|
e = document.cookie.split(";");
|
|
326
326
|
for (let s = 0; s < e.length; s++) {
|
|
327
327
|
let r = e[s];
|
|
@@ -392,13 +392,13 @@ export default class O {
|
|
|
392
392
|
(document.cookie = s), (document.cookie = s + ";path=/");
|
|
393
393
|
}
|
|
394
394
|
}),
|
|
395
|
-
(O.
|
|
395
|
+
(O.Va = class {
|
|
396
396
|
constructor(t, e, s) {
|
|
397
397
|
(this.cn = t),
|
|
398
398
|
(this.GE = []),
|
|
399
399
|
e && this.GE.push(new O.ee(t)),
|
|
400
|
-
s && this.GE.push(new O.
|
|
401
|
-
this.GE.push(new O.
|
|
400
|
+
s && this.GE.push(new O.Ya(t)),
|
|
401
|
+
this.GE.push(new O.Za());
|
|
402
402
|
}
|
|
403
403
|
store(t, e) {
|
|
404
404
|
let s = !0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
Ra: "invalid_api_key",
|
|
3
|
+
Xa: "blacklisted",
|
|
4
|
+
Ea: "no_device_identifier",
|
|
5
|
+
Zh: "invalid_json_response",
|
|
6
|
+
Vh: "empty_response",
|
|
7
7
|
__: "sdk_auth_error",
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isObject as
|
|
1
|
+
import { isObject as Nt } from "../util/code-utils.js";
|
|
2
2
|
import {
|
|
3
3
|
convertMsToSeconds as h,
|
|
4
4
|
timestampOrNow as Jt,
|
|
@@ -39,7 +39,7 @@ export default class be {
|
|
|
39
39
|
return new be(t.user_id, t.name, t.time, t.session_id, t.data);
|
|
40
40
|
}
|
|
41
41
|
static TE(t) {
|
|
42
|
-
return null != t &&
|
|
42
|
+
return null != t && Nt(t) && null != t.t && "" !== t.t;
|
|
43
43
|
}
|
|
44
44
|
static Yn(t) {
|
|
45
45
|
return new be(t.u, t.t, t.ts, t.s, t.d);
|
package/src/models/device.js
CHANGED
|
@@ -6,7 +6,7 @@ export default class xt {
|
|
|
6
6
|
const s = {};
|
|
7
7
|
return (
|
|
8
8
|
null != this.browser && (s.browser = this.browser),
|
|
9
|
-
null != this.
|
|
9
|
+
null != this.Ia && (s.browser_version = this.Ia),
|
|
10
10
|
null != this.os && (s.os_version = this.os),
|
|
11
11
|
null != this.resolution && (s.resolution = this.resolution),
|
|
12
12
|
null != this.language && (s.locale = this.language),
|
|
@@ -28,7 +28,7 @@ export default class Kt {
|
|
|
28
28
|
}
|
|
29
29
|
ss() {
|
|
30
30
|
return {
|
|
31
|
-
s: "4.
|
|
31
|
+
s: "4.10.0",
|
|
32
32
|
l: this.ol,
|
|
33
33
|
e: this.cl,
|
|
34
34
|
a: this.gl,
|
|
@@ -42,7 +42,7 @@ export default class Kt {
|
|
|
42
42
|
static Yn(t) {
|
|
43
43
|
let i = t.l;
|
|
44
44
|
return (
|
|
45
|
-
"4.
|
|
45
|
+
"4.10.0" !== t.s && (i = 0), new Kt(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
}
|