@kubun/store-credential 0.14.0 → 0.14.1

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/lib/api.d.ts CHANGED
@@ -165,5 +165,12 @@ export type CredentialStoreAPI = {
165
165
  setAliasEntryID(namespace: string, key: string, entryID: string): Promise<void>;
166
166
  /** Clear an alias. A no-op, not an error, when none is set. */
167
167
  deleteAliasEntryID(namespace: string, key: string): Promise<void>;
168
+ /**
169
+ * The distinct keys currently set within `namespace`. Keys stay opaque here —
170
+ * a caller interprets them (e.g. connector credentials store the normalized
171
+ * owner DID as the key under a provider namespace). Empty for an unused
172
+ * namespace.
173
+ */
174
+ listAliasKeys(namespace: string): Promise<Array<string>>;
168
175
  };
169
176
  export declare function createCredentialStore(db: Kysely<CredentialTables>, adapter: Adapter): CredentialStoreAPI;
package/lib/api.js CHANGED
@@ -428,6 +428,10 @@ export function createCredentialStore(db, adapter) {
428
428
  },
429
429
  async deleteAliasEntryID (namespace, key) {
430
430
  await db.deleteFrom('kubun_credential_aliases').where('namespace', '=', namespace).where('alias_key', '=', key).execute();
431
+ },
432
+ async listAliasKeys (namespace) {
433
+ const rows = await db.selectFrom('kubun_credential_aliases').select('alias_key').distinct().where('namespace', '=', namespace).execute();
434
+ return rows.map((row)=>row.alias_key);
431
435
  }
432
436
  };
433
437
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/store-credential",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "keywords": [],
5
5
  "license": "see LICENSE.md",
6
6
  "sideEffects": false,
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@kokuin/token": "^0.5.0",
19
19
  "@kubun/db": "^0.14.0",
20
- "@kubun/db-adapter": "^0.14.0",
20
+ "@kubun/db-adapter": "^0.14.1",
21
21
  "kysely": "^0.29.5"
22
22
  },
23
23
  "devDependencies": {