@apimatic/cli 1.4.0 → 2.0.0-beta.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/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 +222 -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 +102 -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 +199 -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 +70 -0
- package/lib/types/apimatic-config/document.js +167 -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 +69 -357
- 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
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { log } from '@clack/prompts';
|
|
2
|
+
import { APIMATIC_CONFIG_FILE_NAME } from '../../types/apimatic-config/document.js';
|
|
3
|
+
import { listedInProse } from '../../utils/string-utils.js';
|
|
4
|
+
import { NAVIGATION_FILE_NAME } from '../../types/portal/portal-navigation.js';
|
|
5
|
+
import { TRANSFORMATIONS_DIRECTORY_NAME } from '../../types/transform-context.js';
|
|
6
|
+
import { CONTENT_DIRECTORY_NAME, SPEC_DIRECTORY_NAME, STATIC_DIRECTORY_NAME } from '../../types/project-layout.js';
|
|
7
|
+
import { format as f } from '../format.js';
|
|
8
|
+
const TITLE_EXAMPLE = ['---', 'title: Getting started', '---'].join('\n');
|
|
9
|
+
const ROOT_NAVIGATION_FILE = `${CONTENT_DIRECTORY_NAME}/${NAVIGATION_FILE_NAME}`;
|
|
10
|
+
export const specPath = (sourceDirectory) => f.path(sourceDirectory.join(SPEC_DIRECTORY_NAME));
|
|
11
|
+
export const contentPath = (sourceDirectory) => f.path(sourceDirectory.join(CONTENT_DIRECTORY_NAME));
|
|
12
|
+
export const staticPath = (sourceDirectory) => f.path(sourceDirectory.join(STATIC_DIRECTORY_NAME));
|
|
13
|
+
const relative = (file, sourceDirectory) => f.var(file.relativeTo(sourceDirectory));
|
|
14
|
+
const spelt = (found, sourceDirectory) => `spelt ${relative(found, sourceDirectory)} on disk`;
|
|
15
|
+
// Found by this machine's file system, which ignores case, and lost by the host.
|
|
16
|
+
function reportSpellings(files) {
|
|
17
|
+
if (files.some(({ foundAs }) => foundAs !== null)) {
|
|
18
|
+
log.message('Names are matched exactly, as the servers a portal is published to match them, so write each name as the ' +
|
|
19
|
+
'file is spelt.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const transformCommand = (flags) => [f.cmdAlt('apimatic', 'api', 'transform'), f.flag('format', 'openapi3yaml'), ...flags].join(' ');
|
|
23
|
+
// Quickstart refuses a spec for the same reason, and has to point at the same fix.
|
|
24
|
+
export const convertToOpenApi3 = () => `Convert it with ${transformCommand([f.flag('file', '<your spec>')])}, and use the file it writes into a ` +
|
|
25
|
+
`${f.var(TRANSFORMATIONS_DIRECTORY_NAME)} folder.`;
|
|
26
|
+
function reportSpecConversion({ file, format, converted, others }, sourceDirectory) {
|
|
27
|
+
const name = f.var(file.name().toString());
|
|
28
|
+
log.error(`No OpenAPI 3.x document found in ${specPath(sourceDirectory)}.` + (format === null ? '' : ` ${name} is ${format}.`));
|
|
29
|
+
const command = transformCommand([
|
|
30
|
+
f.flag('file', f.relative(file)),
|
|
31
|
+
f.flag('destination', f.relative(file.directory()))
|
|
32
|
+
]);
|
|
33
|
+
const convert = format === null ? `If ${name} is an API definition in another format, convert` : 'Convert';
|
|
34
|
+
const documents = others === 1 ? 'document' : `${others} documents`;
|
|
35
|
+
log.message(`${convert} it with:\n` +
|
|
36
|
+
` ${command}\n` +
|
|
37
|
+
`then move ${f.relativePath(converted)} up into ${specPath(sourceDirectory)}, which is the only folder read.` +
|
|
38
|
+
(others === 0 ? '' : ` Convert the other ${documents} the same way.`));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Shared by `portal generate` and `portal serve`: both read the same source directory, so
|
|
42
|
+
* a broken one has to be explained the same way in both. `offerQuickstart` is false once a
|
|
43
|
+
* preview of the directory is running: quickstart refuses a directory that is not empty.
|
|
44
|
+
*/
|
|
45
|
+
export function reportSourceProblem(problem, sourceDirectory, { offerQuickstart = true } = {}) {
|
|
46
|
+
const quickstart = `Run ${f.cmdAlt('apimatic', 'quickstart')} to set up a portal.`;
|
|
47
|
+
switch (problem.kind) {
|
|
48
|
+
case 'missingConfig': {
|
|
49
|
+
log.error(`No ${f.var(APIMATIC_CONFIG_FILE_NAME)} found in ${f.path(sourceDirectory)}.`);
|
|
50
|
+
if (offerQuickstart) {
|
|
51
|
+
log.message(quickstart);
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
case 'invalidConfig': {
|
|
56
|
+
log.error(`The ${f.var(APIMATIC_CONFIG_FILE_NAME)} in ${f.path(sourceDirectory)} is not valid:`);
|
|
57
|
+
log.message(problem.errors.map((error) => ` • ${error}`).join('\n'));
|
|
58
|
+
// A file without the block is no worse off than no file: the same command sets it up.
|
|
59
|
+
if (problem.missingPortal && offerQuickstart) {
|
|
60
|
+
log.message(quickstart);
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
case 'invalidContent': {
|
|
65
|
+
reportContentProblems(problem.problems, sourceDirectory);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
case 'unreadableSpec': {
|
|
69
|
+
log.error(`${f.var(problem.fileName.toString())} could not be read as JSON or YAML.`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
case 'missingStaticFiles': {
|
|
73
|
+
const one = problem.files.length === 1;
|
|
74
|
+
const [subject, verb] = one ? ['A file', 'is'] : ['Files', 'are'];
|
|
75
|
+
const heading = `${subject} named in ${f.var(APIMATIC_CONFIG_FILE_NAME)} ${verb} not in ${f.path(sourceDirectory)}:`;
|
|
76
|
+
const lines = problem.files.map(({ setting, file, foundAs }) => ` • ${relative(file, sourceDirectory)}, named by ${f.var(setting)}` +
|
|
77
|
+
(foundAs === null ? '' : `, which is ${spelt(foundAs, sourceDirectory)}`));
|
|
78
|
+
log.error(heading);
|
|
79
|
+
log.message(lines.join('\n'));
|
|
80
|
+
log.message(one
|
|
81
|
+
? 'Add the file there, or remove the setting that names it.'
|
|
82
|
+
: 'Add each file there, or remove the setting that names it.');
|
|
83
|
+
reportSpellings(problem.files);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
case 'emptySpecDirectory': {
|
|
87
|
+
const message = `${specPath(sourceDirectory)} has no files. Add your OpenAPI 3.x document to it as a ` +
|
|
88
|
+
`${f.var('.json')}, ${f.var('.yaml')} or ${f.var('.yml')} file.`;
|
|
89
|
+
log.error(message);
|
|
90
|
+
if (problem.folders.length > 0) {
|
|
91
|
+
const folders = listedInProse(problem.folders.map((folder) => f.var(folder.leafName())));
|
|
92
|
+
log.message(`A document in a folder inside it, such as ${folders}, is not read: move it up.`);
|
|
93
|
+
}
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
case 'noOpenApiSpec': {
|
|
97
|
+
reportSpecConversion(problem.conversion, sourceDirectory);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Each problem in turn, so one run lists everything a build would refuse in `content/`. */
|
|
103
|
+
export function reportContentProblems(problems, sourceDirectory) {
|
|
104
|
+
for (const problem of problems) {
|
|
105
|
+
reportContentProblem(problem, sourceDirectory);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function reportContentProblem(problem, sourceDirectory) {
|
|
109
|
+
switch (problem.kind) {
|
|
110
|
+
case 'unreadableContent': {
|
|
111
|
+
log.error(`${contentPath(sourceDirectory)} could not be read. Check that it and every ` +
|
|
112
|
+
`directory beneath it can be listed.`);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
case 'groupNamedPages': {
|
|
116
|
+
const names = listedInProse(problem.pages.map((page) => relative(page, sourceDirectory)));
|
|
117
|
+
const one = problem.pages.length === 1;
|
|
118
|
+
log.error(`${names} ${one ? 'is' : 'are'} named like a ${f.var('(group)')} folder, which is left out of every ` +
|
|
119
|
+
`address, so the build cannot serve ${one ? 'it' : 'them'}. Rename ${one ? 'the file' : 'each file'}.`);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
case 'reservedAddresses': {
|
|
123
|
+
reportReservedAddresses(problem.pages, sourceDirectory);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
case 'sharedAddresses': {
|
|
127
|
+
reportSharedAddresses(problem.addresses, sourceDirectory);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
case 'invalidFrontMatter': {
|
|
131
|
+
log.error(`The front matter of pages in ${f.path(sourceDirectory)} would fail the build:`);
|
|
132
|
+
log.message(problem.errors.map((error) => ` • ${error}`).join('\n'));
|
|
133
|
+
log.message(`Start each page with front matter that gives its title, for example:\n${TITLE_EXAMPLE}`);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
case 'invalidNavigation': {
|
|
137
|
+
log.error(`The page order in ${f.path(sourceDirectory)} could not be applied:`);
|
|
138
|
+
log.message(problem.errors.map((error) => ` • ${error}`).join('\n'));
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
case 'missingImages': {
|
|
142
|
+
reportMissingImages(problem.images, sourceDirectory);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function reportMissingImages(images, sourceDirectory) {
|
|
148
|
+
const lines = images.map(({ page, line, url, missing }) => {
|
|
149
|
+
const where = ` • ${relative(page, sourceDirectory)}, line ${line}: ${f.var(url)}`;
|
|
150
|
+
if (missing === null) {
|
|
151
|
+
return `${where} points outside ${f.var(CONTENT_DIRECTORY_NAME)}, or into a folder the build skips`;
|
|
152
|
+
}
|
|
153
|
+
return missing.foundAs === null
|
|
154
|
+
? `${where}, but there is no ${relative(missing.file, sourceDirectory)}`
|
|
155
|
+
: `${where}, but the file is ${spelt(missing.foundAs, sourceDirectory)}`;
|
|
156
|
+
});
|
|
157
|
+
log.error(images.length === 1
|
|
158
|
+
? `A page in ${f.path(sourceDirectory)} shows an image the build cannot find:`
|
|
159
|
+
: `Pages in ${f.path(sourceDirectory)} show images the build cannot find:`);
|
|
160
|
+
log.message(lines.join('\n'));
|
|
161
|
+
log.message(`An image written as ${f.var('/images/logo.png')} is read from ${staticPath(sourceDirectory)}, and any ` +
|
|
162
|
+
`other from beside its page in ${contentPath(sourceDirectory)}.`);
|
|
163
|
+
reportSpellings(images.flatMap(({ missing }) => (missing === null ? [] : [missing])));
|
|
164
|
+
}
|
|
165
|
+
function reportReservedAddresses(pages, sourceDirectory) {
|
|
166
|
+
const one = pages.length === 1;
|
|
167
|
+
const lines = pages.map(({ file, address, section }) => {
|
|
168
|
+
const kept = `/${section.folder}`;
|
|
169
|
+
const within = address === kept ? '' : `, under ${f.var(kept)}`;
|
|
170
|
+
return ` • ${relative(file, sourceDirectory)}, at ${f.var(address)}${within}, which is kept for ${section.description}`;
|
|
171
|
+
});
|
|
172
|
+
log.error(one
|
|
173
|
+
? `A page in ${f.path(sourceDirectory)} would be served where the portal puts the pages it generates:`
|
|
174
|
+
: `Pages in ${f.path(sourceDirectory)} would be served where the portal puts the pages it generates:`);
|
|
175
|
+
log.message(lines.join('\n'));
|
|
176
|
+
log.message(one ? 'Rename or move the page.' : 'Rename or move each page.');
|
|
177
|
+
}
|
|
178
|
+
function reportSharedAddresses(addresses, sourceDirectory) {
|
|
179
|
+
const one = addresses.length === 1;
|
|
180
|
+
const lines = addresses.map(({ address, pages }) => ` • ${f.var(address)}: ${listedInProse(pages.map((page) => relative(page, sourceDirectory)))}`);
|
|
181
|
+
log.error(`Pages in ${f.path(sourceDirectory)} would share ${one ? 'an address' : 'addresses'}, but only one page ` +
|
|
182
|
+
`can be served at each:`);
|
|
183
|
+
log.message(lines.join('\n'));
|
|
184
|
+
log.message(`Rename or move all but one ${one ? 'of them' : 'page at each address'}. A page in a ${f.var('(group)')} folder is served as if the folder were not there, and an ${f.var('index')} page at its folder's address.`);
|
|
185
|
+
}
|
|
186
|
+
export function reportShadowedFiles(shadowed) {
|
|
187
|
+
if (shadowed.length === 0) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const names = listedInProse(shadowed.map((fileName) => f.var(fileName.toString())));
|
|
191
|
+
const replaces = shadowed.length === 1 ? 'replaces the file' : 'replace the files';
|
|
192
|
+
log.warn(`${names} in ${f.var('static')} ${replaces} the portal would have generated.`);
|
|
193
|
+
}
|
|
194
|
+
export function reportIgnoredNavigationFiles(files, sourceDirectory) {
|
|
195
|
+
if (files.length === 0) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const names = listedInProse(files.map((file) => relative(file, sourceDirectory)));
|
|
199
|
+
const verb = files.length === 1 ? 'is' : 'are';
|
|
200
|
+
// Not "rename it": on a case-sensitive filesystem a correctly named file may already sit
|
|
201
|
+
// beside it, and the two would then need merging rather than renaming.
|
|
202
|
+
log.warn(`${names} ${verb} not read. Only a file named ${f.var(NAVIGATION_FILE_NAME)}, in lower case, orders the pages.`);
|
|
203
|
+
}
|
|
204
|
+
export function reportContentNotices(notices, sourceDirectory) {
|
|
205
|
+
reportHiddenPages(notices.hiddenPages, sourceDirectory);
|
|
206
|
+
reportIgnoredNavigationFiles(notices.ignoredNavigationFiles, sourceDirectory);
|
|
207
|
+
reportFolderTabs(notices.folderTabs);
|
|
208
|
+
reportSharedTabNames(notices.sharedTabNames, sourceDirectory);
|
|
209
|
+
}
|
|
210
|
+
export function reportFolderTabs(folders) {
|
|
211
|
+
if (folders.length === 0) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const names = listedInProse(folders.map((folder) => f.var(folder.leafName())));
|
|
215
|
+
log.info(`${f.var(ROOT_NAVIGATION_FILE)} makes a tab of each folder it lists: ${names}.`);
|
|
216
|
+
}
|
|
217
|
+
export function reportSharedTabNames(shared, sourceDirectory) {
|
|
218
|
+
if (shared.length === 0) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
const describe = ({ owner, namedBy }) => {
|
|
222
|
+
const titledIn = namedBy === null ? '' : ` (titled in ${relative(namedBy, sourceDirectory)})`;
|
|
223
|
+
switch (owner.kind) {
|
|
224
|
+
case 'home':
|
|
225
|
+
return `the Home tab${titledIn}`;
|
|
226
|
+
case 'apiReference':
|
|
227
|
+
return `the API reference${titledIn}`;
|
|
228
|
+
case 'generated':
|
|
229
|
+
return `the tab of ${owner.section.description}`;
|
|
230
|
+
case 'folder': {
|
|
231
|
+
const folder = `the tab of the ${f.var(owner.directory.leafName())} folder`;
|
|
232
|
+
return namedBy === null ? `${folder} (named after the folder)` : `${folder}${titledIn}`;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const spellings = (tabs) => listedInProse([...new Set(tabs.map(({ name }) => name))].map((name) => f.var(name)));
|
|
237
|
+
log.warn('More than one tab has the same name, or one that differs only in case, so readers cannot tell them apart:');
|
|
238
|
+
log.message(shared.map(({ tabs }) => ` • ${spellings(tabs)}: ${listedInProse(tabs.map(describe))}`).join('\n'));
|
|
239
|
+
log.message(`Rename all but one tab of each name with a ${f.var('title')} in its folder's ` +
|
|
240
|
+
`${f.var(NAVIGATION_FILE_NAME)}, or in ${f.var(ROOT_NAVIGATION_FILE)} for the Home tab; the tabs of the ` +
|
|
241
|
+
`SDK pages and the context plugin keep their names.`);
|
|
242
|
+
}
|
|
243
|
+
export function reportHiddenPages(files, sourceDirectory) {
|
|
244
|
+
if (files.length === 0) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const names = listedInProse(files.map((file) => relative(file, sourceDirectory)));
|
|
248
|
+
const [verb, pronoun] = files.length === 1 ? ['sits', 'it'] : ['sit', 'them'];
|
|
249
|
+
log.warn(`${names} ${verb} inside a specification's section under ${f.var('content/api')}, which lists only ` +
|
|
250
|
+
`its own reference pages, so ${pronoun} will not appear in the sidebar. Move ${pronoun} elsewhere ` +
|
|
251
|
+
`in ${f.var('content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EAAE,EAAE,EAAE,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjH,GAAG,CAAC,OAAO,CACT,8CAA8C,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,mBAAmB;QAC7E,GAAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,qCAAqC;QACzG,oDAAoD,CACvD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,eAA8B;IACjF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAClF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9E,GAAG,CAAC,IAAI,CACN,GAAG,KAAK,IAAI,IAAI,2CAA2C,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,qBAAqB;QAClG,+BAA+B,OAAO,yCAAyC,OAAO,aAAa;QACnG,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAC5B,CAAC;AACJ,CAAC"}
|
package/lib/prompts/prompt.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { Result } from
|
|
2
|
-
|
|
1
|
+
import { Result } from 'neverthrow';
|
|
2
|
+
/** A fixed message, or one built from what the operation returned. */
|
|
3
|
+
type SpinnerMessage<T> = string | ((value: T) => string);
|
|
4
|
+
export interface SpinnerOptions {
|
|
5
|
+
/** `timer` shows elapsed time, for work measured in tens of seconds rather than a moment. */
|
|
6
|
+
indicator?: 'dots' | 'timer';
|
|
7
|
+
}
|
|
8
|
+
export declare function withSpinner<T, E>(intro: string, success: SpinnerMessage<T>, failure: SpinnerMessage<E>, fn: Promise<Result<T, E>>, options?: SpinnerOptions): Promise<Result<T, E>>;
|
|
3
9
|
export declare const noteWrapped: (message: string, title: string) => void;
|
|
10
|
+
type ColumnStyle = 'primary' | 'secondary' | 'item';
|
|
4
11
|
export declare function buildTableWithHeading(groups: {
|
|
5
12
|
heading: string;
|
|
6
13
|
rows: string[][];
|
|
7
14
|
}[], headers: string[], columnStyles?: ColumnStyle[]): string;
|
|
8
|
-
|
|
15
|
+
/** The part of a child process's output worth putting in front of the user. */
|
|
16
|
+
export declare function logTail(output: string): string;
|
|
9
17
|
export {};
|
package/lib/prompts/prompt.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export async function withSpinner(intro, success, failure, fn) {
|
|
1
|
+
import { stripVTControlCharacters } from 'node:util';
|
|
2
|
+
import pc from 'picocolors';
|
|
3
|
+
import { getColumns } from '@clack/core';
|
|
4
|
+
import { log, note, S_BAR_H, S_CONNECT_LEFT, spinner } from '@clack/prompts';
|
|
5
|
+
export async function withSpinner(intro, success, failure, fn, options = {}) {
|
|
6
6
|
const s = spinner({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
...(options.indicator === 'timer' ? { indicator: 'timer' } : {}),
|
|
8
|
+
cancelMessage: 'cancelled',
|
|
9
|
+
errorMessage: 'failed',
|
|
10
|
+
frames: ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']
|
|
10
11
|
});
|
|
11
12
|
s.start(intro);
|
|
12
13
|
const result = await fn;
|
|
13
|
-
result.match(() => s.stop(success, 0), () => s.stop(failure, 1));
|
|
14
|
+
result.match((value) => s.stop(typeof success === 'function' ? success(value) : success, 0), (error) => s.stop(typeof failure === 'function' ? failure(error) : failure, 1));
|
|
14
15
|
return result;
|
|
15
16
|
}
|
|
16
17
|
export const noteWrapped = (message, title) => {
|
|
17
18
|
const output = process.stdout;
|
|
18
19
|
const columns = getColumns(output) || 80;
|
|
19
|
-
const messages = message.split(
|
|
20
|
+
const messages = message.split('\n');
|
|
20
21
|
const messageHasOverFlow = messages.some((msg) => {
|
|
21
|
-
const clean =
|
|
22
|
+
const clean = stripVTControlCharacters(msg);
|
|
22
23
|
return clean.length + 6 > columns;
|
|
23
24
|
});
|
|
24
25
|
if (messageHasOverFlow) {
|
|
25
26
|
const startLine = S_BAR_H.repeat(columns - title.length - 4);
|
|
26
27
|
log.step(`${title} ${pc.gray(startLine)}`);
|
|
27
28
|
log.message(message);
|
|
28
|
-
output.write(pc.gray(S_CONNECT_LEFT + S_BAR_H.repeat(columns - 1)) +
|
|
29
|
+
output.write(pc.gray(S_CONNECT_LEFT + S_BAR_H.repeat(columns - 1)) + '\n');
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
32
|
const opts = {
|
|
@@ -43,7 +44,7 @@ function buildTable(headers, rows, rowSeparators = false, columnStyles) {
|
|
|
43
44
|
const COL_PAD = 2;
|
|
44
45
|
const MIN_COL_WIDTH = 4;
|
|
45
46
|
const coloredHeaders = headers.map((h) => pc.bold(pc.white(h)));
|
|
46
|
-
let widths = headers.map((h, i) => Math.max(
|
|
47
|
+
let widths = headers.map((h, i) => Math.max(stripVTControlCharacters(h).length, ...rows.map((r) => stripVTControlCharacters(r[i]).length)) + COL_PAD);
|
|
47
48
|
const terminalColumns = getColumns(process.stdout) || 80;
|
|
48
49
|
const totalWidth = 1 + 3 * headers.length + widths.reduce((a, b) => a + b, 0);
|
|
49
50
|
if (totalWidth > terminalColumns) {
|
|
@@ -60,7 +61,7 @@ function buildTable(headers, rows, rowSeparators = false, columnStyles) {
|
|
|
60
61
|
const renderRow = (cells, applyStyles = false) => pc.gray('│') +
|
|
61
62
|
cells
|
|
62
63
|
.map((cell, i) => {
|
|
63
|
-
const styled = applyStyles &&
|
|
64
|
+
const styled = applyStyles && columnStyles?.[i] ? columnStyleMap[columnStyles[i]](cell) : cell;
|
|
64
65
|
return ` ${pad(styled, widths[i])} ` + pc.gray('│');
|
|
65
66
|
})
|
|
66
67
|
.join('');
|
|
@@ -77,6 +78,29 @@ function buildTable(headers, rows, rowSeparators = false, columnStyles) {
|
|
|
77
78
|
}
|
|
78
79
|
/** Pad `text` to `width` visible characters (ANSI-safe). */
|
|
79
80
|
function pad(text, width) {
|
|
80
|
-
return text + ' '.repeat(Math.max(0, width -
|
|
81
|
+
return text + ' '.repeat(Math.max(0, width - stripVTControlCharacters(text).length));
|
|
82
|
+
}
|
|
83
|
+
/** Last lines of a failed build, enough to show the cause without flooding the terminal. */
|
|
84
|
+
const LOG_TAIL_LINES = 15;
|
|
85
|
+
const STACK_FRAME = /^\s+at\s/;
|
|
86
|
+
// A bundler puts the message and the offending file first and its own stack last, so a plain
|
|
87
|
+
// tail of the log shows the least useful part of it. Frames inside installed packages are
|
|
88
|
+
// dropped first; they also carry the store paths of the CLI's own dependencies.
|
|
89
|
+
const INTERNAL_FRAME = new RegExp(STACK_FRAME.source + /.*(?:[\\/]node_modules[\\/]|\(node:)/.source);
|
|
90
|
+
// Where Vite's report of a failed build, or of a dev server that failed to start, begins.
|
|
91
|
+
const ERROR_HEADINGS = ['error during build:', 'error when starting dev server:'];
|
|
92
|
+
/** The part of a child process's output worth putting in front of the user. */
|
|
93
|
+
export function logTail(output) {
|
|
94
|
+
const lines = stripVTControlCharacters(output).trimEnd().split('\n');
|
|
95
|
+
const meaningful = lines.filter((line) => !INTERNAL_FRAME.test(line));
|
|
96
|
+
// Some failures are nothing but frames; showing them beats showing nothing.
|
|
97
|
+
const source = meaningful.some((line) => line.trim().length > 0) ? meaningful : lines;
|
|
98
|
+
const error = source.findIndex((line) => ERROR_HEADINGS.some((heading) => line.trimStart().startsWith(heading)));
|
|
99
|
+
if (error === -1) {
|
|
100
|
+
return source.slice(-LOG_TAIL_LINES).join('\n').trim();
|
|
101
|
+
}
|
|
102
|
+
// After the heading, the error alone: the CLI already says what failed, and the full log keeps the frames.
|
|
103
|
+
const [message = '', ...rest] = source.slice(error + 1).filter((line) => !STACK_FRAME.test(line));
|
|
104
|
+
return [message.replace(/^Error: /, ''), ...rest].slice(0, LOG_TAIL_LINES).join('\n').trim();
|
|
81
105
|
}
|
|
82
106
|
//# sourceMappingURL=prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompts/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAe,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompts/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAe,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAW1F,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,OAA0B,EAC1B,OAA0B,EAC1B,EAAyB,EACzB,OAAO,GAAmB,EAAE;IAE5B,MAAM,CAAC,GAAG,OAAO,CAAC;QAChB,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CA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lPath } from '../types/file/urlPath.js';
|
|
3
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
4
|
+
import { FilePath } from '../types/file/filePath.js';
|
|
5
|
+
import { ServiceError } from '../infrastructure/service-error.js';
|
|
6
|
+
import { Directory } from '../types/file/directory.js';
|
|
7
|
+
import { ResourceInput } from '../types/file/resource-input.js';
|
|
8
|
+
import { FileDownloadResponse } from '../infrastructure/services/file-download-service.js';
|
|
9
|
+
import { PortalAuthorizationFailure } from '../infrastructure/services/portal-authorization-service.js';
|
|
10
|
+
import { PluginConfigWriteFailure } from '../types/plugin-config-context.js';
|
|
11
|
+
import { PortalScaffoldProblem } from '../types/portal/portal-source.js';
|
|
12
|
+
import { GitignoreFailure } from '../types/project-context.js';
|
|
13
|
+
import { Language } from '../types/sdk/generate.js';
|
|
2
14
|
export declare class QuickstartPrompts {
|
|
3
15
|
welcomeMessage(): void;
|
|
4
|
-
|
|
5
|
-
|
|
16
|
+
importSpecStep(): void;
|
|
17
|
+
/** The project came with its own source directory, so there is nothing to import into it. */
|
|
18
|
+
importSpecStepAdopted(sourceDirectory: DirectoryPath): void;
|
|
19
|
+
/** `defaultSpecUrl` is null once the sample has failed to download; it is not offered again. */
|
|
20
|
+
specPathPrompt(defaultSpecUrl: UrlPath | null): Promise<ResourceInput | undefined>;
|
|
21
|
+
specFormatUnsupported(specPath: FilePath, format: string): void;
|
|
22
|
+
/** For a document that names no format at all: a Postman collection, a RAML file, arbitrary JSON. */
|
|
23
|
+
specNotRecognised(specPath: FilePath): void;
|
|
24
|
+
runtimeUnsupported(reason: string): void;
|
|
25
|
+
specFileDoesNotExist(): void;
|
|
26
|
+
noSpecSpecified(): void;
|
|
27
|
+
useDefaultSpecPrompt(): Promise<boolean>;
|
|
28
|
+
fixYourSpec(): void;
|
|
29
|
+
validateSpecStep(): void;
|
|
30
|
+
specValidationFailed(spec: ResourceInput): void;
|
|
31
|
+
createPortalStep(): void;
|
|
32
|
+
authorizationFailed(failure: PortalAuthorizationFailure): void;
|
|
33
|
+
projectDirectoryPrompt(): Promise<DirectoryPath | undefined>;
|
|
34
|
+
projectDirectoryDoesNotExist(projectDirectory: DirectoryPath): void;
|
|
35
|
+
projectDirectoryNotEmpty(projectDirectory: DirectoryPath): void;
|
|
36
|
+
noProjectDirectoryProvided(): void;
|
|
37
|
+
scaffoldFailed(problem: PortalScaffoldProblem, sourceDirectory: DirectoryPath): void;
|
|
38
|
+
downloadSpecFile(fn: Promise<Result<FileDownloadResponse, ServiceError>>): Promise<Result<FileDownloadResponse, ServiceError>>;
|
|
39
|
+
nextSteps(configFile: FilePath): void;
|
|
40
|
+
serviceError(serviceError: ServiceError): void;
|
|
41
|
+
/** Names the address that failed: without it the same message repeats for every retry. */
|
|
42
|
+
specDownloadFailed(url: UrlPath, serviceError: ServiceError): void;
|
|
43
|
+
printDirectoryStructure(projectDirectory: DirectoryPath, structure: Directory): void;
|
|
44
|
+
selectLanguages(): Promise<Language[] | undefined>;
|
|
45
|
+
noLanguagesSelected(): void;
|
|
46
|
+
configNotWritten(failure: PluginConfigWriteFailure, sourceDirectory: DirectoryPath): void;
|
|
47
|
+
/** A warning, not an error: the portal is already written, and Git tracking it does not stop a build. */
|
|
48
|
+
gitignoreNotUpdated(failure: GitignoreFailure, projectDirectory: DirectoryPath): void;
|
|
6
49
|
}
|