@epam/ai-dial-chat-hooks 1.2.0-dev.158 → 1.2.0-dev.162

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.
@@ -2,52 +2,52 @@ import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
2
  import { isPublicToolsetId as t } from "../oauth/toolset-id.js";
3
3
  import { resolveLocalizedText as n } from "../shared/locale.js";
4
4
  import { mapEntityDetailsToCatalogDetails as r } from "./map-entity-details-to-catalog.js";
5
- import { CatalogEntityType as i, formatLastUsed as a } from "@epam/ai-dial-chat-shared";
6
- import { CredentialStatus as o, ToolsetAuthenticationType as s } from "@epam/ai-dial-catalog";
5
+ import { CatalogEntityType as i, PUBLIC_BUCKET as a, formatLastUsed as o } from "@epam/ai-dial-chat-shared";
6
+ import { CredentialStatus as s, ToolsetAuthenticationType as c } from "@epam/ai-dial-catalog";
7
7
  //#region src/catalog/map-deployment-to-catalog-item.ts
8
- var c = {
9
- NONE: s.None,
10
- API_KEY: s.ApiKey,
11
- OAUTH: s.OAuth
12
- }, l = {
13
- SIGNED_IN: o.SignedIn,
14
- SIGNED_OUT: o.SignedOut,
15
- FAILED: o.Failed
16
- }, u = (e, n, r) => {
8
+ var l = {
9
+ NONE: c.None,
10
+ API_KEY: c.ApiKey,
11
+ OAUTH: c.OAuth
12
+ }, u = {
13
+ SIGNED_IN: s.SignedIn,
14
+ SIGNED_OUT: s.SignedOut,
15
+ FAILED: s.Failed
16
+ }, d = (e, n, r) => {
17
17
  if (n == null) return;
18
- let i = t(e), a = n.userLevelAuthStatus ? l[n.userLevelAuthStatus] : void 0, u = n.globalAuthStatus ? l[n.globalAuthStatus] : void 0;
18
+ let i = t(e), a = n.userLevelAuthStatus ? u[n.userLevelAuthStatus] : void 0, o = n.globalAuthStatus ? u[n.globalAuthStatus] : void 0;
19
19
  return {
20
- authenticationType: !r && i && a !== o.SignedIn && u === o.SignedIn ? s.None : c[n.authenticationType],
20
+ authenticationType: !r && i && a !== s.SignedIn && o === s.SignedIn ? c.None : l[n.authenticationType],
21
21
  userStatus: a,
22
- globalStatus: u,
22
+ globalStatus: o,
23
23
  isPublic: i,
24
24
  isManageableByAdmin: r && i,
25
25
  apiKeyHeader: n.apiKeyHeader
26
26
  };
27
- }, d = {
27
+ }, f = {
28
28
  model: i.Model,
29
29
  toolset: i.Toolset,
30
30
  application: i.Agent
31
- }, f = "applications/", p = "toolsets/", m = "public", h = (t, n) => (t.startsWith(n) ? t.slice(n.length) : t).split("/").filter(Boolean).map(e), g = (e, t) => {
31
+ }, p = "applications/", m = "toolsets/", h = (t, n) => (t.startsWith(n) ? t.slice(n.length) : t).split("/").filter(Boolean).map(e), g = (e, t) => {
32
32
  if (e.isMy) return [t.personal];
33
- let n = h(e.applicationFolder ?? "", f);
34
- return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n.length === 0 && e.type?.toLowerCase() === "application" ? [t.public] : n[0]?.toLowerCase() === m ? [t.public, ...n.slice(1)] : n;
33
+ let n = h(e.applicationFolder ?? "", p);
34
+ return e.sharedWithMe ? [t.shared, ...n.slice(1)] : n.length === 0 && e.type?.toLowerCase() === "application" ? [t.public] : n[0]?.toLowerCase() === a ? [t.public, ...n.slice(1)] : n;
35
35
  }, _ = (e, t) => {
36
36
  if (e.isMy && t != null) return [t.personal];
37
37
  let n = e.toolset || e.id;
38
- if (!n.startsWith(p)) return t == null ? [] : e.sharedWithMe ? [t.shared] : n.length > 0 && !n.includes("/") ? [t.public] : [];
39
- let r = h(n, p).slice(0, -1);
40
- return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() === m && t != null ? [t.public, ...r.slice(1)] : r.slice(1);
41
- }, v = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: o, folderLabels: s, editableSchemaIds: c = [], isCustomAppsEditable: l = !1, activeLocale: u, primaryLocale: f, resolveIconUrl: p }) => {
42
- let m = n(e.displayName, u, f) || e.id, h = (e.type ?? "").toLowerCase();
38
+ if (!n.startsWith(m)) return t == null ? [] : e.sharedWithMe ? [t.shared] : n.length > 0 && !n.includes("/") ? [t.public] : [];
39
+ let r = h(n, m).slice(0, -1);
40
+ return e.sharedWithMe && t != null ? [t.shared, ...r.slice(1)] : r[0]?.toLowerCase() === a && t != null ? [t.public, ...r.slice(1)] : r.slice(1);
41
+ }, v = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), entityDetails: a, folderLabels: s, editableSchemaIds: c = [], isCustomAppsEditable: l = !1, activeLocale: u, primaryLocale: d, resolveIconUrl: p }) => {
42
+ let m = n(e.displayName, u, d) || e.id, h = (e.type ?? "").toLowerCase();
43
43
  return {
44
44
  id: e.id,
45
- type: d[h] ?? i.Model,
45
+ type: f[h] ?? i.Model,
46
46
  name: m,
47
- description: n(e.description, u, f),
47
+ description: n(e.description, u, d),
48
48
  iconUrl: p(e.iconUrl),
49
49
  version: e.displayVersion ?? "",
50
- lastUsed: a(e.updatedAt),
50
+ lastUsed: o(e.updatedAt),
51
51
  updatedAt: e.updatedAt,
52
52
  createdAt: e.createdAt,
53
53
  isFeatured: e.isFeatured ?? !1,
@@ -59,20 +59,20 @@ var c = {
59
59
  sharedWithMe: e.sharedWithMe ?? !1,
60
60
  isEditable: (!!e.isMy || !!e.canEdit) && (c.length > 0 && c.includes(e.applicationTypeSchemaId ?? "") || l && !e.applicationTypeSchemaId && h === "application"),
61
61
  folder: g(e, s),
62
- details: o == null ? void 0 : r(o),
62
+ details: a == null ? void 0 : r(a),
63
63
  supportsMcp: e.features?.mcp === !0,
64
64
  supportsChat: e.interfaces == null || e.interfaces.includes("chat")
65
65
  };
66
- }, y = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), isAdmin: r = !1, folderLabels: o, activeLocale: s, primaryLocale: c, resolveIconUrl: l }) => {
67
- let d = n(e.displayName, s, c) || e.toolset || e.reference || e.id, f = e.allowedTools ?? [];
66
+ }, y = (e, { favoriteIds: t = /* @__PURE__ */ new Set(), isAdmin: r = !1, folderLabels: a, activeLocale: s, primaryLocale: c, resolveIconUrl: l }) => {
67
+ let u = n(e.displayName, s, c) || e.toolset || e.reference || e.id, f = e.allowedTools ?? [];
68
68
  return {
69
69
  id: e.id,
70
70
  type: i.Toolset,
71
- name: d,
71
+ name: u,
72
72
  description: n(e.description, s, c),
73
73
  iconUrl: l(e.iconUrl),
74
74
  version: e.displayVersion ?? "",
75
- lastUsed: a(e.updatedAt),
75
+ lastUsed: o(e.updatedAt),
76
76
  updatedAt: e.updatedAt,
77
77
  createdAt: e.createdAt,
78
78
  isFeatured: !1,
@@ -83,10 +83,10 @@ var c = {
83
83
  isMyApp: e.isMy ?? !1,
84
84
  sharedWithMe: e.sharedWithMe ?? !1,
85
85
  isEditable: !!(e.isMy || e.canEdit),
86
- folder: _(e, o),
87
- credentials: u(e.id, e.authSettings, r),
86
+ folder: _(e, a),
87
+ credentials: d(e.id, e.authSettings, r),
88
88
  details: f.length > 0 ? { tools: { tools: f.map((e) => ({ name: e })) } } : void 0
89
89
  };
90
90
  };
91
91
  //#endregion
92
- export { v as mapDeploymentToCatalogItem, u as mapDeploymentToolsetCredentials, y as mapToolsetToCatalogItem, g as resolveDeploymentFolder };
92
+ export { v as mapDeploymentToCatalogItem, d as mapDeploymentToolsetCredentials, y as mapToolsetToCatalogItem, g as resolveDeploymentFolder };
@@ -1,13 +1,13 @@
1
1
  import { safeDecodeURIComponent as e } from "../shared/string-utils.js";
2
- import { CatalogEntityType as t } from "@epam/ai-dial-chat-shared";
2
+ import { CatalogEntityType as t, PUBLIC_BUCKET as n } from "@epam/ai-dial-chat-shared";
3
3
  //#region src/catalog/publish.ts
4
- var n = {
4
+ var r = {
5
5
  [t.Model]: "model",
6
6
  [t.Toolset]: "toolset",
7
7
  [t.Agent]: "application",
8
8
  [t.Prompt]: "prompt",
9
9
  [t.Skill]: "skill"
10
- }, r = (e) => n[e], i = "public", a = (e) => e.split("/")[1] === i, o = (t) => a(t) ? t.split("/").slice(2, -1).map(e) : [], s = (e) => ({
10
+ }, i = (e) => r[e], a = (e) => e.split("/")[1] === n, o = (t) => a(t) ? t.split("/").slice(2, -1).map(e) : [], s = (e) => ({
11
11
  version: e.version,
12
12
  publishedAt: Date.parse(e.publishedAt),
13
13
  folderPath: e.folderPath.split("/").filter(Boolean),
@@ -17,4 +17,4 @@ var n = {
17
17
  folderPath: e.folderPath.split("/").filter(Boolean)
18
18
  });
19
19
  //#endregion
20
- export { o as getPublicCatalogEntityFolderPath, a as isPublicCatalogEntityId, c as mapPublishConversationResultDto, s as mapPublishHistoryEntryDto, r as toPublishEntityType };
20
+ export { o as getPublicCatalogEntityFolderPath, a as isPublicCatalogEntityId, c as mapPublishConversationResultDto, s as mapPublishHistoryEntryDto, i as toPublishEntityType };
package/catalog.d.ts CHANGED
@@ -646,7 +646,11 @@ declare enum PromptSource {
646
646
  Public = "public"
647
647
  }
648
648
 
649
- /** DIAL Core bucket holding organisation-wide skills. */
649
+ /**
650
+ * DIAL Core bucket holding organisation-wide skills.
651
+ *
652
+ * @deprecated Use `PUBLIC_BUCKET` from `@epam/ai-dial-chat-shared`.
653
+ */
650
654
  export declare const PUBLIC_SKILL_BUCKET = "public";
651
655
 
652
656
  /** The DIAL publish API surface produced by {@link createPublishApiClient}. */
@@ -1,32 +1,40 @@
1
1
  import { formatDateYMD as e } from "./date.js";
2
2
  import { ExportFileNameKind as t } from "./types.js";
3
3
  //#region src/conversation/conversation-transfer/export-conversation.ts
4
- var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) => {
4
+ var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) => e.map((e) => {
5
+ if (e.body?.source == null) return e;
6
+ let { source: t, ...n } = e.body;
7
+ return {
8
+ ...e,
9
+ body: n
10
+ };
11
+ }), a = (e) => {
5
12
  let t = e.custom_content;
6
13
  if (!t) return e;
7
- let { attachments: n, stages: i, ...a } = t;
8
- if (n == null && i == null) return e;
9
- let o = {
10
- ...a,
11
- ...i ? { stages: r(i) } : {}
14
+ let { attachments: n, stages: a, annotations: o, ...s } = t;
15
+ if (n == null && a == null && o == null) return e;
16
+ let c = {
17
+ ...s,
18
+ ...a ? { stages: r(a) } : {},
19
+ ...o ? { annotations: i(o) } : {}
12
20
  };
13
- if (Object.keys(o).length > 0) return {
21
+ if (Object.keys(c).length > 0) return {
14
22
  ...e,
15
- custom_content: o
23
+ custom_content: c
16
24
  };
17
- let { custom_content: s, ...c } = e;
18
- return c;
19
- }, a = (e) => ({
25
+ let { custom_content: l, ...u } = e;
26
+ return u;
27
+ }, o = (e) => ({
20
28
  ...e,
21
- messages: e.messages.map(i)
22
- }), o = (e, t = []) => ({
29
+ messages: e.messages.map(a)
30
+ }), s = (e, t = []) => ({
23
31
  version: 5,
24
32
  history: e,
25
33
  folders: t
26
- }), s = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), c = {
34
+ }), c = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), l = {
27
35
  [t.SingleConversation]: "json",
28
36
  [t.SingleConversationWithAttachments]: "dial",
29
37
  [t.AllConversationsHistory]: "json"
30
- }, l = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${c[t]}`;
38
+ }, u = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${l[t]}`;
31
39
  //#endregion
32
- export { n as EXPORT_APP_NAME, o as buildExportEnvelope, l as buildExportFileName, s as serializeExportEnvelope, a as stripConversationAttachments };
40
+ export { n as EXPORT_APP_NAME, s as buildExportEnvelope, u as buildExportFileName, c as serializeExportEnvelope, o as stripConversationAttachments };
@@ -1,57 +1,57 @@
1
1
  import { collectAttachmentRefs as e, splitFileIdAnchor as t } from "./attachment-refs.js";
2
2
  import { resolveDialFileBucketAndPath as n } from "./dial-file-resolve.js";
3
- import { generateUUID as r, sanitizeConversationName as i, stripTrailingDots as a, truncateToUtf8Bytes as o } from "@epam/ai-dial-chat-shared";
3
+ import { PUBLIC_BUCKET as r, generateUUID as i, sanitizeConversationName as a, stripTrailingDots as o, truncateToUtf8Bytes as s } from "@epam/ai-dial-chat-shared";
4
4
  //#region src/conversation/conversation-transfer/import-conversation.ts
5
- var s = class extends Error {
5
+ var c = class extends Error {
6
6
  constructor(e) {
7
7
  super(e), this.name = "UnsupportedImportFormatError";
8
8
  }
9
- }, c = (e) => typeof e == "object" && !!e, l = 5, u = (e) => {
9
+ }, l = (e) => typeof e == "object" && !!e, u = 5, d = (e) => {
10
10
  let t;
11
11
  try {
12
12
  t = JSON.parse(e);
13
13
  } catch {
14
- throw new s("Import file is not valid JSON");
14
+ throw new c("Import file is not valid JSON");
15
15
  }
16
- if (!c(t) || t.version !== l || !Array.isArray(t.history)) throw new s("Import file is not a supported export format");
16
+ if (!l(t) || t.version !== u || !Array.isArray(t.history)) throw new c("Import file is not a supported export format");
17
17
  let n = Array.isArray(t.folders) ? t.folders : [];
18
18
  return {
19
- version: l,
19
+ version: u,
20
20
  history: t.history,
21
21
  folders: n
22
22
  };
23
- }, d = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, f = "__", p = 255, m = "applications", h = /[-+]/, g = /^\d+$/, _ = (e) => e ? e.split(h)[0].split(".").every((e) => g.test(e)) : !1, v = (e) => a(o(e.replace(/\r\n|\r/g, "\n").split("\n").map((e) => i(e).trim()).filter(Boolean)[0] ?? "", p)).trimEnd(), y = (e, t, n) => {
24
- let i = e.split(f);
25
- if (i.length < 2) return [e, r()].join(f);
26
- let a = n && _(i[1]) ? i.slice(0, 2) : i.slice(0, 1), o = a.length > 1 ? d.test(i[i.length - 1]) : i.length >= 3, s = i.slice(a.length, o ? -1 : void 0).join(f);
23
+ }, f = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, p = "__", m = 255, h = "applications", g = /[-+]/, _ = /^\d+$/, v = (e) => e ? e.split(g)[0].split(".").every((e) => _.test(e)) : !1, y = (e) => o(s(e.replace(/\r\n|\r/g, "\n").split("\n").map((e) => a(e).trim()).filter(Boolean)[0] ?? "", m)).trimEnd(), b = (e, t, n) => {
24
+ let r = e.split(p);
25
+ if (r.length < 2) return [e, i()].join(p);
26
+ let a = n && v(r[1]) ? r.slice(0, 2) : r.slice(0, 1), o = a.length > 1 ? f.test(r[r.length - 1]) : r.length >= 3, s = r.slice(a.length, o ? -1 : void 0).join(p);
27
27
  return [
28
28
  ...a,
29
29
  t || s,
30
- r()
31
- ].join(f);
32
- }, b = "conversations/", x = (e) => e.startsWith(b) ? e.slice(14) : e, S = (e, t) => {
33
- let n = x(e.id), r = n.split("/"), i = x(e.folderId), a = r[0], o = i.startsWith(`${a}/`) ? i.slice(a.length + 1).split("/").filter(Boolean) : [], s = r.slice(1).slice(o.length), c = s.slice(0, -1), l = s.at(-1) ?? r.at(-1) ?? n, u = [...o, ...c], d = v(e.name), f = y(l, d, u[0] === m), p = [...u, f].join("/"), h = o.length ? `${t}/${o.join("/")}` : t;
30
+ i()
31
+ ].join(p);
32
+ }, x = "conversations/", S = (e) => e.startsWith(x) ? e.slice(14) : e, C = (e, t) => {
33
+ let n = S(e.id), r = n.split("/"), i = S(e.folderId), a = r[0], o = i.startsWith(`${a}/`) ? i.slice(a.length + 1).split("/").filter(Boolean) : [], s = r.slice(1).slice(o.length), c = s.slice(0, -1), l = s.at(-1) ?? r.at(-1) ?? n, u = [...o, ...c], d = y(e.name), f = b(l, d, u[0] === h), p = [...u, f].join("/"), m = o.length ? `${t}/${o.join("/")}` : t;
34
34
  return {
35
35
  conversation: {
36
36
  ...e,
37
37
  ...d ? { name: d } : {},
38
38
  id: `${t}/${p}`,
39
- folderId: h
39
+ folderId: m
40
40
  },
41
41
  subPath: p
42
42
  };
43
- }, C = (e) => {
44
- let t = x(e.folderId).split("/").filter(Boolean).slice(1);
43
+ }, w = (e) => {
44
+ let t = S(e.folderId).split("/").filter(Boolean).slice(1);
45
45
  return t.length ? t.join(" / ") : void 0;
46
- }, w = (e) => e.map((e) => `"${e}"`).join(", "), T = (e, n) => {
46
+ }, T = (e) => e.map((e) => `"${e}"`).join(", "), E = (e, n) => {
47
47
  if (!e) return;
48
48
  let { fileId: r, anchor: i } = t(e), a = n.get(r);
49
49
  if (a != null) return {
50
50
  ...a,
51
51
  url: `${a.url}${i}`
52
52
  };
53
- }, E = (e, t) => {
54
- let n = T(e.url, t), r = T(e.reference_url, t);
53
+ }, D = (e, t) => {
54
+ let n = E(e.url, t), r = E(e.reference_url, t);
55
55
  if (n == null && r == null) return;
56
56
  let i = n?.title ?? r?.title;
57
57
  return {
@@ -59,19 +59,19 @@ var s = class extends Error {
59
59
  ...r == null ? {} : { reference_url: r.url },
60
60
  ...i == null ? {} : { title: i }
61
61
  };
62
- }, D = (e, t) => e.map((e) => e.attachments?.length ? {
62
+ }, O = (e, t) => e.map((e) => e.attachments?.length ? {
63
63
  ...e,
64
64
  attachments: e.attachments.map((e) => {
65
- let n = E(e, t);
65
+ let n = D(e, t);
66
66
  return n ? {
67
67
  ...e,
68
68
  ...n
69
69
  } : e;
70
70
  })
71
- } : e), O = (e, t) => e.map((e) => {
71
+ } : e), k = (e, t) => e.map((e) => {
72
72
  let n = e.body?.source;
73
73
  if (n?.attachment == null) return e;
74
- let r = E(n.attachment, t);
74
+ let r = D(n.attachment, t);
75
75
  return r == null ? e : {
76
76
  ...e,
77
77
  body: {
@@ -85,7 +85,7 @@ var s = class extends Error {
85
85
  }
86
86
  }
87
87
  };
88
- }), k = (e, t) => ({
88
+ }), A = (e, t) => ({
89
89
  ...e,
90
90
  messages: e.messages.map((e) => {
91
91
  let n = e.custom_content;
@@ -96,23 +96,72 @@ var s = class extends Error {
96
96
  custom_content: {
97
97
  ...n,
98
98
  ...r?.length ? { attachments: r.map((e) => {
99
- let n = E(e, t);
99
+ let n = D(e, t);
100
100
  return n ? {
101
101
  ...e,
102
102
  ...n
103
103
  } : e;
104
104
  }) } : {},
105
- ...i?.length ? { stages: D(i, t) } : {},
106
- ...a?.length ? { annotations: O(a, t) } : {}
105
+ ...i?.length ? { stages: O(i, t) } : {},
106
+ ...a?.length ? { annotations: k(a, t) } : {}
107
107
  }
108
108
  };
109
109
  })
110
- }), A = (e) => e.split("/").pop() || e, j = (t, r, i) => {
110
+ }), j = (e, i) => {
111
+ if (!e) return;
112
+ let a = n(t(e).fileId);
113
+ if (!(!a || a.bucket === i || a.bucket === r)) return a.path.split("/").pop() || a.path;
114
+ }, M = (e, t, n) => e.flatMap((e) => {
115
+ let r = j(e.url, t);
116
+ if (r != null) return n.push(r), [];
117
+ let i = j(e.reference_url, t);
118
+ if (i == null) return [e];
119
+ n.push(i);
120
+ let { reference_url: a, reference_type: o, ...s } = e;
121
+ return s.url == null && s.data == null ? [] : [s];
122
+ }), N = (e, t, n) => e.map((e) => {
123
+ let r = e.body, i = j(r?.source?.attachment?.url, t);
124
+ if (r == null || i == null) return e;
125
+ n.push(i);
126
+ let { source: a, ...o } = r;
127
+ return {
128
+ ...e,
129
+ body: o
130
+ };
131
+ }), P = (e, t) => {
132
+ let n = [], r = e.messages.map((e) => {
133
+ let r = e.custom_content;
134
+ if (!r) return e;
135
+ let { attachments: i, stages: a, annotations: o } = r;
136
+ return !i?.length && !a?.length && !o?.length ? e : {
137
+ ...e,
138
+ custom_content: {
139
+ ...r,
140
+ ...i?.length ? { attachments: M(i, t, n) } : {},
141
+ ...a?.length ? { stages: a.map((e) => e.attachments?.length ? {
142
+ ...e,
143
+ attachments: M(e.attachments, t, n)
144
+ } : e) } : {},
145
+ ...o?.length ? { annotations: N(o, t, n) } : {}
146
+ }
147
+ };
148
+ });
149
+ return n.length ? {
150
+ conversation: {
151
+ ...e,
152
+ messages: r
153
+ },
154
+ droppedNames: n
155
+ } : {
156
+ conversation: e,
157
+ droppedNames: n
158
+ };
159
+ }, F = (e) => e.split("/").pop() || e, I = (t, r, i) => {
111
160
  let a = [], o = [];
112
161
  for (let s of e(t)) {
113
162
  let e = n(s.fileId);
114
163
  if (!e) {
115
- o.push(A(s.fileId));
164
+ o.push(F(s.fileId));
116
165
  continue;
117
166
  }
118
167
  let t = e.path.split("/").pop() ?? e.path, c = r.get(e.path);
@@ -133,4 +182,4 @@ var s = class extends Error {
133
182
  };
134
183
  };
135
184
  //#endregion
136
- export { s as UnsupportedImportFormatError, w as formatQuotedNameList, C as getFolderBreadcrumb, u as parseImportEnvelope, j as planAttachmentUploads, S as rebaseConversationId, k as rewriteAttachmentUrls };
185
+ export { c as UnsupportedImportFormatError, P as dropForeignAttachmentRefs, T as formatQuotedNameList, w as getFolderBreadcrumb, d as parseImportEnvelope, I as planAttachmentUploads, C as rebaseConversationId, A as rewriteAttachmentUrls };
@@ -171,12 +171,12 @@ var S = 5, C = 512 * 1024 * 1024, w = 429, T = 5, E = 2e3, D = (e) => e instance
171
171
  }, s);
172
172
  return I.startJob(c, (e) => R(c, t, i, o, s, e));
173
173
  }, [I, R]), B = b(async (e, t, n) => {
174
- let r = d.ExportAll, a = [], s;
174
+ let r = d.ExportAll, a = [], c;
175
175
  do {
176
176
  if (n.aborted) return;
177
177
  let t;
178
178
  try {
179
- t = await x.listConversations({ nextToken: s }, { signal: n });
179
+ t = await x.listConversations({ nextToken: c }, { signal: n });
180
180
  } catch (t) {
181
181
  if (n.aborted) return;
182
182
  if (E(t).isUnauthorized) F?.({
@@ -197,18 +197,18 @@ var S = 5, C = 512 * 1024 * 1024, w = 429, T = 5, E = 2e3, D = (e) => e instance
197
197
  a.push(...t.items.filter(j).map((e) => ({
198
198
  id: e.id,
199
199
  title: e.title
200
- }))), s = t.nextToken;
201
- } while (s);
200
+ }))), c = t.nextToken;
201
+ } while (c);
202
202
  I.setJobProgress(e, p({
203
203
  kind: r,
204
204
  phase: f.Prepare
205
205
  }));
206
- let c = [];
206
+ let l = [];
207
207
  for (let t of a) {
208
208
  if (n.aborted) return;
209
209
  try {
210
210
  let e = await A(x, T(t.id), n);
211
- c.push(e);
211
+ l.push(e);
212
212
  } catch (r) {
213
213
  if (n.aborted) return;
214
214
  let i = E(r);
@@ -240,17 +240,17 @@ var S = 5, C = 512 * 1024 * 1024, w = 429, T = 5, E = 2e3, D = (e) => e instance
240
240
  I.setJobProgress(e, p({
241
241
  kind: r,
242
242
  phase: f.Transfer,
243
- completed: c.length,
243
+ completed: l.length,
244
244
  total: a.length
245
245
  }, {
246
- completed: c.length,
246
+ completed: l.length,
247
247
  total: a.length,
248
248
  kind: v.Conversation
249
249
  }));
250
250
  }
251
251
  }
252
252
  if (!n.aborted) try {
253
- y(o(i(c, [])), t), k?.({ jobId: e }), I.succeedJob(e);
253
+ y(o(i(l.map(s), [])), t), k?.({ jobId: e }), I.succeedJob(e);
254
254
  } catch (t) {
255
255
  let n = M(t) ? g.FileTooLarge : g.Unknown, r = await D(t);
256
256
  F?.({