@epam/ai-dial-chat-hooks 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-error/api-error.d.ts +18 -0
- package/api-error/api-error.d.ts.map +1 -0
- package/api-transport/create-csrf-middleware.d.ts +15 -0
- package/api-transport/create-csrf-middleware.d.ts.map +1 -0
- package/api-transport/create-unauthorized-middleware.d.ts +40 -0
- package/api-transport/create-unauthorized-middleware.d.ts.map +1 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -2
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +1 -1
- package/catalog/deployment-endpoint-url.d.ts +19 -0
- package/catalog/deployment-endpoint-url.d.ts.map +1 -0
- package/catalog/deployment-id.d.ts +21 -0
- package/catalog/deployment-id.d.ts.map +1 -0
- package/catalog/entity-details.d.ts +132 -0
- package/catalog/entity-details.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts +33 -0
- package/catalog/map-deployment-limits-to-catalog.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.d.ts +15 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-to-catalog-item.d.ts +60 -0
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-entity-details-to-catalog.d.ts +23 -0
- package/catalog/map-entity-details-to-catalog.d.ts.map +1 -0
- package/catalog/map-prompt-to-catalog-item.d.ts +45 -0
- package/catalog/map-prompt-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-skill-to-catalog-item.d.ts +87 -0
- package/catalog/map-skill-to-catalog-item.d.ts.map +1 -0
- package/catalog/mcp-endpoint-url.d.ts +18 -0
- package/catalog/mcp-endpoint-url.d.ts.map +1 -0
- package/catalog/publish.d.ts +17 -0
- package/catalog/publish.d.ts.map +1 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +37 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +28 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -1
- package/conversation/conversation-transfer/queue.d.ts +1 -1
- package/conversation/conversation-transfer/queue.d.ts.map +1 -1
- package/conversation/conversation-transfer/types.d.ts +0 -27
- package/conversation/conversation-transfer/types.d.ts.map +1 -1
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +39 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts.map +1 -0
- package/conversation/display-name-watch.d.ts +4 -0
- package/conversation/display-name-watch.d.ts.map +1 -0
- package/conversation/footer-message.d.ts +10 -0
- package/conversation/footer-message.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.d.ts +27 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/greeting.d.ts +18 -0
- package/conversation/greeting.d.ts.map +1 -0
- package/conversation/message-factory.d.ts +7 -0
- package/conversation/message-factory.d.ts.map +1 -0
- package/conversation/message-utils.d.ts +27 -0
- package/conversation/message-utils.d.ts.map +1 -0
- package/conversation/overlay-messages.d.ts +5 -0
- package/conversation/overlay-messages.d.ts.map +1 -0
- package/conversation/quick-app-conversation-starters.d.ts +10 -0
- package/conversation/quick-app-conversation-starters.d.ts.map +1 -0
- package/conversation/starter-option.d.ts +21 -0
- package/conversation/starter-option.d.ts.map +1 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts +34 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +37 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +1 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +2 -1
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +1 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +2 -1
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +58 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- package/conversation/useConversationStream/conversation-path.d.ts +0 -2
- package/conversation/useConversationStream/conversation-path.d.ts.map +1 -1
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts +32 -0
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +1 -0
- package/files/annotation.d.ts +10 -0
- package/files/annotation.d.ts.map +1 -0
- package/files/attachment-canvas.d.ts +90 -0
- package/files/attachment-canvas.d.ts.map +1 -0
- package/files/attachment-dto-to-display.d.ts +10 -0
- package/files/attachment-dto-to-display.d.ts.map +1 -0
- package/files/attachment-types.d.ts +14 -0
- package/files/attachment-types.d.ts.map +1 -0
- package/files/create-files-api.d.ts +52 -0
- package/files/create-files-api.d.ts.map +1 -0
- package/files/create-upload-file-with-progress.d.ts +24 -0
- package/files/create-upload-file-with-progress.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
- package/files/dial-file-manager-path.util.d.ts.map +1 -1
- package/files/dial-file-to-attachment.d.ts +26 -0
- package/files/dial-file-to-attachment.d.ts.map +1 -0
- package/files/dial-file.d.ts +17 -0
- package/files/dial-file.d.ts.map +1 -0
- package/files/file-path.d.ts +3 -0
- package/files/file-path.d.ts.map +1 -0
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/index.d.ts +77 -1
- package/index.d.ts.map +1 -1
- package/index.js +17482 -1867
- package/oauth/authorize-url.d.ts +16 -0
- package/oauth/authorize-url.d.ts.map +1 -0
- package/oauth/handshake.d.ts +30 -0
- package/oauth/handshake.d.ts.map +1 -0
- package/oauth/models.d.ts +74 -0
- package/oauth/models.d.ts.map +1 -0
- package/oauth/popup.d.ts +30 -0
- package/oauth/popup.d.ts.map +1 -0
- package/oauth/toolset-id.d.ts +23 -0
- package/oauth/toolset-id.d.ts.map +1 -0
- package/oauth/types.d.ts +84 -0
- package/oauth/types.d.ts.map +1 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +54 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +1 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +72 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- package/package.json +20 -8
- package/prompt/export-prompt.d.ts +31 -0
- package/prompt/export-prompt.d.ts.map +1 -0
- package/prompt/prompt-resource.d.ts +31 -0
- package/prompt/prompt-resource.d.ts.map +1 -0
- package/prompt/prompt.d.ts +34 -0
- package/prompt/prompt.d.ts.map +1 -0
- package/prompt/usePromptsState/usePromptsState.d.ts +34 -0
- package/prompt/usePromptsState/usePromptsState.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-mapping.d.ts +19 -0
- package/scheduled-task/scheduled-task-mapping.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-trigger.d.ts +27 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -0
- package/shared/application-schema.d.ts +10 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/browser-timezone.d.ts +7 -0
- package/shared/browser-timezone.d.ts.map +1 -0
- package/shared/cron-weekday.d.ts +5 -0
- package/shared/cron-weekday.d.ts.map +1 -0
- package/shared/custom-apps.d.ts +7 -0
- package/shared/custom-apps.d.ts.map +1 -0
- package/shared/external-services.d.ts +16 -0
- package/shared/external-services.d.ts.map +1 -0
- package/shared/formatting.d.ts +5 -0
- package/shared/formatting.d.ts.map +1 -0
- package/shared/locale.d.ts +45 -0
- package/shared/locale.d.ts.map +1 -0
- package/shared/string-utils.d.ts +9 -0
- package/shared/string-utils.d.ts.map +1 -0
- package/shared/toolset-login-events.d.ts +15 -0
- package/shared/toolset-login-events.d.ts.map +1 -0
- package/skill/skill-file-batch-validation.d.ts +70 -0
- package/skill/skill-file-batch-validation.d.ts.map +1 -0
- package/skill/skill-file-preview.d.ts +25 -0
- package/skill/skill-file-preview.d.ts.map +1 -0
- package/skill/skill-manifest.d.ts +28 -0
- package/skill/skill-manifest.d.ts.map +1 -0
- package/skill/skill-types.d.ts +42 -0
- package/skill/skill-types.d.ts.map +1 -0
- package/skill/skill.d.ts +114 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/useSkillEditorLoad.d.ts +74 -0
- package/skill/useSkillEditorLoad.d.ts.map +1 -0
- package/skill/useSkillEditorSubmit.d.ts +105 -0
- package/skill/useSkillEditorSubmit.d.ts.map +1 -0
- package/skill/useSkillFileActions.d.ts +53 -0
- package/skill/useSkillFileActions.d.ts.map +1 -0
- package/skill/useSkillsState/useSkillsState.d.ts +35 -0
- package/skill/useSkillsState/useSkillsState.d.ts.map +1 -0
- package/usage/useUsageData/useUsageData.d.ts +20 -0
- package/usage/useUsageData/useUsageData.d.ts.map +1 -0
- package/useToolsMenu/useToolsMenu.d.ts +7 -16
- package/useToolsMenu/useToolsMenu.d.ts.map +1 -1
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConversationListItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Parameters for `useConversationLookupMaps`. */
|
|
3
|
+
export interface UseConversationLookupMapsParams {
|
|
4
|
+
/** Raw conversation list from the API. */
|
|
5
|
+
items: ConversationListItemDto[];
|
|
6
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
7
|
+
toPanelConversationId: (id: string) => string;
|
|
8
|
+
}
|
|
9
|
+
/** Stable reverse-lookup maps returned by `useConversationLookupMaps`. */
|
|
10
|
+
export interface ConversationLookupMaps {
|
|
11
|
+
/** Returns the raw context id for a panel-space conversation id, or `undefined` when not found. */
|
|
12
|
+
toContextId: (panelId: string) => string | undefined;
|
|
13
|
+
/** Returns the raw `ConversationListItemDto` for a panel-space conversation id, or `undefined` when not found. */
|
|
14
|
+
getRawItem: (panelId: string) => ConversationListItemDto | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Builds two memoised reverse-lookup maps from the raw conversation list:
|
|
18
|
+
* panel-space id → context id and panel-space id → raw DTO.
|
|
19
|
+
*
|
|
20
|
+
* Replaces the inlined `panelToContextId` map and `items.find` calls that
|
|
21
|
+
* previously appeared at each row-action call site in `ConversationPanelView`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const useConversationLookupMaps: ({ items, toPanelConversationId, }: UseConversationLookupMapsParams) => ConversationLookupMaps;
|
|
24
|
+
//# sourceMappingURL=useConversationLookupMaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversationLookupMaps.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationLookupMaps/useConversationLookupMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAG7E,kDAAkD;AAClD,MAAM,WAAW,+BAA+B;IAC9C,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,mGAAmG;IACnG,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACrD,kHAAkH;IAClH,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,CAAC;CACtE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,mCAGvC,+BAA+B,KAAG,sBAaD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ConversationListItemDto, DeploymentItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { FilterTab } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/**
|
|
4
|
+
* Classifies a conversation's ownership using the shared filter-tab contract.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getConversationSource: (item: Pick<ConversationListItemDto, "sharedWithMe" | "publishedWithMe">) => FilterTab;
|
|
7
|
+
/** Resolver callbacks injected by the host app into `useConversationPanelItems`. */
|
|
8
|
+
export interface UseConversationPanelItemsResolvers {
|
|
9
|
+
/** Converts a raw conversation id to the panel-space id. App-specific. */
|
|
10
|
+
toPanelConversationId: (id: string) => string;
|
|
11
|
+
/** Resolves the icon URL for a deployment. Returns `undefined` when not available. */
|
|
12
|
+
resolveIconUrl: (deployment: DeploymentItemDto | undefined) => string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the icon tooltip text. Receives the matched deployment (or
|
|
15
|
+
* `undefined`) and a decoded fallback string derived from the model path.
|
|
16
|
+
*/
|
|
17
|
+
resolveIconTooltip: (deployment: DeploymentItemDto | undefined, fallback: string) => string | undefined;
|
|
18
|
+
/** Resolves the href to navigate to when the conversation row is clicked. */
|
|
19
|
+
resolveHref: (panelConversationId: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns badge metadata for a scheduled-task conversation, or `undefined`
|
|
22
|
+
* when the item should not show a task badge.
|
|
23
|
+
*/
|
|
24
|
+
resolveTaskBadge?: (item: ConversationListItemDto) => {
|
|
25
|
+
label: string;
|
|
26
|
+
isUnread: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
}
|
|
29
|
+
/** Parameters accepted by `useConversationPanelItems`. */
|
|
30
|
+
export interface UseConversationPanelItemsParams extends UseConversationPanelItemsResolvers {
|
|
31
|
+
/** Raw conversation list from the API. */
|
|
32
|
+
items: ConversationListItemDto[];
|
|
33
|
+
/** Available deployments used to resolve icons and tooltips. */
|
|
34
|
+
deployments: DeploymentItemDto[];
|
|
35
|
+
/** Whether the deployments list is still loading (drives `isIconLoading`). */
|
|
36
|
+
isDeploymentsLoading: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Maps raw `ConversationListItemDto[]` to panel-compatible conversation items.
|
|
40
|
+
*
|
|
41
|
+
* Returns a memoised array whose shape is compatible with the conversation
|
|
42
|
+
* panel's item contract. All app-specific concerns (icon URL resolution,
|
|
43
|
+
* route generation, id normalisation) are injected via resolver callbacks.
|
|
44
|
+
*/
|
|
45
|
+
export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskBadge, }: UseConversationPanelItemsParams) => {
|
|
46
|
+
showTaskBadge?: boolean | undefined;
|
|
47
|
+
taskBadgeLabel?: string | undefined;
|
|
48
|
+
isUnread?: boolean | undefined;
|
|
49
|
+
id: string;
|
|
50
|
+
title: string;
|
|
51
|
+
isPinned: boolean;
|
|
52
|
+
iconUrl: string | undefined;
|
|
53
|
+
iconTooltip: string | undefined;
|
|
54
|
+
isIconLoading: boolean;
|
|
55
|
+
source: FilterTab;
|
|
56
|
+
href: string;
|
|
57
|
+
}[];
|
|
58
|
+
//# sourceMappingURL=useConversationPanelItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConversationPanelItems.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationPanelItems/useConversationPanelItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,IAAI,CAAC,uBAAuB,EAAE,cAAc,GAAG,iBAAiB,CAAC,KACtE,SAIF,CAAC;AAEF,oFAAoF;AACpF,MAAM,WAAW,kCAAkC;IACjD,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,sFAAsF;IACtF,cAAc,EAAE,CACd,UAAU,EAAE,iBAAiB,GAAG,SAAS,KACtC,MAAM,GAAG,SAAS,CAAC;IACxB;;;OAGG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,iBAAiB,GAAG,SAAS,EACzC,QAAQ,EAAE,MAAM,KACb,MAAM,GAAG,SAAS,CAAC;IACxB,6EAA6E;IAC7E,WAAW,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,uBAAuB,KAC1B;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACvD;AAED,0DAA0D;AAC1D,MAAM,WAAW,+BAAgC,SAAQ,kCAAkC;IACzF,0CAA0C;IAC1C,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,gEAAgE;IAChE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,yIASvC,+BAA+B;;;;;;;;;;;;GAkD/B,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** Decodes a percent-encoded path segment, leaving it unchanged if decoding fails. */
|
|
2
|
-
export declare const safeDecodeURI: (path: string) => string;
|
|
3
1
|
/**
|
|
4
2
|
* Strips the leading bucket segment from a conversation id and decodes any
|
|
5
3
|
* already-percent-encoded remainder back to raw, so callers that re-encode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-path.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/conversation-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conversation-path.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/conversation-path.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,gBAAgB,MAAM,KAAG,MAO5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAcf,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;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ePickerParams {
|
|
4
|
+
/**
|
|
5
|
+
* MIME types / file-extension filter string passed to the hidden input's
|
|
6
|
+
* `accept` attribute. The host resolves any platform-specific policy before
|
|
7
|
+
* passing this value.
|
|
8
|
+
*/
|
|
9
|
+
accept?: string;
|
|
10
|
+
/** Called with the selected `File` after the user confirms their choice. */
|
|
11
|
+
onFileSelected: (file: File) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Controls returned by `useImportFilePicker`. */
|
|
14
|
+
export interface UseImportFilePickerResult {
|
|
15
|
+
/** Ref to attach to the hidden `<input type="file">` element. */
|
|
16
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
17
|
+
/** Programmatically opens the native file picker by clicking the hidden input. */
|
|
18
|
+
triggerImport: () => void;
|
|
19
|
+
/** `onChange` handler for the hidden input; calls `onFileSelected` and resets the value. */
|
|
20
|
+
handleFileChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Manages the hidden `<input type="file">` pattern used to trigger a native
|
|
24
|
+
* file-picker without a visible control.
|
|
25
|
+
*
|
|
26
|
+
* The host renders `<input ref={inputRef} type="file" onChange={handleFileChange} />`
|
|
27
|
+
* and calls `triggerImport()` when the user initiates an import action. The
|
|
28
|
+
* hook sets the `accept` attribute via a layout effect so re-selecting the
|
|
29
|
+
* same file always fires `onChange` (the value is reset after each selection).
|
|
30
|
+
*/
|
|
31
|
+
export declare const useImportFilePicker: ({ accept, onFileSelected, }: UseImportFilePickerParams) => UseImportFilePickerResult;
|
|
32
|
+
//# sourceMappingURL=useImportFilePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useImportFilePicker.d.ts","sourceRoot":"","sources":["../../../src/conversation/useImportFilePicker/useImportFilePicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,4CAA4C;AAC5C,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACtC;AAED,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACxC,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,kFAAkF;IAClF,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,4FAA4F;IAC5F,gBAAgB,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAClE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,GAAI,6BAGjC,yBAAyB,KAAG,yBA6B9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AttachmentResource } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { ResolveDownloadUrl } from '../attachment/useAttachmentAction/useAttachmentAction';
|
|
3
|
+
/**
|
|
4
|
+
* Opens a cited/referenced attachment: triggers a browser download for
|
|
5
|
+
* DIAL-hosted files (`files/...` ids) via the injected `resolveDownloadUrl`,
|
|
6
|
+
* otherwise opens the URL in a new tab. No-ops when the attachment has no
|
|
7
|
+
* URL or the download URL cannot be resolved.
|
|
8
|
+
*/
|
|
9
|
+
export declare const openAnnotationAttachment: (attachment: AttachmentResource, resolveDownloadUrl: ResolveDownloadUrl) => void;
|
|
10
|
+
//# sourceMappingURL=annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.d.ts","sourceRoot":"","sources":["../../src/files/annotation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAGhG;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,kBAAkB,EAC9B,oBAAoB,kBAAkB,KACrC,IAeF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CodeCanvasContent, ErrorCanvasContent, HtmlCanvasContent, ImageCanvasContent, JsonCanvasContent, MarkdownCanvasContent, OoxmlCanvasContent, OoxmlFileType, PdfCanvasContent, PlainTextCanvasContent, VisualizerCanvasContent } from '../../../attachment-canvas/src/index.ts';
|
|
2
|
+
import { Annotation, AttachmentResource, CustomVisualizer, DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { AnnotationGroup } from '@epam/ai-dial-quotations';
|
|
4
|
+
/**
|
|
5
|
+
* DIAL-file URL resolution injected by the host into every attachment-canvas
|
|
6
|
+
* content resolver below. Host-owned — encodes the app's own
|
|
7
|
+
* file-download endpoint.
|
|
8
|
+
*/
|
|
9
|
+
export interface AttachmentCanvasUrlResolvers {
|
|
10
|
+
/** Resolves a DIAL Core file id to a downloadable URL. */
|
|
11
|
+
resolveDialFileDownloadUrl: (fileId: string) => string | undefined;
|
|
12
|
+
/** Resolves the best downloadable DIAL-file URL from an attachment's `url` or `referenceUrl`. */
|
|
13
|
+
resolveDialUrl: (attachment: DisplayAttachment) => string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns the last path segment of `url` — its file name — for both absolute
|
|
17
|
+
* URLs and DIAL-relative resource paths such as
|
|
18
|
+
* `files/<bucket>/qa-routed-source.html`. Any query string or hash is dropped
|
|
19
|
+
* and percent escapes are decoded. Returns an empty string when no segment can
|
|
20
|
+
* be extracted. Used to classify a resource by extension when its display name
|
|
21
|
+
* is a citation title rather than a file name.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getUrlFileName: (url: string) => string;
|
|
24
|
+
/** Returns true when an external (non-DIAL) source URL should be opened in the canvas rather than a new browser tab. */
|
|
25
|
+
export declare const isExternalSourcePreviewable: (contentType: string, url: string) => boolean;
|
|
26
|
+
/** Clears all cached fetch results. Call this when leaving a conversation. */
|
|
27
|
+
export declare const clearAttachmentCache: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the attachment carries text `resolveAttachmentText` can resolve —
|
|
30
|
+
* inline data, a DIAL download URL, or a locally-picked file. Mirrors that
|
|
31
|
+
* function's source list, so a `null` resolver result can be read as "the text
|
|
32
|
+
* was fetched and rejected" rather than "there was no text to fetch".
|
|
33
|
+
*/
|
|
34
|
+
export declare const hasAttachmentTextSource: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves an image canvas content payload from a DisplayAttachment without
|
|
37
|
+
* fetching — returns the BFF download URL (or a local/inline blob URL)
|
|
38
|
+
* directly so the browser cache can be shared with the conversation view's
|
|
39
|
+
* `<img>` element. Error detection is delegated to `<img onError>` in the
|
|
40
|
+
* canvas renderer. Returns `null` if no URL source is available.
|
|
41
|
+
*/
|
|
42
|
+
export declare const resolveImageCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => ImageCanvasContent | null;
|
|
43
|
+
/** Resolves a plain-text canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
44
|
+
export declare const resolveTextCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<PlainTextCanvasContent | ErrorCanvasContent | null>;
|
|
45
|
+
/** Resolves a Markdown canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
46
|
+
export declare const resolveMarkdownCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<MarkdownCanvasContent | ErrorCanvasContent | null>;
|
|
47
|
+
/** Resolves a syntax-highlighted code canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
48
|
+
export declare const resolveCodeCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, language?: string) => Promise<CodeCanvasContent | ErrorCanvasContent | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
51
|
+
* Fetches and inlines the HTML as `srcdoc` when the attachment has a download URL or inline data.
|
|
52
|
+
* Returns `null` if no source is available, or an `ErrorCanvasContent` on fetch failure.
|
|
53
|
+
* Rejects `srcdoc` payloads larger than 1 MiB to prevent browser truncation.
|
|
54
|
+
*/
|
|
55
|
+
export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
58
|
+
* for all annotations in the same source group and scroll target for the clicked one.
|
|
59
|
+
* Returns `null` if the annotation has no PDF source attachment.
|
|
60
|
+
*/
|
|
61
|
+
export declare const annotationToPdfCanvasContent: (annotation: Annotation, groups: AnnotationGroup[], resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
62
|
+
/**
|
|
63
|
+
* Builds a `PdfCanvasContent` for a reference-only attachment whose
|
|
64
|
+
* `reference_url` points at a PDF file (optionally with a `#page=N`
|
|
65
|
+
* fragment), so it can be opened in the canvas and scrolled to the
|
|
66
|
+
* referenced page the same way a regular PDF citation is. Returns `null`
|
|
67
|
+
* when the attachment's `url` does not target a PDF.
|
|
68
|
+
*/
|
|
69
|
+
export declare const referenceAttachmentToPdfCanvasContent: (attachment: AttachmentResource, resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
70
|
+
/** Resolves a PDF canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
71
|
+
export declare const resolvePdfCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<PdfCanvasContent | ErrorCanvasContent | null>;
|
|
72
|
+
/** Resolves an OOXML canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
73
|
+
export declare const resolveOoxmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, format: OoxmlFileType) => Promise<OoxmlCanvasContent | ErrorCanvasContent | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Resolves a JSON canvas content payload from a DisplayAttachment, or `null` if unavailable.
|
|
76
|
+
* Falls back to `PlainTextCanvasContent` when the fetched text is not valid JSON.
|
|
77
|
+
*/
|
|
78
|
+
export declare const resolveJsonCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<JsonCanvasContent | PlainTextCanvasContent | ErrorCanvasContent | null>;
|
|
79
|
+
/**
|
|
80
|
+
* Fetches the attachment payload and builds a `VisualizerCanvasContent` for the
|
|
81
|
+
* given registry entry and theme. Returns `null` when the payload cannot be
|
|
82
|
+
* fetched (caller should fall through to default content-type handling).
|
|
83
|
+
*
|
|
84
|
+
* Only JSON payloads are parsed into `data`. Non-JSON payloads (plain text,
|
|
85
|
+
* CSV, binary, …) resolve with `data: {}` — the visualizer still receives
|
|
86
|
+
* `mimeType` and `layout`, just no payload body. This is intentional: only
|
|
87
|
+
* JSON attachment content is forwarded to visualizers in this version.
|
|
88
|
+
*/
|
|
89
|
+
export declare const resolveVisualizerCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, entry: CustomVisualizer, themeId: string) => Promise<VisualizerCanvasContent | null>;
|
|
90
|
+
//# sourceMappingURL=attachment-canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/files/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAClB,gBAAgB,EACh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,IAAI,CAKvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,KACtC,OAAO,CAAC,iBAAiB,GAAG,kBAAkB,GAAG,IAAI,CAOvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,YAAY,UAAU,EACtB,QAAQ,eAAe,EAAE,EACzB,WAAW,4BAA4B,KACtC,gBAAgB,GAAG,IAmBrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,GAChD,YAAY,kBAAkB,EAC9B,WAAW,4BAA4B,KACtC,gBAAgB,GAAG,IA0BrB,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,uBAAuB,GAClC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,KACtC,OAAO,CAAC,gBAAgB,GAAG,kBAAkB,GAAG,IAAI,CAOtD,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,yBAAyB,GACpC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,EACvC,QAAQ,aAAa,KACpB,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,GAAG,IAAI,CAKxD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,KACtC,OAAO,CACR,iBAAiB,GAAG,sBAAsB,GAAG,kBAAkB,GAAG,IAAI,CAYvE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,GACzC,YAAY,iBAAiB,EAC7B,WAAW,4BAA4B,EACvC,OAAO,gBAAgB,EACvB,SAAS,MAAM,KACd,OAAO,CAAC,uBAAuB,GAAG,IAAI,CA4BxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Annotation, AttachmentDisplayResolvers, DisplayAttachment, MessageAttachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Maps a message attachment payload to the display-only attachment model used by UI components.
|
|
4
|
+
*/
|
|
5
|
+
export declare const attachmentDtoToDisplayAttachment: (dto: MessageAttachment, resolvers: AttachmentDisplayResolvers) => DisplayAttachment;
|
|
6
|
+
/** Maps an annotation's source attachment to the display-only attachment model. */
|
|
7
|
+
export declare const annotationToDisplayAttachment: (annotation: Annotation) => DisplayAttachment | null;
|
|
8
|
+
/** Maps Chat API attachment DTOs to display-only attachment models. */
|
|
9
|
+
export declare const attachmentDtosToDisplayAttachments: (dtos: MessageAttachment[] | undefined, resolvers: AttachmentDisplayResolvers) => DisplayAttachment[];
|
|
10
|
+
//# sourceMappingURL=attachment-dto-to-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-dto-to-display.d.ts","sourceRoot":"","sources":["../../src/files/attachment-dto-to-display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAOnC;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,KAAK,iBAAiB,EACtB,WAAW,0BAA0B,KACpC,iBAAyE,CAAC;AAE7E,mFAAmF;AACnF,eAAO,MAAM,6BAA6B,GACxC,YAAY,UAAU,KACrB,iBAAiB,GAAG,IAatB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,kCAAkC,GAC7C,MAAM,iBAAiB,EAAE,GAAG,SAAS,EACrC,WAAW,0BAA0B,KACpC,iBAAiB,EACwD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DialFileAcceptType } from '@epam/ai-dial-react-file-manager';
|
|
2
|
+
/** Narrows a string to a `DialFileAcceptType` — a dotted extension or a MIME type/wildcard. */
|
|
3
|
+
export declare const isDialFileAcceptType: (type: string) => type is DialFileAcceptType;
|
|
4
|
+
/** Normalizes `*` to the all-files wildcard and drops any value that is not a valid `DialFileAcceptType`. */
|
|
5
|
+
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Builds an `<input accept>` string from resolved MIME types, filtering out
|
|
8
|
+
* any value `isDialFileAcceptType` rejects, or `undefined` when no types are
|
|
9
|
+
* given or any type accepts everything.
|
|
10
|
+
*/
|
|
11
|
+
export declare const mimeTypesToFileAccept: (types?: string[]) => string | undefined;
|
|
12
|
+
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
13
|
+
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
14
|
+
//# sourceMappingURL=attachment-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-types.d.ts","sourceRoot":"","sources":["../../src/files/attachment-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAK3E,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,KACX,IAAI,IAAI,kBAAgE,CAAC;AAE5E,6GAA6G;AAC7G,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EAAE,KACf,kBAAkB,EAAE,GAAG,SAQzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,EAAE,KAAG,MAAM,GAAG,SASjE,CAAC;AAEF,iIAAiI;AACjI,eAAO,MAAM,oCAAoC,GAAI,OAAO,MAAM,EAAE,KAAG,MAgBxD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ArchiveItemDto, CopyFilesResponseDto, CopyItemDto, CreateFolderDto, CreateFolderResponseDto, DeleteFilesResponseDto, DeleteItemDto, DiscardSharedItemDto, DiscardSharedResponseDto, FileMetadataResponseDto, FileUploadResponseDto, FilesApi, ListFilesResponseDto, ListPublicFilesRequest, ListSharedFilesRequest, MoveFilesResponseDto, MoveItemDto, RenameFilesResponseDto, RenameItemDto, RevokeAccessItemDto, RevokeAccessResponseDto, UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Upload mode passed to `FilesApi.uploadFile`: overwrite an existing file or fail if it already exists. */
|
|
3
|
+
export type UploadMode = 'overwrite' | 'create-only';
|
|
4
|
+
/** Options accepted by an {@link UploadFileWithProgressFn}. */
|
|
5
|
+
export interface UploadFileWithProgressOptions {
|
|
6
|
+
/** Aborts the upload in flight. */
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
/** Called with the upload's progress percentage (0–100). */
|
|
9
|
+
onProgress?: (percent: number) => void;
|
|
10
|
+
/** Defaults to the generated client's own default when omitted. */
|
|
11
|
+
uploadMode?: UploadMode;
|
|
12
|
+
}
|
|
13
|
+
/** Shape of a progress-reporting file upload function, e.g. the return value of `createUploadFileWithProgress`. */
|
|
14
|
+
export type UploadFileWithProgressFn = (bucket: string, path: string, file: File, options?: UploadFileWithProgressOptions) => Promise<FileUploadResponseDto>;
|
|
15
|
+
/** Options accepted by the returned `uploadFile`. */
|
|
16
|
+
export type UploadFileOptions = UploadFileWithProgressOptions;
|
|
17
|
+
/** The DIAL files API surface produced by {@link createFilesApiClient}. */
|
|
18
|
+
export interface FilesApiClient {
|
|
19
|
+
listPublicFiles: (params: ListPublicFilesRequest) => Promise<ListFilesResponseDto>;
|
|
20
|
+
listSharedFiles: (params: ListSharedFilesRequest) => Promise<ListFilesResponseDto>;
|
|
21
|
+
listFiles: (params: {
|
|
22
|
+
bucket: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
recursive?: boolean;
|
|
27
|
+
permissions?: boolean;
|
|
28
|
+
}, signal?: AbortSignal) => Promise<ListFilesResponseDto>;
|
|
29
|
+
uploadFile: (bucket: string, path: string, file: File, options?: AbortSignal | UploadFileOptions) => Promise<FileUploadResponseDto>;
|
|
30
|
+
uploadArchive: (file: File, bucket: string, destinationPath: string) => Promise<UploadArchiveResponseDto>;
|
|
31
|
+
getFileMetadata: (params: {
|
|
32
|
+
bucket: string;
|
|
33
|
+
path: string;
|
|
34
|
+
}) => Promise<FileMetadataResponseDto>;
|
|
35
|
+
downloadFile: (bucket: string, path: string, signal?: AbortSignal) => Promise<Response>;
|
|
36
|
+
createFolder: (params: CreateFolderDto) => Promise<CreateFolderResponseDto>;
|
|
37
|
+
deleteFiles: (items: DeleteItemDto[]) => Promise<DeleteFilesResponseDto>;
|
|
38
|
+
renameFiles: (items: RenameItemDto[]) => Promise<RenameFilesResponseDto>;
|
|
39
|
+
copyFiles: (items: CopyItemDto[], signal?: AbortSignal) => Promise<CopyFilesResponseDto>;
|
|
40
|
+
moveFiles: (items: MoveItemDto[], signal?: AbortSignal) => Promise<MoveFilesResponseDto>;
|
|
41
|
+
downloadArchive: (items: ArchiveItemDto[]) => Promise<Response>;
|
|
42
|
+
revokeAccess: (items: RevokeAccessItemDto[]) => Promise<RevokeAccessResponseDto>;
|
|
43
|
+
discardShared: (items: DiscardSharedItemDto[]) => Promise<DiscardSharedResponseDto>;
|
|
44
|
+
listSharedByMe: (bucket: string) => Promise<ListFilesResponseDto>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds the DIAL files API wrapper functions `apps/chat/src/server-api/files.api.ts`
|
|
48
|
+
* exposes today, delegating to an already-configured `FilesApi` instance and
|
|
49
|
+
* an injected progress-reporting upload function.
|
|
50
|
+
*/
|
|
51
|
+
export declare const createFilesApiClient: (filesApi: FilesApi, uploadFileWithProgress: UploadFileWithProgressFn) => FilesApiClient;
|
|
52
|
+
//# sourceMappingURL=create-files-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-files-api.d.ts","sourceRoot":"","sources":["../../src/files/create-files-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,uBAAuB,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AAC;IAChE,YAAY,EAAE,CACZ,KAAK,EAAE,mBAAmB,EAAE,KACzB,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,aAAa,EAAE,CACb,KAAK,EAAE,oBAAoB,EAAE,KAC1B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACnE;AAOD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,QAAQ,EAClB,wBAAwB,wBAAwB,KAC/C,cAgFD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UploadFileWithProgressFn } from './create-files-api';
|
|
2
|
+
/** Host capabilities {@link createUploadFileWithProgress} needs to perform an XHR upload. */
|
|
3
|
+
export interface CreateUploadFileWithProgressDeps {
|
|
4
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
5
|
+
getCsrfToken: () => string | null;
|
|
6
|
+
/** Stores a CSRF token captured from the upload response header. */
|
|
7
|
+
setCsrfToken: (token: string | null) => void;
|
|
8
|
+
/** Notifies the host that the upload request was unauthorized. */
|
|
9
|
+
notifyUnauthorized: (url: string) => void;
|
|
10
|
+
/** Constructs the error thrown to signal an unauthorized upload. */
|
|
11
|
+
createUnauthorizedError: (url: string) => Error;
|
|
12
|
+
/** The upload endpoint's URL. */
|
|
13
|
+
uploadUrl: string;
|
|
14
|
+
/** Builds the `XMLHttpRequest` instance to upload through. Defaults to `() => new XMLHttpRequest()`. */
|
|
15
|
+
xhrFactory?: () => XMLHttpRequest;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds a progress-reporting file-upload function backed by
|
|
19
|
+
* `XMLHttpRequest` (needed because the `fetch`-based generated client has no
|
|
20
|
+
* upload-progress event), reporting progress, honoring an `AbortSignal`,
|
|
21
|
+
* attaching/rotating a CSRF token, and reporting an unauthorized response.
|
|
22
|
+
*/
|
|
23
|
+
export declare const createUploadFileWithProgress: (deps: CreateUploadFileWithProgressDeps) => UploadFileWithProgressFn;
|
|
24
|
+
//# sourceMappingURL=create-upload-file-with-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-upload-file-with-progress.d.ts","sourceRoot":"","sources":["../../src/files/create-upload-file-with-progress.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EAEzB,MAAM,oBAAoB,CAAC;AAE5B,6FAA6F;AAC7F,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,oEAAoE;IACpE,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,kEAAkE;IAClE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,oEAAoE;IACpE,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,KAAK,CAAC;IAChD,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,cAAc,CAAC;CACnC;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,gCAAgC,KACrC,wBA8EF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-mapping.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file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BAAgB,EAAE,CAAC,EACtC,eAAe,MAAM,EACrB,SAAS,uBAAuB,EAChC,uBAAuB,MAAM,EAAE,KAC9B,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAwBhC,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,MAAM,oBAAoB,GAAG,IAAI,EACjC,OAAO,MAAM,EACb,OACI,gBAAgB,GAChB,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC,KACvD,oBAAoB,GAAG,IAOzB,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,UAAU,YAAY,EACtB,KAAK,mBAAmB,EACxB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,gBAAgB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,KAC1C,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA4C/D,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,UAAU,YAAY,EACtB,KAAK,mBAAmB,EACxB,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,gBAAgB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,KAC1C,OAAO,CAAC;IAAE,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAuCvC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,MAAM,gBAAgB,EACtB,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,QAiCF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,uBAAuB,EACjC,UAAU,QAAQ,KACjB,QAgBD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file-manager-path.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-path.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|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,KACb,MAKF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,GACrC,cAAc,MAAM,EACpB,WAAW,MAAM,EACjB,UAAU,OAAO,KAChB,MASF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,EACf,gBAAgB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EAC3C,gBAAgB,MAAM,KACrB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAahC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Attachment } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
import { DialFile } from '@epam/ai-dial-ui-kit';
|
|
3
|
+
/** Options for {@link dialFileToAttachment} and {@link dialFilesToAttachments}. */
|
|
4
|
+
export interface DialFileToAttachmentOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Resolves an image attachment's `previewUrl` from its DIAL resource URL.
|
|
7
|
+
* Left unset, image attachments get no `previewUrl`. The host owns bucket/
|
|
8
|
+
* icon-path REST construction — this hook never builds those URLs itself.
|
|
9
|
+
*/
|
|
10
|
+
resolvePreviewUrl?: (url: string) => string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Converts a selected ui-kit file into the generic attachment contract.
|
|
14
|
+
* DIAL storage identifiers are resolved at the app edge so the input library
|
|
15
|
+
* remains unaware of buckets, server routes, and external file systems.
|
|
16
|
+
*/
|
|
17
|
+
export declare const dialFileToAttachment: (file: DialFile, bucket: string, options?: DialFileToAttachmentOptions) => Attachment | null;
|
|
18
|
+
/** Maps a batch of selected DIAL files to attachments, dropping folders and unresolvable entries. */
|
|
19
|
+
export declare const dialFilesToAttachments: (files: DialFile[], bucket: string, options?: DialFileToAttachmentOptions) => Attachment[];
|
|
20
|
+
/**
|
|
21
|
+
* Converts a DIAL Core folder path (e.g. `files/{bucket}/{path}/`) into an
|
|
22
|
+
* attachment. DIAL Core resolves folder contents server-side when the path is
|
|
23
|
+
* sent as an attachment URL.
|
|
24
|
+
*/
|
|
25
|
+
export declare const dialFolderPathToAttachment: (folderPath: string) => Attachment;
|
|
26
|
+
//# sourceMappingURL=dial-file-to-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-to-attachment.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-to-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAkBvE,mFAAmF;AACnF,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,QAAQ,EACd,QAAQ,MAAM,EACd,UAAU,2BAA2B,KACpC,UAAU,GAAG,IAoBf,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,sBAAsB,GACjC,OAAO,QAAQ,EAAE,EACjB,QAAQ,MAAM,EACd,UAAU,2BAA2B,KACpC,UAAU,EAG4D,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,YAAY,MAAM,KAAG,UAa/D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** True when `url` looks like a DIAL Core file id (`files/{bucket}/{path}`). */
|
|
2
|
+
export declare const isDialFileId: (url: string) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Converts a DIAL file ID or full resource path to the relative bucket path
|
|
5
|
+
* expected by the files download API.
|
|
6
|
+
*/
|
|
7
|
+
export declare const resolveRelativeDialFilePath: (pathOrFileId: string, bucket: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Extracts the bucket and decoded relative path from a DIAL file ID
|
|
10
|
+
* (`files/{bucket}/{path}`). Returns `undefined` if the input does not start
|
|
11
|
+
* with `files/` or has no path segment after the bucket.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resolveDialFileBucketAndPath: (fileId: string) => {
|
|
14
|
+
bucket: string;
|
|
15
|
+
path: string;
|
|
16
|
+
} | undefined;
|
|
17
|
+
//# sourceMappingURL=dial-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file.d.ts","sourceRoot":"","sources":["../../src/files/dial-file.ts"],"names":[],"mappings":"AAEA,gFAAgF;AAChF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OAAmC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,cAAc,MAAM,EACpB,QAAQ,MAAM,KACb,MAmBF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,QAAQ,MAAM,KACb;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAcrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path.d.ts","sourceRoot":"","sources":["../../src/files/file-path.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,OACgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DownloadDestination } from './download-destination';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves where a download should be written: the browser's native "Save
|
|
4
|
+
* As" picker when available (`window.showSaveFilePicker`), otherwise a
|
|
5
|
+
* plain blob download. Returns `Cancelled` if the user dismisses the picker.
|
|
6
|
+
*/
|
|
7
|
+
export declare const prepareDownloadDestination: (filename: string, mimeType?: string) => Promise<DownloadDestination>;
|
|
8
|
+
//# sourceMappingURL=prepare-download-destination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-download-destination.d.ts","sourceRoot":"","sources":["../../src/files/prepare-download-destination.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,wBAAwB,CAAC;AAchC;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,UAAU,MAAM,EAChB,iBAAqC,KACpC,OAAO,CAAC,mBAAmB,CAkC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDialFileListing.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileListing/useDialFileListing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"useDialFileListing.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileListing/useDialFileListing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;AAkB1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,gDAAgD;AAChD,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,YAAY,CAAC;IACvB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,SAAS,EAAE,mBAAmB,CAAC;I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