@verana-labs/vs-agent-plugin-chat 2.0.0-dev.54 → 2.0.0-dev.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/build/events/ChatEvents.js +0 -11
  2. package/build/events/ChatEvents.js.map +1 -1
  3. package/build/events/didcommModuleEvents.d.ts +2 -0
  4. package/build/events/didcommModuleEvents.js +128 -0
  5. package/build/events/didcommModuleEvents.js.map +1 -0
  6. package/build/index.d.ts +12 -1
  7. package/build/index.js +21 -3
  8. package/build/index.js.map +1 -1
  9. package/build/nestjs/ChatPlugin.d.ts +5 -1
  10. package/build/nestjs/ChatPlugin.js +23 -3
  11. package/build/nestjs/ChatPlugin.js.map +1 -1
  12. package/build/nestjs/V2DidcommActionMenuController.d.ts +8 -0
  13. package/build/nestjs/V2DidcommActionMenuController.js +60 -0
  14. package/build/nestjs/V2DidcommActionMenuController.js.map +1 -0
  15. package/build/nestjs/V2DidcommCallsController.d.ts +12 -0
  16. package/build/nestjs/V2DidcommCallsController.js +116 -0
  17. package/build/nestjs/V2DidcommCallsController.js.map +1 -0
  18. package/build/nestjs/V2DidcommMediaSharingController.d.ts +8 -0
  19. package/build/nestjs/V2DidcommMediaSharingController.js +71 -0
  20. package/build/nestjs/V2DidcommMediaSharingController.js.map +1 -0
  21. package/build/nestjs/V2DidcommQuestionAnswerController.d.ts +8 -0
  22. package/build/nestjs/V2DidcommQuestionAnswerController.js +63 -0
  23. package/build/nestjs/V2DidcommQuestionAnswerController.js.map +1 -0
  24. package/build/nestjs/V2DidcommReactionsController.d.ts +8 -0
  25. package/build/nestjs/V2DidcommReactionsController.js +67 -0
  26. package/build/nestjs/V2DidcommReactionsController.js.map +1 -0
  27. package/build/nestjs/V2DidcommReceiptsController.d.ts +8 -0
  28. package/build/nestjs/V2DidcommReceiptsController.js +66 -0
  29. package/build/nestjs/V2DidcommReceiptsController.js.map +1 -0
  30. package/build/nestjs/V2DidcommUserProfileController.d.ts +11 -0
  31. package/build/nestjs/V2DidcommUserProfileController.js +93 -0
  32. package/build/nestjs/V2DidcommUserProfileController.js.map +1 -0
  33. package/build/nestjs/chatModuleApi.d.ts +5 -0
  34. package/build/nestjs/chatModuleApi.js +11 -0
  35. package/build/nestjs/chatModuleApi.js.map +1 -0
  36. package/build/nestjs/defaultProfile.d.ts +4 -0
  37. package/build/nestjs/defaultProfile.js +5 -0
  38. package/build/nestjs/defaultProfile.js.map +1 -0
  39. package/build/nestjs/dto/action-menu.dto.d.ts +30 -0
  40. package/build/nestjs/dto/action-menu.dto.js +147 -0
  41. package/build/nestjs/dto/action-menu.dto.js.map +1 -0
  42. package/build/nestjs/dto/calls.dto.d.ts +17 -0
  43. package/build/nestjs/dto/calls.dto.js +76 -0
  44. package/build/nestjs/dto/calls.dto.js.map +1 -0
  45. package/build/nestjs/dto/index.d.ts +8 -0
  46. package/build/nestjs/dto/index.js +25 -0
  47. package/build/nestjs/dto/index.js.map +1 -0
  48. package/build/nestjs/dto/media-sharing.dto.d.ts +20 -0
  49. package/build/nestjs/dto/media-sharing.dto.js +114 -0
  50. package/build/nestjs/dto/media-sharing.dto.js.map +1 -0
  51. package/build/nestjs/dto/question-answer.dto.d.ts +9 -0
  52. package/build/nestjs/dto/question-answer.dto.js +54 -0
  53. package/build/nestjs/dto/question-answer.dto.js.map +1 -0
  54. package/build/nestjs/dto/reactions.dto.d.ts +11 -0
  55. package/build/nestjs/dto/reactions.dto.js +60 -0
  56. package/build/nestjs/dto/reactions.dto.js.map +1 -0
  57. package/build/nestjs/dto/receipts.dto.d.ts +22 -0
  58. package/build/nestjs/dto/receipts.dto.js +67 -0
  59. package/build/nestjs/dto/receipts.dto.js.map +1 -0
  60. package/build/nestjs/dto/sent-message.dto.d.ts +3 -0
  61. package/build/nestjs/dto/sent-message.dto.js +24 -0
  62. package/build/nestjs/dto/sent-message.dto.js.map +1 -0
  63. package/build/nestjs/dto/user-profile.dto.d.ts +22 -0
  64. package/build/nestjs/dto/user-profile.dto.js +118 -0
  65. package/build/nestjs/dto/user-profile.dto.js.map +1 -0
  66. package/package.json +7 -3
@@ -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":";;;;;;;;;;;;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AAW,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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AW,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,0BAA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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,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_PROFILE = void 0;
4
+ exports.DEFAULT_PROFILE = 'CHAT_DEFAULT_PROFILE';
5
+ //# sourceMappingURL=defaultProfile.js.map
@@ -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,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,yDAAw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AW,EAAC,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;IAC5D,IAAA,0BAAQ,GAAE;;kDACS;AAOpB;IALC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACpF,IAAA,yBAAO,GAAE;IACT,IAAA,+BAAa,GAAE;IACf,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;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
+ }