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