@wrcb/cb-common 1.0.897 → 1.0.899
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/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/services/RedisService.d.ts +8 -0
- package/build/services/RedisService.js +17 -0
- package/build/services/TenantDataService.js +52 -0
- package/build/types/clinica.d.ts +239 -0
- package/build/types/clinica.js +126 -0
- package/build/types/crm.d.ts +11 -1
- package/build/types/crm.js +21 -0
- package/build/types/tenant.d.ts +2 -1
- package/build/types/tenant.js +1 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from './types/predictionType';
|
|
|
58
58
|
export * from './types/mercadoProfissional';
|
|
59
59
|
export * from './types/trabalhoHomeOffice';
|
|
60
60
|
export * from './types/crm';
|
|
61
|
+
export * from './types/clinica';
|
|
61
62
|
export * from './types/companion';
|
|
62
63
|
export * from './events/subjects';
|
|
63
64
|
export * from './events/baseListener';
|
package/build/index.js
CHANGED
|
@@ -86,6 +86,7 @@ __exportStar(require("./types/mercadoProfissional"), exports);
|
|
|
86
86
|
__exportStar(require("./types/trabalhoHomeOffice"), exports);
|
|
87
87
|
// crm — núcleo multi-tenant (pipeline configurável + agente de IA)
|
|
88
88
|
__exportStar(require("./types/crm"), exports);
|
|
89
|
+
__exportStar(require("./types/clinica"), exports);
|
|
89
90
|
__exportStar(require("./types/companion"), exports);
|
|
90
91
|
__exportStar(require("./events/subjects"), exports);
|
|
91
92
|
__exportStar(require("./events/baseListener"), exports);
|
|
@@ -21,4 +21,12 @@ export declare class RedisService {
|
|
|
21
21
|
static babeliaWordQuestionsKey(word: string, language: string): string;
|
|
22
22
|
static babeliaTopicsListKey(language: string, level: string, activityType: string, topicType?: string): string;
|
|
23
23
|
static babeliaLeaderboardKey(userId: string): string;
|
|
24
|
+
/** Trava de agenda de UM profissional enquanto um horário é marcado. */
|
|
25
|
+
static clinicaSlotLockKey(tenant: Tenant, professionalId: string): string;
|
|
26
|
+
/** Configuração da agenda da conta (lida a cada mensagem que chega). */
|
|
27
|
+
static clinicaAgendaSettingsKey(tenant: Tenant, ownerId: string): string;
|
|
28
|
+
/** Rodada de um worker periódico: só um pod roda por vez. */
|
|
29
|
+
static clinicaRoundLockKey(tenant: Tenant, worker: string): string;
|
|
30
|
+
/** Cache das leituras da Meta (campanhas, posts) de uma conta. */
|
|
31
|
+
static clinicaMetaCacheKey(tenant: Tenant, ownerId: string, what: string): string;
|
|
24
32
|
}
|
|
@@ -68,5 +68,22 @@ class RedisService {
|
|
|
68
68
|
static babeliaLeaderboardKey(userId) {
|
|
69
69
|
return `babelia:leaderboard:${userId}`;
|
|
70
70
|
}
|
|
71
|
+
// --- Pacientto (clinica-backend) -----------------------------------------
|
|
72
|
+
/** Trava de agenda de UM profissional enquanto um horário é marcado. */
|
|
73
|
+
static clinicaSlotLockKey(tenant, professionalId) {
|
|
74
|
+
return `${tenant}:clinica:slot-lock:${professionalId}`;
|
|
75
|
+
}
|
|
76
|
+
/** Configuração da agenda da conta (lida a cada mensagem que chega). */
|
|
77
|
+
static clinicaAgendaSettingsKey(tenant, ownerId) {
|
|
78
|
+
return `${tenant}:clinica:agenda-settings:${ownerId}`;
|
|
79
|
+
}
|
|
80
|
+
/** Rodada de um worker periódico: só um pod roda por vez. */
|
|
81
|
+
static clinicaRoundLockKey(tenant, worker) {
|
|
82
|
+
return `${tenant}:clinica:round:${worker}`;
|
|
83
|
+
}
|
|
84
|
+
/** Cache das leituras da Meta (campanhas, posts) de uma conta. */
|
|
85
|
+
static clinicaMetaCacheKey(tenant, ownerId, what) {
|
|
86
|
+
return `${tenant}:clinica:meta:${ownerId}:${what}`;
|
|
87
|
+
}
|
|
71
88
|
}
|
|
72
89
|
exports.RedisService = RedisService;
|
|
@@ -1255,5 +1255,57 @@ TenantDataService.tenantDataMap = {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
},
|
|
1257
1257
|
RATING_CRITERIA: undefined
|
|
1258
|
+
},
|
|
1259
|
+
[tenant_1.Tenant.Clinica]: {
|
|
1260
|
+
TENANT: tenant_1.Tenant.Clinica,
|
|
1261
|
+
BACKEND_API_VERSION: '1',
|
|
1262
|
+
SITE_NAME: 'Pacientto',
|
|
1263
|
+
// Domínio ainda não definido.
|
|
1264
|
+
SITE_URL: '',
|
|
1265
|
+
FROM_EMAIL: 'app@wrsolucoesdigitais.com.br',
|
|
1266
|
+
SITE_WHATSAPP_SUPPORT: '37988083717',
|
|
1267
|
+
SITE_WHATSAPP_BOT: '',
|
|
1268
|
+
WHATSAPP_BOT_NUMBER_ID: '',
|
|
1269
|
+
WHATSAPP_TOKEN: '',
|
|
1270
|
+
WHATSAPP_API_URL: '',
|
|
1271
|
+
WHATSAPP_API_VERSION: '',
|
|
1272
|
+
IOS_APP_DOWNLOAD_LINK: '',
|
|
1273
|
+
ANDROID_APP_DOWNLOAD_LINK: '',
|
|
1274
|
+
SITE_DESCRIPTION: 'CRM para clínicas com atendimento automático por WhatsApp com IA: agendamento, confirmação de consultas e acompanhamento de pacientes.',
|
|
1275
|
+
KEYWORDS: [
|
|
1276
|
+
'crm para clinicas',
|
|
1277
|
+
'whatsapp',
|
|
1278
|
+
'agendamento',
|
|
1279
|
+
'atendimento com ia',
|
|
1280
|
+
'pacientes'
|
|
1281
|
+
],
|
|
1282
|
+
SOCIAL_X: '',
|
|
1283
|
+
SOCIAL_YOUTUBE: '',
|
|
1284
|
+
SOCIAL_INSTAGRAM: '',
|
|
1285
|
+
SOCIAL_FACEBOOK: '',
|
|
1286
|
+
USER_CATEGORIES_CONFIG: {},
|
|
1287
|
+
COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_SELLER: [],
|
|
1288
|
+
COUPONS_TYPE_ALLOWED_TO_BE_CREATED_BY_ADMIN: [],
|
|
1289
|
+
EMAIL_HOST: 'smtp.gmail.com',
|
|
1290
|
+
EMAIL_PORT: '587',
|
|
1291
|
+
EMAIL_USER: 'wrsolucoesdig@gmail.com',
|
|
1292
|
+
EMAIL_PASS: 'lwegguaqrzauawsg',
|
|
1293
|
+
AUTH_FACEBOOK_APP_ID: '',
|
|
1294
|
+
AUTH_GOOGLE_ID: '',
|
|
1295
|
+
AUTH_GOOGLE_SECRET: '',
|
|
1296
|
+
GOOGLE_ANALYTICS_MEASUREMENT_ID: '',
|
|
1297
|
+
GOOGLE_VERIFICATION: '',
|
|
1298
|
+
MEDIA_CONFIG: {
|
|
1299
|
+
maxPhotoSizeMB: 5,
|
|
1300
|
+
maxVideoSizeMB: 20,
|
|
1301
|
+
allowedImageFormats: ['jpg', 'jpeg', 'png', 'webp'],
|
|
1302
|
+
allowedVideoFormats: ['mp4', 'webm'],
|
|
1303
|
+
imageQualities: {
|
|
1304
|
+
thumbnail: { width: 150, height: 150, quality: 80 },
|
|
1305
|
+
medium: { width: 800, height: 800, quality: 85 },
|
|
1306
|
+
large: { width: 1200, height: 1200, quality: 90 }
|
|
1307
|
+
}
|
|
1308
|
+
},
|
|
1309
|
+
RATING_CRITERIA: undefined
|
|
1258
1310
|
}
|
|
1259
1311
|
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
export declare enum ClinicaAppointmentStatus {
|
|
2
|
+
AwaitingDeposit = "AwaitingDeposit",
|
|
3
|
+
Confirmed = "Confirmed",
|
|
4
|
+
Cancelled = "Cancelled",
|
|
5
|
+
Completed = "Completed",
|
|
6
|
+
NoShow = "NoShow"
|
|
7
|
+
}
|
|
8
|
+
export declare enum ClinicaAppointmentSource {
|
|
9
|
+
Ai = "Ai",
|
|
10
|
+
Panel = "Panel",
|
|
11
|
+
Assistant = "Assistant"
|
|
12
|
+
}
|
|
13
|
+
export declare enum ClinicaCancelReason {
|
|
14
|
+
PatientRequested = "PatientRequested",
|
|
15
|
+
ClinicRescheduled = "ClinicRescheduled",
|
|
16
|
+
DepositExpired = "DepositExpired",
|
|
17
|
+
Other = "Other"
|
|
18
|
+
}
|
|
19
|
+
export declare enum ClinicaDepositStatus {
|
|
20
|
+
NotRequired = "NotRequired",
|
|
21
|
+
Pending = "Pending",
|
|
22
|
+
Approved = "Approved",
|
|
23
|
+
Rejected = "Rejected",
|
|
24
|
+
Expired = "Expired"
|
|
25
|
+
}
|
|
26
|
+
/** Um intervalo de atendimento na semana. `weekday`: 0 = domingo. */
|
|
27
|
+
export interface ClinicaWeeklySlot {
|
|
28
|
+
weekday: number;
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
}
|
|
32
|
+
/** Lembrete enviado antes do horário marcado (ex.: 1 dia antes). */
|
|
33
|
+
export interface ClinicaReminder {
|
|
34
|
+
beforeMinutes: number;
|
|
35
|
+
text: string | null;
|
|
36
|
+
aiInstruction: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface ClinicaAgendaSettings {
|
|
39
|
+
timezone: string;
|
|
40
|
+
slotMinutes: number;
|
|
41
|
+
minNoticeMinutes: number;
|
|
42
|
+
maxDaysAhead: number;
|
|
43
|
+
depositHoldMinutes: number;
|
|
44
|
+
cancelWithoutLossHours: number;
|
|
45
|
+
pixKey: string | null;
|
|
46
|
+
pixKeyHolder: string | null;
|
|
47
|
+
reminders: ClinicaReminder[];
|
|
48
|
+
readDelaySeconds: number;
|
|
49
|
+
audioEnabled: boolean;
|
|
50
|
+
fishVoiceId: string | null;
|
|
51
|
+
photosEnabled: boolean;
|
|
52
|
+
reclassifySuggestions: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** 1 = só informa, 3 = equilibrada (padrão), 5 = máxima. */
|
|
55
|
+
export type ClinicaAggressiveness = 1 | 2 | 3 | 4 | 5;
|
|
56
|
+
/** Foto de resultado de um atendimento do catálogo. */
|
|
57
|
+
export interface ClinicaServicePhoto {
|
|
58
|
+
id: string;
|
|
59
|
+
key: string;
|
|
60
|
+
caption: string;
|
|
61
|
+
tags: string[];
|
|
62
|
+
consent: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ClinicaStageSuggestion {
|
|
65
|
+
stageKey: string;
|
|
66
|
+
reason: string;
|
|
67
|
+
createdAt: Date;
|
|
68
|
+
}
|
|
69
|
+
export interface ClinicaTestChatMessage {
|
|
70
|
+
role: 'user' | 'assistant';
|
|
71
|
+
content: string;
|
|
72
|
+
}
|
|
73
|
+
/** Uma ferramenta usada pela IA no teste. As que mudam dado são simuladas. */
|
|
74
|
+
export interface ClinicaTestChatStep {
|
|
75
|
+
tool: string;
|
|
76
|
+
arguments: Record<string, string | number | boolean | null | string[]>;
|
|
77
|
+
result: string;
|
|
78
|
+
succeeded: boolean;
|
|
79
|
+
simulated: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface ClinicaTestChatPhoto {
|
|
82
|
+
url: string;
|
|
83
|
+
caption: string;
|
|
84
|
+
}
|
|
85
|
+
export interface ClinicaTestChatResult {
|
|
86
|
+
reply: string;
|
|
87
|
+
steps: ClinicaTestChatStep[];
|
|
88
|
+
sources: string[];
|
|
89
|
+
photos: ClinicaTestChatPhoto[];
|
|
90
|
+
audio: string | null;
|
|
91
|
+
handoff: string | null;
|
|
92
|
+
stageKey: string;
|
|
93
|
+
}
|
|
94
|
+
export declare enum ClinicaMetaStatus {
|
|
95
|
+
Pending = "Pending",
|
|
96
|
+
Active = "Active",
|
|
97
|
+
Expired = "Expired"
|
|
98
|
+
}
|
|
99
|
+
export interface ClinicaMetaPageOption {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
igUserId: string | null;
|
|
103
|
+
igUsername: string | null;
|
|
104
|
+
}
|
|
105
|
+
export interface ClinicaMetaAdAccountOption {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
currency: string;
|
|
109
|
+
}
|
|
110
|
+
export declare enum ClinicaCommentPlatform {
|
|
111
|
+
Instagram = "Instagram",
|
|
112
|
+
Facebook = "Facebook"
|
|
113
|
+
}
|
|
114
|
+
/** Resposta automática a comentários (estilo ManyChat, só comentários). */
|
|
115
|
+
export interface ClinicaCommentRule {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
isActive: boolean;
|
|
119
|
+
platforms: ClinicaCommentPlatform[];
|
|
120
|
+
keywords: string[];
|
|
121
|
+
postIds: string[];
|
|
122
|
+
publicReplies: string[];
|
|
123
|
+
aiPublicReply: boolean;
|
|
124
|
+
privateMessage: string | null;
|
|
125
|
+
}
|
|
126
|
+
export declare enum ClinicaCampaignAutomationMode {
|
|
127
|
+
Off = "Off",
|
|
128
|
+
SemiAutomatic = "SemiAutomatic",
|
|
129
|
+
Automatic = "Automatic"
|
|
130
|
+
}
|
|
131
|
+
export interface ClinicaCampaignLimits {
|
|
132
|
+
maxDailySpendCents: number | null;
|
|
133
|
+
maxMonthlySpendCents: number | null;
|
|
134
|
+
maxBudgetIncreasePercent: number;
|
|
135
|
+
}
|
|
136
|
+
export declare enum ClinicaCampaignActionType {
|
|
137
|
+
Pause = "Pause",
|
|
138
|
+
Activate = "Activate",
|
|
139
|
+
SetDailyBudget = "SetDailyBudget",
|
|
140
|
+
CreateFromPost = "CreateFromPost"
|
|
141
|
+
}
|
|
142
|
+
export declare enum ClinicaCampaignActionOrigin {
|
|
143
|
+
Panel = "Panel",
|
|
144
|
+
Assistant = "Assistant",
|
|
145
|
+
Automation = "Automation"
|
|
146
|
+
}
|
|
147
|
+
export declare enum ClinicaCampaignActionStatus {
|
|
148
|
+
Suggested = "Suggested",
|
|
149
|
+
Executed = "Executed",
|
|
150
|
+
Rejected = "Rejected",
|
|
151
|
+
Failed = "Failed"
|
|
152
|
+
}
|
|
153
|
+
export interface ClinicaCampaignMetrics {
|
|
154
|
+
campaignId: string;
|
|
155
|
+
name: string;
|
|
156
|
+
status: string;
|
|
157
|
+
objective: string | null;
|
|
158
|
+
dailyBudgetCents: number | null;
|
|
159
|
+
spendCents: number;
|
|
160
|
+
impressions: number;
|
|
161
|
+
reach: number;
|
|
162
|
+
clicks: number;
|
|
163
|
+
conversations: number;
|
|
164
|
+
leads: number;
|
|
165
|
+
appointments: number;
|
|
166
|
+
costPerLeadCents: number | null;
|
|
167
|
+
costPerAppointmentCents: number | null;
|
|
168
|
+
}
|
|
169
|
+
export interface ClinicaMetaPost {
|
|
170
|
+
id: string;
|
|
171
|
+
platform: ClinicaCommentPlatform;
|
|
172
|
+
caption: string;
|
|
173
|
+
mediaType: string;
|
|
174
|
+
permalink: string | null;
|
|
175
|
+
thumbnailUrl: string | null;
|
|
176
|
+
publishedAt: string;
|
|
177
|
+
likes: number;
|
|
178
|
+
comments: number;
|
|
179
|
+
reach: number | null;
|
|
180
|
+
saves: number | null;
|
|
181
|
+
shares: number | null;
|
|
182
|
+
views: number | null;
|
|
183
|
+
}
|
|
184
|
+
export interface ClinicaCreativeScript {
|
|
185
|
+
hook: string;
|
|
186
|
+
lines: string[];
|
|
187
|
+
onScreenText: string[];
|
|
188
|
+
caption: string;
|
|
189
|
+
}
|
|
190
|
+
export interface ClinicaCreativeSuggestion {
|
|
191
|
+
title: string;
|
|
192
|
+
basedOn: string[];
|
|
193
|
+
why: string;
|
|
194
|
+
script: ClinicaCreativeScript;
|
|
195
|
+
}
|
|
196
|
+
export interface ClinicaCreativeRankingItem {
|
|
197
|
+
postId: string;
|
|
198
|
+
verdict: 'focar' | 'manter' | 'deixar';
|
|
199
|
+
reason: string;
|
|
200
|
+
}
|
|
201
|
+
/** De qual anúncio veio o contato (clique para o WhatsApp). */
|
|
202
|
+
export interface ClinicaAdReferral {
|
|
203
|
+
adId: string;
|
|
204
|
+
campaignId: string | null;
|
|
205
|
+
headline: string | null;
|
|
206
|
+
sourceUrl: string | null;
|
|
207
|
+
receivedAt: Date;
|
|
208
|
+
}
|
|
209
|
+
export declare enum ClinicaAssistantActionType {
|
|
210
|
+
RequestReschedule = "RequestReschedule",
|
|
211
|
+
MoveAppointment = "MoveAppointment",
|
|
212
|
+
CancelAppointment = "CancelAppointment",
|
|
213
|
+
BlockAgenda = "BlockAgenda",
|
|
214
|
+
SendMessage = "SendMessage",
|
|
215
|
+
MoveLeadStage = "MoveLeadStage",
|
|
216
|
+
PauseCampaign = "PauseCampaign",
|
|
217
|
+
ActivateCampaign = "ActivateCampaign",
|
|
218
|
+
SetCampaignBudget = "SetCampaignBudget",
|
|
219
|
+
CreateCampaignFromPost = "CreateCampaignFromPost"
|
|
220
|
+
}
|
|
221
|
+
export declare enum ClinicaAssistantPlanStatus {
|
|
222
|
+
Proposed = "Proposed",
|
|
223
|
+
Running = "Running",
|
|
224
|
+
Done = "Done",
|
|
225
|
+
PartiallyFailed = "PartiallyFailed",
|
|
226
|
+
Discarded = "Discarded"
|
|
227
|
+
}
|
|
228
|
+
export declare enum ClinicaAssistantActionStatus {
|
|
229
|
+
Pending = "Pending",
|
|
230
|
+
Done = "Done",
|
|
231
|
+
Failed = "Failed"
|
|
232
|
+
}
|
|
233
|
+
export interface ClinicaAssistantAction {
|
|
234
|
+
type: ClinicaAssistantActionType;
|
|
235
|
+
description: string;
|
|
236
|
+
params: Record<string, string | number | boolean | null>;
|
|
237
|
+
status: ClinicaAssistantActionStatus;
|
|
238
|
+
error: string | null;
|
|
239
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Tipos do Pacientto (clinica-backend / clinica-frontend): agenda, sinal por
|
|
3
|
+
// Pix, áudio e assistente de comandos. O núcleo de CRM (funil, conversa,
|
|
4
|
+
// follow-up) continua em ./crm.ts.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClinicaAssistantActionStatus = exports.ClinicaAssistantPlanStatus = exports.ClinicaAssistantActionType = exports.ClinicaCampaignActionStatus = exports.ClinicaCampaignActionOrigin = exports.ClinicaCampaignActionType = exports.ClinicaCampaignAutomationMode = exports.ClinicaCommentPlatform = exports.ClinicaMetaStatus = exports.ClinicaDepositStatus = exports.ClinicaCancelReason = exports.ClinicaAppointmentSource = exports.ClinicaAppointmentStatus = void 0;
|
|
7
|
+
// ============================================
|
|
8
|
+
// AGENDA
|
|
9
|
+
// ============================================
|
|
10
|
+
var ClinicaAppointmentStatus;
|
|
11
|
+
(function (ClinicaAppointmentStatus) {
|
|
12
|
+
// Horário reservado esperando o comprovante do sinal. Libera sozinho quando
|
|
13
|
+
// `deposit.expiresAt` passa.
|
|
14
|
+
ClinicaAppointmentStatus["AwaitingDeposit"] = "AwaitingDeposit";
|
|
15
|
+
ClinicaAppointmentStatus["Confirmed"] = "Confirmed";
|
|
16
|
+
ClinicaAppointmentStatus["Cancelled"] = "Cancelled";
|
|
17
|
+
ClinicaAppointmentStatus["Completed"] = "Completed";
|
|
18
|
+
ClinicaAppointmentStatus["NoShow"] = "NoShow";
|
|
19
|
+
})(ClinicaAppointmentStatus || (exports.ClinicaAppointmentStatus = ClinicaAppointmentStatus = {}));
|
|
20
|
+
var ClinicaAppointmentSource;
|
|
21
|
+
(function (ClinicaAppointmentSource) {
|
|
22
|
+
// Marcado pela IA no WhatsApp.
|
|
23
|
+
ClinicaAppointmentSource["Ai"] = "Ai";
|
|
24
|
+
// Marcado pela equipe no painel.
|
|
25
|
+
ClinicaAppointmentSource["Panel"] = "Panel";
|
|
26
|
+
// Marcado pelo assistente de comandos.
|
|
27
|
+
ClinicaAppointmentSource["Assistant"] = "Assistant";
|
|
28
|
+
})(ClinicaAppointmentSource || (exports.ClinicaAppointmentSource = ClinicaAppointmentSource = {}));
|
|
29
|
+
var ClinicaCancelReason;
|
|
30
|
+
(function (ClinicaCancelReason) {
|
|
31
|
+
ClinicaCancelReason["PatientRequested"] = "PatientRequested";
|
|
32
|
+
ClinicaCancelReason["ClinicRescheduled"] = "ClinicRescheduled";
|
|
33
|
+
ClinicaCancelReason["DepositExpired"] = "DepositExpired";
|
|
34
|
+
ClinicaCancelReason["Other"] = "Other";
|
|
35
|
+
})(ClinicaCancelReason || (exports.ClinicaCancelReason = ClinicaCancelReason = {}));
|
|
36
|
+
var ClinicaDepositStatus;
|
|
37
|
+
(function (ClinicaDepositStatus) {
|
|
38
|
+
ClinicaDepositStatus["NotRequired"] = "NotRequired";
|
|
39
|
+
ClinicaDepositStatus["Pending"] = "Pending";
|
|
40
|
+
ClinicaDepositStatus["Approved"] = "Approved";
|
|
41
|
+
// Comprovante lido mas recusado (valor, chave ou data não batem). Continua
|
|
42
|
+
// esperando um válido até expirar.
|
|
43
|
+
ClinicaDepositStatus["Rejected"] = "Rejected";
|
|
44
|
+
ClinicaDepositStatus["Expired"] = "Expired";
|
|
45
|
+
})(ClinicaDepositStatus || (exports.ClinicaDepositStatus = ClinicaDepositStatus = {}));
|
|
46
|
+
// ============================================
|
|
47
|
+
// META (Instagram e Facebook)
|
|
48
|
+
// ============================================
|
|
49
|
+
var ClinicaMetaStatus;
|
|
50
|
+
(function (ClinicaMetaStatus) {
|
|
51
|
+
// Conectado, esperando escolher a página e a conta de anúncios.
|
|
52
|
+
ClinicaMetaStatus["Pending"] = "Pending";
|
|
53
|
+
ClinicaMetaStatus["Active"] = "Active";
|
|
54
|
+
// O token venceu ou foi revogado: precisa conectar de novo.
|
|
55
|
+
ClinicaMetaStatus["Expired"] = "Expired";
|
|
56
|
+
})(ClinicaMetaStatus || (exports.ClinicaMetaStatus = ClinicaMetaStatus = {}));
|
|
57
|
+
var ClinicaCommentPlatform;
|
|
58
|
+
(function (ClinicaCommentPlatform) {
|
|
59
|
+
ClinicaCommentPlatform["Instagram"] = "Instagram";
|
|
60
|
+
ClinicaCommentPlatform["Facebook"] = "Facebook";
|
|
61
|
+
})(ClinicaCommentPlatform || (exports.ClinicaCommentPlatform = ClinicaCommentPlatform = {}));
|
|
62
|
+
var ClinicaCampaignAutomationMode;
|
|
63
|
+
(function (ClinicaCampaignAutomationMode) {
|
|
64
|
+
ClinicaCampaignAutomationMode["Off"] = "Off";
|
|
65
|
+
// A IA sugere e o admin aprova.
|
|
66
|
+
ClinicaCampaignAutomationMode["SemiAutomatic"] = "SemiAutomatic";
|
|
67
|
+
// A IA executa sozinha, dentro dos limites.
|
|
68
|
+
ClinicaCampaignAutomationMode["Automatic"] = "Automatic";
|
|
69
|
+
})(ClinicaCampaignAutomationMode || (exports.ClinicaCampaignAutomationMode = ClinicaCampaignAutomationMode = {}));
|
|
70
|
+
var ClinicaCampaignActionType;
|
|
71
|
+
(function (ClinicaCampaignActionType) {
|
|
72
|
+
ClinicaCampaignActionType["Pause"] = "Pause";
|
|
73
|
+
ClinicaCampaignActionType["Activate"] = "Activate";
|
|
74
|
+
ClinicaCampaignActionType["SetDailyBudget"] = "SetDailyBudget";
|
|
75
|
+
ClinicaCampaignActionType["CreateFromPost"] = "CreateFromPost";
|
|
76
|
+
})(ClinicaCampaignActionType || (exports.ClinicaCampaignActionType = ClinicaCampaignActionType = {}));
|
|
77
|
+
var ClinicaCampaignActionOrigin;
|
|
78
|
+
(function (ClinicaCampaignActionOrigin) {
|
|
79
|
+
ClinicaCampaignActionOrigin["Panel"] = "Panel";
|
|
80
|
+
ClinicaCampaignActionOrigin["Assistant"] = "Assistant";
|
|
81
|
+
ClinicaCampaignActionOrigin["Automation"] = "Automation";
|
|
82
|
+
})(ClinicaCampaignActionOrigin || (exports.ClinicaCampaignActionOrigin = ClinicaCampaignActionOrigin = {}));
|
|
83
|
+
var ClinicaCampaignActionStatus;
|
|
84
|
+
(function (ClinicaCampaignActionStatus) {
|
|
85
|
+
// Sugerida pela automação, esperando o admin.
|
|
86
|
+
ClinicaCampaignActionStatus["Suggested"] = "Suggested";
|
|
87
|
+
ClinicaCampaignActionStatus["Executed"] = "Executed";
|
|
88
|
+
ClinicaCampaignActionStatus["Rejected"] = "Rejected";
|
|
89
|
+
ClinicaCampaignActionStatus["Failed"] = "Failed";
|
|
90
|
+
})(ClinicaCampaignActionStatus || (exports.ClinicaCampaignActionStatus = ClinicaCampaignActionStatus = {}));
|
|
91
|
+
// ============================================
|
|
92
|
+
// ASSISTENTE DE COMANDOS
|
|
93
|
+
// ============================================
|
|
94
|
+
var ClinicaAssistantActionType;
|
|
95
|
+
(function (ClinicaAssistantActionType) {
|
|
96
|
+
// Desmarca e chama o paciente no WhatsApp para escolher outro horário.
|
|
97
|
+
ClinicaAssistantActionType["RequestReschedule"] = "RequestReschedule";
|
|
98
|
+
// Muda o horário de um agendamento para outro já livre.
|
|
99
|
+
ClinicaAssistantActionType["MoveAppointment"] = "MoveAppointment";
|
|
100
|
+
ClinicaAssistantActionType["CancelAppointment"] = "CancelAppointment";
|
|
101
|
+
// Bloqueia a agenda de um profissional (folga, imprevisto).
|
|
102
|
+
ClinicaAssistantActionType["BlockAgenda"] = "BlockAgenda";
|
|
103
|
+
ClinicaAssistantActionType["SendMessage"] = "SendMessage";
|
|
104
|
+
ClinicaAssistantActionType["MoveLeadStage"] = "MoveLeadStage";
|
|
105
|
+
// Campanhas (só o dono da conta, dentro dos limites de gasto).
|
|
106
|
+
ClinicaAssistantActionType["PauseCampaign"] = "PauseCampaign";
|
|
107
|
+
ClinicaAssistantActionType["ActivateCampaign"] = "ActivateCampaign";
|
|
108
|
+
ClinicaAssistantActionType["SetCampaignBudget"] = "SetCampaignBudget";
|
|
109
|
+
ClinicaAssistantActionType["CreateCampaignFromPost"] = "CreateCampaignFromPost";
|
|
110
|
+
})(ClinicaAssistantActionType || (exports.ClinicaAssistantActionType = ClinicaAssistantActionType = {}));
|
|
111
|
+
var ClinicaAssistantPlanStatus;
|
|
112
|
+
(function (ClinicaAssistantPlanStatus) {
|
|
113
|
+
// Proposto, esperando o "executar" de quem pediu.
|
|
114
|
+
ClinicaAssistantPlanStatus["Proposed"] = "Proposed";
|
|
115
|
+
ClinicaAssistantPlanStatus["Running"] = "Running";
|
|
116
|
+
ClinicaAssistantPlanStatus["Done"] = "Done";
|
|
117
|
+
// Terminou com alguma ação falhando — o detalhe fica em cada ação.
|
|
118
|
+
ClinicaAssistantPlanStatus["PartiallyFailed"] = "PartiallyFailed";
|
|
119
|
+
ClinicaAssistantPlanStatus["Discarded"] = "Discarded";
|
|
120
|
+
})(ClinicaAssistantPlanStatus || (exports.ClinicaAssistantPlanStatus = ClinicaAssistantPlanStatus = {}));
|
|
121
|
+
var ClinicaAssistantActionStatus;
|
|
122
|
+
(function (ClinicaAssistantActionStatus) {
|
|
123
|
+
ClinicaAssistantActionStatus["Pending"] = "Pending";
|
|
124
|
+
ClinicaAssistantActionStatus["Done"] = "Done";
|
|
125
|
+
ClinicaAssistantActionStatus["Failed"] = "Failed";
|
|
126
|
+
})(ClinicaAssistantActionStatus || (exports.ClinicaAssistantActionStatus = ClinicaAssistantActionStatus = {}));
|
package/build/types/crm.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface CrmStage {
|
|
|
49
49
|
isWon: boolean;
|
|
50
50
|
isLost: boolean;
|
|
51
51
|
slaMinutes: number | null;
|
|
52
|
+
aggressiveness?: number | null;
|
|
52
53
|
}
|
|
53
54
|
export declare enum CrmStageChangedBy {
|
|
54
55
|
Ai = "Ai",
|
|
@@ -89,7 +90,16 @@ export declare enum CrmAgentTool {
|
|
|
89
90
|
MoveStage = "MoveStage",
|
|
90
91
|
ScheduleFollowUp = "ScheduleFollowUp",
|
|
91
92
|
RecordField = "RecordField",
|
|
92
|
-
RequestHuman = "RequestHuman"
|
|
93
|
+
RequestHuman = "RequestHuman",
|
|
94
|
+
CheckAvailability = "CheckAvailability",
|
|
95
|
+
BookAppointment = "BookAppointment",
|
|
96
|
+
ListAppointments = "ListAppointments",
|
|
97
|
+
RescheduleAppointment = "RescheduleAppointment",
|
|
98
|
+
CancelAppointment = "CancelAppointment",
|
|
99
|
+
SetAudioConsent = "SetAudioConsent",
|
|
100
|
+
SendAudio = "SendAudio",
|
|
101
|
+
SendServicePhotos = "SendServicePhotos",
|
|
102
|
+
ConfirmPresence = "ConfirmPresence"
|
|
93
103
|
}
|
|
94
104
|
export interface CrmAgentToolCall {
|
|
95
105
|
tool: CrmAgentTool;
|
package/build/types/crm.js
CHANGED
|
@@ -168,6 +168,27 @@ var CrmAgentTool;
|
|
|
168
168
|
CrmAgentTool["RecordField"] = "RecordField";
|
|
169
169
|
// Devolve a conversa para um humano.
|
|
170
170
|
CrmAgentTool["RequestHuman"] = "RequestHuman";
|
|
171
|
+
// --- Agenda (Pacientto) -------------------------------------------------
|
|
172
|
+
// Horários livres de verdade, já descontados agendamentos e bloqueios. O
|
|
173
|
+
// agente só pode oferecer o que esta ferramenta devolver.
|
|
174
|
+
CrmAgentTool["CheckAvailability"] = "CheckAvailability";
|
|
175
|
+
// Marca o horário. Com sinal, nasce reservado aguardando o comprovante Pix.
|
|
176
|
+
CrmAgentTool["BookAppointment"] = "BookAppointment";
|
|
177
|
+
// Agendamentos futuros do contato, para remarcar ou cancelar o certo.
|
|
178
|
+
CrmAgentTool["ListAppointments"] = "ListAppointments";
|
|
179
|
+
CrmAgentTool["RescheduleAppointment"] = "RescheduleAppointment";
|
|
180
|
+
CrmAgentTool["CancelAppointment"] = "CancelAppointment";
|
|
181
|
+
// --- Áudio ----------------------------------------------------------------
|
|
182
|
+
// Grava a resposta do contato à pergunta "posso te mandar um áudio?".
|
|
183
|
+
CrmAgentTool["SetAudioConsent"] = "SetAudioConsent";
|
|
184
|
+
// Gera a fala (FishAudio) e envia como áudio. Só com consentimento.
|
|
185
|
+
CrmAgentTool["SendAudio"] = "SendAudio";
|
|
186
|
+
// --- Catálogo e presença (Pacientto) -------------------------------------
|
|
187
|
+
// Envia fotos de resultado de um atendimento do catálogo (só as que têm
|
|
188
|
+
// autorização do paciente fotografado).
|
|
189
|
+
CrmAgentTool["SendServicePhotos"] = "SendServicePhotos";
|
|
190
|
+
// O paciente confirmou que vai ao horário marcado.
|
|
191
|
+
CrmAgentTool["ConfirmPresence"] = "ConfirmPresence";
|
|
171
192
|
})(CrmAgentTool || (exports.CrmAgentTool = CrmAgentTool = {}));
|
|
172
193
|
/**
|
|
173
194
|
* NÃO SÃO CONFIGURÁVEIS, de propósito — e vale registrar por quê, porque a
|
package/build/types/tenant.d.ts
CHANGED
|
@@ -15,5 +15,6 @@ export declare enum Tenant {
|
|
|
15
15
|
LinkedinAutomator = "LinkedinAutomator",
|
|
16
16
|
NotasBr = "NotasBr",
|
|
17
17
|
TrabalhoHomeOffice = "TrabalhoHomeOffice",
|
|
18
|
-
MercadoProfissional = "MercadoProfissional"
|
|
18
|
+
MercadoProfissional = "MercadoProfissional",
|
|
19
|
+
Clinica = "Clinica"
|
|
19
20
|
}
|
package/build/types/tenant.js
CHANGED