@metamask-previews/notification-services-controller 0.1.0-preview-caf274f8 → 0.1.0-preview-ed5d0223
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/dist/NotificationServicesController/NotificationServicesController.js +3 -3
- package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -2
- package/dist/NotificationServicesController/constants/constants.js +1 -1
- package/dist/NotificationServicesController/constants/constants.mjs +1 -1
- package/dist/NotificationServicesController/constants/index.js +2 -2
- package/dist/NotificationServicesController/constants/index.mjs +2 -2
- package/dist/NotificationServicesController/constants/notification-schema.js +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.mjs +1 -1
- package/dist/NotificationServicesController/index.js +6 -6
- package/dist/NotificationServicesController/index.mjs +5 -5
- package/dist/NotificationServicesController/processors/index.js +2 -2
- package/dist/NotificationServicesController/processors/index.mjs +2 -2
- package/dist/NotificationServicesController/processors/process-feature-announcement.js +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.js +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.mjs +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.js +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.mjs +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.js +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.mjs +1 -1
- package/dist/NotificationServicesController/utils/utils.js +1 -1
- package/dist/NotificationServicesController/utils/utils.mjs +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +9 -9
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +8 -8
- package/dist/NotificationServicesPushController/constants.js +1 -1
- package/dist/NotificationServicesPushController/constants.mjs +1 -1
- package/dist/NotificationServicesPushController/index.js +12 -12
- package/dist/NotificationServicesPushController/index.mjs +11 -11
- package/dist/NotificationServicesPushController/services/endpoints.js +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.mjs +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.js +7 -7
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +6 -6
- package/dist/NotificationServicesPushController/services/services.js +8 -8
- package/dist/NotificationServicesPushController/services/services.mjs +7 -7
- package/dist/NotificationServicesPushController/utils/get-notification-data.js +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +7 -7
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +6 -6
- package/dist/NotificationServicesPushController/utils/index.js +8 -8
- package/dist/NotificationServicesPushController/utils/index.mjs +7 -7
- package/dist/chunk-26CCETCM.mjs +70 -0
- package/dist/chunk-4KZO4UUC.js +4300 -0
- package/dist/chunk-4KZO4UUC.js.map +1 -0
- package/dist/{chunk-TI4UC3G3.mjs → chunk-52NKJDI2.mjs} +6 -5
- package/dist/chunk-52NKJDI2.mjs.map +1 -0
- package/dist/{chunk-IK7KP7N3.js → chunk-CQ6CGSKZ.js} +3 -3
- package/dist/{chunk-6GPIA5G3.js → chunk-DKQBDI4C.js} +35 -35
- package/dist/{chunk-KCIC5BWH.js → chunk-FFQNSBPU.js} +7 -7
- package/dist/chunk-HCOBC2R5.mjs +4300 -0
- package/dist/chunk-HCOBC2R5.mjs.map +1 -0
- package/dist/{chunk-DBTJ34DS.mjs → chunk-JLHFZ2UG.mjs} +3 -3
- package/dist/{chunk-TS2NQOUA.mjs → chunk-LFD7J7KR.mjs} +33 -6
- package/dist/chunk-LFD7J7KR.mjs.map +1 -0
- package/dist/{chunk-H4RSHSWR.js → chunk-NJBJIZLR.js} +7 -6
- package/dist/chunk-NJBJIZLR.js.map +1 -0
- package/dist/{chunk-QJTZL7TJ.js → chunk-NMLYB3XT.js} +4 -4
- package/dist/{chunk-O6RMA2N6.js → chunk-NXXY4CAP.js} +36 -9
- package/dist/chunk-NXXY4CAP.js.map +1 -0
- package/dist/{chunk-ZFNFSLS6.mjs → chunk-ODZ6V4PH.mjs} +4 -4
- package/dist/{chunk-ABFHAGGB.js → chunk-PGMXFZ6Y.js} +3 -3
- package/dist/{chunk-57S5B7X2.mjs → chunk-QTK2RMF7.mjs} +2 -2
- package/dist/{chunk-YSNDM6BH.mjs → chunk-RYAHBEX2.mjs} +6 -26
- package/dist/chunk-RYAHBEX2.mjs.map +1 -0
- package/dist/{chunk-AHEMTJDE.mjs → chunk-SSWX2N73.mjs} +2 -2
- package/dist/{chunk-CQI6FYPZ.mjs → chunk-TT56I53C.mjs} +2 -2
- package/dist/{chunk-6265FKB5.js → chunk-UPVIT75F.js} +3 -3
- package/dist/chunk-V46WVGWN.js +70 -0
- package/dist/{chunk-QSFGJCPI.mjs → chunk-VE4DTN4R.mjs} +2 -2
- package/dist/{chunk-DOYL2MCR.js → chunk-YRWUXGL3.js} +82 -102
- package/dist/chunk-YRWUXGL3.js.map +1 -0
- package/dist/index.js +12 -12
- package/dist/index.mjs +11 -11
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +0 -2
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +1 -0
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +1 -0
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-DOYL2MCR.js.map +0 -1
- package/dist/chunk-H4RSHSWR.js.map +0 -1
- package/dist/chunk-IGY2S5BC.js +0 -36
- package/dist/chunk-NBRY7XVG.mjs +0 -925
- package/dist/chunk-NBRY7XVG.mjs.map +0 -1
- package/dist/chunk-O6RMA2N6.js.map +0 -1
- package/dist/chunk-TI4UC3G3.mjs.map +0 -1
- package/dist/chunk-TS2NQOUA.mjs.map +0 -1
- package/dist/chunk-U5UIDVOO.mjs +0 -36
- package/dist/chunk-XYIGTTEP.js +0 -925
- package/dist/chunk-XYIGTTEP.js.map +0 -1
- package/dist/chunk-YSNDM6BH.mjs.map +0 -1
- /package/dist/{chunk-U5UIDVOO.mjs.map → chunk-26CCETCM.mjs.map} +0 -0
- /package/dist/{chunk-IK7KP7N3.js.map → chunk-CQ6CGSKZ.js.map} +0 -0
- /package/dist/{chunk-6GPIA5G3.js.map → chunk-DKQBDI4C.js.map} +0 -0
- /package/dist/{chunk-KCIC5BWH.js.map → chunk-FFQNSBPU.js.map} +0 -0
- /package/dist/{chunk-DBTJ34DS.mjs.map → chunk-JLHFZ2UG.mjs.map} +0 -0
- /package/dist/{chunk-QJTZL7TJ.js.map → chunk-NMLYB3XT.js.map} +0 -0
- /package/dist/{chunk-ZFNFSLS6.mjs.map → chunk-ODZ6V4PH.mjs.map} +0 -0
- /package/dist/{chunk-ABFHAGGB.js.map → chunk-PGMXFZ6Y.js.map} +0 -0
- /package/dist/{chunk-57S5B7X2.mjs.map → chunk-QTK2RMF7.mjs.map} +0 -0
- /package/dist/{chunk-AHEMTJDE.mjs.map → chunk-SSWX2N73.mjs.map} +0 -0
- /package/dist/{chunk-CQI6FYPZ.mjs.map → chunk-TT56I53C.mjs.map} +0 -0
- /package/dist/{chunk-6265FKB5.js.map → chunk-UPVIT75F.js.map} +0 -0
- /package/dist/{chunk-IGY2S5BC.js.map → chunk-V46WVGWN.js.map} +0 -0
- /package/dist/{chunk-QSFGJCPI.mjs.map → chunk-VE4DTN4R.mjs.map} +0 -0
|
@@ -11,11 +11,11 @@ var _chunkLYEXYTOIjs = require('./chunk-LYEXYTOI.js');
|
|
|
11
11
|
var _chunk52CALMRAjs = require('./chunk-52CALMRA.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkV46WVGWNjs = require('./chunk-V46WVGWN.js');
|
|
15
15
|
|
|
16
16
|
// src/NotificationServicesController/processors/index.ts
|
|
17
17
|
var processors_exports = {};
|
|
18
|
-
|
|
18
|
+
_chunkV46WVGWNjs.__export.call(void 0, processors_exports, {
|
|
19
19
|
isFeatureAnnouncementRead: () => _chunk52CALMRAjs.isFeatureAnnouncementRead,
|
|
20
20
|
processFeatureAnnouncement: () => _chunk52CALMRAjs.processFeatureAnnouncement,
|
|
21
21
|
processNotification: () => _chunkGFAESVZAjs.processNotification,
|
|
@@ -26,4 +26,4 @@ _chunkIGY2S5BCjs.__export.call(void 0, processors_exports, {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
exports.processors_exports = processors_exports;
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-UPVIT75F.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined")
|
|
11
|
+
return require.apply(this, arguments);
|
|
12
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __accessCheck = (obj, member, msg) => {
|
|
38
|
+
if (!member.has(obj))
|
|
39
|
+
throw TypeError("Cannot " + msg);
|
|
40
|
+
};
|
|
41
|
+
var __privateGet = (obj, member, getter) => {
|
|
42
|
+
__accessCheck(obj, member, "read from private field");
|
|
43
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
44
|
+
};
|
|
45
|
+
var __privateAdd = (obj, member, value) => {
|
|
46
|
+
if (member.has(obj))
|
|
47
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
48
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
49
|
+
};
|
|
50
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
51
|
+
__accessCheck(obj, member, "write to private field");
|
|
52
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
53
|
+
return value;
|
|
54
|
+
};
|
|
55
|
+
var __privateMethod = (obj, member, method) => {
|
|
56
|
+
__accessCheck(obj, member, "access private method");
|
|
57
|
+
return method;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
exports.__require = __require; exports.__commonJS = __commonJS; exports.__export = __export; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod;
|
|
70
|
+
//# sourceMappingURL=chunk-V46WVGWN.js.map
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-6ZDVTRRT.mjs";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-26CCETCM.mjs";
|
|
17
17
|
|
|
18
18
|
// src/NotificationServicesController/constants/index.ts
|
|
19
19
|
var constants_exports = {};
|
|
@@ -32,4 +32,4 @@ __export(constants_exports, {
|
|
|
32
32
|
export {
|
|
33
33
|
constants_exports
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-VE4DTN4R.mjs.map
|
|
@@ -26,7 +26,7 @@ var _chunkTLX5QQK5js = require('./chunk-TLX5QQK5.js');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkV46WVGWNjs = require('./chunk-V46WVGWN.js');
|
|
30
30
|
|
|
31
31
|
// src/NotificationServicesController/NotificationServicesController.ts
|
|
32
32
|
var _basecontroller = require('@metamask/base-controller');
|
|
@@ -87,7 +87,7 @@ var defaultState = {
|
|
|
87
87
|
isUpdatingMetamaskNotificationsAccount: [],
|
|
88
88
|
isCheckingAccountsPresence: false
|
|
89
89
|
};
|
|
90
|
-
var
|
|
90
|
+
var _auth, _storage, _pushNotifications, _accounts, _featureAnnouncementEnv, _registerMessageHandlers, registerMessageHandlers_fn, _clearLoadingStates, clearLoadingStates_fn, _assertAuthEnabled, assertAuthEnabled_fn, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn, _performEnableProfileSyncing, _assertUserStorage, assertUserStorage_fn, _getUserStorage, getUserStorage_fn, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn;
|
|
91
91
|
var NotificationServicesController = class extends _basecontroller.BaseController {
|
|
92
92
|
/**
|
|
93
93
|
* Creates a NotificationServicesController instance.
|
|
@@ -97,7 +97,6 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
97
97
|
* @param args.state - Initial state to set on this controller.
|
|
98
98
|
* @param args.env - environment variables for a given controller.
|
|
99
99
|
* @param args.env.featureAnnouncements - env variables for feature announcements.
|
|
100
|
-
* @param args.env.isPushIntegrated - toggle push notifications on/off if client has integrated them.
|
|
101
100
|
*/
|
|
102
101
|
constructor({
|
|
103
102
|
messenger,
|
|
@@ -110,11 +109,11 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
110
109
|
name: controllerName,
|
|
111
110
|
state: { ...defaultState, ...state }
|
|
112
111
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _registerMessageHandlers);
|
|
113
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _clearLoadingStates);
|
|
114
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _assertAuthEnabled);
|
|
115
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _getValidStorageKeyAndBearerToken);
|
|
116
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _assertUserStorage);
|
|
118
117
|
/**
|
|
119
118
|
* Retrieves and parses the user storage from the storage key.
|
|
120
119
|
*
|
|
@@ -124,7 +123,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
124
123
|
*
|
|
125
124
|
* @returns The parsed user storage object or null
|
|
126
125
|
*/
|
|
127
|
-
|
|
126
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _getUserStorage);
|
|
128
127
|
/**
|
|
129
128
|
* Sets the state of notification creation process.
|
|
130
129
|
*
|
|
@@ -135,7 +134,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
135
134
|
*
|
|
136
135
|
* @param isUpdatingMetamaskNotifications - A boolean value representing the new state of the notification creation process.
|
|
137
136
|
*/
|
|
138
|
-
|
|
137
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsUpdatingMetamaskNotifications);
|
|
139
138
|
/**
|
|
140
139
|
* Updates the state to indicate whether fetching of MetaMask notifications is in progress.
|
|
141
140
|
*
|
|
@@ -144,7 +143,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
144
143
|
*
|
|
145
144
|
* @param isFetchingMetamaskNotifications - A boolean value representing the fetching state.
|
|
146
145
|
*/
|
|
147
|
-
|
|
146
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsFetchingMetamaskNotifications);
|
|
148
147
|
/**
|
|
149
148
|
* Updates the state to indicate that the checking of accounts presence is in progress.
|
|
150
149
|
*
|
|
@@ -154,23 +153,21 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
154
153
|
*
|
|
155
154
|
* @param isCheckingAccountsPresence - A boolean value indicating whether the account presence check is currently active.
|
|
156
155
|
*/
|
|
157
|
-
|
|
156
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _setIsCheckingAccountsPresence);
|
|
158
157
|
/**
|
|
159
158
|
* Updates the state to indicate that account updates are in progress.
|
|
160
159
|
* Removes duplicate accounts before updating the state.
|
|
161
160
|
*
|
|
162
161
|
* @param accounts - The accounts being updated.
|
|
163
162
|
*/
|
|
164
|
-
|
|
163
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _updateUpdatingAccountsState);
|
|
165
164
|
/**
|
|
166
165
|
* Clears the state indicating that account updates are complete.
|
|
167
166
|
*
|
|
168
167
|
* @param accounts - The accounts that have finished updating.
|
|
169
168
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
_chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _isPushIntegrated, true);
|
|
173
|
-
_chunkIGY2S5BCjs.__privateAdd.call(void 0, this, _auth, {
|
|
169
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _clearUpdatingAccountsState);
|
|
170
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _auth, {
|
|
174
171
|
getBearerToken: async () => {
|
|
175
172
|
return await this.messagingSystem.call(
|
|
176
173
|
"AuthenticationController:getBearerToken"
|
|
@@ -180,7 +177,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
180
177
|
return this.messagingSystem.call("AuthenticationController:isSignedIn");
|
|
181
178
|
}
|
|
182
179
|
});
|
|
183
|
-
|
|
180
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _storage, {
|
|
184
181
|
enableProfileSyncing: async () => {
|
|
185
182
|
return await this.messagingSystem.call(
|
|
186
183
|
"UserStorageController:enableProfileSyncing"
|
|
@@ -203,38 +200,26 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
203
200
|
);
|
|
204
201
|
}
|
|
205
202
|
});
|
|
206
|
-
|
|
203
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _pushNotifications, {
|
|
207
204
|
enablePushNotifications: async (UUIDs) => {
|
|
208
|
-
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
await this.messagingSystem.call(
|
|
205
|
+
return await this.messagingSystem.call(
|
|
212
206
|
"NotificationServicesPushController:enablePushNotifications",
|
|
213
207
|
UUIDs
|
|
214
208
|
);
|
|
215
209
|
},
|
|
216
210
|
disablePushNotifications: async (UUIDs) => {
|
|
217
|
-
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
await this.messagingSystem.call(
|
|
211
|
+
return await this.messagingSystem.call(
|
|
221
212
|
"NotificationServicesPushController:disablePushNotifications",
|
|
222
213
|
UUIDs
|
|
223
214
|
);
|
|
224
215
|
},
|
|
225
216
|
updatePushNotifications: async (UUIDs) => {
|
|
226
|
-
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
await this.messagingSystem.call(
|
|
217
|
+
return await this.messagingSystem.call(
|
|
230
218
|
"NotificationServicesPushController:updateTriggerPushNotifications",
|
|
231
219
|
UUIDs
|
|
232
220
|
);
|
|
233
221
|
},
|
|
234
222
|
subscribe: () => {
|
|
235
|
-
if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
223
|
this.messagingSystem.subscribe(
|
|
239
224
|
"NotificationServicesPushController:onNewNotifications",
|
|
240
225
|
(notification) => {
|
|
@@ -243,21 +228,18 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
243
228
|
);
|
|
244
229
|
},
|
|
245
230
|
initializePushNotifications: async () => {
|
|
246
|
-
if (!_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _isPushIntegrated)) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
231
|
if (!this.state.isNotificationServicesEnabled) {
|
|
250
232
|
return;
|
|
251
233
|
}
|
|
252
|
-
const storage = await
|
|
234
|
+
const storage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
253
235
|
if (!storage) {
|
|
254
236
|
return;
|
|
255
237
|
}
|
|
256
238
|
const uuids = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, storage);
|
|
257
|
-
await
|
|
239
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(uuids);
|
|
258
240
|
}
|
|
259
241
|
});
|
|
260
|
-
|
|
242
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _accounts, {
|
|
261
243
|
/**
|
|
262
244
|
* Used to get list of addresses from keyring (wallet addresses)
|
|
263
245
|
*
|
|
@@ -296,7 +278,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
296
278
|
* @returns result from list accounts
|
|
297
279
|
*/
|
|
298
280
|
initialize: () => {
|
|
299
|
-
return
|
|
281
|
+
return _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
|
|
300
282
|
},
|
|
301
283
|
/**
|
|
302
284
|
* Subscription to any state change in the keyring controller (aka wallet accounts).
|
|
@@ -311,7 +293,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
311
293
|
if (!this.state.isNotificationServicesEnabled) {
|
|
312
294
|
return;
|
|
313
295
|
}
|
|
314
|
-
const { accountsAdded, accountsRemoved } = await
|
|
296
|
+
const { accountsAdded, accountsRemoved } = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
|
|
315
297
|
const promises = [];
|
|
316
298
|
if (accountsAdded.length > 0) {
|
|
317
299
|
promises.push(this.updateOnChainTriggersByAccount(accountsAdded));
|
|
@@ -324,23 +306,22 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
324
306
|
);
|
|
325
307
|
}
|
|
326
308
|
});
|
|
327
|
-
|
|
328
|
-
|
|
309
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _featureAnnouncementEnv, void 0);
|
|
310
|
+
_chunkV46WVGWNjs.__privateAdd.call(void 0, this, _performEnableProfileSyncing, async () => {
|
|
329
311
|
try {
|
|
330
|
-
await
|
|
312
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).enableProfileSyncing();
|
|
331
313
|
} catch (e) {
|
|
332
314
|
_loglevel2.default.error("Failed to enable profile syncing", e);
|
|
333
315
|
throw new Error("Failed to enable profile syncing");
|
|
334
316
|
}
|
|
335
317
|
});
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
_chunkIGY2S5BCjs.__privateGet.call(void 0, this, _pushNotifications).subscribe();
|
|
318
|
+
_chunkV46WVGWNjs.__privateSet.call(void 0, this, _featureAnnouncementEnv, env.featureAnnouncements);
|
|
319
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _registerMessageHandlers, registerMessageHandlers_fn).call(this);
|
|
320
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearLoadingStates, clearLoadingStates_fn).call(this);
|
|
321
|
+
_chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).initialize();
|
|
322
|
+
_chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).initializePushNotifications();
|
|
323
|
+
_chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).subscribe();
|
|
324
|
+
_chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).subscribe();
|
|
344
325
|
}
|
|
345
326
|
/**
|
|
346
327
|
* Retrieves the current enabled state of MetaMask notifications.
|
|
@@ -355,16 +336,16 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
355
336
|
}
|
|
356
337
|
async checkAccountsPresence(accounts) {
|
|
357
338
|
try {
|
|
358
|
-
|
|
359
|
-
const userStorage = await
|
|
360
|
-
|
|
339
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, true);
|
|
340
|
+
const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
341
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
361
342
|
const presence = _chunkPIZCE3JDjs.checkAccountsPresence.call(void 0, userStorage, accounts);
|
|
362
343
|
return presence;
|
|
363
344
|
} catch (error) {
|
|
364
345
|
_loglevel2.default.error("Failed to check accounts presence", error);
|
|
365
346
|
throw error;
|
|
366
347
|
} finally {
|
|
367
|
-
|
|
348
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, false);
|
|
368
349
|
}
|
|
369
350
|
}
|
|
370
351
|
/**
|
|
@@ -396,17 +377,17 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
396
377
|
*/
|
|
397
378
|
async createOnChainTriggers() {
|
|
398
379
|
try {
|
|
399
|
-
|
|
400
|
-
await
|
|
401
|
-
const { bearerToken, storageKey } = await
|
|
402
|
-
const { accounts } = await
|
|
403
|
-
let userStorage = await
|
|
380
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
381
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _performEnableProfileSyncing).call(this);
|
|
382
|
+
const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
383
|
+
const { accounts } = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _accounts).listAccounts();
|
|
384
|
+
let userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
404
385
|
if (userStorage?.[_chunkTLX5QQK5js.USER_STORAGE_VERSION_KEY] === void 0) {
|
|
405
386
|
userStorage = _chunkPIZCE3JDjs.initializeUserStorage.call(void 0,
|
|
406
387
|
accounts.map((account) => ({ address: account })),
|
|
407
388
|
false
|
|
408
389
|
);
|
|
409
|
-
await
|
|
390
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
410
391
|
}
|
|
411
392
|
const triggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage);
|
|
412
393
|
await _chunkVOZ7Y2OOjs.createOnChainTriggers.call(void 0,
|
|
@@ -416,8 +397,8 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
416
397
|
triggers
|
|
417
398
|
);
|
|
418
399
|
const allUUIDS = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
|
|
419
|
-
await
|
|
420
|
-
await
|
|
400
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).enablePushNotifications(allUUIDS);
|
|
401
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
421
402
|
this.update((state) => {
|
|
422
403
|
state.isNotificationServicesEnabled = true;
|
|
423
404
|
state.isFeatureAnnouncementsEnabled = true;
|
|
@@ -428,7 +409,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
428
409
|
_loglevel2.default.error("Failed to create On Chain triggers", err);
|
|
429
410
|
throw new Error("Failed to create On Chain triggers");
|
|
430
411
|
} finally {
|
|
431
|
-
|
|
412
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
432
413
|
}
|
|
433
414
|
}
|
|
434
415
|
/**
|
|
@@ -443,13 +424,13 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
443
424
|
*/
|
|
444
425
|
async enableMetamaskNotifications() {
|
|
445
426
|
try {
|
|
446
|
-
|
|
427
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
447
428
|
await this.createOnChainTriggers();
|
|
448
429
|
} catch (e) {
|
|
449
430
|
_loglevel2.default.error("Unable to enable notifications", e);
|
|
450
431
|
throw new Error("Unable to enable notifications");
|
|
451
432
|
} finally {
|
|
452
|
-
|
|
433
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
453
434
|
}
|
|
454
435
|
}
|
|
455
436
|
/**
|
|
@@ -462,11 +443,11 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
462
443
|
*/
|
|
463
444
|
async disableNotificationServices() {
|
|
464
445
|
try {
|
|
465
|
-
|
|
466
|
-
const userStorage = await
|
|
467
|
-
|
|
446
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
447
|
+
const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
448
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
468
449
|
const UUIDs = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
|
|
469
|
-
await
|
|
450
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
|
|
470
451
|
this.update((state) => {
|
|
471
452
|
state.isNotificationServicesEnabled = false;
|
|
472
453
|
state.isFeatureAnnouncementsEnabled = false;
|
|
@@ -476,7 +457,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
476
457
|
_loglevel2.default.error("Unable to disable notifications", e);
|
|
477
458
|
throw new Error("Unable to disable notifications");
|
|
478
459
|
} finally {
|
|
479
|
-
|
|
460
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
480
461
|
}
|
|
481
462
|
}
|
|
482
463
|
/**
|
|
@@ -495,10 +476,10 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
495
476
|
*/
|
|
496
477
|
async deleteOnChainTriggersByAccount(accounts) {
|
|
497
478
|
try {
|
|
498
|
-
|
|
499
|
-
const { bearerToken, storageKey } = await
|
|
500
|
-
const userStorage = await
|
|
501
|
-
|
|
479
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
|
|
480
|
+
const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
481
|
+
const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
482
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
502
483
|
const UUIDs = accounts.map((a) => _chunkPIZCE3JDjs.getUUIDsForAccount.call(void 0, userStorage, a.toLowerCase())).flat();
|
|
503
484
|
if (UUIDs.length === 0) {
|
|
504
485
|
return userStorage;
|
|
@@ -509,14 +490,14 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
509
490
|
bearerToken,
|
|
510
491
|
UUIDs
|
|
511
492
|
);
|
|
512
|
-
await
|
|
513
|
-
await
|
|
493
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).disablePushNotifications(UUIDs);
|
|
494
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
514
495
|
return userStorage;
|
|
515
496
|
} catch (err) {
|
|
516
497
|
_loglevel2.default.error("Failed to delete OnChain triggers", err);
|
|
517
498
|
throw new Error("Failed to delete OnChain triggers");
|
|
518
499
|
} finally {
|
|
519
|
-
|
|
500
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
|
|
520
501
|
}
|
|
521
502
|
}
|
|
522
503
|
/**
|
|
@@ -536,10 +517,10 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
536
517
|
*/
|
|
537
518
|
async updateOnChainTriggersByAccount(accounts) {
|
|
538
519
|
try {
|
|
539
|
-
|
|
540
|
-
const { bearerToken, storageKey } = await
|
|
541
|
-
const userStorage = await
|
|
542
|
-
|
|
520
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
|
|
521
|
+
const { bearerToken, storageKey } = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
522
|
+
const userStorage = await _chunkV46WVGWNjs.__privateMethod.call(void 0, this, _getUserStorage, getUserStorage_fn).call(this);
|
|
523
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
543
524
|
accounts.forEach((a) => _chunkPIZCE3JDjs.upsertAddressTriggers.call(void 0, a, userStorage));
|
|
544
525
|
const newTriggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage, {
|
|
545
526
|
mapTrigger: (t) => {
|
|
@@ -550,7 +531,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
550
531
|
}
|
|
551
532
|
});
|
|
552
533
|
if (newTriggers.length > 0) {
|
|
553
|
-
await
|
|
534
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
554
535
|
const triggers = _chunkPIZCE3JDjs.traverseUserStorageTriggers.call(void 0, userStorage, {
|
|
555
536
|
mapTrigger: (t) => {
|
|
556
537
|
if (accounts.some((a) => a.toLowerCase() === t.address.toLowerCase())) {
|
|
@@ -567,14 +548,14 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
567
548
|
);
|
|
568
549
|
}
|
|
569
550
|
const UUIDs = _chunkPIZCE3JDjs.getAllUUIDs.call(void 0, userStorage);
|
|
570
|
-
await
|
|
571
|
-
await
|
|
551
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _pushNotifications).updatePushNotifications(UUIDs);
|
|
552
|
+
await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
572
553
|
return userStorage;
|
|
573
554
|
} catch (err) {
|
|
574
555
|
_loglevel2.default.error("Failed to update OnChain triggers", err);
|
|
575
556
|
throw new Error("Failed to update OnChain triggers");
|
|
576
557
|
} finally {
|
|
577
|
-
|
|
558
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
|
|
578
559
|
}
|
|
579
560
|
}
|
|
580
561
|
/**
|
|
@@ -587,13 +568,13 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
587
568
|
*/
|
|
588
569
|
async fetchAndUpdateMetamaskNotifications() {
|
|
589
570
|
try {
|
|
590
|
-
|
|
571
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, true);
|
|
591
572
|
const rawFeatureAnnouncementNotifications = this.state.isFeatureAnnouncementsEnabled ? await _chunkZMNXLHACjs.getFeatureAnnouncementNotifications.call(void 0,
|
|
592
|
-
|
|
573
|
+
_chunkV46WVGWNjs.__privateGet.call(void 0, this, _featureAnnouncementEnv)
|
|
593
574
|
).catch(() => []) : [];
|
|
594
575
|
const rawOnChainNotifications = [];
|
|
595
|
-
const userStorage = await
|
|
596
|
-
const bearerToken = await
|
|
576
|
+
const userStorage = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getNotificationStorage().then((s) => s && JSON.parse(s)).catch(() => null);
|
|
577
|
+
const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken().catch(() => null);
|
|
597
578
|
if (userStorage && bearerToken) {
|
|
598
579
|
const notifications = await _chunkVOZ7Y2OOjs.getOnChainNotifications.call(void 0,
|
|
599
580
|
userStorage,
|
|
@@ -618,10 +599,10 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
618
599
|
this.update((state) => {
|
|
619
600
|
state.metamaskNotificationsList = metamaskNotifications;
|
|
620
601
|
});
|
|
621
|
-
|
|
602
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
|
|
622
603
|
return metamaskNotifications;
|
|
623
604
|
} catch (err) {
|
|
624
|
-
|
|
605
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
|
|
625
606
|
_loglevel2.default.error("Failed to fetch notifications", err);
|
|
626
607
|
throw new Error("Failed to fetch notifications");
|
|
627
608
|
}
|
|
@@ -643,7 +624,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
643
624
|
(notification) => notification.type === "features_announcement" /* FEATURES_ANNOUNCEMENT */ && !notification.isRead
|
|
644
625
|
);
|
|
645
626
|
if (onChainNotifications.length > 0) {
|
|
646
|
-
const bearerToken = await
|
|
627
|
+
const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken();
|
|
647
628
|
if (bearerToken) {
|
|
648
629
|
onchainNotificationIds = onChainNotifications.map(
|
|
649
630
|
(notification) => notification.id
|
|
@@ -708,7 +689,6 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
708
689
|
}
|
|
709
690
|
}
|
|
710
691
|
};
|
|
711
|
-
_isPushIntegrated = new WeakMap();
|
|
712
692
|
_auth = new WeakMap();
|
|
713
693
|
_storage = new WeakMap();
|
|
714
694
|
_pushNotifications = new WeakMap();
|
|
@@ -740,7 +720,7 @@ clearLoadingStates_fn = function() {
|
|
|
740
720
|
};
|
|
741
721
|
_assertAuthEnabled = new WeakSet();
|
|
742
722
|
assertAuthEnabled_fn = function() {
|
|
743
|
-
if (!
|
|
723
|
+
if (!_chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).isSignedIn()) {
|
|
744
724
|
this.update((state) => {
|
|
745
725
|
state.isNotificationServicesEnabled = false;
|
|
746
726
|
});
|
|
@@ -749,9 +729,9 @@ assertAuthEnabled_fn = function() {
|
|
|
749
729
|
};
|
|
750
730
|
_getValidStorageKeyAndBearerToken = new WeakSet();
|
|
751
731
|
getValidStorageKeyAndBearerToken_fn = async function() {
|
|
752
|
-
|
|
753
|
-
const bearerToken = await
|
|
754
|
-
const storageKey = await
|
|
732
|
+
_chunkV46WVGWNjs.__privateMethod.call(void 0, this, _assertAuthEnabled, assertAuthEnabled_fn).call(this);
|
|
733
|
+
const bearerToken = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _auth).getBearerToken();
|
|
734
|
+
const storageKey = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getStorageKey();
|
|
755
735
|
if (!bearerToken || !storageKey) {
|
|
756
736
|
throw new Error("Missing BearerToken or storage key");
|
|
757
737
|
}
|
|
@@ -766,7 +746,7 @@ assertUserStorage_fn = function(storage) {
|
|
|
766
746
|
};
|
|
767
747
|
_getUserStorage = new WeakSet();
|
|
768
748
|
getUserStorage_fn = async function() {
|
|
769
|
-
const userStorageString = await
|
|
749
|
+
const userStorageString = await _chunkV46WVGWNjs.__privateGet.call(void 0, this, _storage).getNotificationStorage();
|
|
770
750
|
if (!userStorageString) {
|
|
771
751
|
return null;
|
|
772
752
|
}
|
|
@@ -819,4 +799,4 @@ clearUpdatingAccountsState_fn = function(accounts) {
|
|
|
819
799
|
|
|
820
800
|
|
|
821
801
|
exports.defaultState = defaultState; exports.NotificationServicesController = NotificationServicesController;
|
|
822
|
-
//# sourceMappingURL=chunk-
|
|
802
|
+
//# sourceMappingURL=chunk-YRWUXGL3.js.map
|