tychat-contracts 1.3.8 → 1.3.9
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/conversations/conversation-type.dto.d.ts +2 -2
- package/dist/conversations/conversation-type.dto.d.ts.map +1 -1
- package/dist/conversations/conversation-type.dto.js +2 -1
- package/dist/conversations/followup-config-response.dto.d.ts +8 -0
- package/dist/conversations/followup-config-response.dto.d.ts.map +1 -1
- package/dist/conversations/followup-config-response.dto.js +80 -0
- package/package.json +1 -1
- package/src/conversations/conversation-type.dto.ts +2 -1
- package/src/conversations/followup-config-response.dto.ts +82 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const CONVERSATION_SESSION_TYPES: readonly ["ia", "human"];
|
|
2
|
-
export declare const CONVERSATION_TYPES: readonly ["ia", "human"];
|
|
1
|
+
export declare const CONVERSATION_SESSION_TYPES: readonly ["ia", "human", "waiting"];
|
|
2
|
+
export declare const CONVERSATION_TYPES: readonly ["ia", "human", "waiting"];
|
|
3
3
|
export type ConversationTypeDto = (typeof CONVERSATION_SESSION_TYPES)[number];
|
|
4
4
|
export declare const CONVERSATION_MESSAGE_TYPES: readonly ["ia", "human", "patient"];
|
|
5
5
|
export type ConversationMessageTypeDto = (typeof CONVERSATION_MESSAGE_TYPES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-type.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-type.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation-type.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/conversation-type.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,qCAAsC,CAAC;AAG9E,eAAO,MAAM,kBAAkB,qCAA6B,CAAC;AAE7D,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAI9E,eAAO,MAAM,0BAA0B,qCAAsC,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -4,7 +4,8 @@ exports.CONVERSATION_MESSAGE_TYPES = exports.CONVERSATION_TYPES = exports.CONVER
|
|
|
4
4
|
// Allowed conversation session types.
|
|
5
5
|
// "ia" → patient interacting with the AI.
|
|
6
6
|
// "human" → human staff member responding to the patient.
|
|
7
|
-
|
|
7
|
+
// "waiting" → waiting queue for human handoff.
|
|
8
|
+
exports.CONVERSATION_SESSION_TYPES = ['ia', 'human', 'waiting'];
|
|
8
9
|
// Backwards-compatible alias for session types.
|
|
9
10
|
exports.CONVERSATION_TYPES = exports.CONVERSATION_SESSION_TYPES;
|
|
10
11
|
// Allowed conversation message types for the `conversations` table.
|
|
@@ -33,5 +33,13 @@ export declare class FollowupConfigResponseDto {
|
|
|
33
33
|
templateReturnSuggestion?: string;
|
|
34
34
|
templateAbandonment?: string;
|
|
35
35
|
enabled: boolean;
|
|
36
|
+
humanPatientIdleWarningDelayMinutes: number;
|
|
37
|
+
humanPatientIdleFinalizeDelayMinutes: number;
|
|
38
|
+
humanAttendantIdleRequeueDelayMinutes: number;
|
|
39
|
+
humanPatientIdleWarningMessage: string;
|
|
40
|
+
humanPatientIdleFinalizeMessage: string;
|
|
41
|
+
humanAttendantIdleRequeueMessage: string;
|
|
42
|
+
humanAfterHoursWaitingMessage: string;
|
|
43
|
+
humanRequestOutsideHoursMessage: string;
|
|
36
44
|
}
|
|
37
45
|
//# sourceMappingURL=followup-config-response.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"followup-config-response.dto.d.ts","sourceRoot":"","sources":["../../src/conversations/followup-config-response.dto.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,qBAAa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A+B,EAAE,MAAM,CAAC;CACzC"}
|
|
@@ -71,6 +71,14 @@ class FollowupConfigResponseDto {
|
|
|
71
71
|
// Global setting
|
|
72
72
|
// ---------------------------------------------------------------------------
|
|
73
73
|
enabled;
|
|
74
|
+
humanPatientIdleWarningDelayMinutes;
|
|
75
|
+
humanPatientIdleFinalizeDelayMinutes;
|
|
76
|
+
humanAttendantIdleRequeueDelayMinutes;
|
|
77
|
+
humanPatientIdleWarningMessage;
|
|
78
|
+
humanPatientIdleFinalizeMessage;
|
|
79
|
+
humanAttendantIdleRequeueMessage;
|
|
80
|
+
humanAfterHoursWaitingMessage;
|
|
81
|
+
humanRequestOutsideHoursMessage;
|
|
74
82
|
}
|
|
75
83
|
exports.FollowupConfigResponseDto = FollowupConfigResponseDto;
|
|
76
84
|
__decorate([
|
|
@@ -259,3 +267,75 @@ __decorate([
|
|
|
259
267
|
(0, class_validator_1.IsBoolean)(),
|
|
260
268
|
__metadata("design:type", Boolean)
|
|
261
269
|
], FollowupConfigResponseDto.prototype, "enabled", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
(0, swagger_1.ApiProperty)({
|
|
272
|
+
description: 'Minutes to send warning when attendant sent the last message and patient did not reply',
|
|
273
|
+
example: 5,
|
|
274
|
+
}),
|
|
275
|
+
(0, class_validator_1.IsInt)(),
|
|
276
|
+
(0, class_validator_1.Min)(1),
|
|
277
|
+
__metadata("design:type", Number)
|
|
278
|
+
], FollowupConfigResponseDto.prototype, "humanPatientIdleWarningDelayMinutes", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, swagger_1.ApiProperty)({
|
|
281
|
+
description: 'Minutes after warning to finalize human attendance and return session to IA',
|
|
282
|
+
example: 10,
|
|
283
|
+
}),
|
|
284
|
+
(0, class_validator_1.IsInt)(),
|
|
285
|
+
(0, class_validator_1.Min)(1),
|
|
286
|
+
__metadata("design:type", Number)
|
|
287
|
+
], FollowupConfigResponseDto.prototype, "humanPatientIdleFinalizeDelayMinutes", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
(0, swagger_1.ApiProperty)({
|
|
290
|
+
description: 'Minutes to requeue when patient sent the last message and attendant did not reply',
|
|
291
|
+
example: 15,
|
|
292
|
+
}),
|
|
293
|
+
(0, class_validator_1.IsInt)(),
|
|
294
|
+
(0, class_validator_1.Min)(1),
|
|
295
|
+
__metadata("design:type", Number)
|
|
296
|
+
], FollowupConfigResponseDto.prototype, "humanAttendantIdleRequeueDelayMinutes", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
(0, swagger_1.ApiProperty)({
|
|
299
|
+
description: 'Message sent as warning when patient is idle during human attendance',
|
|
300
|
+
example: 'Ainda estamos aguardando sua resposta. Em alguns minutos, o atendimento humano sera finalizado caso nao haja retorno.',
|
|
301
|
+
}),
|
|
302
|
+
(0, class_validator_1.IsString)(),
|
|
303
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
304
|
+
__metadata("design:type", String)
|
|
305
|
+
], FollowupConfigResponseDto.prototype, "humanPatientIdleWarningMessage", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
(0, swagger_1.ApiProperty)({
|
|
308
|
+
description: 'Message sent when human attendance is finalized due to patient inactivity',
|
|
309
|
+
example: 'Como nao recebemos seu retorno, encerramos o atendimento humano por agora. Se precisar, posso continuar seu atendimento por IA.',
|
|
310
|
+
}),
|
|
311
|
+
(0, class_validator_1.IsString)(),
|
|
312
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
313
|
+
__metadata("design:type", String)
|
|
314
|
+
], FollowupConfigResponseDto.prototype, "humanPatientIdleFinalizeMessage", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
(0, swagger_1.ApiProperty)({
|
|
317
|
+
description: 'Message sent when session is requeued due to attendant inactivity',
|
|
318
|
+
example: 'Devido a alta demanda, outro atendente continuara seu atendimento em breve.',
|
|
319
|
+
}),
|
|
320
|
+
(0, class_validator_1.IsString)(),
|
|
321
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
322
|
+
__metadata("design:type", String)
|
|
323
|
+
], FollowupConfigResponseDto.prototype, "humanAttendantIdleRequeueMessage", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
(0, swagger_1.ApiProperty)({
|
|
326
|
+
description: 'Message sent when clinic is closed and session remains in waiting queue',
|
|
327
|
+
example: 'Nosso horario de atendimento foi encerrado. Retornaremos o contato no proximo dia util.',
|
|
328
|
+
}),
|
|
329
|
+
(0, class_validator_1.IsString)(),
|
|
330
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
331
|
+
__metadata("design:type", String)
|
|
332
|
+
], FollowupConfigResponseDto.prototype, "humanAfterHoursWaitingMessage", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
(0, swagger_1.ApiProperty)({
|
|
335
|
+
description: 'Message sent when patient requests human support outside clinic hours',
|
|
336
|
+
example: 'No momento estamos fora do horario de atendimento humano. Sua conversa foi para a fila e retornaremos no proximo dia util.',
|
|
337
|
+
}),
|
|
338
|
+
(0, class_validator_1.IsString)(),
|
|
339
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
340
|
+
__metadata("design:type", String)
|
|
341
|
+
], FollowupConfigResponseDto.prototype, "humanRequestOutsideHoursMessage", void 0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Allowed conversation session types.
|
|
2
2
|
// "ia" → patient interacting with the AI.
|
|
3
3
|
// "human" → human staff member responding to the patient.
|
|
4
|
-
|
|
4
|
+
// "waiting" → waiting queue for human handoff.
|
|
5
|
+
export const CONVERSATION_SESSION_TYPES = ['ia', 'human', 'waiting'] as const;
|
|
5
6
|
|
|
6
7
|
// Backwards-compatible alias for session types.
|
|
7
8
|
export const CONVERSATION_TYPES = CONVERSATION_SESSION_TYPES;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsInt,
|
|
5
|
+
IsNotEmpty,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
MaxLength,
|
|
9
|
+
Min,
|
|
10
|
+
} from 'class-validator';
|
|
3
11
|
|
|
4
12
|
/**
|
|
5
13
|
* Represents a follow-up timing configuration for a tenant.
|
|
@@ -197,4 +205,77 @@ export class FollowupConfigResponseDto {
|
|
|
197
205
|
@ApiProperty({ description: 'Whether abandonment follow-up is enabled for this tenant' })
|
|
198
206
|
@IsBoolean()
|
|
199
207
|
enabled: boolean;
|
|
208
|
+
|
|
209
|
+
@ApiProperty({
|
|
210
|
+
description:
|
|
211
|
+
'Minutes to send warning when attendant sent the last message and patient did not reply',
|
|
212
|
+
example: 5,
|
|
213
|
+
})
|
|
214
|
+
@IsInt()
|
|
215
|
+
@Min(1)
|
|
216
|
+
humanPatientIdleWarningDelayMinutes: number;
|
|
217
|
+
|
|
218
|
+
@ApiProperty({
|
|
219
|
+
description:
|
|
220
|
+
'Minutes after warning to finalize human attendance and return session to IA',
|
|
221
|
+
example: 10,
|
|
222
|
+
})
|
|
223
|
+
@IsInt()
|
|
224
|
+
@Min(1)
|
|
225
|
+
humanPatientIdleFinalizeDelayMinutes: number;
|
|
226
|
+
|
|
227
|
+
@ApiProperty({
|
|
228
|
+
description:
|
|
229
|
+
'Minutes to requeue when patient sent the last message and attendant did not reply',
|
|
230
|
+
example: 15,
|
|
231
|
+
})
|
|
232
|
+
@IsInt()
|
|
233
|
+
@Min(1)
|
|
234
|
+
humanAttendantIdleRequeueDelayMinutes: number;
|
|
235
|
+
|
|
236
|
+
@ApiProperty({
|
|
237
|
+
description: 'Message sent as warning when patient is idle during human attendance',
|
|
238
|
+
example:
|
|
239
|
+
'Ainda estamos aguardando sua resposta. Em alguns minutos, o atendimento humano sera finalizado caso nao haja retorno.',
|
|
240
|
+
})
|
|
241
|
+
@IsString()
|
|
242
|
+
@MaxLength(5000)
|
|
243
|
+
humanPatientIdleWarningMessage: string;
|
|
244
|
+
|
|
245
|
+
@ApiProperty({
|
|
246
|
+
description: 'Message sent when human attendance is finalized due to patient inactivity',
|
|
247
|
+
example:
|
|
248
|
+
'Como nao recebemos seu retorno, encerramos o atendimento humano por agora. Se precisar, posso continuar seu atendimento por IA.',
|
|
249
|
+
})
|
|
250
|
+
@IsString()
|
|
251
|
+
@MaxLength(5000)
|
|
252
|
+
humanPatientIdleFinalizeMessage: string;
|
|
253
|
+
|
|
254
|
+
@ApiProperty({
|
|
255
|
+
description: 'Message sent when session is requeued due to attendant inactivity',
|
|
256
|
+
example:
|
|
257
|
+
'Devido a alta demanda, outro atendente continuara seu atendimento em breve.',
|
|
258
|
+
})
|
|
259
|
+
@IsString()
|
|
260
|
+
@MaxLength(5000)
|
|
261
|
+
humanAttendantIdleRequeueMessage: string;
|
|
262
|
+
|
|
263
|
+
@ApiProperty({
|
|
264
|
+
description: 'Message sent when clinic is closed and session remains in waiting queue',
|
|
265
|
+
example:
|
|
266
|
+
'Nosso horario de atendimento foi encerrado. Retornaremos o contato no proximo dia util.',
|
|
267
|
+
})
|
|
268
|
+
@IsString()
|
|
269
|
+
@MaxLength(5000)
|
|
270
|
+
humanAfterHoursWaitingMessage: string;
|
|
271
|
+
|
|
272
|
+
@ApiProperty({
|
|
273
|
+
description:
|
|
274
|
+
'Message sent when patient requests human support outside clinic hours',
|
|
275
|
+
example:
|
|
276
|
+
'No momento estamos fora do horario de atendimento humano. Sua conversa foi para a fila e retornaremos no proximo dia util.',
|
|
277
|
+
})
|
|
278
|
+
@IsString()
|
|
279
|
+
@MaxLength(5000)
|
|
280
|
+
humanRequestOutsideHoursMessage: string;
|
|
200
281
|
}
|