@dotrino/identity 0.136.0 → 0.136.2

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 (53) hide show
  1. package/package.json +3 -2
  2. package/src/index.d.ts +60 -2
  3. package/src/index.js +364 -81
  4. package/src/node.js +29 -5
  5. package/types/acta.d.ts +397 -175
  6. package/types/assertion.d.ts +25 -18
  7. package/types/avatar.d.ts +14 -3
  8. package/types/capabilities.d.ts +110 -61
  9. package/types/content.d.ts +88 -45
  10. package/types/core.d.ts +578 -383
  11. package/types/keyid.d.ts +10 -3
  12. package/types/machine.d.ts +5 -1
  13. package/types/peerStore.d.ts +80 -0
  14. package/types/peerSync.d.ts +20 -6
  15. package/types/remote.d.ts +170 -42
  16. package/types/session.d.ts +74 -81
  17. package/types/sessionFlow.d.ts +108 -33
  18. package/types/vaultSeal.d.ts +21 -9
  19. package/vault/acta.js +245 -29
  20. package/vault/assertion.js +13 -4
  21. package/vault/avatar.js +12 -1
  22. package/vault/capabilities.js +56 -6
  23. package/vault/channel.js +18 -2
  24. package/vault/content.js +60 -6
  25. package/vault/core.js +419 -88
  26. package/vault/externalKeys.js +34 -2
  27. package/vault/facade.js +182 -24
  28. package/vault/globals.d.ts +60 -0
  29. package/vault/keyid.js +10 -1
  30. package/vault/machine.js +7 -1
  31. package/vault/nativeStore.js +21 -4
  32. package/vault/originPolicy.js +13 -2
  33. package/vault/peerStore.js +57 -10
  34. package/vault/peerSync.js +23 -4
  35. package/vault/remote.js +132 -32
  36. package/vault/session.js +24 -7
  37. package/vault/sessionFlow.js +43 -9
  38. package/vault/sync.js +59 -15
  39. package/vault/vault.js +78 -49
  40. package/vault/vaultSeal.js +18 -7
  41. package/vault/vendor/compat/VERSION.txt +1 -1
  42. package/vault/vendor/compat/advisory.js +58 -8
  43. package/vault/vendor/compat/index.js +57 -6
  44. package/vault/vendor/compat/ranges.js +12 -2
  45. package/vault/vendor/proxy-client/VERSION.txt +1 -1
  46. package/vault/vendor/proxy-client/client.js +41 -19
  47. package/vault/vendor/roadmap/manifests.js +23 -23
  48. package/vault/vendor/store/VERSION.txt +1 -1
  49. package/vault/vendor/vault/VERSION.txt +1 -1
  50. package/vault/vendor/vault/core/libVersion.js +1 -1
  51. package/vault/vendor/vault/core/transport.js +15 -3
  52. package/vault/vendor/vault/core/vault.js +71 -1
  53. package/vault/vendor/vault/protocol.js +25 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/identity",
3
- "version": "0.136.0",
3
+ "version": "0.136.2",
4
4
  "description": "Identidad y rating de usuarios compartidos entre apps de Dotrino (vault iframe + postMessage)",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -39,6 +39,7 @@
39
39
  "import": "./vault/acta.js"
40
40
  },
41
41
  "./content": {
42
+ "types": "./types/content.d.ts",
42
43
  "import": "./vault/content.js"
43
44
  },
