@epam/ai-dial-chat-hooks 1.4.0-dev.5 → 1.4.0-dev.51
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 +4 -0
- package/catalog/publish-dependency-icons.d.ts +22 -0
- package/catalog/publish-dependency-icons.d.ts.map +1 -0
- package/catalog/publish-dependency-icons.js +11 -0
- package/catalog/publish.d.ts +13 -2
- package/catalog/publish.d.ts.map +1 -1
- package/catalog/publish.js +13 -2
- package/catalog/use-publish-dependencies.d.ts +19 -0
- package/catalog/use-publish-dependencies.d.ts.map +1 -0
- package/catalog/use-publish-dependencies.js +25 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +83 -84
- package/catalog.js +33 -31
- package/entry-points/catalog.d.ts +2 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/project.d.ts +5 -0
- package/entry-points/project.d.ts.map +1 -1
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -1
- package/index.js +221 -214
- package/package.json +18 -18
- package/project/project-sharing-client.d.ts +8 -0
- package/project/project-sharing-client.d.ts.map +1 -0
- package/project/project-sharing-client.js +11 -0
- package/project/project-sharing.d.ts +28 -0
- package/project/project-sharing.d.ts.map +1 -0
- package/project/project-sharing.js +22 -0
- package/project/use-pinned-project-chats.d.ts +4 -2
- package/project/use-pinned-project-chats.d.ts.map +1 -1
- package/project/use-pinned-project-chats.js +152 -96
- package/project/use-project-conversations.d.ts.map +1 -1
- package/project/use-project-conversations.js +2 -2
- package/project/use-project-remove-from-list.d.ts +30 -0
- package/project/use-project-remove-from-list.d.ts.map +1 -0
- package/project/use-project-remove-from-list.js +39 -0
- package/project/use-project-revoke-access.d.ts +15 -0
- package/project/use-project-revoke-access.d.ts.map +1 -0
- package/project/use-project-revoke-access.js +32 -0
- package/project/use-project-share-recipients.d.ts +7 -0
- package/project/use-project-share-recipients.d.ts.map +1 -0
- package/project/use-project-share-recipients.js +36 -0
- package/project/use-projects.d.ts +1 -0
- package/project/use-projects.d.ts.map +1 -1
- package/project/use-projects.js +2 -1
- package/project.js +7 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { getApiErrorDetails as e } from "../api-error/api-error.js";
|
|
2
|
+
import { useCallback as t, useRef as n, useState as r } from "react";
|
|
3
|
+
//#region src/project/use-project-remove-from-list.ts
|
|
4
|
+
var i = (i, { discardShared: a, setPinned: o, onUnpinFailed: s, onRemoved: c, onError: l, onSettled: u }) => {
|
|
5
|
+
let [d, f] = r(!1), p = n(!1);
|
|
6
|
+
return {
|
|
7
|
+
isRemoving: d,
|
|
8
|
+
confirmRemove: t(async () => {
|
|
9
|
+
if (i == null || p.current) return;
|
|
10
|
+
p.current = !0, f(!0);
|
|
11
|
+
let t = () => {
|
|
12
|
+
p.current = !1, f(!1), u?.();
|
|
13
|
+
};
|
|
14
|
+
try {
|
|
15
|
+
await a(i.id);
|
|
16
|
+
} catch (n) {
|
|
17
|
+
let { traceId: r } = await e(n);
|
|
18
|
+
l(i, r), t();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
await o(i.id, !1);
|
|
23
|
+
} catch {
|
|
24
|
+
s?.(i);
|
|
25
|
+
}
|
|
26
|
+
t(), c(i);
|
|
27
|
+
}, [
|
|
28
|
+
i,
|
|
29
|
+
a,
|
|
30
|
+
o,
|
|
31
|
+
s,
|
|
32
|
+
c,
|
|
33
|
+
l,
|
|
34
|
+
u
|
|
35
|
+
])
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { i as useProjectRemoveFromList };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProjectDetailsDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { ProjectSharingClient } from './project-sharing-client';
|
|
3
|
+
/** Host notifications and dialog lifecycle for a project revoke. */
|
|
4
|
+
export interface ProjectRevokeAccessHandlers {
|
|
5
|
+
/** Called after successful revoke; the host may notify and close the dialog. */
|
|
6
|
+
onRevoked: (project: ProjectDetailsDto) => void;
|
|
7
|
+
/** Called on failure with the request trace id when available. */
|
|
8
|
+
onError: (project: ProjectDetailsDto, requestId?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Revokes recipients' access while keeping the owner's project, pins and route. */
|
|
11
|
+
export declare const useProjectRevokeAccess: (client: ProjectSharingClient, project: ProjectDetailsDto | null, { onRevoked, onError }: ProjectRevokeAccessHandlers) => {
|
|
12
|
+
isRevoking: boolean;
|
|
13
|
+
confirmRevoke: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=use-project-revoke-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-project-revoke-access.d.ts","sourceRoot":"","sources":["../../src/project/use-project-revoke-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,oEAAoE;AACpE,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,SAAS,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAChD,kEAAkE;IAClE,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnE;AAED,oFAAoF;AACpF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,oBAAoB,EAC5B,SAAS,iBAAiB,GAAG,IAAI,EACjC,wBAAwB,2BAA2B;;;CAwBpD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getApiErrorDetails as e } from "../api-error/api-error.js";
|
|
2
|
+
import { notifyProjectAccessRevoked as t } from "./project-sharing-client.js";
|
|
3
|
+
import { useCallback as n, useRef as r, useState as i } from "react";
|
|
4
|
+
//#region src/project/use-project-revoke-access.ts
|
|
5
|
+
var a = (a, o, { onRevoked: s, onError: c }) => {
|
|
6
|
+
let [l, u] = i(!1), d = r(!1);
|
|
7
|
+
return {
|
|
8
|
+
isRevoking: l,
|
|
9
|
+
confirmRevoke: n(async () => {
|
|
10
|
+
if (o?.canManage && !d.current) {
|
|
11
|
+
d.current = !0, u(!0);
|
|
12
|
+
try {
|
|
13
|
+
await a.revokeSharedAccess({ revokeSharedAccessDto: { itemId: o.id } });
|
|
14
|
+
} catch (t) {
|
|
15
|
+
let { traceId: n } = await e(t);
|
|
16
|
+
c(o, n);
|
|
17
|
+
return;
|
|
18
|
+
} finally {
|
|
19
|
+
d.current = !1, u(!1);
|
|
20
|
+
}
|
|
21
|
+
t(a, o.id), s(o);
|
|
22
|
+
}
|
|
23
|
+
}, [
|
|
24
|
+
a,
|
|
25
|
+
o,
|
|
26
|
+
s,
|
|
27
|
+
c
|
|
28
|
+
])
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as useProjectRevokeAccess };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProjectSharingClient } from './project-sharing-client';
|
|
2
|
+
/** Reads current recipient counts on menu open; a successful revoke immediately clears both surfaces. */
|
|
3
|
+
export declare const useProjectShareRecipients: (client: ProjectSharingClient) => {
|
|
4
|
+
requestRecipients: (projectId: string) => void;
|
|
5
|
+
canRevokeAccess: (projectId: string) => boolean;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=use-project-share-recipients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-project-share-recipients.d.ts","sourceRoot":"","sources":["../../src/project/use-project-share-recipients.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE,yGAAyG;AACzG,eAAO,MAAM,yBAAyB,GAAI,QAAQ,oBAAoB;mCAoBtD,MAAM;iCAwBN,MAAM;CAKrB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { subscribeProjectAccessRevoked as e } from "./project-sharing-client.js";
|
|
2
|
+
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
+
//#region src/project/use-project-share-recipients.ts
|
|
4
|
+
var a = (a) => {
|
|
5
|
+
let [o, s] = i({}), c = r(/* @__PURE__ */ new Map());
|
|
6
|
+
return n(() => {
|
|
7
|
+
s({});
|
|
8
|
+
let t = c.current, n = e(a, (e) => {
|
|
9
|
+
t.delete(e), s((t) => ({
|
|
10
|
+
...t,
|
|
11
|
+
[e]: 0
|
|
12
|
+
}));
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
n(), t.clear();
|
|
16
|
+
};
|
|
17
|
+
}, [a]), {
|
|
18
|
+
requestRecipients: t((e) => {
|
|
19
|
+
if (c.current.has(e)) return;
|
|
20
|
+
let t = {};
|
|
21
|
+
c.current.set(e, t), (async () => {
|
|
22
|
+
let n;
|
|
23
|
+
try {
|
|
24
|
+
n = (await a.getShareRecipientsCount({ itemId: e })).recipientsCount;
|
|
25
|
+
} catch {}
|
|
26
|
+
c.current.get(e) === t && (c.current.delete(e), s((t) => ({
|
|
27
|
+
...t,
|
|
28
|
+
[e]: n
|
|
29
|
+
})));
|
|
30
|
+
})();
|
|
31
|
+
}, [a]),
|
|
32
|
+
canRevokeAccess: t((e) => (o[e] ?? 0) > 0, [o])
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as useProjectShareRecipients };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-projects.d.ts","sourceRoot":"","sources":["../../src/project/use-projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAoC/D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,eAAe,CAAC,EACjE,SAAS,OAAO
|
|
1
|
+
{"version":3,"file":"use-projects.d.ts","sourceRoot":"","sources":["../../src/project/use-projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAoC/D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,eAAe,CAAC,EACjE,SAAS,OAAO;;;;;;;CAoGjB,CAAC"}
|
package/project/use-projects.js
CHANGED
package/project.js
CHANGED
|
@@ -16,5 +16,10 @@ import { useProjectConversations as z } from "./project/use-project-conversation
|
|
|
16
16
|
import { PINNED_PROJECT_CHATS_LIMIT as B, usePinnedProjectChats as V } from "./project/use-pinned-project-chats.js";
|
|
17
17
|
import { useProjectArtifacts as H } from "./project/use-project-artifacts.js";
|
|
18
18
|
import { ProjectActionError as U, useProjectActions as W } from "./project/use-project-actions.js";
|
|
19
|
-
import {
|
|
20
|
-
|
|
19
|
+
import { PinnedProjectMenuAction as G, getPinnedProjectMenuActions as K, isProjectSharedWithMe as q } from "./project/project-sharing.js";
|
|
20
|
+
import { useProjectRemoveFromList as J } from "./project/use-project-remove-from-list.js";
|
|
21
|
+
import { createSerializedKeyedWriter as Y } from "./shared/serialized-writer.js";
|
|
22
|
+
import { notifyProjectAccessRevoked as X } from "./project/project-sharing-client.js";
|
|
23
|
+
import { useProjectShareRecipients as Z } from "./project/use-project-share-recipients.js";
|
|
24
|
+
import { useProjectRevokeAccess as Q } from "./project/use-project-revoke-access.js";
|
|
25
|
+
export { l as DEFAULT_PROJECT_CONTEXT_ALLOWED_EXTENSIONS, u as DEFAULT_PROJECT_CONTEXT_FILE_MAX_BYTES, d as DEFAULT_PROJECT_CONTEXT_TOTAL_MAX_BYTES, B as PINNED_PROJECT_CHATS_LIMIT, G as PinnedProjectMenuAction, U as ProjectActionError, k as ProjectChatCreateFailure, D as ProjectDraftMode, h as ProjectFormErrorField, g as ProjectFormErrorReason, P as ProjectRefreshOutcome, e as buildCreateConversationDto, A as classifyProjectChatCreateError, j as createProjectChat, M as createProjectConversationDataSource, t as createProjectsApiClient, Y as createSerializedKeyedWriter, v as downloadProjectFileAttachment, y as fromProjectOutputCardId, b as fromProjectPreviewKey, f as getMimeTypesForExtensions, K as getPinnedProjectMenuActions, _ as getProjectFormError, q as isProjectSharedWithMe, r as mapProjectArtifactsToOutputs, i as mapProjectDetailsToViewModel, a as mapProjectDtoToItem, o as mapProjectSource, s as mapProjectSourceToFilterTab, c as mapStoredContextFiles, X as notifyProjectAccessRevoked, p as resolveByteLimit, m as resolveExtensionList, n as splitProjectConversationId, x as toProjectContextFileAttachment, S as toProjectOutputAttachment, C as toProjectOutputCardId, w as toProjectPreviewKey, T as toStoredProjectFileAttachment, L as useCreateProject, V as usePinnedProjectChats, F as useProject, W as useProjectActions, H as useProjectArtifacts, z as useProjectConversations, O as useProjectDraft, E as useProjectFilePreview, J as useProjectRemoveFromList, Q as useProjectRevokeAccess, Z as useProjectShareRecipients, I as useProjectWatch, N as useProjects, R as useSaveProject };
|