@wireapp/core 46.46.6-beta.14.f6fd03fe6 → 46.46.6-beta.28.9d3034481

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 (195) hide show
  1. package/lib/Account.d.ts +168 -51
  2. package/lib/Account.d.ts.map +1 -1
  3. package/lib/Account.js +517 -127
  4. package/lib/Account.test.js +158 -147
  5. package/lib/broadcast/AvailabilityType.d.ts +1 -1
  6. package/lib/broadcast/AvailabilityType.d.ts.map +1 -1
  7. package/lib/broadcast/BroadcastService.d.ts +1 -1
  8. package/lib/broadcast/BroadcastService.d.ts.map +1 -1
  9. package/lib/broadcast/BroadcastService.js +1 -1
  10. package/lib/client/ClientService.d.ts +4 -3
  11. package/lib/client/ClientService.d.ts.map +1 -1
  12. package/lib/client/ClientService.js +19 -5
  13. package/lib/conversation/AbortReason.d.ts +1 -1
  14. package/lib/conversation/AbortReason.d.ts.map +1 -1
  15. package/lib/conversation/AssetService/AssetService.d.ts +12 -30
  16. package/lib/conversation/AssetService/AssetService.d.ts.map +1 -1
  17. package/lib/conversation/AssetService/AssetService.js +1 -10
  18. package/lib/conversation/AssetService/AssetService.test.js +8 -3
  19. package/lib/conversation/ClientActionType.d.ts +1 -1
  20. package/lib/conversation/ClientActionType.d.ts.map +1 -1
  21. package/lib/conversation/ClientActionType.js +1 -1
  22. package/lib/conversation/ConversationService/ConversationService.d.ts +98 -14
  23. package/lib/conversation/ConversationService/ConversationService.d.ts.map +1 -1
  24. package/lib/conversation/ConversationService/ConversationService.js +314 -101
  25. package/lib/conversation/ConversationService/ConversationService.test.js +441 -47
  26. package/lib/conversation/ConversationService/ConversationService.types.d.ts +5 -4
  27. package/lib/conversation/ConversationService/ConversationService.types.d.ts.map +1 -1
  28. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.d.ts.map +1 -1
  29. package/lib/conversation/ConversationService/Utility/getConversationQualifiedMembers.js +6 -3
  30. package/lib/conversation/SubconversationService/SubconversationService.d.ts.map +1 -1
  31. package/lib/conversation/SubconversationService/SubconversationService.js +158 -11
  32. package/lib/conversation/SubconversationService/SubconversationService.test.js +8 -2
  33. package/lib/conversation/content/AssetContent.d.ts +1 -1
  34. package/lib/conversation/content/AssetContent.d.ts.map +1 -1
  35. package/lib/conversation/content/ButtonActionConfirmationContent.d.ts +1 -1
  36. package/lib/conversation/content/ButtonActionConfirmationContent.d.ts.map +1 -1
  37. package/lib/conversation/content/ButtonActionContent.d.ts +1 -1
  38. package/lib/conversation/content/ButtonActionContent.d.ts.map +1 -1
  39. package/lib/conversation/content/ClearedContent.d.ts +1 -1
  40. package/lib/conversation/content/ClearedContent.d.ts.map +1 -1
  41. package/lib/conversation/content/ClientActionContent.d.ts +1 -1
  42. package/lib/conversation/content/ClientActionContent.d.ts.map +1 -1
  43. package/lib/conversation/content/CompositeContent.d.ts +1 -1
  44. package/lib/conversation/content/CompositeContent.d.ts.map +1 -1
  45. package/lib/conversation/content/ConfirmationContent.d.ts +1 -1
  46. package/lib/conversation/content/ConfirmationContent.d.ts.map +1 -1
  47. package/lib/conversation/content/DeletedContent.d.ts +1 -1
  48. package/lib/conversation/content/DeletedContent.d.ts.map +1 -1
  49. package/lib/conversation/content/HiddenContent.d.ts +1 -1
  50. package/lib/conversation/content/HiddenContent.d.ts.map +1 -1
  51. package/lib/conversation/content/KnockContent.d.ts +1 -1
  52. package/lib/conversation/content/KnockContent.d.ts.map +1 -1
  53. package/lib/conversation/content/LinkPreviewContent.d.ts +1 -1
  54. package/lib/conversation/content/LinkPreviewContent.d.ts.map +1 -1
  55. package/lib/conversation/content/MentionContent.d.ts +1 -1
  56. package/lib/conversation/content/MentionContent.d.ts.map +1 -1
  57. package/lib/conversation/content/MultipartContent.d.ts +1 -1
  58. package/lib/conversation/content/MultipartContent.d.ts.map +1 -1
  59. package/lib/conversation/content/QuoteContent.d.ts +1 -1
  60. package/lib/conversation/content/QuoteContent.d.ts.map +1 -1
  61. package/lib/conversation/content/TweetContent.d.ts +1 -1
  62. package/lib/conversation/content/TweetContent.d.ts.map +1 -1
  63. package/lib/conversation/content/index.d.ts +1 -1
  64. package/lib/conversation/content/index.d.ts.map +1 -1
  65. package/lib/conversation/content/index.js +1 -1
  66. package/lib/conversation/message/MessageBuilder.d.ts +1 -1
  67. package/lib/conversation/message/MessageBuilder.d.ts.map +1 -1
  68. package/lib/conversation/message/MessageBuilder.js +1 -1
  69. package/lib/conversation/message/MessageService.d.ts.map +1 -1
  70. package/lib/conversation/message/MessageService.js +1 -1
  71. package/lib/conversation/message/MessageService.test.js +7 -1
  72. package/lib/conversation/message/MessageToProtoMapper.d.ts +1 -1
  73. package/lib/conversation/message/MessageToProtoMapper.d.ts.map +1 -1
  74. package/lib/conversation/message/MessageToProtoMapper.js +1 -1
  75. package/lib/conversation/message/messageSender.js +2 -2
  76. package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts +2 -2
  77. package/lib/cryptography/AssetCryptography/EncryptedAsset.d.ts.map +1 -1
  78. package/lib/messagingProtocols/common.types.d.ts +9 -0
  79. package/lib/messagingProtocols/common.types.d.ts.map +1 -1
  80. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts +2 -2
  81. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.d.ts.map +1 -1
  82. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIService.types.js +2 -1
  83. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts +1 -1
  84. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.d.ts.map +1 -1
  85. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.js +13 -11
  86. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceExternal.test.js +21 -16
  87. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts +9 -3
  88. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.d.ts.map +1 -1
  89. package/lib/messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal.js +31 -12
  90. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts +6 -0
  91. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.d.ts.map +1 -1
  92. package/lib/messagingProtocols/mls/E2EIdentityService/Helper/index.js +19 -1
  93. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.d.ts +7 -0
  94. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.d.ts.map +1 -0
  95. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/IncomingProposalsQueue.js +48 -0
  96. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingProposalsQueue/index.d.ts +2 -0
  97. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/{IncomingMessagesQueue → IncomingProposalsQueue}/index.d.ts.map +1 -1
  98. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/{IncomingMessagesQueue → IncomingProposalsQueue}/index.js +1 -1
  99. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.d.ts +0 -1
  100. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.d.ts.map +1 -1
  101. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/index.js +0 -1
  102. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.d.ts.map +1 -1
  103. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.js +23 -14
  104. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.d.ts.map +1 -1
  105. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.js +5 -2
  106. package/lib/messagingProtocols/mls/EventHandler/events/welcomeMessage/welcomeMessage.test.js +13 -3
  107. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts +38 -2
  108. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.d.ts.map +1 -1
  109. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.js +41 -6
  110. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.d.ts +2 -0
  111. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.d.ts.map +1 -0
  112. package/lib/messagingProtocols/mls/MLSService/CoreCryptoMLSError.test.js +124 -0
  113. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts +38 -34
  114. package/lib/messagingProtocols/mls/MLSService/MLSService.d.ts.map +1 -1
  115. package/lib/messagingProtocols/mls/MLSService/MLSService.js +267 -208
  116. package/lib/messagingProtocols/mls/MLSService/MLSService.test.js +157 -160
  117. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.js +3 -3
  118. package/lib/messagingProtocols/mls/MLSService/commitBundleUtil.test.js +5 -5
  119. package/lib/messagingProtocols/mls/conversationRejoinQueue.js +2 -2
  120. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.d.ts +78 -0
  121. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.d.ts.map +1 -0
  122. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.js +173 -0
  123. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.d.ts +2 -0
  124. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.d.ts.map +1 -0
  125. package/lib/messagingProtocols/mls/recovery/MlsErrorMapper.test.js +117 -0
  126. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.d.ts +167 -0
  127. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.d.ts.map +1 -0
  128. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.js +317 -0
  129. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.d.ts +2 -0
  130. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.d.ts.map +1 -0
  131. package/lib/messagingProtocols/mls/recovery/MlsRecoveryOrchestrator.test.js +248 -0
  132. package/lib/messagingProtocols/mls/recovery/index.d.ts +5 -0
  133. package/lib/messagingProtocols/mls/recovery/index.d.ts.map +1 -0
  134. package/lib/messagingProtocols/mls/recovery/index.js +28 -0
  135. package/lib/messagingProtocols/mls/types.d.ts +0 -8
  136. package/lib/messagingProtocols/mls/types.d.ts.map +1 -1
  137. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.d.ts.map +1 -1
  138. package/lib/messagingProtocols/proteus/EventHandler/events/otrMessageAdd/otrMessageAdd.js +7 -1
  139. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts +8 -15
  140. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.d.ts.map +1 -1
  141. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CoreCryptoWrapper/CoreCryptoWrapper.js +97 -62
  142. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts +0 -6
  143. package/lib/messagingProtocols/proteus/ProteusService/CryptoClient/CryptoClient.types.d.ts.map +1 -1
  144. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.d.ts +1 -6
  145. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.d.ts.map +1 -1
  146. package/lib/messagingProtocols/proteus/ProteusService/DecryptionErrorGenerator/DecryptionErrorGenerator.js +19 -22
  147. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts +5 -3
  148. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.d.ts.map +1 -1
  149. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.js +11 -24
  150. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts +1 -0
  151. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.d.ts.map +1 -1
  152. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.mocks.js +11 -2
  153. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.test.js +13 -9
  154. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts +3 -2
  155. package/lib/messagingProtocols/proteus/ProteusService/ProteusService.types.d.ts.map +1 -1
  156. package/lib/messagingProtocols/proteus/ProteusService/WithMockedGenerics.test.js +11 -4
  157. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.d.ts +0 -4
  158. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.d.ts.map +1 -1
  159. package/lib/messagingProtocols/proteus/ProteusService/cryptoMigrationStateStore.js +0 -5
  160. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.d.ts +2 -1
  161. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.d.ts.map +1 -1
  162. package/lib/messagingProtocols/proteus/ProteusService/identityClearer.js +8 -2
  163. package/lib/messagingProtocols/proteus/Utility/SessionHandler/SessionHandler.test.js +4 -0
  164. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts +1 -1
  165. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.d.ts.map +1 -1
  166. package/lib/messagingProtocols/proteus/Utility/getGenericMessageParams.js +1 -1
  167. package/lib/notification/NotificationService.d.ts +20 -6
  168. package/lib/notification/NotificationService.d.ts.map +1 -1
  169. package/lib/notification/NotificationService.js +23 -14
  170. package/lib/notification/NotificationService.test.js +8 -0
  171. package/lib/secretStore/secretKeyGenerator.d.ts +1 -0
  172. package/lib/secretStore/secretKeyGenerator.d.ts.map +1 -1
  173. package/lib/secretStore/secretKeyGenerator.js +3 -1
  174. package/lib/self/SelfService.d.ts +2 -2
  175. package/lib/self/SelfService.d.ts.map +1 -1
  176. package/lib/self/SelfService.test.js +5 -2
  177. package/lib/team/TeamService.d.ts +5 -2
  178. package/lib/team/TeamService.d.ts.map +1 -1
  179. package/lib/team/TeamService.js +12 -2
  180. package/lib/test/StoreHelper.d.ts +2 -0
  181. package/lib/test/StoreHelper.d.ts.map +1 -0
  182. package/lib/test/StoreHelper.js +27 -0
  183. package/lib/user/UserService.d.ts +2 -2
  184. package/lib/user/UserService.d.ts.map +1 -1
  185. package/lib/user/UserService.js +3 -3
  186. package/lib/util/TypePredicateUtil.d.ts.map +1 -1
  187. package/lib/util/TypePredicateUtil.js +2 -2
  188. package/package.json +5 -5
  189. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts +0 -4
  190. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.d.ts.map +0 -1
  191. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/IncomingMesssagesQueue.js +0 -69
  192. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/IncomingMessagesQueue/index.d.ts +0 -2
  193. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.d.ts +0 -2
  194. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.d.ts.map +0 -1
  195. package/lib/messagingProtocols/mls/EventHandler/events/messageAdd/messageAdd.test.js +0 -98
