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
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export function renderPhotoUploadPage(session) {
|
|
2
|
+
const sessionJson = scriptJson({
|
|
3
|
+
id: session.id,
|
|
4
|
+
status: session.status,
|
|
5
|
+
folderName: session.folderName ?? "",
|
|
6
|
+
expiresAt: session.expiresAt,
|
|
7
|
+
fileCount: session.fileCount,
|
|
8
|
+
totalBytes: session.totalBytes,
|
|
9
|
+
uploadedPaths: session.uploadedPaths,
|
|
10
|
+
finalizedBatchCount: session.finalizedBatchCount,
|
|
11
|
+
finalLibraryRelativePath: session.finalLibraryRelativePath ?? "",
|
|
12
|
+
});
|
|
13
|
+
return `<!doctype html>
|
|
14
|
+
<html lang="zh-CN">
|
|
15
|
+
<head>
|
|
16
|
+
<meta charset="utf-8">
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
18
|
+
<title>上传照片到 AI Box</title>
|
|
19
|
+
<style>
|
|
20
|
+
:root{color-scheme:light dark;--bg:#f4f7f6;--panel:#fff;--panel2:#edf3f1;--text:#15201d;--muted:#65736f;--line:#d5dfdc;--accent:#087f6a;--accentText:#fff;--danger:#b42318}
|
|
21
|
+
@media(prefers-color-scheme:dark){:root{--bg:#101513;--panel:#171e1b;--panel2:#202a26;--text:#edf5f2;--muted:#9badA7;--line:#31403b;--accent:#2dd4a8;--accentText:#06251c;--danger:#ff8a7a}}
|
|
22
|
+
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
|
|
23
|
+
main{width:min(900px,100%);margin:0 auto;padding:28px 16px 48px}h1{font-size:25px;margin:0 0 6px}.lead{margin:0 0 22px;color:var(--muted)}
|
|
24
|
+
.drop{padding:38px 20px;border:2px dashed var(--line);border-radius:14px;background:var(--panel);text-align:center;transition:.15s}.drop.drag{border-color:var(--accent);background:var(--panel2)}
|
|
25
|
+
.drop h2{margin:0 0 8px;font-size:18px}.drop p{margin:0;color:var(--muted)}.buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:20px}
|
|
26
|
+
button{min-height:42px;border:1px solid var(--line);border-radius:8px;padding:9px 15px;background:var(--panel);color:var(--text);font:inherit;font-weight:650;cursor:pointer}button:hover{border-color:var(--accent)}button:disabled{cursor:not-allowed;opacity:.55}
|
|
27
|
+
button.primary{background:var(--accent);border-color:var(--accent);color:var(--accentText)}input[type=file]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
|
|
28
|
+
.panel{margin-top:18px;border:1px solid var(--line);border-radius:12px;background:var(--panel);overflow:hidden}.panel-head{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line)}
|
|
29
|
+
.panel-head strong{font-size:15px}.summary{color:var(--muted)}.files{max-height:320px;overflow:auto}.file{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:9px 16px;border-bottom:1px solid var(--line)}.file:last-child{border-bottom:0}.file-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-size{color:var(--muted)}
|
|
30
|
+
.progress{height:8px;margin:14px 16px 0;border-radius:999px;background:var(--panel2);overflow:hidden}.progress>div{height:100%;width:0;background:var(--accent);transition:width .15s}.actions{display:flex;justify-content:flex-end;gap:10px;padding:16px}
|
|
31
|
+
.status{margin-top:18px;padding:13px 15px;border-radius:10px;background:var(--panel2)}.status.error{color:var(--danger)}.status.success{color:var(--accent)}.status[hidden]{display:none}
|
|
32
|
+
.small{margin-top:14px;color:var(--muted);font-size:12px}
|
|
33
|
+
@media(max-width:560px){main{padding-top:20px}.drop{padding:28px 14px}.buttons,.actions{display:grid}.buttons button,.actions button{width:100%}.panel-head{display:block}.summary{margin-top:4px}.file{padding-inline:12px}}
|
|
34
|
+
</style>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<main>
|
|
38
|
+
<h1>上传照片到 AI Box</h1>
|
|
39
|
+
<p class="lead">从电脑或手机选择照片和视频。文件只通过当前局域网传输到 AI Box。</p>
|
|
40
|
+
|
|
41
|
+
<section class="drop" data-drop>
|
|
42
|
+
<h2>把照片拖到这里</h2>
|
|
43
|
+
<p>也可以使用系统文件选择器</p>
|
|
44
|
+
<div class="buttons">
|
|
45
|
+
<button class="primary" type="button" data-pick-files>选择照片或视频</button>
|
|
46
|
+
<button type="button" data-pick-folder>选择文件夹</button>
|
|
47
|
+
</div>
|
|
48
|
+
<input type="file" multiple accept="image/*,video/*,.dng,.raw,.arw,.cr2,.cr3,.nef,.orf,.raf,.rw2" data-files>
|
|
49
|
+
<input type="file" multiple webkitdirectory directory data-folder>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<section class="panel" data-panel hidden>
|
|
53
|
+
<div class="panel-head">
|
|
54
|
+
<strong>待上传文件</strong>
|
|
55
|
+
<span class="summary" data-summary></span>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="files" data-list></div>
|
|
58
|
+
<div class="progress"><div data-progress></div></div>
|
|
59
|
+
<div class="actions">
|
|
60
|
+
<button type="button" data-clear>清空</button>
|
|
61
|
+
<button class="primary" type="button" data-upload>开始上传</button>
|
|
62
|
+
<button class="primary" type="button" data-finalize hidden>完成并扫描照片库</button>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
|
|
66
|
+
<div class="status" data-status hidden role="status"></div>
|
|
67
|
+
<p class="small">文件夹选择主要适用于桌面 Chrome、Edge 和 Safari。手机请使用“选择照片或视频”。链接将在 ${escapeHtml(session.expiresAt)} 过期。</p>
|
|
68
|
+
</main>
|
|
69
|
+
<script>
|
|
70
|
+
const session=${sessionJson};
|
|
71
|
+
const selected=new Map();
|
|
72
|
+
const uploadedPaths=new Set(session.uploadedPaths||[]);
|
|
73
|
+
const drop=document.querySelector("[data-drop]");
|
|
74
|
+
const filesInput=document.querySelector("[data-files]");
|
|
75
|
+
const folderInput=document.querySelector("[data-folder]");
|
|
76
|
+
const panel=document.querySelector("[data-panel]");
|
|
77
|
+
const list=document.querySelector("[data-list]");
|
|
78
|
+
const summary=document.querySelector("[data-summary]");
|
|
79
|
+
const progress=document.querySelector("[data-progress]");
|
|
80
|
+
const statusBox=document.querySelector("[data-status]");
|
|
81
|
+
const uploadButton=document.querySelector("[data-upload]");
|
|
82
|
+
const finalizeButton=document.querySelector("[data-finalize]");
|
|
83
|
+
const clearButton=document.querySelector("[data-clear]");
|
|
84
|
+
let uploaded=false;
|
|
85
|
+
let busy=false;
|
|
86
|
+
function esc(value){return String(value).replace(/[&<>"']/g,(char)=>({"&":"&","<":"<",">":">","\\"":""","'":"'"}[char]));}
|
|
87
|
+
function formatBytes(value){if(value<1024)return value+" B";const units=["KB","MB","GB","TB"];let n=value/1024;let i=0;while(n>=1024&&i<units.length-1){n/=1024;i++;}return n.toFixed(n>=10?1:2)+" "+units[i];}
|
|
88
|
+
function relativePath(file){return String(file.webkitRelativePath||file.name||"").replace(/\\\\/g,"/").replace(/^\\/+/, "");}
|
|
89
|
+
function setStatus(kind,message){statusBox.hidden=!message;statusBox.className="status"+(kind?" "+kind:"");statusBox.textContent=message||"";}
|
|
90
|
+
function addFiles(files){
|
|
91
|
+
if(busy||session.status==="finalized")return;
|
|
92
|
+
for(const file of files){
|
|
93
|
+
if(!(file instanceof File))continue;
|
|
94
|
+
const path=relativePath(file);
|
|
95
|
+
if(path&&!uploadedPaths.has(path))selected.set(path,file);
|
|
96
|
+
}
|
|
97
|
+
uploaded=false;
|
|
98
|
+
render();
|
|
99
|
+
}
|
|
100
|
+
function render(){
|
|
101
|
+
const entries=[...selected.entries()];
|
|
102
|
+
const total=entries.reduce((sum,item)=>sum+item[1].size,0);
|
|
103
|
+
panel.hidden=entries.length===0&&uploadedPaths.size===0&&!uploaded;
|
|
104
|
+
summary.textContent=entries.length+" 个待上传 · "+uploadedPaths.size+" 个已上传 · "+formatBytes(total);
|
|
105
|
+
list.innerHTML=entries.slice(0,300).map(([path,file])=>'<div class="file"><span class="file-name" title="'+esc(path)+'">'+esc(path)+'</span><span class="file-size">'+formatBytes(file.size)+'</span></div>').join("")+(entries.length>300?'<div class="file"><span>还有 '+(entries.length-300)+' 个文件</span></div>':"");
|
|
106
|
+
uploadButton.hidden=entries.length===0;
|
|
107
|
+
clearButton.hidden=entries.length===0;
|
|
108
|
+
uploadButton.disabled=busy||entries.length===0||uploaded;
|
|
109
|
+
clearButton.disabled=busy||uploaded;
|
|
110
|
+
finalizeButton.hidden=uploadedPaths.size===0||entries.length>0||session.status==="finalized";
|
|
111
|
+
}
|
|
112
|
+
async function uploadOne(path,file,onProgress){
|
|
113
|
+
return await new Promise((resolve,reject)=>{
|
|
114
|
+
const xhr=new XMLHttpRequest();
|
|
115
|
+
xhr.open("POST",window.location.pathname+"/files?path="+encodeURIComponent(path));
|
|
116
|
+
xhr.setRequestHeader("X-Jishushell-Photo-Upload","1");
|
|
117
|
+
xhr.upload.onprogress=(event)=>{if(event.lengthComputable)onProgress(event.loaded,event.total);};
|
|
118
|
+
xhr.onerror=()=>reject(new Error("网络错误"));
|
|
119
|
+
xhr.onload=()=>{
|
|
120
|
+
let body={};
|
|
121
|
+
try{body=xhr.responseText?JSON.parse(xhr.responseText):{};}catch(_){}
|
|
122
|
+
if(xhr.status>=200&&xhr.status<300)resolve(body);
|
|
123
|
+
else reject(new Error(body.error||body.detail||("上传失败(HTTP "+xhr.status+")")));
|
|
124
|
+
};
|
|
125
|
+
const form=new FormData();
|
|
126
|
+
form.append("file",file,file.name);
|
|
127
|
+
xhr.send(form);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async function startUpload(){
|
|
131
|
+
if(busy||uploaded||selected.size===0)return;
|
|
132
|
+
busy=true;
|
|
133
|
+
setStatus("","正在上传,请不要关闭页面…");
|
|
134
|
+
render();
|
|
135
|
+
const entries=[...selected.entries()];
|
|
136
|
+
const totalBytes=entries.reduce((sum,item)=>sum+item[1].size,0);
|
|
137
|
+
let completedBytes=0;
|
|
138
|
+
try{
|
|
139
|
+
for(let index=0;index<entries.length;index++){
|
|
140
|
+
const [path,file]=entries[index];
|
|
141
|
+
setStatus("","正在上传 "+(index+1)+" / "+entries.length+":"+path);
|
|
142
|
+
await uploadOne(path,file,(loaded)=>{
|
|
143
|
+
const value=totalBytes?((completedBytes+loaded)/totalBytes)*100:0;
|
|
144
|
+
progress.style.width=Math.min(100,value)+"%";
|
|
145
|
+
});
|
|
146
|
+
completedBytes+=file.size;
|
|
147
|
+
uploadedPaths.add(path);
|
|
148
|
+
selected.delete(path);
|
|
149
|
+
progress.style.width=(totalBytes?(completedBytes/totalBytes)*100:100)+"%";
|
|
150
|
+
}
|
|
151
|
+
uploaded=true;
|
|
152
|
+
uploadButton.hidden=true;
|
|
153
|
+
finalizeButton.hidden=false;
|
|
154
|
+
setStatus("success","文件上传完成。点击“完成并扫描照片库”后,照片才会进入默认图库。");
|
|
155
|
+
}catch(error){
|
|
156
|
+
setStatus("error","上传中断:"+(error&&error.message?error.message:String(error))+"。已成功上传的文件已经保留,可以直接重试剩余文件。");
|
|
157
|
+
}finally{
|
|
158
|
+
busy=false;
|
|
159
|
+
render();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function finalize(){
|
|
163
|
+
if(busy||uploadedPaths.size===0||selected.size>0)return;
|
|
164
|
+
busy=true;
|
|
165
|
+
finalizeButton.disabled=true;
|
|
166
|
+
setStatus("","正在保存批次并提交 Immich 扫描…");
|
|
167
|
+
try{
|
|
168
|
+
const response=await fetch(window.location.pathname+"/finalize",{
|
|
169
|
+
method:"POST",
|
|
170
|
+
headers:{"Content-Type":"application/json","X-Jishushell-Photo-Upload":"1"},
|
|
171
|
+
body:"{}"
|
|
172
|
+
});
|
|
173
|
+
const body=await response.json().catch(()=>({}));
|
|
174
|
+
if(!response.ok)throw new Error(body.error||body.detail||("完成失败(HTTP "+response.status+")"));
|
|
175
|
+
const scan=body.scan||{};
|
|
176
|
+
uploadedPaths.clear();
|
|
177
|
+
selected.clear();
|
|
178
|
+
uploaded=false;
|
|
179
|
+
session.fileCount=0;
|
|
180
|
+
session.totalBytes=0;
|
|
181
|
+
session.uploadedPaths=[];
|
|
182
|
+
session.finalizedBatchCount=body.batch_number||((session.finalizedBatchCount||0)+1);
|
|
183
|
+
session.finalLibraryRelativePath=body.library_path||session.finalLibraryRelativePath||"";
|
|
184
|
+
progress.style.width="0";
|
|
185
|
+
finalizeButton.textContent="完成并扫描照片库";
|
|
186
|
+
if(scan.status==="scan_queued"){
|
|
187
|
+
setStatus("success","已保存第 "+session.finalizedBatchCount+" 批 "+body.file_count+" 个文件,Immich 已开始后台扫描。可以继续选择下一批,或关闭此页面。");
|
|
188
|
+
}else{
|
|
189
|
+
setStatus("success","已保存第 "+session.finalizedBatchCount+" 批 "+body.file_count+" 个文件。自动扫描未完成;可以继续选择下一批,或回到 OpenClaw 说“扫描照片库”。");
|
|
190
|
+
}
|
|
191
|
+
busy=false;
|
|
192
|
+
finalizeButton.disabled=false;
|
|
193
|
+
render();
|
|
194
|
+
}catch(error){
|
|
195
|
+
busy=false;
|
|
196
|
+
finalizeButton.disabled=false;
|
|
197
|
+
setStatus("error","完成失败:"+(error&&error.message?error.message:String(error))+"。文件仍安全保存在临时目录,可以重试。");
|
|
198
|
+
render();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
document.querySelector("[data-pick-files]").addEventListener("click",()=>filesInput.click());
|
|
202
|
+
document.querySelector("[data-pick-folder]").addEventListener("click",()=>folderInput.click());
|
|
203
|
+
filesInput.addEventListener("change",()=>{addFiles(filesInput.files);filesInput.value="";});
|
|
204
|
+
folderInput.addEventListener("change",()=>{addFiles(folderInput.files);folderInput.value="";});
|
|
205
|
+
drop.addEventListener("dragover",(event)=>{event.preventDefault();drop.classList.add("drag");});
|
|
206
|
+
drop.addEventListener("dragleave",()=>drop.classList.remove("drag"));
|
|
207
|
+
drop.addEventListener("drop",(event)=>{event.preventDefault();drop.classList.remove("drag");addFiles(event.dataTransfer.files);});
|
|
208
|
+
clearButton.addEventListener("click",()=>{selected.clear();progress.style.width="0";setStatus("","");render();});
|
|
209
|
+
uploadButton.addEventListener("click",startUpload);
|
|
210
|
+
finalizeButton.addEventListener("click",finalize);
|
|
211
|
+
if(session.status==="finalized"){
|
|
212
|
+
uploaded=true;
|
|
213
|
+
panel.hidden=false;
|
|
214
|
+
uploadButton.hidden=true;
|
|
215
|
+
clearButton.hidden=true;
|
|
216
|
+
finalizeButton.hidden=false;
|
|
217
|
+
finalizeButton.disabled=true;
|
|
218
|
+
finalizeButton.textContent="已完成";
|
|
219
|
+
setStatus("success","这个上传批次已经保存到照片库。");
|
|
220
|
+
}else if(uploadedPaths.size>0){
|
|
221
|
+
setStatus("","这个批次已有 "+uploadedPaths.size+" 个文件上传完成。可以继续选择文件,或直接完成并扫描。");
|
|
222
|
+
}
|
|
223
|
+
render();
|
|
224
|
+
</script>
|
|
225
|
+
</body>
|
|
226
|
+
</html>`;
|
|
227
|
+
}
|
|
228
|
+
function escapeHtml(value) {
|
|
229
|
+
return value.replace(/[&<>"']/g, (char) => {
|
|
230
|
+
const escaped = {
|
|
231
|
+
"&": "&",
|
|
232
|
+
"<": "<",
|
|
233
|
+
">": ">",
|
|
234
|
+
"\"": """,
|
|
235
|
+
"'": "'",
|
|
236
|
+
};
|
|
237
|
+
return escaped[char] ?? char;
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function scriptJson(value) {
|
|
241
|
+
return JSON.stringify(value)
|
|
242
|
+
.replace(/</g, "\\u003c")
|
|
243
|
+
.replace(/>/g, "\\u003e")
|
|
244
|
+
.replace(/&/g, "\\u0026")
|
|
245
|
+
.replace(/\u2028/g, "\\u2028")
|
|
246
|
+
.replace(/\u2029/g, "\\u2029");
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=upload-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload-page.js","sourceRoot":"","sources":["../../../../src/services/files/photos/upload-page.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,OAA2B;IAC/D,MAAM,WAAW,GAAG,UAAU,CAAC;QAC7B,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;QAChD,wBAAwB,EAAE,OAAO,CAAC,wBAAwB,IAAI,EAAE;KACjE,CAAC,CAAC;IAEH,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAsDkE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC;;;gBAGxF,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4JnB,CAAC;AACT,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;QACxC,MAAM,OAAO,GAA2B;YACtC,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,OAAO;SACb,CAAC;QACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SACzB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;SACxB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Readable } from "node:stream";
|
|
2
|
+
export declare const PHOTO_UPLOAD_TTL_MS: number;
|
|
3
|
+
export declare const PHOTO_UPLOAD_FINALIZED_RETENTION_MS: number;
|
|
4
|
+
export declare const PHOTO_UPLOAD_MAX_FILES = 2000;
|
|
5
|
+
export declare const PHOTO_UPLOAD_MAX_FILE_BYTES: number;
|
|
6
|
+
export declare const PHOTO_UPLOAD_MAX_TOTAL_BYTES: number;
|
|
7
|
+
export type PhotoUploadSession = {
|
|
8
|
+
id: string;
|
|
9
|
+
status: "open" | "finalized";
|
|
10
|
+
folderName?: string;
|
|
11
|
+
destinationRelativePath: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
expiresAt: string;
|
|
14
|
+
fileCount: number;
|
|
15
|
+
totalBytes: number;
|
|
16
|
+
uploadedPaths: string[];
|
|
17
|
+
finalizedBatchCount: number;
|
|
18
|
+
finalizedAt?: string;
|
|
19
|
+
finalLibraryRelativePath?: string;
|
|
20
|
+
};
|
|
21
|
+
export type PhotoUploadFinalizeResult = {
|
|
22
|
+
session: PhotoUploadSession;
|
|
23
|
+
fileCount: number;
|
|
24
|
+
totalBytes: number;
|
|
25
|
+
batchNumber: number;
|
|
26
|
+
libraryRelativePath: string;
|
|
27
|
+
};
|
|
28
|
+
export type CreatePhotoUploadSessionInput = {
|
|
29
|
+
folderName?: string;
|
|
30
|
+
now?: Date;
|
|
31
|
+
ttlMs?: number;
|
|
32
|
+
};
|
|
33
|
+
export type PhotoUploadStoreOptions = {
|
|
34
|
+
filesRoot?: string;
|
|
35
|
+
sessionRoot?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare class PhotoUploadStore {
|
|
38
|
+
private readonly filesRoot;
|
|
39
|
+
private readonly sessionRoot;
|
|
40
|
+
private readonly photosRoot;
|
|
41
|
+
private readonly stagingRoot;
|
|
42
|
+
private readonly libraryRoot;
|
|
43
|
+
constructor(options?: PhotoUploadStoreOptions);
|
|
44
|
+
create(input?: CreatePhotoUploadSessionInput): PhotoUploadSession;
|
|
45
|
+
get(sessionId: string): PhotoUploadSession | null;
|
|
46
|
+
writeFile(sessionId: string, relativePathInput: string, source: Readable, options?: {
|
|
47
|
+
now?: Date;
|
|
48
|
+
}): Promise<{
|
|
49
|
+
path: string;
|
|
50
|
+
size: number;
|
|
51
|
+
fileCount: number;
|
|
52
|
+
totalBytes: number;
|
|
53
|
+
}>;
|
|
54
|
+
finalize(sessionId: string, options?: {
|
|
55
|
+
now?: Date;
|
|
56
|
+
}): Promise<PhotoUploadFinalizeResult>;
|
|
57
|
+
deleteExpired(options?: {
|
|
58
|
+
now?: Date;
|
|
59
|
+
}): number;
|
|
60
|
+
private requireOpenSession;
|
|
61
|
+
private withSessionLock;
|
|
62
|
+
private writeSession;
|
|
63
|
+
private sessionDir;
|
|
64
|
+
private sessionPath;
|
|
65
|
+
private lockPath;
|
|
66
|
+
private stagingDir;
|
|
67
|
+
private clearInterruptedOperationLocks;
|
|
68
|
+
}
|
|
69
|
+
export declare class PhotoUploadError extends Error {
|
|
70
|
+
readonly statusCode: number;
|
|
71
|
+
readonly code: string;
|
|
72
|
+
constructor(message: string, statusCode: number, code: string);
|
|
73
|
+
}
|
|
74
|
+
export declare function photoUploadDisplayName(session: PhotoUploadSession): string;
|