@verana-labs/vs-agent-plugin-chat 2.0.0-dev.8 → 2.0.0-pr.767.1
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,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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SendReceiptsBodyDto = exports.MessageReceiptDto = exports.MessageState = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
var MessageState;
|
|
17
|
+
(function (MessageState) {
|
|
18
|
+
MessageState["Created"] = "created";
|
|
19
|
+
MessageState["Submitted"] = "submitted";
|
|
20
|
+
MessageState["Received"] = "received";
|
|
21
|
+
MessageState["Viewed"] = "viewed";
|
|
22
|
+
MessageState["Deleted"] = "deleted";
|
|
23
|
+
})(MessageState || (exports.MessageState = MessageState = {}));
|
|
24
|
+
/**
|
|
25
|
+
* One entry of [VSA-ADM-DC-RC-SEND] sendReceipts.
|
|
26
|
+
*/
|
|
27
|
+
class MessageReceiptDto {
|
|
28
|
+
}
|
|
29
|
+
exports.MessageReceiptDto = MessageReceiptDto;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({ description: 'Identifier of the message the receipt refers to', example: 'msg-1234' }),
|
|
32
|
+
(0, class_validator_1.IsString)(),
|
|
33
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], MessageReceiptDto.prototype, "messageId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({ enum: MessageState, description: 'State reported for the message' }),
|
|
38
|
+
(0, class_validator_1.IsEnum)(MessageState),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], MessageReceiptDto.prototype, "state", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'When the state was reached', example: '2026-09-07T12:00:00.000Z' }),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsISO8601)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], MessageReceiptDto.prototype, "timestamp", void 0);
|
|
47
|
+
/**
|
|
48
|
+
* Body of [VSA-ADM-DC-RC-SEND] sendReceipts.
|
|
49
|
+
*/
|
|
50
|
+
class SendReceiptsBodyDto {
|
|
51
|
+
}
|
|
52
|
+
exports.SendReceiptsBodyDto = SendReceiptsBodyDto;
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({ description: 'Connection to send the receipts on', example: 'conn-1234-5678' }),
|
|
55
|
+
(0, class_validator_1.IsString)(),
|
|
56
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], SendReceiptsBodyDto.prototype, "connectionId", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({ type: [MessageReceiptDto], description: 'The receipts to send' }),
|
|
61
|
+
(0, class_validator_1.IsArray)(),
|
|
62
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
63
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
64
|
+
(0, class_transformer_1.Type)(() => MessageReceiptDto),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], SendReceiptsBodyDto.prototype, "receipts", void 0);
|
|
67
|
+
//# sourceMappingURL=receipts.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receipts.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/receipts.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAkE;AAClE,yDAAwC;AACxC,qDASwB;AAExB,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;AACrB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED;;GAEG;AACH,MAAa,iBAAiB;CAc7B;AAdD,8CAcC;AAVC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACpG,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;oDACK;AAIlB;IAFC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAClF,IAAA,wBAAM,EAAC,YAAY,CAAC;;gDACD;AAKpB;IAHC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACvG,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;oDACM;AAGpB;;GAEG;AACH,MAAa,mBAAmB;CAY/B;AAZD,kDAYC;AARC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC7F,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yDACQ;AAOrB;IALC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,CAAC,iBAAiB,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC/E,IAAA,yBAAO,GAAE;IACT,IAAA,+BAAa,GAAE;IACf,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC;;qDACA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.SentMessageDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class SentMessageDto {
|
|
15
|
+
}
|
|
16
|
+
exports.SentMessageDto = SentMessageDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, swagger_1.ApiProperty)({
|
|
19
|
+
description: 'Identifier of the sent message',
|
|
20
|
+
example: 'a1b2c3d4-5678-90ab-cdef-1234567890ab',
|
|
21
|
+
}),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], SentMessageDto.prototype, "id", void 0);
|
|
24
|
+
//# sourceMappingURL=sent-message.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sent-message.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/sent-message.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA6C;AAE7C,MAAa,cAAc;CAM1B;AAND,wCAMC;AADC;IAJC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,sCAAsC;KAChD,CAAC;;0CACS"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare class ProfilePictureDto {
|
|
2
|
+
mimeType?: string;
|
|
3
|
+
links?: string[];
|
|
4
|
+
base64?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class UserProfileDto {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
displayPicture?: ProfilePictureDto;
|
|
9
|
+
displayIcon?: ProfilePictureDto;
|
|
10
|
+
description?: string;
|
|
11
|
+
preferredLanguage?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class SendProfileBodyDto {
|
|
14
|
+
connectionId: string;
|
|
15
|
+
profile?: UserProfileDto;
|
|
16
|
+
sendBackYours?: boolean;
|
|
17
|
+
threadId?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class RequestProfileBodyDto {
|
|
20
|
+
connectionId: string;
|
|
21
|
+
query?: string[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
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.RequestProfileBodyDto = exports.SendProfileBodyDto = exports.UserProfileDto = exports.ProfilePictureDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
class ProfilePictureDto {
|
|
17
|
+
}
|
|
18
|
+
exports.ProfilePictureDto = ProfilePictureDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Media type of the content', example: 'image/png' }),
|
|
21
|
+
(0, class_validator_1.IsOptional)(),
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ProfilePictureDto.prototype, "mimeType", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'URLs the content can be fetched from', type: [String] }),
|
|
27
|
+
(0, class_validator_1.IsOptional)(),
|
|
28
|
+
(0, class_validator_1.IsArray)(),
|
|
29
|
+
(0, class_validator_1.IsUrl)({}, { each: true }),
|
|
30
|
+
__metadata("design:type", Array)
|
|
31
|
+
], ProfilePictureDto.prototype, "links", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'The content, base64 encoded' }),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ProfilePictureDto.prototype, "base64", void 0);
|
|
38
|
+
class UserProfileDto {
|
|
39
|
+
}
|
|
40
|
+
exports.UserProfileDto = UserProfileDto;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Name to display', example: 'Acme Support' }),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], UserProfileDto.prototype, "displayName", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiPropertyOptional)({ type: ProfilePictureDto, description: 'Picture to display' }),
|
|
49
|
+
(0, class_validator_1.IsOptional)(),
|
|
50
|
+
(0, class_validator_1.ValidateNested)(),
|
|
51
|
+
(0, class_transformer_1.Type)(() => ProfilePictureDto),
|
|
52
|
+
__metadata("design:type", ProfilePictureDto)
|
|
53
|
+
], UserProfileDto.prototype, "displayPicture", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiPropertyOptional)({ type: ProfilePictureDto, description: 'Icon to display' }),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.ValidateNested)(),
|
|
58
|
+
(0, class_transformer_1.Type)(() => ProfilePictureDto),
|
|
59
|
+
__metadata("design:type", ProfilePictureDto)
|
|
60
|
+
], UserProfileDto.prototype, "displayIcon", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Text that describes the profile' }),
|
|
63
|
+
(0, class_validator_1.IsOptional)(),
|
|
64
|
+
(0, class_validator_1.IsString)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], UserProfileDto.prototype, "description", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Preferred language, as a BCP 47 tag', example: 'en' }),
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsString)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], UserProfileDto.prototype, "preferredLanguage", void 0);
|
|
73
|
+
class SendProfileBodyDto {
|
|
74
|
+
}
|
|
75
|
+
exports.SendProfileBodyDto = SendProfileBodyDto;
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)({ description: 'Connection to send the profile on', example: 'conn-1234-5678' }),
|
|
78
|
+
(0, class_validator_1.IsString)(),
|
|
79
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], SendProfileBodyDto.prototype, "connectionId", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiPropertyOptional)({ type: UserProfileDto, description: 'Profile to send, the stored one when absent' }),
|
|
84
|
+
(0, class_validator_1.IsOptional)(),
|
|
85
|
+
(0, class_validator_1.ValidateNested)(),
|
|
86
|
+
(0, class_transformer_1.Type)(() => UserProfileDto),
|
|
87
|
+
__metadata("design:type", UserProfileDto)
|
|
88
|
+
], SendProfileBodyDto.prototype, "profile", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Ask the peer to answer with its own profile', default: false }),
|
|
91
|
+
(0, class_validator_1.IsOptional)(),
|
|
92
|
+
(0, class_validator_1.IsBoolean)(),
|
|
93
|
+
__metadata("design:type", Boolean)
|
|
94
|
+
], SendProfileBodyDto.prototype, "sendBackYours", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Thread of the message this profile answers' }),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], SendProfileBodyDto.prototype, "threadId", void 0);
|
|
102
|
+
class RequestProfileBodyDto {
|
|
103
|
+
}
|
|
104
|
+
exports.RequestProfileBodyDto = RequestProfileBodyDto;
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, swagger_1.ApiProperty)({ description: 'Connection to send the request on', example: 'conn-1234-5678' }),
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
109
|
+
__metadata("design:type", String)
|
|
110
|
+
], RequestProfileBodyDto.prototype, "connectionId", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Profile fields of interest, every field when absent', type: [String] }),
|
|
113
|
+
(0, class_validator_1.IsOptional)(),
|
|
114
|
+
(0, class_validator_1.IsArray)(),
|
|
115
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
116
|
+
__metadata("design:type", Array)
|
|
117
|
+
], RequestProfileBodyDto.prototype, "query", void 0);
|
|
118
|
+
//# sourceMappingURL=user-profile.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-profile.dto.js","sourceRoot":"","sources":["../../../src/nestjs/dto/user-profile.dto.ts"],"names":[],"mappings":"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"}
|
package/build/utils/parsers.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import { DidCommMessageReceipt } from '@2060.io/credo-ts-didcomm-receipts';
|
|
2
1
|
import { PictureData } from '@2060.io/credo-ts-didcomm-user-profile';
|
|
3
|
-
import { VsAgentMessageReceipt } from '@verana-labs/vs-agent-model';
|
|
4
|
-
export declare const UriValidator: RegExp;
|
|
5
|
-
export declare function parseDataUrl(dataUrl: string): {
|
|
6
|
-
mimeType: string;
|
|
7
|
-
data: string;
|
|
8
|
-
} | null;
|
|
9
|
-
export declare function parsePictureData(pictureData: string): PictureData | undefined;
|
|
10
2
|
export declare function createDataUrl(pictureData: PictureData): string | undefined;
|
|
11
|
-
export declare const didcommReceiptFromVsAgentReceipt: (receipt: VsAgentMessageReceipt) => DidCommMessageReceipt;
|
package/build/utils/parsers.js
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.didcommReceiptFromVsAgentReceipt = exports.UriValidator = void 0;
|
|
4
|
-
exports.parseDataUrl = parseDataUrl;
|
|
5
|
-
exports.parsePictureData = parsePictureData;
|
|
6
3
|
exports.createDataUrl = createDataUrl;
|
|
7
|
-
const credo_ts_didcomm_receipts_1 = require("@2060.io/credo-ts-didcomm-receipts");
|
|
8
|
-
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
9
|
-
exports.UriValidator = /\w+:(\/?\/?)[^\s]+/;
|
|
10
|
-
function parseDataUrl(dataUrl) {
|
|
11
|
-
const regex = /^data:(.+);base64,(.*)$/;
|
|
12
|
-
const matches = dataUrl.match(regex);
|
|
13
|
-
if (!matches)
|
|
14
|
-
return null;
|
|
15
|
-
return { mimeType: matches[1], data: matches[2] };
|
|
16
|
-
}
|
|
17
|
-
function parsePictureData(pictureData) {
|
|
18
|
-
const parsedDataUrl = parseDataUrl(pictureData);
|
|
19
|
-
if (parsedDataUrl) {
|
|
20
|
-
return { base64: parsedDataUrl.data, mimeType: parsedDataUrl.mimeType };
|
|
21
|
-
}
|
|
22
|
-
else if (exports.UriValidator.test(pictureData)) {
|
|
23
|
-
return { links: [pictureData] };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
4
|
function createDataUrl(pictureData) {
|
|
27
5
|
if (pictureData.base64 && pictureData.mimeType) {
|
|
28
6
|
return `data:${pictureData.mimeType};base64,${pictureData.base64}`;
|
|
@@ -31,6 +9,4 @@ function createDataUrl(pictureData) {
|
|
|
31
9
|
return pictureData.links[0];
|
|
32
10
|
}
|
|
33
11
|
}
|
|
34
|
-
const didcommReceiptFromVsAgentReceipt = (receipt) => new credo_ts_didcomm_receipts_1.DidCommMessageReceipt(Object.assign(Object.assign({}, receipt), { state: vs_agent_model_1.didcommMessageState[receipt.state.toLowerCase()] }));
|
|
35
|
-
exports.didcommReceiptFromVsAgentReceipt = didcommReceiptFromVsAgentReceipt;
|
|
36
12
|
//# sourceMappingURL=parsers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/utils/parsers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/utils/parsers.ts"],"names":[],"mappings":";;AAEA,sCAMC;AAND,SAAgB,aAAa,CAAC,WAAwB;IACpD,IAAI,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC/C,OAAO,QAAQ,WAAW,CAAC,QAAQ,WAAW,WAAW,CAAC,MAAM,EAAE,CAAA;IACpE,CAAC;SAAM,IAAI,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"default": "./build/index.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
"version": "2.0.0-
|
|
12
|
+
"version": "2.0.0-pr.767.1",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/verana-labs/vs-agent"
|
|
@@ -28,21 +28,25 @@
|
|
|
28
28
|
"@2060.io/credo-ts-didcomm-reactions": "^0.1.1",
|
|
29
29
|
"@2060.io/credo-ts-didcomm-receipts": "0.1.1",
|
|
30
30
|
"@2060.io/credo-ts-didcomm-user-profile": "0.1.0",
|
|
31
|
-
"@credo-ts/action-menu": "0.7.1-pr-2704-
|
|
32
|
-
"@credo-ts/core": "0.7.1-pr-2704-
|
|
33
|
-
"@credo-ts/didcomm": "0.7.1-pr-2704-
|
|
34
|
-
"@credo-ts/question-answer": "0.7.1-pr-2704-
|
|
31
|
+
"@credo-ts/action-menu": "0.7.1-pr-2704-20260909134930",
|
|
32
|
+
"@credo-ts/core": "0.7.1-pr-2704-20260909134930",
|
|
33
|
+
"@credo-ts/didcomm": "0.7.1-pr-2704-20260909134930",
|
|
34
|
+
"@credo-ts/question-answer": "0.7.1-pr-2704-20260909134930",
|
|
35
35
|
"@nestjs/common": "^10.0.0",
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
36
|
+
"@nestjs/swagger": "^8.0.7",
|
|
37
|
+
"class-transformer": "0.5.1",
|
|
38
|
+
"class-validator": "0.14.1",
|
|
39
|
+
"@verana-labs/vs-agent-sdk": "2.0.0-pr.767.1",
|
|
40
|
+
"@verana-labs/vs-agent-model": "2.0.0-pr.767.1"
|
|
38
41
|
},
|
|
39
42
|
"peerDependencies": {
|
|
40
|
-
"@credo-ts/core": "0.7.1-pr-2704-
|
|
43
|
+
"@credo-ts/core": "0.7.1-pr-2704-20260909134930"
|
|
41
44
|
},
|
|
42
45
|
"scripts": {
|
|
43
46
|
"build": "pnpm run clean && pnpm run compile",
|
|
44
47
|
"clean": "rimraf -rf ./build",
|
|
45
48
|
"compile": "tsc -p tsconfig.build.json",
|
|
49
|
+
"test": "vitest",
|
|
46
50
|
"version": "pnpm version --allow-same-version"
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { MessageHandler } from '@verana-labs/vs-agent-sdk';
|
|
2
|
-
import { DidCommConnectionRecord } from '@credo-ts/didcomm';
|
|
3
|
-
import { IBaseMessage, MessageType } from '@verana-labs/vs-agent-model';
|
|
4
|
-
import { VsAgent } from '@verana-labs/vs-agent-sdk';
|
|
5
|
-
export declare class ChatMessageHandler implements MessageHandler {
|
|
6
|
-
readonly supportedTypes: MessageType[];
|
|
7
|
-
readonly openApiExamples: Record<string, {
|
|
8
|
-
summary: string;
|
|
9
|
-
description: string;
|
|
10
|
-
value: object;
|
|
11
|
-
}>;
|
|
12
|
-
handle(agent: VsAgent<any>, message: IBaseMessage, connection: DidCommConnectionRecord): Promise<string | undefined>;
|
|
13
|
-
}
|
|
@@ -1,273 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.ChatMessageHandler = void 0;
|
|
10
|
-
const action_menu_1 = require("@credo-ts/action-menu");
|
|
11
|
-
const core_1 = require("@credo-ts/core");
|
|
12
|
-
const question_answer_1 = require("@credo-ts/question-answer");
|
|
13
|
-
const common_1 = require("@nestjs/common");
|
|
14
|
-
const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
|
|
15
|
-
const parsers_1 = require("../utils/parsers");
|
|
16
|
-
let ChatMessageHandler = class ChatMessageHandler {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.supportedTypes = [
|
|
19
|
-
vs_agent_model_1.MessageType.TextMessage,
|
|
20
|
-
vs_agent_model_1.MessageType.MediaMessage,
|
|
21
|
-
vs_agent_model_1.MessageType.ReceiptsMessage,
|
|
22
|
-
vs_agent_model_1.MessageType.ReactionMessage,
|
|
23
|
-
vs_agent_model_1.MessageType.MenuDisplayMessage,
|
|
24
|
-
vs_agent_model_1.MessageType.ContextualMenuUpdateMessage,
|
|
25
|
-
vs_agent_model_1.MessageType.ProfileMessage,
|
|
26
|
-
vs_agent_model_1.MessageType.CallOfferRequestMessage,
|
|
27
|
-
vs_agent_model_1.MessageType.CallEndRequestMessage,
|
|
28
|
-
];
|
|
29
|
-
this.openApiExamples = {
|
|
30
|
-
callAccept: {
|
|
31
|
-
summary: 'Call Accept',
|
|
32
|
-
description: '#### Call Accept\n\nAccept a call offer from a third party to initiate a WebRTC call. This message will return a `threadId`, which can be used to track the subsequent status of the call. Additional parameters related to the `wsUrl` of the WebRTC server connection are expected to notify the other party.',
|
|
33
|
-
value: { type: 'call-accept', parameters: { key: 'value' } },
|
|
34
|
-
},
|
|
35
|
-
callReject: {
|
|
36
|
-
summary: 'Call Reject',
|
|
37
|
-
description: '#### Call Reject\n\nReject a call offer from a third party to initiate a WebRTC call. This message will return a `threadId`, which can be used to identify which offer has been terminated.',
|
|
38
|
-
value: { type: 'call-reject' },
|
|
39
|
-
},
|
|
40
|
-
callEnd: {
|
|
41
|
-
summary: 'Call End',
|
|
42
|
-
description: '#### Call End\n\nEnd a call offer from a third party to initiate a WebRTC call. This message will return a `threadId`, which can be used to identify which offer has been terminated.',
|
|
43
|
-
value: { type: 'call-end' },
|
|
44
|
-
},
|
|
45
|
-
callOffer: {
|
|
46
|
-
summary: 'Call Offer',
|
|
47
|
-
description: '#### Call Offer\n\nCreate a call offer from a service to initiate a WebRTC call and notify the other party of the created request. This message will return a `threadId`, which can be used to track the subsequent status of the call. Additional parameters related to the `wsUrl` of the WebRTC server connection are expected to notify the other party.',
|
|
48
|
-
value: { type: 'call-offer', parameters: { key: 'value' } },
|
|
49
|
-
},
|
|
50
|
-
contextualMenuRequest: {
|
|
51
|
-
summary: 'Contextual Menu Request',
|
|
52
|
-
description: '#### Contextual Menu Request\n\nRequests a destination agent context menu root (if any). The other side should always respond with a [Context Menu Update](#contextual-menu-update) even if no context menu is available (in such case, an empty payload will be sent).',
|
|
53
|
-
value: { type: 'contextual-menu-request' },
|
|
54
|
-
},
|
|
55
|
-
contextualMenuSelect: {
|
|
56
|
-
summary: 'Contextual Menu Select',
|
|
57
|
-
description: '#### Contextual Menu Select\n\nSubmits the selected item of context menu.',
|
|
58
|
-
value: { type: 'contextual-menu-select', selectionId: 'string' },
|
|
59
|
-
},
|
|
60
|
-
contextualMenuUpdate: {
|
|
61
|
-
summary: 'Contextual Menu Update',
|
|
62
|
-
description: '#### Contextual Menu Update\n\nSends or updates the contents for the contextual menu to destination agent.',
|
|
63
|
-
value: {
|
|
64
|
-
type: 'contextual-menu-update',
|
|
65
|
-
payload: {
|
|
66
|
-
title: 'string',
|
|
67
|
-
description: 'string',
|
|
68
|
-
options: [{ id: 'string', title: 'string', description: 'string' }],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
media: {
|
|
73
|
-
summary: 'Media',
|
|
74
|
-
description: '#### Media\n\nShares media files to a destination. They might be previously encrypted and stored in an URL reachable by the destination agent.',
|
|
75
|
-
value: {
|
|
76
|
-
type: 'media',
|
|
77
|
-
description: 'string',
|
|
78
|
-
items: [
|
|
79
|
-
{
|
|
80
|
-
mimeType: 'string',
|
|
81
|
-
filename: 'string',
|
|
82
|
-
description: 'string',
|
|
83
|
-
byteCount: 'number',
|
|
84
|
-
uri: 'string',
|
|
85
|
-
ciphering: { algorithm: 'string' },
|
|
86
|
-
preview: 'string',
|
|
87
|
-
width: 'number',
|
|
88
|
-
height: 'number',
|
|
89
|
-
duration: 'number',
|
|
90
|
-
title: 'string',
|
|
91
|
-
icon: 'string',
|
|
92
|
-
openingMode: 'string',
|
|
93
|
-
screenOrientaton: 'string',
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
menuDisplay: {
|
|
99
|
-
summary: 'Menu Display',
|
|
100
|
-
description: 'Menu Display\n\nAuto-generated example .',
|
|
101
|
-
value: {
|
|
102
|
-
type: 'menu-display',
|
|
103
|
-
connectionId: 'REPLACE_WITH_CONNECTION_ID',
|
|
104
|
-
timestamp: '2025-08-19T16:17:08.871Z',
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
menuSelect: {
|
|
108
|
-
summary: 'Menu Select',
|
|
109
|
-
description: '#### Menu Select\n\nSubmits the selected item of a presented menu, defined in `threadId` field.',
|
|
110
|
-
value: { type: 'menu-select', menuItems: [{ id: 'string' }], content: 'string' },
|
|
111
|
-
},
|
|
112
|
-
profile: {
|
|
113
|
-
summary: 'Profile',
|
|
114
|
-
description: '#### Profile\n\nSends User Profile to a particular connection. An Agent may have its default profile settings, but also override them and send any arbitrary value to each connection. All items are optional.\n\n> **Notes**:\n\n- Display Image and Contextual Menu Image are sent as a Data URL or regular URL\n- A null value means to delete any existing one. A missing value means to keep the previous one.',
|
|
115
|
-
value: { type: 'profile', displayName: 'string', displayImageUrl: 'string', displayIconUrl: 'string' },
|
|
116
|
-
},
|
|
117
|
-
reaction: {
|
|
118
|
-
summary: 'Reaction',
|
|
119
|
-
description: '#### Reaction\n\nSends emoji reactions to previously received messages. Each reaction references a `message_id` and an `emoji`. Use `action: "react"` to add a reaction or `action: "unreact"` to remove it.',
|
|
120
|
-
value: {
|
|
121
|
-
type: 'reaction',
|
|
122
|
-
reactions: [{ message_id: 'uuid-of-original-message', emoji: '👍', action: 'react' }],
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
receipts: {
|
|
126
|
-
summary: 'Receipts',
|
|
127
|
-
description: '#### Receipts\n\nSends message updates for a number of messages.',
|
|
128
|
-
value: {
|
|
129
|
-
type: 'receipts',
|
|
130
|
-
receipts: [{ messageId: 'string', state: 'MessageState', timestamp: 'Date' }],
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
text: {
|
|
134
|
-
summary: 'Text',
|
|
135
|
-
description: '#### Text\n\nSends a simple text to a destination',
|
|
136
|
-
value: { type: 'text', content: 'string' },
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
async handle(agent, message, connection) {
|
|
141
|
-
var _a;
|
|
142
|
-
const messageType = message.type;
|
|
143
|
-
let messageId;
|
|
144
|
-
if (messageType === vs_agent_model_1.TextMessage.type) {
|
|
145
|
-
const textMsg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.TextMessage);
|
|
146
|
-
const record = await agent.didcomm.basicMessages.sendMessage(textMsg.connectionId, textMsg.content);
|
|
147
|
-
messageId = record.threadId;
|
|
148
|
-
}
|
|
149
|
-
else if (messageType === vs_agent_model_1.MediaMessage.type) {
|
|
150
|
-
const mediaMsg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.MediaMessage);
|
|
151
|
-
const mediaRecord = await agent.modules.media.create({ connectionId: mediaMsg.connectionId });
|
|
152
|
-
const record = await agent.modules.media.share({
|
|
153
|
-
recordId: mediaRecord.id,
|
|
154
|
-
description: mediaMsg.description,
|
|
155
|
-
items: mediaMsg.items.map(item => {
|
|
156
|
-
var _a, _b;
|
|
157
|
-
return ({
|
|
158
|
-
id: item.id,
|
|
159
|
-
uri: item.uri,
|
|
160
|
-
description: item.description,
|
|
161
|
-
mimeType: item.mimeType,
|
|
162
|
-
byteCount: item.byteCount,
|
|
163
|
-
ciphering: ((_a = item.ciphering) === null || _a === void 0 ? void 0 : _a.algorithm)
|
|
164
|
-
? Object.assign(Object.assign({}, item.ciphering), { parameters: (_b = item.ciphering.parameters) !== null && _b !== void 0 ? _b : {} }) : undefined,
|
|
165
|
-
fileName: item.filename,
|
|
166
|
-
metadata: {
|
|
167
|
-
preview: item.preview,
|
|
168
|
-
width: item.width,
|
|
169
|
-
height: item.height,
|
|
170
|
-
duration: item.duration,
|
|
171
|
-
title: item.title,
|
|
172
|
-
icon: item.icon,
|
|
173
|
-
openingMode: item.openingMode,
|
|
174
|
-
screenOrientation: item.screenOrientation,
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
}),
|
|
178
|
-
});
|
|
179
|
-
messageId = record.threadId;
|
|
180
|
-
}
|
|
181
|
-
else if (messageType === vs_agent_model_1.ReceiptsMessage.type) {
|
|
182
|
-
const textMsg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.ReceiptsMessage);
|
|
183
|
-
await agent.modules.receipts.send({
|
|
184
|
-
connectionId: textMsg.connectionId,
|
|
185
|
-
receipts: textMsg.receipts.map(parsers_1.didcommReceiptFromVsAgentReceipt),
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
else if (messageType === vs_agent_model_1.ReactionMessage.type) {
|
|
189
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.ReactionMessage);
|
|
190
|
-
await agent.modules.reactions.send({
|
|
191
|
-
connectionId: msg.connectionId,
|
|
192
|
-
reactions: msg.reactions.map(r => ({
|
|
193
|
-
messageId: r.messageId,
|
|
194
|
-
emoji: r.emoji,
|
|
195
|
-
action: r.action,
|
|
196
|
-
timestamp: r.timestamp,
|
|
197
|
-
})),
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
else if (messageType === vs_agent_model_1.MenuDisplayMessage.type) {
|
|
201
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.MenuDisplayMessage);
|
|
202
|
-
const record = await agent.modules.questionAnswer.sendQuestion(msg.connectionId, {
|
|
203
|
-
question: msg.prompt,
|
|
204
|
-
validResponses: msg.menuItems.map(item => new question_answer_1.ValidResponse({ text: item.text })),
|
|
205
|
-
});
|
|
206
|
-
messageId = record.threadId;
|
|
207
|
-
record.metadata.add('text-id-mapping', msg.menuItems.reduce((acc, curr) => ((acc[curr.text] = curr.id), acc), {}));
|
|
208
|
-
await agent.dependencyManager.resolve(question_answer_1.QuestionAnswerRepository).update(agent.context, record);
|
|
209
|
-
}
|
|
210
|
-
else if (messageType === vs_agent_model_1.ContextualMenuUpdateMessage.type) {
|
|
211
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.ContextualMenuUpdateMessage);
|
|
212
|
-
await agent.modules.actionMenu.clearActiveMenu({
|
|
213
|
-
connectionId: msg.connectionId,
|
|
214
|
-
role: action_menu_1.ActionMenuRole.Responder,
|
|
215
|
-
});
|
|
216
|
-
await agent.modules.actionMenu.sendMenu({
|
|
217
|
-
connectionId: msg.connectionId,
|
|
218
|
-
menu: {
|
|
219
|
-
title: msg.title,
|
|
220
|
-
description: (_a = msg.description) !== null && _a !== void 0 ? _a : '',
|
|
221
|
-
options: msg.options.map(item => {
|
|
222
|
-
var _a;
|
|
223
|
-
return new action_menu_1.ActionMenuOption({
|
|
224
|
-
title: item.title,
|
|
225
|
-
name: item.id,
|
|
226
|
-
description: (_a = item.description) !== null && _a !== void 0 ? _a : '',
|
|
227
|
-
});
|
|
228
|
-
}),
|
|
229
|
-
},
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
else if (messageType === vs_agent_model_1.ProfileMessage.type) {
|
|
233
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.ProfileMessage);
|
|
234
|
-
const { displayImageUrl, displayName, displayIconUrl, description, preferredLanguage } = msg;
|
|
235
|
-
await agent.modules.userProfile.sendUserProfile({
|
|
236
|
-
connectionId: connection.id,
|
|
237
|
-
profileData: {
|
|
238
|
-
displayName: displayName !== null && displayName !== void 0 ? displayName : undefined,
|
|
239
|
-
displayPicture: displayImageUrl ? (0, parsers_1.parsePictureData)(displayImageUrl) : undefined,
|
|
240
|
-
displayIcon: displayIconUrl ? (0, parsers_1.parsePictureData)(displayIconUrl) : undefined,
|
|
241
|
-
description: description !== null && description !== void 0 ? description : undefined,
|
|
242
|
-
preferredLanguage: preferredLanguage !== null && preferredLanguage !== void 0 ? preferredLanguage : undefined,
|
|
243
|
-
},
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
else if (messageType === vs_agent_model_1.CallOfferRequestMessage.type) {
|
|
247
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.CallOfferRequestMessage);
|
|
248
|
-
const callOffer = await agent.modules.calls.offer({
|
|
249
|
-
connectionId: connection.id,
|
|
250
|
-
offerExpirationTime: msg.offerExpirationTime,
|
|
251
|
-
offerStartTime: msg.offerStartTime,
|
|
252
|
-
description: msg.description,
|
|
253
|
-
callType: 'service',
|
|
254
|
-
parameters: msg.parameters,
|
|
255
|
-
});
|
|
256
|
-
messageId = callOffer.messageId;
|
|
257
|
-
}
|
|
258
|
-
else if (messageType === vs_agent_model_1.CallEndRequestMessage.type) {
|
|
259
|
-
const msg = core_1.JsonTransformer.fromJSON(message, vs_agent_model_1.CallEndRequestMessage);
|
|
260
|
-
const hangup = await agent.modules.calls.hangup({
|
|
261
|
-
connectionId: connection.id,
|
|
262
|
-
threadId: msg.threadId,
|
|
263
|
-
});
|
|
264
|
-
messageId = hangup.messageId;
|
|
265
|
-
}
|
|
266
|
-
return messageId;
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
exports.ChatMessageHandler = ChatMessageHandler;
|
|
270
|
-
exports.ChatMessageHandler = ChatMessageHandler = __decorate([
|
|
271
|
-
(0, common_1.Injectable)()
|
|
272
|
-
], ChatMessageHandler);
|
|
273
|
-
//# sourceMappingURL=ChatMessageHandler.js.map
|