@escapenavigator/types 1.10.158 → 1.10.159
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/dist/location/create-location.dto.d.ts +1 -0
- package/dist/location/create-location.dto.js +6 -0
- package/dist/location/location-light.ro.d.ts +1 -0
- package/dist/location/location-light.ro.js +4 -0
- package/dist/openapi/orders/openapi-create-preorder.dto.d.ts +7 -0
- package/dist/openapi/orders/openapi-create-preorder.dto.js +6 -0
- package/dist/profile/company-ai-context.d.ts +2 -0
- package/dist/questroom/create-questroom.dto.d.ts +1 -0
- package/dist/questroom/create-questroom.dto.js +7 -0
- package/dist/questroom/questroom-ai-context.d.ts +1 -0
- package/dist/questroom/questroom.ro.d.ts +1 -0
- package/dist/questroom/questroom.ro.js +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/widget-chat/enum/widget-chat-outcome.enum.d.ts +10 -0
- package/dist/widget-chat/enum/widget-chat-outcome.enum.js +25 -0
- package/dist/widget-chat/enum/widget-chat-resolution-reason.enum.d.ts +8 -0
- package/dist/widget-chat/enum/widget-chat-resolution-reason.enum.js +20 -0
- package/dist/widget-chat/enum/widget-chat-resolved-by.enum.d.ts +6 -0
- package/dist/widget-chat/enum/widget-chat-resolved-by.enum.js +11 -0
- package/dist/widget-chat/enum/widget-chat-satisfaction.enum.d.ts +4 -0
- package/dist/widget-chat/enum/widget-chat-satisfaction.enum.js +9 -0
- package/dist/widget-chat/widget-chat-ai-settings-update.dto.d.ts +12 -0
- package/dist/widget-chat/widget-chat-ai-settings-update.dto.js +73 -0
- package/dist/widget-chat/widget-chat-booking-info.ro.d.ts +9 -0
- package/dist/widget-chat/widget-chat-booking-info.ro.js +2 -0
- package/dist/widget-chat/widget-chat-conversation.ro.d.ts +14 -0
- package/dist/widget-chat/widget-chat-feedback.dto.d.ts +5 -0
- package/dist/widget-chat/widget-chat-feedback.dto.js +33 -0
- package/dist/widget-chat/widget-chat-identify.dto.d.ts +5 -0
- package/dist/widget-chat/widget-chat-identify.dto.js +33 -0
- package/dist/widget-chat/widget-chat-knowledge-save.dto.d.ts +10 -0
- package/dist/widget-chat/widget-chat-knowledge-save.dto.js +54 -0
- package/dist/widget-chat/widget-chat-message.ro.d.ts +9 -0
- package/dist/widget-chat/widget-chat-outcome.util.d.ts +11 -0
- package/dist/widget-chat/widget-chat-outcome.util.js +35 -0
- package/dist/widget-chat/widget-chat-satisfaction.dto.d.ts +6 -0
- package/dist/widget-chat/widget-chat-satisfaction.dto.js +34 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare enum WidgetChatOutcomeEnum {
|
|
2
|
+
OPEN = "open",
|
|
3
|
+
AWAITING_FEEDBACK = "awaiting_feedback",
|
|
4
|
+
WAITING_OPERATOR = "waiting_operator",
|
|
5
|
+
BOOKING_COMPLETED = "booking_completed",
|
|
6
|
+
AI_RESOLVED = "ai_resolved",
|
|
7
|
+
OPERATOR_RESOLVED = "operator_resolved",
|
|
8
|
+
AUTO_TIMEOUT = "auto_timeout",
|
|
9
|
+
ABANDONED = "abandoned"
|
|
10
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WidgetChatOutcomeEnum = void 0;
|
|
4
|
+
// Итог диалога для аналитики. Производное значение (НЕ хранится в БД) —
|
|
5
|
+
// вычисляется из статуса/атрибуции закрытия, чтобы различать исходы:
|
|
6
|
+
// разрешил ИИ, передан оператору, оформлена бронь, авто-закрытие и т.д.
|
|
7
|
+
var WidgetChatOutcomeEnum;
|
|
8
|
+
(function (WidgetChatOutcomeEnum) {
|
|
9
|
+
// Активный диалог, ведёт ИИ, ждёт следующего сообщения.
|
|
10
|
+
WidgetChatOutcomeEnum["OPEN"] = "open";
|
|
11
|
+
// ИИ показал кнопки 👍/👎 и ждёт реакции клиента.
|
|
12
|
+
WidgetChatOutcomeEnum["AWAITING_FEEDBACK"] = "awaiting_feedback";
|
|
13
|
+
// Передан оператору и ещё не закрыт (идёт/ждёт ответа человека).
|
|
14
|
+
WidgetChatOutcomeEnum["WAITING_OPERATOR"] = "waiting_operator";
|
|
15
|
+
// Закрыт: клиент оформил/подтвердил бронь из диалога (цель достигнута).
|
|
16
|
+
WidgetChatOutcomeEnum["BOOKING_COMPLETED"] = "booking_completed";
|
|
17
|
+
// Закрыт ИИ без участия человека (deflection): подтверждение/мягкое закрытие.
|
|
18
|
+
WidgetChatOutcomeEnum["AI_RESOLVED"] = "ai_resolved";
|
|
19
|
+
// Закрыт оператором (живой человек довёл диалог).
|
|
20
|
+
WidgetChatOutcomeEnum["OPERATOR_RESOLVED"] = "operator_resolved";
|
|
21
|
+
// Авто-закрытие: клиент не ответил на «решён ли вопрос?».
|
|
22
|
+
WidgetChatOutcomeEnum["AUTO_TIMEOUT"] = "auto_timeout";
|
|
23
|
+
// Авто-закрытие брошенного без активности диалога.
|
|
24
|
+
WidgetChatOutcomeEnum["ABANDONED"] = "abandoned";
|
|
25
|
+
})(WidgetChatOutcomeEnum || (exports.WidgetChatOutcomeEnum = WidgetChatOutcomeEnum = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WidgetChatResolutionReasonEnum = void 0;
|
|
4
|
+
// Причина закрытия диалога.
|
|
5
|
+
var WidgetChatResolutionReasonEnum;
|
|
6
|
+
(function (WidgetChatResolutionReasonEnum) {
|
|
7
|
+
// Клиент подтвердил «вопрос решён» (на вопрос ИИ или оператора).
|
|
8
|
+
WidgetChatResolutionReasonEnum["CONFIRMED"] = "confirmed";
|
|
9
|
+
// Оператор закрыл вручную (hard-close).
|
|
10
|
+
WidgetChatResolutionReasonEnum["OPERATOR_MANUAL"] = "operator_manual";
|
|
11
|
+
// Клиент не ответил на «решён ли вопрос?» — авто-закрытие по таймауту.
|
|
12
|
+
WidgetChatResolutionReasonEnum["TIMEOUT"] = "timeout";
|
|
13
|
+
// Брошенный диалог без активности — авто-закрытие.
|
|
14
|
+
WidgetChatResolutionReasonEnum["ABANDONED"] = "abandoned";
|
|
15
|
+
// Клиент оформил и подтвердил бронь из диалога (цель чата достигнута).
|
|
16
|
+
WidgetChatResolutionReasonEnum["BOOKING_COMPLETED"] = "booking_completed";
|
|
17
|
+
// Клиент явно дал понять, что вопрос закрыт («спасибо, всё получилось»),
|
|
18
|
+
// ИИ мягко закрыл диалог без отдельного вопроса «удалось ли решить?».
|
|
19
|
+
WidgetChatResolutionReasonEnum["AI_SOFT_CLOSE"] = "ai_soft_close";
|
|
20
|
+
})(WidgetChatResolutionReasonEnum || (exports.WidgetChatResolutionReasonEnum = WidgetChatResolutionReasonEnum = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WidgetChatResolvedByEnum = void 0;
|
|
4
|
+
// Кто закрыл диалог — для атрибуции и аналитики (deflection rate ИИ).
|
|
5
|
+
var WidgetChatResolvedByEnum;
|
|
6
|
+
(function (WidgetChatResolvedByEnum) {
|
|
7
|
+
WidgetChatResolvedByEnum["AI"] = "ai";
|
|
8
|
+
WidgetChatResolvedByEnum["OPERATOR"] = "operator";
|
|
9
|
+
WidgetChatResolvedByEnum["VISITOR"] = "visitor";
|
|
10
|
+
WidgetChatResolvedByEnum["SYSTEM"] = "system";
|
|
11
|
+
})(WidgetChatResolvedByEnum || (exports.WidgetChatResolvedByEnum = WidgetChatResolvedByEnum = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WidgetChatSatisfactionEnum = void 0;
|
|
4
|
+
// Оценка качества (CSAT) после закрытия диалога: 👍 / 👎.
|
|
5
|
+
var WidgetChatSatisfactionEnum;
|
|
6
|
+
(function (WidgetChatSatisfactionEnum) {
|
|
7
|
+
WidgetChatSatisfactionEnum["POSITIVE"] = "positive";
|
|
8
|
+
WidgetChatSatisfactionEnum["NEGATIVE"] = "negative";
|
|
9
|
+
})(WidgetChatSatisfactionEnum || (exports.WidgetChatSatisfactionEnum = WidgetChatSatisfactionEnum = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const WIDGET_CHAT_AI_TONE_MAX = 500;
|
|
2
|
+
export declare const WIDGET_CHAT_AI_GREETING_MAX = 2000;
|
|
3
|
+
export declare const WIDGET_CHAT_AI_HANDOFF_MAX = 1000;
|
|
4
|
+
export declare class WidgetChatAiSettingsUpdateDto {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
tone?: string | null;
|
|
7
|
+
greeting?: string | null;
|
|
8
|
+
handoffMessage?: string | null;
|
|
9
|
+
workingHoursEnabled?: boolean;
|
|
10
|
+
workingHoursStart?: number | null;
|
|
11
|
+
workingHoursEnd?: number | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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.WidgetChatAiSettingsUpdateDto = exports.WIDGET_CHAT_AI_HANDOFF_MAX = exports.WIDGET_CHAT_AI_GREETING_MAX = exports.WIDGET_CHAT_AI_TONE_MAX = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
// Лимиты длины: эти поля попадают в СИСТЕМНЫЙ промпт на КАЖДЫЙ ответ ИИ, поэтому
|
|
16
|
+
// неограниченная длина прямо раздувала бы стоимость каждого вызова. Держим коротко.
|
|
17
|
+
exports.WIDGET_CHAT_AI_TONE_MAX = 500;
|
|
18
|
+
exports.WIDGET_CHAT_AI_GREETING_MAX = 2000;
|
|
19
|
+
exports.WIDGET_CHAT_AI_HANDOFF_MAX = 1000;
|
|
20
|
+
// Runtime-валидируемый payload PUT /widget-chat/ai/settings. @IsOptional
|
|
21
|
+
// пропускает и undefined, и null (поля можно сбрасывать).
|
|
22
|
+
class WidgetChatAiSettingsUpdateDto {
|
|
23
|
+
}
|
|
24
|
+
exports.WidgetChatAiSettingsUpdateDto = WidgetChatAiSettingsUpdateDto;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsOptional)(),
|
|
27
|
+
(0, class_validator_1.IsBoolean)(),
|
|
28
|
+
(0, class_transformer_1.Expose)(),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "enabled", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_AI_TONE_MAX),
|
|
35
|
+
(0, class_transformer_1.Expose)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "tone", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsString)(),
|
|
41
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_AI_GREETING_MAX),
|
|
42
|
+
(0, class_transformer_1.Expose)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "greeting", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsString)(),
|
|
48
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_AI_HANDOFF_MAX),
|
|
49
|
+
(0, class_transformer_1.Expose)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "handoffMessage", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
(0, class_validator_1.IsBoolean)(),
|
|
55
|
+
(0, class_transformer_1.Expose)(),
|
|
56
|
+
__metadata("design:type", Boolean)
|
|
57
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "workingHoursEnabled", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsInt)(),
|
|
61
|
+
(0, class_validator_1.Min)(0),
|
|
62
|
+
(0, class_validator_1.Max)(23),
|
|
63
|
+
(0, class_transformer_1.Expose)(),
|
|
64
|
+
__metadata("design:type", Number)
|
|
65
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "workingHoursStart", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.IsInt)(),
|
|
69
|
+
(0, class_validator_1.Min)(0),
|
|
70
|
+
(0, class_validator_1.Max)(23),
|
|
71
|
+
(0, class_transformer_1.Expose)(),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], WidgetChatAiSettingsUpdateDto.prototype, "workingHoursEnd", void 0);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { WidgetChatConversationStatusEnum } from './enum/widget-chat-conversation-status.enum';
|
|
2
|
+
import { WidgetChatOutcomeEnum } from './enum/widget-chat-outcome.enum';
|
|
3
|
+
import { WidgetChatResolutionReasonEnum } from './enum/widget-chat-resolution-reason.enum';
|
|
4
|
+
import { WidgetChatResolvedByEnum } from './enum/widget-chat-resolved-by.enum';
|
|
5
|
+
import { WidgetChatSatisfactionEnum } from './enum/widget-chat-satisfaction.enum';
|
|
6
|
+
import { WidgetChatBookingInfo } from './widget-chat-booking-info.ro';
|
|
2
7
|
export type WidgetChatConversationRO = {
|
|
3
8
|
id: number;
|
|
4
9
|
profileId: number;
|
|
@@ -17,7 +22,16 @@ export type WidgetChatConversationRO = {
|
|
|
17
22
|
aiSummary?: string;
|
|
18
23
|
escalationReason?: string;
|
|
19
24
|
status: WidgetChatConversationStatusEnum;
|
|
25
|
+
outcome?: WidgetChatOutcomeEnum;
|
|
20
26
|
resolvedAt?: Date | null;
|
|
27
|
+
resolvedBy?: WidgetChatResolvedByEnum | null;
|
|
28
|
+
resolvedByUserId?: number | null;
|
|
29
|
+
resolutionReason?: WidgetChatResolutionReasonEnum | null;
|
|
30
|
+
satisfaction?: WidgetChatSatisfactionEnum | null;
|
|
31
|
+
reopenCount?: number;
|
|
32
|
+
clientId?: number | null;
|
|
33
|
+
visitorEmail?: string | null;
|
|
34
|
+
bookingInfo?: WidgetChatBookingInfo | null;
|
|
21
35
|
createdAt: Date;
|
|
22
36
|
updatedAt: Date;
|
|
23
37
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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.WidgetChatFeedbackDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class WidgetChatFeedbackDto {
|
|
16
|
+
}
|
|
17
|
+
exports.WidgetChatFeedbackDto = WidgetChatFeedbackDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsNumber)(),
|
|
20
|
+
(0, class_transformer_1.Expose)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], WidgetChatFeedbackDto.prototype, "conversationId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], WidgetChatFeedbackDto.prototype, "visitorToken", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsBoolean)(),
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
__metadata("design:type", Boolean)
|
|
33
|
+
], WidgetChatFeedbackDto.prototype, "positive", void 0);
|
|
@@ -0,0 +1,33 @@
|
|
|
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.WidgetChatIdentifyDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class WidgetChatIdentifyDto {
|
|
16
|
+
}
|
|
17
|
+
exports.WidgetChatIdentifyDto = WidgetChatIdentifyDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsNumber)(),
|
|
20
|
+
(0, class_transformer_1.Expose)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], WidgetChatIdentifyDto.prototype, "conversationId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
(0, class_transformer_1.Expose)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], WidgetChatIdentifyDto.prototype, "visitorToken", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsEmail)(),
|
|
31
|
+
(0, class_transformer_1.Expose)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], WidgetChatIdentifyDto.prototype, "email", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const WIDGET_CHAT_KNOWLEDGE_TITLE_MAX = 200;
|
|
2
|
+
export declare const WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX = 5000;
|
|
3
|
+
export declare const WIDGET_CHAT_KNOWLEDGE_TAG_MAX = 50;
|
|
4
|
+
export declare const WIDGET_CHAT_KNOWLEDGE_TAGS_MAX = 20;
|
|
5
|
+
export declare class WidgetChatKnowledgeSaveDto {
|
|
6
|
+
title: string;
|
|
7
|
+
content: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.WidgetChatKnowledgeSaveDto = exports.WIDGET_CHAT_KNOWLEDGE_TAGS_MAX = exports.WIDGET_CHAT_KNOWLEDGE_TAG_MAX = exports.WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX = exports.WIDGET_CHAT_KNOWLEDGE_TITLE_MAX = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
// Лимиты ручного FAQ: content инжектится в контекст модели при срабатывании
|
|
16
|
+
// searchKnowledge, поэтому держим разумный потолок длины.
|
|
17
|
+
exports.WIDGET_CHAT_KNOWLEDGE_TITLE_MAX = 200;
|
|
18
|
+
exports.WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX = 5000;
|
|
19
|
+
exports.WIDGET_CHAT_KNOWLEDGE_TAG_MAX = 50;
|
|
20
|
+
exports.WIDGET_CHAT_KNOWLEDGE_TAGS_MAX = 20;
|
|
21
|
+
// Runtime-валидируемый payload POST/PUT /widget-chat/knowledge. id берётся из
|
|
22
|
+
// path-параметра (см. контроллер), в теле его нет.
|
|
23
|
+
class WidgetChatKnowledgeSaveDto {
|
|
24
|
+
}
|
|
25
|
+
exports.WidgetChatKnowledgeSaveDto = WidgetChatKnowledgeSaveDto;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, class_validator_1.MinLength)(1),
|
|
29
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_KNOWLEDGE_TITLE_MAX),
|
|
30
|
+
(0, class_transformer_1.Expose)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], WidgetChatKnowledgeSaveDto.prototype, "title", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.MinLength)(1),
|
|
36
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX),
|
|
37
|
+
(0, class_transformer_1.Expose)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], WidgetChatKnowledgeSaveDto.prototype, "content", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
(0, class_validator_1.IsArray)(),
|
|
43
|
+
(0, class_validator_1.ArrayMaxSize)(exports.WIDGET_CHAT_KNOWLEDGE_TAGS_MAX),
|
|
44
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
45
|
+
(0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_KNOWLEDGE_TAG_MAX, { each: true }),
|
|
46
|
+
(0, class_transformer_1.Expose)(),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], WidgetChatKnowledgeSaveDto.prototype, "tags", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsOptional)(),
|
|
51
|
+
(0, class_validator_1.IsBoolean)(),
|
|
52
|
+
(0, class_transformer_1.Expose)(),
|
|
53
|
+
__metadata("design:type", Boolean)
|
|
54
|
+
], WidgetChatKnowledgeSaveDto.prototype, "enabled", void 0);
|
|
@@ -8,8 +8,17 @@ export type WidgetChatSlotSuggestion = {
|
|
|
8
8
|
export type WidgetChatMessageMeta = {
|
|
9
9
|
kind: 'slot_suggestions';
|
|
10
10
|
items: WidgetChatSlotSuggestion[];
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'feedback_request';
|
|
11
13
|
} | {
|
|
12
14
|
kind: 'resolution_check';
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'satisfaction_request';
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'identify_request';
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'reply_suggestions';
|
|
21
|
+
items: string[];
|
|
13
22
|
};
|
|
14
23
|
export type WidgetChatMessageRO = {
|
|
15
24
|
id: number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WidgetChatConversationStatusEnum } from './enum/widget-chat-conversation-status.enum';
|
|
2
|
+
import { WidgetChatOutcomeEnum } from './enum/widget-chat-outcome.enum';
|
|
3
|
+
import { WidgetChatResolutionReasonEnum } from './enum/widget-chat-resolution-reason.enum';
|
|
4
|
+
import { WidgetChatResolvedByEnum } from './enum/widget-chat-resolved-by.enum';
|
|
5
|
+
export type WidgetChatOutcomeInput = {
|
|
6
|
+
status: WidgetChatConversationStatusEnum;
|
|
7
|
+
aiPaused?: boolean;
|
|
8
|
+
resolvedBy?: WidgetChatResolvedByEnum | null;
|
|
9
|
+
resolutionReason?: WidgetChatResolutionReasonEnum | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function deriveWidgetChatOutcome(c: WidgetChatOutcomeInput): WidgetChatOutcomeEnum;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deriveWidgetChatOutcome = deriveWidgetChatOutcome;
|
|
4
|
+
const widget_chat_conversation_status_enum_1 = require("./enum/widget-chat-conversation-status.enum");
|
|
5
|
+
const widget_chat_outcome_enum_1 = require("./enum/widget-chat-outcome.enum");
|
|
6
|
+
const widget_chat_resolution_reason_enum_1 = require("./enum/widget-chat-resolution-reason.enum");
|
|
7
|
+
const widget_chat_resolved_by_enum_1 = require("./enum/widget-chat-resolved-by.enum");
|
|
8
|
+
// Чистая функция: единый источник правды для «исхода» диалога. Используется и
|
|
9
|
+
// на бэке (RO/аналитика), и на фронте (бейджи), чтобы классификация не разъезжалась.
|
|
10
|
+
function deriveWidgetChatOutcome(c) {
|
|
11
|
+
if (c.status === widget_chat_conversation_status_enum_1.WidgetChatConversationStatusEnum.RESOLVED) {
|
|
12
|
+
switch (c.resolutionReason) {
|
|
13
|
+
case widget_chat_resolution_reason_enum_1.WidgetChatResolutionReasonEnum.BOOKING_COMPLETED:
|
|
14
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.BOOKING_COMPLETED;
|
|
15
|
+
case widget_chat_resolution_reason_enum_1.WidgetChatResolutionReasonEnum.TIMEOUT:
|
|
16
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.AUTO_TIMEOUT;
|
|
17
|
+
case widget_chat_resolution_reason_enum_1.WidgetChatResolutionReasonEnum.ABANDONED:
|
|
18
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.ABANDONED;
|
|
19
|
+
default:
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
if (c.resolvedBy === widget_chat_resolved_by_enum_1.WidgetChatResolvedByEnum.OPERATOR) {
|
|
23
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.OPERATOR_RESOLVED;
|
|
24
|
+
}
|
|
25
|
+
// CONFIRMED / AI_SOFT_CLOSE и прочее закрытие без оператора — это deflection ИИ.
|
|
26
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.AI_RESOLVED;
|
|
27
|
+
}
|
|
28
|
+
// Ещё не закрыт.
|
|
29
|
+
if (c.aiPaused)
|
|
30
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.WAITING_OPERATOR;
|
|
31
|
+
if (c.status === widget_chat_conversation_status_enum_1.WidgetChatConversationStatusEnum.AWAITING_CONFIRMATION) {
|
|
32
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.AWAITING_FEEDBACK;
|
|
33
|
+
}
|
|
34
|
+
return widget_chat_outcome_enum_1.WidgetChatOutcomeEnum.OPEN;
|
|
35
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.WidgetChatSatisfactionDto = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const widget_chat_satisfaction_enum_1 = require("./enum/widget-chat-satisfaction.enum");
|
|
16
|
+
class WidgetChatSatisfactionDto {
|
|
17
|
+
}
|
|
18
|
+
exports.WidgetChatSatisfactionDto = WidgetChatSatisfactionDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsNumber)(),
|
|
21
|
+
(0, class_transformer_1.Expose)(),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], WidgetChatSatisfactionDto.prototype, "conversationId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
(0, class_transformer_1.Expose)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], WidgetChatSatisfactionDto.prototype, "visitorToken", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_validator_1.IsEnum)(widget_chat_satisfaction_enum_1.WidgetChatSatisfactionEnum),
|
|
32
|
+
(0, class_transformer_1.Expose)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], WidgetChatSatisfactionDto.prototype, "satisfaction", void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/types",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.159",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"reflect-metadata": "^0.1.13",
|
|
24
24
|
"rxjs": "^7.5.5"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "ec89e018a85f2301968b5862bc3c45182eb6c58c",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/validator": "13.0.0",
|
|
29
29
|
"typescript": "^5.6"
|