package/lib/Account.d.ts CHANGED
@@ -1,8 +1,11 @@
1
1
  import { RegisterData, Context, Cookie, LoginData } from '@wireapp/api-client/lib/auth';
2
- import { ClientType, RegisteredClient } from '@wireapp/api-client/lib/client/';
2
+ import { ClientCapability, ClientType, RegisteredClient } from '@wireapp/api-client/lib/client/';
3
3
  import * as Events from '@wireapp/api-client/lib/event';
4
+ import { Notification } from '@wireapp/api-client/lib/notification/';
5
+ import { ConsumableNotification } from '@wireapp/api-client/lib/notification/ConsumableNotification';
4
6
  import { APIClient, BackendFeatures } from '@wireapp/api-client';
5
7
  import { TypedEventEmitter } from '@wireapp/commons';
8
+ import type { CoreCryptoLogLevel } from '@wireapp/core-crypto';
6
9
  import { CRUDEngine } from '@wireapp/store-engine';
7
10
  import { AccountService } from './account/';
8
11
  import { BroadcastService } from './broadcast/';
@@ -12,10 +15,11 @@ import { AssetService, ConversationService } from './conversation/';
12
15
  import { SubconversationService } from './conversation/SubconversationService/SubconversationService';
13
16
  import { GiphyService } from './giphy/';
