@sudoplatform/sudo-secure-communications 5.5.1 → 5.6.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 (68) hide show
  1. package/cjs/private/data/session/sessionManager.js +25 -10
  2. package/cjs/private/data/session/sessionManager.js.map +1 -1
  3. package/cjs/private/domain/use-cases/handles/provisionHandleUseCase.js +3 -3
  4. package/cjs/private/domain/use-cases/handles/provisionHandleUseCase.js.map +1 -1
  5. package/cjs/public/modules/handlesModule.js +1 -0
  6. package/cjs/public/modules/handlesModule.js.map +1 -1
  7. package/cjs/public/secureCommsClient.js +4 -4
  8. package/cjs/public/secureCommsClient.js.map +1 -1
  9. package/docs/assets/hierarchy.js +1 -1
  10. package/docs/assets/search.js +1 -1
  11. package/docs/classes/DefaultHandlesModule.html +6 -6
  12. package/docs/classes/DefaultSecureCommsClient.html +18 -16
  13. package/docs/hierarchy.html +1 -1
  14. package/docs/interfaces/Audio.html +1 -1
  15. package/docs/interfaces/AudioMedia.html +1 -1
  16. package/docs/interfaces/BaseMessageContent.html +1 -1
  17. package/docs/interfaces/ChannelInvite.html +1 -1
  18. package/docs/interfaces/ChannelMember.html +1 -1
  19. package/docs/interfaces/DirectChatInvite.html +1 -1
  20. package/docs/interfaces/EditedMessage.html +1 -1
  21. package/docs/interfaces/Emote.html +1 -1
  22. package/docs/interfaces/EncryptedMessage.html +1 -1
  23. package/docs/interfaces/File.html +1 -1
  24. package/docs/interfaces/FileMedia.html +1 -1
  25. package/docs/interfaces/GetMessagesInput.html +1 -1
  26. package/docs/interfaces/GroupInvite.html +1 -1
  27. package/docs/interfaces/GroupMember.html +1 -1
  28. package/docs/interfaces/Handle.html +1 -1
  29. package/docs/interfaces/HandlesModule.html +5 -5
  30. package/docs/interfaces/Image.html +1 -1
  31. package/docs/interfaces/ImageMedia.html +1 -1
  32. package/docs/interfaces/Invite.html +1 -1
  33. package/docs/interfaces/KeyVerificationRequest.html +1 -1
  34. package/docs/interfaces/ListHandlesInput.html +1 -1
  35. package/docs/interfaces/Location.html +1 -1
  36. package/docs/interfaces/Member.html +1 -1
  37. package/docs/interfaces/MembershipChange.html +1 -1
  38. package/docs/interfaces/MessageNotification.html +1 -1
  39. package/docs/interfaces/Notice.html +1 -1
  40. package/docs/interfaces/NotificationInfo.html +1 -1
  41. package/docs/interfaces/OwnedHandle.html +1 -1
  42. package/docs/interfaces/Pagination.html +1 -1
  43. package/docs/interfaces/Poll.html +1 -1
  44. package/docs/interfaces/PollResponse.html +1 -1
  45. package/docs/interfaces/ProvisionHandleInput.html +7 -5
  46. package/docs/interfaces/RedactedMessage.html +1 -1
  47. package/docs/interfaces/SearchMessagesInput.html +1 -1
  48. package/docs/interfaces/SecureCommsClient.html +8 -6
  49. package/docs/interfaces/SelfDestructedMessage.html +1 -1
  50. package/docs/interfaces/SelfDestructible.html +1 -1
  51. package/docs/interfaces/Text.html +1 -1
  52. package/docs/interfaces/UpdateHandleInput.html +3 -3
  53. package/docs/interfaces/Video.html +1 -1
  54. package/docs/interfaces/VideoMedia.html +1 -1
  55. package/docs/types/SecureCommsClientOptions.html +7 -7
  56. package/lib/private/data/session/sessionManager.js +25 -10
  57. package/lib/private/data/session/sessionManager.js.map +1 -1
  58. package/lib/private/domain/use-cases/handles/provisionHandleUseCase.js +3 -3
  59. package/lib/private/domain/use-cases/handles/provisionHandleUseCase.js.map +1 -1
  60. package/lib/public/modules/handlesModule.js +1 -0
  61. package/lib/public/modules/handlesModule.js.map +1 -1
  62. package/lib/public/secureCommsClient.js +4 -4
  63. package/lib/public/secureCommsClient.js.map +1 -1
  64. package/package.json +124 -127
  65. package/types/private/data/session/sessionManager.d.ts +10 -2
  66. package/types/private/domain/use-cases/handles/provisionHandleUseCase.d.ts +2 -2
  67. package/types/public/modules/handlesModule.d.ts +2 -0
  68. package/types/public/secureCommsClient.d.ts +6 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudoplatform/sudo-secure-communications",