44
45
  "./channel": {
@@ -71,7 +72,7 @@
71
72
  "scripts": {
72
73
  "vendor": "node vendor.mjs",
73
74
  "test": "node --test \"test/*.test.js\" \"test/*.test.mjs\"",
74
- "type-check": "tsc --noEmit",
75
+ "type-check": "tsc --noEmit && tsc --noEmit -p tsconfig.shadowed.json",
75
76
  "types": "tsc -p tsconfig.types.json"
76
77
  },
77
78
  "keywords": [
package/src/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export interface IdentityOptions {
2
2
  vaultUrl?: string
3
3
  timeoutMs?: number
4
+ /** `false`: no pedir aquí la contraseña de un perfil protegido (la app la pide a su manera). */
5
+ promptUnlock?: boolean
4
6
  }
5
7
 
6
8
  export interface ProfileLink { id: string; type: string; value: string; visible?: boolean }
@@ -188,7 +190,6 @@ export class Identity {
188
190
  */
189
191
  enrollDevice (qr: VaultInvitation, opts?: { label?: string; join?: 'new' | 'current' | 'adopt'; account?: string | null }): Promise<{ ok: boolean; deviceId: string; master: string; exp?: number; scope?: string[]; [k: string]: any }>
190
192
  vaultStatus (): Promise<any>
191
- vaultUnpair (): Promise<any>
192
193
  vaultSign (payload: any): Promise<{ signature: string; publickey: string }>
193
194
  /**
194
195
  * El almacén de hilos EN la bóveda, cifrado de punta a punta con la clave de contenido del
@@ -264,10 +265,67 @@ export class Identity {
264
265
  selfVaultMachines (): Promise<any[]>
265
266
  selfVaultApprove (deviceId: string, code: string): Promise<any>
266
267
  selfVaultReject (deviceId: string): Promise<{ ok: true }>
267
- selfVaultRevoke (nonce: string): Promise<any>
268
+ /** Por `sub` (su llave) quita el aparato entero; un `nonce` suelto retira solo ese certificado. */
269
+ selfVaultRevoke (target: string | { sub?: string; nonce?: string }): Promise<any>
268
270
  selfVaultProbe (pubkeys: string[]): Promise<{ online: string[] }>
269
271
  onSelfVault (handler: (payload: any) => void): () => void
270
272
  on (event: 'peer_updated' | 'me_updated' | 'sync' | 'vault' | 'selfVault', handler: (payload: any) => void): () => void
273
+ /** Quitar un APARATO: sale del acta y se le retiran todos sus certificados. */
274
+ revokeDevice (sub: string): Promise<any>
275
+ /** Los miembros del acta del perfil, con su id legible. */
276
+ profileMembers (): Promise<any>
277
+ /** Qué es ESTE aparato en el acta del perfil (sus permisos). */
278
+ myMembership (): Promise<any>
279
+ /** La cadena de actas desde `sinceSeq`. */
280
+ actaHistory (opts?: { sinceSeq?: number }): Promise<any>
281
+ /** Los que estuvieron en las actas de la ventana del historial y ya no están. */
282
+ pastMembers (): Promise<any>
283
+ /** ¿Puede ESTE aparato sellar el acta del perfil? */
284
+ isMaster (): Promise<boolean>
285
+ admitMember (member: Record<string, any>): Promise<any>
286
+ /** Registra la llave de cifrado de un miembro ya admitido. */
287
+ setMemberEncPub (args: { pub: string; encPub: string }): Promise<any>
288
+ setCaps (pub: string, caps: string[]): Promise<any>
289
+ /** Los permisos de VARIOS miembros en una sola acta: `[{ pub, caps }]`. */
290
+ setCapsMany (changes: Array<{ pub: string; caps?: string[]; cn?: string | null }>): Promise<any>
291
+ setLabel (pub: string, label: string): Promise<any>
292
+ removeMember (pub: string): Promise<any>
293
+ handoverMaster (to: string, member?: Record<string, any> | null): Promise<any>
294
+ renounceCaps (caps: string[]): Promise<any>
295
+ absorbRenounce (record: any): Promise<any>
296
+ adoptActa (acta: Acta): Promise<any>
297
+ /** Une ESTE perfil a la cuenta de otro (solo si nació para eso). */
298
+ joinProfile (acta: Acta): Promise<any>
299
+ /** Marca este perfil como nacido para ADOPTAR la cuenta de otro. */
300
+ prepareForAdoption (): Promise<any>
301
+ /** Rota la clave de contenido del perfil. */
302
+ rotateContentKey (): Promise<any>
303
+ /** Abre un sobre de un cajón de secretos con la envoltura dirigida a este aparato. */
304
+ openSealedValue (args?: { wrap?: any; envelope?: any }): Promise<any>
305
+ /** Desempareja este aparato de su bóveda. */
306
+ unpairDevice (): Promise<any>
307
+ /** Administrar la bóveda (admitir, expulsar…) con el papel de este aparato. */
308
+ vaultAdmin (op: string, args?: Record<string, any> & { to?: string }): Promise<any>
309
+ /** Registrar el token de push de una app nativa. */
310
+ registerPush (args?: { token?: string; kind?: string }): Promise<any>
311
+ canAdminVault (): Promise<boolean>
312
+ /** Los inicios de sesión con contraseña que guarda la bóveda de esta pestaña. */
313
+ selfVaultLogins (): Promise<any[]>
314
+ selfVaultLoginAdd (opts?: { user?: string; password?: string; label?: string; caps?: string[] }): Promise<any>
315
+ selfVaultLoginPasswd (opts?: { user?: string; oldPassword?: string; newPassword?: string }): Promise<{ ok: boolean; user?: string }>
316
+ selfVaultBackupDrawers (): Promise<any>
317
+ selfVaultBackupExport (opts?: { drawers?: string[] | null; password?: string }): Promise<{ file: any; summary: any }>
318
+ selfVaultBackupPlan (opts?: { file?: any; password?: string; drawers?: string[] | null; map?: Record<string, string> }): Promise<any>
319
+ selfVaultBackupImport (opts?: { file?: any; password?: string; drawers?: string[] | null; map?: Record<string, string>; onConflict?: string | null; decisions?: Record<string, any> }): Promise<any>
320
+ selfVaultLoginClose (opts?: { user?: string; sid?: string | null }): Promise<any>
321
+ selfVaultLoginUnblock (user: string): Promise<any>
322
+ selfVaultLoginRemove (user: string): Promise<any>
323
+ /** Salir de una cuenta abierta con contraseña (sin `id`, la activa). */
324
+ logoutLogin (id?: string | null): Promise<any>
325
+ /** El subconjunto PÚBLICO del perfil (lo marcado visible). */
326
+ publicMe (): Promise<Partial<Me> & Record<string, any>>
327
+ /** Cómo fue el último empujón del perfil a la bóveda. */
328
+ profilePushState (): Promise<{ ok: boolean | null; at: number; error: string | null }>
271
329
  }
272
330
 
273
331
  /** Un miembro del acta: su llave pública y lo que el acta le deja hacer. */