@braze/web-sdk 6.3.0 → 6.3.1
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 +1 -1
- package/package.json +1 -1
- package/shared-lib/guid.js +23 -4
- package/shared-lib/logger.js +2 -2
- package/src/managers/braze-instance.js +1 -1
- package/src/models/server-config.js +2 -2
- package/src/request-controller.js +1 -1
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/validation-utils.js +5 -4
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v6.3.
|
|
2
|
+
* Type definitions for @braze/web-sdk v6.3.1
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2025 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
package/package.json
CHANGED
package/shared-lib/guid.js
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
const P = {
|
|
2
2
|
oe: function () {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if ("undefined" != typeof window && window.crypto) {
|
|
4
|
+
if ("function" == typeof window.crypto.randomUUID)
|
|
5
|
+
return window.crypto.randomUUID();
|
|
6
|
+
if ("function" == typeof window.crypto.getRandomValues)
|
|
7
|
+
try {
|
|
8
|
+
const n = new Uint8Array(16);
|
|
9
|
+
window.crypto.getRandomValues(n),
|
|
10
|
+
(n[6] = (15 & n[6]) | 64),
|
|
11
|
+
(n[8] = (63 & n[8]) | 128);
|
|
12
|
+
const t = Array.from(n, (n) => ("0" + n.toString(16)).slice(-2));
|
|
13
|
+
return [
|
|
14
|
+
t.slice(0, 4).join(""),
|
|
15
|
+
t.slice(4, 6).join(""),
|
|
16
|
+
t.slice(6, 8).join(""),
|
|
17
|
+
t.slice(8, 10).join(""),
|
|
18
|
+
t.slice(10, 16).join(""),
|
|
19
|
+
].join("-");
|
|
20
|
+
} catch (n) {}
|
|
21
|
+
}
|
|
22
|
+
const n = (n = !1) => {
|
|
23
|
+
const t = (Math.random().toString(16) + "000000000").substr(2, 8);
|
|
24
|
+
return n ? "-" + t.substr(0, 4) + "-" + t.substr(4, 4) : t;
|
|
6
25
|
};
|
|
7
|
-
return
|
|
26
|
+
return n() + n(!0) + n(!0) + n();
|
|
8
27
|
},
|
|
9
28
|
};
|
|
10
29
|
export default P;
|
package/shared-lib/logger.js
CHANGED
|
@@ -24,13 +24,13 @@ const E = {
|
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
26
|
if (E.zg) {
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v6.3.
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v6.3.1)";
|
|
28
28
|
null != E.vd ? E.vd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
32
|
if (E.zg) {
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v6.3.
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v6.3.1)";
|
|
34
34
|
null != E.vd ? E.vd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -38,7 +38,7 @@ export default class ni {
|
|
|
38
38
|
}
|
|
39
39
|
dt() {
|
|
40
40
|
return {
|
|
41
|
-
s: "6.3.
|
|
41
|
+
s: "6.3.1",
|
|
42
42
|
l: this.ol,
|
|
43
43
|
e: this.bl,
|
|
44
44
|
a: this.fl,
|
|
@@ -54,7 +54,7 @@ export default class ni {
|
|
|
54
54
|
static qn(t) {
|
|
55
55
|
let i = t.l;
|
|
56
56
|
return (
|
|
57
|
-
"6.3.
|
|
57
|
+
"6.3.1" !== t.s && (i = 0),
|
|
58
58
|
new ni(i, t.e, t.a, t.p, t.m, t.v, t.c, t.f, t.grl, t.b)
|
|
59
59
|
);
|
|
60
60
|
}
|
|
@@ -190,7 +190,7 @@ export default class Wt {
|
|
|
190
190
|
const t = this.C.bt() !== this.C.qo();
|
|
191
191
|
t && (this.j.hE(s.iu.Jh), this.j.hE(s.iu.su)),
|
|
192
192
|
this.Kl(!1, void 0, () => {
|
|
193
|
-
this.j.Nt(s.ct.qe);
|
|
193
|
+
t && (this.j.Nt(s.ct.qe), this.j.Nt(s.ct.It));
|
|
194
194
|
}),
|
|
195
195
|
this.zn(),
|
|
196
196
|
t &&
|
package/src/ui/js/attach-css.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import r, { OPTIONS as z } from "../../managers/braze-instance.js";
|
|
2
2
|
export function attachCSS(n, t, o) {
|
|
3
3
|
const c = n || document.querySelector("head"),
|
|
4
|
-
e = `ab-${t}-css-definitions-${"6.3.
|
|
4
|
+
e = `ab-${t}-css-definitions-${"6.3.1".replace(/\./g, "-")}`;
|
|
5
5
|
if (!c) return;
|
|
6
6
|
const s = c.ownerDocument || document;
|
|
7
7
|
if (null == s.getElementById(e)) {
|
|
@@ -22,7 +22,8 @@ export const CUSTOM_ATTRIBUTE_RESERVED_OPERATORS = [
|
|
|
22
22
|
"$google_ad_personalization",
|
|
23
23
|
"$google_ad_user_data",
|
|
24
24
|
];
|
|
25
|
-
export const EMAIL_ADDRESS_REGEX =
|
|
25
|
+
export const EMAIL_ADDRESS_REGEX = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
26
|
+
export const EMAIL_ADDRESS_MAX_LENGTH = 256;
|
|
26
27
|
export const CUSTOM_PROPERTIES_MAX_SIZE_BYTES = 51200;
|
|
27
28
|
export const CUSTOM_PROPERTIES_MAX_SIZE_STRING = "50KB";
|
|
28
29
|
export const CUSTOM_ATTRIBUTES_MAX_SIZE_BYTES = 76800;
|
|
@@ -178,9 +179,9 @@ export function validateCustomAttributeArrayType(t, e) {
|
|
|
178
179
|
return [r, n];
|
|
179
180
|
}
|
|
180
181
|
export function isValidEmail(t) {
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
);
|
|
182
|
+
if ("string" != typeof t) return !1;
|
|
183
|
+
const e = t.length;
|
|
184
|
+
return !(0 === e || e > 256) && EMAIL_ADDRESS_REGEX.test(t.toLowerCase());
|
|
184
185
|
}
|
|
185
186
|
export function isValidBrazeActionJson(t) {
|
|
186
187
|
if (!(oo.properties.type in t)) return !1;
|