@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,14 +1,17 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { ActionResult } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
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 { ResourceInput } from '../../types/file/resource-input.js';
|
|
5
|
+
/** `unchecked`: the spec could not be fetched or the validation service did not answer, so nothing is known of it. */
|
|
6
|
+
export type SpecCheck = 'valid' | 'invalid' | 'unchecked';
|
|
6
7
|
export declare class ValidateAction {
|
|
7
8
|
private readonly prompts;
|
|
8
9
|
private readonly validationService;
|
|
9
10
|
private readonly authKey;
|
|
10
11
|
private readonly commandMetadata;
|
|
11
12
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
12
|
-
|
|
13
|
+
/** `onChecked` hears what the validation found, which the `ActionResult` alone cannot tell apart. */
|
|
14
|
+
readonly execute: (resourcePath: ResourceInput, displayValidationSummary?: boolean, onChecked?: (check: SpecCheck) => void) => Promise<ActionResult>;
|
|
15
|
+
private readonly check;
|
|
13
16
|
private hasValidationIssues;
|
|
14
17
|
}
|
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
import { ActionResult } from
|
|
2
|
-
import { ApiValidatePrompts } from
|
|
3
|
-
import { ValidationService } from
|
|
4
|
-
import { withDirPath } from
|
|
5
|
-
import { ResourceContext } from
|
|
1
|
+
import { ActionResult } from '../action-result.js';
|
|
2
|
+
import { ApiValidatePrompts } from '../../prompts/api/validate.js';
|
|
3
|
+
import { ValidationService } from '../../infrastructure/services/validation-service.js';
|
|
4
|
+
import { withDirPath } from '../../infrastructure/tmp-extensions.js';
|
|
5
|
+
import { ResourceContext } from '../../types/resource-context.js';
|
|
6
6
|
export class ValidateAction {
|
|
7
|
+
prompts = new ApiValidatePrompts();
|
|
8
|
+
validationService;
|
|
9
|
+
authKey;
|
|
10
|
+
commandMetadata;
|
|
7
11
|
constructor(configDir, commandMetadata, authKey = null) {
|
|
8
|
-
this.prompts = new ApiValidatePrompts();
|
|
9
|
-
this.execute = async (resourcePath, displayValidationSummary = true) => {
|
|
10
|
-
return await withDirPath(async (tempDirectory) => {
|
|
11
|
-
const resourceContext = new ResourceContext(tempDirectory);
|
|
12
|
-
const specFileDirResult = await resourceContext.resolveTo(resourcePath);
|
|
13
|
-
if (specFileDirResult.isErr()) {
|
|
14
|
-
this.prompts.networkError(specFileDirResult.error);
|
|
15
|
-
return ActionResult.failed();
|
|
16
|
-
}
|
|
17
|
-
const validationSummaryResult = await this.prompts.validateApi(this.validationService.validateViaFile({
|
|
18
|
-
file: specFileDirResult.value,
|
|
19
|
-
commandMetadata: this.commandMetadata,
|
|
20
|
-
authKey: this.authKey
|
|
21
|
-
}));
|
|
22
|
-
if (validationSummaryResult.isErr()) {
|
|
23
|
-
this.prompts.logValidationError(validationSummaryResult.error);
|
|
24
|
-
return ActionResult.failed();
|
|
25
|
-
}
|
|
26
|
-
const validationSummary = validationSummaryResult.value;
|
|
27
|
-
if (displayValidationSummary) {
|
|
28
|
-
if (this.hasValidationIssues(validationSummary.result.validation)) {
|
|
29
|
-
this.prompts.displayValidationSummary(validationSummary.result.validation);
|
|
30
|
-
}
|
|
31
|
-
if (this.hasValidationIssues(validationSummary.result.linting)) {
|
|
32
|
-
this.prompts.displayValidationSummary(validationSummary.result.linting);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (!validationSummary.result.validation.isSuccess || !validationSummary.result.linting.isSuccess) {
|
|
36
|
-
return ActionResult.failed();
|
|
37
|
-
}
|
|
38
|
-
return ActionResult.success(validationSummary.unallowedFeatures);
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
12
|
this.authKey = authKey;
|
|
42
13
|
this.validationService = new ValidationService(configDir);
|
|
43
14
|
this.commandMetadata = commandMetadata;
|
|
44
15
|
}
|
|
16
|
+
/** `onChecked` hears what the validation found, which the `ActionResult` alone cannot tell apart. */
|
|
17
|
+
execute = async (resourcePath, displayValidationSummary = true, onChecked) => {
|
|
18
|
+
const check = await this.check(resourcePath, displayValidationSummary);
|
|
19
|
+
onChecked?.(check);
|
|
20
|
+
return check === 'valid' ? ActionResult.success() : ActionResult.failed();
|
|
21
|
+
};
|
|
22
|
+
check = async (resourcePath, displayValidationSummary) => {
|
|
23
|
+
return await withDirPath(async (tempDirectory) => {
|
|
24
|
+
const resourceContext = new ResourceContext(tempDirectory);
|
|
25
|
+
const specFileDirResult = await resourceContext.resolveTo(resourcePath);
|
|
26
|
+
if (specFileDirResult.isErr()) {
|
|
27
|
+
this.prompts.networkError(specFileDirResult.error);
|
|
28
|
+
return 'unchecked';
|
|
29
|
+
}
|
|
30
|
+
const validationSummaryResult = await this.prompts.validateApi(this.validationService.validateViaFile({
|
|
31
|
+
file: specFileDirResult.value,
|
|
32
|
+
commandMetadata: this.commandMetadata,
|
|
33
|
+
authKey: this.authKey
|
|
34
|
+
}));
|
|
35
|
+
if (validationSummaryResult.isErr()) {
|
|
36
|
+
this.prompts.logValidationError(validationSummaryResult.error.message);
|
|
37
|
+
return validationSummaryResult.error.kind === 'rejected' ? 'invalid' : 'unchecked';
|
|
38
|
+
}
|
|
39
|
+
const { validation, linting } = validationSummaryResult.value;
|
|
40
|
+
if (displayValidationSummary) {
|
|
41
|
+
if (this.hasValidationIssues(validation)) {
|
|
42
|
+
this.prompts.displayValidationSummary(validation);
|
|
43
|
+
}
|
|
44
|
+
if (this.hasValidationIssues(linting)) {
|
|
45
|
+
this.prompts.displayValidationSummary(linting);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return validation.isSuccess && linting.isSuccess ? 'valid' : 'invalid';
|
|
49
|
+
});
|
|
50
|
+
};
|
|
45
51
|
hasValidationIssues(summary) {
|
|
46
52
|
return (summary.blocking.length > 0 ||
|
|
47
53
|
summary.errors.length > 0 ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/actions/api/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/actions/api/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMlE,MAAM,OAAO,cAAc;IACR,OAAO,GAAuB,IAAI,kBAAkB,EAAE,CAAC;IACvD,iBAAiB,CAAoB;IACrC,OAAO,CAAgB;IACvB,eAAe,CAAkB;IAElD,YAAY,SAAwB,EAAE,eAAgC,EAAE,OAAO,GAAkB,IAAI;QACnG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,SA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,CAAC,OAAO,CAAC,CAAC;gBACvE,OAAO,uBAAuB,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;YACrF,CAAC;YACD,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,uBAAuB,CAAC,KAAK,CAAC;YAC9D,IAAI,wBAAwB,EAAE,CAAC;gBAC7B,IAAI,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;oBACzC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;gBACpD,CAAC;gBACD,IAAI,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;oBACtC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;gBACjD,CAAC;YACH,CAAC;YACD,OAAO,UAAU,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEM,mBAAmB,CAAC,OAA0B;QACpD,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAC3B,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAC3B,OAAO,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAC/B,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -6,13 +6,16 @@ import { setAuthInfo } from "../../client-utils/auth-manager.js";
|
|
|
6
6
|
import { LoginPrompts } from "../../prompts/auth/login.js";
|
|
7
7
|
import { ActionResult } from "../action-result.js";
|
|
8
8
|
import { err, ok } from "neverthrow";
|
|
9
|
+
import { sleep } from "../../infrastructure/timer-extensions.js";
|
|
9
10
|
export class LoginAction {
|
|
11
|
+
configDir;
|
|
12
|
+
commandMetadata;
|
|
13
|
+
authService = new AuthService();
|
|
14
|
+
apiService = new ApiService();
|
|
15
|
+
prompts = new LoginPrompts();
|
|
10
16
|
constructor(configDir, commandMetadata) {
|
|
11
17
|
this.configDir = configDir;
|
|
12
18
|
this.commandMetadata = commandMetadata;
|
|
13
|
-
this.authService = new AuthService();
|
|
14
|
-
this.apiService = new ApiService();
|
|
15
|
-
this.prompts = new LoginPrompts();
|
|
16
19
|
}
|
|
17
20
|
async execute(apiKey = undefined) {
|
|
18
21
|
const apiKeyResult = await this.pollDeviceToken(apiKey, this.commandMetadata.shell);
|
|
@@ -48,7 +51,7 @@ export class LoginAction {
|
|
|
48
51
|
if (result.isOk()) {
|
|
49
52
|
return ok(result.value.apiKey);
|
|
50
53
|
}
|
|
51
|
-
await
|
|
54
|
+
await sleep(delayMs);
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/actions/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/actions/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM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AC,CAAC;YACjC,CAAC;YACD,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -2,9 +2,10 @@ import { ActionResult } from "../action-result.js";
|
|
|
2
2
|
import { removeAuthInfo } from "../../client-utils/auth-manager.js";
|
|
3
3
|
import { LogoutPrompts } from "../../prompts/auth/logout.js";
|
|
4
4
|
export class LogoutAction {
|
|
5
|
+
configDir;
|
|
6
|
+
prompts = new LogoutPrompts();
|
|
5
7
|
constructor(configDir) {
|
|
6
8
|
this.configDir = configDir;
|
|
7
|
-
this.prompts = new LogoutPrompts();
|
|
8
9
|
}
|
|
9
10
|
async execute() {
|
|
10
11
|
await removeAuthInfo(this.configDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/actions/auth/logout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/actions/auth/logout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,YAAY;IAGM,SAAS;IAFrB,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IAE/C,YAA6B,SAAwB;yBAAxB,SAAS;IAAkB,CAAC;IAElD,KAAK,CAAC,OAAO;QAClB,MAAM,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC9B,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -3,18 +3,20 @@ import { getAuthInfo } from "../../client-utils/auth-manager.js";
|
|
|
3
3
|
import { StatusPrompts } from "../../prompts/auth/status.js";
|
|
4
4
|
import { ApiService } from "../../infrastructure/services/api-service.js";
|
|
5
5
|
export class StatusAction {
|
|
6
|
+
configDir;
|
|
7
|
+
commandMetadata;
|
|
8
|
+
prompts = new StatusPrompts();
|
|
9
|
+
apiService = new ApiService();
|
|
6
10
|
constructor(configDir, commandMetadata) {
|
|
7
11
|
this.configDir = configDir;
|
|
8
12
|
this.commandMetadata = commandMetadata;
|
|
9
|
-
this.prompts = new StatusPrompts();
|
|
10
|
-
this.apiService = new ApiService();
|
|
11
13
|
}
|
|
12
14
|
async execute(authKey) {
|
|
13
15
|
const accountInfo = await getAuthInfo(this.configDir.toString());
|
|
14
16
|
// `auth logout` blanks config.json rather than deleting it, so a logged-out user still
|
|
15
17
|
// has a non-null AuthInfo with an empty key. Checking the key catches both that and a
|
|
16
18
|
// missing config file, and avoids a request that can only come back 401.
|
|
17
|
-
if (!
|
|
19
|
+
if (!accountInfo?.authKey) {
|
|
18
20
|
this.prompts.notLoggedIn();
|
|
19
21
|
return ActionResult.failed();
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/actions/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/actions/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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 +1,16 @@
|
|
|
1
1
|
import { CommandMetadata } from '../../types/common/command-metadata.js';
|
|
2
2
|
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
3
4
|
import { ActionResult } from '../action-result.js';
|
|
4
5
|
export declare class PluginGenerateAction {
|
|
5
6
|
private readonly prompts;
|
|
6
7
|
private readonly pluginService;
|
|
8
|
+
private readonly publishingApiService;
|
|
7
9
|
private readonly configDir;
|
|
8
10
|
private readonly commandMetadata;
|
|
9
11
|
private readonly authKey;
|
|
10
12
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
11
|
-
readonly execute: (
|
|
13
|
+
readonly execute: (project: ProjectContext, pluginDirectory: DirectoryPath, force: boolean) => Promise<ActionResult>;
|
|
14
|
+
/** A record, a staging and a generation fault land here alike; only the wording differs. */
|
|
15
|
+
private readonly reportGenerationProblem;
|
|
12
16
|
}
|
|
@@ -1,71 +1,98 @@
|
|
|
1
|
+
import { ResultAsync } from 'neverthrow';
|
|
1
2
|
import { withDirPath } from '../../infrastructure/tmp-extensions.js';
|
|
2
3
|
import { PluginService } from '../../infrastructure/services/plugin-service.js';
|
|
4
|
+
import { PublishingApiService } from '../../infrastructure/services/publishing-api-service.js';
|
|
3
5
|
import { PluginGeneratePrompts } from '../../prompts/plugin/generate.js';
|
|
4
|
-
import {
|
|
5
|
-
import { PluginConfigContext } from '../../types/plugin-config-context.js';
|
|
6
|
+
import { PluginConfig } from '../../types/plugin-config-context.js';
|
|
6
7
|
import { PluginContext } from '../../types/plugin-context.js';
|
|
8
|
+
import { PublishingProfiles } from '../../types/publish/publishing-profiles.js';
|
|
7
9
|
import { TempContext } from '../../types/temp-context.js';
|
|
8
10
|
import { ActionResult } from '../action-result.js';
|
|
9
11
|
import { PluginRecordMetadataAction } from './record-metadata.js';
|
|
10
12
|
export class PluginGenerateAction {
|
|
13
|
+
prompts = new PluginGeneratePrompts();
|
|
14
|
+
pluginService = new PluginService();
|
|
15
|
+
publishingApiService = new PublishingApiService();
|
|
16
|
+
configDir;
|
|
17
|
+
commandMetadata;
|
|
18
|
+
authKey;
|
|
11
19
|
constructor(configDir, commandMetadata, authKey = null) {
|
|
12
|
-
this.prompts = new PluginGeneratePrompts();
|
|
13
|
-
this.pluginService = new PluginService();
|
|
14
|
-
this.execute = async (buildDirectory, pluginDirectory, force) => {
|
|
15
|
-
if (buildDirectory.isEqual(pluginDirectory)) {
|
|
16
|
-
this.prompts.directoryCannotBeSame(pluginDirectory);
|
|
17
|
-
return ActionResult.failed();
|
|
18
|
-
}
|
|
19
|
-
const buildContext = new BuildContext(buildDirectory);
|
|
20
|
-
if (!(await buildContext.exists())) {
|
|
21
|
-
this.prompts.srcDirectoryDoesNotExist(buildDirectory);
|
|
22
|
-
return ActionResult.failed();
|
|
23
|
-
}
|
|
24
|
-
const pluginContext = new PluginContext(pluginDirectory);
|
|
25
|
-
if (!force && (await pluginContext.exists()) && !(await this.prompts.overwritePlugin(pluginDirectory))) {
|
|
26
|
-
this.prompts.pluginDirectoryNotEmpty();
|
|
27
|
-
return ActionResult.cancelled();
|
|
28
|
-
}
|
|
29
|
-
let configState = await new PluginConfigContext(buildDirectory).getPluginConfigState();
|
|
30
|
-
if (configState.state === 'unreadable') {
|
|
31
|
-
this.prompts.pluginConfigUnreadable(configState.reason, configState.path);
|
|
32
|
-
return ActionResult.failed();
|
|
33
|
-
}
|
|
34
|
-
if (configState.state === 'missing' || !configState.hasMetadata()) {
|
|
35
|
-
const metadataResult = await new PluginRecordMetadataAction(this.configDir, this.commandMetadata, this.authKey).execute(buildDirectory);
|
|
36
|
-
if (metadataResult.isCancelled()) {
|
|
37
|
-
this.prompts.metadataCancelled(metadataResult.getMessage());
|
|
38
|
-
return ActionResult.cancelled();
|
|
39
|
-
}
|
|
40
|
-
if (!metadataResult.isSuccess()) {
|
|
41
|
-
return metadataResult.discardValue();
|
|
42
|
-
}
|
|
43
|
-
configState = metadataResult.getValue();
|
|
44
|
-
}
|
|
45
|
-
if (!configState.hasPublishedSdks()) {
|
|
46
|
-
this.prompts.noPublishedSdks();
|
|
47
|
-
this.prompts.nextStepsPublishSdks();
|
|
48
|
-
return ActionResult.success();
|
|
49
|
-
}
|
|
50
|
-
return await withDirPath(async (tempDirectory) => {
|
|
51
|
-
const tempContext = new TempContext(tempDirectory);
|
|
52
|
-
const buildZipPath = await tempContext.zip(buildDirectory);
|
|
53
|
-
const response = await this.prompts.generatePlugin(this.pluginService.generatePlugin(buildZipPath, this.configDir, this.commandMetadata, this.authKey));
|
|
54
|
-
if (response.isErr()) {
|
|
55
|
-
this.prompts.pluginGenerationError(response.error.errorMessage);
|
|
56
|
-
return ActionResult.failed();
|
|
57
|
-
}
|
|
58
|
-
const tempPluginZipPath = await tempContext.save(response.value);
|
|
59
|
-
await pluginContext.save(tempPluginZipPath);
|
|
60
|
-
this.prompts.pluginGenerated(pluginDirectory);
|
|
61
|
-
this.prompts.tryPluginLocally(pluginDirectory);
|
|
62
|
-
this.prompts.nextStepsPublishPlugin();
|
|
63
|
-
return ActionResult.success();
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
20
|
this.configDir = configDir;
|
|
67
21
|
this.commandMetadata = commandMetadata;
|
|
68
22
|
this.authKey = authKey;
|
|
69
23
|
}
|
|
24
|
+
execute = async (project, pluginDirectory, force) => {
|
|
25
|
+
const sourceDirectory = project.sourceDirectory();
|
|
26
|
+
if (project.isSourceDirectory(pluginDirectory)) {
|
|
27
|
+
this.prompts.directoryCannotBeSame(pluginDirectory);
|
|
28
|
+
return ActionResult.failed();
|
|
29
|
+
}
|
|
30
|
+
if (!(await project.sourceExists())) {
|
|
31
|
+
this.prompts.sourceDirectoryDoesNotExist(sourceDirectory);
|
|
32
|
+
return ActionResult.failed();
|
|
33
|
+
}
|
|
34
|
+
const pluginContext = new PluginContext(pluginDirectory);
|
|
35
|
+
if (!force && (await pluginContext.exists()) && !(await this.prompts.overwritePlugin(pluginDirectory))) {
|
|
36
|
+
this.prompts.pluginDirectoryNotEmpty();
|
|
37
|
+
return ActionResult.cancelled();
|
|
38
|
+
}
|
|
39
|
+
const configContext = project.pluginConfig();
|
|
40
|
+
const configState = await configContext.getPluginConfigState();
|
|
41
|
+
if (configState.state === 'unreadable') {
|
|
42
|
+
this.prompts.pluginConfigUnreadable(configState.reason, configState.path);
|
|
43
|
+
return ActionResult.failed();
|
|
44
|
+
}
|
|
45
|
+
const recorded = configState.state === 'missing' ? PluginConfig.empty : configState;
|
|
46
|
+
if (!recorded.isSetUp() && !this.prompts.canAsk()) {
|
|
47
|
+
this.prompts.setupNeedsTerminal(sourceDirectory, recorded);
|
|
48
|
+
return ActionResult.failed();
|
|
49
|
+
}
|
|
50
|
+
const identified = recorded.hasMetadata()
|
|
51
|
+
? ActionResult.success(recorded)
|
|
52
|
+
: await new PluginRecordMetadataAction(this.configDir, this.commandMetadata, this.authKey).execute(project);
|
|
53
|
+
if (!identified.isSuccess()) {
|
|
54
|
+
return identified.discardValue();
|
|
55
|
+
}
|
|
56
|
+
const config = identified.getValue();
|
|
57
|
+
const selection = config.hasRecordedLanguages() ? config.recordedLanguages() : await this.prompts.selectLanguages();
|
|
58
|
+
if (!selection?.length) {
|
|
59
|
+
this.prompts.noLanguagesSelected();
|
|
60
|
+
return ActionResult.cancelled();
|
|
61
|
+
}
|
|
62
|
+
this.prompts.recordedLanguagesIncluded(config.recordedLanguages());
|
|
63
|
+
this.prompts.languagesNotIncluded(config.unsupportedLanguages());
|
|
64
|
+
// Asked before the config is written, so a declined run leaves no language claimed in it.
|
|
65
|
+
const couldPublishInstead = selection.some((language) => !config.publishedLanguages().includes(language)) &&
|
|
66
|
+
(await this.prompts.checkPublishingProfiles(this.publishingApiService.getPublishingProfiles(this.configDir, this.commandMetadata.shell, this.authKey)))
|
|
67
|
+
.andThen(PublishingProfiles.create)
|
|
68
|
+
.map((profiles) => profiles.getActiveProfiles().length > 0)
|
|
69
|
+
.unwrapOr(false);
|
|
70
|
+
if (couldPublishInstead && !(await this.prompts.confirmLocalPlugin(recorded.isSetUp()))) {
|
|
71
|
+
this.prompts.localPluginCancelled();
|
|
72
|
+
return ActionResult.cancelled();
|
|
73
|
+
}
|
|
74
|
+
const generated = await withDirPath(async (tempDirectory) => {
|
|
75
|
+
const tempContext = new TempContext(tempDirectory);
|
|
76
|
+
const written = await configContext.recordLanguages(selection);
|
|
77
|
+
return await written
|
|
78
|
+
.asyncAndThen(() => new ResultAsync(configContext.stageUpload(tempDirectory, selection)))
|
|
79
|
+
.map((staged) => tempContext.zip(staged))
|
|
80
|
+
.andThen((upload) => new ResultAsync(this.prompts.generatePlugin(this.pluginService.generatePlugin(upload, this.configDir, this.commandMetadata, this.authKey))))
|
|
81
|
+
.map(async (stream) => pluginContext.save(await tempContext.save(stream)));
|
|
82
|
+
});
|
|
83
|
+
if (generated.isErr()) {
|
|
84
|
+
this.reportGenerationProblem(generated.error, sourceDirectory);
|
|
85
|
+
return ActionResult.failed();
|
|
86
|
+
}
|
|
87
|
+
this.prompts.installPluginLocally(pluginDirectory);
|
|
88
|
+
if (couldPublishInstead) {
|
|
89
|
+
this.prompts.previewOnly();
|
|
90
|
+
}
|
|
91
|
+
return ActionResult.success();
|
|
92
|
+
};
|
|
93
|
+
/** A record, a staging and a generation fault land here alike; only the wording differs. */
|
|
94
|
+
reportGenerationProblem = (problem, sourceDirectory) => typeof problem === 'string'
|
|
95
|
+
? this.prompts.configNotPrepared(problem, sourceDirectory)
|
|
96
|
+
: this.prompts.pluginGenerationError(problem.errorMessage);
|
|
70
97
|
}
|
|
71
98
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/actions/plugin/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,
|
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AC,CAC9F,CACF,CACJ;iBACA,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;QACH,IAAI,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;YACtB,IAAI,CAAC,uBAAuB,CAAC,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YAC/D,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,mBAAmB,EAAE,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC;QAED,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC,CAAC;IAEF,4FAA4F;IAC3E,uBAAuB,GAAG,CACzC,OAAgD,EAChD,eAA8B,EAC9B,EAAE,CACF,OAAO,OAAO,KAAK,QAAQ;QACzB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,EAAE,eAAe,CAAC;QAC1D,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;CAChE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
2
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
2
3
|
import { ActionResult } from '../action-result.js';
|
|
3
4
|
export declare class PluginPublishAction {
|
|
4
5
|
private readonly prompts;
|
|
5
|
-
readonly execute: (
|
|
6
|
+
readonly execute: (project: ProjectContext, pluginDirectory: DirectoryPath) => Promise<ActionResult>;
|
|
6
7
|
}
|
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
import { PluginPublishPrompts } from '../../prompts/plugin/publish.js';
|
|
2
|
-
import { PluginConfigContext } from '../../types/plugin-config-context.js';
|
|
3
2
|
import { PluginContext } from '../../types/plugin-context.js';
|
|
4
3
|
import { ActionResult } from '../action-result.js';
|
|
5
4
|
export class PluginPublishAction {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}
|
|
5
|
+
prompts = new PluginPublishPrompts();
|
|
6
|
+
execute = async (project, pluginDirectory) => {
|
|
7
|
+
if (project.isSourceDirectory(pluginDirectory)) {
|
|
8
|
+
this.prompts.directoryCannotBeSame(pluginDirectory);
|
|
9
|
+
return ActionResult.failed();
|
|
10
|
+
}
|
|
11
|
+
const pluginContext = new PluginContext(pluginDirectory);
|
|
12
|
+
if (!(await pluginContext.exists())) {
|
|
13
|
+
this.prompts.pluginNotGenerated(pluginDirectory);
|
|
14
|
+
return ActionResult.failed();
|
|
15
|
+
}
|
|
16
|
+
const configState = await project.pluginConfig().getPluginConfigState();
|
|
17
|
+
if (configState.state === 'unreadable') {
|
|
18
|
+
this.prompts.pluginConfigUnreadable(configState.reason, configState.path);
|
|
19
|
+
return ActionResult.failed();
|
|
20
|
+
}
|
|
21
|
+
if (configState.state === 'missing') {
|
|
22
|
+
this.prompts.pluginConfigMissing(project.sourceDirectory());
|
|
23
|
+
return ActionResult.failed();
|
|
24
|
+
}
|
|
25
|
+
const release = configState.getRelease();
|
|
26
|
+
if (!release) {
|
|
27
|
+
this.prompts.pluginDetailsNotSet();
|
|
28
|
+
return ActionResult.failed();
|
|
29
|
+
}
|
|
30
|
+
const contents = await pluginContext.describeContents();
|
|
31
|
+
if (await pluginContext.isGitInitialized()) {
|
|
32
|
+
this.prompts.updateInstructions(release, contents, pluginDirectory);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.prompts.firstPublishInstructions(release, contents, pluginDirectory);
|
|
36
|
+
}
|
|
37
|
+
return ActionResult.success();
|
|
38
|
+
};
|
|
42
39
|
}
|
|
43
40
|
//# sourceMappingURL=publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/actions/plugin/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/actions/plugin/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,OAAO,mBAAmB;IACb,OAAO,GAAyB,IAAI,oBAAoB,EAAE,CAAC;IAE5D,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAE,eAA8B,EAAyB,EAAE;QACjH,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,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,eAAe,CAAC,CAAC;QACzD,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,MAAM,EAAE,C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|
|
1
1
|
import { CommandMetadata } from '../../types/common/command-metadata.js';
|
|
2
2
|
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
|
-
import {
|
|
3
|
+
import { PluginConfig } from '../../types/plugin-config-context.js';
|
|
4
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
4
5
|
import { ActionResult } from '../action-result.js';
|
|
5
6
|
/**
|
|
6
7
|
* Only `plugin generate` writes the plugin's identity: `sdk publish` records languages and leaves
|
|
@@ -14,5 +15,5 @@ export declare class PluginRecordMetadataAction {
|
|
|
14
15
|
private readonly commandMetadata;
|
|
15
16
|
private readonly authKey;
|
|
16
17
|
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
17
|
-
readonly execute: (
|
|
18
|
+
readonly execute: (project: ProjectContext) => Promise<ActionResult<PluginConfig>>;
|
|
18
19
|
}
|