@apimatic/cli 1.5.0 → 2.0.0-beta.2
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 +221 -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 +100 -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 +193 -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 +68 -0
- package/lib/types/apimatic-config/document.js +161 -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 +154 -442
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/actions/sdk/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AASjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/actions/sdk/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AASjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OA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publishing-profile-item.js';
|
|
3
|
+
import { PublishingProfile } from '../../types/publish/publishing-profile.js';
|
|
4
|
+
import { SemVersion } from '../../types/publish/version.js';
|
|
5
|
+
import { Language } from '../../types/sdk/generate.js';
|
|
6
|
+
import { ActionResult } from '../action-result.js';
|
|
7
|
+
/**
|
|
8
|
+
* Callers discard the result: this runs after a publish that already succeeded, and no outcome here
|
|
9
|
+
* may change that.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RecordPublishedSdkAction {
|
|
12
|
+
private readonly prompts;
|
|
13
|
+
readonly execute: (project: ProjectContext, language: Language, publishingProfile: PublishingProfile, publishTypes: PublishType[], packageVersion: SemVersion) => Promise<ActionResult>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { RecordPublishedSdkPrompts } from '../../prompts/sdk/record-published-sdk.js';
|
|
2
|
+
import { findingClause } from '../../types/apimatic-config/document.js';
|
|
3
|
+
import { buildLanguageEntry, languagesOf, withLanguage } from '../../types/apimatic-config/languages-block.js';
|
|
4
|
+
import { PublishType } from '../../types/publish-api/publishing-profile-item.js';
|
|
5
|
+
import { ActionResult } from '../action-result.js';
|
|
6
|
+
/** A publish writes where its SDK went, and nothing else in the file is its business. */
|
|
7
|
+
const RECORDED_BLOCKS = ['languages'];
|
|
8
|
+
/**
|
|
9
|
+
* Callers discard the result: this runs after a publish that already succeeded, and no outcome here
|
|
10
|
+
* may change that.
|
|
11
|
+
*/
|
|
12
|
+
export class RecordPublishedSdkAction {
|
|
13
|
+
prompts = new RecordPublishedSdkPrompts();
|
|
14
|
+
execute = async (project, language, publishingProfile, publishTypes, packageVersion) => {
|
|
15
|
+
// A package-only run claims no repository, and a source-only run records no released version.
|
|
16
|
+
// The configuration is written either way: it says how the package is set up, not that one is.
|
|
17
|
+
const entry = buildLanguageEntry(language, publishTypes.includes(PublishType.SourceCodePublishing)
|
|
18
|
+
? publishingProfile.getGitConfigurationForLanguage(language)
|
|
19
|
+
: undefined, publishingProfile.getPackageConfigurationDataForLanguage(language), publishTypes.includes(PublishType.PackagePublishing) ? packageVersion : undefined);
|
|
20
|
+
const config = project.config();
|
|
21
|
+
const state = await config.read();
|
|
22
|
+
if (state.state === 'unparseable') {
|
|
23
|
+
this.prompts.configUnreadable(findingClause(state.findings));
|
|
24
|
+
return ActionResult.failed();
|
|
25
|
+
}
|
|
26
|
+
const configExisted = state.state === 'parsed';
|
|
27
|
+
if (configExisted) {
|
|
28
|
+
const findings = state.document.findingsFor('root', ...RECORDED_BLOCKS);
|
|
29
|
+
if (findings.length > 0) {
|
|
30
|
+
this.prompts.configUnreadable(findingClause(findings));
|
|
31
|
+
return ActionResult.failed();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const recorded = configExisted ? languagesOf(state.document)[language] : undefined;
|
|
35
|
+
if (!entry.publishing?.source && !recorded?.publishing?.source) {
|
|
36
|
+
this.prompts.noSourceRepository(language);
|
|
37
|
+
}
|
|
38
|
+
const packageSettings = publishingProfile.getPackageSettingsStateForLanguage(language);
|
|
39
|
+
const written = await config.merge(RECORDED_BLOCKS, (document) => document.with('languages', withLanguage(languagesOf(document), language, entry, packageSettings)));
|
|
40
|
+
if (written.isErr()) {
|
|
41
|
+
switch (written.error) {
|
|
42
|
+
// Readable a moment ago, so this only happens if the file changed underneath us.
|
|
43
|
+
case 'unreadable':
|
|
44
|
+
this.prompts.configUnreadable();
|
|
45
|
+
return ActionResult.failed();
|
|
46
|
+
case 'unwritable':
|
|
47
|
+
this.prompts.configNotWritten();
|
|
48
|
+
return ActionResult.failed();
|
|
49
|
+
default:
|
|
50
|
+
throw written.error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
this.prompts.sdkRecorded(language, configExisted);
|
|
54
|
+
return ActionResult.success();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=record-published-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-published-sdk.js","sourceRoot":"","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,gBAAgB,EAAE,CAAC;oBAChC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC/B,KAAK,YAAY;oBACf,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;oBAChC,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;gBAC/B;oBACE,MAAM,OAAO,CAAC,KAAqB,CAAC;YACxC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAClD,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-manager.js","sourceRoot":"","sources":["../../src/client-utils/auth-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAQ1B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAiB;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,CAAC;IAAC,
|
|
1
|
+
{"version":3,"file":"auth-manager.js","sourceRoot":"","sources":["../../src/client-utils/auth-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAQ1B;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAiB;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,OAAe,EACf,mBAA4B,EAC5B,SAAwB;IAExB,MAAM,WAAW,GAAa;QAC5B,KAAK;QACL,OAAO;QACP,6BAA6B,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;KAC/D,CAAC;IACF,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;IAEtE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAEtE,OAAO,MAAM,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAwB;IAC3D,MAAM,WAAW,GAAa;QAC5B,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;KACZ,CAAC;IACF,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,aAAa,CAAC,CAAC;IAEtE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAEtE,OAAO,MAAM,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Transform extends Command {
|
|
3
3
|
static readonly summary = "Transform API specifications between different formats";
|
|
4
4
|
static readonly description = "Transform API specifications from one format to another.\nSupports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.";
|
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
import { Command, Flags } from
|
|
2
|
-
import { DirectoryPath } from
|
|
3
|
-
import { FlagsProvider } from
|
|
4
|
-
import { TransformAction } from
|
|
5
|
-
import { format, intro, outro } from
|
|
6
|
-
import { createResourceInput } from
|
|
7
|
-
import { TransformationFormats } from
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
|
+
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
4
|
+
import { TransformAction } from '../../actions/api/transform.js';
|
|
5
|
+
import { format, intro, outro } from '../../prompts/format.js';
|
|
6
|
+
import { createResourceInput } from '../../types/file/resource-input.js';
|
|
7
|
+
import { TransformationFormats } from '../../types/api/transform.js';
|
|
8
|
+
import { TRANSFORMATIONS_DIRECTORY_NAME } from '../../types/transform-context.js';
|
|
9
|
+
import { ExportFormats } from '@apimatic/sdk';
|
|
10
|
+
export default class Transform extends Command {
|
|
11
|
+
static summary = 'Transform API specifications between different formats';
|
|
12
|
+
static description = `Transform API specifications from one format to another.
|
|
13
|
+
Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.`;
|
|
14
|
+
static cmdTxt = format.cmd('apimatic', 'api', 'transform');
|
|
15
|
+
static examples = [
|
|
16
|
+
`${Transform.cmdTxt} ${format.flag('format', 'openapi3yaml')} ${format.flag('file', './specs/sample.json')} ${format.flag('destination', './')}`,
|
|
17
|
+
`${Transform.cmdTxt} ${format.flag('format', 'raml')} ${format.flag('url', '"https://petstore.swagger.io/v2/swagger.json"')} ${format.flag('destination', './')}`
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
format: Flags.string({
|
|
21
|
+
required: true,
|
|
22
|
+
description: 'Specification format to transform API specification into',
|
|
23
|
+
options: Object.keys(TransformationFormats)
|
|
24
|
+
}),
|
|
25
|
+
file: Flags.string({
|
|
26
|
+
description: 'Path to the API specification file to transform'
|
|
27
|
+
}),
|
|
28
|
+
url: Flags.string({
|
|
29
|
+
description: 'URL to the API specification file to transform (publicly accessible)'
|
|
30
|
+
}),
|
|
31
|
+
destination: Flags.string({
|
|
32
|
+
char: 'd',
|
|
33
|
+
description: 'Directory to save the transformed file to',
|
|
34
|
+
default: './'
|
|
35
|
+
}),
|
|
36
|
+
...FlagsProvider.force,
|
|
37
|
+
...FlagsProvider.authKey
|
|
38
|
+
};
|
|
16
39
|
async run() {
|
|
17
|
-
const { flags: { format, file, url, destination, force,
|
|
40
|
+
const { flags: { format, file, url, destination, force, 'auth-key': authKey } } = await this.parse(Transform);
|
|
18
41
|
const workingDirectory = DirectoryPath.createInput(destination);
|
|
19
|
-
const transformedApiDirectory = workingDirectory.join(
|
|
42
|
+
const transformedApiDirectory = workingDirectory.join(TRANSFORMATIONS_DIRECTORY_NAME);
|
|
20
43
|
const specFile = createResourceInput(file, url);
|
|
21
44
|
// Directly map the format flag to ExportFormats using TransformationFormats
|
|
22
45
|
const key = format;
|
|
@@ -26,32 +49,13 @@ class Transform extends Command {
|
|
|
26
49
|
commandName: Transform.id,
|
|
27
50
|
shell: this.config.shell
|
|
28
51
|
};
|
|
29
|
-
intro(
|
|
52
|
+
intro('Transform API');
|
|
30
53
|
const action = new TransformAction(this.getConfigDir(), commandMetadata, authKey);
|
|
31
54
|
const result = await action.execute(specFile, parsedFormat, transformedApiDirectory, force);
|
|
32
55
|
outro(result);
|
|
33
56
|
}
|
|
57
|
+
getConfigDir = () => {
|
|
58
|
+
return new DirectoryPath(this.config.configDir);
|
|
59
|
+
};
|
|
34
60
|
}
|
|
35
|
-
Transform.summary = "Transform API specifications between different formats";
|
|
36
|
-
Transform.description = `Transform API specifications from one format to another.
|
|
37
|
-
Supports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.`;
|
|
38
|
-
Transform.cmdTxt = format.cmd("apimatic", "api", "transform");
|
|
39
|
-
Transform.examples = [
|
|
40
|
-
`${Transform.cmdTxt} ${format.flag("format", "openapi3yaml")} ${format.flag("file", "./specs/sample.json")} ${format.flag("destination", "./")}`,
|
|
41
|
-
`${Transform.cmdTxt} ${format.flag("format", "raml")} ${format.flag("url", '"https://petstore.swagger.io/v2/swagger.json"')} ${format.flag("destination", "./")}`
|
|
42
|
-
];
|
|
43
|
-
Transform.flags = Object.assign(Object.assign({ format: Flags.string({
|
|
44
|
-
required: true,
|
|
45
|
-
description: "Specification format to transform API specification into",
|
|
46
|
-
options: Object.keys(TransformationFormats)
|
|
47
|
-
}), file: Flags.string({
|
|
48
|
-
description: "Path to the API specification file to transform"
|
|
49
|
-
}), url: Flags.string({
|
|
50
|
-
description: "URL to the API specification file to transform (publicly accessible)"
|
|
51
|
-
}), destination: Flags.string({
|
|
52
|
-
char: "d",
|
|
53
|
-
description: "Directory to save the transformed file to",
|
|
54
|
-
default: "./"
|
|
55
|
-
}) }, FlagsProvider.force), FlagsProvider.authKey);
|
|
56
|
-
export default Transform;
|
|
57
61
|
//# sourceMappingURL=transform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/commands/api/transform.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,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,O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G,aAAa,CAAC,oBAAoB,CAAC,CAAC;QAEzD,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,SAAS,CAAC,EAAE;YACzB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QAClF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC5F,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"}
|
|
@@ -4,13 +4,19 @@ import { FlagsProvider } from "../../types/flags-provider.js";
|
|
|
4
4
|
import { ValidateAction } from "../../actions/api/validate.js";
|
|
5
5
|
import { format, intro, outro } from "../../prompts/format.js";
|
|
6
6
|
import { createResourceInput } from "../../types/file/resource-input.js";
|
|
7
|
-
class Validate extends Command {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
7
|
+
export default class Validate extends Command {
|
|
8
|
+
static summary = "Validate API specification for syntactic and semantic correctness";
|
|
9
|
+
static description = `Validate your API specification to ensure it adheres to syntactic and semantic standards.`;
|
|
10
|
+
static cmdTxt = format.cmd("apimatic", "api", "validate");
|
|
11
|
+
static examples = [
|
|
12
|
+
`${Validate.cmdTxt} ${format.flag("file", "./specs/sample.json")}`,
|
|
13
|
+
`${Validate.cmdTxt} ${format.flag("url", '"https://petstore.swagger.io/v2/swagger.json"')}`
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
file: Flags.string({ description: "Path to the API specification file to validate" }),
|
|
17
|
+
url: Flags.string({ description: "URL to the API specification file to validate (publicly accessible)" }),
|
|
18
|
+
...FlagsProvider.authKey
|
|
19
|
+
};
|
|
14
20
|
async run() {
|
|
15
21
|
const { flags: { file, url, "auth-key": authKey } } = await this.parse(Validate);
|
|
16
22
|
const commandMetadata = {
|
|
@@ -23,14 +29,8 @@ class Validate extends Command {
|
|
|
23
29
|
const result = await action.execute(resourceInput);
|
|
24
30
|
outro(result);
|
|
25
31
|
}
|
|
32
|
+
getConfigDir = () => {
|
|
33
|
+
return new DirectoryPath(this.config.configDir);
|
|
34
|
+
};
|
|
26
35
|
}
|
|
27
|
-
Validate.summary = "Validate API specification for syntactic and semantic correctness";
|
|
28
|
-
Validate.description = `Validate your API specification to ensure it adheres to syntactic and semantic standards.`;
|
|
29
|
-
Validate.cmdTxt = format.cmd("apimatic", "api", "validate");
|
|
30
|
-
Validate.examples = [
|
|
31
|
-
`${Validate.cmdTxt} ${format.flag("file", "./specs/sample.json")}`,
|
|
32
|
-
`${Validate.cmdTxt} ${format.flag("url", '"https://petstore.swagger.io/v2/swagger.json"')}`
|
|
33
|
-
];
|
|
34
|
-
Validate.flags = Object.assign({ file: Flags.string({ description: "Path to the API specification file to validate" }), url: Flags.string({ description: "URL to the API specification file to validate (publicly accessible)" }) }, FlagsProvider.authKey);
|
|
35
|
-
export default Validate;
|
|
36
36
|
//# sourceMappingURL=validate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/commands/api/validate.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,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,MAAM,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zB,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,EAC1C,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/B,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,QAAQ,CAAC,EAAE;YACxB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QACjF,MAAM,aAAa,GAAG,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAErD,KAAK,CAAC,cAAc,CAAC,CAAC;QACtB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACnD,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"}
|
|
@@ -2,7 +2,20 @@ import { Command, Flags } from "@oclif/core";
|
|
|
2
2
|
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
3
3
|
import { LoginAction } from "../../actions/auth/login.js";
|
|
4
4
|
import { format, intro, outro } from "../../prompts/format.js";
|
|
5
|
-
class Login extends Command {
|
|
5
|
+
export default class Login extends Command {
|
|
6
|
+
static summary = "Login to your APIMatic account";
|
|
7
|
+
static description = "Login using your APIMatic credentials or an API Key";
|
|
8
|
+
static cmdTxt = format.cmd('apimatic', 'auth', 'login');
|
|
9
|
+
static examples = [
|
|
10
|
+
Login.cmdTxt,
|
|
11
|
+
`${Login.cmdTxt} ${format.flag('auth-key', '{api-key}')}`
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
"auth-key": Flags.string({
|
|
15
|
+
char: "k",
|
|
16
|
+
description: "Sets authentication key for all commands."
|
|
17
|
+
})
|
|
18
|
+
};
|
|
6
19
|
async run() {
|
|
7
20
|
const { flags: { "auth-key": authKey } } = await this.parse(Login);
|
|
8
21
|
if (authKey === "") {
|
|
@@ -18,18 +31,4 @@ class Login extends Command {
|
|
|
18
31
|
outro(result);
|
|
19
32
|
}
|
|
20
33
|
}
|
|
21
|
-
Login.summary = "Login to your APIMatic account";
|
|
22
|
-
Login.description = "Login using your APIMatic credentials or an API Key";
|
|
23
|
-
Login.cmdTxt = format.cmd('apimatic', 'auth', 'login');
|
|
24
|
-
Login.examples = [
|
|
25
|
-
Login.cmdTxt,
|
|
26
|
-
`${Login.cmdTxt} ${format.flag('auth-key', '{api-key}')}`
|
|
27
|
-
];
|
|
28
|
-
Login.flags = {
|
|
29
|
-
"auth-key": Flags.string({
|
|
30
|
-
char: "k",
|
|
31
|
-
description: "Sets authentication key for all commands."
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
export default Login;
|
|
35
34
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,C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,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -2,16 +2,15 @@ import { Command } from "@oclif/core";
|
|
|
2
2
|
import { format, intro, outro } from "../../prompts/format.js";
|
|
3
3
|
import { LogoutAction } from "../../actions/auth/logout.js";
|
|
4
4
|
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
5
|
-
class Logout extends Command {
|
|
5
|
+
export default class Logout extends Command {
|
|
6
|
+
static summary = "Clears the local login credentials.";
|
|
7
|
+
static description = "Clears the local login credentials. This will also clear any cached credentials from the CLI.";
|
|
8
|
+
static cmdTxt = format.cmd('apimatic', 'auth', 'logout');
|
|
9
|
+
static examples = [Logout.cmdTxt];
|
|
6
10
|
async run() {
|
|
7
11
|
intro("Logout");
|
|
8
12
|
const actionResult = await new LogoutAction(new DirectoryPath(this.config.configDir)).execute();
|
|
9
13
|
outro(actionResult);
|
|
10
14
|
}
|
|
11
15
|
}
|
|
12
|
-
Logout.summary = "Clears the local login credentials.";
|
|
13
|
-
Logout.description = "Clears the local login credentials. This will also clear any cached credentials from the CLI.";
|
|
14
|
-
Logout.cmdTxt = format.cmd('apimatic', 'auth', 'logout');
|
|
15
|
-
Logout.examples = [Logout.cmdTxt];
|
|
16
|
-
export default Logout;
|
|
17
16
|
//# sourceMappingURL=logout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IACzC,MAAM,CAAC,OAAO,GAAG,qCAAqC,CAAC;IAEvD,MAAM,CAAC,WAAW,GAAG,+FAA+F,CAAC;IAE7G,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClE,MAAM,CAAC,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG;QAEP,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,MAAM,YAAY,GAAG,MAAM,IAAI,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAChG,KAAK,CAAC,YAAY,CAAC,CAAA;IACrB,CAAC;CACF"}
|
|
@@ -2,7 +2,10 @@ import { Command } from "@oclif/core";
|
|
|
2
2
|
import { format, intro, outro } from "../../prompts/format.js";
|
|
3
3
|
import { StatusAction } from "../../actions/auth/status.js";
|
|
4
4
|
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
5
|
-
class Status extends Command {
|
|
5
|
+
export default class Status extends Command {
|
|
6
|
+
static description = "View the currently logged in user.";
|
|
7
|
+
static cmdTxt = format.cmd('apimatic', 'auth', 'status');
|
|
8
|
+
static examples = [Status.cmdTxt];
|
|
6
9
|
async run() {
|
|
7
10
|
const commandMetadata = {
|
|
8
11
|
commandName: Status.id,
|
|
@@ -14,8 +17,4 @@ class Status extends Command {
|
|
|
14
17
|
outro(actionResult);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
|
-
Status.description = "View the currently logged in user.";
|
|
18
|
-
Status.cmdTxt = format.cmd('apimatic', 'auth', 'status');
|
|
19
|
-
Status.examples = [Status.cmdTxt];
|
|
20
|
-
export default Status;
|
|
21
20
|
//# sourceMappingURL=status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE,
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IACzC,MAAM,CAAC,WAAW,GAAG,oCAAoC,CAAC;IAElD,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClE,MAAM,CAAC,QAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAElC,KAAK,CAAC,GAAG;QAEP,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,MAAM,CAAC,EAAE;YACtB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,QAAQ,CAAC,CAAA;QACf,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;QACjG,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,KAAK,CAAC,YAAY,CAAC,CAAA;IACrB,CAAC;CACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
export default class PluginGenerate extends Command {
|
|
3
|
-
static readonly summary = "Generate a context plugin for your
|
|
4
|
-
static readonly description = "Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with
|
|
3
|
+
static readonly summary = "Generate a context plugin for your SDKs.";
|
|
4
|
+
static readonly description = "Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with your API specification \u2014 `apimatic.json` is created if it is not there. It asks for the plugin's name on the first run, and for its languages only when `apimatic.json` records none (`sdk publish` records them). Later runs read both from `apimatic.json` without asking.";
|
|
5
5
|
static readonly cmdTxt: string;
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly flags: {
|
|
8
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
9
|
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
private readonly getConfigDir;
|
|
@@ -2,36 +2,36 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
import { PluginGenerateAction } from '../../actions/plugin/generate.js';
|
|
3
3
|
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
4
4
|
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
5
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
5
6
|
import { format, intro, outro } from '../../prompts/format.js';
|
|
6
|
-
class PluginGenerate extends Command {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export default class PluginGenerate extends Command {
|
|
8
|
+
static summary = 'Generate a context plugin for your SDKs.';
|
|
9
|
+
static description = "Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with your API specification — `apimatic.json` is created if it is not there. It asks for the plugin's name on the first run, and for its languages only when `apimatic.json` records none (`sdk publish` records them). Later runs read both from `apimatic.json` without asking.";
|
|
10
|
+
static cmdTxt = format.cmd('apimatic', 'plugin', 'generate');
|
|
11
|
+
static examples = [
|
|
12
|
+
PluginGenerate.cmdTxt,
|
|
13
|
+
`${PluginGenerate.cmdTxt} ${format.flag('input', '"./"')} ${format.flag('destination', '"./plugin"')}`
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
...FlagsProvider.input,
|
|
17
|
+
...FlagsProvider.destination('plugin', 'plugin'),
|
|
18
|
+
...FlagsProvider.force,
|
|
19
|
+
...FlagsProvider.authKey
|
|
20
|
+
};
|
|
13
21
|
async run() {
|
|
14
22
|
const { flags: { input, destination, force, 'auth-key': authKey } } = await this.parse(PluginGenerate);
|
|
15
|
-
const
|
|
16
|
-
const buildDirectory = workingDirectory.join('src');
|
|
17
|
-
const pluginDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join('plugin');
|
|
23
|
+
const project = ProjectContext.at(input);
|
|
18
24
|
const commandMetadata = {
|
|
19
25
|
commandName: PluginGenerate.id,
|
|
20
26
|
shell: this.config.shell
|
|
21
27
|
};
|
|
22
28
|
intro('Generate Context Plugin');
|
|
23
29
|
const action = new PluginGenerateAction(this.getConfigDir(), commandMetadata, authKey);
|
|
24
|
-
const result = await action.execute(
|
|
30
|
+
const result = await action.execute(project, project.pluginDirectory(destination), force);
|
|
25
31
|
outro(result);
|
|
26
32
|
}
|
|
33
|
+
getConfigDir = () => {
|
|
34
|
+
return new DirectoryPath(this.config.configDir);
|
|
35
|
+
};
|
|
27
36
|
}
|
|
28
|
-
PluginGenerate.summary = 'Generate a context plugin for your published SDKs.';
|
|
29
|
-
PluginGenerate.description = 'Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with a `plugin-config.json`.';
|
|
30
|
-
PluginGenerate.cmdTxt = format.cmd('apimatic', 'plugin', 'generate');
|
|
31
|
-
PluginGenerate.examples = [
|
|
32
|
-
PluginGenerate.cmdTxt,
|
|
33
|
-
`${PluginGenerate.cmdTxt} ${format.flag('input', '"./"')} ${format.flag('destination', '"./plugin"')}`
|
|
34
|
-
];
|
|
35
|
-
PluginGenerate.flags = Object.assign(Object.assign(Object.assign(Object.assign({}, FlagsProvider.input), FlagsProvider.destination('plugin', 'plugin')), FlagsProvider.force), FlagsProvider.authKey);
|
|
36
|
-
export default PluginGenerate;
|
|
37
37
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/plugin/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/comm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AK,CAAC,CAAC;QACzC,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,cAAc,CAAC,EAAE;YAC9B,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC;QAC1F,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"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import { PluginPublishAction } from '../../actions/plugin/publish.js';
|
|
3
|
-
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
4
3
|
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
4
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
5
5
|
import { format, intro, outro } from '../../prompts/format.js';
|
|
6
|
-
class PluginPublish extends Command {
|
|
6
|
+
export default class PluginPublish extends Command {
|
|
7
|
+
static summary = 'Print the git commands for publishing your context plugin to GitHub.';
|
|
8
|
+
static description = 'Print the commands that publish a generated context plugin to a GitHub repository. The commands are printed for you to run — this command never touches your repository.';
|
|
9
|
+
static cmdTxt = format.cmd('apimatic', 'plugin', 'publish');
|
|
10
|
+
static examples = [
|
|
11
|
+
PluginPublish.cmdTxt,
|
|
12
|
+
`${PluginPublish.cmdTxt} ${format.flag('input', '"./"')} ${format.flag('destination', '"./plugin"')}`
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
...FlagsProvider.input,
|
|
16
|
+
destination: Flags.string({
|
|
17
|
+
char: 'd',
|
|
18
|
+
description: '[default: <input>/plugin] path where the plugin was generated.'
|
|
19
|
+
})
|
|
20
|
+
};
|
|
7
21
|
async run() {
|
|
8
22
|
const { flags: { input, destination } } = await this.parse(PluginPublish);
|
|
9
|
-
const
|
|
10
|
-
const buildDirectory = workingDirectory.join('src');
|
|
11
|
-
const pluginDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join('plugin');
|
|
23
|
+
const project = ProjectContext.at(input);
|
|
12
24
|
intro('Publish Context Plugin');
|
|
13
|
-
const result = await new PluginPublishAction().execute(
|
|
25
|
+
const result = await new PluginPublishAction().execute(project, project.pluginDirectory(destination));
|
|
14
26
|
outro(result);
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
|
-
PluginPublish.summary = 'Print the git commands for publishing your context plugin to GitHub.';
|
|
18
|
-
PluginPublish.description = 'Print the commands that publish a generated context plugin to a GitHub repository. The commands are printed for you to run — this command never touches your repository.';
|
|
19
|
-
PluginPublish.cmdTxt = format.cmd('apimatic', 'plugin', 'publish');
|
|
20
|
-
PluginPublish.examples = [
|
|
21
|
-
PluginPublish.cmdTxt,
|
|
22
|
-
`${PluginPublish.cmdTxt} ${format.flag('input', '"./"')} ${format.flag('destination', '"./plugin"')}`
|
|
23
|
-
];
|
|
24
|
-
PluginPublish.flags = Object.assign(Object.assign({}, FlagsProvider.input), { destination: Flags.string({
|
|
25
|
-
char: 'd',
|
|
26
|
-
description: '[default: <input>/plugin] path where the plugin was generated.'
|
|
27
|
-
}) });
|
|
28
|
-
export default PluginPublish;
|
|
29
29
|
//# sourceMappingURL=publish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/commands/plugin/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,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pC,MAAM,OAAO,GAAG,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAEzC,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,MAAM,IAAI,mBAAmB,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC;QACtG,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { Command } from
|
|
2
|
-
export
|
|
3
|
-
static summary
|
|
4
|
-
static description
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class PortalGenerate extends Command {
|
|
3
|
+
static readonly summary = "Generate a static API Documentation Portal.";
|
|
4
|
+
static readonly description = "Builds a documentation portal from the OpenAPI documents and Markdown pages in your 'src' directory.\n\nThe portal is built on your machine and written as static files you can host anywhere. Configure it with 'src/apimatic.json', whose 'languages' block gives the portal a page for each SDK language, and whose 'plugin' block, or a 'pluginUrl' in its 'portal' block for a plugin hosted elsewhere, a page for the context plugin.";
|
|
5
|
+
static readonly cmdTxt: string;
|
|
6
|
+
static readonly examples: string[];
|
|
5
7
|
static flags: {
|
|
8
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
9
|
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
zip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
|
|
11
|
+
zip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
12
|
};
|
|
11
|
-
static cmdTxt: string;
|
|
12
|
-
static examples: string[];
|
|
13
13
|
run(): Promise<void>;
|
|
14
|
+
private readonly getConfigDir;
|
|
14
15
|
}
|