@braze/web-sdk 4.7.2 → 4.8.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 +27 -24
- package/package.json +1 -1
- package/shared-lib/braze-shared-lib.js +5 -5
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +24 -24
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +17 -17
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +18 -18
- package/src/Card/card-manager-factory.js +2 -2
- package/src/Card/card-manager.js +47 -41
- package/src/Card/display/card-display.js +70 -67
- package/src/Card/log-card-click.js +1 -1
- package/src/Card/log-card-dismissal.js +1 -1
- package/src/Card/log-card-impressions.js +3 -3
- package/src/Card/models/banner.js +3 -2
- package/src/Card/models/captioned-image.js +6 -5
- package/src/Card/models/card.js +107 -87
- package/src/Card/models/classic-card.js +5 -5
- package/src/Card/models/control-card.js +5 -21
- package/src/Card/types.js +1 -0
- package/src/Card/util/card-factory.js +32 -32
- package/src/ContentCards/content-cards-provider-factory.js +3 -3
- package/src/ContentCards/content-cards-provider.js +283 -175
- package/src/ContentCards/content-cards.js +2 -2
- package/src/ContentCards/get-cached-content-cards.js +1 -1
- package/src/ContentCards/log-content-cards-displayed.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +1 -1
- package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
- package/src/ContentCards/types.js +1 -0
- package/src/ContentCards/ui/hide-content-cards.js +2 -2
- package/src/ContentCards/ui/show-content-cards.js +35 -33
- package/src/Core/add-sdk-metadata.js +17 -18
- package/src/Core/change-user.js +12 -14
- package/src/Core/destroy.js +1 -1
- package/src/Core/disable-sdk.js +7 -6
- package/src/Core/enable-sdk.js +4 -4
- package/src/Core/get-device-id.js +7 -6
- package/src/Core/get-user.js +1 -1
- package/src/Core/handle-braze-action.js +57 -40
- package/src/Core/is-disabled.js +2 -2
- package/src/Core/log-custom-event.js +22 -15
- package/src/Core/log-purchase.js +33 -33
- package/src/Core/open-session.js +17 -15
- package/src/Core/request-immediate-data-flush.js +4 -2
- package/src/Core/set-logger.js +1 -1
- package/src/Core/set-sdk-authentication-signature.js +5 -6
- package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
- package/src/Core/toggle-logging.js +1 -1
- package/src/Core/types.js +1 -0
- package/src/Core/wipe-data.js +11 -10
- package/src/FeatureFlags/feature-flag-factory.js +6 -6
- package/src/FeatureFlags/feature-flag.js +17 -17
- package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
- package/src/FeatureFlags/feature-flags-provider.js +67 -65
- package/src/FeatureFlags/get-all-feature-flags.js +3 -3
- package/src/FeatureFlags/get-feature-flag.js +4 -4
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
- package/src/Feed/feed-provider-factory.js +8 -8
- package/src/Feed/feed-provider.js +57 -46
- package/src/Feed/feed.js +1 -1
- package/src/Feed/get-cached-feed.js +2 -2
- package/src/Feed/log-feed-displayed.js +3 -1
- package/src/Feed/request-feed-refresh.js +2 -2
- package/src/Feed/subscribe-to-feed-updates.js +2 -2
- package/src/Feed/types.js +1 -0
- package/src/Feed/ui/hide-feed.js +2 -2
- package/src/Feed/ui/show-feed.js +40 -36
- package/src/InAppMessage/display/html-message-to-html.js +125 -119
- package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
- package/src/InAppMessage/display/modal-utils.js +18 -13
- package/src/InAppMessage/in-app-message-factory.js +9 -8
- package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
- package/src/InAppMessage/in-app-message-manager.js +122 -108
- package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
- package/src/InAppMessage/log-in-app-message-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
- package/src/InAppMessage/log-in-app-message-impression.js +5 -5
- package/src/InAppMessage/models/control-message.js +4 -1
- package/src/InAppMessage/models/full-screen-message.js +35 -37
- package/src/InAppMessage/models/html-message.js +34 -33
- package/src/InAppMessage/models/in-app-message-button.js +23 -16
- package/src/InAppMessage/models/in-app-message.js +147 -105
- package/src/InAppMessage/models/modal-message.js +34 -36
- package/src/InAppMessage/models/slide-up-message.js +25 -27
- package/src/InAppMessage/models/templated-in-app-message.js +12 -7
- package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
- package/src/InAppMessage/types.js +1 -0
- package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
- package/src/InAppMessage/ui/show-in-app-message.js +95 -89
- package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
- package/src/Push/is-push-blocked.js +2 -2
- package/src/Push/is-push-permission-granted.js +2 -2
- package/src/Push/is-push-supported.js +2 -2
- package/src/Push/push-manager-factory.js +20 -20
- package/src/Push/push-manager.js +192 -174
- package/src/Push/request-push-permission.js +4 -3
- package/src/Push/types.js +1 -0
- package/src/Push/unregister-push.js +2 -2
- package/src/Push/utils/push-utils.js +10 -10
- package/src/User/types.js +1 -0
- package/src/User/user-manager.js +24 -24
- package/src/User/user.js +117 -105
- package/src/common/base-feed.js +7 -7
- package/src/common/base-provider.js +2 -2
- package/src/common/constants.js +6 -0
- package/src/common/event-logger.js +6 -6
- package/src/common/feed-display.js +18 -18
- package/src/common/types.js +1 -0
- package/src/l10n/l10n-manager-factory.js +5 -5
- package/src/l10n/l10n-manager.js +1 -1
- package/src/managers/auth-manager.js +32 -32
- package/src/managers/braze-instance.js +202 -202
- package/src/managers/device-manager.js +23 -23
- package/src/managers/network-manager.js +96 -82
- package/src/managers/server-config-manager.js +60 -42
- package/src/managers/session-manager.js +41 -41
- package/src/managers/storage-manager-factory.js +15 -15
- package/src/managers/storage-manager.js +163 -160
- package/src/managers/subscription-manager.js +11 -11
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +7 -7
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +7 -7
- package/src/models/push-token.js +7 -7
- package/src/models/request-result.js +3 -3
- package/src/models/server-config.js +20 -20
- package/src/request-controller.js +176 -174
- package/src/triggers/models/custom-event-data.js +6 -6
- package/src/triggers/models/custom-event-property-data.js +9 -9
- package/src/triggers/models/filter-set.js +9 -9
- package/src/triggers/models/filter.js +64 -64
- package/src/triggers/models/in-app-message-click-data.js +12 -12
- package/src/triggers/models/purchase-data.js +3 -3
- package/src/triggers/models/purchase-property-data.js +9 -9
- package/src/triggers/models/push-click-data.js +5 -5
- package/src/triggers/models/trigger-condition.js +52 -52
- package/src/triggers/models/trigger-events.js +2 -2
- package/src/triggers/models/trigger.js +36 -36
- package/src/triggers/triggers-provider-factory.js +8 -8
- package/src/triggers/triggers-provider.js +165 -162
- package/src/types.js +1 -0
- package/src/ui/js/attach-css.js +3 -3
- package/src/ui/js/load-font-awesome.js +2 -2
- package/src/util/base-device-parser.js +1 -1
- package/src/util/braze-actions.js +20 -20
- package/src/util/browser-detector.js +22 -22
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/code-utils.js +1 -1
- package/src/util/color-utils.js +2 -2
- package/src/util/component-utils.js +2 -2
- package/src/util/deprecation-utils.js +1 -1
- package/src/util/device-constants.js +5 -5
- package/src/util/dom-utils.js +2 -2
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +11 -11
- package/src/util/request-header-utils.js +23 -0
- package/src/util/string-utils.js +1 -1
- package/src/util/user-agent-parser.js +20 -20
- package/src/util/validation-utils.js +44 -44
- package/src/util/window-utils.js +3 -3
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v4.
|
|
2
|
+
* Type definitions for @braze/web-sdk v4.8.0
|
|
3
3
|
* Project: https://github.com/braze-inc/braze-web-sdk
|
|
4
4
|
* (c) Braze, Inc. 2023 - http://braze.com
|
|
5
5
|
* License available at https://github.com/braze-inc/braze-web-sdk/blob/master/LICENSE
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
* no arguments when this card records a click.
|
|
89
89
|
*
|
|
90
90
|
* @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
|
|
91
|
-
* to cancel the subscription.
|
|
91
|
+
* to cancel the subscription. Returns null if the subscriber passed is not a function.
|
|
92
92
|
*/
|
|
93
|
-
subscribeToClickedEvent(subscriber: () => void): string;
|
|
93
|
+
subscribeToClickedEvent(subscriber: () => void): string | null;
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Subscribe to receive dismissed events. The subscriber callback will be called whenever this card is dismissed by the
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
* no arguments when this card records a dismissal.
|
|
101
101
|
*
|
|
102
102
|
* @returns The identifier of the subscription created. This can be passed to `Card.removeSubscription`
|
|
103
|
-
* to cancel the subscription.
|
|
103
|
+
* to cancel the subscription. Returns null if the subscriber passed is not a function.
|
|
104
104
|
*/
|
|
105
|
-
subscribeToDismissedEvent(subscriber: () => void): string;
|
|
105
|
+
subscribeToDismissedEvent(subscriber: () => void): string | null;
|
|
106
106
|
|
|
107
107
|
/** The id of the card. This will be reported back to Braze with events for analytics purposes. */
|
|
108
108
|
id?: string;
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
triggerId?: string;
|
|
474
474
|
|
|
475
475
|
/** Object of string/string key/value pairs. */
|
|
476
|
-
extras: Record<string,
|
|
476
|
+
extras: Record<string, string>;
|
|
477
477
|
|
|
478
478
|
/** Whether this message is a ControlMessage. */
|
|
479
479
|
isControl: boolean;
|
|
@@ -562,7 +562,7 @@
|
|
|
562
562
|
message?: string;
|
|
563
563
|
|
|
564
564
|
/** Object of string/string key/value pairs. */
|
|
565
|
-
extras: Record<string,
|
|
565
|
+
extras: Record<string, string>;
|
|
566
566
|
|
|
567
567
|
/**
|
|
568
568
|
* The id of the trigger that created this message. The SDK will report back this to
|
|
@@ -625,9 +625,9 @@
|
|
|
625
625
|
* no arguments when this message records a click.
|
|
626
626
|
*
|
|
627
627
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription`
|
|
628
|
-
* to cancel the subscription.
|
|
628
|
+
* to cancel the subscription. Returns null if the subscriber passed is not a function.
|
|
629
629
|
*/
|
|
630
|
-
subscribeToClickedEvent(subscriber: () => void): string;
|
|
630
|
+
subscribeToClickedEvent(subscriber: () => void): string | null;
|
|
631
631
|
|
|
632
632
|
/**
|
|
633
633
|
* Subscribe to receive dismissed events. The subscriber callback will be called whenever this message is closed
|
|
@@ -637,9 +637,9 @@
|
|
|
637
637
|
* no arguments when this message records a dismissal.
|
|
638
638
|
*
|
|
639
639
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription`
|
|
640
|
-
* to cancel the subscription.
|
|
640
|
+
* to cancel the subscription. Returns null if the subscriber passed is not a function.
|
|
641
641
|
*/
|
|
642
|
-
subscribeToDismissedEvent(subscriber: () => void): string;
|
|
642
|
+
subscribeToDismissedEvent(subscriber: () => void): string | null;
|
|
643
643
|
|
|
644
644
|
|
|
645
645
|
}
|
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
constructor(
|
|
699
699
|
message?: string,
|
|
700
700
|
messageAlignment?: TextAlignment,
|
|
701
|
-
extras?: Record<string,
|
|
701
|
+
extras?: Record<string, string>,
|
|
702
702
|
triggerId?: string,
|
|
703
703
|
clickAction?: ClickAction,
|
|
704
704
|
uri?: string,
|
|
@@ -857,7 +857,7 @@
|
|
|
857
857
|
constructor(
|
|
858
858
|
message?: string,
|
|
859
859
|
messageAlignment?: TextAlignment,
|
|
860
|
-
extras?: Record<string,
|
|
860
|
+
extras?: Record<string, string>,
|
|
861
861
|
triggerId?: string,
|
|
862
862
|
clickAction?: ClickAction,
|
|
863
863
|
uri?: string,
|
|
@@ -980,7 +980,7 @@
|
|
|
980
980
|
*/
|
|
981
981
|
constructor(
|
|
982
982
|
message: string,
|
|
983
|
-
extras?: Record<string,
|
|
983
|
+
extras?: Record<string, string>,
|
|
984
984
|
triggerId?: string,
|
|
985
985
|
dismissType?: DismissType,
|
|
986
986
|
duration?: number,
|
|
@@ -1047,7 +1047,7 @@
|
|
|
1047
1047
|
message: string,
|
|
1048
1048
|
messageAlignment?: TextAlignment,
|
|
1049
1049
|
slideFrom?: SlideFrom,
|
|
1050
|
-
extras?: Record<string,
|
|
1050
|
+
extras?: Record<string, string>,
|
|
1051
1051
|
triggerId?: string,
|
|
1052
1052
|
clickAction?: ClickAction,
|
|
1053
1053
|
uri?: string,
|
|
@@ -1496,9 +1496,9 @@
|
|
|
1496
1496
|
* no arguments when this button records a click.
|
|
1497
1497
|
*
|
|
1498
1498
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription`
|
|
1499
|
-
* to cancel the subscription.
|
|
1499
|
+
* to cancel the subscription. Returns null if the subscriber passed is not a function.
|
|
1500
1500
|
*/
|
|
1501
|
-
subscribeToClickedEvent(subscriber: () => void): string;
|
|
1501
|
+
subscribeToClickedEvent(subscriber: () => void): string | null;
|
|
1502
1502
|
}
|
|
1503
1503
|
|
|
1504
1504
|
export interface FeatureFlagStringProperty {
|
|
@@ -1842,7 +1842,7 @@
|
|
|
1842
1842
|
): boolean;
|
|
1843
1843
|
|
|
1844
1844
|
/**
|
|
1845
|
-
* A
|
|
1845
|
+
* A convenient method to log that the user saw the given Content Cards. This method is equivalent to
|
|
1846
1846
|
* calling [`logCardImpressions` method with `forContentCards` param set to true.
|
|
1847
1847
|
* This is done automatically when you use Braze's display module and should only be called
|
|
1848
1848
|
* if you're bypassing that and manually building the DOM for displaying content cards in
|
|
@@ -2005,7 +2005,7 @@
|
|
|
2005
2005
|
* - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
|
|
2006
2006
|
*
|
|
2007
2007
|
* ```
|
|
2008
|
-
* self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.
|
|
2008
|
+
* self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');
|
|
2009
2009
|
* ```
|
|
2010
2010
|
*
|
|
2011
2011
|
* For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
|
|
@@ -2138,10 +2138,11 @@
|
|
|
2138
2138
|
* regardless of whether new cards are available, you should use the `successCallback` of `requestContentCardsRefresh`.
|
|
2139
2139
|
*
|
|
2140
2140
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
|
|
2141
|
+
* Returns undefined if the SDK has not been initialized.
|
|
2141
2142
|
*/
|
|
2142
2143
|
export function subscribeToContentCardsUpdates(
|
|
2143
2144
|
subscriber: (cards: ContentCards) => void
|
|
2144
|
-
): string;
|
|
2145
|
+
): string | undefined;
|
|
2145
2146
|
|
|
2146
2147
|
/**
|
|
2147
2148
|
* Subscribe to news feed updates. The subscriber callback will be called whenever the news feed is updated.
|
|
@@ -2245,15 +2246,17 @@
|
|
|
2245
2246
|
* Subscribe to feature flag updates. The subscriber callback will be called whenever feature flags are updated. This method
|
|
2246
2247
|
* should be called before calling `openSession`.
|
|
2247
2248
|
*
|
|
2248
|
-
* @param subscriber - The callback function to handle new feature flags. This function
|
|
2249
|
-
*
|
|
2249
|
+
* @param subscriber - The callback function to handle new feature flags. This function is always called first with the
|
|
2250
|
+
* available cached list of `FeatureFlag` objects, and will also be called when feature flag updates are available.
|
|
2251
|
+
* If you want to be notified when a refresh has completed
|
|
2250
2252
|
* regardless of whether new feature flags are available, you should use the `successCallback` of `refreshFeatureFlags`.
|
|
2251
2253
|
*
|
|
2252
2254
|
* @returns The identifier of the subscription created. This can be passed to `removeSubscription` to cancel the subscription.
|
|
2255
|
+
* Returns undefined if the SDK has not been initialized.
|
|
2253
2256
|
*/
|
|
2254
2257
|
export function subscribeToFeatureFlagsUpdates(
|
|
2255
2258
|
subscriber: (featureFlags: FeatureFlag[]) => void
|
|
2256
|
-
): string;
|
|
2259
|
+
): string | undefined;
|
|
2257
2260
|
|
|
2258
2261
|
/**
|
|
2259
2262
|
* Gets all available feature flags.
|
|
@@ -2358,7 +2361,7 @@
|
|
|
2358
2361
|
* lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
|
|
2359
2362
|
* option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
|
|
2360
2363
|
* `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
|
|
2361
|
-
* `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.
|
|
2364
|
+
* `self.importScripts('https://js.appboycdn.com/web-sdk-develop/4.8/service-worker.js');` or by including the content
|
|
2362
2365
|
* of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
|
|
2363
2366
|
*/
|
|
2364
2367
|
manageServiceWorkerExternally?: boolean;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import je from "./encoding-utils.js";
|
|
2
2
|
import { EventTypes as ve, InternalEventTypes as De } from "./event-types.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const r = {
|
|
3
|
+
import Ie from "./guid.js";
|
|
4
|
+
import Be from "./indexed-db-adapter.js";
|
|
5
|
+
import Ae from "./logger.js";
|
|
6
|
+
import Ge from "./supported-options.js";
|
|
7
|
+
const r = { _n: je, q: ve, Cr: De, Z: Ie, xt: Be, zt: Be.ep, j: Ae, Jo: Ge };
|
|
8
8
|
export default r;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
const ve = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
4
|
+
Rl: "pc",
|
|
5
5
|
cc: "ca",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
ya: "i",
|
|
7
|
+
Is: "ie",
|
|
8
|
+
P: "cci",
|
|
9
|
+
T: "ccic",
|
|
10
|
+
$: "ccc",
|
|
11
|
+
H: "ccd",
|
|
12
|
+
Vh: "ss",
|
|
13
|
+
Fh: "se",
|
|
14
|
+
_i: "si",
|
|
15
15
|
Ii: "sc",
|
|
16
|
-
|
|
16
|
+
Mi: "sbc",
|
|
17
17
|
Ze: "sfe",
|
|
18
18
|
ro: "iec",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
Pl: "lr",
|
|
20
|
+
Ll: "uae",
|
|
21
|
+
R: "ci",
|
|
22
|
+
B: "cc",
|
|
23
|
+
Nl: "lcaa",
|
|
24
|
+
Ml: "lcar",
|
|
25
|
+
Rn: "inc",
|
|
26
|
+
Bn: "add",
|
|
27
|
+
Ln: "rem",
|
|
28
|
+
Fn: "set",
|
|
29
|
+
$n: "ncam",
|
|
30
|
+
Ol: "sgu"
|
|
31
31
|
},
|
|
32
|
-
De = {
|
|
32
|
+
De = { Ar: "feed_displayed", dc: "content_cards_displayed" };
|
|
33
33
|
export { ve as EventTypes, De as InternalEventTypes };
|
package/shared-lib/guid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const Ie = {
|
|
2
|
+
Y: () => {
|
|
3
3
|
const t = t => {
|
|
4
4
|
const e = (Math.random().toString(16) + "000000000").substr(2, 8);
|
|
5
5
|
return t ? "-" + e.substr(0, 4) + "-" + e.substr(4, 4) : e;
|
|
@@ -7,4 +7,4 @@ const Be = {
|
|
|
7
7
|
return t() + t(!0) + t(!0) + t();
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
export default
|
|
10
|
+
export default Ie;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default class
|
|
1
|
+
export default class Be {
|
|
2
2
|
constructor(t, e) {
|
|
3
3
|
(this.td = "undefined" == typeof window ? self : window),
|
|
4
4
|
(this.ed = t),
|
|
@@ -47,10 +47,10 @@ export default class Ae {
|
|
|
47
47
|
"Upgrading indexedDB " + o.ed.dd + " to v" + o.ed.VERSION + "..."
|
|
48
48
|
);
|
|
49
49
|
const e = t.target.result;
|
|
50
|
-
for (const t in o.ed
|
|
51
|
-
o.ed
|
|
52
|
-
!e.objectStoreNames.contains(o.ed
|
|
53
|
-
e.createObjectStore(o.ed
|
|
50
|
+
for (const t in o.ed.Jt)
|
|
51
|
+
o.ed.Jt.hasOwnProperty(t) &&
|
|
52
|
+
!e.objectStoreNames.contains(o.ed.Jt[t]) &&
|
|
53
|
+
e.createObjectStore(o.ed.Jt[t]);
|
|
54
54
|
}),
|
|
55
55
|
(n.onsuccess = n => {
|
|
56
56
|
const i = n.target.result;
|
|
@@ -223,7 +223,7 @@ export default class Ae {
|
|
|
223
223
|
};
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
|
|
226
|
+
Mt(t, e) {
|
|
227
227
|
if (!this.rd()) return !1;
|
|
228
228
|
const n = this;
|
|
229
229
|
return this.sd(o => {
|
|
@@ -274,10 +274,10 @@ export default class Ae {
|
|
|
274
274
|
clearData() {
|
|
275
275
|
if (!this.rd()) return !1;
|
|
276
276
|
const t = [];
|
|
277
|
-
for (const e in this.ed
|
|
278
|
-
this.ed
|
|
279
|
-
this.ed
|
|
280
|
-
t.push(this.ed
|
|
277
|
+
for (const e in this.ed.Jt)
|
|
278
|
+
this.ed.Jt.hasOwnProperty(e) &&
|
|
279
|
+
this.ed.Jt[e] !== this.ed.Jt.oe &&
|
|
280
|
+
t.push(this.ed.Jt[e]);
|
|
281
281
|
const e = this;
|
|
282
282
|
return this.sd(function(n) {
|
|
283
283
|
const o = n.transaction(t, "readwrite");
|
|
@@ -296,19 +296,19 @@ export default class Ae {
|
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
Be.ep = {
|
|
300
300
|
Ft: {
|
|
301
301
|
dd: "AppboyServiceWorkerAsyncStorage",
|
|
302
302
|
VERSION: 6,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
Jt: {
|
|
304
|
+
Xa: "data",
|
|
305
|
+
kr: "pushClicks",
|
|
306
306
|
cu: "pushSubscribed",
|
|
307
307
|
ud: "fallbackDevice",
|
|
308
|
-
|
|
308
|
+
qt: "cardUpdates",
|
|
309
309
|
oe: "optOut",
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
yr: "pendingData",
|
|
311
|
+
gu: "sdkAuthenticationSignature"
|
|
312
312
|
},
|
|
313
313
|
se: 1
|
|
314
314
|
}
|
package/shared-lib/logger.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ae = {
|
|
2
2
|
init: function(n) {
|
|
3
|
-
(void 0 === n && void 0 !==
|
|
3
|
+
(void 0 === n && void 0 !== Ae.zg) || (Ae.zg = !!n), Ae.Eg || (Ae.Eg = !0);
|
|
4
4
|
},
|
|
5
5
|
destroy: function() {
|
|
6
|
-
(
|
|
6
|
+
(Ae.Eg = !1), (Ae.zg = void 0), (Ae.nd = void 0);
|
|
7
7
|
},
|
|
8
8
|
setLogger: function(n) {
|
|
9
9
|
"function" == typeof n
|
|
10
|
-
? (
|
|
11
|
-
:
|
|
10
|
+
? (Ae.init(), (Ae.nd = n))
|
|
11
|
+
: Ae.info("Ignoring setLogger call since logger is not a function");
|
|
12
12
|
},
|
|
13
13
|
toggleLogging: function() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
? (console.log("Disabling Braze logging"), (
|
|
17
|
-
: (console.log("Enabled Braze logging"), (
|
|
14
|
+
Ae.init(),
|
|
15
|
+
Ae.zg
|
|
16
|
+
? (console.log("Disabling Braze logging"), (Ae.zg = !1))
|
|
17
|
+
: (console.log("Enabled Braze logging"), (Ae.zg = !0));
|
|
18
18
|
},
|
|
19
19
|
info: function(n) {
|
|
20
|
-
if (
|
|
20
|
+
if (Ae.zg) {
|
|
21
21
|
const o = "Braze: " + n;
|
|
22
|
-
null !=
|
|
22
|
+
null != Ae.nd ? Ae.nd(o) : console.log(o);
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
warn: function(n) {
|
|
26
|
-
if (
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v4.
|
|
28
|
-
null !=
|
|
26
|
+
if (Ae.zg) {
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v4.8.0)";
|
|
28
|
+
null != Ae.nd ? Ae.nd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function(n) {
|
|
32
|
-
if (
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v4.
|
|
34
|
-
null !=
|
|
32
|
+
if (Ae.zg) {
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v4.8.0)";
|
|
34
|
+
null != Ae.nd ? Ae.nd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
export default
|
|
38
|
+
export default Ae;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
ho: "allowCrawlerActivity",
|
|
3
|
+
Eo: "baseUrl",
|
|
4
|
+
_o: "noCookies",
|
|
5
|
+
Io: "devicePropertyAllowlist",
|
|
6
6
|
ia: "disablePushTokenMaintenance",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Ao: "enableLogging",
|
|
8
|
+
So: "enableSdkAuthentication",
|
|
9
9
|
ta: "manageServiceWorkerExternally",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
No: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
|
+
wo: "sessionTimeoutInSeconds",
|
|
12
|
+
To: "appVersion",
|
|
13
13
|
na: "serviceWorkerLocation",
|
|
14
14
|
ra: "safariWebsitePushId",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
Mn: "localization",
|
|
16
|
+
lo: "contentSecurityNonce",
|
|
17
|
+
Oo: "enableHtmlInAppMessages",
|
|
18
|
+
Co: "allowUserSuppliedJavascript",
|
|
19
|
+
mo: "inAppMessageZIndex",
|
|
20
|
+
po: "openInAppMessagesInNewTab",
|
|
21
21
|
en: "openNewsFeedCardsInNewTab",
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
Lh: "requireExplicitInAppMessageDismissal",
|
|
23
|
+
Lo: "doNotLoadFontAwesome",
|
|
24
|
+
Po: "sdkFlavor",
|
|
25
25
|
tn: "openCardsInNewTab"
|
|
26
26
|
};
|
|
@@ -3,9 +3,9 @@ import e from "../managers/braze-instance.js";
|
|
|
3
3
|
const n = {
|
|
4
4
|
t: !1,
|
|
5
5
|
i: null,
|
|
6
|
-
m: () => (n.o(), n.i || (n.i = new a(e.l()
|
|
6
|
+
m: () => (n.o(), n.i || (n.i = new a(e.l())), n.i),
|
|
7
7
|
o: () => {
|
|
8
|
-
n.t || (e.
|
|
8
|
+
n.t || (e.g(n), (n.t = !0));
|
|
9
9
|
},
|
|
10
10
|
destroy: () => {
|
|
11
11
|
(n.i = null), (n.t = !1);
|
package/src/Card/card-manager.js
CHANGED
|
@@ -2,71 +2,77 @@ import { ControlCard } from "./models/index.js";
|
|
|
2
2
|
import s from "../common/event-logger.js";
|
|
3
3
|
import t from "../models/request-result.js";
|
|
4
4
|
import r from "../../shared-lib/braze-shared-lib.js";
|
|
5
|
-
import { STORAGE_KEYS as
|
|
5
|
+
import { STORAGE_KEYS as i } from "../managers/storage-manager.js";
|
|
6
6
|
export default class a {
|
|
7
|
-
constructor(s
|
|
8
|
-
(this.
|
|
7
|
+
constructor(s) {
|
|
8
|
+
(this.u = s), (this.u = s);
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
h(n, o) {
|
|
11
11
|
const e = new t();
|
|
12
|
-
if ((n.
|
|
12
|
+
if ((n.p(), null == n.url || "" === n.url))
|
|
13
13
|
return (
|
|
14
|
-
r.
|
|
14
|
+
r.j.info(
|
|
15
15
|
`Card ${n.id} has no url. Not logging click to Braze servers.`
|
|
16
16
|
),
|
|
17
17
|
e
|
|
18
18
|
);
|
|
19
|
-
if (
|
|
20
|
-
const s = this.
|
|
21
|
-
(s[n.id] = !0), this.
|
|
19
|
+
if (o && n.id && this.u) {
|
|
20
|
+
const s = this.u.v(i.k.C) || {};
|
|
21
|
+
(s[n.id] = !0), this.u.D(i.k.C, s);
|
|
22
22
|
}
|
|
23
|
-
const l = this.
|
|
23
|
+
const l = this.I([n]);
|
|
24
24
|
if (null == l) return e;
|
|
25
|
-
const u =
|
|
26
|
-
return s.
|
|
25
|
+
const u = o ? r.q.$ : r.q.B;
|
|
26
|
+
return s.N(u, l);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
if (!n.
|
|
28
|
+
A(n) {
|
|
29
|
+
const o = new t();
|
|
30
|
+
if (!n.F())
|
|
31
31
|
return (
|
|
32
|
-
r.
|
|
32
|
+
r.j.info(
|
|
33
33
|
`Card ${n.id} refused this dismissal. Ignoring analytics event.`
|
|
34
34
|
),
|
|
35
|
-
|
|
35
|
+
o
|
|
36
36
|
);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
if (n.id && this.u) {
|
|
38
|
+
const s = this.u.v(i.k.G) || {};
|
|
39
|
+
(s[n.id] = !0), this.u.D(i.k.G, s);
|
|
40
|
+
}
|
|
41
|
+
const e = this.I([n]);
|
|
42
|
+
return null == e ? o : s.N(r.q.H, e);
|
|
41
43
|
}
|
|
42
|
-
|
|
44
|
+
J(n, o) {
|
|
43
45
|
const e = new t(!0),
|
|
44
46
|
l = [],
|
|
45
47
|
u = [];
|
|
46
48
|
let a;
|
|
47
|
-
a =
|
|
49
|
+
this.u && (a = o ? this.u.v(i.k.K) || {} : this.u.v(i.k.L) || {});
|
|
48
50
|
for (const s of n)
|
|
49
|
-
s.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
s.M(),
|
|
52
|
+
s instanceof ControlCard ? u.push(s) : l.push(s),
|
|
53
|
+
s.id && (a[s.id] = !0);
|
|
54
|
+
const h = this.I(l),
|
|
55
|
+
c = this.I(u);
|
|
56
|
+
if (null == h && null == c) return (e.O = !1), e;
|
|
57
|
+
if ((this.u && (o ? this.u.D(i.k.K, a) : this.u.D(i.k.L, a)), null != h)) {
|
|
58
|
+
const t = o ? r.q.P : r.q.R,
|
|
59
|
+
n = s.N(t, h);
|
|
60
|
+
e.S(n);
|
|
57
61
|
}
|
|
58
|
-
if (null !=
|
|
59
|
-
const t = s.
|
|
60
|
-
e.
|
|
62
|
+
if (null != c && o) {
|
|
63
|
+
const t = s.N(r.q.T, c);
|
|
64
|
+
e.S(t);
|
|
61
65
|
}
|
|
62
66
|
return e;
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
let t
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
I(s) {
|
|
69
|
+
let t,
|
|
70
|
+
r = null;
|
|
71
|
+
for (let n = 0; n < s.length; n++)
|
|
72
|
+
(t = s[n].id),
|
|
73
|
+
null != t &&
|
|
74
|
+
"" !== t &&
|
|
75
|
+
((r = r || {}), (r.ids = r.ids || []), r.ids.push(t));
|
|
76
|
+
return r;
|
|
71
77
|
}
|
|
72
78
|
}
|