@verana-labs/vs-agent-plugin-chat 2.0.0-dev.8 → 2.0.0-dev.80
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/build/events/ChatEvents.js +0 -32
- package/build/events/ChatEvents.js.map +1 -1
- package/build/events/didcommModuleEvents.d.ts +2 -0
- package/build/events/didcommModuleEvents.js +119 -0
- package/build/events/didcommModuleEvents.js.map +1 -0
- package/build/index.d.ts +12 -2
- package/build/index.js +21 -5
- package/build/index.js.map +1 -1
- package/build/nestjs/ChatPlugin.d.ts +5 -1
- package/build/nestjs/ChatPlugin.js +25 -5
- package/build/nestjs/ChatPlugin.js.map +1 -1
- package/build/nestjs/V2DidcommActionMenuController.d.ts +8 -0
- package/build/nestjs/V2DidcommActionMenuController.js +60 -0
- package/build/nestjs/V2DidcommActionMenuController.js.map +1 -0
- package/build/nestjs/V2DidcommCallsController.d.ts +12 -0
- package/build/nestjs/V2DidcommCallsController.js +116 -0
- package/build/nestjs/V2DidcommCallsController.js.map +1 -0
- package/build/nestjs/V2DidcommMediaSharingController.d.ts +8 -0
- package/build/nestjs/V2DidcommMediaSharingController.js +71 -0
- package/build/nestjs/V2DidcommMediaSharingController.js.map +1 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.d.ts +8 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.js +63 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.js.map +1 -0
- package/build/nestjs/V2DidcommReactionsController.d.ts +8 -0
- package/build/nestjs/V2DidcommReactionsController.js +67 -0
- package/build/nestjs/V2DidcommReactionsController.js.map +1 -0
- package/build/nestjs/V2DidcommReceiptsController.d.ts +8 -0
- package/build/nestjs/V2DidcommReceiptsController.js +66 -0
- package/build/nestjs/V2DidcommReceiptsController.js.map +1 -0
- package/build/nestjs/V2DidcommUserProfileController.d.ts +11 -0
- package/build/nestjs/V2DidcommUserProfileController.js +93 -0
- package/build/nestjs/V2DidcommUserProfileController.js.map +1 -0
- package/build/nestjs/chatModuleApi.d.ts +5 -0
- package/build/nestjs/chatModuleApi.js +11 -0
- package/build/nestjs/chatModuleApi.js.map +1 -0
- package/build/nestjs/defaultProfile.d.ts +4 -0
- package/build/nestjs/defaultProfile.js +5 -0
- package/build/nestjs/defaultProfile.js.map +1 -0
- package/build/nestjs/didcommModules.d.ts +2 -0
- package/build/nestjs/didcommModules.js +13 -0
- package/build/nestjs/didcommModules.js.map +1 -0
- package/build/nestjs/dto/action-menu.dto.d.ts +30 -0
- package/build/nestjs/dto/action-menu.dto.js +147 -0
- package/build/nestjs/dto/action-menu.dto.js.map +1 -0
- package/build/nestjs/dto/calls.dto.d.ts +17 -0
- package/build/nestjs/dto/calls.dto.js +76 -0
- package/build/nestjs/dto/calls.dto.js.map +1 -0
- package/build/nestjs/dto/index.d.ts +8 -0
- package/build/nestjs/dto/index.js +25 -0
- package/build/nestjs/dto/index.js.map +1 -0
- package/build/nestjs/dto/media-sharing.dto.d.ts +20 -0
- package/build/nestjs/dto/media-sharing.dto.js +114 -0
- package/build/nestjs/dto/media-sharing.dto.js.map +1 -0
- package/build/nestjs/dto/question-answer.dto.d.ts +9 -0
- package/build/nestjs/dto/question-answer.dto.js +54 -0
- package/build/nestjs/dto/question-answer.dto.js.map +1 -0
- package/build/nestjs/dto/reactions.dto.d.ts +11 -0
- package/build/nestjs/dto/reactions.dto.js +60 -0
- package/build/nestjs/dto/reactions.dto.js.map +1 -0
- package/build/nestjs/dto/receipts.dto.d.ts +22 -0
- package/build/nestjs/dto/receipts.dto.js +67 -0
- package/build/nestjs/dto/receipts.dto.js.map +1 -0
- package/build/nestjs/dto/sent-message.dto.d.ts +3 -0
- package/build/nestjs/dto/sent-message.dto.js +24 -0
- package/build/nestjs/dto/sent-message.dto.js.map +1 -0
- package/build/nestjs/dto/user-profile.dto.d.ts +22 -0
- package/build/nestjs/dto/user-profile.dto.js +118 -0
- package/build/nestjs/dto/user-profile.dto.js.map +1 -0
- package/build/utils/parsers.d.ts +0 -9
- package/build/utils/parsers.js +0 -24
- package/build/utils/parsers.js.map +1 -1
- package/package.json +12 -8
- package/build/handlers/ChatMessageHandler.d.ts +0 -13
- package/build/handlers/ChatMessageHandler.js +0 -273
- package/build/handlers/ChatMessageHandler.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2DidcommMediaSharingController = void 0;
|
|
16
|
+
const credo_ts_didcomm_media_sharing_1 = require("@2060.io/credo-ts-didcomm-media-sharing");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const dto_1 = require("./dto");
|
|
20
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
21
|
+
let V2DidcommMediaSharingController = class V2DidcommMediaSharingController {
|
|
22
|
+
constructor(vsAgent) {
|
|
23
|
+
this.vsAgent = vsAgent;
|
|
24
|
+
}
|
|
25
|
+
async shareMedia(body) {
|
|
26
|
+
const agent = await this.agent();
|
|
27
|
+
const service = (0, vs_agent_sdk_1.moduleService)(agent, credo_ts_didcomm_media_sharing_1.DidCommMediaSharingService, 'media-sharing');
|
|
28
|
+
const connection = await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
29
|
+
const items = body.items.map(item => new credo_ts_didcomm_media_sharing_1.SharedMediaItem(item));
|
|
30
|
+
const record = await service.createRecord(agent.context, {
|
|
31
|
+
connectionRecord: connection,
|
|
32
|
+
parentThreadId: body.threadId,
|
|
33
|
+
description: body.description,
|
|
34
|
+
items,
|
|
35
|
+
});
|
|
36
|
+
const { message } = await service.createMediaShare(agent.context, {
|
|
37
|
+
record,
|
|
38
|
+
parentThreadId: body.threadId,
|
|
39
|
+
description: body.description,
|
|
40
|
+
items,
|
|
41
|
+
});
|
|
42
|
+
return { id: await (0, vs_agent_sdk_1.sendMessage)(agent, connection, message, record) };
|
|
43
|
+
}
|
|
44
|
+
async agent() {
|
|
45
|
+
if (!this.vsAgent.isInitialized)
|
|
46
|
+
await this.vsAgent.initialize();
|
|
47
|
+
return this.vsAgent;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.V2DidcommMediaSharingController = V2DidcommMediaSharingController;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, common_1.Post)(),
|
|
53
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
54
|
+
(0, swagger_1.ApiOperation)({
|
|
55
|
+
summary: 'Share media',
|
|
56
|
+
description: 'Shares media items on an established connection. The media itself travels out of band.',
|
|
57
|
+
}),
|
|
58
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
59
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
60
|
+
__param(0, (0, common_1.Body)()),
|
|
61
|
+
__metadata("design:type", Function),
|
|
62
|
+
__metadata("design:paramtypes", [dto_1.ShareMediaBodyDto]),
|
|
63
|
+
__metadata("design:returntype", Promise)
|
|
64
|
+
], V2DidcommMediaSharingController.prototype, "shareMedia", null);
|
|
65
|
+
exports.V2DidcommMediaSharingController = V2DidcommMediaSharingController = __decorate([
|
|
66
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
67
|
+
(0, common_1.Controller)({ path: 'didcomm/media-sharing', version: '2' }),
|
|
68
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
69
|
+
__metadata("design:paramtypes", [Function])
|
|
70
|
+
], V2DidcommMediaSharingController);
|
|
71
|
+
//# sourceMappingURL=V2DidcommMediaSharingController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommMediaSharingController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommMediaSharingController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,4FAAqG;AACrG,2CAAyF;AACzF,6CAAgG;AAEhG,+BAAyD;AACzD,4DAAoF;AAI7E,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC1C,YAAuD,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAUhF,AAAN,KAAK,CAAC,UAAU,CAAS,IAAuB;QACrD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,OAAO,GAAG,IAAA,4BAAa,EAAC,KAAK,EAAE,2DAA0B,EAAE,eAAe,CAAC,CAAA;QACjF,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,gDAAe,CAAC,IAAI,CAAC,CAAC,CAAA;QAC/D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE;YACvD,gBAAgB,EAAE,UAAU;YAC5B,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK;SACN,CAAC,CAAA;QACF,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,EAAE;YAChE,MAAM;YACN,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK;SACN,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,MAAM,IAAA,0BAAW,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAA;IACtE,CAAC;IAEO,KAAK,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAChE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF,CAAA;AArCY,0EAA+B;AAW7B;IARZ,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9F,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,wFAAwF;KACtG,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IAC5E,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,uBAAiB;;iEAoBtD;0CA/BU,+BAA+B;IAF3C,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAEtC,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;;GAD1B,+BAA+B,CAqC3C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import { SendQuestionBodyDto, SentMessageDto } from './dto';
|
|
3
|
+
export declare class V2DidcommQuestionAnswerController {
|
|
4
|
+
private readonly vsAgent;
|
|
5
|
+
constructor(vsAgent: VsAgent<BaseAgentModules>);
|
|
6
|
+
sendQuestion(body: SendQuestionBodyDto): Promise<SentMessageDto>;
|
|
7
|
+
private agent;
|
|
8
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2DidcommQuestionAnswerController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const dto_1 = require("./dto");
|
|
19
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
20
|
+
const chatModuleApi_1 = require("./chatModuleApi");
|
|
21
|
+
let V2DidcommQuestionAnswerController = class V2DidcommQuestionAnswerController {
|
|
22
|
+
constructor(vsAgent) {
|
|
23
|
+
this.vsAgent = vsAgent;
|
|
24
|
+
}
|
|
25
|
+
async sendQuestion(body) {
|
|
26
|
+
const agent = await this.agent();
|
|
27
|
+
const api = (0, chatModuleApi_1.chatModuleApi)(agent, 'questionAnswer', 'question-answer');
|
|
28
|
+
await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
29
|
+
const record = await api.sendQuestion(body.connectionId, {
|
|
30
|
+
question: body.question,
|
|
31
|
+
detail: body.detail,
|
|
32
|
+
validResponses: body.validResponses,
|
|
33
|
+
});
|
|
34
|
+
return { id: record.threadId };
|
|
35
|
+
}
|
|
36
|
+
async agent() {
|
|
37
|
+
if (!this.vsAgent.isInitialized)
|
|
38
|
+
await this.vsAgent.initialize();
|
|
39
|
+
return this.vsAgent;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.V2DidcommQuestionAnswerController = V2DidcommQuestionAnswerController;
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, common_1.Post)(),
|
|
45
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
46
|
+
(0, swagger_1.ApiOperation)({
|
|
47
|
+
summary: 'Send a question',
|
|
48
|
+
description: 'Asks the peer a question with a fixed set of answers.',
|
|
49
|
+
}),
|
|
50
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
51
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
52
|
+
__param(0, (0, common_1.Body)()),
|
|
53
|
+
__metadata("design:type", Function),
|
|
54
|
+
__metadata("design:paramtypes", [dto_1.SendQuestionBodyDto]),
|
|
55
|
+
__metadata("design:returntype", Promise)
|
|
56
|
+
], V2DidcommQuestionAnswerController.prototype, "sendQuestion", null);
|
|
57
|
+
exports.V2DidcommQuestionAnswerController = V2DidcommQuestionAnswerController = __decorate([
|
|
58
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
59
|
+
(0, common_1.Controller)({ path: 'didcomm/question-answer', version: '2' }),
|
|
60
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
61
|
+
__metadata("design:paramtypes", [Function])
|
|
62
|
+
], V2DidcommQuestionAnswerController);
|
|
63
|
+
//# sourceMappingURL=V2DidcommQuestionAnswerController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommQuestionAnswerController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommQuestionAnswerController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,2CAAyF;AACzF,6CAAgG;AAEhG,+BAA2D;AAC3D,4DAAwD;AACxD,mDAA+C;AAIxC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC5C,YAAuD,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAUhF,AAAN,KAAK,CAAC,YAAY,CAAS,IAAyB;QACzD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,GAAG,GAAG,IAAA,6BAAa,EAAC,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAA;QACrE,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE5C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE;YACvD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAA;IAChC,CAAC;IAEO,KAAK,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAChE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF,CAAA;AA7BY,8EAAiC;AAW/B;IARZ,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9F,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,iBAAiB;QAC1B,WAAW,EAAE,uDAAuD;KACrE,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IAC1E,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,yBAAmB;;qEAY1D;4CAvBU,iCAAiC;IAF7C,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAExC,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;;GAD1B,iCAAiC,CA6B7C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import { SendReactionsBodyDto, SentMessageDto } from './dto';
|
|
3
|
+
export declare class V2DidcommReactionsController {
|
|
4
|
+
private readonly vsAgent;
|
|
5
|
+
constructor(vsAgent: VsAgent<BaseAgentModules>);
|
|
6
|
+
sendReactions(body: SendReactionsBodyDto): Promise<SentMessageDto>;
|
|
7
|
+
private agent;
|
|
8
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2DidcommReactionsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const dto_1 = require("./dto");
|
|
19
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
20
|
+
const chatModuleApi_1 = require("./chatModuleApi");
|
|
21
|
+
let V2DidcommReactionsController = class V2DidcommReactionsController {
|
|
22
|
+
constructor(vsAgent) {
|
|
23
|
+
this.vsAgent = vsAgent;
|
|
24
|
+
}
|
|
25
|
+
async sendReactions(body) {
|
|
26
|
+
const agent = await this.agent();
|
|
27
|
+
const api = (0, chatModuleApi_1.chatModuleApi)(agent, 'reactions', 'reactions');
|
|
28
|
+
await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
29
|
+
const { messageId } = await api.send({
|
|
30
|
+
connectionId: body.connectionId,
|
|
31
|
+
reactions: body.reactions.map(reaction => ({
|
|
32
|
+
messageId: reaction.messageId,
|
|
33
|
+
emoji: reaction.emoji,
|
|
34
|
+
action: reaction.action,
|
|
35
|
+
timestamp: reaction.timestamp ? new Date(reaction.timestamp) : undefined,
|
|
36
|
+
})),
|
|
37
|
+
});
|
|
38
|
+
return { id: messageId };
|
|
39
|
+
}
|
|
40
|
+
async agent() {
|
|
41
|
+
if (!this.vsAgent.isInitialized)
|
|
42
|
+
await this.vsAgent.initialize();
|
|
43
|
+
return this.vsAgent;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.V2DidcommReactionsController = V2DidcommReactionsController;
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, common_1.Post)(),
|
|
49
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
50
|
+
(0, swagger_1.ApiOperation)({
|
|
51
|
+
summary: 'Send message reactions',
|
|
52
|
+
description: 'Sends emoji reactions to messages on an established connection.',
|
|
53
|
+
}),
|
|
54
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
55
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
56
|
+
__param(0, (0, common_1.Body)()),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [dto_1.SendReactionsBodyDto]),
|
|
59
|
+
__metadata("design:returntype", Promise)
|
|
60
|
+
], V2DidcommReactionsController.prototype, "sendReactions", null);
|
|
61
|
+
exports.V2DidcommReactionsController = V2DidcommReactionsController = __decorate([
|
|
62
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
63
|
+
(0, common_1.Controller)({ path: 'didcomm/reactions', version: '2' }),
|
|
64
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
65
|
+
__metadata("design:paramtypes", [Function])
|
|
66
|
+
], V2DidcommReactionsController);
|
|
67
|
+
//# sourceMappingURL=V2DidcommReactionsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommReactionsController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommReactionsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,2CAAyF;AACzF,6CAAgG;AAEhG,+BAA4D;AAC5D,4DAAwD;AACxD,mDAA+C;AAIxC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAAuD,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAUhF,AAAN,KAAK,CAAC,aAAa,CAAS,IAA0B;QAC3D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,GAAG,GAAG,IAAA,6BAAa,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;QAC1D,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE5C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gBACzC,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK;gBACrB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;aACzE,CAAC,CAAC;SACJ,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,CAAA;IAC1B,CAAC;IAEO,KAAK,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAChE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF,CAAA;AAjCY,oEAA4B;AAW1B;IARZ,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9F,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,wBAAwB;QACjC,WAAW,EAAE,iEAAiE;KAC/E,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IACzE,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,0BAAoB;;iEAgB5D;uCA3BU,4BAA4B;IAFxC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAElC,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;;GAD1B,4BAA4B,CAiCxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import { SendReceiptsBodyDto, SentMessageDto } from './dto';
|
|
3
|
+
export declare class V2DidcommReceiptsController {
|
|
4
|
+
private readonly vsAgent;
|
|
5
|
+
constructor(vsAgent: VsAgent<BaseAgentModules>);
|
|
6
|
+
sendReceipts(body: SendReceiptsBodyDto): Promise<SentMessageDto>;
|
|
7
|
+
private agent;
|
|
8
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2DidcommReceiptsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const dto_1 = require("./dto");
|
|
19
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
20
|
+
const chatModuleApi_1 = require("./chatModuleApi");
|
|
21
|
+
let V2DidcommReceiptsController = class V2DidcommReceiptsController {
|
|
22
|
+
constructor(vsAgent) {
|
|
23
|
+
this.vsAgent = vsAgent;
|
|
24
|
+
}
|
|
25
|
+
async sendReceipts(body) {
|
|
26
|
+
const agent = await this.agent();
|
|
27
|
+
const api = (0, chatModuleApi_1.chatModuleApi)(agent, 'receipts', 'receipts');
|
|
28
|
+
await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
29
|
+
const { messageId } = await api.send({
|
|
30
|
+
connectionId: body.connectionId,
|
|
31
|
+
receipts: body.receipts.map(receipt => ({
|
|
32
|
+
messageId: receipt.messageId,
|
|
33
|
+
state: receipt.state,
|
|
34
|
+
timestamp: receipt.timestamp ? new Date(receipt.timestamp) : undefined,
|
|
35
|
+
})),
|
|
36
|
+
});
|
|
37
|
+
return { id: messageId };
|
|
38
|
+
}
|
|
39
|
+
async agent() {
|
|
40
|
+
if (!this.vsAgent.isInitialized)
|
|
41
|
+
await this.vsAgent.initialize();
|
|
42
|
+
return this.vsAgent;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.V2DidcommReceiptsController = V2DidcommReceiptsController;
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, common_1.Post)(),
|
|
48
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
49
|
+
(0, swagger_1.ApiOperation)({
|
|
50
|
+
summary: 'Send message receipts',
|
|
51
|
+
description: 'Sends message receipts on an established connection.',
|
|
52
|
+
}),
|
|
53
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
54
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
55
|
+
__param(0, (0, common_1.Body)()),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [dto_1.SendReceiptsBodyDto]),
|
|
58
|
+
__metadata("design:returntype", Promise)
|
|
59
|
+
], V2DidcommReceiptsController.prototype, "sendReceipts", null);
|
|
60
|
+
exports.V2DidcommReceiptsController = V2DidcommReceiptsController = __decorate([
|
|
61
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
62
|
+
(0, common_1.Controller)({ path: 'didcomm/receipts', version: '2' }),
|
|
63
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
64
|
+
__metadata("design:paramtypes", [Function])
|
|
65
|
+
], V2DidcommReceiptsController);
|
|
66
|
+
//# sourceMappingURL=V2DidcommReceiptsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommReceiptsController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommReceiptsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,2CAAyF;AACzF,6CAAgG;AAEhG,+BAA2D;AAC3D,4DAAwD;AACxD,mDAA+C;AAIxC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAAuD,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAUhF,AAAN,KAAK,CAAC,YAAY,CAAS,IAAyB;QACzD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,GAAG,GAAG,IAAA,6BAAa,EAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;QACxD,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE5C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC;YACnC,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACtC,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;aACvE,CAAC,CAAC;SACJ,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,CAAA;IAC1B,CAAC;IAEO,KAAK,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAChE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF,CAAA;AAhCY,kEAA2B;AAWzB;IARZ,IAAA,aAAI,GAAE;IACN,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9F,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,sDAAsD;KACpE,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IAC1E,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,yBAAmB;;+DAe1D;sCA1BU,2BAA2B;IAFvC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAEjC,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;;GAD1B,2BAA2B,CAgCvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
2
|
+
import { type DefaultProfile } from './defaultProfile';
|
|
3
|
+
import { RequestProfileBodyDto, SendProfileBodyDto, SentMessageDto } from './dto';
|
|
4
|
+
export declare class V2DidcommUserProfileController {
|
|
5
|
+
private readonly vsAgent;
|
|
6
|
+
private readonly defaultProfile;
|
|
7
|
+
constructor(vsAgent: VsAgent<BaseAgentModules>, defaultProfile: DefaultProfile | undefined);
|
|
8
|
+
sendProfile(body: SendProfileBodyDto): Promise<SentMessageDto>;
|
|
9
|
+
requestProfile(body: RequestProfileBodyDto): Promise<SentMessageDto>;
|
|
10
|
+
private agent;
|
|
11
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.V2DidcommUserProfileController = void 0;
|
|
16
|
+
const credo_ts_didcomm_user_profile_1 = require("@2060.io/credo-ts-didcomm-user-profile");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
19
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
20
|
+
const defaultProfile_1 = require("./defaultProfile");
|
|
21
|
+
const dto_1 = require("./dto");
|
|
22
|
+
let V2DidcommUserProfileController = class V2DidcommUserProfileController {
|
|
23
|
+
constructor(vsAgent, defaultProfile) {
|
|
24
|
+
this.vsAgent = vsAgent;
|
|
25
|
+
this.defaultProfile = defaultProfile;
|
|
26
|
+
}
|
|
27
|
+
async sendProfile(body) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const agent = await this.agent();
|
|
30
|
+
const service = (0, vs_agent_sdk_1.moduleService)(agent, credo_ts_didcomm_user_profile_1.DidCommUserProfileService, 'user-profile');
|
|
31
|
+
const connection = await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
32
|
+
const profile = (_a = body.profile) !== null && _a !== void 0 ? _a : (await ((_b = this.defaultProfile) === null || _b === void 0 ? void 0 : _b.call(this, agent)));
|
|
33
|
+
if (!profile) {
|
|
34
|
+
throw new vs_agent_sdk_1.AdminApiError(vs_agent_sdk_1.AdminApiErrorCode.InvalidState, common_1.HttpStatus.CONFLICT, 'the agent holds no ECS-Service credential to derive a profile from');
|
|
35
|
+
}
|
|
36
|
+
const message = await service.createProfileMessage({
|
|
37
|
+
profile,
|
|
38
|
+
threadId: body.threadId,
|
|
39
|
+
sendBackYours: body.sendBackYours,
|
|
40
|
+
});
|
|
41
|
+
return { id: await (0, vs_agent_sdk_1.sendMessage)(agent, connection, message) };
|
|
42
|
+
}
|
|
43
|
+
async requestProfile(body) {
|
|
44
|
+
const agent = await this.agent();
|
|
45
|
+
const service = (0, vs_agent_sdk_1.moduleService)(agent, credo_ts_didcomm_user_profile_1.DidCommUserProfileService, 'user-profile');
|
|
46
|
+
const connection = await (0, vs_agent_sdk_1.connectionOf)(agent, body.connectionId);
|
|
47
|
+
const message = await service.createRequestProfileMessage({
|
|
48
|
+
query: body.query,
|
|
49
|
+
});
|
|
50
|
+
return { id: await (0, vs_agent_sdk_1.sendMessage)(agent, connection, message) };
|
|
51
|
+
}
|
|
52
|
+
async agent() {
|
|
53
|
+
if (!this.vsAgent.isInitialized)
|
|
54
|
+
await this.vsAgent.initialize();
|
|
55
|
+
return this.vsAgent;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.V2DidcommUserProfileController = V2DidcommUserProfileController;
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, common_1.Post)('send'),
|
|
61
|
+
(0, swagger_1.ApiOperation)({
|
|
62
|
+
summary: 'Send a profile',
|
|
63
|
+
description: 'Sends a profile on an established connection, the stored one when the body omits it.',
|
|
64
|
+
}),
|
|
65
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
66
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
67
|
+
__param(0, (0, common_1.Body)()),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [dto_1.SendProfileBodyDto]),
|
|
70
|
+
__metadata("design:returntype", Promise)
|
|
71
|
+
], V2DidcommUserProfileController.prototype, "sendProfile", null);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, common_1.Post)('request'),
|
|
74
|
+
(0, swagger_1.ApiOperation)({
|
|
75
|
+
summary: 'Request a profile',
|
|
76
|
+
description: 'Asks the peer of a connection for its profile.',
|
|
77
|
+
}),
|
|
78
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
79
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
80
|
+
__param(0, (0, common_1.Body)()),
|
|
81
|
+
__metadata("design:type", Function),
|
|
82
|
+
__metadata("design:paramtypes", [dto_1.RequestProfileBodyDto]),
|
|
83
|
+
__metadata("design:returntype", Promise)
|
|
84
|
+
], V2DidcommUserProfileController.prototype, "requestProfile", null);
|
|
85
|
+
exports.V2DidcommUserProfileController = V2DidcommUserProfileController = __decorate([
|
|
86
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
87
|
+
(0, common_1.Controller)({ path: 'didcomm/user-profile', version: '2' }),
|
|
88
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
89
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
90
|
+
__param(1, (0, common_1.Inject)(defaultProfile_1.DEFAULT_PROFILE)),
|
|
91
|
+
__metadata("design:paramtypes", [Function, Object])
|
|
92
|
+
], V2DidcommUserProfileController);
|
|
93
|
+
//# sourceMappingURL=V2DidcommUserProfileController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommUserProfileController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommUserProfileController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,0FAI+C;AAC/C,2CAAqG;AACrG,6CAAgG;AAEhG,4DAMkC;AAElC,qDAAuE;AACvE,+BAAiF;AAK1E,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACsC,OAAkC,EAC5B,cAA0C;QADhD,YAAO,GAAP,OAAO,CAA2B;QAC5B,mBAAc,GAAd,cAAc,CAA4B;IACnF,CAAC;IASS,AAAN,KAAK,CAAC,WAAW,CAAS,IAAwB;;QACvD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,OAAO,GAAG,IAAA,4BAAa,EAAC,KAAK,EAAE,yDAAyB,EAAE,cAAc,CAAC,CAAA;QAC/E,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,MAAM,OAAO,GACX,MAAC,IAAI,CAAC,OAA8C,mCAAI,CAAC,MAAM,CAAA,MAAA,IAAI,CAAC,cAAc,qDAAG,KAAK,CAAC,CAAA,CAAC,CAAA;QAC9F,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,4BAAa,CACrB,gCAAiB,CAAC,YAAY,EAC9B,mBAAU,CAAC,QAAQ,EACnB,oEAAoE,CACrE,CAAA;QACH,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC;YACjD,OAAO;YACP,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,MAAM,IAAA,0BAAW,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,CAAA;IAC9D,CAAC;IASY,AAAN,KAAK,CAAC,cAAc,CAAS,IAA2B;QAC7D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAChC,MAAM,OAAO,GAAG,IAAA,4BAAa,EAAC,KAAK,EAAE,yDAAyB,EAAE,cAAc,CAAC,CAAA;QAC/E,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAY,EAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAE/D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,2BAA2B,CAAC;YACxD,KAAK,EAAE,IAAI,CAAC,KAA4C;SACzD,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,MAAM,IAAA,0BAAW,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,CAAA;IAC9D,CAAC;IAEO,KAAK,CAAC,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;YAAE,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAA;QAChE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF,CAAA;AA5DY,wEAA8B;AAa5B;IAPZ,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,gBAAgB;QACzB,WAAW,EAAE,sFAAsF;KACpG,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IAC3E,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,wBAAkB;;iEAsBxD;AASY;IAPZ,IAAA,aAAI,EAAC,SAAS,CAAC;IACf,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,mBAAmB;QAC5B,WAAW,EAAE,gDAAgD;KAC9D,CAAC;IACD,IAAA,4BAAkB,EAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAc,EAAE,CAAC;IAC7E,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,8DAA8D,EAAE,CAAC;IACxE,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,2BAAqB;;oEAU9D;yCAtDU,8BAA8B;IAH1C,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAC1D,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAG1F,WAAA,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;IACjB,WAAA,IAAA,eAAM,EAAC,gCAAe,CAAC,CAAA;;GAHf,8BAA8B,CA4D1C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ChatAgentModules } from '../types';
|
|
2
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
type ChatAgent = VsAgent<ChatAgentModules>;
|
|
4
|
+
export declare function chatModuleApi<K extends keyof ChatAgent['modules']>(agent: VsAgent<BaseAgentModules>, key: K, module: string): ChatAgent['modules'][K];
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatModuleApi = chatModuleApi;
|
|
4
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
5
|
+
function chatModuleApi(agent, key, module) {
|
|
6
|
+
const { modules } = agent;
|
|
7
|
+
if (!(key in modules))
|
|
8
|
+
throw (0, vs_agent_sdk_1.moduleNotServed)(module);
|
|
9
|
+
return modules[key];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=chatModuleApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatModuleApi.js","sourceRoot":"","sources":["../../src/nestjs/chatModuleApi.ts"],"names":[],"mappings":";;AAOA,sCAQC;AAZD,4DAA2D;AAI3D,SAAgB,aAAa,CAC3B,KAAgC,EAChC,GAAM,EACN,MAAc;IAEd,MAAM,EAAE,OAAO,EAAE,GAAG,KAA6B,CAAA;IACjD,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC;QAAE,MAAM,IAAA,8BAAe,EAAC,MAAM,CAAC,CAAA;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DidCommUserProfileData } from '@2060.io/credo-ts-didcomm-user-profile';
|
|
2
|
+
import type { BaseAgentModules, VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
export declare const DEFAULT_PROFILE = "CHAT_DEFAULT_PROFILE";
|
|
4
|
+
export type DefaultProfile = (agent: VsAgent<BaseAgentModules>) => Promise<DidCommUserProfileData | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultProfile.js","sourceRoot":"","sources":["../../src/nestjs/defaultProfile.ts"],"names":[],"mappings":";;;AAGa,QAAA,eAAe,GAAG,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHAT_DIDCOMM_MODULES = void 0;
|
|
4
|
+
exports.CHAT_DIDCOMM_MODULES = [
|
|
5
|
+
{ module: 'receipts', prefixes: ['https://didcomm.org/receipts/'] },
|
|
6
|
+
{ module: 'reactions', prefixes: ['https://didcomm.org/reactions/'] },
|
|
7
|
+
{ module: 'user-profile', prefixes: ['https://didcomm.org/user-profile/'] },
|
|
8
|
+
{ module: 'media-sharing', prefixes: ['https://didcomm.org/media-sharing/'] },
|
|
9
|
+
{ module: 'calls', prefixes: ['https://didcomm.org/calls/'] },
|
|
10
|
+
{ module: 'action-menu', prefixes: ['https://didcomm.org/action-menu/'] },
|
|
11
|
+
{ module: 'question-answer', prefixes: ['https://didcomm.org/questionanswer/'] },
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=didcommModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"didcommModules.js","sourceRoot":"","sources":["../../src/nestjs/didcommModules.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAA6B;IAC5D,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,+BAA+B,CAAC,EAAE;IACnE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,gCAAgC,CAAC,EAAE;IACrE,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,OAAO,EAAE,QAAQ,EAAE,CAAC,4BAA4B,CAAC,EAAE;IAC7D,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,kCAAkC,CAAC,EAAE;IACzE,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,qCAAqC,CAAC,EAAE;CACjF,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ActionMenuFormInputType } from '@credo-ts/action-menu';
|
|
2
|
+
export declare class ActionMenuFormParameterDto {
|
|
3
|
+
name: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
default?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
type?: ActionMenuFormInputType;
|
|
9
|
+
}
|
|
10
|
+
export declare class ActionMenuFormDto {
|
|
11
|
+
description: string;
|
|
12
|
+
submitLabel: string;
|
|
13
|
+
params: ActionMenuFormParameterDto[];
|
|
14
|
+
}
|
|
15
|
+
export declare class ActionMenuOptionDto {
|
|
16
|
+
name: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
form?: ActionMenuFormDto;
|
|
21
|
+
}
|
|
22
|
+
export declare class ActionMenuDto {
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
options: ActionMenuOptionDto[];
|
|
26
|
+
}
|
|
27
|
+
export declare class SendMenuBodyDto {
|
|
28
|
+
connectionId: string;
|
|
29
|
+
menu: ActionMenuDto;
|
|
30
|
+
}
|