arcli 2.1.0 → 2.2.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 (539) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/README.md +6 -0
  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 +41 -14
  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
@@ -3,7 +3,7 @@ import { colorize, writeTerminalError } from '../ui/index.js';
3
3
  * Opciones del programa que un comando puede no usar. Commander las acepta en cualquier comando (las parsea el
4
4
  * programa), asi que `arcli config revisar --produccion` no fallaba ni hacia nada.
5
5
  */
6
- const GLOBAL_OPTION_FLAGS = ['--testing', '--produccion', '--json', '--bruto'];
6
+ export const GLOBAL_OPTION_FLAGS = ['--testing', '--produccion', '--json', '--bruto'];
7
7
  /** Las opciones globales que se pasaron pero el comando no declara: se ignoran. Las del padre no cuentan. */
8
8
  export function findIgnoredGlobalOptions(program, actionCommand) {
9
9
  const values = program.opts();
@@ -30,4 +30,3 @@ export function warnAboutIgnoredGlobalOptions(program) {
30
30
  }
31
31
  });
32
32
  }
33
- //# sourceMappingURL=ignored-global-options.js.map
package/dist/cli/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { OWNER_ONLY_UMASK } from '../lib/files/restrict-to-owner.js';
3
+ import { COMPLETE_COMMAND } from '../modules/completion/shell-scripts.js';
3
4
  import { renderUpdateNoticePanel } from '../modules/update-check/update-check.presenter.js';
4
5
  import { checkForUpdate } from '../modules/update-check/update-check.service.js';
5
6
  import { writeTerminalError } from '../ui/index.js';
@@ -14,11 +15,13 @@ let errorsAsJson;
14
15
  // Se decide recien al fallar (puede leer la config) y una sola vez: commander y el catch lo consultan.
15
16
  const shouldPrintErrorsAsJson = () => (errorsAsJson ??= shouldPrintErrorAsJson(process.argv));
16
17
  const program = createProgram({ errorsAsJson: shouldPrintErrorsAsJson });
17
- const argv = normalizeHelpArgv(process.argv, isInteractiveTerminal());
18
+ // El autocompletado corre en cada Tab: recibe las palabras tal cual y no busca actualizaciones.
19
+ const isCompletion = process.argv[2] === COMPLETE_COMMAND;
20
+ const argv = isCompletion ? process.argv : normalizeHelpArgv(process.argv, isInteractiveTerminal());
18
21
  const useJson = process.argv.includes('--json');
19
22
  // El modo interactivo muestra la actualizacion como primera opcion del menu, no al cerrar.
20
23
  const isInteractiveMode = argv[2] === 'interactivo';
21
- const updateCheckPromise = useJson || isInteractiveMode ? Promise.resolve(null) : checkForUpdate(CLI_VERSION).catch(() => null);
24
+ const updateCheckPromise = useJson || isInteractiveMode || isCompletion ? Promise.resolve(null) : checkForUpdate(CLI_VERSION).catch(() => null);
22
25
  program
23
26
  .parseAsync(argv)
