@verana-labs/vs-agent-plugin-openid4vc 1.12.0-oidc4vc.7 → 2.0.0-dev.66

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 (91) hide show
  1. package/README.md +127 -157
  2. package/build/config.d.ts +12 -3
  3. package/build/config.js +115 -237
  4. package/build/config.js.map +1 -1
  5. package/build/index.d.ts +19 -12
  6. package/build/index.js +36 -16
  7. package/build/index.js.map +1 -1
  8. package/build/nestjs/OpenId4VcPlugin.js +18 -43
  9. package/build/nestjs/OpenId4VcPlugin.js.map +1 -1
  10. package/build/nestjs/V2OpenId4VcCredentialExchangesController.d.ts +19 -0
  11. package/build/nestjs/V2OpenId4VcCredentialExchangesController.js +161 -0
  12. package/build/nestjs/V2OpenId4VcCredentialExchangesController.js.map +1 -0
  13. package/build/nestjs/V2OpenId4VcPresentationsController.d.ts +19 -0
  14. package/build/nestjs/V2OpenId4VcPresentationsController.js +147 -0
  15. package/build/nestjs/V2OpenId4VcPresentationsController.js.map +1 -0
  16. package/build/nestjs/V2OpenId4VcSigningCertificatesController.d.ts +17 -0
  17. package/build/nestjs/V2OpenId4VcSigningCertificatesController.js +58 -0
  18. package/build/nestjs/V2OpenId4VcSigningCertificatesController.js.map +1 -0
  19. package/build/nestjs/dto/credential-exchange.dto.d.ts +31 -0
  20. package/build/nestjs/dto/credential-exchange.dto.js +150 -0
  21. package/build/nestjs/dto/credential-exchange.dto.js.map +1 -0
  22. package/build/nestjs/dto/index.d.ts +3 -0
  23. package/build/nestjs/dto/index.js +20 -0
  24. package/build/nestjs/dto/index.js.map +1 -0
  25. package/build/nestjs/dto/presentation.dto.d.ts +56 -0
  26. package/build/nestjs/dto/presentation.dto.js +234 -0
  27. package/build/nestjs/dto/presentation.dto.js.map +1 -0
  28. package/build/nestjs/dto/signing-certificate.dto.d.ts +8 -0
  29. package/build/nestjs/dto/signing-certificate.dto.js +40 -0
  30. package/build/nestjs/dto/signing-certificate.dto.js.map +1 -0
  31. package/build/nestjs/mappers.d.ts +5 -0
  32. package/build/nestjs/mappers.js +31 -0
  33. package/build/nestjs/mappers.js.map +1 -0
  34. package/build/sdk/setupOpenId4Vc.d.ts +8 -12
  35. package/build/sdk/setupOpenId4Vc.js +94 -80
  36. package/build/sdk/setupOpenId4Vc.js.map +1 -1
  37. package/build/services/CertificateService.d.ts +5 -22
  38. package/build/services/CertificateService.js +90 -84
  39. package/build/services/CertificateService.js.map +1 -1
  40. package/build/services/IssuerService.d.ts +31 -44
  41. package/build/services/IssuerService.js +133 -107
  42. package/build/services/IssuerService.js.map +1 -1
  43. package/build/services/VerifierService.d.ts +37 -44
  44. package/build/services/VerifierService.js +150 -226
  45. package/build/services/VerifierService.js.map +1 -1
  46. package/build/services/presentationRequest.d.ts +51 -0
  47. package/build/services/presentationRequest.js +67 -0
  48. package/build/services/presentationRequest.js.map +1 -0
  49. package/build/services/presentationVerification.d.ts +12 -0
  50. package/build/services/presentationVerification.js +13 -0
  51. package/build/services/presentationVerification.js.map +1 -0
  52. package/build/trust/CertificateTrust.d.ts +1 -4
  53. package/build/trust/CertificateTrust.js +10 -15
  54. package/build/trust/CertificateTrust.js.map +1 -1
  55. package/build/trust/keyBinding.d.ts +4 -17
  56. package/build/trust/keyBinding.js +34 -144
  57. package/build/trust/keyBinding.js.map +1 -1
  58. package/build/trust/types.d.ts +5 -16
  59. package/build/trust/types.js +8 -0
  60. package/build/trust/types.js.map +1 -1
  61. package/build/types.d.ts +21 -51
  62. package/build/types.js +3 -0
  63. package/build/types.js.map +1 -1
  64. package/build/utils/isRecord.d.ts +1 -0
  65. package/build/utils/isRecord.js +7 -0
  66. package/build/utils/isRecord.js.map +1 -0
  67. package/build/utils/serviceDisplay.d.ts +8 -0
  68. package/build/utils/serviceDisplay.js +11 -0
  69. package/build/utils/serviceDisplay.js.map +1 -0
  70. package/package.json +10 -8
  71. package/build/nestjs/CertificatesController.d.ts +0 -11
  72. package/build/nestjs/CertificatesController.js +0 -58
  73. package/build/nestjs/CertificatesController.js.map +0 -1
  74. package/build/nestjs/IssuerController.d.ts +0 -8
  75. package/build/nestjs/IssuerController.js +0 -66
  76. package/build/nestjs/IssuerController.js.map +0 -1
  77. package/build/nestjs/VerifierController.d.ts +0 -8
  78. package/build/nestjs/VerifierController.js +0 -66
  79. package/build/nestjs/VerifierController.js.map +0 -1
  80. package/build/nestjs/dto.d.ts +0 -7
  81. package/build/nestjs/dto.js +0 -34
  82. package/build/nestjs/dto.js.map +0 -1
  83. package/build/services/StatusListService.d.ts +0 -42
  84. package/build/services/StatusListService.js +0 -132
  85. package/build/services/StatusListService.js.map +0 -1
  86. package/build/trust/TrustClient.d.ts +0 -12
  87. package/build/trust/TrustClient.js +0 -120
  88. package/build/trust/TrustClient.js.map +0 -1
  89. package/build/trust/verdict.d.ts +0 -2
  90. package/build/trust/verdict.js +0 -13
  91. package/build/trust/verdict.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ "use strict";
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
+ __exportStar(require("./credential-exchange.dto"), exports);
18
+ __exportStar(require("./presentation.dto"), exports);
19
+ __exportStar(require("./signing-certificate.dto"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nestjs/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,qDAAkC;AAClC,4DAAyC"}
@@ -0,0 +1,56 @@
1
+ import type { OpenId4VcQueryLanguage } from '../../services/presentationRequest';
2
+ import type { OpenId4VcRequestSigner } from '../../services/VerifierService';
3
+ import type { TrustVerdictName, VeranaTrustStatus } from '../../trust/types';
4
+ import { OpenId4VcVerificationSessionState } from '@credo-ts/openid4vc';
5
+ import { PaginationQueryDto } from '@verana-labs/vs-agent-sdk';
6
+ /** Request body of [VSA-ADM-OID-PR] createPresentationRequest. */
7
+ export declare class OpenId4VcCreatePresentationRequestBodyDto {
8
+ jsonSchemaCredentialId: string;
9
+ requestedClaims?: string[];
10
+ queryLanguage?: OpenId4VcQueryLanguage;
11
+ requestSigner?: OpenId4VcRequestSigner;
12
+ }
13
+ /** Response of [VSA-ADM-OID-PR] createPresentationRequest. */
14
+ export declare class OpenId4VcPresentationRequestResponseDto {
15
+ proofExchangeId: string;
16
+ url: string;
17
+ }
18
+ /** Query of [VSA-ADM-OID-PR] listPresentations. */
19
+ export declare class OpenId4VcListPresentationsQueryDto extends PaginationQueryDto {
20
+ jsonSchemaCredentialId?: string;
21
+ state?: OpenId4VcVerificationSessionState;
22
+ }
23
+ /** What the agent read from the resolver to reach a trust verdict on a presentation. */
24
+ export declare class OpenId4VcTrustEvidenceDto {
25
+ did: string | null;
26
+ trustStatus: VeranaTrustStatus | null;
27
+ jsonSchemaCredentialId: string | null;
28
+ authorized: boolean | null;
29
+ queries: string[];
30
+ note?: string;
31
+ }
32
+ /** The trust verdict on a presentation, on the record of [VSA-ADM-OID-PR] getPresentation. */
33
+ export declare class OpenId4VcTrustVerdictDto {
34
+ verdict: TrustVerdictName;
35
+ evidence: OpenId4VcTrustEvidenceDto;
36
+ }
37
+ /** The credential a wallet presented, on the record of [VSA-ADM-OID-PR] getPresentation. */
38
+ export declare class OpenId4VcPresentedCredentialDto {
39
+ vct: string;
40
+ disclosedClaims: Record<string, unknown>;
41
+ }
42
+ /** A presentation record, as returned by listPresentations and getPresentation. */
43
+ export declare class OpenId4VcPresentationRecordDto {
44
+ proofExchangeId: string;
45
+ jsonSchemaCredentialId?: string;
46
+ requestedClaims?: string[];
47
+ state: OpenId4VcVerificationSessionState;
48
+ createdAt: Date;
49
+ updatedAt: Date;
50
+ errorMessage?: string;
51
+ cryptographicVerified: boolean;
52
+ accepted: boolean;
53
+ trust?: OpenId4VcTrustVerdictDto;
54
+ credential?: OpenId4VcPresentedCredentialDto;
55
+ }
56
+ export declare const OpenId4VcPresentationRecordPageDto: import("@nestjs/common").Type<import("@verana-labs/vs-agent-sdk").Page<OpenId4VcPresentationRecordDto>>;
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OpenId4VcPresentationRecordPageDto = exports.OpenId4VcPresentationRecordDto = exports.OpenId4VcPresentedCredentialDto = exports.OpenId4VcTrustVerdictDto = exports.OpenId4VcTrustEvidenceDto = exports.OpenId4VcListPresentationsQueryDto = exports.OpenId4VcPresentationRequestResponseDto = exports.OpenId4VcCreatePresentationRequestBodyDto = void 0;
13
+ const openid4vc_1 = require("@credo-ts/openid4vc");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
16
+ const class_validator_1 = require("class-validator");
17
+ const presentationRequest_1 = require("../../services/presentationRequest");
18
+ const VerifierService_1 = require("../../services/VerifierService");
19
+ const types_1 = require("../../trust/types");
20
+ /** Request body of [VSA-ADM-OID-PR] createPresentationRequest. */
21
+ class OpenId4VcCreatePresentationRequestBodyDto {
22
+ }
23
+ exports.OpenId4VcCreatePresentationRequestBodyDto = OpenId4VcCreatePresentationRequestBodyDto;
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({
26
+ description: 'Credential type the request asks for. The agent derives no credential type yet, so every identifier answers UNKNOWN_ID.',
27
+ example: 'employee',
28
+ }),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", String)
32
+ ], OpenId4VcCreatePresentationRequestBodyDto.prototype, "jsonSchemaCredentialId", void 0);
33
+ __decorate([
34
+ (0, swagger_1.ApiPropertyOptional)({
35
+ type: [String],
36
+ description: 'Claim names the request asks the wallet to disclose, without a duplicate. Defaults to every claim of the type.',
37
+ example: ['name', 'role'],
38
+ }),
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsArray)(),
41
+ (0, class_validator_1.IsString)({ each: true }),
42
+ (0, class_validator_1.IsNotEmpty)({ each: true }),
43
+ (0, class_validator_1.ArrayUnique)(),
44
+ __metadata("design:type", Array)
45
+ ], OpenId4VcCreatePresentationRequestBodyDto.prototype, "requestedClaims", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiPropertyOptional)({
48
+ enum: presentationRequest_1.OPENID4VC_QUERY_LANGUAGES,
49
+ description: 'Query language of the request. Defaults to dcql; presentation_exchange serves a wallet that never implemented DCQL.',
50
+ }),
51
+ (0, class_validator_1.IsOptional)(),
52
+ (0, class_validator_1.IsIn)(presentationRequest_1.OPENID4VC_QUERY_LANGUAGES),
53
+ __metadata("design:type", String)
54
+ ], OpenId4VcCreatePresentationRequestBodyDto.prototype, "queryLanguage", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiPropertyOptional)({
57
+ enum: VerifierService_1.OPENID4VC_REQUEST_SIGNERS,
58
+ description: 'Signer of this request only. x5c yields an x509_hash client identifier for a wallet that cannot resolve a DID.',
59
+ }),
60
+ (0, class_validator_1.IsOptional)(),
61
+ (0, class_validator_1.IsIn)(VerifierService_1.OPENID4VC_REQUEST_SIGNERS),
62
+ __metadata("design:type", String)
63
+ ], OpenId4VcCreatePresentationRequestBodyDto.prototype, "requestSigner", void 0);
64
+ /** Response of [VSA-ADM-OID-PR] createPresentationRequest. */
65
+ class OpenId4VcPresentationRequestResponseDto {
66
+ }
67
+ exports.OpenId4VcPresentationRequestResponseDto = OpenId4VcPresentationRequestResponseDto;
68
+ __decorate([
69
+ (0, swagger_1.ApiProperty)({
70
+ description: 'Identifier of the verification session, for later tracking',
71
+ example: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
72
+ }),
73
+ __metadata("design:type", String)
74
+ ], OpenId4VcPresentationRequestResponseDto.prototype, "proofExchangeId", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiProperty)({
77
+ description: 'Authorization request URI, ready to render as a QR code or to send as a link',
78
+ example: 'openid4vp://authorize?request_uri=https%3A%2F%2Fagent.example%2Foid4vp%2Fverifier%2Fauthorization-requests%2F1',
79
+ }),
80
+ __metadata("design:type", String)
81
+ ], OpenId4VcPresentationRequestResponseDto.prototype, "url", void 0);
82
+ /** Query of [VSA-ADM-OID-PR] listPresentations. */
83
+ class OpenId4VcListPresentationsQueryDto extends vs_agent_sdk_1.PaginationQueryDto {
84
+ }
85
+ exports.OpenId4VcListPresentationsQueryDto = OpenId4VcListPresentationsQueryDto;
86
+ __decorate([
87
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Filter by credential type', example: 'employee' }),
88
+ (0, class_validator_1.IsOptional)(),
89
+ (0, class_validator_1.IsString)(),
90
+ (0, class_validator_1.IsNotEmpty)(),
91
+ __metadata("design:type", String)
92
+ ], OpenId4VcListPresentationsQueryDto.prototype, "jsonSchemaCredentialId", void 0);
93
+ __decorate([
94
+ (0, swagger_1.ApiPropertyOptional)({
95
+ enum: openid4vc_1.OpenId4VcVerificationSessionState,
96
+ description: 'Filter by verification session state',
97
+ }),
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsEnum)(openid4vc_1.OpenId4VcVerificationSessionState),
100
+ __metadata("design:type", String)
101
+ ], OpenId4VcListPresentationsQueryDto.prototype, "state", void 0);
102
+ /** What the agent read from the resolver to reach a trust verdict on a presentation. */
103
+ class OpenId4VcTrustEvidenceDto {
104
+ }
105
+ exports.OpenId4VcTrustEvidenceDto = OpenId4VcTrustEvidenceDto;
106
+ __decorate([
107
+ (0, swagger_1.ApiProperty)({ type: String, nullable: true, description: 'DID of the issuer, read from the certificate' }),
108
+ __metadata("design:type", Object)
109
+ ], OpenId4VcTrustEvidenceDto.prototype, "did", void 0);
110
+ __decorate([
111
+ (0, swagger_1.ApiProperty)({
112
+ enum: types_1.VERANA_TRUST_STATUSES,
113
+ nullable: true,
114
+ description: 'Trust status the resolver returned',
115
+ }),
116
+ __metadata("design:type", Object)
117
+ ], OpenId4VcTrustEvidenceDto.prototype, "trustStatus", void 0);
118
+ __decorate([
119
+ (0, swagger_1.ApiProperty)({ type: String, nullable: true, description: 'Credential type of the request' }),
120
+ __metadata("design:type", Object)
121
+ ], OpenId4VcTrustEvidenceDto.prototype, "jsonSchemaCredentialId", void 0);
122
+ __decorate([
123
+ (0, swagger_1.ApiProperty)({
124
+ type: Boolean,
125
+ nullable: true,
126
+ description: 'Whether the resolver authorizes the issuer for the credential type',
127
+ }),
128
+ __metadata("design:type", Object)
129
+ ], OpenId4VcTrustEvidenceDto.prototype, "authorized", void 0);
130
+ __decorate([
131
+ (0, swagger_1.ApiProperty)({ type: [String], description: 'Resolver queries the agent ran' }),
132
+ __metadata("design:type", Array)
133
+ ], OpenId4VcTrustEvidenceDto.prototype, "queries", void 0);
134
+ __decorate([
135
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Why the verdict was not TRUSTED_AUTHORIZED' }),
136
+ __metadata("design:type", String)
137
+ ], OpenId4VcTrustEvidenceDto.prototype, "note", void 0);
138
+ /** The trust verdict on a presentation, on the record of [VSA-ADM-OID-PR] getPresentation. */
139
+ class OpenId4VcTrustVerdictDto {
140
+ }
141
+ exports.OpenId4VcTrustVerdictDto = OpenId4VcTrustVerdictDto;
142
+ __decorate([
143
+ (0, swagger_1.ApiProperty)({ enum: types_1.TRUST_VERDICT_NAMES, description: 'The trust verdict' }),
144
+ __metadata("design:type", String)
145
+ ], OpenId4VcTrustVerdictDto.prototype, "verdict", void 0);
146
+ __decorate([
147
+ (0, swagger_1.ApiProperty)({ type: OpenId4VcTrustEvidenceDto, description: 'The basis of the verdict' }),
148
+ __metadata("design:type", OpenId4VcTrustEvidenceDto)
149
+ ], OpenId4VcTrustVerdictDto.prototype, "evidence", void 0);
150
+ /** The credential a wallet presented, on the record of [VSA-ADM-OID-PR] getPresentation. */
151
+ class OpenId4VcPresentedCredentialDto {
152
+ }
153
+ exports.OpenId4VcPresentedCredentialDto = OpenId4VcPresentedCredentialDto;
154
+ __decorate([
155
+ (0, swagger_1.ApiProperty)({
156
+ description: 'SD-JWT VC type of the presented credential',
157
+ example: 'https://agent.example/oid4vc/vct/employee',
158
+ }),
159
+ __metadata("design:type", String)
160
+ ], OpenId4VcPresentedCredentialDto.prototype, "vct", void 0);
161
+ __decorate([
162
+ (0, swagger_1.ApiProperty)({
163
+ type: 'object',
164
+ additionalProperties: true,
165
+ description: 'The claims the wallet disclosed',
166
+ example: { name: 'Ada Lovelace' },
167
+ }),
168
+ __metadata("design:type", Object)
169
+ ], OpenId4VcPresentedCredentialDto.prototype, "disclosedClaims", void 0);
170
+ /** A presentation record, as returned by listPresentations and getPresentation. */
171
+ class OpenId4VcPresentationRecordDto {
172
+ }
173
+ exports.OpenId4VcPresentationRecordDto = OpenId4VcPresentationRecordDto;
174
+ __decorate([
175
+ (0, swagger_1.ApiProperty)({
176
+ description: 'Identifier of the verification session',
177
+ example: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
178
+ }),
179
+ __metadata("design:type", String)
180
+ ], OpenId4VcPresentationRecordDto.prototype, "proofExchangeId", void 0);
181
+ __decorate([
182
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Credential type of the request', example: 'employee' }),
183
+ __metadata("design:type", String)
184
+ ], OpenId4VcPresentationRecordDto.prototype, "jsonSchemaCredentialId", void 0);
185
+ __decorate([
186
+ (0, swagger_1.ApiPropertyOptional)({
187
+ type: [String],
188
+ description: 'Claim names the request asked for',
189
+ example: ['name', 'role'],
190
+ }),
191
+ __metadata("design:type", Array)
192
+ ], OpenId4VcPresentationRecordDto.prototype, "requestedClaims", void 0);
193
+ __decorate([
194
+ (0, swagger_1.ApiProperty)({ enum: openid4vc_1.OpenId4VcVerificationSessionState, description: 'State of the verification session' }),
195
+ __metadata("design:type", String)
196
+ ], OpenId4VcPresentationRecordDto.prototype, "state", void 0);
197
+ __decorate([
198
+ (0, swagger_1.ApiProperty)({ type: String, format: 'date-time', description: 'When the agent created the request' }),
199
+ __metadata("design:type", Date)
200
+ ], OpenId4VcPresentationRecordDto.prototype, "createdAt", void 0);
201
+ __decorate([
202
+ (0, swagger_1.ApiProperty)({ type: String, format: 'date-time', description: 'When the session last changed' }),
203
+ __metadata("design:type", Date)
204
+ ], OpenId4VcPresentationRecordDto.prototype, "updatedAt", void 0);
205
+ __decorate([
206
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Error message on the session. The agent sets it if the flow stops.' }),
207
+ __metadata("design:type", String)
208
+ ], OpenId4VcPresentationRecordDto.prototype, "errorMessage", void 0);
209
+ __decorate([
210
+ (0, swagger_1.ApiProperty)({
211
+ description: 'True once the agent verified the response, the holder binding, the signature and the chain',
212
+ }),
213
+ __metadata("design:type", Boolean)
214
+ ], OpenId4VcPresentationRecordDto.prototype, "cryptographicVerified", void 0);
215
+ __decorate([
216
+ (0, swagger_1.ApiProperty)({ description: 'True only for the verdict TRUSTED_AUTHORIZED' }),
217
+ __metadata("design:type", Boolean)
218
+ ], OpenId4VcPresentationRecordDto.prototype, "accepted", void 0);
219
+ __decorate([
220
+ (0, swagger_1.ApiPropertyOptional)({
221
+ type: OpenId4VcTrustVerdictDto,
222
+ description: 'The trust verdict, once the agent verified the response',
223
+ }),
224
+ __metadata("design:type", OpenId4VcTrustVerdictDto)
225
+ ], OpenId4VcPresentationRecordDto.prototype, "trust", void 0);
226
+ __decorate([
227
+ (0, swagger_1.ApiPropertyOptional)({
228
+ type: OpenId4VcPresentedCredentialDto,
229
+ description: 'The presented credential, once verified',
230
+ }),
231
+ __metadata("design:type", OpenId4VcPresentedCredentialDto)
232
+ ], OpenId4VcPresentationRecordDto.prototype, "credential", void 0);
233
+ exports.OpenId4VcPresentationRecordPageDto = (0, vs_agent_sdk_1.PageDto)(OpenId4VcPresentationRecordDto);
234
+ //# sourceMappingURL=presentation.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/presentation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,mDAAuE;AACvE,6CAAkE;AAClE,4DAAuE;AACvE,qDAAsG;AAEtG,4EAA8E;AAC9E,oEAA0E;AAC1E,6CAA8E;AAE9E,kEAAkE;AAClE,MAAa,yCAAyC;CAwCrD;AAxCD,8FAwCC;AAhCC;IAPC,IAAA,qBAAW,EAAC;QACX,WAAW,EACT,yHAAyH;QAC3H,OAAO,EAAE,UAAU;KACpB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yFACkB;AAa/B;IAXC,IAAA,6BAAmB,EAAC;QACnB,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,WAAW,EACT,gHAAgH;QAClH,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KAC1B,CAAC;IACD,IAAA,4BAAU,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B;QAC9B,WAAW,EAAE,yDAAyD;KACvE,CAAC;8BACM,wBAAwB;6DAAA;AAMhC;IAJC,IAAA,6BAAmB,EAAC;QACnB,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,yCAAyC;KACvD,CAAC;8BACW,+BAA+B;kEAAA;AAGjC,QAAA,kCAAkC,GAAG,IAAA,sBAAO,EAAC,8BAA8B,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { SigningRole } from '../../services/CertificateService';
2
+ /** One entry of [VSA-ADM-OID-CS] listSigningCertificates. */
3
+ export declare class OpenId4VcSigningCertificateDto {
4
+ role: SigningRole;
5
+ development: boolean;
6
+ fingerprint: string;
7
+ certificateChain: string[];
8
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OpenId4VcSigningCertificateDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ /** One entry of [VSA-ADM-OID-CS] listSigningCertificates. */
15
+ class OpenId4VcSigningCertificateDto {
16
+ }
17
+ exports.OpenId4VcSigningCertificateDto = OpenId4VcSigningCertificateDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiProperty)({
20
+ enum: ['issuer', 'verifier'],
21
+ description: 'The capability that signs with this certificate',
22
+ }),
23
+ __metadata("design:type", String)
24
+ ], OpenId4VcSigningCertificateDto.prototype, "role", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({ description: 'True when the agent generated the certificate itself (development signing)' }),
27
+ __metadata("design:type", Boolean)
28
+ ], OpenId4VcSigningCertificateDto.prototype, "development", void 0);
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({
31
+ description: 'SHA-256 fingerprint of the leaf, for an operator to pin it on a peer verifier',
32
+ example: `SHA256:${'0'.repeat(64)}`,
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], OpenId4VcSigningCertificateDto.prototype, "fingerprint", void 0);
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({ type: [String], description: 'Certificate chain, base64 DER, leaf first' }),
38
+ __metadata("design:type", Array)
39
+ ], OpenId4VcSigningCertificateDto.prototype, "certificateChain", void 0);
40
+ //# sourceMappingURL=signing-certificate.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signing-certificate.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/signing-certificate.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6CAA6C;AAE7C,6DAA6D;AAC7D,MAAa,8BAA8B;CAkB1C;AAlBD,wEAkBC;AAbC;IAJC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;QAC5B,WAAW,EAAE,iDAAiD;KAC/D,CAAC;;4DACgB;AAGlB;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE,CAAC;;mEACtF;AAMrB;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,+EAA+E;QAC5F,OAAO,EAAE,UAAU,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;KACpC,CAAC;;mEACkB;AAGpB;IADC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;;wEAC/D"}
@@ -0,0 +1,5 @@
1
+ import type { OpenId4VcIssuanceSessionSummary } from '../services/IssuerService';
2
+ import type { OpenId4VcVerificationSessionSummary } from '../services/VerifierService';
3
+ import { OpenId4VcCredentialExchangeRecordDto, OpenId4VcPresentationRecordDto } from './dto';
4
+ export declare function toCredentialExchangeDto(session: OpenId4VcIssuanceSessionSummary): OpenId4VcCredentialExchangeRecordDto;
5
+ export declare function toPresentationDto(session: OpenId4VcVerificationSessionSummary): OpenId4VcPresentationRecordDto;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCredentialExchangeDto = toCredentialExchangeDto;
4
+ exports.toPresentationDto = toPresentationDto;
5
+ function toCredentialExchangeDto(session) {
6
+ return {
7
+ credentialExchangeId: session.id,
8
+ jsonSchemaCredentialId: session.jsonSchemaCredentialId,
9
+ state: session.state,
10
+ createdAt: session.createdAt,
11
+ updatedAt: session.updatedAt,
12
+ expiresAt: session.expiresAt,
13
+ errorMessage: session.errorMessage,
14
+ };
15
+ }
16
+ function toPresentationDto(session) {
17
+ return {
18
+ proofExchangeId: session.id,
19
+ jsonSchemaCredentialId: session.jsonSchemaCredentialId,
20
+ requestedClaims: session.requestedClaims,
21
+ state: session.state,
22
+ createdAt: session.createdAt,
23
+ updatedAt: session.updatedAt,
24
+ errorMessage: session.errorMessage,
25
+ cryptographicVerified: session.cryptographicVerified,
26
+ accepted: session.accepted,
27
+ trust: session.trust,
28
+ credential: session.credential,
29
+ };
30
+ }
31
+ //# sourceMappingURL=mappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/nestjs/mappers.ts"],"names":[],"mappings":";;AAKA,0DAYC;AAED,8CAgBC;AA9BD,SAAgB,uBAAuB,CACrC,OAAwC;IAExC,OAAO;QACL,oBAAoB,EAAE,OAAO,CAAC,EAAE;QAChC,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;QACtD,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;KACnC,CAAA;AACH,CAAC;AAED,SAAgB,iBAAiB,CAC/B,OAA4C;IAE5C,OAAO;QACL,eAAe,EAAE,OAAO,CAAC,EAAE;QAC3B,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;QACtD,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;QACpD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAA;AACH,CAAC"}
@@ -1,18 +1,14 @@
1
- import type { OpenId4VcPluginOptions } from '../types';
2
- import { X509Module } from '@credo-ts/core';
3
- import { OpenId4VcModule, type OpenId4VciCredentialRequestToCredentialMapper } from '@credo-ts/openid4vc';
4
- import { type Express } from 'express';
1
+ import type { OpenId4VcCredentialConfiguration, OpenId4VcPluginOptions, OpenId4VcVsAgentModules } from '../types';
2
+ import { type OpenId4VciCredentialRequestToCredentialMapper } from '@credo-ts/openid4vc';
3
+ import { type Express, type NextFunction, type Request, type Response } from 'express';
5
4
  export interface OpenId4VcIssuerRequestMapper {
6
5
  mapCredentialRequest: OpenId4VciCredentialRequestToCredentialMapper;
7
- getVctMetadata: (configurationId: string) => Record<string, unknown> | undefined;
8
- }
9
- export interface OpenId4VcAgentModules {
10
- [key: string]: unknown;
11
- openId4Vc: OpenId4VcModule<null, null>;
12
- x509: X509Module;
6
+ getJwtVcIssuerMetadata: () => Record<string, unknown>;
13
7
  }
14
8
  export interface OpenId4VcSdkPlugin {
15
- modules: OpenId4VcAgentModules;
9
+ modules: Pick<OpenId4VcVsAgentModules, 'openId4Vc' | 'x509'>;
16
10
  publicMiddleware: Express;
17
11
  }
18
- export declare function setupOpenId4Vc(options: OpenId4VcPluginOptions, getIssuerService?: () => OpenId4VcIssuerRequestMapper): OpenId4VcSdkPlugin;
12
+ export declare function setupOpenId4Vc(options: OpenId4VcPluginOptions, getIssuerService: () => OpenId4VcIssuerRequestMapper): OpenId4VcSdkPlugin;
13
+ export declare function acceptDraftCredentialRequests(configurations: OpenId4VcCredentialConfiguration[]): (request: Request, _response: Response, next: NextFunction) => void;
14
+ export declare function accommodateLegacyMetadataAccept(request: Request, _response: Response, next: NextFunction): void;