@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,86 +1,92 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
3
|
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
4
|
-
import { CodeGenerationVersion,
|
|
4
|
+
import { CodeGenerationVersion, Language, Stability } from '../../types/sdk/generate.js';
|
|
5
|
+
import { StabilityChoice } from '../../types/sdk/stability-choice.js';
|
|
6
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
5
7
|
import { format, intro, outro } from '../../prompts/format.js';
|
|
6
8
|
import { PublishType } from '../../types/publish-api/publishing-profile-item.js';
|
|
7
9
|
import { TelemetryService } from '../../infrastructure/services/telemetry-service.js';
|
|
8
10
|
import { SdkPublishValidationFailedEvent } from '../../types/events/sdk-publish-validation-failed.js';
|
|
9
11
|
import { SdkPublishInteractiveAction } from '../../actions/sdk/publish/interactive.js';
|
|
10
12
|
import { SdkPublishNonInteractiveAction } from '../../actions/sdk/publish/non-interactive.js';
|
|
11
|
-
class SdkPublish extends Command {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
export default class SdkPublish extends Command {
|
|
14
|
+
static summary = 'Generate and publish an SDK to a package registry and/or source repository';
|
|
15
|
+
static description = `Generate and publish an SDK using a publishing profile configured in the APIMatic App. Requires an input directory containing the API specification. Run without flags for a step-by-step interactive experience, or pass all required flags for CI/CD automation.`;
|
|
16
|
+
static cmdTxt = format.cmd('apimatic', 'sdk', 'publish');
|
|
17
|
+
static flags = {
|
|
18
|
+
'profile-id': Flags.string({
|
|
19
|
+
char: 'p',
|
|
20
|
+
description: 'Id of the publishing profile to use.'
|
|
21
|
+
}),
|
|
22
|
+
version: Flags.string({
|
|
23
|
+
char: 'v',
|
|
24
|
+
description: 'Semantic version of the SDK to publish (e.g. 1.0.0).'
|
|
25
|
+
}),
|
|
26
|
+
...FlagsProvider.destination('sdk', 'sdk'),
|
|
27
|
+
language: Flags.string({
|
|
28
|
+
char: 'l',
|
|
29
|
+
description: 'Language of the SDK to generate and publish.',
|
|
30
|
+
options: Object.values(Language).map((l) => l.valueOf())
|
|
31
|
+
}),
|
|
32
|
+
...FlagsProvider.force,
|
|
33
|
+
...FlagsProvider.input,
|
|
34
|
+
'publish-type': Flags.string({
|
|
35
|
+
description: "One or more publishing targets: 'package' for a package registry, 'sourcecode' for a git repository.",
|
|
36
|
+
options: [PublishType.PackagePublishing, PublishType.SourceCodePublishing],
|
|
37
|
+
multiple: true,
|
|
38
|
+
multipleNonGreedy: true
|
|
39
|
+
}),
|
|
40
|
+
'dry-run': Flags.boolean({
|
|
41
|
+
default: false,
|
|
42
|
+
description: 'Generate the SDK locally for review without publishing.'
|
|
43
|
+
}),
|
|
44
|
+
'codegen-version': Flags.string({
|
|
45
|
+
description: 'Version of the code generator to use',
|
|
46
|
+
options: Object.values(CodeGenerationVersion).map((v) => v.valueOf()),
|
|
47
|
+
default: CodeGenerationVersion.V4
|
|
48
|
+
}),
|
|
49
|
+
stability: Flags.string({
|
|
50
|
+
description: 'Stability level of the generated SDK. Defaults to the level the language offers.',
|
|
51
|
+
options: Object.values(Stability).map((s) => s.valueOf())
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
static examples = [
|
|
55
|
+
`${SdkPublish.cmdTxt}`,
|
|
56
|
+
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'a1b2c3d4e5f6a1b2c3d4e5f6')} ${format.flag('language', 'typescript')} ${format.flag('version', '1.0.0')} ${format.flag('publish-type', PublishType.PackagePublishing)} ${format.flag('publish-type', PublishType.SourceCodePublishing)}`,
|
|
57
|
+
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'b2c3d4e5f6a1b2c3d4e5f6a1')} ${format.flag('language', 'csharp')} ${format.flag('version', '2.0.0')} ${format.flag('publish-type', PublishType.SourceCodePublishing)}`,
|
|
58
|
+
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'c3d4e5f6a1b2c3d4e5f6a1b2')} ${format.flag('language', 'python')} ${format.flag('version', '1.0.0')} ${format.flag('publish-type', PublishType.PackagePublishing)} ${format.flag('dry-run')}`
|
|
59
|
+
];
|
|
18
60
|
async run() {
|
|
19
|
-
|
|
20
|
-
const { flags: { 'profile-id': profileId, version, destination, language, force, input, 'publish-type': publishType, 'dry-run': dryRun, 'codegen-version': codegenVersion, stability, 'update-plugin-config': updatePluginConfig }, metadata } = await this.parse(SdkPublish);
|
|
61
|
+
const { flags: { 'profile-id': profileId, version, destination, language, force, input, 'publish-type': publishType, 'dry-run': dryRun, stability, 'codegen-version': codegenVersion } } = await this.parse(SdkPublish);
|
|
21
62
|
const publishTypes = [...new Set(publishType)];
|
|
22
63
|
const interactive = this.argv.length === 0;
|
|
23
64
|
const commandMetadata = {
|
|
24
65
|
commandName: SdkPublish.id,
|
|
25
66
|
shell: this.config.shell
|
|
26
67
|
};
|
|
27
|
-
const
|
|
28
|
-
const buildDirectory = input ? new DirectoryPath(input, 'src') : workingDirectory.join('src');
|
|
29
|
-
const sdkDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join('sdk');
|
|
68
|
+
const project = ProjectContext.at(input);
|
|
30
69
|
const configDir = this.getConfigDir();
|
|
31
70
|
const telemetryService = new TelemetryService(configDir);
|
|
32
71
|
const onPublishSdkError = interactive
|
|
33
72
|
? (errorMessage) => telemetryService.trackEvent(new SdkPublishValidationFailedEvent(errorMessage, SdkPublish.id, { interactive: true }), commandMetadata.shell)
|
|
34
|
-
: (errorMessage) => telemetryService.trackEvent(new SdkPublishValidationFailedEvent(errorMessage, SdkPublish.id,
|
|
35
|
-
|
|
73
|
+
: (errorMessage) => telemetryService.trackEvent(new SdkPublishValidationFailedEvent(errorMessage, SdkPublish.id, {
|
|
74
|
+
'profile-id': profileId,
|
|
75
|
+
version,
|
|
76
|
+
language,
|
|
77
|
+
...(force && { force }),
|
|
78
|
+
'publish-type': publishTypes,
|
|
79
|
+
stability,
|
|
80
|
+
'codegen-version': codegenVersion
|
|
81
|
+
}), commandMetadata.shell);
|
|
36
82
|
intro('Publish SDK');
|
|
37
83
|
const result = interactive
|
|
38
|
-
? await new SdkPublishInteractiveAction(configDir, commandMetadata).execute(
|
|
39
|
-
: await new SdkPublishNonInteractiveAction(configDir, commandMetadata).execute(
|
|
84
|
+
? await new SdkPublishInteractiveAction(configDir, commandMetadata).execute(DirectoryPath.createInput(input), onPublishSdkError)
|
|
85
|
+
: await new SdkPublishNonInteractiveAction(configDir, commandMetadata).execute(project, project.sdkDirectory(destination), language, publishTypes, force, dryRun, StabilityChoice.for(language, stability), onPublishSdkError, profileId, version);
|
|
40
86
|
outro(result);
|
|
41
87
|
}
|
|
88
|
+
getConfigDir = () => {
|
|
89
|
+
return new DirectoryPath(this.config.configDir);
|
|
90
|
+
};
|
|
42
91
|
}
|
|
43
|
-
SdkPublish.summary = 'Generate and publish an SDK to a package registry and/or source repository';
|
|
44
|
-
SdkPublish.description = `Generate and publish an SDK using a publishing profile configured in the APIMatic App. Requires an input directory containing the API specification. Run without flags for a step-by-step interactive experience, or pass all required flags for CI/CD automation.`;
|
|
45
|
-
SdkPublish.cmdTxt = format.cmd('apimatic', 'sdk', 'publish');
|
|
46
|
-
SdkPublish.flags = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ 'profile-id': Flags.string({
|
|
47
|
-
char: 'p',
|
|
48
|
-
description: 'Id of the publishing profile to use.'
|
|
49
|
-
}), version: Flags.string({
|
|
50
|
-
char: 'v',
|
|
51
|
-
description: 'Semantic version of the SDK to publish (e.g. 1.0.0).'
|
|
52
|
-
}) }, FlagsProvider.destination('sdk', 'sdk')), { language: Flags.string({
|
|
53
|
-
char: 'l',
|
|
54
|
-
description: 'Language of the SDK to generate and publish.',
|
|
55
|
-
options: Object.values(Language)
|
|
56
|
-
.filter((l) => l !== Language.GO)
|
|
57
|
-
.map((l) => l.valueOf())
|
|
58
|
-
}) }), FlagsProvider.force), FlagsProvider.input), { 'publish-type': Flags.string({
|
|
59
|
-
description: "One or more publishing targets: 'package' for a package registry, 'sourcecode' for a git repository.",
|
|
60
|
-
options: [PublishType.PackagePublishing, PublishType.SourceCodePublishing],
|
|
61
|
-
multiple: true,
|
|
62
|
-
multipleNonGreedy: true
|
|
63
|
-
}), 'dry-run': Flags.boolean({
|
|
64
|
-
default: false,
|
|
65
|
-
description: 'Generate the SDK locally for review without publishing.'
|
|
66
|
-
}), 'codegen-version': Flags.string({
|
|
67
|
-
description: 'Version of the code generator to use',
|
|
68
|
-
options: Object.values(CodeGenerationVersion).map((v) => v.valueOf()),
|
|
69
|
-
default: CodeGenerationVersion.V3
|
|
70
|
-
}), 'stability': Flags.string({
|
|
71
|
-
description: 'Stability level of the generated SDK',
|
|
72
|
-
options: Object.values(Stability).map((s) => s.valueOf()),
|
|
73
|
-
default: Stability.STABLE
|
|
74
|
-
}), 'update-plugin-config': Flags.boolean({
|
|
75
|
-
default: false,
|
|
76
|
-
description: "Record the published SDK in 'plugin-config.json', creating the file if it does not exist. Interactive runs are asked instead."
|
|
77
|
-
}) });
|
|
78
|
-
SdkPublish.examples = [
|
|
79
|
-
`${SdkPublish.cmdTxt}`,
|
|
80
|
-
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'a1b2c3d4e5f6a1b2c3d4e5f6')} ${format.flag('language', 'typescript')} ${format.flag('version', '1.0.0')} ${format.flag('publish-type', PublishType.PackagePublishing)} ${format.flag('publish-type', PublishType.SourceCodePublishing)}`,
|
|
81
|
-
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'b2c3d4e5f6a1b2c3d4e5f6a1')} ${format.flag('language', 'java')} ${format.flag('version', '2.0.0')} ${format.flag('publish-type', PublishType.SourceCodePublishing)}`,
|
|
82
|
-
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'c3d4e5f6a1b2c3d4e5f6a1b2')} ${format.flag('language', 'python')} ${format.flag('version', '1.0.0')} ${format.flag('publish-type', PublishType.PackagePublishing)} ${format.flag('dry-run')}`,
|
|
83
|
-
`${SdkPublish.cmdTxt} ${format.flag('profile-id', 'd4e5f6a1b2c3d4e5f6a1b2c3')} ${format.flag('language', 'csharp')} ${format.flag('version', '1.0.0')} ${format.flag('publish-type', PublishType.PackagePublishing)} ${format.flag('codegen-version', 'v4')} ${format.flag('stability', 'beta')}`
|
|
84
|
-
];
|
|
85
|
-
export default SdkPublish;
|
|
86
92
|
//# sourceMappingURL=publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/commands/sdk/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/commands/sdk/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;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,EACjB,SAAS,EACT,OAAO,CACR,CAAC;QACN,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAEgB,YAAY,GAAG,GAAG,EAAE;QACnC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC;CACH"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
// npm and pnpm only warn when the installed Node falls outside `engines.node`, so without
|
|
3
|
+
// this the install succeeds and the failure surfaces later as an unrelated-looking crash.
|
|
4
|
+
const hook = async function () {
|
|
5
|
+
const supported = this.config.pjson.engines?.node;
|
|
6
|
+
if (supported !== undefined && !semver.satisfies(process.versions.node, supported)) {
|
|
7
|
+
this.error(`The APIMatic CLI needs Node ${supported}; this is Node ${process.versions.node}. ` +
|
|
8
|
+
'Upgrade Node from https://nodejs.org/en/download and reinstall the CLI.', { exit: 1 });
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export default hook;
|
|
12
|
+
//# sourceMappingURL=node-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-version.js","sourceRoot":"","sources":["../../src/hooks/node-version.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,0FAA0F;AAC1F,0FAA0F;AAC1F,MAAM,IAAI,GAAc,KAAK;IAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;IAClD,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC;QACnF,IAAI,CAAC,KAAK,CACR,+BAA+B,SAAS,kBAAkB,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI;YACjF,yEAAyE,EAC3E,EAAE,IAAI,EAAE,CAAC,EAAE,CACZ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/lib/hooks/not-found.js
CHANGED
|
@@ -3,7 +3,6 @@ import { toConfiguredId } from "@oclif/core";
|
|
|
3
3
|
import { cyan, yellow } from "ansis";
|
|
4
4
|
import utils from "./utils.js";
|
|
5
5
|
const hook = async function (opts) {
|
|
6
|
-
var _a;
|
|
7
6
|
const hiddenCommandIds = new Set(opts.config.commands.filter((c) => c.hidden).map((c) => c.id));
|
|
8
7
|
const commandIDs = [...opts.config.commandIDs, ...opts.config.commands.flatMap((c) => c.aliases)].filter((c) => !hiddenCommandIds.has(c));
|
|
9
8
|
if (commandIDs.length === 0)
|
|
@@ -32,12 +31,12 @@ const hook = async function (opts) {
|
|
|
32
31
|
try {
|
|
33
32
|
response = await utils.getConfirmation(readableSuggestion);
|
|
34
33
|
}
|
|
35
|
-
catch
|
|
34
|
+
catch {
|
|
36
35
|
response = false;
|
|
37
36
|
}
|
|
38
37
|
if (response) {
|
|
39
38
|
const confirmedSuggestion = suggestion;
|
|
40
|
-
let argv =
|
|
39
|
+
let argv = opts.argv ?? [];
|
|
41
40
|
if (confirmedSuggestion.startsWith("help:")) {
|
|
42
41
|
argv = confirmedSuggestion.split(":").slice(1);
|
|
43
42
|
suggestion = "help";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"not-found.js","sourceRoot":"","sources":["../../src/hooks/not-found.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,EAAQ,cAAc,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,MAAM,IAAI,GAAyB,KAAK,WAAW,IAAI
|
|
1
|
+
{"version":3,"file":"not-found.js","sourceRoot":"","sources":["../../src/hooks/not-found.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,EAAQ,cAAc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C,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/C,UAAU,GAAG,MAAM,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,oCAAoC,EAAE;QACxE,IAAI,EAAE,GAAG;KACV,CAAC,CAAC;AAEL,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/lib/hooks/utils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
declare const getConfirmation: (suggestion: string) => Promise<boolean>;
|
|
2
|
+
declare const closest: (target: string, possibilities: string[]) => string | null;
|
|
1
3
|
declare const _default: {
|
|
2
|
-
closest:
|
|
3
|
-
getConfirmation:
|
|
4
|
+
closest: typeof closest;
|
|
5
|
+
getConfirmation: typeof getConfirmation;
|
|
4
6
|
};
|
|
5
7
|
export default _default;
|
package/lib/hooks/utils.js
CHANGED
|
@@ -25,9 +25,9 @@ const getConfirmation = async (suggestion) => {
|
|
|
25
25
|
};
|
|
26
26
|
const timeout = setTimeout(() => {
|
|
27
27
|
finish(false);
|
|
28
|
-
},
|
|
28
|
+
}, 10_000);
|
|
29
29
|
rl.question(question, (answer) => {
|
|
30
|
-
const a = (answer
|
|
30
|
+
const a = (answer ?? '').trim().toLowerCase();
|
|
31
31
|
finish(a === '' || a === 'y' || a === 'yes');
|
|
32
32
|
});
|
|
33
33
|
});
|
package/lib/hooks/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/hooks/utils.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,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AiB,EAAE;IACzE,IAAI,IAAI,GAAkB,IAAI,CAAC;IAC/B,IAAI,YAAY,GAAG,QAAQ,CAAC;IAE5B,KAAK,MAAM,EAAE,IAAI,aAAa,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,IAAI,QAAQ,GAAG,YAAY,EAAE,CAAC;YAC5B,YAAY,GAAG,QAAQ,CAAC;YACxB,IAAI,GAAG,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe;IACb,OAAO;IACP,eAAe;CAChB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
1
2
|
declare class EnvInfo {
|
|
2
3
|
private static cachedCliVersion;
|
|
3
4
|
private static cachedUserAgent;
|
|
@@ -6,6 +7,8 @@ declare class EnvInfo {
|
|
|
6
7
|
private static cachedPublishingBaseUrl;
|
|
7
8
|
getUserAgent(shell: string): string;
|
|
8
9
|
getCLIVersion(): string;
|
|
10
|
+
/** Where the CLI is installed: the directory holding its `package.json` and what it ships. */
|
|
11
|
+
packageRoot(): DirectoryPath;
|
|
9
12
|
getBaseUrl(): string | undefined;
|
|
10
13
|
getAuthBaseUrl(): string | undefined;
|
|
11
14
|
getPublishingBaseUrl(): string | undefined;
|
|
@@ -2,7 +2,13 @@ import os from 'os';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import fs from 'fs-extra';
|
|
5
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
5
6
|
class EnvInfo {
|
|
7
|
+
static cachedCliVersion = null;
|
|
8
|
+
static cachedUserAgent = null;
|
|
9
|
+
static cachedBaseUrl;
|
|
10
|
+
static cachedAuthBaseUrl;
|
|
11
|
+
static cachedPublishingBaseUrl;
|
|
6
12
|
getUserAgent(shell) {
|
|
7
13
|
if (!EnvInfo.cachedUserAgent) {
|
|
8
14
|
const osInfo = `${os.platform()} ${os.release()}`;
|
|
@@ -17,19 +23,22 @@ class EnvInfo {
|
|
|
17
23
|
return EnvInfo.cachedCliVersion;
|
|
18
24
|
}
|
|
19
25
|
try {
|
|
20
|
-
const
|
|
21
|
-
const __dirname = dirname(__filename);
|
|
22
|
-
const pkgPath = join(__dirname, '../../package.json');
|
|
26
|
+
const pkgPath = join(this.packageRoot().toString(), 'package.json');
|
|
23
27
|
const pkgJson = fs.readFileSync(pkgPath, 'utf-8');
|
|
24
28
|
const pkg = JSON.parse(pkgJson);
|
|
25
29
|
const version = pkg.version || 'unknown';
|
|
26
30
|
EnvInfo.cachedCliVersion = version;
|
|
27
31
|
return version;
|
|
28
32
|
}
|
|
29
|
-
catch
|
|
33
|
+
catch {
|
|
30
34
|
return 'unknown';
|
|
31
35
|
}
|
|
32
36
|
}
|
|
37
|
+
/** Where the CLI is installed: the directory holding its `package.json` and what it ships. */
|
|
38
|
+
packageRoot() {
|
|
39
|
+
// This file sits two levels down, in `lib/infrastructure/` or, under tsx, `src/infrastructure/`.
|
|
40
|
+
return new DirectoryPath(join(dirname(fileURLToPath(import.meta.url)), '..', '..'));
|
|
41
|
+
}
|
|
33
42
|
getBaseUrl() {
|
|
34
43
|
if (EnvInfo.cachedBaseUrl) {
|
|
35
44
|
return EnvInfo.cachedBaseUrl;
|
|
@@ -63,7 +72,5 @@ class EnvInfo {
|
|
|
63
72
|
return EnvInfo.cachedPublishingBaseUrl;
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
|
-
EnvInfo.cachedCliVersion = null;
|
|
67
|
-
EnvInfo.cachedUserAgent = null;
|
|
68
75
|
export const envInfo = new EnvInfo();
|
|
69
76
|
//# sourceMappingURL=env-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-info.js","sourceRoot":"","sources":["../../src/infrastructure/env-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"env-info.js","sourceRoot":"","sources":["../../src/infrastructure/env-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,OAAO;IACH,MAAM,CAAC,gBAAgB,GAAkB,IAAI,CAAC;IAC9C,MAAM,CAAC,eAAe,GAAkB,IAAI,CAAC;IAC7C,MAAM,CAAC,aAAa,CAAqB;IACzC,MAAM,CAAC,iBAAiB,CAAqB;IAC7C,MAAM,CAAC,uBAAuB,CAAqB;IAEpD,YAAY,CAAC,KAAa;QAC/B,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAClD,MAAM,MAAM,GAAG,SAAS,CAAC;YACzB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;YACtC,OAAO,CAAC,eAAe,GAAG,gBAAgB,IAAI,CAAC,aAAa,EAAE,WAAW,MAAM,aAAa,MAAM,IAAI,aAAa,YAAY,KAAK,GAAG,CAAC;QAC1I,CAAC;QACD,OAAO,OAAO,CAAC,eAAe,CAAC;IACjC,CAAC;IAEM,aAAa;QAClB,IAAI,OAAO,CAAC,gBAAg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BAAiB,CAAC;QAClD,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACxC,OAAO,CAAC,iBAAiB,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9E,CAAC;QACD,OAAO,OAAO,CAAC,iBAAiB,CAAC;IACnC,CAAC;IAEM,oBAAoB;QACzB,IAAI,OAAO,CAAC,uBAAuB,EAAE,CAAC;YACpC,OAAO,OAAO,CAAC,uBAAuB,CAAC;QACzC,CAAC;QACD,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAClD,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACxC,OAAO,CAAC,uBAAuB,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpF,CAAC;QACD,OAAO,OAAO,CAAC,uBAAuB,CAAC;IACzC,CAAC;CACF;AACD,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -1,34 +1,61 @@
|
|
|
1
|
-
import fs from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import { DirectoryPath } from
|
|
4
|
-
import { Directory } from
|
|
5
|
-
import { FileName } from
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import { FilePath } from '../types/file/filePath.js';
|
|
3
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
4
|
+
import { Directory } from '../types/file/directory.js';
|
|
5
|
+
import { FileName } from '../types/file/fileName.js';
|
|
6
6
|
export declare class FileService {
|
|
7
7
|
fileExists(file: FilePath): Promise<boolean>;
|
|
8
8
|
fileExistsSync(file: FilePath): boolean;
|
|
9
9
|
directoryExists(dir: DirectoryPath): Promise<boolean>;
|
|
10
10
|
directoryExistsSync(dir: DirectoryPath): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Hidden entries do not count: scaffolding into a directory that holds only a `.git` is
|
|
13
|
+
* the normal way to start a project, so the prompts say "apart from hidden files".
|
|
14
|
+
*/
|
|
11
15
|
directoryEmpty(dir: DirectoryPath): Promise<boolean>;
|
|
12
16
|
cleanDirectory(dir: DirectoryPath): Promise<void>;
|
|
13
17
|
cleanDirectoryExcluding(dir: DirectoryPath, excludeNames: FileName[]): Promise<void>;
|
|
14
18
|
createDirectoryIfNotExists(dir: DirectoryPath): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* The whole tree beneath `directoryPath`. A link to nothing is left out rather than failing
|
|
21
|
+
* the walk, which is what a glob over the same tree would do with it. Any other failure
|
|
22
|
+
* still throws: a file that cannot be examined is a file the caller would otherwise never
|
|
23
|
+
* hear about, and a missing specification is worse than a failed build.
|
|
24
|
+
*/
|
|
15
25
|
getDirectory(directoryPath: DirectoryPath): Promise<Directory>;
|
|
26
|
+
/**
|
|
27
|
+
* The names of the files directly inside `dir`. `getDirectory` walks the whole tree and
|
|
28
|
+
* stats every entry, which is wasted work when only the top level is wanted, and throws on
|
|
29
|
+
* an entry it cannot stat -- out of callers that have no way to report it.
|
|
30
|
+
*/
|
|
31
|
+
getFileNames(dir: DirectoryPath): Promise<FileName[]>;
|
|
16
32
|
getSubDirectoriesPaths(dir: DirectoryPath): Promise<DirectoryPath[]>;
|
|
33
|
+
spelledOnDisk(root: DirectoryPath, file: FilePath): Promise<FilePath | null>;
|
|
34
|
+
private listEntries;
|
|
17
35
|
copyDirectoryContents(source: DirectoryPath, destination: DirectoryPath): Promise<void>;
|
|
36
|
+
moveDirectoryContents(source: DirectoryPath, destination: DirectoryPath): Promise<void>;
|
|
37
|
+
private forEachEntry;
|
|
18
38
|
copyDirectoryExcluding(source: DirectoryPath, destination: DirectoryPath, excludeNames: FileName[]): Promise<void>;
|
|
19
39
|
deleteFile(filePath: FilePath): Promise<void>;
|
|
20
40
|
deleteDirectory(dirPath: DirectoryPath): Promise<void>;
|
|
21
41
|
pollDeleteDirectory(dirPath: DirectoryPath, onDeleteFailurePersists: () => void): Promise<void>;
|
|
22
|
-
getRelativePath(filePath: FilePath, basePath: DirectoryPath): string;
|
|
23
42
|
getStream(filePath: FilePath): Promise<fs.ReadStream>;
|
|
24
43
|
getContents(filePath: FilePath): Promise<string>;
|
|
25
44
|
writeFile(filePath: FilePath, stream: NodeJS.ReadableStream): Promise<void>;
|
|
26
45
|
ensurePathExists(filePath: FilePath): Promise<void>;
|
|
27
46
|
writeContents(filePath: FilePath, contents: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Writes beside the target and renames over it, so a fault mid-write leaves the target as it
|
|
49
|
+
* was rather than half-written. The temporary file goes on a failure for the same reason: a
|
|
50
|
+
* write that did not happen must leave nothing behind.
|
|
51
|
+
*/
|
|
52
|
+
replaceContents(filePath: FilePath, contents: string): Promise<void>;
|
|
53
|
+
/** Renamed over, so a watcher never reads it half-written, and skipped when unchanged, so nothing reloads. */
|
|
54
|
+
replaceContentsIfChanged(filePath: FilePath, contents: string): Promise<boolean>;
|
|
28
55
|
copy(source: FilePath, destination: FilePath): Promise<void>;
|
|
56
|
+
/** Skipped when the destination has the source's size and time, to the millisecond a copy keeps. */
|
|
57
|
+
copyIfChanged(source: FilePath, destination: FilePath): Promise<boolean>;
|
|
29
58
|
copyToDir(source: FilePath, destination: DirectoryPath): Promise<void>;
|
|
30
|
-
readFile(filePath: FilePath): Promise<string>;
|
|
31
59
|
isZipFile(filePath: FilePath): Promise<boolean>;
|
|
32
|
-
hasContent(file: FilePath, content: string): Promise<boolean>;
|
|
33
60
|
getAvailableDirectoryPath(currentPath: DirectoryPath): Promise<DirectoryPath>;
|
|
34
61
|
}
|