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.
Files changed (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +164 -4
  3. package/dist/cli/commands/billing-family.command.d.ts +2 -0
  4. package/dist/cli/commands/billing-family.command.js +30 -0
  5. package/dist/cli/commands/billing-family.command.js.map +1 -0
  6. package/dist/cli/commands/billing-shortcuts.command.d.ts +2 -0
  7. package/dist/cli/commands/billing-shortcuts.command.js +18 -0
  8. package/dist/cli/commands/billing-shortcuts.command.js.map +1 -0
  9. package/dist/cli/commands/billing.command.interactive-preview.d.ts +17 -0
  10. package/dist/cli/commands/billing.command.interactive-preview.js +65 -0
  11. package/dist/cli/commands/billing.command.interactive-preview.js.map +1 -0
  12. package/dist/cli/commands/billing.command.options.d.ts +2 -0
  13. package/dist/cli/commands/billing.command.options.js +49 -0
  14. package/dist/cli/commands/billing.command.options.js.map +1 -0
  15. package/dist/cli/commands/billing.command.output.d.ts +12 -0
  16. package/dist/cli/commands/billing.command.output.js +33 -0
  17. package/dist/cli/commands/billing.command.output.js.map +1 -0
  18. package/dist/cli/commands/billing.command.parser.d.ts +18 -0
  19. package/dist/cli/commands/billing.command.parser.js +136 -0
  20. package/dist/cli/commands/billing.command.parser.js.map +1 -0
  21. package/dist/cli/commands/billing.command.shared.d.ts +7 -0
  22. package/dist/cli/commands/billing.command.shared.js +78 -0
  23. package/dist/cli/commands/billing.command.shared.js.map +1 -0
  24. package/dist/cli/commands/billing.command.shortcuts.d.ts +7 -0
  25. package/dist/cli/commands/billing.command.shortcuts.js +52 -0
  26. package/dist/cli/commands/billing.command.shortcuts.js.map +1 -0
  27. package/dist/cli/commands/config.command.d.ts +2 -0
  28. package/dist/cli/commands/config.command.js +125 -0
  29. package/dist/cli/commands/config.command.js.map +1 -0
  30. package/dist/cli/commands/examples.command.d.ts +2 -0
  31. package/dist/cli/commands/examples.command.js +14 -0
  32. package/dist/cli/commands/examples.command.js.map +1 -0
  33. package/dist/cli/commands/storybook.command.d.ts +2 -0
  34. package/dist/cli/commands/storybook.command.js +26 -0
  35. package/dist/cli/commands/storybook.command.js.map +1 -0
  36. package/dist/cli/help.d.ts +10 -0
  37. package/dist/cli/help.js +473 -0
  38. package/dist/cli/help.js.map +1 -0
  39. package/dist/cli/index.d.ts +2 -0
  40. package/dist/cli/index.js +41 -0
  41. package/dist/cli/index.js.map +1 -0
  42. package/dist/cli/program.d.ts +2 -0
  43. package/dist/cli/program.js +28 -0
  44. package/dist/cli/program.js.map +1 -0
  45. package/dist/cli/types.d.ts +6 -0
  46. package/dist/cli/types.js +2 -0
  47. package/dist/cli/types.js.map +1 -0
  48. package/dist/cli/version.d.ts +1 -0
  49. package/dist/cli/version.js +2 -0
  50. package/dist/cli/version.js.map +1 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.js +2 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/lib/dates/arca-date.d.ts +2 -0
  55. package/dist/lib/dates/arca-date.js +28 -0
  56. package/dist/lib/dates/arca-date.js.map +1 -0
  57. package/dist/lib/errors/app-error.d.ts +14 -0
  58. package/dist/lib/errors/app-error.js +29 -0
  59. package/dist/lib/errors/app-error.js.map +1 -0
  60. package/dist/lib/files/read-json-file.d.ts +1 -0
  61. package/dist/lib/files/read-json-file.js +21 -0
  62. package/dist/lib/files/read-json-file.js.map +1 -0
  63. package/dist/lib/paths/mask-path.d.ts +1 -0
  64. package/dist/lib/paths/mask-path.js +17 -0
  65. package/dist/lib/paths/mask-path.js.map +1 -0
  66. package/dist/lib/security/certificate.d.ts +7 -0
  67. package/dist/lib/security/certificate.js +16 -0
  68. package/dist/lib/security/certificate.js.map +1 -0
  69. package/dist/lib/security/pem.d.ts +5 -0
  70. package/dist/lib/security/pem.js +36 -0
  71. package/dist/lib/security/pem.js.map +1 -0
  72. package/dist/modules/billing/billing-response.d.ts +4 -0
  73. package/dist/modules/billing/billing-response.js +74 -0
  74. package/dist/modules/billing/billing-response.js.map +1 -0
  75. package/dist/modules/billing/billing.amounts.d.ts +9 -0
  76. package/dist/modules/billing/billing.amounts.js +30 -0
  77. package/dist/modules/billing/billing.amounts.js.map +1 -0
  78. package/dist/modules/billing/billing.associated-vouchers.d.ts +10 -0
  79. package/dist/modules/billing/billing.associated-vouchers.js +51 -0
  80. package/dist/modules/billing/billing.associated-vouchers.js.map +1 -0
  81. package/dist/modules/billing/billing.constants.d.ts +2 -0
  82. package/dist/modules/billing/billing.constants.js +3 -0
  83. package/dist/modules/billing/billing.constants.js.map +1 -0
  84. package/dist/modules/billing/billing.date-range.d.ts +8 -0
  85. package/dist/modules/billing/billing.date-range.js +45 -0
  86. package/dist/modules/billing/billing.date-range.js.map +1 -0
  87. package/dist/modules/billing/billing.display.d.ts +13 -0
  88. package/dist/modules/billing/billing.display.js +111 -0
  89. package/dist/modules/billing/billing.display.js.map +1 -0
  90. package/dist/modules/billing/billing.json-format.d.ts +6 -0
  91. package/dist/modules/billing/billing.json-format.js +5 -0
  92. package/dist/modules/billing/billing.json-format.js.map +1 -0
  93. package/dist/modules/billing/billing.labels.d.ts +9 -0
  94. package/dist/modules/billing/billing.labels.js +108 -0
  95. package/dist/modules/billing/billing.labels.js.map +1 -0
  96. package/dist/modules/billing/billing.mappers.d.ts +8 -0
  97. package/dist/modules/billing/billing.mappers.js +59 -0
  98. package/dist/modules/billing/billing.mappers.js.map +1 -0
  99. package/dist/modules/billing/billing.presenter.d.ts +7 -0
  100. package/dist/modules/billing/billing.presenter.js +3 -0
  101. package/dist/modules/billing/billing.presenter.js.map +1 -0
  102. package/dist/modules/billing/billing.schemas.d.ts +74 -0
  103. package/dist/modules/billing/billing.schemas.js +69 -0
  104. package/dist/modules/billing/billing.schemas.js.map +1 -0
  105. package/dist/modules/billing/billing.serialize.d.ts +8 -0
  106. package/dist/modules/billing/billing.serialize.js +51 -0
  107. package/dist/modules/billing/billing.serialize.js.map +1 -0
  108. package/dist/modules/billing/billing.service.d.ts +15 -0
  109. package/dist/modules/billing/billing.service.js +88 -0
  110. package/dist/modules/billing/billing.service.js.map +1 -0
  111. package/dist/modules/billing/billing.text.d.ts +8 -0
  112. package/dist/modules/billing/billing.text.js +44 -0
  113. package/dist/modules/billing/billing.text.js.map +1 -0
  114. package/dist/modules/billing/billing.types.d.ts +13 -0
  115. package/dist/modules/billing/billing.types.internal.d.ts +25 -0
  116. package/dist/modules/billing/billing.types.internal.js +2 -0
  117. package/dist/modules/billing/billing.types.internal.js.map +1 -0
  118. package/dist/modules/billing/billing.types.js +2 -0
  119. package/dist/modules/billing/billing.types.js.map +1 -0
  120. package/dist/modules/billing/billing.validation.d.ts +5 -0
  121. package/dist/modules/billing/billing.validation.js +45 -0
  122. package/dist/modules/billing/billing.validation.js.map +1 -0
  123. package/dist/modules/billing/voucher-kind-map.d.ts +9 -0
  124. package/dist/modules/billing/voucher-kind-map.js +180 -0
  125. package/dist/modules/billing/voucher-kind-map.js.map +1 -0
  126. package/dist/modules/config/config-doctor.d.ts +15 -0
  127. package/dist/modules/config/config-doctor.js +125 -0
  128. package/dist/modules/config/config-doctor.js.map +1 -0
  129. package/dist/modules/config/config-value-parser.d.ts +2 -0
  130. package/dist/modules/config/config-value-parser.js +71 -0
  131. package/dist/modules/config/config-value-parser.js.map +1 -0
  132. package/dist/modules/config/config.presenter.d.ts +7 -0
  133. package/dist/modules/config/config.presenter.js +80 -0
  134. package/dist/modules/config/config.presenter.js.map +1 -0
  135. package/dist/modules/config/config.schemas.d.ts +87 -0
  136. package/dist/modules/config/config.schemas.js +84 -0
  137. package/dist/modules/config/config.schemas.js.map +1 -0
  138. package/dist/modules/config/config.service.d.ts +20 -0
  139. package/dist/modules/config/config.service.js +78 -0
  140. package/dist/modules/config/config.service.js.map +1 -0
  141. package/dist/modules/examples/examples.d.ts +1 -0
  142. package/dist/modules/examples/examples.js +156 -0
  143. package/dist/modules/examples/examples.js.map +1 -0
  144. package/dist/modules/storybook/showcase-theme.d.ts +7 -0
  145. package/dist/modules/storybook/showcase-theme.js +6 -0
  146. package/dist/modules/storybook/showcase-theme.js.map +1 -0
  147. package/dist/modules/storybook/showcase.d.ts +2 -0
  148. package/dist/modules/storybook/showcase.js +310 -0
  149. package/dist/modules/storybook/showcase.js.map +1 -0
  150. package/dist/modules/update-check/update-check.presenter.d.ts +2 -0
  151. package/dist/modules/update-check/update-check.presenter.js +6 -0
  152. package/dist/modules/update-check/update-check.presenter.js.map +1 -0
  153. package/dist/modules/update-check/update-check.service.d.ts +8 -0
  154. package/dist/modules/update-check/update-check.service.js +72 -0
  155. package/dist/modules/update-check/update-check.service.js.map +1 -0
  156. package/dist/services/arca/arca-billing.gateway.d.ts +9 -0
  157. package/dist/services/arca/arca-billing.gateway.js +10 -0
  158. package/dist/services/arca/arca-billing.gateway.js.map +1 -0
  159. package/dist/services/arca/arca-client.factory.d.ts +5 -0
  160. package/dist/services/arca/arca-client.factory.js +7 -0
  161. package/dist/services/arca/arca-client.factory.js.map +1 -0
  162. package/dist/services/arca/arca-context.resolver.d.ts +44 -0
  163. package/dist/services/arca/arca-context.resolver.js +120 -0
  164. package/dist/services/arca/arca-context.resolver.js.map +1 -0
  165. package/dist/ui/components/contentPanel.d.ts +5 -0
  166. package/dist/ui/components/contentPanel.js +11 -0
  167. package/dist/ui/components/contentPanel.js.map +1 -0
  168. package/dist/ui/components/errorPanel.d.ts +1 -0
  169. package/dist/ui/components/errorPanel.js +13 -0
  170. package/dist/ui/components/errorPanel.js.map +1 -0
  171. package/dist/ui/components/index.d.ts +6 -0
  172. package/dist/ui/components/index.js +7 -0
  173. package/dist/ui/components/index.js.map +1 -0
  174. package/dist/ui/components/keyValuePanel.d.ts +3 -0
  175. package/dist/ui/components/keyValuePanel.js +14 -0
  176. package/dist/ui/components/keyValuePanel.js.map +1 -0
  177. package/dist/ui/components/noticePanel.d.ts +3 -0
  178. package/dist/ui/components/noticePanel.js +11 -0
  179. package/dist/ui/components/noticePanel.js.map +1 -0
  180. package/dist/ui/components/rawPanel.d.ts +1 -0
  181. package/dist/ui/components/rawPanel.js +5 -0
  182. package/dist/ui/components/rawPanel.js.map +1 -0
  183. package/dist/ui/components/statusPanel.d.ts +3 -0
  184. package/dist/ui/components/statusPanel.js +20 -0
  185. package/dist/ui/components/statusPanel.js.map +1 -0
  186. package/dist/ui/index.d.ts +5 -0
  187. package/dist/ui/index.js +6 -0
  188. package/dist/ui/index.js.map +1 -0
  189. package/dist/ui/presenters/billing.presenter.d.ts +2 -0
  190. package/dist/ui/presenters/billing.presenter.js +2 -0
  191. package/dist/ui/presenters/billing.presenter.js.map +1 -0
  192. package/dist/ui/presenters/config.presenter.d.ts +1 -0
  193. package/dist/ui/presenters/config.presenter.js +2 -0
  194. package/dist/ui/presenters/config.presenter.js.map +1 -0
  195. package/dist/ui/presenters/errors.presenter.d.ts +1 -0
  196. package/dist/ui/presenters/errors.presenter.js +89 -0
  197. package/dist/ui/presenters/errors.presenter.js.map +1 -0
  198. package/dist/ui/presenters/errors.zod-presenter.d.ts +2 -0
  199. package/dist/ui/presenters/errors.zod-presenter.js +82 -0
  200. package/dist/ui/presenters/errors.zod-presenter.js.map +1 -0
  201. package/dist/ui/presenters/index.d.ts +4 -0
  202. package/dist/ui/presenters/index.js +5 -0
  203. package/dist/ui/presenters/index.js.map +1 -0
  204. package/dist/ui/presenters/showcase.presenter.d.ts +1 -0
  205. package/dist/ui/presenters/showcase.presenter.js +2 -0
  206. package/dist/ui/presenters/showcase.presenter.js.map +1 -0
  207. package/dist/ui/primitives/index.d.ts +10 -0
  208. package/dist/ui/primitives/index.js +11 -0
  209. package/dist/ui/primitives/index.js.map +1 -0
  210. package/dist/ui/primitives/renderDivider.d.ts +5 -0
  211. package/dist/ui/primitives/renderDivider.js +5 -0
  212. package/dist/ui/primitives/renderDivider.js.map +1 -0
  213. package/dist/ui/primitives/renderFooter.d.ts +7 -0
  214. package/dist/ui/primitives/renderFooter.js +6 -0
  215. package/dist/ui/primitives/renderFooter.js.map +1 -0
  216. package/dist/ui/primitives/renderJson.d.ts +3 -0
  217. package/dist/ui/primitives/renderJson.js +19 -0
  218. package/dist/ui/primitives/renderJson.js.map +1 -0
  219. package/dist/ui/primitives/renderKeyValue.d.ts +14 -0
  220. package/dist/ui/primitives/renderKeyValue.js +34 -0
  221. package/dist/ui/primitives/renderKeyValue.js.map +1 -0
  222. package/dist/ui/primitives/renderLogo.d.ts +2 -0
  223. package/dist/ui/primitives/renderLogo.js +28 -0
  224. package/dist/ui/primitives/renderLogo.js.map +1 -0
  225. package/dist/ui/primitives/renderObject.d.ts +1 -0
  226. package/dist/ui/primitives/renderObject.js +19 -0
  227. package/dist/ui/primitives/renderObject.js.map +1 -0
  228. package/dist/ui/primitives/renderPanel.d.ts +23 -0
  229. package/dist/ui/primitives/renderPanel.js +114 -0
  230. package/dist/ui/primitives/renderPanel.js.map +1 -0
  231. package/dist/ui/primitives/renderSubtitle.d.ts +7 -0
  232. package/dist/ui/primitives/renderSubtitle.js +6 -0
  233. package/dist/ui/primitives/renderSubtitle.js.map +1 -0
  234. package/dist/ui/primitives/renderTable.d.ts +6 -0
  235. package/dist/ui/primitives/renderTable.js +14 -0
  236. package/dist/ui/primitives/renderTable.js.map +1 -0
  237. package/dist/ui/primitives/text.d.ts +18 -0
  238. package/dist/ui/primitives/text.js +154 -0
  239. package/dist/ui/primitives/text.js.map +1 -0
  240. package/dist/ui/stream/index.d.ts +1 -0
  241. package/dist/ui/stream/index.js +2 -0
  242. package/dist/ui/stream/index.js.map +1 -0
  243. package/dist/ui/stream/terminal-stream.d.ts +10 -0
  244. package/dist/ui/stream/terminal-stream.js +20 -0
  245. package/dist/ui/stream/terminal-stream.js.map +1 -0
  246. package/dist/ui/theme/index.d.ts +1 -0
  247. package/dist/ui/theme/index.js +2 -0
  248. package/dist/ui/theme/index.js.map +1 -0
  249. package/dist/ui/theme/theme.d.ts +27 -0
  250. package/dist/ui/theme/theme.js +41 -0
  251. package/dist/ui/theme/theme.js.map +1 -0
  252. package/llms.txt +157 -0
  253. package/package.json +98 -35
  254. package/.babelrc +0 -4
  255. package/.eslintignore +0 -1
  256. package/.eslintrc.js +0 -17
  257. package/.npmignore +0 -1
  258. package/lib/arcli.js +0 -275
  259. package/lib/arcli.min.js +0 -1
  260. package/src/config.js +0 -22
  261. package/src/consoler.js +0 -10
  262. package/src/index.js +0 -21
  263. package/src/init.js +0 -13
  264. package/src/run.js +0 -4
  265. package/src/spinner.js +0 -39
  266. package/tst/index.js +0 -26
  267. package/webpack.config.js +0 -47
@@ -0,0 +1,7 @@
1
+ import type { Command } from 'commander';
2
+ import type { VoucherShortcut } from '../../modules/billing/billing.types';
3
+ import type { GlobalCliOptions } from '../types';
4
+ export declare function registerGlobalOptions(command: Command): void;
5
+ export declare function registerBillingCommandOptions(command: Command): void;
6
+ export declare function getGlobalOptions(command: Command): GlobalCliOptions;
7
+ export declare function executeBillingCommand(command: Command, shortcut: VoucherShortcut): Promise<void>;
@@ -0,0 +1,78 @@
1
+ import ora from 'ora';
2
+ import { BillingService } from '../../modules/billing/billing.service.js';
3
+ import { getVoucherKindByShortcut } from '../../modules/billing/voucher-kind-map.js';
4
+ import { ArcaBillingGateway } from '../../services/arca/arca-billing.gateway.js';
5
+ import { ArcaClientFactory } from '../../services/arca/arca-client.factory.js';
6
+ import { ArcaContextResolver } from '../../services/arca/arca-context.resolver.js';
7
+ import { runInteractiveBillingPreview } from './billing.command.interactive-preview.js';
8
+ import { writeBillingCommandResults } from './billing.command.output.js';
9
+ import { parseBillingCommandPlan, registerBillingOptions } from './billing.command.parser.js';
10
+ export function registerGlobalOptions(command) {
11
+ command
12
+ .option('--testing', 'usar entorno de testing en esta ejecucion')
13
+ .option('--produccion', 'usar entorno de produccion en esta ejecucion')
14
+ .option('--json', 'imprimir salida JSON')
15
+ .option('--bruto', 'mostrar la respuesta bruta de ARCA cuando exista');
16
+ }
17
+ export function registerBillingCommandOptions(command) {
18
+ registerGlobalOptions(command);
19
+ registerBillingOptions(command);
20
+ }
21
+ export function getGlobalOptions(command) {
22
+ return command.optsWithGlobals();
23
+ }
24
+ export async function executeBillingCommand(command, shortcut) {
25
+ const globalOptions = getGlobalOptions(command);
26
+ let spinner = null;
27
+ const voucherKind = getVoucherKindByShortcut(shortcut);
28
+ try {
29
+ const runtime = new ArcaContextResolver({ options: globalOptions }).resolve();
30
+ const plan = parseBillingCommandPlan(command, shortcut, {
31
+ defaultConcept: runtime.config.conceptoPorDefecto,
32
+ defaultCurrencyCode: runtime.config.monedaPorDefecto,
33
+ defaultEmit: runtime.config.output.emitirPorDefecto,
34
+ defaultExchangeRate: runtime.config.cotizacionPorDefecto,
35
+ defaultIvaCondition: runtime.config.ivaReceptorPorDefecto,
36
+ });
37
+ const service = new BillingService();
38
+ const arca = new ArcaClientFactory().create(runtime);
39
+ const useRaw = typeof globalOptions.bruto === 'boolean' ? globalOptions.bruto : runtime.outputRaw;
40
+ const preview = await runInteractiveBillingPreview({
41
+ inputs: plan.inputs,
42
+ modeSource: plan.modeSource,
43
+ runtime,
44
+ service,
45
+ useRaw,
46
+ voucherLabel: voucherKind?.displayName ?? 'este comprobante',
47
+ });
48
+ if (!preview.proceed) {
49
+ return;
50
+ }
51
+ const { inputs, previewShown } = preview;
52
+ spinner = !runtime.outputJson && process.stdout.isTTY ? ora('Procesando comprobante...').start() : null;
53
+ if (spinner) {
54
+ spinner.text = inputs.length > 1 ? `Procesando ${inputs.length} comprobantes...` : 'Procesando comprobante...';
55
+ }
56
+ const gateway = new ArcaBillingGateway(arca);
57
+ const results = [];
58
+ for (const input of inputs) {
59
+ results.push(await service.execute({
60
+ gateway,
61
+ input,
62
+ runtime,
63
+ }));
64
+ }
65
+ spinner?.stop();
66
+ writeBillingCommandResults(results, {
67
+ environment: runtime.environment,
68
+ outputJson: runtime.outputJson,
69
+ previewShown,
70
+ raw: useRaw,
71
+ });
72
+ }
73
+ catch (error) {
74
+ spinner?.stop();
75
+ throw error;
76
+ }
77
+ }
78
+ //# sourceMappingURL=billing.command.shared.js.map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GAAG,CAAC,2BAA2B,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAExG,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,MAAM,CAAC,MAAM,kBAAkB,CAAC,CAAC,CAAC,2BAA2B,CAAC;QACjH,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,OAAO,GAA6B,EAAE,CAAC;QAE7C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,OAAO,CAAC,IAAI,CACV,MAAM,OAAO,CAAC,OAAO,CAAC;gBACpB,OAAO;gBACP,KAAK;gBACL,OAAO;aACR,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,CAAC;QAEhB,0BAA0B,CAAC,OAAO,EAAE;YAClC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,YAAY;YACZ,GAAG,EAAE,MAAM;SACZ,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { BillingCommandInput } from '../../modules/billing/billing.schemas';
2
+ export declare function resolveIvaShortcut(commandOptions: Record<string, unknown>): BillingCommandInput['ivaCondition'] | undefined;
3
+ export declare function resolveDocumentIdentity(commandOptions: Record<string, unknown>): {
4
+ readonly documentNumber?: number;
5
+ readonly documentType?: BillingCommandInput['documentType'];
6
+ };
7
+ export declare function resolveConceptShortcut(commandOptions: Record<string, unknown>): BillingCommandInput['concept'] | undefined;
@@ -0,0 +1,52 @@
1
+ import { InputValidationError } from '../../lib/errors/app-error.js';
2
+ export function resolveIvaShortcut(commandOptions) {
3
+ const shortcuts = [
4
+ commandOptions.irCe ? 'cliente-del-exterior' : null,
5
+ commandOptions.irCf ? 'consumidor-final' : null,
6
+ commandOptions.irIl ? 'iva-liberado' : null,
7
+ commandOptions.irIna ? 'iva-no-alcanzado' : null,
8
+ commandOptions.irMs ? 'monotributista-social' : null,
9
+ commandOptions.irMtip ? 'monotributo-trabajador-independiente-promovido' : null,
10
+ commandOptions.irPe ? 'proveedor-del-exterior' : null,
11
+ commandOptions.irRi ? 'responsable-inscripto' : null,
12
+ commandOptions.irRm ? 'responsable-monotributo' : null,
13
+ commandOptions.irSe ? 'sujeto-exento' : null,
14
+ commandOptions.irSnc ? 'sujeto-no-categorizado' : null,
15
+ ].filter(Boolean);
16
+ if (shortcuts.length > 1) {
17
+ throw new InputValidationError('Use solo un flag de IVA receptor entre las opciones --ir-*.');
18
+ }
19
+ return shortcuts[0];
20
+ }
21
+ export function resolveDocumentIdentity(commandOptions) {
22
+ const candidates = [
23
+ typeof commandOptions.cuit === 'number'
24
+ ? { documentNumber: commandOptions.cuit, documentType: 'cuit' }
25
+ : null,
26
+ typeof commandOptions.cuil === 'number'
27
+ ? { documentNumber: commandOptions.cuil, documentType: 'cuil' }
28
+ : null,
29
+ typeof commandOptions.dni === 'number'
30
+ ? { documentNumber: commandOptions.dni, documentType: 'dni' }
31
+ : null,
32
+ commandOptions.cfinal || commandOptions.consumidorFinal
33
+ ? { documentNumber: 0, documentType: 'consumidor-final' }
34
+ : null,
35
+ ].filter(Boolean);
36
+ if (candidates.length > 1) {
37
+ throw new InputValidationError('Use solo una identidad de receptor: --cuit, --cuil, --dni, --consumidor-final o --cfinal.');
38
+ }
39
+ return candidates[0] ?? {};
40
+ }
41
+ export function resolveConceptShortcut(commandOptions) {
42
+ const shortcutConcepts = [
43
+ commandOptions.cs ? 'servicios' : null,
44
+ commandOptions.cp ? 'productos' : null,
45
+ commandOptions.csp ? 'productos-servicios' : null,
46
+ ].filter(Boolean);
47
+ if (shortcutConcepts.length > 1) {
48
+ throw new InputValidationError('Use solo un flag de concepto entre --cs, --cp o --csp.');
49
+ }
50
+ return shortcutConcepts[0];
51
+ }
52
+ //# sourceMappingURL=billing.command.shortcuts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.command.shortcuts.js","sourceRoot":"","sources":["../../../src/cli/commands/billing.command.shortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,MAAM,UAAU,kBAAkB,CAChC,cAAuC;IAEvC,MAAM,SAAS,GAAG;QAChB,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI;QACnD,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI;QAC/C,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI;QAC3C,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI;QAChD,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI;QACpD,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC,IAAI;QAC/E,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI;QACrD,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI;QACpD,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,IAAI;QACtD,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI;QAC5C,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI;KACvD,CAAC,MAAM,CAAC,OAAO,CAA0C,CAAC;IAE3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C,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;QACtC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI;KAClD,CAAC,MAAM,CAAC,OAAO,CAAqC,CAAC;IAEtD,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,oBAAoB,CAAC,wDAAwD,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerConfigCommand(program: Command): void;
@@ -0,0 +1,125 @@
1
+ import ora from 'ora';
2
+ import { ConfigService } from '../../modules/config/config.service.js';
3
+ import { buildConfigDoctorReport } from '../../modules/config/config-doctor.js';
4
+ import { ArcaContextResolver } from '../../services/arca/arca-context.resolver.js';
5
+ import { formatConfig, formatConfigAsText, formatConfigDoctor, formatConfigDoctorAsText, formatConfigPath, writeTerminalJson, writeTerminalOutput, } from '../../ui/index.js';
6
+ import { configureSpanishHelp, createConfigHelp } from '../help.js';
7
+ function createConfigService() {
8
+ const service = new ConfigService();
9
+ service.ensureInitialized();
10
+ return service;
11
+ }
12
+ function printConfigResult(textValue, jsonValue, useJson = false) {
13
+ if (useJson) {
14
+ writeTerminalJson(jsonValue);
15
+ return;
16
+ }
17
+ writeTerminalOutput(textValue);
18
+ }
19
+ function buildRuntimeCheck(options) {
20
+ try {
21
+ return {
22
+ validation: new ArcaContextResolver({
23
+ options: {
24
+ produccion: options.produccion,
25
+ testing: options.testing,
26
+ },
27
+ }).validate(),
28
+ };
29
+ }
30
+ catch (error) {
31
+ return {
32
+ error: error instanceof Error ? error.message : 'No se pudo completar la revision activa.',
33
+ };
34
+ }
35
+ }
36
+ export function registerConfigCommand(program) {
37
+ const configCommand = program
38
+ .command('config')
39
+ .description('guardar defaults, credenciales y revisar si el CLI esta listo para emitir');
40
+ configureSpanishHelp(configCommand);
41
+ configCommand.option('--json', 'imprimir salida JSON').action((options) => {
42
+ const service = createConfigService();
43
+ try {
44
+ const config = service.getConfig();
45
+ const ticketPath = service.resolveTicketPath(config);
46
+ printConfigResult(formatConfigAsText(config, ticketPath), formatConfig(config, ticketPath), options.json);
47
+ }
48
+ finally {
49
+ service.close();
50
+ }
51
+ });
52
+ configCommand.addHelpText('after', createConfigHelp());
53
+ const revisarCommand = configCommand
54
+ .command('revisar')
55
+ .description('revisar configuracion, defaults, credenciales y validacion activa')
56
+ .option('--json', 'imprimir salida JSON')
57
+ .option('--testing', 'revisar para testing')
58
+ .option('--produccion', 'revisar para produccion')
59
+ .action((options) => {
60
+ const service = createConfigService();
61
+ const spinner = !options.json && process.stdout.isTTY ? ora('Generando revision...').start() : null;
62
+ try {
63
+ const report = buildConfigDoctorReport(service.getConfig(), buildRuntimeCheck(options));
64
+ spinner?.stop();
65
+ printConfigResult(formatConfigDoctorAsText(report), formatConfigDoctor(report), options.json);
66
+ }
67
+ catch (error) {
68
+ spinner?.stop();
69
+ throw error;
70
+ }
71
+ finally {
72
+ service.close();
73
+ }
74
+ });
75
+ configureSpanishHelp(revisarCommand);
76
+ const rutaCommand = configCommand
77
+ .command('ruta')
78
+ .description('mostrar la ruta del archivo de configuracion')
79
+ .action(() => {
80
+ const service = createConfigService();
81
+ try {
82
+ writeTerminalOutput(formatConfigPath(service.getPath()));
83
+ }
84
+ finally {
85
+ service.close();
86
+ }
87
+ });
88
+ configureSpanishHelp(rutaCommand);
89
+ const establecerCommand = configCommand
90
+ .command('establecer')
91
+ .description('guardar un valor de configuracion')
92
+ .option('--json', 'imprimir salida JSON')
93
+ .argument('<clave>', 'clave publica de configuracion')
94
+ .argument('<valor>', 'valor a guardar')
95
+ .action((key, value, options) => {
96
+ const service = createConfigService();
97
+ try {
98
+ const config = service.setValue(key, value);
99
+ const ticketPath = service.resolveTicketPath(config);
100
+ printConfigResult(formatConfigAsText(config, ticketPath), formatConfig(config, ticketPath), options.json);
101
+ }
102
+ finally {
103
+ service.close();
104
+ }
105
+ });
106
+ configureSpanishHelp(establecerCommand);
107
+ const eliminarCommand = configCommand
108
+ .command('eliminar')
109
+ .description('eliminar un valor de configuracion')
110
+ .option('--json', 'imprimir salida JSON')
111
+ .argument('<clave>', 'clave publica de configuracion')
112
+ .action((key, options) => {
113
+ const service = createConfigService();
114
+ try {
115
+ const config = service.unsetValue(key);
116
+ const ticketPath = service.resolveTicketPath(config);
117
+ printConfigResult(formatConfigAsText(config, ticketPath), formatConfig(config, ticketPath), options.json);
118
+ }
119
+ finally {
120
+ service.close();
121
+ }
122
+ });
123
+ configureSpanishHelp(eliminarCommand);
124
+ }
125
+ //# sourceMappingURL=config.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.command.js","sourceRoot":"","sources":["../../../src/cli/commands/config.command.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAiC,MAAM,oCAAoC,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjE,SAAS,mBAAmB;IAC1B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IACpC,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAE5B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB,EAAE,SAAiB,EAAE,OAAO,GAAG,KAAK;IAC9E,IAAI,OAAO,EAAE,CAAC;QACZ,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC7B,OAAO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OAAO,GAAG,mBAAmB,EAAE,CAAC;QAEtC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;YACrD,iBAAiB,CAAC,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5G,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IACL,oBAAoB,CAAC,eAAe,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerExamplesCommand(program: Command): void;
@@ -0,0 +1,14 @@
1
+ import { renderExamples } from '../../modules/examples/examples.js';
2
+ import { writeTerminalOutput } from '../../ui/index.js';
3
+ import { configureSpanishHelp, createExamplesHelp } from '../help.js';
4
+ export function registerExamplesCommand(program) {
5
+ const command = program
6
+ .command('ejemplos')
7
+ .description('ver ejemplos listos para copiar de todos los comprobantes')
8
+ .action(() => {
9
+ writeTerminalOutput(renderExamples());
10
+ })
11
+ .addHelpText('after', createExamplesHelp());
12
+ configureSpanishHelp(command);
13
+ }
14
+ //# sourceMappingURL=examples.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"examples.command.js","sourceRoot":"","sources":["../../../src/cli/commands/examples.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEnE,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,2DAA2D,CAAC;SACxE,MAAM,CAAC,GAAG,EAAE;QACX,mBAAmB,CAAC,cAAc,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC;SACD,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAE9C,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Command } from 'commander';
2
+ export declare function registerStorybookCommand(program: Command): void;
@@ -0,0 +1,26 @@
1
+ import { InputValidationError } from '../../lib/errors/app-error.js';
2
+ import { renderStorybookShowcase, writeTerminalOutput } from '../../ui/index.js';
3
+ import { configureSpanishHelp, createStorybookHelp } from '../help.js';
4
+ const STORYBOOK_SCENES = [
5
+ 'colores',
6
+ 'componentes',
7
+ 'comprobantes',
8
+ 'configuracion',
9
+ 'errores',
10
+ 'json',
11
+ ];
12
+ export function registerStorybookCommand(program) {
13
+ const command = program
14
+ .command('storybook')
15
+ .description('ver escenas visuales del CLI con datos de ejemplo')
16
+ .argument('[escena]', 'comprobantes, colores, componentes, configuracion, errores o json')
17
+ .action((scene) => {
18
+ if (scene && !STORYBOOK_SCENES.includes(scene)) {
19
+ throw new InputValidationError(`La escena "${scene}" no es valida. Use comprobantes, colores, componentes, configuracion, errores o json.`);
20
+ }
21
+ writeTerminalOutput(renderStorybookShowcase(scene));
22
+ })
23
+ .addHelpText('after', createStorybookHelp());
24
+ configureSpanishHelp(command);
25
+ }
26
+ //# sourceMappingURL=storybook.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storybook.command.js","sourceRoot":"","sources":["../../../src/cli/commands/storybook.command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,gBAAgB,GAAqB;IACzC,SAAS;IACT,aAAa;IACb,cAAc;IACd,eAAe;IACf,SAAS;IACT,MAAM;CACP,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,mDAAmD,CAAC;SAChE,QAAQ,CAAC,UAAU,EAAE,mEAAmE,CAAC;SACzF,MAAM,CAAC,CAAC,KAAc,EAAE,EAAE;QACzB,IAAI,KAAK,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAuB,CAAC,EAAE,CAAC;YACjE,MAAM,IAAI,oBAAoB,CAC5B,cAAc,KAAK,wFAAwF,CAC5G,CAAC;QACJ,CAAC;QAED,mBAAmB,CAAC,uBAAuB,CAAC,KAAmC,CAAC,CAAC,CAAC;IACpF,CAAC,CAAC;SACD,WAAW,CAAC,OAAO,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAE/C,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Command } from 'commander';
2
+ import type { VoucherFamily, VoucherShortcut } from '../modules/billing/billing.types';
3
+ export declare function createConfigHelp(): string;
4
+ export declare function createStorybookHelp(): string;
5
+ export declare function createExamplesHelp(): string;
6
+ export declare function createShortcutHelp(shortcut: VoucherShortcut): string;
7
+ export declare function createFamilyHelp(family: VoucherFamily): string;
8
+ export declare function createProgramHelp(): string;
9
+ export declare function configureSpanishHelp(command: Command): void;
10
+ export declare function createProgramHeader(): string;