arcli 2.1.0 → 2.2.1

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 (539) hide show
  1. package/CHANGELOG.md +67 -1
  2. package/README.md +37 -2
  3. package/dist/cli/arca-runtime.js +0 -1
  4. package/dist/cli/commands/billing-family.command.js +36 -9
  5. package/dist/cli/commands/billing-shortcuts.command.js +8 -2
  6. package/dist/cli/commands/billing.command.batch.js +0 -1
  7. package/dist/cli/commands/billing.command.interactive-preview.js +9 -13
  8. package/dist/cli/commands/billing.command.options.js +83 -39
  9. package/dist/cli/commands/billing.command.output.js +0 -1
  10. package/dist/cli/commands/billing.command.parser.js +18 -17
  11. package/dist/cli/commands/billing.command.pdf.js +9 -6
  12. package/dist/cli/commands/billing.command.shared.js +2 -2
  13. package/dist/cli/commands/billing.command.shortcuts.js +3 -4
  14. package/dist/cli/commands/completion.command.js +140 -0
  15. package/dist/cli/commands/config.command.js +9 -10
  16. package/dist/cli/commands/cuit-argument.js +6 -6
  17. package/dist/cli/commands/examples.command.js +0 -1
  18. package/dist/cli/commands/export-shortcut.command.js +19 -0
  19. package/dist/cli/commands/export.command.js +106 -0
  20. package/dist/cli/commands/export.command.options.js +140 -0
  21. package/dist/cli/commands/export.command.parser.js +84 -0
  22. package/dist/cli/commands/export.command.pdf.js +61 -0
  23. package/dist/cli/commands/fce-obligation.command.js +2 -3
  24. package/dist/cli/commands/interactive.command.js +2 -3
  25. package/dist/cli/commands/padron.command.js +5 -6
  26. package/dist/cli/commands/parameters.command.js +5 -6
  27. package/dist/cli/commands/pdf.command.js +1 -2
  28. package/dist/cli/commands/storybook.command.js +4 -4
  29. package/dist/cli/commands/vouchers.command.js +9 -9
  30. package/dist/cli/error-output.js +21 -3
  31. package/dist/cli/global-options.js +2 -3
  32. package/dist/cli/help-argv.js +0 -1
  33. package/dist/cli/help.js +186 -380
  34. package/dist/cli/ignored-global-options.js +1 -2
  35. package/dist/cli/index.js +5 -3
  36. package/dist/cli/interactive/advanced-options.js +13 -14
  37. package/dist/cli/interactive/config.flow.js +55 -17
  38. package/dist/cli/interactive/export.flow.js +263 -0
  39. package/dist/cli/interactive/history.flow.js +2 -3
  40. package/dist/cli/interactive/interactive-mode.js +16 -17
  41. package/dist/cli/interactive/invoice-picker.js +7 -7
  42. package/dist/cli/interactive/invoice.flow.js +32 -11
  43. package/dist/cli/interactive/note.flow.js +12 -13
  44. package/dist/cli/interactive/pdf.flow.js +9 -7
  45. package/dist/cli/interactive/prompts.js +0 -1
  46. package/dist/cli/interactive/receiver-padron.js +3 -4
  47. package/dist/cli/interactive/repeat.flow.js +7 -8
  48. package/dist/cli/interactive/session.js +9 -7
  49. package/dist/cli/interactive/status.flow.js +0 -1
  50. package/dist/cli/interactive/update.flow.js +0 -1
  51. package/dist/cli/interactive/validators.js +7 -6
  52. package/dist/cli/option-parsers.js +14 -4
  53. package/dist/cli/program.js +6 -3
  54. package/dist/cli/skipped-options.js +14 -0
  55. package/dist/cli/spinner.js +0 -1
  56. package/dist/cli/types.js +0 -1
  57. package/dist/cli/version.js +1 -2
  58. package/dist/index.js +0 -1
  59. package/dist/lib/dates/arca-date.js +3 -4
  60. package/dist/lib/errors/app-error.js +0 -1
  61. package/dist/lib/files/read-json-file.js +2 -3
  62. package/dist/lib/files/restrict-to-owner.js +0 -1
  63. package/dist/lib/files/write-new-file.js +0 -1
  64. package/dist/lib/identity/cuit.js +26 -0
  65. package/dist/lib/identity/format-cuit.js +1 -2
  66. package/dist/lib/links.js +0 -1
  67. package/dist/lib/numbers/argentine-amount.js +3 -4
  68. package/dist/lib/numbers/strict-integer.js +0 -1
  69. package/dist/lib/paths/mask-path.js +0 -1
  70. package/dist/lib/security/certificate.js +0 -1
  71. package/dist/lib/security/pem.js +2 -3
  72. package/dist/modules/billing/billing-response.js +6 -7
  73. package/dist/modules/billing/billing.amounts.js +3 -4
  74. package/dist/modules/billing/billing.associated-period.js +7 -8
  75. package/dist/modules/billing/billing.associated-vouchers.js +5 -6
  76. package/dist/modules/billing/billing.batch.js +7 -6
  77. package/dist/modules/billing/billing.constants.js +0 -1
  78. package/dist/modules/billing/billing.currency.js +4 -5
  79. package/dist/modules/billing/billing.date-range.js +1 -2
  80. package/dist/modules/billing/billing.display.js +10 -8
  81. package/dist/modules/billing/billing.errors.js +2 -3
  82. package/dist/modules/billing/billing.fce.js +3 -4
  83. package/dist/modules/billing/billing.iva-receptor.js +2 -3
  84. package/dist/modules/billing/billing.json-format.js +0 -1
  85. package/dist/modules/billing/billing.json-input.js +5 -6
  86. package/dist/modules/billing/billing.labels.js +1 -2
  87. package/dist/modules/billing/billing.mappers.js +0 -1
  88. package/dist/modules/billing/billing.padron.js +9 -5
  89. package/dist/modules/billing/billing.presenter.js +0 -1
  90. package/dist/modules/billing/billing.schemas.js +14 -6
  91. package/dist/modules/billing/billing.serialize.js +6 -3
  92. package/dist/modules/billing/billing.service.js +4 -4
  93. package/dist/modules/billing/billing.text.js +0 -1
  94. package/dist/modules/billing/billing.types.internal.js +0 -1
  95. package/dist/modules/billing/billing.types.js +0 -1
  96. package/dist/modules/billing/billing.validation.js +13 -11
  97. package/dist/modules/billing/voucher-kind-map.js +15 -16
  98. package/dist/modules/completion/completion.js +53 -0
  99. package/dist/modules/completion/completion.presenter.js +35 -0
  100. package/dist/modules/completion/installer.js +92 -0
  101. package/dist/modules/completion/shell-scripts.js +46 -0
  102. package/dist/modules/config/certificate-expiry.js +3 -4
  103. package/dist/modules/config/config-doctor.js +36 -14
  104. package/dist/modules/config/config-value-parser.js +29 -16
  105. package/dist/modules/config/config.export-credentials.js +23 -0
  106. package/dist/modules/config/config.presenter.js +22 -6
  107. package/dist/modules/config/config.schemas.js +24 -12
  108. package/dist/modules/config/config.sections.js +26 -11
  109. package/dist/modules/config/config.service.js +6 -2
  110. package/dist/modules/examples/examples.js +44 -10
  111. package/dist/modules/export/export.items.js +149 -0
  112. package/dist/modules/export/export.json-input.js +91 -0
  113. package/dist/modules/export/export.mappers.js +293 -0
  114. package/dist/modules/export/export.presenter.js +2 -0
  115. package/dist/modules/export/export.response.js +86 -0
  116. package/dist/modules/export/export.serialize.js +70 -0
  117. package/dist/modules/export/export.service.js +146 -0
  118. package/dist/modules/export/export.text.js +177 -0
  119. package/dist/modules/export/export.types.js +36 -0
  120. package/dist/modules/fce/fce-obligation.js +3 -4
  121. package/dist/modules/fce/fce-obligation.presenter.js +2 -3
  122. package/dist/modules/interactive/amount-input.js +0 -1
  123. package/dist/modules/interactive/choices.js +10 -2
  124. package/dist/modules/interactive/config-fields.js +11 -3
  125. package/dist/modules/interactive/equivalent-command.js +4 -1
  126. package/dist/modules/interactive/export-equivalent-command.js +40 -0
  127. package/dist/modules/interactive/invoice-copy.js +1 -2
  128. package/dist/modules/interactive/periods.js +0 -1
  129. package/dist/modules/interactive/wizard.js +0 -1
  130. package/dist/modules/padron/padron.js +0 -1
  131. package/dist/modules/padron/padron.presenter.js +6 -7
  132. package/dist/modules/parameters/health.js +0 -1
  133. package/dist/modules/parameters/parameters.js +2 -3
  134. package/dist/modules/parameters/parameters.presenter.js +12 -13
  135. package/dist/modules/parameters/status.js +0 -1
  136. package/dist/modules/pdf/pdf-data.mapper.js +94 -3
  137. package/dist/modules/pdf/pdf-decision.js +0 -1
  138. package/dist/modules/pdf/pdf-file-name.js +0 -1
  139. package/dist/modules/pdf/pdf-issuer.js +3 -3
  140. package/dist/modules/pdf/pdf-legends.js +35 -0
  141. package/dist/modules/pdf/pdf.errors.js +0 -1
  142. package/dist/modules/pdf/pdf.types.js +0 -1
  143. package/dist/modules/storybook/showcase-theme.js +0 -1
  144. package/dist/modules/storybook/showcase.js +20 -21
  145. package/dist/modules/update-check/changelog.js +0 -1
  146. package/dist/modules/update-check/update-check.presenter.js +6 -7
  147. package/dist/modules/update-check/update-check.service.js +0 -1
  148. package/dist/modules/vouchers/voucher-history.js +0 -1
  149. package/dist/modules/vouchers/voucher-history.presenter.js +3 -4
  150. package/dist/services/arca/arca-billing.gateway.js +4 -5
  151. package/dist/services/arca/arca-client.factory.js +23 -2
  152. package/dist/services/arca/arca-context.resolver.js +5 -6
  153. package/dist/services/arca/arca-export.gateway.js +146 -0
  154. package/dist/services/arca/arca-fce-obligation.gateway.js +2 -3
  155. package/dist/services/arca/arca-padron.gateway.js +1 -2
  156. package/dist/services/arca/arca-parameters.gateway.js +2 -3
  157. package/dist/services/arca/arca-voucher-history.gateway.js +2 -3
  158. package/dist/services/arca/last-voucher.js +26 -0
  159. package/dist/services/clipboard/clipboard.js +0 -1
  160. package/dist/services/pdf/escape-html.js +0 -1
  161. package/dist/services/pdf/pdf-browser.js +0 -1
  162. package/dist/services/pdf/pdf-exporter.js +15 -2
  163. package/dist/services/pdf/pdf-plugin.js +45 -16
  164. package/dist/ui/components/certificateBanner.js +0 -1
  165. package/dist/ui/components/contentPanel.js +0 -1
  166. package/dist/ui/components/errorPanel.js +0 -1
  167. package/dist/ui/components/index.js +0 -1
  168. package/dist/ui/components/keyValuePanel.js +0 -1
  169. package/dist/ui/components/noticePanel.js +0 -1
  170. package/dist/ui/components/rawPanel.js +0 -1
  171. package/dist/ui/components/sectionHeading.js +0 -1
  172. package/dist/ui/components/statusBar.js +0 -1
  173. package/dist/ui/components/statusPanel.js +0 -1
  174. package/dist/ui/components/testingBanner.js +0 -1
  175. package/dist/ui/index.js +0 -1
  176. package/dist/ui/presenters/billing.presenter.js +0 -1
  177. package/dist/ui/presenters/config.presenter.js +0 -1
  178. package/dist/ui/presenters/errors.presenter.js +10 -11
  179. package/dist/ui/presenters/errors.zod-presenter.js +8 -9
  180. package/dist/ui/presenters/export.presenter.js +1 -0
  181. package/dist/ui/presenters/index.js +1 -1
  182. package/dist/ui/presenters/pdf.presenter.js +1 -2
  183. package/dist/ui/presenters/showcase.presenter.js +0 -1
  184. package/dist/ui/primitives/index.js +0 -1
  185. package/dist/ui/primitives/renderDivider.js +0 -1
  186. package/dist/ui/primitives/renderFooter.js +0 -1
  187. package/dist/ui/primitives/renderJson.js +0 -1
  188. package/dist/ui/primitives/renderKeyValue.js +0 -1
  189. package/dist/ui/primitives/renderLogo.js +0 -1
  190. package/dist/ui/primitives/renderObject.js +0 -1
  191. package/dist/ui/primitives/renderPanel.js +0 -1
  192. package/dist/ui/primitives/renderSubtitle.js +0 -1
  193. package/dist/ui/primitives/renderTable.js +0 -1
  194. package/dist/ui/primitives/terminalWidth.js +0 -1
  195. package/dist/ui/primitives/text.js +0 -1
  196. package/dist/ui/stream/index.js +0 -1
  197. package/dist/ui/stream/terminal-stream.js +0 -1
  198. package/dist/ui/theme/index.js +0 -1
  199. package/dist/ui/theme/theme.js +0 -1
  200. package/llms.txt +64 -5
  201. package/package.json +1 -2
  202. package/dist/cli/arca-runtime.d.ts +0 -20
  203. package/dist/cli/arca-runtime.js.map +0 -1
  204. package/dist/cli/commands/billing-family.command.d.ts +0 -2
  205. package/dist/cli/commands/billing-family.command.js.map +0 -1
  206. package/dist/cli/commands/billing-shortcuts.command.d.ts +0 -2
  207. package/dist/cli/commands/billing-shortcuts.command.js.map +0 -1
  208. package/dist/cli/commands/billing.command.batch.d.ts +0 -32
  209. package/dist/cli/commands/billing.command.batch.js.map +0 -1
  210. package/dist/cli/commands/billing.command.interactive-preview.d.ts +0 -18
  211. package/dist/cli/commands/billing.command.interactive-preview.js.map +0 -1
  212. package/dist/cli/commands/billing.command.options.d.ts +0 -2
  213. package/dist/cli/commands/billing.command.options.js.map +0 -1
  214. package/dist/cli/commands/billing.command.output.d.ts +0 -18
  215. package/dist/cli/commands/billing.command.output.js.map +0 -1
  216. package/dist/cli/commands/billing.command.parser.d.ts +0 -35
  217. package/dist/cli/commands/billing.command.parser.js.map +0 -1
  218. package/dist/cli/commands/billing.command.pdf.d.ts +0 -24
  219. package/dist/cli/commands/billing.command.pdf.js.map +0 -1
  220. package/dist/cli/commands/billing.command.shared.d.ts +0 -26
  221. package/dist/cli/commands/billing.command.shared.js.map +0 -1
  222. package/dist/cli/commands/billing.command.shortcuts.d.ts +0 -7
  223. package/dist/cli/commands/billing.command.shortcuts.js.map +0 -1
  224. package/dist/cli/commands/config.command.d.ts +0 -6
  225. package/dist/cli/commands/config.command.js.map +0 -1
  226. package/dist/cli/commands/cuit-argument.d.ts +0 -2
  227. package/dist/cli/commands/cuit-argument.js.map +0 -1
  228. package/dist/cli/commands/examples.command.d.ts +0 -2
  229. package/dist/cli/commands/examples.command.js.map +0 -1
  230. package/dist/cli/commands/fce-obligation.command.d.ts +0 -2
  231. package/dist/cli/commands/fce-obligation.command.js.map +0 -1
  232. package/dist/cli/commands/interactive.command.d.ts +0 -3
  233. package/dist/cli/commands/interactive.command.js.map +0 -1
  234. package/dist/cli/commands/padron.command.d.ts +0 -2
  235. package/dist/cli/commands/padron.command.js.map +0 -1
  236. package/dist/cli/commands/parameters.command.d.ts +0 -2
  237. package/dist/cli/commands/parameters.command.js.map +0 -1
  238. package/dist/cli/commands/pdf.command.d.ts +0 -2
  239. package/dist/cli/commands/pdf.command.js.map +0 -1
  240. package/dist/cli/commands/storybook.command.d.ts +0 -2
  241. package/dist/cli/commands/storybook.command.js.map +0 -1
  242. package/dist/cli/commands/vouchers.command.d.ts +0 -2
  243. package/dist/cli/commands/vouchers.command.js.map +0 -1
  244. package/dist/cli/error-output.d.ts +0 -25
  245. package/dist/cli/error-output.js.map +0 -1
  246. package/dist/cli/global-options.d.ts +0 -26
  247. package/dist/cli/global-options.js.map +0 -1
  248. package/dist/cli/help-argv.d.ts +0 -5
  249. package/dist/cli/help-argv.js.map +0 -1
  250. package/dist/cli/help.d.ts +0 -14
  251. package/dist/cli/help.js.map +0 -1
  252. package/dist/cli/ignored-global-options.d.ts +0 -6
  253. package/dist/cli/ignored-global-options.js.map +0 -1
  254. package/dist/cli/index.d.ts +0 -2
  255. package/dist/cli/index.js.map +0 -1
  256. package/dist/cli/interactive/advanced-options.d.ts +0 -21
  257. package/dist/cli/interactive/advanced-options.js.map +0 -1
  258. package/dist/cli/interactive/config.flow.d.ts +0 -4
  259. package/dist/cli/interactive/config.flow.js.map +0 -1
  260. package/dist/cli/interactive/history.flow.d.ts +0 -6
  261. package/dist/cli/interactive/history.flow.js.map +0 -1
  262. package/dist/cli/interactive/interactive-mode.d.ts +0 -3
  263. package/dist/cli/interactive/interactive-mode.js.map +0 -1
  264. package/dist/cli/interactive/invoice-picker.d.ts +0 -25
  265. package/dist/cli/interactive/invoice-picker.js.map +0 -1
  266. package/dist/cli/interactive/invoice.flow.d.ts +0 -22
  267. package/dist/cli/interactive/invoice.flow.js.map +0 -1
  268. package/dist/cli/interactive/note.flow.d.ts +0 -34
  269. package/dist/cli/interactive/note.flow.js.map +0 -1
  270. package/dist/cli/interactive/pdf.flow.d.ts +0 -5
  271. package/dist/cli/interactive/pdf.flow.js.map +0 -1
  272. package/dist/cli/interactive/prompts.d.ts +0 -57
  273. package/dist/cli/interactive/prompts.js.map +0 -1
  274. package/dist/cli/interactive/receiver-padron.d.ts +0 -29
  275. package/dist/cli/interactive/receiver-padron.js.map +0 -1
  276. package/dist/cli/interactive/repeat.flow.d.ts +0 -13
  277. package/dist/cli/interactive/repeat.flow.js.map +0 -1
  278. package/dist/cli/interactive/session.d.ts +0 -22
  279. package/dist/cli/interactive/session.js.map +0 -1
  280. package/dist/cli/interactive/status.flow.d.ts +0 -3
  281. package/dist/cli/interactive/status.flow.js.map +0 -1
  282. package/dist/cli/interactive/update.flow.d.ts +0 -6
  283. package/dist/cli/interactive/update.flow.js.map +0 -1
  284. package/dist/cli/interactive/validators.d.ts +0 -9
  285. package/dist/cli/interactive/validators.js.map +0 -1
  286. package/dist/cli/option-parsers.d.ts +0 -6
  287. package/dist/cli/option-parsers.js.map +0 -1
  288. package/dist/cli/program.d.ts +0 -6
  289. package/dist/cli/program.js.map +0 -1
  290. package/dist/cli/spinner.d.ts +0 -8
  291. package/dist/cli/spinner.js.map +0 -1
  292. package/dist/cli/types.d.ts +0 -6
  293. package/dist/cli/types.js.map +0 -1
  294. package/dist/cli/version.d.ts +0 -1
  295. package/dist/cli/version.js.map +0 -1
  296. package/dist/index.d.ts +0 -1
  297. package/dist/index.js.map +0 -1
  298. package/dist/lib/dates/arca-date.d.ts +0 -19
  299. package/dist/lib/dates/arca-date.js.map +0 -1
  300. package/dist/lib/errors/app-error.d.ts +0 -17
  301. package/dist/lib/errors/app-error.js.map +0 -1
  302. package/dist/lib/files/read-json-file.d.ts +0 -1
  303. package/dist/lib/files/read-json-file.js.map +0 -1
  304. package/dist/lib/files/restrict-to-owner.d.ts +0 -7
  305. package/dist/lib/files/restrict-to-owner.js.map +0 -1
  306. package/dist/lib/files/write-new-file.d.ts +0 -5
  307. package/dist/lib/files/write-new-file.js.map +0 -1
  308. package/dist/lib/identity/format-cuit.d.ts +0 -2
  309. package/dist/lib/identity/format-cuit.js.map +0 -1
  310. package/dist/lib/links.d.ts +0 -4
  311. package/dist/lib/links.js.map +0 -1
  312. package/dist/lib/numbers/argentine-amount.d.ts +0 -23
  313. package/dist/lib/numbers/argentine-amount.js.map +0 -1
  314. package/dist/lib/numbers/strict-integer.d.ts +0 -4
  315. package/dist/lib/numbers/strict-integer.js.map +0 -1
  316. package/dist/lib/paths/mask-path.d.ts +0 -1
  317. package/dist/lib/paths/mask-path.js.map +0 -1
  318. package/dist/lib/security/certificate.d.ts +0 -11
  319. package/dist/lib/security/certificate.js.map +0 -1
  320. package/dist/lib/security/pem.d.ts +0 -5
  321. package/dist/lib/security/pem.js.map +0 -1
  322. package/dist/modules/billing/billing-response.d.ts +0 -4
  323. package/dist/modules/billing/billing-response.js.map +0 -1
  324. package/dist/modules/billing/billing.amounts.d.ts +0 -21
  325. package/dist/modules/billing/billing.amounts.js.map +0 -1
  326. package/dist/modules/billing/billing.associated-period.d.ts +0 -8
  327. package/dist/modules/billing/billing.associated-period.js.map +0 -1
  328. package/dist/modules/billing/billing.associated-vouchers.d.ts +0 -12
  329. package/dist/modules/billing/billing.associated-vouchers.js.map +0 -1
  330. package/dist/modules/billing/billing.batch.d.ts +0 -23
  331. package/dist/modules/billing/billing.batch.js.map +0 -1
  332. package/dist/modules/billing/billing.constants.d.ts +0 -2
  333. package/dist/modules/billing/billing.constants.js.map +0 -1
  334. package/dist/modules/billing/billing.currency.d.ts +0 -18
  335. package/dist/modules/billing/billing.currency.js.map +0 -1
  336. package/dist/modules/billing/billing.date-range.d.ts +0 -9
  337. package/dist/modules/billing/billing.date-range.js.map +0 -1
  338. package/dist/modules/billing/billing.display.d.ts +0 -13
  339. package/dist/modules/billing/billing.display.js.map +0 -1
  340. package/dist/modules/billing/billing.errors.d.ts +0 -12
  341. package/dist/modules/billing/billing.errors.js.map +0 -1
  342. package/dist/modules/billing/billing.fce.d.ts +0 -21
  343. package/dist/modules/billing/billing.fce.js.map +0 -1
  344. package/dist/modules/billing/billing.iva-receptor.d.ts +0 -8
  345. package/dist/modules/billing/billing.iva-receptor.js.map +0 -1
  346. package/dist/modules/billing/billing.json-format.d.ts +0 -6
  347. package/dist/modules/billing/billing.json-format.js.map +0 -1
  348. package/dist/modules/billing/billing.json-input.d.ts +0 -58
  349. package/dist/modules/billing/billing.json-input.js.map +0 -1
  350. package/dist/modules/billing/billing.labels.d.ts +0 -9
  351. package/dist/modules/billing/billing.labels.js.map +0 -1
  352. package/dist/modules/billing/billing.mappers.d.ts +0 -8
  353. package/dist/modules/billing/billing.mappers.js.map +0 -1
  354. package/dist/modules/billing/billing.padron.d.ts +0 -14
  355. package/dist/modules/billing/billing.padron.js.map +0 -1
  356. package/dist/modules/billing/billing.presenter.d.ts +0 -7
  357. package/dist/modules/billing/billing.presenter.js.map +0 -1
  358. package/dist/modules/billing/billing.schemas.d.ts +0 -147
  359. package/dist/modules/billing/billing.schemas.js.map +0 -1
  360. package/dist/modules/billing/billing.serialize.d.ts +0 -9
  361. package/dist/modules/billing/billing.serialize.js.map +0 -1
  362. package/dist/modules/billing/billing.service.d.ts +0 -30
  363. package/dist/modules/billing/billing.service.js.map +0 -1
  364. package/dist/modules/billing/billing.text.d.ts +0 -8
  365. package/dist/modules/billing/billing.text.js.map +0 -1
  366. package/dist/modules/billing/billing.types.d.ts +0 -13
  367. package/dist/modules/billing/billing.types.internal.d.ts +0 -38
  368. package/dist/modules/billing/billing.types.internal.js.map +0 -1
  369. package/dist/modules/billing/billing.types.js.map +0 -1
  370. package/dist/modules/billing/billing.validation.d.ts +0 -7
  371. package/dist/modules/billing/billing.validation.js.map +0 -1
  372. package/dist/modules/billing/voucher-kind-map.d.ts +0 -9
  373. package/dist/modules/billing/voucher-kind-map.js.map +0 -1
  374. package/dist/modules/config/certificate-expiry.d.ts +0 -42
  375. package/dist/modules/config/certificate-expiry.js.map +0 -1
  376. package/dist/modules/config/config-doctor.d.ts +0 -16
  377. package/dist/modules/config/config-doctor.js.map +0 -1
  378. package/dist/modules/config/config-value-parser.d.ts +0 -2
  379. package/dist/modules/config/config-value-parser.js.map +0 -1
  380. package/dist/modules/config/config.presenter.d.ts +0 -17
  381. package/dist/modules/config/config.presenter.js.map +0 -1
  382. package/dist/modules/config/config.schemas.d.ts +0 -156
  383. package/dist/modules/config/config.schemas.js.map +0 -1
  384. package/dist/modules/config/config.sections.d.ts +0 -14
  385. package/dist/modules/config/config.sections.js.map +0 -1
  386. package/dist/modules/config/config.service.d.ts +0 -35
  387. package/dist/modules/config/config.service.js.map +0 -1
  388. package/dist/modules/examples/examples.d.ts +0 -6
  389. package/dist/modules/examples/examples.js.map +0 -1
  390. package/dist/modules/fce/fce-obligation.d.ts +0 -20
  391. package/dist/modules/fce/fce-obligation.js.map +0 -1
  392. package/dist/modules/fce/fce-obligation.presenter.d.ts +0 -9
  393. package/dist/modules/fce/fce-obligation.presenter.js.map +0 -1
  394. package/dist/modules/interactive/amount-input.d.ts +0 -4
  395. package/dist/modules/interactive/amount-input.js.map +0 -1
  396. package/dist/modules/interactive/choices.d.ts +0 -13
  397. package/dist/modules/interactive/choices.js.map +0 -1
  398. package/dist/modules/interactive/config-fields.d.ts +0 -20
  399. package/dist/modules/interactive/config-fields.js.map +0 -1
  400. package/dist/modules/interactive/equivalent-command.d.ts +0 -8
  401. package/dist/modules/interactive/equivalent-command.js.map +0 -1
  402. package/dist/modules/interactive/invoice-copy.d.ts +0 -19
  403. package/dist/modules/interactive/invoice-copy.js.map +0 -1
  404. package/dist/modules/interactive/periods.d.ts +0 -7
  405. package/dist/modules/interactive/periods.js.map +0 -1
  406. package/dist/modules/interactive/wizard.d.ts +0 -16
  407. package/dist/modules/interactive/wizard.js.map +0 -1
  408. package/dist/modules/padron/padron.d.ts +0 -46
  409. package/dist/modules/padron/padron.js.map +0 -1
  410. package/dist/modules/padron/padron.presenter.d.ts +0 -7
  411. package/dist/modules/padron/padron.presenter.js.map +0 -1
  412. package/dist/modules/parameters/health.d.ts +0 -17
  413. package/dist/modules/parameters/health.js.map +0 -1
  414. package/dist/modules/parameters/parameters.d.ts +0 -50
  415. package/dist/modules/parameters/parameters.js.map +0 -1
  416. package/dist/modules/parameters/parameters.presenter.d.ts +0 -12
  417. package/dist/modules/parameters/parameters.presenter.js.map +0 -1
  418. package/dist/modules/parameters/status.d.ts +0 -31
  419. package/dist/modules/parameters/status.js.map +0 -1
  420. package/dist/modules/pdf/pdf-data.mapper.d.ts +0 -4
  421. package/dist/modules/pdf/pdf-data.mapper.js.map +0 -1
  422. package/dist/modules/pdf/pdf-decision.d.ts +0 -14
  423. package/dist/modules/pdf/pdf-decision.js.map +0 -1
  424. package/dist/modules/pdf/pdf-file-name.d.ts +0 -3
  425. package/dist/modules/pdf/pdf-file-name.js.map +0 -1
  426. package/dist/modules/pdf/pdf-issuer.d.ts +0 -8
  427. package/dist/modules/pdf/pdf-issuer.js.map +0 -1
  428. package/dist/modules/pdf/pdf.errors.d.ts +0 -9
  429. package/dist/modules/pdf/pdf.errors.js.map +0 -1
  430. package/dist/modules/pdf/pdf.types.d.ts +0 -91
  431. package/dist/modules/pdf/pdf.types.js.map +0 -1
  432. package/dist/modules/storybook/showcase-theme.d.ts +0 -7
  433. package/dist/modules/storybook/showcase-theme.js.map +0 -1
  434. package/dist/modules/storybook/showcase.d.ts +0 -2
  435. package/dist/modules/storybook/showcase.js.map +0 -1
  436. package/dist/modules/update-check/changelog.d.ts +0 -23
  437. package/dist/modules/update-check/changelog.js.map +0 -1
  438. package/dist/modules/update-check/update-check.presenter.d.ts +0 -6
  439. package/dist/modules/update-check/update-check.presenter.js.map +0 -1
  440. package/dist/modules/update-check/update-check.service.d.ts +0 -11
  441. package/dist/modules/update-check/update-check.service.js.map +0 -1
  442. package/dist/modules/vouchers/voucher-history.d.ts +0 -39
  443. package/dist/modules/vouchers/voucher-history.js.map +0 -1
  444. package/dist/modules/vouchers/voucher-history.presenter.d.ts +0 -29
  445. package/dist/modules/vouchers/voucher-history.presenter.js.map +0 -1
  446. package/dist/services/arca/arca-billing.gateway.d.ts +0 -16
  447. package/dist/services/arca/arca-billing.gateway.js.map +0 -1
  448. package/dist/services/arca/arca-client.factory.d.ts +0 -6
  449. package/dist/services/arca/arca-client.factory.js.map +0 -1
  450. package/dist/services/arca/arca-context.resolver.d.ts +0 -55
  451. package/dist/services/arca/arca-context.resolver.js.map +0 -1
  452. package/dist/services/arca/arca-fce-obligation.gateway.d.ts +0 -7
  453. package/dist/services/arca/arca-fce-obligation.gateway.js.map +0 -1
  454. package/dist/services/arca/arca-padron.gateway.d.ts +0 -9
  455. package/dist/services/arca/arca-padron.gateway.js.map +0 -1
  456. package/dist/services/arca/arca-parameters.gateway.d.ts +0 -10
  457. package/dist/services/arca/arca-parameters.gateway.js.map +0 -1
  458. package/dist/services/arca/arca-voucher-history.gateway.d.ts +0 -8
  459. package/dist/services/arca/arca-voucher-history.gateway.js.map +0 -1
  460. package/dist/services/clipboard/clipboard.d.ts +0 -2
  461. package/dist/services/clipboard/clipboard.js.map +0 -1
  462. package/dist/services/pdf/escape-html.d.ts +0 -6
  463. package/dist/services/pdf/escape-html.js.map +0 -1
  464. package/dist/services/pdf/pdf-browser.d.ts +0 -5
  465. package/dist/services/pdf/pdf-browser.js.map +0 -1
  466. package/dist/services/pdf/pdf-exporter.d.ts +0 -22
  467. package/dist/services/pdf/pdf-exporter.js.map +0 -1
  468. package/dist/services/pdf/pdf-plugin.d.ts +0 -50
  469. package/dist/services/pdf/pdf-plugin.js.map +0 -1
  470. package/dist/ui/components/certificateBanner.d.ts +0 -11
  471. package/dist/ui/components/certificateBanner.js.map +0 -1
  472. package/dist/ui/components/contentPanel.d.ts +0 -5
  473. package/dist/ui/components/contentPanel.js.map +0 -1
  474. package/dist/ui/components/errorPanel.d.ts +0 -1
  475. package/dist/ui/components/errorPanel.js.map +0 -1
  476. package/dist/ui/components/index.d.ts +0 -10
  477. package/dist/ui/components/index.js.map +0 -1
  478. package/dist/ui/components/keyValuePanel.d.ts +0 -3
  479. package/dist/ui/components/keyValuePanel.js.map +0 -1
  480. package/dist/ui/components/noticePanel.d.ts +0 -3
  481. package/dist/ui/components/noticePanel.js.map +0 -1
  482. package/dist/ui/components/rawPanel.d.ts +0 -1
  483. package/dist/ui/components/rawPanel.js.map +0 -1
  484. package/dist/ui/components/sectionHeading.d.ts +0 -3
  485. package/dist/ui/components/sectionHeading.js.map +0 -1
  486. package/dist/ui/components/statusBar.d.ts +0 -19
  487. package/dist/ui/components/statusBar.js.map +0 -1
  488. package/dist/ui/components/statusPanel.d.ts +0 -3
  489. package/dist/ui/components/statusPanel.js.map +0 -1
  490. package/dist/ui/components/testingBanner.d.ts +0 -2
  491. package/dist/ui/components/testingBanner.js.map +0 -1
  492. package/dist/ui/index.d.ts +0 -5
  493. package/dist/ui/index.js.map +0 -1
  494. package/dist/ui/presenters/billing.presenter.d.ts +0 -2
  495. package/dist/ui/presenters/billing.presenter.js.map +0 -1
  496. package/dist/ui/presenters/config.presenter.d.ts +0 -1
  497. package/dist/ui/presenters/config.presenter.js.map +0 -1
  498. package/dist/ui/presenters/errors.presenter.d.ts +0 -1
  499. package/dist/ui/presenters/errors.presenter.js.map +0 -1
  500. package/dist/ui/presenters/errors.zod-presenter.d.ts +0 -4
  501. package/dist/ui/presenters/errors.zod-presenter.js.map +0 -1
  502. package/dist/ui/presenters/index.d.ts +0 -6
  503. package/dist/ui/presenters/index.js.map +0 -1
  504. package/dist/ui/presenters/pdf.presenter.d.ts +0 -13
  505. package/dist/ui/presenters/pdf.presenter.js.map +0 -1
  506. package/dist/ui/presenters/showcase.presenter.d.ts +0 -1
  507. package/dist/ui/presenters/showcase.presenter.js.map +0 -1
  508. package/dist/ui/primitives/index.d.ts +0 -10
  509. package/dist/ui/primitives/index.js.map +0 -1
  510. package/dist/ui/primitives/renderDivider.d.ts +0 -5
  511. package/dist/ui/primitives/renderDivider.js.map +0 -1
  512. package/dist/ui/primitives/renderFooter.d.ts +0 -7
  513. package/dist/ui/primitives/renderFooter.js.map +0 -1
  514. package/dist/ui/primitives/renderJson.d.ts +0 -3
  515. package/dist/ui/primitives/renderJson.js.map +0 -1
  516. package/dist/ui/primitives/renderKeyValue.d.ts +0 -14
  517. package/dist/ui/primitives/renderKeyValue.js.map +0 -1
  518. package/dist/ui/primitives/renderLogo.d.ts +0 -3
  519. package/dist/ui/primitives/renderLogo.js.map +0 -1
  520. package/dist/ui/primitives/renderObject.d.ts +0 -1
  521. package/dist/ui/primitives/renderObject.js.map +0 -1
  522. package/dist/ui/primitives/renderPanel.d.ts +0 -27
  523. package/dist/ui/primitives/renderPanel.js.map +0 -1
  524. package/dist/ui/primitives/renderSubtitle.d.ts +0 -7
  525. package/dist/ui/primitives/renderSubtitle.js.map +0 -1
  526. package/dist/ui/primitives/renderTable.d.ts +0 -6
  527. package/dist/ui/primitives/renderTable.js.map +0 -1
  528. package/dist/ui/primitives/terminalWidth.d.ts +0 -4
  529. package/dist/ui/primitives/terminalWidth.js.map +0 -1
  530. package/dist/ui/primitives/text.d.ts +0 -28
  531. package/dist/ui/primitives/text.js.map +0 -1
  532. package/dist/ui/stream/index.d.ts +0 -1
  533. package/dist/ui/stream/index.js.map +0 -1
  534. package/dist/ui/stream/terminal-stream.d.ts +0 -21
  535. package/dist/ui/stream/terminal-stream.js.map +0 -1
  536. package/dist/ui/theme/index.d.ts +0 -1
  537. package/dist/ui/theme/index.js.map +0 -1
  538. package/dist/ui/theme/theme.d.ts +0 -68
  539. package/dist/ui/theme/theme.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ import { InputValidationError } from '../../lib/errors/app-error.js';
