@dotrino/identity 0.107.1 → 0.107.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotrino/identity",
3
- "version": "0.107.1",
3
+ "version": "0.107.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",
package/src/index.d.ts CHANGED
@@ -188,6 +188,18 @@ export class Identity {
188
188
  canApproveVault (): Promise<boolean>
189
189
  getVaultCert (): Promise<any>
190
190
  onVault (handler: (payload: any) => void): () => void
191
+ /** El perfil ACTIVO de este aparato (el que usan las apps; `@dotrino/store` se ata a él). */
192
+ currentProfile (): Promise<{ id: string; name?: string; pubkey?: string } | null>
193
+ /** Los perfiles de este aparato. */
194
+ listProfiles (): Promise<Array<{ id: string; name?: string; pubkey?: string; current?: boolean; avatar?: string }>>
195
+ /** Cambia el perfil activo (la app recarga: no es reactivo). */
196
+ switchProfile (id: string): Promise<any>
197
+ /** Cifra con la llave de la CUENTA: el sobre lleva la marca `t: 'dotrino-cek'` y lo abren todos los aparatos del acta. */
198
+ sealContent (plaintext: string): Promise<{ t: 'dotrino-cek'; gen: number; iv: string; ct: string }>
199
+ /** Abre un sobre de la cuenta (cualquier generación que este aparato tenga). */
200
+ openContent (envelope: { gen: number; iv: string; ct: string; t?: string }): Promise<string>
201
+ /** Mi copia de la llave de la cuenta vigente, o null si todavía no me la han envuelto. */
202
+ contentKey (): Promise<{ gen: number; cek: string } | null>
191
203
  // self-vault (este dispositivo ES el vault, daemon dentro del iframe)
192
204
  selfVaultStatus (): Promise<{ enabled: boolean; running: boolean }>
193
205
  setSelfVault (enabled: boolean): Promise<{ ok: true; enabled: boolean }>
package/src/index.js CHANGED
@@ -139,6 +139,7 @@ export class Identity {
139
139
  const err = new Error(msg.error)
140
140
  if (msg.code) err.code = msg.code
141
141
  if (msg.detail) err.detail = msg.detail
142
+ if (msg.reason) err.reason = msg.reason
142
143
  pending.reject(err)
143
144
  }
144
145
  else pending.resolve(msg.result)
package/vault/vault.js CHANGED
@@ -540,7 +540,10 @@ import { useBackend as usePeerBackend } from './peerStore.js'
540
540
  reply({
541
541
  error: e?.message || String(e),
542
542
  ...(e?.code ? { code: e.code } : {}),
543
- ...(e?.detail ? { detail: e.detail } : {})
543
+ ...(e?.detail ? { detail: e.detail } : {}),
544
+ // El MOTIVO de un rechazo de la bóveda (`expired`, `revoked`, `acta`…): sin él, «la
545
+ // bóveda te rechaza» no dice si hay que volver a enlazar o esperar.
546
+ ...(e?.reason ? { reason: e.reason } : {})
544
547
  })
545
548
  }
546
549
  })