@escapenavigator/types 1.10.159 → 1.10.160

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.
@@ -4,5 +4,6 @@ export declare enum WidgetChatResolutionReasonEnum {
4
4
  TIMEOUT = "timeout",
5
5
  ABANDONED = "abandoned",
6
6
  BOOKING_COMPLETED = "booking_completed",
7
+ CERTIFICATE_PURCHASED = "certificate_purchased",
7
8
  AI_SOFT_CLOSE = "ai_soft_close"
8
9
  }
@@ -14,6 +14,8 @@ var WidgetChatResolutionReasonEnum;
14
14
  WidgetChatResolutionReasonEnum["ABANDONED"] = "abandoned";
15
15
  // Клиент оформил и подтвердил бронь из диалога (цель чата достигнута).
16
16
  WidgetChatResolutionReasonEnum["BOOKING_COMPLETED"] = "booking_completed";
17
+ // Клиент оплатил подарочный сертификат, оформленный из диалога.
18
+ WidgetChatResolutionReasonEnum["CERTIFICATE_PURCHASED"] = "certificate_purchased";
17
19
  // Клиент явно дал понять, что вопрос закрыт («спасибо, всё получилось»),
18
20
  // ИИ мягко закрыл диалог без отдельного вопроса «удалось ли решить?».
19
21
  WidgetChatResolutionReasonEnum["AI_SOFT_CLOSE"] = "ai_soft_close";
@@ -1,7 +1,13 @@
1
1
  import { WidgetChatConversationRO } from './widget-chat-conversation.ro';
2
2
  import { WidgetChatMessageRO } from './widget-chat-message.ro';
3
+ export type WidgetChatStarterChipRO = {
4
+ knowledgeId: number;
5
+ label: string;
6
+ emoji?: string;
7
+ };
3
8
  export type WidgetChatInitRO = {
4
9
  visitorToken: string;
5
10
  conversation: WidgetChatConversationRO;
6
11
  messages: WidgetChatMessageRO[];
12
+ starterChips?: WidgetChatStarterChipRO[];
7
13
  };
@@ -2,9 +2,15 @@ export declare const WIDGET_CHAT_KNOWLEDGE_TITLE_MAX = 200;
2
2
  export declare const WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX = 5000;
3
3
  export declare const WIDGET_CHAT_KNOWLEDGE_TAG_MAX = 50;
4
4
  export declare const WIDGET_CHAT_KNOWLEDGE_TAGS_MAX = 20;
5
+ export declare const WIDGET_CHAT_CHIP_LABEL_MAX = 32;
6
+ export declare const WIDGET_CHAT_CHIP_EMOJI_MAX = 8;
5
7
  export declare class WidgetChatKnowledgeSaveDto {
6
8
  title: string;
7
9
  content: string;
8
10
  tags?: string[];
9
11
  enabled?: boolean;
12
+ showOnWelcome?: boolean;
13
+ chipLabel?: string;
14
+ chipEmoji?: string;
15
+ chipOrder?: number;
10
16
  }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
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;
12
+ exports.WidgetChatKnowledgeSaveDto = exports.WIDGET_CHAT_CHIP_EMOJI_MAX = exports.WIDGET_CHAT_CHIP_LABEL_MAX = 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
13
  const class_transformer_1 = require("class-transformer");
14
14
  const class_validator_1 = require("class-validator");
15
15
  // Лимиты ручного FAQ: content инжектится в контекст модели при срабатывании
@@ -18,6 +18,9 @@ exports.WIDGET_CHAT_KNOWLEDGE_TITLE_MAX = 200;
18
18
  exports.WIDGET_CHAT_KNOWLEDGE_CONTENT_MAX = 5000;
19
19
  exports.WIDGET_CHAT_KNOWLEDGE_TAG_MAX = 50;
20
20
  exports.WIDGET_CHAT_KNOWLEDGE_TAGS_MAX = 20;
