@sphereon/ssi-sdk.wellknown-did-issuer 0.33.0 → 0.33.1-feature.vcdm2.4
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/WellKnownDidIssuer.js +154 -184
- package/dist/agent/WellKnownDidIssuer.js.map +1 -1
- package/dist/entities/DidConfigurationResourceEntity.js +32 -34
- package/dist/entities/DidConfigurationResourceEntity.js.map +1 -1
- package/dist/index.js +7 -27
- package/dist/index.js.map +1 -1
- package/dist/migrations/generic/1-CreateWellknownDidIssuer.js +46 -68
- package/dist/migrations/generic/1-CreateWellknownDidIssuer.js.map +1 -1
- package/dist/migrations/generic/index.js +2 -5
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.js +1 -5
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.js +6 -8
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -1
- package/dist/migrations/postgres/1661165115000-CreateWellknownDidIssuer.js +8 -27
- package/dist/migrations/postgres/1661165115000-CreateWellknownDidIssuer.js.map +1 -1
- package/dist/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.js +8 -27
- package/dist/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.js.map +1 -1
- package/dist/types/IWellKnownDidIssuer.js +1 -2
- package/package.json +6 -6
|
@@ -1,218 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.WellKnownDidIssuer = void 0;
|
|
13
|
-
const ssi_sdk_credential_store_1 = require("@sphereon/ssi-sdk.credential-store");
|
|
14
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
15
|
-
const wellknown_dids_client_1 = require("@sphereon/wellknown-dids-client");
|
|
16
|
-
const did_jwt_vc_1 = require("did-jwt-vc");
|
|
17
|
-
const uuid_1 = require("uuid");
|
|
18
|
-
const DidConfigurationResourceEntity_1 = require("../entities/DidConfigurationResourceEntity");
|
|
19
|
-
const index_1 = require("../index");
|
|
20
|
-
const ssi_sdk_data_store_1 = require("@sphereon/ssi-sdk.data-store");
|
|
1
|
+
import { CredentialCorrelationType, CredentialRole } from '@sphereon/ssi-sdk.credential-store';
|
|
2
|
+
import { CredentialMapper, parseDid } from '@sphereon/ssi-types';
|
|
3
|
+
import { ServiceTypesEnum, WellKnownDidIssuer as Issuer, } from '@sphereon/wellknown-dids-client';
|
|
4
|
+
import { normalizeCredential } from 'did-jwt-vc';
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
+
import { createCredentialEntity, DidConfigurationResourceEntity, didConfigurationResourceFrom } from '../entities/DidConfigurationResourceEntity';
|
|
7
|
+
import { schema } from '../index';
|
|
8
|
+
import { RegulationType } from '@sphereon/ssi-sdk.data-store';
|
|
21
9
|
/**
|
|
22
10
|
* {@inheritDoc IWellKnownDidIssuer}
|
|
23
11
|
*/
|
|
24
|
-
class WellKnownDidIssuer {
|
|
12
|
+
export class WellKnownDidIssuer {
|
|
13
|
+
dbConnection;
|
|
14
|
+
schema = schema.IWellKnownDidVerifier;
|
|
15
|
+
methods = {
|
|
16
|
+
addLinkedDomainsService: this.addLinkedDomainsService.bind(this),
|
|
17
|
+
getDidConfigurationResource: this.getDidConfigurationResource.bind(this),
|
|
18
|
+
issueDidConfigurationResource: this.issueDidConfigurationResource.bind(this),
|
|
19
|
+
issueDomainLinkageCredential: this.issueDomainLinkageCredential.bind(this),
|
|
20
|
+
registerCredentialIssuance: this.registerCredentialIssuance.bind(this),
|
|
21
|
+
removeCredentialIssuance: this.removeCredentialIssuance.bind(this),
|
|
22
|
+
saveDidConfigurationResource: this.saveDidConfigurationResource.bind(this),
|
|
23
|
+
};
|
|
24
|
+
credentialIssuances;
|
|
25
|
+
didConfigurationResourceRelations = ['linkedDids'];
|
|
25
26
|
constructor(dbConnection, args) {
|
|
26
27
|
this.dbConnection = dbConnection;
|
|
27
|
-
this.schema = index_1.schema.IWellKnownDidVerifier;
|
|
28
|
-
this.methods = {
|
|
29
|
-
addLinkedDomainsService: this.addLinkedDomainsService.bind(this),
|
|
30
|
-
getDidConfigurationResource: this.getDidConfigurationResource.bind(this),
|
|
31
|
-
issueDidConfigurationResource: this.issueDidConfigurationResource.bind(this),
|
|
32
|
-
issueDomainLinkageCredential: this.issueDomainLinkageCredential.bind(this),
|
|
33
|
-
registerCredentialIssuance: this.registerCredentialIssuance.bind(this),
|
|
34
|
-
removeCredentialIssuance: this.removeCredentialIssuance.bind(this),
|
|
35
|
-
saveDidConfigurationResource: this.saveDidConfigurationResource.bind(this),
|
|
36
|
-
};
|
|
37
|
-
this.didConfigurationResourceRelations = ['linkedDids'];
|
|
38
28
|
this.credentialIssuances = (args && args.credentialIssuances) || {};
|
|
39
29
|
}
|
|
40
30
|
/** {@inheritDoc IWellKnownDidIssuer.registerSignatureVerification} */
|
|
41
|
-
registerCredentialIssuance(args, context) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.credentialIssuances[args.callbackName] = args.credentialIssuance;
|
|
47
|
-
});
|
|
31
|
+
async registerCredentialIssuance(args, context) {
|
|
32
|
+
if (this.credentialIssuances[args.callbackName] !== undefined) {
|
|
33
|
+
return Promise.reject(new Error(`Credential issuance with callbackName: ${args.callbackName} already present`));
|
|
34
|
+
}
|
|
35
|
+
this.credentialIssuances[args.callbackName] = args.credentialIssuance;
|
|
48
36
|
}
|
|
49
37
|
/** {@inheritDoc IWellKnownDidIssuer.removeSignatureVerification} */
|
|
50
|
-
removeCredentialIssuance(args, context) {
|
|
51
|
-
return
|
|
52
|
-
return delete this.credentialIssuances[args.callbackName];
|
|
53
|
-
});
|
|
38
|
+
async removeCredentialIssuance(args, context) {
|
|
39
|
+
return delete this.credentialIssuances[args.callbackName];
|
|
54
40
|
}
|
|
55
41
|
/** {@inheritDoc IWellKnownDidIssuer.issueDidConfigurationResource} */
|
|
56
|
-
issueDidConfigurationResource(args, context) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
async issueDidConfigurationResource(args, context) {
|
|
43
|
+
if (!args.issuances.every((issuance) => issuance.origin === args.issuances[0].origin)) {
|
|
44
|
+
return Promise.reject(Error('All verifiableCredentials should be issued for the same origin'));
|
|
45
|
+
}
|
|
46
|
+
// TODO We should combine all origins into one service when we update to Veramo 3.1.6.next-165 or higher, as then we can support multiple origins
|
|
47
|
+
const addServices = args.issuances.map((issuance) => this.addLinkedDomainsService({
|
|
48
|
+
did: issuance.did,
|
|
49
|
+
origin: issuance.origin,
|
|
50
|
+
serviceId: issuance.serviceId,
|
|
51
|
+
}, context));
|
|
52
|
+
return Promise.all(addServices).then(async () => new Issuer()
|
|
53
|
+
.issueDidConfigurationResource({
|
|
54
|
+
issuances: await this.mapIssuances(args.issuances),
|
|
55
|
+
issueCallback: typeof args.credentialIssuance === 'string' ? await this.getCredentialIssuance(args.credentialIssuance) : args.credentialIssuance,
|
|
56
|
+
})
|
|
57
|
+
.then(async (didConfigurationResource) => {
|
|
58
|
+
if (args.save) {
|
|
59
|
+
// TODO add support for multiple origins when we upgrade Veramo version
|
|
60
|
+
await this.saveDidConfigurationResource({ origin: args.issuances[0].origin, didConfigurationResource }, context);
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
origin: issuance.origin,
|
|
65
|
-
serviceId: issuance.serviceId,
|
|
66
|
-
}, context));
|
|
67
|
-
return Promise.all(addServices).then(() => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
return new wellknown_dids_client_1.WellKnownDidIssuer()
|
|
69
|
-
.issueDidConfigurationResource({
|
|
70
|
-
issuances: yield this.mapIssuances(args.issuances),
|
|
71
|
-
issueCallback: typeof args.credentialIssuance === 'string' ? yield this.getCredentialIssuance(args.credentialIssuance) : args.credentialIssuance,
|
|
72
|
-
})
|
|
73
|
-
.then((didConfigurationResource) => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
if (args.save) {
|
|
75
|
-
// TODO add support for multiple origins when we upgrade Veramo version
|
|
76
|
-
yield this.saveDidConfigurationResource({ origin: args.issuances[0].origin, didConfigurationResource }, context);
|
|
77
|
-
}
|
|
78
|
-
return didConfigurationResource;
|
|
79
|
-
}))
|
|
80
|
-
.catch((error) => Promise.reject(Error(`Unable to issue DID configuration resource. Error: ${error.message}`)));
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
62
|
+
return didConfigurationResource;
|
|
63
|
+
})
|
|
64
|
+
.catch((error) => Promise.reject(Error(`Unable to issue DID configuration resource. Error: ${error.message}`))));
|
|
83
65
|
}
|
|
84
66
|
/** {@inheritDoc IWellKnownDidIssuer.saveDidConfigurationResource} */
|
|
85
|
-
saveDidConfigurationResource(args, context) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
yield (yield this.dbConnection).getRepository(DidConfigurationResourceEntity_1.DidConfigurationResourceEntity).save(didConfigurationEntity, { transaction: true });
|
|
93
|
-
});
|
|
67
|
+
async saveDidConfigurationResource(args, context) {
|
|
68
|
+
const didConfigurationEntity = {
|
|
69
|
+
origin: args.origin,
|
|
70
|
+
context: args.didConfigurationResource['@context'],
|
|
71
|
+
linkedDids: args.didConfigurationResource.linked_dids.map((credential) => createCredentialEntity(this.normalizeCredential(credential))),
|
|
72
|
+
};
|
|
73
|
+
await (await this.dbConnection).getRepository(DidConfigurationResourceEntity).save(didConfigurationEntity, { transaction: true });
|
|
94
74
|
}
|
|
95
75
|
/** {@inheritDoc IWellKnownDidIssuer.getDidConfigurationResource} */
|
|
96
|
-
getDidConfigurationResource(args, context) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
relations: this.didConfigurationResourceRelations,
|
|
101
|
-
});
|
|
102
|
-
if (!result) {
|
|
103
|
-
return Promise.reject(Error(`No DID configuration resource found for origin: ${args.origin}`));
|
|
104
|
-
}
|
|
105
|
-
return (0, DidConfigurationResourceEntity_1.didConfigurationResourceFrom)(result);
|
|
76
|
+
async getDidConfigurationResource(args, context) {
|
|
77
|
+
const result = await (await this.dbConnection).getRepository(DidConfigurationResourceEntity).findOne({
|
|
78
|
+
where: { origin: args.origin },
|
|
79
|
+
relations: this.didConfigurationResourceRelations,
|
|
106
80
|
});
|
|
81
|
+
if (!result) {
|
|
82
|
+
return Promise.reject(Error(`No DID configuration resource found for origin: ${args.origin}`));
|
|
83
|
+
}
|
|
84
|
+
return didConfigurationResourceFrom(result);
|
|
107
85
|
}
|
|
108
86
|
/** {@inheritDoc IWellKnownDidIssuer.issueDomainLinkageCredential} */
|
|
109
|
-
issueDomainLinkageCredential(args, context) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
87
|
+
async issueDomainLinkageCredential(args, context) {
|
|
88
|
+
const did = parseDid(args.did).did;
|
|
89
|
+
if (new URL(args.origin).origin !== args.origin) {
|
|
90
|
+
return Promise.reject(Error(`Origin ${args.origin} is not valid`));
|
|
91
|
+
}
|
|
92
|
+
if (new URL(args.origin).protocol !== 'https:') {
|
|
93
|
+
return Promise.reject(Error(`Origin ${args.origin} is not a https URL`));
|
|
94
|
+
}
|
|
95
|
+
if (args.issuanceDate && isNaN(Date.parse(args.issuanceDate))) {
|
|
96
|
+
return Promise.reject(Error(`IssuanceDate ${args.issuanceDate} is not a valid date`));
|
|
97
|
+
}
|
|
98
|
+
if (isNaN(Date.parse(args.expirationDate))) {
|
|
99
|
+
return Promise.reject(Error(`ExpirationDate ${args.expirationDate} is not a valid date`));
|
|
100
|
+
}
|
|
101
|
+
const credentialIssuance = typeof args.credentialIssuance === 'string'
|
|
102
|
+
? await this.getCredentialIssuance(args.credentialIssuance)
|
|
103
|
+
: args.credentialIssuance;
|
|
104
|
+
return new Issuer()
|
|
105
|
+
.issueDomainLinkageCredential({
|
|
106
|
+
did,
|
|
107
|
+
origin: args.origin,
|
|
108
|
+
issuanceDate: args.issuanceDate,
|
|
109
|
+
expirationDate: args.expirationDate,
|
|
110
|
+
options: args.options,
|
|
111
|
+
issueCallback: credentialIssuance,
|
|
112
|
+
})
|
|
113
|
+
.then(async (credential) => {
|
|
114
|
+
if (args.save) {
|
|
115
|
+
await this.saveDomainLinkageCredential(credential, context);
|
|
114
116
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
if (args.issuanceDate && isNaN(Date.parse(args.issuanceDate))) {
|
|
119
|
-
return Promise.reject(Error(`IssuanceDate ${args.issuanceDate} is not a valid date`));
|
|
120
|
-
}
|
|
121
|
-
if (isNaN(Date.parse(args.expirationDate))) {
|
|
122
|
-
return Promise.reject(Error(`ExpirationDate ${args.expirationDate} is not a valid date`));
|
|
123
|
-
}
|
|
124
|
-
const credentialIssuance = typeof args.credentialIssuance === 'string'
|
|
125
|
-
? yield this.getCredentialIssuance(args.credentialIssuance)
|
|
126
|
-
: args.credentialIssuance;
|
|
127
|
-
return new wellknown_dids_client_1.WellKnownDidIssuer()
|
|
128
|
-
.issueDomainLinkageCredential({
|
|
129
|
-
did,
|
|
130
|
-
origin: args.origin,
|
|
131
|
-
issuanceDate: args.issuanceDate,
|
|
132
|
-
expirationDate: args.expirationDate,
|
|
133
|
-
options: args.options,
|
|
134
|
-
issueCallback: credentialIssuance,
|
|
135
|
-
})
|
|
136
|
-
.then((credential) => __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
if (args.save) {
|
|
138
|
-
yield this.saveDomainLinkageCredential(credential, context);
|
|
139
|
-
}
|
|
140
|
-
return credential;
|
|
141
|
-
}))
|
|
142
|
-
.catch((error) => Promise.reject(Error(`Unable to issue domain linkage credential for DID: ${did}. Error: ${error.message}`)));
|
|
143
|
-
});
|
|
117
|
+
return credential;
|
|
118
|
+
})
|
|
119
|
+
.catch((error) => Promise.reject(Error(`Unable to issue domain linkage credential for DID: ${did}. Error: ${error.message}`)));
|
|
144
120
|
}
|
|
145
121
|
/** {@inheritDoc IWellKnownDidIssuer.addLinkedDomainsService} */
|
|
146
|
-
addLinkedDomainsService(args, context) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
122
|
+
async addLinkedDomainsService(args, context) {
|
|
123
|
+
const did = parseDid(args.did).did;
|
|
124
|
+
if (new URL(args.origin).origin !== args.origin) {
|
|
125
|
+
return Promise.reject(Error(`Origin ${args.origin} is not valid`));
|
|
126
|
+
}
|
|
127
|
+
if (new URL(args.origin).protocol !== 'https:') {
|
|
128
|
+
return Promise.reject(Error(`Origin ${args.origin} is not a https URL`));
|
|
129
|
+
}
|
|
130
|
+
context.agent
|
|
131
|
+
.didManagerGet({ did })
|
|
132
|
+
.catch(() => Promise.reject(Error('DID cannot be found')))
|
|
133
|
+
.then(async (identifier) => {
|
|
134
|
+
if (!identifier.services ||
|
|
135
|
+
identifier.services.filter(
|
|
136
|
+
// TODO we should also check for the origins in the serviceEndpoint objects when we start supporting multiple origins
|
|
137
|
+
(service) => service.type === ServiceTypesEnum.LINKED_DOMAINS && service.serviceEndpoint === args.origin).length === 0) {
|
|
138
|
+
await context.agent.didManagerAddService({
|
|
139
|
+
did: identifier.did,
|
|
140
|
+
service: {
|
|
141
|
+
id: args.serviceId || uuidv4(),
|
|
142
|
+
type: ServiceTypesEnum.LINKED_DOMAINS,
|
|
143
|
+
// TODO We should support a serviceEndpoint object here when we update to Veramo 3.1.6.next-165 or higher, as then we can support multiple origins
|
|
144
|
+
serviceEndpoint: args.origin,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
154
147
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
.catch(() => Promise.reject(Error('DID cannot be found')))
|
|
158
|
-
.then((identifier) => __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
if (!identifier.services ||
|
|
160
|
-
identifier.services.filter(
|
|
161
|
-
// TODO we should also check for the origins in the serviceEndpoint objects when we start supporting multiple origins
|
|
162
|
-
(service) => service.type === wellknown_dids_client_1.ServiceTypesEnum.LINKED_DOMAINS && service.serviceEndpoint === args.origin).length === 0) {
|
|
163
|
-
yield context.agent.didManagerAddService({
|
|
164
|
-
did: identifier.did,
|
|
165
|
-
service: {
|
|
166
|
-
id: args.serviceId || (0, uuid_1.v4)(),
|
|
167
|
-
type: wellknown_dids_client_1.ServiceTypesEnum.LINKED_DOMAINS,
|
|
168
|
-
// TODO We should support a serviceEndpoint object here when we update to Veramo 3.1.6.next-165 or higher, as then we can support multiple origins
|
|
169
|
-
serviceEndpoint: args.origin,
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}))
|
|
174
|
-
.catch((error) => Promise.reject(Error(`Unable to add LinkedDomains service to DID: ${args.did}. Error: ${error.message}`)));
|
|
175
|
-
});
|
|
148
|
+
})
|
|
149
|
+
.catch((error) => Promise.reject(Error(`Unable to add LinkedDomains service to DID: ${args.did}. Error: ${error.message}`)));
|
|
176
150
|
}
|
|
177
|
-
getCredentialIssuance(callbackName) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return this.credentialIssuances[callbackName];
|
|
183
|
-
});
|
|
151
|
+
async getCredentialIssuance(callbackName) {
|
|
152
|
+
if (this.credentialIssuances[callbackName] === undefined) {
|
|
153
|
+
return Promise.reject(new Error(`Credential issuance not found for callbackName: ${callbackName}`));
|
|
154
|
+
}
|
|
155
|
+
return this.credentialIssuances[callbackName];
|
|
184
156
|
}
|
|
185
|
-
saveDomainLinkageCredential(credential, context) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
200
|
-
});
|
|
157
|
+
async saveDomainLinkageCredential(credential, context) {
|
|
158
|
+
const vc = this.normalizeCredential(credential);
|
|
159
|
+
return context.agent.crsAddCredential({
|
|
160
|
+
credential: {
|
|
161
|
+
rawDocument: JSON.stringify(vc),
|
|
162
|
+
credentialRole: CredentialRole.ISSUER,
|
|
163
|
+
regulationType: RegulationType.NON_REGULATED, // FIXME funke
|
|
164
|
+
kmsKeyRef: 'FIXME', // FIXME funke
|
|
165
|
+
identifierMethod: 'did',
|
|
166
|
+
issuerCorrelationId: CredentialMapper.issuerCorrelationIdFromIssuerType(vc.issuer),
|
|
167
|
+
issuerCorrelationType: CredentialCorrelationType.DID,
|
|
168
|
+
subjectCorrelationId: CredentialMapper.issuerCorrelationIdFromIssuerType(vc.issuer), // FIXME get separate did for subject
|
|
169
|
+
subjectCorrelationType: CredentialCorrelationType.DID,
|
|
170
|
+
},
|
|
201
171
|
});
|
|
202
172
|
}
|
|
203
173
|
normalizeCredential(credential) {
|
|
204
|
-
return typeof credential === 'string' ?
|
|
174
|
+
return typeof credential === 'string' ? normalizeCredential(credential) : credential;
|
|
205
175
|
}
|
|
206
|
-
mapIssuances(issuances) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
176
|
+
async mapIssuances(issuances) {
|
|
177
|
+
const promises = issuances.map(async (issuance) => {
|
|
178
|
+
return {
|
|
179
|
+
...issuance,
|
|
180
|
+
issueCallback: typeof issuance.credentialIssuance === 'string'
|
|
181
|
+
? await this.getCredentialIssuance(issuance.credentialIssuance)
|
|
182
|
+
: issuance.credentialIssuance,
|
|
183
|
+
};
|
|
214
184
|
});
|
|
185
|
+
return Promise.all(promises);
|
|
215
186
|
}
|
|
216
187
|
}
|
|
217
|
-
exports.WellKnownDidIssuer = WellKnownDidIssuer;
|
|
218
188
|
//# sourceMappingURL=WellKnownDidIssuer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WellKnownDidIssuer.js","sourceRoot":"","sources":["../../src/agent/WellKnownDidIssuer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WellKnownDidIssuer.js","sourceRoot":"","sources":["../../src/agent/WellKnownDidIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAqB,MAAM,oCAAoC,CAAA;AACjH,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAIL,gBAAgB,EAChB,kBAAkB,IAAI,MAAM,GAC7B,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGhD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AACjJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAajC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAE7D;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAgBnB;IAfD,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAA;IACrC,OAAO,GAAwB;QACtC,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;QAChE,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC;QACxE,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5E,4BAA4B,EAAE,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1E,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;QACtE,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,IA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,mBAAmB,EAAE,gBAAgB,CAAC,iCAAiC,CAAC,EAAE,CAAC,MAAM,CAAC;gBAClF,qBAAqB,EAAE,yBAAyB,CAAC,GAAG;gBACpD,oBAAoB,EAAE,gBAAgB,CAAC,iCAAiC,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,qCAAqC;gBAC1H,sBAAsB,EAAE,yBAAyB,CAAC,GAAG;aACtD;SACF,CAAC,CAAA;IACJ,CAAC;IAEO,mBAAmB,CAAC,UAAmC;QAC7D,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAA;IACtF,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,SAAmD;QAC5E,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAA2C,EAAE,EAAE;YACnF,OAAO;gBACL,GAAG,QAAQ;gBACX,aAAa,EACX,OAAO,QAAQ,CAAC,kBAAkB,KAAK,QAAQ;oBAC7C,CAAC,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,kBAAkB,CAAC;oBAC/D,CAAC,CAAC,QAAQ,CAAC,kBAAkB;aAClC,CAAA;QACH,CAAC,CAAC,CAAA;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC9B,CAAC;CACF"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,58 +7,58 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
import { Credential, Identifier, Claim } from '@veramo/data-store';
|
|
11
|
+
import { asArray, computeEntryHash, extractIssuer } from '@veramo/utils';
|
|
12
|
+
import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn, ManyToMany, JoinTable, BaseEntity } from 'typeorm';
|
|
13
|
+
let DidConfigurationResourceEntity = class DidConfigurationResourceEntity extends BaseEntity {
|
|
14
|
+
origin;
|
|
15
|
+
context;
|
|
16
|
+
// TODO cascade of delete should be true when the VC is only attached to one DID configuration resource
|
|
17
|
+
linkedDids;
|
|
18
|
+
createdAt;
|
|
19
|
+
lastUpdatedAt;
|
|
17
20
|
};
|
|
18
|
-
exports.DidConfigurationResourceEntity = DidConfigurationResourceEntity;
|
|
19
21
|
__decorate([
|
|
20
|
-
|
|
22
|
+
PrimaryColumn({ nullable: false }),
|
|
21
23
|
__metadata("design:type", String)
|
|
22
24
|
], DidConfigurationResourceEntity.prototype, "origin", void 0);
|
|
23
25
|
__decorate([
|
|
24
|
-
|
|
26
|
+
Column({ nullable: false }),
|
|
25
27
|
__metadata("design:type", String)
|
|
26
28
|
], DidConfigurationResourceEntity.prototype, "context", void 0);
|
|
27
29
|
__decorate([
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
ManyToMany(() => Credential, (credential) => credential.hash, { nullable: false, cascade: true, onDelete: 'NO ACTION' }),
|
|
31
|
+
JoinTable({ name: 'DidConfigurationResourceCredentials' }),
|
|
30
32
|
__metadata("design:type", Array)
|
|
31
33
|
], DidConfigurationResourceEntity.prototype, "linkedDids", void 0);
|
|
32
34
|
__decorate([
|
|
33
|
-
|
|
35
|
+
CreateDateColumn({ name: 'created_at', nullable: false }),
|
|
34
36
|
__metadata("design:type", Date)
|
|
35
37
|
], DidConfigurationResourceEntity.prototype, "createdAt", void 0);
|
|
36
38
|
__decorate([
|
|
37
|
-
|
|
39
|
+
UpdateDateColumn({ name: 'last_updated_at', nullable: false }),
|
|
38
40
|
__metadata("design:type", Date)
|
|
39
41
|
], DidConfigurationResourceEntity.prototype, "lastUpdatedAt", void 0);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
DidConfigurationResourceEntity = __decorate([
|
|
43
|
+
Entity('DidConfigurationResource')
|
|
42
44
|
], DidConfigurationResourceEntity);
|
|
43
|
-
|
|
45
|
+
export { DidConfigurationResourceEntity };
|
|
46
|
+
export const didConfigurationResourceFrom = (didConfigurationResource) => {
|
|
44
47
|
return {
|
|
45
48
|
'@context': didConfigurationResource.context,
|
|
46
49
|
linked_dids: linkedDidsFrom(didConfigurationResource.linkedDids),
|
|
47
50
|
};
|
|
48
51
|
};
|
|
49
|
-
exports.didConfigurationResourceFrom = didConfigurationResourceFrom;
|
|
50
52
|
const linkedDidsFrom = (credentials) => {
|
|
51
|
-
return credentials.map((credential) =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
? credential.raw.proof.jwt
|
|
55
|
-
: credential.raw;
|
|
56
|
-
});
|
|
53
|
+
return credentials.map((credential) => credential?.raw?.proof?.type === 'JwtProof2020' && typeof credential?.raw?.proof?.jwt === 'string'
|
|
54
|
+
? credential.raw.proof.jwt
|
|
55
|
+
: credential.raw);
|
|
57
56
|
};
|
|
58
|
-
const createCredentialEntity = (vci) => {
|
|
57
|
+
export const createCredentialEntity = (vci) => {
|
|
59
58
|
const vc = vci;
|
|
60
|
-
const credential = new
|
|
61
|
-
credential.context =
|
|
62
|
-
credential.type =
|
|
59
|
+
const credential = new Credential();
|
|
60
|
+
credential.context = asArray(vc['@context']);
|
|
61
|
+
credential.type = asArray(vc.type || []);
|
|
63
62
|
credential.id = vc.id;
|
|
64
63
|
if (vc.issuanceDate) {
|
|
65
64
|
credential.issuanceDate = new Date(vc.issuanceDate);
|
|
@@ -67,11 +66,11 @@ const createCredentialEntity = (vci) => {
|
|
|
67
66
|
if (vc.expirationDate) {
|
|
68
67
|
credential.expirationDate = new Date(vc.expirationDate);
|
|
69
68
|
}
|
|
70
|
-
const issuer = new
|
|
71
|
-
issuer.did =
|
|
69
|
+
const issuer = new Identifier();
|
|
70
|
+
issuer.did = extractIssuer(vc);
|
|
72
71
|
credential.issuer = issuer;
|
|
73
72
|
if (vc.credentialSubject.id) {
|
|
74
|
-
const subject = new
|
|
73
|
+
const subject = new Identifier();
|
|
75
74
|
subject.did = vc.credentialSubject.id;
|
|
76
75
|
credential.subject = subject;
|
|
77
76
|
}
|
|
@@ -81,8 +80,8 @@ const createCredentialEntity = (vci) => {
|
|
|
81
80
|
const value = vc.credentialSubject[type];
|
|
82
81
|
if (type !== 'id') {
|
|
83
82
|
const isObj = typeof value === 'function' || (typeof value === 'object' && !!value);
|
|
84
|
-
const claim = new
|
|
85
|
-
claim.hash =
|
|
83
|
+
const claim = new Claim();
|
|
84
|
+
claim.hash = computeEntryHash(JSON.stringify(vc) + type);
|
|
86
85
|
claim.type = type;
|
|
87
86
|
claim.value = isObj ? JSON.stringify(value) : value;
|
|
88
87
|
claim.isObj = isObj;
|
|
@@ -99,5 +98,4 @@ const createCredentialEntity = (vci) => {
|
|
|
99
98
|
credential.raw = vci;
|
|
100
99
|
return credential;
|
|
101
100
|
};
|
|
102
|
-
exports.createCredentialEntity = createCredentialEntity;
|
|
103
101
|
//# sourceMappingURL=DidConfigurationResourceEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidConfigurationResourceEntity.js","sourceRoot":"","sources":["../../src/entities/DidConfigurationResourceEntity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DidConfigurationResourceEntity.js","sourceRoot":"","sources":["../../src/entities/DidConfigurationResourceEntity.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA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AAc,GAAG,UAAU,CAAC,IAAI,CAAA;gBACtC,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;gBAClC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;IAED,UAAU,CAAC,GAAG,GAAG,GAAG,CAAA;IACpB,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WellknownDidIssuerMigrations = exports.WellknownDidIssuerEntities = exports.WellKnownDidIssuer = exports.DidConfigurationResourceEntity = exports.schema = void 0;
|
|
18
|
-
const DidConfigurationResourceEntity_1 = require("./entities/DidConfigurationResourceEntity");
|
|
1
|
+
import { DidConfigurationResourceEntity } from './entities/DidConfigurationResourceEntity';
|
|
19
2
|
/**
|
|
20
3
|
* @public
|
|
21
4
|
*/
|
|
22
5
|
const schema = require('../plugin.schema.json');
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.WellknownDidIssuerEntities = [DidConfigurationResourceEntity_1.DidConfigurationResourceEntity];
|
|
30
|
-
var migrations_1 = require("./migrations");
|
|
31
|
-
Object.defineProperty(exports, "WellknownDidIssuerMigrations", { enumerable: true, get: function () { return migrations_1.WellknownDidIssuerMigrations; } });
|
|
6
|
+
export { schema };
|
|
7
|
+
export { DidConfigurationResourceEntity } from './entities/DidConfigurationResourceEntity';
|
|
8
|
+
export { WellKnownDidIssuer } from './agent/WellKnownDidIssuer';
|
|
9
|
+
export * from './types/IWellKnownDidIssuer';
|
|
10
|
+
export const WellknownDidIssuerEntities = [DidConfigurationResourceEntity];
|
|
11
|
+
export { WellknownDidIssuerMigrations } from './migrations';
|
|
32
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAA;AAE1F;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,cAAc,6BAA6B,CAAA;AAC3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,8BAA8B,CAAC,CAAA;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1,72 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import Debug from 'debug';
|
|
2
|
+
import { CreateWellknownDidIssuer1661165115000 } from '../postgres/1661165115000-CreateWellknownDidIssuer';
|
|
3
|
+
import { CreateWellknownDidIssuer1661161799000 } from '../sqlite/1661161799000-CreateWellknownDidIssuer';
|
|
4
|
+
const debug = Debug('sphereon:ssi-sdk:migrations');
|
|
5
|
+
export class CreateWellknownDidIssuer1661162010000 {
|
|
6
|
+
name = 'CreateWellknownDidIssuer1661162010000';
|
|
7
|
+
async up(queryRunner) {
|
|
8
|
+
debug('migration: creating well-known DID tables');
|
|
9
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
10
|
+
if (dbType === 'postgres') {
|
|
11
|
+
debug('using postgres migration file');
|
|
12
|
+
const mig = new CreateWellknownDidIssuer1661165115000();
|
|
13
|
+
const up = await mig.up(queryRunner);
|
|
14
|
+
debug('Migration statements executed');
|
|
15
|
+
return up;
|
|
16
|
+
}
|
|
17
|
+
else if (dbType === 'sqlite' || dbType === 'react-native' || dbType === 'expo') {
|
|
18
|
+
debug('using sqlite/react-native migration file');
|
|
19
|
+
const mig = new CreateWellknownDidIssuer1661161799000();
|
|
20
|
+
const up = await mig.up(queryRunner);
|
|
21
|
+
debug('Migration statements executed');
|
|
22
|
+
return up;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expor and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
26
|
+
}
|
|
23
27
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
down(queryRunner) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
debug('reverting well-known DID tables');
|
|
50
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
51
|
-
if (dbType === 'postgres') {
|
|
52
|
-
debug('using postgres migration file');
|
|
53
|
-
const mig = new _1661165115000_CreateWellknownDidIssuer_1.CreateWellknownDidIssuer1661165115000();
|
|
54
|
-
const down = yield mig.down(queryRunner);
|
|
55
|
-
debug('Migration statements executed');
|
|
56
|
-
return down;
|
|
57
|
-
}
|
|
58
|
-
else if (dbType === 'sqlite' || dbType === 'react-native' || dbType === 'expo') {
|
|
59
|
-
debug('using sqlite/react-native migration file');
|
|
60
|
-
const mig = new _1661161799000_CreateWellknownDidIssuer_1.CreateWellknownDidIssuer1661161799000();
|
|
61
|
-
const down = yield mig.down(queryRunner);
|
|
62
|
-
debug('Migration statements executed');
|
|
63
|
-
return down;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expor and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
28
|
+
async down(queryRunner) {
|
|
29
|
+
debug('reverting well-known DID tables');
|
|
30
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
31
|
+
if (dbType === 'postgres') {
|
|
32
|
+
debug('using postgres migration file');
|
|
33
|
+
const mig = new CreateWellknownDidIssuer1661165115000();
|
|
34
|
+
const down = await mig.down(queryRunner);
|
|
35
|
+
debug('Migration statements executed');
|
|
36
|
+
return down;
|
|
37
|
+
}
|
|
38
|
+
else if (dbType === 'sqlite' || dbType === 'react-native' || dbType === 'expo') {
|
|
39
|
+
debug('using sqlite/react-native migration file');
|
|
40
|
+
const mig = new CreateWellknownDidIssuer1661161799000();
|
|
41
|
+
const down = await mig.down(queryRunner);
|
|
42
|
+
debug('Migration statements executed');
|
|
43
|
+
return down;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expor and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
47
|
+
}
|
|
69
48
|
}
|
|
70
49
|
}
|
|
71
|
-
exports.CreateWellknownDidIssuer1661162010000 = CreateWellknownDidIssuer1661162010000;
|
|
72
50
|
//# sourceMappingURL=1-CreateWellknownDidIssuer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/generic/1-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,qCAAqC,EAAE,MAAM,oDAAoD,CAAA;AAC1G,OAAO,EAAE,qCAAqC,EAAE,MAAM,kDAAkD,CAAA;AAExG,MAAM,KAAK,GAAG,KAAK,CAAC,6BAA6B,CAAC,CAAA;AAElD,MAAM,OAAO,qCAAqC;IAChD,IAAI,GAAG,uCAAuC,CAAA;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,KAAK,CAAC,2CAA2C,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAA;QACzD,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,KAAK,CAAC,+BAA+B,CAAC,CAAA;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EAAE,CAAA;YACvD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YACxC,KAAK,CAAC,+BAA+B,CAAC,CAAA;YACtC,OAAO,IAAI,CAAA;QACb,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAC,MAAM,CACnB,6FAA6F,MAAM,+GAA+G,CACnN,CAAA;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WellknownDidIssuerMigrations = void 0;
|
|
4
|
-
const _1_CreateWellknownDidIssuer_1 = require("./1-CreateWellknownDidIssuer");
|
|
1
|
+
import { CreateWellknownDidIssuer1661162010000 } from './1-CreateWellknownDidIssuer';
|
|
5
2
|
/**
|
|
6
3
|
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
7
4
|
*
|
|
@@ -9,5 +6,5 @@ const _1_CreateWellknownDidIssuer_1 = require("./1-CreateWellknownDidIssuer");
|
|
|
9
6
|
*
|
|
10
7
|
* @public
|
|
11
8
|
*/
|
|
12
|
-
|
|
9
|
+
export const WellknownDidIssuerMigrations = [CreateWellknownDidIssuer1661162010000];
|
|
13
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/migrations/generic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAA;AAEpF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,qCAAqC,CAAC,CAAA"}
|
package/dist/migrations/index.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WellknownDidIssuerMigrations = void 0;
|
|
4
|
-
var generic_1 = require("./generic");
|
|
5
|
-
Object.defineProperty(exports, "WellknownDidIssuerMigrations", { enumerable: true, get: function () { return generic_1.WellknownDidIssuerMigrations; } });
|
|
1
|
+
export { WellknownDidIssuerMigrations } from './generic';
|
|
6
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const index_1 = require("../index");
|
|
1
|
+
import { WellknownDidIssuerEntities, WellknownDidIssuerMigrations } from '../index';
|
|
4
2
|
/**
|
|
5
3
|
* Do Not use these connections in production!. They are only here to create/test migration files!
|
|
6
4
|
*/
|
|
7
|
-
|
|
5
|
+
export default [
|
|
8
6
|
{
|
|
9
7
|
type: 'sqlite',
|
|
10
8
|
name: 'migration-sqlite',
|
|
@@ -12,8 +10,8 @@ exports.default = [
|
|
|
12
10
|
migrationsRun: false,
|
|
13
11
|
synchronize: false,
|
|
14
12
|
logging: ['error', 'info', 'warn', 'log'],
|
|
15
|
-
entities: [...
|
|
16
|
-
migrations: [...
|
|
13
|
+
entities: [...WellknownDidIssuerEntities],
|
|
14
|
+
migrations: [...WellknownDidIssuerMigrations],
|
|
17
15
|
},
|
|
18
16
|
{
|
|
19
17
|
type: 'postgres',
|
|
@@ -22,8 +20,8 @@ exports.default = [
|
|
|
22
20
|
migrationsRun: false,
|
|
23
21
|
synchronize: false,
|
|
24
22
|
logging: ['error', 'info', 'warn', 'log'],
|
|
25
|
-
entities: [...
|
|
26
|
-
migrations: [...
|
|
23
|
+
entities: [...WellknownDidIssuerEntities],
|
|
24
|
+
migrations: [...WellknownDidIssuerMigrations],
|
|
27
25
|
},
|
|
28
26
|
];
|
|
29
27
|
//# sourceMappingURL=internal-migrations-ormconfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-migrations-ormconfig.js","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-migrations-ormconfig.js","sourceRoot":"","sources":["../../src/migrations/internal-migrations-ormconfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA;AAEnF;;GAEG;AACH,eAAe;IACb;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,kBAAkB;QAC5B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,0BAA0B,CAAC;QACzC,UAAU,EAAE,CAAC,GAAG,4BAA4B,CAAC;KAC9C;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,oBAAoB;QAC1B,QAAQ,EAAE,oBAAoB;QAC9B,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;QACzC,QAAQ,EAAE,CAAC,GAAG,0BAA0B,CAAC;QACzC,UAAU,EAAE,CAAC,GAAG,4BAA4B,CAAC;KAC9C;CACqB,CAAA"}
|
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateWellknownDidIssuer1661165115000 = void 0;
|
|
13
|
-
class CreateWellknownDidIssuer1661165115000 {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'CreateWellknownDidIssuer1661165115000';
|
|
1
|
+
export class CreateWellknownDidIssuer1661165115000 {
|
|
2
|
+
name = 'CreateWellknownDidIssuer1661165115000';
|
|
3
|
+
async up(queryRunner) {
|
|
4
|
+
await queryRunner.query(`CREATE TABLE "DidConfigurationResource" ("origin" varchar NOT NULL, "context" varchar NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_Origin" PRIMARY KEY ("origin"))`);
|
|
5
|
+
await queryRunner.query(`CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`);
|
|
16
6
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
yield queryRunner.query(`CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
down(queryRunner) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
yield queryRunner.query(`DROP TABLE "DidConfigurationResource"`);
|
|
26
|
-
yield queryRunner.query(`DROP TABLE "DidConfigurationResourceCredentials"`);
|
|
27
|
-
});
|
|
7
|
+
async down(queryRunner) {
|
|
8
|
+
await queryRunner.query(`DROP TABLE "DidConfigurationResource"`);
|
|
9
|
+
await queryRunner.query(`DROP TABLE "DidConfigurationResourceCredentials"`);
|
|
28
10
|
}
|
|
29
11
|
}
|
|
30
|
-
exports.CreateWellknownDidIssuer1661165115000 = CreateWellknownDidIssuer1661165115000;
|
|
31
12
|
//# sourceMappingURL=1661165115000-CreateWellknownDidIssuer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1661165115000-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1661165115000-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,qCAAqC;IAChD,IAAI,GAAG,uCAAuC,CAAA;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CACrB,mPAAmP,CACpP,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB,2IAA2I,CAC5I,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAChE,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;IAC7E,CAAC;CACF"}
|
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateWellknownDidIssuer1661161799000 = void 0;
|
|
13
|
-
class CreateWellknownDidIssuer1661161799000 {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'CreateWellknownDidIssuer1661161799000';
|
|
1
|
+
export class CreateWellknownDidIssuer1661161799000 {
|
|
2
|
+
name = 'CreateWellknownDidIssuer1661161799000';
|
|
3
|
+
async up(queryRunner) {
|
|
4
|
+
await queryRunner.query(`CREATE TABLE "DidConfigurationResource" ("origin" varchar PRIMARY KEY NOT NULL, "context" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
5
|
+
await queryRunner.query(`CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`);
|
|
16
6
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
yield queryRunner.query(`CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
down(queryRunner) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
yield queryRunner.query(`DROP TABLE "DidConfigurationResource"`);
|
|
26
|
-
yield queryRunner.query(`DROP TABLE "DidConfigurationResourceCredentials"`);
|
|
27
|
-
});
|
|
7
|
+
async down(queryRunner) {
|
|
8
|
+
await queryRunner.query(`DROP TABLE "DidConfigurationResource"`);
|
|
9
|
+
await queryRunner.query(`DROP TABLE "DidConfigurationResourceCredentials"`);
|
|
28
10
|
}
|
|
29
11
|
}
|
|
30
|
-
exports.CreateWellknownDidIssuer1661161799000 = CreateWellknownDidIssuer1661161799000;
|
|
31
12
|
//# sourceMappingURL=1661161799000-CreateWellknownDidIssuer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1661161799000-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1661161799000-CreateWellknownDidIssuer.js","sourceRoot":"","sources":["../../../src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,qCAAqC;IAChD,IAAI,GAAG,uCAAuC,CAAA;IAEvC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CACrB,sOAAsO,CACvO,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB,2IAA2I,CAC5I,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAChE,MAAM,WAAW,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;IAC7E,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.wellknown-did-issuer",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build:clean": "tsc --build --clean && tsc --build"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@sphereon/ssi-sdk.credential-store": "0.33.
|
|
18
|
-
"@sphereon/ssi-sdk.data-store": "0.33.
|
|
19
|
-
"@sphereon/ssi-types": "0.33.
|
|
17
|
+
"@sphereon/ssi-sdk.credential-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
18
|
+
"@sphereon/ssi-sdk.data-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
19
|
+
"@sphereon/ssi-types": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
20
20
|
"@sphereon/wellknown-dids-client": "^0.1.3",
|
|
21
21
|
"@veramo/data-store": "4.2.0",
|
|
22
22
|
"@veramo/utils": "4.2.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"uuid": "^9.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@sphereon/ssi-sdk.agent-config": "0.33.
|
|
30
|
+
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
31
31
|
"@types/express": "^4.17.21",
|
|
32
32
|
"@types/uuid": "^9.0.8",
|
|
33
33
|
"@veramo/remote-client": "4.2.0",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"Verifiable Credential"
|
|
61
61
|
],
|
|
62
62
|
"nx": {},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "9f634bdb714061141e277508c124b08d626f6036"
|
|
64
64
|
}
|