@apimatic/cli 1.4.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -212
- package/apimatic.schema.json +550 -0
- package/lib/actions/action-result.js +3 -0
- package/lib/actions/action-result.js.map +1 -1
- package/lib/actions/api/transform.js +36 -33
- package/lib/actions/api/transform.js.map +1 -1
- package/lib/actions/api/validate.d.ts +9 -6
- package/lib/actions/api/validate.js +44 -38
- package/lib/actions/api/validate.js.map +1 -1
- package/lib/actions/auth/login.js +7 -4
- package/lib/actions/auth/login.js.map +1 -1
- package/lib/actions/auth/logout.js +2 -1
- package/lib/actions/auth/logout.js.map +1 -1
- package/lib/actions/auth/status.js +5 -3
- package/lib/actions/auth/status.js.map +1 -1
- package/lib/actions/plugin/generate.d.ts +5 -1
- package/lib/actions/plugin/generate.js +83 -56
- package/lib/actions/plugin/generate.js.map +1 -1
- package/lib/actions/plugin/publish.d.ts +2 -1
- package/lib/actions/plugin/publish.js +34 -37
- package/lib/actions/plugin/publish.js.map +1 -1
- package/lib/actions/plugin/record-metadata.d.ts +3 -2
- package/lib/actions/plugin/record-metadata.js +33 -30
- package/lib/actions/plugin/record-metadata.js.map +1 -1
- package/lib/actions/portal/generate.d.ts +8 -6
- package/lib/actions/portal/generate.js +50 -61
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/prepare-project.d.ts +25 -0
- package/lib/actions/portal/prepare-project.js +68 -0
- package/lib/actions/portal/prepare-project.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +21 -6
- package/lib/actions/portal/serve.js +170 -153
- package/lib/actions/portal/serve.js.map +1 -1
- package/lib/actions/publishing/profile/list.js +4 -2
- package/lib/actions/publishing/profile/list.js.map +1 -1
- package/lib/actions/quickstart.d.ts +23 -5
- package/lib/actions/quickstart.js +222 -21
- package/lib/actions/quickstart.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +4 -7
- package/lib/actions/sdk/generate.js +53 -93
- package/lib/actions/sdk/generate.js.map +1 -1
- package/lib/actions/sdk/publish/interactive.d.ts +4 -3
- package/lib/actions/sdk/publish/interactive.js +96 -97
- package/lib/actions/sdk/publish/interactive.js.map +1 -1
- package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
- package/lib/actions/sdk/publish/non-interactive.js +91 -90
- package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
- package/lib/actions/sdk/publish.d.ts +3 -2
- package/lib/actions/sdk/publish.js +55 -53
- package/lib/actions/sdk/publish.js.map +1 -1
- package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
- package/lib/actions/sdk/record-published-sdk.js +57 -0
- package/lib/actions/sdk/record-published-sdk.js.map +1 -0
- package/lib/client-utils/auth-manager.js +1 -1
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/commands/api/transform.d.ts +1 -1
- package/lib/commands/api/transform.js +44 -40
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.js +16 -16
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.js +14 -15
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.js +5 -6
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.js +4 -5
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/plugin/generate.d.ts +3 -3
- package/lib/commands/plugin/generate.js +20 -20
- package/lib/commands/plugin/generate.js.map +1 -1
- package/lib/commands/plugin/publish.js +18 -18
- package/lib/commands/plugin/publish.js.map +1 -1
- package/lib/commands/portal/generate.d.ts +9 -8
- package/lib/commands/portal/generate.js +36 -27
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +7 -9
- package/lib/commands/portal/serve.js +41 -44
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/publishing/profile/list.js +8 -12
- package/lib/commands/publishing/profile/list.js.map +1 -1
- package/lib/commands/quickstart.d.ts +5 -5
- package/lib/commands/quickstart.js +18 -24
- package/lib/commands/quickstart.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +5 -7
- package/lib/commands/sdk/generate.js +58 -70
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/commands/sdk/publish.d.ts +6 -7
- package/lib/commands/sdk/publish.js +66 -60
- package/lib/commands/sdk/publish.js.map +1 -1
- package/lib/hooks/node-version.d.ts +3 -0
- package/lib/hooks/node-version.js +12 -0
- package/lib/hooks/node-version.js.map +1 -0
- package/lib/hooks/not-found.js +2 -3
- package/lib/hooks/not-found.js.map +1 -1
- package/lib/hooks/utils.d.ts +4 -2
- package/lib/hooks/utils.js +2 -2
- package/lib/hooks/utils.js.map +1 -1
- package/lib/infrastructure/env-info.d.ts +3 -0
- package/lib/infrastructure/env-info.js +13 -6
- package/lib/infrastructure/env-info.js.map +1 -1
- package/lib/infrastructure/file-service.d.ts +35 -8
- package/lib/infrastructure/file-service.js +149 -53
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/file-watch-service.d.ts +40 -0
- package/lib/infrastructure/file-watch-service.js +167 -0
- package/lib/infrastructure/file-watch-service.js.map +1 -0
- package/lib/infrastructure/generation-status-poller.d.ts +8 -7
- package/lib/infrastructure/generation-status-poller.js +20 -12
- package/lib/infrastructure/generation-status-poller.js.map +1 -1
- package/lib/infrastructure/launcher-service.js +6 -6
- package/lib/infrastructure/launcher-service.js.map +1 -1
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +15 -1
- package/lib/infrastructure/network-service.js.map +1 -1
- package/lib/infrastructure/portal-build-service.d.ts +19 -0
- package/lib/infrastructure/portal-build-service.js +58 -0
- package/lib/infrastructure/portal-build-service.js.map +1 -0
- package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
- package/lib/infrastructure/portal-dev-server-service.js +135 -0
- package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
- package/lib/infrastructure/portal-pages-service.d.ts +17 -0
- package/lib/infrastructure/portal-pages-service.js +103 -0
- package/lib/infrastructure/portal-pages-service.js.map +1 -0
- package/lib/infrastructure/portal-project-service.d.ts +77 -0
- package/lib/infrastructure/portal-project-service.js +309 -0
- package/lib/infrastructure/portal-project-service.js.map +1 -0
- package/lib/infrastructure/service-error.d.ts +1 -0
- package/lib/infrastructure/service-error.js +39 -41
- package/lib/infrastructure/service-error.js.map +1 -1
- package/lib/infrastructure/services/api-client-factory.js +15 -13
- package/lib/infrastructure/services/api-client-factory.js.map +1 -1
- package/lib/infrastructure/services/api-service.d.ts +7 -5
- package/lib/infrastructure/services/api-service.js +28 -20
- package/lib/infrastructure/services/api-service.js.map +1 -1
- package/lib/infrastructure/services/auth-service.js +4 -9
- package/lib/infrastructure/services/auth-service.js.map +1 -1
- package/lib/infrastructure/services/file-download-service.js +3 -3
- package/lib/infrastructure/services/file-download-service.js.map +1 -1
- package/lib/infrastructure/services/plugin-service.d.ts +1 -8
- package/lib/infrastructure/services/plugin-service.js +11 -22
- package/lib/infrastructure/services/plugin-service.js.map +1 -1
- package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
- package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
- package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
- package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
- package/lib/infrastructure/services/portal-authorization-service.js +23 -0
- package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
- package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
- package/lib/infrastructure/services/publishing-api-service.js +11 -15
- package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
- package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
- package/lib/infrastructure/services/sdk-generation-service.js +118 -0
- package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.js +5 -4
- package/lib/infrastructure/services/telemetry-service.js.map +1 -1
- package/lib/infrastructure/services/transformation-service.js +29 -32
- package/lib/infrastructure/services/transformation-service.js.map +1 -1
- package/lib/infrastructure/services/validation-service.d.ts +12 -53
- package/lib/infrastructure/services/validation-service.js +24 -199
- package/lib/infrastructure/services/validation-service.js.map +1 -1
- package/lib/infrastructure/timer-extensions.d.ts +2 -0
- package/lib/infrastructure/timer-extensions.js +10 -0
- package/lib/infrastructure/timer-extensions.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +31 -1
- package/lib/infrastructure/tmp-extensions.js +86 -3
- package/lib/infrastructure/tmp-extensions.js.map +1 -1
- package/lib/infrastructure/zip-service.js +2 -2
- package/lib/infrastructure/zip-service.js.map +1 -1
- package/lib/prompts/api/validate.d.ts +6 -7
- package/lib/prompts/api/validate.js +12 -12
- package/lib/prompts/api/validate.js.map +1 -1
- package/lib/prompts/format.d.ts +4 -0
- package/lib/prompts/format.js +5 -0
- package/lib/prompts/format.js.map +1 -1
- package/lib/prompts/plugin/generate.d.ts +17 -12
- package/lib/prompts/plugin/generate.js +94 -44
- package/lib/prompts/plugin/generate.js.map +1 -1
- package/lib/prompts/plugin/publish.d.ts +2 -1
- package/lib/prompts/plugin/publish.js +8 -7
- package/lib/prompts/plugin/publish.js.map +1 -1
- package/lib/prompts/plugin/record-metadata.d.ts +1 -0
- package/lib/prompts/plugin/record-metadata.js +10 -7
- package/lib/prompts/plugin/record-metadata.js.map +1 -1
- package/lib/prompts/portal/artifacts.d.ts +8 -0
- package/lib/prompts/portal/artifacts.js +26 -0
- package/lib/prompts/portal/artifacts.js.map +1 -0
- package/lib/prompts/portal/authorization.d.ts +6 -0
- package/lib/prompts/portal/authorization.js +29 -0
- package/lib/prompts/portal/authorization.js.map +1 -0
- package/lib/prompts/portal/code-samples.d.ts +1 -0
- package/lib/prompts/portal/code-samples.js +9 -0
- package/lib/prompts/portal/code-samples.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +14 -9
- package/lib/prompts/portal/generate.js +48 -26
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/prepare-project.d.ts +20 -0
- package/lib/prompts/portal/prepare-project.js +36 -0
- package/lib/prompts/portal/prepare-project.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +32 -12
- package/lib/prompts/portal/serve.js +102 -39
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/source.d.ts +26 -0
- package/lib/prompts/portal/source.js +253 -0
- package/lib/prompts/portal/source.js.map +1 -0
- package/lib/prompts/prompt.d.ts +11 -3
- package/lib/prompts/prompt.js +39 -15
- package/lib/prompts/prompt.js.map +1 -1
- package/lib/prompts/quickstart.d.ts +46 -3
- package/lib/prompts/quickstart.js +199 -12
- package/lib/prompts/quickstart.js.map +1 -1
- package/lib/prompts/sdk/generate.d.ts +15 -13
- package/lib/prompts/sdk/generate.js +29 -32
- package/lib/prompts/sdk/generate.js.map +1 -1
- package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
- package/lib/prompts/sdk/publish/interactive.js +26 -24
- package/lib/prompts/sdk/publish/interactive.js.map +1 -1
- package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
- package/lib/prompts/sdk/publish/non-interactive.js +5 -4
- package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
- package/lib/prompts/sdk/publish.d.ts +3 -3
- package/lib/prompts/sdk/publish.js +13 -17
- package/lib/prompts/sdk/publish.js.map +1 -1
- package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
- package/lib/prompts/sdk/record-published-sdk.js +26 -0
- package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
- package/lib/types/apimatic-config/document.d.ts +70 -0
- package/lib/types/apimatic-config/document.js +167 -0
- package/lib/types/apimatic-config/document.js.map +1 -0
- package/lib/types/apimatic-config/languages-block.d.ts +39 -0
- package/lib/types/apimatic-config/languages-block.js +58 -0
- package/lib/types/apimatic-config/languages-block.js.map +1 -0
- package/lib/types/apimatic-config-context.d.ts +48 -0
- package/lib/types/apimatic-config-context.js +121 -0
- package/lib/types/apimatic-config-context.js.map +1 -0
- package/lib/types/build/build.d.ts +1 -89
- package/lib/types/build/build.js +6 -161
- package/lib/types/build/build.js.map +1 -1
- package/lib/types/events/domain-event.js +3 -0
- package/lib/types/events/domain-event.js.map +1 -1
- package/lib/types/events/quickstart-completed.js +3 -3
- package/lib/types/events/quickstart-completed.js.map +1 -1
- package/lib/types/events/quickstart-initiated.js +3 -3
- package/lib/types/events/quickstart-initiated.js.map +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
- package/lib/types/file/directory.d.ts +4 -9
- package/lib/types/file/directory.js +17 -65
- package/lib/types/file/directory.js.map +1 -1
- package/lib/types/file/directoryPath.d.ts +17 -0
- package/lib/types/file/directoryPath.js +47 -2
- package/lib/types/file/directoryPath.js.map +1 -1
- package/lib/types/file/fileName.d.ts +8 -0
- package/lib/types/file/fileName.js +28 -6
- package/lib/types/file/fileName.js.map +1 -1
- package/lib/types/file/filePath.d.ts +18 -2
- package/lib/types/file/filePath.js +39 -4
- package/lib/types/file/filePath.js.map +1 -1
- package/lib/types/file/resource-input.js +1 -2
- package/lib/types/file/resource-input.js.map +1 -1
- package/lib/types/file/urlPath.js +2 -1
- package/lib/types/file/urlPath.js.map +1 -1
- package/lib/types/flags-provider.js +22 -22
- package/lib/types/flags-provider.js.map +1 -1
- package/lib/types/package-settings-context.js +2 -1
- package/lib/types/package-settings-context.js.map +1 -1
- package/lib/types/plugin/plugin-config.d.ts +10 -50
- package/lib/types/plugin/plugin-config.js +7 -1
- package/lib/types/plugin/plugin-config.js.map +1 -1
- package/lib/types/plugin-config-context.d.ts +30 -37
- package/lib/types/plugin-config-context.js +108 -139
- package/lib/types/plugin-config-context.js.map +1 -1
- package/lib/types/plugin-context.js +3 -2
- package/lib/types/plugin-context.js.map +1 -1
- package/lib/types/portal/code-samples.d.ts +27 -0
- package/lib/types/portal/code-samples.js +67 -0
- package/lib/types/portal/code-samples.js.map +1 -0
- package/lib/types/portal/config/ai-config.d.ts +15 -0
- package/lib/types/portal/config/ai-config.js +26 -0
- package/lib/types/portal/config/ai-config.js.map +1 -0
- package/lib/types/portal/config/brand-config.d.ts +55 -0
- package/lib/types/portal/config/brand-config.js +105 -0
- package/lib/types/portal/config/brand-config.js.map +1 -0
- package/lib/types/portal/config/color.d.ts +19 -0
- package/lib/types/portal/config/color.js +43 -0
- package/lib/types/portal/config/color.js.map +1 -0
- package/lib/types/portal/config/fields.d.ts +23 -0
- package/lib/types/portal/config/fields.js +67 -0
- package/lib/types/portal/config/fields.js.map +1 -0
- package/lib/types/portal/config/link.d.ts +18 -0
- package/lib/types/portal/config/link.js +72 -0
- package/lib/types/portal/config/link.js.map +1 -0
- package/lib/types/portal/config/navigation-config.d.ts +13 -0
- package/lib/types/portal/config/navigation-config.js +30 -0
- package/lib/types/portal/config/navigation-config.js.map +1 -0
- package/lib/types/portal/config/site-config.d.ts +32 -0
- package/lib/types/portal/config/site-config.js +88 -0
- package/lib/types/portal/config/site-config.js.map +1 -0
- package/lib/types/portal/config/static-asset.d.ts +25 -0
- package/lib/types/portal/config/static-asset.js +77 -0
- package/lib/types/portal/config/static-asset.js.map +1 -0
- package/lib/types/portal/content-notices.d.ts +20 -0
- package/lib/types/portal/content-notices.js +2 -0
- package/lib/types/portal/content-notices.js.map +1 -0
- package/lib/types/portal/content-tree.d.ts +103 -0
- package/lib/types/portal/content-tree.js +344 -0
- package/lib/types/portal/content-tree.js.map +1 -0
- package/lib/types/portal/endpoint.d.ts +6 -0
- package/lib/types/portal/endpoint.js +12 -0
- package/lib/types/portal/endpoint.js.map +1 -0
- package/lib/types/portal/generated-pages.d.ts +68 -0
- package/lib/types/portal/generated-pages.js +111 -0
- package/lib/types/portal/generated-pages.js.map +1 -0
- package/lib/types/portal/generation-status.d.ts +31 -0
- package/lib/types/portal/generation-status.js +26 -0
- package/lib/types/portal/generation-status.js.map +1 -0
- package/lib/types/portal/openapi-document.d.ts +48 -0
- package/lib/types/portal/openapi-document.js +138 -0
- package/lib/types/portal/openapi-document.js.map +1 -0
- package/lib/types/portal/page-fragments.d.ts +13 -0
- package/lib/types/portal/page-fragments.js +24 -0
- package/lib/types/portal/page-fragments.js.map +1 -0
- package/lib/types/portal/page-template.d.ts +15 -0
- package/lib/types/portal/page-template.js +64 -0
- package/lib/types/portal/page-template.js.map +1 -0
- package/lib/types/portal/page.d.ts +24 -0
- package/lib/types/portal/page.js +100 -0
- package/lib/types/portal/page.js.map +1 -0
- package/lib/types/portal/portal-artifacts.d.ts +25 -0
- package/lib/types/portal/portal-artifacts.js +30 -0
- package/lib/types/portal/portal-artifacts.js.map +1 -0
- package/lib/types/portal/portal-config.d.ts +69 -0
- package/lib/types/portal/portal-config.js +105 -0
- package/lib/types/portal/portal-config.js.map +1 -0
- package/lib/types/portal/portal-downloads.d.ts +8 -0
- package/lib/types/portal/portal-downloads.js +14 -0
- package/lib/types/portal/portal-downloads.js.map +1 -0
- package/lib/types/portal/portal-languages.d.ts +15 -0
- package/lib/types/portal/portal-languages.js +45 -0
- package/lib/types/portal/portal-languages.js.map +1 -0
- package/lib/types/portal/portal-navigation.d.ts +65 -0
- package/lib/types/portal/portal-navigation.js +217 -0
- package/lib/types/portal/portal-navigation.js.map +1 -0
- package/lib/types/portal/portal-sdk.d.ts +15 -0
- package/lib/types/portal/portal-sdk.js +28 -0
- package/lib/types/portal/portal-sdk.js.map +1 -0
- package/lib/types/portal/portal-source.d.ts +129 -0
- package/lib/types/portal/portal-source.js +2 -0
- package/lib/types/portal/portal-source.js.map +1 -0
- package/lib/types/portal/portal-stylesheet.d.ts +19 -0
- package/lib/types/portal/portal-stylesheet.js +40 -0
- package/lib/types/portal/portal-stylesheet.js.map +1 -0
- package/lib/types/portal/portal-tabs.d.ts +33 -0
- package/lib/types/portal/portal-tabs.js +38 -0
- package/lib/types/portal/portal-tabs.js.map +1 -0
- package/lib/types/portal/preview-config.d.ts +20 -0
- package/lib/types/portal/preview-config.js +32 -0
- package/lib/types/portal/preview-config.js.map +1 -0
- package/lib/types/portal/preview-content.d.ts +18 -0
- package/lib/types/portal/preview-content.js +50 -0
- package/lib/types/portal/preview-content.js.map +1 -0
- package/lib/types/portal/published-package.d.ts +12 -0
- package/lib/types/portal/published-package.js +35 -0
- package/lib/types/portal/published-package.js.map +1 -0
- package/lib/types/portal/unknown-fields.d.ts +5 -0
- package/lib/types/portal/unknown-fields.js +10 -0
- package/lib/types/portal/unknown-fields.js.map +1 -0
- package/lib/types/portal-context.d.ts +38 -6
- package/lib/types/portal-context.js +71 -24
- package/lib/types/portal-context.js.map +1 -1
- package/lib/types/portal-source-context.d.ts +77 -0
- package/lib/types/portal-source-context.js +408 -0
- package/lib/types/portal-source-context.js.map +1 -0
- package/lib/types/project-context.d.ts +49 -0
- package/lib/types/project-context.js +151 -0
- package/lib/types/project-context.js.map +1 -0
- package/lib/types/project-layout.d.ts +9 -0
- package/lib/types/project-layout.js +10 -0
- package/lib/types/project-layout.js.map +1 -0
- package/lib/types/publish/package-settings-configuration.d.ts +2 -0
- package/lib/types/publish/profile-id.js +1 -0
- package/lib/types/publish/profile-id.js.map +1 -1
- package/lib/types/publish/publishing-profile.d.ts +3 -1
- package/lib/types/publish/publishing-profile.js +33 -15
- package/lib/types/publish/publishing-profile.js.map +1 -1
- package/lib/types/publish/publishing-profiles.js +2 -1
- package/lib/types/publish/publishing-profiles.js.map +1 -1
- package/lib/types/publish/version.js +1 -0
- package/lib/types/publish/version.js.map +1 -1
- package/lib/types/resource-context.js +3 -2
- package/lib/types/resource-context.js.map +1 -1
- package/lib/types/sdk/generate.d.ts +22 -16
- package/lib/types/sdk/generate.js +64 -41
- package/lib/types/sdk/generate.js.map +1 -1
- package/lib/types/sdk/stability-choice.d.ts +12 -0
- package/lib/types/sdk/stability-choice.js +24 -0
- package/lib/types/sdk/stability-choice.js.map +1 -0
- package/lib/types/sdk-context.d.ts +4 -5
- package/lib/types/sdk-context.js +10 -18
- package/lib/types/sdk-context.js.map +1 -1
- package/lib/types/spec-context.d.ts +5 -4
- package/lib/types/spec-context.js +9 -8
- package/lib/types/spec-context.js.map +1 -1
- package/lib/types/temp-context.d.ts +1 -1
- package/lib/types/temp-context.js +5 -4
- package/lib/types/temp-context.js.map +1 -1
- package/lib/types/transform-context.d.ts +9 -5
- package/lib/types/transform-context.js +21 -18
- package/lib/types/transform-context.js.map +1 -1
- package/lib/utils/error-utils.d.ts +2 -0
- package/lib/utils/error-utils.js +5 -0
- package/lib/utils/error-utils.js.map +1 -0
- package/lib/utils/json-utils.d.ts +2 -0
- package/lib/utils/json-utils.js +4 -0
- package/lib/utils/json-utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +8 -1
- package/lib/utils/string-utils.js +13 -26
- package/lib/utils/string-utils.js.map +1 -1
- package/lib/utils/utils.d.ts +1 -3
- package/lib/utils/utils.js +12 -40
- package/lib/utils/utils.js.map +1 -1
- package/oclif.manifest.json +69 -357
- package/package.json +47 -25
- package/portal-pages/context-plugin.mdx +26 -0
- package/portal-pages/sdk.mdx +8 -0
- package/portal-pages/sdks.mdx +11 -0
- package/portal-template/NOTICE +37 -0
- package/portal-template/downloads.ts +41 -0
- package/portal-template/generated-pages-reload.ts +51 -0
- package/portal-template/package.json +11 -0
- package/portal-template/portal-config.ts +32 -0
- package/portal-template/prerender-pages.ts +81 -0
- package/portal-template/spec-reload.ts +26 -0
- package/portal-template/src/components/api-page.tsx +15 -0
- package/portal-template/src/components/code-block.tsx +9 -0
- package/portal-template/src/components/command-block.tsx +50 -0
- package/portal-template/src/components/example-layout.tsx +99 -0
- package/portal-template/src/components/logos.tsx +127 -0
- package/portal-template/src/components/mdx.tsx +28 -0
- package/portal-template/src/components/not-found.tsx +11 -0
- package/portal-template/src/components/plugin-install.tsx +22 -0
- package/portal-template/src/components/plugin-support.tsx +53 -0
- package/portal-template/src/components/sdk-actions.tsx +79 -0
- package/portal-template/src/components/sdk-cards.tsx +100 -0
- package/portal-template/src/components/search.tsx +41 -0
- package/portal-template/src/components/usage-tabs.tsx +92 -0
- package/portal-template/src/lib/code-samples.server.ts +40 -0
- package/portal-template/src/lib/code-samples.ts +43 -0
- package/portal-template/src/lib/code-titles.ts +29 -0
- package/portal-template/src/lib/install-command.ts +13 -0
- package/portal-template/src/lib/json.ts +5 -0
- package/portal-template/src/lib/layout.shared.tsx +41 -0
- package/portal-template/src/lib/layout.tsx +16 -0
- package/portal-template/src/lib/llms.server.ts +54 -0
- package/portal-template/src/lib/media-adapters.ts +34 -0
- package/portal-template/src/lib/navigation.ts +406 -0
- package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
- package/portal-template/src/lib/openapi-filter.ts +191 -0
- package/portal-template/src/lib/openapi-labels.ts +15 -0
- package/portal-template/src/lib/openapi-methods.ts +12 -0
- package/portal-template/src/lib/openapi-section.server.ts +280 -0
- package/portal-template/src/lib/openapi-slim.ts +202 -0
- package/portal-template/src/lib/openapi.server.ts +16 -0
- package/portal-template/src/lib/portal-types.ts +36 -0
- package/portal-template/src/lib/portal.server.ts +13 -0
- package/portal-template/src/lib/portal.ts +11 -0
- package/portal-template/src/lib/rehype-code-titles.ts +53 -0
- package/portal-template/src/lib/request-examples.ts +72 -0
- package/portal-template/src/lib/seo.ts +21 -0
- package/portal-template/src/lib/shared.ts +51 -0
- package/portal-template/src/lib/shiki-bundle.ts +104 -0
- package/portal-template/src/lib/sitemap.server.ts +20 -0
- package/portal-template/src/lib/source.server.ts +27 -0
- package/portal-template/src/lib/source.ts +49 -0
- package/portal-template/src/lib/tabs.ts +37 -0
- package/portal-template/src/router.tsx +12 -0
- package/portal-template/src/routes/$.tsx +194 -0
- package/portal-template/src/routes/__root.tsx +56 -0
- package/portal-template/src/routes/api/search[.]json.ts +9 -0
- package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
- package/portal-template/src/routes/llms[.]txt.ts +10 -0
- package/portal-template/src/routes/robots[.]txt.ts +10 -0
- package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
- package/portal-template/src/routes/spa-shell.tsx +7 -0
- package/portal-template/src/routes/{$}[.]md.ts +21 -0
- package/portal-template/src/styles/app.css +33 -0
- package/portal-template/tsconfig.json +26 -0
- package/portal-template/vite.config.ts +68 -0
- package/lib/actions/plugin/record-sdk.d.ts +0 -14
- package/lib/actions/plugin/record-sdk.js +0 -60
- package/lib/actions/plugin/record-sdk.js.map +0 -1
- package/lib/actions/portal/copilot.d.ts +0 -17
- package/lib/actions/portal/copilot.js +0 -89
- package/lib/actions/portal/copilot.js.map +0 -1
- package/lib/actions/portal/quickstart.d.ts +0 -18
- package/lib/actions/portal/quickstart.js +0 -238
- package/lib/actions/portal/quickstart.js.map +0 -1
- package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
- package/lib/actions/portal/recipe/new-recipe.js +0 -177
- package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
- package/lib/actions/portal/toc/new-toc.d.ts +0 -21
- package/lib/actions/portal/toc/new-toc.js +0 -95
- package/lib/actions/portal/toc/new-toc.js.map +0 -1
- package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
- package/lib/actions/sdk/merge-source-tree.js +0 -78
- package/lib/actions/sdk/merge-source-tree.js.map +0 -1
- package/lib/actions/sdk/quickstart.d.ts +0 -18
- package/lib/actions/sdk/quickstart.js +0 -188
- package/lib/actions/sdk/quickstart.js.map +0 -1
- package/lib/actions/sdk/save-changes.d.ts +0 -8
- package/lib/actions/sdk/save-changes.js +0 -93
- package/lib/actions/sdk/save-changes.js.map +0 -1
- package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
- package/lib/application/portal/recipe/portal-recipe.js +0 -33
- package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
- package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
- package/lib/application/portal/recipe/recipe-generator.js +0 -130
- package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
- package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
- package/lib/application/portal/toc/toc-content-parser.js +0 -44
- package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
- package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
- package/lib/application/portal/toc/toc-structure-generator.js +0 -165
- package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
- package/lib/commands/portal/copilot.d.ts +0 -13
- package/lib/commands/portal/copilot.js +0 -34
- package/lib/commands/portal/copilot.js.map +0 -1
- package/lib/commands/portal/recipe/new.d.ts +0 -12
- package/lib/commands/portal/recipe/new.js +0 -45
- package/lib/commands/portal/recipe/new.js.map +0 -1
- package/lib/commands/portal/toc/new.d.ts +0 -16
- package/lib/commands/portal/toc/new.js +0 -68
- package/lib/commands/portal/toc/new.js.map +0 -1
- package/lib/commands/sdk/save-changes.d.ts +0 -14
- package/lib/commands/sdk/save-changes.js +0 -51
- package/lib/commands/sdk/save-changes.js.map +0 -1
- package/lib/infrastructure/debounce-service.d.ts +0 -10
- package/lib/infrastructure/debounce-service.js +0 -55
- package/lib/infrastructure/debounce-service.js.map +0 -1
- package/lib/infrastructure/services/portal-service.d.ts +0 -43
- package/lib/infrastructure/services/portal-service.js +0 -337
- package/lib/infrastructure/services/portal-service.js.map +0 -1
- package/lib/prompts/plugin/record-sdk.d.ts +0 -9
- package/lib/prompts/plugin/record-sdk.js +0 -40
- package/lib/prompts/plugin/record-sdk.js.map +0 -1
- package/lib/prompts/portal/copilot.d.ts +0 -18
- package/lib/prompts/portal/copilot.js +0 -82
- package/lib/prompts/portal/copilot.js.map +0 -1
- package/lib/prompts/portal/quickstart.d.ts +0 -42
- package/lib/prompts/portal/quickstart.js +0 -243
- package/lib/prompts/portal/quickstart.js.map +0 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
- package/lib/prompts/portal/recipe/new-recipe.js +0 -165
- package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
- package/lib/prompts/portal/toc/new-toc.js +0 -50
- package/lib/prompts/portal/toc/new-toc.js.map +0 -1
- package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
- package/lib/prompts/sdk/merge-source-tree.js +0 -90
- package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
- package/lib/prompts/sdk/quickstart.d.ts +0 -38
- package/lib/prompts/sdk/quickstart.js +0 -196
- package/lib/prompts/sdk/quickstart.js.map +0 -1
- package/lib/prompts/sdk/save-changes.d.ts +0 -21
- package/lib/prompts/sdk/save-changes.js +0 -84
- package/lib/prompts/sdk/save-changes.js.map +0 -1
- package/lib/types/build-context.d.ts +0 -26
- package/lib/types/build-context.js +0 -111
- package/lib/types/build-context.js.map +0 -1
- package/lib/types/events/recipe-creation-failed.d.ts +0 -5
- package/lib/types/events/recipe-creation-failed.js +0 -8
- package/lib/types/events/recipe-creation-failed.js.map +0 -1
- package/lib/types/events/sdk-changes-saved.d.ts +0 -8
- package/lib/types/events/sdk-changes-saved.js +0 -11
- package/lib/types/events/sdk-changes-saved.js.map +0 -1
- package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
- package/lib/types/events/sdk-changes-tracked.js +0 -11
- package/lib/types/events/sdk-changes-tracked.js.map +0 -1
- package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
- package/lib/types/events/sdk-conflicts-resolved.js +0 -11
- package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
- package/lib/types/events/toc-creation-failed.d.ts +0 -5
- package/lib/types/events/toc-creation-failed.js +0 -8
- package/lib/types/events/toc-creation-failed.js.map +0 -1
- package/lib/types/merge-source-tree-context.d.ts +0 -28
- package/lib/types/merge-source-tree-context.js +0 -63
- package/lib/types/merge-source-tree-context.js.map +0 -1
- package/lib/types/plugin/language-entry.d.ts +0 -9
- package/lib/types/plugin/language-entry.js +0 -64
- package/lib/types/plugin/language-entry.js.map +0 -1
- package/lib/types/recipe/recipe.d.ts +0 -22
- package/lib/types/recipe/recipe.js +0 -6
- package/lib/types/recipe/recipe.js.map +0 -1
- package/lib/types/recipe-context.d.ts +0 -9
- package/lib/types/recipe-context.js +0 -26
- package/lib/types/recipe-context.js.map +0 -1
- package/lib/types/save-changes-context.d.ts +0 -17
- package/lib/types/save-changes-context.js +0 -42
- package/lib/types/save-changes-context.js.map +0 -1
- package/lib/types/sdl/sdl.d.ts +0 -10
- package/lib/types/sdl/sdl.js +0 -18
- package/lib/types/sdl/sdl.js.map +0 -1
- package/lib/types/toc/toc-components.d.ts +0 -36
- package/lib/types/toc/toc-components.js +0 -94
- package/lib/types/toc/toc-components.js.map +0 -1
- package/lib/types/toc/toc.d.ts +0 -67
- package/lib/types/toc/toc.js +0 -2
- package/lib/types/toc/toc.js.map +0 -1
- package/lib/types/toc-context.d.ts +0 -12
- package/lib/types/toc-context.js +0 -26
- package/lib/types/toc-context.js.map +0 -1
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export class PortalGenerate extends Command {
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
3
|
+
import { GenerateAction } from '../../actions/portal/generate.js';
|
|
4
|
+
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
5
|
+
import { format, intro, outro } from '../../prompts/format.js';
|
|
6
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
7
|
+
export default class PortalGenerate extends Command {
|
|
8
|
+
static summary = 'Generate a static API Documentation Portal.';
|
|
9
|
+
static description = `Builds a documentation portal from the OpenAPI documents and Markdown pages in your 'src' directory.
|
|
10
|
+
|
|
11
|
+
The 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.`;
|
|
12
|
+
static cmdTxt = format.cmd('apimatic', 'portal', 'generate');
|
|
13
|
+
static examples = [
|
|
14
|
+
PortalGenerate.cmdTxt,
|
|
15
|
+
`${PortalGenerate.cmdTxt} ${format.flag('input', './')} ${format.flag('destination', './portal')}`,
|
|
16
|
+
`${PortalGenerate.cmdTxt} ${format.flag('zip')}`
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
zip: Flags.boolean({
|
|
20
|
+
default: false,
|
|
21
|
+
description: 'write the generated portal as a .zip archive.'
|
|
22
|
+
}),
|
|
23
|
+
...FlagsProvider.input,
|
|
24
|
+
...FlagsProvider.destination('portal', 'portal'),
|
|
25
|
+
...FlagsProvider.force,
|
|
26
|
+
...FlagsProvider.authKey
|
|
27
|
+
};
|
|
8
28
|
async run() {
|
|
9
|
-
const { flags: { input, destination, force, zip: zipPortal,
|
|
10
|
-
const
|
|
11
|
-
const buildDirectory = input ? new DirectoryPath(input, "src") : workingDirectory.join("src");
|
|
12
|
-
const portalDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join("portal");
|
|
29
|
+
const { flags: { input, destination, force, zip: zipPortal, 'auth-key': authKey } } = await this.parse(PortalGenerate);
|
|
30
|
+
const project = ProjectContext.at(input);
|
|
13
31
|
const commandMetadata = {
|
|
14
|
-
commandName:
|
|
32
|
+
commandName: PortalGenerate.id,
|
|
15
33
|
shell: this.config.shell
|
|
16
34
|
};
|
|
17
|
-
intro(
|
|
18
|
-
const action = new GenerateAction(
|
|
19
|
-
const result = await action.execute(
|
|
35
|
+
intro('Generate Portal');
|
|
36
|
+
const action = new GenerateAction(this.getConfigDir(), commandMetadata, authKey);
|
|
37
|
+
const result = await action.execute(project, project.portalDirectory(destination), force, zipPortal);
|
|
20
38
|
outro(result);
|
|
21
39
|
}
|
|
40
|
+
getConfigDir = () => {
|
|
41
|
+
return new DirectoryPath(this.config.configDir);
|
|
42
|
+
};
|
|
22
43
|
}
|
|
23
|
-
_a = PortalGenerate;
|
|
24
|
-
PortalGenerate.summary = "Generate Context Plugins and API Documentation Portal with AI Assist Features.";
|
|
25
|
-
PortalGenerate.description = "Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/build-file-reference)";
|
|
26
|
-
PortalGenerate.flags = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, FlagsProvider.input), FlagsProvider.destination("portal", "portal")), FlagsProvider.force), { zip: Flags.boolean({
|
|
27
|
-
default: false,
|
|
28
|
-
description: "Download the generated portal as a .zip archive"
|
|
29
|
-
}) }), FlagsProvider.authKey);
|
|
30
|
-
PortalGenerate.cmdTxt = format.cmd("apimatic", "portal", "generate");
|
|
31
|
-
PortalGenerate.examples = [
|
|
32
|
-
_a.cmdTxt,
|
|
33
|
-
`${_a.cmdTxt} ${format.flag("input", '"./"')} ${format.flag("destination", '"./portal"')}`
|
|
34
|
-
];
|
|
35
44
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/portal/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAU,OAAO,GAAG,6CAA6C,CAAC;IAExE,MAAM,CAAU,WAAW,GAAG;;oUAEoS,CAAC;IAEnU,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,E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AC,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACrG,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,16 +1,14 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
export default class PortalServe extends Command {
|
|
3
|
-
static summary
|
|
4
|
-
static description
|
|
3
|
+
static readonly summary = "Preview your API Documentation Portal with live reload.";
|
|
4
|
+
static readonly description = "Serves the portal described by 'src/apimatic.json' from your machine, reloading the browser as you edit the Markdown pages in 'src/content', reorder them in a 'nav.json', or change the 'portal', 'languages' or 'plugin' block of 'apimatic.json'.\n\nAdding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', or changing which documents are in 'src/spec', needs the preview restarted.\n\nNothing is written to disk; run 'apimatic portal generate' to produce the static files.";
|
|
5
|
+
static readonly cmdTxt: string;
|
|
6
|
+
static readonly examples: string[];
|
|
5
7
|
static flags: {
|
|
6
8
|
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
"no-reload": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
9
|
port: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
|
-
static cmdTxt: string;
|
|
13
|
-
static examples: string[];
|
|
14
12
|
run(): Promise<void>;
|
|
15
|
-
private getConfigDir;
|
|
13
|
+
private readonly getConfigDir;
|
|
16
14
|
}
|
|
@@ -1,53 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { format, intro, outro } from
|
|
7
|
-
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { DEFAULT_PORTAL_PORT, PortalServeAction } from '../../actions/portal/serve.js';
|
|
3
|
+
import { DirectoryPath } from '../../types/file/directoryPath.js';
|
|
4
|
+
import { FlagsProvider } from '../../types/flags-provider.js';
|
|
5
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
6
|
+
import { format, intro, outro } from '../../prompts/format.js';
|
|
7
|
+
const defaultPortText = String(DEFAULT_PORTAL_PORT);
|
|
8
|
+
export default class PortalServe extends Command {
|
|
9
|
+
static summary = 'Preview your API Documentation Portal with live reload.';
|
|
10
|
+
static description = `Serves the portal described by 'src/apimatic.json' from your machine, reloading the browser as you edit the Markdown pages in 'src/content', reorder them in a 'nav.json', or change the 'portal', 'languages' or 'plugin' block of 'apimatic.json'.
|
|
11
|
+
|
|
12
|
+
Adding a language or a 'plugin' block, adding or removing a page in 'src/content', creating 'src/static', or changing which documents are in 'src/spec', needs the preview restarted.
|
|
13
|
+
|
|
14
|
+
Nothing is written to disk; run 'apimatic portal generate' to produce the static files.`;
|
|
15
|
+
static cmdTxt = format.cmd('apimatic', 'portal', 'serve');
|
|
16
|
+
static examples = [
|
|
17
|
+
PortalServe.cmdTxt,
|
|
18
|
+
`${PortalServe.cmdTxt} ${format.flag('input', './')} ${format.flag('port', defaultPortText)} ${format.flag('open')}`
|
|
19
|
+
];
|
|
20
|
+
static flags = {
|
|
21
|
+
port: Flags.integer({
|
|
22
|
+
char: 'p',
|
|
23
|
+
description: 'port to serve the portal on.',
|
|
24
|
+
default: DEFAULT_PORTAL_PORT,
|
|
25
|
+
helpValue: defaultPortText
|
|
26
|
+
}),
|
|
27
|
+
open: Flags.boolean({
|
|
28
|
+
char: 'o',
|
|
29
|
+
description: 'open the portal in the default browser.',
|
|
30
|
+
default: false
|
|
31
|
+
}),
|
|
32
|
+
...FlagsProvider.input,
|
|
33
|
+
...FlagsProvider.authKey
|
|
34
|
+
};
|
|
8
35
|
async run() {
|
|
9
|
-
const { flags: { input,
|
|
10
|
-
const workingDirectory = DirectoryPath.createInput(input);
|
|
11
|
-
const buildDirectory = input ? new DirectoryPath(input, "src") : workingDirectory.join("src");
|
|
12
|
-
const portalDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join("portal");
|
|
36
|
+
const { flags: { input, port, open, 'auth-key': authKey } } = await this.parse(PortalServe);
|
|
13
37
|
const commandMetadata = {
|
|
14
|
-
commandName:
|
|
38
|
+
commandName: PortalServe.id,
|
|
15
39
|
shell: this.config.shell
|
|
16
40
|
};
|
|
17
|
-
intro(
|
|
18
|
-
const
|
|
19
|
-
const result = await
|
|
41
|
+
intro('Portal Serve');
|
|
42
|
+
const action = new PortalServeAction(this.getConfigDir(), commandMetadata, authKey);
|
|
43
|
+
const result = await action.execute(ProjectContext.at(input), port, open);
|
|
20
44
|
outro(result);
|
|
21
45
|
}
|
|
22
|
-
getConfigDir() {
|
|
46
|
+
getConfigDir = () => {
|
|
23
47
|
return new DirectoryPath(this.config.configDir);
|
|
24
|
-
}
|
|
48
|
+
};
|
|
25
49
|
}
|
|
26
|
-
_a = PortalServe;
|
|
27
|
-
PortalServe.summary = "Generate and serve an API Documentation Portal with hot reload.";
|
|
28
|
-
PortalServe.description = "Requires an input directory with API specifications, a config file, and optionally markdown guides. Supports disabling hot reload and opening the portal in the default browser.";
|
|
29
|
-
PortalServe.flags = Object.assign(Object.assign(Object.assign(Object.assign({ port: Flags.integer({
|
|
30
|
-
char: "p",
|
|
31
|
-
description: "port to serve the portal.",
|
|
32
|
-
default: 23513,
|
|
33
|
-
helpValue: "23513"
|
|
34
|
-
}) }, FlagsProvider.input), FlagsProvider.destination("portal", "portal")), { open: Flags.boolean({
|
|
35
|
-
char: "o",
|
|
36
|
-
description: "open the portal in the default browser.",
|
|
37
|
-
default: false
|
|
38
|
-
}), "no-reload": Flags.boolean({
|
|
39
|
-
description: "disable hot reload.",
|
|
40
|
-
default: false
|
|
41
|
-
}) }), FlagsProvider.authKey);
|
|
42
|
-
PortalServe.cmdTxt = format.cmd("apimatic", "portal", "serve");
|
|
43
|
-
PortalServe.examples = [
|
|
44
|
-
_a.cmdTxt,
|
|
45
|
-
`${_a.cmdTxt} ` +
|
|
46
|
-
`${format.flag("input", './')} ` +
|
|
47
|
-
`${format.flag("destination", './portal')} ` +
|
|
48
|
-
`${format.flag("port", "23513")} ` +
|
|
49
|
-
`${format.flag("open")} ` +
|
|
50
|
-
`${format.flag("no-reload")}`
|
|
51
|
-
];
|
|
52
|
-
export default PortalServe;
|
|
53
50
|
//# sourceMappingURL=serve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/commands/portal/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/commands/portal/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,eAAe,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,MAAM,CAAU,OAAO,GAAG,yDAAyD,CAAC;IAEpF,MA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AAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1E,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,13 +2,11 @@ import { Command } from '@oclif/core';
|
|
|
2
2
|
import { DirectoryPath } from '../../../types/file/directoryPath.js';
|
|
3
3
|
import { format, intro, outro } from '../../../prompts/format.js';
|
|
4
4
|
import { PublishingProfileListAction } from '../../../actions/publishing/profile/list.js';
|
|
5
|
-
class PublishingProfileList extends Command {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
}
|
|
5
|
+
export default class PublishingProfileList extends Command {
|
|
6
|
+
static summary = 'List all publishing profiles';
|
|
7
|
+
static description = `Display all publishing profiles associated with your account, including each profile's name, ID and enabled languages.`;
|
|
8
|
+
static cmdTxt = format.cmd('apimatic', 'publishing', 'profile', 'list');
|
|
9
|
+
static examples = [PublishingProfileList.cmdTxt];
|
|
12
10
|
async run() {
|
|
13
11
|
const commandMetadata = {
|
|
14
12
|
commandName: PublishingProfileList.id,
|
|
@@ -19,10 +17,8 @@ class PublishingProfileList extends Command {
|
|
|
19
17
|
const result = await action.execute();
|
|
20
18
|
outro(result);
|
|
21
19
|
}
|
|
20
|
+
getConfigDir = () => {
|
|
21
|
+
return new DirectoryPath(this.config.configDir);
|
|
22
|
+
};
|
|
22
23
|
}
|
|
23
|
-
PublishingProfileList.summary = 'List all publishing profiles';
|
|
24
|
-
PublishingProfileList.description = `Display all publishing profiles associated with your account, including each profile's name, ID and enabled languages.`;
|
|
25
|
-
PublishingProfileList.cmdTxt = format.cmd('apimatic', 'publishing', 'profile', 'list');
|
|
26
|
-
PublishingProfileList.examples = [PublishingProfileList.cmdTxt];
|
|
27
|
-
export default PublishingProfileList;
|
|
28
24
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/publishing/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAE1F,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/publishing/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAE1F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,OAAO;IACxD,MAAM,CAAU,OAAO,GAAG,8BAA8B,CAAC;IAEzD,MAAM,CAAU,WAAW,GAAG,wHAAwH,CAAC;IAE/I,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAEzF,MAAM,CAAC,QAAQ,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAEjD,KAAK,CAAC,GAAG;QACP,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,qBAAqB,CAAC,EAAE;YACrC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,CAAC,CAAC;QACrF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACtC,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,9 +1,9 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
export default class Quickstart extends Command {
|
|
3
|
-
static description
|
|
4
|
-
static summary
|
|
5
|
-
static cmdTxt: string;
|
|
6
|
-
static examples: string[];
|
|
3
|
+
static readonly description = "Point the CLI at your API specification and it builds a documentation portal, SDKs, and a context plugin that teaches an AI coding assistant to use them.";
|
|
4
|
+
static readonly summary = "Create your first API Documentation Portal, SDKs and Context Plugins.";
|
|
5
|
+
static readonly cmdTxt: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
7
|
run(): Promise<void>;
|
|
8
8
|
private readonly getConfigDir;
|
|
9
9
|
}
|
|
@@ -1,37 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return new DirectoryPath(this.config.configDir);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { format, intro, outro } from '../prompts/format.js';
|
|
3
|
+
import { TelemetryService } from '../infrastructure/services/telemetry-service.js';
|
|
4
|
+
import { DirectoryPath } from '../types/file/directoryPath.js';
|
|
5
|
+
import { QuickstartInitiatedEvent } from '../types/events/quickstart-initiated.js';
|
|
6
|
+
import { QuickstartAction } from '../actions/quickstart.js';
|
|
7
|
+
import { QuickstartCompletedEvent } from '../types/events/quickstart-completed.js';
|
|
8
|
+
export default class Quickstart extends Command {
|
|
9
|
+
static description = 'Point the CLI at your API specification and it builds a documentation portal, SDKs, and a context plugin that teaches an AI coding assistant to use them.';
|
|
10
|
+
static summary = 'Create your first API Documentation Portal, SDKs and Context Plugins.';
|
|
11
|
+
static cmdTxt = format.cmd('apimatic', 'quickstart');
|
|
12
|
+
static examples = [Quickstart.cmdTxt];
|
|
16
13
|
async run() {
|
|
17
14
|
const telemetryService = new TelemetryService(this.getConfigDir());
|
|
18
15
|
const commandMetadata = {
|
|
19
|
-
commandName:
|
|
16
|
+
commandName: Quickstart.id,
|
|
20
17
|
shell: this.config.shell
|
|
21
18
|
};
|
|
22
19
|
await telemetryService.trackEvent(new QuickstartInitiatedEvent(), commandMetadata.shell);
|
|
23
|
-
intro(
|
|
20
|
+
intro('Quickstart');
|
|
24
21
|
const action = new QuickstartAction(this.getConfigDir(), commandMetadata);
|
|
25
|
-
const result = await action.execute();
|
|
22
|
+
const result = await action.execute(DirectoryPath.default);
|
|
26
23
|
outro(result);
|
|
27
24
|
// TODO: Remove this, find a solution for tracking.
|
|
28
25
|
await result.mapAll(async () => await telemetryService.trackEvent(new QuickstartCompletedEvent(), commandMetadata.shell), async () => { }, async () => { });
|
|
29
26
|
}
|
|
27
|
+
getConfigDir = () => {
|
|
28
|
+
return new DirectoryPath(this.config.configDir);
|
|
29
|
+
};
|
|
30
30
|
}
|
|
31
|
-
_a = Quickstart;
|
|
32
|
-
Quickstart.description = "Get started with your first SDK or API Portal in four easy steps.";
|
|
33
|
-
Quickstart.summary = "Create your first API Portal, Context Plugins and SDKs, or a standalone SDK, using APIMatic.";
|
|
34
|
-
Quickstart.cmdTxt = format.cmd("apimatic", "quickstart");
|
|
35
|
-
Quickstart.examples = [_a.cmdTxt];
|
|
36
|
-
export default Quickstart;
|
|
37
31
|
//# sourceMappingURL=quickstart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../src/commands/quickstart.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../src/commands/quickstart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,OAAO;IAC7C,MAAM,CAAU,WAAW,GACzB,2JAA2J,CAAC;IAE9J,MAAM,CAAU,OAAO,GAAG,uEAAuE,CAAC;IAElG,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAE9D,MAAM,CAAU,QAAQ,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAE/C,KAAK,CAAC,GAAG;QACP,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACnE,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,UAAU,CAAC,EAAE;YAC1B,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,MAAM,gBAAgB,CAAC,UAAU,CAAC,IAAI,wBAAwB,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;QAEzF,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,eAAe,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3D,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,mDAAmD;QACnD,MAAM,MAAM,CAAC,MAAM,CACjB,KAAK,IAAI,EAAE,CAAC,MAAM,gBAAgB,CAAC,UAAU,CAAC,IAAI,wBAAwB,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,EACpG,KAAK,IAAI,EAAE,GAAE,CAAC,EACd,KAAK,IAAI,EAAE,GAAE,CAAC,CACf,CAAC;IACJ,CAAC;IAEgB,YAAY,GAAG,GAAG,EAAE;QACnC,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAClD,CAAC,CAAC;CACH"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
2
|
export default class SdkGenerate extends Command {
|
|
3
3
|
static readonly summary = "Generate an SDK for your API";
|
|
4
|
-
static readonly description = "Generate Software Development
|
|
4
|
+
static readonly description = "Generate a Software Development Kit (SDK) from an API specification.\nC#, TypeScript and Python are available; Java, Ruby, Go and PHP are on their way.";
|
|
5
5
|
static readonly cmdTxt: string;
|
|
6
6
|
static flags: {
|
|
7
7
|
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
8
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
language: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
|
|
12
|
-
"api-version": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
12
|
zip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
stability: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'codegen-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
stability: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
15
|
};
|
|
18
16
|
static examples: string[];
|
|
19
17
|
run(): Promise<void>;
|
|
@@ -1,80 +1,68 @@
|
|
|
1
|
-
import { Command, Flags } from
|
|
2
|
-
import { DirectoryPath } from
|
|
3
|
-
import { FlagsProvider } from
|
|
4
|
-
import { GenerateAction } from
|
|
5
|
-
import { CodeGenerationVersion,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 { GenerateAction } from '../../actions/sdk/generate.js';
|
|
5
|
+
import { CodeGenerationVersion, Language, Stability } from '../../types/sdk/generate.js';
|
|
6
|
+
import { StabilityChoice } from '../../types/sdk/stability-choice.js';
|
|
7
|
+
import { ProjectContext } from '../../types/project-context.js';
|
|
8
|
+
import { format, intro, outro } from '../../prompts/format.js';
|
|
9
|
+
export default class SdkGenerate extends Command {
|
|
10
|
+
static summary = 'Generate an SDK for your API';
|
|
11
|
+
static description = `Generate a Software Development Kit (SDK) from an API specification.
|
|
12
|
+
C#, TypeScript and Python are available; Java, Ruby, Go and PHP are on their way.`;
|
|
13
|
+
static cmdTxt = format.cmd('apimatic', 'sdk', 'generate');
|
|
14
|
+
static flags = {
|
|
15
|
+
// Every language stays here so one that is coming back is answered by the command rather than
|
|
16
|
+
// rejected as an unknown value; the action says which are available.
|
|
17
|
+
language: Flags.string({
|
|
18
|
+
char: 'l',
|
|
19
|
+
required: true,
|
|
20
|
+
description: 'Programming language for SDK generation',
|
|
21
|
+
options: Object.values(Language).map((p) => p.valueOf())
|
|
22
|
+
}),
|
|
23
|
+
destination: Flags.string({
|
|
24
|
+
char: 'd',
|
|
25
|
+
description: '[default: <input>/sdk/<language> | <input>/sdk/<api-version>/<language>] path where the SDK will be generated'
|
|
26
|
+
}),
|
|
27
|
+
'api-version': Flags.string({
|
|
28
|
+
description: 'Version of the API to use for SDK generation (if multiple versions exist)'
|
|
29
|
+
}),
|
|
30
|
+
zip: Flags.boolean({
|
|
31
|
+
default: false,
|
|
32
|
+
description: 'Download the generated SDK as a .zip archive'
|
|
33
|
+
}),
|
|
34
|
+
'codegen-version': Flags.string({
|
|
35
|
+
description: 'Version of the code generator to use',
|
|
36
|
+
options: Object.values(CodeGenerationVersion).map((v) => v.valueOf()),
|
|
37
|
+
default: CodeGenerationVersion.V4
|
|
38
|
+
}),
|
|
39
|
+
stability: Flags.string({
|
|
40
|
+
description: 'Stability level of the generated SDK. Defaults to the level the language offers.',
|
|
41
|
+
options: Object.values(Stability).map((s) => s.valueOf())
|
|
42
|
+
}),
|
|
43
|
+
...FlagsProvider.input,
|
|
44
|
+
...FlagsProvider.force,
|
|
45
|
+
...FlagsProvider.authKey
|
|
46
|
+
};
|
|
47
|
+
static examples = [
|
|
48
|
+
`${SdkGenerate.cmdTxt} ${format.flag('language', 'typescript')}`,
|
|
49
|
+
`${SdkGenerate.cmdTxt} ${format.flag('language', 'csharp')} ${format.flag('input', './')}`,
|
|
50
|
+
`${SdkGenerate.cmdTxt} ${format.flag('language', 'python')} ${format.flag('destination', './sdk')} ${format.flag('zip')}`
|
|
51
|
+
];
|
|
17
52
|
async run() {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const workingDirectory = DirectoryPath.createInput(input);
|
|
21
|
-
const buildDirectory = input ? new DirectoryPath(input, "src") : workingDirectory.join("src");
|
|
22
|
-
const sdkDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join("sdk");
|
|
53
|
+
const { flags: { language, input, destination, force, zip: zipSdk, stability, 'auth-key': authKey, 'api-version': apiVersion } } = await this.parse(SdkGenerate);
|
|
54
|
+
const project = ProjectContext.at(input);
|
|
23
55
|
const commandMetadata = {
|
|
24
56
|
commandName: SdkGenerate.id,
|
|
25
57
|
shell: this.config.shell
|
|
26
58
|
};
|
|
27
|
-
|
|
28
|
-
intro("Generate SDK");
|
|
59
|
+
intro('Generate SDK');
|
|
29
60
|
const action = new GenerateAction(this.getConfigDir(), commandMetadata, authKey);
|
|
30
|
-
const result = await action.execute(
|
|
61
|
+
const result = await action.execute(project, project.sdkDirectory(destination), language, StabilityChoice.for(language, stability).stabilityLevel(), force, zipSdk, apiVersion);
|
|
31
62
|
outro(result);
|
|
32
|
-
await result.mapAll(async (res) => {
|
|
33
|
-
if (res === null || res === void 0 ? void 0 : res.sourceTreeTrackingInitiated) {
|
|
34
|
-
await telemetryService.trackEvent(new SdkChangesTrackedEvent(language), commandMetadata.shell);
|
|
35
|
-
}
|
|
36
|
-
if (res === null || res === void 0 ? void 0 : res.conflictsResolved) {
|
|
37
|
-
await telemetryService.trackEvent(new SdkConflictsResolvedEvent(language), commandMetadata.shell);
|
|
38
|
-
}
|
|
39
|
-
}, async () => { }, async () => { });
|
|
40
63
|
}
|
|
64
|
+
getConfigDir = () => {
|
|
65
|
+
return new DirectoryPath(this.config.configDir);
|
|
66
|
+
};
|
|
41
67
|
}
|
|
42
|
-
SdkGenerate.summary = "Generate an SDK for your API";
|
|
43
|
-
SdkGenerate.description = `Generate Software Development Kits (SDKs) from API specifications.
|
|
44
|
-
Supports multiple programming languages including Java, C#, Python, JavaScript, and more.`;
|
|
45
|
-
SdkGenerate.cmdTxt = format.cmd("apimatic", "sdk", "generate");
|
|
46
|
-
SdkGenerate.flags = Object.assign(Object.assign(Object.assign({ language: Flags.string({
|
|
47
|
-
char: "l",
|
|
48
|
-
required: true,
|
|
49
|
-
description: "Programming language for SDK generation",
|
|
50
|
-
options: Object.values(Language).map((p) => p.valueOf()),
|
|
51
|
-
}), destination: Flags.string({
|
|
52
|
-
char: "d",
|
|
53
|
-
description: "[default: <input>/sdk/<language> | <input>/sdk/<api-version>/<language>] path where the SDK will be generated"
|
|
54
|
-
}), "skip-changes": Flags.boolean({
|
|
55
|
-
default: false,
|
|
56
|
-
description: "Do not apply the saved changes to the generated SDK"
|
|
57
|
-
}), "api-version": Flags.string({
|
|
58
|
-
description: "Version of the API to use for SDK generation (if multiple versions exist)"
|
|
59
|
-
}), zip: Flags.boolean({
|
|
60
|
-
default: false,
|
|
61
|
-
description: "Download the generated SDK as a .zip archive"
|
|
62
|
-
}), "track-changes": Flags.boolean({
|
|
63
|
-
default: false,
|
|
64
|
-
description: "Enable change tracking for SDK generation (only required for initial setup)"
|
|
65
|
-
}), "codegen-version": Flags.string({
|
|
66
|
-
description: "Version of the code generator to use",
|
|
67
|
-
options: Object.values(CodeGenerationVersion).map((v) => v.valueOf()),
|
|
68
|
-
default: CodeGenerationVersion.V3
|
|
69
|
-
}), "stability": Flags.string({
|
|
70
|
-
description: "Stability level of the generated SDK",
|
|
71
|
-
options: Object.values(Stability).map((s) => s.valueOf()),
|
|
72
|
-
default: Stability.STABLE
|
|
73
|
-
}) }, FlagsProvider.input), FlagsProvider.force), FlagsProvider.authKey);
|
|
74
|
-
SdkGenerate.examples = [
|
|
75
|
-
`${SdkGenerate.cmdTxt} ${format.flag("language", "java")}`,
|
|
76
|
-
`${SdkGenerate.cmdTxt} ${format.flag("language", "csharp")} ${format.flag("input", "./")}`,
|
|
77
|
-
`${SdkGenerate.cmdTxt} ${format.flag("language", "python")} ${format.flag("destination", "./sdk")} ${format.flag("zip")}`
|
|
78
|
-
];
|
|
79
|
-
export default SdkGenerate;
|
|
80
68
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/sdk/generate.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;AAC/D,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/sdk/generate.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;AAC/D,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAC9C,MAAM,CAAU,OAAO,GAAG,8BAA8B,CAAC;IAEzD,MAAM,CAAU,WAAW,GAAG;kFACkD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AAC,QAAoB,EAAE,SAAS,CAAC,CAAC,cAAc,EAAE,EACrE,KAAK,EACL,MAAM,EACN,UAAU,CACX,CAAC;QACF,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,16 +4,15 @@ export default class SdkPublish extends Command {
|
|
|
4
4
|
static readonly 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.";
|
|
5
5
|
static readonly cmdTxt: string;
|
|
6
6
|
static flags: {
|
|
7
|
-
'publish-type': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'codegen-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
stability: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
-
'update-plugin-config': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
language: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
7
|
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
9
|
'profile-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
10
|
version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
language: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'publish-type': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'codegen-version': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
stability: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
16
|
};
|
|
18
17
|
static examples: string[];
|
|
19
18
|
run(): Promise<void>;
|