arcli 0.1.2 → 1.1.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 +21 -0
- package/README.md +164 -4
- package/dist/cli/commands/billing-family.command.d.ts +2 -0
- package/dist/cli/commands/billing-family.command.js +30 -0
- package/dist/cli/commands/billing-family.command.js.map +1 -0
- package/dist/cli/commands/billing-shortcuts.command.d.ts +2 -0
- package/dist/cli/commands/billing-shortcuts.command.js +18 -0
- package/dist/cli/commands/billing-shortcuts.command.js.map +1 -0
- package/dist/cli/commands/billing.command.interactive-preview.d.ts +17 -0
- package/dist/cli/commands/billing.command.interactive-preview.js +65 -0
- package/dist/cli/commands/billing.command.interactive-preview.js.map +1 -0
- package/dist/cli/commands/billing.command.options.d.ts +2 -0
- package/dist/cli/commands/billing.command.options.js +49 -0
- package/dist/cli/commands/billing.command.options.js.map +1 -0
- package/dist/cli/commands/billing.command.output.d.ts +12 -0
- package/dist/cli/commands/billing.command.output.js +33 -0
- package/dist/cli/commands/billing.command.output.js.map +1 -0
- package/dist/cli/commands/billing.command.parser.d.ts +18 -0
- package/dist/cli/commands/billing.command.parser.js +136 -0
- package/dist/cli/commands/billing.command.parser.js.map +1 -0
- package/dist/cli/commands/billing.command.shared.d.ts +7 -0
- package/dist/cli/commands/billing.command.shared.js +78 -0
- package/dist/cli/commands/billing.command.shared.js.map +1 -0
- package/dist/cli/commands/billing.command.shortcuts.d.ts +7 -0
- package/dist/cli/commands/billing.command.shortcuts.js +52 -0
- package/dist/cli/commands/billing.command.shortcuts.js.map +1 -0
- package/dist/cli/commands/config.command.d.ts +2 -0
- package/dist/cli/commands/config.command.js +125 -0
- package/dist/cli/commands/config.command.js.map +1 -0
- package/dist/cli/commands/examples.command.d.ts +2 -0
- package/dist/cli/commands/examples.command.js +14 -0
- package/dist/cli/commands/examples.command.js.map +1 -0
- package/dist/cli/commands/storybook.command.d.ts +2 -0
- package/dist/cli/commands/storybook.command.js +26 -0
- package/dist/cli/commands/storybook.command.js.map +1 -0
- package/dist/cli/help.d.ts +10 -0
- package/dist/cli/help.js +473 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +41 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/program.d.ts +2 -0
- package/dist/cli/program.js +28 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/types.d.ts +6 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +2 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/dates/arca-date.d.ts +2 -0
- package/dist/lib/dates/arca-date.js +28 -0
- package/dist/lib/dates/arca-date.js.map +1 -0
- package/dist/lib/errors/app-error.d.ts +14 -0
- package/dist/lib/errors/app-error.js +29 -0
- package/dist/lib/errors/app-error.js.map +1 -0
- package/dist/lib/files/read-json-file.d.ts +1 -0
- package/dist/lib/files/read-json-file.js +21 -0
- package/dist/lib/files/read-json-file.js.map +1 -0
- package/dist/lib/paths/mask-path.d.ts +1 -0
- package/dist/lib/paths/mask-path.js +17 -0
- package/dist/lib/paths/mask-path.js.map +1 -0
- package/dist/lib/security/certificate.d.ts +7 -0
- package/dist/lib/security/certificate.js +16 -0
- package/dist/lib/security/certificate.js.map +1 -0
- package/dist/lib/security/pem.d.ts +5 -0
- package/dist/lib/security/pem.js +36 -0
- package/dist/lib/security/pem.js.map +1 -0
- package/dist/modules/billing/billing-response.d.ts +4 -0
- package/dist/modules/billing/billing-response.js +74 -0
- package/dist/modules/billing/billing-response.js.map +1 -0
- package/dist/modules/billing/billing.amounts.d.ts +9 -0
- package/dist/modules/billing/billing.amounts.js +30 -0
- package/dist/modules/billing/billing.amounts.js.map +1 -0
- package/dist/modules/billing/billing.associated-vouchers.d.ts +10 -0
- package/dist/modules/billing/billing.associated-vouchers.js +51 -0
- package/dist/modules/billing/billing.associated-vouchers.js.map +1 -0
- package/dist/modules/billing/billing.constants.d.ts +2 -0
- package/dist/modules/billing/billing.constants.js +3 -0
- package/dist/modules/billing/billing.constants.js.map +1 -0
- package/dist/modules/billing/billing.date-range.d.ts +8 -0
- package/dist/modules/billing/billing.date-range.js +45 -0
- package/dist/modules/billing/billing.date-range.js.map +1 -0
- package/dist/modules/billing/billing.display.d.ts +13 -0
- package/dist/modules/billing/billing.display.js +111 -0
- package/dist/modules/billing/billing.display.js.map +1 -0
- package/dist/modules/billing/billing.json-format.d.ts +6 -0
- package/dist/modules/billing/billing.json-format.js +5 -0
- package/dist/modules/billing/billing.json-format.js.map +1 -0
- package/dist/modules/billing/billing.labels.d.ts +9 -0
- package/dist/modules/billing/billing.labels.js +108 -0
- package/dist/modules/billing/billing.labels.js.map +1 -0
- package/dist/modules/billing/billing.mappers.d.ts +8 -0
- package/dist/modules/billing/billing.mappers.js +59 -0
- package/dist/modules/billing/billing.mappers.js.map +1 -0
- package/dist/modules/billing/billing.presenter.d.ts +7 -0
- package/dist/modules/billing/billing.presenter.js +3 -0
- package/dist/modules/billing/billing.presenter.js.map +1 -0
- package/dist/modules/billing/billing.schemas.d.ts +74 -0
- package/dist/modules/billing/billing.schemas.js +69 -0
- package/dist/modules/billing/billing.schemas.js.map +1 -0
- package/dist/modules/billing/billing.serialize.d.ts +8 -0
- package/dist/modules/billing/billing.serialize.js +51 -0
- package/dist/modules/billing/billing.serialize.js.map +1 -0
- package/dist/modules/billing/billing.service.d.ts +15 -0
- package/dist/modules/billing/billing.service.js +88 -0
- package/dist/modules/billing/billing.service.js.map +1 -0
- package/dist/modules/billing/billing.text.d.ts +8 -0
- package/dist/modules/billing/billing.text.js +44 -0
- package/dist/modules/billing/billing.text.js.map +1 -0
- package/dist/modules/billing/billing.types.d.ts +13 -0
- package/dist/modules/billing/billing.types.internal.d.ts +25 -0
- package/dist/modules/billing/billing.types.internal.js +2 -0
- package/dist/modules/billing/billing.types.internal.js.map +1 -0
- package/dist/modules/billing/billing.types.js +2 -0
- package/dist/modules/billing/billing.types.js.map +1 -0
- package/dist/modules/billing/billing.validation.d.ts +5 -0
- package/dist/modules/billing/billing.validation.js +45 -0
- package/dist/modules/billing/billing.validation.js.map +1 -0
- package/dist/modules/billing/voucher-kind-map.d.ts +9 -0
- package/dist/modules/billing/voucher-kind-map.js +180 -0
- package/dist/modules/billing/voucher-kind-map.js.map +1 -0
- package/dist/modules/config/config-doctor.d.ts +15 -0
- package/dist/modules/config/config-doctor.js +125 -0
- package/dist/modules/config/config-doctor.js.map +1 -0
- package/dist/modules/config/config-value-parser.d.ts +2 -0
- package/dist/modules/config/config-value-parser.js +71 -0
- package/dist/modules/config/config-value-parser.js.map +1 -0
- package/dist/modules/config/config.presenter.d.ts +7 -0
- package/dist/modules/config/config.presenter.js +80 -0
- package/dist/modules/config/config.presenter.js.map +1 -0
- package/dist/modules/config/config.schemas.d.ts +87 -0
- package/dist/modules/config/config.schemas.js +84 -0
- package/dist/modules/config/config.schemas.js.map +1 -0
- package/dist/modules/config/config.service.d.ts +20 -0
- package/dist/modules/config/config.service.js +78 -0
- package/dist/modules/config/config.service.js.map +1 -0
- package/dist/modules/examples/examples.d.ts +1 -0
- package/dist/modules/examples/examples.js +156 -0
- package/dist/modules/examples/examples.js.map +1 -0
- package/dist/modules/storybook/showcase-theme.d.ts +7 -0
- package/dist/modules/storybook/showcase-theme.js +6 -0
- package/dist/modules/storybook/showcase-theme.js.map +1 -0
- package/dist/modules/storybook/showcase.d.ts +2 -0
- package/dist/modules/storybook/showcase.js +310 -0
- package/dist/modules/storybook/showcase.js.map +1 -0
- package/dist/modules/update-check/update-check.presenter.d.ts +2 -0
- package/dist/modules/update-check/update-check.presenter.js +6 -0
- package/dist/modules/update-check/update-check.presenter.js.map +1 -0
- package/dist/modules/update-check/update-check.service.d.ts +8 -0
- package/dist/modules/update-check/update-check.service.js +72 -0
- package/dist/modules/update-check/update-check.service.js.map +1 -0
- package/dist/services/arca/arca-billing.gateway.d.ts +9 -0
- package/dist/services/arca/arca-billing.gateway.js +10 -0
- package/dist/services/arca/arca-billing.gateway.js.map +1 -0
- package/dist/services/arca/arca-client.factory.d.ts +5 -0
- package/dist/services/arca/arca-client.factory.js +7 -0
- package/dist/services/arca/arca-client.factory.js.map +1 -0
- package/dist/services/arca/arca-context.resolver.d.ts +44 -0
- package/dist/services/arca/arca-context.resolver.js +120 -0
- package/dist/services/arca/arca-context.resolver.js.map +1 -0
- package/dist/ui/components/contentPanel.d.ts +5 -0
- package/dist/ui/components/contentPanel.js +11 -0
- package/dist/ui/components/contentPanel.js.map +1 -0
- package/dist/ui/components/errorPanel.d.ts +1 -0
- package/dist/ui/components/errorPanel.js +13 -0
- package/dist/ui/components/errorPanel.js.map +1 -0
- package/dist/ui/components/index.d.ts +6 -0
- package/dist/ui/components/index.js +7 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/components/keyValuePanel.d.ts +3 -0
- package/dist/ui/components/keyValuePanel.js +14 -0
- package/dist/ui/components/keyValuePanel.js.map +1 -0
- package/dist/ui/components/noticePanel.d.ts +3 -0
- package/dist/ui/components/noticePanel.js +11 -0
- package/dist/ui/components/noticePanel.js.map +1 -0
- package/dist/ui/components/rawPanel.d.ts +1 -0
- package/dist/ui/components/rawPanel.js +5 -0
- package/dist/ui/components/rawPanel.js.map +1 -0
- package/dist/ui/components/statusPanel.d.ts +3 -0
- package/dist/ui/components/statusPanel.js +20 -0
- package/dist/ui/components/statusPanel.js.map +1 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/presenters/billing.presenter.d.ts +2 -0
- package/dist/ui/presenters/billing.presenter.js +2 -0
- package/dist/ui/presenters/billing.presenter.js.map +1 -0
- package/dist/ui/presenters/config.presenter.d.ts +1 -0
- package/dist/ui/presenters/config.presenter.js +2 -0
- package/dist/ui/presenters/config.presenter.js.map +1 -0
- package/dist/ui/presenters/errors.presenter.d.ts +1 -0
- package/dist/ui/presenters/errors.presenter.js +89 -0
- package/dist/ui/presenters/errors.presenter.js.map +1 -0
- package/dist/ui/presenters/errors.zod-presenter.d.ts +2 -0
- package/dist/ui/presenters/errors.zod-presenter.js +82 -0
- package/dist/ui/presenters/errors.zod-presenter.js.map +1 -0
- package/dist/ui/presenters/index.d.ts +4 -0
- package/dist/ui/presenters/index.js +5 -0
- package/dist/ui/presenters/index.js.map +1 -0
- package/dist/ui/presenters/showcase.presenter.d.ts +1 -0
- package/dist/ui/presenters/showcase.presenter.js +2 -0
- package/dist/ui/presenters/showcase.presenter.js.map +1 -0
- package/dist/ui/primitives/index.d.ts +10 -0
- package/dist/ui/primitives/index.js +11 -0
- package/dist/ui/primitives/index.js.map +1 -0
- package/dist/ui/primitives/renderDivider.d.ts +5 -0
- package/dist/ui/primitives/renderDivider.js +5 -0
- package/dist/ui/primitives/renderDivider.js.map +1 -0
- package/dist/ui/primitives/renderFooter.d.ts +7 -0
- package/dist/ui/primitives/renderFooter.js +6 -0
- package/dist/ui/primitives/renderFooter.js.map +1 -0
- package/dist/ui/primitives/renderJson.d.ts +3 -0
- package/dist/ui/primitives/renderJson.js +19 -0
- package/dist/ui/primitives/renderJson.js.map +1 -0
- package/dist/ui/primitives/renderKeyValue.d.ts +14 -0
- package/dist/ui/primitives/renderKeyValue.js +34 -0
- package/dist/ui/primitives/renderKeyValue.js.map +1 -0
- package/dist/ui/primitives/renderLogo.d.ts +2 -0
- package/dist/ui/primitives/renderLogo.js +28 -0
- package/dist/ui/primitives/renderLogo.js.map +1 -0
- package/dist/ui/primitives/renderObject.d.ts +1 -0
- package/dist/ui/primitives/renderObject.js +19 -0
- package/dist/ui/primitives/renderObject.js.map +1 -0
- package/dist/ui/primitives/renderPanel.d.ts +23 -0
- package/dist/ui/primitives/renderPanel.js +114 -0
- package/dist/ui/primitives/renderPanel.js.map +1 -0
- package/dist/ui/primitives/renderSubtitle.d.ts +7 -0
- package/dist/ui/primitives/renderSubtitle.js +6 -0
- package/dist/ui/primitives/renderSubtitle.js.map +1 -0
- package/dist/ui/primitives/renderTable.d.ts +6 -0
- package/dist/ui/primitives/renderTable.js +14 -0
- package/dist/ui/primitives/renderTable.js.map +1 -0
- package/dist/ui/primitives/text.d.ts +18 -0
- package/dist/ui/primitives/text.js +154 -0
- package/dist/ui/primitives/text.js.map +1 -0
- package/dist/ui/stream/index.d.ts +1 -0
- package/dist/ui/stream/index.js +2 -0
- package/dist/ui/stream/index.js.map +1 -0
- package/dist/ui/stream/terminal-stream.d.ts +10 -0
- package/dist/ui/stream/terminal-stream.js +20 -0
- package/dist/ui/stream/terminal-stream.js.map +1 -0
- package/dist/ui/theme/index.d.ts +1 -0
- package/dist/ui/theme/index.js +2 -0
- package/dist/ui/theme/index.js.map +1 -0
- package/dist/ui/theme/theme.d.ts +27 -0
- package/dist/ui/theme/theme.js +41 -0
- package/dist/ui/theme/theme.js.map +1 -0
- package/llms.txt +157 -0
- package/package.json +98 -35
- package/.babelrc +0 -4
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -17
- package/.npmignore +0 -1
- package/lib/arcli.js +0 -275
- package/lib/arcli.min.js +0 -1
- package/src/config.js +0 -22
- package/src/consoler.js +0 -10
- package/src/index.js +0 -21
- package/src/init.js +0 -13
- package/src/run.js +0 -4
- package/src/spinner.js +0 -39
- package/tst/index.js +0 -26
- package/webpack.config.js +0 -47
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const arcliEnvironmentSchema: z.ZodEnum<{
|
|
3
|
+
produccion: "produccion";
|
|
4
|
+
testing: "testing";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const arcliDefaultConceptSchema: z.ZodEnum<{
|
|
7
|
+
productos: "productos";
|
|
8
|
+
"productos-servicios": "productos-servicios";
|
|
9
|
+
servicios: "servicios";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const arcliDefaultIvaConditionSchema: z.ZodEnum<{
|
|
12
|
+
"cliente-del-exterior": "cliente-del-exterior";
|
|
13
|
+
"consumidor-final": "consumidor-final";
|
|
14
|
+
"iva-liberado": "iva-liberado";
|
|
15
|
+
"iva-no-alcanzado": "iva-no-alcanzado";
|
|
16
|
+
"monotributista-social": "monotributista-social";
|
|
17
|
+
"monotributo-trabajador-independiente-promovido": "monotributo-trabajador-independiente-promovido";
|
|
18
|
+
"proveedor-del-exterior": "proveedor-del-exterior";
|
|
19
|
+
"responsable-inscripto": "responsable-inscripto";
|
|
20
|
+
"responsable-monotributo": "responsable-monotributo";
|
|
21
|
+
"sujeto-exento": "sujeto-exento";
|
|
22
|
+
"sujeto-no-categorizado": "sujeto-no-categorizado";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const arcliDefaultCurrencySchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
25
|
+
export declare const arcliConfigSchema: z.ZodObject<{
|
|
26
|
+
cert: z.ZodDefault<z.ZodObject<{
|
|
27
|
+
produccion: z.ZodOptional<z.ZodString>;
|
|
28
|
+
testing: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
cuit: z.ZodOptional<z.ZodString>;
|
|
31
|
+
conceptoPorDefecto: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
productos: "productos";
|
|
33
|
+
"productos-servicios": "productos-servicios";
|
|
34
|
+
servicios: "servicios";
|
|
35
|
+
}>>;
|
|
36
|
+
ivaReceptorPorDefecto: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
"cliente-del-exterior": "cliente-del-exterior";
|
|
38
|
+
"consumidor-final": "consumidor-final";
|
|
39
|
+
"iva-liberado": "iva-liberado";
|
|
40
|
+
"iva-no-alcanzado": "iva-no-alcanzado";
|
|
41
|
+
"monotributista-social": "monotributista-social";
|
|
42
|
+
"monotributo-trabajador-independiente-promovido": "monotributo-trabajador-independiente-promovido";
|
|
43
|
+
"proveedor-del-exterior": "proveedor-del-exterior";
|
|
44
|
+
"responsable-inscripto": "responsable-inscripto";
|
|
45
|
+
"responsable-monotributo": "responsable-monotributo";
|
|
46
|
+
"sujeto-exento": "sujeto-exento";
|
|
47
|
+
"sujeto-no-categorizado": "sujeto-no-categorizado";
|
|
48
|
+
}>>;
|
|
49
|
+
monedaPorDefecto: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
50
|
+
cotizacionPorDefecto: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
entornoPorDefecto: z.ZodDefault<z.ZodEnum<{
|
|
52
|
+
produccion: "produccion";
|
|
53
|
+
testing: "testing";
|
|
54
|
+
}>>;
|
|
55
|
+
key: z.ZodDefault<z.ZodObject<{
|
|
56
|
+
produccion: z.ZodOptional<z.ZodString>;
|
|
57
|
+
testing: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
output: z.ZodDefault<z.ZodObject<{
|
|
60
|
+
emitirPorDefecto: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
jsonPorDefecto: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
brutoPorDefecto: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
puntoVentaPorDefecto: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
ticketPath: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type ArcliConfig = z.infer<typeof arcliConfigSchema>;
|
|
68
|
+
export type ArcliEnvironment = z.infer<typeof arcliEnvironmentSchema>;
|
|
69
|
+
export declare const CONFIG_DEFAULTS: ArcliConfig;
|
|
70
|
+
export declare const configPublicKeySchema: z.ZodEnum<{
|
|
71
|
+
cuit: "cuit";
|
|
72
|
+
ticketPath: "ticketPath";
|
|
73
|
+
"cert.produccion": "cert.produccion";
|
|
74
|
+
"cert.testing": "cert.testing";
|
|
75
|
+
concepto: "concepto";
|
|
76
|
+
cotizacion: "cotizacion";
|
|
77
|
+
entorno: "entorno";
|
|
78
|
+
emitir: "emitir";
|
|
79
|
+
ivaReceptor: "ivaReceptor";
|
|
80
|
+
json: "json";
|
|
81
|
+
"key.produccion": "key.produccion";
|
|
82
|
+
"key.testing": "key.testing";
|
|
83
|
+
moneda: "moneda";
|
|
84
|
+
bruto: "bruto";
|
|
85
|
+
puntoVenta: "puntoVenta";
|
|
86
|
+
}>;
|
|
87
|
+
export type ConfigPublicKey = z.infer<typeof configPublicKeySchema>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const arcliEnvironmentSchema = z.enum(['testing', 'produccion']);
|
|
3
|
+
export const arcliDefaultConceptSchema = z.enum(['productos', 'productos-servicios', 'servicios']);
|
|
4
|
+
export const arcliDefaultIvaConditionSchema = z.enum([
|
|
5
|
+
'cliente-del-exterior',
|
|
6
|
+
'consumidor-final',
|
|
7
|
+
'iva-liberado',
|
|
8
|
+
'iva-no-alcanzado',
|
|
9
|
+
'monotributista-social',
|
|
10
|
+
'monotributo-trabajador-independiente-promovido',
|
|
11
|
+
'proveedor-del-exterior',
|
|
12
|
+
'responsable-inscripto',
|
|
13
|
+
'responsable-monotributo',
|
|
14
|
+
'sujeto-exento',
|
|
15
|
+
'sujeto-no-categorizado',
|
|
16
|
+
]);
|
|
17
|
+
export const arcliDefaultCurrencySchema = z
|
|
18
|
+
.string()
|
|
19
|
+
.trim()
|
|
20
|
+
.length(3)
|
|
21
|
+
.transform((value) => value.toUpperCase());
|
|
22
|
+
export const arcliConfigSchema = z.object({
|
|
23
|
+
cert: z
|
|
24
|
+
.object({
|
|
25
|
+
produccion: z.string().trim().min(1).optional(),
|
|
26
|
+
testing: z.string().trim().min(1).optional(),
|
|
27
|
+
})
|
|
28
|
+
.default({}),
|
|
29
|
+
cuit: z
|
|
30
|
+
.string()
|
|
31
|
+
.trim()
|
|
32
|
+
.regex(/^\d{11}$/, 'El CUIT debe tener 11 digitos')
|
|
33
|
+
.optional(),
|
|
34
|
+
conceptoPorDefecto: arcliDefaultConceptSchema.optional(),
|
|
35
|
+
ivaReceptorPorDefecto: arcliDefaultIvaConditionSchema.optional(),
|
|
36
|
+
monedaPorDefecto: arcliDefaultCurrencySchema.optional(),
|
|
37
|
+
cotizacionPorDefecto: z.number().positive().optional(),
|
|
38
|
+
entornoPorDefecto: arcliEnvironmentSchema.default('testing'),
|
|
39
|
+
key: z
|
|
40
|
+
.object({
|
|
41
|
+
produccion: z.string().trim().min(1).optional(),
|
|
42
|
+
testing: z.string().trim().min(1).optional(),
|
|
43
|
+
})
|
|
44
|
+
.default({}),
|
|
45
|
+
output: z
|
|
46
|
+
.object({
|
|
47
|
+
emitirPorDefecto: z.boolean().default(false),
|
|
48
|
+
jsonPorDefecto: z.boolean().default(false),
|
|
49
|
+
brutoPorDefecto: z.boolean().default(false),
|
|
50
|
+
})
|
|
51
|
+
.default({ emitirPorDefecto: false, jsonPorDefecto: false, brutoPorDefecto: false }),
|
|
52
|
+
puntoVentaPorDefecto: z.number().int().positive().optional(),
|
|
53
|
+
ticketPath: z.string().trim().min(1).optional(),
|
|
54
|
+
});
|
|
55
|
+
export const CONFIG_DEFAULTS = {
|
|
56
|
+
cert: {},
|
|
57
|
+
entornoPorDefecto: 'testing',
|
|
58
|
+
key: {},
|
|
59
|
+
monedaPorDefecto: 'PES',
|
|
60
|
+
cotizacionPorDefecto: 1,
|
|
61
|
+
output: {
|
|
62
|
+
emitirPorDefecto: false,
|
|
63
|
+
jsonPorDefecto: false,
|
|
64
|
+
brutoPorDefecto: false,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export const configPublicKeySchema = z.enum([
|
|
68
|
+
'cert.produccion',
|
|
69
|
+
'cert.testing',
|
|
70
|
+
'concepto',
|
|
71
|
+
'cuit',
|
|
72
|
+
'cotizacion',
|
|
73
|
+
'entorno',
|
|
74
|
+
'emitir',
|
|
75
|
+
'ivaReceptor',
|
|
76
|
+
'json',
|
|
77
|
+
'key.produccion',
|
|
78
|
+
'key.testing',
|
|
79
|
+
'moneda',
|
|
80
|
+
'bruto',
|
|
81
|
+
'puntoVenta',
|
|
82
|
+
'ticketPath',
|
|
83
|
+
]);
|
|
84
|
+
//# sourceMappingURL=config.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.schemas.js","sourceRoot":"","sources":["../../../src/modules/config/config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AACxE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,qBAAqB,EAAE,WAAW,CAAC,CAAC,CAAC;AACnG,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC;IACnD,sBAAsB;IACtB,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,uBAAuB;IACvB,gDAAgD;IAChD,wBAAwB;IACxB,uBAAuB;IACvB,yBAAyB;IACzB,eAAe;IACf,wBAAwB;CACzB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,MAAM,CAAC,CAAC,CAAC;KACT,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC;SACJ,MAAM,CAAC;QACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;QAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,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,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,IAAI,EAAE,EAAE;IACR,iBAAiB,EAAE,SAAS;IAC5B,GAAG,EAAE,EAAE;IACP,gBAAgB,EAAE,KAAK;IACvB,oBAAoB,EAAE,CAAC;IACvB,MAAM,EAAE;QACN,gBAAgB,EAAE,KAAK;QACvB,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,KAAK;KACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,iBAAiB;IACjB,cAAc;IACd,UAAU;IACV,MAAM;IACN,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,aAAa;IACb,MAAM;IACN,gBAAgB;IAChB,aAAa;IACb,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ArcliConfig } from './config.schemas';
|
|
2
|
+
export interface ConfigServiceOptions {
|
|
3
|
+
readonly configName?: string;
|
|
4
|
+
readonly cwd?: string;
|
|
5
|
+
readonly projectName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class ConfigService {
|
|
8
|
+
private readonly store;
|
|
9
|
+
constructor(options?: ConfigServiceOptions);
|
|
10
|
+
close(): void;
|
|
11
|
+
getConfig(): ArcliConfig;
|
|
12
|
+
getPath(): string;
|
|
13
|
+
getDefaultTicketPath(): string;
|
|
14
|
+
resolveTicketPath(config: ArcliConfig): string;
|
|
15
|
+
initialize(): ArcliConfig;
|
|
16
|
+
ensureInitialized(): ArcliConfig;
|
|
17
|
+
setValue(rawKey: string, rawValue: string): ArcliConfig;
|
|
18
|
+
unsetValue(rawKey: string): ArcliConfig;
|
|
19
|
+
private resolveKey;
|
|
20
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import Conf from 'conf';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { arcliConfigSchema, CONFIG_DEFAULTS, configPublicKeySchema, } from './config.schemas.js';
|
|
4
|
+
import { parseConfigValue } from './config-value-parser.js';
|
|
5
|
+
const CONFIG_KEY_ALIASES = {
|
|
6
|
+
'cert.produccion': 'cert.produccion',
|
|
7
|
+
'cert.testing': 'cert.testing',
|
|
8
|
+
concepto: 'conceptoPorDefecto',
|
|
9
|
+
cotizacion: 'cotizacionPorDefecto',
|
|
10
|
+
cuit: 'cuit',
|
|
11
|
+
entorno: 'entornoPorDefecto',
|
|
12
|
+
emitir: 'output.emitirPorDefecto',
|
|
13
|
+
ivaReceptor: 'ivaReceptorPorDefecto',
|
|
14
|
+
json: 'output.jsonPorDefecto',
|
|
15
|
+
'key.produccion': 'key.produccion',
|
|
16
|
+
'key.testing': 'key.testing',
|
|
17
|
+
moneda: 'monedaPorDefecto',
|
|
18
|
+
bruto: 'output.brutoPorDefecto',
|
|
19
|
+
puntoVenta: 'puntoVentaPorDefecto',
|
|
20
|
+
ticketPath: 'ticketPath',
|
|
21
|
+
};
|
|
22
|
+
export class ConfigService {
|
|
23
|
+
store;
|
|
24
|
+
constructor(options = {}) {
|
|
25
|
+
this.store = new Conf({
|
|
26
|
+
clearInvalidConfig: false,
|
|
27
|
+
configName: options.configName ?? 'config',
|
|
28
|
+
cwd: options.cwd,
|
|
29
|
+
defaults: CONFIG_DEFAULTS,
|
|
30
|
+
projectName: options.projectName ?? 'arcli',
|
|
31
|
+
projectSuffix: '',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
close() {
|
|
35
|
+
this.store._closeWatcher();
|
|
36
|
+
}
|
|
37
|
+
getConfig() {
|
|
38
|
+
return arcliConfigSchema.parse(this.store.store);
|
|
39
|
+
}
|
|
40
|
+
getPath() {
|
|
41
|
+
return this.store.path;
|
|
42
|
+
}
|
|
43
|
+
getDefaultTicketPath() {
|
|
44
|
+
return join(dirname(this.store.path), 'tickets');
|
|
45
|
+
}
|
|
46
|
+
resolveTicketPath(config) {
|
|
47
|
+
return config.ticketPath ?? this.getDefaultTicketPath();
|
|
48
|
+
}
|
|
49
|
+
initialize() {
|
|
50
|
+
const config = this.getConfig();
|
|
51
|
+
this.store.store = config;
|
|
52
|
+
return config;
|
|
53
|
+
}
|
|
54
|
+
ensureInitialized() {
|
|
55
|
+
return this.initialize();
|
|
56
|
+
}
|
|
57
|
+
setValue(rawKey, rawValue) {
|
|
58
|
+
const key = this.resolveKey(rawKey);
|
|
59
|
+
const canonicalKey = CONFIG_KEY_ALIASES[key];
|
|
60
|
+
const parsedValue = parseConfigValue(canonicalKey, rawValue);
|
|
61
|
+
this.store.set(canonicalKey, parsedValue);
|
|
62
|
+
const config = this.getConfig();
|
|
63
|
+
this.store.store = config;
|
|
64
|
+
return config;
|
|
65
|
+
}
|
|
66
|
+
unsetValue(rawKey) {
|
|
67
|
+
const key = this.resolveKey(rawKey);
|
|
68
|
+
const canonicalKey = CONFIG_KEY_ALIASES[key];
|
|
69
|
+
this.store.delete(canonicalKey);
|
|
70
|
+
const config = this.getConfig();
|
|
71
|
+
this.store.store = config;
|
|
72
|
+
return config;
|
|
73
|
+
}
|
|
74
|
+
resolveKey(rawKey) {
|
|
75
|
+
return configPublicKeySchema.parse(rawKey.trim());
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=config.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../src/modules/config/config.service.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAEL,iBAAi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,qBAAqB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderExamples(): string;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { badge, bold, renderLogo, renderPanel, toneText } from '../../ui/index.js';
|
|
2
|
+
import { VOUCHER_FAMILIES, VOUCHER_KIND_MAP, VOUCHER_SHORTCUTS } from '../billing/voucher-kind-map.js';
|
|
3
|
+
const ISSUER_HINT = 'Estos ejemplos asumen que ya resolviste cuit emisor, credenciales y, en la version minima, tambien punto de venta por config.';
|
|
4
|
+
function resolveAmount(definition) {
|
|
5
|
+
if (definition.letter === 'a') {
|
|
6
|
+
return 1;
|
|
7
|
+
}
|
|
8
|
+
if (definition.letter === 'b') {
|
|
9
|
+
return 15000;
|
|
10
|
+
}
|
|
11
|
+
return 300000;
|
|
12
|
+
}
|
|
13
|
+
function resolveIdentityLong(definition) {
|
|
14
|
+
if (definition.letter === 'a') {
|
|
15
|
+
return ['--cuit 20168598204', '--iva-receptor responsable-inscripto'];
|
|
16
|
+
}
|
|
17
|
+
return ['--consumidor-final', '--iva-receptor consumidor-final'];
|
|
18
|
+
}
|
|
19
|
+
function resolveIdentityShort(definition) {
|
|
20
|
+
if (definition.letter === 'a') {
|
|
21
|
+
return ['--cuit 20168598204', '--ir-ri'];
|
|
22
|
+
}
|
|
23
|
+
return ['--cfinal', '--ir-cf'];
|
|
24
|
+
}
|
|
25
|
+
function resolveAssociatedShortcut(definition) {
|
|
26
|
+
if (!definition.requiresAssociatedVoucher) {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
if (definition.family === 'nota-credito') {
|
|
30
|
+
return `f${definition.letter}`;
|
|
31
|
+
}
|
|
32
|
+
if (definition.family === 'nota-debito') {
|
|
33
|
+
return `f${definition.letter}`;
|
|
34
|
+
}
|
|
35
|
+
if (definition.family === 'nota-credito-electronica') {
|
|
36
|
+
return `fce${definition.letter}`;
|
|
37
|
+
}
|
|
38
|
+
return `fce${definition.letter}`;
|
|
39
|
+
}
|
|
40
|
+
function buildMinimalLong(definition) {
|
|
41
|
+
const command = [
|
|
42
|
+
`arcli ${definition.family} ${definition.letter}`,
|
|
43
|
+
`--monto ${resolveAmount(definition)}`,
|
|
44
|
+
'--concepto servicios',
|
|
45
|
+
];
|
|
46
|
+
command.push(...resolveIdentityLong(definition));
|
|
47
|
+
if (definition.requiresAssociatedVoucher) {
|
|
48
|
+
command.push(`--ac ${resolveAssociatedShortcut(definition)}`, '--asociado-punto-venta 3', '--ar 120', '--acuit 20409509763');
|
|
49
|
+
}
|
|
50
|
+
command.push('--previsualizar');
|
|
51
|
+
return command.join(' ');
|
|
52
|
+
}
|
|
53
|
+
function buildMinimalShort(definition) {
|
|
54
|
+
const command = [`arcli ${definition.shortcut}`, `-m ${resolveAmount(definition)}`, '--cs'];
|
|
55
|
+
command.push(...resolveIdentityShort(definition));
|
|
56
|
+
if (definition.requiresAssociatedVoucher) {
|
|
57
|
+
command.push(`--ac ${resolveAssociatedShortcut(definition)}`, '--apv 3', '--ar 120', '--acuit 20409509763');
|
|
58
|
+
}
|
|
59
|
+
command.push('--previsualizar');
|
|
60
|
+
return command.join(' ');
|
|
61
|
+
}
|
|
62
|
+
function buildFullLong(definition) {
|
|
63
|
+
const command = [
|
|
64
|
+
`arcli ${definition.family} ${definition.letter}`,
|
|
65
|
+
`--monto ${resolveAmount(definition)}`,
|
|
66
|
+
'--concepto servicios',
|
|
67
|
+
'--punto-venta 3',
|
|
68
|
+
'--fecha 31-03-2026',
|
|
69
|
+
'--moneda PES',
|
|
70
|
+
'--cotizacion-moneda 1',
|
|
71
|
+
'--dia 31',
|
|
72
|
+
'--servicio-desde 01-03-2026',
|
|
73
|
+
'--servicio-hasta 31-03-2026',
|
|
74
|
+
];
|
|
75
|
+
command.push(...resolveIdentityLong(definition));
|
|
76
|
+
if (definition.requiresAssociatedVoucher) {
|
|
77
|
+
command.push(`--ac ${resolveAssociatedShortcut(definition)}`, '--asociado-punto-venta 3', '--ar 120', '--acuit 20409509763');
|
|
78
|
+
}
|
|
79
|
+
command.push('--previsualizar');
|
|
80
|
+
return command.join(' ');
|
|
81
|
+
}
|
|
82
|
+
function buildFullShort(definition) {
|
|
83
|
+
const command = [
|
|
84
|
+
`arcli ${definition.shortcut}`,
|
|
85
|
+
`-m ${resolveAmount(definition)}`,
|
|
86
|
+
'--cs',
|
|
87
|
+
'--pv 3',
|
|
88
|
+
'-f 31-03-2026',
|
|
89
|
+
'--mda PES',
|
|
90
|
+
'--cm 1',
|
|
91
|
+
'-d 31',
|
|
92
|
+
'--sd 01-03-2026',
|
|
93
|
+
'--sh 31-03-2026',
|
|
94
|
+
];
|
|
95
|
+
command.push(...resolveIdentityShort(definition));
|
|
96
|
+
if (definition.requiresAssociatedVoucher) {
|
|
97
|
+
command.push(`--ac ${resolveAssociatedShortcut(definition)}`, '--apv 3', '--ar 120', '--acuit 20409509763');
|
|
98
|
+
}
|
|
99
|
+
command.push('--previsualizar');
|
|
100
|
+
return command.join(' ');
|
|
101
|
+
}
|
|
102
|
+
function formatVoucherExample(definition) {
|
|
103
|
+
return [
|
|
104
|
+
renderPanel({
|
|
105
|
+
borderType: 'note',
|
|
106
|
+
content: bold(definition.displayName.toUpperCase()),
|
|
107
|
+
contentAlign: 'left',
|
|
108
|
+
padding: {
|
|
109
|
+
top: 0,
|
|
110
|
+
bottom: 0,
|
|
111
|
+
left: 0,
|
|
112
|
+
right: 0,
|
|
113
|
+
},
|
|
114
|
+
width: 'standard',
|
|
115
|
+
}),
|
|
116
|
+
'',
|
|
117
|
+
`${badge('MINIMA LARGA', 'info')}`,
|
|
118
|
+
`${buildMinimalLong(definition)}`,
|
|
119
|
+
'',
|
|
120
|
+
`${badge('MINIMA CORTA', 'success')}`,
|
|
121
|
+
`${buildMinimalShort(definition)}`,
|
|
122
|
+
'',
|
|
123
|
+
`${badge('FULL LARGA', 'warning')}`,
|
|
124
|
+
`${buildFullLong(definition)}`,
|
|
125
|
+
'',
|
|
126
|
+
`${badge('FULL CORTA', 'debug')}`,
|
|
127
|
+
`${buildFullShort(definition)}`,
|
|
128
|
+
].join('\n');
|
|
129
|
+
}
|
|
130
|
+
function renderFamilyExamples(family) {
|
|
131
|
+
return VOUCHER_SHORTCUTS.map((shortcut) => VOUCHER_KIND_MAP[shortcut])
|
|
132
|
+
.filter((definition) => definition.family === family)
|
|
133
|
+
.map(formatVoucherExample)
|
|
134
|
+
.join('\n\n\n');
|
|
135
|
+
}
|
|
136
|
+
export function renderExamples() {
|
|
137
|
+
return [
|
|
138
|
+
renderLogo().trim(),
|
|
139
|
+
'',
|
|
140
|
+
`${badge('MINIMA', 'info')} datos esenciales`,
|
|
141
|
+
`${badge('FULL', 'warning')} mas campos explicitados`,
|
|
142
|
+
`${badge('LARGA', 'success')} comando largo`,
|
|
143
|
+
`${badge('CORTA', 'debug')} shortcut y aliases`,
|
|
144
|
+
'',
|
|
145
|
+
toneText('SEGURIDAD', 'warning'),
|
|
146
|
+
'Todos usan --previsualizar para evitar emisiones reales por error.',
|
|
147
|
+
'Si queres emitir de verdad, reemplaza --previsualizar por --emitir.',
|
|
148
|
+
'Para emitir en produccion necesitas --produccion junto con --emitir.',
|
|
149
|
+
'',
|
|
150
|
+
ISSUER_HINT,
|
|
151
|
+
'',
|
|
152
|
+
...VOUCHER_FAMILIES.flatMap((family) => [renderFamilyExamples(family), '']),
|
|
153
|
+
'',
|
|
154
|
+
].join('\n');
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"examples.js","sourceRoot":"","sources":["../../../src/modules/examples/examples.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EA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,CAAC,0BAA0B;QACrD,GAAG,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,gBAAgB;QAC5C,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,qBAAqB;QAC/C,EAAE;QACF,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;QAChC,oEAAoE;QACpE,qEAAqE;QACrE,sEAAsE;QACtE,EAAE;QACF,WAAW;QACX,EAAE;QACF,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3E,EAAE;KACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UiWidthPreset } from '../../ui';
|
|
2
|
+
export interface StorybookShowcaseTheme {
|
|
3
|
+
readonly borderColor: string;
|
|
4
|
+
readonly indexPanelWidth: UiWidthPreset;
|
|
5
|
+
readonly sceneWidth: UiWidthPreset;
|
|
6
|
+
}
|
|
7
|
+
export declare const STORYBOOK_SHOWCASE_THEME: StorybookShowcaseTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"showcase-theme.js","sourceRoot":"","sources":["../../../src/modules/storybook/showcase-theme.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,wBAAwB,GAA2B;IAC9D,WAAW,EAAE,SAAS;IACtB,eAAe,EAAE,MAAM;IACvB,UAAU,EAAE,MAAM;CACnB,CAAC"}
|