@builderbot/bot 1.2.2 → 1.2.3-alpha.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/dist/index.cjs
CHANGED
|
@@ -13752,7 +13752,7 @@ const fileTypeFromFile = async (response) => {
|
|
|
13752
13752
|
* @param url - La URL del archivo a descargar
|
|
13753
13753
|
* @returns La ruta al archivo descargado
|
|
13754
13754
|
*/
|
|
13755
|
-
const generalDownload = async (url, pathToSave) => {
|
|
13755
|
+
const generalDownload = async (url, pathToSave, headers) => {
|
|
13756
13756
|
const checkIsLocal = require$$3$1.existsSync(url);
|
|
13757
13757
|
const handleDownload = () => {
|
|
13758
13758
|
try {
|
|
@@ -13780,7 +13780,10 @@ const generalDownload = async (url, pathToSave) => {
|
|
|
13780
13780
|
* From URL
|
|
13781
13781
|
*/
|
|
13782
13782
|
return new Promise((res, rej) => {
|
|
13783
|
-
|
|
13783
|
+
const options = {
|
|
13784
|
+
headers: headers ?? {},
|
|
13785
|
+
};
|
|
13786
|
+
handleHttp.get(url, options, function (response) {
|
|
13784
13787
|
response.pipe(file);
|
|
13785
13788
|
file.on('finish', async function () {
|
|
13786
13789
|
file.close();
|
package/dist/utils/download.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* @param url - La URL del archivo a descargar
|
|
4
4
|
* @returns La ruta al archivo descargado
|
|
5
5
|
*/
|
|
6
|
-
declare const generalDownload: (url: string, pathToSave?: string) => Promise<string>;
|
|
6
|
+
declare const generalDownload: (url: string, pathToSave?: string, headers?: Record<string, any>) => Promise<string>;
|
|
7
7
|
export { generalDownload };
|
|
8
8
|
//# sourceMappingURL=download.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,QAAA,MAAM,eAAe,QAAe,MAAM,eAAe,MAAM,KAAG,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,QAAA,MAAM,eAAe,QAAe,MAAM,eAAe,MAAM,YAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,OAAO,CAAC,MAAM,CAuE9G,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builderbot/bot",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3-alpha.0",
|
|
4
4
|
"description": "core typescript",
|
|
5
5
|
"author": "Leifer Mendez <leifer33@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/codigoencasa/bot-whatsapp#readme",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"optionalDependencies": {
|
|
63
63
|
"sharp": "0.33.3"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "0f6e93213ffdcab4bfbd1c9d7842a5b1a209de69"
|
|
66
66
|
}
|