@apimatic/cli 1.5.0 → 2.0.0-beta.2
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/LICENSE +21 -0
- package/README.md +128 -212
- package/apimatic.schema.json +550 -0
- package/lib/actions/action-result.js +3 -0
- package/lib/actions/action-result.js.map +1 -1
- package/lib/actions/api/transform.js +36 -33
- package/lib/actions/api/transform.js.map +1 -1
- package/lib/actions/api/validate.d.ts +9 -6
- package/lib/actions/api/validate.js +44 -38
- package/lib/actions/api/validate.js.map +1 -1
- package/lib/actions/auth/login.js +7 -4
- package/lib/actions/auth/login.js.map +1 -1
- package/lib/actions/auth/logout.js +2 -1
- package/lib/actions/auth/logout.js.map +1 -1
- package/lib/actions/auth/status.js +5 -3
- package/lib/actions/auth/status.js.map +1 -1
- package/lib/actions/plugin/generate.d.ts +5 -1
- package/lib/actions/plugin/generate.js +83 -56
- package/lib/actions/plugin/generate.js.map +1 -1
- package/lib/actions/plugin/publish.d.ts +2 -1
- package/lib/actions/plugin/publish.js +34 -37
- package/lib/actions/plugin/publish.js.map +1 -1
- package/lib/actions/plugin/record-metadata.d.ts +3 -2
- package/lib/actions/plugin/record-metadata.js +33 -30
- package/lib/actions/plugin/record-metadata.js.map +1 -1
- package/lib/actions/portal/generate.d.ts +8 -6
- package/lib/actions/portal/generate.js +50 -61
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/prepare-project.d.ts +25 -0
- package/lib/actions/portal/prepare-project.js +68 -0
- package/lib/actions/portal/prepare-project.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +21 -6
- package/lib/actions/portal/serve.js +170 -153
- package/lib/actions/portal/serve.js.map +1 -1
- package/lib/actions/publishing/profile/list.js +4 -2
- package/lib/actions/publishing/profile/list.js.map +1 -1
- package/lib/actions/quickstart.d.ts +23 -5
- package/lib/actions/quickstart.js +221 -21
- package/lib/actions/quickstart.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +4 -7
- package/lib/actions/sdk/generate.js +53 -93
- package/lib/actions/sdk/generate.js.map +1 -1
- package/lib/actions/sdk/publish/interactive.d.ts +4 -3
- package/lib/actions/sdk/publish/interactive.js +96 -97
- package/lib/actions/sdk/publish/interactive.js.map +1 -1
- package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
- package/lib/actions/sdk/publish/non-interactive.js +91 -90
- package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
- package/lib/actions/sdk/publish.d.ts +3 -2
- package/lib/actions/sdk/publish.js +55 -53
- package/lib/actions/sdk/publish.js.map +1 -1
- package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
- package/lib/actions/sdk/record-published-sdk.js +57 -0
- package/lib/actions/sdk/record-published-sdk.js.map +1 -0
- package/lib/client-utils/auth-manager.js +1 -1
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/commands/api/transform.d.ts +1 -1
- package/lib/commands/api/transform.js +44 -40
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.js +16 -16
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.js +14 -15
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.js +5 -6
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.js +4 -5
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/plugin/generate.d.ts +3 -3
- package/lib/commands/plugin/generate.js +20 -20
- package/lib/commands/plugin/generate.js.map +1 -1
- package/lib/commands/plugin/publish.js +18 -18
- package/lib/commands/plugin/publish.js.map +1 -1
- package/lib/commands/portal/generate.d.ts +9 -8
- package/lib/commands/portal/generate.js +36 -27
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +7 -9
- package/lib/commands/portal/serve.js +41 -44
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/publishing/profile/list.js +8 -12
- package/lib/commands/publishing/profile/list.js.map +1 -1
- package/lib/commands/quickstart.d.ts +5 -5
- package/lib/commands/quickstart.js +18 -24
- package/lib/commands/quickstart.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +5 -7
- package/lib/commands/sdk/generate.js +58 -70
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/commands/sdk/publish.d.ts +6 -7
- package/lib/commands/sdk/publish.js +66 -60
- package/lib/commands/sdk/publish.js.map +1 -1
- package/lib/hooks/node-version.d.ts +3 -0
- package/lib/hooks/node-version.js +12 -0
- package/lib/hooks/node-version.js.map +1 -0
- package/lib/hooks/not-found.js +2 -3
- package/lib/hooks/not-found.js.map +1 -1
- package/lib/hooks/utils.d.ts +4 -2
- package/lib/hooks/utils.js +2 -2
- package/lib/hooks/utils.js.map +1 -1
- package/lib/infrastructure/env-info.d.ts +3 -0
- package/lib/infrastructure/env-info.js +13 -6
- package/lib/infrastructure/env-info.js.map +1 -1
- package/lib/infrastructure/file-service.d.ts +35 -8
- package/lib/infrastructure/file-service.js +149 -53
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/file-watch-service.d.ts +40 -0
- package/lib/infrastructure/file-watch-service.js +167 -0
- package/lib/infrastructure/file-watch-service.js.map +1 -0
- package/lib/infrastructure/generation-status-poller.d.ts +8 -7
- package/lib/infrastructure/generation-status-poller.js +20 -12
- package/lib/infrastructure/generation-status-poller.js.map +1 -1
- package/lib/infrastructure/launcher-service.js +6 -6
- package/lib/infrastructure/launcher-service.js.map +1 -1
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +15 -1
- package/lib/infrastructure/network-service.js.map +1 -1
- package/lib/infrastructure/portal-build-service.d.ts +19 -0
- package/lib/infrastructure/portal-build-service.js +58 -0
- package/lib/infrastructure/portal-build-service.js.map +1 -0
- package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
- package/lib/infrastructure/portal-dev-server-service.js +135 -0
- package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
- package/lib/infrastructure/portal-pages-service.d.ts +17 -0
- package/lib/infrastructure/portal-pages-service.js +103 -0
- package/lib/infrastructure/portal-pages-service.js.map +1 -0
- package/lib/infrastructure/portal-project-service.d.ts +77 -0
- package/lib/infrastructure/portal-project-service.js +309 -0
- package/lib/infrastructure/portal-project-service.js.map +1 -0
- package/lib/infrastructure/service-error.d.ts +1 -0
- package/lib/infrastructure/service-error.js +39 -41
- package/lib/infrastructure/service-error.js.map +1 -1
- package/lib/infrastructure/services/api-client-factory.js +15 -13
- package/lib/infrastructure/services/api-client-factory.js.map +1 -1
- package/lib/infrastructure/services/api-service.d.ts +7 -5
- package/lib/infrastructure/services/api-service.js +28 -20
- package/lib/infrastructure/services/api-service.js.map +1 -1
- package/lib/infrastructure/services/auth-service.js +4 -9
- package/lib/infrastructure/services/auth-service.js.map +1 -1
- package/lib/infrastructure/services/file-download-service.js +3 -3
- package/lib/infrastructure/services/file-download-service.js.map +1 -1
- package/lib/infrastructure/services/plugin-service.d.ts +1 -8
- package/lib/infrastructure/services/plugin-service.js +11 -22
- package/lib/infrastructure/services/plugin-service.js.map +1 -1
- package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
- package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
- package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
- package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
- package/lib/infrastructure/services/portal-authorization-service.js +23 -0
- package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
- package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
- package/lib/infrastructure/services/publishing-api-service.js +11 -15
- package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
- package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
- package/lib/infrastructure/services/sdk-generation-service.js +118 -0
- package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.js +5 -4
- package/lib/infrastructure/services/telemetry-service.js.map +1 -1
- package/lib/infrastructure/services/transformation-service.js +29 -32
- package/lib/infrastructure/services/transformation-service.js.map +1 -1
- package/lib/infrastructure/services/validation-service.d.ts +12 -53
- package/lib/infrastructure/services/validation-service.js +24 -199
- package/lib/infrastructure/services/validation-service.js.map +1 -1
- package/lib/infrastructure/timer-extensions.d.ts +2 -0
- package/lib/infrastructure/timer-extensions.js +10 -0
- package/lib/infrastructure/timer-extensions.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +31 -1
- package/lib/infrastructure/tmp-extensions.js +86 -3
- package/lib/infrastructure/tmp-extensions.js.map +1 -1
- package/lib/infrastructure/zip-service.js +2 -2
- package/lib/infrastructure/zip-service.js.map +1 -1
- package/lib/prompts/api/validate.d.ts +6 -7
- package/lib/prompts/api/validate.js +12 -12
- package/lib/prompts/api/validate.js.map +1 -1
- package/lib/prompts/format.d.ts +4 -0
- package/lib/prompts/format.js +5 -0
- package/lib/prompts/format.js.map +1 -1
- package/lib/prompts/plugin/generate.d.ts +17 -12
- package/lib/prompts/plugin/generate.js +94 -44
- package/lib/prompts/plugin/generate.js.map +1 -1
- package/lib/prompts/plugin/publish.d.ts +2 -1
- package/lib/prompts/plugin/publish.js +8 -7
- package/lib/prompts/plugin/publish.js.map +1 -1
- package/lib/prompts/plugin/record-metadata.d.ts +1 -0
- package/lib/prompts/plugin/record-metadata.js +10 -7
- package/lib/prompts/plugin/record-metadata.js.map +1 -1
- package/lib/prompts/portal/artifacts.d.ts +8 -0
- package/lib/prompts/portal/artifacts.js +26 -0
- package/lib/prompts/portal/artifacts.js.map +1 -0
- package/lib/prompts/portal/authorization.d.ts +6 -0
- package/lib/prompts/portal/authorization.js +29 -0
- package/lib/prompts/portal/authorization.js.map +1 -0
- package/lib/prompts/portal/code-samples.d.ts +1 -0
- package/lib/prompts/portal/code-samples.js +9 -0
- package/lib/prompts/portal/code-samples.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +14 -9
- package/lib/prompts/portal/generate.js +48 -26
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/prepare-project.d.ts +20 -0
- package/lib/prompts/portal/prepare-project.js +36 -0
- package/lib/prompts/portal/prepare-project.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +32 -12
- package/lib/prompts/portal/serve.js +100 -39
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/source.d.ts +26 -0
- package/lib/prompts/portal/source.js +253 -0
- package/lib/prompts/portal/source.js.map +1 -0
- package/lib/prompts/prompt.d.ts +11 -3
- package/lib/prompts/prompt.js +39 -15
- package/lib/prompts/prompt.js.map +1 -1
- package/lib/prompts/quickstart.d.ts +46 -3
- package/lib/prompts/quickstart.js +193 -12
- package/lib/prompts/quickstart.js.map +1 -1
- package/lib/prompts/sdk/generate.d.ts +15 -13
- package/lib/prompts/sdk/generate.js +29 -32
- package/lib/prompts/sdk/generate.js.map +1 -1
- package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
- package/lib/prompts/sdk/publish/interactive.js +26 -24
- package/lib/prompts/sdk/publish/interactive.js.map +1 -1
- package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
- package/lib/prompts/sdk/publish/non-interactive.js +5 -4
- package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
- package/lib/prompts/sdk/publish.d.ts +3 -3
- package/lib/prompts/sdk/publish.js +13 -17
- package/lib/prompts/sdk/publish.js.map +1 -1
- package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
- package/lib/prompts/sdk/record-published-sdk.js +26 -0
- package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
- package/lib/types/apimatic-config/document.d.ts +68 -0
- package/lib/types/apimatic-config/document.js +161 -0
- package/lib/types/apimatic-config/document.js.map +1 -0
- package/lib/types/apimatic-config/languages-block.d.ts +39 -0
- package/lib/types/apimatic-config/languages-block.js +58 -0
- package/lib/types/apimatic-config/languages-block.js.map +1 -0
- package/lib/types/apimatic-config-context.d.ts +48 -0
- package/lib/types/apimatic-config-context.js +121 -0
- package/lib/types/apimatic-config-context.js.map +1 -0
- package/lib/types/build/build.d.ts +1 -89
- package/lib/types/build/build.js +6 -161
- package/lib/types/build/build.js.map +1 -1
- package/lib/types/events/domain-event.js +3 -0
- package/lib/types/events/domain-event.js.map +1 -1
- package/lib/types/events/quickstart-completed.js +3 -3
- package/lib/types/events/quickstart-completed.js.map +1 -1
- package/lib/types/events/quickstart-initiated.js +3 -3
- package/lib/types/events/quickstart-initiated.js.map +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
- package/lib/types/file/directory.d.ts +4 -9
- package/lib/types/file/directory.js +17 -65
- package/lib/types/file/directory.js.map +1 -1
- package/lib/types/file/directoryPath.d.ts +17 -0
- package/lib/types/file/directoryPath.js +47 -2
- package/lib/types/file/directoryPath.js.map +1 -1
- package/lib/types/file/fileName.d.ts +8 -0
- package/lib/types/file/fileName.js +28 -6
- package/lib/types/file/fileName.js.map +1 -1
- package/lib/types/file/filePath.d.ts +18 -2
- package/lib/types/file/filePath.js +39 -4
- package/lib/types/file/filePath.js.map +1 -1
- package/lib/types/file/resource-input.js +1 -2
- package/lib/types/file/resource-input.js.map +1 -1
- package/lib/types/file/urlPath.js +2 -1
- package/lib/types/file/urlPath.js.map +1 -1
- package/lib/types/flags-provider.js +22 -22
- package/lib/types/flags-provider.js.map +1 -1
- package/lib/types/package-settings-context.js +2 -1
- package/lib/types/package-settings-context.js.map +1 -1
- package/lib/types/plugin/plugin-config.d.ts +10 -50
- package/lib/types/plugin/plugin-config.js +7 -1
- package/lib/types/plugin/plugin-config.js.map +1 -1
- package/lib/types/plugin-config-context.d.ts +30 -37
- package/lib/types/plugin-config-context.js +108 -139
- package/lib/types/plugin-config-context.js.map +1 -1
- package/lib/types/plugin-context.js +3 -2
- package/lib/types/plugin-context.js.map +1 -1
- package/lib/types/portal/code-samples.d.ts +27 -0
- package/lib/types/portal/code-samples.js +67 -0
- package/lib/types/portal/code-samples.js.map +1 -0
- package/lib/types/portal/config/ai-config.d.ts +15 -0
- package/lib/types/portal/config/ai-config.js +26 -0
- package/lib/types/portal/config/ai-config.js.map +1 -0
- package/lib/types/portal/config/brand-config.d.ts +55 -0
- package/lib/types/portal/config/brand-config.js +105 -0
- package/lib/types/portal/config/brand-config.js.map +1 -0
- package/lib/types/portal/config/color.d.ts +19 -0
- package/lib/types/portal/config/color.js +43 -0
- package/lib/types/portal/config/color.js.map +1 -0
- package/lib/types/portal/config/fields.d.ts +23 -0
- package/lib/types/portal/config/fields.js +67 -0
- package/lib/types/portal/config/fields.js.map +1 -0
- package/lib/types/portal/config/link.d.ts +18 -0
- package/lib/types/portal/config/link.js +72 -0
- package/lib/types/portal/config/link.js.map +1 -0
- package/lib/types/portal/config/navigation-config.d.ts +13 -0
- package/lib/types/portal/config/navigation-config.js +30 -0
- package/lib/types/portal/config/navigation-config.js.map +1 -0
- package/lib/types/portal/config/site-config.d.ts +32 -0
- package/lib/types/portal/config/site-config.js +88 -0
- package/lib/types/portal/config/site-config.js.map +1 -0
- package/lib/types/portal/config/static-asset.d.ts +25 -0
- package/lib/types/portal/config/static-asset.js +77 -0
- package/lib/types/portal/config/static-asset.js.map +1 -0
- package/lib/types/portal/content-notices.d.ts +20 -0
- package/lib/types/portal/content-notices.js +2 -0
- package/lib/types/portal/content-notices.js.map +1 -0
- package/lib/types/portal/content-tree.d.ts +103 -0
- package/lib/types/portal/content-tree.js +344 -0
- package/lib/types/portal/content-tree.js.map +1 -0
- package/lib/types/portal/endpoint.d.ts +6 -0
- package/lib/types/portal/endpoint.js +12 -0
- package/lib/types/portal/endpoint.js.map +1 -0
- package/lib/types/portal/generated-pages.d.ts +68 -0
- package/lib/types/portal/generated-pages.js +111 -0
- package/lib/types/portal/generated-pages.js.map +1 -0
- package/lib/types/portal/generation-status.d.ts +31 -0
- package/lib/types/portal/generation-status.js +26 -0
- package/lib/types/portal/generation-status.js.map +1 -0
- package/lib/types/portal/openapi-document.d.ts +48 -0
- package/lib/types/portal/openapi-document.js +138 -0
- package/lib/types/portal/openapi-document.js.map +1 -0
- package/lib/types/portal/page-fragments.d.ts +13 -0
- package/lib/types/portal/page-fragments.js +24 -0
- package/lib/types/portal/page-fragments.js.map +1 -0
- package/lib/types/portal/page-template.d.ts +15 -0
- package/lib/types/portal/page-template.js +64 -0
- package/lib/types/portal/page-template.js.map +1 -0
- package/lib/types/portal/page.d.ts +24 -0
- package/lib/types/portal/page.js +100 -0
- package/lib/types/portal/page.js.map +1 -0
- package/lib/types/portal/portal-artifacts.d.ts +25 -0
- package/lib/types/portal/portal-artifacts.js +30 -0
- package/lib/types/portal/portal-artifacts.js.map +1 -0
- package/lib/types/portal/portal-config.d.ts +69 -0
- package/lib/types/portal/portal-config.js +105 -0
- package/lib/types/portal/portal-config.js.map +1 -0
- package/lib/types/portal/portal-downloads.d.ts +8 -0
- package/lib/types/portal/portal-downloads.js +14 -0
- package/lib/types/portal/portal-downloads.js.map +1 -0
- package/lib/types/portal/portal-languages.d.ts +15 -0
- package/lib/types/portal/portal-languages.js +45 -0
- package/lib/types/portal/portal-languages.js.map +1 -0
- package/lib/types/portal/portal-navigation.d.ts +65 -0
- package/lib/types/portal/portal-navigation.js +217 -0
- package/lib/types/portal/portal-navigation.js.map +1 -0
- package/lib/types/portal/portal-sdk.d.ts +15 -0
- package/lib/types/portal/portal-sdk.js +28 -0
- package/lib/types/portal/portal-sdk.js.map +1 -0
- package/lib/types/portal/portal-source.d.ts +129 -0
- package/lib/types/portal/portal-source.js +2 -0
- package/lib/types/portal/portal-source.js.map +1 -0
- package/lib/types/portal/portal-stylesheet.d.ts +19 -0
- package/lib/types/portal/portal-stylesheet.js +40 -0
- package/lib/types/portal/portal-stylesheet.js.map +1 -0
- package/lib/types/portal/portal-tabs.d.ts +33 -0
- package/lib/types/portal/portal-tabs.js +38 -0
- package/lib/types/portal/portal-tabs.js.map +1 -0
- package/lib/types/portal/preview-config.d.ts +20 -0
- package/lib/types/portal/preview-config.js +32 -0
- package/lib/types/portal/preview-config.js.map +1 -0
- package/lib/types/portal/preview-content.d.ts +18 -0
- package/lib/types/portal/preview-content.js +50 -0
- package/lib/types/portal/preview-content.js.map +1 -0
- package/lib/types/portal/published-package.d.ts +12 -0
- package/lib/types/portal/published-package.js +35 -0
- package/lib/types/portal/published-package.js.map +1 -0
- package/lib/types/portal/unknown-fields.d.ts +5 -0
- package/lib/types/portal/unknown-fields.js +10 -0
- package/lib/types/portal/unknown-fields.js.map +1 -0
- package/lib/types/portal-context.d.ts +38 -6
- package/lib/types/portal-context.js +71 -24
- package/lib/types/portal-context.js.map +1 -1
- package/lib/types/portal-source-context.d.ts +77 -0
- package/lib/types/portal-source-context.js +408 -0
- package/lib/types/portal-source-context.js.map +1 -0
- package/lib/types/project-context.d.ts +49 -0
- package/lib/types/project-context.js +151 -0
- package/lib/types/project-context.js.map +1 -0
- package/lib/types/project-layout.d.ts +9 -0
- package/lib/types/project-layout.js +10 -0
- package/lib/types/project-layout.js.map +1 -0
- package/lib/types/publish/package-settings-configuration.d.ts +2 -0
- package/lib/types/publish/profile-id.js +1 -0
- package/lib/types/publish/profile-id.js.map +1 -1
- package/lib/types/publish/publishing-profile.d.ts +3 -1
- package/lib/types/publish/publishing-profile.js +33 -15
- package/lib/types/publish/publishing-profile.js.map +1 -1
- package/lib/types/publish/publishing-profiles.js +2 -1
- package/lib/types/publish/publishing-profiles.js.map +1 -1
- package/lib/types/publish/version.js +1 -0
- package/lib/types/publish/version.js.map +1 -1
- package/lib/types/resource-context.js +3 -2
- package/lib/types/resource-context.js.map +1 -1
- package/lib/types/sdk/generate.d.ts +22 -16
- package/lib/types/sdk/generate.js +64 -41
- package/lib/types/sdk/generate.js.map +1 -1
- package/lib/types/sdk/stability-choice.d.ts +12 -0
- package/lib/types/sdk/stability-choice.js +24 -0
- package/lib/types/sdk/stability-choice.js.map +1 -0
- package/lib/types/sdk-context.d.ts +4 -5
- package/lib/types/sdk-context.js +10 -18
- package/lib/types/sdk-context.js.map +1 -1
- package/lib/types/spec-context.d.ts +5 -4
- package/lib/types/spec-context.js +9 -8
- package/lib/types/spec-context.js.map +1 -1
- package/lib/types/temp-context.d.ts +1 -1
- package/lib/types/temp-context.js +5 -4
- package/lib/types/temp-context.js.map +1 -1
- package/lib/types/transform-context.d.ts +9 -5
- package/lib/types/transform-context.js +21 -18
- package/lib/types/transform-context.js.map +1 -1
- package/lib/utils/error-utils.d.ts +2 -0
- package/lib/utils/error-utils.js +5 -0
- package/lib/utils/error-utils.js.map +1 -0
- package/lib/utils/json-utils.d.ts +2 -0
- package/lib/utils/json-utils.js +4 -0
- package/lib/utils/json-utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +8 -1
- package/lib/utils/string-utils.js +13 -26
- package/lib/utils/string-utils.js.map +1 -1
- package/lib/utils/utils.d.ts +1 -3
- package/lib/utils/utils.js +12 -40
- package/lib/utils/utils.js.map +1 -1
- package/oclif.manifest.json +154 -442
- package/package.json +47 -25
- package/portal-pages/context-plugin.mdx +26 -0
- package/portal-pages/sdk.mdx +8 -0
- package/portal-pages/sdks.mdx +11 -0
- package/portal-template/NOTICE +37 -0
- package/portal-template/downloads.ts +41 -0
- package/portal-template/generated-pages-reload.ts +51 -0
- package/portal-template/package.json +11 -0
- package/portal-template/portal-config.ts +32 -0
- package/portal-template/prerender-pages.ts +81 -0
- package/portal-template/spec-reload.ts +26 -0
- package/portal-template/src/components/api-page.tsx +15 -0
- package/portal-template/src/components/code-block.tsx +9 -0
- package/portal-template/src/components/command-block.tsx +50 -0
- package/portal-template/src/components/example-layout.tsx +99 -0
- package/portal-template/src/components/logos.tsx +127 -0
- package/portal-template/src/components/mdx.tsx +28 -0
- package/portal-template/src/components/not-found.tsx +11 -0
- package/portal-template/src/components/plugin-install.tsx +22 -0
- package/portal-template/src/components/plugin-support.tsx +53 -0
- package/portal-template/src/components/sdk-actions.tsx +79 -0
- package/portal-template/src/components/sdk-cards.tsx +100 -0
- package/portal-template/src/components/search.tsx +41 -0
- package/portal-template/src/components/usage-tabs.tsx +92 -0
- package/portal-template/src/lib/code-samples.server.ts +40 -0
- package/portal-template/src/lib/code-samples.ts +43 -0
- package/portal-template/src/lib/code-titles.ts +29 -0
- package/portal-template/src/lib/install-command.ts +13 -0
- package/portal-template/src/lib/json.ts +5 -0
- package/portal-template/src/lib/layout.shared.tsx +41 -0
- package/portal-template/src/lib/layout.tsx +16 -0
- package/portal-template/src/lib/llms.server.ts +54 -0
- package/portal-template/src/lib/media-adapters.ts +34 -0
- package/portal-template/src/lib/navigation.ts +406 -0
- package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
- package/portal-template/src/lib/openapi-filter.ts +191 -0
- package/portal-template/src/lib/openapi-labels.ts +15 -0
- package/portal-template/src/lib/openapi-methods.ts +12 -0
- package/portal-template/src/lib/openapi-section.server.ts +280 -0
- package/portal-template/src/lib/openapi-slim.ts +202 -0
- package/portal-template/src/lib/openapi.server.ts +16 -0
- package/portal-template/src/lib/portal-types.ts +36 -0
- package/portal-template/src/lib/portal.server.ts +13 -0
- package/portal-template/src/lib/portal.ts +11 -0
- package/portal-template/src/lib/rehype-code-titles.ts +53 -0
- package/portal-template/src/lib/request-examples.ts +72 -0
- package/portal-template/src/lib/seo.ts +21 -0
- package/portal-template/src/lib/shared.ts +51 -0
- package/portal-template/src/lib/shiki-bundle.ts +104 -0
- package/portal-template/src/lib/sitemap.server.ts +20 -0
- package/portal-template/src/lib/source.server.ts +27 -0
- package/portal-template/src/lib/source.ts +49 -0
- package/portal-template/src/lib/tabs.ts +37 -0
- package/portal-template/src/router.tsx +12 -0
- package/portal-template/src/routes/$.tsx +194 -0
- package/portal-template/src/routes/__root.tsx +56 -0
- package/portal-template/src/routes/api/search[.]json.ts +9 -0
- package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
- package/portal-template/src/routes/llms[.]txt.ts +10 -0
- package/portal-template/src/routes/robots[.]txt.ts +10 -0
- package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
- package/portal-template/src/routes/spa-shell.tsx +7 -0
- package/portal-template/src/routes/{$}[.]md.ts +21 -0
- package/portal-template/src/styles/app.css +33 -0
- package/portal-template/tsconfig.json +26 -0
- package/portal-template/vite.config.ts +68 -0
- package/lib/actions/plugin/record-sdk.d.ts +0 -14
- package/lib/actions/plugin/record-sdk.js +0 -60
- package/lib/actions/plugin/record-sdk.js.map +0 -1
- package/lib/actions/portal/copilot.d.ts +0 -17
- package/lib/actions/portal/copilot.js +0 -89
- package/lib/actions/portal/copilot.js.map +0 -1
- package/lib/actions/portal/quickstart.d.ts +0 -18
- package/lib/actions/portal/quickstart.js +0 -238
- package/lib/actions/portal/quickstart.js.map +0 -1
- package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
- package/lib/actions/portal/recipe/new-recipe.js +0 -177
- package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
- package/lib/actions/portal/toc/new-toc.d.ts +0 -21
- package/lib/actions/portal/toc/new-toc.js +0 -95
- package/lib/actions/portal/toc/new-toc.js.map +0 -1
- package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
- package/lib/actions/sdk/merge-source-tree.js +0 -78
- package/lib/actions/sdk/merge-source-tree.js.map +0 -1
- package/lib/actions/sdk/quickstart.d.ts +0 -18
- package/lib/actions/sdk/quickstart.js +0 -188
- package/lib/actions/sdk/quickstart.js.map +0 -1
- package/lib/actions/sdk/save-changes.d.ts +0 -8
- package/lib/actions/sdk/save-changes.js +0 -93
- package/lib/actions/sdk/save-changes.js.map +0 -1
- package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
- package/lib/application/portal/recipe/portal-recipe.js +0 -33
- package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
- package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
- package/lib/application/portal/recipe/recipe-generator.js +0 -130
- package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
- package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
- package/lib/application/portal/toc/toc-content-parser.js +0 -44
- package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
- package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
- package/lib/application/portal/toc/toc-structure-generator.js +0 -165
- package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
- package/lib/commands/portal/copilot.d.ts +0 -13
- package/lib/commands/portal/copilot.js +0 -34
- package/lib/commands/portal/copilot.js.map +0 -1
- package/lib/commands/portal/recipe/new.d.ts +0 -12
- package/lib/commands/portal/recipe/new.js +0 -45
- package/lib/commands/portal/recipe/new.js.map +0 -1
- package/lib/commands/portal/toc/new.d.ts +0 -16
- package/lib/commands/portal/toc/new.js +0 -68
- package/lib/commands/portal/toc/new.js.map +0 -1
- package/lib/commands/sdk/save-changes.d.ts +0 -14
- package/lib/commands/sdk/save-changes.js +0 -51
- package/lib/commands/sdk/save-changes.js.map +0 -1
- package/lib/infrastructure/debounce-service.d.ts +0 -10
- package/lib/infrastructure/debounce-service.js +0 -55
- package/lib/infrastructure/debounce-service.js.map +0 -1
- package/lib/infrastructure/services/portal-service.d.ts +0 -43
- package/lib/infrastructure/services/portal-service.js +0 -337
- package/lib/infrastructure/services/portal-service.js.map +0 -1
- package/lib/prompts/plugin/record-sdk.d.ts +0 -9
- package/lib/prompts/plugin/record-sdk.js +0 -40
- package/lib/prompts/plugin/record-sdk.js.map +0 -1
- package/lib/prompts/portal/copilot.d.ts +0 -18
- package/lib/prompts/portal/copilot.js +0 -82
- package/lib/prompts/portal/copilot.js.map +0 -1
- package/lib/prompts/portal/quickstart.d.ts +0 -42
- package/lib/prompts/portal/quickstart.js +0 -243
- package/lib/prompts/portal/quickstart.js.map +0 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
- package/lib/prompts/portal/recipe/new-recipe.js +0 -165
- package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
- package/lib/prompts/portal/toc/new-toc.js +0 -50
- package/lib/prompts/portal/toc/new-toc.js.map +0 -1
- package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
- package/lib/prompts/sdk/merge-source-tree.js +0 -90
- package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
- package/lib/prompts/sdk/quickstart.d.ts +0 -38
- package/lib/prompts/sdk/quickstart.js +0 -196
- package/lib/prompts/sdk/quickstart.js.map +0 -1
- package/lib/prompts/sdk/save-changes.d.ts +0 -21
- package/lib/prompts/sdk/save-changes.js +0 -84
- package/lib/prompts/sdk/save-changes.js.map +0 -1
- package/lib/types/build-context.d.ts +0 -26
- package/lib/types/build-context.js +0 -111
- package/lib/types/build-context.js.map +0 -1
- package/lib/types/events/recipe-creation-failed.d.ts +0 -5
- package/lib/types/events/recipe-creation-failed.js +0 -8
- package/lib/types/events/recipe-creation-failed.js.map +0 -1
- package/lib/types/events/sdk-changes-saved.d.ts +0 -8
- package/lib/types/events/sdk-changes-saved.js +0 -11
- package/lib/types/events/sdk-changes-saved.js.map +0 -1
- package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
- package/lib/types/events/sdk-changes-tracked.js +0 -11
- package/lib/types/events/sdk-changes-tracked.js.map +0 -1
- package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
- package/lib/types/events/sdk-conflicts-resolved.js +0 -11
- package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
- package/lib/types/events/toc-creation-failed.d.ts +0 -5
- package/lib/types/events/toc-creation-failed.js +0 -8
- package/lib/types/events/toc-creation-failed.js.map +0 -1
- package/lib/types/merge-source-tree-context.d.ts +0 -28
- package/lib/types/merge-source-tree-context.js +0 -63
- package/lib/types/merge-source-tree-context.js.map +0 -1
- package/lib/types/plugin/language-entry.d.ts +0 -9
- package/lib/types/plugin/language-entry.js +0 -64
- package/lib/types/plugin/language-entry.js.map +0 -1
- package/lib/types/recipe/recipe.d.ts +0 -22
- package/lib/types/recipe/recipe.js +0 -6
- package/lib/types/recipe/recipe.js.map +0 -1
- package/lib/types/recipe-context.d.ts +0 -9
- package/lib/types/recipe-context.js +0 -26
- package/lib/types/recipe-context.js.map +0 -1
- package/lib/types/save-changes-context.d.ts +0 -17
- package/lib/types/save-changes-context.js +0 -42
- package/lib/types/save-changes-context.js.map +0 -1
- package/lib/types/sdl/sdl.d.ts +0 -10
- package/lib/types/sdl/sdl.js +0 -18
- package/lib/types/sdl/sdl.js.map +0 -1
- package/lib/types/toc/toc-components.d.ts +0 -36
- package/lib/types/toc/toc-components.js +0 -94
- package/lib/types/toc/toc-components.js.map +0 -1
- package/lib/types/toc/toc.d.ts +0 -67
- package/lib/types/toc/toc.js +0 -2
- package/lib/types/toc/toc.js.map +0 -1
- package/lib/types/toc-context.d.ts +0 -12
- package/lib/types/toc-context.js +0 -26
- package/lib/types/toc-context.js.map +0 -1
|
@@ -1,25 +1,206 @@
|
|
|
1
|
-
import { isCancel, log, select } from
|
|
1
|
+
import { isCancel, log, multiselect, select, text } from '@clack/prompts';
|
|
2
|
+
import { UrlPath } from '../types/file/urlPath.js';
|
|
3
|
+
import { format as f, getTree } from './format.js';
|
|
4
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
5
|
+
import { createResourceInputFromInput } from '../types/file/resource-input.js';
|
|
6
|
+
import { APIMATIC_CONFIG_FILE_NAME } from '../types/apimatic-config/document.js';
|
|
7
|
+
import { GENERATED, GITIGNORE } from '../types/project-context.js';
|
|
8
|
+
import { AVAILABLE_LANGUAGES, languageLabel, UPCOMING_LANGUAGES } from '../types/sdk/generate.js';
|
|
9
|
+
import { noteWrapped, withSpinner } from './prompt.js';
|
|
10
|
+
import { reportAuthorizationFailure } from './portal/authorization.js';
|
|
11
|
+
import { convertToOpenApi3 } from './portal/source.js';
|
|
12
|
+
const vscodeExtensionUrl = 'https://marketplace.visualstudio.com/items?itemName=apimatic-developers.apimatic-for-vscode';
|
|
2
13
|
export class QuickstartPrompts {
|
|
3
14
|
welcomeMessage() {
|
|
4
|
-
log.
|
|
5
|
-
|
|
15
|
+
log.message(`This wizard will walk you through creating your API Documentation
|
|
16
|
+
Portal, SDKs and Context Plugins.
|
|
6
17
|
Let's get started!`);
|
|
7
18
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
19
|
+
importSpecStep() {
|
|
20
|
+
log.info(`Step 1 of 3: Import your OpenAPI Definition`);
|
|
21
|
+
}
|
|
22
|
+
/** The project came with its own source directory, so there is nothing to import into it. */
|
|
23
|
+
importSpecStepAdopted(sourceDirectory) {
|
|
24
|
+
log.info(`Step 1 of 3: Using the OpenAPI Definition already in ${f.path(sourceDirectory)}`);
|
|
25
|
+
}
|
|
26
|
+
/** `defaultSpecUrl` is null once the sample has failed to download; it is not offered again. */
|
|
27
|
+
async specPathPrompt(defaultSpecUrl) {
|
|
28
|
+
const spec = await text({
|
|
29
|
+
message: `Provide a local path or a public URL for your OpenAPI Definition file:`,
|
|
30
|
+
placeholder: defaultSpecUrl
|
|
31
|
+
? 'Provide absolute URL/local path or press Enter to use a sample OpenAPI file from APIMatic.'
|
|
32
|
+
: 'Provide an absolute URL or local path to your OpenAPI Definition file.',
|
|
33
|
+
...(defaultSpecUrl === null ? {} : { defaultValue: defaultSpecUrl.toString() }),
|
|
34
|
+
validate: (value) => {
|
|
35
|
+
if (!value && defaultSpecUrl === null) {
|
|
36
|
+
return 'Please enter a file path or URL.';
|
|
37
|
+
}
|
|
38
|
+
if (value && !createResourceInputFromInput(value)) {
|
|
39
|
+
return 'Please enter a valid file path or URL.';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (isCancel(spec)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
return createResourceInputFromInput(spec);
|
|
47
|
+
}
|
|
48
|
+
specFormatUnsupported(specPath, format) {
|
|
49
|
+
const message = `${f.path(specPath)} is ${format}, not OpenAPI 3.x. ` + convertToOpenApi3();
|
|
50
|
+
log.error(message);
|
|
51
|
+
}
|
|
52
|
+
/** For a document that names no format at all: a Postman collection, a RAML file, arbitrary JSON. */
|
|
53
|
+
specNotRecognised(specPath) {
|
|
54
|
+
const message = `${f.path(specPath)} is not an OpenAPI 3.x document. ` + convertToOpenApi3();
|
|
55
|
+
log.error(message);
|
|
56
|
+
}
|
|
57
|
+
runtimeUnsupported(reason) {
|
|
58
|
+
log.error(reason);
|
|
59
|
+
}
|
|
60
|
+
specFileDoesNotExist() {
|
|
61
|
+
log.error('The specified file does not exist or is not a valid file. Please enter a valid file path.');
|
|
62
|
+
}
|
|
63
|
+
noSpecSpecified() {
|
|
64
|
+
log.error('No API Definition was provided.');
|
|
65
|
+
}
|
|
66
|
+
async useDefaultSpecPrompt() {
|
|
67
|
+
const useDefaultSpec = await select({
|
|
68
|
+
message: `How would you like to proceed?`,
|
|
11
69
|
options: [
|
|
12
|
-
{
|
|
13
|
-
|
|
70
|
+
{
|
|
71
|
+
value: 'no',
|
|
72
|
+
label: `1. Fix the issues`
|
|
73
|
+
},
|
|
74
|
+
{ value: 'yes', label: `2. Use an example API spec instead (recommended)` }
|
|
14
75
|
]
|
|
15
76
|
});
|
|
16
|
-
if (isCancel(
|
|
77
|
+
if (isCancel(useDefaultSpec)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return useDefaultSpec === 'yes';
|
|
81
|
+
}
|
|
82
|
+
fixYourSpec() {
|
|
83
|
+
const message = `Good luck fixing your API Definition! Feel free to run this command again once you're done.`;
|
|
84
|
+
log.info(message);
|
|
85
|
+
}
|
|
86
|
+
validateSpecStep() {
|
|
87
|
+
log.info(`Step 2 of 3: Validate and Lint your OpenAPI Definition`);
|
|
88
|
+
}
|
|
89
|
+
specValidationFailed(spec) {
|
|
90
|
+
log.error(`Oops, it looks like there are some errors in your API Definition`);
|
|
91
|
+
// A placeholder rather than the user's own path or URL, which no quoting survives every shell with.
|
|
92
|
+
const specFlag = spec instanceof UrlPath ? f.flag('url', '<url>') : f.flag('file', '<path>');
|
|
93
|
+
const validateCommand = `${f.cmdAlt('apimatic', 'api', 'validate')} ${specFlag}`;
|
|
94
|
+
const message = [
|
|
95
|
+
`Ask an AI coding agent to run this command and fix what it reports:`,
|
|
96
|
+
validateCommand,
|
|
97
|
+
'',
|
|
98
|
+
`Or use APIMatic's interactive VS Code Extension:`,
|
|
99
|
+
f.link(vscodeExtensionUrl)
|
|
100
|
+
].join('\n');
|
|
101
|
+
noteWrapped(message, 'How to fix');
|
|
102
|
+
}
|
|
103
|
+
createPortalStep() {
|
|
104
|
+
log.info(`Step 3 of 3: Create your portal`);
|
|
105
|
+
}
|
|
106
|
+
authorizationFailed(failure) {
|
|
107
|
+
reportAuthorizationFailure(failure);
|
|
108
|
+
}
|
|
109
|
+
async projectDirectoryPrompt() {
|
|
110
|
+
const projectDirectory = await text({
|
|
111
|
+
message: 'Enter the directory path where you would like to setup the API Portal (must be empty, apart from hidden files such as .git):',
|
|
112
|
+
placeholder: 'Provide absolute path to the directory or press Enter to use the current directory.',
|
|
113
|
+
defaultValue: './'
|
|
114
|
+
});
|
|
115
|
+
if (isCancel(projectDirectory)) {
|
|
17
116
|
return undefined;
|
|
18
117
|
}
|
|
19
|
-
return
|
|
118
|
+
return DirectoryPath.fromUserInput(projectDirectory);
|
|
119
|
+
}
|
|
120
|
+
projectDirectoryDoesNotExist(projectDirectory) {
|
|
121
|
+
log.error(`The specified directory path ${f.path(projectDirectory)} does not exist.`);
|
|
122
|
+
}
|
|
123
|
+
projectDirectoryNotEmpty(projectDirectory) {
|
|
124
|
+
const message = `The target directory ${f.path(projectDirectory)} is not empty. ` +
|
|
125
|
+
`Please provide a path to an empty directory or clear its contents.`;
|
|
126
|
+
log.error(message);
|
|
127
|
+
}
|
|
128
|
+
noProjectDirectoryProvided() {
|
|
129
|
+
log.error('No directory was specified.');
|
|
130
|
+
}
|
|
131
|
+
scaffoldFailed(problem, sourceDirectory) {
|
|
132
|
+
switch (problem.kind) {
|
|
133
|
+
case 'configUnreadable': {
|
|
134
|
+
const message = `${f.var(APIMATIC_CONFIG_FILE_NAME)} is already in ${f.path(sourceDirectory)} and could not be read, ` +
|
|
135
|
+
`so the portal was not written into it.`;
|
|
136
|
+
log.error(message);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
case 'configUnwritable': {
|
|
140
|
+
log.error(`${f.var(APIMATIC_CONFIG_FILE_NAME)} could not be written to ${f.path(sourceDirectory)}.`);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
case 'sourceUnwritable': {
|
|
144
|
+
log.error(`${f.path(sourceDirectory)} could not be written: ${problem.reason}`);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
downloadSpecFile(fn) {
|
|
150
|
+
return withSpinner('Downloading API Definition', `API Definition downloaded`, 'Unable to download API Definition', fn);
|
|
151
|
+
}
|
|
152
|
+
nextSteps(configFile) {
|
|
153
|
+
const message = [
|
|
154
|
+
`Change the name, logo and colours in the ${f.var('portal')} block of ${f.path(configFile)}; ` +
|
|
155
|
+
`your editor completes and checks it.`,
|
|
156
|
+
`Set ${f.var('portal.site.url')} to your hosting address for canonical links and a sitemap.`,
|
|
157
|
+
`Add Markdown pages under ${f.var('src/content')}; the preview reloads as you edit them.`,
|
|
158
|
+
`Run ${f.cmdAlt('apimatic', 'portal', 'generate')} to produce static files you can host.`
|
|
159
|
+
].join('\n');
|
|
160
|
+
noteWrapped(message, 'Next Steps');
|
|
161
|
+
}
|
|
162
|
+
serviceError(serviceError) {
|
|
163
|
+
log.error(serviceError.errorMessage);
|
|
164
|
+
}
|
|
165
|
+
/** Names the address that failed: without it the same message repeats for every retry. */
|
|
166
|
+
specDownloadFailed(url, serviceError) {
|
|
167
|
+
log.error(`${serviceError.errorMessage} Could not download ${f.link(url.toString())}.`);
|
|
168
|
+
}
|
|
169
|
+
printDirectoryStructure(projectDirectory, structure) {
|
|
170
|
+
const heading = `${f.var('src')} directory containing source files created at ${f.path(projectDirectory)}\n`;
|
|
171
|
+
const message = getTree(structure.toTreeNode());
|
|
172
|
+
log.info(heading + message);
|
|
173
|
+
}
|
|
174
|
+
// Everything is checked: a first portal covering every language it can is the answer one Enter gives.
|
|
175
|
+
async selectLanguages() {
|
|
176
|
+
const selected = await multiselect({
|
|
177
|
+
message: 'Which languages should your portal include?',
|
|
178
|
+
options: AVAILABLE_LANGUAGES.map((language) => ({ value: language, label: languageLabel(language) })),
|
|
179
|
+
initialValues: [...AVAILABLE_LANGUAGES],
|
|
180
|
+
required: false
|
|
181
|
+
});
|
|
182
|
+
if (isCancel(selected)) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
log.message(f.hint(`${UPCOMING_LANGUAGES.map(languageLabel).join(', ')} are coming soon`));
|
|
186
|
+
return selected;
|
|
187
|
+
}
|
|
188
|
+
noLanguagesSelected() {
|
|
189
|
+
log.warn('No languages selected. Exiting without building a portal.');
|
|
190
|
+
}
|
|
191
|
+
configNotWritten(failure, sourceDirectory) {
|
|
192
|
+
const problem = failure === 'unreadable' ? 'read' : 'written';
|
|
193
|
+
const message = `${f.var(APIMATIC_CONFIG_FILE_NAME)} in ${f.path(sourceDirectory)} could not be ${problem}, ` +
|
|
194
|
+
`so the languages you chose were not recorded. Check that it can be ${problem} and try again.`;
|
|
195
|
+
log.error(message);
|
|
20
196
|
}
|
|
21
|
-
|
|
22
|
-
|
|
197
|
+
/** A warning, not an error: the portal is already written, and Git tracking it does not stop a build. */
|
|
198
|
+
gitignoreNotUpdated(failure, projectDirectory) {
|
|
199
|
+
const problem = failure === 'unreadable' ? 'read' : 'written';
|
|
200
|
+
const message = `${f.var(GITIGNORE)} in ${f.path(projectDirectory)} could not be ${problem}, so ` +
|
|
201
|
+
`${GENERATED.map((entry) => f.var(entry)).join(', ')} were not added to it. ` +
|
|
202
|
+
`Add them yourself, or Git will track everything the CLI generates.`;
|
|
203
|
+
log.warn(message);
|
|
23
204
|
}
|
|
24
205
|
}
|
|
25
206
|
//# sourceMappingURL=quickstart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../src/prompts/quickstart.ts"],"names":[],"mappings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CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,MAAM,OAAO,GACX,GAAG,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,OAAO,IAAI;YAC7F,sEAAsE,OAAO,iBAAiB,CAAC;QACjG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAED,yGAAyG;IAClG,mBAAmB,CAAC,OAAyB,EAAE,gBAA+B;QACnF,MAAM,OAAO,GAAG,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,MAAM,OAAO,GACX,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,OAAO,OAAO;YACjF,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB;YAC7E,oEAAoE,CAAC;QACvE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { Result } from
|
|
3
|
-
import { ServiceError } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
2
|
+
import { Result } from 'neverthrow';
|
|
3
|
+
import { ServiceError } from '../../infrastructure/service-error.js';
|
|
4
|
+
import { Language } from '../../types/sdk/generate.js';
|
|
5
|
+
import { VersionProblem } from '../../types/project-context.js';
|
|
6
6
|
export declare class SdkGeneratePrompts {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Named rather than listed as flag values: a user whose language is on its way back reads
|
|
9
|
+
* something different from one who mistyped, and neither is told to reach for a generator
|
|
10
|
+
* version that no longer exists.
|
|
11
|
+
*/
|
|
12
|
+
languageNotAvailable(language: Language): void;
|
|
8
13
|
overwriteSdk(directory: DirectoryPath): Promise<boolean>;
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
sameSourceAndSdkDir(directory: DirectoryPath): void;
|
|
15
|
+
sourceDirectoryEmpty(directory: DirectoryPath): void;
|
|
11
16
|
specDirectoryEmpty(directory: DirectoryPath): void;
|
|
12
17
|
destinationDirNotEmpty(): void;
|
|
13
|
-
|
|
14
|
-
generateV4SDK(fn: Promise<Result<NodeJS.ReadableStream, ServiceError>>): Promise<Result<NodeJS.ReadableStream, ServiceError>>;
|
|
18
|
+
generateSdk(fn: Promise<Result<NodeJS.ReadableStream, ServiceError>>): Promise<Result<NodeJS.ReadableStream, ServiceError>>;
|
|
15
19
|
sdkGenerationServiceError(serviceError: ServiceError): void;
|
|
16
|
-
|
|
20
|
+
noVersionToBuild(problem: VersionProblem, sourceDirectory: DirectoryPath): void;
|
|
17
21
|
apiVersionOnlyApplicableWithVersionedBuild(): void;
|
|
18
|
-
versionNotFound(): void;
|
|
19
22
|
selectVersion(versions: string[]): Promise<string | undefined>;
|
|
20
23
|
sdkGenerated(sdk: DirectoryPath): void;
|
|
21
|
-
sdkCustomizationsNotSupportedForV4(): void;
|
|
22
24
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { isCancel, confirm, log, select } from
|
|
2
|
-
import { format as f } from
|
|
3
|
-
import { withSpinner } from
|
|
4
|
-
import {
|
|
1
|
+
import { isCancel, confirm, log, select } from '@clack/prompts';
|
|
2
|
+
import { format as f } from '../format.js';
|
|
3
|
+
import { withSpinner } from '../prompt.js';
|
|
4
|
+
import { AVAILABLE_LANGUAGES, languageLabel, UPCOMING_LANGUAGES } from '../../types/sdk/generate.js';
|
|
5
|
+
const names = (languages) => languages.map(languageLabel).join(', ');
|
|
5
6
|
export class SdkGeneratePrompts {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Named rather than listed as flag values: a user whose language is on its way back reads
|
|
9
|
+
* something different from one who mistyped, and neither is told to reach for a generator
|
|
10
|
+
* version that no longer exists.
|
|
11
|
+
*/
|
|
12
|
+
languageNotAvailable(language) {
|
|
13
|
+
log.error(`${languageLabel(language)} isn't available yet.\n` +
|
|
14
|
+
`Available now: ${names(AVAILABLE_LANGUAGES)}\n` +
|
|
15
|
+
`Coming soon: ${names(UPCOMING_LANGUAGES)}`);
|
|
11
16
|
}
|
|
12
17
|
async overwriteSdk(directory) {
|
|
13
18
|
const overwrite = await confirm({
|
|
@@ -19,13 +24,12 @@ export class SdkGeneratePrompts {
|
|
|
19
24
|
}
|
|
20
25
|
return overwrite;
|
|
21
26
|
}
|
|
22
|
-
|
|
23
|
-
const message = `The ${f.var(
|
|
24
|
-
`Current value: ${f.path(directory)}`;
|
|
27
|
+
sameSourceAndSdkDir(directory) {
|
|
28
|
+
const message = `The ${f.var('src')} and ${f.var('sdk')} directories must be different. ` + `Current value: ${f.path(directory)}`;
|
|
25
29
|
log.error(message);
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
const message = `The ${f.var(
|
|
31
|
+
sourceDirectoryEmpty(directory) {
|
|
32
|
+
const message = `The ${f.var('src')} directory is either empty or invalid: ${f.path(directory)}`;
|
|
29
33
|
log.error(message);
|
|
30
34
|
}
|
|
31
35
|
specDirectoryEmpty(directory) {
|
|
@@ -36,29 +40,25 @@ export class SdkGeneratePrompts {
|
|
|
36
40
|
const message = `Please enter a different destination folder or remove the existing files and try again.`;
|
|
37
41
|
log.error(message);
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
return withSpinner(
|
|
41
|
-
}
|
|
42
|
-
generateV4SDK(fn) {
|
|
43
|
-
return withSpinner("Generating SDK", "SDK generated successfully.", "SDK Generation failed.", fn);
|
|
43
|
+
generateSdk(fn) {
|
|
44
|
+
return withSpinner('Generating SDK', 'SDK generated successfully.', 'SDK Generation failed.', fn);
|
|
44
45
|
}
|
|
45
46
|
sdkGenerationServiceError(serviceError) {
|
|
46
47
|
log.error(serviceError.errorMessage);
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
noVersionToBuild(problem, sourceDirectory) {
|
|
50
|
+
const messages = {
|
|
51
|
+
noVersions: `The ${f.var('versioned_docs')} directory is either empty or invalid: ${f.path(sourceDirectory)}`,
|
|
52
|
+
versionNotFound: 'The selected API version is invalid.'
|
|
53
|
+
};
|
|
54
|
+
log.error(messages[problem]);
|
|
51
55
|
}
|
|
52
56
|
apiVersionOnlyApplicableWithVersionedBuild() {
|
|
53
|
-
log.warn(`The ${f.flag(
|
|
54
|
-
}
|
|
55
|
-
versionNotFound() {
|
|
56
|
-
const message = `The selected API version is invalid.`;
|
|
57
|
-
log.error(message);
|
|
57
|
+
log.warn(`The ${f.flag('api-version')} is only applicable with a versioned build.`);
|
|
58
58
|
}
|
|
59
59
|
async selectVersion(versions) {
|
|
60
60
|
const version = await select({
|
|
61
|
-
message:
|
|
61
|
+
message: 'Select an API version for SDK generation:',
|
|
62
62
|
options: versions.map((v) => ({ label: v, value: v }))
|
|
63
63
|
});
|
|
64
64
|
if (isCancel(version)) {
|
|
@@ -67,10 +67,7 @@ export class SdkGeneratePrompts {
|
|
|
67
67
|
return version;
|
|
68
68
|
}
|
|
69
69
|
sdkGenerated(sdk) {
|
|
70
|
-
log.info(`The generated SDK can be found at ${f.
|
|
71
|
-
}
|
|
72
|
-
sdkCustomizationsNotSupportedForV4() {
|
|
73
|
-
log.warn(`The V4 Code Generator does not currently support SDK customizations.`);
|
|
70
|
+
log.info(`The generated SDK can be found at ${f.relativePath(sdk)}.`);
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/prompts/sdk/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/prompts/sdk/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAY,aAAa,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAG/G,MAAM,KAAK,GAAG,CAAC,SAA8B,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE1F,MAAM,OAAO,kBAAkB;IAC7B;;;;OAIG;IACI,oBAAoB,CAAC,QAAkB;QAC5C,GAAG,CAAC,KAAK,CACP,GAAG,aAAa,CAAC,QAAQ,CAAC,yBAAyB;YACjD,kBAAkB,KAAK,CAAC,mBAAmB,CAAC,IAAI;YAChD,gBAAgB,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAC9C,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,SAAwB;QAChD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;YAC9B,OAAO,EAAE,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,0CAA0C;YACvF,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,SAAS,CAA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AgB,CAAC,0CAA0C,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YAC7G,eAAe,EAAE,sCAAsC;SACxD,CAAC;QACF,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/B,CAAC;IAEM,0CAA0C;QAC/C,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,6CAA6C,CAAC,CAAC;IACtF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,QAAkB;QAC3C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC;YAC3B,OAAO,EAAE,2CAA2C;YACpD,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;SACvD,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACtB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,YAAY,CAAC,GAAkB;QACpC,GAAG,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC;CACF"}
|
|
@@ -3,13 +3,13 @@ import { DirectoryPath } from '../../../types/file/directoryPath.js';
|
|
|
3
3
|
import { ServiceError } from '../../../infrastructure/service-error.js';
|
|
4
4
|
import { PublishingProfileWithLanguagesGroup, PublishingProfileItem } from '../../../types/publish-api/publishing-profile-item.js';
|
|
5
5
|
import { PublishingProfile } from '../../../types/publish/publishing-profile.js';
|
|
6
|
-
import {
|
|
6
|
+
import { Language, Stability } from '../../../types/sdk/generate.js';
|
|
7
7
|
import { SemVersion } from '../../../types/publish/version.js';
|
|
8
8
|
export declare class SdkPublishInteractivePrompts {
|
|
9
9
|
inputWorkingDirectory(defaultDirectory: DirectoryPath, validator: (value: string | undefined) => string | Error | undefined): Promise<DirectoryPath | undefined>;
|
|
10
10
|
noInputDirectoryProvided(): Promise<void>;
|
|
11
11
|
inputSdkDirectory(defaultDirectory: DirectoryPath, validator: (value: string | undefined) => string | Error | undefined): Promise<DirectoryPath | undefined>;
|
|
12
|
-
|
|
12
|
+
sdkDirectoryCannotBeSameAsSourceDirectory(): void;
|
|
13
13
|
noSdkDirectoryProvided(): Promise<void>;
|
|
14
14
|
getPublishingProfiles(fn: Promise<Result<PublishingProfileItem[], ServiceError>>): Promise<Result<PublishingProfileItem[], ServiceError>>;
|
|
15
15
|
getPublishingProfilesServiceError(serviceError: ServiceError): void;
|
|
@@ -17,15 +17,19 @@ export declare class SdkPublishInteractivePrompts {
|
|
|
17
17
|
noProfileWithEnabledLanguagesFound(): void;
|
|
18
18
|
selectPublishingProfile(groups: PublishingProfileWithLanguagesGroup[]): Promise<PublishingProfileItem | undefined>;
|
|
19
19
|
noPublishingProfileSelected(): void;
|
|
20
|
-
selectLanguage(publishingProfile: PublishingProfile): Promise<Language | undefined>;
|
|
20
|
+
selectLanguage(publishingProfile: PublishingProfile, offered: readonly Language[]): Promise<Language | undefined>;
|
|
21
21
|
noLanguageSelected(): void;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The profile is configured for languages the CLI cannot generate yet. Named rather than
|
|
24
|
+
* reported as an empty list, so the reason reads as timing rather than a broken profile.
|
|
25
|
+
*/
|
|
26
|
+
noAvailableLanguageOnProfile(enabled: readonly Language[]): void;
|
|
27
|
+
selectStability(levels: readonly Stability[]): Promise<Stability | undefined>;
|
|
28
|
+
noStabilitySelected(): void;
|
|
24
29
|
inputVersion(): Promise<SemVersion | undefined>;
|
|
25
30
|
noVersionSpecified(): void;
|
|
26
31
|
publishingSummary(publishingSummary: string): void;
|
|
27
32
|
confirmPublishing(): Promise<boolean>;
|
|
28
|
-
confirmRecordSdk(): Promise<boolean>;
|
|
29
33
|
publishingCancelled(): void;
|
|
30
34
|
sourceCodeOnlyPublishingNotice(): void;
|
|
31
35
|
}
|
|
@@ -3,8 +3,8 @@ import { format as f } from '../../../prompts/format.js';
|
|
|
3
3
|
import { withSpinner } from '../../prompt.js';
|
|
4
4
|
import { DirectoryPath } from '../../../types/file/directoryPath.js';
|
|
5
5
|
import { PublishType } from '../../../types/publish-api/publishing-profile-item.js';
|
|
6
|
+
import { AVAILABLE_LANGUAGES, languageLabel } from '../../../types/sdk/generate.js';
|
|
6
7
|
import { SemVersion } from '../../../types/publish/version.js';
|
|
7
|
-
import { removeQuotes } from '../../../utils/string-utils.js';
|
|
8
8
|
import { SDK_PUBLISHING_OVERVIEW_URL } from '../../publishing/links.js';
|
|
9
9
|
export class SdkPublishInteractivePrompts {
|
|
10
10
|
async inputWorkingDirectory(defaultDirectory, validator) {
|
|
@@ -17,7 +17,7 @@ export class SdkPublishInteractivePrompts {
|
|
|
17
17
|
if (isCancel(value)) {
|
|
18
18
|
return undefined;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return DirectoryPath.fromUserInput(value);
|
|
21
21
|
}
|
|
22
22
|
async noInputDirectoryProvided() {
|
|
23
23
|
log.error('No input directory was provided.');
|
|
@@ -32,9 +32,9 @@ export class SdkPublishInteractivePrompts {
|
|
|
32
32
|
if (isCancel(value)) {
|
|
33
33
|
return undefined;
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return DirectoryPath.fromUserInput(value);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
sdkDirectoryCannotBeSameAsSourceDirectory() {
|
|
38
38
|
log.error(`SDK directory must be different from the ${f.var('src')} directory.`);
|
|
39
39
|
}
|
|
40
40
|
async noSdkDirectoryProvided() {
|
|
@@ -69,8 +69,8 @@ export class SdkPublishInteractivePrompts {
|
|
|
69
69
|
noPublishingProfileSelected() {
|
|
70
70
|
log.error('No publishing profile was selected.');
|
|
71
71
|
}
|
|
72
|
-
async selectLanguage(publishingProfile) {
|
|
73
|
-
const options =
|
|
72
|
+
async selectLanguage(publishingProfile, offered) {
|
|
73
|
+
const options = offered.map((language) => ({
|
|
74
74
|
value: language,
|
|
75
75
|
label: `${language} (${publishingProfile
|
|
76
76
|
.getPublishTypesForLanguage(language)
|
|
@@ -89,19 +89,28 @@ export class SdkPublishInteractivePrompts {
|
|
|
89
89
|
noLanguageSelected() {
|
|
90
90
|
log.error('No language was selected for publishing.');
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The profile is configured for languages the CLI cannot generate yet. Named rather than
|
|
94
|
+
* reported as an empty list, so the reason reads as timing rather than a broken profile.
|
|
95
|
+
*/
|
|
96
|
+
noAvailableLanguageOnProfile(enabled) {
|
|
97
|
+
log.error(`This publishing profile is configured for ${enabled.map(languageLabel).join(', ')}, ` +
|
|
98
|
+
`and none of those can be generated yet.\n` +
|
|
99
|
+
`Available now: ${AVAILABLE_LANGUAGES.map(languageLabel).join(', ')}`);
|
|
100
|
+
}
|
|
101
|
+
async selectStability(levels) {
|
|
102
|
+
const stability = await select({
|
|
103
|
+
message: 'Select the stability level of the SDK:',
|
|
104
|
+
initialValue: levels[0],
|
|
105
|
+
options: levels.map((level) => ({ value: level, label: `${level}` }))
|
|
97
106
|
});
|
|
98
|
-
if (isCancel(
|
|
107
|
+
if (isCancel(stability)) {
|
|
99
108
|
return undefined;
|
|
100
109
|
}
|
|
101
|
-
return
|
|
110
|
+
return stability;
|
|
102
111
|
}
|
|
103
|
-
|
|
104
|
-
log.error('No
|
|
112
|
+
noStabilitySelected() {
|
|
113
|
+
log.error('No stability level was selected.');
|
|
105
114
|
}
|
|
106
115
|
async inputVersion() {
|
|
107
116
|
const version = await text({
|
|
@@ -128,19 +137,12 @@ export class SdkPublishInteractivePrompts {
|
|
|
128
137
|
log.info(`Ready to publish:` + publishingSummary);
|
|
129
138
|
}
|
|
130
139
|
async confirmPublishing() {
|
|
131
|
-
|
|
140
|
+
// No by default, as the overwrite prompts are: a release cannot be taken back.
|
|
141
|
+
const result = await confirm({ message: 'Do you want to proceed?', initialValue: false });
|
|
132
142
|
if (isCancel(result))
|
|
133
143
|
return false;
|
|
134
144
|
return result;
|
|
135
145
|
}
|
|
136
|
-
async confirmRecordSdk() {
|
|
137
|
-
const message = `Update configuration for context plugin generation?` +
|
|
138
|
-
f.continuation(`See '${f.cmdAlt('apimatic', 'plugin', 'generate')} ${f.flag('help')}' for more information.`);
|
|
139
|
-
const record = await confirm({ message, initialValue: true });
|
|
140
|
-
if (isCancel(record))
|
|
141
|
-
return false;
|
|
142
|
-
return record;
|
|
143
|
-
}
|
|
144
146
|
publishingCancelled() {
|
|
145
147
|
log.error('Publishing cancelled.');
|
|
146
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../../../../src/prompts/sdk/publish/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAGL,WAAW,EACZ,MAAM,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../../../../src/prompts/sdk/publish/interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO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BAAiB,CAAC,CAAC;IACpD,CAAC;IAEM,KAAK,CAAC,iBAAiB;QAC5B,+EAA+E;QAC/E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1F,IAAI,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,mBAAmB;QACxB,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;IACrC,CAAC;IAEM,8BAA8B;QACnC,GAAG,CAAC,IAAI,CACN,6GAA6G,CAC9G,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -7,7 +7,7 @@ import { ProfileId } from '../../../types/publish/profile-id.js';
|
|
|
7
7
|
import { Language } from '../../../types/sdk/generate.js';
|
|
8
8
|
export declare class SdkPublishNonInteractivePrompts {
|
|
9
9
|
directoryCannotBeSame(directory: DirectoryPath): void;
|
|
10
|
-
|
|
10
|
+
sourceDirectoryDoesNotExist(directory: DirectoryPath): void;
|
|
11
11
|
missingRequiredFlags(options: string[]): void;
|
|
12
12
|
interactiveModeNotice(): void;
|
|
13
13
|
invalidVersion(version: string): void;
|
|
@@ -18,5 +18,6 @@ export declare class SdkPublishNonInteractivePrompts {
|
|
|
18
18
|
languageNotConfiguredForProfile(language: Language): void;
|
|
19
19
|
publishTypesNotAvailableForLanguage(publishTypes: PublishType[], language: Language): void;
|
|
20
20
|
sourceCodeOnlyPublishingNotice(): void;
|
|
21
|
+
/** A publish records itself, and a dry run is the one publish that has nothing to record. */
|
|
21
22
|
dryRunPluginConfigNotice(): void;
|
|
22
23
|
}
|
|
@@ -3,13 +3,13 @@ import { PublishType } from '../../../types/publish-api/publishing-profile-item.
|
|
|
3
3
|
import { format as f } from '../../../prompts/format.js';
|
|
4
4
|
import { withSpinner } from '../../prompt.js';
|
|
5
5
|
import { SDK_PUBLISHING_OVERVIEW_URL } from '../../publishing/links.js';
|
|
6
|
-
|
|
6
|
+
import { APIMATIC_CONFIG_FILE_NAME } from '../../../types/apimatic-config/document.js';
|
|
7
7
|
export class SdkPublishNonInteractivePrompts {
|
|
8
8
|
directoryCannotBeSame(directory) {
|
|
9
9
|
const message = `The ${f.var('src')} and ${f.var('sdk')} directories must be different. Current value: ${f.path(directory)}`;
|
|
10
10
|
log.error(message);
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
sourceDirectoryDoesNotExist(directory) {
|
|
13
13
|
log.error(`The ${f.var('src')} does not exist at the provided location: ${f.path(directory)}`);
|
|
14
14
|
}
|
|
15
15
|
missingRequiredFlags(options) {
|
|
@@ -47,9 +47,10 @@ export class SdkPublishNonInteractivePrompts {
|
|
|
47
47
|
sourceCodeOnlyPublishingNotice() {
|
|
48
48
|
log.info('Version tags will not be created in your Git repository because you have opted to publish Source Code only.');
|
|
49
49
|
}
|
|
50
|
+
/** A publish records itself, and a dry run is the one publish that has nothing to record. */
|
|
50
51
|
dryRunPluginConfigNotice() {
|
|
51
|
-
const message =
|
|
52
|
-
`Re-run without ${f.flag('dry-run')} to record it
|
|
52
|
+
const message = `Nothing was recorded in ${f.var(APIMATIC_CONFIG_FILE_NAME)} because ${f.flag('dry-run')} does not ` +
|
|
53
|
+
`publish the SDK. Re-run without ${f.flag('dry-run')} to record it.`;
|
|
53
54
|
log.info(message);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-interactive.js","sourceRoot":"","sources":["../../../../src/prompts/sdk/publish/non-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,uDAAuD,CAAC;AACpF,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,4BAA4B,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO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