14
17
  import { LinkPreviewService } from './linkPreview';
18
+ import { CoreCryptoConfig } from './messagingProtocols/common.types';
15
19
  import { InitClientOptions, MLSService } from './messagingProtocols/mls';
16
20
  import { E2EIServiceExternal } from './messagingProtocols/mls/E2EIdentityService';
17
- import { getTokenCallback } from './messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal';
18
- import { CoreCallbacks, CoreCryptoConfig, SecretCrypto } from './messagingProtocols/mls/types';
21
+ import { getAllConversationsCallback, getTokenCallback } from './messagingProtocols/mls/E2EIdentityService/E2EIServiceInternal';
22
+ import { CoreCallbacks, SecretCrypto } from './messagingProtocols/mls/types';
19
23
  import { NewClient, ProteusService } from './messagingProtocols/proteus';
20
24
  import { HandledEventPayload, NotificationService, NotificationSource } from './notification/';
21
25
  import { SelfService } from './self/';
@@ -23,21 +27,14 @@ import { TeamService } from './team/';
23
27
  import { UserService } from './user/';
24
28
  import { RecurringTaskScheduler } from './util/RecurringTaskScheduler';
25
29
  export type ProcessedEventPayload = HandledEventPayload;
26
- export declare enum EVENTS {
27
- /**
28
- * event triggered when a message from an unknown client is received.
29
- * An unknown client is a client we don't yet have a session with
30
- */
31
- NEW_SESSION = "new_session"
32
- }
33
30
  export declare enum ConnectionState {
34
- /** The websocket is closed and notifications stream is not being processed */
31
+ /** The WebSocket is closed and no notifications are being processed */
35
32
  CLOSED = "closed",
36
- /** The websocket is being opened */
33
+ /** The WebSocket is being opened or reconnected */
37
34
  CONNECTING = "connecting",
38
35
  /** The websocket is open but locked and notifications stream is being processed */
39
36
  PROCESSING_NOTIFICATIONS = "processing_notifications",
40
- /** The websocket is open and message will go through and notifications stream is fully processed */
37
+ /** The WebSocket is open and new messages are processed live in real time */
41
38
  LIVE = "live"
42
39
  }
