arcli 2.0.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.
- package/CHANGELOG.md +106 -1
- package/README.md +21 -14
- package/dist/cli/arca-runtime.js +41 -0
- package/dist/cli/commands/billing-family.command.js +36 -9
- package/dist/cli/commands/billing-shortcuts.command.js +8 -2
- package/dist/cli/commands/billing.command.batch.js +28 -12
- package/dist/cli/commands/billing.command.interactive-preview.js +12 -13
- package/dist/cli/commands/billing.command.options.js +83 -39
- package/dist/cli/commands/billing.command.output.js +3 -3
- package/dist/cli/commands/billing.command.parser.js +44 -30
- package/dist/cli/commands/billing.command.pdf.js +9 -6
- package/dist/cli/commands/billing.command.shared.js +86 -49
- package/dist/cli/commands/billing.command.shortcuts.js +3 -4
- package/dist/cli/commands/completion.command.js +140 -0
- package/dist/cli/commands/config.command.js +44 -45
- package/dist/cli/commands/cuit-argument.js +10 -0
- package/dist/cli/commands/examples.command.js +0 -1
- package/dist/cli/commands/export-shortcut.command.js +19 -0
- package/dist/cli/commands/export.command.js +106 -0
- package/dist/cli/commands/export.command.options.js +140 -0
- package/dist/cli/commands/export.command.parser.js +84 -0
- package/dist/cli/commands/export.command.pdf.js +61 -0
- package/dist/cli/commands/fce-obligation.command.js +8 -16
- package/dist/cli/commands/interactive.command.js +9 -8
- package/dist/cli/commands/padron.command.js +46 -0
- package/dist/cli/commands/parameters.command.js +13 -13
- package/dist/cli/commands/pdf.command.js +17 -31
- package/dist/cli/commands/storybook.command.js +4 -4
- package/dist/cli/commands/vouchers.command.js +14 -14
- package/dist/cli/error-output.js +89 -11
- package/dist/cli/global-options.js +55 -0
- package/dist/cli/help-argv.js +0 -1
- package/dist/cli/help.js +243 -391
- package/dist/cli/ignored-global-options.js +32 -0
- package/dist/cli/index.js +12 -14
- package/dist/cli/interactive/advanced-options.js +13 -14
- package/dist/cli/interactive/config.flow.js +59 -20
- package/dist/cli/interactive/export.flow.js +263 -0
- package/dist/cli/interactive/history.flow.js +2 -3
- package/dist/cli/interactive/interactive-mode.js +63 -33
- package/dist/cli/interactive/invoice-picker.js +7 -7
- package/dist/cli/interactive/invoice.flow.js +35 -13
- package/dist/cli/interactive/note.flow.js +16 -16
- package/dist/cli/interactive/pdf.flow.js +9 -7
- package/dist/cli/interactive/prompts.js +0 -1
- package/dist/cli/interactive/receiver-padron.js +52 -0
- package/dist/cli/interactive/repeat.flow.js +10 -11
- package/dist/cli/interactive/session.js +13 -8
- package/dist/cli/interactive/status.flow.js +0 -1
- package/dist/cli/interactive/update.flow.js +0 -1
- package/dist/cli/interactive/validators.js +7 -6
- package/dist/cli/option-parsers.js +14 -4
- package/dist/cli/program.js +14 -5
- package/dist/cli/skipped-options.js +14 -0
- package/dist/cli/spinner.js +0 -1
- package/dist/cli/types.js +0 -1
- package/dist/cli/version.js +1 -2
- package/dist/index.js +0 -1
- package/dist/lib/dates/arca-date.js +3 -4
- package/dist/lib/errors/app-error.js +2 -2
- package/dist/lib/files/read-json-file.js +2 -3
- package/dist/lib/files/restrict-to-owner.js +0 -1
- package/dist/lib/files/write-new-file.js +29 -0
- package/dist/lib/identity/cuit.js +26 -0
- package/dist/lib/identity/format-cuit.js +1 -2
- package/dist/lib/links.js +2 -1
- package/dist/lib/numbers/argentine-amount.js +3 -4
- package/dist/lib/numbers/strict-integer.js +0 -1
- package/dist/lib/paths/mask-path.js +0 -1
- package/dist/lib/security/certificate.js +10 -8
- package/dist/lib/security/pem.js +2 -3
- package/dist/modules/billing/billing-response.js +16 -5
- package/dist/modules/billing/billing.amounts.js +3 -4
- package/dist/modules/billing/billing.associated-period.js +7 -8
- package/dist/modules/billing/billing.associated-vouchers.js +5 -6
- package/dist/modules/billing/billing.batch.js +12 -5
- package/dist/modules/billing/billing.constants.js +0 -1
- package/dist/modules/billing/billing.currency.js +4 -5
- package/dist/modules/billing/billing.date-range.js +27 -11
- package/dist/modules/billing/billing.display.js +14 -8
- package/dist/modules/billing/billing.errors.js +2 -3
- package/dist/modules/billing/billing.fce.js +3 -4
- package/dist/modules/billing/billing.iva-receptor.js +2 -3
- package/dist/modules/billing/billing.json-format.js +0 -1
- package/dist/modules/billing/billing.json-input.js +278 -0
- package/dist/modules/billing/billing.labels.js +1 -2
- package/dist/modules/billing/billing.mappers.js +0 -1
- package/dist/modules/billing/billing.padron.js +59 -0
- package/dist/modules/billing/billing.presenter.js +0 -1
- package/dist/modules/billing/billing.schemas.js +20 -6
- package/dist/modules/billing/billing.serialize.js +11 -15
- package/dist/modules/billing/billing.service.js +25 -4
- package/dist/modules/billing/billing.text.js +4 -13
- package/dist/modules/billing/billing.types.internal.js +0 -1
- package/dist/modules/billing/billing.types.js +0 -1
- package/dist/modules/billing/billing.validation.js +13 -11
- package/dist/modules/billing/voucher-kind-map.js +15 -16
- package/dist/modules/completion/completion.js +53 -0
- package/dist/modules/completion/completion.presenter.js +35 -0
- package/dist/modules/completion/installer.js +92 -0
- package/dist/modules/completion/shell-scripts.js +46 -0
- package/dist/modules/config/certificate-expiry.js +90 -0
- package/dist/modules/config/config-doctor.js +42 -28
- package/dist/modules/config/config-value-parser.js +32 -17
- package/dist/modules/config/config.export-credentials.js +23 -0
- package/dist/modules/config/config.presenter.js +28 -6
- package/dist/modules/config/config.schemas.js +27 -12
- package/dist/modules/config/config.sections.js +31 -11
- package/dist/modules/config/config.service.js +38 -9
- package/dist/modules/examples/examples.js +72 -37
- package/dist/modules/export/export.items.js +149 -0
- package/dist/modules/export/export.json-input.js +91 -0
- package/dist/modules/export/export.mappers.js +293 -0
- package/dist/modules/export/export.presenter.js +2 -0
- package/dist/modules/export/export.response.js +86 -0
- package/dist/modules/export/export.serialize.js +70 -0
- package/dist/modules/export/export.service.js +146 -0
- package/dist/modules/export/export.text.js +177 -0
- package/dist/modules/export/export.types.js +36 -0
- package/dist/modules/fce/fce-obligation.js +3 -4
- package/dist/modules/fce/fce-obligation.presenter.js +2 -3
- package/dist/modules/interactive/amount-input.js +0 -1
- package/dist/modules/interactive/choices.js +10 -2
- package/dist/modules/interactive/config-fields.js +17 -3
- package/dist/modules/interactive/equivalent-command.js +6 -3
- package/dist/modules/interactive/export-equivalent-command.js +40 -0
- package/dist/modules/interactive/invoice-copy.js +1 -2
- package/dist/modules/interactive/periods.js +0 -1
- package/dist/modules/interactive/wizard.js +0 -1
- package/dist/modules/padron/padron.js +23 -0
- package/dist/modules/padron/padron.presenter.js +48 -0
- package/dist/modules/parameters/health.js +0 -1
- package/dist/modules/parameters/parameters.js +2 -3
- package/dist/modules/parameters/parameters.presenter.js +14 -12
- package/dist/modules/parameters/status.js +0 -1
- package/dist/modules/pdf/pdf-data.mapper.js +94 -3
- package/dist/modules/pdf/pdf-decision.js +0 -1
- package/dist/modules/pdf/pdf-file-name.js +0 -1
- package/dist/modules/pdf/pdf-issuer.js +3 -3
- package/dist/modules/pdf/pdf-legends.js +35 -0
- package/dist/modules/pdf/pdf.errors.js +0 -1
- package/dist/modules/pdf/pdf.types.js +0 -1
- package/dist/modules/storybook/showcase-theme.js +0 -1
- package/dist/modules/storybook/showcase.js +35 -23
- package/dist/modules/update-check/changelog.js +0 -1
- package/dist/modules/update-check/update-check.presenter.js +6 -7
- package/dist/modules/update-check/update-check.service.js +0 -1
- package/dist/modules/vouchers/voucher-history.js +0 -1
- package/dist/modules/vouchers/voucher-history.presenter.js +3 -4
- package/dist/services/arca/arca-billing.gateway.js +18 -4
- package/dist/services/arca/arca-client.factory.js +27 -1
- package/dist/services/arca/arca-context.resolver.js +17 -7
- package/dist/services/arca/arca-export.gateway.js +146 -0
- package/dist/services/arca/arca-fce-obligation.gateway.js +2 -3
- package/dist/services/arca/arca-padron.gateway.js +103 -0
- package/dist/services/arca/arca-parameters.gateway.js +2 -3
- package/dist/services/arca/arca-voucher-history.gateway.js +2 -3
- package/dist/services/arca/last-voucher.js +26 -0
- package/dist/services/clipboard/clipboard.js +0 -1
- package/dist/services/pdf/escape-html.js +0 -1
- package/dist/services/pdf/pdf-browser.js +0 -1
- package/dist/services/pdf/pdf-exporter.js +26 -11
- package/dist/services/pdf/pdf-plugin.js +41 -14
- package/dist/ui/components/certificateBanner.js +8 -0
- package/dist/ui/components/contentPanel.js +0 -1
- package/dist/ui/components/errorPanel.js +0 -1
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/keyValuePanel.js +0 -1
- package/dist/ui/components/noticePanel.js +0 -1
- package/dist/ui/components/rawPanel.js +0 -1
- package/dist/ui/components/sectionHeading.js +0 -1
- package/dist/ui/components/statusBar.js +0 -1
- package/dist/ui/components/statusPanel.js +0 -1
- package/dist/ui/components/testingBanner.js +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/presenters/billing.presenter.js +0 -1
- package/dist/ui/presenters/config.presenter.js +1 -2
- package/dist/ui/presenters/errors.presenter.js +14 -12
- package/dist/ui/presenters/errors.zod-presenter.js +13 -35
- package/dist/ui/presenters/export.presenter.js +1 -0
- package/dist/ui/presenters/index.js +1 -1
- package/dist/ui/presenters/pdf.presenter.js +1 -2
- package/dist/ui/presenters/showcase.presenter.js +0 -1
- package/dist/ui/primitives/index.js +0 -1
- package/dist/ui/primitives/renderDivider.js +0 -1
- package/dist/ui/primitives/renderFooter.js +0 -1
- package/dist/ui/primitives/renderJson.js +0 -1
- package/dist/ui/primitives/renderKeyValue.js +0 -1
- package/dist/ui/primitives/renderLogo.js +0 -1
- package/dist/ui/primitives/renderObject.js +0 -1
- package/dist/ui/primitives/renderPanel.js +0 -1
- package/dist/ui/primitives/renderSubtitle.js +0 -1
- package/dist/ui/primitives/renderTable.js +0 -1
- package/dist/ui/primitives/terminalWidth.js +0 -1
- package/dist/ui/primitives/text.js +0 -1
- package/dist/ui/stream/index.js +0 -1
- package/dist/ui/stream/terminal-stream.js +13 -2
- package/dist/ui/theme/index.js +0 -1
- package/dist/ui/theme/theme.js +0 -1
- package/llms.txt +122 -45
- package/package.json +1 -2
- package/dist/cli/commands/billing-family.command.d.ts +0 -2
- package/dist/cli/commands/billing-family.command.js.map +0 -1
- package/dist/cli/commands/billing-shortcuts.command.d.ts +0 -2
- package/dist/cli/commands/billing-shortcuts.command.js.map +0 -1
- package/dist/cli/commands/billing.command.batch.d.ts +0 -22
- package/dist/cli/commands/billing.command.batch.js.map +0 -1
- package/dist/cli/commands/billing.command.interactive-preview.d.ts +0 -18
- package/dist/cli/commands/billing.command.interactive-preview.js.map +0 -1
- package/dist/cli/commands/billing.command.options.d.ts +0 -2
- package/dist/cli/commands/billing.command.options.js.map +0 -1
- package/dist/cli/commands/billing.command.output.d.ts +0 -14
- package/dist/cli/commands/billing.command.output.js.map +0 -1
- package/dist/cli/commands/billing.command.parser.d.ts +0 -28
- package/dist/cli/commands/billing.command.parser.js.map +0 -1
- package/dist/cli/commands/billing.command.pdf.d.ts +0 -24
- package/dist/cli/commands/billing.command.pdf.js.map +0 -1
- package/dist/cli/commands/billing.command.shared.d.ts +0 -7
- package/dist/cli/commands/billing.command.shared.js.map +0 -1
- package/dist/cli/commands/billing.command.shortcuts.d.ts +0 -7
- package/dist/cli/commands/billing.command.shortcuts.js.map +0 -1
- package/dist/cli/commands/config.command.d.ts +0 -7
- package/dist/cli/commands/config.command.js.map +0 -1
- package/dist/cli/commands/examples.command.d.ts +0 -2
- package/dist/cli/commands/examples.command.js.map +0 -1
- package/dist/cli/commands/fce-obligation.command.d.ts +0 -2
- package/dist/cli/commands/fce-obligation.command.js.map +0 -1
- package/dist/cli/commands/interactive.command.d.ts +0 -3
- package/dist/cli/commands/interactive.command.js.map +0 -1
- package/dist/cli/commands/parameters.command.d.ts +0 -2
- package/dist/cli/commands/parameters.command.js.map +0 -1
- package/dist/cli/commands/pdf.command.d.ts +0 -2
- package/dist/cli/commands/pdf.command.js.map +0 -1
- package/dist/cli/commands/storybook.command.d.ts +0 -2
- package/dist/cli/commands/storybook.command.js.map +0 -1
- package/dist/cli/commands/vouchers.command.d.ts +0 -2
- package/dist/cli/commands/vouchers.command.js.map +0 -1
- package/dist/cli/error-output.d.ts +0 -7
- package/dist/cli/error-output.js.map +0 -1
- package/dist/cli/help-argv.d.ts +0 -5
- package/dist/cli/help-argv.js.map +0 -1
- package/dist/cli/help.d.ts +0 -12
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/interactive/advanced-options.d.ts +0 -21
- package/dist/cli/interactive/advanced-options.js.map +0 -1
- package/dist/cli/interactive/config.flow.d.ts +0 -5
- package/dist/cli/interactive/config.flow.js.map +0 -1
- package/dist/cli/interactive/history.flow.d.ts +0 -6
- package/dist/cli/interactive/history.flow.js.map +0 -1
- package/dist/cli/interactive/interactive-mode.d.ts +0 -3
- package/dist/cli/interactive/interactive-mode.js.map +0 -1
- package/dist/cli/interactive/invoice-picker.d.ts +0 -25
- package/dist/cli/interactive/invoice-picker.js.map +0 -1
- package/dist/cli/interactive/invoice.flow.d.ts +0 -20
- package/dist/cli/interactive/invoice.flow.js.map +0 -1
- package/dist/cli/interactive/note.flow.d.ts +0 -32
- package/dist/cli/interactive/note.flow.js.map +0 -1
- package/dist/cli/interactive/pdf.flow.d.ts +0 -5
- package/dist/cli/interactive/pdf.flow.js.map +0 -1
- package/dist/cli/interactive/prompts.d.ts +0 -57
- package/dist/cli/interactive/prompts.js.map +0 -1
- package/dist/cli/interactive/repeat.flow.d.ts +0 -13
- package/dist/cli/interactive/repeat.flow.js.map +0 -1
- package/dist/cli/interactive/session.d.ts +0 -22
- package/dist/cli/interactive/session.js.map +0 -1
- package/dist/cli/interactive/status.flow.d.ts +0 -3
- package/dist/cli/interactive/status.flow.js.map +0 -1
- package/dist/cli/interactive/update.flow.d.ts +0 -6
- package/dist/cli/interactive/update.flow.js.map +0 -1
- package/dist/cli/interactive/validators.d.ts +0 -9
- package/dist/cli/interactive/validators.js.map +0 -1
- package/dist/cli/option-parsers.d.ts +0 -6
- package/dist/cli/option-parsers.js.map +0 -1
- package/dist/cli/program.d.ts +0 -2
- package/dist/cli/program.js.map +0 -1
- package/dist/cli/spinner.d.ts +0 -8
- package/dist/cli/spinner.js.map +0 -1
- package/dist/cli/types.d.ts +0 -6
- package/dist/cli/types.js.map +0 -1
- package/dist/cli/version.d.ts +0 -1
- package/dist/cli/version.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/dates/arca-date.d.ts +0 -19
- package/dist/lib/dates/arca-date.js.map +0 -1
- package/dist/lib/errors/app-error.d.ts +0 -17
- package/dist/lib/errors/app-error.js.map +0 -1
- package/dist/lib/files/read-json-file.d.ts +0 -1
- package/dist/lib/files/read-json-file.js.map +0 -1
- package/dist/lib/files/restrict-to-owner.d.ts +0 -7
- package/dist/lib/files/restrict-to-owner.js.map +0 -1
- package/dist/lib/identity/format-cuit.d.ts +0 -2
- package/dist/lib/identity/format-cuit.js.map +0 -1
- package/dist/lib/links.d.ts +0 -2
- package/dist/lib/links.js.map +0 -1
- package/dist/lib/numbers/argentine-amount.d.ts +0 -23
- package/dist/lib/numbers/argentine-amount.js.map +0 -1
- package/dist/lib/numbers/strict-integer.d.ts +0 -4
- package/dist/lib/numbers/strict-integer.js.map +0 -1
- package/dist/lib/paths/mask-path.d.ts +0 -1
- package/dist/lib/paths/mask-path.js.map +0 -1
- package/dist/lib/security/certificate.d.ts +0 -7
- package/dist/lib/security/certificate.js.map +0 -1
- package/dist/lib/security/pem.d.ts +0 -5
- package/dist/lib/security/pem.js.map +0 -1
- package/dist/modules/billing/billing-response.d.ts +0 -4
- package/dist/modules/billing/billing-response.js.map +0 -1
- package/dist/modules/billing/billing.amounts.d.ts +0 -21
- package/dist/modules/billing/billing.amounts.js.map +0 -1
- package/dist/modules/billing/billing.associated-period.d.ts +0 -8
- package/dist/modules/billing/billing.associated-period.js.map +0 -1
- package/dist/modules/billing/billing.associated-vouchers.d.ts +0 -12
- package/dist/modules/billing/billing.associated-vouchers.js.map +0 -1
- package/dist/modules/billing/billing.batch.d.ts +0 -23
- package/dist/modules/billing/billing.batch.js.map +0 -1
- package/dist/modules/billing/billing.constants.d.ts +0 -2
- package/dist/modules/billing/billing.constants.js.map +0 -1
- package/dist/modules/billing/billing.currency.d.ts +0 -18
- package/dist/modules/billing/billing.currency.js.map +0 -1
- package/dist/modules/billing/billing.date-range.d.ts +0 -9
- package/dist/modules/billing/billing.date-range.js.map +0 -1
- package/dist/modules/billing/billing.display.d.ts +0 -13
- package/dist/modules/billing/billing.display.js.map +0 -1
- package/dist/modules/billing/billing.errors.d.ts +0 -12
- package/dist/modules/billing/billing.errors.js.map +0 -1
- package/dist/modules/billing/billing.fce.d.ts +0 -21
- package/dist/modules/billing/billing.fce.js.map +0 -1
- package/dist/modules/billing/billing.iva-receptor.d.ts +0 -8
- package/dist/modules/billing/billing.iva-receptor.js.map +0 -1
- package/dist/modules/billing/billing.json-format.d.ts +0 -6
- package/dist/modules/billing/billing.json-format.js.map +0 -1
- package/dist/modules/billing/billing.labels.d.ts +0 -9
- package/dist/modules/billing/billing.labels.js.map +0 -1
- package/dist/modules/billing/billing.mappers.d.ts +0 -8
- package/dist/modules/billing/billing.mappers.js.map +0 -1
- package/dist/modules/billing/billing.presenter.d.ts +0 -7
- package/dist/modules/billing/billing.presenter.js.map +0 -1
- package/dist/modules/billing/billing.schemas.d.ts +0 -142
- package/dist/modules/billing/billing.schemas.js.map +0 -1
- package/dist/modules/billing/billing.serialize.d.ts +0 -8
- package/dist/modules/billing/billing.serialize.js.map +0 -1
- package/dist/modules/billing/billing.service.d.ts +0 -27
- package/dist/modules/billing/billing.service.js.map +0 -1
- package/dist/modules/billing/billing.text.d.ts +0 -8
- package/dist/modules/billing/billing.text.js.map +0 -1
- package/dist/modules/billing/billing.types.d.ts +0 -13
- package/dist/modules/billing/billing.types.internal.d.ts +0 -30
- package/dist/modules/billing/billing.types.internal.js.map +0 -1
- package/dist/modules/billing/billing.types.js.map +0 -1
- package/dist/modules/billing/billing.validation.d.ts +0 -7
- package/dist/modules/billing/billing.validation.js.map +0 -1
- package/dist/modules/billing/voucher-kind-map.d.ts +0 -9
- package/dist/modules/billing/voucher-kind-map.js.map +0 -1
- package/dist/modules/config/config-doctor.d.ts +0 -15
- package/dist/modules/config/config-doctor.js.map +0 -1
- package/dist/modules/config/config-value-parser.d.ts +0 -2
- package/dist/modules/config/config-value-parser.js.map +0 -1
- package/dist/modules/config/config.presenter.d.ts +0 -15
- package/dist/modules/config/config.presenter.js.map +0 -1
- package/dist/modules/config/config.schemas.d.ts +0 -154
- package/dist/modules/config/config.schemas.js.map +0 -1
- package/dist/modules/config/config.sections.d.ts +0 -14
- package/dist/modules/config/config.sections.js.map +0 -1
- package/dist/modules/config/config.service.d.ts +0 -35
- package/dist/modules/config/config.service.js.map +0 -1
- package/dist/modules/examples/examples.d.ts +0 -1
- package/dist/modules/examples/examples.js.map +0 -1
- package/dist/modules/fce/fce-obligation.d.ts +0 -20
- package/dist/modules/fce/fce-obligation.js.map +0 -1
- package/dist/modules/fce/fce-obligation.presenter.d.ts +0 -9
- package/dist/modules/fce/fce-obligation.presenter.js.map +0 -1
- package/dist/modules/interactive/amount-input.d.ts +0 -4
- package/dist/modules/interactive/amount-input.js.map +0 -1
- package/dist/modules/interactive/choices.d.ts +0 -13
- package/dist/modules/interactive/choices.js.map +0 -1
- package/dist/modules/interactive/config-fields.d.ts +0 -20
- package/dist/modules/interactive/config-fields.js.map +0 -1
- package/dist/modules/interactive/equivalent-command.d.ts +0 -8
- package/dist/modules/interactive/equivalent-command.js.map +0 -1
- package/dist/modules/interactive/invoice-copy.d.ts +0 -19
- package/dist/modules/interactive/invoice-copy.js.map +0 -1
- package/dist/modules/interactive/periods.d.ts +0 -7
- package/dist/modules/interactive/periods.js.map +0 -1
- package/dist/modules/interactive/wizard.d.ts +0 -16
- package/dist/modules/interactive/wizard.js.map +0 -1
- package/dist/modules/parameters/health.d.ts +0 -17
- package/dist/modules/parameters/health.js.map +0 -1
- package/dist/modules/parameters/parameters.d.ts +0 -50
- package/dist/modules/parameters/parameters.js.map +0 -1
- package/dist/modules/parameters/parameters.presenter.d.ts +0 -12
- package/dist/modules/parameters/parameters.presenter.js.map +0 -1
- package/dist/modules/parameters/status.d.ts +0 -31
- package/dist/modules/parameters/status.js.map +0 -1
- package/dist/modules/pdf/pdf-data.mapper.d.ts +0 -4
- package/dist/modules/pdf/pdf-data.mapper.js.map +0 -1
- package/dist/modules/pdf/pdf-decision.d.ts +0 -14
- package/dist/modules/pdf/pdf-decision.js.map +0 -1
- package/dist/modules/pdf/pdf-file-name.d.ts +0 -3
- package/dist/modules/pdf/pdf-file-name.js.map +0 -1
- package/dist/modules/pdf/pdf-issuer.d.ts +0 -8
- package/dist/modules/pdf/pdf-issuer.js.map +0 -1
- package/dist/modules/pdf/pdf.errors.d.ts +0 -9
- package/dist/modules/pdf/pdf.errors.js.map +0 -1
- package/dist/modules/pdf/pdf.types.d.ts +0 -91
- package/dist/modules/pdf/pdf.types.js.map +0 -1
- package/dist/modules/storybook/showcase-theme.d.ts +0 -7
- package/dist/modules/storybook/showcase-theme.js.map +0 -1
- package/dist/modules/storybook/showcase.d.ts +0 -2
- package/dist/modules/storybook/showcase.js.map +0 -1
- package/dist/modules/update-check/changelog.d.ts +0 -23
- package/dist/modules/update-check/changelog.js.map +0 -1
- package/dist/modules/update-check/update-check.presenter.d.ts +0 -6
- package/dist/modules/update-check/update-check.presenter.js.map +0 -1
- package/dist/modules/update-check/update-check.service.d.ts +0 -11
- package/dist/modules/update-check/update-check.service.js.map +0 -1
- package/dist/modules/vouchers/voucher-history.d.ts +0 -39
- package/dist/modules/vouchers/voucher-history.js.map +0 -1
- package/dist/modules/vouchers/voucher-history.presenter.d.ts +0 -29
- package/dist/modules/vouchers/voucher-history.presenter.js.map +0 -1
- package/dist/services/arca/arca-billing.gateway.d.ts +0 -10
- package/dist/services/arca/arca-billing.gateway.js.map +0 -1
- package/dist/services/arca/arca-client.factory.d.ts +0 -5
- package/dist/services/arca/arca-client.factory.js.map +0 -1
- package/dist/services/arca/arca-context.resolver.d.ts +0 -44
- package/dist/services/arca/arca-context.resolver.js.map +0 -1
- package/dist/services/arca/arca-fce-obligation.gateway.d.ts +0 -7
- package/dist/services/arca/arca-fce-obligation.gateway.js.map +0 -1
- package/dist/services/arca/arca-parameters.gateway.d.ts +0 -10
- package/dist/services/arca/arca-parameters.gateway.js.map +0 -1
- package/dist/services/arca/arca-voucher-history.gateway.d.ts +0 -8
- package/dist/services/arca/arca-voucher-history.gateway.js.map +0 -1
- package/dist/services/clipboard/clipboard.d.ts +0 -2
- package/dist/services/clipboard/clipboard.js.map +0 -1
- package/dist/services/pdf/escape-html.d.ts +0 -6
- package/dist/services/pdf/escape-html.js.map +0 -1
- package/dist/services/pdf/pdf-browser.d.ts +0 -5
- package/dist/services/pdf/pdf-browser.js.map +0 -1
- package/dist/services/pdf/pdf-exporter.d.ts +0 -19
- package/dist/services/pdf/pdf-exporter.js.map +0 -1
- package/dist/services/pdf/pdf-plugin.d.ts +0 -50
- package/dist/services/pdf/pdf-plugin.js.map +0 -1
- package/dist/ui/components/contentPanel.d.ts +0 -5
- package/dist/ui/components/contentPanel.js.map +0 -1
- package/dist/ui/components/errorPanel.d.ts +0 -1
- package/dist/ui/components/errorPanel.js.map +0 -1
- package/dist/ui/components/index.d.ts +0 -9
- package/dist/ui/components/index.js.map +0 -1
- package/dist/ui/components/keyValuePanel.d.ts +0 -3
- package/dist/ui/components/keyValuePanel.js.map +0 -1
- package/dist/ui/components/noticePanel.d.ts +0 -3
- package/dist/ui/components/noticePanel.js.map +0 -1
- package/dist/ui/components/rawPanel.d.ts +0 -1
- package/dist/ui/components/rawPanel.js.map +0 -1
- package/dist/ui/components/sectionHeading.d.ts +0 -3
- package/dist/ui/components/sectionHeading.js.map +0 -1
- package/dist/ui/components/statusBar.d.ts +0 -19
- package/dist/ui/components/statusBar.js.map +0 -1
- package/dist/ui/components/statusPanel.d.ts +0 -3
- package/dist/ui/components/statusPanel.js.map +0 -1
- package/dist/ui/components/testingBanner.d.ts +0 -2
- package/dist/ui/components/testingBanner.js.map +0 -1
- package/dist/ui/index.d.ts +0 -5
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/presenters/billing.presenter.d.ts +0 -2
- package/dist/ui/presenters/billing.presenter.js.map +0 -1
- package/dist/ui/presenters/config.presenter.d.ts +0 -1
- package/dist/ui/presenters/config.presenter.js.map +0 -1
- package/dist/ui/presenters/errors.presenter.d.ts +0 -1
- package/dist/ui/presenters/errors.presenter.js.map +0 -1
- package/dist/ui/presenters/errors.zod-presenter.d.ts +0 -4
- package/dist/ui/presenters/errors.zod-presenter.js.map +0 -1
- package/dist/ui/presenters/index.d.ts +0 -6
- package/dist/ui/presenters/index.js.map +0 -1
- package/dist/ui/presenters/pdf.presenter.d.ts +0 -13
- package/dist/ui/presenters/pdf.presenter.js.map +0 -1
- package/dist/ui/presenters/showcase.presenter.d.ts +0 -1
- package/dist/ui/presenters/showcase.presenter.js.map +0 -1
- package/dist/ui/primitives/index.d.ts +0 -10
- package/dist/ui/primitives/index.js.map +0 -1
- package/dist/ui/primitives/renderDivider.d.ts +0 -5
- package/dist/ui/primitives/renderDivider.js.map +0 -1
- package/dist/ui/primitives/renderFooter.d.ts +0 -7
- package/dist/ui/primitives/renderFooter.js.map +0 -1
- package/dist/ui/primitives/renderJson.d.ts +0 -3
- package/dist/ui/primitives/renderJson.js.map +0 -1
- package/dist/ui/primitives/renderKeyValue.d.ts +0 -14
- package/dist/ui/primitives/renderKeyValue.js.map +0 -1
- package/dist/ui/primitives/renderLogo.d.ts +0 -3
- package/dist/ui/primitives/renderLogo.js.map +0 -1
- package/dist/ui/primitives/renderObject.d.ts +0 -1
- package/dist/ui/primitives/renderObject.js.map +0 -1
- package/dist/ui/primitives/renderPanel.d.ts +0 -27
- package/dist/ui/primitives/renderPanel.js.map +0 -1
- package/dist/ui/primitives/renderSubtitle.d.ts +0 -7
- package/dist/ui/primitives/renderSubtitle.js.map +0 -1
- package/dist/ui/primitives/renderTable.d.ts +0 -6
- package/dist/ui/primitives/renderTable.js.map +0 -1
- package/dist/ui/primitives/terminalWidth.d.ts +0 -4
- package/dist/ui/primitives/terminalWidth.js.map +0 -1
- package/dist/ui/primitives/text.d.ts +0 -28
- package/dist/ui/primitives/text.js.map +0 -1
- package/dist/ui/stream/index.d.ts +0 -1
- package/dist/ui/stream/index.js.map +0 -1
- package/dist/ui/stream/terminal-stream.d.ts +0 -16
- package/dist/ui/stream/terminal-stream.js.map +0 -1
- package/dist/ui/theme/index.d.ts +0 -1
- package/dist/ui/theme/index.js.map +0 -1
- package/dist/ui/theme/theme.d.ts +0 -68
- package/dist/ui/theme/theme.js.map +0 -1
package/dist/cli/help.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { Help } from 'commander';
|
|
1
2
|
import { CERTIFICATE_GUIDE_URL } from '../lib/links.js';
|
|
2
|
-
import { getVoucherKindByShortcut } from '../modules/billing/voucher-kind-map.js';
|
|
3
|
+
import { getVoucherKindByFamilyAndLetter, getVoucherKindByShortcut, VOUCHER_FAMILIES, VOUCHER_LETTERS, } from '../modules/billing/voucher-kind-map.js';
|
|
4
|
+
import { CONFIG_LABELS, CONFIG_SECTIONS } from '../modules/config/config.sections.js';
|
|
5
|
+
import { buildMinimalFamilyExample, buildMinimalShortcutExample, EXPORT_MINIMAL_EXAMPLE, } from '../modules/examples/examples.js';
|
|
6
|
+
import { EXPORT_VOUCHER_KIND } from '../modules/export/export.types.js';
|
|
7
|
+
import { CONFIG_FIELDS } from '../modules/interactive/config-fields.js';
|
|
3
8
|
import { renderLogo } from '../ui/index.js';
|
|
4
9
|
import { CLI_VERSION } from './version.js';
|
|
5
10
|
const FAMILY_LABELS = {
|
|
6
11
|
factura: 'Factura',
|
|
7
|
-
'factura-credito-electronica': 'Factura de
|
|
8
|
-
'nota-credito': 'Nota de
|
|
9
|
-
'nota-credito-electronica': 'Nota de
|
|
10
|
-
'nota-debito': 'Nota de
|
|
11
|
-
'nota-debito-electronica': 'Nota de
|
|
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',
|
|
12
17
|
};
|
|
13
18
|
const FAMILY_SHORTCUTS = {
|
|
14
19
|
factura: ['fa', 'fb', 'fc'],
|
|
@@ -18,346 +23,148 @@ const FAMILY_SHORTCUTS = {
|
|
|
18
23
|
'nota-debito': ['nda', 'ndb', 'ndc'],
|
|
19
24
|
'nota-debito-electronica': ['ndea', 'ndeb', 'ndec'],
|
|
20
25
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
' - --consumidor-final | --cfinal | todas | consumidor final con documento 0',
|
|
41
|
-
' - --iva-receptor <tipo> | --ir <tipo> | todas | condicion IVA del receptor',
|
|
42
|
-
' - --ir-* | todas | atajos para IVA receptor, por ejemplo --ir-cf o --ir-ri',
|
|
43
|
-
].join('\n');
|
|
44
|
-
const AVAILABLE_SERVICE_OPTIONS = [
|
|
45
|
-
' - -d, --dia <1-31> | servicios o productos-servicios | dia de vencimiento o referencia de servicio',
|
|
46
|
-
' - --servicio-desde <fecha> | --sd <fecha> | servicios o productos-servicios | inicio del servicio',
|
|
47
|
-
' - --servicio-hasta <fecha> | --sh <fecha> | servicios o productos-servicios | fin del servicio',
|
|
48
|
-
' - --vencimiento <fecha> | --vto <fecha> | servicios, productos-servicios y facturas FCE | vencimiento del pago; por defecto el fin del servicio',
|
|
49
|
-
].join('\n');
|
|
50
|
-
const AVAILABLE_ASSOCIATED_OPTIONS = [
|
|
51
|
-
' - --ac <shortcut> | notas | shortcut del comprobante asociado',
|
|
52
|
-
' - --at <number> | notas | tipo ARCA del comprobante asociado',
|
|
53
|
-
' - --asociado-punto-venta <number> | --apv <number> | notas | punto de venta del asociado',
|
|
54
|
-
' - --ar <number> | notas | numero del comprobante asociado',
|
|
55
|
-
' - --acuit <number> | notas | CUIT del comprobante asociado; en NC/ND FCE por defecto el CUIT emisor',
|
|
56
|
-
' - --afecha <fecha> | notas | fecha del comprobante asociado; obligatoria en NC/ND FCE',
|
|
57
|
-
' - --periodo-desde <fecha> | --pd <fecha> | notas comunes | inicio del periodo asociado; alternativa a --ac',
|
|
58
|
-
' - --periodo-hasta <fecha> | --ph <fecha> | notas comunes | fin del periodo asociado',
|
|
59
|
-
].join('\n');
|
|
60
|
-
const AVAILABLE_FCE_INVOICE_OPTIONS = [
|
|
61
|
-
' - --cbu <22 digitos> | facturas FCE | CBU del emisor; obligatorio (o config cbu)',
|
|
62
|
-
' - --alias <alias> | facturas FCE | alias del CBU (o config aliasCbu)',
|
|
63
|
-
' - --transferencia <sca|adc> | facturas FCE | modalidad de transferencia; por defecto sca',
|
|
64
|
-
].join('\n');
|
|
65
|
-
const AVAILABLE_FCE_NOTE_OPTIONS = [
|
|
66
|
-
' - --anulacion | NC/ND FCE | la nota anula una factura rechazada por el comprador',
|
|
67
|
-
].join('\n');
|
|
68
|
-
function resolveFceOptions(isElectronicCredit, isNote) {
|
|
69
|
-
if (!isElectronicCredit) {
|
|
70
|
-
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.');
|
|
71
45
|
}
|
|
72
|
-
|
|
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));
|
|
73
50
|
}
|
|
74
|
-
const AVAILABLE_EXECUTION_OPTIONS = [
|
|
75
|
-
' - --previsualizar | todas | muestra el payload antes de hablar con ARCA',
|
|
76
|
-
' - --emitir | todas | emite realmente el comprobante',
|
|
77
|
-
' - --testing | todas | fuerza entorno testing en esta corrida',
|
|
78
|
-
' - --produccion | todas | fuerza entorno produccion en esta corrida',
|
|
79
|
-
' - --json | todas | salida estructurada para scripts',
|
|
80
|
-
' - --bruto | todas | agrega respuesta cruda de ARCA cuando exista',
|
|
81
|
-
].join('\n');
|
|
82
|
-
const CORE_RULES = [
|
|
83
|
-
' - ARCLI arma datos desde flags, JSON cargado, config y defaults internos.',
|
|
84
|
-
' - Si no pasa fecha, usa hoy.',
|
|
85
|
-
' - Use --emitir o --previsualizar, pero no ambos.',
|
|
86
|
-
' - Use una sola identidad de receptor: --consumidor-final o --cfinal, o bien --cuit, --cuil o --dni.',
|
|
87
|
-
' - Use --iva-receptor, --ir o un solo flag --ir-*, pero no varios a la vez.',
|
|
88
|
-
' - Use --concepto o un solo flag entre --cs, --cp y --csp, pero no ambos.',
|
|
89
|
-
].join('\n');
|
|
90
51
|
function section(title, body) {
|
|
91
52
|
return [title, body].join('\n');
|
|
92
53
|
}
|
|
93
54
|
function compactList(values) {
|
|
94
55
|
return values.map((value) => ` - ${value}`).join('\n');
|
|
95
56
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
'Como pensar rapido un comando',
|
|
112
|
-
' - 1. Elegí el comprobante: fc, fa, nca, ndeb, fcec.',
|
|
113
|
-
' - 2. Definí el monto: --monto.',
|
|
114
|
-
' - 3. Elegí el concepto: --cs, --cp, --csp o --concepto.',
|
|
115
|
-
' - 4. Definí la identidad: --cuit, --cuil, --dni o --consumidor-final.',
|
|
116
|
-
' - 5. Definí el IVA receptor: --ir-*, --ir o --iva-receptor.',
|
|
117
|
-
].join('\n');
|
|
118
|
-
}
|
|
119
|
-
function createProgramFamilies() {
|
|
120
|
-
return section('Familias y shortcuts', [
|
|
121
|
-
' - factura -> fa, fb, fc',
|
|
122
|
-
' - nota-credito -> nca, ncb, ncc',
|
|
123
|
-
' - nota-debito -> nda, ndb, ndc',
|
|
124
|
-
' - factura-credito-electronica -> fcea, fceb, fcec',
|
|
125
|
-
' - nota-credito-electronica -> ncea, nceb, ncec',
|
|
126
|
-
' - nota-debito-electronica -> ndea, ndeb, ndec',
|
|
127
|
-
].join('\n'));
|
|
128
|
-
}
|
|
129
|
-
function createProgramCommands() {
|
|
130
|
-
return section('Comandos importantes', [
|
|
131
|
-
' - Emitir comprobantes por shortcut: arcli fc ...',
|
|
132
|
-
' - Emitir por familia y letra: arcli factura c ...',
|
|
133
|
-
' - Ver y guardar config: arcli config',
|
|
134
|
-
' - Revisar entorno y credenciales: arcli config revisar',
|
|
135
|
-
' - Ver ejemplos listos para copiar: arcli ejemplos',
|
|
136
|
-
' - Consultar si un receptor esta obligado a FCE: arcli fce-obligado <cuit>',
|
|
137
|
-
' - Asistente paso a paso: arcli (sin argumentos) o arcli interactivo',
|
|
138
|
-
' - Ver los ultimos comprobantes emitidos: arcli ultimos fb',
|
|
139
|
-
' - Ver el detalle de un comprobante: arcli consultar fb 14',
|
|
140
|
-
' - Ver si ARCA responde y el punto de venta esta habilitado: arcli estado',
|
|
141
|
-
' - Ver tablas de ARCA (puntos de venta, alicuotas, cotizacion): arcli parametros',
|
|
142
|
-
' - Generar el PDF al emitir: arcli fc ... --emitir --exportar-pdf (plugin: arcli pdf instalar)',
|
|
143
|
-
' - Ver escenas de UI: arcli storybook',
|
|
144
|
-
].join('\n'));
|
|
145
|
-
}
|
|
146
|
-
function createProgramExamples() {
|
|
147
|
-
return section('Ejemplos utiles', [
|
|
148
|
-
' - Basico: arcli fc -m 300000 --cs --consumidor-final --ir-cf',
|
|
149
|
-
' - Con CUIT: arcli fa -m 1 --cs --cuit 20168598204 --ir-ri',
|
|
150
|
-
' - Nota: arcli nca -m 1 --cs --cuit 20168598204 --ir-ri --ac fa --apv 3 --ar 6 --acuit 20409509763',
|
|
151
|
-
].join('\n'));
|
|
152
|
-
}
|
|
153
|
-
function createProgramSafety() {
|
|
154
|
-
return section('Ejecucion y seguridad', [
|
|
155
|
-
' - --previsualizar muestra la solicitud antes de emitir.',
|
|
156
|
-
' - --emitir habla de verdad con ARCA.',
|
|
157
|
-
' - --produccion cambia al entorno real.',
|
|
158
|
-
' - Sin --emitir, en una terminal pregunta antes de emitir (salvo emitir=true en la config).',
|
|
159
|
-
' - Para scripts o pipelines, usá --json y evitá automatizar sobre salida humana.',
|
|
160
|
-
].join('\n'));
|
|
161
|
-
}
|
|
162
|
-
function createProgramProject() {
|
|
163
|
-
return section('Proyecto y actualizaciones', [
|
|
164
|
-
' - Repositorio: https://github.com/LcsGrz/arcli',
|
|
165
|
-
' - Actualizar a la ultima version: npm install -g arcli@latest',
|
|
166
|
-
' - Ver la version instalada: arcli --version',
|
|
167
|
-
].join('\n'));
|
|
168
|
-
}
|
|
169
|
-
function createProgramDiscovery() {
|
|
170
|
-
return section('Descubrimiento', [
|
|
171
|
-
' - Ayuda general: arcli ayuda',
|
|
172
|
-
' - Ayuda de un shortcut: arcli fc ayuda',
|
|
173
|
-
' - Ayuda de una familia: arcli factura ayuda',
|
|
174
|
-
' - Ayuda de config: arcli config ayuda',
|
|
175
|
-
' - Ayuda de ejemplos: arcli ejemplos ayuda',
|
|
176
|
-
' - Ayuda de storybook: arcli storybook ayuda',
|
|
177
|
-
].join('\n'));
|
|
178
|
-
}
|
|
179
|
-
function createProgramFrequentErrors() {
|
|
180
|
-
return section('Errores frecuentes', [
|
|
181
|
-
' - Identidad duplicada: no uses --cuit y --consumidor-final juntos.',
|
|
182
|
-
' - Falta IVA receptor: elegí --ir-* o --iva-receptor.',
|
|
183
|
-
' - Flags incompatibles: no mezcles --emitir y --previsualizar.',
|
|
184
|
-
' - JSON invalido o incompleto: revisá el archivo pasado a --cargar.',
|
|
185
|
-
].join('\n'));
|
|
186
|
-
}
|
|
187
|
-
function createVoucherSummary(shortcut) {
|
|
188
|
-
const definition = getVoucherKindByShortcut(shortcut);
|
|
189
|
-
if (!definition) {
|
|
190
|
-
return '';
|
|
191
|
-
}
|
|
192
|
-
const whenToUse = definition.requiresAssociatedVoucher
|
|
193
|
-
? 'Use este shortcut cuando ya sabe el comprobante exacto y necesita informar un asociado compatible.'
|
|
194
|
-
: 'Use este shortcut cuando ya sabe exactamente que comprobante quiere emitir y quiere escribir menos.';
|
|
195
|
-
return section('Resumen', [
|
|
196
|
-
` - Comprobante: ${definition.displayName}`,
|
|
197
|
-
` - Shortcut: arcli ${shortcut}`,
|
|
198
|
-
` - Comando largo: arcli ${definition.family} ${definition.letter}`,
|
|
199
|
-
` - Tipo ARCA: ${definition.arcaType}`,
|
|
200
|
-
` - Cuando usarlo: ${whenToUse}`,
|
|
201
|
-
].join('\n'));
|
|
202
|
-
}
|
|
203
|
-
function createShortcutMinimum(shortcut) {
|
|
204
|
-
const definition = getVoucherKindByShortcut(shortcut);
|
|
205
|
-
if (!definition) {
|
|
206
|
-
return '';
|
|
207
|
-
}
|
|
208
|
-
const example = definition.requiresAssociatedVoucher
|
|
209
|
-
? ` - Ejemplo minimo: arcli ${shortcut} -m 1 --cs --cuit 20168598204 --ir-ri --ac fa --apv 3 --ar 6 --acuit 20409509763`
|
|
210
|
-
: ` - Ejemplo minimo: arcli ${shortcut} -m 300000 --cs --consumidor-final --ir-cf`;
|
|
211
|
-
return section('Para empezar', [
|
|
212
|
-
example,
|
|
213
|
-
definition.requiresAssociatedVoucher
|
|
214
|
-
? ' - Ademas de la estructura base, este comprobante siempre necesita asociado.'
|
|
215
|
-
: ' - Con eso ya tenés una base funcional para previsualizar o emitir.',
|
|
216
|
-
].join('\n'));
|
|
217
|
-
}
|
|
218
|
-
function createShortcutExamples(shortcut) {
|
|
219
|
-
const definition = getVoucherKindByShortcut(shortcut);
|
|
220
|
-
if (!definition) {
|
|
221
|
-
return '';
|
|
222
|
-
}
|
|
223
|
-
const examples = definition.requiresAssociatedVoucher
|
|
224
|
-
? [
|
|
225
|
-
` - Previsualizar: arcli ${shortcut} -m 1 --cs --cuit 20168598204 --ir-ri --ac fa --apv 3 --ar 6 --acuit 20409509763 --previsualizar`,
|
|
226
|
-
` - Emitir: arcli ${shortcut} -m 1 --cs --cuit 20168598204 --ir-ri --ac fa --apv 3 --ar 6 --acuit 20409509763 --emitir --bruto`,
|
|
227
|
-
` - JSON: arcli ${shortcut} --cargar ./voucher.json --json`,
|
|
228
|
-
]
|
|
229
|
-
: [
|
|
230
|
-
` - Rapido: arcli ${shortcut} -m 15000 --cs --consumidor-final --ir-cf`,
|
|
231
|
-
` - Emitir: arcli ${shortcut} -m 1 --cs --cuit 20168598204 --ir-ri --emitir --bruto`,
|
|
232
|
-
` - JSON: arcli ${shortcut} --cargar ./voucher.json --json`,
|
|
233
|
-
];
|
|
234
|
-
return section('Ejemplos', examples.join('\n'));
|
|
235
|
-
}
|
|
236
|
-
function createShortcutImportantFlags(shortcut) {
|
|
237
|
-
const definition = getVoucherKindByShortcut(shortcut);
|
|
238
|
-
if (!definition) {
|
|
239
|
-
return '';
|
|
240
|
-
}
|
|
241
|
-
return section('Flags importantes', [
|
|
242
|
-
' - Estructura base: --monto, --concepto/--cs/--cp/--csp, identidad y IVA receptor.',
|
|
243
|
-
' - Datos comunes: --pv, --fecha, --moneda, --cm, --cargar.',
|
|
244
|
-
' - Servicio: --dia, --sd y --sh cuando el concepto usa servicios.',
|
|
245
|
-
definition.requiresAssociatedVoucher
|
|
246
|
-
? definition.isElectronicCredit
|
|
247
|
-
? ' - Asociado: --ac o --at, mas --apv, --ar y --afecha.'
|
|
248
|
-
: ' - Asociado: --ac o --at, mas --apv, --ar y --acuit; o un periodo con --pd y --ph.'
|
|
249
|
-
: ' - Asociado: no aplica para este comprobante.',
|
|
250
|
-
...(definition.isElectronicCredit
|
|
251
|
-
? [
|
|
252
|
-
definition.requiresAssociatedVoucher
|
|
253
|
-
? ' - FCE: --afecha obligatoria y --anulacion si anula una factura rechazada.'
|
|
254
|
-
: ' - FCE: --cbu obligatorio (o config cbu), --alias y --transferencia sca|adc.',
|
|
255
|
-
]
|
|
256
|
-
: []),
|
|
257
|
-
' - Salida y ejecucion: --previsualizar, --emitir, --json, --bruto, --testing, --produccion.',
|
|
258
|
-
].join('\n'));
|
|
259
|
-
}
|
|
260
|
-
function createShortcutAvailableFlags(shortcut) {
|
|
261
|
-
const definition = getVoucherKindByShortcut(shortcut);
|
|
262
|
-
if (!definition) {
|
|
263
|
-
return '';
|
|
264
|
-
}
|
|
265
|
-
return section('Mas parametros disponibles', [
|
|
266
|
-
'Generales',
|
|
267
|
-
AVAILABLE_GENERAL_OPTIONS,
|
|
268
|
-
'',
|
|
269
|
-
'Receptor e IVA',
|
|
270
|
-
AVAILABLE_IDENTITY_OPTIONS,
|
|
271
|
-
'',
|
|
272
|
-
'Servicio',
|
|
273
|
-
AVAILABLE_SERVICE_OPTIONS,
|
|
274
|
-
'',
|
|
275
|
-
'Comprobante asociado',
|
|
276
|
-
definition.requiresAssociatedVoucher ? AVAILABLE_ASSOCIATED_OPTIONS : ' - No aplica para este comprobante.',
|
|
277
|
-
'',
|
|
278
|
-
'Credito electronico (FCE)',
|
|
279
|
-
resolveFceOptions(definition.isElectronicCredit, definition.requiresAssociatedVoucher),
|
|
280
|
-
'',
|
|
281
|
-
'Ejecucion y salida',
|
|
282
|
-
AVAILABLE_EXECUTION_OPTIONS,
|
|
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',
|
|
283
72
|
].join('\n'));
|
|
284
73
|
}
|
|
285
|
-
function
|
|
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) {
|
|
286
92
|
const definition = getVoucherKindByShortcut(shortcut);
|
|
287
93
|
if (!definition) {
|
|
288
94
|
return '';
|
|
289
95
|
}
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
'
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
96
|
+
const minimal = buildMinimalShortcutExample(definition);
|
|
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');
|
|
299
109
|
}
|
|
300
110
|
function createFamilySummary(family) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
' - Si ya sabés el comprobante exacto, el shortcut suele ser mas rapido.',
|
|
307
|
-
].join('\n'));
|
|
308
|
-
}
|
|
309
|
-
function createFamilyExamples(family) {
|
|
310
|
-
return section('Ejemplos por letra', [
|
|
311
|
-
` - Letra A: arcli ${family} a -m 15000 --cs --cuit 20168598204 --ir-ri`,
|
|
312
|
-
` - Letra B: arcli ${family} b -m 15000 --cs --consumidor-final --ir-cf`,
|
|
313
|
-
` - Letra C con JSON: arcli ${family} c --cargar ./voucher.json --json`,
|
|
314
|
-
].join('\n'));
|
|
315
|
-
}
|
|
316
|
-
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}.`;
|
|
317
116
|
return [
|
|
318
|
-
section('
|
|
319
|
-
'',
|
|
320
|
-
section('
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
: '
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
section('Mas parametros disponibles', [
|
|
331
|
-
'Generales',
|
|
332
|
-
AVAILABLE_GENERAL_OPTIONS,
|
|
333
|
-
'',
|
|
334
|
-
'Receptor e IVA',
|
|
335
|
-
AVAILABLE_IDENTITY_OPTIONS,
|
|
336
|
-
'',
|
|
337
|
-
'Servicio',
|
|
338
|
-
AVAILABLE_SERVICE_OPTIONS,
|
|
339
|
-
'',
|
|
340
|
-
'Comprobante asociado',
|
|
341
|
-
family.includes('nota') ? AVAILABLE_ASSOCIATED_OPTIONS : ' - No aplica para esta familia.',
|
|
342
|
-
'',
|
|
343
|
-
'Credito electronico (FCE)',
|
|
344
|
-
resolveFceOptions(family.includes('electronica'), family.includes('nota')),
|
|
345
|
-
'',
|
|
346
|
-
'Ejecucion y salida',
|
|
347
|
-
AVAILABLE_EXECUTION_OPTIONS,
|
|
348
|
-
].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
|
+
])),
|
|
349
129
|
].join('\n');
|
|
350
130
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
131
|
+
const BOOLEAN_CONFIG_VALUES = 'true/false, si/no o 1/0';
|
|
132
|
+
/** Valores de las claves que el asistente no edita o que, siendo booleanas, aceptan mas formas que si/no. */
|
|
133
|
+
const CONFIG_VALUE_OVERRIDES = {
|
|
134
|
+
alicuota: 'general, reducida, incrementada, cero o el número: 0, 2.5, 5, 10.5, 21, 27; por defecto 21',
|
|
135
|
+
bruto: BOOLEAN_CONFIG_VALUES,
|
|
136
|
+
consultarPadron: `${BOOLEAN_CONFIG_VALUES}; por defecto si`,
|
|
137
|
+
emitir: BOOLEAN_CONFIG_VALUES,
|
|
138
|
+
json: BOOLEAN_CONFIG_VALUES,
|
|
139
|
+
verificarFce: BOOLEAN_CONFIG_VALUES,
|
|
140
|
+
};
|
|
141
|
+
function describeConfigValues(key) {
|
|
142
|
+
const override = CONFIG_VALUE_OVERRIDES[key];
|
|
143
|
+
if (override) {
|
|
144
|
+
return override;
|
|
359
145
|
}
|
|
360
|
-
|
|
146
|
+
const field = CONFIG_FIELDS.find((candidate) => candidate.key === key);
|
|
147
|
+
if (!field) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
if (field.choices) {
|
|
151
|
+
return field.choices.join(', ');
|
|
152
|
+
}
|
|
153
|
+
return field.path ? 'ruta' : field.hint;
|
|
154
|
+
}
|
|
155
|
+
/** Todas las claves publicas, por seccion, con su nombre y valores: sale de la misma tabla que `arcli config`. */
|
|
156
|
+
function createConfigKeysSection() {
|
|
157
|
+
const lines = CONFIG_SECTIONS.flatMap((configSection) => [
|
|
158
|
+
` ${configSection.label}`,
|
|
159
|
+
...configSection.keys.map((key) => {
|
|
160
|
+
const values = describeConfigValues(key);
|
|
161
|
+
return ` - ${key}: ${CONFIG_LABELS[key]}${values ? ` (${values})` : ''}`;
|
|
162
|
+
}),
|
|
163
|
+
]);
|
|
164
|
+
return section('Claves', [...lines, ' Guardar: arcli config establecer <clave> <valor>. Borrar: arcli config eliminar <clave>.'].join('\n'));
|
|
165
|
+
}
|
|
166
|
+
export function createConfigSetHelp() {
|
|
167
|
+
return ['', createConfigKeysSection(), '', section('Ejemplo', ' - arcli config establecer puntoVenta 3'), ''].join('\n');
|
|
361
168
|
}
|
|
362
169
|
export function createConfigHelp() {
|
|
363
170
|
return [
|
|
@@ -365,16 +172,16 @@ export function createConfigHelp() {
|
|
|
365
172
|
section('Para que sirve', [
|
|
366
173
|
' - Guardar defaults del CLI para no repetir flags en cada corrida.',
|
|
367
174
|
' - Definir rutas de certificados y claves por entorno.',
|
|
368
|
-
' - Revisar si el entorno
|
|
175
|
+
' - Revisar si el entorno está listo antes de emitir.',
|
|
369
176
|
].join('\n')),
|
|
370
177
|
'',
|
|
371
178
|
section('Casos comunes', [
|
|
372
179
|
' - Guardar defaults para no repetir flags como puntoVenta, concepto o IVA receptor.',
|
|
373
|
-
' - Revisar si testing o
|
|
180
|
+
' - Revisar si testing o producción tienen credenciales y contexto válidos.',
|
|
374
181
|
' - Debuggear por que un comando pide datos que pensabas tener guardados.',
|
|
375
182
|
].join('\n')),
|
|
376
183
|
'',
|
|
377
|
-
section('Comandos
|
|
184
|
+
section('Comandos más usados', [
|
|
378
185
|
' - Ver config actual: arcli config',
|
|
379
186
|
' - Revisar entorno: arcli config revisar',
|
|
380
187
|
' - Ver ruta del archivo: arcli config ruta',
|
|
@@ -382,19 +189,10 @@ export function createConfigHelp() {
|
|
|
382
189
|
' - Guardar una credencial: arcli config establecer cert.testing /ruta/cert.crt',
|
|
383
190
|
].join('\n')),
|
|
384
191
|
'',
|
|
385
|
-
|
|
386
|
-
' - entorno: testing o produccion por defecto cuando no pasas --testing/--produccion.',
|
|
387
|
-
' - cuit, puntoVenta, concepto, ivaReceptor: datos de facturacion que se repiten siempre.',
|
|
388
|
-
' - cert.testing, cert.produccion, key.testing, key.produccion: rutas a certificado/clave por entorno.',
|
|
389
|
-
' - moneda, cotizacion: defaults cuando no pasas --moneda/--cm.',
|
|
390
|
-
' - alicuota: alicuota de IVA por defecto para letras A y B.',
|
|
391
|
-
' - emitir, json, bruto: defaults de ejecucion y salida (true/false, si/no o 1/0).',
|
|
392
|
-
' - ticketPath: carpeta donde se cachea el ticket WSAA.',
|
|
393
|
-
' - Guardar: arcli config establecer <clave> <valor>. Borrar: arcli config eliminar <clave>.',
|
|
394
|
-
].join('\n')),
|
|
192
|
+
createConfigKeysSection(),
|
|
395
193
|
'',
|
|
396
194
|
section('Ejemplos', [
|
|
397
|
-
' - arcli config establecer cuit
|
|
195
|
+
' - arcli config establecer cuit 20333333334',
|
|
398
196
|
' - arcli config establecer entorno produccion',
|
|
399
197
|
' - arcli config establecer ivaReceptor consumidor-final',
|
|
400
198
|
' - arcli config establecer key.produccion /ruta/clave.key',
|
|
@@ -403,12 +201,12 @@ export function createConfigHelp() {
|
|
|
403
201
|
].join('\n')),
|
|
404
202
|
'',
|
|
405
203
|
section('Errores frecuentes', [
|
|
406
|
-
' - Faltan cert.testing o key.testing:
|
|
407
|
-
' - Punto de venta no configurado:
|
|
408
|
-
' - Emitir por defecto activado sin querer:
|
|
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.',
|
|
409
207
|
].join('\n')),
|
|
410
208
|
'',
|
|
411
|
-
section('No
|
|
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')),
|
|
412
210
|
'',
|
|
413
211
|
].join('\n');
|
|
414
212
|
}
|
|
@@ -417,6 +215,7 @@ export function createStorybookHelp() {
|
|
|
417
215
|
'',
|
|
418
216
|
section('Escenas disponibles', [
|
|
419
217
|
' - arcli storybook',
|
|
218
|
+
' - arcli storybook bordes',
|
|
420
219
|
' - arcli storybook colores',
|
|
421
220
|
' - arcli storybook componentes',
|
|
422
221
|
' - arcli storybook comprobantes',
|
|
@@ -438,19 +237,19 @@ export function createExamplesHelp() {
|
|
|
438
237
|
section('Para que sirve', [
|
|
439
238
|
' - Mostrar ejemplos seguros y listos para copiar de todos los comprobantes soportados.',
|
|
440
239
|
' - Comparar la forma larga y la forma corta del mismo comando.',
|
|
441
|
-
' - Ver
|
|
240
|
+
' - Ver rápido que cambia entre una variante mínima y una full.',
|
|
442
241
|
].join('\n')),
|
|
443
242
|
'',
|
|
444
243
|
section('Como leer la salida', [
|
|
445
|
-
' -
|
|
446
|
-
' - Full:
|
|
244
|
+
' - Mínima: datos esenciales del comprobante.',
|
|
245
|
+
' - Full: más campos explicitados para el mismo flujo.',
|
|
447
246
|
' - Larga: comando largo y flags descriptivos.',
|
|
448
247
|
' - Corta: shortcut y aliases practicos.',
|
|
449
248
|
].join('\n')),
|
|
450
249
|
'',
|
|
451
250
|
section('Seguridad', [
|
|
452
251
|
' - Todos los ejemplos usan --previsualizar para evitar emisiones reales por error.',
|
|
453
|
-
' - Si
|
|
252
|
+
' - Si querés emitir, reemplaza --previsualizar por --emitir.',
|
|
454
253
|
].join('\n')),
|
|
455
254
|
'',
|
|
456
255
|
].join('\n');
|
|
@@ -459,11 +258,11 @@ export function createFceObligationHelp() {
|
|
|
459
258
|
return [
|
|
460
259
|
'',
|
|
461
260
|
section('Para que sirve', [
|
|
462
|
-
' - Saber si a un receptor le corresponde factura comun o Factura de
|
|
463
|
-
' - ARCA informa si
|
|
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.',
|
|
464
263
|
].join('\n')),
|
|
465
264
|
'',
|
|
466
|
-
section('Ejemplos', [' - arcli fce-obligado
|
|
265
|
+
section('Ejemplos', [' - arcli fce-obligado 30546689979', ' - arcli fce-obligado 30546689979 --fecha 15/10 --json'].join('\n')),
|
|
467
266
|
'',
|
|
468
267
|
section('Requisitos', [
|
|
469
268
|
' - El certificado tiene que estar autorizado para el servicio wsfecred en ARCA.',
|
|
@@ -472,6 +271,41 @@ export function createFceObligationHelp() {
|
|
|
472
271
|
'',
|
|
473
272
|
].join('\n');
|
|
474
273
|
}
|
|
274
|
+
export function createPadronHelp() {
|
|
275
|
+
return [
|
|
276
|
+
'',
|
|
277
|
+
section('Para que sirve', [
|
|
278
|
+
' - Ver razón social, domicilio fiscal, condición IVA, impuestos y actividad de un CUIT.',
|
|
279
|
+
' - Al facturar con --cuit, arcli usa el mismo dato para completar el IVA receptor si no pasa --ir.',
|
|
280
|
+
].join('\n')),
|
|
281
|
+
'',
|
|
282
|
+
section('Ejemplos', [' - arcli padron 20201797064', ' - arcli padron 20201797064 --json'].join('\n')),
|
|
283
|
+
'',
|
|
284
|
+
section('Requisitos', [
|
|
285
|
+
' - El certificado tiene que estar autorizado para el servicio ws_sr_constancia_inscripcion en ARCA.',
|
|
286
|
+
' - Para no consultarlo al facturar: arcli config establecer consultarPadron false',
|
|
287
|
+
].join('\n')),
|
|
288
|
+
'',
|
|
289
|
+
].join('\n');
|
|
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
|
+
}
|
|
475
309
|
export function createVoucherQueryHelp() {
|
|
476
310
|
return [
|
|
477
311
|
'',
|
|
@@ -491,63 +325,82 @@ export function createVoucherQueryHelp() {
|
|
|
491
325
|
].join('\n');
|
|
492
326
|
}
|
|
493
327
|
export function createShortcutHelp(shortcut) {
|
|
328
|
+
const definition = getVoucherKindByShortcut(shortcut);
|
|
329
|
+
if (!definition) {
|
|
330
|
+
return '';
|
|
331
|
+
}
|
|
494
332
|
return [
|
|
495
333
|
'',
|
|
496
|
-
|
|
497
|
-
'',
|
|
498
|
-
createShortcutMinimum(shortcut),
|
|
499
|
-
'',
|
|
500
|
-
createShortcutImportantFlags(shortcut),
|
|
334
|
+
createShortcutSummary(shortcut),
|
|
501
335
|
'',
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
'',
|
|
508
|
-
createShortcutFrequentErrors(shortcut),
|
|
336
|
+
createRules({
|
|
337
|
+
isElectronicCredit: definition.isElectronicCredit,
|
|
338
|
+
isNote: definition.requiresAssociatedVoucher,
|
|
339
|
+
letters: [definition.letter],
|
|
340
|
+
}),
|
|
509
341
|
'',
|
|
510
342
|
].join('\n');
|
|
511
343
|
}
|
|
512
|
-
|
|
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;
|
|
513
347
|
return [
|
|
514
348
|
'',
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
'',
|
|
523
|
-
|
|
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
|
+
])),
|
|
524
363
|
'',
|
|
525
364
|
].join('\n');
|
|
526
365
|
}
|
|
527
|
-
export function
|
|
366
|
+
export function createFamilyHelp(family) {
|
|
528
367
|
return [
|
|
529
368
|
'',
|
|
530
|
-
|
|
531
|
-
'',
|
|
532
|
-
createProgramMentalModel(),
|
|
533
|
-
'',
|
|
534
|
-
createProgramFamilies(),
|
|
535
|
-
'',
|
|
536
|
-
createProgramCommands(),
|
|
537
|
-
'',
|
|
538
|
-
createProgramExamples(),
|
|
539
|
-
'',
|
|
540
|
-
createProgramSafety(),
|
|
541
|
-
'',
|
|
542
|
-
createProgramDiscovery(),
|
|
543
|
-
'',
|
|
544
|
-
createProgramFrequentErrors(),
|
|
369
|
+
createFamilySummary(family),
|
|
545
370
|
'',
|
|
546
|
-
|
|
371
|
+
createRules({
|
|
372
|
+
isElectronicCredit: family.includes('electronica'),
|
|
373
|
+
isNote: family.includes('nota'),
|
|
374
|
+
letters: VOUCHER_LETTERS,
|
|
375
|
+
}),
|
|
547
376
|
'',
|
|
548
377
|
].join('\n');
|
|
549
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();
|
|
550
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
|
+
});
|
|
551
404
|
command.helpCommand(false);
|
|
552
405
|
command.helpOption('--ayuda', 'mostrar ayuda');
|
|
553
406
|
command.showHelpAfterError('(usa "ayuda" para ver ejemplos y opciones)');
|
|
@@ -555,4 +408,3 @@ export function configureSpanishHelp(command) {
|
|
|
555
408
|
export function createProgramHeader() {
|
|
556
409
|
return renderLogo(CLI_VERSION);
|
|
557
410
|
}
|
|
558
|
-
//# sourceMappingURL=help.js.map
|