3
- "version": "5.5.1",
3
+ "version": "5.6.0",
4
4
  "author": "Anonyome Labs, Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -71,7 +71,7 @@
71
71
  "@aws-sdk/credential-provider-cognito-identity": "^3.965.0",
72
72
  "@aws-sdk/credential-providers": "^3.965.0",
73
73
  "@aws-sdk/lib-storage": "^3.965.0",
74
- "@matrix-org/matrix-sdk-crypto-wasm": "15.3.0",
74
+ "@matrix-org/matrix-sdk-crypto-wasm": "18.0.0",
75
75
  "@sudoplatform/sudo-web-crypto-provider": "^10.0.1",
76
76
  "@types/md5": "^2.3.6",
77
77
  "async-mutex": "^0.5.0",
@@ -82,7 +82,7 @@
82
82
  "idb": "^8.0.3",
83
83
  "io-ts": "^2.2.22",
84
84
  "jsonwebtoken": "^9.0.3",
85
- "lodash": "^4.17.21",
85
+ "lodash": "^4.18.1",
86
86
  "matrix-encrypt-attachment": "^1.0.3",
87
87
  "md5": "^2.3.0",
88
88
  "monocle-ts": "^2.3.13",
@@ -101,10 +101,12 @@
101
101
  "minimist": "^1.2.8",
102
102
  "graphql": "^16.12.0",
103
103
  "got": "^12.6.0",
104
+ "handlebars": "4.7.9",
104
105
  "dset": "^3.1.2",
105
106
  "debug": "^4.3.4",
106
107
  "ua-parser-js": "^1.0.35",
107
108
  "json5": "^2.2.3",
109
+ "lodash": "4.18.1",
108
110
  "fast-xml-parser": "^5.5.6",
109
111
  "form-data": "^3.0.4",
110
112
  "semver": "^7.5.2",
@@ -127,7 +129,7 @@
127
129
  "@graphql-codegen/typed-document-node": "^6.1.4",
128
130
  "@graphql-codegen/typescript": "^5.0.6",
129
131
  "@graphql-codegen/typescript-operations": "^5.0.6",
130
- "@matrix-org/matrix-sdk-crypto-nodejs": "^0.4.0-beta.1",
132
+ "@matrix-org/matrix-sdk-crypto-nodejs": "0.5.1",
131
133
  "@sudoplatform/sudo-api-client": "^16.0.0",
132
134
  "@sudoplatform/sudo-common": "^12.2.0",
133
135
  "@sudoplatform/sudo-entitlements": "^18.0.0",
@@ -169,204 +171,199 @@
169
171
  "packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8",
