@kubun/credential-types 0.16.0 → 0.17.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/index.d.ts +25 -14
- package/lib/index.js +6 -2
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export type OAuthProviderDefinition = {
|
|
2
|
-
name: string;
|
|
3
|
-
authorizationEndpoint: string;
|
|
4
|
-
tokenEndpoint: string;
|
|
5
|
-
baseScopes?: Array<string>;
|
|
6
|
-
clientID?: string;
|
|
7
|
-
clientSecret?: string;
|
|
8
|
-
};
|
|
9
1
|
export type Credential = {
|
|
10
2
|
accessToken: string;
|
|
11
3
|
refreshToken?: string;
|
|
@@ -36,10 +28,29 @@ export type CredentialProvider = {
|
|
|
36
28
|
}): Promise<void>;
|
|
37
29
|
delete(providerName: string, ownerDID: string): Promise<void>;
|
|
38
30
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Opt-in capability: point `(providerName, ownerDID)` at an entry the
|
|
33
|
+
* provider already holds, without minting anything. A `CredentialProvider`
|
|
34
|
+
* that also implements this can bind an alias to an entry created out of
|
|
35
|
+
* band (e.g. a device-to-device credential handoff).
|
|
36
|
+
*/
|
|
37
|
+
export type AliasBindingCredentialProvider = {
|
|
38
|
+
bindAlias(providerName: string, ownerDID: string, entryID: string): Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Opt-in capability: read and write a credential together with the entryID
|
|
42
|
+
* it resolves to, so a caller can target that entry directly on a
|
|
43
|
+
* subsequent write without re-resolving the alias.
|
|
44
|
+
*/
|
|
45
|
+
export type EntryPairedCredentialProvider = {
|
|
46
|
+
getCredentialRef(providerName: string, ownerDID: string): Promise<{
|
|
47
|
+
credential: Credential;
|
|
48
|
+
entryID: string;
|
|
49
|
+
} | null>;
|
|
50
|
+
setCredentialForEntry(params: {
|
|
51
|
+
providerName: string;
|
|
52
|
+
ownerDID: string;
|
|
53
|
+
entryID: string;
|
|
54
|
+
credential: Credential;
|
|
55
|
+
}): Promise<'updated' | 'absent'>;
|
|
45
56
|
};
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
// Credential-domain contracts: the
|
|
1
|
+
// Credential-domain contracts: the credential bundle and the provider port
|
|
2
2
|
// that stores/refreshes it. Kept in this leaf package so both the low-level
|
|
3
3
|
// `@kubun/connector` (which consumes the port) and `@kubun/credential` (which
|
|
4
4
|
// implements it) can depend on the types without depending on each other.
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Opt-in capability: read and write a credential together with the entryID
|
|
7
|
+
* it resolves to, so a caller can target that entry directly on a
|
|
8
|
+
* subsequent write without re-resolving the alias.
|
|
9
|
+
*/ export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/credential-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|
|
22
22
|
"build:clean": "del lib",
|
|
23
|
-
"build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
24
|
-
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
|
|
23
|
+
"build:js": "del 'lib/**/*.js' && swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
24
|
+
"build:types": "del 'lib/**/*.d.ts' 'lib/**/*.d.ts.map' && tsc --emitDeclarationOnly --skipLibCheck",
|
|
25
25
|
"build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
|
|
26
26
|
"test": "pnpm run test:types && pnpm run test:unit",
|
|
27
27
|
"test:types": "tsc --noEmit -p tsconfig.test.json",
|