@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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ApiService } from '../../infrastructure/services/api-service.js';
|
|
2
2
|
import { PluginRecordMetadataPrompts } from '../../prompts/plugin/record-metadata.js';
|
|
3
|
-
import { PluginConfigContext } from '../../types/plugin-config-context.js';
|
|
4
3
|
import { ActionResult } from '../action-result.js';
|
|
5
4
|
/**
|
|
6
5
|
* Suggested in the prompts as an example of the shape each field takes.
|
|
@@ -16,40 +15,44 @@ const DEFAULT_METADATA = {
|
|
|
16
15
|
* plugin.
|
|
17
16
|
*/
|
|
18
17
|
export class PluginRecordMetadataAction {
|
|
18
|
+
prompts = new PluginRecordMetadataPrompts();
|
|
19
|
+
apiService = new ApiService();
|
|
20
|
+
configDir;
|
|
21
|
+
commandMetadata;
|
|
22
|
+
authKey;
|
|
19
23
|
constructor(configDir, commandMetadata, authKey = null) {
|
|
20
|
-
this.prompts = new PluginRecordMetadataPrompts();
|
|
21
|
-
this.apiService = new ApiService();
|
|
22
|
-
this.execute = async (buildDirectory) => {
|
|
23
|
-
const input = await this.prompts.inputPluginMetadata(DEFAULT_METADATA);
|
|
24
|
-
if ('cancelled' in input) {
|
|
25
|
-
return ActionResult.cancelled(input.cancelled);
|
|
26
|
-
}
|
|
27
|
-
const metadata = input.metadata;
|
|
28
|
-
const account = await this.prompts.spinnerAccountInfo(this.apiService.getAccountInfo(this.configDir, this.commandMetadata.shell, this.authKey));
|
|
29
|
-
if (account.isErr()) {
|
|
30
|
-
this.prompts.accountInfoUnavailable();
|
|
31
|
-
}
|
|
32
|
-
const author = account.isOk() ? authorOf(account.value) : undefined;
|
|
33
|
-
const writeResult = await new PluginConfigContext(buildDirectory).upsertMetadata(metadata, author);
|
|
34
|
-
if (writeResult.isErr()) {
|
|
35
|
-
switch (writeResult.error) {
|
|
36
|
-
case 'unreadable':
|
|
37
|
-
this.prompts.pluginConfigUnreadable();
|
|
38
|
-
return ActionResult.failed();
|
|
39
|
-
case 'unwritable':
|
|
40
|
-
this.prompts.pluginConfigNotWritten();
|
|
41
|
-
return ActionResult.failed();
|
|
42
|
-
default:
|
|
43
|
-
throw writeResult.error;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
this.prompts.metadataRecorded(metadata);
|
|
47
|
-
return ActionResult.success(writeResult.value);
|
|
48
|
-
};
|
|
49
24
|
this.configDir = configDir;
|
|
50
25
|
this.commandMetadata = commandMetadata;
|
|
51
26
|
this.authKey = authKey;
|
|
52
27
|
}
|
|
28
|
+
execute = async (project) => {
|
|
29
|
+
const input = await this.prompts.inputPluginMetadata(DEFAULT_METADATA);
|
|
30
|
+
if ('cancelled' in input) {
|
|
31
|
+
this.prompts.metadataCancelled(input.cancelled);
|
|
32
|
+
return ActionResult.cancelled(input.cancelled);
|
|
33
|
+
}
|
|
34
|
+
const metadata = input.metadata;
|
|
35
|
+
const account = await this.prompts.spinnerAccountInfo(this.apiService.getAccountInfo(this.configDir, this.commandMetadata.shell, this.authKey));
|
|
36
|
+
if (account.isErr()) {
|
|
37
|
+
this.prompts.accountInfoUnavailable();
|
|
38
|
+
}
|
|
39
|
+
const author = account.isOk() ? authorOf(account.value) : undefined;
|
|
40
|
+
const writeResult = await project.pluginConfig().upsertMetadata(metadata, author);
|
|
41
|
+
if (writeResult.isErr()) {
|
|
42
|
+
switch (writeResult.error) {
|
|
43
|
+
case 'unreadable':
|
|
44
|
+
this.prompts.pluginConfigUnreadable();
|
|
45
|
+
return ActionResult.failed();
|
|
46
|
+
case 'unwritable':
|
|
47
|
+
this.prompts.pluginConfigNotWritten();
|
|
48
|
+
return ActionResult.failed();
|
|
49
|
+
default:
|
|
50
|
+
throw writeResult.error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
this.prompts.metadataRecorded(metadata);
|
|
54
|
+
return ActionResult.success(writeResult.value);
|
|
55
|
+
};
|
|
53
56
|
}
|
|
54
57
|
function authorOf(account) {
|
|
55
58
|
return account.FullName ? { name: account.FullName, email: account.Email || undefined } : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-metadata.js","sourceRoot":"","sources":["../../../src/actions/plugin/record-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"record-metadata.js","sourceRoot":"","sources":["../../../src/actions/plugin/record-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAOtF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,gBAAgB,GAAmB;IACvC,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,eAAe;IAC3B,aAAa,EAAE,OAAO;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,0BAA0B;IACpB,OAAO,GAAgC,IAAI,2BAA2B,EAAE,CAAC;IACzE,UAAU,GAAe,IAAI,UAAU,EAAE,CAAC;IAC1C,SAAS,CAAgB;IACzB,eAAe,CAAkB;IACjC,OAAO,CAAgB;IAExC,YAAY,SAAwB,EAAE,eAAgC,EAAE,OAAO,GAAkB,IAAI;Q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oBACtC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC/B,KAAK,YAAY;oBACf,IAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE,CAAC;oBACtC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC/B;oBACE,MAAM,WAAW,CAAC,KAAqB,CAAC;YAC5C,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACxC,OAAO,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjD,CAAC,CAAC;CACH;AAED,SAAS,QAAQ,CAAC,OAAyB;IACzC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACtG,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CommandMetadata } from '../../types/common/command-metadata.js';
|
|
2
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
4
|
+
import { ActionResult } from '../action-result.js';
|
|
4
5
|
export declare class GenerateAction {
|
|
5
6
|
private readonly prompts;
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly portalService;
|
|
7
|
+
private readonly buildService;
|
|
8
8
|
private readonly configDir;
|
|
9
9
|
private readonly commandMetadata;
|
|
10
10
|
private readonly authKey;
|
|
11
11
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
12
|
-
readonly execute: (
|
|
12
|
+
readonly execute: (project: ProjectContext, portalDirectory: DirectoryPath, force: boolean, zipPortal: boolean) => Promise<ActionResult>;
|
|
13
|
+
private confirmOverwrite;
|
|
14
|
+
private build;
|
|
13
15
|
}
|
|
@@ -1,69 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { withDirPath } from "../../infrastructure/tmp-extensions.js";
|
|
7
|
-
import { LauncherService } from "../../infrastructure/launcher-service.js";
|
|
8
|
-
import { TempContext } from "../../types/temp-context.js";
|
|
9
|
-
import { ServiceError } from "../../infrastructure/service-error.js";
|
|
1
|
+
import { PortalBuildService } from '../../infrastructure/portal-build-service.js';
|
|
2
|
+
import { PortalGeneratePrompts } from '../../prompts/portal/generate.js';
|
|
3
|
+
import { PortalContext } from '../../types/portal-context.js';
|
|
4
|
+
import { ActionResult } from '../action-result.js';
|
|
5
|
+
import { PreparePortalProjectAction } from './prepare-project.js';
|
|
10
6
|
export class GenerateAction {
|
|
7
|
+
prompts = new PortalGeneratePrompts();
|
|
8
|
+
buildService = new PortalBuildService();
|
|
9
|
+
configDir;
|
|
10
|
+
commandMetadata;
|
|
11
|
+
authKey;
|
|
11
12
|
constructor(configDir, commandMetadata, authKey = null) {
|
|
12
|
-
this.prompts = new PortalGeneratePrompts();
|
|
13
|
-
this.launcherService = new LauncherService();
|
|
14
|
-
this.portalService = new PortalService();
|
|
15
|
-
this.execute = async (buildDirectory, portalDirectory, force, zipPortal, displayMessages = true) => {
|
|
16
|
-
if (buildDirectory.isEqual(portalDirectory)) {
|
|
17
|
-
this.prompts.directoryCannotBeSame(portalDirectory);
|
|
18
|
-
return ActionResult.failed();
|
|
19
|
-
}
|
|
20
|
-
const buildContext = new BuildContext(buildDirectory);
|
|
21
|
-
if (!(await buildContext.validate())) {
|
|
22
|
-
this.prompts.srcDirectoryEmpty(buildDirectory);
|
|
23
|
-
return ActionResult.failed();
|
|
24
|
-
}
|
|
25
|
-
const portalContext = new PortalContext(portalDirectory);
|
|
26
|
-
if (!force && (await portalContext.exists()) && !(await this.prompts.overwritePortal(portalDirectory))) {
|
|
27
|
-
this.prompts.portalDirectoryNotEmpty();
|
|
28
|
-
return ActionResult.cancelled();
|
|
29
|
-
}
|
|
30
|
-
return await withDirPath(async (tempDirectory) => {
|
|
31
|
-
const tempContext = new TempContext(tempDirectory);
|
|
32
|
-
const buildZipPath = await tempContext.zip(buildDirectory);
|
|
33
|
-
const response = await this.prompts.generatePortal(this.portalService.generatePortal(buildZipPath, this.configDir, this.commandMetadata, this.authKey));
|
|
34
|
-
if (response.isErr()) {
|
|
35
|
-
const error = response.error;
|
|
36
|
-
if (error instanceof ServiceError) {
|
|
37
|
-
const sdkMergeFailedErrors = error.getError("sdkMergeFailed");
|
|
38
|
-
if (sdkMergeFailedErrors) {
|
|
39
|
-
this.prompts.portalGenerationSdkMergeFailed(sdkMergeFailedErrors);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.prompts.portalGenerationError(error.errorMessage);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else if (typeof error === "string") {
|
|
46
|
-
this.prompts.portalGenerationError(error);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const errorZipPath = await tempContext.save(error);
|
|
50
|
-
const reportPath = await portalContext.saveError(errorZipPath);
|
|
51
|
-
await this.launcherService.openFile(reportPath);
|
|
52
|
-
this.prompts.portalGenerationErrorWithReport(reportPath);
|
|
53
|
-
}
|
|
54
|
-
return ActionResult.failed();
|
|
55
|
-
}
|
|
56
|
-
const tempPortalZipPath = await tempContext.save(response.value);
|
|
57
|
-
await portalContext.save(tempPortalZipPath, zipPortal);
|
|
58
|
-
if (displayMessages) {
|
|
59
|
-
this.prompts.portalGenerated(portalDirectory);
|
|
60
|
-
}
|
|
61
|
-
return ActionResult.success();
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
13
|
this.configDir = configDir;
|
|
65
14
|
this.commandMetadata = commandMetadata;
|
|
66
15
|
this.authKey = authKey;
|
|
67
16
|
}
|
|
17
|
+
execute = async (project, portalDirectory, force, zipPortal) => {
|
|
18
|
+
if (project.isSourceDirectory(portalDirectory)) {
|
|
19
|
+
this.prompts.directoryCannotBeSame(portalDirectory);
|
|
20
|
+
return ActionResult.failed();
|
|
21
|
+
}
|
|
22
|
+
// The destination is emptied before the site is written, so a destination that holds
|
|
23
|
+
// the source would delete the very files being built from.
|
|
24
|
+
if (project.isSourceWithin(portalDirectory)) {
|
|
25
|
+
this.prompts.destinationContainsSource(project.sourceDirectory(), portalDirectory);
|
|
26
|
+
return ActionResult.failed();
|
|
27
|
+
}
|
|
28
|
+
const portalContext = new PortalContext(portalDirectory);
|
|
29
|
+
return await new PreparePortalProjectAction(this.configDir, this.commandMetadata, this.authKey).execute(project, {
|
|
30
|
+
confirm: () => this.confirmOverwrite(portalContext, portalDirectory, force),
|
|
31
|
+
onPrepared: (portalProject) => this.build(portalProject, portalContext, portalDirectory, zipPortal)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
async confirmOverwrite(portalContext, portalDirectory, force) {
|
|
35
|
+
if (force || !(await portalContext.exists()) || (await this.prompts.overwritePortal(portalDirectory))) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
this.prompts.portalDirectoryNotEmpty();
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
async build(portalProject, portalContext, portalDirectory, zipPortal) {
|
|
42
|
+
const build = await this.prompts.buildPortal(this.buildService.build(portalProject));
|
|
43
|
+
if (build.isErr()) {
|
|
44
|
+
// Written before the temp directory is removed, so the log outlives the build.
|
|
45
|
+
const logPath = await portalContext.saveBuildLog(build.error.log);
|
|
46
|
+
this.prompts.buildFailed(build.error.log, logPath);
|
|
47
|
+
return ActionResult.failed();
|
|
48
|
+
}
|
|
49
|
+
const saved = await this.prompts.savePortal(portalContext.save(build.value.output, zipPortal));
|
|
50
|
+
if (saved.isErr()) {
|
|
51
|
+
return ActionResult.failed();
|
|
52
|
+
}
|
|
53
|
+
this.prompts.portalGenerated(portalDirectory);
|
|
54
|
+
this.prompts.nextSteps(portalDirectory, zipPortal);
|
|
55
|
+
return ActionResult.success();
|
|
56
|
+
}
|
|
68
57
|
}
|
|
69
58
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/actions/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/actions/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,OAAO,cAAc;IACR,OAAO,GAA0B,IAAI,qBAAqB,EAAE,CAAC;IAC7D,YAAY,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACxC,SAAS,CAAgB;IACzB,eAAe,CAAkB;IACjC,OAAO,CAAgB;IAExC,YAAY,SAAwB,EAAE,eAAgC,EAAE,OAAO,GAAkB,IAAI;QACnG,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEe,OAAO,GAAG,KAAK,EAC7B,OAAuB,EACvB,eAA8B,EAC9B,KAAc,EACd,SAAkB,EACK,EAAE;QACzB,IAAI,OAAO,CAAC,iBAAiB,CAAC,eAAe,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;YACpD,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,qFAAqF;QACrF,2DAA2D;QAC3D,IAAI,OAA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AE,EAAE,CAAC;YAClB,+EAA+E;YAC/E,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YACnD,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;QAC/F,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;YAClB,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QAEnD,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PortalProjectPaths } from '../../infrastructure/portal-project-service.js';
|
|
2
|
+
import { CommandMetadata } from '../../types/common/command-metadata.js';
|
|
3
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
4
|
+
import { PortalArtifacts } from '../../types/portal/portal-artifacts.js';
|
|
5
|
+
import { PortalSource } from '../../types/portal/portal-source.js';
|
|
6
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
7
|
+
import { ActionResult } from '../action-result.js';
|
|
8
|
+
/** What the caller does within the shared run, in the order the run does it. */
|
|
9
|
+
export interface PreparationSteps {
|
|
10
|
+
/** Asked once the source is read, before the artifacts are fetched; false cancels the run. */
|
|
11
|
+
confirm?: () => Promise<boolean>;
|
|
12
|
+
onPrepared: (portalProject: PortalProjectPaths, source: PortalSource, artifacts: PortalArtifacts) => Promise<ActionResult>;
|
|
13
|
+
}
|
|
14
|
+
export declare class PreparePortalProjectAction {
|
|
15
|
+
private readonly configDir;
|
|
16
|
+
private readonly commandMetadata;
|
|
17
|
+
private readonly authKey;
|
|
18
|
+
private readonly prompts;
|
|
19
|
+
private readonly projectService;
|
|
20
|
+
private readonly authorizationService;
|
|
21
|
+
private readonly artifactsService;
|
|
22
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
23
|
+
/** Takes the caller's next step rather than returning, because its temporary directories must outlive this call. */
|
|
24
|
+
readonly execute: (project: ProjectContext, { confirm, onPrepared }: PreparationSteps) => Promise<ActionResult>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { PortalProjectService } from '../../infrastructure/portal-project-service.js';
|
|
2
|
+
import { PortalArtifactsService } from '../../infrastructure/services/portal-artifacts-service.js';
|
|
3
|
+
import { PortalAuthorizationService } from '../../infrastructure/services/portal-authorization-service.js';
|
|
4
|
+
import { withPortalProjectDirectory, withDirPath } from '../../infrastructure/tmp-extensions.js';
|
|
5
|
+
import { PreparePortalProjectPrompts } from '../../prompts/portal/prepare-project.js';
|
|
6
|
+
import { ActionResult } from '../action-result.js';
|
|
7
|
+
export class PreparePortalProjectAction {
|
|
8
|
+
configDir;
|
|
9
|
+
commandMetadata;
|
|
10
|
+
authKey;
|
|
11
|
+
prompts = new PreparePortalProjectPrompts();
|
|
12
|
+
projectService = new PortalProjectService();
|
|
13
|
+
authorizationService = new PortalAuthorizationService();
|
|
14
|
+
artifactsService = new PortalArtifactsService();
|
|
15
|
+
constructor(configDir, commandMetadata, authKey = null) {
|
|
16
|
+
this.configDir = configDir;
|
|
17
|
+
this.commandMetadata = commandMetadata;
|
|
18
|
+
this.authKey = authKey;
|
|
19
|
+
}
|
|
20
|
+
/** Takes the caller's next step rather than returning, because its temporary directories must outlive this call. */
|
|
21
|
+
execute = async (project, { confirm = async () => true, onPrepared }) => {
|
|
22
|
+
const sourceDirectory = project.sourceDirectory();
|
|
23
|
+
const runtimeProblem = this.projectService.runtimeProblem();
|
|
24
|
+
if (runtimeProblem !== null) {
|
|
25
|
+
this.prompts.runtimeUnsupported(runtimeProblem);
|
|
26
|
+
return ActionResult.failed();
|
|
27
|
+
}
|
|
28
|
+
const authorization = await this.authorizationService.authorize(this.configDir, this.commandMetadata.shell, this.authKey);
|
|
29
|
+
if (authorization.isErr()) {
|
|
30
|
+
this.prompts.authorizationFailed(authorization.error);
|
|
31
|
+
return ActionResult.failed();
|
|
32
|
+
}
|
|
33
|
+
// Ahead of the server run, which can take minutes: a mistake or a question should not wait on it.
|
|
34
|
+
const source = await project.portalSource().resolve();
|
|
35
|
+
if (source.isErr()) {
|
|
36
|
+
this.prompts.sourceProblem(source.error, sourceDirectory);
|
|
37
|
+
return ActionResult.failed();
|
|
38
|
+
}
|
|
39
|
+
this.prompts.filesShadowedByStatic(source.value.shadowedFiles);
|
|
40
|
+
this.prompts.contentNotices(source.value.contentNotices, sourceDirectory);
|
|
41
|
+
if (!(await confirm())) {
|
|
42
|
+
return ActionResult.cancelled();
|
|
43
|
+
}
|
|
44
|
+
// The artifacts live in this directory for as long as the caller needs them, so it wraps
|
|
45
|
+
// everything that reads them rather than being opened and closed around the call.
|
|
46
|
+
return await withDirPath(async (artifactsDirectory) => {
|
|
47
|
+
const artifacts = await this.prompts.generateArtifacts(this.artifactsService.generate(sourceDirectory, artifactsDirectory, this.configDir, this.commandMetadata, this.authKey));
|
|
48
|
+
if (artifacts.isErr()) {
|
|
49
|
+
return ActionResult.failed();
|
|
50
|
+
}
|
|
51
|
+
this.prompts.unplacedSamples(artifacts.value.codeSampleCatalogs.unplacedIn(source.value.specs.flatMap((spec) => spec.endpoints)));
|
|
52
|
+
const missing = source.value.generatedPages.missingFrom(artifacts.value);
|
|
53
|
+
if (missing !== null) {
|
|
54
|
+
this.prompts.artifactsIncomplete(missing);
|
|
55
|
+
return ActionResult.failed();
|
|
56
|
+
}
|
|
57
|
+
return await withPortalProjectDirectory(sourceDirectory, async (tempDirectory) => {
|
|
58
|
+
const portalProject = await this.projectService.prepare(tempDirectory, source.value, artifacts.value);
|
|
59
|
+
if (portalProject.isErr()) {
|
|
60
|
+
this.prompts.runtimeUnsupported(portalProject.error);
|
|
61
|
+
return ActionResult.failed();
|
|
62
|
+
}
|
|
63
|
+
return await onPrepared(portalProject.value, source.value, artifacts.value);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=prepare-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-project.js","sourceRoot":"","sources":["../../../src/actions/portal/prepare-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAMtF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAanD,MAAM,OAAO,0BAA0B;IAOlB,SAAS;IACT,eAAe;IACf,OAAO;IART,OAAO,GAAgC,IAAI,2BAA2B,EAAE,CAAC;IACzE,cAAc,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC5C,oBAAoB,GAAG,IAAI,0BAA0B,EAAE,CAAC;IACxD,gBAAgB,GAAG,IAAI,sBAAsB,EAAE,CAAC;IAEjE,YACmB,SAAwB,EACxB,eAAgC,EAChC,OAAO,GAAkB,IAAI;yBAF7B,SAAS;+BACT,eAAe;uBACf,OAAO;IACvB,CAAC;IAEJ,oHAAoH;IACpG,OAAO,GAAG,KAAK,EAC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,CAAC,kBAAkB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;oBACrD,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC/B,CAAC;gBAED,OAAO,MAAM,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;YAC9E,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;CACH"}
|
|
@@ -1,16 +1,31 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { ActionResult } from
|
|
3
|
-
import { CommandMetadata } from
|
|
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
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
5
|
+
export declare const DEFAULT_PORTAL_PORT = 23513;
|
|
4
6
|
export declare class PortalServeAction {
|
|
5
7
|
private readonly prompts;
|
|
6
8
|
private readonly networkService;
|
|
7
9
|
private readonly launcherService;
|
|
8
|
-
private readonly
|
|
10
|
+
private readonly projectService;
|
|
11
|
+
private readonly devServerService;
|
|
12
|
+
private readonly fileWatchService;
|
|
9
13
|
private readonly configDir;
|
|
10
14
|
private readonly commandMetadata;
|
|
11
15
|
private readonly authKey;
|
|
12
16
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
13
|
-
execute
|
|
14
|
-
|
|
17
|
+
readonly execute: (project: ProjectContext, port: number, openInBrowser: boolean, onServing?: () => void) => Promise<ActionResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Held to the rules a build applies: an edit a build would refuse is reported as `portal
|
|
20
|
+
* generate` would report it, and the preview keeps what it last accepted.
|
|
21
|
+
*/
|
|
22
|
+
private watchConfig;
|
|
23
|
+
/** Held to a build's rules, as `apimatic.json` is: a refused save is reported, and the preview kept as it was. */
|
|
24
|
+
private watchContent;
|
|
25
|
+
/**
|
|
26
|
+
* Runs `handle` on each save the watch reports, and once at the start: what it handles was read
|
|
27
|
+
* before the preview started, which can take a minute, and a save made meanwhile reached no watch.
|
|
28
|
+
*/
|
|
29
|
+
private startWatch;
|
|
15
30
|
private clearStandardInput;
|
|
16
31
|
}
|