21
+ // Лимиты стартового чипа (рендерится кнопкой на welcome-экране виджета).
22
+ exports.WIDGET_CHAT_CHIP_LABEL_MAX = 32;
23
+ exports.WIDGET_CHAT_CHIP_EMOJI_MAX = 8;
21
24
  // Runtime-валидируемый payload POST/PUT /widget-chat/knowledge. id берётся из
22
25
  // path-параметра (см. контроллер), в теле его нет.
23
26
  class WidgetChatKnowledgeSaveDto {
@@ -52,3 +55,30 @@ __decorate([
52
55
  (0, class_transformer_1.Expose)(),
53
56
  __metadata("design:type", Boolean)
54
57
  ], WidgetChatKnowledgeSaveDto.prototype, "enabled", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsOptional)(),
60
+ (0, class_validator_1.IsBoolean)(),
61
+ (0, class_transformer_1.Expose)(),
62
+ __metadata("design:type", Boolean)
63
+ ], WidgetChatKnowledgeSaveDto.prototype, "showOnWelcome", void 0);
64
+ __decorate([
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_1.IsString)(),
67
+ (0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_CHIP_LABEL_MAX),
68
+ (0, class_transformer_1.Expose)(),
69
+ __metadata("design:type", String)
70
+ ], WidgetChatKnowledgeSaveDto.prototype, "chipLabel", void 0);
71
+ __decorate([
72
+ (0, class_validator_1.IsOptional)(),
73
+ (0, class_validator_1.IsString)(),
74
+ (0, class_validator_1.MaxLength)(exports.WIDGET_CHAT_CHIP_EMOJI_MAX),
75
+ (0, class_transformer_1.Expose)(),
76
+ __metadata("design:type", String)
77
+ ], WidgetChatKnowledgeSaveDto.prototype, "chipEmoji", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsInt)(),
81
+ (0, class_validator_1.Min)(0),
82
+ (0, class_transformer_1.Expose)(),
83
+ __metadata("design:type", Number)
84
+ ], WidgetChatKnowledgeSaveDto.prototype, "chipOrder", void 0);
@@ -5,6 +5,12 @@ export type WidgetChatSlotSuggestion = {
5
5
  date: string;
6
6
  players?: number;
7
7
  };
8
+ export type WidgetChatCertificateAction = {
9
+ designId?: number;
10
+ nominalId?: number;
11
+ customNominal?: number;
12
+ deliveryType?: string;
13
+ };
8
14
  export type WidgetChatMessageMeta = {
9
15
  kind: 'slot_suggestions';
10
16
  items: WidgetChatSlotSuggestion[];
@@ -19,6 +25,15 @@ export type WidgetChatMessageMeta = {
19
25
  } | {
20
26
  kind: 'reply_suggestions';
21
27
  items: string[];
28
+ } | {
29
+ kind: 'starter_chip';
30
+ knowledgeId: number;
31
+ } | ({
32
+ kind: 'certificate_action';
33
+ label?: string;
34
+ } & WidgetChatCertificateAction);
35
+ export type WidgetChatMessageAttachments = {
36
+ photos?: string[];
22
37
  };
23
38
  export type WidgetChatMessageRO = {
24
39
  id: number;
@@ -29,5 +44,6 @@ export type WidgetChatMessageRO = {
29
44
  senderPhoto?: string;
30
45
  text: string;
31
46
  meta?: WidgetChatMessageMeta | null;
47
+ photos?: string[];
32
48
  createdAt: Date;
33
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escapenavigator/types",
3
- "version": "1.10.159",
3
+ "version": "1.10.160",
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": "ec89e018a85f2301968b5862bc3c45182eb6c58c",
26
+ "gitHead": "1c0921756d94309b8cf7f405197331fe98adfa0b",
27
27
  "devDependencies": {
28
28
  "@types/validator": "13.0.0",
29
29
  "typescript": "^5.6"