@nmshd/consumption 7.0.2 → 7.1.0-openid4vc.2

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.
Files changed (46) hide show
  1. package/dist/buildInformation.js +5 -5
  2. package/dist/consumption/ConsumptionController.d.ts +3 -1
  3. package/dist/consumption/ConsumptionController.d.ts.map +1 -1
  4. package/dist/consumption/ConsumptionController.js +4 -0
  5. package/dist/consumption/ConsumptionController.js.map +1 -1
  6. package/dist/consumption/ConsumptionControllerName.d.ts +2 -1
  7. package/dist/consumption/ConsumptionControllerName.d.ts.map +1 -1
  8. package/dist/consumption/ConsumptionControllerName.js +1 -0
  9. package/dist/consumption/ConsumptionControllerName.js.map +1 -1
  10. package/dist/modules/index.d.ts +1 -0
  11. package/dist/modules/index.d.ts.map +1 -1
  12. package/dist/modules/index.js +1 -0
  13. package/dist/modules/index.js.map +1 -1
  14. package/dist/modules/openid4vc/OpenId4VcController.d.ts +17 -0
  15. package/dist/modules/openid4vc/OpenId4VcController.d.ts.map +1 -0
  16. package/dist/modules/openid4vc/OpenId4VcController.js +82 -0
  17. package/dist/modules/openid4vc/OpenId4VcController.js.map +1 -0
  18. package/dist/modules/openid4vc/index.d.ts +8 -0
  19. package/dist/modules/openid4vc/index.d.ts.map +1 -0
  20. package/dist/modules/openid4vc/index.js +24 -0
  21. package/dist/modules/openid4vc/index.js.map +1 -0
  22. package/dist/modules/openid4vc/local/BaseAgent.d.ts +20 -0
  23. package/dist/modules/openid4vc/local/BaseAgent.d.ts.map +1 -0
  24. package/dist/modules/openid4vc/local/BaseAgent.js +69 -0
  25. package/dist/modules/openid4vc/local/BaseAgent.js.map +1 -0
  26. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts +18 -0
  27. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts.map +1 -0
  28. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js +94 -0
  29. package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js.map +1 -0
  30. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts +34 -0
  31. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts.map +1 -0
  32. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js +364 -0
  33. package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js.map +1 -0
  34. package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts +20 -0
  35. package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts.map +1 -0
  36. package/dist/modules/openid4vc/local/EnmeshedStorageService.js +218 -0
  37. package/dist/modules/openid4vc/local/EnmeshedStorageService.js.map +1 -0
  38. package/dist/modules/openid4vc/local/Holder.d.ts +34 -0
  39. package/dist/modules/openid4vc/local/Holder.d.ts.map +1 -0
  40. package/dist/modules/openid4vc/local/Holder.js +225 -0
  41. package/dist/modules/openid4vc/local/Holder.js.map +1 -0
  42. package/dist/modules/openid4vc/local/LocalAgentDependencies.d.ts +3 -0
  43. package/dist/modules/openid4vc/local/LocalAgentDependencies.d.ts.map +1 -0
  44. package/dist/modules/openid4vc/local/LocalAgentDependencies.js +18 -0
  45. package/dist/modules/openid4vc/local/LocalAgentDependencies.js.map +1 -0
  46. package/package.json +13 -5
