@japcon-bot/bot 1.0.0
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/LICENSE.md +21 -0
- package/README.md +21 -0
- package/dist/context/globalstateClass.d.ts +34 -0
- package/dist/context/globalstateClass.d.ts.map +1 -0
- package/dist/context/idlestateClass.d.ts +37 -0
- package/dist/context/idlestateClass.d.ts.map +1 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/stateClass.d.ts +44 -0
- package/dist/context/stateClass.d.ts.map +1 -0
- package/dist/core/coreClass.d.ts +129 -0
- package/dist/core/coreClass.d.ts.map +1 -0
- package/dist/core/eventEmitterClass.d.ts +19 -0
- package/dist/core/eventEmitterClass.d.ts.map +1 -0
- package/dist/db/index.d.ts +16 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/index.cjs +34954 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/io/events/eventAction.d.ts +3 -0
- package/dist/io/events/eventAction.d.ts.map +1 -0
- package/dist/io/events/eventCall.d.ts +4 -0
- package/dist/io/events/eventCall.d.ts.map +1 -0
- package/dist/io/events/eventCustom.d.ts +4 -0
- package/dist/io/events/eventCustom.d.ts.map +1 -0
- package/dist/io/events/eventDocument.d.ts +4 -0
- package/dist/io/events/eventDocument.d.ts.map +1 -0
- package/dist/io/events/eventLocation.d.ts +4 -0
- package/dist/io/events/eventLocation.d.ts.map +1 -0
- package/dist/io/events/eventMedia.d.ts +4 -0
- package/dist/io/events/eventMedia.d.ts.map +1 -0
- package/dist/io/events/eventOrder.d.ts +4 -0
- package/dist/io/events/eventOrder.d.ts.map +1 -0
- package/dist/io/events/eventTemplate.d.ts +4 -0
- package/dist/io/events/eventTemplate.d.ts.map +1 -0
- package/dist/io/events/eventVoiceNote.d.ts +4 -0
- package/dist/io/events/eventVoiceNote.d.ts.map +1 -0
- package/dist/io/events/eventWelcome.d.ts +3 -0
- package/dist/io/events/eventWelcome.d.ts.map +1 -0
- package/dist/io/events/index.d.ts +17 -0
- package/dist/io/events/index.d.ts.map +1 -0
- package/dist/io/flowClass.d.ts +20 -0
- package/dist/io/flowClass.d.ts.map +1 -0
- package/dist/io/methods/addAnswer.d.ts +9 -0
- package/dist/io/methods/addAnswer.d.ts.map +1 -0
- package/dist/io/methods/addChild.d.ts +10 -0
- package/dist/io/methods/addChild.d.ts.map +1 -0
- package/dist/io/methods/addKeyword.d.ts +10 -0
- package/dist/io/methods/addKeyword.d.ts.map +1 -0
- package/dist/io/methods/index.d.ts +8 -0
- package/dist/io/methods/index.d.ts.map +1 -0
- package/dist/io/methods/toCtx.d.ts +20 -0
- package/dist/io/methods/toCtx.d.ts.map +1 -0
- package/dist/io/methods/toJson.d.ts +4 -0
- package/dist/io/methods/toJson.d.ts.map +1 -0
- package/dist/io/methods/toSerialize.d.ts +9 -0
- package/dist/io/methods/toSerialize.d.ts.map +1 -0
- package/dist/provider/interface/provider.d.ts +163 -0
- package/dist/provider/interface/provider.d.ts.map +1 -0
- package/dist/provider/interface/server.d.ts +60 -0
- package/dist/provider/interface/server.d.ts.map +1 -0
- package/dist/provider/providerMock.d.ts +19 -0
- package/dist/provider/providerMock.d.ts.map +1 -0
- package/dist/types.d.ts +289 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/blacklistClass.d.ts +38 -0
- package/dist/utils/blacklistClass.d.ts.map +1 -0
- package/dist/utils/cleanImage.d.ts +8 -0
- package/dist/utils/cleanImage.d.ts.map +1 -0
- package/dist/utils/convertAudio.d.ts +7 -0
- package/dist/utils/convertAudio.d.ts.map +1 -0
- package/dist/utils/delay.d.ts +7 -0
- package/dist/utils/delay.d.ts.map +1 -0
- package/dist/utils/download.d.ts +10 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/event.d.ts +19 -0
- package/dist/utils/event.d.ts.map +1 -0
- package/dist/utils/flattener.d.ts +10 -0
- package/dist/utils/flattener.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +47 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/interactive.d.ts +10 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/queueClass.d.ts +29 -0
- package/dist/utils/queueClass.d.ts.map +1 -0
- package/package.json +66 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Este archivo contiene las definiciones de tipos utilizadas en el proyecto.
|
|
3
|
+
*/
|
|
4
|
+
import type { IdleState } from './context';
|
|
5
|
+
import type { ProviderClass } from './provider/interface/provider';
|
|
6
|
+
import type { Queue } from './utils';
|
|
7
|
+
export type CustomNameEvent = string;
|
|
8
|
+
export type GlobalVendorArgs<V = {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}> = {
|
|
11
|
+
name?: string;
|
|
12
|
+
port?: number;
|
|
13
|
+
writeMyself?: 'none' | 'host' | 'both';
|
|
14
|
+
} & V;
|
|
15
|
+
export type ProviderEventTypes = {
|
|
16
|
+
message: [arg1: BotContext];
|
|
17
|
+
require_action: [
|
|
18
|
+
arg1: {
|
|
19
|
+
title: string;
|
|
20
|
+
instructions: string[];
|
|
21
|
+
payload?: {
|
|
22
|
+
qr?: string;
|
|
23
|
+
code?: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
notice: [arg1: {
|
|
29
|
+
title: string;
|
|
30
|
+
instructions: string[];
|
|
31
|
+
}];
|
|
32
|
+
ready: any;
|
|
33
|
+
auth_failure: any;
|
|
34
|
+
host: any;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
export type GeneralArgs = {
|
|
38
|
+
blackList?: string[];
|
|
39
|
+
listEvents?: Record<string, any>;
|
|
40
|
+
delay?: number;
|
|
41
|
+
logs?: {
|
|
42
|
+
notices?: boolean;
|
|
43
|
+
};
|
|
44
|
+
globalState?: Record<string, any>;
|
|
45
|
+
extensions?: Record<string, any>;
|
|
46
|
+
queue?: {
|
|
47
|
+
timeout: number;
|
|
48
|
+
concurrencyLimit: number;
|
|
49
|
+
};
|
|
50
|
+
host?: string;
|
|
51
|
+
};
|
|
52
|
+
export type FlagsRuntime = {
|
|
53
|
+
endFlow: any;
|
|
54
|
+
fallBack?: boolean;
|
|
55
|
+
flowDynamic?: boolean;
|
|
56
|
+
gotoFlow?: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type Button = {
|
|
59
|
+
body: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* @typedef ActionPropertiesKeyword
|
|
63
|
+
* @property {string} [ref] - [NO USAR - SOLO DEV] se usa para darle un ID especifico al flow.
|
|
64
|
+
* @property {boolean} [capture] - Indica si se debe capturar la acción.
|
|
65
|
+
* @property {number} [idle] - Tiempo de retraso para respuesta.
|
|
66
|
+
* @property {number} [delay] - Tiempo de retraso para la acción.
|
|
67
|
+
* @property {boolean} [regex] - Indica si se debe usar una expresión regular.
|
|
68
|
+
* @property {boolean} [sensitive] - Indica si la acción es sensible.
|
|
69
|
+
*/
|
|
70
|
+
export type ActionPropertiesKeyword = {
|
|
71
|
+
/** @deprecated Intern use. */
|
|
72
|
+
ref?: string;
|
|
73
|
+
/** @deprecated */
|
|
74
|
+
idle?: number;
|
|
75
|
+
buttons?: Button[];
|
|
76
|
+
media?: string;
|
|
77
|
+
capture?: boolean;
|
|
78
|
+
delay?: number;
|
|
79
|
+
regex?: boolean;
|
|
80
|
+
sensitive?: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* @typedef ActionPropertiesGeneric
|
|
84
|
+
* @type {Omit<ActionPropertiesKeyword, "sensitive" | "regex">}
|
|
85
|
+
*/
|
|
86
|
+
export type ActionPropertiesGeneric = Omit<ActionPropertiesKeyword, 'sensitive' | 'regex'>;
|
|
87
|
+
/**
|
|
88
|
+
* @typedef BotContext
|
|
89
|
+
* @property {string} [name] - Nombre del usuario.
|
|
90
|
+
* @property {string} body - Cuerpo del mensaje.
|
|
91
|
+
* @property {string} from - Origen del mensaje.
|
|
92
|
+
*/
|
|
93
|
+
export type BotContext = {
|
|
94
|
+
name?: string;
|
|
95
|
+
host?: {
|
|
96
|
+
phone: string;
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
};
|
|
99
|
+
/** @deprecated */
|
|
100
|
+
idleFallBack?: boolean;
|
|
101
|
+
body: string;
|
|
102
|
+
from: string;
|
|
103
|
+
[key: string]: any;
|
|
104
|
+
};
|
|
105
|
+
export type MessageContextIncoming = {
|
|
106
|
+
from: string;
|
|
107
|
+
ref?: string;
|
|
108
|
+
body?: string;
|
|
109
|
+
host?: string;
|
|
110
|
+
source_id?: string;
|
|
111
|
+
source_type?: string;
|
|
112
|
+
ctwa_id?: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* @typedef FlowDynamicMessage
|
|
116
|
+
* @property {string} body - Cuerpo del mensaje.
|
|
117
|
+
* @property {number} [delay] - Tiempo de retraso para el mensaje.
|
|
118
|
+
* @property {string} [media] - Medio del mensaje.
|
|
119
|
+
*/
|
|
120
|
+
export type FlowDynamicMessage = {
|
|
121
|
+
body?: string;
|
|
122
|
+
buttons?: Button[];
|
|
123
|
+
delay?: number;
|
|
124
|
+
media?: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* @typedef BotState
|
|
128
|
+
* @property {(props: any) => Promise<void>} update - Actualiza el estado del bot.
|
|
129
|
+
* @property {<K>() => { [key: string]: any | K }} getMyState - Obtiene el estado actual del bot.
|
|
130
|
+
* @property {(prop: string) => any} get - Obtiene una propiedad del estado del bot.
|
|
131
|
+
* @property {() => { [key: string]: any }} getAllState - Obtiene todo el estado del bot.
|
|
132
|
+
* @property {() => void} clear - Limpia el estado del bot.
|
|
133
|
+
*/
|
|
134
|
+
export type BotState = {
|
|
135
|
+
update: (props: {
|
|
136
|
+
[key: string]: any;
|
|
137
|
+
}) => Promise<void>;
|
|
138
|
+
getMyState: <K = any>() => {
|
|
139
|
+
[key: string]: K;
|
|
140
|
+
};
|
|
141
|
+
get: <K = any>(prop: string) => K;
|
|
142
|
+
getAllState: () => {
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
};
|
|
145
|
+
clear: () => void;
|
|
146
|
+
};
|
|
147
|
+
export type BotStateStandAlone = Omit<BotState, 'getAllState'>;
|
|
148
|
+
export type BotStateGlobal = Omit<BotState, 'getMyState'>;
|
|
149
|
+
export type DynamicBlacklist = {
|
|
150
|
+
add: (phoneNumbers: string | string[]) => string[];
|
|
151
|
+
remove: (phoneNumber: string) => void;
|
|
152
|
+
checkIf: (phoneNumber: string) => boolean;
|
|
153
|
+
getList: () => string[];
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* P = typeof provider
|
|
157
|
+
* B = typeof database
|
|
158
|
+
* @typedef BotMethods
|
|
159
|
+
* @property {(messages: string | FlowDynamicMessage[]) => Promise<void>} flowDynamic - Define el flujo dinámico del bot.
|
|
160
|
+
* @property {(flow: any) => Promise<void>} gotoFlow - Dirige al bot a un flujo específico.
|
|
161
|
+
* @property {(message?: string) => void} endFlow - Termina el flujo del bot.
|
|
162
|
+
* @property {(message?: string) => void} fallBack - Define la acción de retroceso del bot.
|
|
163
|
+
* @property {BotState} state - Estado del bot.
|
|
164
|
+
* @property {any} extensions - Extensiones del bot.
|
|
165
|
+
*/
|
|
166
|
+
export type BotMethods<P = {}, B = {}> = {
|
|
167
|
+
flowDynamic: (messages: string | string[] | FlowDynamicMessage[], opts?: {
|
|
168
|
+
delay: number;
|
|
169
|
+
}) => Promise<void>;
|
|
170
|
+
gotoFlow: (flow: TFlow<P>, step?: number) => Promise<void>;
|
|
171
|
+
endFlow: (message?: string) => void;
|
|
172
|
+
fallBack: (message?: string) => void;
|
|
173
|
+
provider: P;
|
|
174
|
+
database: B;
|
|
175
|
+
flows: TFlow<P, B>[];
|
|
176
|
+
/** @deprecated */
|
|
177
|
+
inRef: string;
|
|
178
|
+
/** @deprecated */
|
|
179
|
+
idle: IdleState;
|
|
180
|
+
state: BotStateStandAlone;
|
|
181
|
+
blacklist: DynamicBlacklist;
|
|
182
|
+
globalState: BotStateGlobal;
|
|
183
|
+
queue: Queue<any>;
|
|
184
|
+
extensions: Record<string, any>;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* @typedef CallbackFunction
|
|
188
|
+
* @type {(context: BotContext, methods: BotMethods) => void}
|
|
189
|
+
*/
|
|
190
|
+
export type CallbackFunction<P, B> = (context: BotContext, methods: BotMethods<P, B>) => void;
|
|
191
|
+
/**
|
|
192
|
+
* @typedef TCTXoptions
|
|
193
|
+
* @property {null | string} [media] - Medio del mensaje.
|
|
194
|
+
* @property {any[]} [buttons] - Botones del mensaje.
|
|
195
|
+
* @property {boolean} [capture] - Indica si se debe capturar el mensaje.
|
|
196
|
+
* @property {null | any} [child] - Hijo del mensaje.
|
|
197
|
+
* @property {number} [delay] - Tiempo de retraso para el mensaje.
|
|
198
|
+
* @property {null | any} [idle] - Estado de inactividad del mensaje.
|
|
199
|
+
* @property {null | string} [ref] - Referencia del mensaje.
|
|
200
|
+
* @property {any[]} [nested] - Mensajes anidados.
|
|
201
|
+
* @property {string | string[]} [keyword] - Palabra clave del mensaje.
|
|
202
|
+
* @property {boolean} [callback] - Indica si se debe usar una función de devolución de llamada.
|
|
203
|
+
*/
|
|
204
|
+
export interface TCTXoptions extends ActionPropertiesKeyword {
|
|
205
|
+
media?: null | string;
|
|
206
|
+
buttons?: Button[];
|
|
207
|
+
capture?: boolean;
|
|
208
|
+
child?: null | any;
|
|
209
|
+
delay?: number;
|
|
210
|
+
idle?: null | any;
|
|
211
|
+
ref?: null | string;
|
|
212
|
+
nested?: any[];
|
|
213
|
+
keyword?: string | string[] | {};
|
|
214
|
+
callback?: boolean;
|
|
215
|
+
answer?: string;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @typedef Callbacks
|
|
219
|
+
* @type {{ [key: string]: () => void }}
|
|
220
|
+
*/
|
|
221
|
+
export interface Callbacks {
|
|
222
|
+
[key: string]: Function;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* @typedef TContext
|
|
226
|
+
* @property {string} ref - Referencia del contexto.
|
|
227
|
+
* @property {string} keyword - Palabra clave del contexto.
|
|
228
|
+
* @property {string | string[]} answer - Respuesta del contexto.
|
|
229
|
+
* @property {string} [refSerialize] - Referencia serializada del contexto.
|
|
230
|
+
* @property {TCTXoptions} options - Opciones del contexto.
|
|
231
|
+
* @property {Callbacks} callbacks - Funciones de devolución de llamada del contexto.
|
|
232
|
+
* @property {TContext} json - Objeto JSON del contexto.
|
|
233
|
+
*/
|
|
234
|
+
export interface TContext {
|
|
235
|
+
ref: string;
|
|
236
|
+
keyword: string | string[];
|
|
237
|
+
from?: string;
|
|
238
|
+
answer?: string | string[];
|
|
239
|
+
source_id?: string;
|
|
240
|
+
source_type?: string;
|
|
241
|
+
ctwa_id?: string;
|
|
242
|
+
refSerialize?: string;
|
|
243
|
+
endFlow?: boolean;
|
|
244
|
+
options: TCTXoptions;
|
|
245
|
+
callbacks?: Callbacks;
|
|
246
|
+
json?: TContext[];
|
|
247
|
+
ctx?: TContext;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @typedef TFlow
|
|
251
|
+
* @property {TContext} ctx - Contexto del flujo.
|
|
252
|
+
* @property {string} ref - Referencia del flujo.
|
|
253
|
+
* @property {(answer: string) => void} addAnswer - Añade una respuesta al flujo.
|
|
254
|
+
* @property {(action: any) => void} addAction - Añade una acción al flujo.
|
|
255
|
+
* @property {() => TContext} toJson - Convierte el flujo a un objeto JSON.
|
|
256
|
+
*/
|
|
257
|
+
export interface TFlow<P = any, B = any> {
|
|
258
|
+
ctx: TContext;
|
|
259
|
+
ref: string;
|
|
260
|
+
addAnswer: (answer: string | string[], options?: ActionPropertiesKeyword | null, cb?: CallbackFunction<P, B> | null, nested?: TFlow<P, B> | TFlow<P, B>[] | null) => TFlow<P, B>;
|
|
261
|
+
addAction: (actionProps: ActionPropertiesGeneric | CallbackFunction<P, B>, cb?: CallbackFunction<P, B>, nested?: TFlow<P, B> | TFlow<P, B>[] | null) => TFlow<P, B>;
|
|
262
|
+
toJson: () => TContext[];
|
|
263
|
+
}
|
|
264
|
+
export interface SendOptions {
|
|
265
|
+
buttons?: Button[];
|
|
266
|
+
media?: string;
|
|
267
|
+
[key: string]: any;
|
|
268
|
+
}
|
|
269
|
+
export type DispatchFn = (customName: string, payload: {
|
|
270
|
+
from: string;
|
|
271
|
+
name: string;
|
|
272
|
+
[key: string]: any;
|
|
273
|
+
}) => any;
|
|
274
|
+
export type BotCtxMethods = {
|
|
275
|
+
endFlow: (from: string, message?: string) => Promise<void>;
|
|
276
|
+
};
|
|
277
|
+
export type BotCtxMiddlewareOptions = {
|
|
278
|
+
provider: any;
|
|
279
|
+
blacklist: DynamicBlacklist;
|
|
280
|
+
dispatch: DispatchFn;
|
|
281
|
+
state: (number: string) => BotStateStandAlone;
|
|
282
|
+
globalState: () => BotStateGlobal;
|
|
283
|
+
emit: (eventName: string, args: Record<string, any> & {
|
|
284
|
+
from: string;
|
|
285
|
+
}) => void;
|
|
286
|
+
ctxMethods: BotCtxMethods;
|
|
287
|
+
};
|
|
288
|
+
export type BotCtxMiddleware<P = ProviderClass> = Partial<P & BotCtxMiddlewareOptions>;
|
|
289
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC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,EAAE,MAAM,EAClB,OAAO,EAAE;IACL,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACrB,KACA,GAAG,CAAA;AAER,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7D,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,EAAE,GAAG,CAAA;IACb,SAAS,EAAE,gBAAgB,CAAA;IAC3B,QAAQ,EAAE,UAAU,CAAA;IACpB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,kBAAkB,CAAA;IAC7C,WAAW,EAAE,MAAM,cAAc,CAAA;IACjC,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IAC/E,UAAU,EAAE,aAAa,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,aAAa,IAAI,OAAO,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
declare class BlackList {
|
|
2
|
+
private blacklist;
|
|
3
|
+
/**
|
|
4
|
+
* Constructor de la clase BlackList.
|
|
5
|
+
* @param initialNumbers - Números iniciales para agregar a la lista negra.
|
|
6
|
+
*/
|
|
7
|
+
constructor(initialNumbers?: string[]);
|
|
8
|
+
/**
|
|
9
|
+
* Verifica si la lista blanca está activada.
|
|
10
|
+
* @returns Verdadero si algún número en la lista negra empieza con '!', falso en caso contrario.
|
|
11
|
+
*/
|
|
12
|
+
private isWhiteListActivated;
|
|
13
|
+
/**
|
|
14
|
+
* Agrega uno o más números de teléfono a la lista negra.
|
|
15
|
+
* @param phoneNumbers - Número(s) de teléfono a agregar.
|
|
16
|
+
* @returns Mensajes de respuesta indicando el resultado de la operación.
|
|
17
|
+
*/
|
|
18
|
+
add(phoneNumbers: string | string[]): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Elimina un número de teléfono de la lista negra.
|
|
21
|
+
* @param phoneNumber - Número de teléfono a eliminar.
|
|
22
|
+
* @throws Error si el número no está en la lista negra.
|
|
23
|
+
*/
|
|
24
|
+
remove(phoneNumber: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Verifica si un número de teléfono está en la lista negra.
|
|
27
|
+
* @param phoneNumber - Número de teléfono a verificar.
|
|
28
|
+
* @returns Verdadero si el número está en la lista negra, falso en caso contrario.
|
|
29
|
+
*/
|
|
30
|
+
checkIf(phoneNumber: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Obtiene la lista de números en la lista negra.
|
|
33
|
+
* @returns Un array con los números en la lista negra.
|
|
34
|
+
*/
|
|
35
|
+
getList(): string[];
|
|
36
|
+
}
|
|
37
|
+
export { BlackList };
|
|
38
|
+
//# sourceMappingURL=blacklistClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blacklistClass.d.ts","sourceRoot":"","sources":["../../src/utils/blacklistClass.ts"],"names":[],"mappings":"AAAA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAAyB;IAE1C;;;OAGG;gBACS,cAAc,GAAE,MAAM,EAAO;IAIzC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;OAIG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE;IAgB9C;;;;OAIG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAOjC;;;;OAIG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAOrC;;;OAGG;IACH,OAAO,IAAI,MAAM,EAAE;CAGtB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add a border around to improve QR readability
|
|
3
|
+
* @param FROM - The path of the image file to clean up
|
|
4
|
+
* @returns A promise to be resolved when the image has been processed
|
|
5
|
+
*/
|
|
6
|
+
declare const cleanImage: (FROM?: string | null) => Promise<void>;
|
|
7
|
+
export { cleanImage };
|
|
8
|
+
//# sourceMappingURL=cleanImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanImage.d.ts","sourceRoot":"","sources":["../../src/utils/cleanImage.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,UAAU,GAAU,OAAM,MAAM,GAAG,IAAW,KAAG,OAAO,CAAC,IAAI,CAkClE,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertAudio.d.ts","sourceRoot":"","sources":["../../src/utils/convertAudio.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,CAAA;CAC9B;AAiBD,QAAA,MAAM,YAAY,GAAU,UAAU,MAAM,EAAE,SAAQ,aAAa,CAAC,KAAK,CAAU,KAAG,OAAO,CAAC,MAAM,CAqBnG,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility function that introduces a delay in execution.
|
|
3
|
+
* @param milliseconds - The duration of the delay in milliseconds.
|
|
4
|
+
* @returns A Promise that resolves after the specified delay.
|
|
5
|
+
*/
|
|
6
|
+
export declare const delay: (milliseconds: number) => Promise<void>;
|
|
7
|
+
//# sourceMappingURL=delay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../src/utils/delay.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAExD,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Descargar archivo binario en tmp con manejo mejorado de concurrencia
|
|
3
|
+
* @param url - La URL del archivo a descargar
|
|
4
|
+
* @param pathToSave - Directorio donde guardar (opcional)
|
|
5
|
+
* @param headers - Headers adicionales (opcional)
|
|
6
|
+
* @returns La ruta al archivo descargado
|
|
7
|
+
*/
|
|
8
|
+
declare const generalDownload: (url: string, pathToSave?: string, headers?: Record<string, any>) => Promise<string>;
|
|
9
|
+
export { generalDownload };
|
|
10
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAkHA;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,GAAU,KAAK,MAAM,EAAE,aAAa,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,OAAO,CAAC,MAAM,CA+I9G,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param fullHash
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const getEventName: (fullHash: string) => string | null;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param name
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const setEvent: (name: string) => string;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param phone
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const removePlus: (phone: string) => string;
|
|
19
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/utils/event.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM,KAAG,MAAM,GAAG,IAExD,CAAA;AACD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,WAEpC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,WAA8C,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TFlow } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Convierte una lista de objetos anidados en un objeto plano,
|
|
4
|
+
* utilizando las funciones de devolución de llamada proporcionadas.
|
|
5
|
+
* @param listArray Lista de objetos anidados.
|
|
6
|
+
* @returns Objeto plano resultante.
|
|
7
|
+
*/
|
|
8
|
+
declare const flatObject: <P>(listArray?: TFlow<P>[]) => Record<string, Function>;
|
|
9
|
+
export default flatObject;
|
|
10
|
+
//# sourceMappingURL=flattener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flattener.d.ts","sourceRoot":"","sources":["../../src/utils/flattener.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,EAAE,YAAW,KAAK,CAAC,CAAC,CAAC,EAAO,KAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAmB1E,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genera un UUID único con posibilidad de tener un prefijo.
|
|
3
|
+
* @param prefix Prefijo opcional para el UUID.
|
|
4
|
+
* @returns El UUID generado.
|
|
5
|
+
*/
|
|
6
|
+
declare const generateRef: (prefix?: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Genera un timestamp en milisegundos sin prefijo hex.
|
|
9
|
+
* @returns El timestamp generado.
|
|
10
|
+
*/
|
|
11
|
+
declare const generateTime: () => number;
|
|
12
|
+
/**
|
|
13
|
+
* Genera un HASH MD5 a partir de un objeto serializado como cadena JSON.
|
|
14
|
+
* @param param0 Objeto con propiedades index, answer y keyword.
|
|
15
|
+
* @returns El HASH MD5 generado.
|
|
16
|
+
*/
|
|
17
|
+
declare const generateRefSerialize: ({ index, answer, keyword, }: {
|
|
18
|
+
index: number;
|
|
19
|
+
answer: string | string[];
|
|
20
|
+
keyword?: string | string[];
|
|
21
|
+
}) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Generamos un UUID único con posibilidad de tener un prefijo
|
|
24
|
+
* @param prefix - Prefijo opcional para el UUID
|
|
25
|
+
* @returns Un UUID único, opcionalmente con prefijo
|
|
26
|
+
*/
|
|
27
|
+
declare const generateRefProvider: (prefix?: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Encriptar data
|
|
30
|
+
* @param data - Datos a encriptar
|
|
31
|
+
* @returns Datos encriptados en base64
|
|
32
|
+
*/
|
|
33
|
+
declare const encryptData: (data: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* Desencriptar data
|
|
36
|
+
* @param encryptedData - Datos encriptados en base64
|
|
37
|
+
* @returns Datos desencriptados o 'FAIL' en caso de error
|
|
38
|
+
*/
|
|
39
|
+
declare const decryptData: (encryptedData: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @param prefix
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
declare const generateRegex: (prefix: string) => RegExp;
|
|
46
|
+
export { generateRef, generateRefSerialize, generateTime, generateRegex, generateRefProvider, encryptData, decryptData };
|
|
47
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/utils/hash.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,MAGtC,CAAA;AAED;;;GAGG;AACH,QAAA,MAAM,YAAY,QAAO,MAExB,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,oBAAoB,GAAI,6BAI3B;IACC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC9B,KAAG,MAEH,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,MAG9C,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAGnC,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,GAAI,eAAe,MAAM,KAAG,MAS5C,CAAA;AACD;;;;GAIG;AACH,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,KAAG,MAEvC,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './blacklistClass';
|
|
2
|
+
export * from './delay';
|
|
3
|
+
export * from './flattener';
|
|
4
|
+
export * from './hash';
|
|
5
|
+
export * from './interactive';
|
|
6
|
+
export * from './queueClass';
|
|
7
|
+
export * from './download';
|
|
8
|
+
export * from './convertAudio';
|
|
9
|
+
export * from './cleanImage';
|
|
10
|
+
export * from './interactive';
|
|
11
|
+
export * from './event';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type PrinterFunction = (message: string | string[], title: string, cName?: 'bgMagenta' | 'bgRed' | 'bgCyan') => void;
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param message
|
|
5
|
+
* @param title
|
|
6
|
+
* @param cName
|
|
7
|
+
*/
|
|
8
|
+
declare const printer: PrinterFunction;
|
|
9
|
+
export { printer };
|
|
10
|
+
//# sourceMappingURL=interactive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../../src/utils/interactive.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,KAAK,IAAI,CAAA;AAIpH;;;;;GAKG;AACH,QAAA,MAAM,OAAO,EAAE,eAOd,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type Logger = Console;
|
|
2
|
+
declare class Queue<T> {
|
|
3
|
+
private queue;
|
|
4
|
+
private timers;
|
|
5
|
+
private idsCallbacks;
|
|
6
|
+
private workingOnPromise;
|
|
7
|
+
private logger;
|
|
8
|
+
private timeout;
|
|
9
|
+
private concurrencyLimit;
|
|
10
|
+
constructor(logger: Logger, concurrencyLimit?: number, timeout?: number);
|
|
11
|
+
/**
|
|
12
|
+
* Limpiar colar de proceso
|
|
13
|
+
* @param from
|
|
14
|
+
* @param item
|
|
15
|
+
*/
|
|
16
|
+
clearAndDone(from: string, item: {
|
|
17
|
+
fingerIdRef: string;
|
|
18
|
+
}): void;
|
|
19
|
+
private processItem;
|
|
20
|
+
enqueue(from: string, promiseInFunc: () => Promise<T>, fingerIdRef: string): Promise<T>;
|
|
21
|
+
processQueue(from: string): Promise<void>;
|
|
22
|
+
clearQueue(from: string): Promise<number>;
|
|
23
|
+
setIdsCallbacks(from: string, ids?: string[]): void;
|
|
24
|
+
getIdsCallback(from: string): string[];
|
|
25
|
+
getIdWithFrom(from: string, id: string): number;
|
|
26
|
+
clearIdFromCallback(from: string, id: string): void;
|
|
27
|
+
}
|
|
28
|
+
export { Queue };
|
|
29
|
+
//# sourceMappingURL=queueClass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queueClass.d.ts","sourceRoot":"","sources":["../../src/utils/queueClass.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GAAG,OAAO,CAAA;AAiBrB,cAAM,KAAK,CAAC,CAAC;IACT,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAsB;IAC9C,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,gBAAgB,CAAQ;gBAEpB,MAAM,EAAE,MAAM,EAAE,gBAAgB,SAAK,EAAE,OAAO,SAAQ;IAUlE;;;;OAIG;IACI,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE;YAKjD,WAAW;IAkBnB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAyEvF,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAezC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgC/C,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,EAAO,GAAG,IAAI;IAIvD,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAItC,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAM/C,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;CAUtD;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@japcon-bot/bot",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "core typescript",
|
|
5
|
+
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.cjs",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rimraf dist && rollup --config",
|
|
13
|
+
"test": " npx uvu -r tsm ./__tests__ ",
|
|
14
|
+
"test:coverage": "npx c8 npm run test "
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"./dist/"
|
|
18
|
+
],
|
|
19
|
+
"directories": {
|
|
20
|
+
"src": "src",
|
|
21
|
+
"test": "__tests__"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/codigoencasa/bot-whatsapp.git"
|
|
26
|
+
},
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/codigoencasa/bot-whatsapp/issues"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@microsoft/api-extractor": "^7.55.2",
|
|
32
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
33
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
35
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
36
|
+
"@types/body-parser": "^1.19.6",
|
|
37
|
+
"@types/cors": "^2.8.19",
|
|
38
|
+
"@types/fluent-ffmpeg": "^2.1.28",
|
|
39
|
+
"@types/follow-redirects": "^1.14.4",
|
|
40
|
+
"@types/mime-types": "^2.1.4",
|
|
41
|
+
"@types/node": "^24.10.2",
|
|
42
|
+
"@types/polka": "^0.5.8",
|
|
43
|
+
"@types/proxyquire": "^1.3.31",
|
|
44
|
+
"@types/sinon": "^17.0.4",
|
|
45
|
+
"proxyquire": "^2.1.3",
|
|
46
|
+
"rimraf": "^6.1.2",
|
|
47
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
48
|
+
"sinon": "^17.0.1",
|
|
49
|
+
"tslib": "^2.8.1",
|
|
50
|
+
"tsm": "^2.3.0"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
54
|
+
"body-parser": "^2.2.1",
|
|
55
|
+
"cors": "^2.8.5",
|
|
56
|
+
"fluent-ffmpeg": "^2.1.3",
|
|
57
|
+
"follow-redirects": "^1.15.11",
|
|
58
|
+
"mime-types": "^3.0.2",
|
|
59
|
+
"picocolors": "^1.1.1",
|
|
60
|
+
"polka": "^0.5.2"
|
|
61
|
+
},
|
|
62
|
+
"optionalDependencies": {
|
|
63
|
+
"sharp": "0.33.3"
|
|
64
|
+
},
|
|
65
|
+
"gitHead": "be4c4287fe2fa5847968c98c3d9d32088edeaca3"
|
|
66
|
+
}
|