@epam/ai-dial-chat-hooks 1.4.0-dev.122 → 1.4.0-dev.126
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/catalog/create-publish-api.d.ts +7 -1
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +1 -0
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +22 -5
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +181 -125
- package/file-manager.js +33 -33
- package/files/dial-file.d.ts +6 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +17 -12
- package/index.js +262 -262
- package/org-units/org-unit-guards.d.ts +34 -0
- package/org-units/org-unit-guards.d.ts.map +1 -1
- package/org-units/org-unit-guards.js +15 -2
- package/package.json +17 -17
- package/project/project-conversation-data-source.js +4 -4
- package/scheduled-task/scheduled-task-display.d.ts +47 -0
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +55 -39
- package/scheduled-task/scheduled-task-time-format.d.ts +5 -3
- package/scheduled-task/scheduled-task-time-format.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-time-format.js +3 -2
- package/scheduled-tasks.js +14 -14
- package/utils.js +18 -18
package/files/dial-file.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
2
2
|
import { DialFileNodeType as t } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
//#region src/files/dial-file.ts
|
|
4
|
-
var n = (e) => e.startsWith("files/"), r =
|
|
4
|
+
var n = (e) => e.startsWith("files/"), r = (t, r) => {
|
|
5
|
+
let [i] = t.split(/[?#]/, 1);
|
|
6
|
+
if (!n(i)) return !1;
|
|
7
|
+
let a = e(i).split("/");
|
|
8
|
+
return !a.includes("..") && a[1] === e(r);
|
|
9
|
+
}, i = "projects/", a = "/files/", o = (e) => {
|
|
5
10
|
let t = [];
|
|
6
11
|
for (let n of e.split("/")) {
|
|
7
12
|
let e;
|
|
@@ -14,19 +19,19 @@ var n = (e) => e.startsWith("files/"), r = "projects/", i = "/files/", a = (e) =
|
|
|
14
19
|
t.push(e);
|
|
15
20
|
}
|
|
16
21
|
return t;
|
|
17
|
-
},
|
|
22
|
+
}, s = (e) => {
|
|
18
23
|
let t = e.split("#")[0];
|
|
19
|
-
if (!t.startsWith(
|
|
24
|
+
if (!t.startsWith(i)) return;
|
|
20
25
|
let n = t.indexOf("/", 9);
|
|
21
26
|
if (n <= 9) return;
|
|
22
|
-
let
|
|
23
|
-
if (
|
|
24
|
-
let s =
|
|
27
|
+
let r = t.indexOf(a, n);
|
|
28
|
+
if (r <= n) return;
|
|
29
|
+
let s = o(t.slice(9, r)), c = o(t.slice(r + 7));
|
|
25
30
|
if (s != null && c != null) return {
|
|
26
|
-
projectId: `${
|
|
31
|
+
projectId: `${i}${s.join("/")}`,
|
|
27
32
|
filePath: c
|
|
28
33
|
};
|
|
29
|
-
},
|
|
34
|
+
}, c = (e) => s(e) != null, l = (e) => n(e) || c(e), u = (e) => n(e) && e.split("#")[0].endsWith("/"), d = (t, r) => {
|
|
30
35
|
let i = `files/${r}/`;
|
|
31
36
|
if (t.startsWith(i)) return e(t.slice(i.length));
|
|
32
37
|
if (n(t)) {
|
|
@@ -37,7 +42,7 @@ var n = (e) => e.startsWith("files/"), r = "projects/", i = "/files/", a = (e) =
|
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
return t;
|
|
40
|
-
},
|
|
45
|
+
}, f = (e) => {
|
|
41
46
|
if (!n(e)) return;
|
|
42
47
|
let t = e.slice(6), r = t.indexOf("/");
|
|
43
48
|
if (r < 0) return;
|
|
@@ -51,13 +56,13 @@ var n = (e) => e.startsWith("files/"), r = "projects/", i = "/files/", a = (e) =
|
|
|
51
56
|
bucket: i,
|
|
52
57
|
path: o
|
|
53
58
|
};
|
|
54
|
-
},
|
|
59
|
+
}, p = /* @__PURE__ */ function(e) {
|
|
55
60
|
return e.File = "file", e.Folder = "folder", e.Multiple = "multiple", e;
|
|
56
|
-
}({}),
|
|
61
|
+
}({}), m = (e) => e.length === 1 ? e[0].nodeType === t.FOLDER ? "folder" : "file" : "multiple", h = (e, t) => {
|
|
57
62
|
let r = e.url ?? e.id ?? "";
|
|
58
63
|
if (!r) return null;
|
|
59
64
|
let i = (n(r) ? r : `files/${e.bucket ?? t}/${r.replace(/^\/+/, "")}`).split("/").filter((e) => e !== ".." && e !== ".").join("/");
|
|
60
65
|
return i.endsWith("/") ? i : `${i}/`;
|
|
61
66
|
};
|
|
62
67
|
//#endregion
|
|
63
|
-
export {
|
|
68
|
+
export { p as FileSelectionKind, m as getFileSelectionKind, n as isDialFileId, u as isDialFolderId, c as isDialProjectFileId, l as isDialStoredFileId, r as isOwnDialFileId, s as parseDialProjectFileId, f as resolveDialFileBucketAndPath, h as resolveDialFolderPath, d as resolveRelativeDialFilePath };
|