@@ -0,0 +1,34 @@
1
+ import { X509Module } from "@credo-ts/core";
2
+ import { OpenId4VcModule, type OpenId4VciMetadata, type OpenId4VciResolvedCredentialOffer, type OpenId4VpResolvedAuthorizationRequest } from "@credo-ts/openid4vc";
3
+ import { AccountController } from "@nmshd/transport";
4
+ import { AttributesController, OwnIdentityAttribute } from "../../attributes";
5
+ import { BaseAgent } from "./BaseAgent";
6
+ declare function getOpenIdHolderModules(): {
7
+ readonly openid4vc: OpenId4VcModule<null, null>;
8
+ readonly x509: X509Module;
9
+ };
10
+ export declare class Holder extends BaseAgent<ReturnType<typeof getOpenIdHolderModules>> {
11
+ client: {
12
+ clientId: string;
13
+ redirectUri: string;
14
+ };
15
+ constructor(accountController: AccountController, attributeController: AttributesController);
16
+ getVerifiableCredentials(ids: string[] | undefined): Promise<any[]>;
17
+ resolveCredentialOffer(credentialOffer: string): Promise<OpenId4VciResolvedCredentialOffer>;
18
+ resolveIssuerMetadata(credentialIssuer: string): Promise<OpenId4VciMetadata>;
19
+ initiateAuthorization(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, credentialsToRequest: string[]): Promise<any>;
20
+ requestAndStoreCredentials(resolvedCredentialOffer: OpenId4VciResolvedCredentialOffer, options: {
21
+ clientId?: string;
22
+ codeVerifier?: string;
23
+ credentialsToRequest: string[];
24
+ code?: string;
25
+ redirectUri?: string;
26
+ txCode?: string;
27
+ }): Promise<OwnIdentityAttribute[]>;
28
+ resolveProofRequest(proofRequest: string): Promise<any>;
29
+ acceptPresentationRequest(resolvedPresentationRequest: OpenId4VpResolvedAuthorizationRequest): Promise<any>;
30
+ exit(): Promise<any>;
31
+ restart(): Promise<any>;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=Holder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Holder.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/Holder.ts"],"names":[],"mappings":"AAAA,OAAO,EAYH,UAAU,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACH,eAAe,EAIf,KAAK,kBAAkB,EACvB,KAAK,iCAAiC,EACtC,KAAK,qCAAqC,EAC7C,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,iBAAS,sBAAsB;;;EAW9B;AAED,qBAAa,MAAO,SAAQ,SAAS,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;IACrE,MAAM;;;MAGX;gBAEiB,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,oBAAoB;IAIrF,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IASnE,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,iCAAiC,CAAC;IAI3F,qBAAqB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI5E,qBAAqB,CAAC,uBAAuB,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAiC/H,0BAA0B,CACnC,uBAAuB,EAAE,iCAAiC,EAC1D,OAAO,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,oBAAoB,EAAE,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GACF,OAAO,CAAC,oBAAoB,EAAE,CAAC;IA2HrB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAMvD,yBAAyB,CAAC,2BAA2B,EAAE,qCAAqC,GAAG,OAAO,CAAC,GAAG,CAAC;IAuD3G,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC;IAKpB,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;CAGvC"}
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Holder = void 0;
4
+ const core_1 = require("@credo-ts/core");
5
+ const openid4vc_1 = require("@credo-ts/openid4vc");
6
+ const BaseAgent_1 = require("./BaseAgent");
7
+ function getOpenIdHolderModules() {
8
+ return {
9
+ openid4vc: new openid4vc_1.OpenId4VcModule(),
10
+ x509: new core_1.X509Module({
11
+ getTrustedCertificatesForVerification: (_agentContext, { certificateChain, verification }) => {
12
+ // eslint-disable-next-line no-console
13
+ console.log(`dyncamically trusting certificate ${certificateChain[0].getIssuerNameField("C")} for verification of ${verification.type}`);
14
+ return [certificateChain[0].toString("pem")];
15
+ }
16
+ })
17
+ };
18
+ }
19
+ class Holder extends BaseAgent_1.BaseAgent {
20
+ constructor(accountController, attributeController) {
21
+ super(3000, `OpenId4VcHolder ${Math.random().toString()}`, getOpenIdHolderModules(), accountController, attributeController);
22
+ this.client = {
23
+ clientId: "wallet",
24
+ redirectUri: "http://localhost:3000/redirect"
25
+ };
26
+ }
27
+ async getVerifiableCredentials(ids) {
28
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
29
+ const storageService = this.agent.dependencyManager.resolve(core_1.InjectionSymbols.StorageService);
30
+ const allCredentials = await storageService.getAllAsAttributes(this.agent.context, core_1.SdJwtVcRecord);
31
+ if (!ids)
32
+ return allCredentials;
33
+ return allCredentials.filter((vc) => ids.includes(vc.id.toString()));
34
+ }
35
+ async resolveCredentialOffer(credentialOffer) {
36
+ return await this.agent.openid4vc.holder.resolveCredentialOffer(credentialOffer);
37
+ }
38
+ async resolveIssuerMetadata(credentialIssuer) {
39
+ return await this.agent.openid4vc.holder.resolveIssuerMetadata(credentialIssuer);
40
+ }
41
+ async initiateAuthorization(resolvedCredentialOffer, credentialsToRequest) {
42
+ const grants = resolvedCredentialOffer.credentialOfferPayload.grants;
43
+ if (grants?.[openid4vc_1.preAuthorizedCodeGrantIdentifier]) {
44
+ return {
45
+ authorizationFlow: "PreAuthorized",
46
+ preAuthorizedCode: grants[openid4vc_1.preAuthorizedCodeGrantIdentifier]["pre-authorized_code"]
47
+ };
48
+ }
49
+ if (resolvedCredentialOffer.credentialOfferPayload.grants?.[openid4vc_1.authorizationCodeGrantIdentifier]) {
50
+ const resolvedAuthorizationRequest = await this.agent.openid4vc.holder.resolveOpenId4VciAuthorizationRequest(resolvedCredentialOffer, {
51
+ clientId: this.client.clientId,
52
+ redirectUri: this.client.redirectUri,
53
+ scope: Object.entries(resolvedCredentialOffer.offeredCredentialConfigurations)
54
+ .map(([id, value]) => (credentialsToRequest.includes(id) ? value.scope : undefined))
55
+ .filter((v) => Boolean(v))
56
+ });
57
+ if (resolvedAuthorizationRequest.authorizationFlow === openid4vc_1.OpenId4VciAuthorizationFlow.PresentationDuringIssuance) {
58
+ return {
59
+ ...resolvedAuthorizationRequest,
60
+ authorizationFlow: `${openid4vc_1.OpenId4VciAuthorizationFlow.PresentationDuringIssuance}`
61
+ };
62
+ }
63
+ return {
64
+ ...resolvedAuthorizationRequest,
65
+ authorizationFlow: `${openid4vc_1.OpenId4VciAuthorizationFlow.Oauth2Redirect}`
66
+ };
67
+ }
68
+ throw new Error("Unsupported grant type");
69
+ }
70
+ async requestAndStoreCredentials(resolvedCredentialOffer, options) {
71
+ const tokenResponse = await this.agent.openid4vc.holder.requestToken(options.code && options.clientId
72
+ ? {
73
+ resolvedCredentialOffer,
74
+ clientId: options.clientId,
75
+ codeVerifier: options.codeVerifier,
76
+ code: options.code,
77
+ redirectUri: options.redirectUri
78
+ }
79
+ : {
80
+ resolvedCredentialOffer,
81
+ txCode: options.txCode
82
+ });
83
+ const credentialResponse = await this.agent.openid4vc.holder.requestCredentials({
84
+ resolvedCredentialOffer,
85
+ clientId: options.clientId,
86
+ credentialConfigurationIds: options.credentialsToRequest,
87
+ credentialBindingResolver: async ({ supportedDidMethods, supportsAllDidMethods, proofTypes }) => {
88
+ const key = await this.agent.kms.createKeyForSignatureAlgorithm({
89
+ algorithm: proofTypes.jwt?.supportedSignatureAlgorithms[0] ?? "EdDSA"
90
+ });
91
+ const publicJwk = core_1.Kms.PublicJwk.fromPublicJwk(key.publicJwk);
92
+ if (supportsAllDidMethods || supportedDidMethods?.includes("did:key")) {
93
+ await this.agent.dids.create({
94
+ method: "key",
95
+ options: {
96
+ keyId: key.keyId
97
+ }
98
+ });
99
+ const didKey = new core_1.DidKey(publicJwk);
100
+ return {
101
+ method: "did",
102
+ didUrls: [`${didKey.did}#${didKey.publicJwk.fingerprint}`]
103
+ };
104
+ }
105
+ if (supportedDidMethods?.includes("did:jwk")) {
106
+ const didJwk = core_1.DidJwk.fromPublicJwk(publicJwk);
107
+ await this.agent.dids.create({
108
+ method: "jwk",
109
+ options: {
110
+ keyId: key.keyId
111
+ }
112
+ });
113
+ return {
114
+ method: "did",
115
+ didUrls: [`${didJwk.did}#0`]
116
+ };
117
+ }
118
+ // We fall back on jwk binding
119
+ return {
120
+ method: "jwk",
121
+ keys: [publicJwk]
122
+ };
123
+ },
124
+ ...tokenResponse
125
+ });
126
+ this.agent.config.logger.info("Credential response:", credentialResponse);
127
+ const storedCredentials = await Promise.all(credentialResponse.credentials.map((response) => {
128
+ // TODO: batch issuance not yet supported
129
+ const credential = response.credentials[0];
130
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
131
+ const enmeshedStorageService = this.agent.dependencyManager.resolve(core_1.InjectionSymbols.StorageService);
132
+ let credentialKey = "";
133
+ for (const resolved in resolvedCredentialOffer.offeredCredentialConfigurations) {
134
+ credentialKey = resolved;
135
+ }
136
+ const displayInfo = resolvedCredentialOffer.offeredCredentialConfigurations[credentialKey].display;
137
+ // if the displayInfo does not provide a logo - we try to load a logo from the issuers attributes
138
+ if (displayInfo !== undefined &&
139
+ displayInfo[0]?.logo === undefined &&
140
+ resolvedCredentialOffer.metadata.credentialIssuer.display !== undefined &&
141
+ resolvedCredentialOffer.metadata.credentialIssuer.display?.[0] !== undefined &&
142
+ resolvedCredentialOffer.metadata.credentialIssuer.display?.[0]?.["logo"] !== undefined) {
143
+ const logoInformation = resolvedCredentialOffer.metadata.credentialIssuer.display?.[0]?.["logo"];
144
+ displayInfo[0]["logo"] = logoInformation;
145
+ }
146
+ if (credential.claimFormat === core_1.ClaimFormat.MsoMdoc) {
147
+ return enmeshedStorageService.saveWithDisplay(this.agent.context, credential.base64Url, credential.claimFormat.toString(), JSON.stringify(displayInfo), credentialKey);
148
+ }
149
+ else if (credential.claimFormat === core_1.ClaimFormat.SdJwtDc) {
150
+ return enmeshedStorageService.saveWithDisplay(this.agent.context, credential.compact, credential.claimFormat.toString(), JSON.stringify(displayInfo), credentialKey);
151
+ }
152
+ else if (credential.claimFormat === core_1.ClaimFormat.SdJwtW3cVc) {
153
+ return enmeshedStorageService.saveWithDisplay(this.agent.context, credential.encoded, credential.claimFormat.toString(), JSON.stringify(displayInfo), credentialKey);
154
+ }
155
+ throw new Error("Unsupported credential format");
156
+ }));
157
+ this.agent.config.logger.info(`Stored credentials: ${JSON.stringify(storedCredentials)}`);
158
+ return storedCredentials;
159
+ }
160
+ async resolveProofRequest(proofRequest) {
161
+ const resolvedProofRequest = await this.agent.openid4vc.holder.resolveOpenId4VpAuthorizationRequest(proofRequest);
162
+ return resolvedProofRequest;
163
+ }
164
+ async acceptPresentationRequest(resolvedPresentationRequest) {
165
+ if (!resolvedPresentationRequest.presentationExchange && !resolvedPresentationRequest.dcql) {
166
+ throw new Error("Missing presentation exchange or dcql on resolved authorization request");
167
+ }
168
+ // This fix ensures that the credential records which have been loaded here actually do provide the encoded() method
169
+ // this issue arises as the records are loaded and then communicated to the app as a json object, losing the class prototype
170
+ if (resolvedPresentationRequest.presentationExchange) {
171
+ for (const requirementKey in resolvedPresentationRequest.presentationExchange.credentialsForRequest.requirements) {
172
+ const requirement = resolvedPresentationRequest.presentationExchange.credentialsForRequest.requirements[requirementKey];
173
+ for (const submissionEntry of requirement.submissionEntry) {
174
+ for (const vc of submissionEntry.verifiableCredentials) {
175
+ if (vc.claimFormat === core_1.ClaimFormat.SdJwtDc) {
176
+ const recordUncast = vc.credentialRecord;
177
+ const record = new core_1.SdJwtVcRecord({
178
+ id: recordUncast.id,
179
+ createdAt: recordUncast.createdAt,
180
+ compactSdJwtVc: recordUncast.compactSdJwtVc
181
+ });
182
+ vc.credentialRecord = record;
183
+ }
184
+ else if (vc.claimFormat === core_1.ClaimFormat.MsoMdoc) {
185
+ const recordUncast = vc.credentialRecord;
186
+ const record = new core_1.MdocRecord({
187
+ id: recordUncast.id,
188
+ createdAt: recordUncast.createdAt,
189
+ mdoc: core_1.Mdoc.fromBase64Url(recordUncast.base64Url)
190
+ });
191
+ vc.credentialRecord = record;
192
+ }
193
+ else {
194
+ // eslint-disable-next-line no-console
195
+ console.log("Unsupported credential format in demo app, only sd-jwt-vc is supported at the moment");
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ const submissionResult = await this.agent.openid4vc.holder.acceptOpenId4VpAuthorizationRequest({
202
+ authorizationRequestPayload: resolvedPresentationRequest.authorizationRequestPayload,
203
+ presentationExchange: resolvedPresentationRequest.presentationExchange
204
+ ? {
205
+ credentials: this.agent.openid4vc.holder.selectCredentialsForPresentationExchangeRequest(resolvedPresentationRequest.presentationExchange.credentialsForRequest)
206
+ }
207
+ : undefined,
208
+ dcql: resolvedPresentationRequest.dcql
209
+ ? {
210
+ credentials: this.agent.openid4vc.holder.selectCredentialsForDcqlRequest(resolvedPresentationRequest.dcql.queryResult)
211
+ }
212
+ : undefined
213
+ });
214
+ return submissionResult.serverResponse;
215
+ }
216
+ async exit() {
217
+ await this.shutdown();
218
+ process.exit(0);
219
+ }
220
+ async restart() {
221
+ await this.shutdown();
222
+ }
223
+ }
224
+ exports.Holder = Holder;
225
+ //# sourceMappingURL=Holder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Holder.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/Holder.ts"],"names":[],"mappings":";;;AAAA,yCAawB;AACxB,mDAQ6B;AAG7B,2CAAwC;AAGxC,SAAS,sBAAsB;IAC3B,OAAO;QACH,SAAS,EAAE,IAAI,2BAAe,EAAE;QAChC,IAAI,EAAE,IAAI,iBAAU,CAAC;YACjB,qCAAqC,EAAE,CAAC,aAAa,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,EAAE,EAAE;gBACzF,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,qCAA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6BAAM,CAAC;4BACJ,sCAAsC;4BACtC,OAAO,CAAC,GAAG,CAAC,sFAAsF,CAAC,CAAC;wBACxG,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QAED,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,mCAAmC,CAAC;YAC3F,2BAA2B,EAAE,2BAA2B,CAAC,2BAA2B;YACpF,oBAAoB,EAAE,2BAA2B,CAAC,oBAAoB;gBAClE,CAAC,CAAC;oBACI,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,+CAA+C,CACpF,2BAA2B,CAAC,oBAAoB,CAAC,qBAAqB,CACzE;iBACJ;gBACH,CAAC,CAAC,SAAS;YACf,IAAI,EAAE,2BAA2B,CAAC,IAAI;gBAClC,CAAC,CAAC;oBACI,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,+BAA+B,CAAC,2BAA2B,CAAC,IAAI,CAAC,WAAW,CAAC;iBACzH;gBACH,CAAC,CAAC,SAAS;SAClB,CAAC,CAAC;QACH,OAAO,gBAAgB,CAAC,cAAc,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,IAAI;QACb,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAEM,KAAK,CAAC,OAAO;QAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;CACJ;AAtQD,wBAsQC"}
@@ -0,0 +1,3 @@
1
+ import { AgentDependencies } from "@credo-ts/core";
2
+ export declare const agentDependencies: AgentDependencies;
3
+ //# sourceMappingURL=LocalAgentDependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalAgentDependencies.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/LocalAgentDependencies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,iBAAiB,EAAE,iBAK/B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.agentDependencies = void 0;
7
+ const events_1 = require("events");
8
+ const ws_1 = __importDefault(require("ws"));
9
+ const EnmeshedHolderFileSystem_1 = require("./EnmeshedHolderFileSystem");
10
+ const fetchImpl = globalThis.fetch;
11
+ const webSocketImpl = ws_1.default;
12
+ exports.agentDependencies = {
13
+ FileSystem: EnmeshedHolderFileSystem_1.EnmeshedHolderFileSystem,
14
+ EventEmitterClass: events_1.EventEmitter,
15
+ fetch: fetchImpl,
16
+ WebSocketClass: webSocketImpl
17
+ };
18
+ //# sourceMappingURL=LocalAgentDependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalAgentDependencies.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/LocalAgentDependencies.ts"],"names":[],"mappings":";;;;;;AAEA,mCAAsC;AACtC,4CAA2B;AAC3B,yEAAsE;AAEtE,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC;AACnC,MAAM,aAAa,GAAG,YAAS,CAAC;AAEnB,QAAA,iBAAiB,GAAsB;IAChD,UAAU,EAAE,mDAAwB;IACpC,iBAAiB,EAAE,qBAAY;IAC/B,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,aAAa;CAChC,CAAC"}
package/package.json CHANGED
@@ -59,15 +59,22 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
+ "@credo-ts/core": "v0.6.0-alpha-20250919145226",
63
+ "@credo-ts/openid4vc": "v0.6.0-alpha-20250919145226",
62
64
  "@js-soft/docdb-querytranslator": "^1.1.6",
63
65
  "@js-soft/ts-serval": "2.0.14",
64
66
  "@js-soft/ts-utils": "2.3.5",
65
- "@nmshd/content": "7.0.2",
66
- "@nmshd/core-types": "7.0.2",
67
+ "@nmshd/content": "7.1.0-openid4vc.2",
68
+ "@nmshd/core-types": "7.1.0-openid4vc.2",
67
69
  "@nmshd/iql": "^1.0.4",
68
- "@nmshd/transport": "7.0.2",
70
+ "@nmshd/transport": "7.1.0-openid4vc.2",
71
+ "@noble/ciphers": "^0.2.0",
72
+ "jose": "^6.0.13",
73
+ "libsodium-wrappers": "^0.7.15",
69
74
  "lodash": "^4.17.21",
70
- "ts-simple-nameof": "^1.3.3"
75
+ "sjcl": "^1.0.8",
76
+ "ts-simple-nameof": "^1.3.3",
77
+ "ws": "^8.18.3"
71
78
  },
72
79
  "devDependencies": {
73
80
  "@js-soft/docdb-access-loki": "1.3.1",
@@ -75,11 +82,12 @@
75
82
  "@js-soft/node-logger": "1.2.1",
76
83
  "@nmshd/crypto": "2.1.3",
77
84
  "@types/lodash": "^4.17.20",
85
+ "@types/sjcl": "^1.0.34",
78
86
  "ts-mockito": "^2.6.1"
79
87
  },
80
88
  "publishConfig": {
81
89
  "access": "public",
82
90
  "provenance": true
83
91
  },
84
- "version": "7.0.2"
92
+ "version": "7.1.0-openid4vc.2"
85
93
  }