koishi-plugin-media-luna 0.0.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/client/README.md +558 -0
- package/client/api.ts +256 -0
- package/client/components/ChannelConfigDialog.vue +1113 -0
- package/client/components/ChannelsView.vue +698 -0
- package/client/components/ConfigRenderer.vue +164 -0
- package/client/components/EmptyState.vue +87 -0
- package/client/components/GenerateView.vue +778 -0
- package/client/components/HistoryGallery.vue +590 -0
- package/client/components/ImageLightbox.vue +510 -0
- package/client/components/ImageUpload.vue +298 -0
- package/client/components/JsonEditor.vue +68 -0
- package/client/components/LoadingState.vue +73 -0
- package/client/components/PresetsView.vue +800 -0
- package/client/components/ScrollContainer.vue +45 -0
- package/client/components/SettingsView.vue +231 -0
- package/client/components/StatusBadge.vue +55 -0
- package/client/components/TagFilter.vue +139 -0
- package/client/components/TagInput.vue +63 -0
- package/client/components/TasksView.vue +1074 -0
- package/client/components/ViewModeSwitch.vue +78 -0
- package/client/components/settings/CachePanel.vue +142 -0
- package/client/components/settings/MiddlewaresPanel.vue +480 -0
- package/client/components/settings/PluginsPanel.vue +493 -0
- package/client/index.ts +13 -0
- package/client/pages/index.vue +177 -0
- package/client/styles/shared.css +258 -0
- package/client/types.ts +158 -0
- package/client/utils/format.ts +72 -0
- package/dist/index.js +1 -0
- package/dist/style.css +1 -0
- package/lib/api/README.md +643 -0
- package/lib/api/cache-api.d.ts +6 -0
- package/lib/api/cache-api.d.ts.map +1 -0
- package/lib/api/cache-api.js +147 -0
- package/lib/api/cache-api.js.map +1 -0
- package/lib/api/channel-api.d.ts +6 -0
- package/lib/api/channel-api.d.ts.map +1 -0
- package/lib/api/channel-api.js +148 -0
- package/lib/api/channel-api.js.map +1 -0
- package/lib/api/connector-api.d.ts +6 -0
- package/lib/api/connector-api.d.ts.map +1 -0
- package/lib/api/connector-api.js +63 -0
- package/lib/api/connector-api.js.map +1 -0
- package/lib/api/generate-api.d.ts +6 -0
- package/lib/api/generate-api.d.ts.map +1 -0
- package/lib/api/generate-api.js +123 -0
- package/lib/api/generate-api.js.map +1 -0
- package/lib/api/index.d.ts +15 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +34 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/middleware-api.d.ts +6 -0
- package/lib/api/middleware-api.d.ts.map +1 -0
- package/lib/api/middleware-api.js +212 -0
- package/lib/api/middleware-api.js.map +1 -0
- package/lib/api/plugin-api.d.ts +6 -0
- package/lib/api/plugin-api.d.ts.map +1 -0
- package/lib/api/plugin-api.js +78 -0
- package/lib/api/plugin-api.js.map +1 -0
- package/lib/api/preset-api.d.ts +6 -0
- package/lib/api/preset-api.d.ts.map +1 -0
- package/lib/api/preset-api.js +256 -0
- package/lib/api/preset-api.js.map +1 -0
- package/lib/api/settings-api.d.ts +6 -0
- package/lib/api/settings-api.d.ts.map +1 -0
- package/lib/api/settings-api.js +118 -0
- package/lib/api/settings-api.js.map +1 -0
- package/lib/api/task-api.d.ts +6 -0
- package/lib/api/task-api.d.ts.map +1 -0
- package/lib/api/task-api.js +148 -0
- package/lib/api/task-api.js.map +1 -0
- package/lib/config.d.ts +6 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +8 -0
- package/lib/config.js.map +1 -0
- package/lib/connectors/builtin/chat-api.d.ts +9 -0
- package/lib/connectors/builtin/chat-api.d.ts.map +1 -0
- package/lib/connectors/builtin/chat-api.js +351 -0
- package/lib/connectors/builtin/chat-api.js.map +1 -0
- package/lib/connectors/builtin/dalle.d.ts +6 -0
- package/lib/connectors/builtin/dalle.d.ts.map +1 -0
- package/lib/connectors/builtin/dalle.js +109 -0
- package/lib/connectors/builtin/dalle.js.map +1 -0
- package/lib/connectors/builtin/flux.d.ts +7 -0
- package/lib/connectors/builtin/flux.d.ts.map +1 -0
- package/lib/connectors/builtin/flux.js +199 -0
- package/lib/connectors/builtin/flux.js.map +1 -0
- package/lib/connectors/builtin/index.d.ts +5 -0
- package/lib/connectors/builtin/index.d.ts.map +1 -0
- package/lib/connectors/builtin/index.js +6 -0
- package/lib/connectors/builtin/index.js.map +1 -0
- package/lib/connectors/builtin/sd-webui.d.ts +7 -0
- package/lib/connectors/builtin/sd-webui.d.ts.map +1 -0
- package/lib/connectors/builtin/sd-webui.js +157 -0
- package/lib/connectors/builtin/sd-webui.js.map +1 -0
- package/lib/connectors/connector-registry.d.ts +36 -0
- package/lib/connectors/connector-registry.d.ts.map +1 -0
- package/lib/connectors/connector-registry.js +66 -0
- package/lib/connectors/connector-registry.js.map +1 -0
- package/lib/connectors/index.d.ts +3 -0
- package/lib/connectors/index.d.ts.map +1 -0
- package/lib/connectors/index.js +4 -0
- package/lib/connectors/index.js.map +1 -0
- package/lib/core/api/api-utils.d.ts +46 -0
- package/lib/core/api/api-utils.d.ts.map +1 -0
- package/lib/core/api/api-utils.js +78 -0
- package/lib/core/api/api-utils.js.map +1 -0
- package/lib/core/api/cache-api.d.ts +6 -0
- package/lib/core/api/cache-api.d.ts.map +1 -0
- package/lib/core/api/cache-api.js +147 -0
- package/lib/core/api/cache-api.js.map +1 -0
- package/lib/core/api/channel-api.d.ts +6 -0
- package/lib/core/api/channel-api.d.ts.map +1 -0
- package/lib/core/api/channel-api.js +146 -0
- package/lib/core/api/channel-api.js.map +1 -0
- package/lib/core/api/connector-api.d.ts +6 -0
- package/lib/core/api/connector-api.d.ts.map +1 -0
- package/lib/core/api/connector-api.js +63 -0
- package/lib/core/api/connector-api.js.map +1 -0
- package/lib/core/api/generate-api.d.ts +6 -0
- package/lib/core/api/generate-api.d.ts.map +1 -0
- package/lib/core/api/generate-api.js +124 -0
- package/lib/core/api/generate-api.js.map +1 -0
- package/lib/core/api/index.d.ts +16 -0
- package/lib/core/api/index.d.ts.map +1 -0
- package/lib/core/api/index.js +38 -0
- package/lib/core/api/index.js.map +1 -0
- package/lib/core/api/middleware-api.d.ts +6 -0
- package/lib/core/api/middleware-api.d.ts.map +1 -0
- package/lib/core/api/middleware-api.js +196 -0
- package/lib/core/api/middleware-api.js.map +1 -0
- package/lib/core/api/plugin-api.d.ts +6 -0
- package/lib/core/api/plugin-api.d.ts.map +1 -0
- package/lib/core/api/plugin-api.js +78 -0
- package/lib/core/api/plugin-api.js.map +1 -0
- package/lib/core/api/preset-api.d.ts +6 -0
- package/lib/core/api/preset-api.d.ts.map +1 -0
- package/lib/core/api/preset-api.js +272 -0
- package/lib/core/api/preset-api.js.map +1 -0
- package/lib/core/api/settings-api.d.ts +6 -0
- package/lib/core/api/settings-api.d.ts.map +1 -0
- package/lib/core/api/settings-api.js +118 -0
- package/lib/core/api/settings-api.js.map +1 -0
- package/lib/core/api/task-api.d.ts +6 -0
- package/lib/core/api/task-api.d.ts.map +1 -0
- package/lib/core/api/task-api.js +281 -0
- package/lib/core/api/task-api.js.map +1 -0
- package/lib/core/channel.service.d.ts +44 -0
- package/lib/core/channel.service.d.ts.map +1 -0
- package/lib/core/channel.service.js +146 -0
- package/lib/core/channel.service.js.map +1 -0
- package/lib/core/config/config.service.d.ts +89 -0
- package/lib/core/config/config.service.d.ts.map +1 -0
- package/lib/core/config/config.service.js +216 -0
- package/lib/core/config/config.service.js.map +1 -0
- package/lib/core/config/index.d.ts +3 -0
- package/lib/core/config/index.d.ts.map +1 -0
- package/lib/core/config/index.js +3 -0
- package/lib/core/config/index.js.map +1 -0
- package/lib/core/error.d.ts +73 -0
- package/lib/core/error.d.ts.map +1 -0
- package/lib/core/error.js +137 -0
- package/lib/core/error.js.map +1 -0
- package/lib/core/index.d.ts +12 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +23 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/logger.d.ts +18 -0
- package/lib/core/logger.d.ts.map +1 -0
- package/lib/core/logger.js +39 -0
- package/lib/core/logger.js.map +1 -0
- package/lib/core/medialuna.service.d.ts +168 -0
- package/lib/core/medialuna.service.d.ts.map +1 -0
- package/lib/core/medialuna.service.js +423 -0
- package/lib/core/medialuna.service.js.map +1 -0
- package/lib/core/pipeline/dependency-graph.d.ts +43 -0
- package/lib/core/pipeline/dependency-graph.d.ts.map +1 -0
- package/lib/core/pipeline/dependency-graph.js +223 -0
- package/lib/core/pipeline/dependency-graph.js.map +1 -0
- package/lib/core/pipeline/generation-pipeline.d.ts +40 -0
- package/lib/core/pipeline/generation-pipeline.d.ts.map +1 -0
- package/lib/core/pipeline/generation-pipeline.js +216 -0
- package/lib/core/pipeline/generation-pipeline.js.map +1 -0
- package/lib/core/pipeline/index.d.ts +4 -0
- package/lib/core/pipeline/index.d.ts.map +1 -0
- package/lib/core/pipeline/index.js +5 -0
- package/lib/core/pipeline/index.js.map +1 -0
- package/lib/core/pipeline/middleware-registry.d.ts +33 -0
- package/lib/core/pipeline/middleware-registry.d.ts.map +1 -0
- package/lib/core/pipeline/middleware-registry.js +78 -0
- package/lib/core/pipeline/middleware-registry.js.map +1 -0
- package/lib/core/plugin-loader.d.ts +77 -0
- package/lib/core/plugin-loader.d.ts.map +1 -0
- package/lib/core/plugin-loader.js +300 -0
- package/lib/core/plugin-loader.js.map +1 -0
- package/lib/core/registry/connector.registry.d.ts +36 -0
- package/lib/core/registry/connector.registry.d.ts.map +1 -0
- package/lib/core/registry/connector.registry.js +65 -0
- package/lib/core/registry/connector.registry.js.map +1 -0
- package/lib/core/registry/index.d.ts +3 -0
- package/lib/core/registry/index.d.ts.map +1 -0
- package/lib/core/registry/index.js +4 -0
- package/lib/core/registry/index.js.map +1 -0
- package/lib/core/registry/service.registry.d.ts +27 -0
- package/lib/core/registry/service.registry.d.ts.map +1 -0
- package/lib/core/registry/service.registry.js +54 -0
- package/lib/core/registry/service.registry.js.map +1 -0
- package/lib/core/request.service.d.ts +83 -0
- package/lib/core/request.service.d.ts.map +1 -0
- package/lib/core/request.service.js +237 -0
- package/lib/core/request.service.js.map +1 -0
- package/lib/core/types.d.ts +270 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/core/types.js +17 -0
- package/lib/core/types.js.map +1 -0
- package/lib/database.d.ts +6 -0
- package/lib/database.d.ts.map +1 -0
- package/lib/database.js +89 -0
- package/lib/database.js.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +54 -0
- package/lib/index.js.map +1 -0
- package/lib/middlewares/builtin/billing.d.ts +45 -0
- package/lib/middlewares/builtin/billing.d.ts.map +1 -0
- package/lib/middlewares/builtin/billing.js +362 -0
- package/lib/middlewares/builtin/billing.js.map +1 -0
- package/lib/middlewares/builtin/index.d.ts +6 -0
- package/lib/middlewares/builtin/index.d.ts.map +1 -0
- package/lib/middlewares/builtin/index.js +7 -0
- package/lib/middlewares/builtin/index.js.map +1 -0
- package/lib/middlewares/builtin/preset.d.ts +14 -0
- package/lib/middlewares/builtin/preset.d.ts.map +1 -0
- package/lib/middlewares/builtin/preset.js +156 -0
- package/lib/middlewares/builtin/preset.js.map +1 -0
- package/lib/middlewares/builtin/remote-preset-sync.d.ts +8 -0
- package/lib/middlewares/builtin/remote-preset-sync.d.ts.map +1 -0
- package/lib/middlewares/builtin/remote-preset-sync.js +32 -0
- package/lib/middlewares/builtin/remote-preset-sync.js.map +1 -0
- package/lib/middlewares/builtin/request.d.ts +10 -0
- package/lib/middlewares/builtin/request.d.ts.map +1 -0
- package/lib/middlewares/builtin/request.js +50 -0
- package/lib/middlewares/builtin/request.js.map +1 -0
- package/lib/middlewares/builtin/storage.d.ts +64 -0
- package/lib/middlewares/builtin/storage.d.ts.map +1 -0
- package/lib/middlewares/builtin/storage.js +715 -0
- package/lib/middlewares/builtin/storage.js.map +1 -0
- package/lib/middlewares/builtin/task-recorder.d.ts +20 -0
- package/lib/middlewares/builtin/task-recorder.d.ts.map +1 -0
- package/lib/middlewares/builtin/task-recorder.js +138 -0
- package/lib/middlewares/builtin/task-recorder.js.map +1 -0
- package/lib/middlewares/index.d.ts +2 -0
- package/lib/middlewares/index.d.ts.map +1 -0
- package/lib/middlewares/index.js +3 -0
- package/lib/middlewares/index.js.map +1 -0
- package/lib/pipeline/dependency-graph.d.ts +43 -0
- package/lib/pipeline/dependency-graph.d.ts.map +1 -0
- package/lib/pipeline/dependency-graph.js +240 -0
- package/lib/pipeline/dependency-graph.js.map +1 -0
- package/lib/pipeline/generation-pipeline.d.ts +38 -0
- package/lib/pipeline/generation-pipeline.d.ts.map +1 -0
- package/lib/pipeline/generation-pipeline.js +211 -0
- package/lib/pipeline/generation-pipeline.js.map +1 -0
- package/lib/pipeline/index.d.ts +4 -0
- package/lib/pipeline/index.d.ts.map +1 -0
- package/lib/pipeline/index.js +5 -0
- package/lib/pipeline/index.js.map +1 -0
- package/lib/pipeline/middleware-registry.d.ts +36 -0
- package/lib/pipeline/middleware-registry.d.ts.map +1 -0
- package/lib/pipeline/middleware-registry.js +83 -0
- package/lib/pipeline/middleware-registry.js.map +1 -0
- package/lib/plugins/billing/config.d.ts +19 -0
- package/lib/plugins/billing/config.d.ts.map +1 -0
- package/lib/plugins/billing/config.js +98 -0
- package/lib/plugins/billing/config.js.map +1 -0
- package/lib/plugins/billing/index.d.ts +4 -0
- package/lib/plugins/billing/index.d.ts.map +1 -0
- package/lib/plugins/billing/index.js +20 -0
- package/lib/plugins/billing/index.js.map +1 -0
- package/lib/plugins/billing/middleware.d.ts +12 -0
- package/lib/plugins/billing/middleware.d.ts.map +1 -0
- package/lib/plugins/billing/middleware.js +233 -0
- package/lib/plugins/billing/middleware.js.map +1 -0
- package/lib/plugins/cache/config.d.ts +44 -0
- package/lib/plugins/cache/config.d.ts.map +1 -0
- package/lib/plugins/cache/config.js +187 -0
- package/lib/plugins/cache/config.js.map +1 -0
- package/lib/plugins/cache/index.d.ts +6 -0
- package/lib/plugins/cache/index.d.ts.map +1 -0
- package/lib/plugins/cache/index.js +87 -0
- package/lib/plugins/cache/index.js.map +1 -0
- package/lib/plugins/cache/middleware.d.ts +12 -0
- package/lib/plugins/cache/middleware.d.ts.map +1 -0
- package/lib/plugins/cache/middleware.js +194 -0
- package/lib/plugins/cache/middleware.js.map +1 -0
- package/lib/plugins/cache/service.d.ts +106 -0
- package/lib/plugins/cache/service.d.ts.map +1 -0
- package/lib/plugins/cache/service.js +467 -0
- package/lib/plugins/cache/service.js.map +1 -0
- package/lib/plugins/cache/utils/index.d.ts +4 -0
- package/lib/plugins/cache/utils/index.d.ts.map +1 -0
- package/lib/plugins/cache/utils/index.js +5 -0
- package/lib/plugins/cache/utils/index.js.map +1 -0
- package/lib/plugins/cache/utils/mime.d.ts +9 -0
- package/lib/plugins/cache/utils/mime.d.ts.map +1 -0
- package/lib/plugins/cache/utils/mime.js +65 -0
- package/lib/plugins/cache/utils/mime.js.map +1 -0
- package/lib/plugins/cache/utils/s3.d.ts +19 -0
- package/lib/plugins/cache/utils/s3.d.ts.map +1 -0
- package/lib/plugins/cache/utils/s3.js +147 -0
- package/lib/plugins/cache/utils/s3.js.map +1 -0
- package/lib/plugins/cache/utils/webdav.d.ts +16 -0
- package/lib/plugins/cache/utils/webdav.d.ts.map +1 -0
- package/lib/plugins/cache/utils/webdav.js +69 -0
- package/lib/plugins/cache/utils/webdav.js.map +1 -0
- package/lib/plugins/connector-chat-api/index.d.ts +7 -0
- package/lib/plugins/connector-chat-api/index.d.ts.map +1 -0
- package/lib/plugins/connector-chat-api/index.js +400 -0
- package/lib/plugins/connector-chat-api/index.js.map +1 -0
- package/lib/plugins/connector-dalle/index.d.ts +7 -0
- package/lib/plugins/connector-dalle/index.d.ts.map +1 -0
- package/lib/plugins/connector-dalle/index.js +140 -0
- package/lib/plugins/connector-dalle/index.js.map +1 -0
- package/lib/plugins/connector-flux/index.d.ts +7 -0
- package/lib/plugins/connector-flux/index.d.ts.map +1 -0
- package/lib/plugins/connector-flux/index.js +232 -0
- package/lib/plugins/connector-flux/index.js.map +1 -0
- package/lib/plugins/connector-sd-webui/index.d.ts +7 -0
- package/lib/plugins/connector-sd-webui/index.d.ts.map +1 -0
- package/lib/plugins/connector-sd-webui/index.js +171 -0
- package/lib/plugins/connector-sd-webui/index.js.map +1 -0
- package/lib/plugins/index.d.ts +22 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +21 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/preset/config.d.ts +37 -0
- package/lib/plugins/preset/config.d.ts.map +1 -0
- package/lib/plugins/preset/config.js +74 -0
- package/lib/plugins/preset/config.js.map +1 -0
- package/lib/plugins/preset/index.d.ts +6 -0
- package/lib/plugins/preset/index.d.ts.map +1 -0
- package/lib/plugins/preset/index.js +58 -0
- package/lib/plugins/preset/index.js.map +1 -0
- package/lib/plugins/preset/middleware.d.ts +6 -0
- package/lib/plugins/preset/middleware.d.ts.map +1 -0
- package/lib/plugins/preset/middleware.js +126 -0
- package/lib/plugins/preset/middleware.js.map +1 -0
- package/lib/plugins/preset/remote-sync.service.d.ts +84 -0
- package/lib/plugins/preset/remote-sync.service.d.ts.map +1 -0
- package/lib/plugins/preset/remote-sync.service.js +342 -0
- package/lib/plugins/preset/remote-sync.service.js.map +1 -0
- package/lib/plugins/preset/service.d.ts +64 -0
- package/lib/plugins/preset/service.d.ts.map +1 -0
- package/lib/plugins/preset/service.js +196 -0
- package/lib/plugins/preset/service.js.map +1 -0
- package/lib/plugins/prompt-encoding/config.d.ts +25 -0
- package/lib/plugins/prompt-encoding/config.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/config.js +62 -0
- package/lib/plugins/prompt-encoding/config.js.map +1 -0
- package/lib/plugins/prompt-encoding/index.d.ts +5 -0
- package/lib/plugins/prompt-encoding/index.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/index.js +21 -0
- package/lib/plugins/prompt-encoding/index.js.map +1 -0
- package/lib/plugins/prompt-encoding/middleware.d.ts +6 -0
- package/lib/plugins/prompt-encoding/middleware.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/middleware.js +151 -0
- package/lib/plugins/prompt-encoding/middleware.js.map +1 -0
- package/lib/plugins/task/config.d.ts +15 -0
- package/lib/plugins/task/config.d.ts.map +1 -0
- package/lib/plugins/task/config.js +33 -0
- package/lib/plugins/task/config.js.map +1 -0
- package/lib/plugins/task/index.d.ts +5 -0
- package/lib/plugins/task/index.d.ts.map +1 -0
- package/lib/plugins/task/index.js +58 -0
- package/lib/plugins/task/index.js.map +1 -0
- package/lib/plugins/task/middleware.d.ts +14 -0
- package/lib/plugins/task/middleware.d.ts.map +1 -0
- package/lib/plugins/task/middleware.js +123 -0
- package/lib/plugins/task/middleware.js.map +1 -0
- package/lib/plugins/task/service.d.ts +94 -0
- package/lib/plugins/task/service.d.ts.map +1 -0
- package/lib/plugins/task/service.js +226 -0
- package/lib/plugins/task/service.js.map +1 -0
- package/lib/plugins/webui-auth/config.d.ts +12 -0
- package/lib/plugins/webui-auth/config.d.ts.map +1 -0
- package/lib/plugins/webui-auth/config.js +30 -0
- package/lib/plugins/webui-auth/config.js.map +1 -0
- package/lib/plugins/webui-auth/index.d.ts +5 -0
- package/lib/plugins/webui-auth/index.d.ts.map +1 -0
- package/lib/plugins/webui-auth/index.js +99 -0
- package/lib/plugins/webui-auth/index.js.map +1 -0
- package/lib/plugins/webui-auth/service.d.ts +42 -0
- package/lib/plugins/webui-auth/service.d.ts.map +1 -0
- package/lib/plugins/webui-auth/service.js +106 -0
- package/lib/plugins/webui-auth/service.js.map +1 -0
- package/lib/services/asset-cache.service.d.ts +133 -0
- package/lib/services/asset-cache.service.d.ts.map +1 -0
- package/lib/services/asset-cache.service.js +882 -0
- package/lib/services/asset-cache.service.js.map +1 -0
- package/lib/services/cache.service.d.ts +110 -0
- package/lib/services/cache.service.d.ts.map +1 -0
- package/lib/services/cache.service.js +333 -0
- package/lib/services/cache.service.js.map +1 -0
- package/lib/services/channel.service.d.ts +44 -0
- package/lib/services/channel.service.d.ts.map +1 -0
- package/lib/services/channel.service.js +154 -0
- package/lib/services/channel.service.js.map +1 -0
- package/lib/services/config.service.d.ts +73 -0
- package/lib/services/config.service.d.ts.map +1 -0
- package/lib/services/config.service.js +171 -0
- package/lib/services/config.service.js.map +1 -0
- package/lib/services/index.d.ts +8 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +9 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/medialuna.service.d.ts +173 -0
- package/lib/services/medialuna.service.d.ts.map +1 -0
- package/lib/services/medialuna.service.js +455 -0
- package/lib/services/medialuna.service.js.map +1 -0
- package/lib/services/preset.service.d.ts +69 -0
- package/lib/services/preset.service.d.ts.map +1 -0
- package/lib/services/preset.service.js +202 -0
- package/lib/services/preset.service.js.map +1 -0
- package/lib/services/remote-preset.service.d.ts +97 -0
- package/lib/services/remote-preset.service.d.ts.map +1 -0
- package/lib/services/remote-preset.service.js +212 -0
- package/lib/services/remote-preset.service.js.map +1 -0
- package/lib/services/task.service.d.ts +57 -0
- package/lib/services/task.service.d.ts.map +1 -0
- package/lib/services/task.service.js +138 -0
- package/lib/services/task.service.js.map +1 -0
- package/lib/types/index.d.ts +357 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +66 -0
- package/readme.md +326 -0
package/client/api.ts
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { send } from '@koishijs/client'
|
|
2
|
+
import type {
|
|
3
|
+
ChannelConfig,
|
|
4
|
+
PresetData,
|
|
5
|
+
TaskData,
|
|
6
|
+
TaskStats,
|
|
7
|
+
ConnectorDefinition,
|
|
8
|
+
ConfigField,
|
|
9
|
+
GenerationResult,
|
|
10
|
+
ClientFileData,
|
|
11
|
+
MiddlewareInfo,
|
|
12
|
+
CardFieldsResponse,
|
|
13
|
+
PaginatedResponse,
|
|
14
|
+
ApiResponse
|
|
15
|
+
} from './types'
|
|
16
|
+
|
|
17
|
+
// 通用调用封装
|
|
18
|
+
async function call<T>(event: keyof any, params?: any): Promise<T> {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
const result = await send(event, params) as ApiResponse<T>
|
|
21
|
+
if (!result.success) {
|
|
22
|
+
throw new Error(result.error || '请求失败')
|
|
23
|
+
}
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
return result.data
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 渠道 API
|
|
29
|
+
export const channelApi = {
|
|
30
|
+
list: () => call<ChannelConfig[]>('media-luna/channels/list'),
|
|
31
|
+
get: (id: number) => call<ChannelConfig>('media-luna/channels/get', { id }),
|
|
32
|
+
create: (data: Omit<ChannelConfig, 'id'>) => call<ChannelConfig>('media-luna/channels/create', data),
|
|
33
|
+
update: (id: number, data: Partial<ChannelConfig>) => call<ChannelConfig>('media-luna/channels/update', { id, data }),
|
|
34
|
+
delete: (id: number) => call<void>('media-luna/channels/delete', { id }),
|
|
35
|
+
toggle: (id: number, enabled: boolean) => call<void>('media-luna/channels/toggle', { id, enabled }),
|
|
36
|
+
tags: () => call<string[]>('media-luna/channels/tags'),
|
|
37
|
+
getByTags: (tags: string[], matchAll?: boolean) => call<ChannelConfig[]>('media-luna/channels/by-tags', { tags, matchAll })
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 预设 API
|
|
41
|
+
export const presetApi = {
|
|
42
|
+
list: (enabledOnly?: boolean) => call<PresetData[]>('media-luna/presets/list', { enabledOnly }),
|
|
43
|
+
get: (id: number) => call<PresetData>('media-luna/presets/get', { id }),
|
|
44
|
+
create: (data: Omit<PresetData, 'id'>) => call<PresetData>('media-luna/presets/create', data),
|
|
45
|
+
update: (id: number, data: Partial<PresetData>) => call<PresetData>('media-luna/presets/update', { id, data }),
|
|
46
|
+
delete: (id: number) => call<void>('media-luna/presets/delete', { id }),
|
|
47
|
+
toggle: (id: number, enabled: boolean) => call<void>('media-luna/presets/toggle', { id, enabled }),
|
|
48
|
+
copy: (id: number) => call<PresetData>('media-luna/presets/copy', { id }),
|
|
49
|
+
matching: (channelId: number) => call<PresetData[]>('media-luna/presets/matching', { channelId }),
|
|
50
|
+
tags: () => call<string[]>('media-luna/presets/tags'),
|
|
51
|
+
getByTags: (tags: string[], matchAll?: boolean) => call<PresetData[]>('media-luna/presets/by-tags', { tags, matchAll })
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 任务 API
|
|
55
|
+
export const taskApi = {
|
|
56
|
+
list: (params?: { userId?: number, channelId?: number, status?: string, limit?: number, offset?: number }) =>
|
|
57
|
+
call<PaginatedResponse<TaskData>>('media-luna/tasks/list', params),
|
|
58
|
+
get: (id: number) => call<TaskData>('media-luna/tasks/get', { id }),
|
|
59
|
+
delete: (id: number) => call<void>('media-luna/tasks/delete', { id }),
|
|
60
|
+
stats: (channelId?: number) => call<TaskStats>('media-luna/tasks/stats', { channelId }),
|
|
61
|
+
cleanup: (days?: number) => call<{ deleted: number, beforeDate: string }>('media-luna/tasks/cleanup', { days }),
|
|
62
|
+
recent: (userId: number, limit?: number) => call<TaskData[]>('media-luna/tasks/recent', { userId, limit }),
|
|
63
|
+
/** 获取当前用户的任务列表 */
|
|
64
|
+
my: (params?: { channelId?: number, status?: string, limit?: number, offset?: number }) =>
|
|
65
|
+
call<PaginatedResponse<TaskData>>('media-luna/tasks/my', params)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 画廊类型
|
|
69
|
+
export interface GalleryItem {
|
|
70
|
+
id: number
|
|
71
|
+
prompt: string
|
|
72
|
+
images: string[]
|
|
73
|
+
createdAt: Date
|
|
74
|
+
channelId: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface GalleryResponse {
|
|
78
|
+
items: GalleryItem[]
|
|
79
|
+
total: number
|
|
80
|
+
hasMore: boolean
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface RecentImage {
|
|
84
|
+
taskId: number
|
|
85
|
+
url: string
|
|
86
|
+
prompt: string
|
|
87
|
+
createdAt: Date
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 画廊 API
|
|
91
|
+
export const galleryApi = {
|
|
92
|
+
/** 获取当前用户的生成画廊 */
|
|
93
|
+
my: (params?: { limit?: number, offset?: number, channelId?: number }) =>
|
|
94
|
+
call<GalleryResponse>('media-luna/gallery/my', params),
|
|
95
|
+
/** 获取当前用户最近生成的图片 */
|
|
96
|
+
recentImages: (limit?: number) =>
|
|
97
|
+
call<RecentImage[]>('media-luna/gallery/recent-images', { limit }),
|
|
98
|
+
/** 获取指定用户的画廊(管理员) */
|
|
99
|
+
user: (params: { uid: number, limit?: number, offset?: number, channelId?: number }) =>
|
|
100
|
+
call<GalleryResponse>('media-luna/gallery/user', params)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// 认证 API
|
|
104
|
+
export const authApi = {
|
|
105
|
+
/** 获取当前登录用户信息 */
|
|
106
|
+
me: () => call<{ loggedIn: boolean, source?: string, uid?: number, name?: string, authority?: number }>('media-luna/auth/me')
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 中间件 API
|
|
110
|
+
export const middlewareApi = {
|
|
111
|
+
list: () => call<MiddlewareInfo[]>('media-luna/middlewares/list'),
|
|
112
|
+
get: (name: string) => call<MiddlewareInfo>('media-luna/middlewares/get', { name }),
|
|
113
|
+
update: (name: string, data: { enabled?: boolean, config?: any }) => call<void>('media-luna/middlewares/update', { name, data }),
|
|
114
|
+
reset: (name: string) => call<void>('media-luna/middlewares/reset', { name }),
|
|
115
|
+
executionOrder: () => call<any[]>('media-luna/middlewares/execution-order'),
|
|
116
|
+
/** 获取中间件注册的卡片展示字段 */
|
|
117
|
+
cardFields: () => call<CardFieldsResponse>('media-luna/middlewares/card-fields')
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// 连接器 API
|
|
121
|
+
export const connectorApi = {
|
|
122
|
+
list: () => call<ConnectorDefinition[]>('media-luna/connectors/list'),
|
|
123
|
+
get: (id: string) => call<ConnectorDefinition>('media-luna/connectors/get', { id }),
|
|
124
|
+
fields: (id: string) => call<ConfigField[]>('media-luna/connectors/fields', { id }),
|
|
125
|
+
schema: () => call<any[]>('media-luna/connectors/schema')
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// 生成 API
|
|
129
|
+
export const generateApi = {
|
|
130
|
+
generate: (params: { channelId: number, prompt: string, files?: ClientFileData[], parameters?: any, userId?: number }) =>
|
|
131
|
+
call<GenerationResult>('media-luna/generate', params),
|
|
132
|
+
preview: (params: { channelId: number, prompt: string, parameters?: any }) =>
|
|
133
|
+
call<{ channelName: string, connectorId: string, finalPrompt: string, parameters: any }>('media-luna/generate/preview', params)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 缓存类型
|
|
137
|
+
export interface CacheFileInfo {
|
|
138
|
+
id: string
|
|
139
|
+
url?: string // 可访问的 URL
|
|
140
|
+
filename: string
|
|
141
|
+
mime: string
|
|
142
|
+
size: number
|
|
143
|
+
createdAt?: Date
|
|
144
|
+
accessedAt?: Date
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface CacheStats {
|
|
148
|
+
totalFiles: number
|
|
149
|
+
totalSizeMB: number
|
|
150
|
+
maxSizeMB: number
|
|
151
|
+
oldestAccess: Date | null
|
|
152
|
+
newestAccess: Date | null
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// 缓存 API
|
|
156
|
+
export const cacheApi = {
|
|
157
|
+
/** 上传文件到缓存 */
|
|
158
|
+
upload: (data: string, mime: string, filename?: string) =>
|
|
159
|
+
call<CacheFileInfo>('media-luna/cache/upload', { data, mime, filename }),
|
|
160
|
+
/** 从 URL 下载并缓存 */
|
|
161
|
+
cacheUrl: (url: string) =>
|
|
162
|
+
call<CacheFileInfo>('media-luna/cache/cache-url', { url }),
|
|
163
|
+
/** 获取缓存文件信息 */
|
|
164
|
+
get: (id: string) =>
|
|
165
|
+
call<CacheFileInfo>('media-luna/cache/get', { id }),
|
|
166
|
+
/** 读取缓存文件内容(返回 data URL) */
|
|
167
|
+
read: (id: string) =>
|
|
168
|
+
call<string>('media-luna/cache/read', { id }),
|
|
169
|
+
/** 删除缓存文件 */
|
|
170
|
+
delete: (id: string) =>
|
|
171
|
+
call<void>('media-luna/cache/delete', { id }),
|
|
172
|
+
/** 获取缓存统计信息 */
|
|
173
|
+
stats: () =>
|
|
174
|
+
call<CacheStats>('media-luna/cache/stats'),
|
|
175
|
+
/** 清空所有缓存 */
|
|
176
|
+
clear: () =>
|
|
177
|
+
call<void>('media-luna/cache/clear')
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// 设置面板类型
|
|
181
|
+
export interface SettingsPanelInfo {
|
|
182
|
+
id: string
|
|
183
|
+
name: string
|
|
184
|
+
icon: string
|
|
185
|
+
description?: string
|
|
186
|
+
order: number
|
|
187
|
+
type: 'builtin' | 'custom'
|
|
188
|
+
component?: string
|
|
189
|
+
configFields?: ConfigField[]
|
|
190
|
+
configKey?: string
|
|
191
|
+
config?: Record<string, any>
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 设置面板 API
|
|
195
|
+
export const settingsApi = {
|
|
196
|
+
/** 获取所有设置面板 */
|
|
197
|
+
panels: () =>
|
|
198
|
+
call<SettingsPanelInfo[]>('media-luna/settings/panels'),
|
|
199
|
+
/** 获取单个设置面板 */
|
|
200
|
+
get: (id: string) =>
|
|
201
|
+
call<SettingsPanelInfo>('media-luna/settings/get', { id }),
|
|
202
|
+
/** 更新设置面板配置(仅 custom 类型) */
|
|
203
|
+
update: (id: string, config: Record<string, any>) =>
|
|
204
|
+
call<void>('media-luna/settings/update', { id, config }),
|
|
205
|
+
/** 手动触发远程预设同步(通过 preset 插件 API) */
|
|
206
|
+
syncRemotePresets: () =>
|
|
207
|
+
call<{ added: number, updated: number, removed: number }>('media-luna/presets/sync')
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// 插件信息类型
|
|
211
|
+
export interface PluginInfo {
|
|
212
|
+
id: string
|
|
213
|
+
name: string
|
|
214
|
+
description?: string
|
|
215
|
+
version?: string
|
|
216
|
+
enabled: boolean
|
|
217
|
+
configFields: ConfigField[]
|
|
218
|
+
config: Record<string, any>
|
|
219
|
+
actions: Array<{
|
|
220
|
+
name: string
|
|
221
|
+
label: string
|
|
222
|
+
type?: string
|
|
223
|
+
icon?: string
|
|
224
|
+
apiEvent: string
|
|
225
|
+
}>
|
|
226
|
+
middlewares: Array<{
|
|
227
|
+
name: string
|
|
228
|
+
displayName: string
|
|
229
|
+
phase: string
|
|
230
|
+
enabled: boolean
|
|
231
|
+
}>
|
|
232
|
+
connector?: {
|
|
233
|
+
id: string
|
|
234
|
+
name: string
|
|
235
|
+
supportedTypes: string[]
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// 插件 API
|
|
240
|
+
export const pluginApi = {
|
|
241
|
+
/** 获取所有已加载插件 */
|
|
242
|
+
list: () =>
|
|
243
|
+
call<PluginInfo[]>('media-luna/plugins/list'),
|
|
244
|
+
/** 获取单个插件信息 */
|
|
245
|
+
get: (id: string) =>
|
|
246
|
+
call<PluginInfo>('media-luna/plugins/get', { id }),
|
|
247
|
+
/** 更新插件配置 */
|
|
248
|
+
updateConfig: (pluginId: string, config: Record<string, any>) =>
|
|
249
|
+
call<void>('media-luna/plugins/update-config', { pluginId, config }),
|
|
250
|
+
/** 启用插件 */
|
|
251
|
+
enable: (id: string) =>
|
|
252
|
+
call<void>('media-luna/plugins/enable', { id }),
|
|
253
|
+
/** 禁用插件 */
|
|
254
|
+
disable: (id: string) =>
|
|
255
|
+
call<void>('media-luna/plugins/disable', { id })
|
|
256
|
+
}
|