43
40
  export type CreateStoreFn = (storeName: string, key: Uint8Array) => undefined | Promise<CRUDEngine | undefined>;
@@ -45,6 +42,7 @@ interface AccountOptions {
45
42
  /** Used to store info in the database (will create a inMemory engine if returns undefined) */
46
43
  createStore?: CreateStoreFn;
47
44
  systemCrypto?: SecretCrypto;
45
+ coreCryptoConfig?: CoreCryptoConfig;
48
46
  /** Number of prekeys to generate when creating a new device (defaults to 2)
49
47
  * Prekeys are Diffie-Hellmann public keys which allow offline initiation of a secure Proteus session between two devices.
50
48
  * Having a high value will:
@@ -55,29 +53,40 @@ interface AccountOptions {
55
53
  * - make it likely that all prekeys get consumed while the device is offline and the last resort prekey will be used to create new session
56
54
  */
57
55
  nbPrekeys: number;
58
- /**
59
- * Config for coreCrypto in case it supposed to be used. Will fallback to the old cryptobox logic if not provided
60
- */
61
- coreCryptoConfig?: CoreCryptoConfig;
62
56
  }
63
57
  type InitOptions = {
64
58
  /** cookie used to identify the current user. Will use the browser cookie if not defined */
65
59
  cookie?: Cookie;
66
60
  };
