@epam/ai-dial-chat-hooks 1.1.0-dev.267 → 1.1.0-dev.268
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/files/dial-file-manager-copy-move.util.d.ts +15 -0
- package/files/dial-file-manager-copy-move.util.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts +35 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -0
- package/files/dial-file-manager-path.util.d.ts +39 -0
- package/files/dial-file-manager-path.util.d.ts.map +1 -0
- package/files/dial-file-manager.model.d.ts +26 -0
- package/files/dial-file-manager.model.d.ts.map +1 -0
- package/files/dial-file-manager.types.d.ts +320 -0
- package/files/dial-file-manager.types.d.ts.map +1 -0
- package/files/dial-files-api.d.ts +71 -0
- package/files/dial-files-api.d.ts.map +1 -0
- package/files/download-destination.d.ts +31 -0
- package/files/download-destination.d.ts.map +1 -0
- package/files/file-manager-variant.d.ts +22 -0
- package/files/file-manager-variant.d.ts.map +1 -0
- package/files/file-name.d.ts +19 -0
- package/files/file-name.d.ts.map +1 -0
- package/files/resolve-dial-file-api-path.d.ts +17 -0
- package/files/resolve-dial-file-api-path.d.ts.map +1 -0
- package/files/string-utils.d.ts +3 -0
- package/files/string-utils.d.ts.map +1 -0
- package/files/upload-batch.types.d.ts +22 -0
- package/files/upload-batch.types.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.d.ts +73 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -0
- package/files/useDialFileManager/useDialFileManager.d.ts +16 -0
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts +14 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.d.ts.map +1 -0
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts +28 -0
- package/files/useDialFileMetadata/useDialFileMetadata.d.ts.map +1 -0
- package/files/useDialFileMutations/useDialFileMutations.d.ts +68 -0
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -0
- package/files/useDialFileSharing/useDialFileSharing.d.ts +30 -0
- package/files/useDialFileSharing/useDialFileSharing.d.ts.map +1 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts +45 -0
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.d.ts.map +1 -0
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts +27 -0
- package/files/useGridEditingScroll/useGridEditingScroll.d.ts.map +1 -0
- package/index.d.ts +18 -0
- package/index.d.ts.map +1 -1
- package/index.js +1780 -406
- package/package.json +10 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CopyItemDto, MoveItemDto, RenameItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { DialCopiedItem } from '@epam/ai-dial-react-file-manager';
|
|
3
|
+
import { PreparedCopyMoveItem } from './dial-file-manager.model';
|
|
4
|
+
/** Builds the `copyFiles` DTOs (with their destination display name) for `onCopyFiles`. */
|
|
5
|
+
export declare const prepareCopyItems: (copiedItems: DialCopiedItem[], bucket: string, rootLabel: string) => PreparedCopyMoveItem<CopyItemDto>[];
|
|
6
|
+
/**
|
|
7
|
+
* Rename-vs-move disambiguation (design.md D3): entries whose parent folder
|
|
8
|
+
* is unchanged become `renameDtos`; entries whose parent folder changed
|
|
9
|
+
* become `preparedMoveItems`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const prepareMoveRenameItems: (copiedItems: DialCopiedItem[], bucket: string, rootLabel: string) => {
|
|
12
|
+
renameDtos: RenameItemDto[];
|
|
13
|
+
preparedMoveItems: PreparedCopyMoveItem<MoveItemDto>[];
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=dial-file-manager-copy-move.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-manager-copy-move.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-copy-move.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACd,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMtE,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,GAC3B,aAAa,cAAc,EAAE,EAC7B,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB,oBAAoB,CAAC,WAAW,CAAC,EAkChC,CAAC;AAaL;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAa,cAAc,EAAE,EAC7B,QAAQ,MAAM,EACd,WAAW,MAAM,KAChB;IACD,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,iBAAiB,EAAE,oBAAoB,CAAC,WAAW,CAAC,EAAE,CAAC;CAiExD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CreateFolderResponseDto, FileMetadataResponseDto, ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { DialFile, DialFileManagerTabs } from '@epam/ai-dial-react-file-manager';
|
|
3
|
+
import { PreparedCopyMoveItem, SharedRootMeta } from './dial-file-manager.model';
|
|
4
|
+
import { DialFilesApi } from './dial-files-api';
|
|
5
|
+
import { FileUploadBatchState, FileUploadEntry, FileUploadStatus } from './upload-batch.types';
|
|
6
|
+
export declare const mapCorePermissions: (permissions?: string[]) => DialFile["permissions"] | undefined;
|
|
7
|
+
export declare const findFirstSuccessfulCopyMoveItem: <TDto extends {
|
|
8
|
+
success?: boolean;
|
|
9
|
+
sourcePath?: string;
|
|
10
|
+
destinationPath?: string;
|
|
11
|
+
}>(items: PreparedCopyMoveItem<TDto>[], results: {
|
|
12
|
+
success?: boolean;
|
|
13
|
+
sourcePath?: string;
|
|
14
|
+
destinationPath?: string;
|
|
15
|
+
}[]) => PreparedCopyMoveItem<TDto> | undefined;
|
|
16
|
+
export declare const buildFromCache: (cache: Map<string, ListFilesItemDto[]>, listingPermissionsCache: Map<string, string[] | undefined>, apiPath: string, virtualBasePath: string, folderId: string) => DialFile[];
|
|
17
|
+
export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesItemDto[]>, parentApiPath: string, created: CreateFolderResponseDto, inheritedPermissions?: string[]) => Map<string, ListFilesItemDto[]>;
|
|
18
|
+
export declare const updateEntry: (prev: FileUploadBatchState | null, index: number, patch: FileUploadStatus | Partial<Pick<FileUploadEntry, "status" | "percent">>) => FileUploadBatchState | null;
|
|
19
|
+
export declare const fetchByTab: (filesApi: DialFilesApi, tab: DialFileManagerTabs, bucket: string, folderPath: string, sharedRootMeta: Map<string, SharedRootMeta>) => Promise<{
|
|
20
|
+
items: ListFilesItemDto[];
|
|
21
|
+
permissions?: string[];
|
|
22
|
+
}>;
|
|
23
|
+
export declare const fetchForSearch: (filesApi: DialFilesApi, tab: DialFileManagerTabs, bucket: string, folderPath: string, sharedRootMeta: Map<string, SharedRootMeta>) => Promise<{
|
|
24
|
+
items: ListFilesItemDto[];
|
|
25
|
+
}>;
|
|
26
|
+
export declare const mapSearchItem: (item: ListFilesItemDto, fallbackBucket: string, rootLabel: string) => DialFile;
|
|
27
|
+
/**
|
|
28
|
+
* Overlays a `FileMetadataResponseDto` response onto the clicked grid row so
|
|
29
|
+
* `fileMetadataPopupOptions.fileMetadata` receives a value structurally
|
|
30
|
+
* consistent with any other `DialFile` — the row already carries the correct
|
|
31
|
+
* virtual `path`/`id`/`name`/`nodeType`/`folderId`, while size/date/author/
|
|
32
|
+
* permissions are refreshed from the just-fetched server response.
|
|
33
|
+
*/
|
|
34
|
+
export declare const mapFileMetadataToDialFile: (metadata: FileMetadataResponseDto, original: DialFile) => DialFile;
|
|
35
|
+
//# sourceMappingURL=dial-file-manager-mapping.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources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,MAAM,EAAE,gBAAgB,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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DialFile } from '@epam/ai-dial-react-file-manager';
|
|
2
|
+
import { SharedRootMeta } from './dial-file-manager.model';
|
|
3
|
+
import { DialFileManagerActionProfile } from './file-manager-variant';
|
|
4
|
+
export declare const hasForbiddenNameSymbols: (name: string, forbiddenSymbolsRegExp?: RegExp) => boolean;
|
|
5
|
+
export declare const normalizeVirtualPath: (value: string) => string;
|
|
6
|
+
export declare const getVirtualPathName: (virtualPath: string, fallback: string) => string;
|
|
7
|
+
export declare const formatOperationFolderName: (destinationFolder: string, rootLabel: string) => string;
|
|
8
|
+
export declare const findFolderByVirtualPath: (nodes: DialFile[], virtualPath: string) => DialFile | undefined;
|
|
9
|
+
export declare const hasDialFileWritePermission: (folder?: DialFile) => boolean;
|
|
10
|
+
export declare const findDialFileByPath: (nodes: DialFile[], targetPath: string) => DialFile | undefined;
|
|
11
|
+
/** Copy/Move/Duplicate are Browse/Full-only — the attach picker excludes them. */
|
|
12
|
+
export declare const isCopyMoveDuplicateAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
13
|
+
/** Share/Unshare/Remove access are Full-only — Browse and Attach never expose them. */
|
|
14
|
+
export declare const isShareActionsAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
15
|
+
export declare const parseNewFolderVirtualPath: (newFolderVirtualPath: string, rootLabel: string) => {
|
|
16
|
+
parentVirtualPath: string;
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
/** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
|
|
20
|
+
export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Converts a bucket-relative path (e.g. "reports/q1.pdf") to the virtual
|
|
23
|
+
* DialFile.path format ("/My files/reports/q1.pdf") that ui-kit compares
|
|
24
|
+
* row items against for `sharedByMePaths`/`sharedWithMeIds` gating — the
|
|
25
|
+
* DIAL Core resource path ("files/{bucket}/...") is a different identifier
|
|
26
|
+
* space and never matches. Decodes each path segment independently, matching
|
|
27
|
+
* how buildFromCache derives virtual paths.
|
|
28
|
+
*/
|
|
29
|
+
export declare const buildSharedItemVirtualPath: (relativePath: string, rootLabel: string, isFolder: boolean) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves the effective bucket and path for a write operation on the Shared tab.
|
|
32
|
+
* For Shared tab items, the first segment of apiPath is the shared root folder name
|
|
33
|
+
* whose owner bucket is stored in sharedRootMeta.
|
|
34
|
+
*/
|
|
35
|
+
export declare const resolveOwnerCoords: (apiPath: string, sharedRootMeta: Map<string, SharedRootMeta>, fallbackBucket: string) => {
|
|
36
|
+
bucket: string;
|
|
37
|
+
path: string;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=dial-file-manager-path.util.d.ts.map
|
|
@@ -0,0 +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;AAKjE,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAGtE,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,EACZ,yBAAyB,MAAM,KAC9B,OAQF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,MAAM,KAAG,MAGpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,EACnB,UAAU,MAAM,KACf,MAGF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,mBAAmB,MAAM,EACzB,WAAW,MAAM,KAChB,MAIa,CAAC;AAEjB,eAAO,MAAM,uBAAuB,GAClC,OAAO,QAAQ,EAAE,EACjB,aAAa,MAAM,KAClB,QAAQ,GAAG,SASb,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,SAAS,QAAQ,KAAG,OACG,CAAC;AAEnE,eAAO,MAAM,kBAAkB,GAC7B,OAAO,QAAQ,EAAE,EACjB,YAAY,MAAM,KACjB,QAAQ,GAAG,SAOb,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,GACrC,eAAe,4BAA4B,KAC1C,OAYF,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,GAChC,eAAe,4BAA4B,KAC1C,OAA8D,CAAC;AAElE,eAAO,MAAM,yBAAyB,GACpC,sBAAsB,MAAM,EAC5B,WAAW,MAAM,KAChB;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAa3C,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,GACjC,cAAc,MAAM,EACpB,QAAQ,MAAM,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 { DialFilePermission, FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
2
|
+
/** Max number of files uploaded concurrently within a single upload batch. */
|
|
3
|
+
export declare const UPLOAD_CONCURRENCY = 3;
|
|
4
|
+
/** Name reserved for the hidden marker file used to create empty folders. */
|
|
5
|
+
export declare const RESERVED_MARKER_NAME = ".dial_folder";
|
|
6
|
+
export declare const PATH_SEPARATOR_REGEXP: RegExp;
|
|
7
|
+
export declare const DATE_OPTIONS: Intl.DateTimeFormatOptions;
|
|
8
|
+
export declare const COLUMNS_WITHOUT_AUTHOR: FileManagerColumnKey[];
|
|
9
|
+
export declare const COLUMNS_WITH_AUTHOR: FileManagerColumnKey[];
|
|
10
|
+
export declare const CORE_PERMISSION_MAP: Record<string, DialFilePermission>;
|
|
11
|
+
/** Owner-bucket resolution metadata for a Shared-tab root folder, keyed by its display name. */
|
|
12
|
+
export interface SharedRootMeta {
|
|
13
|
+
bucket: string;
|
|
14
|
+
/** DIAL Core URL of the shared root item, e.g. "files/owner-bucket/some-folder/" */
|
|
15
|
+
dialCorePath: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PreparedCopyMoveItem<TDto> {
|
|
18
|
+
dto: TDto;
|
|
19
|
+
destinationName: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CopyMoveResult {
|
|
22
|
+
success?: boolean;
|
|
23
|
+
sourcePath?: string;
|
|
24
|
+
destinationPath?: string;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=dial-file-manager.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-manager.model.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager.model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAE1C,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,6EAA6E;AAC7E,eAAO,MAAM,oBAAoB,iBAAc,CAAC;AAEhD,eAAO,MAAM,qBAAqB,QAAU,CAAC;AAE7C,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,qBAI/B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,oBAAoB,EAKxD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,oBAAoB,EAMrD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAIlE,CAAC;AAEF,gGAAgG;AAChG,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB,CAAC,IAAI;IACxC,GAAG,EAAE,IAAI,CAAC;IACV,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { DialCopiedItem, DialDeletedItem, DialFile, DialFileManagerActions, DialFileManagerTabs, DialUploadFileItem, FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
2
|
+
import { NotificationVariant } from '@epam/ai-dial-ui-kit';
|
|
3
|
+
import { DialFilesApi } from './dial-files-api';
|
|
4
|
+
import { DownloadDestinationHandlers } from './download-destination';
|
|
5
|
+
import { DialFileManagerActionProfile, DialFileManagerVariant } from './file-manager-variant';
|
|
6
|
+
import { FileUploadBatchState } from './upload-batch.types';
|
|
7
|
+
export interface FileUploadValidationResult {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
message?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Library-owned identifier for why a file-manager hook is surfacing an
|
|
13
|
+
* `onNotification` event, replacing a pre-translated toast message. The host
|
|
14
|
+
* maps each reason to its own translated string.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum FileManagerNotificationReason {
|
|
17
|
+
/** A folder listing fetch (initial load, expand, invalidate-refetch, or popup preload) failed. */
|
|
18
|
+
FolderLoadFailed = "folderLoadFailed",
|
|
19
|
+
/** A single-file/folder metadata fetch (`onGetInfo`) failed. */
|
|
20
|
+
MetadataLoadFailed = "metadataLoadFailed",
|
|
21
|
+
/** `onCreateFolder`'s `createFolder` call failed. */
|
|
22
|
+
FolderCreateFailed = "folderCreateFailed",
|
|
23
|
+
/** `onDownloadFiles` failed for a single file/folder selection. */
|
|
24
|
+
DownloadFileFailed = "downloadFileFailed",
|
|
25
|
+
/** `onDownloadFiles` failed for a multi-item selection. */
|
|
26
|
+
DownloadFilesFailed = "downloadFilesFailed",
|
|
27
|
+
/** `onDeleteFiles` deleted at least one item successfully; `count`/`name`/`folder` describe the result. */
|
|
28
|
+
FilesDeleted = "filesDeleted",
|
|
29
|
+
/** `onDeleteFiles` completed with at least one failure alongside a success; `names`/`restCount` list the failures. */
|
|
30
|
+
FilesDeletePartiallyFailed = "filesDeletePartiallyFailed",
|
|
31
|
+
/** `onDeleteFiles`'s `deleteFiles` request itself rejected. */
|
|
32
|
+
DeleteFailed = "deleteFailed",
|
|
33
|
+
/** `onMoveToFiles`'s rename branch failed for every item in the batch. */
|
|
34
|
+
RenameFailed = "renameFailed",
|
|
35
|
+
/** `onMoveToFiles`'s rename branch failed for some items; `count` is the failed count. */
|
|
36
|
+
RenamePartiallyFailed = "renamePartiallyFailed",
|
|
37
|
+
/** `onMoveToFiles`'s move branch failed for every item in the batch. */
|
|
38
|
+
MoveFailed = "moveFailed",
|
|
39
|
+
/** `onMoveToFiles`'s move branch failed for some items; `count` is the failed count. */
|
|
40
|
+
MovePartiallyFailed = "movePartiallyFailed",
|
|
41
|
+
/** `onCopyFiles` failed for every item in the batch. */
|
|
42
|
+
CopyFailed = "copyFailed",
|
|
43
|
+
/** `onCopyFiles` failed for some items; `count` is the failed count. */
|
|
44
|
+
CopyPartiallyFailed = "copyPartiallyFailed",
|
|
45
|
+
/** `useDialFileSharing`'s `onUnshareFiles` request failed. */
|
|
46
|
+
UnshareFailed = "unshareFailed",
|
|
47
|
+
/** `useDialFileSharing`'s `onRemoveFilesAccess` request failed. */
|
|
48
|
+
RemoveAccessFailed = "removeAccessFailed",
|
|
49
|
+
/** `useDialFileUploadBatch`'s plain-file batch had zero successful uploads. */
|
|
50
|
+
UploadFailed = "uploadFailed",
|
|
51
|
+
/** `useDialFileUploadBatch`'s plain-file batch completed (fully or partially successful). */
|
|
52
|
+
UploadCompleted = "uploadCompleted",
|
|
53
|
+
/** `onUploadArchive` extracted zero entries successfully; `names`/`restCount` list the failures. */
|
|
54
|
+
UploadArchiveFailed = "uploadArchiveFailed",
|
|
55
|
+
/** `onUploadArchive` extracted some entries successfully and some failed; `count`/`names`/`restCount` describe the failures. */
|
|
56
|
+
UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed",
|
|
57
|
+
/** `onUploadArchive`'s `uploadArchive` request itself rejected. */
|
|
58
|
+
UploadArchiveRequestFailed = "uploadArchiveRequestFailed"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Structured toast event emitted by file-manager hooks. `reason` carries a
|
|
62
|
+
* library-owned identifier the host translates; `message` is an optional
|
|
63
|
+
* pre-rendered fallback for notifications a hook composes without a `reason`
|
|
64
|
+
* (e.g. hosts still authoring their own text for hooks not yet covered by a
|
|
65
|
+
* `FileManagerNotificationReason` member). The remaining fields carry the
|
|
66
|
+
* data a host needs to interpolate its translated string for reasons whose
|
|
67
|
+
* wording depends on more than the reason itself.
|
|
68
|
+
*/
|
|
69
|
+
export interface FileManagerNotification {
|
|
70
|
+
variant: NotificationVariant;
|
|
71
|
+
title?: string;
|
|
72
|
+
message?: string;
|
|
73
|
+
reason?: FileManagerNotificationReason;
|
|
74
|
+
/** Number of items the notification covers (e.g. a partial-failure count). */
|
|
75
|
+
count?: number;
|
|
76
|
+
/** Name of the affected entity or first successfully affected item. */
|
|
77
|
+
name?: string;
|
|
78
|
+
/** Source or destination folder name the notification refers to. */
|
|
79
|
+
folder?: string;
|
|
80
|
+
/** Up to the first 5 names affected by a partial/full failure list (e.g. archive extraction, delete). */
|
|
81
|
+
names?: string[];
|
|
82
|
+
/** Count of additional affected items beyond `names`' limit. */
|
|
83
|
+
restCount?: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Reason a file/folder name failed `onCreateFolderValidate`/
|
|
87
|
+
* `onRenameValidate`'s validation, used as the discriminant of
|
|
88
|
+
* `FileNameValidationError`.
|
|
89
|
+
*/
|
|
90
|
+
export declare enum FileNameValidationErrorReason {
|
|
91
|
+
Empty = "empty",
|
|
92
|
+
ForbiddenSymbols = "forbiddenSymbols",
|
|
93
|
+
ReservedName = "reservedName",
|
|
94
|
+
TooLong = "tooLong",
|
|
95
|
+
DuplicateName = "duplicateName",
|
|
96
|
+
LeadingDot = "leadingDot"
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Discriminated validation failure returned by `onCreateFolderValidate`/
|
|
100
|
+
* `onRenameValidate` instead of a pre-translated message; `null` means the
|
|
101
|
+
* name is valid. The host maps each `reason` to its own translated string.
|
|
102
|
+
*/
|
|
103
|
+
export type FileNameValidationError = {
|
|
104
|
+
reason: FileNameValidationErrorReason.Empty;
|
|
105
|
+
} | {
|
|
106
|
+
reason: FileNameValidationErrorReason.ForbiddenSymbols;
|
|
107
|
+
symbols: string;
|
|
108
|
+
} | {
|
|
109
|
+
reason: FileNameValidationErrorReason.ReservedName;
|
|
110
|
+
} | {
|
|
111
|
+
reason: FileNameValidationErrorReason.TooLong;
|
|
112
|
+
maxLength: number;
|
|
113
|
+
} | {
|
|
114
|
+
reason: FileNameValidationErrorReason.DuplicateName;
|
|
115
|
+
existingName: string;
|
|
116
|
+
} | {
|
|
117
|
+
reason: FileNameValidationErrorReason.LeadingDot;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Kind of mutation `useDialFileMutations` just completed successfully, for
|
|
121
|
+
* `onOperationSuccess`. Delete has no member here — its success feedback
|
|
122
|
+
* stays a structured `onNotification` event since it needs a count/folder,
|
|
123
|
+
* not a single named entity.
|
|
124
|
+
*/
|
|
125
|
+
export declare enum FileOperationKind {
|
|
126
|
+
FolderCreated = "folderCreated",
|
|
127
|
+
FileRenamed = "fileRenamed",
|
|
128
|
+
FileDownloaded = "fileDownloaded",
|
|
129
|
+
FilesDownloaded = "filesDownloaded",
|
|
130
|
+
FileCopied = "fileCopied",
|
|
131
|
+
FilesCopied = "filesCopied",
|
|
132
|
+
FileMoved = "fileMoved",
|
|
133
|
+
FilesMoved = "filesMoved"
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Structured success event `useDialFileMutations` emits through
|
|
137
|
+
* `onOperationSuccess` instead of calling an application notification
|
|
138
|
+
* service directly.
|
|
139
|
+
*/
|
|
140
|
+
export interface FileOperationSuccessEvent {
|
|
141
|
+
/** Which mutation just succeeded. */
|
|
142
|
+
kind: FileOperationKind;
|
|
143
|
+
/** Name of the affected entity or first successfully affected item, when applicable. */
|
|
144
|
+
name?: string;
|
|
145
|
+
/** Number of items the operation covered, when applicable. */
|
|
146
|
+
count?: number;
|
|
147
|
+
/** Destination folder name, for copy/move operations. */
|
|
148
|
+
destinationFolderName?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Whether the affected item is a folder rather than a file. Only set for
|
|
151
|
+
* `fileRenamed`, since it is the only kind whose current wording depends
|
|
152
|
+
* on the item's node type (a rename toast reads "Folder renamed" vs.
|
|
153
|
+
* "File renamed").
|
|
154
|
+
*/
|
|
155
|
+
isFolder?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface UseDialFileManagerOptions {
|
|
158
|
+
/** Injected operation port used for every file-manager network call. */
|
|
159
|
+
filesApi: DialFilesApi;
|
|
160
|
+
/** DIAL Core bucket to browse (used only for my_files tab). */
|
|
161
|
+
bucket: string;
|
|
162
|
+
/** Display name for the root folder node. Defaults to `'My files'`. */
|
|
163
|
+
rootLabel?: string;
|
|
164
|
+
/** Active tab — drives listing source and per-tab options. Defaults to MyFiles. */
|
|
165
|
+
activeTab?: DialFileManagerTabs;
|
|
166
|
+
/** Called when a file-manager action should surface a toast notification. */
|
|
167
|
+
onNotification?: (notification: FileManagerNotification) => void;
|
|
168
|
+
/** Called when a mutation succeeds, instead of invoking an application notification service directly. */
|
|
169
|
+
onOperationSuccess?: (event: FileOperationSuccessEvent) => void;
|
|
170
|
+
/** Regexp of characters forbidden in file/folder names (e.g. NOT_ALLOWED_SYMBOLS_REGEXP). */
|
|
171
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
172
|
+
/** Which host is driving this hook instance. Defaults to `Attach`. */
|
|
173
|
+
variant?: DialFileManagerVariant;
|
|
174
|
+
/** Gates which actions are exposed. Defaults to the value derived from `variant`. */
|
|
175
|
+
actionProfile?: DialFileManagerActionProfile;
|
|
176
|
+
/**
|
|
177
|
+
* Host-supplied action label text, keyed by `DialFileManagerActions`. The
|
|
178
|
+
* hook computes which actions are visible/enabled per tab/variant/
|
|
179
|
+
* actionProfile and intersects that gating with this map — an action the
|
|
180
|
+
* gating allows but this map omits is left out of `actionLabels`.
|
|
181
|
+
*/
|
|
182
|
+
labels: Partial<Record<DialFileManagerActions, string>>;
|
|
183
|
+
/** BCP-47 locale string for date formatting, replacing `i18n.language`. */
|
|
184
|
+
locale: string;
|
|
185
|
+
/** Translated tooltip shown on the disabled New/Upload button. */
|
|
186
|
+
disabledNewButtonTooltip: string;
|
|
187
|
+
/** Host-injected browser "Save As"/auto-download seam for `onDownloadFiles`. */
|
|
188
|
+
downloadDestination: DownloadDestinationHandlers;
|
|
189
|
+
/**
|
|
190
|
+
* Builds a translated message from a structured validation-error reason,
|
|
191
|
+
* for `onCreateFolderValidate`/`onRenameValidate`. `item` is passed for a
|
|
192
|
+
* rename (so the host can distinguish file vs. folder wording) and
|
|
193
|
+
* omitted for folder creation.
|
|
194
|
+
*/
|
|
195
|
+
buildValidationErrorMessage: (error: FileNameValidationError, item?: DialFile) => string;
|
|
196
|
+
}
|
|
197
|
+
export interface UseDialFileManagerResult {
|
|
198
|
+
/** Hierarchical items for DialFileManager's `items` prop. */
|
|
199
|
+
items: DialFile[];
|
|
200
|
+
/** True while the current folder is loading. */
|
|
201
|
+
isLoading: boolean;
|
|
202
|
+
/** Non-null when the last fetch failed. */
|
|
203
|
+
error: string | null;
|
|
204
|
+
/** Current path in DialFileManager format (e.g. `"/My files"`, `"/My files/reports/"`). */
|
|
205
|
+
path: string;
|
|
206
|
+
/** Pass directly to DialFileManager's `onPathChange`. */
|
|
207
|
+
onPathChange: (nextPath?: string) => void;
|
|
208
|
+
/** Re-runs the fetch for the current `folderPath`. */
|
|
209
|
+
retry: () => void;
|
|
210
|
+
/**
|
|
211
|
+
* Search: called by DialFileManager when the user types in the search box.
|
|
212
|
+
* `folder` is accepted for API parity with DialFileManager but is intentionally
|
|
213
|
+
* unused — this hook always searches from the active-tab root stored in
|
|
214
|
+
* `folderPath`, not from the passed-in `folder` (see design decision D3).
|
|
215
|
+
*/
|
|
216
|
+
onSearchFiles: (folder: string, query: string) => void;
|
|
217
|
+
/** Search: true while a search request is in flight. */
|
|
218
|
+
isSearching: boolean;
|
|
219
|
+
/** Search: flat list of matching files, or null when search is not active. */
|
|
220
|
+
searchResults: DialFile[] | null;
|
|
221
|
+
/** Search: clears results and exits search mode. */
|
|
222
|
+
clearSearchResults: () => void;
|
|
223
|
+
/** Tree: controlled set of expanded folder virtual paths. */
|
|
224
|
+
expandedPaths: Set<string>;
|
|
225
|
+
/** Tree: virtual paths whose children are already in the cache (derived). */
|
|
226
|
+
loadedPaths: Set<string>;
|
|
227
|
+
/** Tree: called by DialFileManager when a folder is expanded/collapsed. */
|
|
228
|
+
onExpandedPathsChange: (paths: Set<string>) => void;
|
|
229
|
+
/** Destination folder popup: preloads the browsed folder without changing the outer grid path. */
|
|
230
|
+
onFolderPopupPathChange: (nextPath?: string) => void;
|
|
231
|
+
/** Destination folder popup: normalized virtual paths currently being preloaded. */
|
|
232
|
+
folderPopupLoadingPaths: Set<string>;
|
|
233
|
+
/** Upload: start a new batch. */
|
|
234
|
+
onUploadFiles: (files: DialUploadFileItem[], destinationFolder: string) => void;
|
|
235
|
+
/** Upload: extracts and uploads a ZIP archive's entries to the destination folder. */
|
|
236
|
+
onUploadArchive: (file: File, name: string, destinationFolder: string) => void;
|
|
237
|
+
/** Upload: validate file names before upload (called by DialFileManager). */
|
|
238
|
+
onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
|
|
239
|
+
/** Upload: current batch state (null when idle). */
|
|
240
|
+
uploadBatchState: FileUploadBatchState | null;
|
|
241
|
+
/** Upload: abort all in-flight and queued uploads. */
|
|
242
|
+
cancelUpload: () => void;
|
|
243
|
+
/** Upload: dismiss the progress modal after the batch has settled. */
|
|
244
|
+
clearUploadBatch: () => void;
|
|
245
|
+
/** Folder creation: called when user confirms a new folder name. */
|
|
246
|
+
onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
|
|
247
|
+
/** Folder creation: inline synchronous validation (returns error message or null). */
|
|
248
|
+
onCreateFolderValidate: (name: string, parentFolder: DialFile) => string | null;
|
|
249
|
+
/** True while a folder creation request is in flight. */
|
|
250
|
+
isCreatingFolder: boolean;
|
|
251
|
+
/** Download: called when user triggers download on one or more items. */
|
|
252
|
+
onDownloadFiles: (dialFiles: DialFile[]) => void;
|
|
253
|
+
/** True while a download is in progress. */
|
|
254
|
+
isDownloading: boolean;
|
|
255
|
+
/** Delete: called when user confirms deletion of one or more items. */
|
|
256
|
+
onDeleteFiles: (items: DialDeletedItem[], sourceFolder: string) => void;
|
|
257
|
+
/** True while a delete request is in flight. */
|
|
258
|
+
isDeleting: boolean;
|
|
259
|
+
/** Rename: inline validation — returns error string or null. */
|
|
260
|
+
onRenameValidate: (value: string, item: DialFile) => string | null;
|
|
261
|
+
/** Rename: called when user confirms an inline rename. Also dispatches cross-folder move (see D3). */
|
|
262
|
+
onMoveToFiles: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
|
|
263
|
+
/** True while a rename request is in flight. */
|
|
264
|
+
isRenaming: boolean;
|
|
265
|
+
/** Copy: called when user confirms a copy-paste. */
|
|
266
|
+
onCopyFiles: (items: DialCopiedItem[], destinationFolder: string) => void;
|
|
267
|
+
/** True while a copy request is in flight. */
|
|
268
|
+
isCopying: boolean;
|
|
269
|
+
/** True while the cross-folder-move branch of onMoveToFiles is in flight. */
|
|
270
|
+
isMoving: boolean;
|
|
271
|
+
/** Aborts whichever of copy/move is currently in flight. */
|
|
272
|
+
cancelCopyMove: () => void;
|
|
273
|
+
/** True when the current folder grants WRITE (upload + new folder). */
|
|
274
|
+
uploadEnabled: boolean;
|
|
275
|
+
/** True when Upload/New must be disabled. */
|
|
276
|
+
isNewButtonDisabled: boolean;
|
|
277
|
+
/** Tooltip for disabled New/Upload when `isNewButtonDisabled` is true. */
|
|
278
|
+
disabledNewButtonTooltip: string;
|
|
279
|
+
/** Columns to show in the grid — tab-dependent. */
|
|
280
|
+
visibleColumns: FileManagerColumnKey[];
|
|
281
|
+
/** BCP-47 locale string for date formatting, sourced from i18n.language. */
|
|
282
|
+
dateLocale: string;
|
|
283
|
+
/** Fixed date format options for the UpdatedAt column. */
|
|
284
|
+
dateOptions: Intl.DateTimeFormatOptions;
|
|
285
|
+
/** Action labels for grid/tree/bulk — Delete present only on my_files tab. */
|
|
286
|
+
actionLabels: Partial<Record<DialFileManagerActions, string>>;
|
|
287
|
+
/** Root-level shared item paths, populated only on the Shared tab. */
|
|
288
|
+
sharedWithMeIds: string[] | undefined;
|
|
289
|
+
/** Share: paths the user has shared with others, populated only on my_files tab. */
|
|
290
|
+
sharedByMePaths: Set<string>;
|
|
291
|
+
/** Unshare: called when user removes a shared-with-me item (Shared tab only). */
|
|
292
|
+
onUnshareFiles: (files: DialFile[]) => void;
|
|
293
|
+
/** True while an unshare request is in flight. */
|
|
294
|
+
isUnsharing: boolean;
|
|
295
|
+
/** Remove access: called when user revokes access to an owned shared item (my_files tab only). */
|
|
296
|
+
onRemoveFilesAccess: (files: DialFile[]) => void;
|
|
297
|
+
/** True while a remove-access request is in flight. */
|
|
298
|
+
isRemovingAccess: boolean;
|
|
299
|
+
/** Metadata: populated once onGetInfo resolves; passed to fileMetadataPopupOptions.fileMetadata. */
|
|
300
|
+
fileMetadata: DialFile | undefined;
|
|
301
|
+
/** True while a metadata request is in flight. */
|
|
302
|
+
isFileMetadataLoading: boolean;
|
|
303
|
+
/** Metadata: called by DialFileManager.onGetInfo to fetch and display a file's details. */
|
|
304
|
+
onGetInfo: (file: DialFile) => void;
|
|
305
|
+
/** Metadata: resets fileMetadata/isFileMetadataLoading; passed to fileMetadataPopupOptions.clearMetadata. */
|
|
306
|
+
clearMetadata: () => void;
|
|
307
|
+
/**
|
|
308
|
+
* True while any mutating file-manager operation is in flight: the OR of
|
|
309
|
+
* `isCreatingFolder`, `isDownloading`, `isDeleting`, `isRenaming`, `isCopying`,
|
|
310
|
+
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and `uploadBatchState != null`.
|
|
311
|
+
*
|
|
312
|
+
* Deliberately excludes three flags, each already fully contained by its own
|
|
313
|
+
* scoped loading UI:
|
|
314
|
+
* - `isLoading` — a read (listing fetch), not a mutation.
|
|
315
|
+
* - `isSearching` — scoped to ui-kit's own search-progress UI.
|
|
316
|
+
* - `isFileMetadataLoading` — has its own `loading` state in `fileMetadataPopupOptions`.
|
|
317
|
+
*/
|
|
318
|
+
isAnyOperationInProgress: boolean;
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=dial-file-manager.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-file-manager.types.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,E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,MAAM,CAAC;IAEjC,mDAAmD;IACnD,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACxC,8EAA8E;IAC9E,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9D,sEAAsE;IACtE,eAAe,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAEtC,oFAAoF;IACpF,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE7B,iFAAiF;IACjF,cAAc,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,kGAAkG;IAClG,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACjD,uDAAuD;IACvD,gBAAgB,EAAE,OAAO,CAAC;IAE1B,oGAAoG;IACpG,YAAY,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnC,kDAAkD;IAClD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,2FAA2F;IAC3F,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,6GAA6G;IAC7G,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ArchiveItemDto, CopyFilesResponseDto, CopyItemDto, CreateFolderDto, CreateFolderResponseDto, DeleteFilesResponseDto, DeleteItemDto, DiscardSharedItemDto, DiscardSharedResponseDto, FileMetadataResponseDto, FileUploadResponseDto, ListFilesResponseDto, ListPublicFilesRequest, ListSharedFilesRequest, MoveFilesResponseDto, MoveItemDto, RenameFilesResponseDto, RenameItemDto, RevokeAccessItemDto, RevokeAccessResponseDto, UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Upload mode passed through to `DialFilesApi.uploadFile` — mirrors the BFF's `uploadMode` form field. */
|
|
3
|
+
export declare enum DialFilesApiUploadMode {
|
|
4
|
+
Overwrite = "overwrite",
|
|
5
|
+
CreateOnly = "create-only"
|
|
6
|
+
}
|
|
7
|
+
/** Options accepted by `DialFilesApi.uploadFile` beyond an already-created `AbortSignal`. */
|
|
8
|
+
export interface DialFilesApiUploadOptions {
|
|
9
|
+
/** Aborts the in-flight upload when triggered. */
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
/** Called with the 0–100 upload progress percentage when the transport reports byte progress. */
|
|
12
|
+
onProgress?: (percent: number) => void;
|
|
13
|
+
/** Controls create-only vs. overwrite semantics for the destination path. */
|
|
14
|
+
uploadMode?: DialFilesApiUploadMode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Operation port every file-manager hook that performs network I/O accepts as
|
|
18
|
+
* a parameter, replacing direct `server-api/files.api` access. Mirrors
|
|
19
|
+
* `apps/chat/src/server-api/files.api.ts`'s exact function signatures — not
|
|
20
|
+
* the generated client's own method shapes — since that file wraps
|
|
21
|
+
* `uploadFile`/`uploadArchive` with custom XHR-based progress/cancellation
|
|
22
|
+
* that has no equivalent in the generated client.
|
|
23
|
+
*/
|
|
24
|
+
export interface DialFilesApi {
|
|
25
|
+
/** Lists files/folders directly under `params.path` within `params.bucket`. */
|
|
26
|
+
listFiles(params: {
|
|
27
|
+
bucket: string;
|
|
28
|
+
path?: string;
|
|
29
|
+
token?: string;
|
|
30
|
+
limit?: number;
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
permissions?: boolean;
|
|
33
|
+
}, signal?: AbortSignal): Promise<ListFilesResponseDto>;
|
|
34
|
+
/** Lists files/folders under the organization's public root. */
|
|
35
|
+
listPublicFiles(params: ListPublicFilesRequest): Promise<ListFilesResponseDto>;
|
|
36
|
+
/** Lists files/folders shared with the current user. */
|
|
37
|
+
listSharedFiles(params: ListSharedFilesRequest): Promise<ListFilesResponseDto>;
|
|
38
|
+
/** Lists items the current user has shared with others, from their own bucket. */
|
|
39
|
+
listSharedByMe(bucket: string): Promise<ListFilesResponseDto>;
|
|
40
|
+
/** Fetches metadata for a single file or folder. */
|
|
41
|
+
getFileMetadata(params: {
|
|
42
|
+
bucket: string;
|
|
43
|
+
path: string;
|
|
44
|
+
}): Promise<FileMetadataResponseDto>;
|
|
45
|
+
/**
|
|
46
|
+
* Uploads a file, reporting progress via `options.onProgress` when supplied
|
|
47
|
+
* and honoring cancellation via `options.signal` or a bare `AbortSignal`.
|
|
48
|
+
*/
|
|
49
|
+
uploadFile(bucket: string, path: string, file: File, options?: AbortSignal | DialFilesApiUploadOptions): Promise<FileUploadResponseDto>;
|
|
50
|
+
/** Uploads a ZIP archive and extracts its entries under `destinationPath`. */
|
|
51
|
+
uploadArchive(file: File, bucket: string, destinationPath: string): Promise<UploadArchiveResponseDto>;
|
|
52
|
+
/** Creates a new folder. */
|
|
53
|
+
createFolder(params: CreateFolderDto): Promise<CreateFolderResponseDto>;
|
|
54
|
+
/** Deletes one or more files/folders. */
|
|
55
|
+
deleteFiles(items: DeleteItemDto[]): Promise<DeleteFilesResponseDto>;
|
|
56
|
+
/** Renames one or more files/folders in place (same parent folder). */
|
|
57
|
+
renameFiles(items: RenameItemDto[]): Promise<RenameFilesResponseDto>;
|
|
58
|
+
/** Copies one or more files/folders to a destination path. */
|
|
59
|
+
copyFiles(items: CopyItemDto[], signal?: AbortSignal): Promise<CopyFilesResponseDto>;
|
|
60
|
+
/** Moves one or more files/folders to a destination path (different parent folder). */
|
|
61
|
+
moveFiles(items: MoveItemDto[], signal?: AbortSignal): Promise<MoveFilesResponseDto>;
|
|
62
|
+
/** Downloads a single file, returning the raw fetch `Response`. */
|
|
63
|
+
downloadFile(bucket: string, path: string, signal?: AbortSignal): Promise<Response>;
|
|
64
|
+
/** Downloads a ZIP archive of the given items, returning the raw fetch `Response`. */
|
|
65
|
+
downloadArchive(items: ArchiveItemDto[]): Promise<Response>;
|
|
66
|
+
/** Revokes access previously granted on the given owned items. */
|
|
67
|
+
revokeAccess(items: RevokeAccessItemDto[]): Promise<RevokeAccessResponseDto>;
|
|
68
|
+
/** Discards items shared with the current user. */
|
|
69
|
+
discardShared(items: DiscardSharedItemDto[]): Promise<DiscardSharedResponseDto>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=dial-files-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dial-files-api.d.ts","sourceRoot":"","sources":["../../src/files/dial-files-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,2GAA2G;AAC3G,oBAAY,sBAAsB;IAChC,SAAS,cAAc;IACvB,UAAU,gBAAgB;CAC3B;AAED,6FAA6F;AAC7F,MAAM,WAAW,yBAAyB;IACxC,kDAAkD;IAClD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iGAAiG;IACjG,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,SAAS,CACP,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;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8DAA8D;IAC9D,SAAS,CACP,KAAK,EAAE,WAAW,EAAE,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,uFAAuF;IACvF,SAAS,CACP,KAAK,EAAE,WAAW,EAAE,EACpB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,mEAAmE;IACnE,YAAY,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrB,sFAAsF;IACtF,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5D,kEAAkE;IAClE,YAAY,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC7E,mDAAmD;IACnD,aAAa,CACX,KAAK,EAAE,oBAAoB,EAAE,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a downloaded file's bytes should be written. Mirrors the host's own
|
|
3
|
+
* "Save As" vs. blob-download vs. cancelled-picker outcomes without the lib
|
|
4
|
+
* depending on the host's browser-API implementation.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DownloadDestinationType {
|
|
7
|
+
Blob = "blob",
|
|
8
|
+
Stream = "stream",
|
|
9
|
+
Cancelled = "cancelled"
|
|
10
|
+
}
|
|
11
|
+
/** Discriminated destination a host resolves for a download, passed back into `triggerDownload`. */
|
|
12
|
+
export type DownloadDestination = {
|
|
13
|
+
type: DownloadDestinationType.Blob;
|
|
14
|
+
} | {
|
|
15
|
+
type: DownloadDestinationType.Stream;
|
|
16
|
+
writable: WritableStream<Uint8Array>;
|
|
17
|
+
} | {
|
|
18
|
+
type: DownloadDestinationType.Cancelled;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Host-injected seam for `useDialFileMutations.onDownloadFiles`, replacing a
|
|
22
|
+
* direct import of the app's browser "Save As" / auto-download utilities —
|
|
23
|
+
* that behavior is desktop/web-shell-specific, not file-manager domain logic.
|
|
24
|
+
*/
|
|
25
|
+
export interface DownloadDestinationHandlers {
|
|
26
|
+
/** Resolves where a download with the given file name/MIME type should be written. */
|
|
27
|
+
resolveDestination(filename: string, mimeType: string): Promise<DownloadDestination>;
|
|
28
|
+
/** Writes `response` to `destination` and returns the name it was saved under. */
|
|
29
|
+
triggerDownload(response: Response, fallbackName: string, destination: DownloadDestination): Promise<string>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=download-destination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-destination.d.ts","sourceRoot":"","sources":["../../src/files/download-destination.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oGAAoG;AACpG,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,uBAAuB,CAAC,IAAI,CAAA;CAAE,GACtC;IACE,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;CACtC,GACD;IAAE,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAA;CAAE,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,sFAAsF;IACtF,kBAAkB,CAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,kFAAkF;IAClF,eAAe,CACb,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,mBAAmB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifies which host is driving `useDialFileManager` / `DialFileManagerShell`.
|
|
3
|
+
* `FolderPicker` is a reserved value with no implemented UI yet (#7503+).
|
|
4
|
+
*/
|
|
5
|
+
export declare enum DialFileManagerVariant {
|
|
6
|
+
Attach = "attach",
|
|
7
|
+
Standalone = "standalone",
|
|
8
|
+
FolderPicker = "folder-picker"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Gates which actions `useDialFileManager` exposes per tab. `Attach` excludes
|
|
12
|
+
* Copy/Move/Duplicate (it is a file picker, not a management surface); `Browse`
|
|
13
|
+
* exposes the full #7503 action set. `Full` is reserved for
|
|
14
|
+
* `DialFileManagerVariant.FolderPicker` (#7503+).
|
|
15
|
+
*/
|
|
16
|
+
export declare enum DialFileManagerActionProfile {
|
|
17
|
+
Attach = "attach",
|
|
18
|
+
Browse = "browse",
|
|
19
|
+
Full = "full"
|
|
20
|
+
}
|
|
21
|
+
export declare const deriveActionProfile: (variant: DialFileManagerVariant) => DialFileManagerActionProfile;
|
|
22
|
+
//# sourceMappingURL=file-manager-variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-manager-variant.d.ts","sourceRoot":"","sources":["../../src/files/file-manager-variant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,sBAAsB;IAChC,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,YAAY,kBAAkB;CAC/B;AAED;;;;;GAKG;AACH,oBAAY,4BAA4B;IACtC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,mBAAmB,GAC9B,SAAS,sBAAsB,KAC9B,4BASF,CAAC"}
|