@engenty/wizards-runtime 0.15.0 → 0.16.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/apps/runtime/dist/agents/studio-assistant.js +138 -9
- package/apps/runtime/dist/agents/website.js +10 -5
- package/apps/runtime/dist/app.js +18 -0
- package/apps/runtime/dist/auth/index.js +5 -0
- package/apps/runtime/dist/broker/account.js +5 -0
- package/apps/runtime/dist/broker/index.js +5 -0
- package/apps/runtime/dist/broker/rwx.js +255 -7
- package/apps/runtime/dist/cli/main.js +7 -0
- package/apps/runtime/dist/cli/move-files.js +84 -0
- package/apps/runtime/dist/cli/move-folder-sources.js +120 -0
- package/apps/runtime/dist/connectors/plugin-connections.js +74 -4
- package/apps/runtime/dist/db/migrations/tenant/0042_client_spaces.sql +16 -0
- package/apps/runtime/dist/db/migrations/tenant/0043_space_member_invite.sql +19 -0
- package/apps/runtime/dist/db/migrations/tenant/0044_client_portal.sql +8 -0
- package/apps/runtime/dist/db/migrations/tenant/0045_client_portal_no_slug.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0046_space_file_hash.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0047_knowledge_folders.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/0048_space_chunk_kind.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0049_knowledge_sources.sql +57 -0
- package/apps/runtime/dist/db/migrations/tenant/0050_dateien.sql +71 -0
- package/apps/runtime/dist/db/migrations/tenant/0051_dateien_drafts.sql +23 -0
- package/apps/runtime/dist/db/migrations/tenant/0052_dateien_plugin_kinds.sql +5 -0
- package/apps/runtime/dist/db/migrations/tenant/0053_dateien_file_title.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/0054_dateien_ocr.sql +14 -0
- package/apps/runtime/dist/db/migrations/tenant/0055_dateien_doc_reread.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0042_snapshot.json +5286 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0043_snapshot.json +5293 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0044_snapshot.json +5344 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0045_snapshot.json +5329 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0046_snapshot.json +5343 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0047_snapshot.json +5391 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0048_snapshot.json +5398 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0049_snapshot.json +5793 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0050_snapshot.json +6288 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0051_snapshot.json +6461 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0052_snapshot.json +6497 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0053_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0054_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0055_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +98 -0
- package/apps/runtime/dist/db/schema.js +294 -5
- package/apps/runtime/dist/docs/dev/api.md +25 -0
- package/apps/runtime/dist/docs/dev/plugins/connections.md +30 -2
- package/apps/runtime/dist/docs/dev/plugins/index.md +1 -1
- package/apps/runtime/dist/docs/dev/plugins/reference.md +7 -4
- package/apps/runtime/dist/docs/dev/plugins/server.md +11 -5
- package/apps/runtime/dist/docs/dev/plugins/space.md +130 -4
- package/apps/runtime/dist/docs/dev/plugins/studio.md +13 -3
- package/apps/runtime/dist/docs/user-guide/command-line.md +2 -0
- package/apps/runtime/dist/docs/user-guide/plugins.md +1 -1
- package/apps/runtime/dist/docs/user-guide/space.md +6 -6
- package/apps/runtime/dist/docs/user-guide/steps.md +1 -1
- package/apps/runtime/dist/documents/ocr.js +72 -0
- package/apps/runtime/dist/documents/parse.js +90 -12
- package/apps/runtime/dist/elements/caller.js +5 -3
- package/apps/runtime/dist/elements/gate.js +1 -1
- package/apps/runtime/dist/elements/knowledge.js +181 -12
- package/apps/runtime/dist/elements/specs.js +1 -1
- package/apps/runtime/dist/elements/wizards.js +15 -2
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +3 -0
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +3 -0
- package/apps/runtime/dist/engenty/connections-s3/s3.js +6 -0
- package/apps/runtime/dist/engine/runner.js +19 -2
- package/apps/runtime/dist/engine/steps.js +1 -1
- package/apps/runtime/dist/env.js +6 -0
- package/apps/runtime/dist/files/blobs.js +57 -1
- package/apps/runtime/dist/files/objects.js +1 -0
- package/apps/runtime/dist/files/pictures.js +41 -0
- package/apps/runtime/dist/files/storage.js +14 -26
- package/apps/runtime/dist/files/thumbs.js +77 -0
- package/apps/runtime/dist/files/upload-check.js +2 -2
- package/apps/runtime/dist/index.js +22 -0
- package/apps/runtime/dist/live/views.js +2 -1
- package/apps/runtime/dist/manage.js +4 -1
- package/apps/runtime/dist/mcp/tools.js +5 -0
- package/apps/runtime/dist/models.js +82 -13
- package/apps/runtime/dist/mounts/cache.js +71 -0
- package/apps/runtime/dist/mounts/drafts.js +367 -0
- package/apps/runtime/dist/mounts/folder.js +148 -0
- package/apps/runtime/dist/mounts/mounts.js +1315 -0
- package/apps/runtime/dist/mounts/source.js +179 -0
- package/apps/runtime/dist/mounts/units.js +97 -0
- package/apps/runtime/dist/move-files.js +4 -0
- package/apps/runtime/dist/plugins/loader.js +73 -1
- package/apps/runtime/dist/plugins/registry.js +2 -0
- package/apps/runtime/dist/prompts/goose.md +13 -1
- package/apps/runtime/dist/prompts/tools.md +5 -2
- package/apps/runtime/dist/render/convert.js +188 -1
- package/apps/runtime/dist/routes/api.js +6 -1
- package/apps/runtime/dist/routes/client-contract.js +164 -0
- package/apps/runtime/dist/routes/client-spaces.js +58 -0
- package/apps/runtime/dist/routes/dateien.js +173 -0
- package/apps/runtime/dist/routes/elements.js +2 -2
- package/apps/runtime/dist/routes/plugins.js +2 -1
- package/apps/runtime/dist/routes/runs.js +24 -10
- package/apps/runtime/dist/routes/studio.js +168 -8
- package/apps/runtime/dist/secrets/signing.js +16 -0
- package/apps/runtime/dist/services/client-portal.js +439 -0
- package/apps/runtime/dist/services/client-spaces.js +228 -0
- package/apps/runtime/dist/services/cloud.js +2 -0
- package/apps/runtime/dist/services/knowledge-model.js +24 -8
- package/apps/runtime/dist/services/knowledge.js +72 -42
- package/apps/runtime/dist/services/links.js +17 -0
- package/apps/runtime/dist/services/members-studio.js +5 -1
- package/apps/runtime/dist/services/page-pictures.js +162 -0
- package/apps/runtime/dist/services/runs.js +22 -6
- package/apps/runtime/dist/services/space-categories.js +41 -5
- package/apps/runtime/dist/services/space-data.js +165 -8
- package/apps/runtime/dist/services/space-files.js +102 -19
- package/apps/runtime/dist/services/space-index.js +384 -41
- package/apps/runtime/dist/services/space-origin.js +25 -1
- package/apps/runtime/dist/services/space-sources.js +937 -0
- package/apps/runtime/dist/services/spaces.js +60 -12
- package/apps/runtime/dist/services/synced-spaces.js +10 -1
- package/apps/runtime/dist/services/work-ai.js +29 -8
- package/apps/runtime/dist/services/work-chats.js +3 -2
- package/apps/runtime/dist/services/work-files.js +25 -1
- package/apps/runtime/dist/sharing/index.js +2 -0
- package/apps/runtime/dist/store/index.js +29 -8
- package/apps/runtime/dist/store/shared-lists.js +30 -17
- package/apps/runtime/dist/sync/records.js +22 -27
- package/apps/runtime/dist/texts.js +4 -0
- package/apps/runtime/dist/tools/pages.js +1 -1
- package/apps/runtime/dist/widgets/step.js +2 -1
- package/apps/web/dist/assets/AboutDialog-C9SnsGno.js +1 -0
- package/apps/web/dist/assets/BlockEditor-CUYFH_CU.js +173 -0
- package/apps/web/dist/assets/BlockEditor-CtW6lw0y.css +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-DvSSybt0.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-Do7pwmFv.js → ChangelogDialog-B28TK333.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-Cdox-51M.js → CodeEditor-D-Y16fdk.js} +1 -1
- package/apps/web/dist/assets/EditorPage-Duu8swX6.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-BPS86xzA.js → FlowPreview-DXnk7m9P.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-BRHbi_Sd.js → LangSwitch-Dkd0FBIH.js} +1 -1
- package/apps/web/dist/assets/Marketplace-Cty40VwG.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-B12l2_Jh.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-B10K8vND.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-D3SEpTmt.js +1 -0
- package/apps/web/dist/assets/PreviewPane-DhhQ06Ic.js +7 -0
- package/apps/web/dist/assets/PublicRunner-B8ncIxIP.js +1 -0
- package/apps/web/dist/assets/ReadOnly-DwewuYi8.js +1 -0
- package/apps/web/dist/assets/SettingsPage-C-gGIJLJ.js +2 -0
- package/apps/web/dist/assets/SetupPage-CdsrHW-w.js +1 -0
- package/apps/web/dist/assets/{SharePage-PKHX8a8a.js → SharePage-CZClatA_.js} +1 -1
- package/apps/web/dist/assets/SkillEditor-BaEiqqXl.js +1 -0
- package/apps/web/dist/assets/Skills-Bv6XbKxc.js +9 -0
- package/apps/web/dist/assets/SpacePage-CYhxcjj0.js +2 -0
- package/apps/web/dist/assets/UpdateCheck-CLPUsKVT.js +2 -0
- package/apps/web/dist/assets/changelog-y5oxYzPd.js +1 -0
- package/apps/web/dist/assets/circle-check-DDLzlcXP.js +1 -0
- package/apps/web/dist/assets/code-DsnwzN1x.js +1 -0
- package/apps/web/dist/assets/code-editor-Ca5EAxmd.js +2 -0
- package/apps/web/dist/assets/code-xml-S4IFi5Jc.js +1 -0
- package/apps/web/dist/assets/connection-sign-in-DECedzrs.js +1 -0
- package/apps/web/dist/assets/{dist-H1UN89OA.js → dist-B3Ray2U5.js} +1 -1
- package/apps/web/dist/assets/dist-CQpLJoQZ.js +10 -0
- package/apps/web/dist/assets/{dist-GlRRx9Xl.js → dist-D1uGQ_tB.js} +1 -1
- package/apps/web/dist/assets/{dist-BdDd1FxP.js → dist-DFI-tsfx.js} +1 -1
- package/apps/web/dist/assets/eye-TJSuiHHO.js +1 -0
- package/apps/web/dist/assets/floating-ui.dom-pwdNGv4b.js +1 -0
- package/apps/web/dist/assets/host-CJdLkzfY.js +125 -0
- package/apps/web/dist/assets/i18n-BBzMbGoo.js +55 -0
- package/apps/web/dist/assets/index-CmonJZHC.js +10 -0
- package/apps/web/dist/assets/index-w-3J3ZJ9.css +1 -0
- package/apps/web/dist/assets/{json-CEsfHdlZ.js → json-Ce3iHrtf.js} +1 -1
- package/apps/web/dist/assets/link-CPL8pB1P.js +1 -0
- package/apps/web/dist/assets/list-checks-DaxmUPqK.js +1 -0
- package/apps/web/dist/assets/{markdown-5-I9_izp.js → markdown-hqKQy2pp.js} +1 -1
- package/apps/web/dist/assets/marked.esm-DQ7XA7AC.js +67 -0
- package/apps/web/dist/assets/oss-credits-BrwV0a4F.js +1 -0
- package/apps/web/dist/assets/pdf-Dg-raaUo.js +54 -0
- package/apps/web/dist/assets/pdf.worker.min-68CMzziE.js +1 -0
- package/apps/web/dist/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
- package/apps/web/dist/assets/phone-B4uKDBFq.js +1 -0
- package/apps/web/dist/assets/read-aloud-Bfp9_bUY.js +1 -0
- package/apps/web/dist/assets/{runners-BoPaPsjN.js → runners-CUpBpSji.js} +1 -1
- package/apps/web/dist/assets/scroll-text-BEnPzQEi.js +1 -0
- package/apps/web/dist/assets/session-CMQo8P-G.js +2 -0
- package/apps/web/dist/assets/table-5B9G3oA6.js +1 -0
- package/apps/web/dist/assets/theme-D6KUBJnh.js +11 -0
- package/apps/web/dist/assets/ui-BCfu5sia.js +16 -0
- package/apps/web/dist/assets/upload-CAlHC232.js +1 -0
- package/apps/web/dist/assets/{useMutation-7_FOHoEl.js → useMutation-1fV4Nnxq.js} +1 -1
- package/apps/web/dist/assets/viewers-ChriFcRy.js +2 -0
- package/apps/web/dist/assets/volume-2-BqlBtCIJ.js +1 -0
- package/apps/web/dist/assets/w3c-keyname-BOAvb0qz.js +1 -0
- package/apps/web/dist/assets/xlsx-CuSbHU4R.js +141 -0
- package/apps/web/dist/index.html +19 -14
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +223 -4
- package/node_modules/@engenty/wizards/dist/plugin/mount.d.ts +123 -0
- package/node_modules/@engenty/wizards/dist/plugin/mount.js +7 -0
- package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +110 -1
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +24 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +24 -0
- package/node_modules/@engenty/wizards-shared/dist/knowledge.d.ts +33 -4
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +21 -4
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +27 -3
- package/node_modules/@engenty/wizards-shared/dist/spaces.d.ts +11 -1
- package/node_modules/@engenty/wizards-shared/dist/spaces.js +9 -2
- package/node_modules/@engenty/wizards-shared/dist/text-merge.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/text-merge.js +25 -0
- package/package.json +3 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/AboutDialog-DaWEIHFN.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-Dt91U_sK.js +0 -2
- package/apps/web/dist/assets/EditorPage-DS_a5K3s.js +0 -3
- package/apps/web/dist/assets/Marketplace-CS7JTgiv.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-D-OLsex6.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-BM_pkk41.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-Cpn5pubC.js +0 -1
- package/apps/web/dist/assets/PreviewPane-BOk1-yO4.js +0 -9
- package/apps/web/dist/assets/PublicRunner-CgzMZb0r.js +0 -1
- package/apps/web/dist/assets/ReadOnly-8DEx-ly3.js +0 -1
- package/apps/web/dist/assets/SettingsPage-CcrknFcI.js +0 -2
- package/apps/web/dist/assets/SetupPage-D5nzjgPU.js +0 -1
- package/apps/web/dist/assets/SkillEditor-BsXTqNli.js +0 -1
- package/apps/web/dist/assets/Skills-C_X1ZsKg.js +0 -9
- package/apps/web/dist/assets/SpacePage-wZGqUoSQ.js +0 -2
- package/apps/web/dist/assets/UpdateCheck-D6x7MqEl.js +0 -2
- package/apps/web/dist/assets/changelog-M-eOBqgu.js +0 -1
- package/apps/web/dist/assets/circle-alert-DJbCyxcg.js +0 -1
- package/apps/web/dist/assets/circle-check-jqtsKi_b.js +0 -1
- package/apps/web/dist/assets/code-editor-BpCEnf8H.js +0 -2
- package/apps/web/dist/assets/code-xml-q88cSTV8.js +0 -1
- package/apps/web/dist/assets/connection-sign-in-UJ6xk-TD.js +0 -1
- package/apps/web/dist/assets/dist-EBVTpvRr.js +0 -10
- package/apps/web/dist/assets/eye-CgkvVlba.js +0 -1
- package/apps/web/dist/assets/host-Bd_bon_c.js +0 -118
- package/apps/web/dist/assets/i18n-0fUKyVRE.js +0 -55
- package/apps/web/dist/assets/index-D18DvnxX.css +0 -1
- package/apps/web/dist/assets/index-DOgwxnto.js +0 -10
- package/apps/web/dist/assets/oss-credits-IdX5bc71.js +0 -1
- package/apps/web/dist/assets/phone-CjPvZ0nk.js +0 -1
- package/apps/web/dist/assets/read-aloud-CLXo_asN.js +0 -1
- package/apps/web/dist/assets/scroll-text-2BhJO_W7.js +0 -1
- package/apps/web/dist/assets/session-CpYa5hwd.js +0 -2
- package/apps/web/dist/assets/theme-Bj3wNQR0.js +0 -11
- package/apps/web/dist/assets/ui-CktezodE.js +0 -82
- package/apps/web/dist/assets/upload-CHGCFVZK.js +0 -1
- package/apps/web/dist/assets/volume-2-Bw5KASy8.js +0 -1
|
@@ -2,7 +2,7 @@ import { TableColumnValueError, tableColumnsSchema, } from "@engenty/wizards-sha
|
|
|
2
2
|
import { note } from "@engenty/wizards-shared/run";
|
|
3
3
|
import { editCells, SPACE_DATA_LIMITS, } from "@engenty/wizards-shared/space-data";
|
|
4
4
|
import { rowKey } from "@engenty/wizards-shared/store";
|
|
5
|
-
import { and, asc, count, desc, eq, inArray, isNotNull, isNull, max } from "drizzle-orm";
|
|
5
|
+
import { and, asc, count, desc, eq, inArray, isNotNull, isNull, max, ne } from "drizzle-orm";
|
|
6
6
|
import { nanoid } from "nanoid";
|
|
7
7
|
import { assertRwx, pageResources, readable, tableResources } from "../broker/rwx.js";
|
|
8
8
|
import { db, schema } from "../db/client.js";
|
|
@@ -139,12 +139,15 @@ export async function createTable(userId, spaceId, input, lang = "en") {
|
|
|
139
139
|
: [{ id: "name", name: "Name", type: "text" }];
|
|
140
140
|
const id = nanoid(12);
|
|
141
141
|
const wizardId = await ownerOf(space.id, input.wizardId);
|
|
142
|
+
const parentId = wizardId ? null : await parentOf(space.id, input.parentId);
|
|
142
143
|
const title = input.title.trim() || serverText(lang, "tableTitle");
|
|
143
144
|
await db.insert(schema.spaceTable).values({
|
|
144
145
|
id,
|
|
145
146
|
tenantId: currentTenant(),
|
|
146
147
|
spaceId: space.id,
|
|
147
148
|
wizardId,
|
|
149
|
+
parentId,
|
|
150
|
+
position: wizardId ? 0 : await nextPosition(space.id, parentId),
|
|
148
151
|
title,
|
|
149
152
|
slug: wizardId ? null : await freeSlug(space.id, title, "table"),
|
|
150
153
|
format: input.format ?? null,
|
|
@@ -405,12 +408,26 @@ async function parentOf(spaceId, parentId, pageId) {
|
|
|
405
408
|
}
|
|
406
409
|
return parent.id;
|
|
407
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* The place after the last of a folder's contents: its sub-pages, tables and documents share one
|
|
413
|
+
* order. `parentId` null: the top of Knowledge.
|
|
414
|
+
*/
|
|
408
415
|
async function nextPosition(spaceId, parentId) {
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
416
|
+
const lasts = await Promise.all([
|
|
417
|
+
db
|
|
418
|
+
.select({ last: max(schema.spacePage.position) })
|
|
419
|
+
.from(schema.spacePage)
|
|
420
|
+
.where(and(eq(schema.spacePage.spaceId, spaceId), isNull(schema.spacePage.wizardId), parentId ? eq(schema.spacePage.parentId, parentId) : isNull(schema.spacePage.parentId))),
|
|
421
|
+
db
|
|
422
|
+
.select({ last: max(schema.spaceTable.position) })
|
|
423
|
+
.from(schema.spaceTable)
|
|
424
|
+
.where(and(eq(schema.spaceTable.spaceId, spaceId), isNull(schema.spaceTable.wizardId), parentId ? eq(schema.spaceTable.parentId, parentId) : isNull(schema.spaceTable.parentId))),
|
|
425
|
+
db
|
|
426
|
+
.select({ last: max(schema.spaceFile.position) })
|
|
427
|
+
.from(schema.spaceFile)
|
|
428
|
+
.where(and(eq(schema.spaceFile.spaceId, spaceId), eq(schema.spaceFile.kind, "document"), parentId ? eq(schema.spaceFile.parentId, parentId) : isNull(schema.spaceFile.parentId))),
|
|
429
|
+
]);
|
|
430
|
+
return Math.max(-1, ...lasts.map(([{ last }]) => last ?? -1)) + 1;
|
|
414
431
|
}
|
|
415
432
|
export async function createPage(userId, spaceId, input) {
|
|
416
433
|
const space = await ownedSpace(userId, spaceId);
|
|
@@ -475,7 +492,10 @@ export async function updatePage(_userId, pageId, patch) {
|
|
|
475
492
|
? await parentOf(page.spaceId, patch.parentId, page.id)
|
|
476
493
|
: page.parentId;
|
|
477
494
|
const moved = title !== page.title || wizardId !== page.wizardId || parentId !== page.parentId;
|
|
478
|
-
const
|
|
495
|
+
const texted = patch.markdown !== undefined && patch.markdown !== page.markdown;
|
|
496
|
+
// A source's own folder renamed or moved stays the source's: its name is the source's name.
|
|
497
|
+
const sourceFolder = Boolean(page.origin?.startsWith("source:")) && page.originKey === "root";
|
|
498
|
+
const edited = (moved && !sourceFolder) || texted;
|
|
479
499
|
const at = new Date();
|
|
480
500
|
await db
|
|
481
501
|
.update(schema.spacePage)
|
|
@@ -497,6 +517,15 @@ export async function updatePage(_userId, pageId, patch) {
|
|
|
497
517
|
updatedAt: at,
|
|
498
518
|
})
|
|
499
519
|
.where(eq(schema.spacePage.id, page.id));
|
|
520
|
+
if (sourceFolder && title !== page.title && page.origin) {
|
|
521
|
+
await db
|
|
522
|
+
.update(schema.spaceSource)
|
|
523
|
+
.set({ label: title, updatedAt: at })
|
|
524
|
+
.where(eq(schema.spaceSource.id, page.origin.slice("source:".length)));
|
|
525
|
+
for (const table of [schema.spacePage, schema.spaceTable]) {
|
|
526
|
+
await db.update(table).set({ originLabel: title }).where(eq(table.origin, page.origin));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
500
529
|
if (moved) {
|
|
501
530
|
queueIndex(`P:${page.id}`);
|
|
502
531
|
}
|
|
@@ -511,6 +540,133 @@ export async function deletePage(_userId, pageId) {
|
|
|
511
540
|
await db.delete(schema.spacePage).where(eq(schema.spacePage.id, page.id));
|
|
512
541
|
await dropOriginal(page);
|
|
513
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Moves an item of Knowledge (`p:`, `t:` or `f:` and its id) into a folder — a page of the
|
|
545
|
+
* space's own, or the top for null — at `index` among the folder's contents, at the end when left
|
|
546
|
+
* out. A page's path follows it; a table's and a file's do not.
|
|
547
|
+
*/
|
|
548
|
+
export async function moveKnowledgeItem(userId, spaceId, input) {
|
|
549
|
+
const space = await ownedSpace(userId, spaceId);
|
|
550
|
+
await requireWritableSpace(space.id);
|
|
551
|
+
await placeItem(space.id, input.key, input.parentId);
|
|
552
|
+
if (input.index !== undefined) {
|
|
553
|
+
await orderFolder(space.id, input.parentId ?? null, input.key, input.index);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Puts an item of Knowledge into a folder of the space, at the end of its contents, unless it is
|
|
558
|
+
* there. Moved, not edited: what a plugin or a source wrote stays theirs.
|
|
559
|
+
*/
|
|
560
|
+
export async function placeItem(spaceId, key, parentId) {
|
|
561
|
+
const kind = key[0];
|
|
562
|
+
const id = key.slice(2);
|
|
563
|
+
const own = (row) => {
|
|
564
|
+
if (!row || row.spaceId !== spaceId) {
|
|
565
|
+
throw notFound();
|
|
566
|
+
}
|
|
567
|
+
return row;
|
|
568
|
+
};
|
|
569
|
+
if (kind === "p") {
|
|
570
|
+
const page = own(await pageRow(id));
|
|
571
|
+
if (page.wizardId) {
|
|
572
|
+
throw notFound();
|
|
573
|
+
}
|
|
574
|
+
const parent = await parentOf(spaceId, parentId, page.id);
|
|
575
|
+
if (parent !== page.parentId) {
|
|
576
|
+
await db
|
|
577
|
+
.update(schema.spacePage)
|
|
578
|
+
.set({
|
|
579
|
+
parentId: parent,
|
|
580
|
+
slug: await freeSlug(spaceId, page.title, { parentId: parent }, page.id),
|
|
581
|
+
position: await nextPosition(spaceId, parent),
|
|
582
|
+
updatedAt: new Date(),
|
|
583
|
+
})
|
|
584
|
+
.where(eq(schema.spacePage.id, page.id));
|
|
585
|
+
queueIndex(`P:${page.id}`);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
else if (kind === "t") {
|
|
589
|
+
const table = own(await tableRow(id));
|
|
590
|
+
if (table.wizardId) {
|
|
591
|
+
throw notFound();
|
|
592
|
+
}
|
|
593
|
+
const parent = await parentOf(spaceId, parentId);
|
|
594
|
+
if (parent !== table.parentId) {
|
|
595
|
+
await db
|
|
596
|
+
.update(schema.spaceTable)
|
|
597
|
+
.set({ parentId: parent, position: await nextPosition(spaceId, parent) })
|
|
598
|
+
.where(eq(schema.spaceTable.id, table.id));
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
else if (kind === "f") {
|
|
602
|
+
const file = own(await db.query.spaceFile.findFirst({
|
|
603
|
+
where: and(eq(schema.spaceFile.id, id), eq(schema.spaceFile.kind, "document")),
|
|
604
|
+
}));
|
|
605
|
+
const parent = await parentOf(spaceId, parentId);
|
|
606
|
+
if (parent !== file.parentId) {
|
|
607
|
+
const position = await nextPosition(spaceId, parent);
|
|
608
|
+
await db
|
|
609
|
+
.update(schema.spaceFile)
|
|
610
|
+
.set({ parentId: parent, position })
|
|
611
|
+
.where(eq(schema.spaceFile.id, file.id));
|
|
612
|
+
// What it was read into goes with it: its first page (its parts stay under that) and its
|
|
613
|
+
// tables.
|
|
614
|
+
const was = file.parentId
|
|
615
|
+
? eq(schema.spacePage.parentId, file.parentId)
|
|
616
|
+
: isNull(schema.spacePage.parentId);
|
|
617
|
+
for (const page of await db.query.spacePage.findMany({
|
|
618
|
+
where: and(eq(schema.spacePage.fileId, file.id), was),
|
|
619
|
+
columns: { id: true },
|
|
620
|
+
})) {
|
|
621
|
+
await placeItem(spaceId, `p:${page.id}`, parent);
|
|
622
|
+
}
|
|
623
|
+
await db
|
|
624
|
+
.update(schema.spaceTable)
|
|
625
|
+
.set({ parentId: parent, position })
|
|
626
|
+
.where(eq(schema.spaceTable.fileId, file.id));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
throw notFound();
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
/** Puts `key` at `index` among a folder's contents and numbers them all again. */
|
|
634
|
+
async function orderFolder(spaceId, parentId, key, index) {
|
|
635
|
+
const [pages, tables, files] = await Promise.all([
|
|
636
|
+
db.query.spacePage.findMany({
|
|
637
|
+
where: and(eq(schema.spacePage.spaceId, spaceId), isNull(schema.spacePage.wizardId), parentId ? eq(schema.spacePage.parentId, parentId) : isNull(schema.spacePage.parentId)),
|
|
638
|
+
columns: { id: true, position: true, title: true },
|
|
639
|
+
}),
|
|
640
|
+
db.query.spaceTable.findMany({
|
|
641
|
+
where: and(eq(schema.spaceTable.spaceId, spaceId), isNull(schema.spaceTable.wizardId), parentId ? eq(schema.spaceTable.parentId, parentId) : isNull(schema.spaceTable.parentId)),
|
|
642
|
+
columns: { id: true, position: true, title: true },
|
|
643
|
+
}),
|
|
644
|
+
db.query.spaceFile.findMany({
|
|
645
|
+
where: and(eq(schema.spaceFile.spaceId, spaceId), eq(schema.spaceFile.kind, "document"), parentId ? eq(schema.spaceFile.parentId, parentId) : isNull(schema.spaceFile.parentId)),
|
|
646
|
+
columns: { id: true, position: true, name: true },
|
|
647
|
+
}),
|
|
648
|
+
]);
|
|
649
|
+
const all = [
|
|
650
|
+
...pages.map((p) => ({ key: `p:${p.id}`, position: p.position, title: p.title })),
|
|
651
|
+
...tables.map((t) => ({ key: `t:${t.id}`, position: t.position, title: t.title })),
|
|
652
|
+
...files.map((f) => ({ key: `f:${f.id}`, position: f.position, title: f.name })),
|
|
653
|
+
].sort((a, b) => a.position - b.position || a.title.localeCompare(b.title, "de"));
|
|
654
|
+
const moving = all.find((i) => i.key === key);
|
|
655
|
+
if (!moving) {
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
658
|
+
const rest = all.filter((i) => i !== moving);
|
|
659
|
+
rest.splice(Math.max(0, Math.min(index, rest.length)), 0, moving);
|
|
660
|
+
for (const [position, item] of rest.entries()) {
|
|
661
|
+
const id = item.key.slice(2);
|
|
662
|
+
const table = item.key[0] === "p"
|
|
663
|
+
? schema.spacePage
|
|
664
|
+
: item.key[0] === "t"
|
|
665
|
+
? schema.spaceTable
|
|
666
|
+
: schema.spaceFile;
|
|
667
|
+
await db.update(table).set({ position }).where(eq(table.id, id));
|
|
668
|
+
}
|
|
669
|
+
}
|
|
514
670
|
/** Puts a page's sub-pages into the order of `ids`. */
|
|
515
671
|
export async function orderSubPages(_userId, pageId, ids) {
|
|
516
672
|
const page = await pageRow(pageId);
|
|
@@ -775,8 +931,9 @@ export async function listOrigin(origin, space) {
|
|
|
775
931
|
updatedAt: true,
|
|
776
932
|
},
|
|
777
933
|
}),
|
|
934
|
+
// A page's pictures go with its pages, not as items of their own.
|
|
778
935
|
db.query.spaceFile.findMany({
|
|
779
|
-
where: and(eq(schema.spaceFile.spaceId, spaceId), eq(schema.spaceFile.origin, origin)),
|
|
936
|
+
where: and(eq(schema.spaceFile.spaceId, spaceId), eq(schema.spaceFile.origin, origin), ne(schema.spaceFile.kind, "picture")),
|
|
780
937
|
columns: { id: true, originKey: true, name: true, updatedAt: true },
|
|
781
938
|
}),
|
|
782
939
|
]);
|
|
@@ -2,10 +2,12 @@ import { note } from "@engenty/wizards-shared/run";
|
|
|
2
2
|
import { SPACE_LIMITS, spaceFileLimit, } from "@engenty/wizards-shared/spaces";
|
|
3
3
|
import { generateText } from "ai";
|
|
4
4
|
import { and, asc, count, eq, max } from "drizzle-orm";
|
|
5
|
+
import { nanoid } from "nanoid";
|
|
5
6
|
import { assertRwx } from "../broker/rwx.js";
|
|
6
7
|
import { db, schema } from "../db/client.js";
|
|
7
8
|
import { documentMime, UnreadableDocument } from "../documents/parse.js";
|
|
8
|
-
import {
|
|
9
|
+
import { blobThumb, getBlob, putBlob, releaseBlob } from "../files/blobs.js";
|
|
10
|
+
import { hasThumb } from "../files/thumbs.js";
|
|
9
11
|
import { checkUpload } from "../files/upload-check.js";
|
|
10
12
|
import { embeddingModel, textModel } from "../models.js";
|
|
11
13
|
import { spaceFileChanged } from "../plugins/events.js";
|
|
@@ -35,6 +37,7 @@ export function fileView(row) {
|
|
|
35
37
|
indexed: row.indexed,
|
|
36
38
|
pages: row.pages,
|
|
37
39
|
chars: row.chars,
|
|
40
|
+
thumb: Boolean(row.hash) && hasThumb(row.mime),
|
|
38
41
|
createdAt: row.createdAt.toISOString(),
|
|
39
42
|
};
|
|
40
43
|
}
|
|
@@ -55,6 +58,10 @@ export async function spaceFile(spaceId, fileId) {
|
|
|
55
58
|
}
|
|
56
59
|
return row;
|
|
57
60
|
}
|
|
61
|
+
/** A file's bytes, from the blob store; null when they are not there. */
|
|
62
|
+
export async function spaceFileBytes(row) {
|
|
63
|
+
return row.hash ? getBlob(row.hash).catch(() => null) : null;
|
|
64
|
+
}
|
|
58
65
|
/**
|
|
59
66
|
* A file's bytes. A document's go out only to a `who` the broker lets read it (broker/rwx.ts),
|
|
60
67
|
* and to nobody when none is given; a logo, pattern or asset is the brand's, not Knowledge, and
|
|
@@ -65,11 +72,19 @@ export async function spaceFileContent(spaceId, fileId, who = []) {
|
|
|
65
72
|
if (row.kind === "document") {
|
|
66
73
|
await assertRwx(spaceId, who, { kind: "document", id: row.id }, "r");
|
|
67
74
|
}
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
75
|
+
const data = await spaceFileBytes(row);
|
|
76
|
+
if (!data) {
|
|
70
77
|
throw notFound();
|
|
71
78
|
}
|
|
72
|
-
return { row, data
|
|
79
|
+
return { row, data };
|
|
80
|
+
}
|
|
81
|
+
/** A file's thumbnail (files/thumbs.ts), to the same people as its bytes; null when it has none. */
|
|
82
|
+
export async function spaceFileThumb(spaceId, fileId, who = []) {
|
|
83
|
+
const row = await spaceFile(spaceId, fileId);
|
|
84
|
+
if (row.kind === "document") {
|
|
85
|
+
await assertRwx(spaceId, who, { kind: "document", id: row.id }, "r");
|
|
86
|
+
}
|
|
87
|
+
return row.hash ? blobThumb(row.hash, row.mime) : null;
|
|
73
88
|
}
|
|
74
89
|
/**
|
|
75
90
|
* Assets are what wizards put into what they make: pictures, clips, recordings, and files to
|
|
@@ -77,6 +92,10 @@ export async function spaceFileContent(spaceId, fileId, who = []) {
|
|
|
77
92
|
*/
|
|
78
93
|
const ASSET_TYPES = /^((image|video|audio|font)\/|application\/(pdf|json)$|model\/gltf)/;
|
|
79
94
|
function accepts(kind, mime) {
|
|
95
|
+
// A page's pictures come only with their page (page-pictures.ts).
|
|
96
|
+
if (kind === "picture") {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
80
99
|
if (kind === "logo" || kind === "pattern") {
|
|
81
100
|
return mime.startsWith("image/");
|
|
82
101
|
}
|
|
@@ -115,23 +134,19 @@ export async function addSpaceFile(spaceId, input) {
|
|
|
115
134
|
if (n >= SPACE_LIMITS.files[input.kind]) {
|
|
116
135
|
throw new ServiceError("refused", note("roomMostFiles", { count: SPACE_LIMITS.files[input.kind] }));
|
|
117
136
|
}
|
|
118
|
-
const
|
|
119
|
-
kind: input.kind === "logo" ? "logo" : "space",
|
|
120
|
-
mime,
|
|
121
|
-
name,
|
|
122
|
-
data,
|
|
123
|
-
});
|
|
137
|
+
const hash = await putBlob(data);
|
|
124
138
|
const description = input.description?.trim().slice(0, 600) ?? "";
|
|
125
139
|
const work = input.kind === "document" || (!description && SEEN_BY_MODEL.includes(mime));
|
|
126
140
|
const [row] = await db
|
|
127
141
|
.insert(schema.spaceFile)
|
|
128
142
|
.values({
|
|
129
|
-
id:
|
|
143
|
+
id: nanoid(16),
|
|
130
144
|
spaceId,
|
|
131
145
|
kind: input.kind,
|
|
132
146
|
name,
|
|
133
147
|
mime,
|
|
134
148
|
size: data.byteLength,
|
|
149
|
+
hash,
|
|
135
150
|
description,
|
|
136
151
|
source: input.source ?? null,
|
|
137
152
|
position: (last ?? -1) + 1,
|
|
@@ -140,8 +155,10 @@ export async function addSpaceFile(spaceId, input) {
|
|
|
140
155
|
.returning();
|
|
141
156
|
if (input.kind === "logo") {
|
|
142
157
|
// Logos are shown on public pages, where only the control database knows the tenant.
|
|
143
|
-
await putLink(
|
|
158
|
+
await putLink(row.id, "logo", row.id);
|
|
144
159
|
}
|
|
160
|
+
// Made now, so lists show it at once.
|
|
161
|
+
void blobThumb(hash, mime).catch(() => null);
|
|
145
162
|
if (work) {
|
|
146
163
|
void prepare(row);
|
|
147
164
|
}
|
|
@@ -241,6 +258,25 @@ async function describeImage(row, data) {
|
|
|
241
258
|
});
|
|
242
259
|
return result.text.trim().slice(0, 600);
|
|
243
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* A picture of a page (kind `picture`) where the embedding model doesn't see pictures: a sentence
|
|
263
|
+
* says what it shows, after the words it came with, and the index finds it by them.
|
|
264
|
+
*/
|
|
265
|
+
export function describePicture(row) {
|
|
266
|
+
void slot(async () => {
|
|
267
|
+
const data = await spaceFileBytes(row);
|
|
268
|
+
const said = data ? await describeImage(row, new Uint8Array(data)).catch(() => "") : "";
|
|
269
|
+
await db
|
|
270
|
+
.update(schema.spaceFile)
|
|
271
|
+
.set({
|
|
272
|
+
status: "ready",
|
|
273
|
+
description: [row.description, said].filter(Boolean).join("\n").slice(0, 600),
|
|
274
|
+
updatedAt: new Date(),
|
|
275
|
+
})
|
|
276
|
+
.where(eq(schema.spaceFile.id, row.id));
|
|
277
|
+
queueIndex(`f:${row.id}`);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
244
280
|
async function describeDocument(row, text) {
|
|
245
281
|
const reader = await textModel("classifier");
|
|
246
282
|
const result = await generateText({
|
|
@@ -282,11 +318,11 @@ async function prepare(row) {
|
|
|
282
318
|
.set({ ...values, updatedAt: new Date() })
|
|
283
319
|
.where(eq(schema.spaceFile.id, row.id));
|
|
284
320
|
try {
|
|
285
|
-
const found = await
|
|
321
|
+
const found = await spaceFileBytes(row);
|
|
286
322
|
if (!found) {
|
|
287
323
|
return;
|
|
288
324
|
}
|
|
289
|
-
const data = new Uint8Array(found
|
|
325
|
+
const data = new Uint8Array(found);
|
|
290
326
|
if (row.kind !== "document") {
|
|
291
327
|
const description = await describeImage(row, data).catch(() => "");
|
|
292
328
|
await set({ status: "ready", ...(description ? { description } : {}) });
|
|
@@ -352,6 +388,50 @@ export async function updateSpaceFile(spaceId, fileId, patch) {
|
|
|
352
388
|
}
|
|
353
389
|
return updated;
|
|
354
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* A page's picture made a brand asset („In Marke übernehmen“): the same bytes under a row of the
|
|
393
|
+
* kind `asset`, at the end of the assets. One the brand has already is given back as it is.
|
|
394
|
+
*/
|
|
395
|
+
export async function pictureToBrand(spaceId, fileId) {
|
|
396
|
+
await requireWritableSpace(spaceId);
|
|
397
|
+
const row = await spaceFile(spaceId, fileId);
|
|
398
|
+
if (row.kind !== "picture" || !row.hash) {
|
|
399
|
+
throw new ServiceError("invalid", note("filesGoHere"));
|
|
400
|
+
}
|
|
401
|
+
const scope = and(eq(schema.spaceFile.spaceId, spaceId), eq(schema.spaceFile.kind, "asset"));
|
|
402
|
+
const had = await db.query.spaceFile.findFirst({
|
|
403
|
+
where: and(scope, eq(schema.spaceFile.hash, row.hash)),
|
|
404
|
+
});
|
|
405
|
+
if (had) {
|
|
406
|
+
return had;
|
|
407
|
+
}
|
|
408
|
+
const [{ n, last }] = await db
|
|
409
|
+
.select({ n: count(), last: max(schema.spaceFile.position) })
|
|
410
|
+
.from(schema.spaceFile)
|
|
411
|
+
.where(scope);
|
|
412
|
+
if (n >= SPACE_LIMITS.files.asset) {
|
|
413
|
+
throw new ServiceError("refused", note("roomMostFiles", { count: SPACE_LIMITS.files.asset }));
|
|
414
|
+
}
|
|
415
|
+
const [asset] = await db
|
|
416
|
+
.insert(schema.spaceFile)
|
|
417
|
+
.values({
|
|
418
|
+
id: nanoid(16),
|
|
419
|
+
spaceId,
|
|
420
|
+
kind: "asset",
|
|
421
|
+
name: row.name,
|
|
422
|
+
mime: row.mime,
|
|
423
|
+
size: row.size,
|
|
424
|
+
hash: row.hash,
|
|
425
|
+
description: row.description,
|
|
426
|
+
source: row.source,
|
|
427
|
+
position: (last ?? -1) + 1,
|
|
428
|
+
status: "ready",
|
|
429
|
+
})
|
|
430
|
+
.returning();
|
|
431
|
+
queueIndex(`f:${asset.id}`);
|
|
432
|
+
spaceFileChanged("space.file.ready", asset);
|
|
433
|
+
return asset;
|
|
434
|
+
}
|
|
355
435
|
/** Puts the files of one kind into the order of `ids`; the first logo is the one end users see. */
|
|
356
436
|
export async function orderSpaceFiles(spaceId, kind, ids) {
|
|
357
437
|
await requireWritableSpace(spaceId);
|
|
@@ -372,7 +452,8 @@ async function removeRow(row) {
|
|
|
372
452
|
const { dropConverted } = await import("./knowledge-model.js");
|
|
373
453
|
await dropConverted(row.id);
|
|
374
454
|
await db.delete(schema.spaceFile).where(eq(schema.spaceFile.id, row.id));
|
|
375
|
-
await
|
|
455
|
+
await releaseBlob(row.hash);
|
|
456
|
+
await releaseBlob(row.textHash);
|
|
376
457
|
if (row.kind === "logo" || row.mime.startsWith("font/")) {
|
|
377
458
|
await dropLinks([row.id]);
|
|
378
459
|
}
|
|
@@ -409,6 +490,7 @@ export async function putOriginFile(origin, input) {
|
|
|
409
490
|
name,
|
|
410
491
|
mime,
|
|
411
492
|
size: input.data.byteLength,
|
|
493
|
+
hash: await putBlob(input.data),
|
|
412
494
|
description: input.description?.trim().slice(0, 600) ?? existing?.description ?? "",
|
|
413
495
|
originLabel: input.label?.trim().slice(0, 120) || null,
|
|
414
496
|
status: "ready",
|
|
@@ -420,8 +502,9 @@ export async function putOriginFile(origin, input) {
|
|
|
420
502
|
let id = existing?.id;
|
|
421
503
|
if (existing) {
|
|
422
504
|
// New content under the id it has: pages that name it as their original keep it.
|
|
423
|
-
await replaceAsset(existing.id, { mime, name, data: input.data });
|
|
424
505
|
await db.update(schema.spaceFile).set(values).where(eq(schema.spaceFile.id, existing.id));
|
|
506
|
+
await releaseBlob(existing.hash);
|
|
507
|
+
await releaseBlob(existing.textHash);
|
|
425
508
|
}
|
|
426
509
|
else {
|
|
427
510
|
const [{ n, last }] = await db
|
|
@@ -431,10 +514,9 @@ export async function putOriginFile(origin, input) {
|
|
|
431
514
|
if (n >= SPACE_LIMITS.files.document) {
|
|
432
515
|
throw new ServiceError("refused", note("spaceMostDocuments", { count: SPACE_LIMITS.files.document }));
|
|
433
516
|
}
|
|
434
|
-
|
|
435
|
-
id = ref.id;
|
|
517
|
+
id = nanoid(16);
|
|
436
518
|
await db.insert(schema.spaceFile).values({
|
|
437
|
-
id
|
|
519
|
+
id,
|
|
438
520
|
spaceId: input.space,
|
|
439
521
|
kind: "document",
|
|
440
522
|
position: (last ?? -1) + 1,
|
|
@@ -443,6 +525,7 @@ export async function putOriginFile(origin, input) {
|
|
|
443
525
|
...values,
|
|
444
526
|
});
|
|
445
527
|
}
|
|
528
|
+
void blobThumb(values.hash, mime).catch(() => null);
|
|
446
529
|
if (input.categories) {
|
|
447
530
|
await setItemCategories(input.space, { fileId: id }, input.categories, "origin");
|
|
448
531
|
}
|