@8wave/ai-elements 0.114.0-beta.8 → 0.115.0-beta.13
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/dist/_chunks/Agent-DK76k05_.js +566 -0
- package/dist/_chunks/Agent-DK76k05_.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-C1sANAr5.js → PkStreamingMarkdown-BKxA6Ntl.js} +688 -672
- package/dist/_chunks/PkStreamingMarkdown-BKxA6Ntl.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-BbxYKt-9.js → PkToolRequestGeolocation-OF1PWhMw.js} +2 -2
- package/{dist-vue/_chunks/PkToolRequestGeolocation-9vfYNaQo.js.map → dist/_chunks/PkToolRequestGeolocation-OF1PWhMw.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CTp2w60F.js → PkToolRequestOAuthConnection-CgQePKKb.js} +4 -4
- package/dist/_chunks/PkToolRequestOAuthConnection-CgQePKKb.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-BfTjxGOT.js → PkToolShowArtifact-CHxeuKEU.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BfTjxGOT.js.map → PkToolShowArtifact-CHxeuKEU.js.map} +1 -1
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js +72 -0
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-PFpY9dIp.js → PkToolShowContactForm-DqVLVwqJ.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-PFpY9dIp.js.map → PkToolShowContactForm-DqVLVwqJ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-CMtSN0oX.js → PkToolShowForm-YJQPYfEe.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-CMtSN0oX.js.map → PkToolShowForm-YJQPYfEe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-C6cu66Ts.js → PkToolShowSources-kGQlIKaN.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-C6cu66Ts.js.map → PkToolShowSources-kGQlIKaN.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js → PkToolShowSuggestedReply-Dl4x_nEJ.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js.map → PkToolShowSuggestedReply-Dl4x_nEJ.js.map} +1 -1
- package/dist/_chunks/{markdown-BRD-hDrH.js → markdown-B4cYQGBo.js} +37 -21
- package/dist/_chunks/markdown-B4cYQGBo.js.map +1 -0
- package/dist/ai-elements.es.js +3177 -2748
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-BNlmK-uJ.js → Agent-tbKw8Mdt.js} +2 -2
- package/dist-vue/_chunks/{Agent-BNlmK-uJ.js.map → Agent-tbKw8Mdt.js.map} +1 -1
- package/dist-vue/_chunks/{Document-2X01-F4Z.js → Document-BWz2HySu.js} +37 -21
- package/dist-vue/_chunks/Document-BWz2HySu.js.map +1 -0
- package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbot-HRayDr2d.js → PkChatbot-DtyZYAzj.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-HRayDr2d.js.map → PkChatbot-DtyZYAzj.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js +421 -0
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-CPOcfoRC.js → PkChatbotEmptyState-Dicjr_Fv.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CPOcfoRC.js.map → PkChatbotEmptyState-Dicjr_Fv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-pLJQIu7v.js → PkChatbotInput-DcLmOqA1.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-pLJQIu7v.js.map → PkChatbotInput-DcLmOqA1.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-GZStJbx_.js → PkChatbotMessages-CrhRrcBs.js} +258 -256
- package/dist-vue/_chunks/PkChatbotMessages-CrhRrcBs.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js → PkChatbotStepPayload-rKaeDQDj.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js.map → PkChatbotStepPayload-rKaeDQDj.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js → PkChatbotStepToolDetail-5HdSV8Im.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js.map → PkChatbotStepToolDetail-5HdSV8Im.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-CPPjwTJN.js +191 -0
- package/dist-vue/_chunks/PkChatbotSteps-CPPjwTJN.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-DIfBWFoG.js → PkChatbotViewChat-B13nCznB.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-DIfBWFoG.js.map → PkChatbotViewChat-B13nCznB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BCdolW0R.js → PkChatbotViewConversations-CHpN4vhm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BCdolW0R.js.map → PkChatbotViewConversations-CHpN4vhm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-Cudao8ew.js → PkChatbotViewFiles-cRyG5X3P.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-Cudao8ew.js.map → PkChatbotViewFiles-cRyG5X3P.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-DDsKOkcC.js → PkChatbotViewProfile-CosaHA-g.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-DDsKOkcC.js.map → PkChatbotViewProfile-CosaHA-g.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BloMJaIW.js → PkStreamingMarkdown-DYy79C1P.js} +214 -205
- package/dist-vue/_chunks/{PkStreamingMarkdown-BloMJaIW.js.map → PkStreamingMarkdown-DYy79C1P.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-9vfYNaQo.js → PkToolRequestGeolocation-BOVbaCzQ.js} +2 -2
- package/{dist/_chunks/PkToolRequestGeolocation-BbxYKt-9.js.map → dist-vue/_chunks/PkToolRequestGeolocation-BOVbaCzQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-BorR5NmZ.js → PkToolRequestOAuthConnection-a2LegFoE.js} +4 -4
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-a2LegFoE.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-BuMY7GNj.js → PkToolShowArtifact-DUOnFdfa.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BuMY7GNj.js.map → PkToolShowArtifact-DUOnFdfa.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js +72 -0
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-0OQRqT8m.js → PkToolShowContactForm-1TFKvG_s.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-0OQRqT8m.js.map → PkToolShowContactForm-1TFKvG_s.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BGL27iHG.js → PkToolShowDiagram-BnbkymPD.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BGL27iHG.js.map → PkToolShowDiagram-BnbkymPD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-BJJpS69F.js → PkToolShowEmail-BDsBoETQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-BJJpS69F.js.map → PkToolShowEmail-BDsBoETQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DDcPpOZ8.js → PkToolShowForm-DwFKxMJd.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-DDcPpOZ8.js.map → PkToolShowForm-DwFKxMJd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-BFGynf3p.js → PkToolShowMessage-Dau3agUy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-BFGynf3p.js.map → PkToolShowMessage-Dau3agUy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-6t1Ir5CW.js → PkToolShowProductList-CsupMsuy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-6t1Ir5CW.js.map → PkToolShowProductList-CsupMsuy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-cOF0ZxOj.js → PkToolShowSources-C8r1vKJk.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowSources-cOF0ZxOj.js.map → PkToolShowSources-C8r1vKJk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DA4NEjHB.js → PkToolShowSuggestedReply-qAWdCUhr.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DA4NEjHB.js.map → PkToolShowSuggestedReply-qAWdCUhr.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-OgaT1vYJ.js → PkToolShowWebPages-D4E3Xzg1.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-OgaT1vYJ.js.map → PkToolShowWebPages-D4E3Xzg1.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-Cd69XP5z.js → PkUrl-Cu3qKl4G.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-Cd69XP5z.js.map → PkUrl-Cu3qKl4G.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CaVLm5W9.js → createChatbotApiClient-BlWs282E.js} +137 -168
- package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-BwrBZJCq.js → useChatbotStore-CMo47fnS.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-BwrBZJCq.js.map → useChatbotStore-CMo47fnS.js.map} +1 -1
- package/dist-vue/_chunks/utils-B45A2ONa.js +184 -0
- package/dist-vue/_chunks/utils-B45A2ONa.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +53 -5
- package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +14 -0
- package/dist-vue/composables.js +524 -39
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3366 -3240
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +46 -0
- package/dist-vue/packages/ability/src/index.d.ts +10 -14
- package/dist-vue/packages/auth/src/active-membership.d.ts +36 -0
- package/dist-vue/packages/auth/src/add-member-to-organization.d.ts +12 -2
- package/dist-vue/packages/auth/src/additional-fields.d.ts +48 -0
- package/dist-vue/packages/auth/src/organization-member-limit.d.ts +12 -0
- package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +31 -0
- package/dist-vue/packages/auth/src/passkey-policy-plugin.d.ts +22 -0
- package/dist-vue/packages/auth/src/two-factor-admin-plugin.d.ts +2 -0
- package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +163 -0
- package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +106 -0
- package/dist-vue/packages/components/src/PkQrCode.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +19 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +8 -4
- package/dist-vue/packages/components/src/chat/PkChatbotSteps.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/PkTurnEvaluation.d.ts +8 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +9 -0
- package/dist-vue/packages/components/src/index.d.ts +2 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +60 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +42 -0
- package/dist-vue/packages/models/src/schema/Document.d.ts +494 -0
- package/dist-vue/packages/models/src/schema/DocumentFolder.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/DocumentSyncSource.d.ts +71 -1
- package/dist-vue/packages/models/src/schema/Lead.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/McpServer.d.ts +13 -0
- package/dist-vue/packages/models/src/schema/Media.d.ts +0 -1
- package/dist-vue/packages/models/src/schema/Member.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/Notification.d.ts +31 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +20 -0
- package/dist-vue/packages/models/src/schema/SignInSecurity.d.ts +168 -0
- package/dist-vue/packages/models/src/schema/User.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DTLrWpzX.js +0 -460
- package/dist/_chunks/Agent-DTLrWpzX.js.map +0 -1
- package/dist/_chunks/Media-Cft7Pwrh.js +0 -108
- package/dist/_chunks/Media-Cft7Pwrh.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-C1sANAr5.js.map +0 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-CTp2w60F.js.map +0 -1
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js +0 -60
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js.map +0 -1
- package/dist/_chunks/markdown-BRD-hDrH.js.map +0 -1
- package/dist-vue/_chunks/Document-2X01-F4Z.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js +0 -349
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-GZStJbx_.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js +0 -190
- package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-BorR5NmZ.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js +0 -61
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-CaVLm5W9.js.map +0 -1
- package/dist-vue/_chunks/utils-h4C7rRcu.js +0 -177
- package/dist-vue/_chunks/utils-h4C7rRcu.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as e, S as t, _ as n, a as r, b as i, g as a, l as o, n as s, o as c, p as l, v as u, w as d, x as f, y as p } from "./schemas-DxbHVg3r.js";
|
|
2
2
|
import { i as m, n as h } from "./Media-_HfFLHGD.js";
|
|
3
|
-
import {
|
|
3
|
+
import { A as g, M as _ } from "./Agent-tbKw8Mdt.js";
|
|
4
4
|
//#region ../../packages/models/src/schema/constants.ts
|
|
5
5
|
var v = /* @__PURE__ */ "openai/gpt-5-nano,openai/gpt-5-mini,openai/gpt-5.1-thinking,openai/gpt-5.2,openai/gpt-5.4-nano,openai/gpt-5.4-mini,openai/gpt-5.4,openai/gpt-5.4-pro,openai/gpt-5.5,openai/gpt-5.5-pro,openai/gpt-5.6-luna,openai/gpt-5.6-terra,openai/gpt-5.6-sol,openai/gpt-5.6-luna-fast,openai/gpt-5.6-terra-fast,openai/gpt-5.6-sol-fast,openai/gpt-6-astra,openai/gpt-6-astra-fast,openai/gpt-6-sol,openai/gpt-6-sol-fast,openai/gpt-6-luna,openai/gpt-6-luna-fast,openai/gpt-6.1-sol,openai/gpt-6.1-sol-fast,google/gemini-2.5-flash-lite,google/gemini-2.5-flash,google/gemini-2.5-pro,google/gemini-3-flash,google/gemini-3.1-pro-preview,google/gemini-3.1-flash-lite,google/gemini-3.5-flash,google/gemini-3.5-flash-lite,google/gemini-3.6-flash,google/gemini-3.7-flash,google/gemini-3.8-flash,anthropic/claude-haiku-4.5,anthropic/claude-sonnet-4.6,anthropic/claude-sonnet-5,anthropic/claude-sonnet-5.5,anthropic/claude-opus-4.6,anthropic/claude-opus-4.7,anthropic/claude-opus-4.8,anthropic/claude-opus-5,anthropic/claude-opus-5-fast,anthropic/claude-opus-5.5,anthropic/claude-opus-5.5-fast,anthropic/claude-fable-5,anthropic/claude-fable-5.1,deepseek/deepseek-v3.2,deepseek/deepseek-v4-flash-0731,deepseek/deepseek-v4.1-flash,deepseek/deepseek-v4-pro-0813,alibaba/qwen3.6-plus,alibaba/qwen3.7-max,alibaba/qwen3.7-plus,alibaba/qwen3.7-flash,alibaba/qwen3.8-flash,alibaba/qwen3.8-max,alibaba/qwen3.8-27b,alibaba/qwen3.8-max-0902,alibaba/qwen3.8-omni-flash,alibaba/qwen3.8-max-prime,spacexai/grok-4.3,spacexai/grok-4.6,spacexai/grok-4.7,zai/glm-5.2,zai/glm-5.2-fast,zai/glm-5.3,zai/glm-5.3-flash,zai/glm-5.3-fast,zai/glm-5.3-flashx,meta/muse-spark-1.1,meta/muse-spark-1.2,meta/muse-spark-1.3,moonshotai/kimi-k3,moonshotai/kimi-k3-fast,mistral/ministral-14b,mistral/mistral-small,mistral/mistral-medium-3.5,mistral/mistral-large-3,xiaomi/mimo-v2.6-flash,xiaomi/mimo-v2.6-pro,xiaomi/mimo-v2.6-pro-ultraspeed".split(","), y = 1e6, b = (/* @__PURE__ */ function(e) {
|
|
6
6
|
return e.textEmbedding3Small = "openai/text-embedding-3-small", e.textEmbedding3Large = "openai/text-embedding-3-large", e.geminiEmbedding2 = "google/gemini-embedding-2", e;
|
|
@@ -15,7 +15,7 @@ var C = /* @__PURE__ */ function(e) {
|
|
|
15
15
|
}({}), T = "byok/", E = (e) => !!e?.startsWith(T), D = n({
|
|
16
16
|
key: i().optional(),
|
|
17
17
|
value: i().optional()
|
|
18
|
-
}), O =
|
|
18
|
+
}), O = g(r(D), r(n({
|
|
19
19
|
key: i(),
|
|
20
20
|
value: i()
|
|
21
21
|
})), (e) => e?.filter((e) => e.key?.trim() && e.value?.trim())), k = /* @__PURE__ */ function(e) {
|
|
@@ -55,6 +55,8 @@ var P = n({
|
|
|
55
55
|
extractionInputHash: i().optional(),
|
|
56
56
|
finalUrl: i().optional(),
|
|
57
57
|
sourceId: d().optional(),
|
|
58
|
+
lastSyncedAt: i().optional(),
|
|
59
|
+
lastmod: i().optional(),
|
|
58
60
|
...F
|
|
59
61
|
}), L = {
|
|
60
62
|
sourceId: d(),
|
|
@@ -99,7 +101,7 @@ var P = n({
|
|
|
99
101
|
producer: i().optional(),
|
|
100
102
|
creationDate: i().optional(),
|
|
101
103
|
modificationDate: i().optional(),
|
|
102
|
-
pageCount:
|
|
104
|
+
pageCount: g(f([a(), r(t())]), a(), (e) => Array.isArray(e) ? e.length : e).optional(),
|
|
103
105
|
encrypted: c().optional(),
|
|
104
106
|
characterCount: a().optional(),
|
|
105
107
|
lineCount: a().optional(),
|
|
@@ -128,8 +130,7 @@ var P = n({
|
|
|
128
130
|
conversionOptions: A.optional()
|
|
129
131
|
}).loose(), H = /* @__PURE__ */ function(e) {
|
|
130
132
|
return e.File = "file", e.Url = "url", e.RevisedAnswer = "revised-answer", e.PlainText = "plain-text", e;
|
|
131
|
-
}({})
|
|
132
|
-
n({
|
|
133
|
+
}({}), U = n({
|
|
133
134
|
id: i(),
|
|
134
135
|
externalId: i().nullable(),
|
|
135
136
|
name: i(),
|
|
@@ -161,23 +162,33 @@ n({
|
|
|
161
162
|
qdrantSynced: c().optional(),
|
|
162
163
|
agentIds: r(i()).optional(),
|
|
163
164
|
folderId: i().nullable().optional(),
|
|
164
|
-
folderPath: i().nullable().optional()
|
|
165
|
+
folderPath: i().nullable().optional(),
|
|
166
|
+
deletedByName: i().nullable().optional()
|
|
167
|
+
});
|
|
168
|
+
H.File, H.Url, H.PlainText, n({
|
|
169
|
+
document: U,
|
|
170
|
+
returnedToRoot: c()
|
|
171
|
+
}), n({ count: a().int() }), n({ agentId: d() }), n({
|
|
172
|
+
purged: a().int(),
|
|
173
|
+
remaining: a().int()
|
|
165
174
|
}), n({
|
|
166
|
-
...
|
|
167
|
-
...
|
|
175
|
+
..._.pagination(),
|
|
176
|
+
..._.sort([
|
|
168
177
|
"id",
|
|
169
178
|
"updatedAt",
|
|
170
179
|
"createdAt",
|
|
171
|
-
"name"
|
|
180
|
+
"name",
|
|
181
|
+
"deletedAt"
|
|
172
182
|
]),
|
|
173
|
-
...
|
|
183
|
+
..._.filters([
|
|
174
184
|
"type",
|
|
175
185
|
"language",
|
|
176
186
|
"agentId",
|
|
177
187
|
"indexStatus"
|
|
178
188
|
]),
|
|
179
|
-
|
|
180
|
-
...
|
|
189
|
+
"filter[deleted]": s(["true", "false"]).optional(),
|
|
190
|
+
..._.fullText(),
|
|
191
|
+
..._.ids(),
|
|
181
192
|
"filter[similarity]": i().optional(),
|
|
182
193
|
"filter[folderId]": i().optional(),
|
|
183
194
|
"filter[hasRedundantChunks]": i().optional(),
|
|
@@ -202,9 +213,14 @@ n({
|
|
|
202
213
|
forceOcr: c().default(!1),
|
|
203
214
|
pages: i().max(100).regex(/^\d+(\s*-\s*\d+)?(\s*,\s*\d+(\s*-\s*\d+)?)*$/).optional(),
|
|
204
215
|
priority: a().int().min(1).max(5).default(3).optional(),
|
|
205
|
-
refreshInterval: s(N).nullable().optional()
|
|
216
|
+
refreshInterval: s(N).nullable().optional(),
|
|
217
|
+
syncSourceId: d().optional()
|
|
206
218
|
}).superRefine((e, t) => {
|
|
207
|
-
if (e.type
|
|
219
|
+
if (e.syncSourceId && e.type !== H.Url && t.addIssue({
|
|
220
|
+
code: "custom",
|
|
221
|
+
params: { i18n: "errors.syncSourceUrlOnly" },
|
|
222
|
+
path: ["syncSourceId"]
|
|
223
|
+
}), e.type === H.File && !e.media) {
|
|
208
224
|
t.addIssue({
|
|
209
225
|
code: "custom",
|
|
210
226
|
params: { i18n: "errors.required" },
|
|
@@ -243,14 +259,14 @@ n({
|
|
|
243
259
|
ids: r(d()).min(1).max(100),
|
|
244
260
|
refreshInterval: s(N).nullable()
|
|
245
261
|
}), n({ ids: r(d()).min(1).max(100) });
|
|
246
|
-
var
|
|
262
|
+
var W = (e) => {
|
|
247
263
|
switch (e) {
|
|
248
264
|
case H.File: return "ri:file-line";
|
|
249
265
|
case H.Url: return "ri:link";
|
|
250
266
|
case H.RevisedAnswer: return "ri:feedback-line";
|
|
251
267
|
default: return "ri:input-method-line";
|
|
252
268
|
}
|
|
253
|
-
},
|
|
269
|
+
}, G = (e) => {
|
|
254
270
|
switch ((e.startsWith(".") ? e.slice(1) : e).toLowerCase()) {
|
|
255
271
|
case "pdf": return "ri:file-pdf-2-line";
|
|
256
272
|
case "doc":
|
|
@@ -277,9 +293,9 @@ var U = (e) => {
|
|
|
277
293
|
case "7z": return "ri:file-zip-line";
|
|
278
294
|
default: return "ri:file-line";
|
|
279
295
|
}
|
|
280
|
-
},
|
|
296
|
+
}, K = (e) => (e ?? "").startsWith("image/"), q = (e) => K(e) || e === "application/pdf", J = (e) => {
|
|
281
297
|
let t = e ?? "";
|
|
282
|
-
return
|
|
298
|
+
return K(t) ? {
|
|
283
299
|
icon: "ri:image-line",
|
|
284
300
|
accent: "#ec4899",
|
|
285
301
|
label: "Image"
|
|
@@ -320,8 +336,8 @@ var U = (e) => {
|
|
|
320
336
|
accent: "#64748b",
|
|
321
337
|
label: "File"
|
|
322
338
|
};
|
|
323
|
-
},
|
|
339
|
+
}, Y = (e) => J(e).icon;
|
|
324
340
|
//#endregion
|
|
325
|
-
export {
|
|
341
|
+
export { K as a, x as c, E as d, W as i, v as l, Y as n, q as o, G as r, b as s, H as t, y as u };
|
|
326
342
|
|
|
327
|
-
//# sourceMappingURL=Document-
|
|
343
|
+
//# sourceMappingURL=Document-BWz2HySu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Document-BWz2HySu.js","names":[],"sources":["../../../../packages/models/src/schema/constants.ts","../../../../packages/models/src/schema/Header.ts","../../../../packages/models/src/schema/Document.ts"],"sourcesContent":["/**\n * The models an agent of this platform may be pointed at.\n *\n * The gateway listing DESCRIBES what exists, this list PERMITS. They are two\n * different questions, and conflating them broke production once: on\n * 2026-07-23 two models entered the catalog before the installed\n * `@ai-sdk/gateway` knew them, and their tool calls failed under the generic\n * handling. Exposing every model the day the listing shows it would reproduce\n * that by construction.\n *\n * Adding one is a line here, after the checklist in\n * `docs/agents/llm-integration.md`: it must be `type: language` in the\n * listing, produce text and carry the `tool-use` tag. Everything else about\n * it, the commercial name, the price, the context window, the two privacy\n * flags, comes from the listing and is never written down twice.\n *\n * A test checks every id against a saved copy of the listing, which is what\n * replaces the by-hand verification that missed a model on 2026-09-18.\n */\nexport const GATEWAY_MODELS = [\n // OpenAI\n 'openai/gpt-5-nano',\n 'openai/gpt-5-mini',\n 'openai/gpt-5.1-thinking',\n 'openai/gpt-5.2',\n 'openai/gpt-5.4-nano',\n 'openai/gpt-5.4-mini',\n 'openai/gpt-5.4',\n 'openai/gpt-5.4-pro',\n 'openai/gpt-5.5',\n 'openai/gpt-5.5-pro',\n 'openai/gpt-5.6-luna',\n 'openai/gpt-5.6-terra',\n 'openai/gpt-5.6-sol',\n 'openai/gpt-5.6-luna-fast',\n 'openai/gpt-5.6-terra-fast',\n 'openai/gpt-5.6-sol-fast',\n 'openai/gpt-6-astra',\n 'openai/gpt-6-astra-fast',\n 'openai/gpt-6-sol',\n 'openai/gpt-6-sol-fast',\n 'openai/gpt-6-luna',\n 'openai/gpt-6-luna-fast',\n 'openai/gpt-6.1-sol',\n 'openai/gpt-6.1-sol-fast',\n // Google Gemini\n 'google/gemini-2.5-flash-lite',\n 'google/gemini-2.5-flash',\n 'google/gemini-2.5-pro',\n 'google/gemini-3-flash',\n 'google/gemini-3.1-pro-preview',\n 'google/gemini-3.1-flash-lite',\n 'google/gemini-3.5-flash',\n 'google/gemini-3.5-flash-lite',\n 'google/gemini-3.6-flash',\n 'google/gemini-3.7-flash',\n 'google/gemini-3.8-flash',\n // Anthropic Claude\n 'anthropic/claude-haiku-4.5',\n 'anthropic/claude-sonnet-4.6',\n 'anthropic/claude-sonnet-5',\n 'anthropic/claude-sonnet-5.5',\n 'anthropic/claude-opus-4.6',\n 'anthropic/claude-opus-4.7',\n 'anthropic/claude-opus-4.8',\n 'anthropic/claude-opus-5',\n 'anthropic/claude-opus-5-fast',\n 'anthropic/claude-opus-5.5',\n 'anthropic/claude-opus-5.5-fast',\n 'anthropic/claude-fable-5',\n 'anthropic/claude-fable-5.1',\n // Deepseek\n 'deepseek/deepseek-v3.2',\n 'deepseek/deepseek-v4-flash-0731',\n 'deepseek/deepseek-v4.1-flash',\n 'deepseek/deepseek-v4-pro-0813',\n // Alibaba\n 'alibaba/qwen3.6-plus',\n 'alibaba/qwen3.7-max',\n 'alibaba/qwen3.7-plus',\n 'alibaba/qwen3.7-flash',\n 'alibaba/qwen3.8-flash',\n 'alibaba/qwen3.8-max',\n 'alibaba/qwen3.8-27b',\n 'alibaba/qwen3.8-max-0902',\n 'alibaba/qwen3.8-omni-flash',\n 'alibaba/qwen3.8-max-prime',\n // SpaceXAI\n 'spacexai/grok-4.3',\n 'spacexai/grok-4.6',\n 'spacexai/grok-4.7',\n // z.ai\n 'zai/glm-5.2',\n 'zai/glm-5.2-fast',\n 'zai/glm-5.3',\n 'zai/glm-5.3-flash',\n 'zai/glm-5.3-fast',\n 'zai/glm-5.3-flashx',\n // Meta\n 'meta/muse-spark-1.1',\n 'meta/muse-spark-1.2',\n 'meta/muse-spark-1.3',\n // Moonshot AI\n 'moonshotai/kimi-k3',\n 'moonshotai/kimi-k3-fast',\n // Mistral\n 'mistral/ministral-14b',\n 'mistral/mistral-small',\n 'mistral/mistral-medium-3.5',\n 'mistral/mistral-large-3',\n // Xiaomi\n 'xiaomi/mimo-v2.6-flash',\n 'xiaomi/mimo-v2.6-pro',\n 'xiaomi/mimo-v2.6-pro-ultraspeed',\n] as const satisfies readonly string[]\n\n/**\n * A model id: an entry of {@link GATEWAY_MODELS}, or a `byok/` id served by an\n * organization's own endpoint. A plain string on purpose, because the second\n * half cannot be enumerated.\n */\nexport type ModelId = string\n\n/**\n * Prices are stored per token, the unit the gateway listing publishes, and\n * shown per million, the unit every price page uses. One copy, so the page,\n * its dialogs and the picker never disagree on the factor.\n */\nexport const PER_MILLION_TOKENS = 1_000_000\n\n/**\n * The models the platform falls back to when an organization has expressed no\n * preference. The only model ids written in the code besides the curated list.\n */\nexport const PLATFORM_MODEL_DEFAULTS = {\n /** New agents, and the runtime fallback of an agent with no model. */\n agentModel: 'openai/gpt-5.6-terra',\n /** Question reformulation, JSON to schema, memory reconciliation. */\n utilityModel: 'google/gemini-3-flash',\n} as const\n\n/**\n * Models used to vectorize text, never to answer. Kept apart from\n * {@link GATEWAY_MODELS} so an embedding id cannot reach the chat plumbing,\n * and out of the catalog for the same reason: they are not selectable.\n */\nexport enum EmbeddingModel {\n textEmbedding3Small = 'openai/text-embedding-3-small',\n textEmbedding3Large = 'openai/text-embedding-3-large',\n geminiEmbedding2 = 'google/gemini-embedding-2',\n}\n\nexport const EMBED_MODEL = EmbeddingModel.geminiEmbedding2\n\n/**\n * Model that answers typed questions (yes/no, choice, score) with calibrated\n * probabilities instead of text, through the gateway's `experimental_evaluate`\n * (TypeSafe Jev). Out of the catalog like the embeddings: it decides for the\n * platform, it never answers the user. Its gateway listing reports no ZDR,\n * yet a ZDR request is served, routed to TypeSafe alone (measured\n * 2026-09-28, scripts/spikeJevEvaluation.ts).\n */\nexport const EVALUATION_MODEL = 'typesafe-ai/jev'\n\n/**\n * Supported languages for documents and revised answers\n */\nexport enum SupportedLanguage {\n it = 'it',\n en = 'en',\n es = 'es',\n fr = 'fr',\n de = 'de',\n}\n\n/**\n * Language display names (i18n keys)\n */\nexport const LANGUAGE_NAMES: Record<SupportedLanguage, string> = {\n [SupportedLanguage.it]: 'language.italian',\n [SupportedLanguage.en]: 'language.english',\n [SupportedLanguage.es]: 'language.spanish',\n [SupportedLanguage.fr]: 'language.french',\n [SupportedLanguage.de]: 'language.german',\n}\n\n/**\n * Content extraction strategies for URL scraping\n */\nexport enum ExtractionStrategy {\n /** Use Mozilla Readability for content extraction (fast, free, no API calls) */\n READABILITY = 'readability',\n /** Use AI-based extraction (better for complex layouts, requires API calls) */\n AI = 'ai',\n}\n\n/**\n * Browser engine options for URL scraping\n */\nexport enum BrowserEngine {\n /** Use simple HTTP fetch (fast, lightweight, no JavaScript support) */\n FETCH = 'fetch',\n /** Use Puppeteer with headless Chrome (full browser, JavaScript support) */\n PUPPETEER = 'puppeteer',\n /** Delegate browser rendering to an external pdf-image-generator service */\n REMOTE = 'remote',\n}\n\n/**\n * Which report family has to account for a credit charge.\n *\n * The hourly reconciliation trusts `cost_reports` (the gateway's own billing,\n * copied in house) as the source of truth for what an organization spent. A\n * charge whose supplier is not the gateway has no counterpart there, so it must\n * be told apart or the reconciliation forgives it: that is what happened to the\n * voice minutes until 2026-08-31.\n *\n * Declared here, written on the ledger row at charge time, never inferred from\n * `source` downstream: the next non-gateway supplier must be a compile-time\n * decision, not a string nobody remembered to add to a list.\n */\nexport enum BillingSource {\n /** Billed by the AI gateway, so it lands in `cost_reports`. */\n GATEWAY = 'gateway',\n /** Billed by another supplier (voice minutes, OCR): the ledger is the only record. */\n INTERNAL = 'internal',\n}\n\n/**\n * Kinds of row on the credit ledger.\n *\n * It used to be a free string with exactly one value ever written, `debit`.\n * Adding a second one is not free: the hourly reconciliation sums debits to\n * rebuild the real-time estimate, and the analytics endpoint sums the ledger to\n * chart spend, so a new type that nobody filters out is a number silently\n * doubled.\n */\nexport enum CreditTransactionType {\n /** A charge for something consumed, written in real time. */\n DEBIT = 'debit',\n /** The hourly settlement against the gateway report: the audit trail of a balance move. */\n RECONCILIATION = 'reconciliation',\n}\n\n/**\n * Prefix that marks a model served by the organization's own OpenAI compatible\n * endpoint rather than by the gateway.\n *\n * It is not a gateway brand, which is the point: every switch on the provider\n * (reasoning options, the Google thought signature repair, the per-provider\n * timeouts, the native web search tools) falls into its default branch without\n * any of them having to learn about BYOK.\n */\nexport const BYOK_MODEL_PREFIX = 'byok/'\n\nexport const isByokModel = (id?: string | null): boolean =>\n Boolean(id?.startsWith(BYOK_MODEL_PREFIX))\n\n/**\n * The id as the endpoint wants it, with the prefix removed. The remainder may\n * itself contain slashes (`byok/meta-llama/Llama-3.3-70B`), so this cuts the\n * prefix and does not split.\n */\nexport const byokModelId = (id: string): string =>\n id.startsWith(BYOK_MODEL_PREFIX) ? id.slice(BYOK_MODEL_PREFIX.length) : id\n","import * as z from 'zod'\nimport { decodeOnly } from '../utils'\n\nexport const HeaderSchema = z.object({\n key: z.string().optional(),\n value: z.string().optional(),\n})\n\nexport const HeadesSchema = decodeOnly(\n z.array(HeaderSchema),\n z.array(z.object({ key: z.string(), value: z.string() })),\n (headers) =>\n headers?.filter(\n (header) => header.key?.trim() && header.value?.trim(),\n ) as Array<{ key: string; value: string }>,\n)\n\nexport type Header = z.infer<typeof HeaderSchema>\nexport type Headers = z.infer<typeof HeadesSchema>\n","import * as z from 'zod'\nimport { zodQs, decodeOnly } from '../utils'\nimport {\n SupportedLanguage,\n ExtractionStrategy,\n BrowserEngine,\n} from './constants'\nimport { MediaSchema } from './Media'\nimport { HeadesSchema } from './Header'\n\n/**\n * Processing status for document indexing and embedding generation\n */\nexport enum IndexStatus {\n Pending = 'pending',\n Processing = 'processing',\n Success = 'success',\n Failed = 'failed',\n}\n\n// ===== Document Source Types =====\n\n/**\n * Conversion options for document processing\n * Used when creating or reprocessing documents\n */\nexport const ConversionOptionsSchema = z.object({\n extractionStrategy: z.enum(ExtractionStrategy).optional(),\n browserEngine: z\n .enum(BrowserEngine)\n .optional()\n .default(BrowserEngine.FETCH),\n headers: HeadesSchema.nullish(),\n aiDescriptionModel: z.string().optional(),\n aiDescriptionPrompt: z.string().max(5000).optional(),\n language: z.string().optional(),\n forceOcr: z.boolean().default(false),\n pages: z\n .string()\n .max(100)\n .regex(/^\\d+(\\s*-\\s*\\d+)?(\\s*,\\s*\\d+(\\s*-\\s*\\d+)?)*$/)\n .optional(),\n})\n\nexport type ConversionOptions = z.infer<typeof ConversionOptionsSchema>\n\n// ===== Document Source (metadata.source) =====\n\n/**\n * Who keeps a document's content up to date.\n *\n * `web` is a page the platform re-reads on its own; the others are cloud\n * document sources. Distinct from `documents.source_provider`, which carries\n * only the providers that OWN their documents (the cloud ones) and is null for\n * everything else: a web page discovered by a source stays editable.\n */\nexport enum DocumentSourceProvider {\n Web = 'web',\n SharePoint = 'sharepoint',\n GoogleDrive = 'google-drive',\n}\n\n/**\n * Outcome of the last pass over a document's source.\n *\n * `unchanged` is the one that pays for the whole mechanism: the source was read\n * and produced the same text, so no chunk was rewritten and no embedding was\n * charged. `shrunk` is a refusal, not a failure: the page answered but with far\n * less content than before, so the good version was kept.\n */\nexport enum DocumentRefreshResult {\n Updated = 'updated',\n Unchanged = 'unchanged',\n Failed = 'failed',\n Shrunk = 'shrunk',\n Gone = 'gone',\n}\n\n/**\n * How often a document re-reads its source on its own.\n *\n * `null` is the fourth value and the default: manual, which is what every\n * document is today and what every type other than `url` can ever be.\n */\nexport enum DocumentRefreshInterval {\n Daily = 'daily',\n Weekly = 'weekly',\n Monthly = 'monthly',\n}\n\n/**\n * The Postgres interval each trigger advances by.\n *\n * One table, read by the two places that move a deadline: the service, when\n * somebody sets or changes the trigger, and the timer, when a due document has\n * been queued. Written as literals rather than composed at the call site\n * because they end up inside SQL.\n */\nexport const REFRESH_INTERVAL_SQL: Record<DocumentRefreshInterval, string> = {\n [DocumentRefreshInterval.Daily]: '1 day',\n [DocumentRefreshInterval.Weekly]: '7 days',\n [DocumentRefreshInterval.Monthly]: '1 month',\n}\n\n/**\n * Hours after which a document left `processing` is treated as abandoned.\n *\n * A killed worker leaves that status behind, and nothing else moves it: the row\n * would drop out of the refresh timer's selection for good, because the timer\n * only claims documents that are `success` or `failed`. Past this window the\n * timer takes it anyway, and a manual refresh stops being refused.\n *\n * Generous on purpose: a scrape is bounded by the Functions host timeout, so\n * anything still `processing` after six hours is not running.\n */\nexport const STALE_PROCESSING_HOURS = 6\n\nexport const DocumentLastRefreshSchema = z.object({\n at: z.string(),\n result: z.enum(DocumentRefreshResult),\n httpStatus: z.number().optional(),\n error: z.string().optional(),\n /** Reset by the first good outcome; the notification threshold reads it. */\n consecutiveFailures: z.number().optional(),\n /**\n * Words before and after, written by the shrink guard. They are kept rather\n * than only compared because the guard's thresholds are a starting point:\n * after a month of real pages one can tell whether they cut too much.\n */\n previousWordCount: z.number().optional(),\n newWordCount: z.number().optional(),\n})\n\nexport type DocumentLastRefresh = z.infer<typeof DocumentLastRefreshSchema>\n\n/** Fields every source branch shares, whatever keeps the document up to date. */\nconst commonSourceFields = {\n /**\n * Hash of the text that actually reaches the chunks, so an unchanged source\n * costs no chunking and no embedding. Written by the processor on every\n * pass, which is what lets a document imported before this existed start\n * comparing from its second pass on.\n */\n contentHash: z.string().optional(),\n lastRefresh: DocumentLastRefreshSchema.optional(),\n}\n\nconst WebDocumentSourceSchema = z.object({\n provider: z.literal(DocumentSourceProvider.Web),\n url: z.string(),\n // Written by a successful conversion, and only then: at insert time the\n // page has not been read yet, so a value here would attest a scrape that\n // never happened.\n lastScrapedAt: z.string().optional(),\n /**\n * Hash of the deterministic text handed to the extraction step, before the\n * model. With `extractionStrategy: 'ai'` the model's output differs on every\n * call, so comparing the final markdown would always say \"changed\" and\n * every interval would pay conversion, chunking and embedding. This is what\n * the AI path compares, and it decides whether to call the model at all.\n */\n extractionInputHash: z.string().optional(),\n /**\n * Where the last successful pass actually landed after redirects.\n *\n * The shrink guard compares this with the new final URL, and not with `url`\n * on purpose: plenty of sites always redirect (a locale prefix, a trailing\n * slash, http to https), so comparing against the stored URL would refuse\n * every update of those pages forever. What says a page is gone is its\n * destination changing from the one it has been landing on.\n */\n finalUrl: z.string().optional(),\n /**\n * The web source that discovered this page. It says who found it, not who\n * governs it: the page stays editable like any other. Editing the text by\n * hand takes it off, and the page stops belonging to the source.\n */\n sourceId: z.uuid().optional(),\n /**\n * The last run of that source that found the page listed.\n *\n * Not the last successful read of the page, which is `lastScrapedAt`:\n * this is the marker the removal option reads, named like the cloud\n * field because the same reconciliation reads both. A page without one is\n * never removed.\n */\n lastSyncedAt: z.string().optional(),\n /**\n * The `<lastmod>` the sitemap declared the last time the source read it.\n * A change that is newer than `lastScrapedAt` queues an early refresh.\n */\n lastmod: z.string().optional(),\n ...commonSourceFields,\n})\n\n/** Coordinates a cloud adapter needs to find the item again, plus its content fingerprint. */\nconst cloudSourceFields = {\n /** The `document_sync_sources` row that owns this document. */\n sourceId: z.uuid(),\n remoteId: z.string(),\n webUrl: z.string(),\n path: z.string(),\n /**\n * The provider's own content fingerprint, compared for equality only and\n * never interpreted. It is what lets a sync skip the download entirely.\n */\n fingerprint: z.string(),\n /** Marks the document as seen by a run: the reconciliation after a resync reads it. */\n lastSyncedAt: z.string(),\n /** When the provider says the item last changed. Shown, never compared: the fingerprint decides. */\n lastModified: z.string().optional(),\n /**\n * A newly downloaded blob waiting to be converted. It sits here instead of\n * replacing `metadata.media` so that a conversion failure cannot destroy the\n * version that works: the processor promotes it only on success.\n */\n candidate: z\n .object({\n media: MediaSchema,\n fingerprint: z.string(),\n name: z.string(),\n webUrl: z.string(),\n path: z.string(),\n lastModified: z.string().optional(),\n })\n .optional(),\n ...commonSourceFields,\n}\n\nconst SharePointDocumentSourceSchema = z.object({\n provider: z.literal(DocumentSourceProvider.SharePoint),\n ...cloudSourceFields,\n})\n\nconst GoogleDriveDocumentSourceSchema = z.object({\n provider: z.literal(DocumentSourceProvider.GoogleDrive),\n ...cloudSourceFields,\n})\n\n/**\n * `metadata.source`, discriminated on `provider`.\n *\n * One object cannot hold both shapes: a web page has a URL and a scrape date, a\n * cloud file has remote coordinates and a fingerprint, and making every field\n * optional to fit both is the same as having no schema. Rows written before the\n * discriminator existed carry no `provider`, so they are normalized to the web\n * branch before routing: that is the only shape that could have been written.\n *\n * The normalization runs on parse, and responses are serialized by the\n * parse-based compiler (see `apps/backend/src/utils/responseSerializer.ts`), so\n * a legacy row still comes out of the API intact.\n */\nexport const DocumentSourceSchema = z.preprocess(\n (value) => {\n if (\n value &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n !('provider' in value)\n ) {\n return { provider: DocumentSourceProvider.Web, ...value }\n }\n return value\n },\n z.discriminatedUnion('provider', [\n WebDocumentSourceSchema,\n SharePointDocumentSourceSchema,\n GoogleDriveDocumentSourceSchema,\n ]),\n)\n\nexport type DocumentSource = z.infer<typeof DocumentSourceSchema>\nexport type WebDocumentSource = z.infer<typeof WebDocumentSourceSchema>\n\n/**\n * The page URL of a document's source, when its source is a web page.\n *\n * One place to narrow the union, so the views that show \"where this came from\"\n * do not each grow their own check, and a cloud-synced document returns nothing\n * here instead of a broken link: its address is `webUrl` on the remote item,\n * which is a different thing to show and to say.\n */\nexport function documentSourceUrl(source?: DocumentSource): string | undefined {\n return source && 'url' in source ? source.url : undefined\n}\n\n// ===== Processing queue contract =====\n\n/**\n * Why a document is being processed again. Absent means the ingestion of a new\n * document, which is the only case whose natural key is the document id alone.\n */\nexport type DocumentProcessingKind = 'refresh' | 'reprocess' | 'reindex'\n\n/**\n * The `document-processing` queue message.\n *\n * Lives here because two processes read it: the backend publishes it and the\n * Azure Function consumes it. It used to be declared in each, and the copy in\n * the function app was already a field behind.\n */\nexport interface DocumentProcessingJob {\n documentId: string\n conversionOptions?: ConversionOptions\n /**\n * Set by every caller that processes a document which already exists. It\n * shapes the message id (see `publishProcessingJob`) and, for `refresh`,\n * turns on the refresh mode of the processor.\n */\n kind?: DocumentProcessingKind\n /**\n * Only a scheduled refresh enforces the shrink guard. A person who clicked\n * \"refresh now\" is looking at the result and may well be refreshing a page\n * that really did get shorter, so the guard would only stand in their way.\n */\n guarded?: boolean\n /**\n * The web source whose sitemap asked for this early refresh. Nobody is\n * watching it either, so it enforces the shrink guard; and it is void if\n * the page no longer belongs to that source, which is what editing its text\n * by hand does. Not `guarded`, which also voids a page without a trigger:\n * a source reads its pages whether they have one or not.\n */\n sourceId?: string\n}\n\n/**\n * Metadata structure for document.metadata column\n * Consolidates all metadata from converters and source info\n */\nexport const DocumentMetadataSchema = z\n .object({\n // === Source Info (URL and synced documents) ===\n source: DocumentSourceSchema.optional(),\n\n // === Media Info (File documents only) ===\n media: MediaSchema.optional(),\n\n // === Common Fields (all document types) ===\n title: z.string().optional(),\n author: z.string().optional(),\n description: z.string().optional(),\n summary: z.string().optional(),\n keywords: z.array(z.string()).optional(),\n\n // === PDF Specific ===\n subject: z.string().optional(),\n creator: z.string().optional(), // Original application\n producer: z.string().optional(), // PDF generator software\n creationDate: z.string().optional(),\n modificationDate: z.string().optional(),\n pageCount: decodeOnly(\n z.union([z.number(), z.array(z.unknown())]),\n z.number(),\n (val) => (Array.isArray(val) ? val.length : val),\n ).optional(),\n encrypted: z.boolean().optional(),\n\n // === DOCX Specific ===\n characterCount: z.number().optional(),\n lineCount: z.number().optional(),\n\n // === URL Specific ===\n siteName: z.string().optional(),\n canonicalUrl: z.url().optional(),\n imageUrl: z.url().optional(),\n favicon: z.url().optional(),\n type: z.string().optional(), // og:type (article, website, etc.)\n locale: z.string().optional(),\n tags: z.array(z.string()).optional(),\n publishedTime: z.string().optional(),\n modifiedTime: z.string().optional(),\n\n // === Metrics (all document types) ===\n wordCount: z.number().optional(),\n paragraphCount: z.number().optional(),\n readingTime: z.number().optional(), // in minutes\n\n // === OCR (PDF documents) ===\n ocrUsed: z.boolean().optional(),\n ocrProvider: z.string().optional(),\n ocrModel: z.string().optional(),\n ocrPages: z.string().optional(),\n ocrCost: z.number().optional(),\n ocrError: z.string().optional(),\n\n // === RAG / Duplicates / Sync Info ===\n chunksCount: z.number().optional(),\n redundantChunksCount: z.number().optional(),\n hasRedundantChunks: z.boolean().optional(),\n qdrantSynced: z.boolean().optional(),\n\n // === Conversion Options (for reprocessing) ===\n conversionOptions: ConversionOptionsSchema.optional(),\n })\n .loose() // Allow additional custom fields\n\nexport type DocumentMetadata = z.infer<typeof DocumentMetadataSchema>\n\n/**\n * Document type enum\n *\n * - 'file': Document created from uploaded file (PDF, DOCX)\n * - 'url': Document created from web scraping\n * - 'revised-answer': Document created from revised AI answer\n * - 'plain-text': Document created from plain text input\n */\nexport enum DocumentType {\n File = 'file',\n Url = 'url',\n RevisedAnswer = 'revised-answer',\n PlainText = 'plain-text',\n}\n\n// ===== Schemas =====\n\n/**\n * Full document schema from database\n * Extended with computed field chunksCount\n */\nconst BaseDocumentSchema = z.object({\n id: z.string(),\n externalId: z.string().nullable(),\n name: z.string(),\n content: z.string(),\n type: z.string(),\n language: z.string(),\n metadata: z.record(z.string(), z.unknown()),\n indexStatus: z.string(),\n processedAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n createdBy: z.string(),\n updatedAt: z.coerce.date(),\n updatedBy: z.string(),\n deleted: z.boolean(),\n deletedAt: z.coerce.date().nullable(),\n deletedBy: z.string().nullable(),\n organizationId: z.string(),\n priority: z.number().int().min(1).max(5).default(3),\n /** The automatic refresh trigger; null is manual, and only `url` can have one. */\n refreshInterval: z.enum(DocumentRefreshInterval).nullable().optional(),\n /**\n * When the trigger next comes due. Null with an interval set means paused:\n * the source answered that the page is gone for good.\n */\n nextRefreshAt: z.coerce.date().nullable().optional(),\n /**\n * Which sync source owns this document, when one does.\n *\n * Null is the ordinary case. A non-null value means a job keeps the\n * document up to date, which is what makes it read only: editing it, moving\n * it or deleting it by hand would be undone at the next run, silently.\n * Written only by providers that own their documents, never by a crawl that\n * merely discovered a page.\n */\n sourceProvider: z.enum(DocumentSourceProvider).nullable().optional(),\n})\n\nexport const DocumentSchema = BaseDocumentSchema.extend({\n type: z.enum(DocumentType),\n indexStatus: z.enum(IndexStatus),\n metadata: DocumentMetadataSchema,\n // Add computed field for chunks count (populated by service layer)\n chunksCount: z.number().optional(),\n // Computed fields for redundancy tracking\n redundantChunksCount: z.number().optional(),\n hasRedundantChunks: z.boolean().optional(),\n // Qdrant sync status\n qdrantSynced: z.boolean().optional(),\n // Agent IDs associated with this document (populated in single-item reads)\n agentIds: z.array(z.string()).optional(),\n // Folder ID for this document within an agent context (populated in agent-scoped reads)\n folderId: z.string().nullable().optional(),\n // Full folder path string e.g. \"Parent / Child\" (populated in list reads when agentId is set)\n folderPath: z.string().nullable().optional(),\n /** Who sent the document to the trash, by name (populated in trash reads). */\n deletedByName: z.string().nullable().optional(),\n})\n\n/**\n * The document types the trash holds: the ones a person adds to a knowledge\n * base by hand. A revised answer lives and dies with its own page, so it is\n * never listed, restored or emptied from here.\n */\nexport const DOCUMENT_TRASH_TYPES = [\n DocumentType.File,\n DocumentType.Url,\n DocumentType.PlainText,\n] as const\n\n/**\n * Why a restore was refused (docs/specs/document-trash.md, Decision 3), sent\n * as `additionalData.reason` of a `conflict` problem. The third case of the\n * decision, a folder that no longer exists, is not a refusal: the document\n * goes back to the root and the answer says so.\n */\nexport enum DocumentRestoreRefusal {\n /** Every agent the document belonged to has been deleted. */\n AgentGone = 'agent-gone',\n /**\n * A live document of the same source holds its remote identity; its id\n * travels as `additionalData.documentId`.\n */\n IdentityTaken = 'identity-taken',\n}\n\nexport const DocumentRestoreResultSchema = z.object({\n document: DocumentSchema,\n /** Its folder was gone, so it went back to the root of its agent. */\n returnedToRoot: z.boolean(),\n})\n\nexport const DocumentTrashSummarySchema = z.object({\n /** Documents in the trash of the agent, the ones it can restore. */\n count: z.number().int(),\n})\n\nexport const DocumentEmptyTrashDtoSchema = z.object({\n agentId: z.uuid(),\n})\n\nexport const DocumentEmptyTrashResultSchema = z.object({\n purged: z.number().int(),\n /** Still in the trash: one call empties a batch, the caller asks again. */\n remaining: z.number().int(),\n})\n\n/**\n * Query parameters for listing documents with pagination, sorting, and filters\n */\nexport const DocumentQuerystringSchema = z.object({\n ...zodQs.pagination(),\n ...zodQs.sort(['id', 'updatedAt', 'createdAt', 'name', 'deletedAt']),\n ...zodQs.filters(['type', 'language', 'agentId', 'indexStatus']),\n // 'true' lists the trash instead of the knowledge base: a flat list, by\n // agent, of what that agent can restore. Every other read keeps ignoring\n // deleted documents.\n 'filter[deleted]': z.enum(['true', 'false']).optional(),\n ...zodQs.fullText(),\n ...zodQs.ids(),\n 'filter[similarity]': z.string().optional(),\n // UUID = documents in that folder; 'null' = documents at root (no folder); absent = all documents\n 'filter[folderId]': z.string().optional(),\n 'filter[hasRedundantChunks]': z.string().optional(),\n // One of the intervals, 'null' for the documents left on manual, 'auto' for\n // any of the three. Same convention as `filter[folderId]`, and handled\n // outside `getFilters` for the same reason: `inArray` cannot say IS NULL.\n 'filter[refreshInterval]': z.string().optional(),\n // A provider, 'null' for the documents nobody syncs, 'any' for the ones a\n // source owns whoever it is. Same convention and the same reason as above.\n 'filter[sourceProvider]': z.string().optional(),\n})\n\n/**\n * Document creation schema for POST /documents endpoint\n *\n * Supports three types:\n * - 'file': Requires media object with uploaded file info\n * - 'url': Requires url string for web scraping\n * - 'revised-answer': Requires content (created from revisedAnswer service)\n */\nexport const DocumentCreateDtoSchema = z\n .object({\n type: z.enum(DocumentType).default(DocumentType.File),\n name: z.string().min(1).max(255).optional(),\n language: z.enum(SupportedLanguage).optional(),\n organizationId: z.string(),\n agentIds: z.array(z.string()).min(1, 'At least one agent is required'),\n folderId: z.uuid().nullable().optional(),\n media: MediaSchema.optional(),\n url: z.url().optional(),\n content: z.string().optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n extractionStrategy: z.enum(ExtractionStrategy).optional(),\n browserEngine: z.enum(BrowserEngine).optional(),\n headers: HeadesSchema.nullish().default([]),\n aiDescriptionModel: z.string().optional(),\n aiDescriptionPrompt: z.string().max(5000).optional(),\n forceOcr: z.boolean().default(false),\n pages: z\n .string()\n .max(100)\n .regex(/^\\d+(\\s*-\\s*\\d+)?(\\s*,\\s*\\d+(\\s*-\\s*\\d+)?)*$/)\n .optional(),\n priority: z.number().int().min(1).max(5).default(3).optional(),\n refreshInterval: z.enum(DocumentRefreshInterval).nullable().optional(),\n /**\n * The web source this page is imported for: the pages ticked in the\n * crawler dialog when it also creates a source. They land in the\n * source's folder as pages the source discovered, so its removal\n * option and its early refresh apply to them from the first run.\n */\n syncSourceId: z.uuid().optional(),\n })\n .superRefine((data, ctx) => {\n if (data.syncSourceId && data.type !== DocumentType.Url) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.syncSourceUrlOnly',\n },\n path: ['syncSourceId'],\n })\n }\n if (data.type === DocumentType.File && !data.media) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.required',\n },\n path: ['media'],\n })\n return\n }\n if (data.type === DocumentType.Url && !data.url) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.required',\n },\n path: ['url'],\n })\n }\n // The database has the same CHECK, but a 400 saying which field is\n // wrong beats a constraint violation surfacing as a 500.\n if (data.refreshInterval && data.type !== DocumentType.Url) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.refreshIntervalUrlOnly',\n },\n path: ['refreshInterval'],\n })\n }\n if (\n data.type === DocumentType.PlainText &&\n !(data.name || data.language)\n ) {\n if (!data.name) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.required',\n },\n path: ['name'],\n })\n }\n if (!data.language) {\n ctx.addIssue({\n code: 'custom',\n params: {\n i18n: 'errors.required',\n },\n path: ['language'],\n })\n }\n }\n })\n\n/**\n * Document update schema for PUT /documents/:id endpoint\n *\n * All fields are optional, but at least one must be provided\n */\nexport const DocumentUpdateDtoSchema = z.object({\n id: z.string(),\n organizationId: z.string(),\n content: z.string().optional(),\n name: z.string().min(1).max(255).optional(),\n language: z.enum(SupportedLanguage).optional(),\n priority: z.number().int().min(1).max(5).optional(),\n agentIds: z.array(z.string()).min(1).optional(),\n metadata: z.record(z.string(), z.unknown()).optional(),\n refreshInterval: z.enum(DocumentRefreshInterval).nullable().optional(),\n})\n\n/** Body of `PATCH /documents/:id/refresh-interval`, twin of the priority route. */\nexport const DocumentRefreshIntervalDtoSchema = z.object({\n refreshInterval: z.enum(DocumentRefreshInterval).nullable(),\n})\n\n/** Body of `POST /documents/bulk-refresh-interval`. */\nexport const DocumentBulkRefreshIntervalDtoSchema = z.object({\n ids: z.array(z.uuid()).min(1).max(100),\n refreshInterval: z.enum(DocumentRefreshInterval).nullable(),\n})\n\n/** Body of `POST /documents/bulk-refresh`, twin of `bulk-reprocess`. */\nexport const DocumentBulkRefreshDtoSchema = z.object({\n ids: z.array(z.uuid()).min(1).max(100),\n})\n\n// ===== Type Exports =====\n\nexport type Document = z.infer<typeof DocumentSchema>\nexport type DocumentQuerystring = z.infer<typeof DocumentQuerystringSchema>\nexport type DocumentCreateDto = z.infer<typeof DocumentCreateDtoSchema>\nexport type DocumentUpdateDto = z.infer<typeof DocumentUpdateDtoSchema>\nexport type DocumentRefreshIntervalDto = z.infer<\n typeof DocumentRefreshIntervalDtoSchema\n>\nexport type DocumentBulkRefreshIntervalDto = z.infer<\n typeof DocumentBulkRefreshIntervalDtoSchema\n>\nexport type DocumentBulkRefreshDto = z.infer<\n typeof DocumentBulkRefreshDtoSchema\n>\nexport type DocumentRestoreResult = z.infer<typeof DocumentRestoreResultSchema>\nexport type DocumentTrashSummary = z.infer<typeof DocumentTrashSummarySchema>\nexport type DocumentEmptyTrashDto = z.infer<typeof DocumentEmptyTrashDtoSchema>\nexport type DocumentEmptyTrashResult = z.infer<\n typeof DocumentEmptyTrashResultSchema\n>\n\n// ===== Helper Functions =====\n\nexport const getStatusColor = (status: IndexStatus) => {\n switch (status) {\n case IndexStatus.Success:\n return 'success'\n case IndexStatus.Failed:\n return 'danger'\n case IndexStatus.Processing:\n return 'warning'\n default:\n return 'info'\n }\n}\n\nexport const getStatusIcon = (status: IndexStatus) => {\n switch (status) {\n case IndexStatus.Success:\n return 'ri:check-line'\n case IndexStatus.Failed:\n return 'ri:error-warning-line'\n case IndexStatus.Processing:\n return 'ri:hourglass-line'\n default:\n return 'ri:time-line'\n }\n}\n\nexport const getTypeIcon = (type: DocumentType) => {\n switch (type) {\n case DocumentType.File:\n return 'ri:file-line'\n case DocumentType.Url:\n return 'ri:link'\n case DocumentType.RevisedAnswer:\n return 'ri:feedback-line'\n default:\n return 'ri:input-method-line'\n }\n}\n\nexport const getFileIcon = (extension: string) => {\n const ext = (\n extension.startsWith('.') ? extension.slice(1) : extension\n ).toLowerCase()\n switch (ext) {\n case 'pdf':\n return 'ri:file-pdf-2-line'\n case 'doc':\n case 'docx':\n return 'ri:file-word-line'\n case 'xls':\n case 'xlsx':\n return 'ri:file-excel-line'\n case 'ppt':\n case 'pptx':\n return 'ri:file-ppt-line'\n case 'txt':\n return 'ri:file-text-line'\n case 'mp3':\n case 'wav':\n case 'ogg':\n return 'ri:file-music-line'\n case 'mp4':\n case 'avi':\n case 'mkv':\n return 'ri:file-video-line'\n case 'jpg':\n case 'jpeg':\n case 'png':\n case 'gif':\n case 'bmp':\n case 'svg':\n return 'ri:file-image-line'\n case 'zip':\n case 'rar':\n case '7z':\n return 'ri:file-zip-line'\n default:\n return 'ri:file-line'\n }\n}\n\n/** Whether a MIME type is an image. */\nexport const isImageMime = (mimeType?: string | null): boolean =>\n (mimeType ?? '').startsWith('image/')\n\n/** Whether a file MIME type can be previewed inline in the browser (image or\n * PDF) instead of being forced as a download. Shared by every file-list surface\n * so the preview/download decision stays consistent. */\nexport const isInlineViewable = (mimeType?: string | null): boolean =>\n isImageMime(mimeType) || mimeType === 'application/pdf'\n\n/** File-type identity for list rows and previews: icon, accent color\n * (CSS value driving glyph and tile tint) and a short human kind label. */\nexport interface FileKind {\n icon: string\n accent: string\n label: string\n}\n\n/** File-type identity derived from a MIME type. Accents match the chat\n * attachment cards (PkChatbotFilePreview) so files read the same everywhere. */\nexport const fileKindForMime = (mimeType?: string | null): FileKind => {\n const mime = mimeType ?? ''\n if (isImageMime(mime)) {\n return { icon: 'ri:image-line', accent: '#ec4899', label: 'Image' }\n }\n if (mime === 'application/pdf') {\n return { icon: 'ri:file-pdf-2-line', accent: '#e2483d', label: 'PDF' }\n }\n if (mime === 'application/msword' || mime.includes('wordprocessingml')) {\n return { icon: 'ri:file-word-line', accent: '#2b7de9', label: 'Word' }\n }\n if (mime === 'application/vnd.ms-excel' || mime.includes('spreadsheetml')) {\n return {\n icon: 'ri:file-excel-line',\n accent: '#1f9d57',\n label: 'Spreadsheet',\n }\n }\n if (\n mime === 'application/vnd.ms-powerpoint' ||\n mime.includes('presentationml')\n ) {\n return {\n icon: 'ri:file-ppt-line',\n accent: '#d98324',\n label: 'Presentation',\n }\n }\n if (mime.startsWith('audio/')) {\n return { icon: 'ri:file-music-line', accent: '#8b5cf6', label: 'Audio' }\n }\n if (mime.startsWith('video/')) {\n return { icon: 'ri:file-video-line', accent: '#6366f1', label: 'Video' }\n }\n if (\n mime === 'application/zip' ||\n mime === 'application/x-rar-compressed' ||\n mime === 'application/x-7z-compressed'\n ) {\n return { icon: 'ri:file-zip-line', accent: '#c08a1e', label: 'Archive' }\n }\n if (mime.startsWith('text/')) {\n return { icon: 'ri:file-text-line', accent: '#64748b', label: 'Text' }\n }\n return { icon: 'ri:file-line', accent: '#64748b', label: 'File' }\n}\n\n/** Icon for a file-list row, derived from its MIME type. */\nexport const fileIconForMime = (mimeType?: string | null): string =>\n fileKindForMime(mimeType).icon\n"],"mappings":";;;;AAmBA,IAAa,IAAiB,82DA+F9B,GAca,IAAqB,KAwBrB,KAAc,gBANpB,SAAA,GAAA;QACH,EAAA,sBAAA,iCACA,EAA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EAAoB,QAAQ;EAAW,OAAO;CAAU,IAEvE,EAAK,WAAW,OAAO,IAChB;EAAE,MAAM;EAAqB,QAAQ;EAAW,OAAO;CAAO,IAElE;EAAE,MAAM;EAAgB,QAAQ;EAAW,OAAO;CAAO;AACpE,GAGa,KAAmB,MAC5B,EAAgB,CAAQ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Media-_HfFLHGD.js","names":["core._coercedDate","schemas.ZodDate"],"sources":["../../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.js","../../../../packages/models/src/schema/Media.ts"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from 'zod'\n\n// ===== Constants =====\n\nexport const MAX_FILE_SIZE = 100 * 1024 * 1024 // 100MB\n\nexport const MIME_TYPE_REGEX = /^[a-z]+\\/[a-z0-9\\-+.]+$/i\n\nexport const SUPPORTED_IMAGE_TYPES = [\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n] as const\n\nexport const SUPPORTED_DOCUMENT_TYPES = [\n 'application/pdf',\n 'application/msword',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'application/vnd.ms-excel',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'text/plain',\n 'text/markdown',\n] as const\n\nexport const SUPPORTED_VIDEO_TYPES = [\n 'video/mp4',\n 'video/webm',\n 'video/ogg',\n] as const\n\nexport const SUPPORTED_AUDIO_TYPES = [\n 'audio/mpeg',\n 'audio/wav',\n 'audio/ogg',\n] as const\n\n// ===== Enums =====\n\nexport enum StoragePolicy {\n DEFAULT = 'default',\n COLD = 'cold',\n HOT = 'hot',\n ARCHIVE = 'archive',\n}\n\nexport enum PreviewStatus {\n Pending = 'pending',\n Done = 'done',\n Failed = 'failed',\n}\n\n// ===== Storage Handle Schemas =====\n\nconst AzureBlobStorageHandleSchema = z.object({\n type: z.literal('azure-blob'),\n blobUri: z.url(),\n containerName: z.string().min(1),\n pathRelativeToContainer: z.string().min(1),\n})\n\nconst S3StorageHandleSchema = z.object({\n type: z.literal('s3'),\n bucket: z.string().min(1),\n key: z.string().min(1),\n region: z.string().min(1),\n})\n\nconst StorageHandleSchema = z.discriminatedUnion('type', [\n AzureBlobStorageHandleSchema,\n S3StorageHandleSchema,\n])\n\n// ===== Media Upload Schema =====\n\n/**\n * Media upload information for preparing a file upload\n */\nexport const MediaUploadSchema = z.object({\n /** Media type category (picture, video, audio, etc.) */\n type: z.string().min(1),\n /** Original filename */\n name: z.string().min(1),\n /** MIME type (e.g., 'image/jpeg') */\n mimeType: z.string().regex(MIME_TYPE_REGEX),\n /** File size in bytes (must be positive) */\n bytesCount: z.number().positive(),\n /** File extension with dot (e.g., '.jpg') */\n extension: z\n .string()\n .regex(/^\\.[a-zA-Z0-9]+$/)\n .overwrite((ext) => ext.toLowerCase()),\n /** Optional custom stored filename */\n storedFileName: z.string().optional(),\n /** Additional metadata key-value pairs */\n metadata: z.record(z.string(), z.string()).default({}),\n /** Storage tags for categorization */\n tags: z.record(z.string(), z.string()).default({}),\n})\nexport type MediaUpload = z.infer<typeof MediaUploadSchema>\n\n// ===== Media Source Schema =====\n\n/**\n * Complete media source information including storage details\n */\nexport const MediaSourceSchema = MediaUploadSchema.extend({\n /** Storage backend configuration */\n storageHandle: StorageHandleSchema,\n /** Storage tier/policy */\n storagePolicy: z.enum(StoragePolicy),\n /** Optional signature data for verification */\n signData: z.string().optional(),\n /** Actual stored filename (required) */\n storedFileName: z.string().min(1),\n})\nexport type MediaSource = z.infer<typeof MediaSourceSchema>\n\n// ===== Media Schema =====\n\n/**\n * Complete media object with source and optional variants\n */\nexport const MediaSchema = z.object({\n /** Display name for the media */\n name: z.string().min(1),\n /** Primary media source */\n src: MediaSourceSchema,\n /** Optional additional sources (e.g., different resolutions) */\n srcSet: z.array(MediaSourceSchema).default([]),\n /** Type-specific metadata (dimensions, duration, etc.) */\n rawOptions: z.custom<RawOptions>().optional(),\n})\nexport type Media = z.infer<typeof MediaSchema>\n\n// ===== Upload Handle Schema =====\n\n/**\n * Upload handle containing SAS URI and metadata for client-side upload\n */\nexport const MediaUploadHandleSchema = z.object({\n /** Media source information */\n src: MediaSourceSchema,\n /** Upload credentials and metadata */\n uploadHandle: z.object({\n /** Shared Access Signature URI for upload */\n uploadSasuri: z.url(),\n /** Metadata to attach to the blob */\n metadata: z.record(z.string(), z.string()).default({}),\n /** Tags to attach to the blob */\n tags: z.record(z.string(), z.string()).default({}),\n }),\n})\nexport type MediaUploadHandle = z.infer<typeof MediaUploadHandleSchema>\n\n// ===== Download Handle Schema =====\n\n/**\n * Download handle containing SAS URIs for different access patterns\n */\nexport const MediaDownloadHandleSchema = z.object({\n /** Media source information */\n src: MediaSourceSchema,\n /** Download credentials and URIs */\n downloadHandle: z.object({\n /** SAS URI for file download */\n downloadSasuri: z.url(),\n /** SAS URI for inline viewing */\n viewSasuri: z.url(),\n /** Optional SAS URI for preview thumbnail */\n previewSasuri: z.url().optional(),\n /** Expiration timestamp for the SAS URIs */\n expiresOn: z.string().datetime(),\n /** Storage backend type */\n type: z.string(),\n }),\n})\nexport type MediaDownloadHandle = z.infer<typeof MediaDownloadHandleSchema>\n\n// ===== Media Types =====\n\nexport enum MediaType {\n picture = 'picture',\n video = 'video',\n audio = 'audio',\n office = 'office',\n archive = 'archive',\n binary = 'binary',\n executable = 'executable',\n}\n\n// ===== Raw Options Schemas =====\n\nconst PictureRawOptionsSchema = z.object({\n type: z.literal(MediaType.picture),\n width: z.number().positive(),\n height: z.number().positive(),\n blurhash: z.string().optional(),\n})\n\nconst VideoRawOptionsSchema = z.object({\n type: z.literal(MediaType.video),\n width: z.number().positive(),\n height: z.number().positive(),\n duration: z.number().nonnegative(),\n})\n\nconst AudioRawOptionsSchema = z.object({\n type: z.literal(MediaType.audio),\n duration: z.number().nonnegative(),\n})\n\nconst OfficeRawOptionsSchema = z.object({\n type: z.literal(MediaType.office),\n})\n\nconst ArchiveRawOptionsSchema = z.object({\n type: z.literal(MediaType.archive),\n})\n\nconst BinaryRawOptionsSchema = z.object({\n type: z.literal(MediaType.binary),\n})\n\nconst ExecutableRawOptionsSchema = z.object({\n type: z.literal(MediaType.executable),\n})\n\nexport const RawOptionsSchema = z.discriminatedUnion('type', [\n PictureRawOptionsSchema,\n VideoRawOptionsSchema,\n AudioRawOptionsSchema,\n OfficeRawOptionsSchema,\n ArchiveRawOptionsSchema,\n BinaryRawOptionsSchema,\n ExecutableRawOptionsSchema,\n])\n\n// ===== Raw Options Types =====\n\n// ===== Raw Options Types =====\n\nexport type PictureRawOptions = z.infer<typeof PictureRawOptionsSchema>\nexport type VideoRawOptions = z.infer<typeof VideoRawOptionsSchema>\nexport type AudioRawOptions = z.infer<typeof AudioRawOptionsSchema>\nexport type OfficeRawOptions = z.infer<typeof OfficeRawOptionsSchema>\nexport type ArchiveRawOptions = z.infer<typeof ArchiveRawOptionsSchema>\nexport type BinaryRawOptions = z.infer<typeof BinaryRawOptionsSchema>\nexport type ExecutableRawOptions = z.infer<typeof ExecutableRawOptionsSchema>\n\nexport type RawOptions = z.infer<typeof RawOptionsSchema>\n\n// ===== Uploaded File Type =====\n\nexport type UploadedFile<Source = undefined> = Source extends undefined\n ? {\n name: string\n size: number\n type: string\n url: string\n lastModified?: number\n }\n : {\n name: string\n size: number\n type: string\n url: string\n lastModified?: number\n source: Source\n }\n\n// ===== Helper Functions =====\n\n/**\n * Check if a MIME type is a supported image format\n */\nexport const isSupportedImageType = (mimeType: string): boolean => {\n return mimeType.startsWith('image/')\n}\n\n/**\n * Check if a MIME type supports preview generation\n */\nexport const isSupportedPreviewType = (mimeType: string): boolean => {\n return mimeType.startsWith('image/') || mimeType === 'application/pdf'\n}\n\n/**\n * Determine MediaType from MIME type\n */\nexport const getMediaTypeFromMime = (mimeType: string): MediaType => {\n if (mimeType.startsWith('image/')) {\n return MediaType.picture\n }\n if (mimeType.startsWith('video/')) {\n return MediaType.video\n }\n if (mimeType.startsWith('audio/')) {\n return MediaType.audio\n }\n if (\n mimeType.startsWith('application/pdf') ||\n mimeType.startsWith('application/msword') ||\n mimeType.startsWith('application/vnd.openxmlformats') ||\n mimeType.startsWith('application/vnd.ms-')\n ) {\n return MediaType.office\n }\n if (\n mimeType === 'application/zip' ||\n mimeType === 'application/x-rar-compressed' ||\n mimeType === 'application/x-7z-compressed'\n ) {\n return MediaType.archive\n }\n if (\n mimeType.startsWith('application/x-') &&\n mimeType.includes('executable')\n ) {\n return MediaType.executable\n }\n return MediaType.binary\n}\n\n/**\n * Extract file extension from filename\n */\nexport const getExtensionFromFilename = (filename: string): string => {\n const lastDot = filename.lastIndexOf('.')\n return lastDot === -1 ? '' : filename.slice(lastDot).toLowerCase()\n}\n\n/**\n * Format bytes to human-readable string\n */\nexport const formatBytes = (bytes: number, decimals = 2): string => {\n if (bytes === 0) {\n return '0 Bytes'\n }\n const k = 1024\n const dm = decimals < 0 ? 0 : decimals\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`\n}\n\n// ===== Type Guards =====\n\nexport const isPictureOptions = (\n options: RawOptions,\n): options is PictureRawOptions => {\n return options.type === MediaType.picture\n}\n\nexport const isVideoOptions = (\n options: RawOptions,\n): options is VideoRawOptions => {\n return options.type === MediaType.video\n}\n\nexport const isAudioOptions = (\n options: RawOptions,\n): options is AudioRawOptions => {\n return options.type === MediaType.audio\n}\n\nexport const isOfficeOptions = (\n options: RawOptions,\n): options is OfficeRawOptions => {\n return options.type === MediaType.office\n}\n\nexport const isArchiveOptions = (\n options: RawOptions,\n): options is ArchiveRawOptions => {\n return options.type === MediaType.archive\n}\n\nexport const isBinaryOptions = (\n options: RawOptions,\n): options is BinaryRawOptions => {\n return options.type === MediaType.binary\n}\n\nexport const isExecutableOptions = (\n options: RawOptions,\n): options is ExecutableRawOptions => {\n return options.type === MediaType.executable\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAcA,SAAgB,EAAK,GAAQ;CACzB,OAAOA,EAAkBC,GAAiB,CAAM;AACpD;;;ACVA,IAAa,IAAkB,4BAkCnB,IAAL,yBAAA,GAAA;QACH,EAAA,UAAA,WACA,EAAA,OAAA,QACA,EAAA,MAAA,OACA,EAAA,UAAA;AACJ,EAAA,CAAA,CAAA,GAUM,IAA+B,EAAS;CAC1C,MAAM,EAAU,YAAY;CAC5B,SAAS,EAAM;CACf,eAAe,EAAS,CAAC,CAAC,IAAI,CAAC;CAC/B,yBAAyB,EAAS,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,IAAI;CACpB,QAAQ,EAAS,CAAC,CAAC,IAAI,CAAC;CACxB,KAAK,EAAS,CAAC,CAAC,IAAI,CAAC;CACrB,QAAQ,EAAS,CAAC,CAAC,IAAI,CAAC;AAC5B,CAAC,GAEK,IAAsB,EAAqB,QAAQ,CACrD,GACA,CACJ,CAAC,GAmCY,IA5BoB,EAAS;CAEtC,MAAM,EAAS,CAAC,CAAC,IAAI,CAAC;CAEtB,MAAM,EAAS,CAAC,CAAC,IAAI,CAAC;CAEtB,UAAU,EAAS,CAAC,CAAC,MAAM,CAAe;CAE1C,YAAY,EAAS,CAAC,CAAC,SAAS;CAEhC,WAAW,EACC,CAAC,CACR,MAAM,kBAAkB,CAAC,CACzB,WAAW,MAAQ,EAAI,YAAY,CAAC;CAEzC,gBAAgB,EAAS,CAAC,CAAC,SAAS;CAEpC,UAAU,EAAS,EA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C,CAAC,SAAS;AAClC,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,EAAU,KAAK;CAC/B,OAAO,EAAS,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAS,CAAC,CAAC,SAAS;CAC5B,UAAU,EAAS,CAAC,CAAC,YAAY;AACrC,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,EAAU,KAAK;CAC/B,UAAU,EAAS,CAAC,CAAC,YAAY;AACrC,CAAC,GAEK,IAAyB,EAAS,EACpC,MAAM,EAAU,EAAU,MAAM,EACpC,CAAC,GAEK,IAA0B,EAAS,EACrC,MAAM,EAAU,EAAU,OAAO,EACrC,CAAC,GAEK,IAAyB,EAAS,EACpC,MAAM,EAAU,EAAU,MAAM,EACpC,CAAC,GAEK,IAA6B,EAAS,EACxC,MAAM,EAAU,EAAU,UAAU,EACxC,CAAC;AAE+B,EAAqB,QAAQ;CACzD;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"Media-_HfFLHGD.js","names":["core._coercedDate","schemas.ZodDate"],"sources":["../../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.js","../../../../packages/models/src/schema/Media.ts"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from 'zod'\n\n// ===== Constants =====\n\nexport const MAX_FILE_SIZE = 100 * 1024 * 1024 // 100MB\n\nexport const MIME_TYPE_REGEX = /^[a-z]+\\/[a-z0-9\\-+.]+$/i\n\nexport const SUPPORTED_IMAGE_TYPES = [\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n] as const\n\nexport const SUPPORTED_VIDEO_TYPES = [\n 'video/mp4',\n 'video/webm',\n 'video/ogg',\n] as const\n\nexport const SUPPORTED_AUDIO_TYPES = [\n 'audio/mpeg',\n 'audio/wav',\n 'audio/ogg',\n] as const\n\n// ===== Enums =====\n\nexport enum StoragePolicy {\n DEFAULT = 'default',\n COLD = 'cold',\n HOT = 'hot',\n ARCHIVE = 'archive',\n}\n\nexport enum PreviewStatus {\n Pending = 'pending',\n Done = 'done',\n Failed = 'failed',\n}\n\n// ===== Storage Handle Schemas =====\n\nconst AzureBlobStorageHandleSchema = z.object({\n type: z.literal('azure-blob'),\n blobUri: z.url(),\n containerName: z.string().min(1),\n pathRelativeToContainer: z.string().min(1),\n})\n\nconst S3StorageHandleSchema = z.object({\n type: z.literal('s3'),\n bucket: z.string().min(1),\n key: z.string().min(1),\n region: z.string().min(1),\n})\n\nconst StorageHandleSchema = z.discriminatedUnion('type', [\n AzureBlobStorageHandleSchema,\n S3StorageHandleSchema,\n])\n\n// ===== Media Upload Schema =====\n\n/**\n * Media upload information for preparing a file upload\n */\nexport const MediaUploadSchema = z.object({\n /** Media type category (picture, video, audio, etc.) */\n type: z.string().min(1),\n /** Original filename */\n name: z.string().min(1),\n /** MIME type (e.g., 'image/jpeg') */\n mimeType: z.string().regex(MIME_TYPE_REGEX),\n /** File size in bytes (must be positive) */\n bytesCount: z.number().positive(),\n /** File extension with dot (e.g., '.jpg') */\n extension: z\n .string()\n .regex(/^\\.[a-zA-Z0-9]+$/)\n .overwrite((ext) => ext.toLowerCase()),\n /** Optional custom stored filename */\n storedFileName: z.string().optional(),\n /** Additional metadata key-value pairs */\n metadata: z.record(z.string(), z.string()).default({}),\n /** Storage tags for categorization */\n tags: z.record(z.string(), z.string()).default({}),\n})\nexport type MediaUpload = z.infer<typeof MediaUploadSchema>\n\n// ===== Media Source Schema =====\n\n/**\n * Complete media source information including storage details\n */\nexport const MediaSourceSchema = MediaUploadSchema.extend({\n /** Storage backend configuration */\n storageHandle: StorageHandleSchema,\n /** Storage tier/policy */\n storagePolicy: z.enum(StoragePolicy),\n /** Optional signature data for verification */\n signData: z.string().optional(),\n /** Actual stored filename (required) */\n storedFileName: z.string().min(1),\n})\nexport type MediaSource = z.infer<typeof MediaSourceSchema>\n\n// ===== Media Schema =====\n\n/**\n * Complete media object with source and optional variants\n */\nexport const MediaSchema = z.object({\n /** Display name for the media */\n name: z.string().min(1),\n /** Primary media source */\n src: MediaSourceSchema,\n /** Optional additional sources (e.g., different resolutions) */\n srcSet: z.array(MediaSourceSchema).default([]),\n /** Type-specific metadata (dimensions, duration, etc.) */\n rawOptions: z.custom<RawOptions>().optional(),\n})\nexport type Media = z.infer<typeof MediaSchema>\n\n// ===== Upload Handle Schema =====\n\n/**\n * Upload handle containing SAS URI and metadata for client-side upload\n */\nexport const MediaUploadHandleSchema = z.object({\n /** Media source information */\n src: MediaSourceSchema,\n /** Upload credentials and metadata */\n uploadHandle: z.object({\n /** Shared Access Signature URI for upload */\n uploadSasuri: z.url(),\n /** Metadata to attach to the blob */\n metadata: z.record(z.string(), z.string()).default({}),\n /** Tags to attach to the blob */\n tags: z.record(z.string(), z.string()).default({}),\n }),\n})\nexport type MediaUploadHandle = z.infer<typeof MediaUploadHandleSchema>\n\n// ===== Download Handle Schema =====\n\n/**\n * Download handle containing SAS URIs for different access patterns\n */\nexport const MediaDownloadHandleSchema = z.object({\n /** Media source information */\n src: MediaSourceSchema,\n /** Download credentials and URIs */\n downloadHandle: z.object({\n /** SAS URI for file download */\n downloadSasuri: z.url(),\n /** SAS URI for inline viewing */\n viewSasuri: z.url(),\n /** Optional SAS URI for preview thumbnail */\n previewSasuri: z.url().optional(),\n /** Expiration timestamp for the SAS URIs */\n expiresOn: z.string().datetime(),\n /** Storage backend type */\n type: z.string(),\n }),\n})\nexport type MediaDownloadHandle = z.infer<typeof MediaDownloadHandleSchema>\n\n// ===== Media Types =====\n\nexport enum MediaType {\n picture = 'picture',\n video = 'video',\n audio = 'audio',\n office = 'office',\n archive = 'archive',\n binary = 'binary',\n executable = 'executable',\n}\n\n// ===== Raw Options Schemas =====\n\nconst PictureRawOptionsSchema = z.object({\n type: z.literal(MediaType.picture),\n width: z.number().positive(),\n height: z.number().positive(),\n blurhash: z.string().optional(),\n})\n\nconst VideoRawOptionsSchema = z.object({\n type: z.literal(MediaType.video),\n width: z.number().positive(),\n height: z.number().positive(),\n duration: z.number().nonnegative(),\n})\n\nconst AudioRawOptionsSchema = z.object({\n type: z.literal(MediaType.audio),\n duration: z.number().nonnegative(),\n})\n\nconst OfficeRawOptionsSchema = z.object({\n type: z.literal(MediaType.office),\n})\n\nconst ArchiveRawOptionsSchema = z.object({\n type: z.literal(MediaType.archive),\n})\n\nconst BinaryRawOptionsSchema = z.object({\n type: z.literal(MediaType.binary),\n})\n\nconst ExecutableRawOptionsSchema = z.object({\n type: z.literal(MediaType.executable),\n})\n\nexport const RawOptionsSchema = z.discriminatedUnion('type', [\n PictureRawOptionsSchema,\n VideoRawOptionsSchema,\n AudioRawOptionsSchema,\n OfficeRawOptionsSchema,\n ArchiveRawOptionsSchema,\n BinaryRawOptionsSchema,\n ExecutableRawOptionsSchema,\n])\n\n// ===== Raw Options Types =====\n\n// ===== Raw Options Types =====\n\nexport type PictureRawOptions = z.infer<typeof PictureRawOptionsSchema>\nexport type VideoRawOptions = z.infer<typeof VideoRawOptionsSchema>\nexport type AudioRawOptions = z.infer<typeof AudioRawOptionsSchema>\nexport type OfficeRawOptions = z.infer<typeof OfficeRawOptionsSchema>\nexport type ArchiveRawOptions = z.infer<typeof ArchiveRawOptionsSchema>\nexport type BinaryRawOptions = z.infer<typeof BinaryRawOptionsSchema>\nexport type ExecutableRawOptions = z.infer<typeof ExecutableRawOptionsSchema>\n\nexport type RawOptions = z.infer<typeof RawOptionsSchema>\n\n// ===== Uploaded File Type =====\n\nexport type UploadedFile<Source = undefined> = Source extends undefined\n ? {\n name: string\n size: number\n type: string\n url: string\n lastModified?: number\n }\n : {\n name: string\n size: number\n type: string\n url: string\n lastModified?: number\n source: Source\n }\n\n// ===== Helper Functions =====\n\n/**\n * Check if a MIME type is a supported image format\n */\nexport const isSupportedImageType = (mimeType: string): boolean => {\n return mimeType.startsWith('image/')\n}\n\n/**\n * Check if a MIME type supports preview generation\n */\nexport const isSupportedPreviewType = (mimeType: string): boolean => {\n return mimeType.startsWith('image/') || mimeType === 'application/pdf'\n}\n\n/**\n * Determine MediaType from MIME type\n */\nexport const getMediaTypeFromMime = (mimeType: string): MediaType => {\n if (mimeType.startsWith('image/')) {\n return MediaType.picture\n }\n if (mimeType.startsWith('video/')) {\n return MediaType.video\n }\n if (mimeType.startsWith('audio/')) {\n return MediaType.audio\n }\n if (\n mimeType.startsWith('application/pdf') ||\n mimeType.startsWith('application/msword') ||\n mimeType.startsWith('application/vnd.openxmlformats') ||\n mimeType.startsWith('application/vnd.ms-')\n ) {\n return MediaType.office\n }\n if (\n mimeType === 'application/zip' ||\n mimeType === 'application/x-rar-compressed' ||\n mimeType === 'application/x-7z-compressed'\n ) {\n return MediaType.archive\n }\n if (\n mimeType.startsWith('application/x-') &&\n mimeType.includes('executable')\n ) {\n return MediaType.executable\n }\n return MediaType.binary\n}\n\n/**\n * Extract file extension from filename\n */\nexport const getExtensionFromFilename = (filename: string): string => {\n const lastDot = filename.lastIndexOf('.')\n return lastDot === -1 ? '' : filename.slice(lastDot).toLowerCase()\n}\n\n/**\n * Format bytes to human-readable string\n */\nexport const formatBytes = (bytes: number, decimals = 2): string => {\n if (bytes === 0) {\n return '0 Bytes'\n }\n const k = 1024\n const dm = decimals < 0 ? 0 : decimals\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`\n}\n\n// ===== Type Guards =====\n\nexport const isPictureOptions = (\n options: RawOptions,\n): options is PictureRawOptions => {\n return options.type === MediaType.picture\n}\n\nexport const isVideoOptions = (\n options: RawOptions,\n): options is VideoRawOptions => {\n return options.type === MediaType.video\n}\n\nexport const isAudioOptions = (\n options: RawOptions,\n): options is AudioRawOptions => {\n return options.type === MediaType.audio\n}\n\nexport const isOfficeOptions = (\n options: RawOptions,\n): options is OfficeRawOptions => {\n return options.type === MediaType.office\n}\n\nexport const isArchiveOptions = (\n options: RawOptions,\n): options is ArchiveRawOptions => {\n return options.type === MediaType.archive\n}\n\nexport const isBinaryOptions = (\n options: RawOptions,\n): options is BinaryRawOptions => {\n return options.type === MediaType.binary\n}\n\nexport const isExecutableOptions = (\n options: RawOptions,\n): options is ExecutableRawOptions => {\n return options.type === MediaType.executable\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAcA,SAAgB,EAAK,GAAQ;CACzB,OAAOA,EAAkBC,GAAiB,CAAM;AACpD;;;ACVA,IAAa,IAAkB,4BAwBnB,IAAL,yBAAA,GAAA;QACH,EAAA,UAAA,WACA,EAAA,OAAA,QACA,EAAA,MAAA,OACA,EAAA,UAAA;AACJ,EAAA,CAAA,CAAA,GAUM,IAA+B,EAAS;CAC1C,MAAM,EAAU,YAAY;CAC5B,SAAS,EAAM;CACf,eAAe,EAAS,CAAC,CAAC,IAAI,CAAC;CAC/B,yBAAyB,EAAS,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,IAAI;CACpB,QAAQ,EAAS,CAAC,CAAC,IAAI,CAAC;CACxB,KAAK,EAAS,CAAC,CAAC,IAAI,CAAC;CACrB,QAAQ,EAAS,CAAC,CAAC,IAAI,CAAC;AAC5B,CAAC,GAEK,IAAsB,EAAqB,QAAQ,CACrD,GACA,CACJ,CAAC,GAmCY,IA5BoB,EAAS;CAEtC,MAAM,EAAS,CAAC,CAAC,IAAI,CAAC;CAEtB,MAAM,EAAS,CAAC,CAAC,IAAI,CAAC;CAEtB,UAAU,EAAS,CAAC,CAAC,MA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,SAAA,UACA,EAAA,aAAA;AACJ,EAAA,CAAA,CAAA,GAIM,IAA0B,EAAS;CACrC,MAAM,EAAU,EAAU,OAAO;CACjC,OAAO,EAAS,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAS,CAAC,CAAC,SAAS;CAC5B,UAAU,EAAS,CAAC,CAAC,SAAS;AAClC,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,EAAU,KAAK;CAC/B,OAAO,EAAS,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAS,CAAC,CAAC,SAAS;CAC5B,UAAU,EAAS,CAAC,CAAC,YAAY;AACrC,CAAC,GAEK,IAAwB,EAAS;CACnC,MAAM,EAAU,EAAU,KAAK;CAC/B,UAAU,EAAS,CAAC,CAAC,YAAY;AACrC,CAAC,GAEK,IAAyB,EAAS,EACpC,MAAM,EAAU,EAAU,MAAM,EACpC,CAAC,GAEK,IAA0B,EAAS,EACrC,MAAM,EAAU,EAAU,OAAO,EACrC,CAAC,GAEK,IAAyB,EAAS,EACpC,MAAM,EAAU,EAAU,MAAM,EACpC,CAAC,GAEK,IAA6B,EAAS,EACxC,MAAM,EAAU,EAAU,UAAU,EACxC,CAAC;AAE+B,EAAqB,QAAQ;CACzD;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { n as e, t } from "./PkStreamingMarkdown-
|
|
2
|
-
import { n } from "./useChatbotStore-
|
|
3
|
-
import { t as ee } from "./PkChatbotViewConversations-
|
|
4
|
-
import { t as te } from "./PkChatbotViewChat-
|
|
5
|
-
import { t as ne } from "./PkChatbotViewFiles-
|
|
1
|
+
import { n as e, t } from "./PkStreamingMarkdown-DYy79C1P.js";
|
|
2
|
+
import { n } from "./useChatbotStore-CMo47fnS.js";
|
|
3
|
+
import { t as ee } from "./PkChatbotViewConversations-CHpN4vhm.js";
|
|
4
|
+
import { t as te } from "./PkChatbotViewChat-B13nCznB.js";
|
|
5
|
+
import { t as ne } from "./PkChatbotViewFiles-cRyG5X3P.js";
|
|
6
6
|
import { t as r } from "./useLocalizedString-PfaKjIQY.js";
|
|
7
|
-
import {
|
|
7
|
+
import { S as i } from "./utils-B45A2ONa.js";
|
|
8
8
|
import { t as re } from "./PkAvatar-paEJByEA.js";
|
|
9
9
|
import { t as a } from "./chatbotProfileContext-CgnFhNPn.js";
|
|
10
|
-
import { t as ie } from "./PkChatbotViewProfile-
|
|
10
|
+
import { t as ie } from "./PkChatbotViewProfile-CosaHA-g.js";
|
|
11
11
|
import { VvAlert as ae, VvButton as oe, VvButtonGroup as se, VvDropdown as ce, VvDropdownAction as le, VvIcon as ue } from "@volverjs/ui-vue/components";
|
|
12
12
|
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, createTextVNode as p, createVNode as m, defineComponent as h, guardReactiveProps as g, inject as _, mergeModels as v, mergeProps as y, normalizeClass as de, normalizeProps as b, normalizeStyle as x, openBlock as S, renderList as C, renderSlot as w, toDisplayString as T, toRef as fe, unref as E, useModel as pe, useSlots as me, useTemplateRef as he, watch as D, watchEffect as ge, withCtx as O } from "vue";
|
|
13
13
|
import { useI18n as _e } from "vue-i18n";
|
|
@@ -269,4 +269,4 @@ var be = { class: "pk-chatbot__header-start" }, xe = ["title"], Se = { key: 1 },
|
|
|
269
269
|
//#endregion
|
|
270
270
|
export { k as t };
|
|
271
271
|
|
|
272
|
-
//# sourceMappingURL=PkChatbot-
|
|
272
|
+
//# sourceMappingURL=PkChatbot-DtyZYAzj.js.map
|