@braze/web-sdk 6.0.0 → 6.1.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 +103 -33
- package/package.json +1 -1
- package/shared-lib/encoding-utils.js +1 -1
- package/shared-lib/event-types.js +22 -22
- package/shared-lib/guid.js +3 -3
- package/shared-lib/indexed-db-adapter.js +19 -19
- package/shared-lib/logger.js +18 -18
- package/shared-lib/supported-options.js +15 -15
- package/src/Banner/banner-factory.js +2 -1
- package/src/Banner/banner-provider-factory.js +7 -7
- package/src/Banner/banner-provider.js +92 -98
- package/src/Banner/banner.js +21 -18
- package/src/Banner/display/banner-to-html.js +9 -9
- package/src/Banner/display/destroy-banner-html.js +2 -2
- package/src/Banner/display/detect-banner-impressions.js +2 -2
- package/src/Banner/get-all-banners.js +5 -5
- package/src/Banner/get-banner.js +7 -7
- package/src/Banner/log-banner-click.js +7 -7
- package/src/Banner/log-banner-impressions.js +9 -9
- package/src/Banner/request-banners-refresh.js +16 -20
- package/src/Banner/subscribe-to-banners-updates.js +7 -7
- package/src/Banner/ui/insert-banner.js +6 -6
- package/src/Card/card-manager-factory.js +7 -7
- package/src/Card/card-manager.js +35 -35
- package/src/Card/display/card-display.js +11 -11
- package/src/Card/log-card-dismissal.js +4 -4
- package/src/Card/log-content-card-click.js +4 -4
- package/src/Card/log-content-card-impressions.js +6 -6
- package/src/Card/models/captioned-image.js +21 -21
- package/src/Card/models/card.js +68 -68
- package/src/Card/models/classic-card.js +21 -21
- package/src/Card/models/control-card.js +11 -11
- package/src/Card/models/image-only.js +18 -18
- package/src/Card/util/card-factory.js +35 -35
- package/src/ContentCards/content-cards-provider-factory.js +13 -13
- package/src/ContentCards/content-cards-provider.js +136 -136
- package/src/ContentCards/get-cached-content-cards.js +2 -2
- package/src/ContentCards/request-content-cards-refresh.js +2 -2
- package/src/ContentCards/subscribe-to-content-cards-updates.js +6 -6
- package/src/ContentCards/ui/show-content-cards.js +7 -7
- package/src/Core/add-sdk-metadata.js +3 -3
- package/src/Core/change-user.js +7 -7
- package/src/Core/destroy.js +2 -2
- package/src/Core/disable-sdk.js +8 -8
- package/src/Core/enable-sdk.js +6 -6
- package/src/Core/get-device-id.js +4 -4
- package/src/Core/handle-braze-action.js +5 -5
- package/src/Core/is-disabled.js +1 -1
- package/src/Core/log-custom-event.js +10 -10
- package/src/Core/log-purchase.js +13 -13
- package/src/Core/open-session.js +10 -10
- package/src/Core/set-logger.js +2 -2
- package/src/Core/set-sdk-authentication-signature.js +2 -2
- package/src/Core/toggle-logging.js +2 -2
- package/src/Core/wipe-data.js +7 -7
- package/src/FeatureFlags/feature-flag-factory.js +10 -10
- package/src/FeatureFlags/feature-flag.js +20 -71
- package/src/FeatureFlags/feature-flags-provider-factory.js +12 -12
- package/src/FeatureFlags/feature-flags-provider.js +87 -87
- package/src/FeatureFlags/get-all-feature-flags.js +4 -4
- package/src/FeatureFlags/get-feature-flag.js +4 -4
- package/src/FeatureFlags/log-feature-flag-impression.js +9 -9
- package/src/FeatureFlags/refresh-feature-flags.js +2 -2
- package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -4
- package/src/InAppMessage/defer-in-app-message.js +4 -4
- package/src/InAppMessage/display/html-message-to-html.js +10 -10
- package/src/InAppMessage/display/in-app-message-to-html.js +28 -28
- package/src/InAppMessage/display/modal-utils.js +7 -7
- package/src/InAppMessage/in-app-message-factory.js +15 -15
- package/src/InAppMessage/in-app-message-manager-factory.js +5 -5
- package/src/InAppMessage/in-app-message-manager.js +100 -100
- package/src/InAppMessage/log-in-app-message-button-click.js +9 -9
- package/src/InAppMessage/log-in-app-message-click.js +6 -6
- package/src/InAppMessage/log-in-app-message-html-click.js +9 -9
- 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 +35 -35
- package/src/InAppMessage/models/html-message.js +21 -21
- package/src/InAppMessage/models/in-app-message-button.js +5 -5
- package/src/InAppMessage/models/in-app-message.js +75 -75
- package/src/InAppMessage/models/modal-message.js +34 -34
- package/src/InAppMessage/models/slide-up-message.js +31 -31
- 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 +19 -19
- package/src/Push/push-manager-factory.js +9 -9
- package/src/Push/push-manager.js +118 -118
- package/src/Push/utils/push-utils.js +9 -9
- package/src/User/user-manager.js +20 -20
- package/src/User/user.js +44 -45
- package/src/common/base-provider.js +1 -1
- package/src/common/content-cards-display.js +18 -18
- package/src/common/event-logger.js +10 -10
- package/src/common/properties-base.js +56 -0
- package/src/l10n/l10n-manager-factory.js +7 -7
- package/src/l10n/l10n-manager.js +4 -4
- package/src/managers/auth-manager.js +32 -32
- package/src/managers/braze-instance.js +143 -143
- package/src/managers/device-manager.js +22 -22
- package/src/managers/network-manager.js +172 -168
- package/src/managers/server-config-manager.js +73 -73
- package/src/managers/session-manager.js +40 -40
- package/src/managers/storage-manager-factory.js +6 -6
- package/src/managers/storage-manager.js +97 -97
- package/src/managers/subscription-manager.js +12 -12
- package/src/managers/utils.js +1 -1
- package/src/models/backend-errors.js +5 -5
- package/src/models/braze-event.js +5 -5
- package/src/models/device.js +2 -2
- package/src/models/identifier.js +12 -12
- package/src/models/push-token.js +13 -13
- package/src/models/request-result.js +4 -4
- package/src/models/server-config.js +31 -31
- package/src/request-controller.js +159 -159
- package/src/triggers/models/custom-event-data.js +1 -1
- package/src/triggers/models/custom-event-property-data.js +2 -2
- package/src/triggers/models/filter-set.js +6 -6
- package/src/triggers/models/filter.js +26 -26
- 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 +37 -37
- package/src/triggers/models/trigger-events.js +3 -3
- package/src/triggers/models/trigger.js +16 -16
- package/src/triggers/triggers-provider-factory.js +12 -12
- package/src/triggers/triggers-provider.js +61 -61
- 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/braze-actions.js +6 -6
- package/src/util/browser-detector.js +20 -13
- package/src/util/client-hints-parser.js +6 -6
- package/src/util/code-utils.js +2 -2
- package/src/util/component-utils.js +1 -1
- package/src/util/deprecation-utils.js +2 -2
- package/src/util/device-constants.js +4 -4
- package/src/util/dom-utils.js +9 -9
- package/src/util/html-display-utils.js +7 -7
- package/src/util/key-codes.js +1 -1
- package/src/util/net.js +12 -12
- package/src/util/request-header-utils.js +22 -22
- package/src/util/string-utils.js +2 -2
- package/src/util/user-agent-parser.js +16 -16
- package/src/util/validation-utils.js +12 -12
- package/src/util/window-utils.js +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Type definitions for @braze/web-sdk v6.
|
|
2
|
+
* Type definitions for @braze/web-sdk v6.1.0
|
|
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
|
|
@@ -1542,64 +1542,66 @@ export class InAppMessageButton {
|
|
|
1542
1542
|
subscribeToClickedEvent(subscriber: () => void): string | null;
|
|
1543
1543
|
}
|
|
1544
1544
|
|
|
1545
|
-
export interface
|
|
1545
|
+
export interface StringProperty {
|
|
1546
1546
|
type: "string";
|
|
1547
1547
|
value: string;
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
|
-
export interface
|
|
1550
|
+
export interface NumberProperty {
|
|
1551
1551
|
type: "number";
|
|
1552
1552
|
value: number;
|
|
1553
1553
|
}
|
|
1554
1554
|
|
|
1555
|
-
export interface
|
|
1555
|
+
export interface BooleanProperty {
|
|
1556
1556
|
type: "boolean";
|
|
1557
1557
|
value: boolean;
|
|
1558
1558
|
}
|
|
1559
1559
|
|
|
1560
|
-
export interface
|
|
1560
|
+
export interface ImageProperty {
|
|
1561
1561
|
type: "image";
|
|
1562
1562
|
value: string;
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
|
-
export interface
|
|
1565
|
+
export interface TimestampProperty {
|
|
1566
1566
|
type: "datetime";
|
|
1567
1567
|
value: number;
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
1570
|
-
export type
|
|
1571
|
-
export interface
|
|
1570
|
+
export type JsonPropertyValue = Partial<Record<string, any>>;
|
|
1571
|
+
export interface JsonProperty {
|
|
1572
1572
|
type: "jsonobject";
|
|
1573
|
-
value:
|
|
1573
|
+
value: JsonPropertyValue;
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
|
+
export type PropertiesJson = Partial<
|
|
1577
|
+
Record<
|
|
1578
|
+
string,
|
|
1579
|
+
| StringProperty
|
|
1580
|
+
| NumberProperty
|
|
1581
|
+
| BooleanProperty
|
|
1582
|
+
| ImageProperty
|
|
1583
|
+
| JsonProperty
|
|
1584
|
+
| TimestampProperty
|
|
1585
|
+
>
|
|
1586
|
+
>;
|
|
1587
|
+
|
|
1576
1588
|
export class FeatureFlag {
|
|
1577
1589
|
/** Indicates whether or not this feature flag is enabled. */
|
|
1578
1590
|
enabled: boolean;
|
|
1579
1591
|
|
|
1592
|
+
/** The ID for this feature flag. */
|
|
1593
|
+
id: string;
|
|
1594
|
+
|
|
1580
1595
|
/**
|
|
1581
|
-
* Properties of this
|
|
1596
|
+
* Properties of this object.
|
|
1582
1597
|
*
|
|
1583
1598
|
* Avoid accessing these properties directly. Instead, prefer using the `getStringProperty`, `getBooleanProperty`, `getNumberProperty`,
|
|
1584
1599
|
* `getImageProperty` and `getJsonProperty` methods which ensure type safety and to avoid breaking changes in the future.
|
|
1585
1600
|
*/
|
|
1586
|
-
properties:
|
|
1587
|
-
Record<
|
|
1588
|
-
string,
|
|
1589
|
-
| FeatureFlagStringProperty
|
|
1590
|
-
| FeatureFlagNumberProperty
|
|
1591
|
-
| FeatureFlagBooleanProperty
|
|
1592
|
-
| FeatureFlagImageProperty
|
|
1593
|
-
| FeatureFlagJsonProperty
|
|
1594
|
-
| FeatureFlagTimestampProperty
|
|
1595
|
-
>
|
|
1596
|
-
>;
|
|
1597
|
-
|
|
1598
|
-
/** The ID for this feature flag. */
|
|
1599
|
-
id: string;
|
|
1601
|
+
properties: PropertiesJson;
|
|
1600
1602
|
|
|
1601
1603
|
/**
|
|
1602
|
-
* Get value of a
|
|
1604
|
+
* Get value of a property of type string.
|
|
1603
1605
|
*
|
|
1604
1606
|
* @param key - The key of the property.
|
|
1605
1607
|
*
|
|
@@ -1609,7 +1611,7 @@ export class FeatureFlag {
|
|
|
1609
1611
|
getStringProperty(key: string): string | null;
|
|
1610
1612
|
|
|
1611
1613
|
/**
|
|
1612
|
-
* Get value of a
|
|
1614
|
+
* Get value of a property of type number.
|
|
1613
1615
|
*
|
|
1614
1616
|
* @param key - The key of the property.
|
|
1615
1617
|
*
|
|
@@ -1619,7 +1621,7 @@ export class FeatureFlag {
|
|
|
1619
1621
|
getNumberProperty(key: string): number | null;
|
|
1620
1622
|
|
|
1621
1623
|
/**
|
|
1622
|
-
* Get value of a
|
|
1624
|
+
* Get value of a property of type boolean.
|
|
1623
1625
|
*
|
|
1624
1626
|
* @param key - The key of the property.
|
|
1625
1627
|
*
|
|
@@ -1629,7 +1631,7 @@ export class FeatureFlag {
|
|
|
1629
1631
|
getBooleanProperty(key: string): boolean | null;
|
|
1630
1632
|
|
|
1631
1633
|
/**
|
|
1632
|
-
* Get value of a
|
|
1634
|
+
* Get value of a property of type image.
|
|
1633
1635
|
*
|
|
1634
1636
|
* @param key - The key of the property.
|
|
1635
1637
|
*
|
|
@@ -1639,17 +1641,17 @@ export class FeatureFlag {
|
|
|
1639
1641
|
getImageProperty(key: string): string | null;
|
|
1640
1642
|
|
|
1641
1643
|
/**
|
|
1642
|
-
* Get value of a
|
|
1644
|
+
* Get value of a property of type JSON.
|
|
1643
1645
|
*
|
|
1644
1646
|
* @param key - The key of the property.
|
|
1645
1647
|
*
|
|
1646
1648
|
* @returns The value of the property if the key is found and is of type JSON.
|
|
1647
1649
|
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1648
1650
|
*/
|
|
1649
|
-
getJsonProperty(key: string):
|
|
1651
|
+
getJsonProperty(key: string): JsonPropertyValue | null;
|
|
1650
1652
|
|
|
1651
1653
|
/**
|
|
1652
|
-
* Get value of a
|
|
1654
|
+
* Get value of a property of type datetime as a Unix timestamp (milliseconds).
|
|
1653
1655
|
*
|
|
1654
1656
|
* @param key - The key of the property.
|
|
1655
1657
|
*
|
|
@@ -1670,6 +1672,74 @@ export class Banner {
|
|
|
1670
1672
|
|
|
1671
1673
|
/** Whether this banner is a control banner. */
|
|
1672
1674
|
isControl: boolean;
|
|
1675
|
+
|
|
1676
|
+
/**
|
|
1677
|
+
* Properties of this object.
|
|
1678
|
+
*
|
|
1679
|
+
* Avoid accessing these properties directly. Instead, prefer using the `getStringProperty`, `getBooleanProperty`, `getNumberProperty`,
|
|
1680
|
+
* `getImageProperty` and `getJsonProperty` methods which ensure type safety and to avoid breaking changes in the future.
|
|
1681
|
+
*/
|
|
1682
|
+
properties: PropertiesJson;
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
* Get value of a property of type string.
|
|
1686
|
+
*
|
|
1687
|
+
* @param key - The key of the property.
|
|
1688
|
+
*
|
|
1689
|
+
* @returns The value of the property if the key is found and is of type string.
|
|
1690
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1691
|
+
*/
|
|
1692
|
+
getStringProperty(key: string): string | null;
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Get value of a property of type number.
|
|
1696
|
+
*
|
|
1697
|
+
* @param key - The key of the property.
|
|
1698
|
+
*
|
|
1699
|
+
* @returns The value of the property if the key is found and is of type number.
|
|
1700
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1701
|
+
*/
|
|
1702
|
+
getNumberProperty(key: string): number | null;
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Get value of a property of type boolean.
|
|
1706
|
+
*
|
|
1707
|
+
* @param key - The key of the property.
|
|
1708
|
+
*
|
|
1709
|
+
* @returns The value of the property if the key is found and is of type boolean.
|
|
1710
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1711
|
+
*/
|
|
1712
|
+
getBooleanProperty(key: string): boolean | null;
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Get value of a property of type image.
|
|
1716
|
+
*
|
|
1717
|
+
* @param key - The key of the property.
|
|
1718
|
+
*
|
|
1719
|
+
* @returns The string value of the image url if the key is found and is of type image.
|
|
1720
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1721
|
+
*/
|
|
1722
|
+
getImageProperty(key: string): string | null;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Get value of a property of type JSON.
|
|
1726
|
+
*
|
|
1727
|
+
* @param key - The key of the property.
|
|
1728
|
+
*
|
|
1729
|
+
* @returns The value of the property if the key is found and is of type JSON.
|
|
1730
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1731
|
+
*/
|
|
1732
|
+
getJsonProperty(key: string): JsonPropertyValue | null;
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Get value of a property of type datetime as a Unix timestamp (milliseconds).
|
|
1736
|
+
*
|
|
1737
|
+
* @param key - The key of the property.
|
|
1738
|
+
*
|
|
1739
|
+
* @returns The Unix timestamp (milliseconds) value of the property if the key is found and is of type datetime.
|
|
1740
|
+
* If the key is not found or if there is a type mismatch, this method will return a null.
|
|
1741
|
+
*/
|
|
1742
|
+
getTimestampProperty(key: string): number | null;
|
|
1673
1743
|
}
|
|
1674
1744
|
|
|
1675
1745
|
/**
|
|
@@ -2068,7 +2138,7 @@ export function openSession(): void;
|
|
|
2068
2138
|
* - Create a `service-worker.js` file with the content below and place it in the root directory of your website:
|
|
2069
2139
|
*
|
|
2070
2140
|
* ```
|
|
2071
|
-
* self.importScripts('https://js.appboycdn.com/web-sdk
|
|
2141
|
+
* self.importScripts('https://js.appboycdn.com/web-sdk/6.1/service-worker.js');
|
|
2072
2142
|
* ```
|
|
2073
2143
|
*
|
|
2074
2144
|
* For more details, see [Our Product Documentation](https://www.braze.com/docs/developer_guide/platform_integration_guides/web/push_notifications/integration).
|
|
@@ -2491,7 +2561,7 @@ export type InitializationOptions = {
|
|
|
2491
2561
|
* lifecycle of, set this option to true and the Braze SDK will not register or unregister a service worker. If you set this
|
|
2492
2562
|
* option to true, in order for push to function correctly you must register the service worker yourself BEFORE calling
|
|
2493
2563
|
* `requestPushPermission`, and ensure that it contains Braze's service worker code, either with
|
|
2494
|
-
* `self.importScripts('https://js.appboycdn.com/web-sdk
|
|
2564
|
+
* `self.importScripts('https://js.appboycdn.com/web-sdk/6.1/service-worker.js');` or by including the content
|
|
2495
2565
|
* of that file directly. When this option is true, the `serviceWorkerLocation` option is irrelevant and is ignored.
|
|
2496
2566
|
*/
|
|
2497
2567
|
manageServiceWorkerExternally?: boolean;
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m = {
|
|
2
2
|
CustomEvent: "ce",
|
|
3
3
|
Pr: "p",
|
|
4
|
-
|
|
4
|
+
uc: "pc",
|
|
5
5
|
Cc: "ca",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
wu: "i",
|
|
7
|
+
pu: "ie",
|
|
8
|
+
Ut: "cci",
|
|
9
|
+
Wt: "ccic",
|
|
10
|
+
Ht: "ccc",
|
|
11
|
+
Mt: "ccd",
|
|
12
|
+
Al: "ss",
|
|
13
|
+
Dl: "se",
|
|
14
|
+
Gi: "si",
|
|
15
|
+
$i: "sc",
|
|
16
|
+
Fi: "sbc",
|
|
17
17
|
yc: "sfe",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
zo: "iec",
|
|
19
|
+
lc: "lr",
|
|
20
|
+
nc: "uae",
|
|
21
|
+
mc: "lcaa",
|
|
22
|
+
dc: "lcar",
|
|
23
23
|
Gn: "inc",
|
|
24
24
|
Rn: "add",
|
|
25
25
|
On: "rem",
|
|
26
26
|
$n: "set",
|
|
27
27
|
Bn: "ncam",
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
fc: "sgu",
|
|
29
|
+
Fr: "ffi",
|
|
30
30
|
ro: "bi",
|
|
31
|
-
|
|
31
|
+
ot: "bc",
|
|
32
32
|
},
|
|
33
33
|
Ee = { Mc: "content_cards_displayed" };
|
|
34
|
-
export {
|
|
34
|
+
export { m as EventTypes, Ee as InternalEventTypes };
|
package/shared-lib/guid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const P = {
|
|
2
|
+
oe: function () {
|
|
3
3
|
const t = (t = !1) => {
|
|
4
4
|
const n = (Math.random().toString(16) + "000000000").substr(2, 8);
|
|
5
5
|
return t ? "-" + n.substr(0, 4) + "-" + n.substr(4, 4) : n;
|
|
@@ -7,4 +7,4 @@ const O = {
|
|
|
7
7
|
return t() + t(!0) + t(!0) + t();
|
|
8
8
|
},
|
|
9
9
|
};
|
|
10
|
-
export default
|
|
10
|
+
export default P;
|
|
@@ -64,11 +64,11 @@ export default class et {
|
|
|
64
64
|
"...",
|
|
65
65
|
);
|
|
66
66
|
const n = null === (e = t.target) || void 0 === e ? void 0 : e.result;
|
|
67
|
-
for (const t in i.database.
|
|
67
|
+
for (const t in i.database.Fs) {
|
|
68
68
|
const e = t;
|
|
69
|
-
i.database.
|
|
70
|
-
!n.objectStoreNames.contains(i.database.
|
|
71
|
-
n.createObjectStore(i.database.
|
|
69
|
+
i.database.Fs.hasOwnProperty(t) &&
|
|
70
|
+
!n.objectStoreNames.contains(i.database.Fs[e]) &&
|
|
71
|
+
n.createObjectStore(i.database.Fs[e]);
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
74
|
(o.onsuccess = (n) => {
|
|
@@ -216,7 +216,7 @@ export default class et {
|
|
|
216
216
|
});
|
|
217
217
|
}, n);
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
be(t, e) {
|
|
220
220
|
if (!this.isSupported()) return !1;
|
|
221
221
|
const n = this;
|
|
222
222
|
return this.Bd((o) => {
|
|
@@ -249,7 +249,7 @@ export default class et {
|
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
Ds(t, e) {
|
|
253
253
|
if (!this.isSupported()) return !1;
|
|
254
254
|
const n = this;
|
|
255
255
|
return this.Bd((o) => {
|
|
@@ -304,11 +304,11 @@ export default class et {
|
|
|
304
304
|
clearData() {
|
|
305
305
|
if (!this.isSupported()) return !1;
|
|
306
306
|
const t = [];
|
|
307
|
-
for (const e in this.database.
|
|
307
|
+
for (const e in this.database.Fs) {
|
|
308
308
|
const n = e;
|
|
309
|
-
this.database.
|
|
310
|
-
this.database.
|
|
311
|
-
t.push(this.database.
|
|
309
|
+
this.database.Fs.hasOwnProperty(e) &&
|
|
310
|
+
this.database.Fs[n] !== this.database.Fs.le &&
|
|
311
|
+
t.push(this.database.Fs[n]);
|
|
312
312
|
}
|
|
313
313
|
const e = this;
|
|
314
314
|
return this.Bd(function (n) {
|
|
@@ -333,20 +333,20 @@ export default class et {
|
|
|
333
333
|
});
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
et.
|
|
337
|
-
|
|
336
|
+
et.Us = {
|
|
337
|
+
Rs: {
|
|
338
338
|
Sd: "AppboyServiceWorkerAsyncStorage",
|
|
339
339
|
VERSION: 6,
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
Fs: {
|
|
341
|
+
Tu: "data",
|
|
342
342
|
hr: "pushClicks",
|
|
343
343
|
cu: "pushSubscribed",
|
|
344
344
|
Cd: "fallbackDevice",
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
As: "cardUpdates",
|
|
346
|
+
le: "optOut",
|
|
347
|
+
wr: "pendingData",
|
|
348
|
+
xh: "sdkAuthenticationSignature",
|
|
349
349
|
},
|
|
350
|
-
|
|
350
|
+
me: 1,
|
|
351
351
|
},
|
|
352
352
|
};
|
package/shared-lib/logger.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = {
|
|
2
2
|
init: function (n) {
|
|
3
|
-
(void 0 === n && void 0 !==
|
|
3
|
+
(void 0 === n && void 0 !== E.zg) || (E.zg = !!n), E.i || (E.i = !0);
|
|
4
4
|
},
|
|
5
5
|
destroy: function () {
|
|
6
|
-
(
|
|
6
|
+
(E.i = !1), (E.zg = void 0), (E.vd = void 0);
|
|
7
7
|
},
|
|
8
8
|
setLogger: function (n) {
|
|
9
9
|
"function" == typeof n
|
|
10
|
-
? (
|
|
11
|
-
:
|
|
10
|
+
? (E.init(), (E.vd = n))
|
|
11
|
+
: E.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
|
+
E.init(),
|
|
15
|
+
E.zg
|
|
16
|
+
? (console.log("Disabling Braze logging"), (E.zg = !1))
|
|
17
|
+
: (console.log("Enabled Braze logging"), (E.zg = !0));
|
|
18
18
|
},
|
|
19
19
|
info: function (n) {
|
|
20
|
-
if (
|
|
20
|
+
if (E.zg) {
|
|
21
21
|
const o = "Braze: " + n;
|
|
22
|
-
null !=
|
|
22
|
+
null != E.vd ? E.vd(o) : console.log(o);
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
warn: function (n) {
|
|
26
|
-
if (
|
|
27
|
-
const o = "Braze SDK Warning: " + n + " (v6.
|
|
28
|
-
null !=
|
|
26
|
+
if (E.zg) {
|
|
27
|
+
const o = "Braze SDK Warning: " + n + " (v6.1.0)";
|
|
28
|
+
null != E.vd ? E.vd(o) : console.warn(o);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
error: function (n) {
|
|
32
|
-
if (
|
|
33
|
-
const o = "Braze SDK Error: " + n + " (v6.
|
|
34
|
-
null !=
|
|
32
|
+
if (E.zg) {
|
|
33
|
+
const o = "Braze SDK Error: " + n + " (v6.1.0)";
|
|
34
|
+
null != E.vd ? E.vd(o) : console.error(o);
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
-
export default
|
|
38
|
+
export default E;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
_o: "allowCrawlerActivity",
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Ro: "baseUrl",
|
|
4
|
+
Wo: "noCookies",
|
|
5
|
+
Vo: "devicePropertyAllowlist",
|
|
6
6
|
Aa: "disablePushTokenMaintenance",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Yo: "enableLogging",
|
|
8
|
+
Xo: "enableSdkAuthentication",
|
|
9
9
|
qa: "manageServiceWorkerExternally",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
Zo: "minimumIntervalBetweenTriggerActionsInSeconds",
|
|
11
|
+
Wh: "sessionTimeoutInSeconds",
|
|
12
|
+
Vh: "appVersion",
|
|
13
|
+
Kh: "appVersionNumber",
|
|
14
14
|
Ma: "serviceWorkerLocation",
|
|
15
15
|
ka: "safariWebsitePushId",
|
|
16
|
-
|
|
16
|
+
Xn: "localization",
|
|
17
17
|
er: "contentSecurityNonce",
|
|
18
18
|
re: "allowUserSuppliedJavascript",
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Jo: "inAppMessageZIndex",
|
|
20
|
+
Do: "openInAppMessagesInNewTab",
|
|
21
21
|
Lh: "requireExplicitInAppMessageDismissal",
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
$h: "doNotLoadFontAwesome",
|
|
23
|
+
Jh: "deviceId",
|
|
24
24
|
_a: "serviceWorkerScope",
|
|
25
|
-
|
|
25
|
+
Yh: "sdkFlavor",
|
|
26
26
|
tn: "openCardsInNewTab",
|
|
27
27
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Banner from "./banner.js";
|
|
2
2
|
export function newBannerFromSerializedValue(n) {
|
|
3
|
-
return new Banner(n.id, n.
|
|
3
|
+
return new Banner(n.id, n.pid, n.html, n.its, n.ic, n.eat, n.pr);
|
|
4
4
|
}
|
|
5
5
|
export function newBannerFromJson(n) {
|
|
6
6
|
return new Banner(
|
|
@@ -10,5 +10,6 @@ export function newBannerFromJson(n) {
|
|
|
10
10
|
n.is_test_send,
|
|
11
11
|
n.is_control,
|
|
12
12
|
n.expires_at,
|
|
13
|
+
n.properties,
|
|
13
14
|
);
|
|
14
15
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import r from "../managers/braze-instance.js";
|
|
2
2
|
import e from "./banner-provider.js";
|
|
3
3
|
const i = {
|
|
4
|
-
|
|
4
|
+
i: !1,
|
|
5
5
|
provider: null,
|
|
6
|
-
|
|
7
|
-
i.
|
|
6
|
+
o: () => (
|
|
7
|
+
i.t(),
|
|
8
8
|
i.provider ||
|
|
9
|
-
((i.provider = new e(r.
|
|
9
|
+
((i.provider = new e(r.l(), r.m(), r.p(), r.u())), r.v(i.provider)),
|
|
10
10
|
i.provider
|
|
11
11
|
),
|
|
12
|
-
|
|
13
|
-
i.
|
|
12
|
+
t: () => {
|
|
13
|
+
i.i || (r.g(i), (i.i = !0));
|
|
14
14
|
},
|
|
15
15
|
destroy: () => {
|
|
16
|
-
(i.provider = null), (i.
|
|
16
|
+
(i.provider = null), (i.i = !1);
|
|
17
17
|
},
|
|
18
18
|
};
|
|
19
19
|
export default i;
|