Skip to content

Commit e474e7a

Browse files
vveerrggclaude
andcommitted
feat: add profileScope field to vault docs and API keys
Adds a `profileScope` property (null = all profiles, number[] = specific profile indices) to both vault-store and api-key-store data models. Existing items default to null. The field is preserved through save/update cycles and ready for UI filtering when per-profile scoping is implemented. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 560aaf3 commit e474e7a

6 files changed

Lines changed: 31 additions & 24 deletions

File tree

distros/chrome/api-keys/api-keys.build.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/chrome/vault/vault.build.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/safari/api-keys/api-keys.build.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distros/safari/vault/vault.build.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utilities/api-key-store.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
* Storage schema in browser.storage.local:
55
* apiKeyVault: {
66
* keys: {
7-
* "<uuid>": { id, label, secret, createdAt, updatedAt }
7+
* "<uuid>": { id, label, secret, createdAt, updatedAt, profileScope }
88
* },
99
* syncEnabled: true,
1010
* eventId: null,
1111
* relayCreatedAt: null,
1212
* syncStatus: "synced" // synced | local-only | conflict
1313
* }
14+
*
15+
* profileScope: null (all profiles) | number[] (specific profile indices)
1416
*/
1517

1618
import { api } from './browser-polyfill';
@@ -70,6 +72,7 @@ export async function saveApiKey(id, label, secret) {
7072
secret,
7173
createdAt: existing?.createdAt || now,
7274
updatedAt: now,
75+
profileScope: existing?.profileScope ?? null,
7376
};
7477
await setStore(store);
7578
return store.keys[id];

src/utilities/vault-store.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
* Storage schema in browser.storage.local:
55
* vaultDocs: {
66
* "path/to/file.md": {
7-
* path, content, updatedAt, syncStatus, eventId, relayCreatedAt
7+
* path, content, updatedAt, syncStatus, eventId, relayCreatedAt,
8+
* profileScope
89
* }
910
* }
1011
*
1112
* syncStatus: "synced" | "local-only" | "conflict"
13+
* profileScope: null (all profiles) | number[] (specific profile indices)
1214
*/
1315

1416
import { api } from './browser-polyfill';
@@ -50,13 +52,15 @@ export async function getDocument(path) {
5052
*/
5153
export async function saveDocumentLocal(path, content, syncStatus, eventId = null, relayCreatedAt = null) {
5254
const docs = await getDocs();
55+
const existing = docs[path];
5356
docs[path] = {
5457
path,
5558
content,
5659
updatedAt: Math.floor(Date.now() / 1000),
5760
syncStatus,
5861
eventId,
5962
relayCreatedAt,
63+
profileScope: existing?.profileScope ?? null,
6064
};
6165
await setDocs(docs);
6266
return docs[path];

0 commit comments

Comments
 (0)