@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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apimatic/cli",
|
|
3
3
|
"description": "The official CLI for APIMatic.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0-beta.2",
|
|
5
5
|
"author": "APIMatic",
|
|
6
6
|
"bin": {
|
|
7
7
|
"apimatic": "./bin/run.js"
|
|
@@ -14,13 +14,16 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=24.0.0"
|
|
18
18
|
},
|
|
19
19
|
"packageManager": "pnpm@11.0.8",
|
|
20
20
|
"files": [
|
|
21
21
|
"./bin",
|
|
22
22
|
"./lib",
|
|
23
|
-
"
|
|
23
|
+
"./portal-template",
|
|
24
|
+
"./portal-pages",
|
|
25
|
+
"/oclif.manifest.json",
|
|
26
|
+
"/apimatic.schema.json"
|
|
24
27
|
],
|
|
25
28
|
"repository": "git://github.com/apimatic/apimatic-cli.git",
|
|
26
29
|
"homepage": "https://docs.apimatic.io/apimatic-cli/intro-and-install/",
|
|
@@ -41,9 +44,10 @@
|
|
|
41
44
|
"build:watch": "rimraf oclif.manifest.json && tsc --watch",
|
|
42
45
|
"apimatic": "node ./bin/run.js",
|
|
43
46
|
"prepack": "oclif manifest",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
+
"pretest": "tsc -p test/tsconfig.json",
|
|
48
|
+
"posttest": "eslint .",
|
|
49
|
+
"prettier": "prettier \"src/**/*.{js,ts}\" \"portal-template/**/*.{ts,tsx}\"",
|
|
50
|
+
"format": "prettier --write \"src/**/*.{js,ts}\" \"portal-template/**/*.{ts,tsx}\"",
|
|
47
51
|
"lint": "eslint \"src/**/*.{js,ts}\"",
|
|
48
52
|
"lint:fix": "eslint --fix \"src/**/*.{js,ts}\" --quiet",
|
|
49
53
|
"readme": "oclif readme",
|
|
@@ -53,38 +57,58 @@
|
|
|
53
57
|
"@apimatic/sdk": "0.2.0-alpha.10",
|
|
54
58
|
"@clack/core": "1.0.0-alpha.1",
|
|
55
59
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
60
|
+
"@fontsource-variable/geist": "5.3.0",
|
|
61
|
+
"@fontsource-variable/geist-mono": "5.3.0",
|
|
62
|
+
"@fumadocs/api-docs": "0.2.8",
|
|
56
63
|
"@oclif/core": "^4.2.8",
|
|
57
64
|
"@oclif/plugin-autocomplete": "^3.2.24",
|
|
58
65
|
"@oclif/plugin-help": "^6.2.26",
|
|
66
|
+
"@scalar/json-magic": "0.13.4",
|
|
67
|
+
"@tailwindcss/vite": "4.3.3",
|
|
68
|
+
"@tanstack/react-router": "1.170.33",
|
|
69
|
+
"@tanstack/react-start": "1.168.50",
|
|
70
|
+
"@tanstack/start-static-server-functions": "1.167.33",
|
|
71
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
59
72
|
"adm-zip": "^0.5.17",
|
|
60
73
|
"ansis": "^3.17.0",
|
|
61
74
|
"async-mutex": "^0.5.0",
|
|
62
75
|
"axios": "^1.8.1",
|
|
63
|
-
"chokidar": "^3.6.0",
|
|
64
|
-
"connect-livereload": "^0.6.1",
|
|
65
76
|
"execa": "^9.6.0",
|
|
66
|
-
"express": "^4.17.1",
|
|
67
77
|
"fast-levenshtein": "^3.0.0",
|
|
68
78
|
"form-data": "^4.0.2",
|
|
69
79
|
"fs-extra": "^11.3.0",
|
|
80
|
+
"fumadocs-core": "16.15.15",
|
|
81
|
+
"fumadocs-mdx": "15.4.0",
|
|
82
|
+
"fumadocs-openapi": "11.4.1",
|
|
83
|
+
"fumadocs-ui": "16.15.15",
|
|
70
84
|
"get-port": "^7.1.0",
|
|
71
85
|
"is-in-ci": "^2.0.0",
|
|
72
86
|
"isomorphic-git": "^1.37.2",
|
|
73
|
-
"
|
|
87
|
+
"lucide-react": "1.47.0",
|
|
88
|
+
"mustache": "^4.2.0",
|
|
74
89
|
"neverthrow": "^8.2.0",
|
|
75
90
|
"open": "^8.4.0",
|
|
76
91
|
"picocolors": "^1.1.1",
|
|
77
92
|
"prettier": "^2.8.8",
|
|
93
|
+
"react": "19.2.8",
|
|
94
|
+
"react-dom": "19.2.8",
|
|
95
|
+
"rehype-raw": "7.0.0",
|
|
96
|
+
"remark": "15.0.1",
|
|
97
|
+
"remark-mdx": "3.1.1",
|
|
98
|
+
"semver": "^7.8.0",
|
|
99
|
+
"shiki": "4.4.3",
|
|
78
100
|
"striptags": "^3.2.0",
|
|
101
|
+
"tailwindcss": "4.3.3",
|
|
79
102
|
"tmp-promise": "^3.0.3",
|
|
80
103
|
"tslib": "^2.8.1",
|
|
81
104
|
"uuid": "^11.1.0",
|
|
105
|
+
"vite": "8.2.2",
|
|
82
106
|
"yaml": "^2.8.0",
|
|
83
107
|
"yazl": "^3.3.1"
|
|
84
108
|
},
|
|
85
109
|
"devDependencies": {
|
|
86
110
|
"@commitlint/cli": "^20.5.0",
|
|
87
|
-
"@commitlint/config-conventional": "^
|
|
111
|
+
"@commitlint/config-conventional": "^20.5.3",
|
|
88
112
|
"@eslint/js": "^9.34.0",
|
|
89
113
|
"@oclif/test": "^4.1.13",
|
|
90
114
|
"@semantic-release/changelog": "^6.0.3",
|
|
@@ -92,21 +116,23 @@
|
|
|
92
116
|
"@types/adm-zip": "^0.5.8",
|
|
93
117
|
"@types/base-64": "^1.0.0",
|
|
94
118
|
"@types/chai": "^4.3.20",
|
|
95
|
-
"@types/connect-livereload": "^0.5.32",
|
|
96
|
-
"@types/express": "^4.17.23",
|
|
97
119
|
"@types/fast-levenshtein": "^0.0.4",
|
|
98
120
|
"@types/fs-extra": "^9.0.13",
|
|
99
|
-
"@types/
|
|
100
|
-
"@types/
|
|
101
|
-
"@types/
|
|
102
|
-
"@types/node": "^20.17.50",
|
|
121
|
+
"@types/mocha": "^10.0.10",
|
|
122
|
+
"@types/mustache": "^4.2.6",
|
|
123
|
+
"@types/node": "^24.13.4",
|
|
103
124
|
"@types/prettier": "^2.7.3",
|
|
125
|
+
"@types/react": "^19.3.0",
|
|
126
|
+
"@types/react-dom": "^19.3.0",
|
|
127
|
+
"@types/semver": "^7.8.0",
|
|
104
128
|
"@types/sinon": "^17.0.4",
|
|
105
129
|
"@types/treeify": "^1.0.3",
|
|
106
130
|
"@types/unzipper": "^0.10.4",
|
|
107
131
|
"@types/yazl": "^3.3.0",
|
|
108
132
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
109
133
|
"@typescript-eslint/parser": "^8.0.0",
|
|
134
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
135
|
+
"ajv": "^8.20.0",
|
|
110
136
|
"chai": "^4.5.0",
|
|
111
137
|
"eslint": "^9.21.0",
|
|
112
138
|
"eslint-config-prettier": "^8.3.0",
|
|
@@ -114,7 +140,6 @@
|
|
|
114
140
|
"husky": "^7.0.4",
|
|
115
141
|
"lint-staged": "^11.2.6",
|
|
116
142
|
"mocha": "^11.7.1",
|
|
117
|
-
"mock-fs": "^5.5.0",
|
|
118
143
|
"nock": "^14.0.4",
|
|
119
144
|
"nyc": "^17.1.0",
|
|
120
145
|
"oclif": "^4.17.34",
|
|
@@ -123,9 +148,8 @@
|
|
|
123
148
|
"simple-git": "^3.36.0",
|
|
124
149
|
"sinon": "^21.0.0",
|
|
125
150
|
"string-argv": "^0.3.1",
|
|
126
|
-
"ts-node": "^10.9.2",
|
|
127
151
|
"tsx": "^4.20.3",
|
|
128
|
-
"typescript": "
|
|
152
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
129
153
|
},
|
|
130
154
|
"oclif": {
|
|
131
155
|
"commands": "./lib/commands",
|
|
@@ -133,6 +157,7 @@
|
|
|
133
157
|
"bin": "apimatic",
|
|
134
158
|
"description": "The official CLI for APIMatic. \nTo get started with APIMatic's CLI using a step by step wizard, run 'apimatic quickstart'.",
|
|
135
159
|
"hooks": {
|
|
160
|
+
"init": "./lib/hooks/node-version",
|
|
136
161
|
"command_not_found": "./lib/hooks/not-found"
|
|
137
162
|
},
|
|
138
163
|
"plugins": [
|
|
@@ -150,7 +175,7 @@
|
|
|
150
175
|
"description": "Generate context plugins that teach AI coding assistants to use your SDKs."
|
|
151
176
|
},
|
|
152
177
|
"portal": {
|
|
153
|
-
"description": "
|
|
178
|
+
"description": "Build and serve an API Documentation portal for your APIs."
|
|
154
179
|
},
|
|
155
180
|
"sdk": {
|
|
156
181
|
"description": "Generate and publish SDKs for your APIs in multiple languages."
|
|
@@ -160,15 +185,12 @@
|
|
|
160
185
|
},
|
|
161
186
|
"publishing:profile": {
|
|
162
187
|
"description": "Manage publishing profiles."
|
|
163
|
-
},
|
|
164
|
-
"portal:toc": {
|
|
165
|
-
"description": "Generate a Table of Contents (TOC) file for your API documentation portal."
|
|
166
188
|
}
|
|
167
189
|
},
|
|
168
190
|
"topicSeparator": " "
|
|
169
191
|
},
|
|
170
192
|
"lint-staged": {
|
|
171
193
|
"*.js": "eslint --cache --fix",
|
|
172
|
-
"*.{js,ts}": "prettier --write"
|
|
194
|
+
"*.{js,ts,tsx}": "prettier --write"
|
|
173
195
|
}
|
|
174
196
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Context Plugin"
|
|
3
|
+
description: "Give your AI coding assistant working knowledge of this API's SDKs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The context plugin teaches your AI coding assistant how to use this API's SDKs, so the code it writes for you calls the API the way the SDKs are meant to be used.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
<PluginInstall path="{{installPath}}" />
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
Once the plugin is installed, describe what you want to build and your assistant works from the SDK for your language: how to install it and create a client, how to authenticate, and which methods and types to use for each call. You spend less time correcting code written from guesses about the API.
|
|
15
|
+
|
|
16
|
+
## Supported languages
|
|
17
|
+
|
|
18
|
+
<PluginLanguages>
|
|
19
|
+
{{#languages}}
|
|
20
|
+
<PluginLanguage language="{{language}}" name="{{name}}" />
|
|
21
|
+
{{/languages}}
|
|
22
|
+
</PluginLanguages>
|
|
23
|
+
|
|
24
|
+
## Supported platforms
|
|
25
|
+
|
|
26
|
+
<PluginPlatforms />
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "SDKs"
|
|
3
|
+
description: "Client libraries for this API."
|
|
4
|
+
full: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<SdkCards>
|
|
8
|
+
{{#sdks}}
|
|
9
|
+
<SdkCard language="{{language}}" name="{{name}}" page="{{page}}" download="{{download}}" source="{{source}}" install="{{install}}" packageUrl="{{packageUrl}}" registry="{{registry}}" />
|
|
10
|
+
{{/sdks}}
|
|
11
|
+
</SdkCards>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
This directory is the build project the APIMatic CLI copies into a temporary
|
|
2
|
+
directory to generate a documentation portal. It is distributed under the MIT
|
|
3
|
+
licence, with the rest of @apimatic/cli.
|
|
4
|
+
|
|
5
|
+
It is derived from the Fumadocs and TanStack Start starter templates, and at
|
|
6
|
+
build time it runs against the packages below. Each is MIT licensed and carries
|
|
7
|
+
its own copyright:
|
|
8
|
+
|
|
9
|
+
Fumadocs (fumadocs-core, fumadocs-ui, fumadocs-mdx, fumadocs-openapi)
|
|
10
|
+
Copyright (c) 2023 Fuma Nama
|
|
11
|
+
|
|
12
|
+
TanStack Start and TanStack Router (@tanstack/react-start, @tanstack/react-router,
|
|
13
|
+
@tanstack/start-static-server-functions)
|
|
14
|
+
Copyright (c) 2021-present Tanner Linsley
|
|
15
|
+
|
|
16
|
+
Shiki, Tailwind CSS, React, Vite and rehype-raw are likewise MIT licensed; see
|
|
17
|
+
their own packages for the full notices.
|
|
18
|
+
|
|
19
|
+
The SDK and context plugin pages draw these marks, copied into
|
|
20
|
+
src/components/logos.tsx:
|
|
21
|
+
|
|
22
|
+
The C#, Python and TypeScript logos, from Devicon 2.17.0
|
|
23
|
+
Copyright (c) 2015 konpa, MIT licensed
|
|
24
|
+
https://github.com/devicons/devicon
|
|
25
|
+
|
|
26
|
+
The Claude, Cursor and GitHub Copilot logos, from Simple Icons 16.32.0
|
|
27
|
+
CC0 1.0 Universal, https://github.com/simple-icons/simple-icons
|
|
28
|
+
|
|
29
|
+
Each mark remains the trademark of its owner, and is shown to name the
|
|
30
|
+
language or tool it stands for.
|
|
31
|
+
|
|
32
|
+
The generated portal also bundles the Geist and Geist Mono typefaces, from the
|
|
33
|
+
Fontsource packages @fontsource-variable/geist and @fontsource-variable/geist-mono.
|
|
34
|
+
They are licensed under the SIL Open Font License 1.1, not MIT:
|
|
35
|
+
|
|
36
|
+
Geist and Geist Mono
|
|
37
|
+
Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createReadStream } from 'node:fs';
|
|
2
|
+
import { cp, readdir } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import type { Plugin } from 'vite';
|
|
5
|
+
|
|
6
|
+
/** Where the site offers the downloads: a name the user's static directory is not expected to use. */
|
|
7
|
+
export const DOWNLOADS_ADDRESS = '__downloads';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Adds the SDKs and the context plugin the CLI downloaded to the site, which Vite's one
|
|
11
|
+
* `publicDir` cannot, since that is the user's static directory.
|
|
12
|
+
*/
|
|
13
|
+
export function downloads(directory: string | null): Plugin {
|
|
14
|
+
return {
|
|
15
|
+
name: 'apimatic:downloads',
|
|
16
|
+
async configureServer(server) {
|
|
17
|
+
if (directory === null) return;
|
|
18
|
+
const files = await filesByAddress(directory);
|
|
19
|
+
server.middlewares.use((request, response, next) => {
|
|
20
|
+
const file = files.get(decodeURIComponent(new URL(request.url ?? '/', 'http://localhost').pathname));
|
|
21
|
+
if (file === undefined) return next();
|
|
22
|
+
response.setHeader('Content-Type', 'application/zip');
|
|
23
|
+
createReadStream(file).pipe(response);
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
async writeBundle(options) {
|
|
27
|
+
if (directory === null || this.environment.name !== 'client' || options.dir === undefined) return;
|
|
28
|
+
await cp(directory, path.join(options.dir, DOWNLOADS_ADDRESS), { recursive: true });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function filesByAddress(directory: string): Promise<Map<string, string>> {
|
|
34
|
+
const entries = await readdir(directory, { recursive: true, withFileTypes: true });
|
|
35
|
+
const files = new Map<string, string>();
|
|
36
|
+
for (const entry of entries.filter((candidate) => candidate.isFile())) {
|
|
37
|
+
const file = path.join(entry.parentPath, entry.name);
|
|
38
|
+
files.set(`/${DOWNLOADS_ADDRESS}/${path.relative(directory, file).split(path.sep).join('/')}`, file);
|
|
39
|
+
}
|
|
40
|
+
return files;
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import type { Plugin } from 'vite';
|
|
3
|
+
|
|
4
|
+
/** Where the CLI writes the pages it generates, as `src/lib/source.ts` names it. */
|
|
5
|
+
const GENERATED_DIRECTORY = 'generated';
|
|
6
|
+
|
|
7
|
+
/** The module that declares the collections, and so holds the glob of their files. */
|
|
8
|
+
const SOURCE_MODULE = 'src/lib/source.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The files the collection reads: its pages and their `nav.json`. The CLI writes each one
|
|
12
|
+
* beside itself under a temporary name and renames it over, and those names are left out.
|
|
13
|
+
*/
|
|
14
|
+
const COLLECTED_FILE = /\.(md|mdx|json)$/;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* fumadocs-mdx expands each collection into a glob of imports when it transforms
|
|
18
|
+
* `src/lib/source.ts`, and under `vite dev` it does not expand it again when a file is added
|
|
19
|
+
* or removed: an added page never appears, and a removed one fails every request until the
|
|
20
|
+
* server restarts. `portal serve` adds and removes generated pages as `apimatic.json` changes,
|
|
21
|
+
* so an add or remove there is passed on as an edit to that module, which Vite transforms again.
|
|
22
|
+
*/
|
|
23
|
+
export function generatedPagesReload(): Plugin {
|
|
24
|
+
return {
|
|
25
|
+
name: 'apimatic:generated-pages-reload',
|
|
26
|
+
apply: 'serve',
|
|
27
|
+
configureServer(server) {
|
|
28
|
+
const directory = path.resolve(server.config.root, GENERATED_DIRECTORY);
|
|
29
|
+
const sourceModule = path.resolve(server.config.root, SOURCE_MODULE);
|
|
30
|
+
const reload = () => server.watcher.emit('change', sourceModule);
|
|
31
|
+
const onFileAddedOrRemoved = (file: string) => {
|
|
32
|
+
if (isInside(directory, file) && COLLECTED_FILE.test(file)) {
|
|
33
|
+
reload();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
server.watcher.on('add', onFileAddedOrRemoved);
|
|
37
|
+
server.watcher.on('unlink', onFileAddedOrRemoved);
|
|
38
|
+
server.watcher.on('unlinkDir', (folder: string) => {
|
|
39
|
+
if (isInside(directory, folder)) {
|
|
40
|
+
reload();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// `path.relative` compares case-insensitively on Windows, as the file system there does.
|
|
48
|
+
function isInside(directory: string, file: string): boolean {
|
|
49
|
+
const relative = path.relative(directory, path.resolve(file));
|
|
50
|
+
return relative.length > 0 && relative.split(path.sep)[0] !== '..' && !path.isAbsolute(relative);
|
|
51
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apimatic-portal",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"description": "Build project for the API documentation portal generated by the APIMatic CLI. Dependencies are provided by the CLI at build time.",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"dev": "vite dev"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import type { Portal } from './src/lib/portal-types';
|
|
3
|
+
|
|
4
|
+
/** Written by the CLI next to this file before every build or dev-server start. */
|
|
5
|
+
export interface BuildPaths {
|
|
6
|
+
/** Section slug -> absolute path of an OpenAPI document. */
|
|
7
|
+
specs: Record<string, string>;
|
|
8
|
+
/** Absolute path of the code samples, keyed by path then method; null when there are none. */
|
|
9
|
+
codeSamples: string | null;
|
|
10
|
+
/** Absolute. Always exists, and may be empty. */
|
|
11
|
+
contentDir: string;
|
|
12
|
+
/** Absolute, inside this project: the pages the CLI generates, which `src/lib/source.ts` compiles. */
|
|
13
|
+
generatedDir: string;
|
|
14
|
+
staticDir: string | null;
|
|
15
|
+
/** Absolute, inside this project: the SDKs and the context plugin, laid out as the site serves them under `/__downloads/`. */
|
|
16
|
+
downloadsDir: string | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function readBuildPaths(): Promise<BuildPaths> {
|
|
20
|
+
return (await readJson('./portal.config.json')) as BuildPaths;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The part of what the browser is told that the build set-up reads too. */
|
|
24
|
+
export type BuildIdentity = Pick<Portal, 'siteUrl'>;
|
|
25
|
+
|
|
26
|
+
export async function readPortalIdentity(): Promise<BuildIdentity> {
|
|
27
|
+
return (await readJson('./portal.identity.json')) as BuildIdentity;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function readJson(relative: string): Promise<unknown> {
|
|
31
|
+
return JSON.parse(await readFile(new URL(relative, import.meta.url), 'utf8'));
|
|
32
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { readdir } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { getSlugs, loader } from 'fumadocs-core/source';
|
|
4
|
+
import type { BuildPaths } from './portal-config.ts';
|
|
5
|
+
import { openApiSection } from './src/lib/openapi-section.server';
|
|
6
|
+
|
|
7
|
+
const CONTENT_EXTENSIONS = new Set(['.md', '.mdx']);
|
|
8
|
+
|
|
9
|
+
/** Passed over by Vite's `import.meta.glob`, which the content collection is read through. */
|
|
10
|
+
const isSkippedByGlob = (segment: string) => segment.startsWith('.') || segment === 'node_modules';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Every URL the static build has to emit. TanStack Start's crawler misses links inside
|
|
14
|
+
* collapsed sidebar folders and never sees the `.md` URLs the page actions fetch, so
|
|
15
|
+
* the list is computed here from the same sources the site is built from.
|
|
16
|
+
*/
|
|
17
|
+
export async function prerenderPages(config: BuildPaths, siteUrl: string | null): Promise<{ path: string }[]> {
|
|
18
|
+
const urls = new Set<string>(['/', '/api/search.json', '/llms.txt', '/llms-full.txt']);
|
|
19
|
+
// Both need absolute URLs, so they are only emitted for a portal that declares its address.
|
|
20
|
+
if (siteUrl) {
|
|
21
|
+
urls.add('/sitemap.xml');
|
|
22
|
+
urls.add('/robots.txt');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
for (const url of await contentUrls(config.contentDir)) urls.add(url);
|
|
26
|
+
// The CLI keeps the user's pages away from the generated ones' addresses, so the two
|
|
27
|
+
// directories never collide and can be listed apart.
|
|
28
|
+
for (const url of await contentUrls(config.generatedDir)) urls.add(url);
|
|
29
|
+
for (const url of await openApiUrls(config.specs)) urls.add(url);
|
|
30
|
+
|
|
31
|
+
// The copy is load-bearing, not redundant: this loop adds to `urls`, and a `Set` visits
|
|
32
|
+
// entries added during iteration, so iterating `urls` itself would suffix the `.md` URLs it
|
|
33
|
+
// creates in turn -- `/guides.md.md` and on, never terminating.
|
|
34
|
+
for (const url of [...urls]) {
|
|
35
|
+
if (url === '/') urls.add('/index.md');
|
|
36
|
+
else if (!/\.(txt|xml|json)$/.test(url)) urls.add(`${url}.md`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return [...urls].map((url) => ({ path: url }));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function contentUrls(contentDir: string): Promise<string[]> {
|
|
43
|
+
const entries = await readdir(contentDir, { recursive: true, withFileTypes: true }).catch(() => []);
|
|
44
|
+
|
|
45
|
+
const files = entries
|
|
46
|
+
.filter((entry) => entry.isFile() && CONTENT_EXTENSIONS.has(path.extname(entry.name)))
|
|
47
|
+
.map((entry) => path.relative(contentDir, path.join(entry.parentPath, entry.name)).split(path.sep).join('/'))
|
|
48
|
+
.filter((file) => !file.split('/').some(isSkippedByGlob))
|
|
49
|
+
.map((file) => {
|
|
50
|
+
// The content source's own slug rules, not a second implementation: "(group)" folders
|
|
51
|
+
// drop out, "index" collapses into its parent.
|
|
52
|
+
return { slugs: getSlugs(file), isIndex: path.basename(file, path.extname(file)) === 'index' };
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// `guides.md` and `guides/index.md` both collapse to "guides". The content source settles
|
|
56
|
+
// that by taking the non-index files first and appending "index" to the loser, so the same
|
|
57
|
+
// order has to hold here or the page it moves to /guides/index is never written.
|
|
58
|
+
const taken = new Set<string>();
|
|
59
|
+
const claim = (slugs: string[]): string => {
|
|
60
|
+
const key = slugs.join('/');
|
|
61
|
+
taken.add(key);
|
|
62
|
+
return '/' + key;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const urls = files.filter((file) => !file.isIndex).map((file) => claim(file.slugs));
|
|
66
|
+
for (const file of files.filter((file) => file.isIndex)) {
|
|
67
|
+
urls.push(claim(taken.has(file.slugs.join('/')) ? [...file.slugs, 'index'] : file.slugs));
|
|
68
|
+
}
|
|
69
|
+
return urls;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Through the same sections as the site, so an internal operation gets no page here either.
|
|
73
|
+
async function openApiUrls(specs: Record<string, string>): Promise<string[]> {
|
|
74
|
+
const sources = Object.fromEntries(
|
|
75
|
+
await Promise.all(Object.entries(specs).map(async ([id, file]) => [id, await openApiSection(id, file, null)]))
|
|
76
|
+
);
|
|
77
|
+
if (Object.keys(sources).length === 0) return [];
|
|
78
|
+
return loader(sources, { baseUrl: '/' })
|
|
79
|
+
.getPages()
|
|
80
|
+
.map((page) => page.url);
|
|
81
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import type { Plugin } from 'vite';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reloads the preview when a file beside a specification changes. The specifications are read
|
|
6
|
+
* at run time rather than imported, so Vite's module graph never learns of them, and the
|
|
7
|
+
* reference pages are built once per server module evaluation.
|
|
8
|
+
*/
|
|
9
|
+
export function specReload(specs: Record<string, string>): Plugin {
|
|
10
|
+
const directories = [...new Set(Object.values(specs).map((file) => path.posix.dirname(file)))];
|
|
11
|
+
const isInSpecDirectory = (file: string) => directories.some((directory) => file.startsWith(`${directory}/`));
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
name: 'apimatic:spec-reload',
|
|
15
|
+
apply: 'serve',
|
|
16
|
+
configureServer(server) {
|
|
17
|
+
server.watcher.add(directories);
|
|
18
|
+
},
|
|
19
|
+
// Sent to each environment: the server runner re-evaluates every module, the browser reloads.
|
|
20
|
+
hotUpdate({ file }) {
|
|
21
|
+
if (!isInSpecDirectory(file)) return;
|
|
22
|
+
this.environment.hot.send({ type: 'full-reload' });
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createOpenAPIPage } from 'fumadocs-openapi/ui';
|
|
2
|
+
import { createCodeUsageGeneratorRegistry } from 'fumadocs-openapi/requests/generators';
|
|
3
|
+
import { mediaAdapters } from '@/lib/media-adapters';
|
|
4
|
+
import { CodeBlock } from './code-block';
|
|
5
|
+
import { renderExampleLayout } from './example-layout';
|
|
6
|
+
import { renderUsageTabs } from './usage-tabs';
|
|
7
|
+
|
|
8
|
+
export const OpenAPIPage = createOpenAPIPage({
|
|
9
|
+
// Without a registry of its own, Fumadocs registers and bundles every request generator it has.
|
|
10
|
+
codeUsages: createCodeUsageGeneratorRegistry(),
|
|
11
|
+
generateTypeScriptDefinitions: false,
|
|
12
|
+
components: { CodeBlock },
|
|
13
|
+
content: { renderAPIExampleLayout: renderExampleLayout, renderAPIExampleUsageTabs: renderUsageTabs },
|
|
14
|
+
mediaAdapters
|
|
15
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock.core';
|
|
2
|
+
import { useRenderContext } from 'fumadocs-openapi/ui';
|
|
3
|
+
|
|
4
|
+
// Fumadocs passes `JSON.stringify(example.value)`, which is undefined for an example with no `value`.
|
|
5
|
+
export function CodeBlock({ lang, code }: Readonly<{ lang: string; code: string | undefined }>) {
|
|
6
|
+
const { shiki, shikiOptions } = useRenderContext();
|
|
7
|
+
if (code === undefined) return null;
|
|
8
|
+
return <DynamicCodeBlock lang={lang} code={code} highlighter={() => shiki.getOrInit()} options={shikiOptions} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { asMarkdown } from 'fumadocs-core/server';
|
|
3
|
+
import { CodeBlock, Pre } from 'fumadocs-ui/components/codeblock';
|
|
4
|
+
import { CODE_BLOCK_TITLES } from '@/lib/code-titles';
|
|
5
|
+
|
|
6
|
+
interface CommandBlockProps {
|
|
7
|
+
command: string;
|
|
8
|
+
/** One line that truncates, for a card; the full command is still what the button copies. */
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Centred on the one line, where the block's own placement pins the button to the top corner.
|
|
13
|
+
function CentredActions({ children }: Readonly<{ children?: ReactNode }>) {
|
|
14
|
+
return <div className="absolute inset-y-0 end-1.5 z-2 flex items-center text-fd-muted-foreground">{children}</div>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** One shell command in a copyable block: an MDX page has no highlighter to hand, so it is plain. */
|
|
18
|
+
export function CommandBlock({ command, compact = false }: Readonly<CommandBlockProps>) {
|
|
19
|
+
if (asMarkdown()) {
|
|
20
|
+
return `\`\`\`bash\n${command}\n\`\`\``;
|
|
21
|
+
}
|
|
22
|
+
if (!compact) {
|
|
23
|
+
return (
|
|
24
|
+
<CodeBlock title={CODE_BLOCK_TITLES.shellscript}>
|
|
25
|
+
<Pre>
|
|
26
|
+
<code>
|
|
27
|
+
{/* A highlighted block's lines carry this class, which is what the block pads. */}
|
|
28
|
+
<span className="line">{command}</span>
|
|
29
|
+
</code>
|
|
30
|
+
</Pre>
|
|
31
|
+
</CodeBlock>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return (
|
|
35
|
+
<CodeBlock
|
|
36
|
+
className="my-0 rounded-lg bg-fd-secondary shadow-none"
|
|
37
|
+
viewportProps={{ className: 'py-2 text-xs' }}
|
|
38
|
+
Actions={CentredActions}
|
|
39
|
+
>
|
|
40
|
+
<Pre className="w-full">
|
|
41
|
+
<code>
|
|
42
|
+
{/* The block pads a line only as far as the button's edge, so a cut-off command would run up to it. */}
|
|
43
|
+
<span className="line truncate [--padding-right:calc(var(--spacing)*10)]" title={command}>
|
|
44
|
+
{command}
|
|
45
|
+
</span>
|
|
46
|
+
</code>
|
|
47
|
+
</Pre>
|
|
48
|
+
</CodeBlock>
|
|
49
|
+
);
|
|
50
|
+
}
|