@epam/ai-dial-chat-shared 1.4.0-dev.178 → 1.4.0-dev.182
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/index.js +81 -81
- package/package.json +1 -1
- package/utils/org-unit.d.ts +12 -0
- package/utils/org-unit.d.ts.map +1 -1
- package/utils/org-unit.js +5 -2
package/index.js
CHANGED
|
@@ -16,84 +16,84 @@ import { ENTITY_DESCRIPTION_MAX_LENGTH as V, ENTITY_INSTRUCTIONS_MAX_LENGTH as H
|
|
|
16
16
|
import { RESOURCE_VERSION_PATTERN as K, STORED_RESOURCE_VERSION_PATTERN as q } from "./utils/resource-version.js";
|
|
17
17
|
import { mergeClasses as J } from "./utils/merge-class.js";
|
|
18
18
|
import { buildCssVars as Y } from "./utils/build-css-vars.js";
|
|
19
|
-
import { canAccessAt as X, canApprovePublicationsAt as Z, canReadAt as Q, canRequestPublicationAt as $, canSaveToFolderAt as ee, canWriteAt as te, canWriteIntoOrgUnitAt as ne, findOwningOrgUnit as re,
|
|
20
|
-
import { isStatusMessage as
|
|
21
|
-
import { messageAttachmentToDisplayAttachment as
|
|
22
|
-
import { isAudioTranscriptionSupported as
|
|
23
|
-
import { copyToClipboard as
|
|
24
|
-
import { copyMarkdownAsRichText as
|
|
25
|
-
import { makeOutsideInert as
|
|
26
|
-
import { formatLastUsed as
|
|
27
|
-
import { formatFileSize as
|
|
28
|
-
import { formatCost as
|
|
29
|
-
import { base64ToBlob as
|
|
30
|
-
import { isSyntaxHighlightingAllowed as
|
|
31
|
-
import { ENTITY_TYPE_BG_COLOR as
|
|
32
|
-
import { PROMPT_PARAM_DEFAULT_SEPARATOR as
|
|
33
|
-
import { generateUUID as
|
|
34
|
-
import { BASE_LG_ICON_PROPS as
|
|
35
|
-
import { HIDDEN_FILE as
|
|
36
|
-
import { TAG_INPUT_TAG_CLASS_NAME as
|
|
37
|
-
import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as
|
|
38
|
-
import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as
|
|
39
|
-
import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as
|
|
40
|
-
import { DESKTOP_BREAKPOINT_PX as
|
|
41
|
-
import { InitialsAvatar as
|
|
42
|
-
import { DeploymentIcon as
|
|
43
|
-
import { CopyButton as
|
|
44
|
-
import { extractInitials as
|
|
45
|
-
import { pickAvatarColor as
|
|
46
|
-
import { useIsPhone as
|
|
47
|
-
import { ActionMenu as
|
|
48
|
-
import { PanelEmptyState as
|
|
49
|
-
import { NewVersionAlert as
|
|
50
|
-
import { NotificationStack as
|
|
51
|
-
import { ItemHeader as
|
|
52
|
-
import { EntityTypeLabel as
|
|
53
|
-
import { FeaturedChip as
|
|
54
|
-
import { EntityHeader as
|
|
55
|
-
import { ResourceSummary as
|
|
56
|
-
import { ConfirmationIdentityCard as
|
|
57
|
-
import { ConfirmationIdentityRow as
|
|
58
|
-
import { ConfirmationView as
|
|
59
|
-
import { ConfirmationFooter as
|
|
60
|
-
import { ConfirmationDialog as
|
|
61
|
-
import { DELETE_CONFIRMATION_MAX_LISTED_NAMES as
|
|
62
|
-
import { DeleteConfirmationDialog as
|
|
63
|
-
import { DeleteConfirmationDrawer as
|
|
64
|
-
import { TableHeader as
|
|
65
|
-
import { TextRefinementState as
|
|
66
|
-
import { TextRefinementField as
|
|
67
|
-
import { CHAT_SHARED_CLASS as
|
|
68
|
-
import { useCodeCopy as
|
|
69
|
-
import { restrainedSyntaxTheme as
|
|
70
|
-
import { MarkdownCodeBlock as
|
|
71
|
-
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as
|
|
72
|
-
import { MarkdownTable as
|
|
73
|
-
import { MarkdownRenderer as
|
|
74
|
-
import { COMPACT_MARKDOWN_CLASS_NAMES as
|
|
75
|
-
import { PlainTextRenderer as
|
|
76
|
-
import { MDMessageViewer as
|
|
77
|
-
import { MarkdownWithPlaceholders as
|
|
78
|
-
import { buildInlineSegmentSource as
|
|
79
|
-
import { useCollapsedText as
|
|
80
|
-
import { useAvailableHeightCap as
|
|
81
|
-
import { useControlErrorAssociation as
|
|
82
|
-
import { useHasBeenTrue as
|
|
83
|
-
import { useIsMobile as
|
|
84
|
-
import { useIsTablet as
|
|
85
|
-
import { useIsTextClipped as
|
|
86
|
-
import { useIsVerticallyClamped as
|
|
87
|
-
import { useUnsavedChangesGuard as
|
|
88
|
-
import { useUnsavedChanges as
|
|
89
|
-
import { useUnsavedChangesLeaveGuard as
|
|
90
|
-
import { useUnsavedChangesLeaveConfirmation as
|
|
91
|
-
import { UnsavedChangesProvider as
|
|
92
|
-
import { DialFileManagerActionProfile as
|
|
93
|
-
import { getParentFolderPath as
|
|
94
|
-
import { FileDownloadStatus as
|
|
95
|
-
import { useGridEditingScroll as
|
|
96
|
-
import { OperationLoaderModal as
|
|
97
|
-
import { isSkillSelectionUnsupported as
|
|
98
|
-
import { toConversationTransferQueueItems as
|
|
99
|
-
export {
|
|
19
|
+
import { canAccessAt as X, canApprovePublicationsAt as Z, canReadAt as Q, canRequestPublicationAt as $, canSaveToFolderAt as ee, canWriteAt as te, canWriteIntoOrgUnitAt as ne, findOwningOrgUnit as re, isOrgUnitTreeFolder as ie, normalizeOrgUnitFolder as ae } from "./utils/org-unit.js";
|
|
20
|
+
import { isStatusMessage as oe } from "./utils/message.js";
|
|
21
|
+
import { messageAttachmentToDisplayAttachment as se, messageAttachmentsToDisplayAttachments as ce } from "./utils/message-attachment-to-display.js";
|
|
22
|
+
import { isAudioTranscriptionSupported as le } from "./utils/is-audio-transcription-supported.js";
|
|
23
|
+
import { copyToClipboard as ue } from "./utils/copy-to-clipboard.js";
|
|
24
|
+
import { copyMarkdownAsRichText as de, markdownToRichTextHtml as fe } from "./utils/markdown-rich-text.js";
|
|
25
|
+
import { makeOutsideInert as pe } from "./utils/dom.js";
|
|
26
|
+
import { formatLastUsed as me } from "./utils/format-last-used.js";
|
|
27
|
+
import { formatFileSize as he } from "./utils/format-file-size.js";
|
|
28
|
+
import { formatCost as ge, formatPrice as _e, formatUnitPrice as ve } from "./utils/format-price.js";
|
|
29
|
+
import { base64ToBlob as ye, downloadTextFile as be, ensureDownloadFilename as xe, getFileExtensionForLanguage as Se, triggerAnchorDownload as Ce, triggerBlobDownload as we, tryBase64ToBytes as Te } from "./utils/file-download.js";
|
|
30
|
+
import { isSyntaxHighlightingAllowed as Ee } from "./utils/syntax-highlighting.js";
|
|
31
|
+
import { ENTITY_TYPE_BG_COLOR as De, ENTITY_TYPE_COLOR as Oe } from "./constants/entity-colors.js";
|
|
32
|
+
import { PROMPT_PARAM_DEFAULT_SEPARATOR as ke, PROMPT_PARAM_PATTERN as Ae, PROMPT_VARIABLE_CLASS_NAME as je, buildPromptParamDefaults as Me, extractPromptParams as Ne, rehypePromptVariables as Pe, resolvePromptParams as Fe } from "./utils/prompt-variables.js";
|
|
33
|
+
import { generateUUID as Ie } from "./utils/generate-uuid.js";
|
|
34
|
+
import { BASE_LG_ICON_PROPS as Le, BASE_MD_ICON_PROPS as Re } from "./constants/icon.js";
|
|
35
|
+
import { HIDDEN_FILE as ze, PUBLIC_BUCKET as Be } from "./constants/dial.js";
|
|
36
|
+
import { TAG_INPUT_TAG_CLASS_NAME as Ve } from "./constants/tag-input.js";
|
|
37
|
+
import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as He, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as Ue, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as We, RESIZABLE_TEXTAREA_CLASS_NAME as Ge } from "./constants/resizable-fields.js";
|
|
38
|
+
import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as Ke } from "./constants/markdown-editor.js";
|
|
39
|
+
import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as qe, SELECT_LIST_MAX_HEIGHT_PX as Je } from "./constants/select-list.js";
|
|
40
|
+
import { DESKTOP_BREAKPOINT_PX as Ye, DESKTOP_MEDIA_QUERY as Xe, MOBILE_MAX_WIDTH_PX as Ze, MOBILE_MEDIA_QUERY as Qe, PHONE_MEDIA_QUERY as $e, TABLET_BREAKPOINT_PX as et, TABLET_MEDIA_QUERY as tt } from "./constants/breakpoint.js";
|
|
41
|
+
import { InitialsAvatar as nt } from "./components/InitialsAvatar/InitialsAvatar.js";
|
|
42
|
+
import { DeploymentIcon as rt } from "./components/DeploymentIcon/DeploymentIcon.js";
|
|
43
|
+
import { CopyButton as it, CopyIconButton as at } from "./components/CopyButton/CopyButton.js";
|
|
44
|
+
import { extractInitials as ot } from "./utils/initials.js";
|
|
45
|
+
import { pickAvatarColor as st } from "./utils/avatar-color.js";
|
|
46
|
+
import { useIsPhone as ct } from "./hooks/useIsPhone.js";
|
|
47
|
+
import { ActionMenu as lt } from "./components/ActionMenu/ActionMenu.js";
|
|
48
|
+
import { PanelEmptyState as ut } from "./components/PanelEmptyState/PanelEmptyState.js";
|
|
49
|
+
import { NewVersionAlert as dt } from "./components/NewVersionAlert/NewVersionAlert.js";
|
|
50
|
+
import { NotificationStack as ft } from "./components/NotificationStack/NotificationStack.js";
|
|
51
|
+
import { ItemHeader as pt } from "./components/ItemHeader/ItemHeader.js";
|
|
52
|
+
import { EntityTypeLabel as mt } from "./components/EntityTypeLabel/EntityTypeLabel.js";
|
|
53
|
+
import { FeaturedChip as ht } from "./components/FeaturedChip/FeaturedChip.js";
|
|
54
|
+
import { EntityHeader as gt } from "./components/EntityHeader/EntityHeader.js";
|
|
55
|
+
import { ResourceSummary as _t } from "./components/ResourceSummary/ResourceSummary.js";
|
|
56
|
+
import { ConfirmationIdentityCard as vt } from "./components/ConfirmationIdentityCard/ConfirmationIdentityCard.js";
|
|
57
|
+
import { ConfirmationIdentityRow as yt } from "./components/ConfirmationIdentityRow/ConfirmationIdentityRow.js";
|
|
58
|
+
import { ConfirmationView as bt } from "./components/ConfirmationView/ConfirmationView.js";
|
|
59
|
+
import { ConfirmationFooter as xt } from "./components/ConfirmationView/ConfirmationFooter.js";
|
|
60
|
+
import { ConfirmationDialog as St } from "./components/ConfirmationDialog/ConfirmationDialog.js";
|
|
61
|
+
import { DELETE_CONFIRMATION_MAX_LISTED_NAMES as Ct, DeleteConfirmationView as wt } from "./components/DeleteConfirmationView/DeleteConfirmationView.js";
|
|
62
|
+
import { DeleteConfirmationDialog as Tt } from "./components/DeleteConfirmationDialog/DeleteConfirmationDialog.js";
|
|
63
|
+
import { DeleteConfirmationDrawer as Et } from "./components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js";
|
|
64
|
+
import { TableHeader as Dt } from "./components/MarkdownRenderer/Table/TableHeader.js";
|
|
65
|
+
import { TextRefinementState as Ot, useTextRefinement as kt } from "./hooks/useTextRefinement.js";
|
|
66
|
+
import { TextRefinementField as At } from "./components/TextRefinementField/TextRefinementField.js";
|
|
67
|
+
import { CHAT_SHARED_CLASS as jt } from "./constants/public-class-names.js";
|
|
68
|
+
import { useCodeCopy as Mt } from "./hooks/useCodeCopy.js";
|
|
69
|
+
import { restrainedSyntaxTheme as Nt } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
70
|
+
import { MarkdownCodeBlock as Pt } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
71
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Ft, MARKDOWN_TABLE_CSV_MIME_TYPE as It, MarkdownTableCopyFormat as Lt, serializeMarkdownTableRows as Rt } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
72
|
+
import { MarkdownTable as zt } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
73
|
+
import { MarkdownRenderer as Bt, defaultMarkdownComponents as Vt } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
74
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as Ht, DEFAULT_MARKDOWN_CLASS_NAMES as Ut } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
75
|
+
import { PlainTextRenderer as Wt } from "./components/MarkdownRenderer/PlainTextRenderer.js";
|
|
76
|
+
import { MDMessageViewer as Gt } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
77
|
+
import { MarkdownWithPlaceholders as Kt } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
78
|
+
import { buildInlineSegmentSource as qt, createInlineSegmentComponents as Jt, createRehypeInlineSegments as Yt } from "./utils/inline-segments.js";
|
|
79
|
+
import { useCollapsedText as Xt } from "./hooks/useCollapsedText.js";
|
|
80
|
+
import { useAvailableHeightCap as Zt } from "./hooks/useAvailableHeightCap.js";
|
|
81
|
+
import { useControlErrorAssociation as Qt } from "./hooks/useControlErrorAssociation.js";
|
|
82
|
+
import { useHasBeenTrue as $t } from "./hooks/useHasBeenTrue.js";
|
|
83
|
+
import { useIsMobile as en } from "./hooks/useIsMobile.js";
|
|
84
|
+
import { useIsTablet as tn } from "./hooks/useIsTablet.js";
|
|
85
|
+
import { useIsTextClipped as nn } from "./hooks/useIsTextClipped.js";
|
|
86
|
+
import { useIsVerticallyClamped as rn } from "./hooks/useIsVerticallyClamped.js";
|
|
87
|
+
import { useUnsavedChangesGuard as an } from "./hooks/useUnsavedChangesGuard.js";
|
|
88
|
+
import { useUnsavedChanges as on } from "./components/UnsavedChangesProvider/unsaved-changes-context.js";
|
|
89
|
+
import { useUnsavedChangesLeaveGuard as sn } from "./hooks/useUnsavedChangesLeaveGuard.js";
|
|
90
|
+
import { useUnsavedChangesLeaveConfirmation as cn } from "./hooks/useUnsavedChangesLeaveConfirmation.js";
|
|
91
|
+
import { UnsavedChangesProvider as ln } from "./components/UnsavedChangesProvider/UnsavedChangesProvider.js";
|
|
92
|
+
import { DialFileManagerActionProfile as un, DialFileManagerVariant as dn } from "./file-manager/file-manager-variant.js";
|
|
93
|
+
import { getParentFolderPath as fn, isHiddenPath as pn } from "./file-manager/path.js";
|
|
94
|
+
import { FileDownloadStatus as mn, FileUploadFailureReason as hn, FileUploadStatus as gn, isDownloadInProgress as _n, isUploadInProgress as vn } from "./file-manager/upload-batch.js";
|
|
95
|
+
import { useGridEditingScroll as yn } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
|
|
96
|
+
import { OperationLoaderModal as bn } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
97
|
+
import { isSkillSelectionUnsupported as xn } from "./utils/is-skill-selection-unsupported.js";
|
|
98
|
+
import { toConversationTransferQueueItems as Sn } from "./conversation-transfer/conversation-transfer-queue.js";
|
|
99
|
+
export { lt as ActionMenu, g as AttachmentErrorReason, _ as AttachmentType, Le as BASE_LG_ICON_PROPS, Re as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, jt as CHAT_SHARED_CLASS, Ht as COMPACT_MARKDOWN_CLASS_NAMES, v as CatalogEntityType, x as CodeBlockTheme, St as ConfirmationDialog, xt as ConfirmationFooter, vt as ConfirmationIdentityCard, yt as ConfirmationIdentityRow, bt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, it as CopyButton, at as CopyIconButton, Ut as DEFAULT_MARKDOWN_CLASS_NAMES, Ft as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, Ct as DELETE_CONFIRMATION_MAX_LISTED_NAMES, Ye as DESKTOP_BREAKPOINT_PX, Xe as DESKTOP_MEDIA_QUERY, Tt as DeleteConfirmationDialog, Et as DeleteConfirmationDrawer, wt as DeleteConfirmationView, rt as DeploymentIcon, un as DialFileManagerActionProfile, dn as DialFileManagerVariant, V as ENTITY_DESCRIPTION_MAX_LENGTH, H as ENTITY_INSTRUCTIONS_MAX_LENGTH, U as ENTITY_NAME_MAX_LENGTH, De as ENTITY_TYPE_BG_COLOR, Oe as ENTITY_TYPE_COLOR, gt as EntityHeader, mt as EntityTypeLabel, ht as FeaturedChip, mn as FileDownloadStatus, y as FileExtension, hn as FileUploadFailureReason, gn as FileUploadStatus, o as FilterTab, ze as HIDDEN_FILE, nt as InitialsAvatar, pt as ItemHeader, He as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Ue as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Ke as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, It as MARKDOWN_TABLE_CSV_MIME_TYPE, Gt as MDMessageViewer, b as MIMEType, S as MIME_TYPE_ALIASES, C as MIME_TYPE_AUDIO_PREFIX, w as MIME_TYPE_EXT_MAP, T as MIME_TYPE_WILDCARD, Ze as MOBILE_MAX_WIDTH_PX, Qe as MOBILE_MEDIA_QUERY, Pt as MarkdownCodeBlock, Bt as MarkdownRenderer, zt as MarkdownTable, Lt as MarkdownTableCopyFormat, Kt as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, dt as NewVersionAlert, ft as NotificationStack, bn as OperationLoaderModal, m as OrgUnitAction, h as OrgUnitNamespace, $e as PHONE_MEDIA_QUERY, I as PROHIBITED_CONVERSATION_NAME_CHARS_RE, ke as PROMPT_PARAM_DEFAULT_SEPARATOR, Ae as PROMPT_PARAM_PATTERN, je as PROMPT_VARIABLE_CLASS_NAME, Be as PUBLIC_BUCKET, ut as PanelEmptyState, Wt as PlainTextRenderer, We as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Ge as RESIZABLE_TEXTAREA_CLASS_NAME, K as RESOURCE_VERSION_PATTERN, u as RequestStatus, _t as ResourceSummary, p as ResponseFormat, qe as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, Je as SELECT_LIST_MAX_HEIGHT_PX, q as STORED_RESOURCE_VERSION_PATTERN, d as StageStatus, f as StatusEvent, et as TABLET_BREAKPOINT_PX, tt as TABLET_MEDIA_QUERY, Ve as TAG_INPUT_TAG_CLASS_NAME, Dt as TableHeader, At as TextRefinementField, Ot as TextRefinementState, ln as UnsavedChangesProvider, ye as base64ToBlob, Y as buildCssVars, qt as buildInlineSegmentSource, Me as buildPromptParamDefaults, X as canAccessAt, Z as canApprovePublicationsAt, Q as canReadAt, $ as canRequestPublicationAt, ee as canSaveToFolderAt, te as canWriteAt, ne as canWriteIntoOrgUnitAt, de as copyMarkdownAsRichText, ue as copyToClipboard, Jt as createInlineSegmentComponents, Yt as createRehypeInlineSegments, P as decodeJsonFromBase64, Vt as defaultMarkdownComponents, be as downloadTextFile, F as encodeJsonToBase64, xe as ensureDownloadFilename, W as exceedsMaxLength, ot as extractInitials, Ne as extractPromptParams, re as findOwningOrgUnit, ge as formatCost, he as formatFileSize, me as formatLastUsed, _e as formatPrice, ve as formatUnitPrice, Ie as generateUUID, E as getAttachmentTypeFromMime, D as getBaseMimeType, Se as getFileExtensionForLanguage, fn as getParentFolderPath, L as getUtf8ByteLength, G as hasControlCharacters, O as inferMimeTypeFromPath, j as isAnnotationSelector, le as isAudioTranscriptionSupported, _n as isDownloadInProgress, pn as isHiddenPath, ie as isOrgUnitTreeFolder, xn as isSkillSelectionUnsupported, oe as isStatusMessage, Ee as isSyntaxHighlightingAllowed, vn as isUploadInProgress, pe as makeOutsideInert, fe as markdownToRichTextHtml, J as mergeClasses, se as messageAttachmentToDisplayAttachment, ce as messageAttachmentsToDisplayAttachments, k as normalizeMimeType, ae as normalizeOrgUnitFolder, M as normalizePersistedHtmlTagAttachmentType, N as normalizeRawAnnotations, st as pickAvatarColor, Pe as rehypePromptVariables, Fe as resolvePromptParams, Nt as restrainedSyntaxTheme, R as sanitizeConversationName, Rt as serializeMarkdownTableRows, z as stripTrailingDots, A as stripUrlQueryAndFragment, Sn as toConversationTransferQueueItems, Ce as triggerAnchorDownload, we as triggerBlobDownload, B as truncateToUtf8Bytes, Te as tryBase64ToBytes, Zt as useAvailableHeightCap, Mt as useCodeCopy, Xt as useCollapsedText, Qt as useControlErrorAssociation, yn as useGridEditingScroll, $t as useHasBeenTrue, en as useIsMobile, ct as useIsPhone, tn as useIsTablet, nn as useIsTextClipped, rn as useIsVerticallyClamped, kt as useTextRefinement, on as useUnsavedChanges, an as useUnsavedChangesGuard, cn as useUnsavedChangesLeaveConfirmation, sn as useUnsavedChangesLeaveGuard };
|
package/package.json
CHANGED
package/utils/org-unit.d.ts
CHANGED
|
@@ -18,6 +18,18 @@ export declare const normalizeOrgUnitFolder: (folder: string) => string;
|
|
|
18
18
|
* @param publicPath - decoded path relative to the public bucket, e.g. `Acme/US Risk/Reports`
|
|
19
19
|
*/
|
|
20
20
|
export declare const findOwningOrgUnit: (units: readonly OrgUnit[], publicPath: string) => OrgUnit | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Whether `publicPath` belongs to the org-unit structure of the public bucket,
|
|
23
|
+
* i.e. should stay listed when org units are on: the public root, a unit's own
|
|
24
|
+
* folder, a folder inside a unit (see {@link findOwningOrgUnit}), or an
|
|
25
|
+
* ancestor of a unit folder at a segment boundary (`Acme/` when only
|
|
26
|
+
* `Acme/Risk/` is a unit). Any other public folder — and so its subtree — is a
|
|
27
|
+
* plain folder no unit owns. Describes the folder kind, not a right, so admin
|
|
28
|
+
* access is not consulted. `publicPath` is decoded and public-relative.
|
|
29
|
+
* @param units - units as returned by DIAL Core
|
|
30
|
+
* @param publicPath - decoded path relative to the public bucket, e.g. `Acme/Reports`
|
|
31
|
+
*/
|
|
32
|
+
export declare const isOrgUnitTreeFolder: (units: readonly OrgUnit[], publicPath: string) => boolean;
|
|
21
33
|
/**
|
|
22
34
|
* Whether the caller may do `action` on `namespace` at `publicPath`. A DIAL
|
|
23
35
|
* admin may anywhere; otherwise only the owning unit's `permissions` decide, so
|
package/utils/org-unit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/utils/org-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAmB5B;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,MAIvD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i } of c(e)) i.length > o && n.startsWith(i) && (r = t, o = i.length);
|
|
23
23
|
return r;
|
|
24
|
-
}, u = (e, t
|
|
24
|
+
}, u = (e, t) => {
|
|
25
|
+
let n = a(i(t));
|
|
26
|
+
return n === "" || l(e, t) ? !0 : c(e).some(({ folder: e }) => e !== "" && e.startsWith(n));
|
|
27
|
+
}, d = (e, t, n, r) => e.hasAdminAccess ? !0 : l(e.units, t)?.permissions?.[n]?.includes(r) ?? !1, f = (t, n, r) => d(t, n, r, e.Write), p = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : f(e, t, n), m = (e, t, n) => l(e.units, t) != null && f(e, t, n), h = (t, n, r) => d(t, n, r, e.Read), g = (e, n) => h(e, n, t.Publications) && f(e, n, t.Publications), _ = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : h(e, t, n);
|
|
25
28
|
//#endregion
|
|
26
|
-
export {
|
|
29
|
+
export { d as canAccessAt, g as canApprovePublicationsAt, h as canReadAt, _ as canRequestPublicationAt, p as canSaveToFolderAt, f as canWriteAt, m as canWriteIntoOrgUnitAt, l as findOwningOrgUnit, u as isOrgUnitTreeFolder, o as normalizeOrgUnitFolder };
|