@verana-labs/vs-agent-plugin-chat 2.0.0-dev.9 → 2.0.0-dev.91
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 +52 -0
- package/build/nestjs/V2DidcommActionMenuController.js.map +1 -0
- package/build/nestjs/V2DidcommCallsController.d.ts +12 -0
- package/build/nestjs/V2DidcommCallsController.js +108 -0
- package/build/nestjs/V2DidcommCallsController.js.map +1 -0
- package/build/nestjs/V2DidcommMediaSharingController.d.ts +8 -0
- package/build/nestjs/V2DidcommMediaSharingController.js +64 -0
- package/build/nestjs/V2DidcommMediaSharingController.js.map +1 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.d.ts +8 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.js +55 -0
- package/build/nestjs/V2DidcommQuestionAnswerController.js.map +1 -0
- package/build/nestjs/V2DidcommReactionsController.d.ts +8 -0
- package/build/nestjs/V2DidcommReactionsController.js +59 -0
- package/build/nestjs/V2DidcommReactionsController.js.map +1 -0
- package/build/nestjs/V2DidcommReceiptsController.d.ts +8 -0
- package/build/nestjs/V2DidcommReceiptsController.js +58 -0
- package/build/nestjs/V2DidcommReceiptsController.js.map +1 -0
- package/build/nestjs/V2DidcommUserProfileController.d.ts +11 -0
- package/build/nestjs/V2DidcommUserProfileController.js +85 -0
- package/build/nestjs/V2DidcommUserProfileController.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 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommMediaSharingController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommMediaSharingController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,4FAAyE;AACzE,2CAAyF;AACzF,6CAAgG;AAEhG,+BAAyD;AACzD,4DAAwD;AAIjD,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC1C,YAAuD,KAAgC;QAAhC,UAAK,GAAL,KAAK,CAA2B;IAAG,CAAC;IAU9E,AAAN,KAAK,CAAC,UAAU,CAAS,IAAuB;QACrD,MAAM,IAAA,2BAAY,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAEjD,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,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;YACnD,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK;SACN,CAAC,CAAA;QACF,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC;YACtE,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK;SACN,CAAC,CAAA;QAEF,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AA9BY,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;;iEAkBtD;0CA7BU,+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,CA8B3C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatAgentModules } from '../types';
|
|
2
|
+
import type { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
import { SendQuestionBodyDto, SentMessageDto } from './dto';
|
|
4
|
+
export declare class V2DidcommQuestionAnswerController {
|
|
5
|
+
private readonly agent;
|
|
6
|
+
constructor(agent: VsAgent<ChatAgentModules>);
|
|
7
|
+
sendQuestion(body: SendQuestionBodyDto): Promise<SentMessageDto>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
let V2DidcommQuestionAnswerController = class V2DidcommQuestionAnswerController {
|
|
21
|
+
constructor(agent) {
|
|
22
|
+
this.agent = agent;
|
|
23
|
+
}
|
|
24
|
+
async sendQuestion(body) {
|
|
25
|
+
await (0, vs_agent_sdk_1.connectionOf)(this.agent, body.connectionId);
|
|
26
|
+
const record = await this.agent.modules.questionAnswer.sendQuestion(body.connectionId, {
|
|
27
|
+
question: body.question,
|
|
28
|
+
detail: body.detail,
|
|
29
|
+
validResponses: body.validResponses,
|
|
30
|
+
});
|
|
31
|
+
return { id: record.threadId };
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
exports.V2DidcommQuestionAnswerController = V2DidcommQuestionAnswerController;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, common_1.Post)(),
|
|
37
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
38
|
+
(0, swagger_1.ApiOperation)({
|
|
39
|
+
summary: 'Send a question',
|
|
40
|
+
description: 'Asks the peer a question with a fixed set of answers.',
|
|
41
|
+
}),
|
|
42
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
43
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
44
|
+
__param(0, (0, common_1.Body)()),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", [dto_1.SendQuestionBodyDto]),
|
|
47
|
+
__metadata("design:returntype", Promise)
|
|
48
|
+
], V2DidcommQuestionAnswerController.prototype, "sendQuestion", null);
|
|
49
|
+
exports.V2DidcommQuestionAnswerController = V2DidcommQuestionAnswerController = __decorate([
|
|
50
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
51
|
+
(0, common_1.Controller)({ path: 'didcomm/question-answer', version: '2' }),
|
|
52
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
53
|
+
__metadata("design:paramtypes", [Function])
|
|
54
|
+
], V2DidcommQuestionAnswerController);
|
|
55
|
+
//# sourceMappingURL=V2DidcommQuestionAnswerController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommQuestionAnswerController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommQuestionAnswerController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,2CAAyF;AACzF,6CAAgG;AAEhG,+BAA2D;AAC3D,4DAAwD;AAIjD,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAC5C,YAAuD,KAAgC;QAAhC,UAAK,GAAL,KAAK,CAA2B;IAAG,CAAC;IAU9E,AAAN,KAAK,CAAC,YAAY,CAAS,IAAyB;QACzD,MAAM,IAAA,2BAAY,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAEjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,EAAE;YACrF,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;CACF,CAAA;AAtBY,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;;qEAU1D;4CArBU,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,CAsB7C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatAgentModules } from '../types';
|
|
2
|
+
import type { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
import { SendReactionsBodyDto, SentMessageDto } from './dto';
|
|
4
|
+
export declare class V2DidcommReactionsController {
|
|
5
|
+
private readonly agent;
|
|
6
|
+
constructor(agent: VsAgent<ChatAgentModules>);
|
|
7
|
+
sendReactions(body: SendReactionsBodyDto): Promise<SentMessageDto>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
let V2DidcommReactionsController = class V2DidcommReactionsController {
|
|
21
|
+
constructor(agent) {
|
|
22
|
+
this.agent = agent;
|
|
23
|
+
}
|
|
24
|
+
async sendReactions(body) {
|
|
25
|
+
await (0, vs_agent_sdk_1.connectionOf)(this.agent, body.connectionId);
|
|
26
|
+
const { messageId } = await this.agent.modules.reactions.send({
|
|
27
|
+
connectionId: body.connectionId,
|
|
28
|
+
reactions: body.reactions.map(reaction => ({
|
|
29
|
+
messageId: reaction.messageId,
|
|
30
|
+
emoji: reaction.emoji,
|
|
31
|
+
action: reaction.action,
|
|
32
|
+
timestamp: reaction.timestamp ? new Date(reaction.timestamp) : undefined,
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
return { id: messageId };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
exports.V2DidcommReactionsController = V2DidcommReactionsController;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, common_1.Post)(),
|
|
41
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
42
|
+
(0, swagger_1.ApiOperation)({
|
|
43
|
+
summary: 'Send message reactions',
|
|
44
|
+
description: 'Sends emoji reactions to messages on an established connection.',
|
|
45
|
+
}),
|
|
46
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
47
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
48
|
+
__param(0, (0, common_1.Body)()),
|
|
49
|
+
__metadata("design:type", Function),
|
|
50
|
+
__metadata("design:paramtypes", [dto_1.SendReactionsBodyDto]),
|
|
51
|
+
__metadata("design:returntype", Promise)
|
|
52
|
+
], V2DidcommReactionsController.prototype, "sendReactions", null);
|
|
53
|
+
exports.V2DidcommReactionsController = V2DidcommReactionsController = __decorate([
|
|
54
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
55
|
+
(0, common_1.Controller)({ path: 'didcomm/reactions', version: '2' }),
|
|
56
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
57
|
+
__metadata("design:paramtypes", [Function])
|
|
58
|
+
], V2DidcommReactionsController);
|
|
59
|
+
//# sourceMappingURL=V2DidcommReactionsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommReactionsController.js","sourceRoot":"","sources":["../../src/n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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;;iEAc5D;uCAzBU,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,CA0BxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatAgentModules } from '../types';
|
|
2
|
+
import type { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
import { SendReceiptsBodyDto, SentMessageDto } from './dto';
|
|
4
|
+
export declare class V2DidcommReceiptsController {
|
|
5
|
+
private readonly agent;
|
|
6
|
+
constructor(agent: VsAgent<ChatAgentModules>);
|
|
7
|
+
sendReceipts(body: SendReceiptsBodyDto): Promise<SentMessageDto>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
let V2DidcommReceiptsController = class V2DidcommReceiptsController {
|
|
21
|
+
constructor(agent) {
|
|
22
|
+
this.agent = agent;
|
|
23
|
+
}
|
|
24
|
+
async sendReceipts(body) {
|
|
25
|
+
await (0, vs_agent_sdk_1.connectionOf)(this.agent, body.connectionId);
|
|
26
|
+
const { messageId } = await this.agent.modules.receipts.send({
|
|
27
|
+
connectionId: body.connectionId,
|
|
28
|
+
receipts: body.receipts.map(receipt => ({
|
|
29
|
+
messageId: receipt.messageId,
|
|
30
|
+
state: receipt.state,
|
|
31
|
+
timestamp: receipt.timestamp ? new Date(receipt.timestamp) : undefined,
|
|
32
|
+
})),
|
|
33
|
+
});
|
|
34
|
+
return { id: messageId };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.V2DidcommReceiptsController = V2DidcommReceiptsController;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, common_1.Post)(),
|
|
40
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
41
|
+
(0, swagger_1.ApiOperation)({
|
|
42
|
+
summary: 'Send message receipts',
|
|
43
|
+
description: 'Sends message receipts on an established connection.',
|
|
44
|
+
}),
|
|
45
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
46
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
47
|
+
__param(0, (0, common_1.Body)()),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", [dto_1.SendReceiptsBodyDto]),
|
|
50
|
+
__metadata("design:returntype", Promise)
|
|
51
|
+
], V2DidcommReceiptsController.prototype, "sendReceipts", null);
|
|
52
|
+
exports.V2DidcommReceiptsController = V2DidcommReceiptsController = __decorate([
|
|
53
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
54
|
+
(0, common_1.Controller)({ path: 'didcomm/receipts', version: '2' }),
|
|
55
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
56
|
+
__metadata("design:paramtypes", [Function])
|
|
57
|
+
], V2DidcommReceiptsController);
|
|
58
|
+
//# sourceMappingURL=V2DidcommReceiptsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommReceiptsController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommReceiptsController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,2CAAyF;AACzF,6CAAgG;AAEhG,+BAA2D;AAC3D,4DAAwD;AAIjD,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAAuD,KAAgC;QAAhC,UAAK,GAAL,KAAK,CAA2B;IAAG,CAAC;IAU9E,AAAN,KAAK,CAAC,YAAY,CAAS,IAAyB;QACzD,MAAM,IAAA,2BAAY,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAEjD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC3D,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;CACF,CAAA;AAzBY,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;;+DAa1D;sCAxBU,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,CAyBvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChatAgentModules } from '../types';
|
|
2
|
+
import type { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
3
|
+
import { type DefaultProfile } from './defaultProfile';
|
|
4
|
+
import { RequestProfileBodyDto, SendProfileBodyDto, SentMessageDto } from './dto';
|
|
5
|
+
export declare class V2DidcommUserProfileController {
|
|
6
|
+
private readonly agent;
|
|
7
|
+
private readonly defaultProfile;
|
|
8
|
+
constructor(agent: VsAgent<ChatAgentModules>, defaultProfile: DefaultProfile | undefined);
|
|
9
|
+
sendProfile(body: SendProfileBodyDto): Promise<SentMessageDto>;
|
|
10
|
+
requestProfile(body: RequestProfileBodyDto): Promise<SentMessageDto>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const vs_agent_sdk_1 = require("@verana-labs/vs-agent-sdk");
|
|
19
|
+
const defaultProfile_1 = require("./defaultProfile");
|
|
20
|
+
const dto_1 = require("./dto");
|
|
21
|
+
let V2DidcommUserProfileController = class V2DidcommUserProfileController {
|
|
22
|
+
constructor(agent, defaultProfile) {
|
|
23
|
+
this.agent = agent;
|
|
24
|
+
this.defaultProfile = defaultProfile;
|
|
25
|
+
}
|
|
26
|
+
async sendProfile(body) {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
await (0, vs_agent_sdk_1.connectionOf)(this.agent, body.connectionId);
|
|
29
|
+
const profile = (_a = body.profile) !== null && _a !== void 0 ? _a : (await ((_b = this.defaultProfile) === null || _b === void 0 ? void 0 : _b.call(this, this.agent)));
|
|
30
|
+
if (!profile) {
|
|
31
|
+
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');
|
|
32
|
+
}
|
|
33
|
+
const { messageId } = await this.agent.modules.userProfile.sendUserProfile({
|
|
34
|
+
connectionId: body.connectionId,
|
|
35
|
+
profileData: profile,
|
|
36
|
+
threadId: body.threadId,
|
|
37
|
+
sendBackYours: body.sendBackYours,
|
|
38
|
+
});
|
|
39
|
+
return { id: messageId };
|
|
40
|
+
}
|
|
41
|
+
async requestProfile(body) {
|
|
42
|
+
await (0, vs_agent_sdk_1.connectionOf)(this.agent, body.connectionId);
|
|
43
|
+
const { messageId } = await this.agent.modules.userProfile.requestUserProfile({
|
|
44
|
+
connectionId: body.connectionId,
|
|
45
|
+
query: body.query,
|
|
46
|
+
});
|
|
47
|
+
return { id: messageId };
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.V2DidcommUserProfileController = V2DidcommUserProfileController;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, common_1.Post)('send'),
|
|
53
|
+
(0, swagger_1.ApiOperation)({
|
|
54
|
+
summary: 'Send a profile',
|
|
55
|
+
description: 'Sends a profile on an established connection, the stored one when the body omits it.',
|
|
56
|
+
}),
|
|
57
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
58
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
59
|
+
__param(0, (0, common_1.Body)()),
|
|
60
|
+
__metadata("design:type", Function),
|
|
61
|
+
__metadata("design:paramtypes", [dto_1.SendProfileBodyDto]),
|
|
62
|
+
__metadata("design:returntype", Promise)
|
|
63
|
+
], V2DidcommUserProfileController.prototype, "sendProfile", null);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, common_1.Post)('request'),
|
|
66
|
+
(0, swagger_1.ApiOperation)({
|
|
67
|
+
summary: 'Request a profile',
|
|
68
|
+
description: 'Asks the peer of a connection for its profile.',
|
|
69
|
+
}),
|
|
70
|
+
(0, swagger_1.ApiCreatedResponse)({ description: 'The sent message', type: dto_1.SentMessageDto }),
|
|
71
|
+
(0, swagger_1.ApiNotFoundResponse)({ description: 'No connection with the given id, or the module is not served' }),
|
|
72
|
+
__param(0, (0, common_1.Body)()),
|
|
73
|
+
__metadata("design:type", Function),
|
|
74
|
+
__metadata("design:paramtypes", [dto_1.RequestProfileBodyDto]),
|
|
75
|
+
__metadata("design:returntype", Promise)
|
|
76
|
+
], V2DidcommUserProfileController.prototype, "requestProfile", null);
|
|
77
|
+
exports.V2DidcommUserProfileController = V2DidcommUserProfileController = __decorate([
|
|
78
|
+
(0, swagger_1.ApiTags)('v2/didcomm'),
|
|
79
|
+
(0, common_1.Controller)({ path: 'didcomm/user-profile', version: '2' }),
|
|
80
|
+
(0, common_1.UsePipes)(new common_1.ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true })),
|
|
81
|
+
__param(0, (0, common_1.Inject)('VSAGENT')),
|
|
82
|
+
__param(1, (0, common_1.Inject)(defaultProfile_1.DEFAULT_PROFILE)),
|
|
83
|
+
__metadata("design:paramtypes", [Function, Object])
|
|
84
|
+
], V2DidcommUserProfileController);
|
|
85
|
+
//# sourceMappingURL=V2DidcommUserProfileController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"V2DidcommUserProfileController.js","sourceRoot":"","sources":["../../src/nestjs/V2DidcommUserProfileController.ts"],"names":[],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A,eAAM,EAAC,gCAAe,CAAC,CAAA;;GAHf,8BAA8B,CAqD1C"}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
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.SendMenuBodyDto = exports.ActionMenuDto = exports.ActionMenuOptionDto = exports.ActionMenuFormDto = exports.ActionMenuFormParameterDto = void 0;
|
|
13
|
+
const action_menu_1 = require("@credo-ts/action-menu");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
class ActionMenuFormParameterDto {
|
|
18
|
+
}
|
|
19
|
+
exports.ActionMenuFormParameterDto = ActionMenuFormParameterDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({ description: 'Name of the parameter', example: 'email' }),
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ActionMenuFormParameterDto.prototype, "name", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Title of the parameter', example: 'Email address' }),
|
|
28
|
+
(0, class_validator_1.IsString)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ActionMenuFormParameterDto.prototype, "title", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Text that describes the parameter' }),
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ActionMenuFormParameterDto.prototype, "description", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Value the peer starts from' }),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], ActionMenuFormParameterDto.prototype, "default", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'The peer must fill the parameter', default: false }),
|
|
45
|
+
(0, class_validator_1.IsOptional)(),
|
|
46
|
+
(0, class_validator_1.IsBoolean)(),
|
|
47
|
+
__metadata("design:type", Boolean)
|
|
48
|
+
], ActionMenuFormParameterDto.prototype, "required", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiPropertyOptional)({ enum: action_menu_1.ActionMenuFormInputType, description: 'Kind of input' }),
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsEnum)(action_menu_1.ActionMenuFormInputType),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ActionMenuFormParameterDto.prototype, "type", void 0);
|
|
55
|
+
class ActionMenuFormDto {
|
|
56
|
+
}
|
|
57
|
+
exports.ActionMenuFormDto = ActionMenuFormDto;
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({ description: 'Text that describes the form' }),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ActionMenuFormDto.prototype, "description", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiProperty)({ description: 'Label of the submit control', example: 'Send' }),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], ActionMenuFormDto.prototype, "submitLabel", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, swagger_1.ApiProperty)({ type: [ActionMenuFormParameterDto], description: 'The parameters the peer fills' }),
|
|
71
|
+
(0, class_validator_1.IsArray)(),
|
|
72
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
73
|
+
(0, class_transformer_1.Type)(() => ActionMenuFormParameterDto),
|
|
74
|
+
__metadata("design:type", Array)
|
|
75
|
+
], ActionMenuFormDto.prototype, "params", void 0);
|
|
76
|
+
class ActionMenuOptionDto {
|
|
77
|
+
}
|
|
78
|
+
exports.ActionMenuOptionDto = ActionMenuOptionDto;
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, swagger_1.ApiProperty)({ description: 'Name of the option, reported back when the peer performs it' }),
|
|
81
|
+
(0, class_validator_1.IsString)(),
|
|
82
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], ActionMenuOptionDto.prototype, "name", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiProperty)({ description: 'Title of the option' }),
|
|
87
|
+
(0, class_validator_1.IsString)(),
|
|
88
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
89
|
+
__metadata("design:type", String)
|
|
90
|
+
], ActionMenuOptionDto.prototype, "title", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, swagger_1.ApiProperty)({ description: 'Text that describes the option' }),
|
|
93
|
+
(0, class_validator_1.IsString)(),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], ActionMenuOptionDto.prototype, "description", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'The option is displayed but cannot be performed', default: false }),
|
|
98
|
+
(0, class_validator_1.IsOptional)(),
|
|
99
|
+
(0, class_validator_1.IsBoolean)(),
|
|
100
|
+
__metadata("design:type", Boolean)
|
|
101
|
+
], ActionMenuOptionDto.prototype, "disabled", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiPropertyOptional)({ type: ActionMenuFormDto, description: 'Form the peer fills before it performs' }),
|
|
104
|
+
(0, class_validator_1.IsOptional)(),
|
|
105
|
+
(0, class_validator_1.ValidateNested)(),
|
|
106
|
+
(0, class_transformer_1.Type)(() => ActionMenuFormDto),
|
|
107
|
+
__metadata("design:type", ActionMenuFormDto)
|
|
108
|
+
], ActionMenuOptionDto.prototype, "form", void 0);
|
|
109
|
+
class ActionMenuDto {
|
|
110
|
+
}
|
|
111
|
+
exports.ActionMenuDto = ActionMenuDto;
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, swagger_1.ApiProperty)({ description: 'Title of the menu' }),
|
|
114
|
+
(0, class_validator_1.IsString)(),
|
|
115
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], ActionMenuDto.prototype, "title", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, swagger_1.ApiProperty)({ description: 'Text that describes the menu' }),
|
|
120
|
+
(0, class_validator_1.IsString)(),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], ActionMenuDto.prototype, "description", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, swagger_1.ApiProperty)({ type: [ActionMenuOptionDto], description: 'The options of the menu' }),
|
|
125
|
+
(0, class_validator_1.IsArray)(),
|
|
126
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
127
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
128
|
+
(0, class_transformer_1.Type)(() => ActionMenuOptionDto),
|
|
129
|
+
__metadata("design:type", Array)
|
|
130
|
+
], ActionMenuDto.prototype, "options", void 0);
|
|
131
|
+
class SendMenuBodyDto {
|
|
132
|
+
}
|
|
133
|
+
exports.SendMenuBodyDto = SendMenuBodyDto;
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, swagger_1.ApiProperty)({ description: 'Connection to send the menu on', example: 'conn-1234-5678' }),
|
|
136
|
+
(0, class_validator_1.IsString)(),
|
|
137
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
138
|
+
__metadata("design:type", String)
|
|
139
|
+
], SendMenuBodyDto.prototype, "connectionId", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, swagger_1.ApiProperty)({ type: ActionMenuDto, description: 'The menu to send' }),
|
|
142
|
+
(0, class_validator_1.IsDefined)(),
|
|
143
|
+
(0, class_validator_1.ValidateNested)(),
|
|
144
|
+
(0, class_transformer_1.Type)(() => ActionMenuDto),
|
|
145
|
+
__metadata("design:type", ActionMenuDto)
|
|
146
|
+
], SendMenuBodyDto.prototype, "menu", void 0);
|
|
147
|
+
//# sourceMappingURL=action-menu.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/action-menu.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAA+D;AAC/D,6CAAkE;AAClE,yDAAwC;AACxC,qDAUwB;AAExB,MAAa,0BAA0B;CA6BtC;AA7BD,gEA6BC;AAzBC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACvE,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACA;AAKb;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,OAAO,EAAE,eAAe,EA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C;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC;;8CACD;AAGjC,MAAa,eAAe;CAW3B;AAXD,0CAWC;AAPC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IACzF,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACQ;AAMrB;IAJC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;IACrE,IAAA,2BAAS,GAAE;IACX,IAAA,gCAAc,GAAE;IAChB,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,aAAa,CAAC;8BACnB,aAAa;6CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CALL_TYPES: readonly ["audio", "video", "service"];
|
|
2
|
+
export type CallType = (typeof CALL_TYPES)[number];
|
|
3
|
+
export declare class OfferCallBodyDto {
|
|
4
|
+
connectionId: string;
|
|
5
|
+
callType: CallType;
|
|
6
|
+
parameters: Record<string, unknown>;
|
|
7
|
+
description?: string;
|
|
8
|
+
offerStartTime?: string;
|
|
9
|
+
offerExpirationTime?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class CallThreadBodyDto {
|
|
12
|
+
connectionId: string;
|
|
13
|
+
threadId: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class AcceptCallBodyDto extends CallThreadBodyDto {
|
|
16
|
+
parameters: Record<string, unknown>;
|
|
17
|
+
}
|