170
172
  "auditSuppressions": {
171
173
  "1111987": {
172
- "until": 1777593599,
173
- "untilISO": "2026-04-30T23:59:59Z",
174
+ "until": 1785460570,
175
+ "untilISO": "2026-07-31T01:16:10Z",
174
176
  "reason": "Waiting for patch - @smithy/config-resolver"
175
177
  },
176
- "1112255": {
177
- "until": 1777593599,
178
- "untilISO": "2026-04-30T23:59:59Z",
179
- "reason": "node-tar used by bufferutil by websocket"
180
- },
181
- "1112329": {
182
- "until": 1777593599,
183
- "untilISO": "2026-04-30T23:59:59Z",
184
- "reason": "node-tar used by bufferutil by websocket"
185
- },
186
178
  "1112455": {
187
- "until": 1777593599,
188
- "untilISO": "2026-04-30T23:59:59Z",
179
+ "until": 1785460570,
180
+ "untilISO": "2026-07-31T01:16:10Z",
189
181
  "reason": "Waiting for patch - Lodash used by other sudo packages"
190
182
  },
191
- "1112659": {
192
- "until": 1777593599,
193
- "untilISO": "2026-04-30T23:59:59Z",
194
- "reason": "node-tar used by node-gyp - requires tar >=7.5.8"
195
- },
196
183
  "1112686": {
197
- "until": 1777593599,
198
- "untilISO": "2026-04-30T23:59:59Z",
184
+ "until": 1785460570,
185
+ "untilISO": "2026-07-31T01:16:10Z",
199
186
  "reason": "eslint advisory - suppress until eslint can be upgraded to >=9.26.0"
200
187
  },
201
188
  "1112818": {
202
- "until": 1777593599,
203
- "untilISO": "2026-04-30T23:59:59Z",
189
+ "until": 1785460570,
190
+ "untilISO": "2026-07-31T01:16:10Z",
204
191
  "reason": "eslint advisory - suppress until eslint can be upgraded"
205
192
  },
206
193
  "1112862": {
207
- "until": 1777593599,
208
- "untilISO": "2026-04-30T23:59:59Z",
194
+ "until": 1785460570,
195
+ "untilISO": "2026-07-31T01:16:10Z",
209
196
  "reason": "eslint advisory - suppress until eslint can be upgraded"
210
197
  },
211
198
  "1112954": {
212
- "until": 1777593599,
213
- "untilISO": "2026-04-30T23:59:59Z",
199
+ "until": 1785460570,
200
+ "untilISO": "2026-07-31T01:16:10Z",
214
201
  "reason": "eslint advisory - suppress until eslint can be upgraded"
215
202
  },
216
203
  "1113190": {
217
- "until": 1777593599,
218
- "untilISO": "2026-04-30T23:59:59Z",
204
+ "until": 1785460570,
205
+ "untilISO": "2026-07-31T01:16:10Z",
219
206
  "reason": "markdown-it advisory used by typedoc"
220
207
  },
221
- "1113300": {
222
- "until": 1777593599,
223
- "untilISO": "2026-04-30T23:59:59Z",
224
- "reason": "node-tar used by node-gyp"
225
- },
226
- "1113331": {
227
- "until": 1777593599,
228
- "untilISO": "2026-04-30T23:59:59Z",
229
- "reason": "fast-xml-parser advisory - suppress until fast-xml-parser >=5.3.6"
230
- },
231
208
  "1113371": {
232
- "until": 1777593599,
233
- "untilISO": "2026-04-30T23:59:59Z",
209
+ "until": 1785460570,
210
+ "untilISO": "2026-07-31T01:16:10Z",
234
211
  "reason": "minimatch advisory used by tooling deps (typescript-eslint, eslint-plugin-import, glob, typedoc)"
235
212
  },
236
- "1113375": {
237
- "until": 1777593599,
238
- "untilISO": "2026-04-30T23:59:59Z",
239
- "reason": "node-tar used by node-gyp"
240
- },
241
213
  "1113398": {
242
- "until": 1777593599,
243
- "untilISO": "2026-04-30T23:59:59Z",
214
+ "until": 1785460570,
215
+ "untilISO": "2026-07-31T01:16:10Z",
244
216
  "reason": "eslint advisory - suppress until eslint can be upgraded"
245
217
  },
246
- "1113407": {
247
- "until": 1777593599,
248
- "untilISO": "2026-04-30T23:59:59Z",
249
- "reason": "fast-xml-parser advisory - suppress until fast-xml-parser can be bumped"
250
- },
251
218
  "1113459": {
252
- "until": 1777593599,
253
- "untilISO": "2026-04-30T23:59:59Z",
219
+ "until": 1785460570,
220
+ "untilISO": "2026-07-31T01:16:10Z",
254
221
  "reason": "minimatch ReDoS - transitive via eslint-plugin-import"
255
222
  },
256
223
  "1113465": {
257
- "until": 1777593599,
258
- "untilISO": "2026-04-30T23:59:59Z",
224
+ "until": 1785460570,
225
+ "untilISO": "2026-07-31T01:16:10Z",
259
226
  "reason": "minimatch ReDoS - transitive via typescript-eslint, typedoc"
260
227
  },
261
228
  "1113466": {
262
- "until": 1777593599,
263
- "untilISO": "2026-04-30T23:59:59Z",
229
+ "until": 1785460570,
230
+ "untilISO": "2026-07-31T01:16:10Z",
264
231
  "reason": "minimatch ReDoS - transitive via glob"
265
232
  },
266
233
  "1113538": {
267
- "until": 1777593599,
268
- "untilISO": "2026-04-30T23:59:59Z",
234
+ "until": 1785460570,
235
+ "untilISO": "2026-07-31T01:16:10Z",
269
236
  "reason": "minimatch ReDoS matchOne - transitive via eslint-plugin-import"
270
237
  },
271
238
  "1113544": {
272
- "until": 1777593599,
273
- "untilISO": "2026-04-30T23:59:59Z",
239
+ "until": 1785460570,
240
+ "untilISO": "2026-07-31T01:16:10Z",
274
241
  "reason": "minimatch ReDoS matchOne - transitive via typescript-eslint, typedoc"
275
242
  },
276
243
  "1113545": {
277
- "until": 1777593599,
278
- "untilISO": "2026-04-30T23:59:59Z",
244
+ "until": 1785460570,
245
+ "untilISO": "2026-07-31T01:16:10Z",
279
246
  "reason": "minimatch ReDoS matchOne - transitive via glob"
280
247
  },
281
248
  "1113546": {
282
- "until": 1777593599,
283
- "untilISO": "2026-04-30T23:59:59Z",
249
+ "until": 1785460571,
250
+ "untilISO": "2026-07-31T01:16:11Z",
284
251
  "reason": "minimatch ReDoS extglobs - transitive via eslint-plugin-import"
285
252
  },
286
253
  "1113552": {
287
- "until": 1777593599,
288
- "untilISO": "2026-04-30T23:59:59Z",
254
+ "until": 1785460571,
255
+ "untilISO": "2026-07-31T01:16:11Z",
289
256
  "reason": "minimatch ReDoS extglobs - transitive via typescript-eslint, typedoc"
290
257
  },
291
258
  "1113553": {
292
- "until": 1777593599,
293
- "untilISO": "2026-04-30T23:59:59Z",
259
+ "until": 1785460571,
260
+ "untilISO": "2026-07-31T01:16:11Z",
294
261
  "reason": "minimatch ReDoS extglobs - transitive via glob"
295
262
  },
296
- "1113568": {
297
- "until": 1777593599,
298
- "untilISO": "2026-04-30T23:59:59Z",
299
- "reason": "fast-xml-parser entity encoding bypass - transitive via @aws-sdk/xml-builder"
300
- },
301
- "1113569": {
302
- "until": 1777593599,
303
- "untilISO": "2026-04-30T23:59:59Z",
304
- "reason": "fast-xml-parser DoS via entity expansion - transitive via @aws-sdk/xml-builder"
305
- },
306
263
  "1113714": {
307
- "until": 1777593599,
308
- "untilISO": "2026-04-30T23:59:59Z",
264
+ "until": 1785460571,
265
+ "untilISO": "2026-07-31T01:16:11Z",
309
266
  "reason": "ajv ReDoS via $data - transitive via eslint"
310
267
  },
311
268
  "1113977": {
312
- "until": 1777593599,
313
- "untilISO": "2026-04-30T23:59:59Z",
269
+ "until": 1785460571,
270
+ "untilISO": "2026-07-31T01:16:11Z",
314
271
  "reason": "http-proxy-agenty - suppress low severity advisory"
315
272
  },
316
- "1114153": {
317
- "until": 1777593599,
318
- "untilISO": "2026-04-30T23:59:59Z",
319
- "reason": "fast-xml-parser stack overflow in XMLBuilder - transitive via @aws-sdk/xml-builder"
320
- },
321
273
  "1114158": {
322
- "until": 1777593599,
323
- "untilISO": "2026-04-30T23:59:59Z",
274
+ "until": 1785460571,
275
+ "untilISO": "2026-07-31T01:16:11Z",
324
276
  "reason": "immutable prototype pollution - suppress low severity advisory"
325
277
  },
326
- "1114200": {
327
- "until": 1777593599,
328
- "untilISO": "2026-04-30T23:59:59Z",
329
- "reason": "tar hardlink path traversal - transitive via node-gyp"
330
- },
331
- "1114526": {
332
- "until": 1777593599,
333
- "untilISO": "2026-04-30T23:59:59Z",
334
- "reason": "flatted: vulnerable to unbounded recursion DoS in parse() revive phase"
335
- },
336
- "1114680": {
337
- "until": 1777593599,
338
- "untilISO": "2026-04-30T23:59:59Z",
339
- "reason": "Race Condition in node-tar: Path Reservations via Unicode Ligature Collisions on macOS APFS"
340
- },
341
278
  "1115339": {
342
- "until": 1777593599,
343
- "untilISO": "2026-04-30T23:59:59Z",
279
+ "until": 1785460571,
280
+ "untilISO": "2026-07-31T01:16:11Z",
344
281
  "reason": "yaml is vulnerable to Stack Overflow via deeply nested YAML collections"
345
282
  },
346
- "1115357": {
347
- "until": 1777593599,
348
- "untilISO": "2026-04-30T23:59:59Z",
349
- "reason": "Prototype Pollution via parse() in NodeJS flatted"
283
+ "1115538": {
284
+ "until": 1785460571,
285
+ "untilISO": "2026-07-31T01:16:11Z",
286
+ "reason": "handlebars JavaScript Injection via ts-jest@29.4.6 - suppress until ts-jest ships with fixed handlebars"
350
287
  },
351
- "1115359": {
352
- "until": 1777593599,
353
- "untilISO": "2026-04-30T23:59:59Z",
354
- "reason": "Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser"
288
+ "1115539": {
289
+ "until": 1785460571,
290
+ "untilISO": "2026-07-31T01:16:11Z",
291
+ "reason": "handlebars JavaScript Injection via ts-jest@29.4.6 - suppress until ts-jest ships with fixed handlebars"
292
+ },
293
+ "1115540": {
294
+ "until": 1785460571,
295
+ "untilISO": "2026-07-31T01:16:11Z",
296
+ "reason": "brace-expansion DoS via minimatch@3.1.2 - suppress until minimatch can be upgraded"
355
297
  },
356
298
  "1115541": {
357
- "until": 1777618799,
358
- "untilISO": "2026-04-30T23:59:59Z",
299
+ "until": 1785460571,
300
+ "untilISO": "2026-07-31T01:16:11Z",
359
301
  "reason": "brace-expansion DoS - suppress low severity advisory"
360
302
  },
303
+ "1115544": {
304
+ "until": 1785460571,
305
+ "untilISO": "2026-07-31T01:16:11Z",
306
+ "reason": "handlebars Prototype Pollution via ts-jest@29.4.6 - suppress until ts-jest ships with fixed handlebars"
307
+ },
308
+ "1115549": {
309
+ "until": 1785460571,
310
+ "untilISO": "2026-07-31T01:16:11Z",
311
+ "reason": "picomatch POSIX Method Injection via micromatch - suppress until micromatch ships with picomatch >=2.3.2"
312
+ },
313
+ "1115551": {
314
+ "until": 1785460571,
315
+ "untilISO": "2026-07-31T01:16:11Z",
316
+ "reason": "picomatch POSIX Method Injection via tinyglobby - suppress until tinyglobby ships with picomatch >=4.0.4"
317
+ },
318
+ "1115552": {
319
+ "until": 1785460571,
320
+ "untilISO": "2026-07-31T01:16:11Z",
321
+ "reason": "picomatch ReDoS via micromatch - suppress until micromatch ships with picomatch >=2.3.2"
322
+ },
323
+ "1115554": {
324
+ "until": 1785460571,
325
+ "untilISO": "2026-07-31T01:16:11Z",
326
+ "reason": "picomatch ReDoS via tinyglobby - suppress until tinyglobby ships with picomatch >=4.0.4"
327
+ },
361
328
  "1115556": {
362
- "until": 1777618799,
363
- "untilISO": "2026-04-30T23:59:59Z",
329
+ "until": 1785460571,
330
+ "untilISO": "2026-07-31T01:16:11Z",
364
331
  "reason": "yaml stack overflow via deeply nested collections - suppress low severity advisory"
365
332
  },
333
+ "1115588": {
334
+ "until": 1785460571,
335
+ "untilISO": "2026-07-31T01:16:11Z",
336
+ "reason": "handlebars Prototype Method Access Control Gap via ts-jest@29.4.6 - suppress until ts-jest ships with fixed handlebars"
337
+ },
338
+ "1115810": {
339
+ "until": 1785460573,
340
+ "untilISO": "2026-07-31T01:16:13Z",
341
+ "reason": "lodash prototype pollution in _.unset/_.omit - suppress moderate until lodash >=4.17.24"
342
+ },
343
+ "1116957": {
344
+ "until": 1785460573,
345
+ "untilISO": "2026-07-31T01:16:13Z",
346
+ "reason": "fast-xml-parser via @aws-sdk/xml-builder - suppress moderate until AWS SDK pulls fixed xml-builder"
347
+ },
366
348
  "1117066": {
367
- "until": 1777593599,
368
- "untilISO": "2026-04-30T23:59:59Z",
349
+ "until": 1785460572,
350
+ "untilISO": "2026-07-31T01:16:12Z",
369
351
  "reason": "immutable prototype pollution - transitive via @ardatan/relay-compiler, resolved via resolution override"
352
+ },
353
+ "1117635": {
354
+ "until": 1785460573,
355
+ "untilISO": "2026-07-31T01:16:13Z",
356
+ "reason": "uuid buffer bounds via matrix-js-sdk - suppress moderate until matrix-js-sdk updates uuid"
357
+ },
358
+ "1117637": {
359
+ "until": 1785460573,
360
+ "untilISO": "2026-07-31T01:16:13Z",
361
+ "reason": "uuid buffer bounds in dev dependency tree - suppress moderate until transitive uuid >=11.1.1"
362
+ },
363
+ "1117683": {
364
+ "until": 1785460573,
365
+ "untilISO": "2026-07-31T01:16:13Z",
366
+ "reason": "ip-address XSS via socks - suppress moderate transitive advisory"
370
367
  }
371
368
  }
372
369
  }
@@ -7,12 +7,20 @@ export declare class SessionManager {
7
7
  private readonly autoRefreshTokenMinutesBeforeExpiration;
8
8
  private readonly enableCrypto;
9
9
  private readonly log;
10
+ /** Serializes session work per handle so concurrent callers (e.g. startSyncing + isReady) do not double-create sessions. */
11
+ private readonly perHandleSessionChain;
10
12
  private readonly sessions;
11
13
  constructor(sessionService: SessionService, storageModule: StorageModule, autoRefreshTokenMinutesBeforeExpiration: number, enableCrypto?: boolean);
12
14
  deleteSession(handleId: HandleId, deleteStorage?: boolean): Promise<void>;
13
15
  reset(): Promise<void>;
14
- getMatrixClient(handleId: HandleId): Promise<MatrixClientManager>;
15
- ensureValidSession(handleId: HandleId, storePassphrase?: string): Promise<string>;
16
+ getMatrixClient(handleId: HandleId, deviceIdIfNoStoredSession?: string): Promise<MatrixClientManager>;
17
+ /**
18
+ * For a given handle, concurrent calls are queued: the next call runs only after the previous
19
+ * finishes, so overlapping `getMatrixClient` / `ensureValidSession` cannot create duplicate sessions.
20
+ */
21
+ private runSessionWorkSerialized;
22
+ ensureValidSession(handleId: HandleId, storePassphrase?: string, deviceIdIfNoStoredSession?: string): Promise<string>;
23
+ private ensureValidSessionBody;
16
24
  private decodeToken;
17
25
  private isTokenExpired;
18
26
  private isTokenExpiringSoon;
@@ -4,13 +4,13 @@ import { SessionService } from '../../entities/session/sessionService';
4
4
  import { WordValidationService } from '../../entities/wordValidation/wordValidationService';
5
5
  /**
6
6
  * Input for `ProvisionHandleUseCase`.
7
- *
8
- * @interface ProvisionHandleUseCaseInput
7
+ * Optional `deviceId` defaults to a new UUID per handle; reusing an id across handles may correlate them on the backend.
9
8
  */
10
9
  interface ProvisionHandleUseCaseInput {
11
10
  id?: string;
12
11
  name: string;
13
12
  storePassphrase?: string;
13
+ deviceId?: string;
14
14
  }
15
15
  /**
16
16
  * Application business logic for provisioning a handle.
@@ -11,11 +11,13 @@ import { HandleId, OwnedHandle } from '../typings';
11
11
  * @property {string} name The name of the handle that will be publicly visible to other users.
12
12
  * @property {string} storePassphrase (Optional) The passphrase to use for the handle's storage.
13
13
  * If not provided, the local storage will not be encrypted.
14
+ * @property {string} deviceId (Optional) Device identifier for this session. If omitted, a new UUID is used per handle.
14
15
  */
15
16
  export interface ProvisionHandleInput {
16
17
  id?: string;
17
18
  name: string;
18
19
  storePassphrase?: string;
20
+ deviceId?: string;
19
21
  }
20
22
  /**
21
23
  * Properties required when updating existing handles.
@@ -82,15 +82,17 @@ export interface SecureCommsClient {
82
82
  * Can only be called after sign-in creation of a handle.
83
83
  *
84
84
  * @param {HandleId} handleId Identifier of the handle owned by this client.
85
+ * @param {string} deviceId Optional device id when establishing the session; see {@link startSyncing}.
85
86
  */
86
- startSyncing(handleId: HandleId): Promise<void>;
87
+ startSyncing(handleId: HandleId, deviceId?: string): Promise<void>;
87
88
  /**
88
89
  * Check if the client has finished the initial sync and is ready for use.
89
90
  *
90
91
  * @param {HandleId} handleId Identifier of the handle owned by this client.
92
+ * @param {string} deviceId Optional device id when establishing the session; see {@link startSyncing}.
91
93
  * @returns {boolean} True if the client is ready for use, false if not.
92
94
  */
93
- isReady(handleId: HandleId): Promise<boolean>;
95
+ isReady(handleId: HandleId, deviceId?: string): Promise<boolean>;
94
96
  /**
95
97
  * Stop syncing.
96
98
  *
@@ -139,8 +141,8 @@ export declare class DefaultSecureCommsClient implements SecureCommsClient {
139
141
  private readonly secureCommsServiceConfig;
140
142
  private readonly log;
141
143
  constructor(opts: SecureCommsClientOptions);
142
- startSyncing(id: HandleId): Promise<void>;
143
- isReady(id: HandleId): Promise<boolean>;
144
+ startSyncing(id: HandleId, deviceId?: string): Promise<void>;
145
+ isReady(id: HandleId, deviceId?: string): Promise<boolean>;
144
146
  stopSyncing(id: HandleId): Promise<void>;
145
147
  reset(): Promise<void>;
146
148
  }