@apimatic/cli 1.5.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
|
@@ -1,172 +1,189 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { NetworkService } from
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { PortalServePrompts } from '../../prompts/portal/serve.js';
|
|
2
|
+
import { APIMATIC_CONFIG_FILE_NAME } from '../../types/apimatic-config/document.js';
|
|
3
|
+
import { FileName } from '../../types/file/fileName.js';
|
|
4
|
+
import { ActionResult } from '../action-result.js';
|
|
5
|
+
import { isSkippedByGlob } from '../../types/portal/content-tree.js';
|
|
6
|
+
import { PreviewConfig } from '../../types/portal/preview-config.js';
|
|
7
|
+
import { PreviewContent } from '../../types/portal/preview-content.js';
|
|
8
|
+
import { FileWatchService } from '../../infrastructure/file-watch-service.js';
|
|
9
|
+
import { NetworkService } from '../../infrastructure/network-service.js';
|
|
10
|
+
import { LauncherService } from '../../infrastructure/launcher-service.js';
|
|
11
|
+
import { PortalDevServerService } from '../../infrastructure/portal-dev-server-service.js';
|
|
12
|
+
import { PortalProjectService } from '../../infrastructure/portal-project-service.js';
|
|
13
|
+
import { errorMessage } from '../../utils/error-utils.js';
|
|
14
|
+
import { PreparePortalProjectAction } from './prepare-project.js';
|
|
15
|
+
export const DEFAULT_PORTAL_PORT = 23513;
|
|
14
16
|
export class PortalServeAction {
|
|
17
|
+
prompts = new PortalServePrompts();
|
|
18
|
+
networkService = new NetworkService();
|
|
19
|
+
launcherService = new LauncherService();
|
|
20
|
+
projectService = new PortalProjectService();
|
|
21
|
+
devServerService = new PortalDevServerService();
|
|
22
|
+
fileWatchService = new FileWatchService();
|
|
23
|
+
configDir;
|
|
24
|
+
commandMetadata;
|
|
25
|
+
authKey;
|
|
15
26
|
constructor(configDir, commandMetadata, authKey = null) {
|
|
16
|
-
this.prompts = new PortalServePrompts();
|
|
17
|
-
this.networkService = new NetworkService();
|
|
18
|
-
this.launcherService = new LauncherService();
|
|
19
|
-
this.application = express();
|
|
20
27
|
this.configDir = configDir;
|
|
21
28
|
this.commandMetadata = commandMetadata;
|
|
22
29
|
this.authKey = authKey;
|
|
23
30
|
}
|
|
24
|
-
async
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let buildConfig;
|
|
31
|
-
try {
|
|
32
|
-
buildConfig = await buildContext.getBuildFileContents();
|
|
33
|
-
}
|
|
34
|
-
catch (_a) {
|
|
35
|
-
this.prompts.invalidBuildConfig(buildDirectory);
|
|
36
|
-
return ActionResult.failed();
|
|
37
|
-
}
|
|
38
|
-
const servePort = await this.networkService.getServerPort([port, 3000, 3001, 3002]);
|
|
39
|
-
if (servePort != port) {
|
|
40
|
-
this.prompts.usingFallbackPort(port, servePort);
|
|
41
|
-
}
|
|
42
|
-
const serveUrl = new UrlPath(`http://localhost:${servePort}`);
|
|
43
|
-
// Update the configured localhost base URL to the actual serve URL BEFORE
|
|
44
|
-
// generation bakes it into the portal artifacts; otherwise the portal would load
|
|
45
|
-
// its content from the wrong port and fail to render.
|
|
46
|
-
const updatedBuildConfig = buildConfig.updateBuildConfigBaseUrl(serveUrl);
|
|
47
|
-
if (updatedBuildConfig !== buildConfig) {
|
|
48
|
-
await buildContext.updateBuildFileContents(updatedBuildConfig);
|
|
49
|
-
this.prompts.baseUrlPortUpdated(serveUrl);
|
|
50
|
-
}
|
|
51
|
-
const generatePortalAction = new GenerateAction(this.configDir, this.commandMetadata, this.authKey);
|
|
52
|
-
const result = await generatePortalAction.execute(buildDirectory, portalDirectory, true, false);
|
|
53
|
-
if (result.isFailed()) {
|
|
54
|
-
return ActionResult.failed();
|
|
55
|
-
}
|
|
56
|
-
const liveReloadPort = await this.networkService.getServerPort([35729, 35730, 35731, 35732]);
|
|
57
|
-
const liveReloadServer = createLiveReloadServer({ port: liveReloadPort });
|
|
58
|
-
// livereload attaches its "error" handler to the inner WebSocket server, not to the
|
|
59
|
-
// HTTP server it binds the port on, so a failed bind (e.g. the port was taken in the
|
|
60
|
-
// gap since getServerPort) emits an unhandled "error" that would crash the process.
|
|
61
|
-
// Guard the HTTP server the same way as the main server below.
|
|
62
|
-
const liveReloadHttpServer = liveReloadServer.config.server;
|
|
63
|
-
if ((await this.waitForServerListening(liveReloadHttpServer)).isErr()) {
|
|
64
|
-
liveReloadServer.close();
|
|
65
|
-
this.prompts.serverStartFailed(liveReloadPort);
|
|
66
|
-
return ActionResult.failed();
|
|
67
|
-
}
|
|
68
|
-
const server = this.application
|
|
69
|
-
.use(connectLiveReload())
|
|
70
|
-
.use(express.static(portalDirectory.toString(), { extensions: ["html"] }))
|
|
71
|
-
.listen(servePort);
|
|
72
|
-
if ((await this.waitForServerListening(server)).isErr()) {
|
|
73
|
-
liveReloadServer.close();
|
|
74
|
-
this.prompts.serverStartFailed(servePort);
|
|
75
|
-
return ActionResult.failed();
|
|
76
|
-
}
|
|
77
|
-
this.prompts.portalServed(serveUrl);
|
|
78
|
-
if (openInBrowser) {
|
|
79
|
-
await this.launcherService.openUrlInBrowser(serveUrl);
|
|
80
|
-
}
|
|
81
|
-
this.prompts.promptForExit();
|
|
82
|
-
if (!hotReload) {
|
|
83
|
-
if (onAfterServe) {
|
|
84
|
-
onAfterServe();
|
|
85
|
-
}
|
|
86
|
-
this.clearStandardInput();
|
|
87
|
-
await this.prompts.blockExecution();
|
|
88
|
-
liveReloadServer.close();
|
|
89
|
-
server.close();
|
|
90
|
-
return ActionResult.success();
|
|
91
|
-
}
|
|
92
|
-
this.prompts.hotReloadEnabled(buildDirectory);
|
|
93
|
-
const watcher = chokidar.watch(buildDirectory.toString(), {
|
|
94
|
-
ignored: [/(^|[/\\])\..+/],
|
|
95
|
-
ignoreInitial: true,
|
|
96
|
-
persistent: true,
|
|
97
|
-
awaitWriteFinish: true,
|
|
98
|
-
atomic: true
|
|
99
|
-
});
|
|
100
|
-
const deletedDirectories = new Set();
|
|
101
|
-
const debounceService = new DebounceService();
|
|
102
|
-
watcher
|
|
103
|
-
.on("all", async (event, path) => {
|
|
104
|
-
// triggers folder deletion as a single event
|
|
105
|
-
if (event == "unlinkDir") {
|
|
106
|
-
deletedDirectories.add(path);
|
|
107
|
-
}
|
|
108
|
-
if (event == "unlink") {
|
|
109
|
-
for (const dir of deletedDirectories) {
|
|
110
|
-
if (path.startsWith(dir)) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
31
|
+
execute = async (project, port, openInBrowser, onServing) => {
|
|
32
|
+
return await new PreparePortalProjectAction(this.configDir, this.commandMetadata, this.authKey).execute(project, {
|
|
33
|
+
onPrepared: async (portalProject, source, artifacts) => {
|
|
34
|
+
const servePort = await this.networkService.getServerPort([port, 3000, 3001, 3002]);
|
|
35
|
+
if (servePort !== port) {
|
|
36
|
+
this.prompts.usingFallbackPort(port, servePort);
|
|
113
37
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
38
|
+
const server = await this.prompts.startPreview(this.devServerService.start(portalProject, servePort));
|
|
39
|
+
if (server.isErr()) {
|
|
40
|
+
this.prompts.startFailed(server.error.log);
|
|
41
|
+
return ActionResult.failed();
|
|
42
|
+
}
|
|
43
|
+
this.prompts.portalServed(server.value.url, project.sourceDirectory());
|
|
44
|
+
if (openInBrowser) {
|
|
45
|
+
await this.launcherService.openUrlInBrowser(server.value.url);
|
|
46
|
+
}
|
|
47
|
+
if (onServing) {
|
|
48
|
+
onServing();
|
|
49
|
+
}
|
|
50
|
+
// The content's tab names are checked against the generated tabs, which apimatic.json adds and removes.
|
|
51
|
+
let generatedPages = source.generatedPages;
|
|
52
|
+
const contentWatch = this.watchContent(project, source, () => generatedPages, portalProject.projectDirectory);
|
|
53
|
+
const configWatch = this.watchConfig(project, source, artifacts, portalProject.projectDirectory, (settings) => {
|
|
54
|
+
const tabsChanged = !settings.generatedPages.makesSameTabsAs(generatedPages);
|
|
55
|
+
generatedPages = settings.generatedPages;
|
|
56
|
+
if (tabsChanged) {
|
|
57
|
+
contentWatch?.recheck();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const closeWatches = async () => {
|
|
61
|
+
await configWatch?.close();
|
|
62
|
+
await contentWatch?.close();
|
|
63
|
+
};
|
|
64
|
+
this.clearStandardInput();
|
|
122
65
|
try {
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
66
|
+
// Raced with the exit too: waiting only on the signal left a crashed server advertised as running.
|
|
67
|
+
const interrupted = this.prompts.blockExecution().then(() => ({ kind: 'interrupted' }));
|
|
68
|
+
const stopped = server.value.exited.then((output) => ({ kind: 'exited', output }));
|
|
69
|
+
const outcome = await Promise.race([interrupted, stopped]);
|
|
70
|
+
// First, so a save still being handled is not reported after the preview says it stops.
|
|
71
|
+
await closeWatches();
|
|
72
|
+
if (outcome.kind === 'exited') {
|
|
73
|
+
this.prompts.previewStopped(outcome.output);
|
|
74
|
+
return ActionResult.failed();
|
|
128
75
|
}
|
|
76
|
+
this.prompts.stopping();
|
|
77
|
+
await server.value.stop();
|
|
78
|
+
return ActionResult.stopped();
|
|
129
79
|
}
|
|
130
|
-
|
|
131
|
-
//
|
|
132
|
-
|
|
80
|
+
finally {
|
|
81
|
+
// Before the portal project goes: a save being handled writes into it.
|
|
82
|
+
await closeWatches();
|
|
133
83
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Held to the rules a build applies: an edit a build would refuse is reported as `portal
|
|
89
|
+
* generate` would report it, and the preview keeps what it last accepted.
|
|
90
|
+
*/
|
|
91
|
+
watchConfig(project, source, artifacts, portalProjectDirectory, onApplied) {
|
|
92
|
+
const sourceDirectory = project.sourceDirectory();
|
|
93
|
+
const sourceContext = project.portalSource();
|
|
94
|
+
const preview = new PreviewConfig(source.config, source.staticDirectory !== null);
|
|
95
|
+
const applyEdit = async () => {
|
|
96
|
+
const reloaded = await sourceContext.resolveSettings(source.suggestedSite);
|
|
97
|
+
if (reloaded.isErr()) {
|
|
98
|
+
preview.refuse();
|
|
99
|
+
this.prompts.configRejected(reloaded.error, sourceDirectory);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const settings = reloaded.value;
|
|
103
|
+
const { config } = settings;
|
|
104
|
+
const missing = settings.generatedPages.missingFrom(artifacts);
|
|
105
|
+
if (missing !== null) {
|
|
106
|
+
preview.refuse();
|
|
107
|
+
this.prompts.editNeedsRestart(missing);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (preview.staticDirectoryNotServed(config)) {
|
|
111
|
+
this.prompts.staticDirectoryNotServed(sourceDirectory);
|
|
112
|
+
}
|
|
113
|
+
const applied = await this.projectService.applyConfig(portalProjectDirectory, settings);
|
|
114
|
+
if (applied.isErr()) {
|
|
115
|
+
this.prompts.configNotApplied(applied.error);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (preview.show(config, applied.value)) {
|
|
119
|
+
this.prompts.configApplied();
|
|
120
|
+
}
|
|
121
|
+
onApplied(settings);
|
|
122
|
+
};
|
|
123
|
+
return this.startWatch((onChange) => this.fileWatchService.watch(sourceDirectory, new FileName(APIMATIC_CONFIG_FILE_NAME), onChange, (reason) => this.prompts.configWatchFailed(reason)), applyEdit, {
|
|
124
|
+
notWatched: (reason) => this.prompts.configNotWatched(reason),
|
|
125
|
+
thrown: (reason) => this.prompts.configNotApplied(reason)
|
|
141
126
|
});
|
|
142
|
-
// Wait for SIGINT or SIGTERM
|
|
143
|
-
this.clearStandardInput();
|
|
144
|
-
await this.prompts.blockExecution();
|
|
145
|
-
await watcher.close();
|
|
146
|
-
debounceService.close();
|
|
147
|
-
liveReloadServer.close();
|
|
148
|
-
server.close();
|
|
149
|
-
return ActionResult.success();
|
|
150
127
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
128
|
+
/** Held to a build's rules, as `apimatic.json` is: a refused save is reported, and the preview kept as it was. */
|
|
129
|
+
watchContent(project, source, generatedPages, portalProjectDirectory) {
|
|
130
|
+
const contentDirectory = source.contentDirectory;
|
|
131
|
+
if (contentDirectory === null) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const sourceDirectory = project.sourceDirectory();
|
|
135
|
+
const sourceContext = project.portalSource();
|
|
136
|
+
const preview = new PreviewContent(source.contentNotices);
|
|
137
|
+
const check = async () => {
|
|
138
|
+
const checked = await sourceContext.resolveContent(source.specs, generatedPages());
|
|
139
|
+
if (checked.isErr()) {
|
|
140
|
+
preview.refuse();
|
|
141
|
+
this.prompts.contentRejected(checked.error, sourceDirectory);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const applied = await this.projectService.applyContent(portalProjectDirectory, contentDirectory, checked.value.files);
|
|
145
|
+
if (applied.isErr()) {
|
|
146
|
+
this.prompts.contentNotApplied(applied.error, sourceDirectory);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const shown = preview.show(checked.value.notices);
|
|
150
|
+
if (shown.fixed) {
|
|
151
|
+
this.prompts.contentAccepted(sourceDirectory);
|
|
152
|
+
}
|
|
153
|
+
this.prompts.contentNotices(shown.notices, sourceDirectory);
|
|
154
|
+
};
|
|
155
|
+
return this.startWatch((onChange) => this.fileWatchService.watchTree(contentDirectory, onChange, (reason) => this.prompts.contentWatchFailed(reason, sourceDirectory),
|
|
156
|
+
// What the build never reads, as an editor's swap file, would only have the check run again.
|
|
157
|
+
isSkippedByGlob), check, {
|
|
158
|
+
notWatched: (reason) => this.prompts.contentNotWatched(reason, sourceDirectory),
|
|
159
|
+
thrown: (reason) => this.prompts.contentNotChecked(reason, sourceDirectory)
|
|
165
160
|
});
|
|
166
161
|
}
|
|
167
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Runs `handle` on each save the watch reports, and once at the start: what it handles was read
|
|
164
|
+
* before the preview started, which can take a minute, and a save made meanwhile reached no watch.
|
|
165
|
+
*/
|
|
166
|
+
startWatch(watch, handle, report) {
|
|
167
|
+
// The watch drops whatever its handler throws, which would leave the preview stale without a word.
|
|
168
|
+
const onChange = async () => {
|
|
169
|
+
try {
|
|
170
|
+
await handle();
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
report.thrown(errorMessage(error));
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const started = watch(onChange);
|
|
177
|
+
if (started.isErr()) {
|
|
178
|
+
report.notWatched(started.error);
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
started.value.recheck();
|
|
182
|
+
return started.value;
|
|
183
|
+
}
|
|
184
|
+
// Clack leaves stdin in raw mode, which swallows CTRL+C until it is released.
|
|
168
185
|
clearStandardInput() {
|
|
169
|
-
if (process.platform !==
|
|
186
|
+
if (process.platform !== 'darwin' && process.stdin.isTTY) {
|
|
170
187
|
process.stdin.setRawMode(false);
|
|
171
188
|
process.stdin.pause();
|
|
172
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/actions/portal/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/actions/portal/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAIrE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAa,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAEzC,MAAM,OAAO,iBAAiB;IACX,OAAO,GAAuB,IAAI,kBAAkB,EAAE,CAAC;IACvD,cAAc,GAAmB,IAAI,cAAc,EAAE,CAAC;IACtD,eAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;IACzD,cAAc,GAAG,IAAI,oBAA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I,EAAE;YAC1B,IAAI,CAAC;gBACH,MAAM,MAAM,EAAE,CAAC;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,CAAC;QACF,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;YACpB,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACjC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,KAAK,CAAC;IACvB,CAAC;IAED,8EAA8E;IACtE,kBAAkB;QACxB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACzD,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -3,11 +3,13 @@ import { PublishingProfileListPrompts } from '../../../prompts/publishing/profil
|
|
|
3
3
|
import { ActionResult } from '../../action-result.js';
|
|
4
4
|
import { PublishingProfiles } from '../../../types/publish/publishing-profiles.js';
|
|
5
5
|
export class PublishingProfileListAction {
|
|
6
|
+
configDir;
|
|
7
|
+
commandMetadata;
|
|
8
|
+
prompts = new PublishingProfileListPrompts();
|
|
9
|
+
publishingApiService = new PublishingApiService();
|
|
6
10
|
constructor(configDir, commandMetadata) {
|
|
7
11
|
this.configDir = configDir;
|
|
8
12
|
this.commandMetadata = commandMetadata;
|
|
9
|
-
this.prompts = new PublishingProfileListPrompts();
|
|
10
|
-
this.publishingApiService = new PublishingApiService();
|
|
11
13
|
}
|
|
12
14
|
async execute() {
|
|
13
15
|
const profilesResult = await this.prompts.fetchProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/actions/publishing/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAGlG,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,MAAM,OAAO,2BAA2B;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/actions/publishing/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAGlG,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,MAAM,OAAO,2BAA2B;IAIT,SAAS;IAAkC,eAAe;IAHtE,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IAC7C,oBAAoB,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAEnE,YAA6B,SAAwB,EAAmB,eAAgC;yBAA3E,SAAS;+BAAkC,eAAe;IAAoB,CAAC;IAErG,KAAK,CAAC,OAAO;QAClB,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CACrD,IAAI,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAC5F,CAAC;QAEF,IAAI,cAAc,CAAC,KAAK,EAAE,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YAC9C,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,wBAAwB,CAAC,KAAK,EAAE,EAAE,CAAC;YACrC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;YAC/B,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC;QAED,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,CAAC;QAC1D,MAAM,qCAAqC,GAAG,kBAAkB,CAAC,uCAAuC,EAAE,CAAC;QAC3G,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,qCAAqC,CAAC,CAAC;QACpE,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
2
|
+
import { ActionResult } from './action-result.js';
|
|
3
|
+
import { CommandMetadata } from '../types/common/command-metadata.js';
|
|
4
4
|
export declare class QuickstartAction {
|
|
5
|
+
private readonly prompts;
|
|
6
|
+
private readonly fileService;
|
|
7
|
+
private readonly fileDownloadService;
|
|
8
|
+
private readonly authorizationService;
|
|
9
|
+
private readonly projectService;
|
|
5
10
|
private readonly configDir;
|
|
6
11
|
private readonly commandMetadata;
|
|
7
|
-
private readonly
|
|
12
|
+
private readonly defaultSpecUrl;
|
|
8
13
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
|
|
9
|
-
readonly execute: () => Promise<ActionResult>;
|
|
14
|
+
readonly execute: (workingDirectory: DirectoryPath) => Promise<ActionResult>;
|
|
15
|
+
private runWizard;
|
|
16
|
+
private adoptProject;
|
|
17
|
+
private startProject;
|
|
18
|
+
private completeProject;
|
|
19
|
+
private importSpec;
|
|
20
|
+
/**
|
|
21
|
+
* `adopted` decides what a failure offers. The sample can replace a specification the user
|
|
22
|
+
* named, but not one their project carries: an adopted `spec/` already holds the document the
|
|
23
|
+
* portal would be built from, and nothing here moves the sample into it.
|
|
24
|
+
*/
|
|
25
|
+
private validate;
|
|
26
|
+
private chooseProjectDirectory;
|
|
27
|
+
private specFormat;
|
|
10
28
|
}
|