@ai-matrx/vault 0.1.21 → 0.1.22

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/dist/index.d.cts CHANGED
@@ -39,6 +39,14 @@ interface VaultOwner {
39
39
  kind: "me" | "organization" | "shared";
40
40
  label: string;
41
41
  organizationId: string | null;
42
+ /**
43
+ * An organization's list also holds a member's OWN credential they shared into it: it is
44
+ * attributed to the organization it came through (kind "organization"), never to the viewer,
45
+ * and this says so. Absent on everything else.
46
+ */
47
+ memberShared?: {
48
+ userId: string | null;
49
+ };
42
50
  }
43
51
  interface VaultItemCapabilities {
44
52
  canUse: boolean;
@@ -1159,6 +1167,11 @@ interface SaveResult {
1159
1167
  interface VaultSnapshot {
1160
1168
  /** Parts that could not be read this time (an organization, shared items, one-time codes). */
1161
1169
  unavailable: readonly string[];
1170
+ /**
1171
+ * Parts still being read (organization names, "Shared with me"): set only on a partial snapshot
1172
+ * handed to `load`'s `onProgress`; the snapshot `load` resolves with never has it.
1173
+ */
1174
+ pending?: readonly string[];
1162
1175
  items: readonly VaultItem[];
1163
1176
  /** Items in the trash (deleted, still recoverable). Never mixed into `items`. */
1164
1177
  deleted: readonly VaultItem[];
@@ -1172,7 +1185,11 @@ interface VaultSnapshot {
1172
1185
  * `sharing`, …) in its own folder.
1173
1186
  */
1174
1187
  interface VaultPort {
1175
- load(): Promise<VaultSnapshot>;
1188
+ /**
1189
+ * The whole vault. `onProgress` (optional) is called with partial snapshots as parts arrive: the
1190
+ * person's own items first, then each organization's list the moment it answers.
1191
+ */
1192
+ load(onProgress?: (partial: VaultSnapshot) => void): Promise<VaultSnapshot>;
1176
1193
  /** The one path to a plaintext value. Audited by the server; handling `sealed` always refuses. */
1177
1194
  reveal(item: VaultItem, fieldKey: string): Promise<string>;
1178
1195
  /** `organizationId` null = the person's own vault. */
@@ -1427,4 +1444,23 @@ declare function GenerateButton({ onUse, label, limits, disabled }: {
1427
1444
  disabled?: boolean;
1428
1445
  }): react.JSX.Element | null;
1429
1446
 
1430
- export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };
1447
+ /**
1448
+ * THE row menu's entries, one source for every menu that offers them: the row's own More button and
1449
+ * right-click menu, and a host's own right-click menu (the website's v3 menu, which wraps the vault
1450
+ * and so cannot render the package's hooks). Each list row registers a reader of its CURRENT entries
1451
+ * on its element; `rowMenuEntriesAt(target)` reads them for whatever a right-click landed on.
1452
+ */
1453
+ type RowMenuEntryKind = "copy" | "favorite" | "open" | "copy-name" | "host";
1454
+ interface RowMenuEntry {
1455
+ label: string;
1456
+ onSelect: () => void;
1457
+ /** What the entry is, so a host can take only some (the website keeps its own Open and Copy name). */
1458
+ kind?: RowMenuEntryKind;
1459
+ /** Stable key for the entry ("copy:password", "favorite"). */
1460
+ id?: string;
1461
+ disabled?: boolean;
1462
+ }
1463
+ /** The entries of the row a right-click landed on (`[data-item]`), else none. */
1464
+ declare function rowMenuEntriesAt(target: Element | null | undefined): readonly RowMenuEntry[];
1465
+
1466
+ export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type RowMenuEntry, type RowMenuEntryKind, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };
package/dist/index.d.ts CHANGED
@@ -39,6 +39,14 @@ interface VaultOwner {
39
39
  kind: "me" | "organization" | "shared";
40
40
  label: string;
41
41
  organizationId: string | null;
42
+ /**
43
+ * An organization's list also holds a member's OWN credential they shared into it: it is
44
+ * attributed to the organization it came through (kind "organization"), never to the viewer,
45
+ * and this says so. Absent on everything else.
46
+ */
47
+ memberShared?: {
48
+ userId: string | null;
49
+ };
42
50
  }
43
51
  interface VaultItemCapabilities {
44
52
  canUse: boolean;
@@ -1159,6 +1167,11 @@ interface SaveResult {
1159
1167
  interface VaultSnapshot {
1160
1168
  /** Parts that could not be read this time (an organization, shared items, one-time codes). */
1161
1169
  unavailable: readonly string[];
1170
+ /**
1171
+ * Parts still being read (organization names, "Shared with me"): set only on a partial snapshot
1172
+ * handed to `load`'s `onProgress`; the snapshot `load` resolves with never has it.
1173
+ */
1174
+ pending?: readonly string[];
1162
1175
  items: readonly VaultItem[];
1163
1176
  /** Items in the trash (deleted, still recoverable). Never mixed into `items`. */
1164
1177
  deleted: readonly VaultItem[];
@@ -1172,7 +1185,11 @@ interface VaultSnapshot {
1172
1185
  * `sharing`, …) in its own folder.
1173
1186
  */
1174
1187
  interface VaultPort {
1175
- load(): Promise<VaultSnapshot>;
1188
+ /**
1189
+ * The whole vault. `onProgress` (optional) is called with partial snapshots as parts arrive: the
1190
+ * person's own items first, then each organization's list the moment it answers.
1191
+ */
1192
+ load(onProgress?: (partial: VaultSnapshot) => void): Promise<VaultSnapshot>;
1176
1193
  /** The one path to a plaintext value. Audited by the server; handling `sealed` always refuses. */
1177
1194
  reveal(item: VaultItem, fieldKey: string): Promise<string>;
1178
1195
  /** `organizationId` null = the person's own vault. */
@@ -1427,4 +1444,23 @@ declare function GenerateButton({ onUse, label, limits, disabled }: {
1427
1444
  disabled?: boolean;
1428
1445
  }): react.JSX.Element | null;
1429
1446
 
1430
- export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };
1447
+ /**
1448
+ * THE row menu's entries, one source for every menu that offers them: the row's own More button and
1449
+ * right-click menu, and a host's own right-click menu (the website's v3 menu, which wraps the vault
1450
+ * and so cannot render the package's hooks). Each list row registers a reader of its CURRENT entries
1451
+ * on its element; `rowMenuEntriesAt(target)` reads them for whatever a right-click landed on.
1452
+ */
1453
+ type RowMenuEntryKind = "copy" | "favorite" | "open" | "copy-name" | "host";
1454
+ interface RowMenuEntry {
1455
+ label: string;
1456
+ onSelect: () => void;
1457
+ /** What the entry is, so a host can take only some (the website keeps its own Open and Copy name). */
1458
+ kind?: RowMenuEntryKind;
1459
+ /** Stable key for the entry ("copy:password", "favorite"). */
1460
+ id?: string;
1461
+ disabled?: boolean;
1462
+ }
1463
+ /** The entries of the row a right-click landed on (`[data-item]`), else none. */
1464
+ declare function rowMenuEntriesAt(target: Element | null | undefined): readonly RowMenuEntry[];
1465
+
1466
+ export { type ApiVaultPortOptions, CATEGORIES, CONFIRM_RETURN_KEY, type CategoryId, type Confirmed, type CopyOptions, DEFAULT_LOCATION, type DefinitionField, type FieldHandling, type FieldKind, GenerateButton, HIDDEN_ITEM_TAG, type IdentityAccount, IdentityGate, type IdentityMethod, type ItemDraft, LOCKED_MESSAGE, type NoticeKind, type Notify, type ReturnStore, type RowMenuEntry, type RowMenuEntryKind, type SaveResult, type SupabaseAuthLike, type SupabaseIdentityOptions, type TotpReading, type UriMatchMode, type UrlGuess, type VaultAgentScope, VaultApp, type VaultAppProps, type VaultAttachment, type VaultAuthenticator, type VaultClipboard, type VaultCustomField, type VaultDefinition, type VaultField, type VaultHostCapabilities, type VaultIdentity, type VaultInventory, type VaultItem, type VaultItemCapabilities, type VaultKnobs, type VaultLayout, type VaultLocation, type VaultLock, VaultLockedError, type VaultOrganizationRef, type VaultOwner, type VaultPort, type VaultSelection, type VaultSnapshot, type VaultSort, type VaultUserStateDoor, categoryOf, copyValue, createApiVaultPort, createSupabaseIdentity, createVaultKnobs, guardPort, inferFromUrl, isHiddenItem, itemIdAt, locationFromParams, locationToParams, loginSiteOf, matchesQuery, needsRecentSignIn, parseDefinitions, providerOf, rowMenuEntriesAt, siteDomainOf, sortItems, useConfirmed, vaultInventoryScope, vaultItemFacts, wasCancelled };