etiquetas.js 1.0.0-alpha.2 → 1.0.0-alpha.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/README.md CHANGED
@@ -20,7 +20,7 @@ npm install etiquetas.js
20
20
  ## ⚙️ Uso Básico
21
21
 
22
22
  ```javascript
23
- import { etiquetas } from 'etiquetas.js';
23
+ import etiquetas from './src/etiquetas.js';
24
24
 
25
25
  // Inicializar o sistema com seu token JWT para autenticação na API
26
26
  etiquetas.init({
@@ -28,12 +28,16 @@ etiquetas.init({
28
28
  });
29
29
 
30
30
  // Gerar etiqueta de peça
31
- const pdfPeca = await etiquetas.makePartLabel(dadosPeca, '<id-etiqueta>');
31
+ const pdfBuffer = await etiquetas.makeLabel(labelData, '<id-etiqueta>',options);
32
+ //Gerar e enviar para impressora, caso a impressora não esteja disponível o arquivo é baixado automaticamente
33
+ await etiquetas.sendLabel(labelData, '<id-etiqueta>',{
34
+ fileName:<nome-do-arquivo>
35
+ });
32
36
 
33
37
  // Download ou impressão
34
- await etiquetas.downloadPDF(pdfPeca, '<nome-etiqueta>.pdf');
38
+ await etiquetas.downloadPDF(pdfBuffer, '<nome-etiqueta>.pdf');
35
39
  // ou
36
- await etiquetas.sendToPrinter(pdfPeca);
40
+ await etiquetas.sendToPrinter(pdfBuffer);
37
41
  ```
38
42
 
39
43
  ## 🔄 Legacy Transformer
@@ -77,9 +81,9 @@ etiquetas.init({
77
81
  ```javascript
78
82
  // O transformer configurado no init será aplicado automaticamente
79
83
  const pdf = await etiquetas.makeLabel({
80
- PROJETO_ID: 123,
81
- NOME_PROJETO: 'Sistema Antigo',
82
- STATUS: 'ATIVO'
84
+ VARIAVEL1: 123,
85
+ VARIAVEL2: '12345',
86
+
83
87
  }, 'template-id');
84
88
 
85
89
  // Também funciona com sendLabel
@@ -1,4 +1,4 @@
1
- import { a1, a, j, L, b, N, M, Q, P, a7, F, H, K, U, V, k, T, a9, E, I, y, S, W, B, l, a8, a0, Y, a4, a5, o, h, aa, $, d, n, p, v, e, f, i, t, r, a3, C, D, q, G, w, Z, a6, O, s, R, x, z, J, X, a2, u, m, A } from "./index-BmMBOPX1.js";
1
+ import { a1, a, j, L, b, N, M, Q, P, a7, F, H, K, U, V, k, T, a9, E, I, y, S, W, B, l, a8, a0, Y, a4, a5, o, h, aa, $, d, n, p, v, e, f, i, t, r, a3, C, D, q, G, w, Z, a6, O, s, R, x, z, J, X, a2, u, m, A } from "./index-BkmabrFq.js";
2
2
  export {
3
3
  a1 as DEFAULT_LAMINATION_COLORS,
4
4
  a as LABEL_TYPES,