@metamask-previews/notification-services-controller 0.2.1-preview-12fc043b → 0.2.1-preview-1e84326
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/index.js +2 -2
- package/dist/NotificationServicesController/index.mjs +3 -3
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +1 -1
- package/dist/NotificationServicesPushController/index.js +3 -3
- package/dist/NotificationServicesPushController/index.mjs +4 -4
- package/dist/NotificationServicesPushController/services/push/push-web.js +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +1 -1
- package/dist/NotificationServicesPushController/services/services.js +1 -1
- package/dist/NotificationServicesPushController/services/services.mjs +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +1 -1
- package/dist/NotificationServicesPushController/utils/index.js +1 -1
- package/dist/NotificationServicesPushController/utils/index.mjs +1 -1
- package/dist/chunk-2BCJRWFF.js +94 -0
- package/dist/chunk-2BCJRWFF.js.map +1 -0
- package/dist/chunk-N4EKQQX7.mjs +94 -0
- package/dist/chunk-N4EKQQX7.mjs.map +1 -0
- package/dist/chunk-P5DZ7JHL.js +929 -0
- package/dist/chunk-P5DZ7JHL.js.map +1 -0
- package/dist/chunk-Z5VM5N2S.mjs +929 -0
- package/dist/chunk-Z5VM5N2S.mjs.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/NotificationServicesController/index.d.ts +1 -2
- package/dist/types/NotificationServicesController/index.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/index.d.ts +1 -2
- package/dist/types/NotificationServicesPushController/index.d.ts.map +1 -1
- package/package.json +1 -51
- package/dist/chunk-J776HRLN.js +0 -31
- package/dist/chunk-J776HRLN.js.map +0 -1
- package/dist/chunk-OPGQSY7Y.mjs +0 -39
- package/dist/chunk-OPGQSY7Y.mjs.map +0 -1
- package/dist/chunk-RT45HUZ6.mjs +0 -31
- package/dist/chunk-RT45HUZ6.mjs.map +0 -1
- package/dist/chunk-VIB7ZSZG.js +0 -39
- package/dist/chunk-VIB7ZSZG.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkP5DZ7JHLjs = require('../chunk-P5DZ7JHL.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk232HZSEVjs = require('../chunk-232HZSEV.js');
|
|
@@ -46,5 +46,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller = _chunkFFKCMR6Qjs.NotificationServicesController; exports.Processors = _chunkKWTSMLNDjs.processors_exports; exports.Types = _chunk232HZSEVjs.types_exports; exports.UI = _chunkIG3KWCQUjs.ui_exports; exports.
|
|
49
|
+
exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller = _chunkFFKCMR6Qjs.NotificationServicesController; exports.Mocks = _chunkP5DZ7JHLjs.fixtures_exports; exports.Processors = _chunkKWTSMLNDjs.processors_exports; exports.Types = _chunk232HZSEVjs.types_exports; exports.UI = _chunkIG3KWCQUjs.ui_exports; exports.defaultState = _chunkFFKCMR6Qjs.defaultState;
|
|
50
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
2
|
+
fixtures_exports
|
|
3
|
+
} from "../chunk-Z5VM5N2S.mjs";
|
|
4
4
|
import {
|
|
5
5
|
types_exports
|
|
6
6
|
} from "../chunk-B4ECJJ5C.mjs";
|
|
@@ -41,10 +41,10 @@ import "../chunk-U5UIDVOO.mjs";
|
|
|
41
41
|
export {
|
|
42
42
|
constants_exports as Constants,
|
|
43
43
|
NotificationServicesController as Controller,
|
|
44
|
+
fixtures_exports as Mocks,
|
|
44
45
|
processors_exports as Processors,
|
|
45
46
|
types_exports as Types,
|
|
46
47
|
ui_exports as UI,
|
|
47
|
-
NotificationServicesController_default as default,
|
|
48
48
|
defaultState
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -5,7 +5,7 @@ var _chunk6GXEFQ64js = require('../chunk-6GXEFQ64.js');
|
|
|
5
5
|
require('../chunk-4HOEZMSV.js');
|
|
6
6
|
require('../chunk-GDKHOBJT.js');
|
|
7
7
|
require('../chunk-B25TJ7KS.js');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-P5DZ7JHL.js');
|
|
9
9
|
require('../chunk-232HZSEV.js');
|
|
10
10
|
require('../chunk-XZEVRYUE.js');
|
|
11
11
|
require('../chunk-3ZS2HAEG.js');
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import "../chunk-WGGW6VCR.mjs";
|
|
6
6
|
import "../chunk-YHVXD5WW.mjs";
|
|
7
7
|
import "../chunk-IKWNHNJQ.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-Z5VM5N2S.mjs";
|
|
9
9
|
import "../chunk-B4ECJJ5C.mjs";
|
|
10
10
|
import "../chunk-U74Q3BRP.mjs";
|
|
11
11
|
import "../chunk-G52DNXFH.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2BCJRWFFjs = require('../chunk-2BCJRWFF.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk7LWR54U7js = require('../chunk-7LWR54U7.js');
|
|
@@ -17,7 +17,7 @@ var _chunk6GXEFQ64js = require('../chunk-6GXEFQ64.js');
|
|
|
17
17
|
require('../chunk-4HOEZMSV.js');
|
|
18
18
|
require('../chunk-GDKHOBJT.js');
|
|
19
19
|
require('../chunk-B25TJ7KS.js');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-P5DZ7JHL.js');
|
|
21
21
|
require('../chunk-232HZSEV.js');
|
|
22
22
|
require('../chunk-XZEVRYUE.js');
|
|
23
23
|
require('../chunk-3ZS2HAEG.js');
|
|
@@ -50,5 +50,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
exports.Controller = _chunk6GXEFQ64js.NotificationServicesPushController; exports.
|
|
53
|
+
exports.Controller = _chunk6GXEFQ64js.NotificationServicesPushController; exports.Mocks = _chunk2BCJRWFFjs.fixtures_exports; exports.Types = _chunk7LWR54U7js.types_exports; exports.Utils = _chunkENRKCWJ6js.utils_exports; exports.defaultState = _chunk6GXEFQ64js.defaultState;
|
|
54
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-
|
|
2
|
+
fixtures_exports
|
|
3
|
+
} from "../chunk-N4EKQQX7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
types_exports
|
|
6
6
|
} from "../chunk-IOMDG67D.mjs";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import "../chunk-WGGW6VCR.mjs";
|
|
18
18
|
import "../chunk-YHVXD5WW.mjs";
|
|
19
19
|
import "../chunk-IKWNHNJQ.mjs";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-Z5VM5N2S.mjs";
|
|
21
21
|
import "../chunk-B4ECJJ5C.mjs";
|
|
22
22
|
import "../chunk-U74Q3BRP.mjs";
|
|
23
23
|
import "../chunk-G52DNXFH.mjs";
|
|
@@ -46,9 +46,9 @@ import "../chunk-6ZDVTRRT.mjs";
|
|
|
46
46
|
import "../chunk-U5UIDVOO.mjs";
|
|
47
47
|
export {
|
|
48
48
|
NotificationServicesPushController as Controller,
|
|
49
|
+
fixtures_exports as Mocks,
|
|
49
50
|
types_exports as Types,
|
|
50
51
|
utils_exports as Utils,
|
|
51
|
-
NotificationServicesPushController_default as default,
|
|
52
52
|
defaultState
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkGDKHOBJTjs = require('../../../chunk-GDKHOBJT.js');
|
|
7
|
-
require('../../../chunk-
|
|
7
|
+
require('../../../chunk-P5DZ7JHL.js');
|
|
8
8
|
require('../../../chunk-232HZSEV.js');
|
|
9
9
|
require('../../../chunk-XZEVRYUE.js');
|
|
10
10
|
require('../../../chunk-3ZS2HAEG.js');
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
listenToPushNotificationsClicked,
|
|
5
5
|
listenToPushNotificationsReceived
|
|
6
6
|
} from "../../../chunk-YHVXD5WW.mjs";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-Z5VM5N2S.mjs";
|
|
8
8
|
import "../../../chunk-B4ECJJ5C.mjs";
|
|
9
9
|
import "../../../chunk-U74Q3BRP.mjs";
|
|
10
10
|
import "../../../chunk-G52DNXFH.mjs";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
var _chunk4HOEZMSVjs = require('../../chunk-4HOEZMSV.js');
|
|
9
9
|
require('../../chunk-GDKHOBJT.js');
|
|
10
10
|
require('../../chunk-B25TJ7KS.js');
|
|
11
|
-
require('../../chunk-
|
|
11
|
+
require('../../chunk-P5DZ7JHL.js');
|
|
12
12
|
require('../../chunk-232HZSEV.js');
|
|
13
13
|
require('../../chunk-XZEVRYUE.js');
|
|
14
14
|
require('../../chunk-3ZS2HAEG.js');
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../../chunk-WGGW6VCR.mjs";
|
|
9
9
|
import "../../chunk-YHVXD5WW.mjs";
|
|
10
10
|
import "../../chunk-IKWNHNJQ.mjs";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-Z5VM5N2S.mjs";
|
|
12
12
|
import "../../chunk-B4ECJJ5C.mjs";
|
|
13
13
|
import "../../chunk-U74Q3BRP.mjs";
|
|
14
14
|
import "../../chunk-G52DNXFH.mjs";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
|
|
6
6
|
require('../../chunk-EJ52BDLB.js');
|
|
7
|
-
require('../../chunk-
|
|
7
|
+
require('../../chunk-P5DZ7JHL.js');
|
|
8
8
|
require('../../chunk-232HZSEV.js');
|
|
9
9
|
require('../../chunk-XZEVRYUE.js');
|
|
10
10
|
require('../../chunk-3ZS2HAEG.js');
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isOnChainNotification
|
|
5
5
|
} from "../../chunk-6GUOLD7O.mjs";
|
|
6
6
|
import "../../chunk-ODI2BTKS.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-Z5VM5N2S.mjs";
|
|
8
8
|
import "../../chunk-B4ECJJ5C.mjs";
|
|
9
9
|
import "../../chunk-U74Q3BRP.mjs";
|
|
10
10
|
import "../../chunk-G52DNXFH.mjs";
|
|
@@ -10,7 +10,7 @@ var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkEJ52BDLBjs = require('../../chunk-EJ52BDLB.js');
|
|
13
|
-
require('../../chunk-
|
|
13
|
+
require('../../chunk-P5DZ7JHL.js');
|
|
14
14
|
require('../../chunk-232HZSEV.js');
|
|
15
15
|
require('../../chunk-XZEVRYUE.js');
|
|
16
16
|
require('../../chunk-3ZS2HAEG.js');
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getAmount,
|
|
11
11
|
getLeadingZeroCount
|
|
12
12
|
} from "../../chunk-ODI2BTKS.mjs";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-Z5VM5N2S.mjs";
|
|
14
14
|
import "../../chunk-B4ECJJ5C.mjs";
|
|
15
15
|
import "../../chunk-U74Q3BRP.mjs";
|
|
16
16
|
import "../../chunk-G52DNXFH.mjs";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk7LWR54U7js = require('./chunk-7LWR54U7.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkENRKCWJ6js = require('./chunk-ENRKCWJ6.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk6GXEFQ64js = require('./chunk-6GXEFQ64.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkB25TJ7KSjs = require('./chunk-B25TJ7KS.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
|
|
17
|
+
|
|
18
|
+
// src/NotificationServicesPushController/index.ts
|
|
19
|
+
var NotificationServicesPushController_exports = {};
|
|
20
|
+
_chunkIGY2S5BCjs.__export.call(void 0, NotificationServicesPushController_exports, {
|
|
21
|
+
Controller: () => _chunk6GXEFQ64js.NotificationServicesPushController,
|
|
22
|
+
Mocks: () => fixtures_exports,
|
|
23
|
+
Types: () => _chunk7LWR54U7js.types_exports,
|
|
24
|
+
Utils: () => _chunkENRKCWJ6js.utils_exports,
|
|
25
|
+
defaultState: () => _chunk6GXEFQ64js.defaultState
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/NotificationServicesPushController/__fixtures__/index.ts
|
|
29
|
+
var fixtures_exports = {};
|
|
30
|
+
_chunkIGY2S5BCjs.__export.call(void 0, fixtures_exports, {
|
|
31
|
+
MOCK_FCM_RESPONSE: () => MOCK_FCM_RESPONSE,
|
|
32
|
+
MOCK_LINKS_RESPONSE: () => MOCK_LINKS_RESPONSE,
|
|
33
|
+
MOCK_REG_TOKEN: () => MOCK_REG_TOKEN,
|
|
34
|
+
getMockCreateFCMRegistrationTokenResponse: () => getMockCreateFCMRegistrationTokenResponse,
|
|
35
|
+
getMockDeleteFCMRegistrationTokenResponse: () => getMockDeleteFCMRegistrationTokenResponse,
|
|
36
|
+
getMockRetrievePushNotificationLinksResponse: () => getMockRetrievePushNotificationLinksResponse,
|
|
37
|
+
getMockUpdatePushNotificationLinksResponse: () => getMockUpdatePushNotificationLinksResponse
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// src/NotificationServicesPushController/__fixtures__/mockResponse.ts
|
|
41
|
+
var MOCK_REG_TOKEN = "REG_TOKEN";
|
|
42
|
+
var MOCK_LINKS_RESPONSE = {
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
44
|
+
trigger_ids: ["1", "2", "3"],
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
46
|
+
registration_tokens: [
|
|
47
|
+
{ token: "reg_token_1", platform: "portfolio" },
|
|
48
|
+
{ token: "reg_token_2", platform: "extension" }
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
var getMockRetrievePushNotificationLinksResponse = () => {
|
|
52
|
+
return {
|
|
53
|
+
url: _chunkB25TJ7KSjs.REGISTRATION_TOKENS_ENDPOINT,
|
|
54
|
+
requestMethod: "GET",
|
|
55
|
+
response: MOCK_LINKS_RESPONSE
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
var getMockUpdatePushNotificationLinksResponse = () => {
|
|
59
|
+
return {
|
|
60
|
+
url: _chunkB25TJ7KSjs.REGISTRATION_TOKENS_ENDPOINT,
|
|
61
|
+
requestMethod: "POST",
|
|
62
|
+
response: null
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
var MOCK_FCM_RESPONSE = {
|
|
66
|
+
name: "",
|
|
67
|
+
token: "fcm-token",
|
|
68
|
+
web: {
|
|
69
|
+
endpoint: "",
|
|
70
|
+
p256dh: "",
|
|
71
|
+
auth: "",
|
|
72
|
+
applicationPubKey: ""
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var getMockCreateFCMRegistrationTokenResponse = () => {
|
|
76
|
+
return {
|
|
77
|
+
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
|
|
78
|
+
requestMethod: "POST",
|
|
79
|
+
response: MOCK_FCM_RESPONSE
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
var getMockDeleteFCMRegistrationTokenResponse = () => {
|
|
83
|
+
return {
|
|
84
|
+
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
|
|
85
|
+
requestMethod: "POST",
|
|
86
|
+
response: {}
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
exports.fixtures_exports = fixtures_exports; exports.NotificationServicesPushController_exports = NotificationServicesPushController_exports;
|
|
94
|
+
//# sourceMappingURL=chunk-2BCJRWFF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/NotificationServicesPushController/index.ts","../src/NotificationServicesPushController/__fixtures__/index.ts","../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,iBAAiB;AACvB,IAAM,sBAAmC;AAAA;AAAA,EAE9C,aAAa,CAAC,KAAK,KAAK,GAAG;AAAA;AAAA,EAE3B,qBAAqB;AAAA,IACnB,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,IAC9C,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,EAChD;AACF;AAEO,IAAM,+CAA+C,MAAM;AAChE,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,6CAA6C,MAAM;AAC9D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,mBAAmB;AAAA,EACrB;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU,CAAC;AAAA,EACb;AACF","sourcesContent":["import Controller from './NotificationServicesPushController';\n\nexport { Controller };\nexport * from './NotificationServicesPushController';\nexport * as Types from './types';\nexport * as Utils from './utils';\nexport * as Mocks from './__fixtures__';\n","export * from './mockResponse';\n","import { REGISTRATION_TOKENS_ENDPOINT } from '../services/endpoints';\nimport type { LinksResult } from '../services/services';\n\ntype MockResponse = {\n url: string | RegExp;\n requestMethod: 'GET' | 'POST' | 'PUT';\n response: unknown;\n};\n\nexport const MOCK_REG_TOKEN = 'REG_TOKEN';\nexport const MOCK_LINKS_RESPONSE: LinksResult = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n trigger_ids: ['1', '2', '3'],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n registration_tokens: [\n { token: 'reg_token_1', platform: 'portfolio' },\n { token: 'reg_token_2', platform: 'extension' },\n ],\n};\n\nexport const getMockRetrievePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'GET',\n response: MOCK_LINKS_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdatePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_FCM_RESPONSE = {\n name: '',\n token: 'fcm-token',\n web: {\n endpoint: '',\n p256dh: '',\n auth: '',\n applicationPubKey: '',\n },\n};\n\nexport const getMockCreateFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: MOCK_FCM_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockDeleteFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: {},\n } satisfies MockResponse;\n};\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
types_exports
|
|
3
|
+
} from "./chunk-IOMDG67D.mjs";
|
|
4
|
+
import {
|
|
5
|
+
utils_exports
|
|
6
|
+
} from "./chunk-DCADU5QI.mjs";
|
|
7
|
+
import {
|
|
8
|
+
NotificationServicesPushController,
|
|
9
|
+
defaultState
|
|
10
|
+
} from "./chunk-X3ZU3HL7.mjs";
|
|
11
|
+
import {
|
|
12
|
+
REGISTRATION_TOKENS_ENDPOINT
|
|
13
|
+
} from "./chunk-IKWNHNJQ.mjs";
|
|
14
|
+
import {
|
|
15
|
+
__export
|
|
16
|
+
} from "./chunk-U5UIDVOO.mjs";
|
|
17
|
+
|
|
18
|
+
// src/NotificationServicesPushController/index.ts
|
|
19
|
+
var NotificationServicesPushController_exports = {};
|
|
20
|
+
__export(NotificationServicesPushController_exports, {
|
|
21
|
+
Controller: () => NotificationServicesPushController,
|
|
22
|
+
Mocks: () => fixtures_exports,
|
|
23
|
+
Types: () => types_exports,
|
|
24
|
+
Utils: () => utils_exports,
|
|
25
|
+
defaultState: () => defaultState
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/NotificationServicesPushController/__fixtures__/index.ts
|
|
29
|
+
var fixtures_exports = {};
|
|
30
|
+
__export(fixtures_exports, {
|
|
31
|
+
MOCK_FCM_RESPONSE: () => MOCK_FCM_RESPONSE,
|
|
32
|
+
MOCK_LINKS_RESPONSE: () => MOCK_LINKS_RESPONSE,
|
|
33
|
+
MOCK_REG_TOKEN: () => MOCK_REG_TOKEN,
|
|
34
|
+
getMockCreateFCMRegistrationTokenResponse: () => getMockCreateFCMRegistrationTokenResponse,
|
|
35
|
+
getMockDeleteFCMRegistrationTokenResponse: () => getMockDeleteFCMRegistrationTokenResponse,
|
|
36
|
+
getMockRetrievePushNotificationLinksResponse: () => getMockRetrievePushNotificationLinksResponse,
|
|
37
|
+
getMockUpdatePushNotificationLinksResponse: () => getMockUpdatePushNotificationLinksResponse
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// src/NotificationServicesPushController/__fixtures__/mockResponse.ts
|
|
41
|
+
var MOCK_REG_TOKEN = "REG_TOKEN";
|
|
42
|
+
var MOCK_LINKS_RESPONSE = {
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
44
|
+
trigger_ids: ["1", "2", "3"],
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
46
|
+
registration_tokens: [
|
|
47
|
+
{ token: "reg_token_1", platform: "portfolio" },
|
|
48
|
+
{ token: "reg_token_2", platform: "extension" }
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
var getMockRetrievePushNotificationLinksResponse = () => {
|
|
52
|
+
return {
|
|
53
|
+
url: REGISTRATION_TOKENS_ENDPOINT,
|
|
54
|
+
requestMethod: "GET",
|
|
55
|
+
response: MOCK_LINKS_RESPONSE
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
var getMockUpdatePushNotificationLinksResponse = () => {
|
|
59
|
+
return {
|
|
60
|
+
url: REGISTRATION_TOKENS_ENDPOINT,
|
|
61
|
+
requestMethod: "POST",
|
|
62
|
+
response: null
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
var MOCK_FCM_RESPONSE = {
|
|
66
|
+
name: "",
|
|
67
|
+
token: "fcm-token",
|
|
68
|
+
web: {
|
|
69
|
+
endpoint: "",
|
|
70
|
+
p256dh: "",
|
|
71
|
+
auth: "",
|
|
72
|
+
applicationPubKey: ""
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var getMockCreateFCMRegistrationTokenResponse = () => {
|
|
76
|
+
return {
|
|
77
|
+
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
|
|
78
|
+
requestMethod: "POST",
|
|
79
|
+
response: MOCK_FCM_RESPONSE
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
var getMockDeleteFCMRegistrationTokenResponse = () => {
|
|
83
|
+
return {
|
|
84
|
+
url: /^https:\/\/fcmregistrations\.googleapis\.com\/v1\/projects\/.*$/u,
|
|
85
|
+
requestMethod: "POST",
|
|
86
|
+
response: {}
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
fixtures_exports,
|
|
92
|
+
NotificationServicesPushController_exports
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=chunk-N4EKQQX7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/NotificationServicesPushController/index.ts","../src/NotificationServicesPushController/__fixtures__/index.ts","../src/NotificationServicesPushController/__fixtures__/mockResponse.ts"],"sourcesContent":["import Controller from './NotificationServicesPushController';\n\nexport { Controller };\nexport * from './NotificationServicesPushController';\nexport * as Types from './types';\nexport * as Utils from './utils';\nexport * as Mocks from './__fixtures__';\n","export * from './mockResponse';\n","import { REGISTRATION_TOKENS_ENDPOINT } from '../services/endpoints';\nimport type { LinksResult } from '../services/services';\n\ntype MockResponse = {\n url: string | RegExp;\n requestMethod: 'GET' | 'POST' | 'PUT';\n response: unknown;\n};\n\nexport const MOCK_REG_TOKEN = 'REG_TOKEN';\nexport const MOCK_LINKS_RESPONSE: LinksResult = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n trigger_ids: ['1', '2', '3'],\n // eslint-disable-next-line @typescript-eslint/naming-convention\n registration_tokens: [\n { token: 'reg_token_1', platform: 'portfolio' },\n { token: 'reg_token_2', platform: 'extension' },\n ],\n};\n\nexport const getMockRetrievePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'GET',\n response: MOCK_LINKS_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdatePushNotificationLinksResponse = () => {\n return {\n url: REGISTRATION_TOKENS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const MOCK_FCM_RESPONSE = {\n name: '',\n token: 'fcm-token',\n web: {\n endpoint: '',\n p256dh: '',\n auth: '',\n applicationPubKey: '',\n },\n};\n\nexport const getMockCreateFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: MOCK_FCM_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockDeleteFCMRegistrationTokenResponse = () => {\n return {\n url: /^https:\\/\\/fcmregistrations\\.googleapis\\.com\\/v1\\/projects\\/.*$/u,\n requestMethod: 'POST',\n response: {},\n } satisfies MockResponse;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,iBAAiB;AACvB,IAAM,sBAAmC;AAAA;AAAA,EAE9C,aAAa,CAAC,KAAK,KAAK,GAAG;AAAA;AAAA,EAE3B,qBAAqB;AAAA,IACnB,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,IAC9C,EAAE,OAAO,eAAe,UAAU,YAAY;AAAA,EAChD;AACF;AAEO,IAAM,+CAA+C,MAAM;AAChE,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,6CAA6C,MAAM;AAC9D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,IACH,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,mBAAmB;AAAA,EACrB;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,EACZ;AACF;AAEO,IAAM,4CAA4C,MAAM;AAC7D,SAAO;AAAA,IACL,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU,CAAC;AAAA,EACb;AACF;","names":[]}
|