@braze/web-sdk 6.8.0 → 6.9.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 +99 -19
- package/package.json +1 -1
- package/shared-lib/event-types.js +20 -20
- package/shared-lib/indexed-db-adapter.js +64 -64
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +8 -8
- package/src/Banner/banner-provider.js +67 -59
- package/src/Banner/banner.js +40 -19
- package/src/Banner/dismiss-banner.js +4 -0
- package/src/Banner/display/banner-to-html.js +10 -10
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/get-all-banners.js +6 -6
- package/src/Banner/get-banner.js +6 -6
- package/src/Banner/index.js +1 -0
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-dismissal.js +7 -7
- package/src/Banner/log-banner-impressions.js +10 -10
- package/src/Banner/request-banners-refresh.js +8 -8
- package/src/Banner/subscribe-to-banners-updates.js +5 -5
- package/src/Banner/ui/insert-banner.js +8 -8
- package/src/Card/card-manager.js +31 -31
- package/src/Card/log-card-dismissal.js +2 -2
- package/src/Card/log-content-card-click.js +2 -2
- package/src/Card/log-content-card-impressions.js +4 -4
- package/src/Card/models/captioned-image.js +15 -15
- package/src/Card/models/card.js +89 -89
- package/src/Card/models/classic-card.js +16 -16
- package/src/Card/models/control-card.js +7 -7
- package/src/Card/models/image-only.js +13 -13
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider.js +102 -102
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +3 -3
- package/src/ContentCards/ui/show-content-cards.js +5 -5
- package/src/Core/add-sdk-metadata.js +2 -2
- package/src/Core/change-user.js +3 -3
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +4 -4
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +2 -2
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/log-custom-event.js +5 -5
- package/src/Core/log-ecommerce-event.js +5 -5
- package/src/Core/log-purchase.js +9 -9
- package/src/Core/open-session.js +7 -7
- package/src/Core/set-logger.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +6 -6
- package/src/DUST/dust-provider.js +249 -240
- package/src/DUST/dust-shared-worker-code.js +1 -1
- package/src/DUST/dust-shared-worker-impl.js +15 -14
- package/src/DUST/dust-worker-bridge.js +50 -35
- package/src/DUST/subscribe-to-dust.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +8 -8
- package/src/FeatureFlags/feature-flag.js +3 -3
- package/src/FeatureFlags/feature-flags-provider.js +21 -21
- package/src/FeatureFlags/log-feature-flag-impression.js +5 -5
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +1 -1
- package/src/InAppMessage/constants.js +3 -3
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +4 -4
- package/src/InAppMessage/display/in-app-message-to-html.js +16 -16
- package/src/InAppMessage/in-app-message-factory.js +36 -36
- package/src/InAppMessage/in-app-message-manager.js +78 -78
- package/src/InAppMessage/log-in-app-message-button-click.js +4 -4
- package/src/InAppMessage/log-in-app-message-click.js +3 -3
- package/src/InAppMessage/log-in-app-message-html-click.js +5 -5
- package/src/InAppMessage/log-in-app-message-impression.js +4 -4
- package/src/InAppMessage/models/control-message.js +4 -4
- package/src/InAppMessage/models/full-screen-message.js +4 -4
- package/src/InAppMessage/models/html-message.js +3 -3
- package/src/InAppMessage/models/in-app-message-button.js +4 -4
- package/src/InAppMessage/models/in-app-message.js +12 -12
- package/src/InAppMessage/models/modal-message.js +4 -4
- package/src/InAppMessage/models/slide-up-message.js +4 -4
- package/src/InAppMessage/models/templated-in-app-message.js +8 -8
- package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
- package/src/InAppMessage/ui/show-in-app-message.js +14 -14
- package/src/Push/push-manager-factory.js +2 -2
- package/src/Push/push-manager.js +38 -38
- package/src/Push/utils/push-utils.js +6 -6
- package/src/User/user-manager.js +14 -14
- package/src/User/user.js +25 -25
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +7 -7
- package/src/common/event-logger.js +3 -3
- package/src/common/properties-base.js +3 -3
- package/src/l10n/l10n-manager-factory.js +1 -1
- package/src/l10n/l10n-manager.js +3 -3
- package/src/managers/auth-manager.js +11 -11
- package/src/managers/braze-instance.js +56 -56
- package/src/managers/device-manager.js +10 -10
- package/src/managers/network-manager.js +102 -101
- package/src/managers/server-config-manager.js +115 -98
- package/src/managers/session-manager.js +20 -20
- package/src/managers/storage-manager-factory.js +9 -9
- package/src/managers/storage-manager.js +74 -74
- package/src/managers/subscription-manager.js +2 -2
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +1 -1
- package/src/models/device.js +1 -1
- package/src/models/identifier.js +2 -2
- package/src/models/push-token.js +6 -6
- package/src/models/request-result.js +1 -1
- package/src/models/server-config.js +42 -24
- package/src/request-controller.js +126 -126
- package/src/triggers/models/custom-event-data.js +4 -4
- package/src/triggers/models/custom-event-property-data.js +5 -5
- package/src/triggers/models/filter-set.js +2 -2
- package/src/triggers/models/filter.js +1 -1
- package/src/triggers/models/in-app-message-click-data.js +1 -1
- package/src/triggers/models/purchase-data.js +1 -1
- package/src/triggers/models/purchase-property-data.js +2 -2
- package/src/triggers/models/push-click-data.js +1 -1
- package/src/triggers/models/trigger-condition.js +33 -33
- package/src/triggers/models/trigger-events.js +1 -1
- package/src/triggers/models/trigger.js +33 -33
- package/src/triggers/triggers-provider-factory.js +1 -1
- package/src/triggers/triggers-provider.js +68 -68
- package/src/types.js +2 -2
- package/src/ui/js/attach-css.js +1 -1
- package/src/util/braze-actions.js +7 -7
- package/src/util/browser-detector.js +2 -2
- package/src/util/client-hints-parser.js +4 -4
- package/src/util/code-utils.js +2 -2
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/dom-utils.js +7 -7
- package/src/util/ecommerce-event-validation.js +52 -35
- package/src/util/html-display-utils.js +11 -11
- package/src/util/net.js +4 -4
- package/src/util/request-header-utils.js +17 -17
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +2 -2
- package/src/util/validation-utils.js +12 -12
- package/src/util/window-utils.js +2 -2
package/src/User/user-manager.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import _t from "../models/identifier.js";
|
|
2
2
|
import { getByteLength as er } from "../util/string-utils.js";
|
|
3
3
|
import ui from "../models/push-token.js";
|
|
4
|
-
import { logger as
|
|
4
|
+
import { logger as b, IndexedDBAdapter as et } from "../../shared-lib/index.js";
|
|
5
5
|
import { STORAGE_KEYS as s } from "../managers/storage-manager.js";
|
|
6
6
|
import { User } from "../User/index.js";
|
|
7
7
|
export default class Ut {
|
|
8
8
|
constructor(t, s) {
|
|
9
|
-
(this.h = t), (this.
|
|
9
|
+
(this.h = t), (this.j = s), (this.h = t), (this.j = s);
|
|
10
10
|
}
|
|
11
11
|
getUserId() {
|
|
12
|
-
const t = this.
|
|
12
|
+
const t = this.j.$u(s.Ou.Cu);
|
|
13
13
|
if (null == t) return null;
|
|
14
14
|
let i = t.Tu,
|
|
15
15
|
e = er(i);
|
|
16
16
|
if (e > User.br) {
|
|
17
17
|
for (; e > User.br; ) (i = i.slice(0, i.length - 1)), (e = er(i));
|
|
18
|
-
(t.Tu = i), this.
|
|
18
|
+
(t.Tu = i), this.j.Iu(s.Ou.Cu, t);
|
|
19
19
|
}
|
|
20
20
|
return i;
|
|
21
21
|
}
|
|
22
22
|
Ju(t) {
|
|
23
23
|
const i = null == this.getUserId();
|
|
24
|
-
this.
|
|
24
|
+
this.j.Iu(s.Ou.Cu, new _t(t)), i && this.j.Lu(t);
|
|
25
25
|
}
|
|
26
26
|
setCustomUserAttribute(t, s) {
|
|
27
27
|
if (this.h.qu(t))
|
|
28
28
|
return (
|
|
29
|
-
|
|
29
|
+
b.info('Custom Attribute "' + t + '" is blocklisted, ignoring.'), !1
|
|
30
30
|
);
|
|
31
31
|
const i = {};
|
|
32
32
|
return (i[t] = s), this.zu(User.Bu, i, !0);
|
|
33
33
|
}
|
|
34
34
|
zu(t, s, i = !1, e = !1) {
|
|
35
|
-
const u = this.
|
|
35
|
+
const u = this.j.Eu(this.getUserId(), t, s);
|
|
36
36
|
let o = "",
|
|
37
37
|
r = t,
|
|
38
38
|
h = s;
|
|
@@ -43,7 +43,7 @@ export default class Ut {
|
|
|
43
43
|
((r = Object.keys(s)[0]),
|
|
44
44
|
(h = s[r]),
|
|
45
45
|
"object" == typeof h && (h = JSON.stringify(h, null, 2)))),
|
|
46
|
-
!e && u &&
|
|
46
|
+
!e && u && b.info(`Logged${o} attribute ${r} with value ${h}`),
|
|
47
47
|
u
|
|
48
48
|
);
|
|
49
49
|
}
|
|
@@ -52,10 +52,10 @@ export default class Ut {
|
|
|
52
52
|
this.zu("custom_push_public_key", e, !1, !0),
|
|
53
53
|
this.zu("custom_push_user_auth", u, !1, !0),
|
|
54
54
|
this.zu("custom_push_vapid_public_key", o, !1, !0);
|
|
55
|
-
const r = et.
|
|
56
|
-
h = new et(r,
|
|
55
|
+
const r = et._s.Xs,
|
|
56
|
+
h = new et(r, b),
|
|
57
57
|
n = new ui(t, i, e, u, o);
|
|
58
|
-
this.
|
|
58
|
+
this.j.Pt(s.It.Uu, n.qt()), h.setItem(r.Ws.Fu, r.be, !0);
|
|
59
59
|
}
|
|
60
60
|
wu(t) {
|
|
61
61
|
if (
|
|
@@ -65,9 +65,9 @@ export default class Ut {
|
|
|
65
65
|
this.zu("custom_push_vapid_public_key", null, !1, !0),
|
|
66
66
|
t)
|
|
67
67
|
) {
|
|
68
|
-
const t = et.
|
|
69
|
-
i = new et(t,
|
|
70
|
-
this.
|
|
68
|
+
const t = et._s.Xs,
|
|
69
|
+
i = new et(t, b);
|
|
70
|
+
this.j.Pt(s.It.Uu, !1), i.setItem(t.Ws.Fu, t.be, !1);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
package/src/User/user.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isObject as Ct,
|
|
5
5
|
validateValueIsFromEnum as ta,
|
|
6
6
|
} from "../util/code-utils.js";
|
|
7
|
-
import { logger as
|
|
7
|
+
import { logger as b, EventTypes as p } from "../../shared-lib/index.js";
|
|
8
8
|
import {
|
|
9
9
|
isValidEmail as At,
|
|
10
10
|
validateCustomAttributeArrayType as Dt,
|
|
@@ -23,16 +23,16 @@ export default class User {
|
|
|
23
23
|
getUserId(t) {
|
|
24
24
|
const e = this.Ss.getUserId();
|
|
25
25
|
if ("function" != typeof t) return e;
|
|
26
|
-
|
|
26
|
+
b.warn(
|
|
27
27
|
"The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)",
|
|
28
28
|
),
|
|
29
29
|
t(e);
|
|
30
30
|
}
|
|
31
31
|
addAlias(t, e) {
|
|
32
32
|
return !tr(t, "add alias", "the alias", !1) || t.length <= 0
|
|
33
|
-
? (
|
|
33
|
+
? (b.error("addAlias requires a non-empty alias"), !1)
|
|
34
34
|
: !tr(e, "add alias", "the label", !1) || e.length <= 0
|
|
35
|
-
? (
|
|
35
|
+
? (b.error("addAlias requires a non-empty label"), !1)
|
|
36
36
|
: this.Ru.Gu(t, e).lt;
|
|
37
37
|
}
|
|
38
38
|
setFirstName(t) {
|
|
@@ -49,7 +49,7 @@ export default class User {
|
|
|
49
49
|
setEmail(t) {
|
|
50
50
|
return null === t || At(t)
|
|
51
51
|
? this.Ss.zu("email", t)
|
|
52
|
-
: (
|
|
52
|
+
: (b.error(
|
|
53
53
|
`Cannot set email address - "${t}" did not pass RFC-5322 validation.`,
|
|
54
54
|
),
|
|
55
55
|
!1);
|
|
@@ -84,7 +84,7 @@ export default class User {
|
|
|
84
84
|
e < 1 ||
|
|
85
85
|
r > 31 ||
|
|
86
86
|
r < 1
|
|
87
|
-
? (
|
|
87
|
+
? (b.error(
|
|
88
88
|
"Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);",
|
|
89
89
|
),
|
|
90
90
|
!1)
|
|
@@ -130,13 +130,13 @@ export default class User {
|
|
|
130
130
|
!!tr(t, "set phone number", "the phoneNumber", !0) &&
|
|
131
131
|
(null === t || t.match(User.Hu)
|
|
132
132
|
? this.Ss.zu("phone", t)
|
|
133
|
-
: (
|
|
133
|
+
: (b.error(`Cannot set phone number - "${t}" did not pass validation.`),
|
|
134
134
|
!1))
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
setLastKnownLocation(t, e, r, s, n) {
|
|
138
138
|
return null == t || null == e
|
|
139
|
-
? (
|
|
139
|
+
? (b.error(
|
|
140
140
|
"Cannot set last-known location - latitude and longitude are required.",
|
|
141
141
|
),
|
|
142
142
|
!1)
|
|
@@ -150,17 +150,17 @@ export default class User {
|
|
|
150
150
|
(null != r && isNaN(r)) ||
|
|
151
151
|
(null != s && isNaN(s)) ||
|
|
152
152
|
(null != n && isNaN(n))
|
|
153
|
-
? (
|
|
153
|
+
? (b.error(
|
|
154
154
|
"Cannot set last-known location - all supplied parameters must be numeric.",
|
|
155
155
|
),
|
|
156
156
|
!1)
|
|
157
157
|
: t > 90 || t < -90 || e > 180 || e < -180
|
|
158
|
-
? (
|
|
158
|
+
? (b.error(
|
|
159
159
|
"Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively.",
|
|
160
160
|
),
|
|
161
161
|
!1)
|
|
162
162
|
: (null != r && r < 0) || (null != n && n < 0)
|
|
163
|
-
? (
|
|
163
|
+
? (b.error(
|
|
164
164
|
"Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.",
|
|
165
165
|
),
|
|
166
166
|
!1)
|
|
@@ -227,7 +227,7 @@ export default class User {
|
|
|
227
227
|
null == e && (e = 1);
|
|
228
228
|
const r = parseInt(e.toString());
|
|
229
229
|
return isNaN(r) || r !== parseFloat(e.toString())
|
|
230
|
-
? (
|
|
230
|
+
? (b.error(
|
|
231
231
|
`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`,
|
|
232
232
|
),
|
|
233
233
|
!1)
|
|
@@ -243,7 +243,7 @@ export default class User {
|
|
|
243
243
|
(null != e && null == r) ||
|
|
244
244
|
(null != e && (isNaN(e) || e > 90 || e < -90)) ||
|
|
245
245
|
(null != r && (isNaN(r) || r > 180 || r < -180)))
|
|
246
|
-
? (
|
|
246
|
+
? (b.error(
|
|
247
247
|
"Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal.",
|
|
248
248
|
),
|
|
249
249
|
!1)
|
|
@@ -257,11 +257,11 @@ export default class User {
|
|
|
257
257
|
"subscription group ID",
|
|
258
258
|
!1,
|
|
259
259
|
) || t.length <= 0
|
|
260
|
-
? (
|
|
260
|
+
? (b.error(
|
|
261
261
|
"addToSubscriptionGroup requires a non-empty subscription group ID",
|
|
262
262
|
),
|
|
263
263
|
!1)
|
|
264
|
-
: this.Ru.
|
|
264
|
+
: this.Ru.va(t, User.Ia.SUBSCRIBED).lt;
|
|
265
265
|
}
|
|
266
266
|
removeFromSubscriptionGroup(t) {
|
|
267
267
|
return !tr(
|
|
@@ -270,25 +270,25 @@ export default class User {
|
|
|
270
270
|
"subscription group ID",
|
|
271
271
|
!1,
|
|
272
272
|
) || t.length <= 0
|
|
273
|
-
? (
|
|
273
|
+
? (b.error(
|
|
274
274
|
"removeFromSubscriptionGroup requires a non-empty subscription group ID",
|
|
275
275
|
),
|
|
276
276
|
!1)
|
|
277
|
-
: this.Ru.
|
|
277
|
+
: this.Ru.va(t, User.Ia.UNSUBSCRIBED).lt;
|
|
278
278
|
}
|
|
279
279
|
setLineId(t) {
|
|
280
280
|
return tr(t, "set LINE user ID", "the ID", !0) &&
|
|
281
281
|
0 !== (null == t ? void 0 : t.length)
|
|
282
|
-
? t && t.length > User.
|
|
283
|
-
? (
|
|
284
|
-
`Rejected LINE user ID ${t} because it is longer than ${User.
|
|
282
|
+
? t && t.length > User.Ca
|
|
283
|
+
? (b.error(
|
|
284
|
+
`Rejected LINE user ID ${t} because it is longer than ${User.Ca} characters.`,
|
|
285
285
|
),
|
|
286
286
|
!1)
|
|
287
287
|
: this.Ss.zu("native_line_id", t)
|
|
288
|
-
: (
|
|
288
|
+
: (b.error("setLineId requires a non-empty ID"), !1);
|
|
289
289
|
}
|
|
290
290
|
gu(t, e, r, s, n) {
|
|
291
|
-
this.Ss.gu(t, e, r, s, n), this.Ru.
|
|
291
|
+
this.Ss.gu(t, e, r, s, n), this.Ru.Ea();
|
|
292
292
|
}
|
|
293
293
|
wu(t) {
|
|
294
294
|
this.Ss.wu(t);
|
|
@@ -308,8 +308,8 @@ export default class User {
|
|
|
308
308
|
UNSUBSCRIBED: "unsubscribed",
|
|
309
309
|
}),
|
|
310
310
|
(User.Hu = /^[0-9 .\\(\\)\\+\\-]+$/),
|
|
311
|
-
(User.
|
|
312
|
-
(User.
|
|
311
|
+
(User.Ia = { SUBSCRIBED: "subscribed", UNSUBSCRIBED: "unsubscribed" }),
|
|
312
|
+
(User.Sa = "user_id"),
|
|
313
313
|
(User.Bu = "custom"),
|
|
314
314
|
(User.br = 997),
|
|
315
|
-
(User.
|
|
315
|
+
(User.Ca = 33);
|
|
@@ -9,7 +9,7 @@ import { isArray as g } from "../util/code-utils.js";
|
|
|
9
9
|
import { KeyCodes as Ce } from "../util/key-codes.js";
|
|
10
10
|
import Je from "../l10n/l10n-manager-factory.js";
|
|
11
11
|
import { removeSubscription } from "../Core/remove-subscription.js";
|
|
12
|
-
import { logger as
|
|
12
|
+
import { logger as b, Guid as V } from "../../shared-lib/index.js";
|
|
13
13
|
import { BRAZE_ACTION_URI_REGEX as to } from "../util/validation-utils.js";
|
|
14
14
|
import {
|
|
15
15
|
INELIGIBLE_BRAZE_ACTION_URL_ERROR_TYPES as bt,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
impressOnTop as B,
|
|
24
24
|
topHadImpression as Bt,
|
|
25
25
|
} from "./detect-impression.js";
|
|
26
|
-
import { BannerStrings as
|
|
26
|
+
import { BannerStrings as x } from "../Banner/constants.js";
|
|
27
27
|
import ContentCards from "../ContentCards/content-cards.js";
|
|
28
28
|
export const LAST_REQUESTED_REFRESH_DATA_ATTRIBUTE =
|
|
29
29
|
"data-last-requested-refresh";
|
|
@@ -35,7 +35,7 @@ export function destroyContentCardsHtml(t) {
|
|
|
35
35
|
setTimeout(() => {
|
|
36
36
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
37
37
|
}, ContentCards.gr));
|
|
38
|
-
const e = t.getAttribute(
|
|
38
|
+
const e = t.getAttribute(x.ea);
|
|
39
39
|
null != e && removeSubscription(e);
|
|
40
40
|
const n = t.getAttribute("data-listener-id");
|
|
41
41
|
null != n &&
|
|
@@ -63,8 +63,8 @@ export function generateContentCardsUI(t, e) {
|
|
|
63
63
|
for (const a of t.cards) {
|
|
64
64
|
const i = a instanceof ControlCard;
|
|
65
65
|
!i || t.hr()
|
|
66
|
-
? (o.appendChild(qt(a, r, e, n.
|
|
67
|
-
:
|
|
66
|
+
? (o.appendChild(qt(a, r, e, n.wa())), (s = s || !i))
|
|
67
|
+
: b.error(
|
|
68
68
|
"Received a control card for a legacy news feed. Control cards are only supported with content cards.",
|
|
69
69
|
);
|
|
70
70
|
}
|
|
@@ -188,7 +188,7 @@ export function updateContentCards(t, e, n, o, s) {
|
|
|
188
188
|
if (t.url && to.test(t.url)) {
|
|
189
189
|
const e = eo(t.url);
|
|
190
190
|
if (vt(e)) {
|
|
191
|
-
|
|
191
|
+
b.error(yt(bt.Un, "Content Card"));
|
|
192
192
|
continue;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -207,5 +207,5 @@ export function updateContentCards(t, e, n, o, s) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
export function registerContentCardsSubscriptionId(t, e) {
|
|
210
|
-
t && e.setAttribute(
|
|
210
|
+
t && e.setAttribute(x.ea, t);
|
|
211
211
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { logger as
|
|
1
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
2
2
|
import r from "../managers/braze-instance.js";
|
|
3
3
|
import Ie from "../models/braze-event.js";
|
|
4
4
|
import L from "../models/request-result.js";
|
|
5
5
|
const v = {
|
|
6
|
-
|
|
6
|
+
Dt: (e, o, t) => {
|
|
7
7
|
var n, s;
|
|
8
8
|
const i = new L(),
|
|
9
9
|
l = r.u();
|
|
10
10
|
if (!l)
|
|
11
11
|
return (
|
|
12
|
-
|
|
12
|
+
b.info(
|
|
13
13
|
`Not logging event with type "${e}" because the current session ID could not be found.`,
|
|
14
14
|
),
|
|
15
15
|
i
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger as
|
|
1
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
2
2
|
export class PropertiesBase {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
(this.properties = t), (this.properties = t || {});
|
|
@@ -26,10 +26,10 @@ export class PropertiesBase {
|
|
|
26
26
|
return this.tp(t, this.up, "datetime");
|
|
27
27
|
}
|
|
28
28
|
ep(t) {
|
|
29
|
-
|
|
29
|
+
b.info(`Property is not of type ${t}.`);
|
|
30
30
|
}
|
|
31
31
|
rp(t) {
|
|
32
|
-
|
|
32
|
+
b.info(`${t} not found in properties.`);
|
|
33
33
|
}
|
|
34
34
|
op(t) {
|
|
35
35
|
return "string" === t.type && "string" == typeof t.value;
|
package/src/l10n/l10n-manager.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger as
|
|
1
|
+
import { logger as b } from "../../shared-lib/index.js";
|
|
2
2
|
import zt from "../common/translations.js";
|
|
3
3
|
export default class gr {
|
|
4
4
|
constructor(t, e = !1) {
|
|
@@ -15,14 +15,14 @@ export default class gr {
|
|
|
15
15
|
"Braze does not yet have a localization for language " +
|
|
16
16
|
t +
|
|
17
17
|
", defaulting to English. Please contact us if you are willing and able to help us translate our SDK into this language.";
|
|
18
|
-
e ?
|
|
18
|
+
e ? b.error(a) : b.info(a), (t = "en");
|
|
19
19
|
}
|
|
20
20
|
this.language = t;
|
|
21
21
|
}
|
|
22
22
|
get(t) {
|
|
23
23
|
return zt[this.language][t];
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
wa() {
|
|
26
26
|
switch (this.language) {
|
|
27
27
|
case "ar":
|
|
28
28
|
case "he":
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { STORAGE_KEYS as s } from "./storage-manager.js";
|
|
2
2
|
import f from "./subscription-manager.js";
|
|
3
|
-
import { logger as
|
|
3
|
+
import { logger as b, IndexedDBAdapter as et } from "../../shared-lib/index.js";
|
|
4
4
|
export default class Gt {
|
|
5
5
|
constructor(t, i, s) {
|
|
6
|
-
(this.
|
|
6
|
+
(this.j = t),
|
|
7
7
|
(this.gh = i),
|
|
8
8
|
(this.bh = s),
|
|
9
|
-
(this.
|
|
9
|
+
(this.j = t),
|
|
10
10
|
(this.gh = i || !1),
|
|
11
11
|
(this.bh = s),
|
|
12
12
|
(this.Sh = new f()),
|
|
@@ -17,21 +17,21 @@ export default class Gt {
|
|
|
17
17
|
return this.gh;
|
|
18
18
|
}
|
|
19
19
|
kh() {
|
|
20
|
-
return this.
|
|
20
|
+
return this.j.St(s.It.fh);
|
|
21
21
|
}
|
|
22
22
|
setSdkAuthenticationSignature(t) {
|
|
23
23
|
const i = this.kh();
|
|
24
|
-
this.
|
|
25
|
-
const e = et.
|
|
26
|
-
new et(e,
|
|
24
|
+
this.j.Pt(s.It.fh, t);
|
|
25
|
+
const e = et._s.Xs;
|
|
26
|
+
new et(e, b).setItem(e.Ws.wh, this.ph, t), i !== t && this.ct();
|
|
27
27
|
}
|
|
28
28
|
jh() {
|
|
29
|
-
this.
|
|
30
|
-
const t = et.
|
|
31
|
-
new et(t,
|
|
29
|
+
this.j.Vt(s.It.fh);
|
|
30
|
+
const t = et._s.Xs;
|
|
31
|
+
new et(t, b).ge(t.Ws.wh, this.ph);
|
|
32
32
|
}
|
|
33
33
|
subscribeToSdkAuthenticationFailures(t) {
|
|
34
|
-
return this.bh.
|
|
34
|
+
return this.bh.Ut(t);
|
|
35
35
|
}
|
|
36
36
|
Ch(t) {
|
|
37
37
|
this.bh.A(t);
|