@apimatic/cli 1.5.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -212
- package/apimatic.schema.json +550 -0
- package/lib/actions/action-result.js +3 -0
- package/lib/actions/action-result.js.map +1 -1
- package/lib/actions/api/transform.js +36 -33
- package/lib/actions/api/transform.js.map +1 -1
- package/lib/actions/api/validate.d.ts +9 -6
- package/lib/actions/api/validate.js +44 -38
- package/lib/actions/api/validate.js.map +1 -1
- package/lib/actions/auth/login.js +7 -4
- package/lib/actions/auth/login.js.map +1 -1
- package/lib/actions/auth/logout.js +2 -1
- package/lib/actions/auth/logout.js.map +1 -1
- package/lib/actions/auth/status.js +5 -3
- package/lib/actions/auth/status.js.map +1 -1
- package/lib/actions/plugin/generate.d.ts +5 -1
- package/lib/actions/plugin/generate.js +83 -56
- package/lib/actions/plugin/generate.js.map +1 -1
- package/lib/actions/plugin/publish.d.ts +2 -1
- package/lib/actions/plugin/publish.js +34 -37
- package/lib/actions/plugin/publish.js.map +1 -1
- package/lib/actions/plugin/record-metadata.d.ts +3 -2
- package/lib/actions/plugin/record-metadata.js +33 -30
- package/lib/actions/plugin/record-metadata.js.map +1 -1
- package/lib/actions/portal/generate.d.ts +8 -6
- package/lib/actions/portal/generate.js +50 -61
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/prepare-project.d.ts +25 -0
- package/lib/actions/portal/prepare-project.js +68 -0
- package/lib/actions/portal/prepare-project.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +21 -6
- package/lib/actions/portal/serve.js +170 -153
- package/lib/actions/portal/serve.js.map +1 -1
- package/lib/actions/publishing/profile/list.js +4 -2
- package/lib/actions/publishing/profile/list.js.map +1 -1
- package/lib/actions/quickstart.d.ts +23 -5
- package/lib/actions/quickstart.js +221 -21
- package/lib/actions/quickstart.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +4 -7
- package/lib/actions/sdk/generate.js +53 -93
- package/lib/actions/sdk/generate.js.map +1 -1
- package/lib/actions/sdk/publish/interactive.d.ts +4 -3
- package/lib/actions/sdk/publish/interactive.js +96 -97
- package/lib/actions/sdk/publish/interactive.js.map +1 -1
- package/lib/actions/sdk/publish/non-interactive.d.ts +4 -2
- package/lib/actions/sdk/publish/non-interactive.js +91 -90
- package/lib/actions/sdk/publish/non-interactive.js.map +1 -1
- package/lib/actions/sdk/publish.d.ts +3 -2
- package/lib/actions/sdk/publish.js +55 -53
- package/lib/actions/sdk/publish.js.map +1 -1
- package/lib/actions/sdk/record-published-sdk.d.ts +14 -0
- package/lib/actions/sdk/record-published-sdk.js +57 -0
- package/lib/actions/sdk/record-published-sdk.js.map +1 -0
- package/lib/client-utils/auth-manager.js +1 -1
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/commands/api/transform.d.ts +1 -1
- package/lib/commands/api/transform.js +44 -40
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.js +16 -16
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.js +14 -15
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.js +5 -6
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.js +4 -5
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/plugin/generate.d.ts +3 -3
- package/lib/commands/plugin/generate.js +20 -20
- package/lib/commands/plugin/generate.js.map +1 -1
- package/lib/commands/plugin/publish.js +18 -18
- package/lib/commands/plugin/publish.js.map +1 -1
- package/lib/commands/portal/generate.d.ts +9 -8
- package/lib/commands/portal/generate.js +36 -27
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +7 -9
- package/lib/commands/portal/serve.js +41 -44
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/publishing/profile/list.js +8 -12
- package/lib/commands/publishing/profile/list.js.map +1 -1
- package/lib/commands/quickstart.d.ts +5 -5
- package/lib/commands/quickstart.js +18 -24
- package/lib/commands/quickstart.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +5 -7
- package/lib/commands/sdk/generate.js +58 -70
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/commands/sdk/publish.d.ts +6 -7
- package/lib/commands/sdk/publish.js +66 -60
- package/lib/commands/sdk/publish.js.map +1 -1
- package/lib/hooks/node-version.d.ts +3 -0
- package/lib/hooks/node-version.js +12 -0
- package/lib/hooks/node-version.js.map +1 -0
- package/lib/hooks/not-found.js +2 -3
- package/lib/hooks/not-found.js.map +1 -1
- package/lib/hooks/utils.d.ts +4 -2
- package/lib/hooks/utils.js +2 -2
- package/lib/hooks/utils.js.map +1 -1
- package/lib/infrastructure/env-info.d.ts +3 -0
- package/lib/infrastructure/env-info.js +13 -6
- package/lib/infrastructure/env-info.js.map +1 -1
- package/lib/infrastructure/file-service.d.ts +35 -8
- package/lib/infrastructure/file-service.js +149 -53
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/file-watch-service.d.ts +40 -0
- package/lib/infrastructure/file-watch-service.js +167 -0
- package/lib/infrastructure/file-watch-service.js.map +1 -0
- package/lib/infrastructure/generation-status-poller.d.ts +8 -7
- package/lib/infrastructure/generation-status-poller.js +20 -12
- package/lib/infrastructure/generation-status-poller.js.map +1 -1
- package/lib/infrastructure/launcher-service.js +6 -6
- package/lib/infrastructure/launcher-service.js.map +1 -1
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +15 -1
- package/lib/infrastructure/network-service.js.map +1 -1
- package/lib/infrastructure/portal-build-service.d.ts +19 -0
- package/lib/infrastructure/portal-build-service.js +58 -0
- package/lib/infrastructure/portal-build-service.js.map +1 -0
- package/lib/infrastructure/portal-dev-server-service.d.ts +29 -0
- package/lib/infrastructure/portal-dev-server-service.js +135 -0
- package/lib/infrastructure/portal-dev-server-service.js.map +1 -0
- package/lib/infrastructure/portal-pages-service.d.ts +17 -0
- package/lib/infrastructure/portal-pages-service.js +103 -0
- package/lib/infrastructure/portal-pages-service.js.map +1 -0
- package/lib/infrastructure/portal-project-service.d.ts +77 -0
- package/lib/infrastructure/portal-project-service.js +309 -0
- package/lib/infrastructure/portal-project-service.js.map +1 -0
- package/lib/infrastructure/service-error.d.ts +1 -0
- package/lib/infrastructure/service-error.js +39 -41
- package/lib/infrastructure/service-error.js.map +1 -1
- package/lib/infrastructure/services/api-client-factory.js +15 -13
- package/lib/infrastructure/services/api-client-factory.js.map +1 -1
- package/lib/infrastructure/services/api-service.d.ts +7 -5
- package/lib/infrastructure/services/api-service.js +28 -20
- package/lib/infrastructure/services/api-service.js.map +1 -1
- package/lib/infrastructure/services/auth-service.js +4 -9
- package/lib/infrastructure/services/auth-service.js.map +1 -1
- package/lib/infrastructure/services/file-download-service.js +3 -3
- package/lib/infrastructure/services/file-download-service.js.map +1 -1
- package/lib/infrastructure/services/plugin-service.d.ts +1 -8
- package/lib/infrastructure/services/plugin-service.js +11 -22
- package/lib/infrastructure/services/plugin-service.js.map +1 -1
- package/lib/infrastructure/services/portal-artifacts-service.d.ts +44 -0
- package/lib/infrastructure/services/portal-artifacts-service.js +268 -0
- package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -0
- package/lib/infrastructure/services/portal-authorization-service.d.ts +22 -0
- package/lib/infrastructure/services/portal-authorization-service.js +23 -0
- package/lib/infrastructure/services/portal-authorization-service.js.map +1 -0
- package/lib/infrastructure/services/publishing-api-service.d.ts +1 -1
- package/lib/infrastructure/services/publishing-api-service.js +11 -15
- package/lib/infrastructure/services/publishing-api-service.js.map +1 -1
- package/lib/infrastructure/services/sdk-generation-service.d.ts +21 -0
- package/lib/infrastructure/services/sdk-generation-service.js +118 -0
- package/lib/infrastructure/services/sdk-generation-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.js +5 -4
- package/lib/infrastructure/services/telemetry-service.js.map +1 -1
- package/lib/infrastructure/services/transformation-service.js +29 -32
- package/lib/infrastructure/services/transformation-service.js.map +1 -1
- package/lib/infrastructure/services/validation-service.d.ts +12 -53
- package/lib/infrastructure/services/validation-service.js +24 -199
- package/lib/infrastructure/services/validation-service.js.map +1 -1
- package/lib/infrastructure/timer-extensions.d.ts +2 -0
- package/lib/infrastructure/timer-extensions.js +10 -0
- package/lib/infrastructure/timer-extensions.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +31 -1
- package/lib/infrastructure/tmp-extensions.js +86 -3
- package/lib/infrastructure/tmp-extensions.js.map +1 -1
- package/lib/infrastructure/zip-service.js +2 -2
- package/lib/infrastructure/zip-service.js.map +1 -1
- package/lib/prompts/api/validate.d.ts +6 -7
- package/lib/prompts/api/validate.js +12 -12
- package/lib/prompts/api/validate.js.map +1 -1
- package/lib/prompts/format.d.ts +4 -0
- package/lib/prompts/format.js +5 -0
- package/lib/prompts/format.js.map +1 -1
- package/lib/prompts/plugin/generate.d.ts +17 -12
- package/lib/prompts/plugin/generate.js +94 -44
- package/lib/prompts/plugin/generate.js.map +1 -1
- package/lib/prompts/plugin/publish.d.ts +2 -1
- package/lib/prompts/plugin/publish.js +8 -7
- package/lib/prompts/plugin/publish.js.map +1 -1
- package/lib/prompts/plugin/record-metadata.d.ts +1 -0
- package/lib/prompts/plugin/record-metadata.js +10 -7
- package/lib/prompts/plugin/record-metadata.js.map +1 -1
- package/lib/prompts/portal/artifacts.d.ts +8 -0
- package/lib/prompts/portal/artifacts.js +26 -0
- package/lib/prompts/portal/artifacts.js.map +1 -0
- package/lib/prompts/portal/authorization.d.ts +6 -0
- package/lib/prompts/portal/authorization.js +29 -0
- package/lib/prompts/portal/authorization.js.map +1 -0
- package/lib/prompts/portal/code-samples.d.ts +1 -0
- package/lib/prompts/portal/code-samples.js +9 -0
- package/lib/prompts/portal/code-samples.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +14 -9
- package/lib/prompts/portal/generate.js +48 -26
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/prepare-project.d.ts +20 -0
- package/lib/prompts/portal/prepare-project.js +36 -0
- package/lib/prompts/portal/prepare-project.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +32 -12
- package/lib/prompts/portal/serve.js +100 -39
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/source.d.ts +26 -0
- package/lib/prompts/portal/source.js +253 -0
- package/lib/prompts/portal/source.js.map +1 -0
- package/lib/prompts/prompt.d.ts +11 -3
- package/lib/prompts/prompt.js +39 -15
- package/lib/prompts/prompt.js.map +1 -1
- package/lib/prompts/quickstart.d.ts +46 -3
- package/lib/prompts/quickstart.js +193 -12
- package/lib/prompts/quickstart.js.map +1 -1
- package/lib/prompts/sdk/generate.d.ts +15 -13
- package/lib/prompts/sdk/generate.js +29 -32
- package/lib/prompts/sdk/generate.js.map +1 -1
- package/lib/prompts/sdk/publish/interactive.d.ts +10 -6
- package/lib/prompts/sdk/publish/interactive.js +26 -24
- package/lib/prompts/sdk/publish/interactive.js.map +1 -1
- package/lib/prompts/sdk/publish/non-interactive.d.ts +2 -1
- package/lib/prompts/sdk/publish/non-interactive.js +5 -4
- package/lib/prompts/sdk/publish/non-interactive.js.map +1 -1
- package/lib/prompts/sdk/publish.d.ts +3 -3
- package/lib/prompts/sdk/publish.js +13 -17
- package/lib/prompts/sdk/publish.js.map +1 -1
- package/lib/prompts/sdk/record-published-sdk.d.ts +7 -0
- package/lib/prompts/sdk/record-published-sdk.js +26 -0
- package/lib/prompts/sdk/record-published-sdk.js.map +1 -0
- package/lib/types/apimatic-config/document.d.ts +68 -0
- package/lib/types/apimatic-config/document.js +161 -0
- package/lib/types/apimatic-config/document.js.map +1 -0
- package/lib/types/apimatic-config/languages-block.d.ts +39 -0
- package/lib/types/apimatic-config/languages-block.js +58 -0
- package/lib/types/apimatic-config/languages-block.js.map +1 -0
- package/lib/types/apimatic-config-context.d.ts +48 -0
- package/lib/types/apimatic-config-context.js +121 -0
- package/lib/types/apimatic-config-context.js.map +1 -0
- package/lib/types/build/build.d.ts +1 -89
- package/lib/types/build/build.js +6 -161
- package/lib/types/build/build.js.map +1 -1
- package/lib/types/events/domain-event.js +3 -0
- package/lib/types/events/domain-event.js.map +1 -1
- package/lib/types/events/quickstart-completed.js +3 -3
- package/lib/types/events/quickstart-completed.js.map +1 -1
- package/lib/types/events/quickstart-initiated.js +3 -3
- package/lib/types/events/quickstart-initiated.js.map +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js +1 -1
- package/lib/types/events/sdk-publish-validation-failed.js.map +1 -1
- package/lib/types/file/directory.d.ts +4 -9
- package/lib/types/file/directory.js +17 -65
- package/lib/types/file/directory.js.map +1 -1
- package/lib/types/file/directoryPath.d.ts +17 -0
- package/lib/types/file/directoryPath.js +47 -2
- package/lib/types/file/directoryPath.js.map +1 -1
- package/lib/types/file/fileName.d.ts +8 -0
- package/lib/types/file/fileName.js +28 -6
- package/lib/types/file/fileName.js.map +1 -1
- package/lib/types/file/filePath.d.ts +18 -2
- package/lib/types/file/filePath.js +39 -4
- package/lib/types/file/filePath.js.map +1 -1
- package/lib/types/file/resource-input.js +1 -2
- package/lib/types/file/resource-input.js.map +1 -1
- package/lib/types/file/urlPath.js +2 -1
- package/lib/types/file/urlPath.js.map +1 -1
- package/lib/types/flags-provider.js +22 -22
- package/lib/types/flags-provider.js.map +1 -1
- package/lib/types/package-settings-context.js +2 -1
- package/lib/types/package-settings-context.js.map +1 -1
- package/lib/types/plugin/plugin-config.d.ts +10 -50
- package/lib/types/plugin/plugin-config.js +7 -1
- package/lib/types/plugin/plugin-config.js.map +1 -1
- package/lib/types/plugin-config-context.d.ts +30 -37
- package/lib/types/plugin-config-context.js +108 -139
- package/lib/types/plugin-config-context.js.map +1 -1
- package/lib/types/plugin-context.js +3 -2
- package/lib/types/plugin-context.js.map +1 -1
- package/lib/types/portal/code-samples.d.ts +27 -0
- package/lib/types/portal/code-samples.js +67 -0
- package/lib/types/portal/code-samples.js.map +1 -0
- package/lib/types/portal/config/ai-config.d.ts +15 -0
- package/lib/types/portal/config/ai-config.js +26 -0
- package/lib/types/portal/config/ai-config.js.map +1 -0
- package/lib/types/portal/config/brand-config.d.ts +55 -0
- package/lib/types/portal/config/brand-config.js +105 -0
- package/lib/types/portal/config/brand-config.js.map +1 -0
- package/lib/types/portal/config/color.d.ts +19 -0
- package/lib/types/portal/config/color.js +43 -0
- package/lib/types/portal/config/color.js.map +1 -0
- package/lib/types/portal/config/fields.d.ts +23 -0
- package/lib/types/portal/config/fields.js +67 -0
- package/lib/types/portal/config/fields.js.map +1 -0
- package/lib/types/portal/config/link.d.ts +18 -0
- package/lib/types/portal/config/link.js +72 -0
- package/lib/types/portal/config/link.js.map +1 -0
- package/lib/types/portal/config/navigation-config.d.ts +13 -0
- package/lib/types/portal/config/navigation-config.js +30 -0
- package/lib/types/portal/config/navigation-config.js.map +1 -0
- package/lib/types/portal/config/site-config.d.ts +32 -0
- package/lib/types/portal/config/site-config.js +88 -0
- package/lib/types/portal/config/site-config.js.map +1 -0
- package/lib/types/portal/config/static-asset.d.ts +25 -0
- package/lib/types/portal/config/static-asset.js +77 -0
- package/lib/types/portal/config/static-asset.js.map +1 -0
- package/lib/types/portal/content-notices.d.ts +20 -0
- package/lib/types/portal/content-notices.js +2 -0
- package/lib/types/portal/content-notices.js.map +1 -0
- package/lib/types/portal/content-tree.d.ts +103 -0
- package/lib/types/portal/content-tree.js +344 -0
- package/lib/types/portal/content-tree.js.map +1 -0
- package/lib/types/portal/endpoint.d.ts +6 -0
- package/lib/types/portal/endpoint.js +12 -0
- package/lib/types/portal/endpoint.js.map +1 -0
- package/lib/types/portal/generated-pages.d.ts +68 -0
- package/lib/types/portal/generated-pages.js +111 -0
- package/lib/types/portal/generated-pages.js.map +1 -0
- package/lib/types/portal/generation-status.d.ts +31 -0
- package/lib/types/portal/generation-status.js +26 -0
- package/lib/types/portal/generation-status.js.map +1 -0
- package/lib/types/portal/openapi-document.d.ts +48 -0
- package/lib/types/portal/openapi-document.js +138 -0
- package/lib/types/portal/openapi-document.js.map +1 -0
- package/lib/types/portal/page-fragments.d.ts +13 -0
- package/lib/types/portal/page-fragments.js +24 -0
- package/lib/types/portal/page-fragments.js.map +1 -0
- package/lib/types/portal/page-template.d.ts +15 -0
- package/lib/types/portal/page-template.js +64 -0
- package/lib/types/portal/page-template.js.map +1 -0
- package/lib/types/portal/page.d.ts +24 -0
- package/lib/types/portal/page.js +100 -0
- package/lib/types/portal/page.js.map +1 -0
- package/lib/types/portal/portal-artifacts.d.ts +25 -0
- package/lib/types/portal/portal-artifacts.js +30 -0
- package/lib/types/portal/portal-artifacts.js.map +1 -0
- package/lib/types/portal/portal-config.d.ts +69 -0
- package/lib/types/portal/portal-config.js +105 -0
- package/lib/types/portal/portal-config.js.map +1 -0
- package/lib/types/portal/portal-downloads.d.ts +8 -0
- package/lib/types/portal/portal-downloads.js +14 -0
- package/lib/types/portal/portal-downloads.js.map +1 -0
- package/lib/types/portal/portal-languages.d.ts +15 -0
- package/lib/types/portal/portal-languages.js +45 -0
- package/lib/types/portal/portal-languages.js.map +1 -0
- package/lib/types/portal/portal-navigation.d.ts +65 -0
- package/lib/types/portal/portal-navigation.js +217 -0
- package/lib/types/portal/portal-navigation.js.map +1 -0
- package/lib/types/portal/portal-sdk.d.ts +15 -0
- package/lib/types/portal/portal-sdk.js +28 -0
- package/lib/types/portal/portal-sdk.js.map +1 -0
- package/lib/types/portal/portal-source.d.ts +129 -0
- package/lib/types/portal/portal-source.js +2 -0
- package/lib/types/portal/portal-source.js.map +1 -0
- package/lib/types/portal/portal-stylesheet.d.ts +19 -0
- package/lib/types/portal/portal-stylesheet.js +40 -0
- package/lib/types/portal/portal-stylesheet.js.map +1 -0
- package/lib/types/portal/portal-tabs.d.ts +33 -0
- package/lib/types/portal/portal-tabs.js +38 -0
- package/lib/types/portal/portal-tabs.js.map +1 -0
- package/lib/types/portal/preview-config.d.ts +20 -0
- package/lib/types/portal/preview-config.js +32 -0
- package/lib/types/portal/preview-config.js.map +1 -0
- package/lib/types/portal/preview-content.d.ts +18 -0
- package/lib/types/portal/preview-content.js +50 -0
- package/lib/types/portal/preview-content.js.map +1 -0
- package/lib/types/portal/published-package.d.ts +12 -0
- package/lib/types/portal/published-package.js +35 -0
- package/lib/types/portal/published-package.js.map +1 -0
- package/lib/types/portal/unknown-fields.d.ts +5 -0
- package/lib/types/portal/unknown-fields.js +10 -0
- package/lib/types/portal/unknown-fields.js.map +1 -0
- package/lib/types/portal-context.d.ts +38 -6
- package/lib/types/portal-context.js +71 -24
- package/lib/types/portal-context.js.map +1 -1
- package/lib/types/portal-source-context.d.ts +77 -0
- package/lib/types/portal-source-context.js +408 -0
- package/lib/types/portal-source-context.js.map +1 -0
- package/lib/types/project-context.d.ts +49 -0
- package/lib/types/project-context.js +151 -0
- package/lib/types/project-context.js.map +1 -0
- package/lib/types/project-layout.d.ts +9 -0
- package/lib/types/project-layout.js +10 -0
- package/lib/types/project-layout.js.map +1 -0
- package/lib/types/publish/package-settings-configuration.d.ts +2 -0
- package/lib/types/publish/profile-id.js +1 -0
- package/lib/types/publish/profile-id.js.map +1 -1
- package/lib/types/publish/publishing-profile.d.ts +3 -1
- package/lib/types/publish/publishing-profile.js +33 -15
- package/lib/types/publish/publishing-profile.js.map +1 -1
- package/lib/types/publish/publishing-profiles.js +2 -1
- package/lib/types/publish/publishing-profiles.js.map +1 -1
- package/lib/types/publish/version.js +1 -0
- package/lib/types/publish/version.js.map +1 -1
- package/lib/types/resource-context.js +3 -2
- package/lib/types/resource-context.js.map +1 -1
- package/lib/types/sdk/generate.d.ts +22 -16
- package/lib/types/sdk/generate.js +64 -41
- package/lib/types/sdk/generate.js.map +1 -1
- package/lib/types/sdk/stability-choice.d.ts +12 -0
- package/lib/types/sdk/stability-choice.js +24 -0
- package/lib/types/sdk/stability-choice.js.map +1 -0
- package/lib/types/sdk-context.d.ts +4 -5
- package/lib/types/sdk-context.js +10 -18
- package/lib/types/sdk-context.js.map +1 -1
- package/lib/types/spec-context.d.ts +5 -4
- package/lib/types/spec-context.js +9 -8
- package/lib/types/spec-context.js.map +1 -1
- package/lib/types/temp-context.d.ts +1 -1
- package/lib/types/temp-context.js +5 -4
- package/lib/types/temp-context.js.map +1 -1
- package/lib/types/transform-context.d.ts +9 -5
- package/lib/types/transform-context.js +21 -18
- package/lib/types/transform-context.js.map +1 -1
- package/lib/utils/error-utils.d.ts +2 -0
- package/lib/utils/error-utils.js +5 -0
- package/lib/utils/error-utils.js.map +1 -0
- package/lib/utils/json-utils.d.ts +2 -0
- package/lib/utils/json-utils.js +4 -0
- package/lib/utils/json-utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +8 -1
- package/lib/utils/string-utils.js +13 -26
- package/lib/utils/string-utils.js.map +1 -1
- package/lib/utils/utils.d.ts +1 -3
- package/lib/utils/utils.js +12 -40
- package/lib/utils/utils.js.map +1 -1
- package/oclif.manifest.json +154 -442
- package/package.json +47 -25
- package/portal-pages/context-plugin.mdx +26 -0
- package/portal-pages/sdk.mdx +8 -0
- package/portal-pages/sdks.mdx +11 -0
- package/portal-template/NOTICE +37 -0
- package/portal-template/downloads.ts +41 -0
- package/portal-template/generated-pages-reload.ts +51 -0
- package/portal-template/package.json +11 -0
- package/portal-template/portal-config.ts +32 -0
- package/portal-template/prerender-pages.ts +81 -0
- package/portal-template/spec-reload.ts +26 -0
- package/portal-template/src/components/api-page.tsx +15 -0
- package/portal-template/src/components/code-block.tsx +9 -0
- package/portal-template/src/components/command-block.tsx +50 -0
- package/portal-template/src/components/example-layout.tsx +99 -0
- package/portal-template/src/components/logos.tsx +127 -0
- package/portal-template/src/components/mdx.tsx +28 -0
- package/portal-template/src/components/not-found.tsx +11 -0
- package/portal-template/src/components/plugin-install.tsx +22 -0
- package/portal-template/src/components/plugin-support.tsx +53 -0
- package/portal-template/src/components/sdk-actions.tsx +79 -0
- package/portal-template/src/components/sdk-cards.tsx +100 -0
- package/portal-template/src/components/search.tsx +41 -0
- package/portal-template/src/components/usage-tabs.tsx +92 -0
- package/portal-template/src/lib/code-samples.server.ts +40 -0
- package/portal-template/src/lib/code-samples.ts +43 -0
- package/portal-template/src/lib/code-titles.ts +29 -0
- package/portal-template/src/lib/install-command.ts +13 -0
- package/portal-template/src/lib/json.ts +5 -0
- package/portal-template/src/lib/layout.shared.tsx +41 -0
- package/portal-template/src/lib/layout.tsx +16 -0
- package/portal-template/src/lib/llms.server.ts +54 -0
- package/portal-template/src/lib/media-adapters.ts +34 -0
- package/portal-template/src/lib/navigation.ts +406 -0
- package/portal-template/src/lib/openapi-bundle.server.ts +343 -0
- package/portal-template/src/lib/openapi-filter.ts +191 -0
- package/portal-template/src/lib/openapi-labels.ts +15 -0
- package/portal-template/src/lib/openapi-methods.ts +12 -0
- package/portal-template/src/lib/openapi-section.server.ts +280 -0
- package/portal-template/src/lib/openapi-slim.ts +202 -0
- package/portal-template/src/lib/openapi.server.ts +16 -0
- package/portal-template/src/lib/portal-types.ts +36 -0
- package/portal-template/src/lib/portal.server.ts +13 -0
- package/portal-template/src/lib/portal.ts +11 -0
- package/portal-template/src/lib/rehype-code-titles.ts +53 -0
- package/portal-template/src/lib/request-examples.ts +72 -0
- package/portal-template/src/lib/seo.ts +21 -0
- package/portal-template/src/lib/shared.ts +51 -0
- package/portal-template/src/lib/shiki-bundle.ts +104 -0
- package/portal-template/src/lib/sitemap.server.ts +20 -0
- package/portal-template/src/lib/source.server.ts +27 -0
- package/portal-template/src/lib/source.ts +49 -0
- package/portal-template/src/lib/tabs.ts +37 -0
- package/portal-template/src/router.tsx +12 -0
- package/portal-template/src/routes/$.tsx +194 -0
- package/portal-template/src/routes/__root.tsx +56 -0
- package/portal-template/src/routes/api/search[.]json.ts +9 -0
- package/portal-template/src/routes/llms-full[.]txt.ts +10 -0
- package/portal-template/src/routes/llms[.]txt.ts +10 -0
- package/portal-template/src/routes/robots[.]txt.ts +10 -0
- package/portal-template/src/routes/sitemap[.]xml.ts +10 -0
- package/portal-template/src/routes/spa-shell.tsx +7 -0
- package/portal-template/src/routes/{$}[.]md.ts +21 -0
- package/portal-template/src/styles/app.css +33 -0
- package/portal-template/tsconfig.json +26 -0
- package/portal-template/vite.config.ts +68 -0
- package/lib/actions/plugin/record-sdk.d.ts +0 -14
- package/lib/actions/plugin/record-sdk.js +0 -60
- package/lib/actions/plugin/record-sdk.js.map +0 -1
- package/lib/actions/portal/copilot.d.ts +0 -17
- package/lib/actions/portal/copilot.js +0 -89
- package/lib/actions/portal/copilot.js.map +0 -1
- package/lib/actions/portal/quickstart.d.ts +0 -18
- package/lib/actions/portal/quickstart.js +0 -238
- package/lib/actions/portal/quickstart.js.map +0 -1
- package/lib/actions/portal/recipe/new-recipe.d.ts +0 -15
- package/lib/actions/portal/recipe/new-recipe.js +0 -177
- package/lib/actions/portal/recipe/new-recipe.js.map +0 -1
- package/lib/actions/portal/toc/new-toc.d.ts +0 -21
- package/lib/actions/portal/toc/new-toc.js +0 -95
- package/lib/actions/portal/toc/new-toc.js.map +0 -1
- package/lib/actions/sdk/merge-source-tree.d.ts +0 -12
- package/lib/actions/sdk/merge-source-tree.js +0 -78
- package/lib/actions/sdk/merge-source-tree.js.map +0 -1
- package/lib/actions/sdk/quickstart.d.ts +0 -18
- package/lib/actions/sdk/quickstart.js +0 -188
- package/lib/actions/sdk/quickstart.js.map +0 -1
- package/lib/actions/sdk/save-changes.d.ts +0 -8
- package/lib/actions/sdk/save-changes.js +0 -93
- package/lib/actions/sdk/save-changes.js.map +0 -1
- package/lib/application/portal/recipe/portal-recipe.d.ts +0 -8
- package/lib/application/portal/recipe/portal-recipe.js +0 -33
- package/lib/application/portal/recipe/portal-recipe.js.map +0 -1
- package/lib/application/portal/recipe/recipe-generator.d.ts +0 -21
- package/lib/application/portal/recipe/recipe-generator.js +0 -130
- package/lib/application/portal/recipe/recipe-generator.js.map +0 -1
- package/lib/application/portal/toc/toc-content-parser.d.ts +0 -5
- package/lib/application/portal/toc/toc-content-parser.js +0 -44
- package/lib/application/portal/toc/toc-content-parser.js.map +0 -1
- package/lib/application/portal/toc/toc-structure-generator.d.ts +0 -11
- package/lib/application/portal/toc/toc-structure-generator.js +0 -165
- package/lib/application/portal/toc/toc-structure-generator.js.map +0 -1
- package/lib/commands/portal/copilot.d.ts +0 -13
- package/lib/commands/portal/copilot.js +0 -34
- package/lib/commands/portal/copilot.js.map +0 -1
- package/lib/commands/portal/recipe/new.d.ts +0 -12
- package/lib/commands/portal/recipe/new.js +0 -45
- package/lib/commands/portal/recipe/new.js.map +0 -1
- package/lib/commands/portal/toc/new.d.ts +0 -16
- package/lib/commands/portal/toc/new.js +0 -68
- package/lib/commands/portal/toc/new.js.map +0 -1
- package/lib/commands/sdk/save-changes.d.ts +0 -14
- package/lib/commands/sdk/save-changes.js +0 -51
- package/lib/commands/sdk/save-changes.js.map +0 -1
- package/lib/infrastructure/debounce-service.d.ts +0 -10
- package/lib/infrastructure/debounce-service.js +0 -55
- package/lib/infrastructure/debounce-service.js.map +0 -1
- package/lib/infrastructure/services/portal-service.d.ts +0 -43
- package/lib/infrastructure/services/portal-service.js +0 -337
- package/lib/infrastructure/services/portal-service.js.map +0 -1
- package/lib/prompts/plugin/record-sdk.d.ts +0 -9
- package/lib/prompts/plugin/record-sdk.js +0 -40
- package/lib/prompts/plugin/record-sdk.js.map +0 -1
- package/lib/prompts/portal/copilot.d.ts +0 -18
- package/lib/prompts/portal/copilot.js +0 -82
- package/lib/prompts/portal/copilot.js.map +0 -1
- package/lib/prompts/portal/quickstart.d.ts +0 -42
- package/lib/prompts/portal/quickstart.js +0 -243
- package/lib/prompts/portal/quickstart.js.map +0 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +0 -29
- package/lib/prompts/portal/recipe/new-recipe.js +0 -165
- package/lib/prompts/portal/recipe/new-recipe.js.map +0 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +0 -16
- package/lib/prompts/portal/toc/new-toc.js +0 -50
- package/lib/prompts/portal/toc/new-toc.js.map +0 -1
- package/lib/prompts/sdk/merge-source-tree.d.ts +0 -22
- package/lib/prompts/sdk/merge-source-tree.js +0 -90
- package/lib/prompts/sdk/merge-source-tree.js.map +0 -1
- package/lib/prompts/sdk/quickstart.d.ts +0 -38
- package/lib/prompts/sdk/quickstart.js +0 -196
- package/lib/prompts/sdk/quickstart.js.map +0 -1
- package/lib/prompts/sdk/save-changes.d.ts +0 -21
- package/lib/prompts/sdk/save-changes.js +0 -84
- package/lib/prompts/sdk/save-changes.js.map +0 -1
- package/lib/types/build-context.d.ts +0 -26
- package/lib/types/build-context.js +0 -111
- package/lib/types/build-context.js.map +0 -1
- package/lib/types/events/recipe-creation-failed.d.ts +0 -5
- package/lib/types/events/recipe-creation-failed.js +0 -8
- package/lib/types/events/recipe-creation-failed.js.map +0 -1
- package/lib/types/events/sdk-changes-saved.d.ts +0 -8
- package/lib/types/events/sdk-changes-saved.js +0 -11
- package/lib/types/events/sdk-changes-saved.js.map +0 -1
- package/lib/types/events/sdk-changes-tracked.d.ts +0 -8
- package/lib/types/events/sdk-changes-tracked.js +0 -11
- package/lib/types/events/sdk-changes-tracked.js.map +0 -1
- package/lib/types/events/sdk-conflicts-resolved.d.ts +0 -8
- package/lib/types/events/sdk-conflicts-resolved.js +0 -11
- package/lib/types/events/sdk-conflicts-resolved.js.map +0 -1
- package/lib/types/events/toc-creation-failed.d.ts +0 -5
- package/lib/types/events/toc-creation-failed.js +0 -8
- package/lib/types/events/toc-creation-failed.js.map +0 -1
- package/lib/types/merge-source-tree-context.d.ts +0 -28
- package/lib/types/merge-source-tree-context.js +0 -63
- package/lib/types/merge-source-tree-context.js.map +0 -1
- package/lib/types/plugin/language-entry.d.ts +0 -9
- package/lib/types/plugin/language-entry.js +0 -64
- package/lib/types/plugin/language-entry.js.map +0 -1
- package/lib/types/recipe/recipe.d.ts +0 -22
- package/lib/types/recipe/recipe.js +0 -6
- package/lib/types/recipe/recipe.js.map +0 -1
- package/lib/types/recipe-context.d.ts +0 -9
- package/lib/types/recipe-context.js +0 -26
- package/lib/types/recipe-context.js.map +0 -1
- package/lib/types/save-changes-context.d.ts +0 -17
- package/lib/types/save-changes-context.js +0 -42
- package/lib/types/save-changes-context.js.map +0 -1
- package/lib/types/sdl/sdl.d.ts +0 -10
- package/lib/types/sdl/sdl.js +0 -18
- package/lib/types/sdl/sdl.js.map +0 -1
- package/lib/types/toc/toc-components.d.ts +0 -36
- package/lib/types/toc/toc-components.js +0 -94
- package/lib/types/toc/toc-components.js.map +0 -1
- package/lib/types/toc/toc.d.ts +0 -67
- package/lib/types/toc/toc.js +0 -2
- package/lib/types/toc/toc.js.map +0 -1
- package/lib/types/toc-context.d.ts +0 -12
- package/lib/types/toc-context.js +0 -26
- package/lib/types/toc-context.js.map +0 -1
|
@@ -8,9 +8,9 @@ export var Language;
|
|
|
8
8
|
Language["TYPESCRIPT"] = "typescript";
|
|
9
9
|
Language["GO"] = "go";
|
|
10
10
|
})(Language || (Language = {}));
|
|
11
|
+
/** An enum, not a constant, so the next generator is a line here and nothing else. */
|
|
11
12
|
export var CodeGenerationVersion;
|
|
12
13
|
(function (CodeGenerationVersion) {
|
|
13
|
-
CodeGenerationVersion["V3"] = "v3";
|
|
14
14
|
CodeGenerationVersion["V4"] = "v4";
|
|
15
15
|
})(CodeGenerationVersion || (CodeGenerationVersion = {}));
|
|
16
16
|
export var Stability;
|
|
@@ -25,70 +25,93 @@ const languageMap = {
|
|
|
25
25
|
8: Language.PHP,
|
|
26
26
|
16: Language.PYTHON,
|
|
27
27
|
32: Language.RUBY,
|
|
28
|
-
128: Language.TYPESCRIPT
|
|
28
|
+
128: Language.TYPESCRIPT
|
|
29
29
|
};
|
|
30
30
|
export function mapLanguages(languageFlag) {
|
|
31
31
|
return Object.entries(languageMap)
|
|
32
32
|
.filter(([flag]) => (languageFlag & parseInt(flag)) !== 0)
|
|
33
33
|
.map(([, language]) => language);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
export const LANGUAGE_NAMES = {
|
|
36
|
+
[Language.CSHARP]: 'C#',
|
|
37
|
+
[Language.GO]: 'Go',
|
|
38
|
+
[Language.JAVA]: 'Java',
|
|
39
|
+
[Language.PHP]: 'PHP',
|
|
40
|
+
[Language.PYTHON]: 'Python',
|
|
41
|
+
[Language.RUBY]: 'Ruby',
|
|
42
|
+
[Language.TYPESCRIPT]: 'TypeScript'
|
|
43
|
+
};
|
|
44
|
+
/** In display order, which `UPCOMING_LANGUAGES` inherits. */
|
|
41
45
|
export const LANGUAGE_CHOICES = [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
];
|
|
46
|
+
Language.TYPESCRIPT,
|
|
47
|
+
Language.RUBY,
|
|
48
|
+
Language.PYTHON,
|
|
49
|
+
Language.JAVA,
|
|
50
|
+
Language.CSHARP,
|
|
51
|
+
Language.PHP,
|
|
52
|
+
Language.GO
|
|
53
|
+
].map((value) => ({ label: LANGUAGE_NAMES[value], value }));
|
|
54
|
+
/** What each generator offers for a language. A language absent from it cannot be generated. */
|
|
50
55
|
export class CodegenOption {
|
|
56
|
+
version;
|
|
57
|
+
stability;
|
|
51
58
|
constructor(version, stability) {
|
|
52
59
|
this.version = version;
|
|
53
60
|
this.stability = stability;
|
|
54
61
|
}
|
|
55
62
|
static create(version, stability) {
|
|
56
|
-
if (version === CodeGenerationVersion.V3) {
|
|
57
|
-
return CodegenOption.v3;
|
|
58
|
-
}
|
|
59
63
|
return new CodegenOption(version, stability);
|
|
60
64
|
}
|
|
61
|
-
|
|
62
|
-
return this.version
|
|
63
|
-
}
|
|
64
|
-
isV4() {
|
|
65
|
-
return this.version === CodeGenerationVersion.V4;
|
|
65
|
+
codeGenerationVersion() {
|
|
66
|
+
return this.version;
|
|
66
67
|
}
|
|
67
68
|
stabilityLevel() {
|
|
68
69
|
return this.stability;
|
|
69
70
|
}
|
|
70
|
-
codeGenerationVersion() {
|
|
71
|
-
return this.version;
|
|
72
|
-
}
|
|
73
71
|
toString() {
|
|
74
72
|
return `${this.version.toUpperCase()} (${this.stability})`;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* For validating only interactive `sdk publish/generate` commands.
|
|
80
|
-
* Non-interactive validation is handled server-side by codegen API.
|
|
81
|
-
*/
|
|
75
|
+
/** The generator and level together, because neither is a choice the other can be made without. */
|
|
82
76
|
export const CODEGEN_OPTIONS = {
|
|
83
|
-
[Language.CSHARP]: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
[Language.
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
[Language.CSHARP]: [
|
|
78
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.STABLE),
|
|
79
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.BETA)
|
|
80
|
+
],
|
|
81
|
+
[Language.TYPESCRIPT]: [
|
|
82
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.STABLE),
|
|
83
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.BETA)
|
|
84
|
+
],
|
|
85
|
+
[Language.PYTHON]: [
|
|
86
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.STABLE),
|
|
87
|
+
CodegenOption.create(CodeGenerationVersion.V4, Stability.BETA)
|
|
88
|
+
]
|
|
90
89
|
};
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
/** The keys of the table above: a language is available exactly when something can generate it. */
|
|
91
|
+
export const AVAILABLE_LANGUAGES = Object.keys(CODEGEN_OPTIONS);
|
|
92
|
+
/** The rest of the enum, so a language cannot be named by both lists or by neither. */
|
|
93
|
+
export const UPCOMING_LANGUAGES = LANGUAGE_CHOICES.map((choice) => choice.value).filter((language) => !AVAILABLE_LANGUAGES.includes(language));
|
|
94
|
+
/** Takes a string because a config file names its own languages, and may name anything. */
|
|
95
|
+
export function isAvailableLanguage(language) {
|
|
96
|
+
return AVAILABLE_LANGUAGES.includes(language);
|
|
97
|
+
}
|
|
98
|
+
// The portal artifacts can be generated for these today; the rest of `Language` comes later.
|
|
99
|
+
export const PORTAL_LANGUAGES = [Language.CSHARP, Language.TYPESCRIPT, Language.PYTHON];
|
|
100
|
+
export function codegenOptionsFor(language) {
|
|
101
|
+
return CODEGEN_OPTIONS[language] ?? [];
|
|
102
|
+
}
|
|
103
|
+
export function stabilityLevelsFor(language) {
|
|
104
|
+
return codegenOptionsFor(language).map((option) => option.stabilityLevel());
|
|
105
|
+
}
|
|
106
|
+
/** What a flow that never asks sends: the first level a language offers. */
|
|
107
|
+
export function defaultStability(language) {
|
|
108
|
+
return stabilityLevelsFor(language)[0] ?? Stability.STABLE;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The name a language is shown under everywhere, so one reads the same in every message.
|
|
112
|
+
* Takes a string because a config file names its own languages, and may name anything.
|
|
113
|
+
*/
|
|
114
|
+
export function languageLabel(language) {
|
|
115
|
+
return LANGUAGE_NAMES[language] ?? language;
|
|
93
116
|
}
|
|
94
117
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,QAQX;AARD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,uBAAW,CAAA;IACX,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,qCAAyB,CAAA;IACzB,qBAAS,CAAA;AACX,CAAC,EARW,QAAQ,KAAR,QAAQ,QAQnB;AAED,sFAAsF;AACtF,MAAM,CAAN,IAAY,qBAEX;AAFD,WAAY,qBAAqB;IAC/B,kCAAS,CAAA;AACX,CAAC,EAFW,qBAAqB,KAArB,qBAAqB,QAEhC;AAED,MAAM,CAAN,IAAY,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AAS,CAAC,MAAM,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,cAAc,CAAC,QAAoB,CAAC,IAAI,QAAQ,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Language, Stability } from './generate.js';
|
|
2
|
+
/** The level a run generates at, and whether the caller named it or took what the language offers. */
|
|
3
|
+
export declare class StabilityChoice {
|
|
4
|
+
private readonly level;
|
|
5
|
+
private readonly chosen;
|
|
6
|
+
private constructor();
|
|
7
|
+
/** An absent flag is not a level: what the language offers first is what an unasked run sends. */
|
|
8
|
+
static for(language: Language, flagValue: string | undefined): StabilityChoice;
|
|
9
|
+
stabilityLevel(): Stability;
|
|
10
|
+
/** The publishing summary names the level only when it was asked for. */
|
|
11
|
+
chosenLevel(): Stability | undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defaultStability } from './generate.js';
|
|
2
|
+
/** The level a run generates at, and whether the caller named it or took what the language offers. */
|
|
3
|
+
export class StabilityChoice {
|
|
4
|
+
level;
|
|
5
|
+
chosen;
|
|
6
|
+
constructor(level, chosen) {
|
|
7
|
+
this.level = level;
|
|
8
|
+
this.chosen = chosen;
|
|
9
|
+
}
|
|
10
|
+
/** An absent flag is not a level: what the language offers first is what an unasked run sends. */
|
|
11
|
+
static for(language, flagValue) {
|
|
12
|
+
return flagValue === undefined
|
|
13
|
+
? new StabilityChoice(defaultStability(language), false)
|
|
14
|
+
: new StabilityChoice(flagValue, true);
|
|
15
|
+
}
|
|
16
|
+
stabilityLevel() {
|
|
17
|
+
return this.level;
|
|
18
|
+
}
|
|
19
|
+
/** The publishing summary names the level only when it was asked for. */
|
|
20
|
+
chosenLevel() {
|
|
21
|
+
return this.chosen ? this.level : undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=stability-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stability-choice.js","sourceRoot":"","sources":["../../../src/types/sdk/stability-choice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,eAAe,CAAC;AAEtE,sGAAsG;AACtG,MAAM,OAAO,eAAe;IACW,KAAK;IAA8B,MAAM;IAA9E,YAAqC,KAAgB,EAAmB,MAAe;qBAAlD,KAAK;sBAA8B,MAAM;IAAY,CAAC;IAE3F,kGAAkG;IAC3F,MAAM,CAAC,GAAG,CAAC,QAAkB,EAAE,SAA6B;QACjE,OAAO,SAAS,KAAK,SAAS;YAC5B,CAAC,CAAC,IAAI,eAAe,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;YACxD,CAAC,CAAC,IAAI,eAAe,CAAC,SAAsB,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,yEAAyE;IAClE,WAAW;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import { Language } from
|
|
1
|
+
import { DirectoryPath } from './file/directoryPath.js';
|
|
2
|
+
import { FilePath } from './file/filePath.js';
|
|
3
|
+
import { Language } from './sdk/generate.js';
|
|
4
4
|
export declare class SdkContext {
|
|
5
5
|
private readonly language;
|
|
6
6
|
private readonly fileService;
|
|
7
7
|
private readonly zipService;
|
|
8
8
|
private readonly sdkDirectory;
|
|
9
|
-
constructor(language: Language, sdkDirectory: DirectoryPath,
|
|
9
|
+
constructor(language: Language, sdkDirectory: DirectoryPath, version?: string);
|
|
10
10
|
private get zipPath();
|
|
11
11
|
exists(): Promise<boolean>;
|
|
12
12
|
save(tempSdkDirectory: DirectoryPath, zipSdk: boolean): Promise<DirectoryPath>;
|
|
13
13
|
loadSdkInTempDirectory(tempDirectory: DirectoryPath, tempSdk: FilePath): Promise<DirectoryPath>;
|
|
14
|
-
loadSdkWithSourceTreeInTempDirectory(tempDirectory: DirectoryPath, tempSdk: FilePath, tempSdkSourceTree: FilePath): Promise<DirectoryPath>;
|
|
15
14
|
}
|
package/lib/types/sdk-context.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { FileService } from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import { FileName } from
|
|
4
|
-
import { ZipService } from
|
|
1
|
+
import { FileService } from '../infrastructure/file-service.js';
|
|
2
|
+
import { FilePath } from './file/filePath.js';
|
|
3
|
+
import { FileName } from './file/fileName.js';
|
|
4
|
+
import { ZipService } from '../infrastructure/zip-service.js';
|
|
5
5
|
export class SdkContext {
|
|
6
|
-
|
|
6
|
+
language;
|
|
7
|
+
fileService = new FileService();
|
|
8
|
+
zipService = new ZipService();
|
|
9
|
+
sdkDirectory;
|
|
10
|
+
constructor(language, sdkDirectory, version) {
|
|
7
11
|
this.language = language;
|
|
8
|
-
this.
|
|
9
|
-
this.zipService = new ZipService();
|
|
10
|
-
const baseDirectory = requireUncustomizedDir ? sdkDirectory.join('uncustomized') : sdkDirectory;
|
|
11
|
-
this.sdkDirectory = version ? baseDirectory.join(version).join(language) : baseDirectory.join(language);
|
|
12
|
+
this.sdkDirectory = version ? sdkDirectory.join(version).join(language) : sdkDirectory.join(language);
|
|
12
13
|
}
|
|
13
14
|
get zipPath() {
|
|
14
15
|
return new FilePath(this.sdkDirectory, new FileName(`${this.language}.zip`));
|
|
@@ -32,14 +33,5 @@ export class SdkContext {
|
|
|
32
33
|
await this.zipService.unArchive(tempSdk, tempSdkDirectory);
|
|
33
34
|
return tempSdkDirectory;
|
|
34
35
|
}
|
|
35
|
-
async loadSdkWithSourceTreeInTempDirectory(tempDirectory, tempSdk, tempSdkSourceTree) {
|
|
36
|
-
const tempSdkDirectory = tempDirectory.join('sdk');
|
|
37
|
-
await this.fileService.createDirectoryIfNotExists(tempSdkDirectory);
|
|
38
|
-
await this.zipService.unArchive(tempSdk, tempSdkDirectory);
|
|
39
|
-
const gitSourceTreeDir = tempSdkDirectory.join('.git');
|
|
40
|
-
await this.fileService.createDirectoryIfNotExists(gitSourceTreeDir);
|
|
41
|
-
await this.zipService.unArchive(tempSdkSourceTree, gitSourceTreeDir);
|
|
42
|
-
return tempSdkDirectory;
|
|
43
|
-
}
|
|
44
36
|
}
|
|
45
37
|
//# sourceMappingURL=sdk-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-context.js","sourceRoot":"","sources":["../../src/types/sdk-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,OAAO,UAAU;
|
|
1
|
+
{"version":3,"file":"sdk-context.js","sourceRoot":"","sources":["../../src/types/sdk-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,OAAO,UAAU;IAKQ,QAAQ;IAJpB,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAChC,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAC9B,YAAY,CAAgB;IAE7C,YAA6B,QAAkB,EAAE,YAA2B,EAAE,OAAgB;wBAAjE,QAAQ;QACnC,IAAI,CAAC,YAAY,GA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 +1,13 @@
|
|
|
1
|
-
import { DirectoryPath } from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import { FileName } from
|
|
1
|
+
import { DirectoryPath } from './file/directoryPath.js';
|
|
2
|
+
import { FilePath } from './file/filePath.js';
|
|
3
|
+
import { FileName } from './file/fileName.js';
|
|
4
4
|
export declare class SpecContext {
|
|
5
5
|
private readonly fileService;
|
|
6
6
|
private readonly zipService;
|
|
7
7
|
private readonly specDirectory;
|
|
8
8
|
constructor(specDirectory: DirectoryPath);
|
|
9
9
|
validate(): Promise<boolean>;
|
|
10
|
-
|
|
10
|
+
/** Adds a specification to this directory, unpacking it when it is a split-spec archive. */
|
|
11
|
+
install(specPath: FilePath): Promise<void>;
|
|
11
12
|
save(stream: NodeJS.ReadableStream, fileName: FileName): Promise<FilePath>;
|
|
12
13
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { FileService } from
|
|
2
|
-
import { FilePath } from
|
|
3
|
-
import {
|
|
4
|
-
import { ZipService } from "../infrastructure/zip-service.js";
|
|
1
|
+
import { FileService } from '../infrastructure/file-service.js';
|
|
2
|
+
import { FilePath } from './file/filePath.js';
|
|
3
|
+
import { ZipService } from '../infrastructure/zip-service.js';
|
|
5
4
|
export class SpecContext {
|
|
5
|
+
fileService = new FileService();
|
|
6
|
+
zipService = new ZipService();
|
|
7
|
+
specDirectory;
|
|
6
8
|
constructor(specDirectory) {
|
|
7
|
-
this.fileService = new FileService();
|
|
8
|
-
this.zipService = new ZipService();
|
|
9
9
|
this.specDirectory = specDirectory;
|
|
10
10
|
}
|
|
11
11
|
async validate() {
|
|
12
12
|
return !(await this.fileService.directoryEmpty(this.specDirectory));
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/** Adds a specification to this directory, unpacking it when it is a split-spec archive. */
|
|
15
|
+
async install(specPath) {
|
|
16
|
+
await this.fileService.createDirectoryIfNotExists(this.specDirectory);
|
|
16
17
|
if (await this.fileService.isZipFile(specPath)) {
|
|
17
18
|
await this.zipService.unArchive(specPath, this.specDirectory);
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,OAAO,WAAW;IACL,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAChC,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAC9B,aAAa,CAAgB;IAE9C,YAAY,aAA4B;QACtC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,4FAA4F;IACrF,KAAK,CAAC,OAAO,CAAC,QAAkB;QACrC,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtE,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA6B,EAAE,QAAkB;QACjE,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QAC5D,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -6,6 +6,6 @@ export declare class TempContext {
|
|
|
6
6
|
private readonly zipService;
|
|
7
7
|
constructor(tempDirectory: DirectoryPath);
|
|
8
8
|
private get getTempFileName();
|
|
9
|
-
zip(
|
|
9
|
+
zip(directory: DirectoryPath): Promise<FilePath>;
|
|
10
10
|
save(portalStream: NodeJS.ReadableStream): Promise<FilePath>;
|
|
11
11
|
}
|
|
@@ -4,18 +4,19 @@ import { FilePath } from "./file/filePath.js";
|
|
|
4
4
|
import { FileName } from "./file/fileName.js";
|
|
5
5
|
import { randomUUID } from "crypto";
|
|
6
6
|
export class TempContext {
|
|
7
|
+
tempDirectory;
|
|
8
|
+
fileService = new FileService();
|
|
9
|
+
zipService = new ZipService();
|
|
7
10
|
constructor(tempDirectory) {
|
|
8
11
|
this.tempDirectory = tempDirectory;
|
|
9
|
-
this.fileService = new FileService();
|
|
10
|
-
this.zipService = new ZipService();
|
|
11
12
|
}
|
|
12
13
|
get getTempFileName() {
|
|
13
14
|
const uuid = randomUUID();
|
|
14
15
|
return new FilePath(this.tempDirectory, new FileName(`${uuid}`));
|
|
15
16
|
}
|
|
16
|
-
async zip(
|
|
17
|
+
async zip(directory) {
|
|
17
18
|
const tempFile = this.getTempFileName;
|
|
18
|
-
await this.zipService.archive(
|
|
19
|
+
await this.zipService.archive(directory, tempFile);
|
|
19
20
|
return tempFile;
|
|
20
21
|
}
|
|
21
22
|
async save(portalStream) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temp-context.js","sourceRoot":"","sources":["../../src/types/temp-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"temp-context.js","sourceRoot":"","sources":["../../src/types/temp-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,OAAO,WAAW;IAIO,aAAa;IAHzB,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAChC,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAE/C,YAA6B,aAA4B;6BAA5B,aAAa;IAAmB,CAAC;IAE9D,IAAY,eAAe;QACzB,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,SAAwB;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;QACtC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,YAAmC;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;QACtC,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { ExportFormats } from
|
|
2
|
-
import { DirectoryPath } from
|
|
3
|
-
import {
|
|
1
|
+
import { ExportFormats } from '@apimatic/sdk';
|
|
2
|
+
import { DirectoryPath } from './file/directoryPath.js';
|
|
3
|
+
import { FileName } from './file/fileName.js';
|
|
4
|
+
import { FilePath } from './file/filePath.js';
|
|
5
|
+
/** Where `api transform` writes, inside the `--destination` it is given. */
|
|
6
|
+
export declare const TRANSFORMATIONS_DIRECTORY_NAME = "transformations";
|
|
7
|
+
/** What `api transform` names its output: the input's name, then the format and its extension. */
|
|
8
|
+
export declare function transformedFileName(file: FilePath, format: ExportFormats): FileName;
|
|
4
9
|
export declare class TransformContext {
|
|
5
10
|
private readonly destinationDirectory;
|
|
6
11
|
private readonly fileService;
|
|
7
12
|
private readonly transformedApi;
|
|
8
13
|
constructor(specFilePath: FilePath, format: ExportFormats, destinationDirectory: DirectoryPath);
|
|
9
|
-
private get specPath();
|
|
10
14
|
exists(): Promise<boolean>;
|
|
11
15
|
save(stream: NodeJS.ReadableStream): Promise<FilePath>;
|
|
12
|
-
private
|
|
16
|
+
private transformedFile;
|
|
13
17
|
}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { FileService } from
|
|
2
|
-
import { getFileNameFromPath } from
|
|
3
|
-
import { DestinationFormats } from
|
|
4
|
-
import { FileName } from
|
|
5
|
-
import { FilePath } from
|
|
1
|
+
import { FileService } from '../infrastructure/file-service.js';
|
|
2
|
+
import { getFileNameFromPath } from '../utils/utils.js';
|
|
3
|
+
import { DestinationFormats } from './api/transform.js';
|
|
4
|
+
import { FileName } from './file/fileName.js';
|
|
5
|
+
import { FilePath } from './file/filePath.js';
|
|
6
|
+
/** Where `api transform` writes, inside the `--destination` it is given. */
|
|
7
|
+
export const TRANSFORMATIONS_DIRECTORY_NAME = 'transformations';
|
|
8
|
+
/** What `api transform` names its output: the input's name, then the format and its extension. */
|
|
9
|
+
export function transformedFileName(file, format) {
|
|
10
|
+
const extension = DestinationFormats[format];
|
|
11
|
+
return new FileName(`${getFileNameFromPath(file.toString())}_${format}.${extension}`);
|
|
12
|
+
}
|
|
6
13
|
export class TransformContext {
|
|
14
|
+
destinationDirectory;
|
|
15
|
+
fileService = new FileService();
|
|
16
|
+
transformedApi;
|
|
7
17
|
constructor(specFilePath, format, destinationDirectory) {
|
|
8
18
|
this.destinationDirectory = destinationDirectory;
|
|
9
|
-
this.
|
|
10
|
-
this.transformedApi = this.parseFileName(format, specFilePath);
|
|
11
|
-
}
|
|
12
|
-
get specPath() {
|
|
13
|
-
return new FilePath(this.destinationDirectory, this.transformedApi);
|
|
19
|
+
this.transformedApi = transformedFileName(specFilePath, format);
|
|
14
20
|
}
|
|
15
21
|
async exists() {
|
|
16
|
-
|
|
17
|
-
return await this.fileService.fileExists(transformedApiPath);
|
|
22
|
+
return await this.fileService.fileExists(this.transformedFile());
|
|
18
23
|
}
|
|
19
24
|
async save(stream) {
|
|
20
25
|
await this.fileService.createDirectoryIfNotExists(this.destinationDirectory);
|
|
21
|
-
await this.fileService.writeFile(this.
|
|
22
|
-
return this.
|
|
26
|
+
await this.fileService.writeFile(this.transformedFile(), stream);
|
|
27
|
+
return this.transformedFile();
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const destinationFilePrefix = getFileNameFromPath(file.toString());
|
|
27
|
-
return new FileName(`${destinationFilePrefix}_${format}.${destinationFileExt}`);
|
|
29
|
+
transformedFile() {
|
|
30
|
+
return new FilePath(this.destinationDirectory, this.transformedApi);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
//# sourceMappingURL=transform-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-context.js","sourceRoot":"","sources":["../../src/types/transform-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,
|
|
1
|
+
{"version":3,"file":"transform-context.js","sourceRoot":"","sources":["../../src/types/transform-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;AAEhE,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,IAAc,EAAE,MAAqB;IACvE,MAAM,SAAS,GAAW,kBAAkB,CAAC,MAAyC,CAAC,CAAC;IACxF,OAAO,IAAI,QAAQ,CAAC,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,OAAO,gBAAgB;IAKiD,oBAAoB;IAJ/E,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IAEhC,cAAc,CAAW;IAE1C,YAAY,YAAsB,EAAE,MAAqB,EAAmB,oBAAmC;oCAAnC,oBAAoB;QAC9F,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACnE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAA6B;QAC7C,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAC7E,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,MAAM,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;IAChC,CAAC;IAEO,eAAe;QACrB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-utils.js","sourceRoot":"","sources":["../../src/utils/error-utils.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-utils.js","sourceRoot":"","sources":["../../src/utils/json-utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export declare const removeQuotes: (input: string) => string;
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function stripByteOrderMark(contents: string): string;
|
|
3
|
+
declare const PROSE_LISTS: {
|
|
4
|
+
and: Intl.ListFormat;
|
|
5
|
+
or: Intl.ListFormat;
|
|
6
|
+
};
|
|
7
|
+
/** The items as a sentence lists them: `a`, `a and b`, `a, b and c`, or with `or` when they are choices. */
|
|
8
|
+
export declare function listedInProse(items: readonly string[], joiner?: keyof typeof PROSE_LISTS): string;
|
|
9
|
+
export {};
|
|
@@ -7,31 +7,18 @@ export const removeQuotes = (input) => {
|
|
|
7
7
|
}
|
|
8
8
|
return input;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
i++;
|
|
24
|
-
}
|
|
25
|
-
else if (char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127) {
|
|
26
|
-
// Skip other control chars (optional)
|
|
27
|
-
i++;
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
// Normal printable char — keep it
|
|
31
|
-
result += char;
|
|
32
|
-
i++;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
10
|
+
// Editors on Windows, and PowerShell redirection, write a byte-order mark. `JSON.parse`
|
|
11
|
+
// rejects it while the YAML parser strips it, so without this the same document is accepted
|
|
12
|
+
// as `.yaml` and refused as `.json`.
|
|
13
|
+
export function stripByteOrderMark(contents) {
|
|
14
|
+
return contents.codePointAt(0) === 0xfeff ? contents.slice(1) : contents;
|
|
15
|
+
}
|
|
16
|
+
const PROSE_LISTS = {
|
|
17
|
+
and: new Intl.ListFormat('en-GB', { type: 'conjunction' }),
|
|
18
|
+
or: new Intl.ListFormat('en-GB', { type: 'disjunction' })
|
|
19
|
+
};
|
|
20
|
+
/** The items as a sentence lists them: `a`, `a and b`, `a, b and c`, or with `or` when they are choices. */
|
|
21
|
+
export function listedInProse(items, joiner = 'and') {
|
|
22
|
+
return PROSE_LISTS[joiner].format(items);
|
|
36
23
|
}
|
|
37
24
|
//# sourceMappingURL=string-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../src/utils/string-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IACpD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../src/utils/string-utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAU,EAAE;IACpD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzE,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB;QAC5D,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,wFAAwF;AACxF,4FAA4F;AAC5F,qCAAqC;AACrC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3E,CAAC;AAED,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC1D,EAAE,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;CAC1D,CAAC;AAEF,4GAA4G;AAC5G,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,MAAM,GAA6B,KAAK;IAC9F,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC"}
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const replaceHTML: (
|
|
1
|
+
export declare const replaceHTML: (html: string) => string;
|
|
2
2
|
export declare const getFileNameFromPath: (filePath: string) => string;
|
|
3
|
-
export declare function parseStreamBodyToJson(body: NodeJS.ReadableStream): Promise<unknown>;
|
|
4
3
|
export declare function discardStreamBody(body: unknown): void;
|
|
5
|
-
export declare const toPascalCase: (str: string) => string;
|