jishushell 0.6.18 → 0.7.3
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/apps/anythingllm-container.yaml +1 -0
- package/apps/browserless-chromium-container.yaml +1 -0
- package/apps/filebrowser-container.yaml +1 -0
- package/apps/hermes-container.yaml +1 -7
- package/apps/immich-container-lite.yaml +337 -0
- package/apps/immich-container.yaml +371 -0
- package/apps/jishu-kb-container.yaml +26 -21
- package/apps/ollama-binary.yaml +1 -0
- package/apps/ollama-cpu-container.yaml +1 -0
- package/apps/ollama-with-hollama-binary.yaml +2 -0
- package/apps/openclaw-binary.yaml +4 -8
- package/apps/openclaw-container.yaml +1 -7
- package/apps/openclaw-with-ollama-container.yaml +1 -0
- package/apps/openclaw-with-searxng-container.yaml +20 -0
- package/apps/searxng-container.yaml +20 -0
- package/apps/weknora-container.yaml +5 -0
- package/dependencies/jishushell-panel-0.7.3.tgz +0 -0
- package/dist/cli/core.js +1 -1
- package/dist/cli/core.js.map +1 -1
- package/dist/cli/doctor.js +96 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/config.d.ts +9 -1
- package/dist/config.js +72 -2
- package/dist/config.js.map +1 -1
- package/dist/install.js +60 -19
- package/dist/install.js.map +1 -1
- package/dist/routes/admin.d.ts +2 -0
- package/dist/routes/admin.js +72 -0
- package/dist/routes/admin.js.map +1 -0
- package/dist/routes/docker.d.ts +2 -0
- package/dist/routes/docker.js +58 -0
- package/dist/routes/docker.js.map +1 -0
- package/dist/routes/file-mounts.js +5 -8
- package/dist/routes/file-mounts.js.map +1 -1
- package/dist/routes/instances.d.ts +0 -14
- package/dist/routes/instances.js +44 -1184
- package/dist/routes/instances.js.map +1 -1
- package/dist/server.d.ts +6 -0
- package/dist/server.js +53 -20
- package/dist/server.js.map +1 -1
- package/dist/services/app-common/catalog-service.js +15 -5
- package/dist/services/app-common/catalog-service.js.map +1 -1
- package/dist/services/app-common/delete-service.js +5 -0
- package/dist/services/app-common/delete-service.js.map +1 -1
- package/dist/services/app-common/instance-store.js +3 -0
- package/dist/services/app-common/instance-store.js.map +1 -1
- package/dist/services/app-common/lifecycle-service.js +12 -4
- package/dist/services/app-common/lifecycle-service.js.map +1 -1
- package/dist/services/app-common/ownership.d.ts +3 -0
- package/dist/services/app-common/ownership.js +11 -0
- package/dist/services/app-common/ownership.js.map +1 -0
- package/dist/services/app-common/runtime-facts.js +2 -0
- package/dist/services/app-common/runtime-facts.js.map +1 -1
- package/dist/services/app-common/spec-materializer.d.ts +0 -1
- package/dist/services/app-common/spec-materializer.js +21 -87
- package/dist/services/app-common/spec-materializer.js.map +1 -1
- package/dist/services/app-common/status-refresh.js +25 -13
- package/dist/services/app-common/status-refresh.js.map +1 -1
- package/dist/services/app-modules/browserless/routes.js +5 -3
- package/dist/services/app-modules/browserless/routes.js.map +1 -1
- package/dist/services/capabilities/contract.d.ts +1 -2
- package/dist/services/capabilities/contract.js +0 -10
- package/dist/services/capabilities/contract.js.map +1 -1
- package/dist/services/capabilities/endpoint-validator.js +0 -1
- package/dist/services/capabilities/endpoint-validator.js.map +1 -1
- package/dist/services/capabilities/health.js +1 -1
- package/dist/services/capabilities/health.js.map +1 -1
- package/dist/services/capability-proxy/http.d.ts +7 -0
- package/dist/services/capability-proxy/http.js +555 -0
- package/dist/services/capability-proxy/http.js.map +1 -0
- package/dist/services/capability-proxy/terminal.d.ts +4 -0
- package/dist/services/capability-proxy/terminal.js +179 -0
- package/dist/services/capability-proxy/terminal.js.map +1 -0
- package/dist/services/connections/admin.js +19 -9
- package/dist/services/connections/admin.js.map +1 -1
- package/dist/services/connections/apply.d.ts +3 -9
- package/dist/services/connections/apply.js +0 -29
- package/dist/services/connections/apply.js.map +1 -1
- package/dist/services/connections/transactor.js +2 -2
- package/dist/services/connections/transactor.js.map +1 -1
- package/dist/services/files/bootstrap.d.ts +7 -0
- package/dist/services/files/bootstrap.js +16 -0
- package/dist/services/files/bootstrap.js.map +1 -0
- package/dist/services/files/photos/upload-page.d.ts +2 -0
- package/dist/services/files/photos/upload-page.js +248 -0
- package/dist/services/files/photos/upload-page.js.map +1 -0
- package/dist/services/files/photos/upload-store.d.ts +74 -0
- package/dist/services/files/photos/upload-store.js +432 -0
- package/dist/services/files/photos/upload-store.js.map +1 -0
- package/dist/services/http/proxy-utils.d.ts +7 -0
- package/dist/services/http/proxy-utils.js +29 -0
- package/dist/services/http/proxy-utils.js.map +1 -0
- package/dist/services/http/request-utils.d.ts +3 -0
- package/dist/services/http/request-utils.js +23 -0
- package/dist/services/http/request-utils.js.map +1 -0
- package/dist/services/instances/manager.d.ts +6 -5
- package/dist/services/instances/manager.js +45 -51
- package/dist/services/instances/manager.js.map +1 -1
- package/dist/services/instances/pairing.d.ts +17 -0
- package/dist/services/instances/pairing.js +53 -0
- package/dist/services/instances/pairing.js.map +1 -0
- package/dist/services/instances/status.d.ts +2 -0
- package/dist/services/instances/status.js +11 -0
- package/dist/services/instances/status.js.map +1 -0
- package/dist/services/integrations/hermes/integration.d.ts +1 -1
- package/dist/services/integrations/hermes/integration.js +7 -8
- package/dist/services/integrations/hermes/integration.js.map +1 -1
- package/dist/services/integrations/immich/client.d.ts +93 -0
- package/dist/services/integrations/immich/client.js +458 -0
- package/dist/services/integrations/immich/client.js.map +1 -0
- package/dist/services/integrations/immich/config.d.ts +15 -0
- package/dist/services/integrations/immich/config.js +178 -0
- package/dist/services/integrations/immich/config.js.map +1 -0
- package/dist/services/integrations/immich/discovery.d.ts +9 -0
- package/dist/services/integrations/immich/discovery.js +101 -0
- package/dist/services/integrations/immich/discovery.js.map +1 -0
- package/dist/services/integrations/immich/gallery-renderer.d.ts +5 -0
- package/dist/services/integrations/immich/gallery-renderer.js +150 -0
- package/dist/services/integrations/immich/gallery-renderer.js.map +1 -0
- package/dist/services/integrations/immich/immich-shim.d.ts +11 -0
- package/dist/services/integrations/immich/immich-shim.js +439 -0
- package/dist/services/integrations/immich/immich-shim.js.map +1 -0
- package/dist/services/integrations/immich/integration.d.ts +18 -0
- package/dist/services/integrations/immich/integration.js +64 -0
- package/dist/services/integrations/immich/integration.js.map +1 -0
- package/dist/services/integrations/immich/photo-library.d.ts +4 -0
- package/dist/services/integrations/immich/photo-library.js +63 -0
- package/dist/services/integrations/immich/photo-library.js.map +1 -0
- package/dist/services/integrations/immich/review-executor.d.ts +3 -0
- package/dist/services/integrations/immich/review-executor.js +41 -0
- package/dist/services/integrations/immich/review-executor.js.map +1 -0
- package/dist/services/integrations/immich/review-session-service.d.ts +27 -0
- package/dist/services/integrations/immich/review-session-service.js +206 -0
- package/dist/services/integrations/immich/review-session-service.js.map +1 -0
- package/dist/services/integrations/immich/review-store.d.ts +47 -0
- package/dist/services/integrations/immich/review-store.js +347 -0
- package/dist/services/integrations/immich/review-store.js.map +1 -0
- package/dist/services/integrations/immich/routes.d.ts +7 -0
- package/dist/services/integrations/immich/routes.js +363 -0
- package/dist/services/integrations/immich/routes.js.map +1 -0
- package/dist/services/integrations/immich/types.d.ts +186 -0
- package/dist/services/integrations/immich/types.js +2 -0
- package/dist/services/integrations/immich/types.js.map +1 -0
- package/dist/services/integrations/index.d.ts +1 -0
- package/dist/services/integrations/index.js +1 -0
- package/dist/services/integrations/index.js.map +1 -1
- package/dist/services/integrations/installable/installers/integration.js +113 -7
- package/dist/services/integrations/installable/installers/integration.js.map +1 -1
- package/dist/services/integrations/jishukb/integration.d.ts +3 -1
- package/dist/services/integrations/jishukb/integration.js +121 -10
- package/dist/services/integrations/jishukb/integration.js.map +1 -1
- package/dist/services/integrations/openclaw/integration.d.ts +21 -7
- package/dist/services/integrations/openclaw/integration.js +385 -158
- package/dist/services/integrations/openclaw/integration.js.map +1 -1
- package/dist/services/integrations/openclaw/jishukb-native-mcp.d.ts +58 -0
- package/dist/services/integrations/openclaw/jishukb-native-mcp.js +373 -0
- package/dist/services/integrations/openclaw/jishukb-native-mcp.js.map +1 -0
- package/dist/services/integrations/openclaw/jishukb-shim.d.ts +8 -4
- package/dist/services/integrations/openclaw/jishukb-shim.js +624 -17
- package/dist/services/integrations/openclaw/jishukb-shim.js.map +1 -1
- package/dist/services/integrations/openclaw/mcporter.d.ts +13 -0
- package/dist/services/integrations/openclaw/mcporter.js +31 -0
- package/dist/services/integrations/openclaw/mcporter.js.map +1 -1
- package/dist/services/integrations/openclaw/native-mcp.d.ts +48 -0
- package/dist/services/integrations/openclaw/native-mcp.js +125 -0
- package/dist/services/integrations/openclaw/native-mcp.js.map +1 -0
- package/dist/services/integrations/openclaw/routes.js +4 -1
- package/dist/services/integrations/openclaw/routes.js.map +1 -1
- package/dist/services/integrations/types.d.ts +5 -17
- package/dist/services/repair/runtime-repair.js +68 -1
- package/dist/services/repair/runtime-repair.js.map +1 -1
- package/dist/services/runtime/docker-network.d.ts +8 -0
- package/dist/services/runtime/docker-network.js +123 -0
- package/dist/services/runtime/docker-network.js.map +1 -0
- package/dist/services/runtime/driver-registry.d.ts +4 -0
- package/dist/services/runtime/driver-registry.js.map +1 -1
- package/dist/services/runtime/drivers/nomad.d.ts +1 -0
- package/dist/services/runtime/drivers/nomad.js +35 -5
- package/dist/services/runtime/drivers/nomad.js.map +1 -1
- package/dist/services/runtime/service-manager.d.ts +2 -0
- package/dist/services/runtime/service-manager.js +18 -0
- package/dist/services/runtime/service-manager.js.map +1 -0
- package/dist/services/runtime/types.d.ts +1 -0
- package/dist/services/runtime/workload-compiler.js +29 -4
- package/dist/services/runtime/workload-compiler.js.map +1 -1
- package/dist/services/setup/setup-manager.js +29 -73
- package/dist/services/setup/setup-manager.js.map +1 -1
- package/dist/services/system/runtime-ownership.d.ts +36 -0
- package/dist/services/system/runtime-ownership.js +250 -0
- package/dist/services/system/runtime-ownership.js.map +1 -0
- package/dist/services/system/system-reconciler.js +53 -0
- package/dist/services/system/system-reconciler.js.map +1 -1
- package/dist/types.d.ts +19 -3
- package/dist/utils/path-safety.js +1 -1
- package/dist/utils/service-user.d.ts +13 -0
- package/dist/utils/service-user.js +129 -0
- package/dist/utils/service-user.js.map +1 -0
- package/install/jishu-install.sh +0 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +24 -14
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +24 -14
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -2
- package/node_modules/fast-uri/index.js +1 -1
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/security.test.js +28 -0
- package/node_modules/fastify/SECURITY.md +1 -1
- package/node_modules/fastify/SPONSORS.md +6 -4
- package/node_modules/fastify/docs/Guides/Database.md +0 -28
- package/node_modules/fastify/docs/Guides/Ecosystem.md +13 -2
- package/node_modules/fastify/docs/Guides/Serverless.md +2 -2
- package/node_modules/fastify/docs/Guides/Write-Plugin.md +1 -1
- package/node_modules/fastify/docs/Reference/Encapsulation.md +27 -26
- package/node_modules/fastify/docs/Reference/Errors.md +10 -4
- package/node_modules/fastify/docs/Reference/HTTP2.md +10 -10
- package/node_modules/fastify/docs/Reference/Hooks.md +4 -4
- package/node_modules/fastify/docs/Reference/Index.md +14 -16
- package/node_modules/fastify/docs/Reference/LTS.md +12 -13
- package/node_modules/fastify/docs/Reference/Lifecycle.md +9 -8
- package/node_modules/fastify/docs/Reference/Logging.md +44 -39
- package/node_modules/fastify/docs/Reference/Middleware.md +21 -25
- package/node_modules/fastify/docs/Reference/Principles.md +2 -2
- package/node_modules/fastify/docs/Reference/Reply.md +6 -1
- package/node_modules/fastify/docs/Reference/Request.md +27 -16
- package/node_modules/fastify/docs/Reference/Routes.md +5 -2
- package/node_modules/fastify/docs/Reference/Server.md +31 -3
- package/node_modules/fastify/docs/Reference/Type-Providers.md +29 -5
- package/node_modules/fastify/docs/Reference/Validation-and-Serialization.md +15 -2
- package/node_modules/fastify/docs/Reference/Warnings.md +7 -6
- package/node_modules/fastify/eslint.config.js +7 -2
- package/node_modules/fastify/fastify.d.ts +8 -3
- package/node_modules/fastify/fastify.js +43 -14
- package/node_modules/fastify/lib/content-type-parser.js +13 -1
- package/node_modules/fastify/lib/decorate.js +11 -3
- package/node_modules/fastify/lib/error-handler.js +4 -3
- package/node_modules/fastify/lib/error-serializer.js +59 -59
- package/node_modules/fastify/lib/errors.js +16 -1
- package/node_modules/fastify/lib/four-oh-four.js +14 -9
- package/node_modules/fastify/lib/handle-request.js +11 -5
- package/node_modules/fastify/lib/plugin-override.js +2 -1
- package/node_modules/fastify/lib/plugin-utils.js +5 -5
- package/node_modules/fastify/lib/reply.js +63 -8
- package/node_modules/fastify/lib/request.js +14 -4
- package/node_modules/fastify/lib/route.js +20 -6
- package/node_modules/fastify/lib/schema-controller.js +1 -1
- package/node_modules/fastify/lib/schemas.js +37 -30
- package/node_modules/fastify/lib/symbols.js +3 -1
- package/node_modules/fastify/lib/validation.js +1 -13
- package/node_modules/fastify/lib/warnings.js +3 -3
- package/node_modules/fastify/package.json +13 -15
- package/node_modules/fastify/scripts/validate-ecosystem-links.js +1 -0
- package/node_modules/fastify/test/bundler/esbuild/package.json +1 -1
- package/node_modules/fastify/test/close-pipelining.test.js +1 -2
- package/node_modules/fastify/test/custom-http-server.test.js +38 -0
- package/node_modules/fastify/test/decorator-instance-properties.test.js +63 -0
- package/node_modules/fastify/test/diagnostics-channel/async-error-handler.test.js +74 -0
- package/node_modules/fastify/test/hooks.test.js +23 -0
- package/node_modules/fastify/test/http-methods/get.test.js +1 -1
- package/node_modules/fastify/test/http2/plain.test.js +135 -0
- package/node_modules/fastify/test/http2/secure-with-fallback.test.js +1 -1
- package/node_modules/fastify/test/https/https.test.js +1 -2
- package/node_modules/fastify/test/internals/errors.test.js +31 -1
- package/node_modules/fastify/test/internals/plugin.test.js +3 -1
- package/node_modules/fastify/test/internals/request.test.js +27 -3
- package/node_modules/fastify/test/internals/schema-controller-perf.test.js +33 -0
- package/node_modules/fastify/test/logger/logging.test.js +18 -1
- package/node_modules/fastify/test/logger/options.test.js +38 -1
- package/node_modules/fastify/test/reply-error.test.js +1 -1
- package/node_modules/fastify/test/reply-trailers.test.js +70 -0
- package/node_modules/fastify/test/request-media-type.test.js +105 -0
- package/node_modules/fastify/test/route-prefix.test.js +34 -0
- package/node_modules/fastify/test/router-options.test.js +222 -11
- package/node_modules/fastify/test/schema-serialization.test.js +108 -0
- package/node_modules/fastify/test/schema-validation.test.js +24 -0
- package/node_modules/fastify/test/scripts/validate-ecosystem-links.test.js +40 -57
- package/node_modules/fastify/test/throw.test.js +14 -0
- package/node_modules/fastify/test/trust-proxy.test.js +21 -0
- package/node_modules/fastify/test/types/content-type-parser.tst.ts +70 -0
- package/node_modules/fastify/test/types/{decorate-request-reply.test-d.ts → decorate-request-reply.tst.ts} +4 -4
- package/node_modules/fastify/test/types/{dummy-plugin.ts → dummy-plugin.mts} +1 -1
- package/node_modules/fastify/test/types/errors.tst.ts +91 -0
- package/node_modules/fastify/test/types/fastify.tst.ts +351 -0
- package/node_modules/fastify/test/types/hooks.tst.ts +578 -0
- package/node_modules/fastify/test/types/instance.tst.ts +597 -0
- package/node_modules/fastify/test/types/{logger.test-d.ts → logger.tst.ts} +61 -62
- package/node_modules/fastify/test/types/plugin.tst.ts +96 -0
- package/node_modules/fastify/test/types/register.tst.ts +245 -0
- package/node_modules/fastify/test/types/reply.tst.ts +297 -0
- package/node_modules/fastify/test/types/request.tst.ts +199 -0
- package/node_modules/fastify/test/types/route.tst.ts +576 -0
- package/node_modules/fastify/test/types/{schema.test-d.ts → schema.tst.ts} +22 -22
- package/node_modules/fastify/test/types/{serverFactory.test-d.ts → serverFactory.tst.ts} +4 -4
- package/node_modules/fastify/test/types/tsconfig.json +9 -0
- package/node_modules/fastify/test/types/{type-provider.test-d.ts → type-provider.tst.ts} +256 -250
- package/node_modules/fastify/test/types/using.tst.ts +14 -0
- package/node_modules/fastify/types/errors.d.ts +3 -0
- package/node_modules/fastify/types/request.d.ts +23 -2
- package/node_modules/jishushell-panel/output/public/assets/{ApiKeyField-NKcbHjNz.js → ApiKeyField-Ce5d1xna.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{Dashboard-Da1fL38t.js → Dashboard-BXame3yg.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{HermesChatPanel-DZvmYsoh.js → HermesChatPanel-BHZtPCJd.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{HermesConfigForm-BLUWlKwm.js → HermesConfigForm-CB3GbNX9.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{InitPassword-BAKsshzk.js → InitPassword-Boab9F6g.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-DrIWCqo-.js +14 -0
- package/node_modules/jishushell-panel/output/public/assets/{Login-DHeOmwI8.js → Login-CzpOkNau.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-CANXyCcL.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{ProviderRecommendations-H0ByEYF0.js → ProviderRecommendations-BABo9VOC.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/Settings-CKp5XxFh.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/Setup-C7xVDPow.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{WeixinLoginPanel-D-T6BxkQ.js → WeixinLoginPanel-B765Xz4C.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/{index-ERt6_ngA.js → index-Bs6DSbiR.js} +6 -6
- package/node_modules/jishushell-panel/output/public/assets/{registry-DF93EzIb.js → registry-sWIZsIEF.js} +2 -2
- package/node_modules/jishushell-panel/output/public/assets/{usePolling-DeoThIQn.js → usePolling-D4IDOQd_.js} +1 -1
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-Df8aUdv8.js +1 -0
- package/node_modules/jishushell-panel/output/public/assets/{vendor-react-Cc84NArf.js → vendor-react-0L0rjmYG.js} +3 -3
- package/node_modules/jishushell-panel/output/public/index.html +3 -3
- package/node_modules/jishushell-panel/package.json +1 -1
- package/node_modules/semver/classes/range.js +6 -2
- package/node_modules/semver/package.json +1 -1
- package/package.json +4 -4
- package/scripts/check-app-spec.mjs +4 -12
- package/scripts/check-architecture-boundaries.mjs +178 -0
- package/scripts/pack-gui-and-send-pi.sh +5 -3
- package/dependencies/jishushell-panel-0.6.18.tgz +0 -0
- package/dist/services/connections/suggestions.d.ts +0 -27
- package/dist/services/connections/suggestions.js +0 -124
- package/dist/services/connections/suggestions.js.map +0 -1
- package/node_modules/fastify/test/types/content-type-parser.test-d.ts +0 -72
- package/node_modules/fastify/test/types/errors.test-d.ts +0 -90
- package/node_modules/fastify/test/types/fastify.test-d.ts +0 -352
- package/node_modules/fastify/test/types/hooks.test-d.ts +0 -550
- package/node_modules/fastify/test/types/import.ts +0 -2
- package/node_modules/fastify/test/types/instance.test-d.ts +0 -588
- package/node_modules/fastify/test/types/plugin.test-d.ts +0 -97
- package/node_modules/fastify/test/types/register.test-d.ts +0 -237
- package/node_modules/fastify/test/types/reply.test-d.ts +0 -254
- package/node_modules/fastify/test/types/request.test-d.ts +0 -188
- package/node_modules/fastify/test/types/route.test-d.ts +0 -553
- package/node_modules/fastify/test/types/using.test-d.ts +0 -17
- package/node_modules/jishushell-panel/output/public/assets/InstanceDetail-Dgyc_TX5.js +0 -14
- package/node_modules/jishushell-panel/output/public/assets/NewInstance-CIy0cYtp.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Settings-DAT-UMfP.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/Setup-g3uckFYR.js +0 -1
- package/node_modules/jishushell-panel/output/public/assets/vendor-i18n-CS8DFbkQ.js +0 -1
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { FastifyErrorConstructor } from '@fastify/error'
|
|
2
|
-
import { expectAssignable } from 'tsd'
|
|
3
|
-
import { errorCodes } from '../../fastify'
|
|
4
|
-
|
|
5
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_NOT_FOUND)
|
|
6
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_OPTIONS_NOT_OBJ)
|
|
7
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_QSP_NOT_FN)
|
|
8
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN)
|
|
9
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN)
|
|
10
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ)
|
|
11
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR)
|
|
12
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_VALIDATION)
|
|
13
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LISTEN_OPTIONS_INVALID)
|
|
14
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ERROR_HANDLER_NOT_FN)
|
|
15
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ERROR_HANDLER_ALREADY_SET)
|
|
16
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_ALREADY_PRESENT)
|
|
17
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_TYPE)
|
|
18
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_EMPTY_TYPE)
|
|
19
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_HANDLER)
|
|
20
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_PARSE_TYPE)
|
|
21
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_BODY_TOO_LARGE)
|
|
22
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_MEDIA_TYPE)
|
|
23
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_CONTENT_LENGTH)
|
|
24
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_EMPTY_JSON_BODY)
|
|
25
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INVALID_JSON_BODY)
|
|
26
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_CTP_INSTANCE_ALREADY_STARTED)
|
|
27
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_ALREADY_PRESENT)
|
|
28
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_DEPENDENCY_INVALID_TYPE)
|
|
29
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_MISSING_DEPENDENCY)
|
|
30
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_AFTER_START)
|
|
31
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_REFERENCE_TYPE)
|
|
32
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DEC_UNDECLARED)
|
|
33
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_HOOK_INVALID_TYPE)
|
|
34
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_HOOK_INVALID_HANDLER)
|
|
35
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_HOOK_INVALID_ASYNC_HANDLER)
|
|
36
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_HOOK_NOT_SUPPORTED)
|
|
37
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_MISSING_MIDDLEWARE)
|
|
38
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_HOOK_TIMEOUT)
|
|
39
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LOG_INVALID_DESTINATION)
|
|
40
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LOG_INVALID_LOGGER)
|
|
41
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LOG_INVALID_LOGGER_INSTANCE)
|
|
42
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LOG_INVALID_LOGGER_CONFIG)
|
|
43
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED)
|
|
44
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REP_INVALID_PAYLOAD_TYPE)
|
|
45
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REP_RESPONSE_BODY_CONSUMED)
|
|
46
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REP_READABLE_STREAM_LOCKED)
|
|
47
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REP_ALREADY_SENT)
|
|
48
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REP_SENT_VALUE)
|
|
49
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SEND_INSIDE_ONERR)
|
|
50
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SEND_UNDEFINED_ERR)
|
|
51
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_BAD_STATUS_CODE)
|
|
52
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_BAD_TRAILER_NAME)
|
|
53
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_BAD_TRAILER_VALUE)
|
|
54
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_FAILED_ERROR_SERIALIZATION)
|
|
55
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_MISSING_SERIALIZATION_FN)
|
|
56
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN)
|
|
57
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REQ_INVALID_VALIDATION_INVOCATION)
|
|
58
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_MISSING_ID)
|
|
59
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_ALREADY_PRESENT)
|
|
60
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_CONTENT_MISSING_SCHEMA)
|
|
61
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_DUPLICATE)
|
|
62
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_VALIDATION_BUILD)
|
|
63
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_SERIALIZATION_BUILD)
|
|
64
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX)
|
|
65
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_INIT_OPTS_INVALID)
|
|
66
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE)
|
|
67
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_DUPLICATED_ROUTE)
|
|
68
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_BAD_URL)
|
|
69
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ASYNC_CONSTRAINT)
|
|
70
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_INVALID_URL)
|
|
71
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_OPTIONS_NOT_OBJ)
|
|
72
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_DUPLICATED_HANDLER)
|
|
73
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_HANDLER_NOT_FN)
|
|
74
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_MISSING_HANDLER)
|
|
75
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_METHOD_INVALID)
|
|
76
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_METHOD_NOT_SUPPORTED)
|
|
77
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED)
|
|
78
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT)
|
|
79
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROUTE_REWRITE_NOT_STR)
|
|
80
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REOPENED_CLOSE_SERVER)
|
|
81
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_REOPENED_SERVER)
|
|
82
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_INSTANCE_ALREADY_LISTENING)
|
|
83
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_VERSION_MISMATCH)
|
|
84
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE)
|
|
85
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER)
|
|
86
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_CALLBACK_NOT_FN)
|
|
87
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_NOT_VALID)
|
|
88
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_ROOT_PLG_BOOTED)
|
|
89
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PARENT_PLUGIN_BOOTED)
|
|
90
|
-
expectAssignable<FastifyErrorConstructor>(errorCodes.FST_ERR_PLUGIN_TIMEOUT)
|
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import Ajv, { ErrorObject as AjvErrorObject } from 'ajv'
|
|
2
|
-
import * as http from 'node:http'
|
|
3
|
-
import * as http2 from 'node:http2'
|
|
4
|
-
import * as https from 'node:https'
|
|
5
|
-
import { Socket } from 'node:net'
|
|
6
|
-
import { expectAssignable, expectError, expectNotAssignable, expectType } from 'tsd'
|
|
7
|
-
import fastify, {
|
|
8
|
-
ConnectionError,
|
|
9
|
-
FastifyBaseLogger,
|
|
10
|
-
FastifyError,
|
|
11
|
-
FastifyErrorCodes,
|
|
12
|
-
FastifyInstance,
|
|
13
|
-
FastifyPlugin,
|
|
14
|
-
FastifyPluginAsync,
|
|
15
|
-
FastifyPluginCallback,
|
|
16
|
-
InjectOptions,
|
|
17
|
-
LightMyRequestCallback,
|
|
18
|
-
LightMyRequestChain,
|
|
19
|
-
LightMyRequestResponse,
|
|
20
|
-
RawRequestDefaultExpression,
|
|
21
|
-
RouteGenericInterface,
|
|
22
|
-
SafePromiseLike
|
|
23
|
-
} from '../../fastify'
|
|
24
|
-
import { Bindings, ChildLoggerOptions } from '../../types/logger'
|
|
25
|
-
|
|
26
|
-
// FastifyInstance
|
|
27
|
-
// http server
|
|
28
|
-
expectError<
|
|
29
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
30
|
-
Promise<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
31
|
-
>(fastify())
|
|
32
|
-
expectAssignable<
|
|
33
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
34
|
-
PromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
35
|
-
>(fastify())
|
|
36
|
-
expectType<
|
|
37
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
38
|
-
SafePromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
39
|
-
>(fastify())
|
|
40
|
-
expectType<
|
|
41
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
42
|
-
SafePromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
43
|
-
>(fastify({}))
|
|
44
|
-
expectType<
|
|
45
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
46
|
-
SafePromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
47
|
-
>(fastify({ http: {} }))
|
|
48
|
-
// https server
|
|
49
|
-
expectType<
|
|
50
|
-
FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse> &
|
|
51
|
-
SafePromiseLike<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse>>
|
|
52
|
-
>(fastify({ https: {} }))
|
|
53
|
-
expectType<
|
|
54
|
-
FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse> &
|
|
55
|
-
SafePromiseLike<FastifyInstance<https.Server, http.IncomingMessage, http.ServerResponse>>
|
|
56
|
-
>(fastify({ https: null }))
|
|
57
|
-
// http2 server
|
|
58
|
-
expectType<
|
|
59
|
-
FastifyInstance<http2.Http2Server, http2.Http2ServerRequest, http2.Http2ServerResponse> &
|
|
60
|
-
SafePromiseLike<FastifyInstance<http2.Http2Server, http2.Http2ServerRequest, http2.Http2ServerResponse>>
|
|
61
|
-
>(fastify({ http2: true, http2SessionTimeout: 1000 }))
|
|
62
|
-
expectType<
|
|
63
|
-
FastifyInstance<http2.Http2SecureServer, http2.Http2ServerRequest, http2.Http2ServerResponse> &
|
|
64
|
-
SafePromiseLike<FastifyInstance<http2.Http2SecureServer, http2.Http2ServerRequest, http2.Http2ServerResponse>>
|
|
65
|
-
>(fastify({ http2: true, https: {}, http2SessionTimeout: 1000 }))
|
|
66
|
-
expectType<LightMyRequestChain>(fastify({ http2: true, https: {} }).inject())
|
|
67
|
-
expectType<
|
|
68
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
69
|
-
SafePromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
70
|
-
>(fastify({ schemaController: {} }))
|
|
71
|
-
expectType<
|
|
72
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse> &
|
|
73
|
-
SafePromiseLike<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse>>
|
|
74
|
-
>(
|
|
75
|
-
fastify({
|
|
76
|
-
schemaController: {
|
|
77
|
-
compilersFactory: {}
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
expectError(fastify<http2.Http2Server>({ http2: false })) // http2 option must be true
|
|
83
|
-
expectError(fastify<http2.Http2SecureServer>({ http2: false })) // http2 option must be true
|
|
84
|
-
expectError(
|
|
85
|
-
fastify({
|
|
86
|
-
schemaController: {
|
|
87
|
-
bucket: () => ({}) // cannot be empty
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
// light-my-request
|
|
93
|
-
expectAssignable<InjectOptions>({ query: '' })
|
|
94
|
-
fastify({ http2: true, https: {} }).inject().then((resp) => {
|
|
95
|
-
expectAssignable<LightMyRequestResponse>(resp)
|
|
96
|
-
})
|
|
97
|
-
const lightMyRequestCallback: LightMyRequestCallback = (
|
|
98
|
-
err: Error | undefined,
|
|
99
|
-
response: LightMyRequestResponse | undefined
|
|
100
|
-
) => {
|
|
101
|
-
if (err) throw err
|
|
102
|
-
}
|
|
103
|
-
fastify({ http2: true, https: {} }).inject({}, lightMyRequestCallback)
|
|
104
|
-
|
|
105
|
-
// server options
|
|
106
|
-
expectAssignable<
|
|
107
|
-
FastifyInstance<http2.Http2Server, http2.Http2ServerRequest, http2.Http2ServerResponse>
|
|
108
|
-
>(fastify({ http2: true }))
|
|
109
|
-
expectAssignable<FastifyInstance>(fastify({ ignoreTrailingSlash: true }))
|
|
110
|
-
expectAssignable<FastifyInstance>(fastify({ ignoreDuplicateSlashes: true }))
|
|
111
|
-
expectAssignable<FastifyInstance>(fastify({ connectionTimeout: 1000 }))
|
|
112
|
-
expectAssignable<FastifyInstance>(fastify({ forceCloseConnections: true }))
|
|
113
|
-
expectAssignable<FastifyInstance>(fastify({ keepAliveTimeout: 1000 }))
|
|
114
|
-
expectAssignable<FastifyInstance>(fastify({ pluginTimeout: 1000 }))
|
|
115
|
-
expectAssignable<FastifyInstance>(fastify({ bodyLimit: 100 }))
|
|
116
|
-
expectAssignable<FastifyInstance>(fastify({ handlerTimeout: 5000 }))
|
|
117
|
-
expectAssignable<FastifyInstance>(fastify({ maxParamLength: 100 }))
|
|
118
|
-
expectAssignable<FastifyInstance>(fastify({ disableRequestLogging: true }))
|
|
119
|
-
expectAssignable<FastifyInstance>(fastify({ disableRequestLogging: (req) => req.url?.includes('/health') ?? false }))
|
|
120
|
-
expectAssignable<FastifyInstance>(fastify({ requestIdLogLabel: 'request-id' }))
|
|
121
|
-
expectAssignable<FastifyInstance>(fastify({ onProtoPoisoning: 'error' }))
|
|
122
|
-
expectAssignable<FastifyInstance>(fastify({ onConstructorPoisoning: 'error' }))
|
|
123
|
-
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { rounding: 'ceil' } }))
|
|
124
|
-
expectAssignable<FastifyInstance>(
|
|
125
|
-
fastify({ serializerOpts: { ajv: { missingRefs: 'ignore' } } })
|
|
126
|
-
)
|
|
127
|
-
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { schema: {} } }))
|
|
128
|
-
expectAssignable<FastifyInstance>(fastify({ serializerOpts: { otherProp: {} } }))
|
|
129
|
-
expectAssignable<
|
|
130
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyBaseLogger>
|
|
131
|
-
>(fastify({ logger: true }))
|
|
132
|
-
expectAssignable<
|
|
133
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyBaseLogger>
|
|
134
|
-
>(fastify({ logger: true }))
|
|
135
|
-
expectAssignable<FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyBaseLogger>>(fastify({
|
|
136
|
-
logger: {
|
|
137
|
-
level: 'info',
|
|
138
|
-
genReqId: () => 'request-id',
|
|
139
|
-
serializers: {
|
|
140
|
-
req: () => {
|
|
141
|
-
return {
|
|
142
|
-
method: 'GET',
|
|
143
|
-
url: '/',
|
|
144
|
-
version: '1.0.0',
|
|
145
|
-
host: 'localhost',
|
|
146
|
-
remoteAddress: '127.0.0.1',
|
|
147
|
-
remotePort: 3000
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
res: () => {
|
|
151
|
-
return {
|
|
152
|
-
statusCode: 200
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
err: () => {
|
|
156
|
-
return {
|
|
157
|
-
type: 'Error',
|
|
158
|
-
message: 'foo',
|
|
159
|
-
stack: ''
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}))
|
|
165
|
-
const customLogger = {
|
|
166
|
-
level: 'info',
|
|
167
|
-
info: () => { },
|
|
168
|
-
warn: () => { },
|
|
169
|
-
error: () => { },
|
|
170
|
-
fatal: () => { },
|
|
171
|
-
trace: () => { },
|
|
172
|
-
debug: () => { },
|
|
173
|
-
child: () => customLogger
|
|
174
|
-
}
|
|
175
|
-
expectAssignable<
|
|
176
|
-
FastifyInstance<http.Server, http.IncomingMessage, http.ServerResponse, FastifyBaseLogger>
|
|
177
|
-
>(fastify({ logger: customLogger }))
|
|
178
|
-
expectAssignable<FastifyInstance>(fastify({ serverFactory: () => http.createServer() }))
|
|
179
|
-
expectAssignable<FastifyInstance>(fastify({ caseSensitive: true }))
|
|
180
|
-
expectAssignable<FastifyInstance>(fastify({ requestIdHeader: 'request-id' }))
|
|
181
|
-
expectAssignable<FastifyInstance>(fastify({ requestIdHeader: false }))
|
|
182
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
183
|
-
genReqId: (req) => {
|
|
184
|
-
expectType<RawRequestDefaultExpression>(req)
|
|
185
|
-
return 'foo'
|
|
186
|
-
}
|
|
187
|
-
}))
|
|
188
|
-
expectAssignable<FastifyInstance>(fastify({ trustProxy: true }))
|
|
189
|
-
expectAssignable<FastifyInstance>(fastify({ querystringParser: () => ({ foo: 'bar' }) }))
|
|
190
|
-
expectAssignable<FastifyInstance>(fastify({ querystringParser: () => ({ foo: { bar: 'fuzz' } }) }))
|
|
191
|
-
expectAssignable<FastifyInstance>(fastify({ querystringParser: () => ({ foo: ['bar', 'fuzz'] }) }))
|
|
192
|
-
expectAssignable<FastifyInstance>(fastify({ constraints: {} }))
|
|
193
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
194
|
-
constraints: {
|
|
195
|
-
version: {
|
|
196
|
-
name: 'version',
|
|
197
|
-
storage: () => ({
|
|
198
|
-
get: () => () => { },
|
|
199
|
-
set: () => { },
|
|
200
|
-
del: () => { },
|
|
201
|
-
empty: () => { }
|
|
202
|
-
}),
|
|
203
|
-
validate () { },
|
|
204
|
-
deriveConstraint: () => 'foo'
|
|
205
|
-
},
|
|
206
|
-
host: {
|
|
207
|
-
name: 'host',
|
|
208
|
-
storage: () => ({
|
|
209
|
-
get: () => () => { },
|
|
210
|
-
set: () => { },
|
|
211
|
-
del: () => { },
|
|
212
|
-
empty: () => { }
|
|
213
|
-
}),
|
|
214
|
-
validate () { },
|
|
215
|
-
deriveConstraint: () => 'foo'
|
|
216
|
-
},
|
|
217
|
-
withObjectValue: {
|
|
218
|
-
name: 'withObjectValue',
|
|
219
|
-
storage: () => ({
|
|
220
|
-
get: () => () => { },
|
|
221
|
-
set: () => { },
|
|
222
|
-
del: () => { },
|
|
223
|
-
empty: () => { }
|
|
224
|
-
}),
|
|
225
|
-
validate () { },
|
|
226
|
-
deriveConstraint: () => { }
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}))
|
|
231
|
-
expectAssignable<FastifyInstance>(fastify({ return503OnClosing: true }))
|
|
232
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
233
|
-
ajv: {
|
|
234
|
-
customOptions: {
|
|
235
|
-
removeAdditional: 'all'
|
|
236
|
-
},
|
|
237
|
-
plugins: [(ajv: Ajv): Ajv => ajv]
|
|
238
|
-
}
|
|
239
|
-
}))
|
|
240
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
241
|
-
ajv: {
|
|
242
|
-
plugins: [[(ajv: Ajv): Ajv => ajv, ['keyword1', 'keyword2']]]
|
|
243
|
-
}
|
|
244
|
-
}))
|
|
245
|
-
expectError(fastify({
|
|
246
|
-
ajv: {
|
|
247
|
-
customOptions: {
|
|
248
|
-
removeAdditional: 'all'
|
|
249
|
-
},
|
|
250
|
-
plugins: [
|
|
251
|
-
() => {
|
|
252
|
-
// error, plugins always return the Ajv instance fluently
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
}))
|
|
257
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
258
|
-
ajv: {
|
|
259
|
-
onCreate: (ajvInstance) => {
|
|
260
|
-
expectType<Ajv>(ajvInstance)
|
|
261
|
-
return ajvInstance
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}))
|
|
265
|
-
expectAssignable<FastifyInstance>(fastify({ frameworkErrors: () => { } }))
|
|
266
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
267
|
-
rewriteUrl: function (req) {
|
|
268
|
-
this.log.debug('rewrite url')
|
|
269
|
-
return req.url === '/hi' ? '/hello' : req.url!
|
|
270
|
-
}
|
|
271
|
-
}))
|
|
272
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
273
|
-
schemaErrorFormatter: (errors, dataVar) => {
|
|
274
|
-
console.log(
|
|
275
|
-
errors[0].keyword.toLowerCase(),
|
|
276
|
-
errors[0].message?.toLowerCase(),
|
|
277
|
-
errors[0].params,
|
|
278
|
-
errors[0].instancePath.toLowerCase(),
|
|
279
|
-
errors[0].schemaPath.toLowerCase()
|
|
280
|
-
)
|
|
281
|
-
return new Error()
|
|
282
|
-
}
|
|
283
|
-
}))
|
|
284
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
285
|
-
clientErrorHandler: (err, socket) => {
|
|
286
|
-
expectType<ConnectionError>(err)
|
|
287
|
-
expectType<Socket>(socket)
|
|
288
|
-
}
|
|
289
|
-
}))
|
|
290
|
-
|
|
291
|
-
expectAssignable<FastifyInstance>(fastify({
|
|
292
|
-
childLoggerFactory: function (
|
|
293
|
-
this: FastifyInstance,
|
|
294
|
-
logger: FastifyBaseLogger,
|
|
295
|
-
bindings: Bindings,
|
|
296
|
-
opts: ChildLoggerOptions,
|
|
297
|
-
req: RawRequestDefaultExpression
|
|
298
|
-
) {
|
|
299
|
-
expectType<FastifyBaseLogger>(logger)
|
|
300
|
-
expectType<Bindings>(bindings)
|
|
301
|
-
expectType<ChildLoggerOptions>(opts)
|
|
302
|
-
expectType<RawRequestDefaultExpression>(req)
|
|
303
|
-
expectAssignable<FastifyInstance>(this)
|
|
304
|
-
return logger.child(bindings, opts)
|
|
305
|
-
}
|
|
306
|
-
}))
|
|
307
|
-
|
|
308
|
-
// Thenable
|
|
309
|
-
expectAssignable<PromiseLike<FastifyInstance>>(fastify({ return503OnClosing: true }))
|
|
310
|
-
fastify().then(fastifyInstance => expectAssignable<FastifyInstance>(fastifyInstance))
|
|
311
|
-
|
|
312
|
-
expectAssignable<FastifyPluginAsync>(async () => { })
|
|
313
|
-
expectAssignable<FastifyPluginCallback>(() => { })
|
|
314
|
-
expectAssignable<FastifyPlugin>(() => { })
|
|
315
|
-
|
|
316
|
-
const ajvErrorObject: AjvErrorObject = {
|
|
317
|
-
keyword: '',
|
|
318
|
-
instancePath: '',
|
|
319
|
-
schemaPath: '',
|
|
320
|
-
params: {},
|
|
321
|
-
message: ''
|
|
322
|
-
}
|
|
323
|
-
expectNotAssignable<AjvErrorObject>({
|
|
324
|
-
keyword: '',
|
|
325
|
-
instancePath: '',
|
|
326
|
-
schemaPath: '',
|
|
327
|
-
params: '',
|
|
328
|
-
message: ''
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
expectAssignable<FastifyError['validation']>([ajvErrorObject])
|
|
332
|
-
expectAssignable<FastifyError['validationContext']>('body')
|
|
333
|
-
expectAssignable<FastifyError['validationContext']>('headers')
|
|
334
|
-
expectAssignable<FastifyError['validationContext']>('params')
|
|
335
|
-
expectAssignable<FastifyError['validationContext']>('querystring')
|
|
336
|
-
|
|
337
|
-
const routeGeneric: RouteGenericInterface = {}
|
|
338
|
-
expectType<unknown>(routeGeneric.Body)
|
|
339
|
-
expectType<unknown>(routeGeneric.Headers)
|
|
340
|
-
expectType<unknown>(routeGeneric.Params)
|
|
341
|
-
expectType<unknown>(routeGeneric.Querystring)
|
|
342
|
-
expectType<unknown>(routeGeneric.Reply)
|
|
343
|
-
|
|
344
|
-
// ErrorCodes
|
|
345
|
-
expectType<FastifyErrorCodes>(fastify.errorCodes)
|
|
346
|
-
|
|
347
|
-
fastify({ allowUnsafeRegex: true })
|
|
348
|
-
fastify({ allowUnsafeRegex: false })
|
|
349
|
-
expectError(fastify({ allowUnsafeRegex: 'invalid' }))
|
|
350
|
-
|
|
351
|
-
expectAssignable<FastifyInstance>(fastify({ allowErrorHandlerOverride: true }))
|
|
352
|
-
expectAssignable<FastifyInstance>(fastify({ allowErrorHandlerOverride: false }))
|