2
+ import { readJsonFile } from '../../lib/files/read-json-file.js';
3
+ import { mapExportJsonItems, readExportJsonInput } from '../../modules/export/export.json-input.js';
4
+ function pickString(...values) {
5
+ return values.find((value) => typeof value === 'string');
6
+ }
7
+ function pickNumber(...values) {
8
+ return values.find((value) => typeof value === 'number');
9
+ }
10
+ function pickBoolean(...values) {
11
+ return values.find((value) => typeof value === 'boolean');
12
+ }
13
+ function pickItems(flagsValue, fileItems) {
14
+ return Array.isArray(flagsValue) && flagsValue.length > 0 ? flagsValue : fileItems;
15
+ }
16
+ function pickList(flagsValue, fileValue) {
17
+ return Array.isArray(flagsValue) && flagsValue.length > 0 ? flagsValue : fileValue?.slice();
18
+ }
19
+ /** `--emitir` y `--previsualizar` deciden juntos, y el archivo de `--cargar` puede traer `emitir`. */
20
+ function resolveEmitDecision(flags, file, defaults) {
21
+ if (flags.emitir && flags.previsualizar) {
22
+ throw new InputValidationError('Usá --emitir o --previsualizar, no los dos.');
23
+ }
24
+ if (flags.emitir !== undefined) {
25
+ return { emit: flags.emitir, modeSource: 'flags' };
26
+ }
27
+ if (flags.previsualizar !== undefined) {
28
+ return { emit: !flags.previsualizar, modeSource: 'flags' };
29
+ }
30
+ if (file?.emitir !== undefined) {
31
+ return { emit: file.emitir, modeSource: 'file' };
32
+ }
33
+ if (file?.previsualizar !== undefined) {
34
+ return { emit: !file.previsualizar, modeSource: 'file' };
35
+ }
36
+ return { emit: defaults.defaultEmit ?? false, modeSource: 'default' };
37
+ }
38
+ /** Los flags ganan sobre el JSON de `--cargar`, igual que en facturacion. */
39
+ export function parseExportCommandPlan(command, defaults = {}) {
40
+ const options = command.optsWithGlobals();
41
+ const filePath = typeof options.cargar === 'string' ? options.cargar : undefined;
42
+ const file = filePath ? readExportJsonInput(readJsonFile(filePath)) : undefined;
43
+ const { emit, modeSource } = resolveEmitDecision({ emitir: pickBoolean(options.emitir), previsualizar: pickBoolean(options.previsualizar) }, file, defaults);
44
+ const destination = pickString(options.paisDestino, file?.paisDestino) ?? pickNumber(options.paisDestino, file?.paisDestino);
45
+ const currency = pickString(options.moneda, options.mda, file?.codigoMoneda);
46
+ const pdf = pickBoolean(options.exportarPdf, options.pdf) ?? (pickBoolean(options.sinPdf) === true ? false : undefined);
47
+ return {
48
+ input: {
49
+ activity: pickNumber(options.actividad, file?.actividad),
50
+ amount: pickNumber(options.monto, file?.monto),
51
+ clientAddress: pickString(options.domicilioCliente, file?.domicilioCliente),
52
+ clientCountryCuit: pickNumber(options.cuitPais, file?.cuitPais),
53
+ clientName: pickString(options.cliente, file?.cliente),
54
+ clientTaxId: pickString(options.idImpositivo, file?.idImpositivo),
55
+ commercialObservations: pickString(options.obsComerciales, file?.observacionesComerciales),
56
+ currencyCode: currency,
57
+ description: pickString(options.descripcion, file?.descripcion),
58
+ destinationCountry: destination === undefined ? undefined : String(destination),
59
+ emit,
60
+ exchangeRate: pickNumber(options.cotizacionMoneda, options.cm, file?.cotizacionMoneda),
61
+ exportType: pickNumber(options.tipoExpo, file?.tipoExpo),
62
+ incoterm: pickString(options.incoterm, file?.incoterm),
63
+ incotermDescription: pickString(options.incotermsDesc, file?.descripcionIncoterm),
64
+ items: pickItems(options.item, mapExportJsonItems(file?.items)),
65
+ language: pickNumber(options.idioma, file?.idioma),
66
+ modeSource,
67
+ observations: pickString(options.observaciones, file?.observaciones),
68
+ paymentDate: pickString(options.fechaPago, file?.fechaPago),
69
+ paymentTerms: pickString(options.formaPago, file?.formaPago),
70
+ pdf,
71
+ permits: pickList(options.permiso, file?.permisos),
72
+ permitsExisting: pickBoolean(options.permisoExistente, file?.permisoExistente),
73
+ pointOfSale: pickNumber(options.puntoVenta, options.pv, file?.puntoVenta),
74
+ requestId: pickNumber(options.idSolicitud, file?.idSolicitud),
75
+ sameCurrency: pickBoolean(options.mismaMoneda, file?.mismaMoneda),
76
+ voucherDate: pickString(options.fecha, file?.fechaComprobante),
77
+ voucherNumber: pickNumber(options.numero, file?.numero),
78
+ },
79
+ modeSource,
80
+ };
81
+ }
82
+ export function parseExportCommandInput(command, defaults = {}) {
83
+ return parseExportCommandPlan(command, defaults).input;
84
+ }
@@ -0,0 +1,61 @@
1
+ import { resolvePdfDecision } from '../../modules/pdf/pdf-decision.js';
2
+ import { resolvePdfIssuer } from '../../modules/pdf/pdf-issuer.js';
3
+ import { exportExportacionPdf, toPdfFailure } from '../../services/pdf/pdf-exporter.js';
4
+ import { isPromptCancellation } from '../interactive/prompts.js';
5
+ import { startSpinner } from '../spinner.js';
6
+ import { defaultPdfStepDependencies, loadPdfRenderer } from './billing.command.pdf.js';
7
+ /** Sin CAE no hay PDF: ni en vista previa ni en rechazados. */
8
+ function canHavePdf(result) {
9
+ return !result.dryRun && result.response.status !== 'rechazado' && Boolean(result.response.cae);
10
+ }
11
+ async function ask(deps, message, yesLabel) {
12
+ try {
13
+ return await deps.confirm(message, yesLabel, 'No');
14
+ }
15
+ catch (error) {
16
+ // El comprobante ya se emitio: Ctrl+C en la pregunta del PDF es "No", no un error del comando.
17
+ if (isPromptCancellation(error)) {
18
+ return false;
19
+ }
20
+ throw error;
21
+ }
22
+ }
23
+ /**
24
+ * Genera el PDF del comprobante emitido. Nunca lanza: el comprobante ya esta emitido, asi que un error del PDF
25
+ * se devuelve en `pdf.error` y no cambia el codigo de salida.
26
+ */
27
+ export async function attachExportPdf(result, options, deps = defaultPdfStepDependencies) {
28
+ if (!canHavePdf(result)) {
29
+ return result;
30
+ }
31
+ const decision = resolvePdfDecision({
32
+ flag: options.input.pdf,
33
+ interactive: options.interactive,
34
+ mode: options.config.pdf,
35
+ });
36
+ if (decision === 'omitir') {
37
+ return result;
38
+ }
39
+ if (decision === 'preguntar' && !(await ask(deps, '¿Generamos el PDF del comprobante?', 'Si, generar el PDF'))) {
40
+ return result;
41
+ }
42
+ const spinner = startSpinner('Generando PDF...');
43
+ try {
44
+ // Antes de descargar nada: sin los datos del emisor no se puede armar el PDF.
45
+ resolvePdfIssuer(options.config, result.voucherKind.letter);
46
+ const renderer = await loadPdfRenderer(deps.createPlugin(options.config), options.interactive, deps);
47
+ const path = await exportExportacionPdf({
48
+ config: options.config,
49
+ folder: deps.resolveFolder(options.config),
50
+ renderer,
51
+ result,
52
+ });
53
+ return { ...result, pdf: { path } };
54
+ }
55
+ catch (error) {
56
+ return { ...result, pdf: toPdfFailure(error) };
57
+ }
58
+ finally {
59
+ spinner?.stop();
60
+ }
61
+ }
@@ -12,8 +12,8 @@ export function registerFceObligationCommand(program) {
12
12
  const command = program
13
13
  .command('fce-obligado')
14
14
  .argument('<cuit>', 'CUIT del receptor a consultar')
15
- .description('consultar si un receptor esta obligado a recibir Factura de Credito Electronica (FCE)')
16
- .option('-f, --fecha <fecha>', 'fecha de emision a consultar; por defecto hoy')
15
+ .description('consultar si un receptor está obligado a recibir Factura de Crédito Electrónica (FCE)')
16
+ .option('-f, --fecha <fecha>', 'fecha de emisión a consultar; por defecto hoy')
17
17
  .addHelpText('after', createFceObligationHelp());
18
18
  registerQueryOptions(command);
19
19
  configureSpanishHelp(command);
@@ -41,4 +41,3 @@ export function registerFceObligationCommand(program) {
41
41
  }
42
42
  });
