@epam/ai-dial-chat-hooks 1.4.0-dev.122 → 1.4.0-dev.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog/create-publish-api.d.ts +7 -1
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +1 -0
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +22 -5
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +181 -125
- package/file-manager.js +33 -33
- package/files/dial-file.d.ts +6 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +17 -12
- package/index.js +262 -262
- package/org-units/org-unit-guards.d.ts +72 -1
- package/org-units/org-unit-guards.d.ts.map +1 -1
- package/org-units/org-unit-guards.js +53 -16
- package/org-units/useOrgUnits/useOrgUnits.d.ts +6 -4
- package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -1
- package/org-units/useOrgUnits/useOrgUnits.js +37 -35
- package/package.json +17 -17
- package/project/project-conversation-data-source.js +4 -4
- package/scheduled-task/scheduled-task-display.d.ts +47 -0
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +55 -39
- package/scheduled-task/scheduled-task-time-format.d.ts +5 -3
- package/scheduled-task/scheduled-task-time-format.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-time-format.js +3 -2
- package/scheduled-tasks.js +14 -14
- package/utils.js +18 -18
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CopyCatalogEntityToOrgUnitDto, PublishApi, PublishCatalogEntityDto, PublishHistoryEntryDto, PublishResultDto, PublishRuleDto, PublishTargetCheckDto, ResourceIdResponseDto, ResourceDependenciesResultDto, UnpublishAccessDto, UnpublishCatalogEntityDto, UnpublishResultDto, VersionStatusEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
1
|
+
import { ApplicationValuesDependenciesRequestDto, CopyCatalogEntityToOrgUnitDto, PublishApi, PublishCatalogEntityDto, PublishHistoryEntryDto, PublishResultDto, PublishRuleDto, PublishTargetCheckDto, ResourceIdResponseDto, ResourceDependenciesResultDto, UnpublishAccessDto, UnpublishCatalogEntityDto, UnpublishResultDto, VersionStatusEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
2
2
|
import { PublicationRule } from '@epam/ai-dial-publish-panel';
|
|
3
3
|
import { CatalogPublishEntityType } from './publish';
|
|
4
4
|
/**
|
|
@@ -31,6 +31,12 @@ export interface PublishApiClient {
|
|
|
31
31
|
* resolve them.
|
|
32
32
|
*/
|
|
33
33
|
getCatalogPublishDependencies: (entityType: CatalogPublishEntityType, entityId: string) => Promise<ResourceDependenciesResultDto>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the private dependencies of application property values that are not
|
|
36
|
+
* saved yet, from the values alone; the backend reads no application. Advisory
|
|
37
|
+
* like {@link PublishApiClient.getCatalogPublishDependencies}.
|
|
38
|
+
*/
|
|
39
|
+
getApplicationValuesPublishDependencies: (body: ApplicationValuesDependenciesRequestDto) => Promise<ResourceDependenciesResultDto>;
|
|
34
40
|
/** Reads whether the caller may request removal of one catalog entity. */
|
|
35
41
|
getCatalogUnpublishAccess: (entityType: CatalogPublishEntityType, entityId: string) => Promise<UnpublishAccessDto>;
|
|
36
42
|
/** Reads the publication status of every saved version of one application or toolset. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-publish-api.d.ts","sourceRoot":"","sources":["../../src/catalog/create-publish-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,e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E,MAAM,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACpE;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrC;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,UAAU,KACrB,
|
|
1
|
+
{"version":3,"file":"create-publish-api.d.ts","sourceRoot":"","sources":["../../src/catalog/create-publish-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,6BAA6B,EAC7B,UAAU,EACV,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,eAAe,KAAG,cAIvD,CAAC;AAEH,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,8EAA8E;IAC9E,oBAAoB,EAAE,CACpB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/B;;;;OAIG;IACH,0BAA0B,EAAE,CAC1B,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,6BAA6B,KAChC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC;;;;OAIG;IACH,sBAAsB,EAAE,CACtB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,yBAAyB,KAC5B,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,oEAAoE;IACpE,wBAAwB,EAAE,CACxB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACvC;;;;OAIG;IACH,6BAA6B,EAAE,CAC7B,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C;;;;OAIG;IACH,uCAAuC,EAAE,CACvC,IAAI,EAAE,uCAAuC,KAC1C,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,yBAAyB,EAAE,CACzB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjC,yFAAyF;IACzF,yBAAyB,EAAE,CACzB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IACtC,oEAAoE;IACpE,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACpE;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,UAAU,EAAE,wBAAwB,EACpC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACrC;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,UAAU,KACrB,gBA6CD,CAAC"}
|
|
@@ -27,6 +27,7 @@ var e = (e) => ({
|
|
|
27
27
|
entityType: t,
|
|
28
28
|
entityId: n
|
|
29
29
|
}),
|
|
30
|
+
getApplicationValuesPublishDependencies: (t) => e.getApplicationValuesPublishDependencies({ applicationValuesDependenciesRequestDto: t }),
|
|
30
31
|
getCatalogUnpublishAccess: (t, n) => e.getCatalogUnpublishAccess({
|
|
31
32
|
entityType: t,
|
|
32
33
|
entityId: n
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResourceFoldersResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
-
import {
|
|
2
|
+
import { OrgUnitNamespace } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { PublishDependency, PublishAccessRulesLabels, StandaloneSaveToFolderPanelProps } from '@epam/ai-dial-publish-panel';
|
|
3
4
|
import { PublishApiClient } from '../create-publish-api';
|
|
4
5
|
import { ResourceSaveVersionError, SaveDestinationRoot, ResourceSaveAdapter, ResourceSaveChoice, ResourceSaveResult } from '../resource-save';
|
|
5
6
|
import { UsePublishFoldersResult } from '../usePublishFolders/usePublishFolders';
|
|
@@ -37,11 +38,25 @@ export interface UseResourceSavePanelParams {
|
|
|
37
38
|
/** The Organization folder tree state; omit when the user may not publish, which hides that root. */
|
|
38
39
|
organizationFolders?: UsePublishFoldersResult;
|
|
39
40
|
/** Publish operations used for an Organization destination. */
|
|
40
|
-
publishClient: Pick<PublishApiClient, 'publishCatalogEntity' | 'getPublishRules'
|
|
41
|
+
publishClient: Pick<PublishApiClient, 'publishCatalogEntity' | 'getPublishRules'> & Partial<Pick<PublishApiClient, 'checkPublishTarget'>>;
|
|
41
42
|
/** Whether an Organization destination takes a direct write into an org unit (the user may write there); omit while the org-unit rule does not apply, which keeps every Organization destination on the publish path. */
|
|
42
43
|
canSaveDirectlyTo?: (folderPath: string[], root: SaveDestinationRoot) => boolean;
|
|
43
44
|
/** Reason a folder is unavailable as a destination in the given root, or `undefined` when usable; omit while the org-unit rule does not apply. A committed destination with a reason shows it and disables Save. */
|
|
44
45
|
getDisabledReason?: (folderPath: string[], root: SaveDestinationRoot) => string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Reads the private dependencies of what is being saved, already mapped to the panel's model; omit for a resource that has none to list. Called when the panel is open and the destination is under the Organization root, whichever way the save then goes (a publication request or a direct write); the list is advisory, so a failed read leaves it empty. The host reads the values it saves when called, so it should return the form's state at that moment.
|
|
48
|
+
*/
|
|
49
|
+
loadDependencies?: () => Promise<PublishDependency[]>;
|
|
50
|
+
/** The namespaces, among those asked, in which the user may not write straight into the unit that owns the folder; omit while the org-unit rule does not apply. Used for the dependencies the panel lists and for the icon's `files` namespace, on a destination that takes a direct write. */
|
|
51
|
+
getMissingNamespaces?: (folderPath: string[], namespaces: OrgUnitNamespace[]) => OrgUnitNamespace[];
|
|
52
|
+
/** Reason shown for a folder where the dependencies' namespaces are missing; receives the missing namespaces. Without it a missing namespace disables nothing. */
|
|
53
|
+
getMissingNamespacesReason?: (missing: OrgUnitNamespace[]) => string;
|
|
54
|
+
/** One sentence for the dependencies section while the panel cannot list them (an application whose form state is inside an embedded editor); passed through only under the Organization root. */
|
|
55
|
+
dependenciesNote?: string;
|
|
56
|
+
/** Notice about the application's uploaded icon, shown under the committed destination when it is a unit folder where the user may not write `files`; pass it only when the saved resource has an uploaded icon. */
|
|
57
|
+
iconNote?: string;
|
|
58
|
+
/** Reason shown, and Save disabled, while the committed direct-write folder already holds the name this save would write; receives that folder and, for "Save as new version", the typed version. It is returned through `getDisabledReason`, so it needs that parameter too; without it, or without `publishClient.checkPublishTarget`, no target check is made. */
|
|
59
|
+
getTargetTakenReason?: (folderPath: string[], version?: string) => string;
|
|
45
60
|
/** Options offered in the access-rules editor's source picker. */
|
|
46
61
|
ruleSourceOptions: string[];
|
|
47
62
|
/** Translated copy. */
|
|
@@ -50,7 +65,7 @@ export interface UseResourceSavePanelParams {
|
|
|
50
65
|
onSaved: (result: ResourceSaveResult, choice: ResourceSaveChoice) => void;
|
|
51
66
|
}
|
|
52
67
|
/** The {@link StandaloneSaveToFolderPanelProps} the Save flow owns; the host adds the open state, resource summary and labels. */
|
|
53
|
-
export type ResourceSavePanelStateProps = Pick<StandaloneSaveToFolderPanelProps, 'onSubmit' | 'isSubmitDisabled' | 'isSubmitting' | 'submitError' | 'roots' | 'destination' | 'onDestinationChange' | 'onCreateFolder' | 'getDisabledReason' | 'version' | 'accessRules' | 'onPendingDestinationChange' | 'foldersError' | 'onRetryFolders'>;
|
|
68
|
+
export type ResourceSavePanelStateProps = Pick<StandaloneSaveToFolderPanelProps, 'onSubmit' | 'isSubmitDisabled' | 'isSubmitting' | 'submitError' | 'roots' | 'destination' | 'onDestinationChange' | 'onCreateFolder' | 'getDisabledReason' | 'version' | 'accessRules' | 'onPendingDestinationChange' | 'foldersError' | 'onRetryFolders' | 'dependencies' | 'dependenciesNote' | 'destinationNote'>;
|
|
54
69
|
/** Result of {@link useResourceSavePanel}. */
|
|
55
70
|
export interface UseResourceSavePanelResult {
|
|
56
71
|
/** Props to spread on `StandaloneSaveToFolderPanel`. */
|
|
@@ -62,7 +77,9 @@ export interface UseResourceSavePanelResult {
|
|
|
62
77
|
* Owns the Save panel's flow for one resource — the Personal and
|
|
63
78
|
* Organization destination tree, the version choice, the Organization
|
|
64
79
|
* folder's access rules — and runs the choice through the resource's
|
|
65
|
-
* adapter. Notifications stay with the host through `onSaved`.
|
|
80
|
+
* adapter. Notifications stay with the host through `onSaved`. For a resource
|
|
81
|
+
* with private dependencies it also reads them while an Organization
|
|
82
|
+
* destination is chosen and returns them as `panelProps.dependencies`.
|
|
66
83
|
*/
|
|
67
|
-
export declare const useResourceSavePanel: ({ isOpen, adapter, resourceId, currentFolderPath, currentVersion, versionPattern, listPersonalFolders, organizationFolders, publishClient, canSaveDirectlyTo, getDisabledReason: getFolderDisabledReason, ruleSourceOptions, labels, onSaved, }: UseResourceSavePanelParams) => UseResourceSavePanelResult;
|
|
84
|
+
export declare const useResourceSavePanel: ({ isOpen, adapter, resourceId, currentFolderPath, currentVersion, versionPattern, listPersonalFolders, organizationFolders, publishClient, canSaveDirectlyTo, getDisabledReason: getFolderDisabledReason, loadDependencies, getMissingNamespaces, getMissingNamespacesReason, dependenciesNote, iconNote, getTargetTakenReason, ruleSourceOptions, labels, onSaved, }: UseResourceSavePanelParams) => UseResourceSavePanelResult;
|
|
68
85
|
//# sourceMappingURL=useResourceSavePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResourceSavePanel.d.ts","sourceRoot":"","sources":["../../../src/catalog/useResourceSavePanel/useResourceSavePanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAML,KAAK,wBAAwB,EAG7B,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"useResourceSavePanel.d.ts","sourceRoot":"","sources":["../../../src/catalog/useResourceSavePanel/useResourceSavePanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAG7B,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AAIrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAIL,wBAAwB,EAExB,mBAAmB,EAEnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAQtF,4GAA4G;AAC5G,MAAM,WAAW,0BAA0B;IACzC,sCAAsC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;IAClB,+FAA+F;IAC/F,eAAe,EAAE,CAAC,KAAK,E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IAClK,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,MAAM,CAAC;IACrE,kMAAkM;IAClM,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oNAAoN;IACpN,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qWAAqW;IACrW,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1E,kEAAkE;IAClE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB;IACvB,MAAM,EAAE,0BAA0B,CAAC;IACnC,0FAA0F;IAC1F,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC3E;AAED,kIAAkI;AAClI,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,gCAAgC,EAC9B,UAAU,GACV,kBAAkB,GAClB,cAAc,GACd,aAAa,GACb,OAAO,GACP,aAAa,GACb,qBAAqB,GACrB,gBAAgB,GAChB,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,4BAA4B,GAC5B,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,iBAAiB,CACpB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,WAAW,0BAA0B;IACzC,wDAAwD;IACxD,UAAU,EAAE,2BAA2B,CAAC;IACxC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAI,uWAqBlC,0BAA0B,KAAG,0BAgd/B,CAAC"}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { getApiErrorDetails as e } from "../../api-error/api-error.js";
|
|
2
2
|
import { useResourceFolders as t } from "../useResourceFolders/useResourceFolders.js";
|
|
3
|
-
import { ResourceSaveError as n } from "../resource-save-adapter.js";
|
|
4
|
-
import { SaveDestinationRoot as
|
|
5
|
-
import { ResourceSaveVersionError as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { ResourceSaveError as n, isResourceCreateAdapter as r } from "../resource-save-adapter.js";
|
|
4
|
+
import { SaveDestinationRoot as i } from "../save-destination-root.js";
|
|
5
|
+
import { ResourceSaveVersionError as a, createPublishSavedResource as ee, runResourceSave as te, toSaveDestinationRoot as ne } from "../resource-save.js";
|
|
6
|
+
import { getDependencyOrgUnitNamespaces as re } from "../../org-units/org-unit-guards.js";
|
|
7
|
+
import { OrgUnitNamespace as ie } from "@epam/ai-dial-chat-shared";
|
|
8
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
9
|
+
import { SaveVersionMode as d, toFolderPathKey as ae } from "@epam/ai-dial-publish-panel";
|
|
8
10
|
//#region src/catalog/useResourceSavePanel/useResourceSavePanel.ts
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
+
var f = [], oe = 400, p = ({ isOpen: p, adapter: m, resourceId: h, currentFolderPath: g, currentVersion: _, versionPattern: v, listPersonalFolders: se, organizationFolders: y, publishClient: b, canSaveDirectlyTo: ce, getDisabledReason: x, loadDependencies: S, getMissingNamespaces: C, getMissingNamespacesReason: w, dependenciesNote: le, iconNote: ue, getTargetTakenReason: T, ruleSourceOptions: de, labels: E, onSaved: fe }) => {
|
|
12
|
+
let D = t({
|
|
11
13
|
listFolders: se,
|
|
12
|
-
isEnabled:
|
|
13
|
-
}), { getPublishRules:
|
|
14
|
-
rootKey:
|
|
15
|
-
path:
|
|
16
|
-
}), [
|
|
17
|
-
if (e?.rootKey !==
|
|
14
|
+
isEnabled: p
|
|
15
|
+
}), { getPublishRules: pe, checkPublishTarget: O } = b, me = c(() => ee(b), [b]), he = c(() => ({
|
|
16
|
+
rootKey: i.Personal,
|
|
17
|
+
path: g
|
|
18
|
+
}), [g]), [k, ge] = u(he), [A, _e] = u(d.Keep), [j, ve] = u(""), [ye, M] = u(!1), [be, xe] = u(), [Se, Ce] = u(!1), [we, N] = u(), [Te, Ee] = u(!1), [De, Oe] = u(), P = l(/* @__PURE__ */ new Set()), [F, I] = u([]), [L, R] = u(!1), [z, B] = u(!1), V = l(void 0), H = o((e) => e.rootKey === i.Organization && m.saveIntoOrgUnit != null && ce?.(e.path, i.Organization) === !0, [m.saveIntoOrgUnit, ce]), ke = o((e) => {
|
|
19
|
+
if (Ee(e?.rootKey === i.Organization), e?.rootKey !== i.Organization || H(e)) return;
|
|
18
20
|
let t = ae(e.path);
|
|
19
21
|
t !== V.current && (V.current = t, I([]), B(!1), R(!0), (async () => {
|
|
20
22
|
try {
|
|
21
|
-
let n = await
|
|
23
|
+
let n = await pe(e.path.join("/"));
|
|
22
24
|
V.current === t && I(n);
|
|
23
25
|
} catch {
|
|
24
26
|
V.current === t && B(!0);
|
|
@@ -26,157 +28,211 @@ var l = ({ isOpen: l, adapter: u, resourceId: d, currentFolderPath: f, currentVe
|
|
|
26
28
|
V.current === t && R(!1);
|
|
27
29
|
}
|
|
28
30
|
})());
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
let U
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
}, [pe, H]);
|
|
32
|
+
s(() => {
|
|
33
|
+
p && (V.current = void 0, I([]), R(!1), B(!1), Ee(!1), Oe(void 0), P.current.clear(), ge(he), _e(d.Keep), ve(""), M(!1), xe(void 0), N(void 0));
|
|
34
|
+
}, [p]);
|
|
35
|
+
let [U, Ae] = u(f), je = l(S);
|
|
36
|
+
s(() => {
|
|
37
|
+
je.current = S;
|
|
38
|
+
}, [S]);
|
|
39
|
+
let Me = p && S != null && (k.rootKey === i.Organization || Te);
|
|
40
|
+
s(() => {
|
|
41
|
+
if (Ae(f), !Me) return;
|
|
42
|
+
let e = !1;
|
|
43
|
+
return (async () => {
|
|
44
|
+
try {
|
|
45
|
+
let t = await je.current?.();
|
|
46
|
+
!e && t && Ae(t);
|
|
47
|
+
} catch {}
|
|
48
|
+
})(), () => {
|
|
49
|
+
e = !0;
|
|
50
|
+
};
|
|
51
|
+
}, [Me]);
|
|
52
|
+
let W = m.isVersioned && A === d.New, G = j.trim(), K = c(() => {
|
|
53
|
+
if (W) {
|
|
54
|
+
if (!v.test(G)) return a.Invalid;
|
|
55
|
+
if (G === _) return a.Unchanged;
|
|
56
|
+
if (G === be) return a.Exists;
|
|
38
57
|
}
|
|
39
58
|
}, [
|
|
40
|
-
U,
|
|
41
|
-
oe,
|
|
42
59
|
W,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
v,
|
|
61
|
+
G,
|
|
62
|
+
_,
|
|
63
|
+
be
|
|
64
|
+
]), Ne = r(m), q = k.path.join("/"), Pe = [...P.current].some((e) => q === e || q.startsWith(`${e}/`)), Fe = v.test(G) && G !== _, J = W ? G : void 0, Y = T != null && x != null && O != null && !Ne && H(k) && !Pe && (!W || Fe) ? `${q}\u0000${J ?? ""}` : void 0, Ie = m.publishEntityType;
|
|
65
|
+
s(() => {
|
|
66
|
+
if (Y == null || O == null) return;
|
|
67
|
+
let e = !1, t = async () => {
|
|
68
|
+
try {
|
|
69
|
+
let { taken: t } = await O(Ie, h, q, J);
|
|
70
|
+
if (e) return;
|
|
71
|
+
Oe((e) => t ? Y : e === Y ? void 0 : e);
|
|
72
|
+
} catch {}
|
|
73
|
+
}, n = setTimeout(() => void t(), J == null ? 0 : oe);
|
|
74
|
+
return () => {
|
|
75
|
+
e = !0, clearTimeout(n);
|
|
76
|
+
};
|
|
77
|
+
}, [Y]);
|
|
78
|
+
let Le = Y != null && De === Y, X = c(() => re(U), [U]), Re = c(() => {
|
|
79
|
+
if (x) return (e) => {
|
|
80
|
+
let t = ne(e.rootKey);
|
|
81
|
+
if (!t) return;
|
|
82
|
+
let n = x(e.path, t);
|
|
83
|
+
if (n != null) return n;
|
|
84
|
+
let r = e.rootKey === k.rootKey && e.path.join("/") === q;
|
|
85
|
+
if (Le && r && T) return T(e.path, J);
|
|
86
|
+
if (!C || !w || X.length === 0 || !H(e)) return;
|
|
87
|
+
let i = C(e.path, X);
|
|
88
|
+
return i.length > 0 ? w(i) : void 0;
|
|
89
|
+
};
|
|
90
|
+
}, [
|
|
91
|
+
X,
|
|
92
|
+
k.rootKey,
|
|
93
|
+
x,
|
|
94
|
+
C,
|
|
95
|
+
w,
|
|
96
|
+
T,
|
|
97
|
+
H,
|
|
98
|
+
Le,
|
|
99
|
+
q,
|
|
100
|
+
J
|
|
101
|
+
]), Z = Re?.(k), Q = H(k), ze = k.rootKey === i.Organization, Be = ue != null && Q && C?.(k.path, [ie.Files]).length ? ue : void 0, $ = k.rootKey === i.Organization && !Q && (L || z), Ve = o((e) => {
|
|
102
|
+
ve(e), N(void 0);
|
|
103
|
+
}, []), He = o(() => M(!0), []), Ue = y?.rememberPublishFolder, { saveError: We } = E, Ge = o(async () => {
|
|
104
|
+
if (M(!0), K || $ || Z) return;
|
|
105
|
+
Ce(!0), N(void 0);
|
|
53
106
|
let t = {
|
|
54
|
-
resourceId:
|
|
55
|
-
currentFolderPath:
|
|
56
|
-
currentVersion:
|
|
57
|
-
destination:
|
|
58
|
-
versionMode:
|
|
59
|
-
newVersion:
|
|
107
|
+
resourceId: h,
|
|
108
|
+
currentFolderPath: g,
|
|
109
|
+
currentVersion: _,
|
|
110
|
+
destination: k,
|
|
111
|
+
versionMode: A,
|
|
112
|
+
newVersion: G,
|
|
60
113
|
rules: F,
|
|
61
|
-
isDirectWrite:
|
|
114
|
+
isDirectWrite: Q
|
|
62
115
|
};
|
|
63
116
|
try {
|
|
64
|
-
let e = await te(
|
|
65
|
-
e.isPublished &&
|
|
117
|
+
let e = await te(m, t, me);
|
|
118
|
+
e.isPublished && Ue?.(k.path), fe(e, t);
|
|
66
119
|
} catch (t) {
|
|
67
120
|
if (t instanceof n) {
|
|
68
|
-
|
|
121
|
+
N(t.message);
|
|
69
122
|
return;
|
|
70
123
|
}
|
|
71
124
|
let { message: r, status: i } = await e(t);
|
|
72
|
-
if (
|
|
73
|
-
|
|
125
|
+
if (W && i === 409) {
|
|
126
|
+
xe(G);
|
|
74
127
|
return;
|
|
75
128
|
}
|
|
76
|
-
|
|
129
|
+
N(r ?? We);
|
|
77
130
|
} finally {
|
|
78
|
-
|
|
131
|
+
Ce(!1);
|
|
79
132
|
}
|
|
80
133
|
}, [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
C,
|
|
134
|
+
m,
|
|
135
|
+
g,
|
|
136
|
+
_,
|
|
137
|
+
k,
|
|
138
|
+
W,
|
|
139
|
+
Q,
|
|
140
|
+
$,
|
|
141
|
+
Z,
|
|
142
|
+
fe,
|
|
91
143
|
me,
|
|
92
|
-
|
|
144
|
+
Ue,
|
|
145
|
+
h,
|
|
93
146
|
F,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
]),
|
|
147
|
+
We,
|
|
148
|
+
G,
|
|
149
|
+
A,
|
|
150
|
+
K
|
|
151
|
+
]), Ke = o(() => void Ge(), [Ge]), { personalRoot: qe, organizationRoot: Je } = E, Ye = c(() => {
|
|
99
152
|
let e = {
|
|
100
|
-
key:
|
|
101
|
-
label:
|
|
102
|
-
items:
|
|
103
|
-
expandedPaths:
|
|
104
|
-
onExpandedPathsChange:
|
|
105
|
-
loadingPaths:
|
|
153
|
+
key: i.Personal,
|
|
154
|
+
label: qe,
|
|
155
|
+
items: D.folderItems,
|
|
156
|
+
expandedPaths: D.expandedPaths,
|
|
157
|
+
onExpandedPathsChange: D.onExpandedPathsChange,
|
|
158
|
+
loadingPaths: D.loadingPaths
|
|
106
159
|
};
|
|
107
|
-
return
|
|
108
|
-
key:
|
|
109
|
-
label:
|
|
110
|
-
items:
|
|
111
|
-
expandedPaths:
|
|
112
|
-
onExpandedPathsChange:
|
|
113
|
-
loadingPaths:
|
|
160
|
+
return y ? [e, {
|
|
161
|
+
key: i.Organization,
|
|
162
|
+
label: Je,
|
|
163
|
+
items: y.folderItems,
|
|
164
|
+
expandedPaths: y.expandedPaths,
|
|
165
|
+
onExpandedPathsChange: y.onExpandedPathsChange,
|
|
166
|
+
loadingPaths: y.loadingPaths,
|
|
114
167
|
hasAccessRules: !0
|
|
115
168
|
}] : [e];
|
|
116
169
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
]), { onCreateFolder:
|
|
125
|
-
e ===
|
|
126
|
-
}, [
|
|
127
|
-
versionMode:
|
|
128
|
-
onVersionModeChange:
|
|
129
|
-
currentVersion:
|
|
130
|
-
newVersion:
|
|
131
|
-
onNewVersionChange:
|
|
132
|
-
onNewVersionBlur:
|
|
133
|
-
newVersionError:
|
|
170
|
+
y,
|
|
171
|
+
Je,
|
|
172
|
+
D.expandedPaths,
|
|
173
|
+
D.folderItems,
|
|
174
|
+
D.loadingPaths,
|
|
175
|
+
D.onExpandedPathsChange,
|
|
176
|
+
qe
|
|
177
|
+
]), { onCreateFolder: Xe } = D, Ze = y?.onCreatePublishFolder, Qe = o(async (e, t, n) => {
|
|
178
|
+
e === i.Organization ? (P.current.add([...t, n].join("/")), await Ze?.(t, n)) : await Xe(t, n);
|
|
179
|
+
}, [Xe, Ze]), { getVersionError: $e } = E, et = c(() => m.isVersioned && _ != null ? {
|
|
180
|
+
versionMode: A,
|
|
181
|
+
onVersionModeChange: _e,
|
|
182
|
+
currentVersion: _,
|
|
183
|
+
newVersion: j,
|
|
184
|
+
onNewVersionChange: Ve,
|
|
185
|
+
onNewVersionBlur: He,
|
|
186
|
+
newVersionError: ye && K ? $e(K, G) : void 0
|
|
134
187
|
} : void 0, [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
W,
|
|
188
|
+
m.isVersioned,
|
|
189
|
+
_,
|
|
190
|
+
$e,
|
|
191
|
+
ye,
|
|
192
|
+
He,
|
|
193
|
+
j,
|
|
194
|
+
Ve,
|
|
143
195
|
G,
|
|
144
|
-
|
|
145
|
-
|
|
196
|
+
K,
|
|
197
|
+
A
|
|
198
|
+
]), { accessRules: tt } = E, nt = c(() => ({
|
|
146
199
|
rules: F,
|
|
147
200
|
onRulesChange: I,
|
|
148
|
-
sourceOptions:
|
|
201
|
+
sourceOptions: de,
|
|
149
202
|
isLoading: L,
|
|
150
203
|
hasLoadError: z,
|
|
151
|
-
labels:
|
|
204
|
+
labels: tt,
|
|
152
205
|
isHiddenFor: H
|
|
153
206
|
}), [
|
|
154
|
-
|
|
207
|
+
tt,
|
|
155
208
|
z,
|
|
156
209
|
H,
|
|
157
210
|
L,
|
|
158
|
-
|
|
211
|
+
de,
|
|
159
212
|
F
|
|
160
213
|
]);
|
|
161
214
|
return {
|
|
162
215
|
panelProps: {
|
|
163
|
-
onSubmit:
|
|
164
|
-
isSubmitDisabled:
|
|
165
|
-
isSubmitting:
|
|
166
|
-
submitError:
|
|
167
|
-
roots:
|
|
168
|
-
destination:
|
|
169
|
-
onDestinationChange:
|
|
170
|
-
onCreateFolder:
|
|
171
|
-
getDisabledReason:
|
|
172
|
-
version:
|
|
173
|
-
accessRules:
|
|
174
|
-
onPendingDestinationChange:
|
|
175
|
-
foldersError:
|
|
176
|
-
onRetryFolders:
|
|
216
|
+
onSubmit: Ke,
|
|
217
|
+
isSubmitDisabled: W && !!K || $ || Z != null,
|
|
218
|
+
isSubmitting: Se,
|
|
219
|
+
submitError: we,
|
|
220
|
+
roots: Ye,
|
|
221
|
+
destination: k,
|
|
222
|
+
onDestinationChange: ge,
|
|
223
|
+
onCreateFolder: Qe,
|
|
224
|
+
getDisabledReason: Re,
|
|
225
|
+
version: et,
|
|
226
|
+
accessRules: nt,
|
|
227
|
+
onPendingDestinationChange: ke,
|
|
228
|
+
foldersError: D.hasError ? E.foldersLoadError : void 0,
|
|
229
|
+
onRetryFolders: D.retry,
|
|
230
|
+
dependencies: ze ? U : f,
|
|
231
|
+
dependenciesNote: ze ? le : void 0,
|
|
232
|
+
destinationNote: Be
|
|
177
233
|
},
|
|
178
|
-
submit:
|
|
234
|
+
submit: Ge
|
|
179
235
|
};
|
|
180
236
|
};
|
|
181
237
|
//#endregion
|
|
182
|
-
export {
|
|
238
|
+
export { p as useResourceSavePanel };
|
package/file-manager.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { FileSelectionKind as e, getFileSelectionKind as t, isDialFileId as n, isDialFolderId as r, isDialProjectFileId as i, isDialStoredFileId as a,
|
|
2
|
-
import { openAnnotationAttachment as
|
|
3
|
-
import { isDialFileAcceptType as
|
|
4
|
-
import { sanitizeFileName as
|
|
5
|
-
import { DialFilesApiUploadMode as
|
|
6
|
-
import { FileManagerNotificationReason as
|
|
7
|
-
import { COLUMNS_MY_FILES as
|
|
8
|
-
import { buildSharedItemVirtualPath as
|
|
9
|
-
import { resolveDialFileApiPath as
|
|
10
|
-
import { prepareCopyItems as
|
|
11
|
-
import { UploadBodyEncoding as
|
|
12
|
-
import { buildFromCache as
|
|
13
|
-
import { mimeTypesToAttachmentExtensionLabels as
|
|
14
|
-
import { createFilesApiClient as
|
|
15
|
-
import { getUrlFileName as
|
|
16
|
-
import { annotationToDisplayAttachment as
|
|
17
|
-
import { useUnshareConfirmationState as
|
|
18
|
-
import { dialFileToAttachment as
|
|
19
|
-
import { DownloadDestinationType as
|
|
20
|
-
import { prepareDownloadDestination as
|
|
21
|
-
import { deriveActionProfile as
|
|
22
|
-
import { useDialFileListing as
|
|
23
|
-
import { useDialFileMetadata as
|
|
24
|
-
import { useDialFileMutations as
|
|
25
|
-
import { useDialFileSharing as
|
|
26
|
-
import { useDialFileUploadBatch as
|
|
27
|
-
import { useDialFileManager as
|
|
28
|
-
import { useDialFileManagerSections as
|
|
29
|
-
import { useDialFileManagerTabConfig as
|
|
30
|
-
import { useFileAttachmentPicker as
|
|
31
|
-
import { useFileAttachmentModalState as
|
|
32
|
-
import { useGridEditingScroll as
|
|
33
|
-
export {
|
|
1
|
+
import { FileSelectionKind as e, getFileSelectionKind as t, isDialFileId as n, isDialFolderId as r, isDialProjectFileId as i, isDialStoredFileId as a, isOwnDialFileId as o, parseDialProjectFileId as s, resolveDialFileBucketAndPath as c, resolveDialFolderPath as l, resolveRelativeDialFilePath as u } from "./files/dial-file.js";
|
|
2
|
+
import { openAnnotationAttachment as d } from "./files/annotation.js";
|
|
3
|
+
import { isDialFileAcceptType as f, mimeTypesToDialFileAcceptTypes as p, mimeTypesToFileAccept as m } from "./files/attachment-types.js";
|
|
4
|
+
import { sanitizeFileName as h, splitFileNameExtension as g, trimFileNameToByteLimit as _ } from "./files/file-name.js";
|
|
5
|
+
import { DialFilesApiUploadMode as v } from "./files/dial-files-api.js";
|
|
6
|
+
import { FileManagerNotificationReason as y, FileNameValidationErrorReason as b, FileOperationKind as x } from "./files/dial-file-manager.types.js";
|
|
7
|
+
import { COLUMNS_MY_FILES as S, COLUMNS_ORGANIZATION as C, COLUMNS_SHARED as w, CORE_PERMISSION_MAP as T, DATE_OPTIONS as E, DIAL_FILE_MANAGER_SECTION_TABS as D, PATH_SEPARATOR_REGEXP as O, RESERVED_MARKER_NAME as k, UPLOAD_CONCURRENCY as A } from "./files/dial-file-manager.model.js";
|
|
8
|
+
import { buildSharedItemVirtualPath as j, dialCorePathToRelative as M, findDialFileByPath as N, findFolderByVirtualPath as P, formatOperationFolderName as F, getVirtualPathName as I, hasDialFileWritePermission as L, hasForbiddenNameSymbols as R, hasSamePaths as z, isCopyMoveDuplicateAllowed as B, isShareActionsAllowed as V, normalizeVirtualPath as H, parseNewFolderVirtualPath as U, resolveOwnerCoords as W, resolveSectionByPath as G, unionPathSets as K, withRoutableRootLabels as q } from "./files/dial-file-manager-path.util.js";
|
|
9
|
+
import { resolveDialFileApiPath as J, virtualPathToApiPath as Y } from "./files/resolve-dial-file-api-path.js";
|
|
10
|
+
import { prepareCopyItems as X, prepareMoveRenameItems as Z } from "./files/dial-file-manager-copy-move.util.js";
|
|
11
|
+
import { UploadBodyEncoding as Q, UploadNetworkError as $, createUploadFileWithProgress as ee } from "./files/create-upload-file-with-progress.js";
|
|
12
|
+
import { buildFromCache as te, buildSharedSearchScope as ne, fetchByTab as re, fetchForSearch as ie, findFirstSuccessfulCopyMoveItem as ae, mapCorePermissions as oe, mapFileMetadataToDialFile as se, mapSearchItem as ce, mergeCreatedFolderIntoCache as le, resolveTransferFailureReason as ue, resolveUploadFailureReason as de, updateEntry as fe } from "./files/dial-file-manager-mapping.util.js";
|
|
13
|
+
import { mimeTypesToAttachmentExtensionLabels as pe } from "./files/attachment-type-labels.js";
|
|
14
|
+
import { createFilesApiClient as me } from "./files/create-files-api.js";
|
|
15
|
+
import { getUrlFileName as he, isExternalSourcePreviewable as ge, resolveExternalSourceContentType as _e } from "./files/source-content.js";
|
|
16
|
+
import { annotationToDisplayAttachment as ve, attachmentDtoToDisplayAttachment as ye, attachmentDtosToDisplayAttachments as be } from "./files/attachment-dto-to-display.js";
|
|
17
|
+
import { useUnshareConfirmationState as xe } from "./files/useUnshareConfirmationState/useUnshareConfirmationState.js";
|
|
18
|
+
import { dialFileToAttachment as Se, dialFilesToAttachments as Ce, dialFolderPathToAttachment as we } from "./files/dial-file-to-attachment.js";
|
|
19
|
+
import { DownloadDestinationType as Te } from "./files/download-destination.js";
|
|
20
|
+
import { prepareDownloadDestination as Ee } from "./files/prepare-download-destination.js";
|
|
21
|
+
import { deriveActionProfile as De } from "./files/file-manager-variant.js";
|
|
22
|
+
import { useDialFileListing as Oe } from "./files/useDialFileListing/useDialFileListing.js";
|
|
23
|
+
import { useDialFileMetadata as ke } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
24
|
+
import { useDialFileMutations as Ae } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
25
|
+
import { useDialFileSharing as je } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
26
|
+
import { useDialFileUploadBatch as Me } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
27
|
+
import { useDialFileManager as Ne } from "./files/useDialFileManager/useDialFileManager.js";
|
|
28
|
+
import { useDialFileManagerSections as Pe } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
29
|
+
import { useDialFileManagerTabConfig as Fe } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
30
|
+
import { useFileAttachmentPicker as Ie } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
31
|
+
import { useFileAttachmentModalState as Le } from "./files/useFileAttachmentModalState/useFileAttachmentModalState.js";
|
|
32
|
+
import { useGridEditingScroll as Re } from "@epam/ai-dial-chat-shared";
|
|
33
|
+
export { S as COLUMNS_MY_FILES, C as COLUMNS_ORGANIZATION, w as COLUMNS_SHARED, T as CORE_PERMISSION_MAP, E as DATE_OPTIONS, D as DIAL_FILE_MANAGER_SECTION_TABS, v as DialFilesApiUploadMode, Te as DownloadDestinationType, y as FileManagerNotificationReason, b as FileNameValidationErrorReason, x as FileOperationKind, e as FileSelectionKind, O as PATH_SEPARATOR_REGEXP, k as RESERVED_MARKER_NAME, A as UPLOAD_CONCURRENCY, Q as UploadBodyEncoding, $ as UploadNetworkError, ve as annotationToDisplayAttachment, ye as attachmentDtoToDisplayAttachment, be as attachmentDtosToDisplayAttachments, te as buildFromCache, j as buildSharedItemVirtualPath, ne as buildSharedSearchScope, me as createFilesApiClient, ee as createUploadFileWithProgress, De as deriveActionProfile, M as dialCorePathToRelative, Se as dialFileToAttachment, Ce as dialFilesToAttachments, we as dialFolderPathToAttachment, re as fetchByTab, ie as fetchForSearch, N as findDialFileByPath, ae as findFirstSuccessfulCopyMoveItem, P as findFolderByVirtualPath, F as formatOperationFolderName, t as getFileSelectionKind, he as getUrlFileName, I as getVirtualPathName, L as hasDialFileWritePermission, R as hasForbiddenNameSymbols, z as hasSamePaths, B as isCopyMoveDuplicateAllowed, f as isDialFileAcceptType, n as isDialFileId, r as isDialFolderId, i as isDialProjectFileId, a as isDialStoredFileId, ge as isExternalSourcePreviewable, o as isOwnDialFileId, V as isShareActionsAllowed, oe as mapCorePermissions, se as mapFileMetadataToDialFile, ce as mapSearchItem, le as mergeCreatedFolderIntoCache, pe as mimeTypesToAttachmentExtensionLabels, p as mimeTypesToDialFileAcceptTypes, m as mimeTypesToFileAccept, H as normalizeVirtualPath, d as openAnnotationAttachment, s as parseDialProjectFileId, U as parseNewFolderVirtualPath, X as prepareCopyItems, Ee as prepareDownloadDestination, Z as prepareMoveRenameItems, J as resolveDialFileApiPath, c as resolveDialFileBucketAndPath, l as resolveDialFolderPath, _e as resolveExternalSourceContentType, W as resolveOwnerCoords, u as resolveRelativeDialFilePath, G as resolveSectionByPath, ue as resolveTransferFailureReason, de as resolveUploadFailureReason, h as sanitizeFileName, g as splitFileNameExtension, _ as trimFileNameToByteLimit, K as unionPathSets, fe as updateEntry, Oe as useDialFileListing, Ne as useDialFileManager, Pe as useDialFileManagerSections, Fe as useDialFileManagerTabConfig, ke as useDialFileMetadata, Ae as useDialFileMutations, je as useDialFileSharing, Me as useDialFileUploadBatch, Le as useFileAttachmentModalState, Ie as useFileAttachmentPicker, Re as useGridEditingScroll, xe as useUnshareConfirmationState, Y as virtualPathToApiPath, q as withRoutableRootLabels };
|
package/files/dial-file.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { DialFile } from '@epam/ai-dial-ui-kit';
|
|
2
2
|
/** True when `url` looks like a DIAL Core file id (`files/{bucket}/{path}`). */
|
|
3
3
|
export declare const isDialFileId: (url: string) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* True when `url` is a DIAL Core file id in `bucket` without a `..` segment, ignoring a query or fragment; a theme icon name, an absolute URL or a file in another bucket is `false`.
|
|
6
|
+
* @param url - the stored value, e.g. an application's `iconUrl`
|
|
7
|
+
* @param bucket - the bucket the file must lie in
|
|
8
|
+
*/
|
|
9
|
+
export declare const isOwnDialFileId: (url: string, bucket: string) => boolean;
|
|
4
10
|
/** The decoded parts of a DIAL Core project file id, `projects/{bucket}/{path}/files/{filePath}`. */
|
|
5
11
|
export interface DialProjectFileIdParts {
|
|
6
12
|
/** The project id, `projects/{bucket}/{path}`, with every segment decoded. */
|
package/files/dial-file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file.d.ts","sourceRoot":"","sources":["../../src/files/dial-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGvE,gFAAgF;AAChF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"dial-file.d.ts","sourceRoot":"","sources":["../../src/files/dial-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGvE,gFAAgF;AAChF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,OAAmC,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,KAAG,OAK7D,CAAC;AAKF,qGAAqG;AACrG,MAAM,WAAW,sBAAsB;IACrC,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,2GAA2G;IAC3G,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAkBD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,sBAAsB,GAAG,SAqB3B,CAAC;AAEF,qJAAqJ;AACrJ,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,O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