61
+ export declare enum EVENTS {
62
+ /**
63
+ * event triggered when a message from an unknown client is received.
64
+ * An unknown client is a client we don't yet have a session with
65
+ */
66
+ NEW_SESSION = "new_session"
67
+ }
67
68
  type Events = {
68
69
  [EVENTS.NEW_SESSION]: NewClient;
69
70
  };
71
+ export declare const AccountLocalStorageStore: {
72
+ get: (key: string) => string | undefined;
73
+ add: (key: string, value: string) => void;
74
+ remove: (key: string) => void;
75
+ has: (key: string) => boolean;
76
+ };
70
77
  export declare class Account extends TypedEventEmitter<Events> {
71
- private options;
78
+ private readonly options;
72
79
  private readonly apiClient;
73
80
  private readonly logger;
74
- private readonly coreCryptoConfig?;
75
81
  /** this is the client the consumer is currently using. Will be set as soon as `initClient` is called and will be rest upon logout */
76
82
  private currentClient?;
77
83
  private storeEngine?;
78
84
  private db?;
79
85
  private encryptedDb?;
80
86
  private coreCallbacks?;
87
+ private connectionState;
88
+ private readonly notificationProcessingQueue;
89
+ setMaxCoreCryptoLogLevel: (level: CoreCryptoLogLevel) => void;
81
90
  service?: {
82
91
  mls?: MLSService;
83
92
  e2eIdentity?: E2EIServiceExternal;
@@ -115,9 +124,9 @@ export declare class Account extends TypedEventEmitter<Events> {
115
124
  * - useVersion(0, 1, true) > version 1 is used
116
125
  * @return The highest version that is both supported by client and backend
117
126
  */
118
- useAPIVersion(min: number, max: number, allowDev?: boolean): Promise<BackendFeatures>;
119
- private persistCookie;
120
- enrollE2EI({ displayName, handle, teamId, discoveryUrl, getOAuthToken, certificateTtl, }: {
127
+ useAPIVersion: (min: number, max: number, allowDev?: boolean) => Promise<BackendFeatures>;
128
+ private readonly persistCookie;
129
+ enrollE2EI: ({ displayName, handle, teamId, discoveryUrl, getOAuthToken, getAllConversations, certificateTtl, }: {
121
130
  /** display name of the user (should match the identity provider) */
122
131
  displayName: string;
123
132
  /** handle of the user (should match the identity provider) */
@@ -127,9 +136,11 @@ export declare class Account extends TypedEventEmitter<Events> {
127
136
  discoveryUrl: string;
128
137
  /** function called to get the oauth token */
129
138
  getOAuthToken: getTokenCallback;
139
+ /** function called to get all conversations */
140
+ getAllConversations: getAllConversationsCallback;
130
141
  /** number of seconds the certificate should be valid (default 90 days) */
131
142
  certificateTtl?: number;
132
- }): Promise<void>;
143
+ }) => Promise<void>;
133
144
  get clientId(): string;
134
145
  get userId(): string;
135
146
  /**
@@ -138,34 +149,32 @@ export declare class Account extends TypedEventEmitter<Events> {
138
149
  * @param registration The user's data
139
150
  * @param clientType Type of client to create (temporary or permanent)
140
151
  */
141
- register(registration: RegisterData, clientType: ClientType): Promise<Context>;
152
+ register: (registration: RegisterData, clientType: ClientType) => Promise<Context>;
142
153
  /**
143
154
  * Will init the core with an already logged in user
144
155
  *
145
156
  * @param clientType The type of client the user is using (temporary or permanent)
146
157
  */
147
- init(clientType: ClientType, { cookie }?: InitOptions): Promise<Context>;
158
+ init: (clientType: ClientType, { cookie }?: InitOptions) => Promise<Context>;
148
159
  /**
149
160
  * Will log the user in with the given credential.
150
161
  *
151
162
  * @param loginData The credentials of the user
152
163
  * @param clientInfo Info about the client to create (name, type...)
153
164
  */
154
- login(loginData: LoginData): Promise<Context>;
165
+ login: (loginData: LoginData) => Promise<Context>;
155
166
  /**
156
167
  * Will register a new client for the current user
157
168
  */
158
- registerClient(loginData: LoginData, clientInfo?: ClientInfo,
159
- /** will add extra manual entropy to the client's identity being created */
160
- entropyData?: Uint8Array): Promise<RegisteredClient>;
161
- getLocalClient(): Promise<RegisteredClient | undefined> | undefined;
169
+ registerClient: (loginData: LoginData, useLegacyNotificationStream: boolean, entropyData?: Uint8Array, clientInfo?: ClientInfo) => Promise<RegisteredClient>;
170
+ getLocalClient(): Promise<import("./client/ClientService").MetaClient | undefined> | undefined;
162
171
  /**
163
172
  * Will initiate all the cryptographic material of the given registered device and setup all the background tasks.
164
173
  *
165
174
  * @returns The local existing client or undefined if the client does not exist or is not valid (non existing on backend)
166
175
  */
167
- initClient(client: RegisteredClient, mlsConfig?: InitClientOptions): Promise<RegisteredClient>;
168
- private buildCryptoClient;
176
+ initClient: (client: RegisteredClient, mlsConfig?: InitClientOptions) => Promise<RegisteredClient>;
177
+ private readonly buildCryptoClient;
169
178
  /**
170
179
  * In order to be able to send MLS messages, the core needs a few information from the consumer.
171
180
  * Namely:
@@ -173,18 +182,27 @@ export declare class Account extends TypedEventEmitter<Events> {
173
182
  * - what is the groupId of a conversation
174
183
  * @param coreCallbacks
175
184
  */
176
- configureCoreCallbacks(coreCallbacks: CoreCallbacks): void;
177
- private initServices;
178
- private resetContext;
185
+ configureCoreCallbacks: (coreCallbacks: CoreCallbacks) => void;
186
+ private readonly initServices;
187
+ private readonly resetContext;
179
188
  /**
180
189
  * Will logout the current user
181
190
  * @param clearData if set to `true` will completely wipe any database that was created by the Account
182
191
  */
183
- logout(clearData?: boolean): Promise<void>;
192
+ logout: (data?: {
193
+ clearAllData?: boolean;
194
+ clearCryptoData?: boolean;
195
+ }) => Promise<void>;
196
+ private readonly wipeCommonData;
197
+ /**
198
+ * Will delete the identity and history of the current user
199
+ */
200
+ private readonly wipeAllData;
184
201
  /**
185
- * Will delete the identity of the current user
202
+ * Will delete the cryptography and client of the current user
203
+ * Will keep the history intact
186
204
  */
187
- private wipe;
205
+ private readonly wipeCryptoData;
188
206
  /**
189
207
  * return true if the current user has a MLS device that is initialized and ready to use
190
208
  */
@@ -196,20 +214,17 @@ export declare class Account extends TypedEventEmitter<Events> {
196
214
  * @param callbacks callbacks that will be called to handle different events
197
215
  * @returns close a function that will disconnect from the websocket
198
216
  */
199
- listen({ onEvent, onConnectionStateChanged, onNotificationStreamProgress, onMissedNotifications, dryRun, }?: {
217
+ listen: ({ useLegacy, onEvent, onConnectionStateChanged: onConnectionStateChangedCallBack, onNotificationStreamProgress, onMissedNotifications, }?: {
200
218
  /**
201
219
  * Called when a new event arrives from backend
202
220
  * @param payload the payload of the event. Contains the raw event received and the decrypted data (if event was encrypted)
203
221
  * @param source where the message comes from (either websocket or notification stream)
204
222
  */
205
- onEvent?: (payload: HandledEventPayload, source: NotificationSource) => void;
223
+ onEvent?: (payload: HandledEventPayload, source: NotificationSource) => Promise<void>;
206
224
  /**
207
225
  * During the notification stream processing, this function will be called whenever a new notification has been processed
208
226
  */
209
- onNotificationStreamProgress?: ({ done, total }: {
210
- done: number;
211
- total: number;
212
- }) => void;
227
+ onNotificationStreamProgress?: (currentProcessingNotificationTimestamp: string) => void;
213
228
  /**
214
229
  * called when the connection state with the backend has changed
215
230
  */
@@ -222,17 +237,119 @@ export declare class Account extends TypedEventEmitter<Events> {
222
237
  * @param {string} notificationId
223
238
  */
224
239
  onMissedNotifications?: (notificationId: string) => void;
240
+ /**
241
+ * When set to true, will use the legacy notification stream instead of the new async notifications.
242
+ */
243
+ useLegacy?: boolean;
225
244
  /**
226
245
  * When set will not decrypt and not store the last notification ID. This is useful if you only want to subscribe to unencrypted backend events
246
+ * @deprecated Core doesn't support dryRun mode anymore and this parameter will be removed in future versions
227
247
  */
228
248
  dryRun?: boolean;
229
- }): () => void;
230
- private generateDbName;
231
- private generateCoreDbName;
232
- private generateEncryptedDbName;
233
- private initEngine;
234
- private groupIdFromConversationId;
235
- isMLSActiveForClient(): Promise<boolean>;
249
+ }) => Promise<() => void>;
250
+ private readonly createConnectionStateChangedHandler;
251
+ /**
252
+ * Creates the event handler that is invoked for each decrypted event from the backend.
253
+ * Responsible for handling specific event types like `MESSAGE_TIMER_UPDATE`, and then
254
+ * forwarding the event to the consumer via the `onEvent` callback.
255
+ */
256
+ private readonly createEventHandler;
257
+ /**
258
+ * @deprecated This method is used to handle legacy notifications from the backend.
259
+ * It processes notifications from the legacy system, decrypts them, and emits events.
260
+ * It can be replaced with the new notification handling system using `ConsumableNotification`
261
+ * when all clients are capable of handling consumable notifications.
262
+ */
263
+ private readonly createLegacyNotificationHandler;
264
+ private readonly createNotificationHandler;
265
+ private readonly handleNotificationQueueError;
266
+ private readonly acknowledgeSynchronizationNotification;
267
+ private readonly handleSynchronizationNotification;
268
+ private readonly decryptAckEmitNotification;
269
+ getNotificationEventTime: (backendEvent: Events.BackendEvent) => string | null;
270
+ /**
271
+ * Returns a function to handle missed notifications — i.e., when the backend indicates
272
+ * that some notifications were lost due to age (typically >28 days).
273
+ * Also handles MLS-specific epoch mismatch recovery by triggering a conversation rejoin.
274
+ *
275
+ * @deprecated This is used to handle legacy missed notifications.
276
+ * It should be replaced with the new notification handling system using `ConsumableNotification`.
277
+ * when all clients are capable of handling consumable notifications.
278
+ */
279
+ private readonly createLegacyMissedNotificationsHandler;
280
+ /**
281
+ * Returns a processor function for the notification stream (legacy sync).
282
+ * It pauses message sending and MLS rejoining during stream handling to prevent race conditions,
283
+ * then resumes normal operations after sync is complete.
284
+ *
285
+ * @deprecated This is used to do a final sync of the legacy notification stream
286
+ * before switching to the new notification handling system using `ConsumableNotification`.
287
+ * It should be replaced with the new notification handling system when all clients are capable of handling consumable notifications.
288
+ *
289
+ * @param handlers Various logic handlers wired to notification callbacks
290
+ */
291
+ private readonly createLegacyNotificationStreamProcessor;
292
+ /**
293
+ * In case of a closed connection, we flush the notification processing queue.
294
+ * As we are not acknowledging them before decryption is done
295
+ * they will be resent next time the connection is opened
296
+ * this is to avoid duplicate decryption of notifications
297
+ */
298
+ private readonly pauseAndFlushNotificationQueue;
299
+ readonly pauseNotificationQueue: () => void;
300
+ readonly resumeNotificationQueue: () => void;
301
+ /**
302
+ * Sets up WebSocket event listeners for:
303
+ * - Incoming backend messages
304
+ * - WebSocket state changes
305
+ * On each new backend message, we pass it to the notification handler.
306
+ * On state changes, we map raw socket states to public connection states and emit them.
307
+ */
308
+ private readonly setupWebSocketListeners;
309
+ /**
310
+ * Handles logic for reacting to a missed notification event.
311
+ *
312
+ * The backend sends a special "missed notification" signal if it detects
313
+ * that the client has missed one or more notifications. Once this signal is sent,
314
+ * the backend will **stop sending all further notifications** until the client
315
+ * acknowledges the missed state.
316
+ *
317
+ * Because our app currently lacks functionality to perform a full real-time sync
318
+ * while running, we must reload the application to re-fetch the entire state.
319
+ *
320
+ * On first detection of the missed notification:
321
+ * - We set a local storage flag (`has_missing_notification`) to mark that we've
322
+ * entered this state.
323
+ * - We reload the application so the state can be re-fetched from scratch.
324
+ *
325
+ * On the next load:
326
+ * - If the flag is already present, we acknowledge the missed notification via
327
+ * the WebSocket transport, unblocking the backend so it resumes sending updates
328
+ * then we remove the flag.
329
+ */
330
+ private readonly reactToMissedNotification;
331
+ getClientCapabilities: () => ClientCapability[];
332
+ static checkIsConsumable: (notification: Notification | ConsumableNotification) => notification is ConsumableNotification;
333
+ static checkIsLegacyNotification: (notification: Notification | ConsumableNotification) => notification is Notification;
334
+ private readonly generateDbName;
335
+ private readonly generateCoreDbName;
336
+ private readonly generateEncryptedDbName;
337
+ private readonly initEngine;
338
+ private readonly groupIdFromConversationId;
339
+ isMLSActiveForClient: () => Promise<boolean>;
340
+ private readonly isMLSConversationRecoveryEnabled;
341
+ /**
342
+ * Checks the health of the WebSocket connection by sending a ping and waiting for a pong response.
343
+ * This is a non-disruptive check that does not close or reconnect the socket.
344
+ * @returns A promise that resolves to true if the socket responds with a pong within the timeout, false otherwise.
345
+ *
346
+ * @example
347
+ * const healthy = await account.isWebsocketHealthy();
348
+ * if (!healthy) {
349
+ * // handle unhealthy websocket
350
+ * }
351
+ */
352
+ isWebsocketHealthy: () => Promise<boolean>;
236
353
  }
237
354
  export {};
238
355
  //# sourceMappingURL=Account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../src/Account.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,YAAY,EAGZ,OAAO,EACP,MAAM,EAEN,SAAS,EAEV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,UAAU,EAAE,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEnG,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AAUxD,OAAO,EAAC,SAAS,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAa,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAC,UAAU,EAAe,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAC,sBAAsB,EAAC,MAAM,8DAA8D,CAAC;AACpG,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAE,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAMvE,OAAO,EAAC,mBAAmB,EAAO,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAC,gBA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