@wireapp/core 31.1.3 → 31.2.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.
Files changed (227) hide show
  1. package/package.json +10 -9
  2. package/src/main/Account.d.ts +214 -0
  3. package/src/main/Account.js +463 -0
  4. package/src/main/CoreError.d.ts +9 -0
  5. package/src/main/CoreError.js +26 -0
  6. package/src/main/account/AccountService.d.ts +7 -0
  7. package/src/main/account/AccountService.js +33 -0
  8. package/src/main/account/AccountService.js.map +1 -0
  9. package/src/main/account/index.d.ts +1 -0
  10. package/src/main/account/index.js +36 -0
  11. package/src/main/account/index.js.map +1 -0
  12. package/src/main/auth/LoginSanitizer.d.ts +5 -0
  13. package/src/main/auth/LoginSanitizer.js +41 -0
  14. package/src/main/auth/index.d.ts +1 -0
  15. package/src/main/auth/index.js +36 -0
  16. package/src/main/broadcast/AvailabilityType.d.ts +2 -0
  17. package/src/main/broadcast/AvailabilityType.js +21 -0
  18. package/src/main/broadcast/BroadcastService.d.ts +24 -0
  19. package/src/main/broadcast/BroadcastService.js +74 -0
  20. package/src/main/broadcast/index.d.ts +2 -0
  21. package/src/main/broadcast/index.js +37 -0
  22. package/src/main/client/ClientBackendRepository.d.ts +11 -0
  23. package/src/main/client/ClientBackendRepository.js +43 -0
  24. package/src/main/client/ClientDatabaseRepository.d.ts +27 -0
  25. package/src/main/client/ClientDatabaseRepository.js +85 -0
  26. package/src/main/client/ClientInfo.d.ts +8 -0
  27. package/src/main/client/ClientInfo.js +21 -0
  28. package/src/main/client/ClientService.d.ts +40 -0
  29. package/src/main/client/ClientService.js +103 -0
  30. package/src/main/client/index.d.ts +4 -0
  31. package/src/main/client/index.js +39 -0
  32. package/src/main/connection/ConnectionService.d.ts +11 -0
  33. package/src/main/connection/ConnectionService.js +45 -0
  34. package/src/main/connection/index.d.ts +1 -0
  35. package/src/main/connection/index.js +36 -0
  36. package/src/main/conversation/AbortReason.d.ts +2 -0
  37. package/src/main/conversation/AbortReason.js +21 -0
  38. package/src/main/conversation/AssetService/AssetService.d.ts +62 -0
  39. package/src/main/conversation/AssetService/AssetService.js +88 -0
  40. package/src/main/conversation/AssetService/index.d.ts +1 -0
  41. package/src/main/conversation/AssetService/index.js +36 -0
  42. package/src/main/conversation/AssetTransferState.d.ts +4 -0
  43. package/src/main/conversation/AssetTransferState.js +27 -0
  44. package/src/main/conversation/ClientActionType.d.ts +1 -0
  45. package/src/main/conversation/ClientActionType.js +24 -0
  46. package/src/main/conversation/ConversationMapper/ConversationMapper.d.ts +6 -0
  47. package/src/main/conversation/ConversationMapper/ConversationMapper.js +57 -0
  48. package/src/main/conversation/ConversationMapper/index.d.ts +1 -0
  49. package/src/main/conversation/ConversationMapper/index.js +36 -0
  50. package/src/main/conversation/ConversationService/ConversationService.d.ts +149 -0
  51. package/src/main/conversation/ConversationService/ConversationService.js +584 -0
  52. package/src/main/conversation/ConversationService/ConversationService.types.d.ts +110 -0
  53. package/src/main/conversation/ConversationService/ConversationService.types.js +28 -0
  54. package/src/main/conversation/ConversationService/index.d.ts +2 -0
  55. package/src/main/conversation/ConversationService/index.js +37 -0
  56. package/src/main/conversation/ConversationService/messageGenerator.d.ts +9 -0
  57. package/src/main/conversation/ConversationService/messageGenerator.js +313 -0
  58. package/src/main/conversation/GenericMessageType.d.ts +25 -0
  59. package/src/main/conversation/GenericMessageType.js +49 -0
  60. package/src/main/conversation/MessageTimer/MessageTimer.d.ts +10 -0
  61. package/src/main/conversation/MessageTimer/MessageTimer.js +54 -0
  62. package/src/main/conversation/MessageTimer/index.d.ts +1 -0
  63. package/src/main/conversation/MessageTimer/index.js +36 -0
  64. package/src/main/conversation/ReactionType.d.ts +4 -0
  65. package/src/main/conversation/ReactionType.js +27 -0
  66. package/src/main/conversation/content/AssetContent.d.ts +42 -0
  67. package/src/main/conversation/content/AssetContent.js +21 -0
  68. package/src/main/conversation/content/ButtonActionConfirmationContent.d.ts +2 -0
  69. package/src/main/conversation/content/ButtonActionConfirmationContent.js +21 -0
  70. package/src/main/conversation/content/ButtonActionContent.d.ts +2 -0
  71. package/src/main/conversation/content/ButtonActionContent.js +21 -0
  72. package/src/main/conversation/content/CallingContent.d.ts +1 -0
  73. package/src/main/conversation/content/CallingContent.js +21 -0
  74. package/src/main/conversation/content/ClearedContent.d.ts +2 -0
  75. package/src/main/conversation/content/ClearedContent.js +21 -0
  76. package/src/main/conversation/content/ClientActionContent.d.ts +2 -0
  77. package/src/main/conversation/content/ClientActionContent.js +21 -0
  78. package/src/main/conversation/content/ClientAddContent.d.ts +4 -0
  79. package/src/main/conversation/content/ClientAddContent.js +21 -0
  80. package/src/main/conversation/content/ClientRemoveContent.d.ts +6 -0
  81. package/src/main/conversation/content/ClientRemoveContent.js +21 -0
  82. package/src/main/conversation/content/CompositeContent.d.ts +2 -0
  83. package/src/main/conversation/content/CompositeContent.js +21 -0
  84. package/src/main/conversation/content/ConfirmationContent.d.ts +2 -0
  85. package/src/main/conversation/content/ConfirmationContent.js +21 -0
  86. package/src/main/conversation/content/ContentType.d.ts +21 -0
  87. package/src/main/conversation/content/ContentType.js +94 -0
  88. package/src/main/conversation/content/ConversationContent.d.ts +3 -0
  89. package/src/main/conversation/content/ConversationContent.js +21 -0
  90. package/src/main/conversation/content/DeletedContent.d.ts +2 -0
  91. package/src/main/conversation/content/DeletedContent.js +21 -0
  92. package/src/main/conversation/content/EditedTextContent.d.ts +11 -0
  93. package/src/main/conversation/content/EditedTextContent.js +21 -0
  94. package/src/main/conversation/content/FileContent.d.ts +13 -0
  95. package/src/main/conversation/content/FileContent.js +21 -0
  96. package/src/main/conversation/content/HiddenContent.d.ts +2 -0
  97. package/src/main/conversation/content/HiddenContent.js +21 -0
  98. package/src/main/conversation/content/ImageContent.d.ts +7 -0
  99. package/src/main/conversation/content/ImageContent.js +21 -0
  100. package/src/main/conversation/content/KnockContent.d.ts +2 -0
  101. package/src/main/conversation/content/KnockContent.js +21 -0
  102. package/src/main/conversation/content/LinkPreviewContent.d.ts +10 -0
  103. package/src/main/conversation/content/LinkPreviewContent.js +21 -0
  104. package/src/main/conversation/content/LocationContent.d.ts +9 -0
  105. package/src/main/conversation/content/LocationContent.js +21 -0
  106. package/src/main/conversation/content/MentionContent.d.ts +2 -0
  107. package/src/main/conversation/content/MentionContent.js +21 -0
  108. package/src/main/conversation/content/QuoteContent.d.ts +7 -0
  109. package/src/main/conversation/content/QuoteContent.js +21 -0
  110. package/src/main/conversation/content/ReactionContent.d.ts +7 -0
  111. package/src/main/conversation/content/ReactionContent.js +21 -0
  112. package/src/main/conversation/content/TextContent.d.ts +9 -0
  113. package/src/main/conversation/content/TextContent.js +21 -0
  114. package/src/main/conversation/content/TweetContent.d.ts +2 -0
  115. package/src/main/conversation/content/TweetContent.js +21 -0
  116. package/src/main/conversation/content/index.d.ts +28 -0
  117. package/src/main/conversation/content/index.js +76 -0
  118. package/src/main/conversation/index.d.ts +9 -0
  119. package/src/main/conversation/index.js +44 -0
  120. package/src/main/conversation/message/CompositeContentBuilder.d.ts +14 -0
  121. package/src/main/conversation/message/CompositeContentBuilder.js +54 -0
  122. package/src/main/conversation/message/Message.d.ts +4 -0
  123. package/src/main/conversation/message/Message.js +21 -0
  124. package/src/main/conversation/message/MessageBuilder.d.ts +96 -0
  125. package/src/main/conversation/message/MessageBuilder.js +125 -0
  126. package/src/main/conversation/message/MessageService.d.ts +67 -0
  127. package/src/main/conversation/message/MessageService.js +293 -0
  128. package/src/main/conversation/message/MessageToProtoMapper.d.ts +7 -0
  129. package/src/main/conversation/message/MessageToProtoMapper.js +99 -0
  130. package/src/main/conversation/message/OtrMessage.d.ts +80 -0
  131. package/src/main/conversation/message/OtrMessage.js +21 -0
  132. package/src/main/conversation/message/PayloadBundle.d.ts +76 -0
  133. package/src/main/conversation/message/PayloadBundle.js +81 -0
  134. package/src/main/conversation/message/TeamMessage.d.ts +31 -0
  135. package/src/main/conversation/message/TeamMessage.js +21 -0
  136. package/src/main/conversation/message/TextContentBuilder.d.ts +13 -0
  137. package/src/main/conversation/message/TextContentBuilder.js +75 -0
  138. package/src/main/conversation/message/UserClientsUtil.d.ts +22 -0
  139. package/src/main/conversation/message/UserClientsUtil.js +38 -0
  140. package/src/main/conversation/message/UserMessage.d.ts +43 -0
  141. package/src/main/conversation/message/UserMessage.js +21 -0
  142. package/src/main/conversation/message/messageSender.d.ts +4 -0
  143. package/src/main/conversation/message/messageSender.js +36 -0
  144. package/src/main/cryptography/AssetCryptography/EncryptedAsset.d.ts +11 -0
  145. package/src/main/cryptography/AssetCryptography/EncryptedAsset.js +21 -0
  146. package/src/main/cryptography/AssetCryptography/crypto.browser.d.ts +2 -0
  147. package/src/main/cryptography/AssetCryptography/crypto.browser.js +46 -0
  148. package/src/main/cryptography/AssetCryptography/crypto.node.d.ts +2 -0
  149. package/src/main/cryptography/AssetCryptography/crypto.node.js +72 -0
  150. package/src/main/cryptography/AssetCryptography/index.d.ts +8 -0
  151. package/src/main/cryptography/AssetCryptography/index.js +53 -0
  152. package/src/main/cryptography/AssetCryptography/interfaces.d.ts +9 -0
  153. package/src/main/cryptography/AssetCryptography/interfaces.js +21 -0
  154. package/src/main/cryptography/CryptographyDatabaseRepository.d.ts +16 -0
  155. package/src/main/cryptography/CryptographyDatabaseRepository.js +44 -0
  156. package/src/main/cryptography/CryptographyService.d.ts +52 -0
  157. package/src/main/cryptography/CryptographyService.js +205 -0
  158. package/src/main/cryptography/GenericMessageMapper.d.ts +6 -0
  159. package/src/main/cryptography/GenericMessageMapper.js +160 -0
  160. package/src/main/cryptography/MessageHashService.d.ts +16 -0
  161. package/src/main/cryptography/MessageHashService.js +118 -0
  162. package/src/main/cryptography/SessionPayloadBundle.d.ts +4 -0
  163. package/src/main/cryptography/SessionPayloadBundle.js +21 -0
  164. package/src/main/cryptography/index.d.ts +4 -0
  165. package/src/main/cryptography/index.js +39 -0
  166. package/src/main/giphy/GiphyService.d.ts +9 -0
  167. package/src/main/giphy/GiphyService.js +37 -0
  168. package/src/main/giphy/index.d.ts +1 -0
  169. package/src/main/giphy/index.js +36 -0
  170. package/src/main/index.d.ts +17 -0
  171. package/src/main/index.js +59 -0
  172. package/src/main/linkPreview/LinkPreviewService.d.ts +7 -0
  173. package/src/main/linkPreview/LinkPreviewService.js +52 -0
  174. package/src/main/linkPreview/index.d.ts +1 -0
  175. package/src/main/linkPreview/index.js +36 -0
  176. package/src/main/mls/MLSService/MLSService.d.ts +39 -0
  177. package/src/main/mls/MLSService/MLSService.js +181 -0
  178. package/src/main/mls/index.d.ts +1 -0
  179. package/src/main/mls/index.js +36 -0
  180. package/src/main/mls/keyMaterialUpdatesStore/index.d.ts +1 -0
  181. package/src/main/mls/keyMaterialUpdatesStore/index.js +36 -0
  182. package/src/main/mls/keyMaterialUpdatesStore/keyMaterialUpdatesStore.d.ts +9 -0
  183. package/src/main/mls/keyMaterialUpdatesStore/keyMaterialUpdatesStore.js +51 -0
  184. package/src/main/mls/keyPackagesStatusStore/keyPackagesStatusStore.d.ts +7 -0
  185. package/src/main/mls/keyPackagesStatusStore/keyPackagesStatusStore.js +42 -0
  186. package/src/main/mls/types.d.ts +33 -0
  187. package/src/main/mls/types.js +21 -0
  188. package/src/main/notification/NotificationBackendRepository.d.ts +11 -0
  189. package/src/main/notification/NotificationBackendRepository.js +34 -0
  190. package/src/main/notification/NotificationDatabaseRepository.d.ts +42 -0
  191. package/src/main/notification/NotificationDatabaseRepository.js +97 -0
  192. package/src/main/notification/NotificationService.d.ts +129 -0
  193. package/src/main/notification/NotificationService.js +501 -0
  194. package/src/main/notification/index.d.ts +1 -0
  195. package/src/main/notification/index.js +36 -0
  196. package/src/main/notification/types.d.ts +16 -0
  197. package/src/main/notification/types.js +21 -0
  198. package/src/main/self/SelfService.d.ts +13 -0
  199. package/src/main/self/SelfService.js +55 -0
  200. package/src/main/self/index.d.ts +1 -0
  201. package/src/main/self/index.js +36 -0
  202. package/src/main/team/TeamService.d.ts +15 -0
  203. package/src/main/team/TeamService.js +55 -0
  204. package/src/main/team/index.d.ts +1 -0
  205. package/src/main/team/index.js +36 -0
  206. package/src/main/test/CryptographyHelper.d.ts +4 -0
  207. package/src/main/test/CryptographyHelper.js +69 -0
  208. package/src/main/test/PayloadHelper.d.ts +3 -0
  209. package/src/main/test/PayloadHelper.js +66 -0
  210. package/src/main/user/UserMapper.d.ts +5 -0
  211. package/src/main/user/UserMapper.js +88 -0
  212. package/src/main/user/UserService.d.ts +25 -0
  213. package/src/main/user/UserService.js +81 -0
  214. package/src/main/user/index.d.ts +1 -0
  215. package/src/main/user/index.js +36 -0
  216. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.d.ts +21 -0
  217. package/src/main/util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler.js +62 -0
  218. package/src/main/util/TaskScheduler/TaskScheduler.d.ts +10 -0
  219. package/src/main/util/TaskScheduler/TaskScheduler.js +70 -0
  220. package/src/main/util/TypePredicateUtil.d.ts +7 -0
  221. package/src/main/util/TypePredicateUtil.js +55 -0
  222. package/src/main/util/encryptedStore.d.ts +45 -0
  223. package/src/main/util/encryptedStore.js +116 -0
  224. package/src/main/util/fullyQualifiedClientIdUtils.d.ts +13 -0
  225. package/src/main/util/fullyQualifiedClientIdUtils.js +42 -0
  226. package/src/main/util/index.d.ts +1 -0
  227. package/src/main/util/index.js +36 -0
