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
package/dist/cli/help.js CHANGED
@@ -1,17 +1,19 @@
1
+ import { Help } from 'commander';
1
2
  import { CERTIFICATE_GUIDE_URL } from '../lib/links.js';
2
- import { getVoucherKindByFamilyAndLetter, getVoucherKindByShortcut, VOUCHER_LETTERS, } from '../modules/billing/voucher-kind-map.js';
3
+ import { getVoucherKindByFamilyAndLetter, getVoucherKindByShortcut, VOUCHER_FAMILIES, VOUCHER_LETTERS, } from '../modules/billing/voucher-kind-map.js';
3
4
  import { CONFIG_LABELS, CONFIG_SECTIONS } from '../modules/config/config.sections.js';
4
- import { buildMinimalFamilyExample, buildMinimalShortcutExample } from '../modules/examples/examples.js';
5
+ import { buildMinimalFamilyExample, buildMinimalShortcutExample, EXPORT_MINIMAL_EXAMPLE, } from '../modules/examples/examples.js';
6
+ import { EXPORT_VOUCHER_KIND } from '../modules/export/export.types.js';
5
7
  import { CONFIG_FIELDS } from '../modules/interactive/config-fields.js';
6
8
  import { renderLogo } from '../ui/index.js';
7
9
  import { CLI_VERSION } from './version.js';
8
10
  const FAMILY_LABELS = {
9
11
  factura: 'Factura',
10
- 'factura-credito-electronica': 'Factura de credito electronica',
11
- 'nota-credito': 'Nota de credito',
12
- 'nota-credito-electronica': 'Nota de credito electronica',
13
- 'nota-debito': 'Nota de debito',
14
- 'nota-debito-electronica': 'Nota de debito electronica',
12
+ 'factura-credito-electronica': 'Factura de crédito electrónica',
13
+ 'nota-credito': 'Nota de crédito',
14
+ 'nota-credito-electronica': 'Nota de crédito electrónica',
15
+ 'nota-debito': 'Nota de débito',
16
+ 'nota-debito-electronica': 'Nota de débito electrónica',
15
17
  };
