herramientaenvioestupendo 1.0.2 → 1.0.3
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/.idea/workspace.xml +9 -8
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/services.js +2 -0
package/.idea/workspace.xml
CHANGED
|
@@ -31,15 +31,16 @@
|
|
|
31
31
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
32
32
|
<option name="showLibraryContents" value="true" />
|
|
33
33
|
</component>
|
|
34
|
-
<component name="PropertiesComponent"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
35
|
+
"keyToString": {
|
|
36
|
+
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
|
37
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
38
|
+
"Shell Script.estupendo.executor": "Run",
|
|
39
|
+
"git-widget-placeholder": "main",
|
|
40
|
+
"kotlin-language-version-configured": "true",
|
|
41
|
+
"last_opened_file_path": "C:/Users/santi/Downloads/Santiago/ESTUPENDO/Herramientas/EstupendoCLI"
|
|
41
42
|
}
|
|
42
|
-
}
|
|
43
|
+
}]]></component>
|
|
43
44
|
<component name="RunManager">
|
|
44
45
|
<configuration name="estupendo" type="ShConfigurationType" temporary="true">
|
|
45
46
|
<option name="SCRIPT_TEXT" value="" />
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Para instalar el aplicativo CLI, deben realizar el siguiente procedimiento :
|
|
|
14
14
|
```npm i -g herramientaenvioestupendo```
|
|
15
15
|
|
|
16
16
|
- Luego de esto deben validar la version de la herramienta :
|
|
17
|
-
```estupendo --version```, si esta indica que es la 1.0.
|
|
17
|
+
```estupendo --version```, si esta indica que es la 1.0.3 es la correcta.
|
|
18
18
|
|
|
19
19
|
- Para conocer que opciones tienen de comandos solo deben ingresar en su CMD :
|
|
20
20
|
```estupendo --help```
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { program } from "commander"
|
|
|
3
3
|
import { sendTxt, sendXml, sendAttached } from "./services.js"
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
program.name("estupendo").version("1.0.
|
|
6
|
+
program.name("estupendo").version("1.0.3")
|
|
7
7
|
|
|
8
8
|
program.command("send_xml")
|
|
9
9
|
.requiredOption("-d, --directory <char>", "Directorio donde se encuentran los documentos XML")
|
package/src/services.js
CHANGED
|
@@ -66,10 +66,12 @@ const sendTxt = async (options) => {
|
|
|
66
66
|
for (let archivo of txts) {
|
|
67
67
|
const name = path.join(options.directory, archivo)
|
|
68
68
|
const content = fs.readFileSync(name, { encoding: "utf-8" })
|
|
69
|
+
console.log(`Procesando Archivo: ${archivo}`);
|
|
69
70
|
const encoded = Buffer.from(content).toString("base64")
|
|
70
71
|
const data = await request(urlApi, {
|
|
71
72
|
txtEncode: encoded
|
|
72
73
|
})
|
|
74
|
+
console.log(data);
|
|
73
75
|
// Validar que el documento fue autorizado (estado === 2)
|
|
74
76
|
if (data.result === true && data.estado === 2 && data.pdf && data.doc_id) {
|
|
75
77
|
const pdfUrl = data.pdf;
|