@kubun/credential 0.14.2 → 0.14.3

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
@@ -37,6 +37,15 @@ export type CredentialAPI = {
37
37
  credential: string;
38
38
  }) => Promise<void>;
39
39
  deleteCredential: (providerName: string, ownerDID: string) => Promise<void>;
40
+ /**
41
+ * The normalized owner DIDs that currently hold a credential for `providerName`.
42
+ *
43
+ * A credential is pointed at by an alias keyed `(providerName, normalizeDID(
44
+ * ownerDID))`, so the alias keys under a provider namespace are exactly its
45
+ * authenticated owners — already normalized, so a caller can key sync state or
46
+ * a schedule on them directly. Empty when no owner holds one.
47
+ */
48
+ listSubjects: (providerName: string) => Promise<Array<string>>;
40
49
  /**
41
50
  * The controller resolvers for this API's (request-scoped) transaction
42
51
  * provider — the exact `methods` the credential mint passes to `createKey`.
package/lib/api.js CHANGED
@@ -6,6 +6,9 @@ export function createCredentialAPI(params) {
6
6
  const getAliasStore = ()=>getCredentialStore(params.stores);
7
7
  const getCredentials = ()=>params.getCredentialManager(params.stores);
8
8
  return {
9
+ async listSubjects (providerName) {
10
+ return (await getAliasStore()).listAliasKeys(providerName);
11
+ },
9
12
  async getCredential (providerName, ownerDID) {
10
13
  const store = await getAliasStore();
11
14
  const entryID = await store.getAliasEntryID(providerName, normalizeDID(ownerDID));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubun/credential",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "keywords": [],
5
5
  "license": "see LICENSE.md",
6
6
  "sideEffects": false,
@@ -22,7 +22,7 @@
22
22
  "@kubun/hlc": "^0.14.0",
23
23
  "@kubun/id": "^0.14.0",
24
24
  "@kubun/logger": "^0.14.0",
25
- "@kubun/store-credential": "^0.14.0",
25
+ "@kubun/store-credential": "^0.14.1",
26
26
  "@noble/ciphers": "^2.4.0",
27
27
  "@noble/hashes": "^2.4.0",
28
28
  "@sozai/codec": "^0.4.0",