@sphereon/ssi-sdk.credential-store 0.30.2-next.4 → 0.30.2-next.47
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/dist/agent/CredentialStore.d.ts +10 -10
- package/dist/agent/CredentialStore.d.ts.map +1 -1
- package/dist/agent/CredentialStore.js +20 -21
- package/dist/agent/CredentialStore.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ssi-sdk.credential-store.d.ts +8 -8
- package/dist/{types → utils}/filters.d.ts.map +1 -1
- package/dist/{types → utils}/filters.js.map +1 -1
- package/package.json +7 -6
- package/src/agent/CredentialStore.ts +28 -21
- package/src/index.ts +1 -1
- /package/dist/{types → utils}/filters.d.ts +0 -0
- /package/dist/{types → utils}/filters.js +0 -0
- /package/src/{types → utils}/filters.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IAgentPlugin } from '@veramo/core';
|
|
2
|
-
import { ICredentialStore } from '../index';
|
|
3
1
|
import { AbstractDigitalCredentialStore } from '@sphereon/ssi-sdk.data-store';
|
|
2
|
+
import { IAgentPlugin } from '@veramo/core';
|
|
3
|
+
import { ICredentialStore } from '../types/ICredentialStore';
|
|
4
4
|
export declare const credentialStoreMethods: Array<string>;
|
|
5
5
|
/**
|
|
6
6
|
* {@inheritDoc ICRManager}
|
|
@@ -12,21 +12,21 @@ export declare class CredentialStore implements IAgentPlugin {
|
|
|
12
12
|
constructor(options: {
|
|
13
13
|
store: AbstractDigitalCredentialStore;
|
|
14
14
|
});
|
|
15
|
-
/** {@inheritDoc
|
|
15
|
+
/** {@inheritDoc ICredentialStore.crsAddCredential} */
|
|
16
16
|
private crsAddCredential;
|
|
17
|
-
/** {@inheritDoc
|
|
17
|
+
/** {@inheritDoc ICredentialStore.crsUpdateCredentialState} */
|
|
18
18
|
private crsUpdateCredentialState;
|
|
19
|
-
/** {@inheritDoc
|
|
19
|
+
/** {@inheritDoc ICredentialStore.crsGetCredential} */
|
|
20
20
|
private crsGetCredential;
|
|
21
|
-
/** {@inheritDoc
|
|
21
|
+
/** {@inheritDoc ICredentialStore.crsGetCredentials} */
|
|
22
22
|
private crsGetCredentials;
|
|
23
|
-
/** {@inheritDoc
|
|
23
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentialByIdOrHash} */
|
|
24
24
|
private crsGetUniqueCredentialByIdOrHash;
|
|
25
|
-
/** {@inheritDoc
|
|
25
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentials} */
|
|
26
26
|
private crsGetUniqueCredentials;
|
|
27
|
-
/** {@inheritDoc
|
|
27
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredential} */
|
|
28
28
|
private crsDeleteCredential;
|
|
29
|
-
/** {@inheritDoc
|
|
29
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredentials} */
|
|
30
30
|
private crsDeleteCredentials;
|
|
31
31
|
/**
|
|
32
32
|
* Returns a list of UniqueDigitalCredentials that match the given filter based on the claims they contain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialStore.d.ts","sourceRoot":"","sources":["../../src/agent/CredentialStore.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CredentialStore.d.ts","sourceRoot":"","sources":["../../src/agent/CredentialStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAM/B,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAQL,gBAAgB,EAGjB,MAAM,2BAA2B,CAAA;AAIlC,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,MAAM,CAWhD,CAAA;AAED;;GAEG;AACH,qBAAa,eAAgB,YAAW,YAAY;IAClD,QAAQ,CAAC,MAAM,MAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAWjC;IAED,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;gBAE1C,OAAO,EAAE;QAAE,KAAK,EAAE,8BAA8B,CAAA;KAAE;IAI9D,sDAAsD;YACxC,gBAAgB;IAI9B,8DAA8D;YAChD,wBAAwB;IAItC,sDAAsD;YACxC,gBAAgB;IAM9B,uDAAuD;YACzC,iBAAiB;IAO/B,sEAAsE;YACxD,gCAAgC;IAW9C,6DAA6D;YAC/C,uBAAuB;IAMrC,yDAAyD;YAC3C,mBAAmB;IAIjC,0DAA0D;YAC5C,oBAAoB;IAalC;;;OAGG;YACW,yBAAyB;IA4DvC,OAAO,CAAC,sBAAsB;IA2B9B;;;OAGG;YACW,8BAA8B;IAK5C,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,mBAAmB;CAoC5B"}
|
|
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CredentialStore = exports.credentialStoreMethods = void 0;
|
|
13
|
-
const index_1 = require("../index");
|
|
14
13
|
const ssi_sdk_data_store_1 = require("@sphereon/ssi-sdk.data-store");
|
|
15
|
-
const
|
|
14
|
+
const index_1 = require("../index");
|
|
15
|
+
const filters_1 = require("../utils/filters");
|
|
16
16
|
// Exposing the methods here for any REST implementation
|
|
17
17
|
exports.credentialStoreMethods = [
|
|
18
18
|
'crsAddCredential',
|
|
@@ -46,27 +46,27 @@ class CredentialStore {
|
|
|
46
46
|
};
|
|
47
47
|
this.store = options.store;
|
|
48
48
|
}
|
|
49
|
-
/** {@inheritDoc
|
|
49
|
+
/** {@inheritDoc ICredentialStore.crsAddCredential} */
|
|
50
50
|
crsAddCredential(args) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
var _a, _b;
|
|
53
|
-
return yield this.store.addCredential(Object.assign(Object.assign({}, args.credential), { opts: Object.assign(Object.assign({}, args.opts), { hasher: (_b = (_a = args.opts) === null || _a === void 0 ? void 0 : _a.hasher) !== null && _b !== void 0 ? _b :
|
|
53
|
+
return yield this.store.addCredential(Object.assign(Object.assign({}, args.credential), { opts: Object.assign(Object.assign({}, args.opts), { hasher: (_b = (_a = args.opts) === null || _a === void 0 ? void 0 : _a.hasher) !== null && _b !== void 0 ? _b : ssi_sdk_data_store_1.defaultHasher }) }));
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
/** {@inheritDoc
|
|
56
|
+
/** {@inheritDoc ICredentialStore.crsUpdateCredentialState} */
|
|
57
57
|
crsUpdateCredentialState(args) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
return yield this.store.updateCredentialState(args);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
/** {@inheritDoc
|
|
62
|
+
/** {@inheritDoc ICredentialStore.crsGetCredential} */
|
|
63
63
|
crsGetCredential(args) {
|
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
const { id } = args;
|
|
66
|
-
return
|
|
66
|
+
return this.store.getCredential({ id });
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
/** {@inheritDoc
|
|
69
|
+
/** {@inheritDoc ICredentialStore.crsGetCredentials} */
|
|
70
70
|
crsGetCredentials(args) {
|
|
71
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
72
|
const { filter } = args;
|
|
@@ -74,10 +74,10 @@ class CredentialStore {
|
|
|
74
74
|
return credentials.data;
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
/** {@inheritDoc
|
|
77
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentialByIdOrHash} */
|
|
78
78
|
crsGetUniqueCredentialByIdOrHash(args) {
|
|
79
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
const credentials = yield this.crsGetCredentials({ filter: (0,
|
|
80
|
+
const credentials = yield this.crsGetCredentials({ filter: (0, filters_1.credentialIdOrHashFilter)(args.credentialRole, args.idOrHash) });
|
|
81
81
|
if (credentials.length === 0) {
|
|
82
82
|
return undefined;
|
|
83
83
|
}
|
|
@@ -87,20 +87,20 @@ class CredentialStore {
|
|
|
87
87
|
return this.toUniqueCredentials(credentials)[0];
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
/** {@inheritDoc
|
|
90
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentials} */
|
|
91
91
|
crsGetUniqueCredentials(args) {
|
|
92
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
93
|
const credentials = yield this.crsGetCredentials(args);
|
|
94
94
|
return this.toUniqueCredentials(credentials);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
/** {@inheritDoc
|
|
97
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredential} */
|
|
98
98
|
crsDeleteCredential(args) {
|
|
99
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
100
|
return this.store.removeCredential(args);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
/** {@inheritDoc
|
|
103
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredentials} */
|
|
104
104
|
crsDeleteCredentials(args) {
|
|
105
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
106
|
const credentials = yield this.crsGetCredentials(args);
|
|
@@ -124,19 +124,19 @@ class CredentialStore {
|
|
|
124
124
|
filter: [
|
|
125
125
|
// TODO SDK-25 Implement param for documentType & support VP filtering below
|
|
126
126
|
{
|
|
127
|
-
documentType:
|
|
127
|
+
documentType: ssi_sdk_data_store_1.DocumentType.VC,
|
|
128
128
|
credentialRole: args.credentialRole,
|
|
129
129
|
tenantId: args.tenantId,
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
|
-
documentType:
|
|
132
|
+
documentType: ssi_sdk_data_store_1.DocumentType.C,
|
|
133
133
|
credentialRole: args.credentialRole,
|
|
134
134
|
tenantId: args.tenantId,
|
|
135
135
|
},
|
|
136
136
|
],
|
|
137
137
|
});
|
|
138
138
|
// This a copy of how Veramo did this. TODO Use GraphQL in the future?
|
|
139
|
-
|
|
139
|
+
return digitalCredentials.filter((uniqueVC) => {
|
|
140
140
|
var _a, _b;
|
|
141
141
|
if (!uniqueVC.uniformVerifiableCredential) {
|
|
142
142
|
return false;
|
|
@@ -173,7 +173,6 @@ class CredentialStore {
|
|
|
173
173
|
}
|
|
174
174
|
})) !== null && _b !== void 0 ? _b : true);
|
|
175
175
|
});
|
|
176
|
-
return claimFilteredCredentials;
|
|
177
176
|
});
|
|
178
177
|
}
|
|
179
178
|
getValueFromCredential(credential, column) {
|
|
@@ -224,21 +223,21 @@ class CredentialStore {
|
|
|
224
223
|
digitalCredential: credential,
|
|
225
224
|
};
|
|
226
225
|
switch (credential.documentType) {
|
|
227
|
-
case
|
|
226
|
+
case ssi_sdk_data_store_1.DocumentType.VC:
|
|
228
227
|
uniqueCredential.originalVerifiableCredential = this.secureParse(credential.rawDocument);
|
|
229
228
|
uniqueCredential.uniformVerifiableCredential = this.secureParse(credential.uniformDocument);
|
|
230
229
|
uniqueCredential.id = (_a = uniqueCredential.uniformVerifiableCredential) === null || _a === void 0 ? void 0 : _a.id;
|
|
231
230
|
break;
|
|
232
|
-
case
|
|
231
|
+
case ssi_sdk_data_store_1.DocumentType.VP:
|
|
233
232
|
uniqueCredential.originalVerifiablePresentation = this.secureParse(credential.rawDocument);
|
|
234
233
|
uniqueCredential.uniformVerifiablePresentation = this.secureParse(credential.uniformDocument);
|
|
235
234
|
uniqueCredential.id = (_b = uniqueCredential.uniformVerifiablePresentation) === null || _b === void 0 ? void 0 : _b.id;
|
|
236
235
|
break;
|
|
237
|
-
case
|
|
236
|
+
case ssi_sdk_data_store_1.DocumentType.P:
|
|
238
237
|
uniqueCredential.originalPresentation = this.secureParse(credential.rawDocument);
|
|
239
238
|
uniqueCredential.id = (_c = uniqueCredential.originalPresentation) === null || _c === void 0 ? void 0 : _c.id;
|
|
240
239
|
break;
|
|
241
|
-
case
|
|
240
|
+
case ssi_sdk_data_store_1.DocumentType.C:
|
|
242
241
|
uniqueCredential.originalCredential = this.secureParse(credential.rawDocument);
|
|
243
242
|
uniqueCredential.id = (_d = uniqueCredential.originalCredential) === null || _d === void 0 ? void 0 : _d.id;
|
|
244
243
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialStore.js","sourceRoot":"","sources":["../../src/agent/CredentialStore.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CredentialStore.js","sourceRoot":"","sources":["../../src/agent/CredentialStore.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qEAOqC;AAGrC,oCAAyC;AACzC,8CAA2D;AAe3D,wDAAwD;AAC3C,QAAA,sBAAsB,GAAkB;IACnD,kBAAkB;IAClB,0BAA0B;IAC1B,kBAAkB;IAClB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,yBAAyB;IACzB,kCAAkC;IAClC,2BAA2B;IAC3B,gCAAgC;CACjC,CAAA;AAED;;GAEG;AACH,MAAa,eAAe;IAiB1B,YAAY,OAAkD;QAhBrD,WAAM,GAAG,cAAM,CAAC,gBAAgB,CAAA;QAChC,YAAO,GAAqB;YACnC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YAClD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC;YAClE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;YAClD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;YACpD,gCAAgC,EAAE,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC;YAClF,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;YAChE,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;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A,gBAAgB,CAAC,oBAAoB,0CAAE,EAAE,CAAA;oBAC/D,MAAK;gBACP,KAAK,iCAAY,CAAC,CAAC;oBACjB,gBAAgB,CAAC,kBAAkB,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;oBAC9E,gBAAgB,CAAC,EAAE,GAAG,MAAA,gBAAgB,CAAC,kBAAkB,0CAAE,EAAE,CAAA;oBAC7D,MAAK;gBACP,oBAAoB;YACtB,CAAC;YACD,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAA;YAC/C,OAAO,WAAW,CAAA;QACpB,CAAC,EACD,EAA6C,CAC9C,CACF,CAAA;IACH,CAAC;CACF;AAhOD,0CAgOC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { CredentialStore, credentialStoreMethods } from './agent/CredentialStore
|
|
|
8
8
|
export { CredentialRole, CredentialStateType, CredentialCorrelationType, CredentialDocumentFormat, DocumentType, DigitalCredential, FindDigitalCredentialArgs, } from '@sphereon/ssi-sdk.data-store';
|
|
9
9
|
export * from './types/ICredentialStore';
|
|
10
10
|
export * from './types/claims';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './utils/filters';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -33,5 +33,5 @@ Object.defineProperty(exports, "CredentialDocumentFormat", { enumerable: true, g
|
|
|
33
33
|
Object.defineProperty(exports, "DocumentType", { enumerable: true, get: function () { return ssi_sdk_data_store_1.DocumentType; } });
|
|
34
34
|
__exportStar(require("./types/ICredentialStore"), exports);
|
|
35
35
|
__exportStar(require("./types/claims"), exports);
|
|
36
|
-
__exportStar(require("./
|
|
36
|
+
__exportStar(require("./utils/filters"), exports);
|
|
37
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -64,21 +64,21 @@ export declare class CredentialStore implements IAgentPlugin {
|
|
|
64
64
|
constructor(options: {
|
|
65
65
|
store: AbstractDigitalCredentialStore;
|
|
66
66
|
});
|
|
67
|
-
/** {@inheritDoc
|
|
67
|
+
/** {@inheritDoc ICredentialStore.crsAddCredential} */
|
|
68
68
|
private crsAddCredential;
|
|
69
|
-
/** {@inheritDoc
|
|
69
|
+
/** {@inheritDoc ICredentialStore.crsUpdateCredentialState} */
|
|
70
70
|
private crsUpdateCredentialState;
|
|
71
|
-
/** {@inheritDoc
|
|
71
|
+
/** {@inheritDoc ICredentialStore.crsGetCredential} */
|
|
72
72
|
private crsGetCredential;
|
|
73
|
-
/** {@inheritDoc
|
|
73
|
+
/** {@inheritDoc ICredentialStore.crsGetCredentials} */
|
|
74
74
|
private crsGetCredentials;
|
|
75
|
-
/** {@inheritDoc
|
|
75
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentialByIdOrHash} */
|
|
76
76
|
private crsGetUniqueCredentialByIdOrHash;
|
|
77
|
-
/** {@inheritDoc
|
|
77
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentials} */
|
|
78
78
|
private crsGetUniqueCredentials;
|
|
79
|
-
/** {@inheritDoc
|
|
79
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredential} */
|
|
80
80
|
private crsDeleteCredential;
|
|
81
|
-
/** {@inheritDoc
|
|
81
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredentials} */
|
|
82
82
|
private crsDeleteCredentials;
|
|
83
83
|
/**
|
|
84
84
|
* Returns a list of UniqueDigitalCredentials that match the given filter based on the claims they contain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/utils/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmC,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAGzH;;;;;;GAMG;AAEH,eAAO,MAAM,wBAAwB,mBAAoB,cAAc,YAAY,MAAM,8BAoBxF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,mBAC5B,cAAc,eACjB,yBAAyB,8BAYvC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,uGAsBvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../src/utils/filters.ts"],"names":[],"mappings":";;;AAAA,qEAAyH;AACzH,+BAA+C;AAE/C;;;;;;GAMG;AAEI,MAAM,wBAAwB,GAAG,CAAC,cAA8B,EAAE,QAAgB,EAA6B,EAAE;IACtH,MAAM,MAAM,GAA8B;QACxC;YACE,IAAI,EAAE,QAAQ;YACd,cAAc;SACf;QACD;YACE,YAAY,EAAE,QAAQ;YACtB,cAAc;SACf;KACF,CAAA;IAED,IAAI,IAAA,eAAY,EAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC;YACV,EAAE,EAAE,QAAQ;YACZ,cAAc;SACf,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AApBY,QAAA,wBAAwB,4BAoBpC;AAED;;;;;;GAMG;AACI,MAAM,iCAAiC,GAAG,CAC/C,cAA8B,EAC9B,UAAsC,EACX,EAAE;IAC7B,MAAM,MAAM,GAAG;QACb;YACE,YAAY,EAAE,iCAAY,CAAC,EAAE;YAC7B,cAAc,EAAE,cAAc;SAC/B;KACF,CAAA;IACD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,IAAA,mBAAW,EAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IACxC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAdY,QAAA,iCAAiC,qCAc7C;AAED;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,WAAW,GAAG,CAAC,OAAkC,EAAE,OAAkC,EAA6B,EAAE;IAC/H,MAAM,YAAY,GAA8B,EAAE,CAAA;IAElD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsC,CAAA;IAE/D,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC7B,SAAS,CAAC,GAAG,CAAC,KAAK,oBAAO,GAAG,EAAG,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC7B,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,SAAS,CAAC,GAAG,CAAC,KAAK,kCAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,GAAK,GAAG,EAAG,CAAA;QAC3D,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,GAAG,CAAC,KAAK,oBAAO,GAAG,EAAG,CAAA;QAClC,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AAtBY,QAAA,WAAW,eAsBvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.credential-store",
|
|
3
|
-
"version": "0.30.2-next.
|
|
3
|
+
"version": "0.30.2-next.47+df3f6ea1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"generate-plugin-schema": "ts-node ../../packages/dev/bin/sphereon.js dev generate-plugin-schema"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sphereon/pex": "5.0.0-unstable.
|
|
18
|
+
"@sphereon/pex": "5.0.0-unstable.18",
|
|
19
19
|
"@sphereon/pex-models": "^2.3.1",
|
|
20
|
-
"@sphereon/ssi-sdk.data-store": "0.30.2-next.
|
|
20
|
+
"@sphereon/ssi-sdk.data-store": "0.30.2-next.47+df3f6ea1",
|
|
21
21
|
"cross-fetch": "^3.1.8",
|
|
22
22
|
"debug": "^4.3.4",
|
|
23
23
|
"typeorm": "^0.3.20",
|
|
24
24
|
"uuid": "^9.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@sphereon/ssi-sdk.agent-config": "0.30.2-next.
|
|
28
|
-
"@sphereon/ssi-types": "0.30.2-next.
|
|
27
|
+
"@sphereon/ssi-sdk.agent-config": "0.30.2-next.47+df3f6ea1",
|
|
28
|
+
"@sphereon/ssi-types": "0.30.2-next.47+df3f6ea1",
|
|
29
29
|
"@types/uuid": "^9.0.8",
|
|
30
30
|
"@veramo/remote-client": "4.2.0",
|
|
31
31
|
"@veramo/remote-server": "4.2.0"
|
|
@@ -50,5 +50,6 @@
|
|
|
50
50
|
"Veramo",
|
|
51
51
|
"Credential Manager"
|
|
52
52
|
],
|
|
53
|
-
"
|
|
53
|
+
"nx": {},
|
|
54
|
+
"gitHead": "df3f6ea12e55e92781044f29288e95870a38ef06"
|
|
54
55
|
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AbstractDigitalCredentialStore,
|
|
3
|
+
DigitalCredential,
|
|
4
|
+
UpdateCredentialStateArgs,
|
|
5
|
+
DocumentType,
|
|
6
|
+
parseRawDocument,
|
|
7
|
+
defaultHasher
|
|
8
|
+
} from '@sphereon/ssi-sdk.data-store'
|
|
9
|
+
import { IVerifiableCredential } from '@sphereon/ssi-types'
|
|
1
10
|
import { IAgentPlugin } from '@veramo/core'
|
|
11
|
+
import { schema, logger } from '../index'
|
|
12
|
+
import { credentialIdOrHashFilter } from '../utils/filters'
|
|
2
13
|
import {
|
|
3
14
|
AddCredentialArgs,
|
|
4
|
-
credentialIdOrHashFilter,
|
|
5
15
|
DeleteCredentialArgs,
|
|
6
16
|
DeleteCredentialsArgs,
|
|
7
|
-
DocumentType,
|
|
8
17
|
GetCredentialArgs,
|
|
9
18
|
GetCredentialsArgs,
|
|
10
19
|
GetCredentialsByClaimsArgs,
|
|
11
20
|
GetCredentialsByIdOrHashArgs,
|
|
12
21
|
ICredentialStore,
|
|
13
|
-
logger,
|
|
14
22
|
OptionalUniqueDigitalCredential,
|
|
15
|
-
schema,
|
|
16
|
-
TClaimsColumns,
|
|
17
23
|
UniqueDigitalCredential,
|
|
18
|
-
} from '../
|
|
19
|
-
import {
|
|
20
|
-
import { IVerifiableCredential } from '@sphereon/ssi-types'
|
|
21
|
-
import { defaultHasher } from '@sphereon/ssi-sdk.data-store'
|
|
24
|
+
} from '../types/ICredentialStore'
|
|
25
|
+
import { TClaimsColumns} from '../types/claims'
|
|
22
26
|
|
|
23
27
|
// Exposing the methods here for any REST implementation
|
|
24
28
|
export const credentialStoreMethods: Array<string> = [
|
|
@@ -58,30 +62,32 @@ export class CredentialStore implements IAgentPlugin {
|
|
|
58
62
|
this.store = options.store
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
/** {@inheritDoc
|
|
65
|
+
/** {@inheritDoc ICredentialStore.crsAddCredential} */
|
|
62
66
|
private async crsAddCredential(args: AddCredentialArgs): Promise<DigitalCredential> {
|
|
63
67
|
return await this.store.addCredential({ ...args.credential, opts: { ...args.opts, hasher: args.opts?.hasher ?? defaultHasher } })
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
/** {@inheritDoc
|
|
70
|
+
/** {@inheritDoc ICredentialStore.crsUpdateCredentialState} */
|
|
67
71
|
private async crsUpdateCredentialState(args: UpdateCredentialStateArgs): Promise<DigitalCredential> {
|
|
68
72
|
return await this.store.updateCredentialState(args)
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
/** {@inheritDoc
|
|
75
|
+
/** {@inheritDoc ICredentialStore.crsGetCredential} */
|
|
72
76
|
private async crsGetCredential(args: GetCredentialArgs): Promise<DigitalCredential> {
|
|
73
77
|
const { id } = args
|
|
74
|
-
|
|
78
|
+
|
|
79
|
+
return this.store.getCredential({ id })
|
|
75
80
|
}
|
|
76
81
|
|
|
77
|
-
/** {@inheritDoc
|
|
82
|
+
/** {@inheritDoc ICredentialStore.crsGetCredentials} */
|
|
78
83
|
private async crsGetCredentials(args: GetCredentialsArgs): Promise<Array<DigitalCredential>> {
|
|
79
84
|
const { filter } = args
|
|
80
85
|
const credentials = await this.store.getCredentials({ filter })
|
|
86
|
+
|
|
81
87
|
return credentials.data
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
/** {@inheritDoc
|
|
90
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentialByIdOrHash} */
|
|
85
91
|
private async crsGetUniqueCredentialByIdOrHash(args: GetCredentialsByIdOrHashArgs): Promise<OptionalUniqueDigitalCredential> {
|
|
86
92
|
const credentials = await this.crsGetCredentials({ filter: credentialIdOrHashFilter(args.credentialRole, args.idOrHash) })
|
|
87
93
|
if (credentials.length === 0) {
|
|
@@ -89,21 +95,23 @@ export class CredentialStore implements IAgentPlugin {
|
|
|
89
95
|
} else if (credentials.length > 1) {
|
|
90
96
|
logger.warning('Duplicate credentials detected in crsGetUniqueCredentialByIdOrHash', args)
|
|
91
97
|
}
|
|
98
|
+
|
|
92
99
|
return this.toUniqueCredentials(credentials)[0]
|
|
93
100
|
}
|
|
94
101
|
|
|
95
|
-
/** {@inheritDoc
|
|
102
|
+
/** {@inheritDoc ICredentialStore.crsGetUniqueCredentials} */
|
|
96
103
|
private async crsGetUniqueCredentials(args: GetCredentialsArgs): Promise<Array<UniqueDigitalCredential>> {
|
|
97
104
|
const credentials = await this.crsGetCredentials(args)
|
|
105
|
+
|
|
98
106
|
return this.toUniqueCredentials(credentials)
|
|
99
107
|
}
|
|
100
108
|
|
|
101
|
-
/** {@inheritDoc
|
|
109
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredential} */
|
|
102
110
|
private async crsDeleteCredential(args: DeleteCredentialArgs): Promise<boolean> {
|
|
103
111
|
return this.store.removeCredential(args)
|
|
104
112
|
}
|
|
105
113
|
|
|
106
|
-
/** {@inheritDoc
|
|
114
|
+
/** {@inheritDoc ICredentialStore.crsDeleteCredentials} */
|
|
107
115
|
private async crsDeleteCredentials(args: DeleteCredentialsArgs): Promise<number> {
|
|
108
116
|
const credentials = await this.crsGetCredentials(args)
|
|
109
117
|
let count = 0
|
|
@@ -113,6 +121,7 @@ export class CredentialStore implements IAgentPlugin {
|
|
|
113
121
|
count++
|
|
114
122
|
}
|
|
115
123
|
}
|
|
124
|
+
|
|
116
125
|
return count
|
|
117
126
|
}
|
|
118
127
|
|
|
@@ -138,7 +147,7 @@ export class CredentialStore implements IAgentPlugin {
|
|
|
138
147
|
})
|
|
139
148
|
|
|
140
149
|
// This a copy of how Veramo did this. TODO Use GraphQL in the future?
|
|
141
|
-
|
|
150
|
+
return digitalCredentials.filter((uniqueVC) => {
|
|
142
151
|
if (!uniqueVC.uniformVerifiableCredential) {
|
|
143
152
|
return false
|
|
144
153
|
}
|
|
@@ -178,8 +187,6 @@ export class CredentialStore implements IAgentPlugin {
|
|
|
178
187
|
}) ?? true
|
|
179
188
|
)
|
|
180
189
|
})
|
|
181
|
-
|
|
182
|
-
return claimFilteredCredentials
|
|
183
190
|
}
|
|
184
191
|
|
|
185
192
|
private getValueFromCredential(credential: IVerifiableCredential, column: TClaimsColumns): any {
|
package/src/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|