@ayni.org/vs-agent-plugin-ayni-flow 0.0.0-stage → 0.1.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.
- package/LICENSE +201 -0
- package/README.md +52 -2
- package/build/events/ayniFlowEvents.d.ts +20 -0
- package/build/events/ayniFlowEvents.js +58 -0
- package/build/events/ayniFlowEvents.js.map +1 -0
- package/build/index.d.ts +10 -0
- package/build/index.js +8 -0
- package/build/index.js.map +1 -0
- package/build/nestjs/AyniFlowPlugin.d.ts +21 -0
- package/build/nestjs/AyniFlowPlugin.js +69 -0
- package/build/nestjs/AyniFlowPlugin.js.map +1 -0
- package/build/nestjs/V2DidcommAyniFlowController.d.ts +13 -0
- package/build/nestjs/V2DidcommAyniFlowController.js +134 -0
- package/build/nestjs/V2DidcommAyniFlowController.js.map +1 -0
- package/build/nestjs/V2DidcommCarrierControllers.d.ts +80 -0
- package/build/nestjs/V2DidcommCarrierControllers.js +447 -0
- package/build/nestjs/V2DidcommCarrierControllers.js.map +1 -0
- package/build/nestjs/didcommModules.d.ts +3 -0
- package/build/nestjs/didcommModules.js +12 -0
- package/build/nestjs/didcommModules.js.map +1 -0
- package/build/nestjs/dto/ayni-flow.dto.d.ts +62 -0
- package/build/nestjs/dto/ayni-flow.dto.js +279 -0
- package/build/nestjs/dto/ayni-flow.dto.js.map +1 -0
- package/build/nestjs/dto/carriers.dto.d.ts +154 -0
- package/build/nestjs/dto/carriers.dto.js +587 -0
- package/build/nestjs/dto/carriers.dto.js.map +1 -0
- package/build/nestjs/dto/common.dto.d.ts +39 -0
- package/build/nestjs/dto/common.dto.js +107 -0
- package/build/nestjs/dto/common.dto.js.map +1 -0
- package/build/nestjs/dto/index.d.ts +3 -0
- package/build/nestjs/dto/index.js +4 -0
- package/build/nestjs/dto/index.js.map +1 -0
- package/build/sdk/setupAyniFlowProtocols.d.ts +10 -0
- package/build/sdk/setupAyniFlowProtocols.js +36 -0
- package/build/sdk/setupAyniFlowProtocols.js.map +1 -0
- package/build/types.d.ts +33 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +58 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import type { AyniFlowAgentModules } from '../types.js';
|
|
3
|
+
import { CarrierExchangeDto, FailExchangeBodyDto, GrantSessionBodyDto, RespondAuthorizeBodyDto, RespondConfirmBodyDto, RespondLinkSessionBodyDto, RespondSignTxBodyDto, SendAuthorizeBodyDto, SendConfirmBodyDto, SendLinkSessionBodyDto, SendNotificationBodyDto, SendReissueBodyDto, SendRevocationNotificationBodyDto, SendSessionGrantRequestBodyDto, SendSignTxBodyDto, SentMessageDto, toCarrierExchangeDto } from './dto/index.js';
|
|
4
|
+
interface CarrierApiLike {
|
|
5
|
+
findByThreadId(threadId: string): Promise<CarrierRecordLike | null>;
|
|
6
|
+
findByFlowId(flowId: string): Promise<CarrierRecordLike[]>;
|
|
7
|
+
findAllByQuery(query: Record<string, unknown>): Promise<CarrierRecordLike[]>;
|
|
8
|
+
fail(threadId: string, code: string, description?: string): Promise<CarrierRecordLike>;
|
|
9
|
+
}
|
|
10
|
+
type CarrierRecordLike = Parameters<typeof toCarrierExchangeDto>[0];
|
|
11
|
+
/** The read and fail routes every carrier controller shares. */
|
|
12
|
+
declare abstract class CarrierReadController {
|
|
13
|
+
protected abstract api(): CarrierApiLike;
|
|
14
|
+
list(flowId?: string, connectionId?: string): Promise<CarrierExchangeDto[]>;
|
|
15
|
+
get(threadId: string): Promise<CarrierExchangeDto>;
|
|
16
|
+
fail(threadId: string, body: FailExchangeBodyDto): Promise<CarrierExchangeDto>;
|
|
17
|
+
}
|
|
18
|
+
/** `https://didcomm.org/authorize/1.0` (flow profile §6.5). */
|
|
19
|
+
export declare class V2DidcommAuthorizeController extends CarrierReadController {
|
|
20
|
+
private readonly agent;
|
|
21
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
22
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-authorize").AuthorizeApi;
|
|
23
|
+
request(body: SendAuthorizeBodyDto): Promise<CarrierExchangeDto>;
|
|
24
|
+
respond(threadId: string, body: RespondAuthorizeBodyDto): Promise<CarrierExchangeDto>;
|
|
25
|
+
}
|
|
26
|
+
/** `https://didcomm.org/confirm/1.0` (flow profile §6.6). */
|
|
27
|
+
export declare class V2DidcommConfirmController extends CarrierReadController {
|
|
28
|
+
private readonly agent;
|
|
29
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
30
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-confirm").ConfirmApi;
|
|
31
|
+
request(body: SendConfirmBodyDto): Promise<CarrierExchangeDto>;
|
|
32
|
+
respond(threadId: string, body: RespondConfirmBodyDto): Promise<CarrierExchangeDto>;
|
|
33
|
+
}
|
|
34
|
+
/** `https://didcomm.org/link-session/1.0` (flow profile §6.7). */
|
|
35
|
+
export declare class V2DidcommLinkSessionController extends CarrierReadController {
|
|
36
|
+
private readonly agent;
|
|
37
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
38
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-link-session").LinkSessionApi;
|
|
39
|
+
request(body: SendLinkSessionBodyDto): Promise<CarrierExchangeDto>;
|
|
40
|
+
respond(threadId: string, body: RespondLinkSessionBodyDto): Promise<CarrierExchangeDto>;
|
|
41
|
+
}
|
|
42
|
+
/** `https://didcomm.org/session-grant/1.0` (flow profile §6.8). */
|
|
43
|
+
export declare class V2DidcommSessionGrantController extends CarrierReadController {
|
|
44
|
+
private readonly agent;
|
|
45
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
46
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-session-grant").SessionGrantApi;
|
|
47
|
+
request(body: SendSessionGrantRequestBodyDto): Promise<CarrierExchangeDto>;
|
|
48
|
+
grant(threadId: string, body: GrantSessionBodyDto): Promise<CarrierExchangeDto>;
|
|
49
|
+
}
|
|
50
|
+
/** `https://didcomm.org/sign-tx/1.0` (flow profile §6.9). */
|
|
51
|
+
export declare class V2DidcommSignTxController extends CarrierReadController {
|
|
52
|
+
private readonly agent;
|
|
53
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
54
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-sign-tx").SignTxApi;
|
|
55
|
+
request(body: SendSignTxBodyDto): Promise<CarrierExchangeDto>;
|
|
56
|
+
respond(threadId: string, body: RespondSignTxBodyDto): Promise<CarrierExchangeDto>;
|
|
57
|
+
}
|
|
58
|
+
/** `https://didcomm.org/reissue/1.0` (flow profile §6.11). */
|
|
59
|
+
export declare class V2DidcommReissueController extends CarrierReadController {
|
|
60
|
+
private readonly agent;
|
|
61
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
62
|
+
protected api(): import("@ayni.org/credo-ts-didcomm-reissue").ReissueApi;
|
|
63
|
+
request(body: SendReissueBodyDto): Promise<CarrierExchangeDto>;
|
|
64
|
+
answered(threadId: string): Promise<CarrierExchangeDto>;
|
|
65
|
+
}
|
|
66
|
+
/** `https://didcomm.org/notify/1.0` (flow profile §6.10): one message, no record. */
|
|
67
|
+
export declare class V2DidcommNotifyController {
|
|
68
|
+
private readonly agent;
|
|
69
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
70
|
+
send(body: SendNotificationBodyDto): Promise<SentMessageDto>;
|
|
71
|
+
}
|
|
72
|
+
/** `revocation_notification/2.0/revoke` (flow profile §6.12, CC-VSA-007), through Credo's credentials module. */
|
|
73
|
+
export declare class V2DidcommRevocationNotificationController {
|
|
74
|
+
private readonly agent;
|
|
75
|
+
constructor(agent: VsAgent<AyniFlowAgentModules>);
|
|
76
|
+
send(body: SendRevocationNotificationBodyDto): Promise<{
|
|
77
|
+
sent: true;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Body, Controller, Get, Inject, NotFoundException, Param, Post, Query, UsePipes, ValidationPipe, } from '@nestjs/common';
|
|
14
|
+
import { ApiCreatedResponse, ApiNotFoundResponse, ApiOkResponse, ApiOperation, ApiQuery, ApiTags, } from '@nestjs/swagger';
|
|
15
|
+
import { CarrierExchangeDto, FailExchangeBodyDto, GrantSessionBodyDto, RespondAuthorizeBodyDto, RespondConfirmBodyDto, RespondLinkSessionBodyDto, RespondSignTxBodyDto, SendAuthorizeBodyDto, SendConfirmBodyDto, SendLinkSessionBodyDto, SendNotificationBodyDto, SendReissueBodyDto, SendRevocationNotificationBodyDto, SendSessionGrantRequestBodyDto, SendSignTxBodyDto, SentMessageDto, toCarrierExchangeDto, } from './dto/index.js';
|
|
16
|
+
const PIPE = new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true });
|
|
17
|
+
/** The read and fail routes every carrier controller shares. */
|
|
18
|
+
class CarrierReadController {
|
|
19
|
+
async list(flowId, connectionId) {
|
|
20
|
+
const records = flowId
|
|
21
|
+
? await this.api().findByFlowId(flowId)
|
|
22
|
+
: await this.api().findAllByQuery(connectionId ? { connectionId } : {});
|
|
23
|
+
return records.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime()).map(toCarrierExchangeDto);
|
|
24
|
+
}
|
|
25
|
+
async get(threadId) {
|
|
26
|
+
const record = await this.api().findByThreadId(threadId);
|
|
27
|
+
if (!record)
|
|
28
|
+
throw new NotFoundException(`No exchange ${threadId}`);
|
|
29
|
+
return toCarrierExchangeDto(record);
|
|
30
|
+
}
|
|
31
|
+
async fail(threadId, body) {
|
|
32
|
+
return toCarrierExchangeDto(await this.api().fail(threadId, body.code, body.description));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
Get(),
|
|
37
|
+
ApiOperation({ summary: 'List exchanges', description: 'Exchanges of this protocol; filter by flow or connection.' }),
|
|
38
|
+
ApiQuery({ name: 'flowId', required: false }),
|
|
39
|
+
ApiQuery({ name: 'connectionId', required: false }),
|
|
40
|
+
ApiOkResponse({ type: [CarrierExchangeDto] }),
|
|
41
|
+
__param(0, Query('flowId')),
|
|
42
|
+
__param(1, Query('connectionId')),
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", [String, String]),
|
|
45
|
+
__metadata("design:returntype", Promise)
|
|
46
|
+
], CarrierReadController.prototype, "list", null);
|
|
47
|
+
__decorate([
|
|
48
|
+
Get(':threadId'),
|
|
49
|
+
ApiOperation({ summary: 'Get an exchange by its request id' }),
|
|
50
|
+
ApiOkResponse({ type: CarrierExchangeDto }),
|
|
51
|
+
ApiNotFoundResponse({ description: 'No exchange with the given request id' }),
|
|
52
|
+
__param(0, Param('threadId')),
|
|
53
|
+
__metadata("design:type", Function),
|
|
54
|
+
__metadata("design:paramtypes", [String]),
|
|
55
|
+
__metadata("design:returntype", Promise)
|
|
56
|
+
], CarrierReadController.prototype, "get", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
Post(':threadId/fail'),
|
|
59
|
+
ApiOperation({
|
|
60
|
+
summary: 'Record a failure decided by the controller',
|
|
61
|
+
description: 'The exchange is recorded failed locally; nothing is sent (send the flow problem report through ayni-flow).',
|
|
62
|
+
}),
|
|
63
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
64
|
+
__param(0, Param('threadId')),
|
|
65
|
+
__param(1, Body()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [String, FailExchangeBodyDto]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], CarrierReadController.prototype, "fail", null);
|
|
70
|
+
/** `https://didcomm.org/authorize/1.0` (flow profile §6.5). */
|
|
71
|
+
let V2DidcommAuthorizeController = class V2DidcommAuthorizeController extends CarrierReadController {
|
|
72
|
+
constructor(agent) {
|
|
73
|
+
super();
|
|
74
|
+
this.agent = agent;
|
|
75
|
+
}
|
|
76
|
+
api() {
|
|
77
|
+
return this.agent.modules.authorize;
|
|
78
|
+
}
|
|
79
|
+
async request(body) {
|
|
80
|
+
const record = await this.agent.modules.authorize.request({
|
|
81
|
+
connectionId: body.connectionId,
|
|
82
|
+
parentThreadId: body.flowId,
|
|
83
|
+
request: body.request,
|
|
84
|
+
});
|
|
85
|
+
return toCarrierExchangeDto(record);
|
|
86
|
+
}
|
|
87
|
+
async respond(threadId, body) {
|
|
88
|
+
return toCarrierExchangeDto(await this.agent.modules.authorize.respond({ threadId, response: body.response }));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
__decorate([
|
|
92
|
+
Post(),
|
|
93
|
+
ApiOperation({
|
|
94
|
+
summary: 'Ask for an authorization',
|
|
95
|
+
description: 'Sends authorize/1.0/request: a permission the person grants, or a request an approver decides.',
|
|
96
|
+
}),
|
|
97
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
98
|
+
__param(0, Body()),
|
|
99
|
+
__metadata("design:type", Function),
|
|
100
|
+
__metadata("design:paramtypes", [SendAuthorizeBodyDto]),
|
|
101
|
+
__metadata("design:returntype", Promise)
|
|
102
|
+
], V2DidcommAuthorizeController.prototype, "request", null);
|
|
103
|
+
__decorate([
|
|
104
|
+
Post(':threadId/response'),
|
|
105
|
+
ApiOperation({ summary: 'Answer a received authorization request' }),
|
|
106
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
107
|
+
__param(0, Param('threadId')),
|
|
108
|
+
__param(1, Body()),
|
|
109
|
+
__metadata("design:type", Function),
|
|
110
|
+
__metadata("design:paramtypes", [String, RespondAuthorizeBodyDto]),
|
|
111
|
+
__metadata("design:returntype", Promise)
|
|
112
|
+
], V2DidcommAuthorizeController.prototype, "respond", null);
|
|
113
|
+
V2DidcommAuthorizeController = __decorate([
|
|
114
|
+
ApiTags('v2/didcomm'),
|
|
115
|
+
Controller({ path: 'didcomm/authorize', version: '2' }),
|
|
116
|
+
UsePipes(PIPE),
|
|
117
|
+
__param(0, Inject('VSAGENT')),
|
|
118
|
+
__metadata("design:paramtypes", [Function])
|
|
119
|
+
], V2DidcommAuthorizeController);
|
|
120
|
+
export { V2DidcommAuthorizeController };
|
|
121
|
+
/** `https://didcomm.org/confirm/1.0` (flow profile §6.6). */
|
|
122
|
+
let V2DidcommConfirmController = class V2DidcommConfirmController extends CarrierReadController {
|
|
123
|
+
constructor(agent) {
|
|
124
|
+
super();
|
|
125
|
+
this.agent = agent;
|
|
126
|
+
}
|
|
127
|
+
api() {
|
|
128
|
+
return this.agent.modules.confirm;
|
|
129
|
+
}
|
|
130
|
+
async request(body) {
|
|
131
|
+
const record = await this.agent.modules.confirm.request({
|
|
132
|
+
connectionId: body.connectionId,
|
|
133
|
+
parentThreadId: body.flowId,
|
|
134
|
+
request: body.request,
|
|
135
|
+
});
|
|
136
|
+
return toCarrierExchangeDto(record);
|
|
137
|
+
}
|
|
138
|
+
async respond(threadId, body) {
|
|
139
|
+
return toCarrierExchangeDto(await this.agent.modules.confirm.respond({ threadId, response: body.response }));
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
__decorate([
|
|
143
|
+
Post(),
|
|
144
|
+
ApiOperation({
|
|
145
|
+
summary: 'Ask for a confirmation',
|
|
146
|
+
description: 'Sends confirm/1.0/request: a yes-or-no with a code the service also shows elsewhere.',
|
|
147
|
+
}),
|
|
148
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
149
|
+
__param(0, Body()),
|
|
150
|
+
__metadata("design:type", Function),
|
|
151
|
+
__metadata("design:paramtypes", [SendConfirmBodyDto]),
|
|
152
|
+
__metadata("design:returntype", Promise)
|
|
153
|
+
], V2DidcommConfirmController.prototype, "request", null);
|
|
154
|
+
__decorate([
|
|
155
|
+
Post(':threadId/response'),
|
|
156
|
+
ApiOperation({ summary: 'Answer a received confirmation request' }),
|
|
157
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
158
|
+
__param(0, Param('threadId')),
|
|
159
|
+
__param(1, Body()),
|
|
160
|
+
__metadata("design:type", Function),
|
|
161
|
+
__metadata("design:paramtypes", [String, RespondConfirmBodyDto]),
|
|
162
|
+
__metadata("design:returntype", Promise)
|
|
163
|
+
], V2DidcommConfirmController.prototype, "respond", null);
|
|
164
|
+
V2DidcommConfirmController = __decorate([
|
|
165
|
+
ApiTags('v2/didcomm'),
|
|
166
|
+
Controller({ path: 'didcomm/confirm', version: '2' }),
|
|
167
|
+
UsePipes(PIPE),
|
|
168
|
+
__param(0, Inject('VSAGENT')),
|
|
169
|
+
__metadata("design:paramtypes", [Function])
|
|
170
|
+
], V2DidcommConfirmController);
|
|
171
|
+
export { V2DidcommConfirmController };
|
|
172
|
+
/** `https://didcomm.org/link-session/1.0` (flow profile §6.7). */
|
|
173
|
+
let V2DidcommLinkSessionController = class V2DidcommLinkSessionController extends CarrierReadController {
|
|
174
|
+
constructor(agent) {
|
|
175
|
+
super();
|
|
176
|
+
this.agent = agent;
|
|
177
|
+
}
|
|
178
|
+
api() {
|
|
179
|
+
return this.agent.modules.linkSession;
|
|
180
|
+
}
|
|
181
|
+
async request(body) {
|
|
182
|
+
const record = await this.agent.modules.linkSession.request({
|
|
183
|
+
connectionId: body.connectionId,
|
|
184
|
+
parentThreadId: body.flowId,
|
|
185
|
+
request: { ...body.request, codes: body.request.codes ?? null },
|
|
186
|
+
});
|
|
187
|
+
return toCarrierExchangeDto(record);
|
|
188
|
+
}
|
|
189
|
+
async respond(threadId, body) {
|
|
190
|
+
return toCarrierExchangeDto(await this.agent.modules.linkSession.respond({ threadId, response: body.response }));
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
__decorate([
|
|
194
|
+
Post(),
|
|
195
|
+
ApiOperation({
|
|
196
|
+
summary: 'Ask the holder to link a browser session',
|
|
197
|
+
description: 'Sends link-session/1.0/request with the agent, the browser, the web origin, the start time and the invitation id.',
|
|
198
|
+
}),
|
|
199
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
200
|
+
__param(0, Body()),
|
|
201
|
+
__metadata("design:type", Function),
|
|
202
|
+
__metadata("design:paramtypes", [SendLinkSessionBodyDto]),
|
|
203
|
+
__metadata("design:returntype", Promise)
|
|
204
|
+
], V2DidcommLinkSessionController.prototype, "request", null);
|
|
205
|
+
__decorate([
|
|
206
|
+
Post(':threadId/response'),
|
|
207
|
+
ApiOperation({ summary: 'Answer a received link-session request' }),
|
|
208
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
209
|
+
__param(0, Param('threadId')),
|
|
210
|
+
__param(1, Body()),
|
|
211
|
+
__metadata("design:type", Function),
|
|
212
|
+
__metadata("design:paramtypes", [String, RespondLinkSessionBodyDto]),
|
|
213
|
+
__metadata("design:returntype", Promise)
|
|
214
|
+
], V2DidcommLinkSessionController.prototype, "respond", null);
|
|
215
|
+
V2DidcommLinkSessionController = __decorate([
|
|
216
|
+
ApiTags('v2/didcomm'),
|
|
217
|
+
Controller({ path: 'didcomm/link-session', version: '2' }),
|
|
218
|
+
UsePipes(PIPE),
|
|
219
|
+
__param(0, Inject('VSAGENT')),
|
|
220
|
+
__metadata("design:paramtypes", [Function])
|
|
221
|
+
], V2DidcommLinkSessionController);
|
|
222
|
+
export { V2DidcommLinkSessionController };
|
|
223
|
+
/** `https://didcomm.org/session-grant/1.0` (flow profile §6.8). */
|
|
224
|
+
let V2DidcommSessionGrantController = class V2DidcommSessionGrantController extends CarrierReadController {
|
|
225
|
+
constructor(agent) {
|
|
226
|
+
super();
|
|
227
|
+
this.agent = agent;
|
|
228
|
+
}
|
|
229
|
+
api() {
|
|
230
|
+
return this.agent.modules.sessionGrant;
|
|
231
|
+
}
|
|
232
|
+
async request(body) {
|
|
233
|
+
const record = await this.agent.modules.sessionGrant.request({
|
|
234
|
+
connectionId: body.connectionId,
|
|
235
|
+
parentThreadId: body.flowId,
|
|
236
|
+
request: { ...body.request, conversationId: body.request.conversationId ?? null },
|
|
237
|
+
});
|
|
238
|
+
return toCarrierExchangeDto(record);
|
|
239
|
+
}
|
|
240
|
+
async grant(threadId, body) {
|
|
241
|
+
return toCarrierExchangeDto(await this.agent.modules.sessionGrant.respond({ threadId, response: body.grant }));
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
__decorate([
|
|
245
|
+
Post(),
|
|
246
|
+
ApiOperation({
|
|
247
|
+
summary: 'Ask an agent for a session grant (holder side)',
|
|
248
|
+
description: 'Sends session-grant/1.0/request; a service normally receives these and answers with the grant route.',
|
|
249
|
+
}),
|
|
250
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
251
|
+
__param(0, Body()),
|
|
252
|
+
__metadata("design:type", Function),
|
|
253
|
+
__metadata("design:paramtypes", [SendSessionGrantRequestBodyDto]),
|
|
254
|
+
__metadata("design:returntype", Promise)
|
|
255
|
+
], V2DidcommSessionGrantController.prototype, "request", null);
|
|
256
|
+
__decorate([
|
|
257
|
+
Post(':threadId/grant'),
|
|
258
|
+
ApiOperation({
|
|
259
|
+
summary: 'Answer a session-grant request with the grant',
|
|
260
|
+
description: 'Sends session-grant/1.0/grant: an opaque single-use grant valid for at most sixty seconds and the sessions URL (PROF-SESS-013).',
|
|
261
|
+
}),
|
|
262
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
263
|
+
__param(0, Param('threadId')),
|
|
264
|
+
__param(1, Body()),
|
|
265
|
+
__metadata("design:type", Function),
|
|
266
|
+
__metadata("design:paramtypes", [String, GrantSessionBodyDto]),
|
|
267
|
+
__metadata("design:returntype", Promise)
|
|
268
|
+
], V2DidcommSessionGrantController.prototype, "grant", null);
|
|
269
|
+
V2DidcommSessionGrantController = __decorate([
|
|
270
|
+
ApiTags('v2/didcomm'),
|
|
271
|
+
Controller({ path: 'didcomm/session-grant', version: '2' }),
|
|
272
|
+
UsePipes(PIPE),
|
|
273
|
+
__param(0, Inject('VSAGENT')),
|
|
274
|
+
__metadata("design:paramtypes", [Function])
|
|
275
|
+
], V2DidcommSessionGrantController);
|
|
276
|
+
export { V2DidcommSessionGrantController };
|
|
277
|
+
/** `https://didcomm.org/sign-tx/1.0` (flow profile §6.9). */
|
|
278
|
+
let V2DidcommSignTxController = class V2DidcommSignTxController extends CarrierReadController {
|
|
279
|
+
constructor(agent) {
|
|
280
|
+
super();
|
|
281
|
+
this.agent = agent;
|
|
282
|
+
}
|
|
283
|
+
api() {
|
|
284
|
+
return this.agent.modules.signTx;
|
|
285
|
+
}
|
|
286
|
+
async request(body) {
|
|
287
|
+
const record = await this.agent.modules.signTx.request({
|
|
288
|
+
connectionId: body.connectionId,
|
|
289
|
+
parentThreadId: body.flowId,
|
|
290
|
+
request: body.request,
|
|
291
|
+
});
|
|
292
|
+
return toCarrierExchangeDto(record);
|
|
293
|
+
}
|
|
294
|
+
async respond(threadId, body) {
|
|
295
|
+
return toCarrierExchangeDto(await this.agent.modules.signTx.respond({ threadId, response: body.response }));
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
__decorate([
|
|
299
|
+
Post(),
|
|
300
|
+
ApiOperation({
|
|
301
|
+
summary: 'Ask the holder to sign a transaction',
|
|
302
|
+
description: 'Sends sign-tx/1.0/request with the Cosmos SDK sign document, the summary and who broadcasts.',
|
|
303
|
+
}),
|
|
304
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
305
|
+
__param(0, Body()),
|
|
306
|
+
__metadata("design:type", Function),
|
|
307
|
+
__metadata("design:paramtypes", [SendSignTxBodyDto]),
|
|
308
|
+
__metadata("design:returntype", Promise)
|
|
309
|
+
], V2DidcommSignTxController.prototype, "request", null);
|
|
310
|
+
__decorate([
|
|
311
|
+
Post(':threadId/response'),
|
|
312
|
+
ApiOperation({ summary: 'Answer a received sign-tx request' }),
|
|
313
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
314
|
+
__param(0, Param('threadId')),
|
|
315
|
+
__param(1, Body()),
|
|
316
|
+
__metadata("design:type", Function),
|
|
317
|
+
__metadata("design:paramtypes", [String, RespondSignTxBodyDto]),
|
|
318
|
+
__metadata("design:returntype", Promise)
|
|
319
|
+
], V2DidcommSignTxController.prototype, "respond", null);
|
|
320
|
+
V2DidcommSignTxController = __decorate([
|
|
321
|
+
ApiTags('v2/didcomm'),
|
|
322
|
+
Controller({ path: 'didcomm/sign-tx', version: '2' }),
|
|
323
|
+
UsePipes(PIPE),
|
|
324
|
+
__param(0, Inject('VSAGENT')),
|
|
325
|
+
__metadata("design:paramtypes", [Function])
|
|
326
|
+
], V2DidcommSignTxController);
|
|
327
|
+
export { V2DidcommSignTxController };
|
|
328
|
+
/** `https://didcomm.org/reissue/1.0` (flow profile §6.11). */
|
|
329
|
+
let V2DidcommReissueController = class V2DidcommReissueController extends CarrierReadController {
|
|
330
|
+
constructor(agent) {
|
|
331
|
+
super();
|
|
332
|
+
this.agent = agent;
|
|
333
|
+
}
|
|
334
|
+
api() {
|
|
335
|
+
return this.agent.modules.reissue;
|
|
336
|
+
}
|
|
337
|
+
async request(body) {
|
|
338
|
+
const record = await this.agent.modules.reissue.request({
|
|
339
|
+
connectionId: body.connectionId,
|
|
340
|
+
parentThreadId: body.flowId,
|
|
341
|
+
request: body.request,
|
|
342
|
+
});
|
|
343
|
+
return toCarrierExchangeDto(record);
|
|
344
|
+
}
|
|
345
|
+
async answered(threadId) {
|
|
346
|
+
return toCarrierExchangeDto(await this.agent.modules.reissue.markAnswered(threadId));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
__decorate([
|
|
350
|
+
Post(),
|
|
351
|
+
ApiOperation({ summary: 'Ask an issuer to reissue a credential (holder side)' }),
|
|
352
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
353
|
+
__param(0, Body()),
|
|
354
|
+
__metadata("design:type", Function),
|
|
355
|
+
__metadata("design:paramtypes", [SendReissueBodyDto]),
|
|
356
|
+
__metadata("design:returntype", Promise)
|
|
357
|
+
], V2DidcommReissueController.prototype, "request", null);
|
|
358
|
+
__decorate([
|
|
359
|
+
Post(':threadId/answered'),
|
|
360
|
+
ApiOperation({
|
|
361
|
+
summary: 'Record that a reissue request was answered',
|
|
362
|
+
description: 'By an issue flow or by a problem report sent through ayni-flow; nothing is sent here.',
|
|
363
|
+
}),
|
|
364
|
+
ApiCreatedResponse({ type: CarrierExchangeDto }),
|
|
365
|
+
__param(0, Param('threadId')),
|
|
366
|
+
__metadata("design:type", Function),
|
|
367
|
+
__metadata("design:paramtypes", [String]),
|
|
368
|
+
__metadata("design:returntype", Promise)
|
|
369
|
+
], V2DidcommReissueController.prototype, "answered", null);
|
|
370
|
+
V2DidcommReissueController = __decorate([
|
|
371
|
+
ApiTags('v2/didcomm'),
|
|
372
|
+
Controller({ path: 'didcomm/reissue', version: '2' }),
|
|
373
|
+
UsePipes(PIPE),
|
|
374
|
+
__param(0, Inject('VSAGENT')),
|
|
375
|
+
__metadata("design:paramtypes", [Function])
|
|
376
|
+
], V2DidcommReissueController);
|
|
377
|
+
export { V2DidcommReissueController };
|
|
378
|
+
/** `https://didcomm.org/notify/1.0` (flow profile §6.10): one message, no record. */
|
|
379
|
+
let V2DidcommNotifyController = class V2DidcommNotifyController {
|
|
380
|
+
constructor(agent) {
|
|
381
|
+
this.agent = agent;
|
|
382
|
+
}
|
|
383
|
+
async send(body) {
|
|
384
|
+
const { messageId } = await this.agent.modules.notify.send({
|
|
385
|
+
connectionId: body.connectionId,
|
|
386
|
+
parentThreadId: body.flowId,
|
|
387
|
+
notification: body.notification,
|
|
388
|
+
});
|
|
389
|
+
return { id: messageId };
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
__decorate([
|
|
393
|
+
Post(),
|
|
394
|
+
ApiOperation({
|
|
395
|
+
summary: 'Send a notification',
|
|
396
|
+
description: 'Sends notify/1.0/notification; the holder posts an OS notification and marks the conversation unread. Never for a flow: the flow is its own notification.',
|
|
397
|
+
}),
|
|
398
|
+
ApiCreatedResponse({ type: SentMessageDto }),
|
|
399
|
+
__param(0, Body()),
|
|
400
|
+
__metadata("design:type", Function),
|
|
401
|
+
__metadata("design:paramtypes", [SendNotificationBodyDto]),
|
|
402
|
+
__metadata("design:returntype", Promise)
|
|
403
|
+
], V2DidcommNotifyController.prototype, "send", null);
|
|
404
|
+
V2DidcommNotifyController = __decorate([
|
|
405
|
+
ApiTags('v2/didcomm'),
|
|
406
|
+
Controller({ path: 'didcomm/notify', version: '2' }),
|
|
407
|
+
UsePipes(PIPE),
|
|
408
|
+
__param(0, Inject('VSAGENT')),
|
|
409
|
+
__metadata("design:paramtypes", [Function])
|
|
410
|
+
], V2DidcommNotifyController);
|
|
411
|
+
export { V2DidcommNotifyController };
|
|
412
|
+
/** `revocation_notification/2.0/revoke` (flow profile §6.12, CC-VSA-007), through Credo's credentials module. */
|
|
413
|
+
let V2DidcommRevocationNotificationController = class V2DidcommRevocationNotificationController {
|
|
414
|
+
constructor(agent) {
|
|
415
|
+
this.agent = agent;
|
|
416
|
+
}
|
|
417
|
+
async send(body) {
|
|
418
|
+
await this.agent.didcomm.credentials.sendRevocationNotification({
|
|
419
|
+
connectionId: body.connectionId,
|
|
420
|
+
revocationId: body.revocationId,
|
|
421
|
+
revocationFormat: body.revocationFormat ?? 'anoncreds',
|
|
422
|
+
comment: body.comment,
|
|
423
|
+
});
|
|
424
|
+
return { sent: true };
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
__decorate([
|
|
428
|
+
Post(),
|
|
429
|
+
ApiOperation({
|
|
430
|
+
summary: 'Notify the holder that a credential was revoked',
|
|
431
|
+
description: 'Sends revocation_notification/2.0/revoke with the revocation id and format; the holder marks the card revoked and asks nothing.',
|
|
432
|
+
}),
|
|
433
|
+
ApiCreatedResponse({ description: 'Sent' }),
|
|
434
|
+
__param(0, Body()),
|
|
435
|
+
__metadata("design:type", Function),
|
|
436
|
+
__metadata("design:paramtypes", [SendRevocationNotificationBodyDto]),
|
|
437
|
+
__metadata("design:returntype", Promise)
|
|
438
|
+
], V2DidcommRevocationNotificationController.prototype, "send", null);
|
|
439
|
+
V2DidcommRevocationNotificationController = __decorate([
|
|
440
|
+
ApiTags('v2/didcomm'),
|
|
441
|
+
Controller({ path: 'didcomm/revocation-notification', version: '2' }),
|
|
442
|
+
UsePipes(PIPE),
|
|
443
|
+
__param(0, Inject('VSAGENT')),
|
|
444
|
+
__metadata("design:paramtypes", [Function])
|
|
445
|
+
], V2DidcommRevocationNotificationController);
|
|
446
|
+
export { V2DidcommRevocationNotificationController };
|
|
447
|
+
//# sourceMappingURL=V2DidcommCarrierControllers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommCarrierControllers.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommCarrierControllers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,GAAG,EACH,MAAM,EACN,iBAAiB,EACjB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,OAAO,GACR,MAAM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efixes each module serves, listed by `GET /v2/didcomm/protocols`. */
|
|
2
|
+
export const AYNI_FLOW_DIDCOMM_MODULES = [
|
|
3
|
+
{ module: 'ayni-flow', prefixes: ['https://didcomm.org/ayni-flow/', 'https://didcomm.org/report-problem/'] },
|
|
4
|
+
{ module: 'authorize', prefixes: ['https://didcomm.org/authorize/'] },
|
|
5
|
+
{ module: 'confirm', prefixes: ['https://didcomm.org/confirm/'] },
|
|
6
|
+
{ module: 'link-session', prefixes: ['https://didcomm.org/link-session/'] },
|
|
7
|
+
{ module: 'session-grant', prefixes: ['https://didcomm.org/session-grant/'] },
|
|
8
|
+
{ module: 'sign-tx', prefixes: ['https://didcomm.org/sign-tx/'] },
|
|
9
|
+
{ module: 'notify', prefixes: ['https://didcomm.org/notify/'] },
|
|
10
|
+
{ module: 'reissue', prefixes: ['https://didcomm.org/reissue/'] },
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=didcommModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"didcommModules.js","sourceRoot":"","sources":["../../src/nestjs/didcommModules.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,MAAM,CAAC,MAAM,yBAAyB,GAA6B;IACjE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,gCAAgC,EAAE,qCAAqC,CAAC,EAAE;IAC5G,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,gCAAgC,CAAC,EAAE;IACrE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,8BAA8B,CAAC,EAAE;IACjE,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,mCAAmC,CAAC,EAAE;IAC3E,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,oCAAoC,CAAC,EAAE;IAC7E,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,8BAA8B,CAAC,EAAE;IACjE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,6BAA6B,CAAC,EAAE;IAC/D,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,8BAA8B,CAAC,EAAE;CAClE,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { AyniFlowRecord } from '@ayni.org/credo-ts-didcomm-ayni-flow';
|
|
2
|
+
export declare class FlowClientDto {
|
|
3
|
+
description: string;
|
|
4
|
+
platform: 'web' | 'ios' | 'android';
|
|
5
|
+
}
|
|
6
|
+
export declare class FlowOriginDto {
|
|
7
|
+
channel: 'ag-ui' | 'none';
|
|
8
|
+
agentDid?: string;
|
|
9
|
+
sessionId?: string;
|
|
10
|
+
conversationId?: string;
|
|
11
|
+
client?: FlowClientDto;
|
|
12
|
+
}
|
|
13
|
+
export declare class FlowStepDto {
|
|
14
|
+
id: string;
|
|
15
|
+
kind: string;
|
|
16
|
+
title: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class FlowReferenceDto {
|
|
19
|
+
type: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class OpenFlowBodyDto {
|
|
23
|
+
connectionId: string;
|
|
24
|
+
kind: string;
|
|
25
|
+
title: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
origin: FlowOriginDto;
|
|
28
|
+
expiresTime: string;
|
|
29
|
+
requires?: string[];
|
|
30
|
+
steps?: FlowStepDto[];
|
|
31
|
+
}
|
|
32
|
+
export declare class CloseFlowBodyDto {
|
|
33
|
+
outcome: 'completed' | 'declined' | 'cancelled' | 'failed' | 'expired';
|
|
34
|
+
reason?: string;
|
|
35
|
+
references?: FlowReferenceDto[];
|
|
36
|
+
}
|
|
37
|
+
export declare class FlowProblemReportBodyDto {
|
|
38
|
+
code: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
threadId?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare class FlowDto {
|
|
43
|
+
flowId: string;
|
|
44
|
+
connectionId: string;
|
|
45
|
+
role: string;
|
|
46
|
+
openedByMe: boolean;
|
|
47
|
+
state: string;
|
|
48
|
+
kind: string;
|
|
49
|
+
title: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
origin: FlowOriginDto;
|
|
52
|
+
expiresTime: string;
|
|
53
|
+
requires?: string[];
|
|
54
|
+
steps?: FlowStepDto[];
|
|
55
|
+
reason?: string;
|
|
56
|
+
references?: FlowReferenceDto[];
|
|
57
|
+
errorCode?: string;
|
|
58
|
+
closedAt?: string;
|
|
59
|
+
closedBy?: string;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function toFlowDto(record: AyniFlowRecord): FlowDto;
|