@kubun/service-credential-api 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/adapter.d.ts +2 -2
- package/lib/adapter.js +9 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.js +26 -0
- package/package.json +5 -5
package/lib/adapter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Client } from '@enkaku/client';
|
|
2
|
-
import type { CredentialProvider } from '@kubun/credential-types';
|
|
2
|
+
import type { AliasBindingCredentialProvider, CredentialProvider } from '@kubun/credential-types';
|
|
3
3
|
import type { CredentialServiceProtocol } from './index.js';
|
|
4
4
|
export type CredentialProviderWithProvenance = CredentialProvider & {
|
|
5
5
|
getCredentialProvenance(providerName: string, ownerDID: string): Promise<{
|
|
@@ -7,4 +7,4 @@ export type CredentialProviderWithProvenance = CredentialProvider & {
|
|
|
7
7
|
writerDID: string | null;
|
|
8
8
|
} | null>;
|
|
9
9
|
};
|
|
10
|
-
export declare function toCredentialProvider(client: Client<CredentialServiceProtocol>): CredentialProviderWithProvenance;
|
|
10
|
+
export declare function toCredentialProvider(client: Client<CredentialServiceProtocol>): CredentialProviderWithProvenance & AliasBindingCredentialProvider;
|
package/lib/adapter.js
CHANGED
|
@@ -54,6 +54,15 @@ export function toCredentialProvider(client) {
|
|
|
54
54
|
ownerDID
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
+
},
|
|
58
|
+
async bindAlias (providerName, ownerDID, entryID) {
|
|
59
|
+
await client.request('credential/bind-alias', {
|
|
60
|
+
param: {
|
|
61
|
+
providerName,
|
|
62
|
+
ownerDID,
|
|
63
|
+
entryID
|
|
64
|
+
}
|
|
65
|
+
});
|
|
57
66
|
}
|
|
58
67
|
};
|
|
59
68
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -133,5 +133,27 @@ export declare const credentialServiceProtocol: {
|
|
|
133
133
|
readonly type: "null";
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
|
+
readonly 'credential/bind-alias': {
|
|
137
|
+
readonly type: "request";
|
|
138
|
+
readonly param: {
|
|
139
|
+
readonly type: "object";
|
|
140
|
+
readonly properties: {
|
|
141
|
+
readonly providerName: {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
};
|
|
144
|
+
readonly ownerDID: {
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
};
|
|
147
|
+
readonly entryID: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
readonly required: readonly ["providerName", "ownerDID", "entryID"];
|
|
152
|
+
readonly additionalProperties: false;
|
|
153
|
+
};
|
|
154
|
+
readonly result: {
|
|
155
|
+
readonly type: "null";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
136
158
|
};
|
|
137
159
|
export type CredentialServiceProtocol = typeof credentialServiceProtocol;
|
package/lib/index.js
CHANGED
|
@@ -178,5 +178,31 @@ export const credentialServiceProtocol = {
|
|
|
178
178
|
result: {
|
|
179
179
|
type: 'null'
|
|
180
180
|
}
|
|
181
|
+
},
|
|
182
|
+
'credential/bind-alias': {
|
|
183
|
+
type: 'request',
|
|
184
|
+
param: {
|
|
185
|
+
type: 'object',
|
|
186
|
+
properties: {
|
|
187
|
+
providerName: {
|
|
188
|
+
type: 'string'
|
|
189
|
+
},
|
|
190
|
+
ownerDID: {
|
|
191
|
+
type: 'string'
|
|
192
|
+
},
|
|
193
|
+
entryID: {
|
|
194
|
+
type: 'string'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
required: [
|
|
198
|
+
'providerName',
|
|
199
|
+
'ownerDID',
|
|
200
|
+
'entryID'
|
|
201
|
+
],
|
|
202
|
+
additionalProperties: false
|
|
203
|
+
},
|
|
204
|
+
result: {
|
|
205
|
+
type: 'null'
|
|
206
|
+
}
|
|
181
207
|
}
|
|
182
208
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/service-credential-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@enkaku/client": "^0.21.2",
|
|
19
19
|
"@enkaku/protocol": "^0.21.1",
|
|
20
|
-
"@kubun/credential": "^0.
|
|
21
|
-
"@kubun/credential-types": "^0.
|
|
20
|
+
"@kubun/credential": "^0.17.1",
|
|
21
|
+
"@kubun/credential-types": "^0.17.1"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|
|
28
28
|
"build:clean": "del lib",
|
|
29
|
-
"build:js": "swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
30
|
-
"build:types": "tsc --emitDeclarationOnly --skipLibCheck",
|
|
29
|
+
"build:js": "del 'lib/**/*.js' && swc src -d ./lib --config-file ../../node_modules/@kigu/dev/swc.json --strip-leading-paths",
|
|
30
|
+
"build:types": "del 'lib/**/*.d.ts' 'lib/**/*.d.ts.map' && tsc --emitDeclarationOnly --skipLibCheck",
|
|
31
31
|
"build:types:ci": "tsc --emitDeclarationOnly --declarationMap false",
|
|
32
32
|
"test": "pnpm run test:types",
|
|
33
33
|
"test:types": "tsc --noEmit --skipLibCheck"
|