@@ -0,0 +1,129 @@
1
+ /// <reference types="node" />
2
+ import { APIClient } from '@wireapp/api-client';
3
+ import * as Events from '@wireapp/api-client/src/event';
4
+ import { Notification } from '@wireapp/api-client/src/notification/';
5
+ import { CRUDEngine } from '@wireapp/store-engine';
6
+ import { EventEmitter } from 'events';
7
+ import { PayloadBundle, PayloadBundleSource } from '../conversation';
8
+ import { NotificationError } from '../CoreError';
9
+ import { CryptographyService } from '../cryptography';
10
+ import { GenericMessage } from '@wireapp/protocol-messaging';
11
+ import { AbortHandler } from '@wireapp/api-client/src/tcp';
12
+ import { CommitPendingProposalsParams, LastKeyMaterialUpdateParams } from './types';
13
+ import { MLSService } from '../mls';
14
+ export declare type HandledEventPayload = {
15
+ event: Events.BackendEvent;
16
+ mappedEvent?: PayloadBundle;
17
+ decryptedData?: GenericMessage;
18
+ decryptionError?: {
19
+ code: number;
20
+ message: string;
21
+ };
22
+ };
23
+ declare enum TOPIC {
24
+ NOTIFICATION_ERROR = "NotificationService.TOPIC.NOTIFICATION_ERROR"
25
+ }
26
+ export declare type NotificationHandler = (notification: Notification, source: PayloadBundleSource, progress: {
27
+ done: number;
28
+ total: number;
29
+ }) => Promise<void>;
30
+ export interface NotificationService {
31
+ on(event: TOPIC.NOTIFICATION_ERROR, listener: (payload: NotificationError) => void): this;
32
+ }
33
+ export declare class NotificationService extends EventEmitter {
34
+ private readonly mlsService;
35
+ private readonly apiClient;
36
+ private readonly backend;
37
+ private readonly cryptographyService;
38
+ private readonly database;
39
+ private readonly logger;
40
+ static readonly TOPIC: typeof TOPIC;
41
+ constructor(apiClient: APIClient, cryptographyService: CryptographyService, mlsService: MLSService, storeEngine: CRUDEngine);
42
+ private getAllNotifications;
43
+ /** Should only be called with a completely new client. */
44
+ initializeNotificationStream(): Promise<string>;
45
+ hasHistory(): Promise<boolean>;
46
+ getNotificationEventList(): Promise<Events.BackendEvent[]>;
47
+ setLastEventDate(eventDate: Date): Promise<Date>;
48
+ setLastNotificationId(lastNotification: Notification): Promise<string>;
49
+ handleNotificationStream(notificationHandler: NotificationHandler, onMissedNotifications: (notificationId: string) => void, abortHandler: AbortHandler): Promise<void>;
50
+ /**
51
+ * Checks if an event should be ignored.
52
+ * An event that has a date prior to that last event that we have parsed should be ignored
53
+ *
54
+ * @param event
55
+ * @param source
56
+ * @param lastEventDate?
57
+ */
58
+ private isOutdatedEvent;
59
+ handleNotification(notification: Notification, source: PayloadBundleSource, dryRun?: boolean): AsyncGenerator<HandledEventPayload>;
60
+ private cleanupPayloadBundle;
61
+ private handleEvent;
62
+ /**
63
+ * ## MLS only ##
64
+ * If there is a matching conversationId => groupId pair in the database,
65
+ * we can find the groupId and return it as a string
66
+ *
67
+ * @param conversationQualifiedId
68
+ */
69
+ private getGroupIdFromConversationId;
70
+ /**
71
+ * ## MLS only ##
72
+ * If there are pending proposals, we need to either process them,
73
+ * or save them in the database for later processing
74
+ *
75
+ * @param groupId groupId of the mls conversation
76
+ * @param delayInMs delay in ms before processing proposals
77
+ * @param eventTime time of the event that had the proposals
78
+ */
79
+ private handlePendingProposals;
80
+ /**
81
+ * ## MLS only ##
82
+ * Commit all pending proposals for a given groupId
83
+ *
84
+ * @param groupId groupId of the conversation
85
+ * @param skipDelete if true, do not delete the pending proposals from the database
86
+ */
87
+ commitPendingProposals({ groupId, skipDelete }: CommitPendingProposalsParams): Promise<void>;
88
+ /**
89
+ * ## MLS only ##
90
+ * Get all pending proposals from the database and schedule them
91
+ * Function must only be called once, after application start
92
+ *
93
+ */
94
+ checkExistingPendingProposals(): Promise<void>;
95
+ /**
96
+ * ## MLS only ##
97
+ * Store groupIds with last key material update dates.
98
+ *
99
+ * @param {groupId} params.groupId - groupId of the mls conversation
100
+ * @param {previousUpdateDate} params.previousUpdateDate - date of the previous key material update
101
+ */
102
+ storeLastKeyMaterialUpdateDate(params: LastKeyMaterialUpdateParams): Promise<void>;
103
+ /**
104
+ * ## MLS only ##
105
+ * Renew key material for a given groupId
106
+ *
107
+ * @param groupId groupId of the conversation
108
+ */
109
+ private renewKeyMaterial;
110
+ private createKeyMaterialUpdateTaskSchedulerId;
111
+ private scheduleTaskToRenewKeyMaterial;
112
+ /**
113
+ * ## MLS only ##
114
+ * Get all keying material last update dates and schedule tasks for renewal
115
+ * Function must only be called once, after application start
116
+ *
117
+ */
118
+ checkForKeyMaterialsUpdate(): Promise<void>;
119
+ private scheduleKeyPackagesSync;
120
+ private syncKeyPackages;
121
+ /**
122
+ * ## MLS only ##
123
+ * Get date of last key packages count query and schedule a task to sync it with backend
124
+ * Function must only be called once, after application start
125
+ *
126
+ */
127
+ checkForKeyPackagesBackendSync(): Promise<void>;
128
+ }
129
+ export {};
@@ -0,0 +1,501 @@
1
+ "use strict";
2
+ /*
3
+ * Wire
4
+ * Copyright (C) 2018 Wire Swiss GmbH
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see http://www.gnu.org/licenses/.
18
+ *
19
+ */
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
32
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
33
+ }) : function(o, v) {
34
+ o["default"] = v;
35
+ });
36
+ var __importStar = (this && this.__importStar) || function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
44
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
45
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
46
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
47
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
48
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
49
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
50
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
51
+ function fulfill(value) { resume("next", value); }
52
+ function reject(value) { resume("throw", value); }
53
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
54
+ };
55
+ var __importDefault = (this && this.__importDefault) || function (mod) {
56
+ return (mod && mod.__esModule) ? mod : { "default": mod };
57
+ };
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.NotificationService = void 0;
60
+ const commons_1 = require("@wireapp/commons");
61
+ const Events = __importStar(require("@wireapp/api-client/src/event"));
62
+ const store_engine_1 = require("@wireapp/store-engine");
63
+ const events_1 = require("events");
64
+ const logdown_1 = __importDefault(require("logdown"));
65
+ const conversation_1 = require("../conversation");
66
+ const ConversationMapper_1 = require("../conversation/ConversationMapper");
67
+ const CoreError_1 = require("../CoreError");
68
+ const UserMapper_1 = require("../user/UserMapper");
69
+ const NotificationBackendRepository_1 = require("./NotificationBackendRepository");
70
+ const NotificationDatabaseRepository_1 = require("./NotificationDatabaseRepository");
71
+ const protocol_messaging_1 = require("@wireapp/protocol-messaging");
72
+ const bazinga64_1 = require("bazinga64");
73
+ const TaskScheduler_1 = require("../util/TaskScheduler/TaskScheduler");
74
+ const LowPrecisionTaskScheduler_1 = require("../util/LowPrecisionTaskScheduler/LowPrecisionTaskScheduler");
75
+ const keyPackagesStatusStore_1 = require("../mls/keyPackagesStatusStore/keyPackagesStatusStore");
76
+ const keyMaterialUpdatesStore_1 = require("../mls/keyMaterialUpdatesStore");
77
+ var TOPIC;
78
+ (function (TOPIC) {
79
+ TOPIC["NOTIFICATION_ERROR"] = "NotificationService.TOPIC.NOTIFICATION_ERROR";
80
+ })(TOPIC || (TOPIC = {}));
81
+ const DEFAULT_KEYING_MATERIAL_UPDATE_THRESHOLD = 1000 * 60 * 60 * 24 * 30; //30 days
82
+ const INITIAL_NUMBER_OF_KEY_PACKAGES = 100;
83
+ class NotificationService extends events_1.EventEmitter {
84
+ constructor(apiClient, cryptographyService, mlsService, storeEngine) {
85
+ super();
86
+ this.mlsService = mlsService;
87
+ this.logger = (0, logdown_1.default)('@wireapp/core/notification/NotificationService', {
88
+ logger: console,
89
+ markdown: false,
90
+ });
91
+ this.apiClient = apiClient;
92
+ this.cryptographyService = cryptographyService;
93
+ this.backend = new NotificationBackendRepository_1.NotificationBackendRepository(this.apiClient);
94
+ this.database = new NotificationDatabaseRepository_1.NotificationDatabaseRepository(storeEngine);
95
+ }
96
+ async getAllNotifications() {
97
+ const clientId = this.apiClient.clientId;
98
+ const lastNotificationId = await this.database.getLastNotificationId();
99
+ return this.backend.getAllNotifications(clientId, lastNotificationId);
100
+ }
101
+ /** Should only be called with a completely new client. */
102
+ async initializeNotificationStream() {
103
+ const clientId = this.apiClient.clientId;
104
+ await this.setLastEventDate(new Date(0));
105
+ const latestNotification = await this.backend.getLastNotification(clientId);
106
+ return this.setLastNotificationId(latestNotification);
107
+ }
108
+ async hasHistory() {
109
+ const notificationEvents = await this.getNotificationEventList();
110
+ return !!notificationEvents.length;
111
+ }
112
+ getNotificationEventList() {
113
+ return this.database.getNotificationEventList();
114
+ }
115
+ async setLastEventDate(eventDate) {
116
+ let databaseLastEventDate;
117
+ try {
118
+ databaseLastEventDate = await this.database.getLastEventDate();
119
+ }
120
+ catch (error) {
121
+ if (error instanceof store_engine_1.error.RecordNotFoundError ||
122
+ error.constructor.name === store_engine_1.error.RecordNotFoundError.name) {
123
+ return this.database.createLastEventDate(eventDate);
124
+ }
125
+ throw error;
126
+ }
127
+ if (databaseLastEventDate && eventDate > databaseLastEventDate) {
128
+ return this.database.updateLastEventDate(eventDate);
129
+ }
130
+ return databaseLastEventDate;
131
+ }
132
+ async setLastNotificationId(lastNotification) {
133
+ return this.database.updateLastNotificationId(lastNotification);
134
+ }
135
+ async handleNotificationStream(notificationHandler, onMissedNotifications, abortHandler) {
136
+ const { notifications, missedNotification } = await this.getAllNotifications();
137
+ if (missedNotification) {
138
+ onMissedNotifications(missedNotification);
139
+ }
140
+ for (const [index, notification] of notifications.entries()) {
141
+ if (abortHandler.isAborted()) {
142
+ /* Stop handling notifications if the websocket has been disconnected.
143
+ * Upon reconnecting we are going to restart handling the notification stream for where we left of
144
+ */
145
+ return;
146
+ }
147
+ await notificationHandler(notification, conversation_1.PayloadBundleSource.NOTIFICATION_STREAM, {
148
+ done: index + 1,
149
+ total: notifications.length,
150
+ }).catch(error => this.logger.error(error));
151
+ }
152
+ }
153
+ /**
154
+ * Checks if an event should be ignored.
155
+ * An event that has a date prior to that last event that we have parsed should be ignored
156
+ *
157
+ * @param event
158
+ * @param source
159
+ * @param lastEventDate?
160
+ */
161
+ isOutdatedEvent(event, source, lastEventDate) {
162
+ const isFromNotificationStream = source === conversation_1.PayloadBundleSource.NOTIFICATION_STREAM;
163
+ const shouldCheckEventDate = !!event.time && isFromNotificationStream && lastEventDate;
164
+ if (shouldCheckEventDate) {
165
+ /** This check prevents duplicated "You joined" system messages. */
166
+ const isOutdated = lastEventDate.getTime() >= new Date(event.time).getTime();
167
+ return isOutdated;
168
+ }
169
+ return false;
170
+ }
171
+ handleNotification(notification, source, dryRun = false) {
172
+ return __asyncGenerator(this, arguments, function* handleNotification_1() {
173
+ for (const event of notification.payload) {
174
+ this.logger.log(`Handling event of type "${event.type}" for notification with ID "${notification.id}"`, event);
175
+ let lastEventDate = undefined;
176
+ try {
177
+ lastEventDate = yield __await(this.database.getLastEventDate());
178
+ }
179
+ catch (_a) { }
180
+ if ('time' in event && this.isOutdatedEvent(event, source, lastEventDate)) {
181
+ this.logger.info(`Ignored outdated event type: '${event.type}'`);
182
+ continue;
183
+ }
184
+ try {
185
+ const data = yield __await(this.handleEvent(event, source, dryRun));
186
+ yield yield __await(Object.assign(Object.assign({}, data), { mappedEvent: data.mappedEvent ? this.cleanupPayloadBundle(data.mappedEvent) : undefined }));
187
+ }
188
+ catch (error) {
189
+ this.logger.error(`There was an error with notification ID "${notification.id}": ${error.message}`, error);
190
+ const notificationError = {
191
+ error: error,
192
+ notification,
193
+ type: CoreError_1.CoreError.NOTIFICATION_ERROR,
194
+ };
195
+ this.emit(NotificationService.TOPIC.NOTIFICATION_ERROR, notificationError);
196
+ }
197
+ }
198
+ if (!dryRun && !notification.transient) {
199
+ // keep track of the last handled notification for next time we fetch the notification stream
200
+ yield __await(this.setLastNotificationId(notification));
201
+ }
202
+ });
203
+ }
204
+ cleanupPayloadBundle(payload) {
205
+ switch (payload.type) {
206
+ case conversation_1.PayloadBundleType.ASSET: {
207
+ const assetContent = payload.content;
208
+ const isMetaData = !!(assetContent === null || assetContent === void 0 ? void 0 : assetContent.original) && !(assetContent === null || assetContent === void 0 ? void 0 : assetContent.uploaded);
209
+ const isAbort = !!assetContent.abortReason || (!assetContent.original && !assetContent.uploaded);
210
+ if (isMetaData) {
211
+ payload.type = conversation_1.PayloadBundleType.ASSET_META;
212
+ }
213
+ else if (isAbort) {
214
+ payload.type = conversation_1.PayloadBundleType.ASSET_ABORT;
215
+ }
216
+ return payload;
217
+ }
218
+ default:
219
+ return payload;
220
+ }
221
+ }
222
+ async handleEvent(event, source, dryRun = false) {
223
+ var _a, _b;
224
+ switch (event.type) {
225
+ case Events.CONVERSATION_EVENT.MLS_WELCOME_MESSAGE:
226
+ const data = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
227
+ // We extract the groupId from the welcome message and let coreCrypto store this group
228
+ const newGroupId = await this.mlsService.processWelcomeMessage(data);
229
+ const groupIdStr = bazinga64_1.Encoder.toBase64(newGroupId).asString;
230
+ // The groupId can then be sent back to the consumer
231
+ return {
232
+ event: Object.assign(Object.assign({}, event), { data: groupIdStr }),
233
+ mappedEvent: ConversationMapper_1.ConversationMapper.mapConversationEvent(Object.assign(Object.assign({}, event), { data: groupIdStr }), source),
234
+ };
235
+ case Events.CONVERSATION_EVENT.MLS_MESSAGE_ADD:
236
+ const encryptedData = bazinga64_1.Decoder.fromBase64(event.data).asBytes;
237
+ const groupId = await this.getGroupIdFromConversationId((_a = event.qualified_conversation) !== null && _a !== void 0 ? _a : { id: event.conversation, domain: '' });
238
+ const groupIdBytes = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
239
+ // Check if the message includes proposals
240
+ const { proposals, commitDelay, message } = await this.mlsService.decryptMessage(groupIdBytes, encryptedData);
241
+ if (typeof commitDelay === 'number' || proposals.length > 0) {
242
+ // we are dealing with a proposal, add a task to process this proposal later on
243
+ // Those proposals are stored inside of coreCrypto and will be handled after a timeout
244
+ await this.handlePendingProposals({
245
+ groupId,
246
+ delayInMs: commitDelay !== null && commitDelay !== void 0 ? commitDelay : 0,
247
+ eventTime: event.time,
248
+ });
249
+ // This is not a text message, there is nothing more to do
250
+ return { event };
251
+ }
252
+ if (!message) {
253
+ throw new Error(`MLS message received from ${source} was empty`);
254
+ }
255
+ const decryptedData = protocol_messaging_1.GenericMessage.decode(message);
256
+ /**
257
+ * @todo Find a proper solution to add mappedEvent to this return
258
+ * otherwise event.data will be base64 raw data of the received event
259
+ */
260
+ return { event, decryptedData };
261
+ // Encrypted Proteus events
262
+ case Events.CONVERSATION_EVENT.OTR_MESSAGE_ADD: {
263
+ if (dryRun) {
264
+ // In case of a dry run, we do not want to decrypt messages
265
+ // We just return the raw event to the caller
266
+ return { event };
267
+ }
268
+ try {
269
+ const decryptedData = await this.cryptographyService.decryptMessage(event);
270
+ return {
271
+ mappedEvent: this.cryptographyService.mapGenericMessage(event, decryptedData, source),
272
+ event,
273
+ decryptedData,
274
+ };
275
+ }
276
+ catch (error) {
277
+ return { event, decryptionError: error };
278
+ }
279
+ }
280
+ // Meta events
281
+ case Events.CONVERSATION_EVENT.MEMBER_JOIN:
282
+ // As of today (07/07/2022) the backend sends `WELCOME` message to the user's own conversation (not the actual conversation that the welcome should be part of)
283
+ // So in order to map conversation Ids and groupId together, we need to first fetch the conversation and get the groupId linked to it.
284
+ const conversation = await this.apiClient.api.conversation.getConversation((_b = event.qualified_conversation) !== null && _b !== void 0 ? _b : { id: event.conversation, domain: '' });
285
+ if (!conversation) {
286
+ throw new Error('no conv');
287
+ }
288
+ case Events.CONVERSATION_EVENT.MESSAGE_TIMER_UPDATE:
289
+ case Events.CONVERSATION_EVENT.RENAME:
290
+ case Events.CONVERSATION_EVENT.TYPING: {
291
+ const { conversation, from } = event;
292
+ const metaEvent = Object.assign(Object.assign({}, event), { conversation, from });
293
+ return { mappedEvent: ConversationMapper_1.ConversationMapper.mapConversationEvent(metaEvent, source), event };
294
+ }
295
+ // User events
296
+ case Events.USER_EVENT.CONNECTION:
297
+ case Events.USER_EVENT.CLIENT_ADD:
298
+ case Events.USER_EVENT.UPDATE:
299
+ case Events.USER_EVENT.CLIENT_REMOVE: {
300
+ return { mappedEvent: UserMapper_1.UserMapper.mapUserEvent(event, this.apiClient.context.userId, source), event };
301
+ }
302
+ }
303
+ return { event };
304
+ }
305
+ /**
306
+ * ## MLS only ##
307
+ * If there is a matching conversationId => groupId pair in the database,
308
+ * we can find the groupId and return it as a string
309
+ *
310
+ * @param conversationQualifiedId
311
+ */
312
+ async getGroupIdFromConversationId(conversationQualifiedId) {
313
+ var _a, _b;
314
+ const { id: conversationId, domain: conversationDomain } = conversationQualifiedId;
315
+ const groupId = await ((_b = (_a = this.mlsService).groupIdFromConversationId) === null || _b === void 0 ? void 0 : _b.call(_a, conversationQualifiedId));
316
+ if (!groupId) {
317
+ throw new Error(`Could not find a group_id for conversation ${conversationId}@${conversationDomain}`);
318
+ }
319
+ return groupId;
320
+ }
321
+ /**
322
+ * ## MLS only ##
323
+ * If there are pending proposals, we need to either process them,
324
+ * or save them in the database for later processing
325
+ *
326
+ * @param groupId groupId of the mls conversation
327
+ * @param delayInMs delay in ms before processing proposals
328
+ * @param eventTime time of the event that had the proposals
329
+ */
330
+ async handlePendingProposals({ delayInMs, groupId, eventTime }) {
331
+ if (delayInMs > 0) {
332
+ const eventDate = new Date(eventTime);
333
+ const firingDate = eventDate.setTime(eventDate.getTime() + delayInMs);
334
+ try {
335
+ await this.database.storePendingProposal({
336
+ groupId,
337
+ firingDate,
338
+ });
339
+ }
340
+ catch (error) {
341
+ this.logger.error('Could not store pending proposal', error);
342
+ }
343
+ finally {
344
+ TaskScheduler_1.TaskScheduler.addTask({
345
+ task: () => this.commitPendingProposals({ groupId }),
346
+ firingDate,
347
+ key: groupId,
348
+ });
349
+ }
350
+ }
351
+ else {
352
+ await this.commitPendingProposals({ groupId, skipDelete: true });
353
+ }
354
+ }
355
+ /**
356
+ * ## MLS only ##
357
+ * Commit all pending proposals for a given groupId
358
+ *
359
+ * @param groupId groupId of the conversation
360
+ * @param skipDelete if true, do not delete the pending proposals from the database
361
+ */
362
+ async commitPendingProposals({ groupId, skipDelete = false }) {
363
+ try {
364
+ await this.mlsService.commitPendingProposals(bazinga64_1.Decoder.fromBase64(groupId).asBytes);
365
+ if (!skipDelete) {
366
+ TaskScheduler_1.TaskScheduler.cancelTask(groupId);
367
+ await this.database.deletePendingProposal({ groupId });
368
+ }
369
+ }
370
+ catch (error) {
371
+ this.logger.error(`Error while committing pending proposals for groupId ${groupId}`, error);
372
+ }
373
+ }
374
+ /**
375
+ * ## MLS only ##
376
+ * Get all pending proposals from the database and schedule them
377
+ * Function must only be called once, after application start
378
+ *
379
+ */
380
+ async checkExistingPendingProposals() {
381
+ try {
382
+ const pendingProposals = await this.database.getStoredPendingProposals();
383
+ if (pendingProposals.length > 0) {
384
+ pendingProposals.forEach(({ groupId, firingDate }) => TaskScheduler_1.TaskScheduler.addTask({
385
+ task: () => this.commitPendingProposals({ groupId }),
386
+ firingDate,
387
+ key: groupId,
388
+ }));
389
+ }
390
+ }
391
+ catch (error) {
392
+ this.logger.error('Could not get pending proposals', error);
393
+ }
394
+ }
395
+ /**
396
+ * ## MLS only ##
397
+ * Store groupIds with last key material update dates.
398
+ *
399
+ * @param {groupId} params.groupId - groupId of the mls conversation
400
+ * @param {previousUpdateDate} params.previousUpdateDate - date of the previous key material update
401
+ */
402
+ async storeLastKeyMaterialUpdateDate(params) {
403
+ keyMaterialUpdatesStore_1.keyMaterialUpdatesStore.storeLastKeyMaterialUpdateDate(params);
404
+ await this.scheduleTaskToRenewKeyMaterial(params);
405
+ }
406
+ /**
407
+ * ## MLS only ##
408
+ * Renew key material for a given groupId
409
+ *
410
+ * @param groupId groupId of the conversation
411
+ */
412
+ async renewKeyMaterial({ groupId }) {
413
+ try {
414
+ const groupConversationExists = await this.mlsService.conversationExists(bazinga64_1.Decoder.fromBase64(groupId).asBytes);
415
+ if (!groupConversationExists) {
416
+ keyMaterialUpdatesStore_1.keyMaterialUpdatesStore.deleteLastKeyMaterialUpdateDate({ groupId });
417
+ return;
418
+ }
419
+ const groupIdDecodedFromBase64 = bazinga64_1.Decoder.fromBase64(groupId).asBytes;
420
+ await this.mlsService.updateKeyingMaterial(groupIdDecodedFromBase64);
421
+ const keyRenewalTime = new Date().getTime();
422
+ const keyMaterialUpdateDate = { groupId, previousUpdateDate: keyRenewalTime };
423
+ await this.storeLastKeyMaterialUpdateDate(keyMaterialUpdateDate);
424
+ }
425
+ catch (error) {
426
+ this.logger.error(`Error while renewing key material for groupId ${groupId}`, error);
427
+ }
428
+ }
429
+ createKeyMaterialUpdateTaskSchedulerId(groupId) {
430
+ return `renew-key-material-update-${groupId}`;
431
+ }
432
+ async scheduleTaskToRenewKeyMaterial({ groupId, previousUpdateDate }) {
433
+ var _a;
434
+ //given period of time (30 days by default) after last update date renew key material
435
+ const keyingMaterialUpdateThreshold = ((_a = this.mlsService.config) === null || _a === void 0 ? void 0 : _a.keyingMaterialUpdateThreshold) || DEFAULT_KEYING_MATERIAL_UPDATE_THRESHOLD;
436
+ const firingDate = previousUpdateDate + keyingMaterialUpdateThreshold;
437
+ const key = this.createKeyMaterialUpdateTaskSchedulerId(groupId);
438
+ LowPrecisionTaskScheduler_1.LowPrecisionTaskScheduler.addTask({
439
+ task: () => this.renewKeyMaterial({ groupId }),
440
+ intervalDelay: commons_1.TimeUtil.TimeInMillis.MINUTE,
441
+ firingDate,
442
+ key,
443
+ });
444
+ }
445
+ /**
446
+ * ## MLS only ##
447
+ * Get all keying material last update dates and schedule tasks for renewal
448
+ * Function must only be called once, after application start
449
+ *
450
+ */
451
+ async checkForKeyMaterialsUpdate() {
452
+ try {
453
+ const keyMaterialUpdateDates = keyMaterialUpdatesStore_1.keyMaterialUpdatesStore.getAllUpdateDates();
454
+ keyMaterialUpdateDates.forEach(date => this.scheduleTaskToRenewKeyMaterial(date));
455
+ }
456
+ catch (error) {
457
+ this.logger.error('Could not get last key material update dates', error);
458
+ }
459
+ }
460
+ scheduleKeyPackagesSync(firingDate) {
461
+ TaskScheduler_1.TaskScheduler.addTask({
462
+ firingDate,
463
+ key: 'try-key-packages-backend-sync',
464
+ task: () => this.syncKeyPackages(),
465
+ });
466
+ }
467
+ async syncKeyPackages() {
468
+ const validKeyPackagesCount = await this.mlsService.clientValidKeypackagesCount();
469
+ const lastQueryDate = new Date().getTime();
470
+ await keyPackagesStatusStore_1.keyPackagesStatusStore.saveState({ lastQueryDate });
471
+ const minAllowedNumberOfKeyPackages = INITIAL_NUMBER_OF_KEY_PACKAGES / 2;
472
+ if (validKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
473
+ const clientId = this.apiClient.validatedClientId;
474
+ //check numbers of keys on backend
475
+ const backendKeyPackagesCount = await this.apiClient.api.client.getMLSKeyPackageCount(clientId);
476
+ if (backendKeyPackagesCount <= minAllowedNumberOfKeyPackages) {
477
+ //upload new keys
478
+ const newKeyPackages = await this.mlsService.clientKeypackages(INITIAL_NUMBER_OF_KEY_PACKAGES);
479
+ await this.mlsService.uploadMLSKeyPackages(newKeyPackages, clientId);
480
+ }
481
+ }
482
+ //schedule new task after next 24h
483
+ const nextKeyPackagesQueryDate = lastQueryDate + commons_1.TimeUtil.TimeInMillis.DAY;
484
+ this.scheduleKeyPackagesSync(nextKeyPackagesQueryDate);
485
+ }
486
+ /**
487
+ * ## MLS only ##
488
+ * Get date of last key packages count query and schedule a task to sync it with backend
489
+ * Function must only be called once, after application start
490
+ *
491
+ */
492
+ async checkForKeyPackagesBackendSync() {
493
+ const { lastQueryDate } = keyPackagesStatusStore_1.keyPackagesStatusStore.getState();
494
+ //schedule a task lastKeyPackagesQueryDate + 24H
495
+ const nextKeyPackagesQueryDate = lastQueryDate + commons_1.TimeUtil.TimeInMillis.DAY;
496
+ this.scheduleKeyPackagesSync(nextKeyPackagesQueryDate);
497
+ }
498
+ }
499
+ exports.NotificationService = NotificationService;
500
+ NotificationService.TOPIC = TOPIC;
501
+ //# sourceMappingURL=NotificationService.js.map
@@ -0,0 +1 @@
1
+ export * from './NotificationService';
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /*
3
+ * Wire
4
+ * Copyright (C) 2018 Wire Swiss GmbH
5
+ *
6
+ * This program is free software: you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation, either version 3 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program. If not, see http://www.gnu.org/licenses/.
18
+ *
19
+ */
20
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24
+ desc = { enumerable: true, get: function() { return m[k]; } };
25
+ }
26
+ Object.defineProperty(o, k2, desc);
27
+ }) : (function(o, m, k, k2) {
28
+ if (k2 === undefined) k2 = k;
29
+ o[k2] = m[k];
30
+ }));
31
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
32
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ __exportStar(require("./NotificationService"), exports);
36
+ //# sourceMappingURL=index.js.map