24
27
  .then(async () => {
@@ -30,4 +33,3 @@ program
30
33
  .catch((error) => {
31
34
  process.exitCode = reportCliError(error, shouldPrintErrorsAsJson());
32
35
  });
33
- //# sourceMappingURL=index.js.map
@@ -7,7 +7,7 @@ function describeCurrency(options) {
7
7
  if (!options.currencyCode || options.currencyCode === 'PES' || options.currencyCode === 'ARS') {
8
8
  return 'pesos';
9
9
  }
10
- return options.sameCurrency ? 'dolares, cotizacion oficial de ARCA' : `dolares, cotizacion ${options.exchangeRate}`;
10
+ return options.sameCurrency ? 'dólares, cotización oficial de ARCA' : `dólares, cotización ${options.exchangeRate}`;
11
11
  }
12
12
  function describeAmounts(options) {
13
13
  const parts = [
@@ -19,7 +19,7 @@ function describeAmounts(options) {
19
19
  async function askCurrency(current) {
20
20
  const currency = await chooseStep('Moneda del comprobante:', [
21
21
  { name: 'Pesos', value: 'PES' },
22
- { name: 'Dolares (USD)', value: 'USD' },
22
+ { name: 'Dólares (USD)', value: 'USD' },
23
23
  ]);
24
24
  if (currency === BACK) {
25
25
  return BACK;
@@ -27,9 +27,9 @@ async function askCurrency(current) {
27
27
  if (currency === 'PES') {
28
28
  return { ...current, currencyCode: 'ARS', exchangeRate: undefined, sameCurrency: false };
29
29
  }
30
- const payment = await chooseStep('¿Como te pagan?', [
31
- { description: 'Ingresas la cotizacion acordada', name: 'En pesos', value: 'pesos' },
32
- { description: 'Se usa la cotizacion oficial de ARCA', name: 'En dolares', value: 'dolares' },
30
+ const payment = await chooseStep('¿Cómo te pagan?', [
31
+ { description: 'Ingresas la cotización acordada', name: 'En pesos', value: 'pesos' },
32
+ { description: 'Se usa la cotización oficial de ARCA', name: 'En dólares', value: 'dolares' },
33
33
  ]);
34
34
  if (payment === BACK) {
35
35
  return BACK;
@@ -37,19 +37,19 @@ async function askCurrency(current) {
37
37
  if (payment === 'dolares') {
38
38
  return { ...current, currencyCode: 'USD', exchangeRate: undefined, sameCurrency: true };
39
39
  }
40
- const rate = await askTextStep('Cotizacion del dolar:', { validate: validateExchangeRate });
40
+ const rate = await askTextStep('Cotización del dólar:', { validate: validateExchangeRate });
41
41
  return rate === BACK
42
42
  ? BACK
43
43
  : { ...current, currencyCode: 'USD', exchangeRate: parseExchangeRateInput(rate), sameCurrency: false };
44
44
  }
45
45
  async function askExemptAmounts(current) {
46
- const exempt = await askTextStep('Parte exenta del monto total (vacio si no hay):', {
46
+ const exempt = await askTextStep('Parte exenta del monto total (vacío si no hay):', {
47
47
  validate: validateOptionalAmount,
48
48
  });
49
49
  if (exempt === BACK) {
50
50
  return BACK;
51
51
  }
52
- const untaxed = await askTextStep('Parte no gravada del monto total (vacio si no hay):', {
52
+ const untaxed = await askTextStep('Parte no gravada del monto total (vacío si no hay):', {
53
53
  validate: validateOptionalAmount,
54
54
  });
55
55
  if (untaxed === BACK) {
@@ -70,12 +70,12 @@ async function askPaymentDueDate(current) {
70
70
  return due === BACK ? BACK : { ...current, paymentDueDate: due };
71
71
  }
72
72
  async function askIvaRate(current, context) {
73
- const ivaRate = await chooseStep('Alicuota de IVA:', ivaRateChoices(), current.ivaRate ?? context.defaultIvaRate);
73
+ const ivaRate = await chooseStep('Alícuota de IVA:', ivaRateChoices(), current.ivaRate ?? context.defaultIvaRate);
74
74
  return ivaRate === BACK ? BACK : { ...current, ivaRate };
75
75
  }
76
76
  async function askTransferMode(current) {
77
77
  const transferMode = await chooseStep('Modalidad de transferencia:', [
78
- { description: 'La opcion habitual', name: 'Sistema de circulacion abierta (SCA)', value: 'sca' },
78
+ { description: 'La opción habitual', name: 'Sistema de circulación abierta (SCA)', value: 'sca' },
79
79
  { name: 'Agente de deposito colectivo (ADC)', value: 'adc' },
80
80
  ], current.transferMode ?? 'sca');
81
81
  return transferMode === BACK ? BACK : { ...current, transferMode };
@@ -89,7 +89,7 @@ function optionalChoices(options, context) {
89
89
  ? [
90
90
  {
91
91
  description: `${(options.ivaRate ?? context.defaultIvaRate).replace('.', ',')}%`,
92
- name: 'Alicuota de IVA',
92
+ name: 'Alícuota de IVA',
93
93
  value: 'alicuota',
94
94
  },
95
95
  ]
@@ -102,7 +102,7 @@ function optionalChoices(options, context) {
102
102
  ? [
103
103
  {
104
104
  description: options.serviceStartDate ? `${options.serviceStartDate} al ${options.serviceEndDate}` : 'hoy',
105
- name: 'Periodo del servicio',
105
+ name: 'Período del servicio',
106
106
  value: 'servicio',
107
107
  },
108
108
  ]
@@ -144,7 +144,7 @@ export async function askAdvancedOptions(initial, context) {
144
144
  let options = initial;
145
145
  let selected = [...(context.preselected ?? [])];
146
146
  for (;;) {
147
- const picked = await chooseManyStep('¿Agregamos algun opcional? (espacio para marcar, Enter para seguir)', optionalChoices(options, context), selected);
147
+ const picked = await chooseManyStep('¿Agregamos algún opcional? (espacio para marcar, Enter para seguir)', optionalChoices(options, context), selected);
148
148
  if (picked === BACK) {
149
149
  return BACK;
150
150
  }
@@ -163,4 +163,3 @@ export async function askAdvancedOptions(initial, context) {
163
163
  }
164
164
  }
165
165
  }
166
- //# sourceMappingURL=advanced-options.js.map
@@ -1,6 +1,9 @@
1
1
  import { Separator } from '@inquirer/select';
2
2
  import { join } from 'node:path';
3
3
  import { CERTIFICATE_GUIDE_URL } from '../../lib/links.js';
4
+ import { formatCompletionResultAsText, formatCompletionStateAsText, } from '../../modules/completion/completion.presenter.js';
5
+ import { currentCompletionEnvironment, detectShell, getCompletionState, installCompletion, uninstallCompletion, } from '../../modules/completion/installer.js';
6
+ import { COMPLETION_SHELLS } from '../../modules/completion/shell-scripts.js';
4
7
  import { CONFIG_SECTIONS } from '../../modules/config/config.sections.js';
5
8
  import { ConfigService, validateConfigValue } from '../../modules/config/config.service.js';
6
9
  import { buildConfigDoctorReport } from '../../modules/config/config-doctor.js';
@@ -22,7 +25,12 @@ const GUIDED_KEYS = [
22
25
  'concepto',
23
26
  'ivaReceptor',
24
27
  ];
25
- const ISSUER_KEYS = ['emisor.razonSocial', 'emisor.domicilio', 'emisor.inicioActividades'];
28
+ const ISSUER_KEYS = [
29
+ 'emisor.razonSocial',
30
+ 'emisor.domicilio',
31
+ 'emisor.inicioActividades',
32
+ 'emisor.iibb',
33
+ ];
26
34
  function withConfigService(run) {
27
35
  const service = new ConfigService();
28
36
  try {
@@ -105,7 +113,7 @@ function fieldSteps(keys, required) {
105
113
  name: key,
106
114
  run: async () => {
107
115
  if (key === 'cert.testing' && !readConfig().cert.testing) {
108
- writeTerminalOutput(noticePanel(`¿No tenes certificado todavia? Guia paso a paso: ${CERTIFICATE_GUIDE_URL}`, 'muted'));
116
+ writeTerminalOutput(noticePanel(`¿No tenés certificado todavía? Guía paso a paso: ${CERTIFICATE_GUIDE_URL}`, 'muted'));
109
117
  }
110
118
  const result = await askField(getConfigField(key), readConfig(), { required: required.includes(key) });
111
119
  return result === BACK ? BACK : {};
@@ -114,16 +122,16 @@ function fieldSteps(keys, required) {
114
122
  }
115
123
  /** Configuracion guiada: lo minimo para emitir, los defaults mas usados y, si se quiere, los datos del PDF. */
116
124
  export async function runGuidedSetup() {
117
- writeTerminalOutput(noticePanel(`Vamos a dejar todo listo para emitir. Si todavia no tenes certificado, la guia esta en ${CERTIFICATE_GUIDE_URL}`, 'info'));
125
+ writeTerminalOutput(noticePanel(`Vamos a dejar todo listo para emitir. Si todavía no tenés certificado, la guía esta en ${CERTIFICATE_GUIDE_URL}`, 'info'));
118
126
  const completed = await runWizard(fieldSteps(GUIDED_KEYS, ['cuit', 'cert.testing', 'key.testing', 'puntoVenta']), {});
119
127
  if (!completed) {
120
- writeTerminalOutput(noticePanel('Configuracion guiada cancelada. Lo ya respondido quedo guardado.', 'muted'));
128
+ writeTerminalOutput(noticePanel('Configuración guiada cancelada. Lo ya respondido quedo guardado.', 'muted'));
121
129
  return;
122
130
  }
123
- if (await confirm('¿Cargamos tambien los datos del emisor para el PDF?', 'Si', 'Ahora no')) {
131
+ if (await confirm('¿Cargamos también los datos del emisor para el PDF?', 'Si', 'Ahora no')) {
124
132
  await runWizard(fieldSteps(ISSUER_KEYS, []), {});
125
133
  }
126
- writeTerminalOutput(noticePanel('Configuracion guardada. Ya podes emitir en testing.', 'success'));
134
+ writeTerminalOutput(noticePanel('Configuración guardada. Ya podés emitir en testing.', 'success'));
127
135
  }
128
136
  /** Los datos agrupados por seccion, en el mismo orden que `arcli config`, con un titulo arriba de cada una. */
129
137
  function fieldChoicesBySection(config) {
@@ -149,7 +157,7 @@ async function runChangeField() {
149
157
  const config = readConfig();
150
158
  const choices = fieldChoicesBySection(config);
151
159
  // +2: el separador y "Volver" que agrega chooseStep.
152
- const field = await chooseStep('¿Que queres modificar?', choices, lastField, fitPageSize(choices.length + 2));
160
+ const field = await chooseStep('¿Qué querés modificar?', choices, lastField, fitPageSize(choices.length + 2));
153
161
  if (field === BACK) {
154
162
  return;
155
163
  }
@@ -167,11 +175,11 @@ async function runPdfPluginMenu() {
167
175
  }));
168
176
  const status = plugin.getStatus();
169
177
  writeTerminalOutput(formatPdfPluginStatusAsText(status));
170
- const action = await chooseStep('¿Que hacemos con el plugin de PDF?', [
178
+ const action = await chooseStep('¿Qué hacemos con el plugin de PDF?', [
171
179
  status.installed
172
180
  ? { description: 'Borra el plugin y el navegador descargado', name: 'Desinstalar', value: 'desinstalar' }
173
181
  : {
174
- description: '~160 MB, o ~360 MB si no tenes Chrome',
182
+ description: '~160 MB, o ~360 MB si no tenés Chrome',
175
183
  name: status.installedVersion ? 'Actualizar' : 'Instalar',
176
184
  value: 'instalar',
177
185
  },
@@ -197,6 +205,30 @@ async function runPdfPluginMenu() {
197
205
  }
198
206
  writeTerminalOutput(formatPdfPluginStatusAsText(plugin.getStatus(), 'Plugin de PDF instalado'));
199
207
  }
208
+ async function runCompletionMenu() {
209
+ const environment = currentCompletionEnvironment();
210
+ const shell = detectShell(environment.shell) ??
211
+ (await chooseStep('¿Qué shell usás?', COMPLETION_SHELLS.map((name) => ({ name, value: name }))));
212
+ if (shell === BACK) {
213
+ return;
214
+ }
215
+ const state = getCompletionState(shell, environment);
216
+ writeTerminalOutput(formatCompletionStateAsText(state, environment.home));
217
+ const action = await chooseStep('¿Qué hacemos con el autocompletado?', [
218
+ state.installed
219
+ ? { description: 'Lo saca del archivo de inicio del shell', name: 'Desinstalar', value: 'desinstalar' }
220
+ : {
221
+ description: `Completa comandos y flags con Tab; se agrega a ${state.path.replace(environment.home, '~')}`,
222
+ name: 'Instalar',
223
+ value: 'instalar',
224
+ },
225
+ ]);
226
+ if (action === BACK) {
227
+ return;
228
+ }
229
+ const result = (action === 'instalar' ? installCompletion : uninstallCompletion)(shell, environment);
230
+ writeTerminalOutput(formatCompletionResultAsText(result, environment.home));
231
+ }
200
232
  function showConfig() {
201
233
  withConfigService((service) => {
202
234
  const config = service.getConfig();
@@ -206,24 +238,29 @@ function showConfig() {
206
238
  /** Submenu de configuracion: ver, revisar, configuracion guiada, modificar y el plugin de PDF. */
207
239
  export async function runConfigMenu() {
208
240
  for (;;) {
209
- const option = await chooseOne('Configuracion', [
210
- { description: 'Todos los datos guardados, como arcli config', name: 'Ver configuracion', value: 'ver' },
241
+ const option = await chooseOne('Configuración', [
242
+ { description: 'Todos los datos guardados, como arcli config', name: 'Ver configuración', value: 'ver' },
211
243
  {
212
- description: 'Credenciales, defaults y validacion contra ARCA',
213
- name: 'Revisar configuracion',
244
+ description: 'Credenciales, defaults y validación contra ARCA',
245
+ name: 'Revisar configuración',
214
246
  value: 'revisar',
215
247
  },
216
248
  {
217
249
  description: 'CUIT, certificado, punto de venta y defaults, paso a paso',
218
- name: 'Configuracion guiada',
250
+ name: 'Configuración guiada',
219
251
  value: 'guiada',
220
252
  },
221
253
  {
222
- description: 'Elegis un dato, agrupado por seccion, y lo cambias',
223
- name: 'Modificar configuracion',
254
+ description: 'Elegis un dato, agrupado por sección, y lo cambias',
255
+ name: 'Modificar configuración',
224
256
  value: 'cambiar',
225
257
  },
226
258
  { description: 'Estado, instalar o desinstalar', name: 'Plugin de PDF', value: 'pdf' },
259
+ {
260
+ description: 'Completar comandos y flags con Tab en la terminal',
261
+ name: 'Autocompletado',
262
+ value: 'completado',
263
+ },
227
264
  new Separator(' '),
228
265
  { name: '← Volver al menu', value: 'volver' },
229
266
  ], undefined, { escapeValue: 'volver' });
@@ -242,6 +279,7 @@ export async function runConfigMenu() {
242
279
  await runChangeField();
243
280
  if (option === 'pdf')
244
281
  await runPdfPluginMenu();
282
+ if (option === 'completado')
283
+ await runCompletionMenu();
245
284
  }
246
285
  }
247
- //# sourceMappingURL=config.flow.js.map
@@ -0,0 +1,263 @@
1
+ import { parseStrictInteger } from '../../lib/numbers/strict-integer.js';
2
+ import { ConfigService } from '../../modules/config/config.service.js';
3
+ import { DEFAULT_EXPORT_PAYMENT_TERMS, resolveExportDestinationCountry } from '../../modules/export/export.mappers.js';
4
+ import { ExportService } from '../../modules/export/export.service.js';
5
+ import { EXPORT_VOUCHER_KIND, } from '../../modules/export/export.types.js';
6
+ import { parseAmountInput } from '../../modules/interactive/amount-input.js';
7
+ import { buildExportEquivalentCommand } from '../../modules/interactive/export-equivalent-command.js';
8
+ import { BACK, runWizard } from '../../modules/interactive/wizard.js';
9
+ import { ArcaClientFactory } from '../../services/arca/arca-client.factory.js';
10
+ import { ArcaExportGateway } from '../../services/arca/arca-export.gateway.js';
11
+ import { formatExportResultAsText, formatPdfOutcomeAsText, noticePanel, writeTerminalOutput } from '../../ui/index.js';
12
+ import { attachExportPdf } from '../commands/export.command.pdf.js';
13
+ import { startSpinner } from '../spinner.js';
14
+ import { askTextStep, chooseStep, confirm } from './prompts.js';
15
+ import { formatEquivalentCommand } from './session.js';
16
+ import { validateAmount, validateDate } from './validators.js';
17
+ async function withSpinner(text, run) {
18
+ const spinner = startSpinner(text);
19
+ try {
20
+ return await run();
21
+ }
22
+ finally {
23
+ spinner?.stop();
24
+ }
25
+ }
26
+ function required(label) {
27
+ return (value) => (value.trim() ? true : `${label} es obligatorio.`);
28
+ }
29
+ function optionalDate(value) {
30
+ return value.trim() ? validateDate(value) : true;
31
+ }
32
+ function validateCountry(countries) {
33
+ return (value) => {
34
+ try {
35
+ resolveExportDestinationCountry(value, countries);
36
+ return true;
37
+ }
38
+ catch (error) {
39
+ return error instanceof Error ? error.message : String(error);
40
+ }
41
+ };
42
+ }
43
+ function validatePositiveInteger(label, allowed) {
44
+ return (value) => {
45
+ const number = parseStrictInteger(value);
46
+ if (number === undefined || number < 1) {
47
+ return `${label} tiene que ser un número entero mayor a 0.`;
48
+ }
49
+ return !allowed || allowed.size === 0 || allowed.has(number)
50
+ ? true
51
+ : `${number} no está en la tabla de actividades de WSFEX (ARCA la rechaza con el error 2105).`;
52
+ };
53
+ }
54
+ const optional = (value) => value.trim() || undefined;
55
+ /** Pasos de la factura E; cada uno se puede deshacer con "Volver". */
56
+ function exportSteps(tables, configuredActivity, incoterms) {
57
+ return [
58
+ {
59
+ name: 'cliente',
60
+ run: async () => {
61
+ const answer = await askTextStep('Nombre o razón social del cliente del exterior:', {
62
+ validate: required('El cliente'),
63
+ });
64
+ return answer === BACK ? BACK : { clientName: answer.trim() };
65
+ },
66
+ },
67
+ {
68
+ name: 'domicilio',
69
+ run: async () => {
70
+ const answer = await askTextStep('Domicilio del cliente:', { validate: required('El domicilio') });
71
+ return answer === BACK ? BACK : { clientAddress: answer.trim() };
72
+ },
73
+ },
74
+ {
75
+ name: 'pais',
76
+ run: async () => {
77
+ const answer = await askTextStep('País de destino (nombre o código de ARCA, por ejemplo ESTADOS UNIDOS o 212):', {
78
+ validate: validateCountry(tables.countries),
79
+ });
80
+ return answer === BACK
81
+ ? BACK
82
+ : { destinationCountry: resolveExportDestinationCountry(answer, tables.countries).name };
83
+ },
84
+ },
85
+ {
86
+ name: 'id-impositivo',
87
+ run: async () => {
88
+ const answer = await askTextStep('ID impositivo del cliente en su país (Enter para omitirlo):');
89
+ return answer === BACK ? BACK : { clientTaxId: optional(answer) };
90
+ },
91
+ },
92
+ {
93
+ name: 'tipo',
94
+ run: async () => {
95
+ const exportType = await chooseStep('¿Qué exportás?', [
96
+ { name: 'Servicios', value: 2 },
97
+ { description: 'Lleva incoterm y, si los hay, permisos de embarque', name: 'Bienes', value: 1 },
98
+ { name: 'Otros', value: 4 },
99
+ ], 2);
100
+ return exportType === BACK ? BACK : { exportType, incoterm: undefined };
101
+ },
102
+ },
103
+ {
104
+ name: 'monto',
105
+ run: async () => {
106
+ const answer = await askTextStep('Monto total:', { validate: validateAmount });
107
+ return answer === BACK ? BACK : { amount: parseAmountInput(answer) };
108
+ },
109
+ },
110
+ {
111
+ name: 'descripcion',
112
+ run: async () => {
113
+ const answer = await askTextStep('Descripción del servicio o producto (Enter para "Según detalle"):');
114
+ return answer === BACK ? BACK : { description: optional(answer) };
115
+ },
116
+ },
117
+ {
118
+ name: 'moneda',
119
+ run: async () => {
120
+ const currencyCode = await chooseStep('¿En qué moneda facturás?', [
121
+ { description: 'Con la cotización de aduana que publica ARCA', name: 'Dólares (DOL)', value: 'DOL' },
122
+ { name: 'Pesos (PES)', value: 'PES' },
123
+ ], 'DOL');
124
+ return currencyCode === BACK
125
+ ? BACK
126
+ : { currencyCode, sameCurrency: currencyCode === 'PES' ? false : undefined };
127
+ },
128
+ },
129
+ {
130
+ name: 'misma-moneda',
131
+ run: async () => {
132
+ const sameCurrency = await chooseStep('¿Te pagan en dólares?', [
133
+ { description: 'ARCA lo registra como cancelación en la misma moneda', name: 'Sí', value: true },
134
+ { name: 'No, en pesos', value: false },
135
+ ]);
136
+ return sameCurrency === BACK ? BACK : { sameCurrency };
137
+ },
138
+ skip: (state) => state.currencyCode === 'PES',
139
+ },
140
+ {
141
+ name: 'incoterm',
142
+ run: async () => {
143
+ const list = await withSpinner('Consultando incoterms...', incoterms);
144
+ const incoterm = await chooseStep('Incoterm:', [
145
+ { name: 'Sin incoterm', value: '' },
146
+ ...list.map((entry) => ({ name: entry.code, value: entry.code })),
147
+ ]);
148
+ return incoterm === BACK ? BACK : { incoterm: incoterm || undefined };
149
+ },
150
+ skip: (state) => state.exportType !== 1,
151
+ },
152
+ {
153
+ name: 'forma-pago',
154
+ run: async () => {
155
+ const answer = await askTextStep('Forma de pago:', { defaultValue: DEFAULT_EXPORT_PAYMENT_TERMS });
156
+ return answer === BACK ? BACK : { paymentTerms: optional(answer) };
157
+ },
158
+ },
159
+ {
160
+ name: 'fecha-pago',
161
+ run: async () => {
162
+ const answer = await askTextStep('Fecha de pago (Enter para la fecha del comprobante):', {
163
+ validate: optionalDate,
164
+ });
165
+ return answer === BACK ? BACK : { paymentDate: optional(answer) };
166
+ },
167
+ },
168
+ {
169
+ name: 'actividad',
170
+ run: async () => {
171
+ const answer = await askTextStep('Código de actividad de WSFEX (por ejemplo 620100):', {
172
+ validate: validatePositiveInteger('La actividad', tables.activities),
173
+ });
174
+ return answer === BACK ? BACK : { activity: parseStrictInteger(answer) };
175
+ },
176
+ skip: () => configuredActivity !== undefined,
177
+ },
178
+ {
179
+ name: 'numero',
180
+ run: async () => {
181
+ const answer = await askTextStep('Número del comprobante (el siguiente al último E de este punto de venta; 1 si es el primero):', { validate: validatePositiveInteger('El número') });
182
+ return answer === BACK ? BACK : { voucherNumber: parseStrictInteger(answer) };
183
+ },
184
+ },
185
+ ];
186
+ }
187
+ /** Ofrece guardar la actividad que se escribio a mano, para no volver a preguntarla. */
188
+ async function offerSavingActivity(activity) {
189
+ if (!(await confirm(`¿Guardamos la actividad ${activity} en la config para la próxima?`, 'Sí, guardar', 'No'))) {
190
+ return;
191
+ }
192
+ const service = new ConfigService();
193
+ try {
194
+ service.setValue('exportacion.actividad', String(activity));
195
+ }
196
+ finally {
197
+ service.close();
198
+ }
199
+ }
200
+ async function emit(session, gateway, input, activity) {
201
+ const { runtime } = session;
202
+ const service = new ExportService();
203
+ const resolved = await withSpinner('Consultando WSFEX...', () => service.resolve(input, gateway, runtime));
204
+ const preview = service.preview(resolved, runtime, resolved.warnings);
205
+ writeTerminalOutput(formatExportResultAsText(preview, { environment: runtime.environment, raw: false }));
206
+ writeTerminalOutput(formatEquivalentCommand(buildExportEquivalentCommand(input, { activity, environment: runtime.environment })));
207
+ const label = EXPORT_VOUCHER_KIND.displayName;
208
+ const environmentLabel = runtime.environment === 'produccion' ? 'PRODUCCIÓN' : 'testing';
209
+ if (!(await confirm(`¿Emitimos la ${label} en ${environmentLabel}?`, 'Emitir ahora'))) {
210
+ writeTerminalOutput(noticePanel('No se emitió nada.', 'muted'));
211
+ return;
212
+ }
213
+ if (runtime.environment === 'produccion' &&
214
+ !(await confirm('Vas a emitir un comprobante real en PRODUCCIÓN. ¿Confirmás?', 'Sí, emitir en producción'))) {
215
+ writeTerminalOutput(noticePanel('No se emitió nada.', 'muted'));
216
+ return;
217
+ }
218
+ const result = await withSpinner(`Emitiendo ${label} en ARCA...`, () => service.execute({ gateway, resolved, runtime, warnings: resolved.warnings }));
219
+ writeTerminalOutput(formatExportResultAsText(result, { environment: runtime.environment, previewShown: true, raw: false }));
220
+ const withPdf = await attachExportPdf(result, { config: runtime.config, input, interactive: true });
221
+ if (withPdf.pdf) {
222
+ writeTerminalOutput(formatPdfOutcomeAsText(withPdf.pdf));
223
+ }
224
+ }
225
+ /**
226
+ * Factura E paso a paso. Usa ExportService igual que `arcli fe`, asi que valida y emite exactamente lo mismo.
227
+ * Devuelve BACK si se vuelve desde el primer paso, para volver al selector de comprobantes.
228
+ */
229
+ export async function runExportFlow(session) {
230
+ const { config } = session.runtime;
231
+ const gateway = new ArcaExportGateway(new ArcaClientFactory().createForExport(session.runtime));
232
+ const tables = await withSpinner('Consultando las tablas de WSFEX...', async () => ({
233
+ activities: new Set((await gateway.getActivities()).map((activity) => activity.id)),
234
+ countries: await gateway.getDestinationCountries(),
235
+ }));
236
+ const configuredActivity = config.exportacion?.actividad;
237
+ const state = await runWizard(exportSteps(tables, configuredActivity, () => gateway.getIncoterms()), {});
238
+ if (!state) {
239
+ return BACK;
240
+ }
241
+ const activity = (state.activity ?? configuredActivity);
242
+ const input = {
243
+ activity,
244
+ amount: state.amount,
245
+ clientAddress: state.clientAddress,
246
+ clientName: state.clientName,
247
+ clientTaxId: state.clientTaxId,
248
+ currencyCode: state.currencyCode,
249
+ description: state.description,
250
+ destinationCountry: state.destinationCountry,
251
+ emit: false,
252
+ exportType: state.exportType,
253
+ incoterm: state.incoterm,
254
+ paymentDate: state.paymentDate,
255
+ paymentTerms: state.paymentTerms,
256
+ sameCurrency: state.sameCurrency,
257
+ voucherNumber: state.voucherNumber,
258
+ };
259
+ await emit(session, gateway, input, activity);
260
+ if (state.activity !== undefined && configuredActivity === undefined) {
261
+ await offerSavingActivity(state.activity);
262
+ }
263
+ }
@@ -14,7 +14,7 @@ export async function runHistoryFlow(session) {
14
14
  if (!pointOfSale) {
15
15
  return;
16
16
  }
17
- const voucherKind = await chooseStep('¿Que comprobantes queres consultar?', VOUCHER_SHORTCUTS.map((shortcut) => ({
17
+ const voucherKind = await chooseStep('¿Qué comprobantes querés consultar?', VOUCHER_SHORTCUTS.map((shortcut) => ({
18
18
  name: `${VOUCHER_KIND_MAP[shortcut].displayName} (${shortcut})`,
19
19
  value: VOUCHER_KIND_MAP[shortcut],
20
20
  })));
@@ -22,7 +22,7 @@ export async function runHistoryFlow(session) {
22
22
  return;
23
23
  }
24
24
  await pickInvoice(session, {
25
- message: `¿Que ${voucherKind.displayName} queres ver?`,
25
+ message: `¿Qué ${voucherKind.displayName} querés ver?`,
26
26
  onPick: (picked) => writeTerminalOutput(formatVoucherDetailAsText({
27
27
  environment: session.runtime.environment,
28
28
  pointOfSale: picked.pointOfSale,
@@ -33,4 +33,3 @@ export async function runHistoryFlow(session) {
33
33
  voucherKind,
34
34
  });
35
35
  }
36
- //# sourceMappingURL=history.flow.js.map