16
18
  const FAMILY_SHORTCUTS = {
17
19
  factura: ['fa', 'fb', 'fc'],
@@ -21,347 +23,115 @@ const FAMILY_SHORTCUTS = {
21
23
  'nota-debito': ['nda', 'ndb', 'ndc'],
22
24
  'nota-debito-electronica': ['ndea', 'ndeb', 'ndec'],
23
25
  };
24
- const AVAILABLE_GENERAL_OPTIONS = [
25
- ' - --monto <number> | todas | importe total del comprobante',
26
- ' - --punto-venta <number> | --pv <number> | todas | punto de venta emisor',
27
- ' - --fecha <fecha> | todas | fecha del comprobante; si falta usa hoy',
28
- ' - --concepto <tipo> | -c | todas | productos, servicios o productos-servicios',
29
- ' - --cs | --cp | --csp | todas | atajos para concepto',
30
- ' - --moneda <codigo> | --mda <codigo> | todas | codigo de moneda, por ejemplo ARS o USD',
31
- ' - --cotizacion-moneda <number> | --cm <number> | todas | cotizacion de la moneda elegida; obligatoria en moneda extranjera',
32
- ' - --misma-moneda | todas | el pago se cancela en la moneda extranjera; usa la cotizacion oficial de ARCA',
33
- ' - --cargar <path> | todas | cargar un comprobante o lote desde JSON',
34
- ' - --alicuota <tasa> | letras A y B | general (21), reducida (10.5), incrementada (27), cero (0), 5 o 2.5; por defecto config alicuota o 21',
35
- ' - --alicuota <tasa>:<monto> | letras A y B | repetible para varias alicuotas; el monto lleva IVA incluido y --monto pasa a ser opcional',
36
- ' - --exento <number> | letras A y B | parte exenta del monto total',
37
- ' - --nogravado <number> | letras A y B | parte no gravada del monto total',
38
- ].join('\n');
39
- const AVAILABLE_IDENTITY_OPTIONS = [
40
- ' - --cuit <number> | todas | CUIT del receptor',
41
- ' - --cuil <number> | todas | CUIL del receptor',
42
- ' - --dni <number> | todas | DNI del receptor',
43
- ' - --consumidor-final | --cfinal | todas | consumidor final con documento 0',
44
- ' - --iva-receptor <tipo> | --ir <tipo> | todas | condicion IVA del receptor',
45
- ' - --ir-* | todas | atajos para IVA receptor, por ejemplo --ir-cf o --ir-ri',
46
- ].join('\n');
47
- const AVAILABLE_SERVICE_OPTIONS = [
48
- ' - -d, --dia <1-31> | servicios o productos-servicios | dia de vencimiento o referencia de servicio',
49
- ' - --servicio-desde <fecha> | --sd <fecha> | servicios o productos-servicios | inicio del servicio',
50
- ' - --servicio-hasta <fecha> | --sh <fecha> | servicios o productos-servicios | fin del servicio',
51
- ' - --vencimiento <fecha> | --vto <fecha> | servicios, productos-servicios y facturas FCE | vencimiento del pago; por defecto el fin del servicio',
52
- ].join('\n');
53
- const AVAILABLE_ASSOCIATED_OPTIONS = [
54
- ' - --ac <shortcut> | notas | shortcut del comprobante asociado',
55
- ' - --at <number> | notas | tipo ARCA del comprobante asociado',
56
- ' - --asociado-punto-venta <number> | --apv <number> | notas | punto de venta del asociado',
57
- ' - --ar <number> | notas | numero del comprobante asociado',
58
- ' - --acuit <number> | notas | CUIT del comprobante asociado; en NC/ND FCE por defecto el CUIT emisor',
59
- ' - --afecha <fecha> | notas | fecha del comprobante asociado; obligatoria en NC/ND FCE',
60
- ' - --periodo-desde <fecha> | --pd <fecha> | notas comunes | inicio del periodo asociado; alternativa a --ac',
61
- ' - --periodo-hasta <fecha> | --ph <fecha> | notas comunes | fin del periodo asociado',
62
- ].join('\n');
63
- const AVAILABLE_FCE_INVOICE_OPTIONS = [
64
- ' - --cbu <22 digitos> | facturas FCE | CBU del emisor; obligatorio (o config cbu)',
65
- ' - --alias <alias> | facturas FCE | alias del CBU (o config aliasCbu)',
66
- ' - --transferencia <sca|adc> | facturas FCE | modalidad de transferencia; por defecto sca',
67
- ].join('\n');
68
- const AVAILABLE_FCE_NOTE_OPTIONS = [
69
- ' - --anulacion | NC/ND FCE | la nota anula una factura rechazada por el comprador',
70
- ].join('\n');
71
- function resolveFceOptions(isElectronicCredit, isNote) {
72
- if (!isElectronicCredit) {
73
- return ' - No aplica para este comprobante.';
26
+ /** Lo que vale para cualquier comprobante. */
27
+ const CORE_RULES = [
28
+ 'Usá --emitir o --previsualizar, no los dos.',
29
+ 'Una sola identidad del receptor: --cuit, --cuil, --dni o --consumidor-final.',
30
+ 'Un solo IVA receptor: --iva-receptor o un flag --ir-*.',
31
+ 'Un solo concepto: --concepto o uno entre --cs, --cp y --csp.',
32
+ 'Con servicios: --servicio-desde y --servicio-hasta, o --dia para el día de vencimiento.',
33
+ 'Sin --fecha usa hoy. Lo que no pasás por flag sale del JSON de --cargar o de la config.',
34
+ ];
35
+ /** Las reglas que dependen del comprobante; la lista de opciones ya muestra solo las que aplican. */
36
+ function createRules(scope) {
37
+ const rules = [...CORE_RULES];
38
+ if (scope.letters.some((letter) => letter !== 'c')) {
39
+ rules.push('IVA (A y B): --alicuota usa 21 por defecto, o la clave alícuota de la config. Para varias, repetí --alicuota TASA:MONTO con el IVA incluido; --monto pasa a ser opcional.');
40
+ }
41
+ if (scope.isNote) {
42
+ rules.push(scope.isElectronicCredit
43
+ ? 'Asociado: la factura FCE con --ac o --at, --apv, --ar y --afecha; --acuit toma tu CUIT. Con --anulacion, anula una factura que rechazó el comprador.'
44
+ : 'Asociado: el comprobante con --ac o --at, --apv, --ar y --acuit, o un período con --periodo-desde y --periodo-hasta.');
74
45
  }
75
- return isNote ? AVAILABLE_FCE_NOTE_OPTIONS : AVAILABLE_FCE_INVOICE_OPTIONS;
46
+ else if (scope.isElectronicCredit) {
47
+ rules.push('FCE: necesita CBU (--cbu o la clave cbu de la config); --transferencia es sca por defecto.');
48
+ }
49
+ return section('Reglas', compactList(rules));
76
50
  }
77
- const AVAILABLE_EXECUTION_OPTIONS = [
78
- ' - --previsualizar | todas | muestra el payload antes de hablar con ARCA',
79
- ' - --emitir | todas | emite realmente el comprobante',
80
- ' - --testing | todas | fuerza entorno testing en esta corrida',
81
- ' - --produccion | todas | fuerza entorno produccion en esta corrida',
82
- ' - --json | todas | salida estructurada para scripts',
83
- ' - --bruto | todas | agrega respuesta cruda de ARCA cuando exista',
84
- ].join('\n');
85
- const CORE_RULES = [
86
- ' - ARCLI arma datos desde flags, JSON cargado, config y defaults internos.',
87
- ' - Si no pasa fecha, usa hoy.',
88
- ' - Use --emitir o --previsualizar, pero no ambos.',
89
- ' - Use una sola identidad de receptor: --consumidor-final o --cfinal, o bien --cuit, --cuil o --dni.',
90
- ' - Use --iva-receptor, --ir o un solo flag --ir-*, pero no varios a la vez.',
91
- ' - Use --concepto o un solo flag entre --cs, --cp y --csp, pero no ambos.',
92
- ].join('\n');
93
51
  function section(title, body) {
94
52
  return [title, body].join('\n');
95
53
  }
96
54
  function compactList(values) {
97
55
  return values.map((value) => ` - ${value}`).join('\n');
98
56
  }
99
- function formatFamilyShortcuts(family) {
100
- const [a, b, c] = FAMILY_SHORTCUTS[family];
101
- return compactList([`A -> ${a}`, `B -> ${b}`, `C -> ${c}`]);
102
- }
103
- function createProgramQuickStart() {
104
- return [
105
- 'Uso minimo',
106
- ' - TL;DR: arcli fc -m 300000 --cs --consumidor-final --ir-cf',
107
- ' - Ese ejemplo asume que ya resolviste CUIT emisor, credenciales y punto de venta.',
108
- ' - Si todavía no lo hiciste, empezá por: arcli config revisar',
109
- ' - Emitir de verdad: arcli fa -m 1 --cs --cuit 20168598204 --ir-ri --emitir --bruto',
110
- ].join('\n');
111
- }
112
- function createProgramMentalModel() {
113
- return [
114
- 'Como pensar rapido un comando',
115
- ' - 1. Elegí el comprobante: fc, fa, nca, ndeb, fcec.',
116
- ' - 2. Definí el monto: --monto.',
117
- ' - 3. Elegí el concepto: --cs, --cp, --csp o --concepto.',
118
- ' - 4. Definí la identidad: --cuit, --cuil, --dni o --consumidor-final.',
119
- ' - 5. Definí el IVA receptor: --ir-*, --ir o --iva-receptor.',
120
- ].join('\n');
121
- }
122
- function createProgramFamilies() {
123
- return section('Familias y shortcuts', [
124
- ' - factura -> fa, fb, fc',
125
- ' - nota-credito -> nca, ncb, ncc',
126
- ' - nota-debito -> nda, ndb, ndc',
127
- ' - factura-credito-electronica -> fcea, fceb, fcec',
128
- ' - nota-credito-electronica -> ncea, nceb, ncec',
129
- ' - nota-debito-electronica -> ndea, ndeb, ndec',
130
- ].join('\n'));
131
- }
132
- function createProgramCommands() {
133
- return section('Comandos importantes', [
134
- ' - Emitir comprobantes por shortcut: arcli fc ...',
135
- ' - Emitir por familia y letra: arcli factura c ...',
136
- ' - Ver y guardar config: arcli config',
137
- ' - Revisar entorno y credenciales: arcli config revisar',
138
- ' - Ver ejemplos listos para copiar: arcli ejemplos',
139
- ' - Consultar si un receptor esta obligado a FCE: arcli fce-obligado <cuit>',
140
- ' - Ver nombre, domicilio y condicion IVA de un CUIT: arcli padron <cuit>',
141
- ' - Asistente paso a paso: arcli (sin argumentos) o arcli interactivo',
142
- ' - Ver los ultimos comprobantes emitidos: arcli ultimos fb',
143
- ' - Ver el detalle de un comprobante: arcli consultar fb 14',
144
- ' - Ver si ARCA responde y el punto de venta esta habilitado: arcli estado',
145
- ' - Ver tablas de ARCA (puntos de venta, alicuotas, cotizacion): arcli parametros',
146
- ' - Generar el PDF al emitir: arcli fc ... --emitir --exportar-pdf (plugin: arcli pdf instalar)',
147
- ' - Ver escenas de UI: arcli storybook',
148
- ].join('\n'));
149
- }
150
- function createProgramExamples() {
151
- return section('Ejemplos utiles', [
152
- ' - Basico: arcli fc -m 300000 --cs --consumidor-final --ir-cf',
153
- ' - Con CUIT: arcli fa -m 1 --cs --cuit 20168598204 --ir-ri',
154
- ' - Nota: arcli nca -m 1 --cs --cuit 20168598204 --ir-ri --ac fa --apv 3 --ar 6 --acuit 20409509763',
155
- ].join('\n'));
156
- }
157
- function createProgramSafety() {
158
- return section('Ejecucion y seguridad', [
159
- ' - --previsualizar muestra la solicitud antes de emitir.',
160
- ' - --emitir habla de verdad con ARCA.',
161
- ' - --produccion cambia al entorno real.',
162
- ' - Sin --emitir, en una terminal pregunta antes de emitir (salvo emitir=true en la config).',
163
- ' - Para scripts o pipelines, usá --json y evitá automatizar sobre salida humana.',
164
- ].join('\n'));
165
- }
166
- function createProgramProject() {
167
- return section('Proyecto y actualizaciones', [
168
- ' - Repositorio: https://github.com/LcsGrz/arcli',
169
- ' - Actualizar a la ultima version: npm install -g arcli@latest',
170
- ' - Ver la version instalada: arcli --version',
57
+ /** La letra E (exportacion, WSFEX) solo existe en la familia `factura`. */
58
+ function familyShortcuts(family) {
59
+ return family === EXPORT_VOUCHER_KIND.family
60
+ ? [...FAMILY_SHORTCUTS[family], EXPORT_VOUCHER_KIND.shortcut]
61
+ : FAMILY_SHORTCUTS[family];
62
+ }
63
+ /** Los atajos en una tabla familia × letra, en lugar de un renglon por atajo en la lista de comandos. */
64
+ function createProgramVoucherTable() {
65
+ const width = Math.max(...VOUCHER_FAMILIES.map((family) => family.length)) + 2;
66
+ const column = (value) => value.padEnd(7);
67
+ const rows = VOUCHER_FAMILIES.map((family) => ` ${family.padEnd(width)}${familyShortcuts(family).map(column).join('').trimEnd()}`);
68
+ return section('Comprobantes (atajo por familia y letra)', [
69
+ ` ${''.padEnd(width)}${['A', 'B', 'C', 'E'].map(column).join('').trimEnd()}`,
70
+ ...rows,
71
+ ' arcli fc ... es lo mismo que arcli factura c ...; cada uno tiene su ayuda: arcli fc --ayuda',
171
72
  ].join('\n'));
172
73
  }
173
- function createProgramDiscovery() {
174
- return section('Descubrimiento', [
175
- ' - Ayuda general: arcli ayuda',
176
- ' - Ayuda de un shortcut: arcli fc ayuda',
177
- ' - Ayuda de una familia: arcli factura ayuda',
178
- ' - Ayuda de config: arcli config ayuda',
179
- ' - Ayuda de ejemplos: arcli ejemplos ayuda',
180
- ' - Ayuda de storybook: arcli storybook ayuda',
181
- ].join('\n'));
182
- }
183
- function createProgramFrequentErrors() {
184
- return section('Errores frecuentes', [
185
- ' - Identidad duplicada: no uses --cuit y --consumidor-final juntos.',
186
- ' - Falta IVA receptor: elegí --ir-* o --iva-receptor.',
187
- ' - Flags incompatibles: no mezcles --emitir y --previsualizar.',
188
- ' - JSON invalido o incompleto: revisá el archivo pasado a --cargar.',
189
- ].join('\n'));
190
- }
191
- function createVoucherSummary(shortcut) {
192
- const definition = getVoucherKindByShortcut(shortcut);
193
- if (!definition) {
194
- return '';
195
- }
196
- const whenToUse = definition.requiresAssociatedVoucher
197
- ? 'Use este shortcut cuando ya sabe el comprobante exacto y necesita informar un asociado compatible.'
198
- : 'Use este shortcut cuando ya sabe exactamente que comprobante quiere emitir y quiere escribir menos.';
199
- return section('Resumen', [
200
- ` - Comprobante: ${definition.displayName}`,
201
- ` - Shortcut: arcli ${shortcut}`,
202
- ` - Comando largo: arcli ${definition.family} ${definition.letter}`,
203
- ` - Tipo ARCA: ${definition.arcaType}`,
204
- ` - Cuando usarlo: ${whenToUse}`,
205
- ].join('\n'));
206
- }
207
- function createShortcutMinimum(shortcut) {
208
- const definition = getVoucherKindByShortcut(shortcut);
209
- if (!definition) {
210
- return '';
211
- }
212
- const example = ` - Ejemplo minimo: ${buildMinimalShortcutExample(definition)}`;
213
- return section('Para empezar', [
214
- example,
215
- definition.requiresAssociatedVoucher
216
- ? ' - Ademas de la estructura base, este comprobante siempre necesita asociado.'
217
- : ' - Con eso ya tenés una base funcional para previsualizar o emitir.',
218
- ].join('\n'));
219
- }
220
- function createShortcutExamples(shortcut) {
74
+ function createProgramQuickStart() {
75
+ return section('Para empezar', compactList([
76
+ 'Revisá que esté todo listo: arcli config revisar',
77
+ 'Vista previa: arcli fc -m 300000 --cs --consumidor-final --ir-cf',
78
+ 'Emitir: agregá --emitir (sin el flag, en una terminal te pregunta). --produccion usa el entorno real.',
79
+ 'Paso a paso, sin flags: arcli (sin argumentos)',
80
+ 'Un comando se arma con el comprobante, --monto, el concepto (--cs, --cp, --csp), el receptor (--cuit, --dni o --consumidor-final) y su IVA (--ir-*).',
81
+ ]));
82
+ }
83
+ function createProgramMore() {
84
+ return section('Más ayuda', compactList([
85
+ 'Ejemplos listos para copiar: arcli ejemplos',
86
+ 'Autocompletado con Tab de comandos y flags: arcli completado instalar',
87
+ 'Para scripts, usá --json: la salida en texto puede cambiar.',
88
+ 'Repositorio: https://github.com/LcsGrz/arcli · Actualizar: npm install -g arcli@latest',
89
+ ]));
90
+ }
91
+ function createShortcutSummary(shortcut) {
221
92
  const definition = getVoucherKindByShortcut(shortcut);
222
93
  if (!definition) {
223
94
  return '';
224
95
  }
225
96
  const minimal = buildMinimalShortcutExample(definition);
226
- const examples = [
227
- ` - Previsualizar: ${minimal} --previsualizar`,
228
- ` - Emitir: ${minimal} --emitir --bruto`,
229
- ` - JSON: arcli ${shortcut} --cargar ./voucher.json --json`,
230
- ];
231
- return section('Ejemplos', examples.join('\n'));
232
- }
233
- function createShortcutImportantFlags(shortcut) {
234
- const definition = getVoucherKindByShortcut(shortcut);
235
- if (!definition) {
236
- return '';
237
- }
238
- return section('Flags importantes', [
239
- ' - Estructura base: --monto, --concepto/--cs/--cp/--csp, identidad y IVA receptor.',
240
- ' - Datos comunes: --pv, --fecha, --moneda, --cm, --cargar.',
241
- ' - Servicio: --dia, --sd y --sh cuando el concepto usa servicios.',
242
- definition.requiresAssociatedVoucher
243
- ? definition.isElectronicCredit
244
- ? ' - Asociado: --ac o --at, mas --apv, --ar y --afecha.'
245
- : ' - Asociado: --ac o --at, mas --apv, --ar y --acuit; o un periodo con --pd y --ph.'
246
- : ' - Asociado: no aplica para este comprobante.',
247
- ...(definition.isElectronicCredit
248
- ? [
249
- definition.requiresAssociatedVoucher
250
- ? ' - FCE: --afecha obligatoria y --anulacion si anula una factura rechazada.'
251
- : ' - FCE: --cbu obligatorio (o config cbu), --alias y --transferencia sca|adc.',
252
- ]
253
- : []),
254
- ' - Salida y ejecucion: --previsualizar, --emitir, --json, --bruto, --testing, --produccion.',
255
- ].join('\n'));
256
- }
257
- function createShortcutAvailableFlags(shortcut) {
258
- const definition = getVoucherKindByShortcut(shortcut);
259
- if (!definition) {
260
- return '';
261
- }
262
- return section('Mas parametros disponibles', [
263
- 'Generales',
264
- AVAILABLE_GENERAL_OPTIONS,
265
- '',
266
- 'Receptor e IVA',
267
- AVAILABLE_IDENTITY_OPTIONS,
268
- '',
269
- 'Servicio',
270
- AVAILABLE_SERVICE_OPTIONS,
271
- '',
272
- 'Comprobante asociado',
273
- definition.requiresAssociatedVoucher ? AVAILABLE_ASSOCIATED_OPTIONS : ' - No aplica para este comprobante.',
274
- '',
275
- 'Credito electronico (FCE)',
276
- resolveFceOptions(definition.isElectronicCredit, definition.requiresAssociatedVoucher),
277
- '',
278
- 'Ejecucion y salida',
279
- AVAILABLE_EXECUTION_OPTIONS,
280
- ].join('\n'));
281
- }
282
- function createShortcutFrequentErrors(shortcut) {
283
- const definition = getVoucherKindByShortcut(shortcut);
284
- if (!definition) {
285
- return '';
286
- }
287
- const lines = [
288
- ' - No mezcle identidades del receptor.',
289
- ' - No mezcle --emitir y --previsualizar.',
290
- ' - Si usa --cargar, revise que el JSON tenga claves validas.',
291
- ];
292
- if (definition.requiresAssociatedVoucher) {
293
- lines.push(' - Este comprobante exige asociado; complete --ac, --apv, --ar y --acuit cuando corresponda.');
294
- }
295
- return section('Errores frecuentes', lines.join('\n'));
97
+ return [
98
+ section('Comprobante', compactList([
99
+ `${definition.displayName}, tipo ARCA ${definition.arcaType}. Es lo mismo que arcli ${definition.family} ${definition.letter}.`,
100
+ ])),
101
+ '',
102
+ section('Ejemplos', compactList([
103
+ `Vista previa: ${minimal}`,
104
+ `Emitir: ${minimal} --emitir`,
105
+ `Desde un JSON: arcli ${shortcut} --cargar ./voucher.json --json`,
106
+ 'Más ejemplos: arcli ejemplos',
107
+ ])),
108
+ ].join('\n');
296
109
  }
297
110
  function createFamilySummary(family) {
298
- return section('Resumen', [
299
- ` - Familia: ${FAMILY_LABELS[family]}`,
300
- ` - Uso: arcli ${family} <a|b|c>`,
301
- ' - Letras validas: a, b, c',
302
- ' - Use la familia cuando quiera cambiar solo la letra sin aprender todos los shortcuts.',
303
- ' - Si ya sabés el comprobante exacto, el shortcut suele ser mas rapido.',
304
- ].join('\n'));
305
- }
306
- function createFamilyExamples(family) {
307
- return section('Ejemplos por letra', [
308
- ...VOUCHER_LETTERS.map((letter) => {
309
- const definition = getVoucherKindByFamilyAndLetter(family, letter);
310
- return definition ? ` - Letra ${letter.toUpperCase()}: ${buildMinimalFamilyExample(definition)}` : '';
311
- }),
312
- ` - Con JSON: arcli ${family} c --cargar ./voucher.json --json`,
313
- ].join('\n'));
314
- }
315
- function createFamilySharedFlags(family) {
111
+ const [a, b, c] = FAMILY_SHORTCUTS[family];
112
+ const hasExport = family === EXPORT_VOUCHER_KIND.family;
113
+ const summary = hasExport
114
+ ? `${FAMILY_LABELS[family]}, letras A, B, C y E (exportación): arcli ${family} <a|b|c|e>. Atajos: ${a}, ${b}, ${c} y ${EXPORT_VOUCHER_KIND.shortcut}. Los flags que no aplican a la letra se saltean con un aviso.`
115
+ : `${FAMILY_LABELS[family]}, letras A, B y C: arcli ${family} <a|b|c>. Atajos: ${a}, ${b} y ${c}.`;
316
116
  return [
317
- section('Shortcuts relacionados', formatFamilyShortcuts(family)),
318
- '',
319
- section('Flags importantes', [
320
- ' - Base comun: --monto, --concepto/--cs/--cp/--csp, identidad e IVA receptor.',
321
- ' - Datos comunes: --pv, --fecha, --moneda, --cm, --cargar.',
322
- ' - Servicio: --dia, --sd y --sh cuando el concepto usa servicios.',
323
- family.includes('nota')
324
- ? ' - Asociado: esta familia lo exige; usá --ac o --at, mas --apv, --ar y --acuit.'
325
- : ' - Asociado: no aplica para esta familia.',
326
- ' - Ejecucion y salida: --previsualizar, --emitir, --json, --bruto, --testing, --produccion.',
327
- ].join('\n')),
328
- '',
329
- section('Mas parametros disponibles', [
330
- 'Generales',
331
- AVAILABLE_GENERAL_OPTIONS,
332
- '',
333
- 'Receptor e IVA',
334
- AVAILABLE_IDENTITY_OPTIONS,
335
- '',
336
- 'Servicio',
337
- AVAILABLE_SERVICE_OPTIONS,
338
- '',
339
- 'Comprobante asociado',
340
- family.includes('nota') ? AVAILABLE_ASSOCIATED_OPTIONS : ' - No aplica para esta familia.',
341
- '',
342
- 'Credito electronico (FCE)',
343
- resolveFceOptions(family.includes('electronica'), family.includes('nota')),
344
- '',
345
- 'Ejecucion y salida',
346
- AVAILABLE_EXECUTION_OPTIONS,
347
- ].join('\n')),
117
+ section('Familia', compactList([summary])),
118
+ '',
119
+ section('Ejemplos', compactList([
120
+ ...VOUCHER_LETTERS.flatMap((letter) => {
121
+ const definition = getVoucherKindByFamilyAndLetter(family, letter);
122
+ return definition ? [`Letra ${letter.toUpperCase()}: ${buildMinimalFamilyExample(definition)}`] : [];
123
+ }),
124
+ ...(hasExport
125
+ ? [`Letra E: ${EXPORT_MINIMAL_EXAMPLE.replace('arcli fe -m', `arcli ${family} e --monto`)}`]
126
+ : []),
127
+ `Desde un JSON: arcli ${family} c --cargar ./voucher.json --json`,
128
+ ])),
348
129
  ].join('\n');
349
130
  }
350
- function createFamilyFrequentErrors(family) {
351
- const lines = [
352
- ' - La letra debe ser a, b o c.',
353
- ' - No mezcle identidades o conceptos incompatibles.',
354
- ' - Si carga JSON, la letra del comando y el contenido deben representar el mismo comprobante.',
355
- ];
356
- if (family.includes('nota')) {
357
- lines.push(' - Las notas requieren un asociado compatible; sin eso ARCLI no puede armar el payload final.');
358
- }
359
- return section('Errores frecuentes', lines.join('\n'));
360
- }
361
131
  const BOOLEAN_CONFIG_VALUES = 'true/false, si/no o 1/0';
362
132
  /** Valores de las claves que el asistente no edita o que, siendo booleanas, aceptan mas formas que si/no. */
363
133
  const CONFIG_VALUE_OVERRIDES = {
364
- alicuota: 'general, reducida, incrementada, cero o el numero: 0, 2.5, 5, 10.5, 21, 27; por defecto 21',
134
+ alicuota: 'general, reducida, incrementada, cero o el número: 0, 2.5, 5, 10.5, 21, 27; por defecto 21',
365
135
  bruto: BOOLEAN_CONFIG_VALUES,
366
136
  consultarPadron: `${BOOLEAN_CONFIG_VALUES}; por defecto si`,
367
137
  emitir: BOOLEAN_CONFIG_VALUES,
@@ -402,16 +172,16 @@ export function createConfigHelp() {
402
172
  section('Para que sirve', [
403
173
  ' - Guardar defaults del CLI para no repetir flags en cada corrida.',
404
174
  ' - Definir rutas de certificados y claves por entorno.',
405
- ' - Revisar si el entorno esta listo antes de emitir.',
175
+ ' - Revisar si el entorno está listo antes de emitir.',
406
176
  ].join('\n')),
407
177
  '',
408
178
  section('Casos comunes', [
409
179
  ' - Guardar defaults para no repetir flags como puntoVenta, concepto o IVA receptor.',
410
- ' - Revisar si testing o produccion tienen credenciales y contexto validos.',
180
+ ' - Revisar si testing o producción tienen credenciales y contexto válidos.',
411
181
  ' - Debuggear por que un comando pide datos que pensabas tener guardados.',
412
182
  ].join('\n')),
413
183
  '',
414
- section('Comandos mas usados', [
184
+ section('Comandos más usados', [
415
185
  ' - Ver config actual: arcli config',
416
186
  ' - Revisar entorno: arcli config revisar',
417
187
  ' - Ver ruta del archivo: arcli config ruta',
@@ -422,7 +192,7 @@ export function createConfigHelp() {
422
192
  createConfigKeysSection(),
423
193
  '',
424
194
  section('Ejemplos', [
425
- ' - arcli config establecer cuit 20409509763',
195
+ ' - arcli config establecer cuit 20333333334',
426
196
  ' - arcli config establecer entorno produccion',
427
197
  ' - arcli config establecer ivaReceptor consumidor-final',
428
198
  ' - arcli config establecer key.produccion /ruta/clave.key',
@@ -431,12 +201,12 @@ export function createConfigHelp() {
431
201
  ].join('\n')),
432
202
  '',
433
203
  section('Errores frecuentes', [
434
- ' - Faltan cert.testing o key.testing: corra arcli config revisar.',
435
- ' - Punto de venta no configurado: guarde puntoVenta o paselo por flag.',
436
- ' - Emitir por defecto activado sin querer: revise el valor de emitir.',
204
+ ' - Faltan cert.testing o key.testing: corré arcli config revisar.',
205
+ ' - Punto de venta no configurado: guardá puntoVenta o pasalo por flag.',
206
+ ' - Emitir por defecto activado sin querer: revisá el valor de emitir.',
437
207
  ].join('\n')),
438
208
  '',
439
- section('No tenes certificado todavia?', [' - Guia paso a paso (testing y produccion), con capturas de ARCA:', ` ${CERTIFICATE_GUIDE_URL}`].join('\n')),
209
+ section('No tenés certificado todavía?', [' - Guía paso a paso (testing y producción), con capturas de ARCA:', ` ${CERTIFICATE_GUIDE_URL}`].join('\n')),
440
210
  '',
441
211
  ].join('\n');
442
212
  }
@@ -467,19 +237,19 @@ export function createExamplesHelp() {
467
237
  section('Para que sirve', [
468
238
  ' - Mostrar ejemplos seguros y listos para copiar de todos los comprobantes soportados.',
469
239
  ' - Comparar la forma larga y la forma corta del mismo comando.',
470
- ' - Ver rapido que cambia entre una variante minima y una full.',
240
+ ' - Ver rápido que cambia entre una variante mínima y una full.',
471
241
  ].join('\n')),
472
242
  '',
473
243
  section('Como leer la salida', [
474
- ' - Minima: datos esenciales del comprobante.',
475
- ' - Full: mas campos explicitados para el mismo flujo.',
244
+ ' - Mínima: datos esenciales del comprobante.',
245
+ ' - Full: más campos explicitados para el mismo flujo.',
476
246
  ' - Larga: comando largo y flags descriptivos.',
477
247
  ' - Corta: shortcut y aliases practicos.',
478
248
  ].join('\n')),
479
249
  '',
480
250
  section('Seguridad', [
481
251
  ' - Todos los ejemplos usan --previsualizar para evitar emisiones reales por error.',
482
- ' - Si queres emitir, reemplaza --previsualizar por --emitir.',
252
+ ' - Si querés emitir, reemplaza --previsualizar por --emitir.',
483
253
  ].join('\n')),
484
254
  '',
485
255
  ].join('\n');
@@ -488,8 +258,8 @@ export function createFceObligationHelp() {
488
258
  return [
489
259
  '',
490
260
  section('Para que sirve', [
491
- ' - Saber si a un receptor le corresponde factura comun o Factura de Credito Electronica (FCE).',
492
- ' - ARCA informa si esta obligado a recibir FCE y desde que monto.',
261
+ ' - Saber si a un receptor le corresponde factura comun o Factura de Crédito Electrónica (FCE).',
262
+ ' - ARCA informa si está obligado a recibir FCE y desde que monto.',
493
263
  ].join('\n')),
494
264
  '',
495
265
  section('Ejemplos', [' - arcli fce-obligado 30546689979', ' - arcli fce-obligado 30546689979 --fecha 15/10 --json'].join('\n')),
@@ -505,7 +275,7 @@ export function createPadronHelp() {
505
275
  return [
506
276
  '',
507
277
  section('Para que sirve', [
508
- ' - Ver razon social, domicilio fiscal, condicion IVA, impuestos y actividad de un CUIT.',
278
+ ' - Ver razón social, domicilio fiscal, condición IVA, impuestos y actividad de un CUIT.',
509
279
  ' - Al facturar con --cuit, arcli usa el mismo dato para completar el IVA receptor si no pasa --ir.',
510
280
  ].join('\n')),
511
281
  '',
@@ -518,6 +288,24 @@ export function createPadronHelp() {
518
288
  '',
519
289
  ].join('\n');
520
290
  }
291
+ export function createCompletionHelp() {
292
+ return [
293
+ '',
294
+ section('Para que sirve', compactList([
295
+ 'Completar con Tab comandos, flags y valores: arcli f<Tab>, arcli fc --ir<Tab>, arcli config establecer <Tab>.',
296
+ 'La lista sale de la versión instalada: después de actualizar arcli no hay que reinstalar nada.',
297
+ ])),
298
+ '',
299
+ section('Uso', compactList([
300
+ 'Instalar: arcli completado instalar (usa el shell de $SHELL; o arcli completado instalar zsh)',
301
+ 'Ver si está instalado: arcli completado',
302
+ 'Desinstalar: arcli completado desinstalar',
303
+ 'Ver el script sin instalarlo: arcli completado zsh',
304
+ 'Después de instalar, abrí una terminal nueva.',
305
+ ])),
306
+ '',
307
+ ].join('\n');
308
+ }
521
309
  export function createVoucherQueryHelp() {
522
310
  return [
523
311
  '',
@@ -537,63 +325,82 @@ export function createVoucherQueryHelp() {
537
325
  ].join('\n');
538
326
  }
539
327
  export function createShortcutHelp(shortcut) {
328
+ const definition = getVoucherKindByShortcut(shortcut);
329
+ if (!definition) {
330
+ return '';
331
+ }
540
332
  return [
541
333
  '',
542
- createVoucherSummary(shortcut),
543
- '',
544
- createShortcutMinimum(shortcut),
545
- '',
546
- createShortcutImportantFlags(shortcut),
547
- '',
548
- createShortcutExamples(shortcut),
549
- '',
550
- createShortcutAvailableFlags(shortcut),
551
- '',
552
- section('Reglas clave', CORE_RULES),
334
+ createShortcutSummary(shortcut),
553
335
  '',
554
- createShortcutFrequentErrors(shortcut),
336
+ createRules({
337
+ isElectronicCredit: definition.isElectronicCredit,
338
+ isNote: definition.requiresAssociatedVoucher,
339
+ letters: [definition.letter],
340
+ }),
555
341
  '',
556
342
  ].join('\n');
557
343
  }
558
- export function createFamilyHelp(family) {
344
+ /** Ayuda de `arcli fe`: la E no tiene concepto, IVA ni receptor argentino, asi que no usa las reglas de A, B y C. */
345
+ export function createExportShortcutHelp() {
346
+ const { arcaType, displayName, family, letter, shortcut } = EXPORT_VOUCHER_KIND;
559
347
  return [
560
348
  '',
561
- createFamilySummary(family),
562
- '',
563
- createFamilyExamples(family),
564
- '',
565
- createFamilySharedFlags(family),
566
- '',
567
- section('Reglas clave', CORE_RULES),
568
- '',
569
- createFamilyFrequentErrors(family),
349
+ section('Comprobante', compactList([
350
+ `${displayName}, tipo ARCA ${arcaType}, por WSFEX. Es lo mismo que arcli ${family} ${letter}.`,
351
+ 'Sin flags sale de servicios (--tipo-expo 2), en dólares (DOL) y con forma de pago "Transferencia Internacional".',
352
+ 'La actividad sale de --actividad o de exportacion.actividad en la config.',
353
+ '--numero es obligatorio: arcli todavía no puede consultar en WSFEX el último comprobante emitido.',
354
+ ])),
355
+ '',
356
+ section('Ejemplos', compactList([
357
+ `Vista previa: ${EXPORT_MINIMAL_EXAMPLE}`,
358
+ `Emitir: ${EXPORT_MINIMAL_EXAMPLE} --emitir`,
359
+ `Con items, que tienen que sumar --monto: ${EXPORT_MINIMAL_EXAMPLE} --item "001|Consultoría|10|150|unidades"`,
360
+ `Desde un JSON: arcli ${shortcut} --cargar ./factura-e.json --json`,
361
+ 'Más ejemplos: arcli ejemplos',
362
+ ])),
570
363
  '',
571
364
  ].join('\n');
572
365
  }
573
- export function createProgramHelp() {
366
+ export function createFamilyHelp(family) {
574
367
  return [
575
368
  '',
576
- createProgramQuickStart(),
577
- '',
578
- createProgramMentalModel(),
579
- '',
580
- createProgramFamilies(),
581
- '',
582
- createProgramCommands(),
583
- '',
584
- createProgramExamples(),
585
- '',
586
- createProgramSafety(),
587
- '',
588
- createProgramDiscovery(),
589
- '',
590
- createProgramFrequentErrors(),
369
+ createFamilySummary(family),
591
370
  '',
592
- createProgramProject(),
371
+ createRules({
372
+ isElectronicCredit: family.includes('electronica'),
373
+ isNote: family.includes('nota'),
374
+ letters: VOUCHER_LETTERS,
375
+ }),
593
376
  '',
594
377
  ].join('\n');
595
378
  }
379
+ export function createProgramHelp() {
380
+ return ['', createProgramVoucherTable(), '', createProgramQuickStart(), '', createProgramMore(), ''].join('\n');
381
+ }
382
+ /** Lo que commander escribe en ingles en la ayuda. */
383
+ const HELP_TITLES = {
384
+ 'Arguments:': 'Argumentos:',
385
+ 'Commands:': 'Comandos:',
386
+ 'Global Options:': 'Opciones globales:',
387
+ 'Options:': 'Opciones:',
388
+ 'Usage:': 'Uso:',
389
+ };
390
+ const HELP_TERMS = [
391
+ [/\[options\]/g, '[opciones]'],
392
+ [/\[command\]/g, '[comando]'],
393
+ ];
394
+ function translateHelpTerms(text) {
395
+ return HELP_TERMS.reduce((result, [pattern, replacement]) => result.replace(pattern, replacement), text);
396
+ }
397
+ const defaultHelp = new Help();
596
398
  export function configureSpanishHelp(command) {
399
+ command.configureHelp({
400
+ commandUsage: (cmd) => translateHelpTerms(defaultHelp.commandUsage(cmd)),
401
+ styleTitle: (title) => HELP_TITLES[title] ?? title,
402
+ subcommandTerm: (cmd) => translateHelpTerms(defaultHelp.subcommandTerm(cmd)),
403
+ });
597
404
  command.helpCommand(false);
598
405
  command.helpOption('--ayuda', 'mostrar ayuda');
599
406
  command.showHelpAfterError('(usa "ayuda" para ver ejemplos y opciones)');
@@ -601,4 +408,3 @@ export function configureSpanishHelp(command) {
601
408
  export function createProgramHeader() {
602
409
  return renderLogo(CLI_VERSION);
603
410
  }
604
- //# sourceMappingURL=help.js.map