@wrcb/cb-common 1.0.907 → 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 +1 -0
- package/build/index.js +1 -0
- package/build/types/pixReceipt.d.ts +20 -0
- package/build/types/pixReceipt.js +20 -0
- package/build/types/telegram.d.ts +23 -2
- package/package.json +1 -1
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);
|
|
@@ -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?:
|
|
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?:
|
|
66
|
+
document?: TelegramDocument;
|
|
46
67
|
}
|
|
47
68
|
export interface TelegramUpdate {
|
|
48
69
|
update_id: number;
|