@apimatic/cli 1.5.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -212
- package/apimatic.schema.json +550 -0
- package/lib/actions/action-result.js +3 -0
- package/lib/actions/action-result.js.map +1 -1
- package/lib/actions/api/transform.js +36 -33
- package/lib/actions/api/transform.js.map +1 -1
- package/lib/actions/api/validate.d.ts +9 -6
- package/lib/actions/api/validate.js +44 -38
- package/lib/actions/api/validate.js.map +1 -1
- package/lib/actions/auth/login.js +7 -4
- package/lib/actions/auth/login.js.map +1 -1
- package/lib/actions/auth/logout.js +2 -1
- package/lib/actions/auth/logout.js.map +1 -1
- package/lib/actions/auth/status.js +5 -3
- package/lib/actions/auth/status.js.map +1 -1
- package/lib/actions/plugin/generate.d.ts +5 -1
- package/lib/actions/plugin/generate.js +83 -56
- package/lib/actions/plugin/generate.js.map +1 -1
- package/lib/actions/plugin/publish.d.ts +2 -1
- package/lib/actions/plugin/publish.js +34 -37
- package/lib/actions/plugin/publish.js.map +1 -1
- package/lib/actions/plugin/record-metadata.d.ts +3 -2
- package/lib/actions/plugin/record-metadata.js +33 -30
- package/lib/actions/plugin/record-metadata.js.map +1 -1
- package/lib/actions/portal/generate.d.ts +8 -6
- package/lib/actions/portal/generate.js +50 -61
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/prepare-project.d.ts +25 -0
- package/lib/actions/portal/prepare-project.js +68 -0
- package/lib/actions/portal/prepare-project.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +21 -6
- package/lib/actions/portal/serve.js +170 -153
- package/lib/actions/portal/serve.js.map +1 -1
- package/lib/actions/publishing/profile/list.js +4 -2
- package/lib/actions/publishing/profile/list.js.map +1 -1
- package/lib/actions/quickstart.d.ts +23 -5
- package/lib/actions/quickstart.js +222 -21
- package/lib/actions/quickstart.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +4 -7
- package/lib/actions/sdk/generate.js +53 -93
- package/lib/actions/sdk/generate.js.map +1 -1
- package/lib/actions/sdk/publish/interactive.d.ts +4 -3
- package/lib/actions/sdk/publish/interactive.js +96 -97
- package/lib/actions/sdk/publish/interactive.js.map +1 -1
- package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
- package/lib/actions/sdk/publish/non-interactive.js +91 -90
- package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
- package/lib/actions/sdk/publish.d.ts +3 -2
- package/lib/actions/sdk/publish.js +55 -53
- package/lib/actions/sdk/publish.js.map +1 -1
- package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
- package/lib/actions/sdk/record-published-sdk.js +57 -0
- package/lib/actions/sdk/record-published-sdk.js.map +1 -0
- package/lib/client-utils/auth-manager.js +1 -1
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/commands/api/transform.d.ts +1 -1
- package/lib/commands/api/transform.js +44 -40
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.js +16 -16
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.js +14 -15
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.js +5 -6
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.js +4 -5
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/plugin/generate.d.ts +3 -3
- package/lib/commands/plugin/generate.js +20 -20
- package/lib/commands/plugin/generate.js.map +1 -1
- package/lib/commands/plugin/publish.js +18 -18
- package/lib/commands/plugin/publish.js.map +1 -1
- package/lib/commands/portal/generate.d.ts +9 -8
- package/lib/commands/portal/generate.js +36 -27
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +7 -9
- package/lib/commands/portal/serve.js +41 -44
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/publishing/profile/list.js +8 -12
- package/lib/commands/publishing/profile/list.js.map +1 -1
- package/lib/commands/quickstart.d.ts +5 -5
- package/lib/commands/quickstart.js +18 -24
- package/lib/commands/quickstart.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +5 -7
- package/lib/commands/sdk/generate.js +58 -70
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/commands/sdk/publish.d.ts +6 -7
- package/lib/commands/sdk/publish.js +66 -60
- package/lib/commands/sdk/publish.js.map +1 -1
- package/lib/hooks/node-version.d.ts +3 -0
- package/lib/hooks/node-version.js +12 -0
- package/lib/hooks/node-version.js.map +1 -0
- package/lib/hooks/not-found.js +2 -3
- package/lib/hooks/not-found.js.map +1 -1
- package/lib/hooks/utils.d.ts +4 -2
- package/lib/hooks/utils.js +2 -2
- package/lib/hooks/utils.js.map +1 -1
- package/lib/infrastructure/env-info.d.ts +3 -0
- package/lib/infrastructure/env-info.js +13 -6
- package/lib/infrastructure/env-info.js.map +1 -1
- package/lib/infrastructure/file-service.d.ts +35 -8
- package/lib/infrastructure/file-service.js +149 -53
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/file-watch-service.d.ts +40 -0
- package/lib/infrastructure/file-watch-service.js +167 -0
- package/lib/infrastructure/file-watch-service.js.map +1 -0
- package/lib/infrastructure/generation-status-poller.d.ts +8 -7
- package/lib/infrastructure/generation-status-poller.js +20 -12
- package/lib/infrastructure/generation-status-poller.js.map +1 -1
- package/lib/infrastructure/launcher-service.js +6 -6
- package/lib/infrastructure/launcher-service.js.map +1 -1
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +15 -1
- package/lib/infrastructure/network-service.js.map +1 -1
- package/lib/infrastructure/portal-build-service.d.ts +19 -0
- package/lib/infrastructure/portal-build-service.js +58 -0
- package/lib/infrastructure/portal-build-service.js.map +1 -0
- package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
- package/lib/infrastructure/portal-dev-server-service.js +135 -0
- package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
- package/lib/infrastructure/portal-pages-service.d.ts +17 -0
- package/lib/infrastructure/portal-pages-service.js +103 -0
- package/lib/infrastructure/portal-pages-service.js.map +1 -0
- package/lib/infrastructure/portal-project-service.d.ts +77 -0
- package/lib/infrastructure/portal-project-service.js +309 -0
- package/lib/infrastructure/portal-project-service.js.map +1 -0
- package/lib/infrastructure/service-error.d.ts +1 -0
- package/lib/infrastructure/service-error.js +39 -41
- package/lib/infrastructure/service-error.js.map +1 -1
- package/lib/infrastructure/services/api-client-factory.js +15 -13
- package/lib/infrastructure/services/api-client-factory.js.map +1 -1
- package/lib/infrastructure/services/api-service.d.ts +7 -5
- package/lib/infrastructure/services/api-service.js +28 -20
- package/lib/infrastructure/services/api-service.js.map +1 -1
- package/lib/infrastructure/services/auth-service.js +4 -9
- package/lib/infrastructure/services/auth-service.js.map +1 -1
- package/lib/infrastructure/services/file-download-service.js +3 -3
- package/lib/infrastructure/services/file-download-service.js.map +1 -1
- package/lib/infrastructure/services/plugin-service.d.ts +1 -8
- package/lib/infrastructure/services/plugin-service.js +11 -22
- package/lib/infrastructure/services/plugin-service.js.map +1 -1
- package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
- package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
- package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
- package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
- package/lib/infrastructure/services/portal-authorization-service.js +23 -0
- package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
- package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
- package/lib/infrastructure/services/publishing-api-service.js +11 -15
- package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
- package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
- package/lib/infrastructure/services/sdk-generation-service.js +118 -0
- package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.js +5 -4
- package/lib/infrastructure/services/telemetry-service.js.map +1 -1
- package/lib/infrastructure/services/transformation-service.js +29 -32
- package/lib/infrastructure/services/transformation-service.js.map +1 -1
- package/lib/infrastructure/services/validation-service.d.ts +12 -53
- package/lib/infrastructure/services/validation-service.js +24 -199
- package/lib/infrastructure/services/validation-service.js.map +1 -1
- package/lib/infrastructure/timer-extensions.d.ts +2 -0
- package/lib/infrastructure/timer-extensions.js +10 -0
- package/lib/infrastructure/timer-extensions.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +31 -1
- package/lib/infrastructure/tmp-extensions.js +86 -3
- package/lib/infrastructure/tmp-extensions.js.map +1 -1
- package/lib/infrastructure/zip-service.js +2 -2
- package/lib/infrastructure/zip-service.js.map +1 -1
- package/lib/prompts/api/validate.d.ts +6 -7
- package/lib/prompts/api/validate.js +12 -12
- package/lib/prompts/api/validate.js.map +1 -1
- package/lib/prompts/format.d.ts +4 -0
- package/lib/prompts/format.js +5 -0
- package/lib/prompts/format.js.map +1 -1
- package/lib/prompts/plugin/generate.d.ts +17 -12
- package/lib/prompts/plugin/generate.js +94 -44
- package/lib/prompts/plugin/generate.js.map +1 -1
- package/lib/prompts/plugin/publish.d.ts +2 -1
- package/lib/prompts/plugin/publish.js +8 -7
- package/lib/prompts/plugin/publish.js.map +1 -1
- package/lib/prompts/plugin/record-metadata.d.ts +1 -0
- package/lib/prompts/plugin/record-metadata.js +10 -7
- package/lib/prompts/plugin/record-metadata.js.map +1 -1
- package/lib/prompts/portal/artifacts.d.ts +8 -0
- package/lib/prompts/portal/artifacts.js +26 -0
- package/lib/prompts/portal/artifacts.js.map +1 -0
- package/lib/prompts/portal/authorization.d.ts +6 -0
- package/lib/prompts/portal/authorization.js +29 -0
- package/lib/prompts/portal/authorization.js.map +1 -0
- package/lib/prompts/portal/code-samples.d.ts +1 -0
- package/lib/prompts/portal/code-samples.js +9 -0
- package/lib/prompts/portal/code-samples.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +14 -9
- package/lib/prompts/portal/generate.js +48 -26
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/prepare-project.d.ts +20 -0
- package/lib/prompts/portal/prepare-project.js +36 -0
- package/lib/prompts/portal/prepare-project.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +32 -12
- package/lib/prompts/portal/serve.js +102 -39
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/source.d.ts +26 -0
- package/lib/prompts/portal/source.js +253 -0
- package/lib/prompts/portal/source.js.map +1 -0
- package/lib/prompts/prompt.d.ts +11 -3
- package/lib/prompts/prompt.js +39 -15
- package/lib/prompts/prompt.js.map +1 -1
- package/lib/prompts/quickstart.d.ts +46 -3
- package/lib/prompts/quickstart.js +199 -12
- package/lib/prompts/quickstart.js.map +1 -1
- package/lib/prompts/sdk/generate.d.ts +15 -13
- package/lib/prompts/sdk/generate.js +29 -32
- package/lib/prompts/sdk/generate.js.map +1 -1
- package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
- package/lib/prompts/sdk/publish/interactive.js +26 -24
- package/lib/prompts/sdk/publish/interactive.js.map +1 -1
- package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
- package/lib/prompts/sdk/publish/non-interactive.js +5 -4
- package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
- package/lib/prompts/sdk/publish.d.ts +3 -3
- package/lib/prompts/sdk/publish.js +13 -17
- package/lib/prompts/sdk/publish.js.map +1 -1
- package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
- package/lib/prompts/sdk/record-published-sdk.js +26 -0
- package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
- package/lib/types/apimatic-config/document.d.ts +70 -0
- package/lib/types/apimatic-config/document.js +167 -0
- package/lib/types/apimatic-config/document.js.map +1 -0
- package/lib/types/apimatic-config/languages-block.d.ts +39 -0
- package/lib/types/apimatic-config/languages-block.js +58 -0
- package/lib/types/apimatic-config/languages-block.js.map +1 -0
- package/lib/types/apimatic-config-context.d.ts +48 -0
- package/lib/types/apimatic-config-context.js +121 -0
- package/lib/types/apimatic-config-context.js.map +1 -0
- package/lib/types/build/build.d.ts +1 -89
- package/lib/types/build/build.js +6 -161
- package/lib/types/build/build.js.map +1 -1
- package/lib/types/events/domain-event.js +3 -0
- package/lib/types/events/domain-event.js.map +1 -1
- package/lib/types/events/quickstart-completed.js +3 -3
- package/lib/types/events/quickstart-completed.js.map +1 -1
- package/lib/types/events/quickstart-initiated.js +3 -3
- package/lib/types/events/quickstart-initiated.js.map +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
- package/lib/types/file/directory.d.ts +4 -9
- package/lib/types/file/directory.js +17 -65
- package/lib/types/file/directory.js.map +1 -1
- package/lib/types/file/directoryPath.d.ts +17 -0
- package/lib/types/file/directoryPath.js +47 -2
- package/lib/types/file/directoryPath.js.map +1 -1
- package/lib/types/file/fileName.d.ts +8 -0
- package/lib/types/file/fileName.js +28 -6
- package/lib/types/file/fileName.js.map +1 -1
- package/lib/types/file/filePath.d.ts +18 -2
- package/lib/types/file/filePath.js +39 -4
- package/lib/types/file/filePath.js.map +1 -1
- package/lib/types/file/resource-input.js +1 -2
- package/lib/types/file/resource-input.js.map +1 -1
- package/lib/types/file/urlPath.js +2 -1
- package/lib/types/file/urlPath.js.map +1 -1
- package/lib/types/flags-provider.js +22 -22
- package/lib/types/flags-provider.js.map +1 -1
- package/lib/types/package-settings-context.js +2 -1
- package/lib/types/package-settings-context.js.map +1 -1
- package/lib/types/plugin/plugin-config.d.ts +10 -50
- package/lib/types/plugin/plugin-config.js +7 -1
- package/lib/types/plugin/plugin-config.js.map +1 -1
- package/lib/types/plugin-config-context.d.ts +30 -37
- package/lib/types/plugin-config-context.js +108 -139
- package/lib/types/plugin-config-context.js.map +1 -1
- package/lib/types/plugin-context.js +3 -2
- package/lib/types/plugin-context.js.map +1 -1
- package/lib/types/portal/code-samples.d.ts +27 -0
- package/lib/types/portal/code-samples.js +67 -0
- package/lib/types/portal/code-samples.js.map +1 -0
- package/lib/types/portal/config/ai-config.d.ts +15 -0
- package/lib/types/portal/config/ai-config.js +26 -0
- package/lib/types/portal/config/ai-config.js.map +1 -0
- package/lib/types/portal/config/brand-config.d.ts +55 -0
- package/lib/types/portal/config/brand-config.js +105 -0
- package/lib/types/portal/config/brand-config.js.map +1 -0
- package/lib/types/portal/config/color.d.ts +19 -0
- package/lib/types/portal/config/color.js +43 -0
- package/lib/types/portal/config/color.js.map +1 -0
- package/lib/types/portal/config/fields.d.ts +23 -0
- package/lib/types/portal/config/fields.js +67 -0
- package/lib/types/portal/config/fields.js.map +1 -0
- package/lib/types/portal/config/link.d.ts +18 -0
- package/lib/types/portal/config/link.js +72 -0
- package/lib/types/portal/config/link.js.map +1 -0
- package/lib/types/portal/config/navigation-config.d.ts +13 -0
- package/lib/types/portal/config/navigation-config.js +30 -0
- package/lib/types/portal/config/navigation-config.js.map +1 -0
- package/lib/types/portal/config/site-config.d.ts +32 -0
- package/lib/types/portal/config/site-config.js +88 -0
- package/lib/types/portal/config/site-config.js.map +1 -0
- package/lib/types/portal/config/static-asset.d.ts +25 -0
- package/lib/types/portal/config/static-asset.js +77 -0
- package/lib/types/portal/config/static-asset.js.map +1 -0
- package/lib/types/portal/content-notices.d.ts +20 -0
- package/lib/types/portal/content-notices.js +2 -0
- package/lib/types/portal/content-notices.js.map +1 -0
- package/lib/types/portal/content-tree.d.ts +103 -0
- package/lib/types/portal/content-tree.js +344 -0
- package/lib/types/portal/content-tree.js.map +1 -0
- package/lib/types/portal/endpoint.d.ts +6 -0
- package/lib/types/portal/endpoint.js +12 -0
- package/lib/types/portal/endpoint.js.map +1 -0
- package/lib/types/portal/generated-pages.d.ts +68 -0
- package/lib/types/portal/generated-pages.js +111 -0
- package/lib/types/portal/generated-pages.js.map +1 -0
- package/lib/types/portal/generation-status.d.ts +31 -0
- package/lib/types/portal/generation-status.js +26 -0
- package/lib/types/portal/generation-status.js.map +1 -0
- package/lib/types/portal/openapi-document.d.ts +48 -0
- package/lib/types/portal/openapi-document.js +138 -0
- package/lib/types/portal/openapi-document.js.map +1 -0
- package/lib/types/portal/page-fragments.d.ts +13 -0
- package/lib/types/portal/page-fragments.js +24 -0
- package/lib/types/portal/page-fragments.js.map +1 -0
- package/lib/types/portal/page-template.d.ts +15 -0
- package/lib/types/portal/page-template.js +64 -0
- package/lib/types/portal/page-template.js.map +1 -0
- package/lib/types/portal/page.d.ts +24 -0
- package/lib/types/portal/page.js +100 -0
- package/lib/types/portal/page.js.map +1 -0
- package/lib/types/portal/portal-artifacts.d.ts +25 -0
- package/lib/types/portal/portal-artifacts.js +30 -0
- package/lib/types/portal/portal-artifacts.js.map +1 -0
- package/lib/types/portal/portal-config.d.ts +69 -0
- package/lib/types/portal/portal-config.js +105 -0
- package/lib/types/portal/portal-config.js.map +1 -0
- package/lib/types/portal/portal-downloads.d.ts +8 -0
- package/lib/types/portal/portal-downloads.js +14 -0
- package/lib/types/portal/portal-downloads.js.map +1 -0
- package/lib/types/portal/portal-languages.d.ts +15 -0
- package/lib/types/portal/portal-languages.js +45 -0
- package/lib/types/portal/portal-languages.js.map +1 -0
- package/lib/types/portal/portal-navigation.d.ts +65 -0
- package/lib/types/portal/portal-navigation.js +217 -0
- package/lib/types/portal/portal-navigation.js.map +1 -0
- package/lib/types/portal/portal-sdk.d.ts +15 -0
- package/lib/types/portal/portal-sdk.js +28 -0
- package/lib/types/portal/portal-sdk.js.map +1 -0
- package/lib/types/portal/portal-source.d.ts +129 -0
- package/lib/types/portal/portal-source.js +2 -0
- package/lib/types/portal/portal-source.js.map +1 -0
- package/lib/types/portal/portal-stylesheet.d.ts +19 -0
- package/lib/types/portal/portal-stylesheet.js +40 -0
- package/lib/types/portal/portal-stylesheet.js.map +1 -0
- package/lib/types/portal/portal-tabs.d.ts +33 -0
- package/lib/types/portal/portal-tabs.js +38 -0
- package/lib/types/portal/portal-tabs.js.map +1 -0
- package/lib/types/portal/preview-config.d.ts +20 -0
- package/lib/types/portal/preview-config.js +32 -0
- package/lib/types/portal/preview-config.js.map +1 -0
- package/lib/types/portal/preview-content.d.ts +18 -0
- package/lib/types/portal/preview-content.js +50 -0
- package/lib/types/portal/preview-content.js.map +1 -0
- package/lib/types/portal/published-package.d.ts +12 -0
- package/lib/types/portal/published-package.js +35 -0
- package/lib/types/portal/published-package.js.map +1 -0
- package/lib/types/portal/unknown-fields.d.ts +5 -0
- package/lib/types/portal/unknown-fields.js +10 -0
- package/lib/types/portal/unknown-fields.js.map +1 -0
- package/lib/types/portal-context.d.ts +38 -6
- package/lib/types/portal-context.js +71 -24
- package/lib/types/portal-context.js.map +1 -1
- package/lib/types/portal-source-context.d.ts +77 -0
- package/lib/types/portal-source-context.js +408 -0
- package/lib/types/portal-source-context.js.map +1 -0
- package/lib/types/project-context.d.ts +49 -0
- package/lib/types/project-context.js +151 -0
- package/lib/types/project-context.js.map +1 -0
- package/lib/types/project-layout.d.ts +9 -0
- package/lib/types/project-layout.js +10 -0
- package/lib/types/project-layout.js.map +1 -0
- package/lib/types/publish/package-settings-configuration.d.ts +2 -0
- package/lib/types/publish/profile-id.js +1 -0
- package/lib/types/publish/profile-id.js.map +1 -1
- package/lib/types/publish/publishing-profile.d.ts +3 -1
- package/lib/types/publish/publishing-profile.js +33 -15
- package/lib/types/publish/publishing-profile.js.map +1 -1
- package/lib/types/publish/publishing-profiles.js +2 -1
- package/lib/types/publish/publishing-profiles.js.map +1 -1
- package/lib/types/publish/version.js +1 -0
- package/lib/types/publish/version.js.map +1 -1
- package/lib/types/resource-context.js +3 -2
- package/lib/types/resource-context.js.map +1 -1
- package/lib/types/sdk/generate.d.ts +22 -16
- package/lib/types/sdk/generate.js +64 -41
- package/lib/types/sdk/generate.js.map +1 -1
- package/lib/types/sdk/stability-choice.d.ts +12 -0
- package/lib/types/sdk/stability-choice.js +24 -0
- package/lib/types/sdk/stability-choice.js.map +1 -0
- package/lib/types/sdk-context.d.ts +4 -5
- package/lib/types/sdk-context.js +10 -18
- package/lib/types/sdk-context.js.map +1 -1
- package/lib/types/spec-context.d.ts +5 -4
- package/lib/types/spec-context.js +9 -8
- package/lib/types/spec-context.js.map +1 -1
- package/lib/types/temp-context.d.ts +1 -1
- package/lib/types/temp-context.js +5 -4
- package/lib/types/temp-context.js.map +1 -1
- package/lib/types/transform-context.d.ts +9 -5
- package/lib/types/transform-context.js +21 -18
- package/lib/types/transform-context.js.map +1 -1
- package/lib/utils/error-utils.d.ts +2 -0
- package/lib/utils/error-utils.js +5 -0
- package/lib/utils/error-utils.js.map +1 -0
- package/lib/utils/json-utils.d.ts +2 -0
- package/lib/utils/json-utils.js +4 -0
- package/lib/utils/json-utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +8 -1
- package/lib/utils/string-utils.js +13 -26
- package/lib/utils/string-utils.js.map +1 -1
- package/lib/utils/utils.d.ts +1 -3
- package/lib/utils/utils.js +12 -40
- package/lib/utils/utils.js.map +1 -1
- package/oclif.manifest.json +69 -357
- package/package.json +47 -25
- package/portal-pages/context-plugin.mdx +26 -0
- package/portal-pages/sdk.mdx +8 -0
- package/portal-pages/sdks.mdx +11 -0
- package/portal-template/NOTICE +37 -0
- package/portal-template/downloads.ts +41 -0
- package/portal-template/generated-pages-reload.ts +51 -0
- package/portal-template/package.json +11 -0
- package/portal-template/portal-config.ts +32 -0
- package/portal-template/prerender-pages.ts +81 -0
- package/portal-template/spec-reload.ts +26 -0
- package/portal-template/src/components/api-page.tsx +15 -0
- package/portal-template/src/components/code-block.tsx +9 -0
- package/portal-template/src/components/command-block.tsx +50 -0
- package/portal-template/src/components/example-layout.tsx +99 -0
- package/portal-template/src/components/logos.tsx +127 -0
- package/portal-template/src/components/mdx.tsx +28 -0
- package/portal-template/src/components/not-found.tsx +11 -0
- package/portal-template/src/components/plugin-install.tsx +22 -0
- package/portal-template/src/components/plugin-support.tsx +53 -0
- package/portal-template/src/components/sdk-actions.tsx +79 -0
- package/portal-template/src/components/sdk-cards.tsx +100 -0
- package/portal-template/src/components/search.tsx +41 -0
- package/portal-template/src/components/usage-tabs.tsx +92 -0
- package/portal-template/src/lib/code-samples.server.ts +40 -0
- package/portal-template/src/lib/code-samples.ts +43 -0
- package/portal-template/src/lib/code-titles.ts +29 -0
- package/portal-template/src/lib/install-command.ts +13 -0
- package/portal-template/src/lib/json.ts +5 -0
- package/portal-template/src/lib/layout.shared.tsx +41 -0
- package/portal-template/src/lib/layout.tsx +16 -0
- package/portal-template/src/lib/llms.server.ts +54 -0
- package/portal-template/src/lib/media-adapters.ts +34 -0
- package/portal-template/src/lib/navigation.ts +406 -0
- package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
- package/portal-template/src/lib/openapi-filter.ts +191 -0
- package/portal-template/src/lib/openapi-labels.ts +15 -0
- package/portal-template/src/lib/openapi-methods.ts +12 -0
- package/portal-template/src/lib/openapi-section.server.ts +280 -0
- package/portal-template/src/lib/openapi-slim.ts +202 -0
- package/portal-template/src/lib/openapi.server.ts +16 -0
- package/portal-template/src/lib/portal-types.ts +36 -0
- package/portal-template/src/lib/portal.server.ts +13 -0
- package/portal-template/src/lib/portal.ts +11 -0
- package/portal-template/src/lib/rehype-code-titles.ts +53 -0
- package/portal-template/src/lib/request-examples.ts +72 -0
- package/portal-template/src/lib/seo.ts +21 -0
- package/portal-template/src/lib/shared.ts +51 -0
- package/portal-template/src/lib/shiki-bundle.ts +104 -0
- package/portal-template/src/lib/sitemap.server.ts +20 -0
- package/portal-template/src/lib/source.server.ts +27 -0
- package/portal-template/src/lib/source.ts +49 -0
- package/portal-template/src/lib/tabs.ts +37 -0
- package/portal-template/src/router.tsx +12 -0
- package/portal-template/src/routes/$.tsx +194 -0
- package/portal-template/src/routes/__root.tsx +56 -0
- package/portal-template/src/routes/api/search[.]json.ts +9 -0
- package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
- package/portal-template/src/routes/llms[.]txt.ts +10 -0
- package/portal-template/src/routes/robots[.]txt.ts +10 -0
- package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
- package/portal-template/src/routes/spa-shell.tsx +7 -0
- package/portal-template/src/routes/{$}[.]md.ts +21 -0
- package/portal-template/src/styles/app.css +33 -0
- package/portal-template/tsconfig.json +26 -0
- package/portal-template/vite.config.ts +68 -0
- package/lib/actions/plugin/record-sdk.d.ts +0 -14
- package/lib/actions/plugin/record-sdk.js +0 -60
- package/lib/actions/plugin/record-sdk.js.map +0 -1
- package/lib/actions/portal/copilot.d.ts +0 -17
- package/lib/actions/portal/copilot.js +0 -89
- package/lib/actions/portal/copilot.js.map +0 -1
- package/lib/actions/portal/quickstart.d.ts +0 -18
- package/lib/actions/portal/quickstart.js +0 -238
- package/lib/actions/portal/quickstart.js.map +0 -1
- package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
- package/lib/actions/portal/recipe/new-recipe.js +0 -177
- package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
- package/lib/actions/portal/toc/new-toc.d.ts +0 -21
- package/lib/actions/portal/toc/new-toc.js +0 -95
- package/lib/actions/portal/toc/new-toc.js.map +0 -1
- package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
- package/lib/actions/sdk/merge-source-tree.js +0 -78
- package/lib/actions/sdk/merge-source-tree.js.map +0 -1
- package/lib/actions/sdk/quickstart.d.ts +0 -18
- package/lib/actions/sdk/quickstart.js +0 -188
- package/lib/actions/sdk/quickstart.js.map +0 -1
- package/lib/actions/sdk/save-changes.d.ts +0 -8
- package/lib/actions/sdk/save-changes.js +0 -93
- package/lib/actions/sdk/save-changes.js.map +0 -1
- package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
- package/lib/application/portal/recipe/portal-recipe.js +0 -33
- package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
- package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
- package/lib/application/portal/recipe/recipe-generator.js +0 -130
- package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
- package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
- package/lib/application/portal/toc/toc-content-parser.js +0 -44
- package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
- package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
- package/lib/application/portal/toc/toc-structure-generator.js +0 -165
- package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
- package/lib/commands/portal/copilot.d.ts +0 -13
- package/lib/commands/portal/copilot.js +0 -34
- package/lib/commands/portal/copilot.js.map +0 -1
- package/lib/commands/portal/recipe/new.d.ts +0 -12
- package/lib/commands/portal/recipe/new.js +0 -45
- package/lib/commands/portal/recipe/new.js.map +0 -1
- package/lib/commands/portal/toc/new.d.ts +0 -16
- package/lib/commands/portal/toc/new.js +0 -68
- package/lib/commands/portal/toc/new.js.map +0 -1
- package/lib/commands/sdk/save-changes.d.ts +0 -14
- package/lib/commands/sdk/save-changes.js +0 -51
- package/lib/commands/sdk/save-changes.js.map +0 -1
- package/lib/infrastructure/debounce-service.d.ts +0 -10
- package/lib/infrastructure/debounce-service.js +0 -55
- package/lib/infrastructure/debounce-service.js.map +0 -1
- package/lib/infrastructure/services/portal-service.d.ts +0 -43
- package/lib/infrastructure/services/portal-service.js +0 -337
- package/lib/infrastructure/services/portal-service.js.map +0 -1
- package/lib/prompts/plugin/record-sdk.d.ts +0 -9
- package/lib/prompts/plugin/record-sdk.js +0 -40
- package/lib/prompts/plugin/record-sdk.js.map +0 -1
- package/lib/prompts/portal/copilot.d.ts +0 -18
- package/lib/prompts/portal/copilot.js +0 -82
- package/lib/prompts/portal/copilot.js.map +0 -1
- package/lib/prompts/portal/quickstart.d.ts +0 -42
- package/lib/prompts/portal/quickstart.js +0 -243
- package/lib/prompts/portal/quickstart.js.map +0 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
- package/lib/prompts/portal/recipe/new-recipe.js +0 -165
- package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
- package/lib/prompts/portal/toc/new-toc.js +0 -50
- package/lib/prompts/portal/toc/new-toc.js.map +0 -1
- package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
- package/lib/prompts/sdk/merge-source-tree.js +0 -90
- package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
- package/lib/prompts/sdk/quickstart.d.ts +0 -38
- package/lib/prompts/sdk/quickstart.js +0 -196
- package/lib/prompts/sdk/quickstart.js.map +0 -1
- package/lib/prompts/sdk/save-changes.d.ts +0 -21
- package/lib/prompts/sdk/save-changes.js +0 -84
- package/lib/prompts/sdk/save-changes.js.map +0 -1
- package/lib/types/build-context.d.ts +0 -26
- package/lib/types/build-context.js +0 -111
- package/lib/types/build-context.js.map +0 -1
- package/lib/types/events/recipe-creation-failed.d.ts +0 -5
- package/lib/types/events/recipe-creation-failed.js +0 -8
- package/lib/types/events/recipe-creation-failed.js.map +0 -1
- package/lib/types/events/sdk-changes-saved.d.ts +0 -8
- package/lib/types/events/sdk-changes-saved.js +0 -11
- package/lib/types/events/sdk-changes-saved.js.map +0 -1
- package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
- package/lib/types/events/sdk-changes-tracked.js +0 -11
- package/lib/types/events/sdk-changes-tracked.js.map +0 -1
- package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
- package/lib/types/events/sdk-conflicts-resolved.js +0 -11
- package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
- package/lib/types/events/toc-creation-failed.d.ts +0 -5
- package/lib/types/events/toc-creation-failed.js +0 -8
- package/lib/types/events/toc-creation-failed.js.map +0 -1
- package/lib/types/merge-source-tree-context.d.ts +0 -28
- package/lib/types/merge-source-tree-context.js +0 -63
- package/lib/types/merge-source-tree-context.js.map +0 -1
- package/lib/types/plugin/language-entry.d.ts +0 -9
- package/lib/types/plugin/language-entry.js +0 -64
- package/lib/types/plugin/language-entry.js.map +0 -1
- package/lib/types/recipe/recipe.d.ts +0 -22
- package/lib/types/recipe/recipe.js +0 -6
- package/lib/types/recipe/recipe.js.map +0 -1
- package/lib/types/recipe-context.d.ts +0 -9
- package/lib/types/recipe-context.js +0 -26
- package/lib/types/recipe-context.js.map +0 -1
- package/lib/types/save-changes-context.d.ts +0 -17
- package/lib/types/save-changes-context.js +0 -42
- package/lib/types/save-changes-context.js.map +0 -1
- package/lib/types/sdl/sdl.d.ts +0 -10
- package/lib/types/sdl/sdl.js +0 -18
- package/lib/types/sdl/sdl.js.map +0 -1
- package/lib/types/toc/toc-components.d.ts +0 -36
- package/lib/types/toc/toc-components.js +0 -94
- package/lib/types/toc/toc-components.js.map +0 -1
- package/lib/types/toc/toc.d.ts +0 -67
- package/lib/types/toc/toc.js +0 -2
- package/lib/types/toc/toc.js.map +0 -1
- package/lib/types/toc-context.d.ts +0 -12
- package/lib/types/toc-context.js +0 -26
- package/lib/types/toc-context.js.map +0 -1
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { FileName } from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import { FileService } from "../../infrastructure/file-service.js";
|
|
1
|
+
import { FileName } from './fileName.js';
|
|
2
|
+
import { FilePath } from './filePath.js';
|
|
4
3
|
export class Directory {
|
|
4
|
+
directoryPath;
|
|
5
|
+
items;
|
|
5
6
|
constructor(directoryPath, filePaths) {
|
|
6
|
-
this.fileService = new FileService();
|
|
7
7
|
this.directoryPath = directoryPath;
|
|
8
8
|
this.items = filePaths;
|
|
9
9
|
}
|
|
10
|
+
static folderDescriptions = {
|
|
11
|
+
spec: '# Contains all API definition files',
|
|
12
|
+
content: '# Includes custom documentation pages in Markdown',
|
|
13
|
+
static: '# Includes all static files, such as images, GIFs, and PDFs'
|
|
14
|
+
};
|
|
15
|
+
static fileDescriptions = {
|
|
16
|
+
'apimatic.json': '# Configures the documentation portal and the context plugin',
|
|
17
|
+
'APIMATIC-BUILD.json': '# Defines all configurations for SDK generation',
|
|
18
|
+
'APIMATIC-META.json': '# Defines customization for SDK generation'
|
|
19
|
+
};
|
|
10
20
|
toTreeNode() {
|
|
11
21
|
const folderName = this.directoryPath.leafName();
|
|
12
22
|
const folderDescription = Directory.folderDescriptions[folderName];
|
|
@@ -14,13 +24,12 @@ export class Directory {
|
|
|
14
24
|
name: folderName,
|
|
15
25
|
description: folderDescription,
|
|
16
26
|
items: this.items.map((item) => {
|
|
17
|
-
var _a;
|
|
18
27
|
if (item instanceof Directory) {
|
|
19
28
|
return item.toTreeNode();
|
|
20
29
|
}
|
|
21
30
|
// file case
|
|
22
31
|
const fileName = item.fileName.toString();
|
|
23
|
-
const fileDescription =
|
|
32
|
+
const fileDescription = item.description ?? Directory.fileDescriptions[fileName];
|
|
24
33
|
return {
|
|
25
34
|
name: fileName,
|
|
26
35
|
description: fileDescription
|
|
@@ -73,55 +82,8 @@ export class Directory {
|
|
|
73
82
|
}
|
|
74
83
|
return files;
|
|
75
84
|
}
|
|
76
|
-
async parseContentFolder(baseContentPath) {
|
|
77
|
-
const groups = [];
|
|
78
|
-
const pages = [];
|
|
79
|
-
for (const item of this.items) {
|
|
80
|
-
if (item instanceof Directory) {
|
|
81
|
-
const subGroups = await item.parseContentFolder(baseContentPath);
|
|
82
|
-
if (subGroups.length > 0) {
|
|
83
|
-
const directoryName = item.directoryPath.leafName();
|
|
84
|
-
groups.push({
|
|
85
|
-
group: directoryName,
|
|
86
|
-
items: subGroups
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (item.fileName.toString().endsWith(".md")) {
|
|
92
|
-
const currentFilePath = new FilePath(this.directoryPath, item.fileName);
|
|
93
|
-
const relativeFilePath = this.fileService.getRelativePath(currentFilePath, baseContentPath);
|
|
94
|
-
pages.push({
|
|
95
|
-
page: this.getPageName(item.fileName),
|
|
96
|
-
file: relativeFilePath
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const allItems = [...pages, ...groups];
|
|
102
|
-
if (allItems.length === 0) {
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
if (this.isRootContentDirectory(baseContentPath)) {
|
|
106
|
-
return [
|
|
107
|
-
{
|
|
108
|
-
group: "Custom Content",
|
|
109
|
-
items: allItems
|
|
110
|
-
}
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
// For subdirectories, return the items directly
|
|
114
|
-
return allItems;
|
|
115
|
-
}
|
|
116
|
-
getPageName(fileName) {
|
|
117
|
-
const fileNameStr = fileName.toString();
|
|
118
|
-
return fileNameStr.replace(/\.md$/, "");
|
|
119
|
-
}
|
|
120
|
-
isRootContentDirectory(baseContentPath) {
|
|
121
|
-
return this.directoryPath.toString() === baseContentPath.toString();
|
|
122
|
-
}
|
|
123
85
|
static createFromRelativePaths(rootDir, fileItems) {
|
|
124
|
-
const buildDirectory = (pending) => new Directory(pending.pendingDirPath, pending.items.map((item) => (
|
|
86
|
+
const buildDirectory = (pending) => new Directory(pending.pendingDirPath, pending.items.map((item) => ('pendingDirPath' in item ? buildDirectory(item) : item)));
|
|
125
87
|
const root = { pendingDirPath: rootDir, items: [] };
|
|
126
88
|
for (const file of fileItems) {
|
|
127
89
|
const parts = file.fileName.toString().split(/[\\/]/);
|
|
@@ -133,7 +95,7 @@ export class Directory {
|
|
|
133
95
|
currentDir.items.push({ fileName: new FileName(part), description: file.description });
|
|
134
96
|
}
|
|
135
97
|
else {
|
|
136
|
-
let existingDir = currentDir.items.find((item) =>
|
|
98
|
+
let existingDir = currentDir.items.find((item) => 'pendingDirPath' in item && item.pendingDirPath.leafName() === part);
|
|
137
99
|
if (!existingDir) {
|
|
138
100
|
existingDir = { pendingDirPath: currentDir.pendingDirPath.join(part), items: [] };
|
|
139
101
|
currentDir.items.push(existingDir);
|
|
@@ -145,14 +107,4 @@ export class Directory {
|
|
|
145
107
|
return buildDirectory(root);
|
|
146
108
|
}
|
|
147
109
|
}
|
|
148
|
-
Directory.folderDescriptions = {
|
|
149
|
-
spec: "# Contains all API definition files",
|
|
150
|
-
content: "# Includes custom documentation pages in Markdown",
|
|
151
|
-
static: "# Includes all static files, such as images, GIFs, and PDFs"
|
|
152
|
-
};
|
|
153
|
-
Directory.fileDescriptions = {
|
|
154
|
-
"toc.yml": "# Controls the structure of the side navigation bar in the API portal",
|
|
155
|
-
"APIMATIC-BUILD.json": "# Defines all configurations for the API portal, including programming languages and themes",
|
|
156
|
-
"APIMATIC-META.json": "# Defines customization for SDK generation",
|
|
157
|
-
};
|
|
158
110
|
//# sourceMappingURL=directory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/types/file/directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"directory.js","sourceRoot":"","sources":["../../../src/types/file/directory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,MAAM,OAAO,SAAS;IACJ,aAAa,CAAgB;IAC7B,KAAK,CAAkB;IAEvC,YAAmB,aAA4B,EAAE,SAA0B;QACzE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAEO,MAAM,CAAU,kBAAkB,GAA2B;QACnE,IAAI,EAAE,qCAAqC;QAC3C,OAAO,EAAE,mDAAmD;QAC5D,MAAM,EAAE,6DAA6D;KACtE,CAAC;IAEM,MAAM,CAAU,gBAAgB,GAA2B;QACjE,eAAe,EAAE,8DAA8D;QAC/E,qBAAqB,EAAE,iDAAiD;QACxE,oBAAoB,EAAE,4CAA4C;KACnE,CAAC;IAEK,UAAU;QACf,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;QACjD,MAAM,iBAAiB,GAAG,SAAS,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAEnE,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,iBAAiB;YAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,C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AAW,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CACrC,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,IAAI,CACpD,CAAC;oBAE5B,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,WAAW,GAAG,EAAE,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;wBAClF,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBACrC,CAAC;oBAED,UAAU,GAAG,WAAW,CAAC;gBAC3B,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
/** The path with `/` between its segments, which a shell, a log and a file the build reads all take. */
|
|
2
|
+
export declare const posix: (value: string) => string;
|
|
3
|
+
/** How a reader standing in `from` would type `target`: `./sdk` beside them, else the full path. */
|
|
4
|
+
export declare function asTypedFrom(target: string, from: DirectoryPath): string;
|
|
1
5
|
export declare class DirectoryPath {
|
|
2
6
|
private readonly directoryPath;
|
|
3
7
|
constructor(directoryPath: string, ...subPaths: string[]);
|
|
4
8
|
static default: DirectoryPath;
|
|
9
|
+
/** Where the command was run, which is where a path printed for a reader is relative to. */
|
|
10
|
+
static workingDirectory(): DirectoryPath;
|
|
5
11
|
static createInput(input: string | undefined): DirectoryPath;
|
|
12
|
+
static fromUserInput(input: string): DirectoryPath;
|
|
6
13
|
toString(): string;
|
|
14
|
+
toPosix(): string;
|
|
15
|
+
asTypedFrom(from: DirectoryPath): string;
|
|
7
16
|
join(...subPath: string[]): DirectoryPath;
|
|
17
|
+
resolve(relativePath: string): DirectoryPath;
|
|
8
18
|
isEqual(other: DirectoryPath): boolean;
|
|
19
|
+
/** True when `other` is this directory or sits anywhere inside it. */
|
|
20
|
+
contains(other: DirectoryPath): boolean;
|
|
9
21
|
leafName(): string;
|
|
22
|
+
/**
|
|
23
|
+
* This directory as a reader standing in `base` would type it, or its full path when there is
|
|
24
|
+
* no shorter way to say it. Posix separators, because the result is pasted into a shell.
|
|
25
|
+
*/
|
|
26
|
+
relativeTo(base: DirectoryPath): string;
|
|
10
27
|
}
|
|
@@ -1,26 +1,71 @@
|
|
|
1
|
-
import * as path from
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { removeQuotes } from '../../utils/string-utils.js';
|
|
3
|
+
/** The path with `/` between its segments, which a shell, a log and a file the build reads all take. */
|
|
4
|
+
export const posix = (value) => value.split(path.sep).join('/');
|
|
5
|
+
/** How a reader standing in `from` would type `target`: `./sdk` beside them, else the full path. */
|
|
6
|
+
export function asTypedFrom(target, from) {
|
|
7
|
+
const here = path.relative(from.toString(), target);
|
|
8
|
+
if (here === '') {
|
|
9
|
+
return '.';
|
|
10
|
+
}
|
|
11
|
+
// A sibling starts with `..`, and so does a child called `..cache`: only the segment counts.
|
|
12
|
+
if (path.isAbsolute(here) || here === '..' || here.startsWith(`..${path.sep}`)) {
|
|
13
|
+
return target;
|
|
14
|
+
}
|
|
15
|
+
return `./${posix(here)}`;
|
|
16
|
+
}
|
|
2
17
|
export class DirectoryPath {
|
|
18
|
+
directoryPath;
|
|
3
19
|
constructor(directoryPath, ...subPaths) {
|
|
4
20
|
this.directoryPath = path.resolve(directoryPath, ...subPaths);
|
|
5
21
|
}
|
|
22
|
+
static default = new DirectoryPath('./');
|
|
23
|
+
/** Where the command was run, which is where a path printed for a reader is relative to. */
|
|
24
|
+
static workingDirectory() {
|
|
25
|
+
return new DirectoryPath(process.cwd());
|
|
26
|
+
}
|
|
6
27
|
static createInput(input) {
|
|
7
28
|
if (!input) {
|
|
8
29
|
return DirectoryPath.default;
|
|
9
30
|
}
|
|
10
31
|
return new DirectoryPath(input);
|
|
11
32
|
}
|
|
33
|
+
static fromUserInput(input) {
|
|
34
|
+
return new DirectoryPath(removeQuotes(input.trim()));
|
|
35
|
+
}
|
|
12
36
|
toString() {
|
|
13
37
|
return this.directoryPath;
|
|
14
38
|
}
|
|
39
|
+
toPosix() {
|
|
40
|
+
return posix(this.directoryPath);
|
|
41
|
+
}
|
|
42
|
+
asTypedFrom(from) {
|
|
43
|
+
return asTypedFrom(this.directoryPath, from);
|
|
44
|
+
}
|
|
15
45
|
join(...subPath) {
|
|
16
46
|
return new DirectoryPath(path.join(this.directoryPath, ...subPath));
|
|
17
47
|
}
|
|
48
|
+
resolve(relativePath) {
|
|
49
|
+
return new DirectoryPath(this.directoryPath, relativePath);
|
|
50
|
+
}
|
|
18
51
|
isEqual(other) {
|
|
19
52
|
return this.directoryPath === other.directoryPath;
|
|
20
53
|
}
|
|
54
|
+
/** True when `other` is this directory or sits anywhere inside it. */
|
|
55
|
+
contains(other) {
|
|
56
|
+
const relative = path.relative(this.directoryPath, other.directoryPath);
|
|
57
|
+
return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
|
|
58
|
+
}
|
|
21
59
|
leafName() {
|
|
22
60
|
return path.basename(this.directoryPath);
|
|
23
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* This directory as a reader standing in `base` would type it, or its full path when there is
|
|
64
|
+
* no shorter way to say it. Posix separators, because the result is pasted into a shell.
|
|
65
|
+
*/
|
|
66
|
+
relativeTo(base) {
|
|
67
|
+
const here = path.relative(base.directoryPath, this.directoryPath);
|
|
68
|
+
return here === '' || here.startsWith('..') || path.isAbsolute(here) ? this.directoryPath : `./${posix(here)}`;
|
|
69
|
+
}
|
|
24
70
|
}
|
|
25
|
-
DirectoryPath.default = new DirectoryPath("./");
|
|
26
71
|
//# sourceMappingURL=directoryPath.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directoryPath.js","sourceRoot":"","sources":["../../../src/types/file/directoryPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAA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Q;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,IAAmB;QACnC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAEnE,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IACjH,CAAC;CACF"}
|
|
@@ -2,6 +2,14 @@ export declare class FileName {
|
|
|
2
2
|
private readonly name;
|
|
3
3
|
constructor(name: string);
|
|
4
4
|
isMarkDown(): boolean;
|
|
5
|
+
/** Whether the name ends in `extension`, compared without regard to case. */
|
|
6
|
+
hasExtension(extension: string): boolean;
|
|
7
|
+
/** Whether the name ends in `extension` exactly, by code point, the way a glob matches it. */
|
|
8
|
+
hasExactExtension(extension: string): boolean;
|
|
9
|
+
/** Whether this is `name`, compared without regard to case. */
|
|
10
|
+
is(name: string): boolean;
|
|
11
|
+
compare(other: FileName): number;
|
|
12
|
+
withoutExtension(): FileName;
|
|
5
13
|
normalize(): FileName;
|
|
6
14
|
toString(): string;
|
|
7
15
|
}
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
export class FileName {
|
|
2
|
+
name;
|
|
2
3
|
constructor(name) {
|
|
3
4
|
this.name = name;
|
|
4
5
|
}
|
|
5
6
|
isMarkDown() {
|
|
6
|
-
return this.
|
|
7
|
+
return this.hasExtension('.md');
|
|
8
|
+
}
|
|
9
|
+
/** Whether the name ends in `extension`, compared without regard to case. */
|
|
10
|
+
hasExtension(extension) {
|
|
11
|
+
return this.name.toLowerCase().endsWith(extension.toLowerCase());
|
|
12
|
+
}
|
|
13
|
+
/** Whether the name ends in `extension` exactly, by code point, the way a glob matches it. */
|
|
14
|
+
hasExactExtension(extension) {
|
|
15
|
+
return this.name.endsWith(extension);
|
|
16
|
+
}
|
|
17
|
+
/** Whether this is `name`, compared without regard to case. */
|
|
18
|
+
is(name) {
|
|
19
|
+
return this.name.toLowerCase() === name.toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
// By code point rather than collation: callers sort on this to decide which of two names
|
|
22
|
+
// keeps a slug they both normalise to, and a locale-sensitive order would settle that
|
|
23
|
+
// differently from one machine to the next.
|
|
24
|
+
compare(other) {
|
|
25
|
+
return this.name < other.name ? -1 : Number(this.name > other.name);
|
|
26
|
+
}
|
|
27
|
+
withoutExtension() {
|
|
28
|
+
return new FileName(this.name.replace(/\.[^/.]+$/, ''));
|
|
7
29
|
}
|
|
8
30
|
normalize() {
|
|
9
|
-
const
|
|
10
|
-
|
|
31
|
+
const normalized = this.withoutExtension()
|
|
32
|
+
.toString()
|
|
11
33
|
.toLowerCase()
|
|
12
|
-
.replace(/[^a-z0-9-]/g,
|
|
13
|
-
.replace(/-+/g,
|
|
14
|
-
.replace(/(^-|-$)/g,
|
|
34
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
35
|
+
.replace(/-+/g, '-')
|
|
36
|
+
.replace(/(^-|-$)/g, '');
|
|
15
37
|
return new FileName(normalized);
|
|
16
38
|
}
|
|
17
39
|
toString() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileName.js","sourceRoot":"","sources":["../../../src/types/file/fileName.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"fileName.js","sourceRoot":"","sources":["../../../src/types/file/fileName.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;IACF,IAAI,CAAS;IAE9B,YAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,Y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} from
|
|
2
|
-
import { DirectoryPath } from
|
|
1
|
+
import { FileName } from './fileName.js';
|
|
2
|
+
import { DirectoryPath } from './directoryPath.js';
|
|
3
3
|
export declare class FilePath {
|
|
4
4
|
private readonly fileName;
|
|
5
5
|
private readonly directoryPath;
|
|
6
6
|
constructor(path: DirectoryPath, name: FileName);
|
|
7
|
+
/** The leaf name, so callers can ask about it without unwrapping the whole path. */
|
|
8
|
+
name(): FileName;
|
|
9
|
+
directory(): DirectoryPath;
|
|
7
10
|
replaceDirectory(newDirectory: DirectoryPath): FilePath;
|
|
11
|
+
/** The file at the same place below `to` as this one sits below `from`. */
|
|
12
|
+
rebased(from: DirectoryPath, to: DirectoryPath): FilePath;
|
|
13
|
+
/** The same path, spelt the same way: `Logo.png` is not `logo.png`. */
|
|
14
|
+
isEqual(other: FilePath): boolean;
|
|
8
15
|
toString(): string;
|
|
16
|
+
toPosix(): string;
|
|
17
|
+
/**
|
|
18
|
+
* How a message names this file to someone standing in `directory`: the path from there,
|
|
19
|
+
* with forward slashes whatever the platform, so the same file reads the same everywhere.
|
|
20
|
+
*/
|
|
21
|
+
relativeTo(directory: DirectoryPath): string;
|
|
22
|
+
asTypedFrom(from: DirectoryPath): string;
|
|
23
|
+
/** The file `relativePath` names from `directory`, with `/` between its segments as a page or a setting writes it. */
|
|
24
|
+
static resolve(directory: DirectoryPath, relativePath: string): FilePath;
|
|
9
25
|
static create(filePath: string): FilePath | undefined;
|
|
10
26
|
}
|
|
@@ -1,17 +1,52 @@
|
|
|
1
|
-
import path from
|
|
2
|
-
import { FileName } from
|
|
3
|
-
import { DirectoryPath } from
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { FileName } from './fileName.js';
|
|
3
|
+
import { asTypedFrom, DirectoryPath, posix } from './directoryPath.js';
|
|
4
4
|
export class FilePath {
|
|
5
|
+
fileName;
|
|
6
|
+
directoryPath;
|
|
5
7
|
constructor(path, name) {
|
|
6
8
|
this.fileName = name;
|
|
7
9
|
this.directoryPath = path;
|
|
8
10
|
}
|
|
11
|
+
/** The leaf name, so callers can ask about it without unwrapping the whole path. */
|
|
12
|
+
name() {
|
|
13
|
+
return this.fileName;
|
|
14
|
+
}
|
|
15
|
+
directory() {
|
|
16
|
+
return this.directoryPath;
|
|
17
|
+
}
|
|
9
18
|
replaceDirectory(newDirectory) {
|
|
10
19
|
return new FilePath(newDirectory, this.fileName);
|
|
11
20
|
}
|
|
21
|
+
/** The file at the same place below `to` as this one sits below `from`. */
|
|
22
|
+
rebased(from, to) {
|
|
23
|
+
return new FilePath(to.resolve(path.relative(from.toString(), this.directoryPath.toString())), this.fileName);
|
|
24
|
+
}
|
|
25
|
+
/** The same path, spelt the same way: `Logo.png` is not `logo.png`. */
|
|
26
|
+
isEqual(other) {
|
|
27
|
+
return this.directoryPath.isEqual(other.directoryPath) && this.fileName.compare(other.fileName) === 0;
|
|
28
|
+
}
|
|
12
29
|
toString() {
|
|
13
30
|
return path.join(this.directoryPath.toString(), this.fileName.toString());
|
|
14
31
|
}
|
|
32
|
+
toPosix() {
|
|
33
|
+
return `${this.directoryPath.toPosix()}/${this.fileName}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* How a message names this file to someone standing in `directory`: the path from there,
|
|
37
|
+
* with forward slashes whatever the platform, so the same file reads the same everywhere.
|
|
38
|
+
*/
|
|
39
|
+
relativeTo(directory) {
|
|
40
|
+
return posix(path.relative(directory.toString(), this.toString()));
|
|
41
|
+
}
|
|
42
|
+
asTypedFrom(from) {
|
|
43
|
+
return asTypedFrom(this.toString(), from);
|
|
44
|
+
}
|
|
45
|
+
/** The file `relativePath` names from `directory`, with `/` between its segments as a page or a setting writes it. */
|
|
46
|
+
static resolve(directory, relativePath) {
|
|
47
|
+
const resolved = path.resolve(directory.toString(), relativePath);
|
|
48
|
+
return new FilePath(new DirectoryPath(path.dirname(resolved)), new FileName(path.basename(resolved)));
|
|
49
|
+
}
|
|
15
50
|
static create(filePath) {
|
|
16
51
|
if (!filePath) {
|
|
17
52
|
return undefined;
|
|
@@ -24,7 +59,7 @@ export class FilePath {
|
|
|
24
59
|
const fileName = new FileName(filename);
|
|
25
60
|
return new FilePath(directoryPath, fileName);
|
|
26
61
|
}
|
|
27
|
-
catch
|
|
62
|
+
catch {
|
|
28
63
|
return undefined;
|
|
29
64
|
}
|
|
30
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filePath.js","sourceRoot":"","sources":["../../../src/types/file/filePath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"filePath.js","sourceRoot":"","sources":["../../../src/types/file/filePath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,OAAO,QAAQ;IACF,QAAQ,CAAW;IACnB,aAAa,CAAgB;IAE9C,YAAY,IAAmB,EAAE,IAAc;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,oFAAoF;IAC7E,IAAI;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,gBAAgB,CAAC,YAA2B;QACjD,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAED,2EAA2E;IACpE,OAAO,CAAC,IAAmB,EAAE,EAAiB;QACnD,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC,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,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxG,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,QAAgB;QACnC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAChD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;YAC/C,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;YACnD,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxC,OAAO,IAAI,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -27,8 +27,7 @@ export const createResourceInput = (file, url) => {
|
|
|
27
27
|
throw new Error("Must specify either file or url.");
|
|
28
28
|
};
|
|
29
29
|
export function createResourceInputFromInput(path) {
|
|
30
|
-
|
|
31
|
-
const sanitizedPath = removeQuotes((_a = path.trim()) !== null && _a !== void 0 ? _a : "");
|
|
30
|
+
const sanitizedPath = removeQuotes(path.trim() ?? "");
|
|
32
31
|
const urlPath = UrlPath.create(sanitizedPath);
|
|
33
32
|
if (urlPath) {
|
|
34
33
|
return urlPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-input.js","sourceRoot":"","sources":["../../../src/types/file/resource-input.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,O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AAE,IAAI,EAAE,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { URL } from "url";
|
|
2
2
|
export class UrlPath {
|
|
3
|
+
url;
|
|
3
4
|
constructor(url) {
|
|
4
5
|
this.url = url;
|
|
5
6
|
}
|
|
@@ -10,7 +11,7 @@ export class UrlPath {
|
|
|
10
11
|
return new UrlPath(url);
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
catch
|
|
14
|
+
catch {
|
|
14
15
|
// Not a valid URL
|
|
15
16
|
}
|
|
16
17
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlPath.js","sourceRoot":"","sources":["../../../src/types/file/urlPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,OAAO,OAAO;
|
|
1
|
+
{"version":3,"file":"urlPath.js","sourceRoot":"","sources":["../../../src/types/file/urlPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,OAAO,OAAO;IACD,GAAG,CAAS;IAE7B,YAAY,GAAW;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,GAAW;QAC9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,kFAAkF;IAC3E,WAAW;QAChB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QAC5C,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,WAAW,CAAC;IAC9D,CAAC;IAED,+CAA+C;IACxC,OAAO,CAAC,KAAc;QAC3B,OAAO,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Flags } from "@oclif/core";
|
|
2
2
|
export class FlagsProvider {
|
|
3
|
+
static inputFlagName = "input";
|
|
4
|
+
// Common folder flag group
|
|
5
|
+
static input = {
|
|
6
|
+
[FlagsProvider.inputFlagName]: Flags.string({
|
|
7
|
+
char: "i",
|
|
8
|
+
description: "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files."
|
|
9
|
+
})
|
|
10
|
+
};
|
|
3
11
|
static destination(artifact, artifactName) {
|
|
4
12
|
return {
|
|
5
13
|
destination: Flags.string({
|
|
@@ -8,27 +16,19 @@ export class FlagsProvider {
|
|
|
8
16
|
})
|
|
9
17
|
};
|
|
10
18
|
}
|
|
19
|
+
// Auth key group
|
|
20
|
+
static authKey = {
|
|
21
|
+
"auth-key": Flags.string({
|
|
22
|
+
char: "k",
|
|
23
|
+
description: "override current authentication state with an authentication key."
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
static force = {
|
|
27
|
+
force: Flags.boolean({
|
|
28
|
+
char: "f",
|
|
29
|
+
default: false,
|
|
30
|
+
description: "overwrite changes without asking for user consent."
|
|
31
|
+
})
|
|
32
|
+
};
|
|
11
33
|
}
|
|
12
|
-
FlagsProvider.inputFlagName = "input";
|
|
13
|
-
// Common folder flag group
|
|
14
|
-
FlagsProvider.input = {
|
|
15
|
-
[FlagsProvider.inputFlagName]: Flags.string({
|
|
16
|
-
char: "i",
|
|
17
|
-
description: "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files."
|
|
18
|
-
})
|
|
19
|
-
};
|
|
20
|
-
// Auth key group
|
|
21
|
-
FlagsProvider.authKey = {
|
|
22
|
-
"auth-key": Flags.string({
|
|
23
|
-
char: "k",
|
|
24
|
-
description: "override current authentication state with an authentication key."
|
|
25
|
-
})
|
|
26
|
-
};
|
|
27
|
-
FlagsProvider.force = {
|
|
28
|
-
force: Flags.boolean({
|
|
29
|
-
char: "f",
|
|
30
|
-
default: false,
|
|
31
|
-
description: "overwrite changes without asking for user consent."
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
34
|
//# sourceMappingURL=flags-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags-provider.js","sourceRoot":"","sources":["../../src/types/flags-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"flags-provider.js","sourceRoot":"","sources":["../../src/types/flags-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,OAAO,aAAa;IAChB,MAAM,CAAU,aAAa,GAAW,OAAgB,CAAC;IACjE,2BAA2B;IACpB,MAAM,CAAC,KAAK,GAAG;QACpB,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC;YAC1C,IAAI,EAAE,GAAG;YACT,WAAW,EACT,uIAAuI;SAC1I,CAAC;KACH,CAAC;IAEK,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,YAAoB;QAC9D,OAAO;YACL,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;gBACxB,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,cAAc,aAAa,CAAC,aAAa,KAAK,QAAQ,oBAAoB,YAAY,qBAAqB;aACzH,CAAC;SACH,CAAC;IACJ,CAAC;IAED,iBAAiB;IACV,MAAM,CAAC,OAAO,GAAG;QACtB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,mEAAmE;SACjF,CAAC;KACH,CAAC;IAEK,MAAM,CAAC,KAAK,GAAG;QACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,IAAI,EAAE,GAAG;YACT,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,oDAAoD;SAClE,CAAC;KACH,CAAC;CACH"}
|
|
@@ -2,9 +2,10 @@ import { FileService } from '../infrastructure/file-service.js';
|
|
|
2
2
|
import { FilePath } from './file/filePath.js';
|
|
3
3
|
import { FileName } from './file/fileName.js';
|
|
4
4
|
export class PackageSettingsContext {
|
|
5
|
+
packageSettingsDirectory;
|
|
6
|
+
fileService = new FileService();
|
|
5
7
|
constructor(packageSettingsDirectory) {
|
|
6
8
|
this.packageSettingsDirectory = packageSettingsDirectory;
|
|
7
|
-
this.fileService = new FileService();
|
|
8
9
|
}
|
|
9
10
|
getSettingsFilePath(language) {
|
|
10
11
|
return new FilePath(this.packageSettingsDirectory, new FileName(`${language}.json`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-settings-context.js","sourceRoot":"","sources":["../../src/types/package-settings-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAIhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,sBAAsB;
|
|
1
|
+
{"version":3,"file":"package-settings-context.js","sourceRoot":"","sources":["../../src/types/package-settings-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAIhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,sBAAsB;IAGJ,wBAAwB;IAFpC,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAEjD,YAA6B,wBAAuC;wCAAvC,wBAAwB;IAAkB,CAAC;IAEhE,mBAAmB,CAAC,QAAkB;QAC5C,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,QAAQ,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC;IACvF,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,oBAA8C,EAAE,QAAkB;QAChG,MAAM,uBAAuB,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACnE,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,uBAAuB,CAAC;YAAE,OAAO;QACvE,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACjF,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnH,CAAC;CACF"}
|