@wrcb/cb-common 1.0.906 → 1.0.908

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 CHANGED
@@ -61,6 +61,7 @@ export * from './types/crm';
61
61
  export * from './types/clinica';
62
62
  export * from './types/companion';
63
63
  export * from './types/telegram';
64
+ export * from './types/pixReceipt';
64
65
  export * from './events/subjects';
65
66
  export * from './events/baseListener';
66
67
  export * from './events/basePublisher';
package/build/index.js CHANGED
@@ -89,6 +89,7 @@ __exportStar(require("./types/crm"), exports);
89
89
  __exportStar(require("./types/clinica"), exports);
90
90
  __exportStar(require("./types/companion"), exports);
91
91
  __exportStar(require("./types/telegram"), exports);
92
+ __exportStar(require("./types/pixReceipt"), exports);
92
93
  __exportStar(require("./events/subjects"), exports);
93
94
  __exportStar(require("./events/baseListener"), exports);
94
95
  __exportStar(require("./events/basePublisher"), exports);
@@ -135,6 +135,7 @@ export interface ClinicaMetaAdAccountOption {
135
135
  id: string;
136
136
  name: string;
137
137
  currency: string;
138
+ businessName?: string | null;
138
139
  }
139
140
  export declare enum ClinicaCommentPlatform {
140
141
  Instagram = "Instagram",
@@ -231,10 +232,38 @@ export interface ClinicaCreativeRankingItem {
231
232
  export interface ClinicaAdReferral {
232
233
  adId: string;
233
234
  campaignId: string | null;
235
+ adName?: string | null;
236
+ adsetName?: string | null;
237
+ campaignName?: string | null;
234
238
  headline: string | null;
235
239
  sourceUrl: string | null;
236
240
  receivedAt: Date;
237
241
  }
242
+ /** Opção do filtro "Anúncio" no funil. */
243
+ export interface ClinicaAdFilterOption {
244
+ adId: string;
245
+ name: string;
246
+ total: number;
247
+ }
248
+ /** Resultado de um anúncio no período: gasto da Meta, contatos e agendamentos do Pacientto. */
249
+ export interface ClinicaAdMetrics {
250
+ adId: string;
251
+ name: string;
252
+ adsetName: string | null;
253
+ campaignName: string | null;
254
+ status: string | null;
255
+ spendCents: number;
256
+ conversations: number;
257
+ leads: number;
258
+ appointments: number;
259
+ stages: {
260
+ key: string;
261
+ label: string;
262
+ total: number;
263
+ }[];
264
+ costPerLeadCents: number | null;
265
+ costPerAppointmentCents: number | null;
266
+ }
238
267
  export declare enum ClinicaAssistantActionType {
239
268
  RequestReschedule = "RequestReschedule",
240
269
  MoveAppointment = "MoveAppointment",
@@ -0,0 +1,20 @@
1
+ /** O que o modelo leu no comprovante. Nada aqui é confiável até ser validado. */
2
+ export interface PixReceiptReading {
3
+ /** A imagem ou o PDF é mesmo um comprovante de Pix. */
4
+ isPixReceipt: boolean;
5
+ /** Valor pago, em centavos. */
6
+ amountCents: number | null;
7
+ /** Código da transação (ID da transação / E2E), 32 caracteres. */
8
+ endToEndId: string | null;
9
+ /** Nome de quem recebeu, como aparece no comprovante. */
10
+ recipient: string | null;
11
+ }
12
+ /** Por que um comprovante não liberou mensagens. */
13
+ export declare enum PixReceiptRejection {
14
+ NotAReceipt = "NotAReceipt",
15
+ Unreadable = "Unreadable",
16
+ AmountTooLow = "AmountTooLow",
17
+ WrongRecipient = "WrongRecipient",
18
+ Expired = "Expired",
19
+ AlreadyUsed = "AlreadyUsed"
20
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // ============================================
3
+ // COMPROVANTE DE PIX (créditos de mensagens no Telegram)
4
+ // ============================================
5
+ //
6
+ // A pessoa paga a chave Pix e manda o comprovante (foto ou PDF) na conversa.
7
+ // Um modelo de visão lê o que está escrito; quem decide se vale é o código,
8
+ // que confere valor, recebedor, janela de tempo e se o comprovante já foi usado.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.PixReceiptRejection = void 0;
11
+ /** Por que um comprovante não liberou mensagens. */
12
+ var PixReceiptRejection;
13
+ (function (PixReceiptRejection) {
14
+ PixReceiptRejection["NotAReceipt"] = "NotAReceipt";
15
+ PixReceiptRejection["Unreadable"] = "Unreadable";
16
+ PixReceiptRejection["AmountTooLow"] = "AmountTooLow";
17
+ PixReceiptRejection["WrongRecipient"] = "WrongRecipient";
18
+ PixReceiptRejection["Expired"] = "Expired";
19
+ PixReceiptRejection["AlreadyUsed"] = "AlreadyUsed";
20
+ })(PixReceiptRejection || (exports.PixReceiptRejection = PixReceiptRejection = {}));
@@ -26,6 +26,27 @@ export interface TelegramBusinessConnection {
26
26
  rights?: TelegramBusinessBotRights;
27
27
  is_enabled: boolean;
28
28
  }
29
+ /** Um tamanho de foto; a última da lista é a maior. */
30
+ export interface TelegramPhotoSize {
31
+ file_id: string;
32
+ file_unique_id: string;
33
+ width: number;
34
+ height: number;
35
+ file_size?: number;
36
+ }
37
+ export interface TelegramDocument {
38
+ file_id: string;
39
+ file_unique_id: string;
40
+ file_name?: string;
41
+ mime_type?: string;
42
+ file_size?: number;
43
+ }
44
+ /** Resposta do `getFile`: o caminho para baixar o arquivo. */
45
+ export interface TelegramFile {
46
+ file_id: string;
47
+ file_path?: string;
48
+ file_size?: number;
49
+ }
29
50
  export interface TelegramMessage {
30
51
  message_id: number;
31
52
  date: number;
@@ -36,13 +57,13 @@ export interface TelegramMessage {
36
57
  sender_business_bot?: TelegramUser;
37
58
  text?: string;
38
59
  caption?: string;
39
- photo?: unknown[];
60
+ photo?: TelegramPhotoSize[];
40
61
  video?: unknown;
41
62
  video_note?: unknown;
42
63
  voice?: unknown;
43
64
  audio?: unknown;
44
65
  sticker?: unknown;
45
- document?: unknown;
66
+ document?: TelegramDocument;
46
67
  }
47
68
  export interface TelegramUpdate {
48
69
  update_id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.906",
3
+ "version": "1.0.908",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",