43
43
  }
44
- //# sourceMappingURL=fce-obligation.command.js.map
@@ -8,17 +8,16 @@ export function isInteractiveTerminal() {
8
8
  export function registerInteractiveCommand(program) {
9
9
  const command = program
10
10
  .command('interactivo')
11
- .description('asistente paso a paso para emitir comprobantes; tambien se abre con "arcli" sin argumentos');
11
+ .description('asistente paso a paso para emitir comprobantes; también se abre con "arcli" sin argumentos');
12
12
  // Solo el entorno: el asistente no tiene salida JSON ni respuesta bruta.
13
13
  registerEnvironmentOptions(command);
14
14
  configureSpanishHelp(command);
15
15
  command.action(async (_options, self) => {
16
16
  if (!isInteractiveTerminal()) {
17
- throw new InputValidationError('El modo interactivo necesita una terminal interactiva. Use los comandos con flags.');
17
+ throw new InputValidationError('El modo interactivo necesita una terminal interactiva. Usá los comandos con flags.');
18
18
  }
19
19
  // `--json` y `--bruto` se ignoran con un aviso: al asistente le llega solo el entorno.
20
20
  const { produccion, testing } = getGlobalOptions(self);
21
21
  await runInteractiveMode({ produccion, testing });
22
22
  });
23
23
  }
24
- //# sourceMappingURL=interactive.command.js.map
@@ -12,23 +12,23 @@ export function registerPadronCommand(program) {
12
12
  const command = program
13
13
  .command('padron')
14
14
  .argument('<cuit>', 'CUIT a consultar')
15
- .description('consultar en el padron de ARCA el nombre, domicilio y condicion IVA de un CUIT')
15
+ .description('consultar en el padrón de ARCA el nombre, domicilio y condición IVA de un CUIT')
16
16
  .addHelpText('after', createPadronHelp());
17
17
  registerQueryOptions(command);
18
18
  configureSpanishHelp(command);
19
19
  command.action(async (rawCuit, _options, self) => {
20
20
  const cuit = parseCuitArgument(rawCuit);
21
21
  const runtime = resolveArcaRuntime(getGlobalOptions(self));
22
- const spinner = runtime.outputJson ? null : startSpinner('Consultando el padron...');
22
+ const spinner = runtime.outputJson ? null : startSpinner('Consultando el padrón...');
23
23
  try {
24
24
  const taxpayer = await new ArcaPadronGateway(new ArcaClientFactory().create(runtime)).getTaxpayer(cuit);
25
25
  spinner?.stop();
26
26
  if (!taxpayer) {
27
- throw new AppError(`El CUIT ${cuit} no figura en el padron de ARCA (${runtime.environment}).`, {
27
+ throw new AppError(`El CUIT ${cuit} no figura en el padrón de ARCA (${runtime.environment}).`, {
28
28
  code: 'TAXPAYER_NOT_FOUND',
29
29
  suggestion: runtime.environment === 'testing'
30
- ? 'El padron de testing tiene datos ficticios: pruebe con 20201797064.'
31
- : 'Revise el numero.',
30
+ ? 'El padrón de testing tiene datos ficticios: probá con 20201797064.'
31
+ : 'Revisá el número.',
32
32
  });
33
33
  }
34
34
  const report = { environment: runtime.environment, taxpayer };
@@ -44,4 +44,3 @@ export function registerPadronCommand(program) {
44
44
  }
45
45
  });
46
46
  }
47
- //# sourceMappingURL=padron.command.js.map
@@ -34,8 +34,8 @@ export function registerParametersCommands(program) {
34
34
  const parameters = program
35
35
  .command('parametros')
36
36
  .argument('[tabla]', 'tabla a consultar; sin tabla lista las disponibles')
37
- .argument('[moneda]', 'solo para "cotizacion": codigo de moneda, por ejemplo USD')
38
- .description('consultar tablas de ARCA: puntos de venta, tipos, alicuotas, monedas y cotizacion');
37
+ .argument('[moneda]', 'solo para "cotizacion": código de moneda, por ejemplo USD')
38
+ .description('consultar tablas de ARCA: puntos de venta, tipos, alícuotas, monedas y cotización');
39
39
  registerQueryOptions(parameters);
40
40
  configureSpanishHelp(parameters);
41
41
  parameters.action(async (rawTable, currency, _options, self) => {
@@ -52,7 +52,7 @@ export function registerParametersCommands(program) {
52
52
  }
53
53
  if (rawTable.trim().toLowerCase() === 'cotizacion') {
54
54
  if (!currency) {
55
- throw new InputValidationError('Indique la moneda, por ejemplo: arcli parametros cotizacion USD.');
55
+ throw new InputValidationError('Indicá la moneda, por ejemplo: arcli parametros cotizacion USD.');
56
56
  }
57
57
  const { gateway, runtime } = createContext(self);
58
58
  const quotation = await withSpinner(runtime, () => gateway.getQuotation(currency));
@@ -68,7 +68,7 @@ export function registerParametersCommands(program) {
68
68
  });
69
69
  const status = program
70
70
  .command('estado')
71
- .description('ver si ARCA responde y si el punto de venta configurado esta habilitado');
71
+ .description('ver si ARCA responde y si el punto de venta configurado está habilitado');
72
72
  registerQueryOptions(status);
73
73
  configureSpanishHelp(status);
74
74
  status.action(async (_options, self) => {
@@ -78,7 +78,7 @@ export function registerParametersCommands(program) {
78
78
  return await buildStatusReport({ environment: runtime.environment, gateway, pointOfSale: runtime.pointOfSale });
79
79
  }
80
80
  catch (error) {
81
- throw new AppError(`ARCA no respondio: ${error instanceof Error ? error.message : String(error)}`, {
81
+ throw new AppError(`ARCA no respondió: ${error instanceof Error ? error.message : String(error)}`, {
82
82
  code: 'ARCA_UNAVAILABLE',
83
83
  });
84
84
  }
@@ -86,4 +86,3 @@ export function registerParametersCommands(program) {
86
86
  write(runtime, formatStatusAsText(report), formatStatusAsJson(report));
87
87
  });
88
88
  }
89
- //# sourceMappingURL=parameters.command.js.map
@@ -29,7 +29,7 @@ function printStatus({ json, plugin }, title) {
29
29
  export function registerPdfCommand(program) {
30
30
  const pdfCommand = registerJsonOption(program.command('pdf').description('instalar o revisar el plugin que genera los PDFs de los comprobantes')).action((_options, command) => printStatus(createContext(command)));
31
31
  configureSpanishHelp(pdfCommand);
32
- const estadoCommand = registerJsonOption(pdfCommand.command('estado').description('mostrar si el plugin esta instalado, su version y el navegador que usa')).action((_options, command) => printStatus(createContext(command)));
32
+ const estadoCommand = registerJsonOption(pdfCommand.command('estado').description('mostrar si el plugin está instalado, su versión y el navegador que usa')).action((_options, command) => printStatus(createContext(command)));
33
33
  configureSpanishHelp(estadoCommand);
34
34
  // Pedir el comando ya es la confirmacion: no se vuelve a preguntar, asi tambien sirve en scripts.
35
35
  const instalarCommand = registerJsonOption(pdfCommand
@@ -62,4 +62,3 @@ export function registerPdfCommand(program) {
62
62
  });
63
63
  configureSpanishHelp(desinstalarCommand);
64
64
  }
65
- //# sourceMappingURL=pdf.command.js.map
@@ -12,16 +12,16 @@ const STORYBOOK_SCENES = [
12
12
  ];
13
13
  export function registerStorybookCommand(program) {
14
14
  const command = program
15
- .command('storybook')
15
+ // Herramienta de desarrollo: funciona, pero no se lista en la ayuda.
16
+ .command('storybook', { hidden: true })
16
17
  .description('ver escenas visuales del CLI con datos de ejemplo')
17
- .argument('[escena]', 'bordes, comprobantes, colores, componentes, configuracion, errores o json')
18
+ .argument('[escena]', 'bordes, comprobantes, colores, componentes, configuración, errores o json')
18
19
  .action((scene) => {
19
20
  if (scene && !STORYBOOK_SCENES.includes(scene)) {
20
- throw new InputValidationError(`La escena "${scene}" no es valida. Use bordes, comprobantes, colores, componentes, configuracion, errores o json.`);
21
+ throw new InputValidationError(`La escena "${scene}" no es válida. Usá bordes, comprobantes, colores, componentes, configuración, errores o json.`);
21
22
  }
22
23
  writeTerminalOutput(renderStorybookShowcase(scene));
23
24
  })
24
25
  .addHelpText('after', createStorybookHelp());
25
26
  configureSpanishHelp(command);
26
27
  }
27
- //# sourceMappingURL=storybook.command.js.map
@@ -1,4 +1,5 @@
1
1
  import { AppError, InputValidationError } from '../../lib/errors/app-error.js';
2
+ import { parseStrictInteger } from '../../lib/numbers/strict-integer.js';
2
3
  import { getVoucherKindByShortcut, VOUCHER_SHORTCUTS } from '../../modules/billing/voucher-kind-map.js';
3
4
  import { listRecentVouchers, MAX_RECENT_VOUCHERS, RECENT_VOUCHERS_LIMIT } from '../../modules/vouchers/voucher-history.js';
4
5
  import { formatVoucherDetailAsJson, formatVoucherDetailAsText, formatVoucherListAsJson, formatVoucherListAsText, formatVoucherNumber, } from '../../modules/vouchers/voucher-history.presenter.js';
@@ -13,14 +14,14 @@ import { startSpinner } from '../spinner.js';
13
14
  function requireVoucherKind(shortcut) {
14
15
  const voucherKind = getVoucherKindByShortcut(shortcut.trim().toLowerCase());
15
16
  if (!voucherKind) {
16
- throw new InputValidationError(`El tipo "${shortcut}" no es valido. Use un atajo: ${VOUCHER_SHORTCUTS.join(', ')}.`);
17
+ throw new InputValidationError(`El tipo "${shortcut}" no es válido. Usá un atajo: ${VOUCHER_SHORTCUTS.join(', ')}.`);
17
18
  }
18
19
  return voucherKind;
19
20
  }
20
21
  function requirePointOfSale(options, runtime) {
21
22
  const pointOfSale = options.pv ?? options.puntoVenta ?? runtime.pointOfSale;
22
23
  if (!pointOfSale || !Number.isInteger(pointOfSale) || pointOfSale <= 0) {
23
- throw new InputValidationError('Falta el punto de venta. Use --pv <numero> o configurelo con "arcli config establecer puntoVenta <numero>".');
24
+ throw new InputValidationError('Falta el punto de venta. Usá --pv <numero> o configuralo con "arcli config establecer puntoVenta <numero>".');
24
25
  }
25
26
  return pointOfSale;
26
27
  }
@@ -46,7 +47,7 @@ export function registerVoucherQueryCommands(program) {
46
47
  const recent = addPointOfSaleOptions(program
47
48
  .command('ultimos')
48
49
  .argument('<tipo>', 'atajo del comprobante, por ejemplo fb, fc o nca')
49
- .description('listar los ultimos comprobantes emitidos en ARCA')
50
+ .description('listar los últimos comprobantes emitidos en ARCA')
50
51
  .option('--cantidad <numero>', `cuantos comprobantes mostrar (1 a ${MAX_RECENT_VOUCHERS}; por defecto config.comprobantesPorLista o ${RECENT_VOUCHERS_LIMIT})`, integerOption('--cantidad'))).addHelpText('after', createVoucherQueryHelp());
51
52
  registerQueryOptions(recent);
52
53
  configureSpanishHelp(recent);
@@ -54,7 +55,7 @@ export function registerVoucherQueryCommands(program) {
54
55
  const voucherKind = requireVoucherKind(shortcut);
55
56
  const { cantidad } = options;
56
57
  if (cantidad !== undefined && (!Number.isInteger(cantidad) || cantidad < 1 || cantidad > MAX_RECENT_VOUCHERS)) {
57
- throw new InputValidationError(`--cantidad tiene que ser un numero entre 1 y ${MAX_RECENT_VOUCHERS}.`);
58
+ throw new InputValidationError(`--cantidad tiene que ser un número entre 1 y ${MAX_RECENT_VOUCHERS}.`);
58
59
  }
59
60
  const { gateway, runtime } = createContext(self);
60
61
  const limit = cantidad ?? runtime.config.comprobantesPorLista ?? RECENT_VOUCHERS_LIMIT;
@@ -70,15 +71,15 @@ export function registerVoucherQueryCommands(program) {
70
71
  const detail = addPointOfSaleOptions(program
71
72
  .command('consultar')
72
73
  .argument('<tipo>', 'atajo del comprobante, por ejemplo fb, fc o nca')
73
- .argument('<numero>', 'numero del comprobante')
74
+ .argument('<numero>', 'número del comprobante')
74
75
  .description('ver el detalle de un comprobante emitido en ARCA')).addHelpText('after', createVoucherQueryHelp());
75
76
  registerQueryOptions(detail);
76
77
  configureSpanishHelp(detail);
77
78
  detail.action(async (shortcut, rawNumber, options, self) => {
78
79
  const voucherKind = requireVoucherKind(shortcut);
79
- const number = Number(rawNumber);
80
- if (!Number.isInteger(number) || number <= 0) {
81
- throw new InputValidationError(`El numero "${rawNumber}" no es valido: tiene que ser un entero positivo.`);
80
+ const number = parseStrictInteger(rawNumber);
81
+ if (number === undefined || number <= 0) {
82
+ throw new InputValidationError(`El número "${rawNumber}" no es válido: tiene que ser un entero positivo.`);
82
83
  }
83
84
  const { gateway, runtime } = createContext(self);
84
85
  const pointOfSale = requirePointOfSale(options, runtime);
@@ -94,4 +95,3 @@ export function registerVoucherQueryCommands(program) {
94
95
  writeTerminalOutput(formatVoucherDetailAsText(report));
95
96
  });
96
97
  }
97
- //# sourceMappingURL=vouchers.command.js.map
@@ -27,10 +27,29 @@ export function isCommanderExit(error) {
27
27
  export function isCommanderUsageError(error) {
28
28
  return error instanceof CommanderError && !COMMANDER_NON_ERROR_CODES.has(error.code);
29
29
  }
30
+ /** Los mensajes de error de uso de commander (15.x), que vienen en ingles. */
31
+ const COMMANDER_MESSAGES = [
32
+ [/unknown option '([^']+)'/, "opción desconocida '$1'"],
33
+ [/unknown command '([^']+)'/, "comando desconocido '$1'"],
34
+ [/missing required argument '([^']+)'/, "falta el argumento obligatorio '$1'"],
35
+ [/option '([^']+)' argument missing/, "falta el valor de la opción '$1'"],
36
+ [/required option '([^']+)' not specified/, "falta la opción obligatoria '$1'"],
37
+ [/option '([^']+)' argument '([^']*)' is invalid\./, "el valor '$2' de la opción '$1' no es válido."],
38
+ [
39
+ /too many arguments(?: for '([^']+)')?\. Expected (\d+) arguments? but got (\d+): (.*)\./,
40
+ 'sobran argumentos: espera $2 y recibió $3 ($4).',
41
+ ],
42
+ [/ cannot be used with /, ' no se puede usar junto con '],
43
+ [/\(Did you mean one of ([^?]+)\?\)/, '(¿quisiste decir alguno de $1?)'],
44
+ [/\(Did you mean ([^?]+)\?\)/, '(¿quisiste decir $1?)'],
45
+ ];
46
+ export function translateCommanderMessage(message) {
47
+ return COMMANDER_MESSAGES.reduce((result, [pattern, replacement]) => result.replace(pattern, replacement), message);
48
+ }
30
49
  /** El error de uso de commander como `INPUT_VALIDATION_ERROR`, en el mismo formato que el resto. */
31
50
  export function toUsageError(error) {
32
51
  // Commander arma el mensaje con "error: " adelante y, a veces, una segunda linea "(Did you mean --monto?)".
33
- const message = error.message
52
+ const message = translateCommanderMessage(error.message)
34
53
  .replace(/^error:\s*/i, '')
35
54
  .replace(/\s*\n\s*/g, ' ')
36
55
  .trim();
@@ -50,7 +69,7 @@ export function configureUsageErrors(program, errorsAsJson) {
50
69
  outputError: (message, write) => {
51
70
  failing = true;
52
71
  if (!errorsAsJson()) {
53
- write(message);
72
+ write(translateCommanderMessage(message));
54
73
  }
55
74
  },
56
75
  writeErr: (text) => {
@@ -83,4 +102,3 @@ export function reportCliError(error, errorsAsJson) {
83
102
  }
84
103
  return 1;
85
104
  }
86
- //# sourceMappingURL=error-output.js.map
@@ -6,8 +6,8 @@ import { ConfigService } from '../modules/config/config.service.js';
6
6
  */
7
7
  export function registerEnvironmentOptions(command) {
8
8
  return command
9
- .option('--testing', 'usar entorno de testing en esta ejecucion')
10
- .option('--produccion', 'usar entorno de produccion en esta ejecucion');
9
+ .option('--testing', 'usar entorno de testing en esta ejecución')
10
+ .option('--produccion', 'usar entorno de producción en esta ejecución');
11
11
  }
12
12
  export function registerJsonOption(command) {
13
13
  return command.option('--json', 'imprimir salida JSON');
@@ -53,4 +53,3 @@ export function resolveOutputJson(command, config) {
53
53
  }
54
54
  return config ? config.output.jsonPorDefecto : readJsonDefault();
55
55
  }
56
- //# sourceMappingURL=global-options.js.map
@@ -18,4 +18,3 @@ export function normalizeHelpArgv(argv, interactive) {
18
18
  }
19
19
  return argv;
20
20
  }
21
- //# sourceMappingURL=help-argv.js.map