@nocobase/app-server 0.11.1-alpha.5 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +295 -0
- package/dist/application/index.d.ts +128 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/index.js +386 -0
- package/dist/application/index.js.map +1 -0
- package/dist/caching/config.d.ts +2 -0
- package/dist/caching/config.d.ts.map +1 -0
- package/dist/caching/config.js +2 -0
- package/dist/caching/config.js.map +1 -0
- package/dist/caching/index.d.ts +5 -0
- package/dist/caching/index.d.ts.map +1 -0
- package/dist/caching/index.js +4 -0
- package/dist/caching/index.js.map +1 -0
- package/dist/caching/provider.d.ts +8 -0
- package/dist/caching/provider.d.ts.map +1 -0
- package/dist/caching/provider.js +14 -0
- package/dist/caching/provider.js.map +1 -0
- package/dist/caching/token.d.ts +4 -0
- package/dist/caching/token.d.ts.map +1 -0
- package/dist/caching/token.js +3 -0
- package/dist/caching/token.js.map +1 -0
- package/dist/config/app-config-types.d.ts +44 -0
- package/dist/config/app-config-types.d.ts.map +1 -0
- package/dist/config/app-config-types.js +2 -0
- package/dist/config/app-config-types.js.map +1 -0
- package/dist/config/app-config.d.ts +60 -0
- package/dist/config/app-config.d.ts.map +1 -0
- package/dist/config/app-config.js +247 -0
- package/dist/config/app-config.js.map +1 -0
- package/dist/config/context.d.ts +3 -0
- package/dist/config/context.d.ts.map +1 -0
- package/dist/config/context.js +7 -0
- package/dist/config/context.js.map +1 -0
- package/dist/config/define-app-config.d.ts +71 -0
- package/dist/config/define-app-config.d.ts.map +1 -0
- package/dist/config/define-app-config.js +48 -0
- package/dist/config/define-app-config.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +11 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/not-configured.d.ts +23 -0
- package/dist/config/not-configured.d.ts.map +1 -0
- package/dist/config/not-configured.js +31 -0
- package/dist/config/not-configured.js.map +1 -0
- package/dist/config/paths.d.ts +27 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +27 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/placeholder-secret.d.ts +19 -0
- package/dist/config/placeholder-secret.d.ts.map +1 -0
- package/dist/config/placeholder-secret.js +26 -0
- package/dist/config/placeholder-secret.js.map +1 -0
- package/dist/config/runtime-environment.d.ts +11 -0
- package/dist/config/runtime-environment.d.ts.map +1 -0
- package/dist/config/runtime-environment.js +20 -0
- package/dist/config/runtime-environment.js.map +1 -0
- package/dist/config/types.d.ts +12 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/validation.d.ts +36 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +186 -0
- package/dist/config/validation.js.map +1 -0
- package/dist/config/variables.d.ts +57 -0
- package/dist/config/variables.d.ts.map +1 -0
- package/dist/config/variables.js +89 -0
- package/dist/config/variables.js.map +1 -0
- package/dist/database/collections-artifact.d.ts +99 -0
- package/dist/database/collections-artifact.d.ts.map +1 -0
- package/dist/database/collections-artifact.js +397 -0
- package/dist/database/collections-artifact.js.map +1 -0
- package/dist/database/collections-directory.d.ts +36 -0
- package/dist/database/collections-directory.d.ts.map +1 -0
- package/dist/database/collections-directory.js +115 -0
- package/dist/database/collections-directory.js.map +1 -0
- package/dist/database/collections-doctor.d.ts +43 -0
- package/dist/database/collections-doctor.d.ts.map +1 -0
- package/dist/database/collections-doctor.js +88 -0
- package/dist/database/collections-doctor.js.map +1 -0
- package/dist/database/connection-check.d.ts +25 -0
- package/dist/database/connection-check.d.ts.map +1 -0
- package/dist/database/connection-check.js +65 -0
- package/dist/database/connection-check.js.map +1 -0
- package/dist/database/connection-selection.d.ts +16 -0
- package/dist/database/connection-selection.d.ts.map +1 -0
- package/dist/database/connection-selection.js +30 -0
- package/dist/database/connection-selection.js.map +1 -0
- package/dist/database/define-app-database-config.d.ts +49 -0
- package/dist/database/define-app-database-config.d.ts.map +1 -0
- package/dist/database/define-app-database-config.js +73 -0
- package/dist/database/define-app-database-config.js.map +1 -0
- package/dist/database/environment.d.ts +11 -0
- package/dist/database/environment.d.ts.map +1 -0
- package/dist/database/environment.js +49 -0
- package/dist/database/environment.js.map +1 -0
- package/dist/database/index.d.ts +17 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +16 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/manager.d.ts +16 -0
- package/dist/database/manager.d.ts.map +1 -0
- package/dist/database/manager.js +83 -0
- package/dist/database/manager.js.map +1 -0
- package/dist/database/migrator.d.ts +88 -0
- package/dist/database/migrator.d.ts.map +1 -0
- package/dist/database/migrator.js +143 -0
- package/dist/database/migrator.js.map +1 -0
- package/dist/database/ownership.d.ts +6 -0
- package/dist/database/ownership.d.ts.map +1 -0
- package/dist/database/ownership.js +50 -0
- package/dist/database/ownership.js.map +1 -0
- package/dist/database/plan.d.ts +36 -0
- package/dist/database/plan.d.ts.map +1 -0
- package/dist/database/plan.js +136 -0
- package/dist/database/plan.js.map +1 -0
- package/dist/database/provider.d.ts +43 -0
- package/dist/database/provider.d.ts.map +1 -0
- package/dist/database/provider.js +171 -0
- package/dist/database/provider.js.map +1 -0
- package/dist/database/resolve-config.d.ts +42 -0
- package/dist/database/resolve-config.d.ts.map +1 -0
- package/dist/database/resolve-config.js +118 -0
- package/dist/database/resolve-config.js.map +1 -0
- package/dist/database/seeder.d.ts +50 -0
- package/dist/database/seeder.d.ts.map +1 -0
- package/dist/database/seeder.js +117 -0
- package/dist/database/seeder.js.map +1 -0
- package/dist/database/storage.d.ts +10 -0
- package/dist/database/storage.d.ts.map +1 -0
- package/dist/database/storage.js +37 -0
- package/dist/database/storage.js.map +1 -0
- package/dist/database/task-config.d.ts +7 -0
- package/dist/database/task-config.d.ts.map +1 -0
- package/dist/database/task-config.js +19 -0
- package/dist/database/task-config.js.map +1 -0
- package/dist/database/task-container.d.ts +3 -0
- package/dist/database/task-container.d.ts.map +1 -0
- package/dist/database/task-container.js +34 -0
- package/dist/database/task-container.js.map +1 -0
- package/dist/database/tasks.d.ts +104 -0
- package/dist/database/tasks.d.ts.map +1 -0
- package/dist/database/tasks.js +350 -0
- package/dist/database/tasks.js.map +1 -0
- package/dist/database/types.d.ts +92 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +2 -0
- package/dist/database/types.js.map +1 -0
- package/dist/drive/config.d.ts +2 -0
- package/dist/drive/config.d.ts.map +1 -0
- package/dist/drive/config.js +2 -0
- package/dist/drive/config.js.map +1 -0
- package/dist/drive/index.d.ts +5 -0
- package/dist/drive/index.d.ts.map +1 -0
- package/dist/drive/index.js +4 -0
- package/dist/drive/index.js.map +1 -0
- package/dist/drive/provider.d.ts +9 -0
- package/dist/drive/provider.d.ts.map +1 -0
- package/dist/drive/provider.js +22 -0
- package/dist/drive/provider.js.map +1 -0
- package/dist/drive/token.d.ts +4 -0
- package/dist/drive/token.d.ts.map +1 -0
- package/dist/drive/token.js +3 -0
- package/dist/drive/token.js.map +1 -0
- package/dist/i18n/index.d.ts +37 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +44 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/id-generator/config.d.ts +2 -0
- package/dist/id-generator/config.d.ts.map +1 -0
- package/dist/id-generator/config.js +2 -0
- package/dist/id-generator/config.js.map +1 -0
- package/dist/id-generator/index.d.ts +5 -0
- package/dist/id-generator/index.d.ts.map +1 -0
- package/dist/id-generator/index.js +4 -0
- package/dist/id-generator/index.js.map +1 -0
- package/dist/id-generator/provider.d.ts +7 -0
- package/dist/id-generator/provider.d.ts.map +1 -0
- package/dist/id-generator/provider.js +11 -0
- package/dist/id-generator/provider.js.map +1 -0
- package/dist/id-generator/token.d.ts +4 -0
- package/dist/id-generator/token.d.ts.map +1 -0
- package/dist/id-generator/token.js +3 -0
- package/dist/id-generator/token.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/config.d.ts +2 -0
- package/dist/jobs/config.d.ts.map +1 -0
- package/dist/jobs/config.js +2 -0
- package/dist/jobs/config.js.map +1 -0
- package/dist/jobs/index.d.ts +4 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +4 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/provider.d.ts +23 -0
- package/dist/jobs/provider.d.ts.map +1 -0
- package/dist/jobs/provider.js +55 -0
- package/dist/jobs/provider.js.map +1 -0
- package/dist/jobs/token.d.ts +8 -0
- package/dist/jobs/token.d.ts.map +1 -0
- package/dist/jobs/token.js +7 -0
- package/dist/jobs/token.js.map +1 -0
- package/dist/logging/config.d.ts +16 -0
- package/dist/logging/config.d.ts.map +1 -0
- package/dist/logging/config.js +26 -0
- package/dist/logging/config.js.map +1 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +5 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/middleware.d.ts +13 -0
- package/dist/logging/middleware.d.ts.map +1 -0
- package/dist/logging/middleware.js +128 -0
- package/dist/logging/middleware.js.map +1 -0
- package/dist/logging/provider.d.ts +9 -0
- package/dist/logging/provider.d.ts.map +1 -0
- package/dist/logging/provider.js +95 -0
- package/dist/logging/provider.js.map +1 -0
- package/dist/logging/token.d.ts +4 -0
- package/dist/logging/token.d.ts.map +1 -0
- package/dist/logging/token.js +3 -0
- package/dist/logging/token.js.map +1 -0
- package/dist/node/config.d.ts +6 -0
- package/dist/node/config.d.ts.map +1 -0
- package/dist/node/config.js +2 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/index.d.ts +6 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +6 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/not-configured-message.d.ts +10 -0
- package/dist/node/not-configured-message.d.ts.map +1 -0
- package/dist/node/not-configured-message.js +24 -0
- package/dist/node/not-configured-message.js.map +1 -0
- package/dist/node/proxy.d.ts +25 -0
- package/dist/node/proxy.d.ts.map +1 -0
- package/dist/node/proxy.js +229 -0
- package/dist/node/proxy.js.map +1 -0
- package/dist/node/runtime.d.ts +45 -0
- package/dist/node/runtime.d.ts.map +1 -0
- package/dist/node/runtime.js +176 -0
- package/dist/node/runtime.js.map +1 -0
- package/dist/node/scope.d.ts +55 -0
- package/dist/node/scope.d.ts.map +1 -0
- package/dist/node/scope.js +115 -0
- package/dist/node/scope.js.map +1 -0
- package/dist/node/server.d.ts +80 -0
- package/dist/node/server.d.ts.map +1 -0
- package/dist/node/server.js +283 -0
- package/dist/node/server.js.map +1 -0
- package/dist/plugins/define.d.ts +4 -0
- package/dist/plugins/define.d.ts.map +1 -0
- package/dist/plugins/define.js +45 -0
- package/dist/plugins/define.js.map +1 -0
- package/dist/plugins/index.d.ts +27 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/inspect.d.ts +79 -0
- package/dist/plugins/inspect.d.ts.map +1 -0
- package/dist/plugins/inspect.js +142 -0
- package/dist/plugins/inspect.js.map +1 -0
- package/dist/plugins/resolve.d.ts +14 -0
- package/dist/plugins/resolve.d.ts.map +1 -0
- package/dist/plugins/resolve.js +101 -0
- package/dist/plugins/resolve.js.map +1 -0
- package/dist/plugins/types.d.ts +91 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/proxy/http-proxy.d.ts +8 -0
- package/dist/proxy/http-proxy.d.ts.map +1 -0
- package/dist/proxy/http-proxy.js +59 -0
- package/dist/proxy/http-proxy.js.map +1 -0
- package/dist/proxy/index.d.ts +3 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/index.js +3 -0
- package/dist/proxy/index.js.map +1 -0
- package/dist/proxy/origin.d.ts +12 -0
- package/dist/proxy/origin.d.ts.map +1 -0
- package/dist/proxy/origin.js +61 -0
- package/dist/proxy/origin.js.map +1 -0
- package/dist/queue/config.d.ts +4 -0
- package/dist/queue/config.d.ts.map +1 -0
- package/dist/queue/config.js +2 -0
- package/dist/queue/config.js.map +1 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/index.js +4 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/provider.d.ts +24 -0
- package/dist/queue/provider.d.ts.map +1 -0
- package/dist/queue/provider.js +57 -0
- package/dist/queue/provider.js.map +1 -0
- package/dist/queue/token.d.ts +9 -0
- package/dist/queue/token.d.ts.map +1 -0
- package/dist/queue/token.js +8 -0
- package/dist/queue/token.js.map +1 -0
- package/dist/realtime/index.d.ts +6 -0
- package/dist/realtime/index.d.ts.map +1 -0
- package/dist/realtime/index.js +6 -0
- package/dist/realtime/index.js.map +1 -0
- package/dist/realtime/provider.d.ts +10 -0
- package/dist/realtime/provider.d.ts.map +1 -0
- package/dist/realtime/provider.js +19 -0
- package/dist/realtime/provider.js.map +1 -0
- package/dist/realtime/service.d.ts +9 -0
- package/dist/realtime/service.d.ts.map +1 -0
- package/dist/realtime/service.js +347 -0
- package/dist/realtime/service.js.map +1 -0
- package/dist/realtime/types.d.ts +74 -0
- package/dist/realtime/types.d.ts.map +1 -0
- package/dist/realtime/types.js +4 -0
- package/dist/realtime/types.js.map +1 -0
- package/dist/realtime/websocket.d.ts +7 -0
- package/dist/realtime/websocket.d.ts.map +1 -0
- package/dist/realtime/websocket.js +57 -0
- package/dist/realtime/websocket.js.map +1 -0
- package/dist/router/api-error.d.ts +171 -0
- package/dist/router/api-error.d.ts.map +1 -0
- package/dist/router/api-error.js +291 -0
- package/dist/router/api-error.js.map +1 -0
- package/dist/router/api-limits.d.ts +80 -0
- package/dist/router/api-limits.d.ts.map +1 -0
- package/dist/router/api-limits.js +281 -0
- package/dist/router/api-limits.js.map +1 -0
- package/dist/router/cli/derive.d.ts +32 -0
- package/dist/router/cli/derive.d.ts.map +1 -0
- package/dist/router/cli/derive.js +548 -0
- package/dist/router/cli/derive.js.map +1 -0
- package/dist/router/cli/index.d.ts +6 -0
- package/dist/router/cli/index.d.ts.map +1 -0
- package/dist/router/cli/index.js +6 -0
- package/dist/router/cli/index.js.map +1 -0
- package/dist/router/cli/reference.d.ts +9 -0
- package/dist/router/cli/reference.d.ts.map +1 -0
- package/dist/router/cli/reference.js +64 -0
- package/dist/router/cli/reference.js.map +1 -0
- package/dist/router/cli/routes.d.ts +9 -0
- package/dist/router/cli/routes.d.ts.map +1 -0
- package/dist/router/cli/routes.js +228 -0
- package/dist/router/cli/routes.js.map +1 -0
- package/dist/router/cli/service.d.ts +50 -0
- package/dist/router/cli/service.d.ts.map +1 -0
- package/dist/router/cli/service.js +104 -0
- package/dist/router/cli/service.js.map +1 -0
- package/dist/router/cli/types.d.ts +278 -0
- package/dist/router/cli/types.d.ts.map +1 -0
- package/dist/router/cli/types.js +18 -0
- package/dist/router/cli/types.js.map +1 -0
- package/dist/router/duplicate-routes.d.ts +25 -0
- package/dist/router/duplicate-routes.d.ts.map +1 -0
- package/dist/router/duplicate-routes.js +51 -0
- package/dist/router/duplicate-routes.js.map +1 -0
- package/dist/router/health.d.ts +7 -0
- package/dist/router/health.d.ts.map +1 -0
- package/dist/router/health.js +48 -0
- package/dist/router/health.js.map +1 -0
- package/dist/router/index.d.ts +26 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +29 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/openapi/components.d.ts +24 -0
- package/dist/router/openapi/components.d.ts.map +1 -0
- package/dist/router/openapi/components.js +128 -0
- package/dist/router/openapi/components.js.map +1 -0
- package/dist/router/openapi/declared.d.ts +19 -0
- package/dist/router/openapi/declared.d.ts.map +1 -0
- package/dist/router/openapi/declared.js +46 -0
- package/dist/router/openapi/declared.js.map +1 -0
- package/dist/router/openapi/describe.d.ts +82 -0
- package/dist/router/openapi/describe.d.ts.map +1 -0
- package/dist/router/openapi/describe.js +207 -0
- package/dist/router/openapi/describe.js.map +1 -0
- package/dist/router/openapi/docs-routes.d.ts +10 -0
- package/dist/router/openapi/docs-routes.d.ts.map +1 -0
- package/dist/router/openapi/docs-routes.js +157 -0
- package/dist/router/openapi/docs-routes.js.map +1 -0
- package/dist/router/openapi/document.d.ts +151 -0
- package/dist/router/openapi/document.d.ts.map +1 -0
- package/dist/router/openapi/document.js +471 -0
- package/dist/router/openapi/document.js.map +1 -0
- package/dist/router/openapi/index.d.ts +7 -0
- package/dist/router/openapi/index.d.ts.map +1 -0
- package/dist/router/openapi/index.js +7 -0
- package/dist/router/openapi/index.js.map +1 -0
- package/dist/router/openapi/repository-document.d.ts +30 -0
- package/dist/router/openapi/repository-document.d.ts.map +1 -0
- package/dist/router/openapi/repository-document.js +812 -0
- package/dist/router/openapi/repository-document.js.map +1 -0
- package/dist/router/openapi/schema.d.ts +30 -0
- package/dist/router/openapi/schema.d.ts.map +1 -0
- package/dist/router/openapi/schema.js +301 -0
- package/dist/router/openapi/schema.js.map +1 -0
- package/dist/router/openapi/service.d.ts +101 -0
- package/dist/router/openapi/service.d.ts.map +1 -0
- package/dist/router/openapi/service.js +162 -0
- package/dist/router/openapi/service.js.map +1 -0
- package/dist/router/repository-constraints.d.ts +15 -0
- package/dist/router/repository-constraints.d.ts.map +1 -0
- package/dist/router/repository-constraints.js +14 -0
- package/dist/router/repository-constraints.js.map +1 -0
- package/dist/router/repository-routes.d.ts +90 -0
- package/dist/router/repository-routes.d.ts.map +1 -0
- package/dist/router/repository-routes.js +452 -0
- package/dist/router/repository-routes.js.map +1 -0
- package/dist/router/routes.d.ts +24 -0
- package/dist/router/routes.d.ts.map +1 -0
- package/dist/router/routes.js +19 -0
- package/dist/router/routes.js.map +1 -0
- package/dist/runtime/application.d.ts +8 -0
- package/dist/runtime/application.d.ts.map +1 -0
- package/dist/runtime/application.js +22 -0
- package/dist/runtime/application.js.map +1 -0
- package/dist/runtime/definition.d.ts +50 -0
- package/dist/runtime/definition.d.ts.map +1 -0
- package/dist/runtime/definition.js +82 -0
- package/dist/runtime/definition.js.map +1 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/lifecycle.d.ts +29 -0
- package/dist/runtime/lifecycle.d.ts.map +1 -0
- package/dist/runtime/lifecycle.js +104 -0
- package/dist/runtime/lifecycle.js.map +1 -0
- package/dist/runtime/mount.d.ts +4 -0
- package/dist/runtime/mount.d.ts.map +1 -0
- package/dist/runtime/mount.js +47 -0
- package/dist/runtime/mount.js.map +1 -0
- package/dist/runtime/scope.d.ts +29 -0
- package/dist/runtime/scope.d.ts.map +1 -0
- package/dist/runtime/scope.js +48 -0
- package/dist/runtime/scope.js.map +1 -0
- package/dist/runtime/types.d.ts +55 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +2 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/sample-data/index.d.ts +3 -0
- package/dist/sample-data/index.d.ts.map +1 -0
- package/dist/sample-data/index.js +3 -0
- package/dist/sample-data/index.js.map +1 -0
- package/dist/sample-data/registry.d.ts +4 -0
- package/dist/sample-data/registry.d.ts.map +1 -0
- package/dist/sample-data/registry.js +74 -0
- package/dist/sample-data/registry.js.map +1 -0
- package/dist/sample-data/token.d.ts +64 -0
- package/dist/sample-data/token.d.ts.map +1 -0
- package/dist/sample-data/token.js +7 -0
- package/dist/sample-data/token.js.map +1 -0
- package/dist/secrets/config.d.ts +15 -0
- package/dist/secrets/config.d.ts.map +1 -0
- package/dist/secrets/config.js +43 -0
- package/dist/secrets/config.js.map +1 -0
- package/dist/secrets/index.d.ts +6 -0
- package/dist/secrets/index.d.ts.map +1 -0
- package/dist/secrets/index.js +6 -0
- package/dist/secrets/index.js.map +1 -0
- package/dist/secrets/provider.d.ts +7 -0
- package/dist/secrets/provider.d.ts.map +1 -0
- package/dist/secrets/provider.js +10 -0
- package/dist/secrets/provider.js.map +1 -0
- package/dist/secrets/service.d.ts +64 -0
- package/dist/secrets/service.d.ts.map +1 -0
- package/dist/secrets/service.js +47 -0
- package/dist/secrets/service.js.map +1 -0
- package/dist/secrets/table-store.d.ts +34 -0
- package/dist/secrets/table-store.d.ts.map +1 -0
- package/dist/secrets/table-store.js +118 -0
- package/dist/secrets/table-store.js.map +1 -0
- package/dist/secrets/token.d.ts +4 -0
- package/dist/secrets/token.d.ts.map +1 -0
- package/dist/secrets/token.js +3 -0
- package/dist/secrets/token.js.map +1 -0
- package/dist/session/config.d.ts +10 -0
- package/dist/session/config.d.ts.map +1 -0
- package/dist/session/config.js +2 -0
- package/dist/session/config.js.map +1 -0
- package/dist/session/index.d.ts +4 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +4 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/provider.d.ts +26 -0
- package/dist/session/provider.d.ts.map +1 -0
- package/dist/session/provider.js +69 -0
- package/dist/session/provider.js.map +1 -0
- package/dist/session/token.d.ts +4 -0
- package/dist/session/token.d.ts.map +1 -0
- package/dist/session/token.js +3 -0
- package/dist/session/token.js.map +1 -0
- package/dist/spa/config.d.ts +5 -0
- package/dist/spa/config.d.ts.map +1 -0
- package/dist/spa/config.js +2 -0
- package/dist/spa/config.js.map +1 -0
- package/dist/spa/content-types.d.ts +2 -0
- package/dist/spa/content-types.d.ts.map +1 -0
- package/dist/spa/content-types.js +25 -0
- package/dist/spa/content-types.js.map +1 -0
- package/dist/spa/index.d.ts +9 -0
- package/dist/spa/index.d.ts.map +1 -0
- package/dist/spa/index.js +9 -0
- package/dist/spa/index.js.map +1 -0
- package/dist/spa/provider.d.ts +13 -0
- package/dist/spa/provider.d.ts.map +1 -0
- package/dist/spa/provider.js +90 -0
- package/dist/spa/provider.js.map +1 -0
- package/dist/spa/routes.d.ts +4 -0
- package/dist/spa/routes.d.ts.map +1 -0
- package/dist/spa/routes.js +58 -0
- package/dist/spa/routes.js.map +1 -0
- package/dist/spa/runtime-html.d.ts +14 -0
- package/dist/spa/runtime-html.d.ts.map +1 -0
- package/dist/spa/runtime-html.js +85 -0
- package/dist/spa/runtime-html.js.map +1 -0
- package/dist/spa/serve-index.d.ts +9 -0
- package/dist/spa/serve-index.d.ts.map +1 -0
- package/dist/spa/serve-index.js +12 -0
- package/dist/spa/serve-index.js.map +1 -0
- package/dist/spa/static-assets.d.ts +7 -0
- package/dist/spa/static-assets.d.ts.map +1 -0
- package/dist/spa/static-assets.js +90 -0
- package/dist/spa/static-assets.js.map +1 -0
- package/dist/spa/types.d.ts +23 -0
- package/dist/spa/types.d.ts.map +1 -0
- package/dist/spa/types.js +2 -0
- package/dist/spa/types.js.map +1 -0
- package/dist/support/index.d.ts +4 -0
- package/dist/support/index.d.ts.map +1 -0
- package/dist/support/index.js +4 -0
- package/dist/support/index.js.map +1 -0
- package/dist/support/paths.d.ts +10 -0
- package/dist/support/paths.d.ts.map +1 -0
- package/dist/support/paths.js +25 -0
- package/dist/support/paths.js.map +1 -0
- package/dist/support/redirects.d.ts +3 -0
- package/dist/support/redirects.d.ts.map +1 -0
- package/dist/support/redirects.js +48 -0
- package/dist/support/redirects.js.map +1 -0
- package/dist/support/requests.d.ts +2 -0
- package/dist/support/requests.d.ts.map +1 -0
- package/dist/support/requests.js +13 -0
- package/dist/support/requests.js.map +1 -0
- package/dist/swagger-ui/LICENSE +202 -0
- package/dist/swagger-ui/NOTICE +2 -0
- package/dist/swagger-ui/favicon-16x16.png +0 -0
- package/dist/swagger-ui/favicon-32x32.png +0 -0
- package/dist/swagger-ui/swagger-ui-bundle.js +2 -0
- package/dist/swagger-ui/swagger-ui-bundle.js.LICENSE.txt +129 -0
- package/dist/swagger-ui/swagger-ui.css +3 -0
- package/dist/websocket.d.ts +61 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +371 -0
- package/dist/websocket.js.map +1 -0
- package/package.json +193 -12
- package/LICENSE +0 -661
- package/lib/config/cache.d.ts +0 -2
- package/lib/config/cache.js +0 -16
- package/lib/config/database.d.ts +0 -3
- package/lib/config/database.js +0 -25
- package/lib/config/index.d.ts +0 -10
- package/lib/config/index.js +0 -20
- package/lib/config/logger.d.ts +0 -3
- package/lib/config/logger.js +0 -11
- package/lib/config/plugins.d.ts +0 -3
- package/lib/config/plugins.js +0 -8
- package/lib/config/resourcer.d.ts +0 -4
- package/lib/config/resourcer.js +0 -10
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -21
- package/src/config/cache.ts +0 -5
- package/src/config/database.ts +0 -21
- package/src/config/index.ts +0 -13
- package/src/config/logger.ts +0 -6
- package/src/config/plugins.ts +0 -3
- package/src/config/resourcer.ts +0 -3
- package/src/index.ts +0 -10
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command-line hints on API routes, and the command manifest a CLI builds its commands from. The API document is the
|
|
3
|
+
* single source: every documented operation is a command, named from its tag, path and method unless its `x-cli`
|
|
4
|
+
* extension names it, and `x-cli: false` leaves it out.
|
|
5
|
+
*/
|
|
6
|
+
/** Who calls a command: a person (a session or an API key), or an agent's run (its run token). */
|
|
7
|
+
export type CliIdentity = 'person' | 'run';
|
|
8
|
+
export declare const CLI_IDENTITIES: readonly CliIdentity[];
|
|
9
|
+
/**
|
|
10
|
+
* Where a CLI finds an input the command line leaves out: an environment variable by name, such as
|
|
11
|
+
* `GITHUB_REPOSITORY`, or a field of the JSON file an environment variable names, such as `{ file: 'GITHUB_EVENT_PATH',
|
|
12
|
+
* path: 'pull_request.head.sha' }` (dot-separated keys). An unset or empty variable, an unreadable file and a missing
|
|
13
|
+
* field all fall through to the next source.
|
|
14
|
+
*/
|
|
15
|
+
export type CliEnvDefault = string | {
|
|
16
|
+
readonly file: string;
|
|
17
|
+
readonly path: string;
|
|
18
|
+
};
|
|
19
|
+
/** How one input of a route appears on the command line, keyed by its field name in `CliRouteOptions.flags`. */
|
|
20
|
+
export interface CliFlagOptions {
|
|
21
|
+
/** The flag's name when it is not the kebab-case of the field, such as `reply-to` for `parentId`. */
|
|
22
|
+
readonly name?: string;
|
|
23
|
+
/** A one-letter alias, such as `m`. */
|
|
24
|
+
readonly alias?: string;
|
|
25
|
+
/** Also take `--<flag>-file <path>`, whose contents become the value; for long text such as Markdown. */
|
|
26
|
+
readonly contentFile?: boolean;
|
|
27
|
+
/** Ask for a missing value when a terminal is attached. */
|
|
28
|
+
readonly prompt?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Also take `--from-env` instead of a value: the CLI reads it from its own environment variable whose name is the
|
|
31
|
+
* value given for this other field (such as `name`), so a secret never sits on the command line.
|
|
32
|
+
*/
|
|
33
|
+
readonly fromEnv?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Defaults read from the caller's environment when the flag is not given, the first found wins; a flag given
|
|
36
|
+
* explicitly always wins. For values CI already knows, such as the repository (`['GITHUB_REPOSITORY',
|
|
37
|
+
* 'CI_PROJECT_PATH']`) or the commit being built.
|
|
38
|
+
*/
|
|
39
|
+
readonly env?: readonly CliEnvDefault[];
|
|
40
|
+
/** Replaces the schema's description. */
|
|
41
|
+
readonly description?: string;
|
|
42
|
+
/** Not offered on the command line; the field keeps its default. */
|
|
43
|
+
readonly hidden?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Files sent before the request itself: each file named by `--<flag>` is uploaded to the operation `upload` (a
|
|
47
|
+
* `multipart/form-data` route answering `{ data: { id } }`), and the ids it answers fill the body field `field`.
|
|
48
|
+
*/
|
|
49
|
+
export interface CliUploadOptions {
|
|
50
|
+
/** The operationId of the upload route. */
|
|
51
|
+
readonly upload: string;
|
|
52
|
+
/** The body field the uploaded ids fill. */
|
|
53
|
+
readonly field: string;
|
|
54
|
+
/** The form field the file goes in on the upload route; `file` when left out. */
|
|
55
|
+
readonly part?: string;
|
|
56
|
+
readonly multiple?: boolean;
|
|
57
|
+
readonly description?: string;
|
|
58
|
+
/** Per file. */
|
|
59
|
+
readonly maxBytes?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One file sent beside the request rather than in it: the route answers an upload ticket (`{ data: { url, method,
|
|
63
|
+
* headers, message? } }`) and the CLI streams the file named by `--<flag>` straight to it, with the ticket's headers
|
|
64
|
+
* only. The upload's answer is the command's result.
|
|
65
|
+
*/
|
|
66
|
+
export interface CliTicketUploadOptions {
|
|
67
|
+
/** The flag naming the file, such as `file`. */
|
|
68
|
+
readonly flag: string;
|
|
69
|
+
readonly maxBytes: number;
|
|
70
|
+
/** Extensions such as `.tar.gz`; any when left out. */
|
|
71
|
+
readonly accept?: readonly string[];
|
|
72
|
+
readonly description?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The file may be left out, and the route then answers its own result rather than a ticket. To tell the two apart,
|
|
75
|
+
* the CLI sends the file's name in the body field named like the flag when it is given: the route's body declares
|
|
76
|
+
* that field (a string), which the command does not offer as a flag of its own.
|
|
77
|
+
*/
|
|
78
|
+
readonly optional?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The files of a directory on the caller's machine that differ from the manifest it holds, sent with the request as
|
|
82
|
+
* `multipart/form-data` parts named `field`, each file named by its path inside the directory. The CLI looks for
|
|
83
|
+
* `dir` at its working directory and each one above it; `manifest` is a JSON array of `{ path, hash }` (SHA-256, hex).
|
|
84
|
+
* The boolean `--<flag>` sends them; without it the request goes as it would without the input.
|
|
85
|
+
*/
|
|
86
|
+
export interface CliChangedFilesOptions {
|
|
87
|
+
/** The boolean flag, such as `changed`. */
|
|
88
|
+
readonly flag: string;
|
|
89
|
+
/** The form field each file goes in. */
|
|
90
|
+
readonly field: string;
|
|
91
|
+
/** Relative, such as `.nocobase-runner/knowledge`. */
|
|
92
|
+
readonly dir: string;
|
|
93
|
+
/** Inside `dir`, such as `.manifest.json`. */
|
|
94
|
+
readonly manifest: string;
|
|
95
|
+
/** Per file. */
|
|
96
|
+
readonly maxBytes: number;
|
|
97
|
+
readonly maxFiles: number;
|
|
98
|
+
/** Extensions such as `.md`; any when left out. */
|
|
99
|
+
readonly accept?: readonly string[];
|
|
100
|
+
readonly description?: string;
|
|
101
|
+
}
|
|
102
|
+
/** The `x-cli` extension of an operation. */
|
|
103
|
+
export interface CliRouteOptions {
|
|
104
|
+
/** The command's words, such as `issue comment add`; derived from the tag, path and method when left out. */
|
|
105
|
+
readonly command?: string;
|
|
106
|
+
/** The fields given as positional arguments, in order; the path parameters, in path order, when left out. */
|
|
107
|
+
readonly args?: readonly string[];
|
|
108
|
+
/** Per field: how it appears on the command line. */
|
|
109
|
+
readonly flags?: Readonly<Record<string, CliFlagOptions>>;
|
|
110
|
+
/** A flag whose JSON file is the whole request body, such as `file` for `--file issue.json`. */
|
|
111
|
+
readonly bodyFile?: string;
|
|
112
|
+
/** Files uploaded first, by flag name. */
|
|
113
|
+
readonly uploads?: Readonly<Record<string, CliUploadOptions>>;
|
|
114
|
+
/** A file streamed to the upload ticket the route answers. */
|
|
115
|
+
readonly ticketUpload?: CliTicketUploadOptions;
|
|
116
|
+
/** Changed files of a directory, sent with the request. */
|
|
117
|
+
readonly changedFiles?: CliChangedFilesOptions;
|
|
118
|
+
/** The fields a list shows as a table, in order; the first scalar fields when left out. */
|
|
119
|
+
readonly columns?: readonly string[];
|
|
120
|
+
/** Asks before running, with this question, unless `--yes` is given. */
|
|
121
|
+
readonly confirm?: string;
|
|
122
|
+
/** Who may call it; from the operation's security requirements when left out. */
|
|
123
|
+
readonly identities?: readonly CliIdentity[];
|
|
124
|
+
/** Example command lines, without the CLI's name. */
|
|
125
|
+
readonly examples?: readonly string[];
|
|
126
|
+
/** The business action the command performs, such as `pm.issues/comment`; a caller without it is not offered it. */
|
|
127
|
+
readonly action?: string;
|
|
128
|
+
/** Left out of the manifest, while staying documented. */
|
|
129
|
+
readonly hidden?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/** The operation extension `cliRoute()` produces. */
|
|
132
|
+
export declare const CLI_EXTENSION = "x-cli";
|
|
133
|
+
export interface CliRouteExtension {
|
|
134
|
+
readonly 'x-cli': CliRouteOptions | false;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The `x-cli` extension for `describeRoute()`: `describeRoute({ tags, summary, operationId, ...cliRoute({ command:
|
|
138
|
+
* 'issue comment add', args: ['issueId'] }) })`. `cliRoute(false)` keeps the route out of the CLI.
|
|
139
|
+
*/
|
|
140
|
+
export declare function cliRoute(options: CliRouteOptions | false): CliRouteExtension;
|
|
141
|
+
/**
|
|
142
|
+
* Operations an application keeps off its command line while they stay documented (`CliService.exclude()`), such as a
|
|
143
|
+
* library's browser-only flows or the protocol between the application and its own machines.
|
|
144
|
+
*/
|
|
145
|
+
export interface CliExclusion {
|
|
146
|
+
/** Every operation whose first tag is one of these, such as `Authorization`. */
|
|
147
|
+
readonly tags?: readonly string[];
|
|
148
|
+
/** Every operation whose path starts with one of these, such as `/api/auth/`; the path is below the base path. */
|
|
149
|
+
readonly paths?: readonly string[];
|
|
150
|
+
readonly operationIds?: readonly string[];
|
|
151
|
+
}
|
|
152
|
+
/** One input of a command, as the manifest describes it. */
|
|
153
|
+
export interface CliParameter {
|
|
154
|
+
/** The argument's or flag's name on the command line. */
|
|
155
|
+
readonly name: string;
|
|
156
|
+
/** Its name in the request: the path or query parameter, or the body field. */
|
|
157
|
+
readonly field: string;
|
|
158
|
+
readonly in: 'path' | 'query' | 'body' | 'file';
|
|
159
|
+
/** Its place among the positional arguments; a flag has none. */
|
|
160
|
+
readonly position?: number;
|
|
161
|
+
readonly type: 'string' | 'number' | 'integer' | 'boolean' | 'string[]' | 'number[]' | 'json';
|
|
162
|
+
readonly required: boolean;
|
|
163
|
+
readonly description?: string;
|
|
164
|
+
readonly enum?: readonly string[];
|
|
165
|
+
readonly default?: unknown;
|
|
166
|
+
readonly alias?: string;
|
|
167
|
+
readonly contentFile?: boolean;
|
|
168
|
+
readonly prompt?: boolean;
|
|
169
|
+
/** `--from-env` fills it from the environment variable named by the value of this field (`CliFlagOptions.fromEnv`). */
|
|
170
|
+
readonly fromEnv?: string;
|
|
171
|
+
/** Read from the caller's environment when not given, the first found wins (`CliFlagOptions.env`). */
|
|
172
|
+
readonly env?: readonly CliEnvDefault[];
|
|
173
|
+
/** For `in: 'file'`: where each file is uploaded first, and which body field its id fills. */
|
|
174
|
+
readonly upload?: {
|
|
175
|
+
readonly method: string;
|
|
176
|
+
readonly path: string;
|
|
177
|
+
readonly part: string;
|
|
178
|
+
readonly field: string;
|
|
179
|
+
readonly multiple: boolean;
|
|
180
|
+
readonly maxBytes?: number;
|
|
181
|
+
};
|
|
182
|
+
/** For `in: 'file'`: the file is streamed to the upload ticket the route answers. */
|
|
183
|
+
readonly ticket?: {
|
|
184
|
+
readonly maxBytes: number;
|
|
185
|
+
readonly accept?: readonly string[];
|
|
186
|
+
/** The file may be left out; when given, its name goes in the body field `field` (`CliTicketUploadOptions.optional`). */
|
|
187
|
+
readonly optional?: boolean;
|
|
188
|
+
};
|
|
189
|
+
/** For `in: 'file'`: the boolean flag sends the changed files of a directory as `field` parts. */
|
|
190
|
+
readonly changed?: {
|
|
191
|
+
readonly dir: string;
|
|
192
|
+
readonly manifest: string;
|
|
193
|
+
readonly maxBytes: number;
|
|
194
|
+
readonly maxFiles: number;
|
|
195
|
+
readonly accept?: readonly string[];
|
|
196
|
+
};
|
|
197
|
+
/** A file part of a `multipart/form-data` body (`in: 'body'`). */
|
|
198
|
+
readonly binary?: boolean;
|
|
199
|
+
readonly multiple?: boolean;
|
|
200
|
+
}
|
|
201
|
+
export type CliOutputKind = 'data' | 'list' | 'empty' | 'download';
|
|
202
|
+
/** One command of the manifest. */
|
|
203
|
+
export interface CliCommand {
|
|
204
|
+
/** Its words joined by `:`, such as `issue:comment:add`. */
|
|
205
|
+
readonly id: string;
|
|
206
|
+
readonly summary: string;
|
|
207
|
+
readonly description?: string;
|
|
208
|
+
readonly operationId?: string;
|
|
209
|
+
readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
210
|
+
/** The request path below the server's origin, the application's base path included, with `{name}` placeholders. */
|
|
211
|
+
readonly path: string;
|
|
212
|
+
readonly parameters: readonly CliParameter[];
|
|
213
|
+
/** How the body travels; none for a request without one. */
|
|
214
|
+
readonly body?: {
|
|
215
|
+
readonly media: 'application/json' | 'multipart/form-data';
|
|
216
|
+
/** A flag whose JSON file is the whole body. */
|
|
217
|
+
readonly file?: string;
|
|
218
|
+
readonly required?: boolean;
|
|
219
|
+
};
|
|
220
|
+
readonly output: {
|
|
221
|
+
readonly kind: CliOutputKind;
|
|
222
|
+
readonly columns?: readonly string[];
|
|
223
|
+
};
|
|
224
|
+
readonly confirm?: string;
|
|
225
|
+
readonly examples?: readonly string[];
|
|
226
|
+
readonly identities: readonly CliIdentity[];
|
|
227
|
+
readonly action?: string;
|
|
228
|
+
}
|
|
229
|
+
/** Who a manifest is built for. */
|
|
230
|
+
export interface CliCaller {
|
|
231
|
+
readonly kind: CliIdentity;
|
|
232
|
+
/** The person: the caller, or for a run the person who woke the agent. */
|
|
233
|
+
readonly userId: string;
|
|
234
|
+
readonly displayName: string;
|
|
235
|
+
readonly runId?: string;
|
|
236
|
+
/** The business actions the caller holds; a command with an action outside them is left out. None when absent. */
|
|
237
|
+
readonly actions?: ReadonlySet<string>;
|
|
238
|
+
}
|
|
239
|
+
export interface CliManifestIdentity {
|
|
240
|
+
readonly kind: CliIdentity;
|
|
241
|
+
readonly userId: string;
|
|
242
|
+
readonly displayName: string;
|
|
243
|
+
readonly runId?: string;
|
|
244
|
+
/** The business actions the caller holds, sorted; what decides which commands that name one it is offered. */
|
|
245
|
+
readonly actions: readonly string[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* A command the API document describes that the caller is not offered, so a CLI can say why instead of "unknown
|
|
249
|
+
* command": it is another identity's (`identity`), or it names an action the caller does not hold (`action`).
|
|
250
|
+
*/
|
|
251
|
+
export interface CliWithheldCommand {
|
|
252
|
+
readonly id: string;
|
|
253
|
+
readonly summary: string;
|
|
254
|
+
readonly reason: 'identity' | 'action';
|
|
255
|
+
readonly identities: readonly CliIdentity[];
|
|
256
|
+
readonly action?: string;
|
|
257
|
+
}
|
|
258
|
+
/** What `CliService.describe()` tells about the application's CLI, for the agent-readable reference. */
|
|
259
|
+
export interface CliDescription {
|
|
260
|
+
/** The CLI's command name, such as `acme`. */
|
|
261
|
+
readonly bin?: string;
|
|
262
|
+
/** The application's name, such as `Acme`. */
|
|
263
|
+
readonly title?: string;
|
|
264
|
+
/** Lines added to the reference's introduction, such as where the guides are. */
|
|
265
|
+
readonly notes?: readonly string[];
|
|
266
|
+
}
|
|
267
|
+
/** The `version` of the manifest format. */
|
|
268
|
+
export declare const CLI_MANIFEST_VERSION = 4;
|
|
269
|
+
export interface CliManifest {
|
|
270
|
+
readonly version: number;
|
|
271
|
+
/** Changes whenever the commands change; a CLI caches by it. */
|
|
272
|
+
readonly etag: string;
|
|
273
|
+
readonly identity: CliManifestIdentity;
|
|
274
|
+
readonly commands: readonly CliCommand[];
|
|
275
|
+
/** The commands the caller is not offered, and why. */
|
|
276
|
+
readonly withheld: readonly CliWithheldCommand[];
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/router/cli/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kGAAkG;AAClG,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE3C,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAAsB,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACvB,MAAM,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;A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CAAC,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAC;IACzC,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAClD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command-line hints on API routes, and the command manifest a CLI builds its commands from. The API document is the
|
|
3
|
+
* single source: every documented operation is a command, named from its tag, path and method unless its `x-cli`
|
|
4
|
+
* extension names it, and `x-cli: false` leaves it out.
|
|
5
|
+
*/
|
|
6
|
+
export const CLI_IDENTITIES = ['person', 'run'];
|
|
7
|
+
/** The operation extension `cliRoute()` produces. */
|
|
8
|
+
export const CLI_EXTENSION = 'x-cli';
|
|
9
|
+
/**
|
|
10
|
+
* The `x-cli` extension for `describeRoute()`: `describeRoute({ tags, summary, operationId, ...cliRoute({ command:
|
|
11
|
+
* 'issue comment add', args: ['issueId'] }) })`. `cliRoute(false)` keeps the route out of the CLI.
|
|
12
|
+
*/
|
|
13
|
+
export function cliRoute(options) {
|
|
14
|
+
return { 'x-cli': options };
|
|
15
|
+
}
|
|
16
|
+
/** The `version` of the manifest format. */
|
|
17
|
+
export const CLI_MANIFEST_VERSION = 4;
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/router/cli/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,CAAC,MAAM,cAAc,GAA2B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAgIxE,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC;AAMrC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgC;IACvD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC;AA+ID,4CAA4C;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Hono } from 'hono';
|
|
2
|
+
/** One API contribution's router, labelled with whatever registered it. */
|
|
3
|
+
export interface OwnedApiRouter {
|
|
4
|
+
readonly owner: string;
|
|
5
|
+
readonly router: Hono;
|
|
6
|
+
/**
|
|
7
|
+
* Where the router's paths start below the API prefix, such as `/authorization` for a router a dispatcher forwards
|
|
8
|
+
* requests under `/api/authorization` to. Defaults to none: the router is mounted on the API router itself.
|
|
9
|
+
*/
|
|
10
|
+
readonly mount?: string;
|
|
11
|
+
/** Which of the router's endpoints, by path below the API prefix, take part in the check. Defaults to all of them. */
|
|
12
|
+
readonly includes?: (path: string) => boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Fails when two API routes answer the same method and path. Hono matches in registration order and lets the first
|
|
16
|
+
* match win, so the second registration would never run and nothing would say so.
|
|
17
|
+
*
|
|
18
|
+
* Hono records one entry per handler, so `router.post('/x', limit, validate, handle)` is three entries for a single
|
|
19
|
+
* route, and `router.use()` is an `ALL` entry. Only entries whose handler is not a middleware — Hono's own test, a
|
|
20
|
+
* handler that does not take `next` — count as endpoints, which leaves exactly one per route. Two endpoints conflict
|
|
21
|
+
* when their patterns match and their methods are equal or either is `ALL`, whether they come from two contributions
|
|
22
|
+
* or from the same router.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertNoDuplicateApiRoutes(routers: readonly OwnedApiRouter[], prefix?: string): void;
|
|
25
|
+
//# sourceMappingURL=duplicate-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-routes.d.ts","sourceRoot":"","sources":["../../src/router/duplicate-routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGjC,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sHAAsH;IACtH,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/C;AA4BD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,MAAM,GAAE,MAAe,GACtB,IAAI,CA4BN"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { inspectRoutes } from 'hono/dev';
|
|
2
|
+
/**
|
|
3
|
+
* Reduces a Hono path to its pattern: a parameter's name does not change what it matches, so `/a/:x` and `/a/:y` are
|
|
4
|
+
* the same route, while a regular expression or an optional marker after the name does and is kept.
|
|
5
|
+
*/
|
|
6
|
+
function normalizeRoutePattern(path) {
|
|
7
|
+
return path
|
|
8
|
+
.split('/')
|
|
9
|
+
.map((segment) => segment.startsWith(':') ? segment.replace(/^:[^{?]*/, ':') : segment)
|
|
10
|
+
.join('/');
|
|
11
|
+
}
|
|
12
|
+
function describeEndpoint(endpoint, prefix) {
|
|
13
|
+
return `${endpoint.method} ${prefix}${endpoint.path} from ${endpoint.owner}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Fails when two API routes answer the same method and path. Hono matches in registration order and lets the first
|
|
17
|
+
* match win, so the second registration would never run and nothing would say so.
|
|
18
|
+
*
|
|
19
|
+
* Hono records one entry per handler, so `router.post('/x', limit, validate, handle)` is three entries for a single
|
|
20
|
+
* route, and `router.use()` is an `ALL` entry. Only entries whose handler is not a middleware — Hono's own test, a
|
|
21
|
+
* handler that does not take `next` — count as endpoints, which leaves exactly one per route. Two endpoints conflict
|
|
22
|
+
* when their patterns match and their methods are equal or either is `ALL`, whether they come from two contributions
|
|
23
|
+
* or from the same router.
|
|
24
|
+
*/
|
|
25
|
+
export function assertNoDuplicateApiRoutes(routers, prefix = '/api') {
|
|
26
|
+
const endpoints = new Map();
|
|
27
|
+
for (const { owner, router, mount = '', includes } of routers) {
|
|
28
|
+
for (const route of inspectRoutes(router)) {
|
|
29
|
+
if (route.isMiddleware)
|
|
30
|
+
continue;
|
|
31
|
+
const endpoint = {
|
|
32
|
+
owner,
|
|
33
|
+
method: route.method,
|
|
34
|
+
path: `${mount}${route.path === '/' && mount ? '' : route.path}`,
|
|
35
|
+
};
|
|
36
|
+
if (includes && !includes(endpoint.path))
|
|
37
|
+
continue;
|
|
38
|
+
const pattern = normalizeRoutePattern(endpoint.path);
|
|
39
|
+
const registered = endpoints.get(pattern) ?? [];
|
|
40
|
+
const existing = registered.find((candidate) => candidate.method === endpoint.method ||
|
|
41
|
+
candidate.method === 'ALL' ||
|
|
42
|
+
endpoint.method === 'ALL');
|
|
43
|
+
if (existing) {
|
|
44
|
+
throw new Error(`Duplicate API route: ${describeEndpoint(existing, prefix)} and ${describeEndpoint(endpoint, prefix)} answer the same requests. Only the first would ever run; remove or rename one of them.`);
|
|
45
|
+
}
|
|
46
|
+
registered.push(endpoint);
|
|
47
|
+
endpoints.set(pattern, registered);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=duplicate-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-routes.js","sour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AAC;gBAAE,SAAS;YACnD,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrD,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAChD,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAC9B,CAAC,SAAS,EAAE,EAAE,CACZ,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBACpC,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC1B,QAAQ,CAAC,MAAM,KAAK,KAAK,CAC5B,CAAC;YACF,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,IAAI,KAAK,CACb,wBAAwB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,yFAAyF,CAC9L,CAAC;YACJ,CAAC;YACD,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AppApiRouteContribution } from './routes.js';
|
|
2
|
+
export interface HealthCheckRoutesApplication {
|
|
3
|
+
readonly appName: string;
|
|
4
|
+
readonly publicBasePath: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const healthCheckApiRoutes: AppApiRouteContribution<HealthCheckRoutesApplication>;
|
|
7
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/router/health.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,eAAO,MAAM,oBAAoB,EAAE,uBAAuB,CAAC,4BAA4B,CAmDnF,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { describeRoute } from 'hono-openapi';
|
|
3
|
+
import { defineApiRoutes } from './routes.js';
|
|
4
|
+
export const healthCheckApiRoutes = defineApiRoutes((app) => {
|
|
5
|
+
const router = new Hono();
|
|
6
|
+
router.get('/healthz', describeRoute({
|
|
7
|
+
tags: ['App'],
|
|
8
|
+
summary: 'Check that the application is up',
|
|
9
|
+
operationId: 'checkHealth',
|
|
10
|
+
// Probes call it without a credential.
|
|
11
|
+
security: [],
|
|
12
|
+
description: 'Answers while the application serves requests. Probes and load balancers read this body, which keeps its own shape rather than `{ data }`.',
|
|
13
|
+
responses: {
|
|
14
|
+
'200': {
|
|
15
|
+
description: 'The application is up.',
|
|
16
|
+
content: {
|
|
17
|
+
'application/json': {
|
|
18
|
+
schema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
required: ['ok', 'app', 'basePath'],
|
|
21
|
+
properties: {
|
|
22
|
+
ok: { const: true },
|
|
23
|
+
app: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
required: ['name', 'basePath'],
|
|
26
|
+
properties: {
|
|
27
|
+
name: { type: 'string' },
|
|
28
|
+
basePath: { type: 'string' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
basePath: { type: 'string' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}), (context) => context.json({
|
|
39
|
+
ok: true,
|
|
40
|
+
app: {
|
|
41
|
+
name: app.appName,
|
|
42
|
+
basePath: app.publicBasePath,
|
|
43
|
+
},
|
|
44
|
+
basePath: app.publicBasePath,
|
|
45
|
+
}));
|
|
46
|
+
return router;
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=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C,IAAI,CAAC;QACX,EAAE,EAAE,IAAI;QACR,GAAG,EAAE;YACH,IAAI,EAAE,GAAG,CAAC,OAAO;YACjB,QAAQ,EAAE,GAAG,CAAC,cAAc;SAC7B;QACD,QAAQ,EAAE,GAAG,CAAC,cAAc;KAC7B,CAAC,CACL,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { ServiceProvider, type ServiceContainer, type ServiceToken } from '@nocobase/service-provider';
|
|
3
|
+
export * from './api-error.js';
|
|
4
|
+
export * from './api-limits.js';
|
|
5
|
+
export * from './health.js';
|
|
6
|
+
export * from './routes.js';
|
|
7
|
+
export * from './repository-routes.js';
|
|
8
|
+
export * from './openapi/index.js';
|
|
9
|
+
export * from './cli/index.js';
|
|
10
|
+
export { addRepositoryRequestConstraint, type RepositoryRequestConstraint, } from './repository-constraints.js';
|
|
11
|
+
/**
|
|
12
|
+
* The HTTP router owned by an application.
|
|
13
|
+
*
|
|
14
|
+
* The router is deliberately exposed as a service rather than being treated
|
|
15
|
+
* as the application itself. This keeps the application lifecycle and
|
|
16
|
+
* framework-specific HTTP implementation separate.
|
|
17
|
+
*/
|
|
18
|
+
export declare const routerToken: ServiceToken<Hono>;
|
|
19
|
+
export interface RouterProviderApplication {
|
|
20
|
+
readonly container: ServiceContainer;
|
|
21
|
+
}
|
|
22
|
+
export declare class RouterProvider<TApplication extends RouterProviderApplication = RouterProviderApplication> extends ServiceProvider<TApplication> {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
register(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,EAErB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AAEpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,8BAA8B,EAC9B,KAAK,2BAA2B,GACjC,MAAM,6BAA6B,CAAC;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,IAAI,CAE1C,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;CACtC;AAED,qBAAa,cAAc,CACzB,YAAY,SAAS,yBAAyB,GAAG,yBAAyB,CAC1E,SAAQ,eAAe,CAAC,YAAY,CAAC;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAY;IAExB,QAAQ,IAAI,IAAI;CAKjC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { CliService, cliToken } from './cli/service.js';
|
|
3
|
+
import { ApiDocsService, apiDocsToken } from './openapi/service.js';
|
|
4
|
+
import { ServiceProvider, createServiceToken, } from '@nocobase/service-provider';
|
|
5
|
+
export * from './api-error.js';
|
|
6
|
+
export * from './api-limits.js';
|
|
7
|
+
export * from './health.js';
|
|
8
|
+
export * from './routes.js';
|
|
9
|
+
export * from './repository-routes.js';
|
|
10
|
+
export * from './openapi/index.js';
|
|
11
|
+
export * from './cli/index.js';
|
|
12
|
+
export { addRepositoryRequestConstraint, } from './repository-constraints.js';
|
|
13
|
+
/**
|
|
14
|
+
* The HTTP router owned by an application.
|
|
15
|
+
*
|
|
16
|
+
* The router is deliberately exposed as a service rather than being treated
|
|
17
|
+
* as the application itself. This keeps the application lifecycle and
|
|
18
|
+
* framework-specific HTTP implementation separate.
|
|
19
|
+
*/
|
|
20
|
+
export const routerToken = createServiceToken('@nocobase/app/router');
|
|
21
|
+
export class RouterProvider extends ServiceProvider {
|
|
22
|
+
name = 'router';
|
|
23
|
+
register() {
|
|
24
|
+
this.app.container.instance(routerToken, new Hono());
|
|
25
|
+
this.app.container.instance(apiDocsToken, new ApiDocsService());
|
|
26
|
+
this.app.container.instance(cliToken, new CliService());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EACL,eAAe,EAEf,kBAAkB,GAEnB,MAAM,4BAA4B,CAAC;AAEpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,8BAA8B,GAE/B,MAAM,6BAA6B,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAuB,kBAAkB,CAC/D,sBAAsB,CACvB,CAAC;AAMF,MAAM,OAAO,cAEX,SAAQ,eAA6B;IACrB,IAAI,GAAW,QAAQ,CAAC;IAExB,QAAQ;QACtB,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,UAAU,EAAE,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from 'openapi-types';
|
|
2
|
+
/** The HTTP statuses that have a shared error response component, with the component's name. */
|
|
3
|
+
export declare const apiErrorResponseNames: {
|
|
4
|
+
readonly 400: 'BadRequest';
|
|
5
|
+
readonly 401: 'Unauthenticated';
|
|
6
|
+
readonly 403: 'PermissionDenied';
|
|
7
|
+
readonly 404: 'NotFound';
|
|
8
|
+
readonly 409: 'Conflict';
|
|
9
|
+
readonly 413: 'PayloadTooLarge';
|
|
10
|
+
readonly 415: 'UnsupportedMediaType';
|
|
11
|
+
readonly 429: 'TooManyRequests';
|
|
12
|
+
readonly 500: 'InternalError';
|
|
13
|
+
readonly 501: 'NotImplemented';
|
|
14
|
+
readonly 503: 'Unavailable';
|
|
15
|
+
readonly 504: 'DeadlineExceeded';
|
|
16
|
+
};
|
|
17
|
+
export type ApiErrorResponseCode = keyof typeof apiErrorResponseNames;
|
|
18
|
+
/** The schemas and responses every API document carries: the standard error body and list metadata. */
|
|
19
|
+
export declare function apiDocumentBaseComponents(): OpenAPIV3_1.ComponentsObject;
|
|
20
|
+
/** The description of the 400 a route answers when `apiValidator()` rejects its input. */
|
|
21
|
+
export declare const invalidInputDescription: string;
|
|
22
|
+
/** The shared response `apiValidator()` failures are documented with: the 400 every route with a validator can answer. */
|
|
23
|
+
export declare const invalidInputResponseName = "InvalidInput";
|
|
24
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/router/openapi/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAQjD,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,EAAE;IAClC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,sBAAsB,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;CAcjC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAiBtE,uGAAuG;AACvG,wBAAgB,yBAAyB,IAAI,WAAW,CAAC,gBAAgB,CA+FxE;AAED,0FAA0F;AAC1F,eAAO,MAAM,uBAAuB,EAAE,MACsI,CAAC;AAE7K,0HAA0H;AAC1H,eAAO,MAAM,wBAAwB,iBAAiB,CAAC"}
|