@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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { err, ok } from 'neverthrow';
|
|
2
|
+
import { FileService } from '../infrastructure/file-service.js';
|
|
3
|
+
import { errorMessage } from '../utils/error-utils.js';
|
|
4
|
+
import { stripByteOrderMark } from '../utils/string-utils.js';
|
|
5
|
+
import { APIMATIC_CONFIG_FILE_NAME, ApimaticConfigDocument } from './apimatic-config/document.js';
|
|
6
|
+
import { FileName } from './file/fileName.js';
|
|
7
|
+
import { FilePath } from './file/filePath.js';
|
|
8
|
+
/** How a file the CLI creates is laid out; one it found keeps its own layout. */
|
|
9
|
+
const DEFAULT_FORMAT = { indent: ' ', trailingNewline: true };
|
|
10
|
+
/** The `apimatic.json` in a project's `src/`, beside `APIMATIC-BUILD.json`. */
|
|
11
|
+
export class ApimaticConfigContext {
|
|
12
|
+
sourceDirectory;
|
|
13
|
+
fileService = new FileService();
|
|
14
|
+
constructor(sourceDirectory) {
|
|
15
|
+
this.sourceDirectory = sourceDirectory;
|
|
16
|
+
}
|
|
17
|
+
get configFile() {
|
|
18
|
+
return new FilePath(this.sourceDirectory, new FileName(APIMATIC_CONFIG_FILE_NAME));
|
|
19
|
+
}
|
|
20
|
+
async exists() {
|
|
21
|
+
return await this.fileService.fileExists(this.configFile);
|
|
22
|
+
}
|
|
23
|
+
async read() {
|
|
24
|
+
const loaded = await this.load();
|
|
25
|
+
if (loaded === undefined) {
|
|
26
|
+
return { state: 'missing' };
|
|
27
|
+
}
|
|
28
|
+
if (loaded.parsed.isErr()) {
|
|
29
|
+
return { state: 'unparseable', findings: loaded.parsed.error, path: this.configFile };
|
|
30
|
+
}
|
|
31
|
+
return { state: 'parsed', document: loaded.parsed.value, path: this.configFile };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Reads the document, hands the whole of it to `apply`, writes back the whole of what comes
|
|
35
|
+
* back. `blocks` names what the caller is about to write: a finding in one of them, or at
|
|
36
|
+
* the root, refuses the write, so a merge never spreads a malformed block into the file. A
|
|
37
|
+
* missing file starts from the empty document. A file that exists but cannot be parsed is
|
|
38
|
+
* left alone rather than overwritten, and a write fault is reported rather than thrown: this
|
|
39
|
+
* runs after work that already succeeded, and nothing here may turn that into a crash. A merge
|
|
40
|
+
* that changes nothing writes nothing, so re-running a command leaves the file as it was saved.
|
|
41
|
+
*/
|
|
42
|
+
async merge(blocks, apply) {
|
|
43
|
+
const loaded = await this.load();
|
|
44
|
+
let document = ApimaticConfigDocument.empty();
|
|
45
|
+
let format = DEFAULT_FORMAT;
|
|
46
|
+
if (loaded !== undefined) {
|
|
47
|
+
if (loaded.parsed.isErr()) {
|
|
48
|
+
return err('unreadable');
|
|
49
|
+
}
|
|
50
|
+
document = loaded.parsed.value;
|
|
51
|
+
if (document.findingsFor('root', ...blocks).length > 0) {
|
|
52
|
+
return err('unreadable');
|
|
53
|
+
}
|
|
54
|
+
format = loaded.format;
|
|
55
|
+
}
|
|
56
|
+
const next = apply(document);
|
|
57
|
+
const serialized = next.serialize(format.indent, format.trailingNewline);
|
|
58
|
+
if (serialized === document.serialize(format.indent, format.trailingNewline)) {
|
|
59
|
+
return ok(next);
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
await this.fileService.replaceContents(this.configFile, serialized);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return err('unwritable');
|
|
66
|
+
}
|
|
67
|
+
return ok(next);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Rewrites the file without its byte-order mark, if it has one. Reading past a mark is enough
|
|
71
|
+
* while the file stays here, but `plugin generate` zips it and sends it to a parser that is
|
|
72
|
+
* not this one. Only the mark goes: the rest is written back byte for byte, so a layout this
|
|
73
|
+
* CLI never chose, and the line endings with it, survive a rewrite nobody asked for.
|
|
74
|
+
*/
|
|
75
|
+
async removeByteOrderMark() {
|
|
76
|
+
if (!(await this.fileService.fileExists(this.configFile))) {
|
|
77
|
+
return ok(undefined);
|
|
78
|
+
}
|
|
79
|
+
let text;
|
|
80
|
+
try {
|
|
81
|
+
text = await this.fileService.getContents(this.configFile);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return err('unreadable');
|
|
85
|
+
}
|
|
86
|
+
const stripped = stripByteOrderMark(text);
|
|
87
|
+
if (stripped === text) {
|
|
88
|
+
return ok(undefined);
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await this.fileService.replaceContents(this.configFile, stripped);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return err('unwritable');
|
|
95
|
+
}
|
|
96
|
+
return ok(undefined);
|
|
97
|
+
}
|
|
98
|
+
async load() {
|
|
99
|
+
if (!(await this.fileService.fileExists(this.configFile))) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
let text;
|
|
103
|
+
try {
|
|
104
|
+
text = await this.fileService.getContents(this.configFile);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
return {
|
|
108
|
+
parsed: err([{ block: 'root', field: null, problem: `could not be read: ${errorMessage(error)}` }]),
|
|
109
|
+
format: DEFAULT_FORMAT
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return { parsed: ApimaticConfigDocument.parse(text), format: ApimaticConfigContext.detectFormat(text) };
|
|
113
|
+
}
|
|
114
|
+
// The first indented line says how the file is indented; a file with none gets the default.
|
|
115
|
+
// Line endings are not kept: the output is `\n` whatever the file used.
|
|
116
|
+
static detectFormat(text) {
|
|
117
|
+
const indent = /^([ \t]+)"/m.exec(text)?.[1] ?? DEFAULT_FORMAT.indent;
|
|
118
|
+
return { indent, trailingNewline: text.endsWith('\n') };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=apimatic-config-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apimatic-config-context.js","sourceRoot":"","sources":["../../src/types/apimatic-config-context.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,103 +1,15 @@
|
|
|
1
|
-
import { DirectoryPath } from "../file/directoryPath.js";
|
|
2
|
-
import { UrlPath } from "../file/urlPath.js";
|
|
3
1
|
export interface BuildConfigData {
|
|
4
|
-
generatePortal?: PortalConfig;
|
|
5
2
|
generateVersionedPortal?: object;
|
|
6
3
|
versionsPath?: string;
|
|
7
|
-
apiCopilotConfig?: CopilotConfig;
|
|
8
|
-
recipes?: RecipesConfig;
|
|
9
4
|
[key: string]: unknown;
|
|
10
5
|
}
|
|
11
|
-
export interface PortalConfig {
|
|
12
|
-
contentFolder?: string;
|
|
13
|
-
languageConfig: {
|
|
14
|
-
[key: string]: object;
|
|
15
|
-
};
|
|
16
|
-
/** URL where the portal will be hosted. Mirrors `generatePortal.baseUrl` in codegen. */
|
|
17
|
-
baseUrl?: string;
|
|
18
|
-
/** Portal UI settings. Mirrors `generatePortal.portalSettings` in codegen. */
|
|
19
|
-
portalSettings?: PortalSettingsData;
|
|
20
|
-
apiSpecPath?: DirectoryPath;
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
}
|
|
23
|
-
export interface PortalSettingsData {
|
|
24
|
-
/** Base URL for the API calls made by the portal. Preferred over `generatePortal.baseUrl` for portal artifacts. */
|
|
25
|
-
baseUrl?: string;
|
|
26
|
-
/** Language/template id the portal opens on first load. */
|
|
27
|
-
initialPlatform?: string;
|
|
28
|
-
/** Per-language portal settings, keyed by language/template id. */
|
|
29
|
-
languageSettings?: {
|
|
30
|
-
[language: string]: LanguageSettingData;
|
|
31
|
-
};
|
|
32
|
-
[key: string]: unknown;
|
|
33
|
-
}
|
|
34
|
-
export interface LanguageSettingData {
|
|
35
|
-
aiIntegration?: AiIntegration;
|
|
36
|
-
[key: string]: unknown;
|
|
37
|
-
}
|
|
38
|
-
export interface AiIntegration {
|
|
39
|
-
cursor?: AiIntegrationSetting;
|
|
40
|
-
claudeCode?: AiIntegrationSetting;
|
|
41
|
-
vscode?: AiIntegrationSetting;
|
|
42
|
-
}
|
|
43
|
-
export interface AiIntegrationSetting {
|
|
44
|
-
isEnabled: boolean;
|
|
45
|
-
stabilityLevelTag?: string;
|
|
46
|
-
}
|
|
47
|
-
export interface CopilotConfig {
|
|
48
|
-
isEnabled: boolean;
|
|
49
|
-
key: string;
|
|
50
|
-
welcomeMessage: string;
|
|
51
|
-
}
|
|
52
|
-
export interface RecipesConfig {
|
|
53
|
-
workflows?: RecipeWorkflow[];
|
|
54
|
-
}
|
|
55
|
-
export interface RecipeWorkflow {
|
|
56
|
-
name: string;
|
|
57
|
-
permalink: string;
|
|
58
|
-
functionName: string;
|
|
59
|
-
scriptPath: string;
|
|
60
|
-
}
|
|
61
|
-
export declare function getLanguagesConfig(selectedLanguages: string[]): {
|
|
62
|
-
[key: string]: object;
|
|
63
|
-
};
|
|
64
|
-
export declare class LanguageSetting {
|
|
65
|
-
private readonly data;
|
|
66
|
-
private constructor();
|
|
67
|
-
static from(data?: LanguageSettingData): LanguageSetting;
|
|
68
|
-
/** Returns a copy with all AI editor integrations (Cursor/Claude Code/VS Code) enabled. */
|
|
69
|
-
withAiIntegrationsEnabled(): LanguageSetting;
|
|
70
|
-
toLanguageSettingData(): LanguageSettingData;
|
|
71
|
-
}
|
|
72
|
-
export declare class PortalSettings {
|
|
73
|
-
private readonly data;
|
|
74
|
-
private constructor();
|
|
75
|
-
static from(data?: PortalSettingsData): PortalSettings;
|
|
76
|
-
/** Returns a copy with the API-call base URL set. */
|
|
77
|
-
withBaseUrl(baseUrl: UrlPath): PortalSettings;
|
|
78
|
-
withAiIntegrations(languages: string[]): PortalSettings;
|
|
79
|
-
toPortalSettingsData(): PortalSettingsData;
|
|
80
|
-
}
|
|
81
6
|
export declare class BuildConfig {
|
|
82
7
|
private readonly data;
|
|
83
8
|
private constructor();
|
|
84
9
|
static parse(json: string): BuildConfig;
|
|
85
10
|
static from(data: BuildConfigData): BuildConfig;
|
|
86
11
|
toJSON(): BuildConfigData;
|
|
87
|
-
/** Content directory for the portal, relative to the build directory. Defaults to "content". */
|
|
88
|
-
contentFolder(): string;
|
|
89
|
-
/** True when this build produces a multi-versioned portal. */
|
|
90
12
|
isVersioned(): boolean;
|
|
91
|
-
/** Directory holding the versioned
|
|
13
|
+
/** Directory holding the versioned builds, relative to the source directory. Defaults to "versioned_docs". */
|
|
92
14
|
versionsPath(): string;
|
|
93
|
-
/** True when API Copilot is already configured for this build. */
|
|
94
|
-
hasApiCopilot(): boolean;
|
|
95
|
-
hasAiIntegration(): boolean;
|
|
96
|
-
/** Returns a copy with the portal's languageConfig set from the selected friendly language ids. */
|
|
97
|
-
withPortalLanguages(languages: string[]): BuildConfig;
|
|
98
|
-
/** Returns a copy with the API Copilot configuration set (or overwritten). */
|
|
99
|
-
withApiCopilotConfig(config: CopilotConfig): BuildConfig;
|
|
100
|
-
withApiCopilotForPortal(key: string, welcomeMessage: string, baseUrl: UrlPath): BuildConfig;
|
|
101
|
-
updateBuildConfigBaseUrl(serveUrl: UrlPath): BuildConfig;
|
|
102
|
-
withRecipeWorkflow(name: string, functionName: string, scriptPath: string): BuildConfig;
|
|
103
15
|
}
|
package/lib/types/build/build.js
CHANGED
|
@@ -1,88 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
config[lang] = {};
|
|
5
|
-
return config;
|
|
6
|
-
}, {});
|
|
7
|
-
}
|
|
8
|
-
// Maps the CLI's friendly language identifiers (used as languageConfig keys) to
|
|
9
|
-
// codegen's SupportedTemplates ids, which is what portalSettings.languageSettings
|
|
10
|
-
// must be keyed by (codegen resolves these via SdkLanguage.FromSupportedTemplate).
|
|
11
|
-
// These ids are version-specific in codegen (e.g. php_generic_lib_v2) — keep in sync
|
|
12
|
-
// with APIMatic.CodeGen.Common.SdkLanguage.
|
|
13
|
-
const CODEGEN_TEMPLATE_ID_BY_LANGUAGE = {
|
|
14
|
-
typescript: "ts_generic_lib",
|
|
15
|
-
csharp: "cs_net_standard_lib",
|
|
16
|
-
java: "java_eclipse_jre_lib",
|
|
17
|
-
php: "php_generic_lib_v2",
|
|
18
|
-
python: "python_generic_lib",
|
|
19
|
-
ruby: "ruby_generic_lib",
|
|
20
|
-
go: "go_generic_lib"
|
|
21
|
-
};
|
|
22
|
-
// codegen derives initialPlatform from languageConfig (http is always first), so a
|
|
23
|
-
// languageSettings entry for http must exist or the portal widget fails to render.
|
|
24
|
-
const HTTP_TEMPLATE_ID = "http_curl_v1";
|
|
25
|
-
// Immutable per-language portal setting. Build new values via the static factory and
|
|
26
|
-
// the with* transforms; the wrapped data is never mutated after construction.
|
|
27
|
-
export class LanguageSetting {
|
|
28
|
-
constructor(data) {
|
|
29
|
-
this.data = data;
|
|
30
|
-
}
|
|
31
|
-
static from(data = {}) {
|
|
32
|
-
return new LanguageSetting(data);
|
|
33
|
-
}
|
|
34
|
-
/** Returns a copy with all AI editor integrations (Cursor/Claude Code/VS Code) enabled. */
|
|
35
|
-
withAiIntegrationsEnabled() {
|
|
36
|
-
return new LanguageSetting(Object.assign(Object.assign({}, this.data), { aiIntegration: {
|
|
37
|
-
cursor: { isEnabled: true },
|
|
38
|
-
claudeCode: { isEnabled: true },
|
|
39
|
-
vscode: { isEnabled: true }
|
|
40
|
-
} }));
|
|
41
|
-
}
|
|
42
|
-
toLanguageSettingData() {
|
|
43
|
-
return this.data;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Immutable portal UI settings. Build new values via the static factory and the with*
|
|
47
|
-
// transforms; the wrapped data is never mutated after construction.
|
|
48
|
-
export class PortalSettings {
|
|
49
|
-
constructor(data) {
|
|
50
|
-
this.data = data;
|
|
51
|
-
}
|
|
52
|
-
static from(data = {}) {
|
|
53
|
-
return new PortalSettings(data);
|
|
54
|
-
}
|
|
55
|
-
/** Returns a copy with the API-call base URL set. */
|
|
56
|
-
withBaseUrl(baseUrl) {
|
|
57
|
-
return new PortalSettings(Object.assign(Object.assign({}, this.data), { baseUrl: baseUrl.toString() }));
|
|
58
|
-
}
|
|
59
|
-
// Returns a copy with AI editor integrations enabled for the given SDK languages
|
|
60
|
-
// (friendly ids). Always adds the http entry the portal needs to render and opens the
|
|
61
|
-
// portal on the first SDK language. Languages without a codegen template id are skipped.
|
|
62
|
-
withAiIntegrations(languages) {
|
|
63
|
-
var _a;
|
|
64
|
-
const languageSettings = Object.assign({}, this.data.languageSettings);
|
|
65
|
-
languageSettings[HTTP_TEMPLATE_ID] = (_a = languageSettings[HTTP_TEMPLATE_ID]) !== null && _a !== void 0 ? _a : {};
|
|
66
|
-
let firstSdkTemplateId;
|
|
67
|
-
for (const language of languages) {
|
|
68
|
-
const templateId = CODEGEN_TEMPLATE_ID_BY_LANGUAGE[language];
|
|
69
|
-
if (!templateId) {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
firstSdkTemplateId !== null && firstSdkTemplateId !== void 0 ? firstSdkTemplateId : (firstSdkTemplateId = templateId);
|
|
73
|
-
languageSettings[templateId] = LanguageSetting.from(languageSettings[templateId]).withAiIntegrationsEnabled().toLanguageSettingData();
|
|
74
|
-
}
|
|
75
|
-
return new PortalSettings(Object.assign(Object.assign(Object.assign({}, this.data), { languageSettings }), (firstSdkTemplateId ? { initialPlatform: firstSdkTemplateId } : {})));
|
|
76
|
-
}
|
|
77
|
-
toPortalSettingsData() {
|
|
78
|
-
return this.data;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
// Immutable wrapper around the parsed APIMATIC-BUILD.json. All build-config reads go
|
|
82
|
-
// through accessor methods and all changes go through with*/update methods that
|
|
83
|
-
// return a NEW BuildConfig — the wrapped data is never mutated after construction.
|
|
84
|
-
// Construct via `BuildConfig.parse`; persist via `BuildContext`.
|
|
1
|
+
// Immutable wrapper around the parsed APIMATIC-BUILD.json. Since version 2 the portal is
|
|
2
|
+
// configured by `src/apimatic.json` and built locally, so this file only describes SDK and
|
|
3
|
+
// plugin generation.
|
|
85
4
|
export class BuildConfig {
|
|
5
|
+
data;
|
|
86
6
|
constructor(data) {
|
|
87
7
|
this.data = data;
|
|
88
8
|
}
|
|
@@ -96,87 +16,12 @@ export class BuildConfig {
|
|
|
96
16
|
toJSON() {
|
|
97
17
|
return this.data;
|
|
98
18
|
}
|
|
99
|
-
/** Content directory for the portal, relative to the build directory. Defaults to "content". */
|
|
100
|
-
contentFolder() {
|
|
101
|
-
var _a, _b;
|
|
102
|
-
return (_b = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.contentFolder) !== null && _b !== void 0 ? _b : "content";
|
|
103
|
-
}
|
|
104
|
-
/** True when this build produces a multi-versioned portal. */
|
|
105
19
|
isVersioned() {
|
|
106
20
|
return this.data.generateVersionedPortal != null;
|
|
107
21
|
}
|
|
108
|
-
/** Directory holding the versioned
|
|
22
|
+
/** Directory holding the versioned builds, relative to the source directory. Defaults to "versioned_docs". */
|
|
109
23
|
versionsPath() {
|
|
110
|
-
|
|
111
|
-
return (_a = this.data.versionsPath) !== null && _a !== void 0 ? _a : "versioned_docs";
|
|
112
|
-
}
|
|
113
|
-
/** True when API Copilot is already configured for this build. */
|
|
114
|
-
hasApiCopilot() {
|
|
115
|
-
return this.data.apiCopilotConfig != null;
|
|
116
|
-
}
|
|
117
|
-
// True when at least one language has an AI editor integration (Context Plugin)
|
|
118
|
-
// enabled in the portal settings. AI integration cannot exist without Copilot, but
|
|
119
|
-
// Copilot can be present with AI integration disabled — so this is a distinct check.
|
|
120
|
-
hasAiIntegration() {
|
|
121
|
-
var _a, _b;
|
|
122
|
-
const languageSettings = (_b = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.portalSettings) === null || _b === void 0 ? void 0 : _b.languageSettings;
|
|
123
|
-
if (!languageSettings) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
return Object.values(languageSettings).some((setting) => {
|
|
127
|
-
const ai = setting.aiIntegration;
|
|
128
|
-
return ai != null && [ai.cursor, ai.claudeCode, ai.vscode].some((editor) => (editor === null || editor === void 0 ? void 0 : editor.isEnabled) === true);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/** Returns a copy with the portal's languageConfig set from the selected friendly language ids. */
|
|
132
|
-
withPortalLanguages(languages) {
|
|
133
|
-
const portal = this.data.generatePortal;
|
|
134
|
-
return new BuildConfig(Object.assign(Object.assign({}, this.data), { generatePortal: Object.assign(Object.assign({}, portal), { languageConfig: getLanguagesConfig(languages) }) }));
|
|
135
|
-
}
|
|
136
|
-
/** Returns a copy with the API Copilot configuration set (or overwritten). */
|
|
137
|
-
withApiCopilotConfig(config) {
|
|
138
|
-
return new BuildConfig(Object.assign(Object.assign({}, this.data), { apiCopilotConfig: Object.assign({}, config) }));
|
|
139
|
-
}
|
|
140
|
-
// Returns a copy with API Copilot enabled for a locally-served portal: stores the
|
|
141
|
-
// Copilot config, points the portal base URL at the local serve URL, and turns on AI
|
|
142
|
-
// editor integrations for the configured SDK languages.
|
|
143
|
-
withApiCopilotForPortal(key, welcomeMessage, baseUrl) {
|
|
144
|
-
const portal = this.data.generatePortal;
|
|
145
|
-
return new BuildConfig(Object.assign(Object.assign({}, this.data), { apiCopilotConfig: { isEnabled: true, key, welcomeMessage }, generatePortal: Object.assign(Object.assign({}, portal), { baseUrl: baseUrl.toString(), portalSettings: PortalSettings.from(portal.portalSettings)
|
|
146
|
-
.withAiIntegrations(Object.keys(portal.languageConfig))
|
|
147
|
-
.toPortalSettingsData() }) }));
|
|
148
|
-
}
|
|
149
|
-
// Returns a copy with the portal base URL repointed at the serve URL, or `this`
|
|
150
|
-
// unchanged when there's no localhost base URL to rewrite (or it already matches the
|
|
151
|
-
// serve URL). Callers detect a change via reference identity: `result !== original`.
|
|
152
|
-
updateBuildConfigBaseUrl(serveUrl) {
|
|
153
|
-
var _a, _b, _c, _d;
|
|
154
|
-
// `portalSettings.baseUrl` is preferred for portal artifacts; otherwise fall back
|
|
155
|
-
// to `generatePortal.baseUrl`. Mirrors how codegen resolves the base URL.
|
|
156
|
-
const portalSettings = (_a = this.data.generatePortal) === null || _a === void 0 ? void 0 : _a.portalSettings;
|
|
157
|
-
const baseUrl = (_b = portalSettings === null || portalSettings === void 0 ? void 0 : portalSettings.baseUrl) !== null && _b !== void 0 ? _b : (_c = this.data.generatePortal) === null || _c === void 0 ? void 0 : _c.baseUrl;
|
|
158
|
-
if (!baseUrl) {
|
|
159
|
-
return this;
|
|
160
|
-
}
|
|
161
|
-
const parsedUrl = UrlPath.create(baseUrl);
|
|
162
|
-
if (!(parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.isLocalhost()) || parsedUrl.isEqual(serveUrl)) {
|
|
163
|
-
return this;
|
|
164
|
-
}
|
|
165
|
-
const portal = this.data.generatePortal;
|
|
166
|
-
const updatedPortal = ((_d = portal.portalSettings) === null || _d === void 0 ? void 0 : _d.baseUrl)
|
|
167
|
-
? Object.assign(Object.assign({}, portal), { portalSettings: PortalSettings.from(portal.portalSettings).withBaseUrl(serveUrl).toPortalSettingsData() }) : Object.assign(Object.assign({}, portal), { baseUrl: serveUrl.toString() });
|
|
168
|
-
return new BuildConfig(Object.assign(Object.assign({}, this.data), { generatePortal: updatedPortal }));
|
|
169
|
-
}
|
|
170
|
-
// Returns a copy with a recipe workflow added (or replaced, matched by permalink).
|
|
171
|
-
withRecipeWorkflow(name, functionName, scriptPath) {
|
|
172
|
-
var _a, _b;
|
|
173
|
-
const recipes = (_a = this.data.recipes) !== null && _a !== void 0 ? _a : {};
|
|
174
|
-
const workflows = (_b = recipes.workflows) !== null && _b !== void 0 ? _b : [];
|
|
175
|
-
const permalink = `page:recipes/${functionName}`;
|
|
176
|
-
const workflow = { name, permalink, functionName, scriptPath };
|
|
177
|
-
const existingIndex = workflows.findIndex((w) => w.permalink === permalink);
|
|
178
|
-
const updatedWorkflows = existingIndex === -1 ? [...workflows, workflow] : workflows.map((w, index) => (index === existingIndex ? workflow : w));
|
|
179
|
-
return new BuildConfig(Object.assign(Object.assign({}, this.data), { recipes: Object.assign(Object.assign({}, recipes), { workflows: updatedWorkflows }) }));
|
|
24
|
+
return this.data.versionsPath ?? 'versioned_docs';
|
|
180
25
|
}
|
|
181
26
|
}
|
|
182
27
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/types/build/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/types/build/build.ts"],"names":[],"mappings":"AAMA,yFAAyF;AACzF,2FAA2F;AAC3F,qBAAqB;AACrB,MAAM,OAAO,WAAW;IACe,IAAI;IAAzC,YAAqC,IAAqB;oBAArB,IAAI;IAAoB,CAAC;IAEvD,MAAM,CAAC,KAAK,CAAC,IAAY;QAC9B,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAoB,CAAC,CAAC;IAC/D,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,IAAqB;QACtC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,+EAA+E;IACxE,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC;IACnD,CAAC;IAED,8GAA8G;IACvG,YAAY;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,gBAAgB,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/types/events/domain-event.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,WAAW;
|
|
1
|
+
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/types/events/domain-event.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,WAAW;IAEd,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,KAAK,CAAW;IAEjC,YAAsB,OAAe,EAAE,WAAmB,EAAE,KAA8B;QACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,eAAe,CAAC,KAA8B;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DomainEvent } from "./domain-event.js";
|
|
2
2
|
export class QuickstartCompletedEvent extends DomainEvent {
|
|
3
|
+
eventName = QuickstartCompletedEvent.name;
|
|
4
|
+
static message = "Quickstart completed.";
|
|
5
|
+
static commandName = "quickstart";
|
|
3
6
|
constructor() {
|
|
4
7
|
super(QuickstartCompletedEvent.message, QuickstartCompletedEvent.commandName, {});
|
|
5
|
-
this.eventName = QuickstartCompletedEvent.name;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
QuickstartCompletedEvent.message = "Quickstart completed.";
|
|
9
|
-
QuickstartCompletedEvent.commandName = "quickstart";
|
|
10
10
|
//# sourceMappingURL=quickstart-completed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickstart-completed.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"quickstart-completed.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACpC,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IACrD,MAAM,CAAU,OAAO,GAAG,uBAAgC,CAAC;IAC3D,MAAM,CAAU,WAAW,GAAG,YAAqB,CAAC;IAE5D;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DomainEvent } from "./domain-event.js";
|
|
2
2
|
export class QuickstartInitiatedEvent extends DomainEvent {
|
|
3
|
+
eventName = QuickstartInitiatedEvent.name;
|
|
4
|
+
static message = "Quickstart initiated.";
|
|
5
|
+
static commandName = "quickstart";
|
|
3
6
|
constructor() {
|
|
4
7
|
super(QuickstartInitiatedEvent.message, QuickstartInitiatedEvent.commandName, {});
|
|
5
|
-
this.eventName = QuickstartInitiatedEvent.name;
|
|
6
8
|
}
|
|
7
9
|
}
|
|
8
|
-
QuickstartInitiatedEvent.message = "Quickstart initiated.";
|
|
9
|
-
QuickstartInitiatedEvent.commandName = "quickstart";
|
|
10
10
|
//# sourceMappingURL=quickstart-initiated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quickstart-initiated.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-initiated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"quickstart-initiated.js","sourceRoot":"","sources":["../../../src/types/events/quickstart-initiated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACpC,SAAS,GAAG,wBAAwB,CAAC,IAAI,CAAC;IACrD,MAAM,CAAU,OAAO,GAAG,uBAAgC,CAAC;IAC3D,MAAM,CAAU,WAAW,GAAG,YAAqB,CAAC;IAE5D;QACE,KAAK,CAAC,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACpF,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DomainEvent } from './domain-event.js';
|
|
2
2
|
export class SdkPublishValidationFailedEvent extends DomainEvent {
|
|
3
|
+
eventName = SdkPublishValidationFailedEvent.name;
|
|
3
4
|
constructor(message, commandName, flags) {
|
|
4
5
|
super(message, commandName, flags);
|
|
5
|
-
this.eventName = SdkPublishValidationFailedEvent.name;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=sdk-publish-validation-failed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-publish-validation-failed.js","sourceRoot":"","sources":["../../../src/types/events/sdk-publish-validation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,+BAAgC,SAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"sdk-publish-validation-failed.js","sourceRoot":"","sources":["../../../src/types/events/sdk-publish-validation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,+BAAgC,SAAQ,WAAW;IAC3C,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;IAEpE,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { FileName } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { TreeNode } from "../../prompts/format.js";
|
|
1
|
+
import { DirectoryPath } from './directoryPath.js';
|
|
2
|
+
import { FileName } from './fileName.js';
|
|
3
|
+
import { FilePath } from './filePath.js';
|
|
4
|
+
import { TreeNode } from '../../prompts/format.js';
|
|
6
5
|
export type FileItem = {
|
|
7
6
|
fileName: FileName;
|
|
8
7
|
description?: string;
|
|
@@ -11,7 +10,6 @@ export type DirectoryItem = FileItem | Directory;
|
|
|
11
10
|
export declare class Directory {
|
|
12
11
|
readonly directoryPath: DirectoryPath;
|
|
13
12
|
readonly items: DirectoryItem[];
|
|
14
|
-
private readonly fileService;
|
|
15
13
|
constructor(directoryPath: DirectoryPath, filePaths: DirectoryItem[]);
|
|
16
14
|
private static readonly folderDescriptions;
|
|
17
15
|
private static readonly fileDescriptions;
|
|
@@ -22,8 +20,5 @@ export declare class Directory {
|
|
|
22
20
|
countFiles(): number;
|
|
23
21
|
countDirectories(): number;
|
|
24
22
|
getAllFiles(): FilePath[];
|
|
25
|
-
parseContentFolder(baseContentPath: DirectoryPath): Promise<TocGroup[]>;
|
|
26
|
-
private getPageName;
|
|
27
|
-
private isRootContentDirectory;
|
|
28
23
|
static createFromRelativePaths(rootDir: DirectoryPath, fileItems: FileItem[]): Directory;
|
|
29
24
|
}
|