@epam/ai-dial-chat-shared 1.4.0-dev.84 → 1.4.0-dev.90

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 CHANGED
@@ -2,95 +2,96 @@ import { ConversationTransferErrorCode as e, ConversationTransferJobStatus as t,
2
2
  import { ConversationKind as a, FilterTab as o } from "./models/conversation-classification.js";
3
3
  import { BackgroundGenerationStatus as s, MessageRating as c, MessageRole as l, RequestStatus as u, StageStatus as d, StatusEvent as f } from "./models/chat.js";
4
4
  import { ResponseFormat as p } from "./models/deployment-features.js";
5
- import { AttachmentErrorReason as m, AttachmentType as h } from "./types/attachment.js";
6
- import { CatalogEntityType as g } from "./types/entity-type.js";
7
- import { FileExtension as _, MIMEType as v } from "./types/mime-type.js";
8
- import { CodeBlockTheme as y } from "./types/code-editor.js";
9
- import { MIME_TYPE_ALIASES as b, MIME_TYPE_AUDIO_PREFIX as x, MIME_TYPE_EXT_MAP as S, MIME_TYPE_WILDCARD as C } from "./constants/mime-types.js";
10
- import { getAttachmentTypeFromMime as w, getBaseMimeType as T, inferMimeTypeFromPath as E, normalizeMimeType as D, stripUrlQueryAndFragment as O } from "./utils/mime-type.js";
11
- import { isAnnotationSelector as k, normalizePersistedHtmlTagAttachmentType as A, normalizeRawAnnotations as j } from "./utils/annotation.js";
12
- import { decodeJsonFromBase64 as M, encodeJsonToBase64 as N } from "./utils/base64-json.js";
13
- import { PROHIBITED_CONVERSATION_NAME_CHARS_RE as P, getUtf8ByteLength as F, sanitizeConversationName as I, stripTrailingDots as L, truncateToUtf8Bytes as R } from "./utils/string-utils.js";
14
- import { ENTITY_DESCRIPTION_MAX_LENGTH as z, ENTITY_INSTRUCTIONS_MAX_LENGTH as B, ENTITY_NAME_MAX_LENGTH as V, exceedsMaxLength as H, hasControlCharacters as U } from "./utils/entity-field-limits.js";
15
- import { RESOURCE_VERSION_PATTERN as W, STORED_RESOURCE_VERSION_PATTERN as G } from "./utils/resource-version.js";
16
- import { mergeClasses as K } from "./utils/merge-class.js";
17
- import { buildCssVars as q } from "./utils/build-css-vars.js";
18
- import { isOrgUnitFolder as J, normalizeOrgUnitFolder as Y, toOrgUnitFolderSet as X } from "./utils/org-unit.js";
19
- import { isStatusMessage as Z } from "./utils/message.js";
20
- import { messageAttachmentToDisplayAttachment as Q, messageAttachmentsToDisplayAttachments as $ } from "./utils/message-attachment-to-display.js";
21
- import { isAudioTranscriptionSupported as ee } from "./utils/is-audio-transcription-supported.js";
22
- import { copyMarkdownAsRichText as te, copyToClipboard as ne, markdownToRichTextHtml as re } from "./utils/copy-to-clipboard.js";
23
- import { makeOutsideInert as ie } from "./utils/dom.js";
24
- import { formatLastUsed as ae } from "./utils/format-last-used.js";
25
- import { formatFileSize as oe } from "./utils/format-file-size.js";
26
- import { formatCost as se, formatPrice as ce, formatUnitPrice as le } from "./utils/format-price.js";
27
- import { base64ToBlob as ue, downloadTextFile as de, ensureDownloadFilename as fe, getFileExtensionForLanguage as pe, triggerAnchorDownload as me, triggerBlobDownload as he, tryBase64ToBytes as ge } from "./utils/file-download.js";
28
- import { isSyntaxHighlightingAllowed as _e } from "./utils/syntax-highlighting.js";
29
- import { ENTITY_TYPE_BG_COLOR as ve, ENTITY_TYPE_COLOR as ye } from "./constants/entity-colors.js";
30
- import { PROMPT_PARAM_DEFAULT_SEPARATOR as be, PROMPT_PARAM_PATTERN as xe, PROMPT_VARIABLE_CLASS_NAME as Se, buildPromptParamDefaults as Ce, extractPromptParams as we, rehypePromptVariables as Te, resolvePromptParams as Ee } from "./utils/prompt-variables.js";
31
- import { generateUUID as De } from "./utils/generate-uuid.js";
32
- import { BASE_LG_ICON_PROPS as Oe, BASE_MD_ICON_PROPS as ke } from "./constants/icon.js";
33
- import { HIDDEN_FILE as Ae, PUBLIC_BUCKET as je } from "./constants/dial.js";
34
- import { TAG_INPUT_TAG_CLASS_NAME as Me } from "./constants/tag-input.js";
35
- import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as Ne, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as Pe, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as Fe, RESIZABLE_TEXTAREA_CLASS_NAME as Ie } from "./constants/resizable-fields.js";
36
- import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as Le } from "./constants/markdown-editor.js";
37
- import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as Re, SELECT_LIST_MAX_HEIGHT_PX as ze } from "./constants/select-list.js";
38
- import { DESKTOP_BREAKPOINT_PX as Be, DESKTOP_MEDIA_QUERY as Ve, MOBILE_MAX_WIDTH_PX as He, MOBILE_MEDIA_QUERY as Ue, PHONE_MEDIA_QUERY as We, TABLET_BREAKPOINT_PX as Ge, TABLET_MEDIA_QUERY as Ke } from "./constants/breakpoint.js";
39
- import { InitialsAvatar as qe } from "./components/InitialsAvatar/InitialsAvatar.js";
40
- import { DeploymentIcon as Je } from "./components/DeploymentIcon/DeploymentIcon.js";
41
- import { CopyButton as Ye, CopyIconButton as Xe } from "./components/CopyButton/CopyButton.js";
42
- import { extractInitials as Ze } from "./utils/initials.js";
43
- import { pickAvatarColor as Qe } from "./utils/avatar-color.js";
44
- import { useIsPhone as $e } from "./hooks/useIsPhone.js";
45
- import { ActionMenu as et } from "./components/ActionMenu/ActionMenu.js";
46
- import { PanelEmptyState as tt } from "./components/PanelEmptyState/PanelEmptyState.js";
47
- import { NewVersionAlert as nt } from "./components/NewVersionAlert/NewVersionAlert.js";
48
- import { NotificationStack as rt } from "./components/NotificationStack/NotificationStack.js";
49
- import { ItemHeader as it } from "./components/ItemHeader/ItemHeader.js";
50
- import { EntityTypeLabel as at } from "./components/EntityTypeLabel/EntityTypeLabel.js";
51
- import { FeaturedChip as ot } from "./components/FeaturedChip/FeaturedChip.js";
52
- import { EntityHeader as st } from "./components/EntityHeader/EntityHeader.js";
53
- import { ResourceSummary as ct } from "./components/ResourceSummary/ResourceSummary.js";
54
- import { ConfirmationIdentityCard as lt } from "./components/ConfirmationIdentityCard/ConfirmationIdentityCard.js";
55
- import { ConfirmationIdentityRow as ut } from "./components/ConfirmationIdentityRow/ConfirmationIdentityRow.js";
56
- import { ConfirmationView as dt } from "./components/ConfirmationView/ConfirmationView.js";
57
- import { ConfirmationFooter as ft } from "./components/ConfirmationView/ConfirmationFooter.js";
58
- import { ConfirmationDialog as pt } from "./components/ConfirmationDialog/ConfirmationDialog.js";
59
- import { DELETE_CONFIRMATION_MAX_LISTED_NAMES as mt, DeleteConfirmationView as ht } from "./components/DeleteConfirmationView/DeleteConfirmationView.js";
60
- import { DeleteConfirmationDialog as gt } from "./components/DeleteConfirmationDialog/DeleteConfirmationDialog.js";
61
- import { DeleteConfirmationDrawer as _t } from "./components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js";
62
- import { TableHeader as vt } from "./components/MarkdownRenderer/Table/TableHeader.js";
63
- import { TextRefinementState as yt, useTextRefinement as bt } from "./hooks/useTextRefinement.js";
64
- import { TextRefinementField as xt } from "./components/TextRefinementField/TextRefinementField.js";
65
- import { CHAT_SHARED_CLASS as St } from "./constants/public-class-names.js";
66
- import { useCodeCopy as Ct } from "./hooks/useCodeCopy.js";
67
- import { restrainedSyntaxTheme as wt } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
68
- import { MarkdownCodeBlock as Tt } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
69
- import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Et, MARKDOWN_TABLE_CSV_MIME_TYPE as Dt, MarkdownTableCopyFormat as Ot, serializeMarkdownTableRows as kt } from "./components/MarkdownRenderer/Table/table-serialization.js";
70
- import { MarkdownTable as At } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
71
- import { MarkdownRenderer as jt, defaultMarkdownComponents as Mt } from "./components/MarkdownRenderer/MarkdownRenderer.js";
72
- import { COMPACT_MARKDOWN_CLASS_NAMES as Nt, DEFAULT_MARKDOWN_CLASS_NAMES as Pt } from "./components/MarkdownRenderer/markdown-class-names.js";
73
- import { PlainTextRenderer as Ft } from "./components/MarkdownRenderer/PlainTextRenderer.js";
74
- import { MDMessageViewer as It } from "./components/MarkdownRenderer/MDMessageViewer.js";
75
- import { MarkdownWithPlaceholders as Lt } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
76
- import { buildInlineSegmentSource as Rt, createInlineSegmentComponents as zt, createRehypeInlineSegments as Bt } from "./utils/inline-segments.js";
77
- import { useCollapsedText as Vt } from "./hooks/useCollapsedText.js";
78
- import { useAvailableHeightCap as Ht } from "./hooks/useAvailableHeightCap.js";
79
- import { useControlErrorAssociation as Ut } from "./hooks/useControlErrorAssociation.js";
80
- import { useIsMobile as Wt } from "./hooks/useIsMobile.js";
81
- import { useIsTablet as Gt } from "./hooks/useIsTablet.js";
82
- import { useIsTextClipped as Kt } from "./hooks/useIsTextClipped.js";
83
- import { useIsVerticallyClamped as qt } from "./hooks/useIsVerticallyClamped.js";
84
- import { useUnsavedChangesGuard as Jt } from "./hooks/useUnsavedChangesGuard.js";
85
- import { useUnsavedChanges as Yt } from "./components/UnsavedChangesProvider/unsaved-changes-context.js";
86
- import { useUnsavedChangesLeaveGuard as Xt } from "./hooks/useUnsavedChangesLeaveGuard.js";
87
- import { useUnsavedChangesLeaveConfirmation as Zt } from "./hooks/useUnsavedChangesLeaveConfirmation.js";
88
- import { UnsavedChangesProvider as Qt } from "./components/UnsavedChangesProvider/UnsavedChangesProvider.js";
89
- import { DialFileManagerActionProfile as $t, DialFileManagerVariant as en } from "./file-manager/file-manager-variant.js";
90
- import { getParentFolderPath as tn, isHiddenPath as nn } from "./file-manager/path.js";
91
- import { FileDownloadStatus as rn, FileUploadFailureReason as an, FileUploadStatus as on, isDownloadInProgress as sn, isUploadInProgress as cn } from "./file-manager/upload-batch.js";
92
- import { useGridEditingScroll as ln } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
93
- import { OperationLoaderModal as un } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
94
- import { isSkillSelectionUnsupported as dn } from "./utils/is-skill-selection-unsupported.js";
95
- import { toConversationTransferQueueItems as fn } from "./conversation-transfer/conversation-transfer-queue.js";
96
- export { et as ActionMenu, m as AttachmentErrorReason, h as AttachmentType, Oe as BASE_LG_ICON_PROPS, ke as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, St as CHAT_SHARED_CLASS, Nt as COMPACT_MARKDOWN_CLASS_NAMES, g as CatalogEntityType, y as CodeBlockTheme, pt as ConfirmationDialog, ft as ConfirmationFooter, lt as ConfirmationIdentityCard, ut as ConfirmationIdentityRow, dt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, Ye as CopyButton, Xe as CopyIconButton, Pt as DEFAULT_MARKDOWN_CLASS_NAMES, Et as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, mt as DELETE_CONFIRMATION_MAX_LISTED_NAMES, Be as DESKTOP_BREAKPOINT_PX, Ve as DESKTOP_MEDIA_QUERY, gt as DeleteConfirmationDialog, _t as DeleteConfirmationDrawer, ht as DeleteConfirmationView, Je as DeploymentIcon, $t as DialFileManagerActionProfile, en as DialFileManagerVariant, z as ENTITY_DESCRIPTION_MAX_LENGTH, B as ENTITY_INSTRUCTIONS_MAX_LENGTH, V as ENTITY_NAME_MAX_LENGTH, ve as ENTITY_TYPE_BG_COLOR, ye as ENTITY_TYPE_COLOR, st as EntityHeader, at as EntityTypeLabel, ot as FeaturedChip, rn as FileDownloadStatus, _ as FileExtension, an as FileUploadFailureReason, on as FileUploadStatus, o as FilterTab, Ae as HIDDEN_FILE, qe as InitialsAvatar, it as ItemHeader, Ne as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Pe as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Le as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Dt as MARKDOWN_TABLE_CSV_MIME_TYPE, It as MDMessageViewer, v as MIMEType, b as MIME_TYPE_ALIASES, x as MIME_TYPE_AUDIO_PREFIX, S as MIME_TYPE_EXT_MAP, C as MIME_TYPE_WILDCARD, He as MOBILE_MAX_WIDTH_PX, Ue as MOBILE_MEDIA_QUERY, Tt as MarkdownCodeBlock, jt as MarkdownRenderer, At as MarkdownTable, Ot as MarkdownTableCopyFormat, Lt as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, nt as NewVersionAlert, rt as NotificationStack, un as OperationLoaderModal, We as PHONE_MEDIA_QUERY, P as PROHIBITED_CONVERSATION_NAME_CHARS_RE, be as PROMPT_PARAM_DEFAULT_SEPARATOR, xe as PROMPT_PARAM_PATTERN, Se as PROMPT_VARIABLE_CLASS_NAME, je as PUBLIC_BUCKET, tt as PanelEmptyState, Ft as PlainTextRenderer, Fe as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Ie as RESIZABLE_TEXTAREA_CLASS_NAME, W as RESOURCE_VERSION_PATTERN, u as RequestStatus, ct as ResourceSummary, p as ResponseFormat, Re as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, ze as SELECT_LIST_MAX_HEIGHT_PX, G as STORED_RESOURCE_VERSION_PATTERN, d as StageStatus, f as StatusEvent, Ge as TABLET_BREAKPOINT_PX, Ke as TABLET_MEDIA_QUERY, Me as TAG_INPUT_TAG_CLASS_NAME, vt as TableHeader, xt as TextRefinementField, yt as TextRefinementState, Qt as UnsavedChangesProvider, ue as base64ToBlob, q as buildCssVars, Rt as buildInlineSegmentSource, Ce as buildPromptParamDefaults, te as copyMarkdownAsRichText, ne as copyToClipboard, zt as createInlineSegmentComponents, Bt as createRehypeInlineSegments, M as decodeJsonFromBase64, Mt as defaultMarkdownComponents, de as downloadTextFile, N as encodeJsonToBase64, fe as ensureDownloadFilename, H as exceedsMaxLength, Ze as extractInitials, we as extractPromptParams, se as formatCost, oe as formatFileSize, ae as formatLastUsed, ce as formatPrice, le as formatUnitPrice, De as generateUUID, w as getAttachmentTypeFromMime, T as getBaseMimeType, pe as getFileExtensionForLanguage, tn as getParentFolderPath, F as getUtf8ByteLength, U as hasControlCharacters, E as inferMimeTypeFromPath, k as isAnnotationSelector, ee as isAudioTranscriptionSupported, sn as isDownloadInProgress, nn as isHiddenPath, J as isOrgUnitFolder, dn as isSkillSelectionUnsupported, Z as isStatusMessage, _e as isSyntaxHighlightingAllowed, cn as isUploadInProgress, ie as makeOutsideInert, re as markdownToRichTextHtml, K as mergeClasses, Q as messageAttachmentToDisplayAttachment, $ as messageAttachmentsToDisplayAttachments, D as normalizeMimeType, Y as normalizeOrgUnitFolder, A as normalizePersistedHtmlTagAttachmentType, j as normalizeRawAnnotations, Qe as pickAvatarColor, Te as rehypePromptVariables, Ee as resolvePromptParams, wt as restrainedSyntaxTheme, I as sanitizeConversationName, kt as serializeMarkdownTableRows, L as stripTrailingDots, O as stripUrlQueryAndFragment, fn as toConversationTransferQueueItems, X as toOrgUnitFolderSet, me as triggerAnchorDownload, he as triggerBlobDownload, R as truncateToUtf8Bytes, ge as tryBase64ToBytes, Ht as useAvailableHeightCap, Ct as useCodeCopy, Vt as useCollapsedText, Ut as useControlErrorAssociation, ln as useGridEditingScroll, Wt as useIsMobile, $e as useIsPhone, Gt as useIsTablet, Kt as useIsTextClipped, qt as useIsVerticallyClamped, bt as useTextRefinement, Yt as useUnsavedChanges, Jt as useUnsavedChangesGuard, Zt as useUnsavedChangesLeaveConfirmation, Xt as useUnsavedChangesLeaveGuard };
5
+ import { OrgUnitAction as m, OrgUnitNamespace as h } from "./models/org-unit.js";
6
+ import { AttachmentErrorReason as g, AttachmentType as _ } from "./types/attachment.js";
7
+ import { CatalogEntityType as v } from "./types/entity-type.js";
8
+ import { FileExtension as y, MIMEType as b } from "./types/mime-type.js";
9
+ import { CodeBlockTheme as x } from "./types/code-editor.js";
10
+ import { MIME_TYPE_ALIASES as S, MIME_TYPE_AUDIO_PREFIX as C, MIME_TYPE_EXT_MAP as w, MIME_TYPE_WILDCARD as T } from "./constants/mime-types.js";
11
+ import { getAttachmentTypeFromMime as E, getBaseMimeType as D, inferMimeTypeFromPath as O, normalizeMimeType as k, stripUrlQueryAndFragment as A } from "./utils/mime-type.js";
12
+ import { isAnnotationSelector as j, normalizePersistedHtmlTagAttachmentType as M, normalizeRawAnnotations as N } from "./utils/annotation.js";
13
+ import { decodeJsonFromBase64 as P, encodeJsonToBase64 as F } from "./utils/base64-json.js";
14
+ import { PROHIBITED_CONVERSATION_NAME_CHARS_RE as I, getUtf8ByteLength as L, sanitizeConversationName as R, stripTrailingDots as z, truncateToUtf8Bytes as B } from "./utils/string-utils.js";
15
+ import { ENTITY_DESCRIPTION_MAX_LENGTH as V, ENTITY_INSTRUCTIONS_MAX_LENGTH as H, ENTITY_NAME_MAX_LENGTH as U, exceedsMaxLength as W, hasControlCharacters as G } from "./utils/entity-field-limits.js";
16
+ import { RESOURCE_VERSION_PATTERN as K, STORED_RESOURCE_VERSION_PATTERN as q } from "./utils/resource-version.js";
17
+ import { mergeClasses as J } from "./utils/merge-class.js";
18
+ import { buildCssVars as Y } from "./utils/build-css-vars.js";
19
+ import { canAccessAt as X, canReadAt as Z, canRequestPublicationAt as Q, canSaveToFolderAt as $, canWriteAt as ee, canWriteIntoOrgUnitAt as te, findOwningOrgUnit as ne, normalizeOrgUnitFolder as re } from "./utils/org-unit.js";
20
+ import { isStatusMessage as ie } from "./utils/message.js";
21
+ import { messageAttachmentToDisplayAttachment as ae, messageAttachmentsToDisplayAttachments as oe } from "./utils/message-attachment-to-display.js";
22
+ import { isAudioTranscriptionSupported as se } from "./utils/is-audio-transcription-supported.js";
23
+ import { copyMarkdownAsRichText as ce, copyToClipboard as le, markdownToRichTextHtml as ue } from "./utils/copy-to-clipboard.js";
24
+ import { makeOutsideInert as de } from "./utils/dom.js";
25
+ import { formatLastUsed as fe } from "./utils/format-last-used.js";
26
+ import { formatFileSize as pe } from "./utils/format-file-size.js";
27
+ import { formatCost as me, formatPrice as he, formatUnitPrice as ge } from "./utils/format-price.js";
28
+ import { base64ToBlob as _e, downloadTextFile as ve, ensureDownloadFilename as ye, getFileExtensionForLanguage as be, triggerAnchorDownload as xe, triggerBlobDownload as Se, tryBase64ToBytes as Ce } from "./utils/file-download.js";
29
+ import { isSyntaxHighlightingAllowed as we } from "./utils/syntax-highlighting.js";
30
+ import { ENTITY_TYPE_BG_COLOR as Te, ENTITY_TYPE_COLOR as Ee } from "./constants/entity-colors.js";
31
+ import { PROMPT_PARAM_DEFAULT_SEPARATOR as De, PROMPT_PARAM_PATTERN as Oe, PROMPT_VARIABLE_CLASS_NAME as ke, buildPromptParamDefaults as Ae, extractPromptParams as je, rehypePromptVariables as Me, resolvePromptParams as Ne } from "./utils/prompt-variables.js";
32
+ import { generateUUID as Pe } from "./utils/generate-uuid.js";
33
+ import { BASE_LG_ICON_PROPS as Fe, BASE_MD_ICON_PROPS as Ie } from "./constants/icon.js";
34
+ import { HIDDEN_FILE as Le, PUBLIC_BUCKET as Re } from "./constants/dial.js";
35
+ import { TAG_INPUT_TAG_CLASS_NAME as ze } from "./constants/tag-input.js";
36
+ import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as Be, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as Ve, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as He, RESIZABLE_TEXTAREA_CLASS_NAME as Ue } from "./constants/resizable-fields.js";
37
+ import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as We } from "./constants/markdown-editor.js";
38
+ import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as Ge, SELECT_LIST_MAX_HEIGHT_PX as Ke } from "./constants/select-list.js";
39
+ import { DESKTOP_BREAKPOINT_PX as qe, DESKTOP_MEDIA_QUERY as Je, MOBILE_MAX_WIDTH_PX as Ye, MOBILE_MEDIA_QUERY as Xe, PHONE_MEDIA_QUERY as Ze, TABLET_BREAKPOINT_PX as Qe, TABLET_MEDIA_QUERY as $e } from "./constants/breakpoint.js";
40
+ import { InitialsAvatar as et } from "./components/InitialsAvatar/InitialsAvatar.js";
41
+ import { DeploymentIcon as tt } from "./components/DeploymentIcon/DeploymentIcon.js";
42
+ import { CopyButton as nt, CopyIconButton as rt } from "./components/CopyButton/CopyButton.js";
43
+ import { extractInitials as it } from "./utils/initials.js";
44
+ import { pickAvatarColor as at } from "./utils/avatar-color.js";
45
+ import { useIsPhone as ot } from "./hooks/useIsPhone.js";
46
+ import { ActionMenu as st } from "./components/ActionMenu/ActionMenu.js";
47
+ import { PanelEmptyState as ct } from "./components/PanelEmptyState/PanelEmptyState.js";
48
+ import { NewVersionAlert as lt } from "./components/NewVersionAlert/NewVersionAlert.js";
49
+ import { NotificationStack as ut } from "./components/NotificationStack/NotificationStack.js";
50
+ import { ItemHeader as dt } from "./components/ItemHeader/ItemHeader.js";
51
+ import { EntityTypeLabel as ft } from "./components/EntityTypeLabel/EntityTypeLabel.js";
52
+ import { FeaturedChip as pt } from "./components/FeaturedChip/FeaturedChip.js";
53
+ import { EntityHeader as mt } from "./components/EntityHeader/EntityHeader.js";
54
+ import { ResourceSummary as ht } from "./components/ResourceSummary/ResourceSummary.js";
55
+ import { ConfirmationIdentityCard as gt } from "./components/ConfirmationIdentityCard/ConfirmationIdentityCard.js";
56
+ import { ConfirmationIdentityRow as _t } from "./components/ConfirmationIdentityRow/ConfirmationIdentityRow.js";
57
+ import { ConfirmationView as vt } from "./components/ConfirmationView/ConfirmationView.js";
58
+ import { ConfirmationFooter as yt } from "./components/ConfirmationView/ConfirmationFooter.js";
59
+ import { ConfirmationDialog as bt } from "./components/ConfirmationDialog/ConfirmationDialog.js";
60
+ import { DELETE_CONFIRMATION_MAX_LISTED_NAMES as xt, DeleteConfirmationView as St } from "./components/DeleteConfirmationView/DeleteConfirmationView.js";
61
+ import { DeleteConfirmationDialog as Ct } from "./components/DeleteConfirmationDialog/DeleteConfirmationDialog.js";
62
+ import { DeleteConfirmationDrawer as wt } from "./components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js";
63
+ import { TableHeader as Tt } from "./components/MarkdownRenderer/Table/TableHeader.js";
64
+ import { TextRefinementState as Et, useTextRefinement as Dt } from "./hooks/useTextRefinement.js";
65
+ import { TextRefinementField as Ot } from "./components/TextRefinementField/TextRefinementField.js";
66
+ import { CHAT_SHARED_CLASS as kt } from "./constants/public-class-names.js";
67
+ import { useCodeCopy as At } from "./hooks/useCodeCopy.js";
68
+ import { restrainedSyntaxTheme as jt } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
69
+ import { MarkdownCodeBlock as Mt } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
70
+ import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Nt, MARKDOWN_TABLE_CSV_MIME_TYPE as Pt, MarkdownTableCopyFormat as Ft, serializeMarkdownTableRows as It } from "./components/MarkdownRenderer/Table/table-serialization.js";
71
+ import { MarkdownTable as Lt } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
72
+ import { MarkdownRenderer as Rt, defaultMarkdownComponents as zt } from "./components/MarkdownRenderer/MarkdownRenderer.js";
73
+ import { COMPACT_MARKDOWN_CLASS_NAMES as Bt, DEFAULT_MARKDOWN_CLASS_NAMES as Vt } from "./components/MarkdownRenderer/markdown-class-names.js";
74
+ import { PlainTextRenderer as Ht } from "./components/MarkdownRenderer/PlainTextRenderer.js";
75
+ import { MDMessageViewer as Ut } from "./components/MarkdownRenderer/MDMessageViewer.js";
76
+ import { MarkdownWithPlaceholders as Wt } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
77
+ import { buildInlineSegmentSource as Gt, createInlineSegmentComponents as Kt, createRehypeInlineSegments as qt } from "./utils/inline-segments.js";
78
+ import { useCollapsedText as Jt } from "./hooks/useCollapsedText.js";
79
+ import { useAvailableHeightCap as Yt } from "./hooks/useAvailableHeightCap.js";
80
+ import { useControlErrorAssociation as Xt } from "./hooks/useControlErrorAssociation.js";
81
+ import { useIsMobile as Zt } from "./hooks/useIsMobile.js";
82
+ import { useIsTablet as Qt } from "./hooks/useIsTablet.js";
83
+ import { useIsTextClipped as $t } from "./hooks/useIsTextClipped.js";
84
+ import { useIsVerticallyClamped as en } from "./hooks/useIsVerticallyClamped.js";
85
+ import { useUnsavedChangesGuard as tn } from "./hooks/useUnsavedChangesGuard.js";
86
+ import { useUnsavedChanges as nn } from "./components/UnsavedChangesProvider/unsaved-changes-context.js";
87
+ import { useUnsavedChangesLeaveGuard as rn } from "./hooks/useUnsavedChangesLeaveGuard.js";
88
+ import { useUnsavedChangesLeaveConfirmation as an } from "./hooks/useUnsavedChangesLeaveConfirmation.js";
89
+ import { UnsavedChangesProvider as on } from "./components/UnsavedChangesProvider/UnsavedChangesProvider.js";
90
+ import { DialFileManagerActionProfile as sn, DialFileManagerVariant as cn } from "./file-manager/file-manager-variant.js";
91
+ import { getParentFolderPath as ln, isHiddenPath as un } from "./file-manager/path.js";
92
+ import { FileDownloadStatus as dn, FileUploadFailureReason as fn, FileUploadStatus as pn, isDownloadInProgress as mn, isUploadInProgress as hn } from "./file-manager/upload-batch.js";
93
+ import { useGridEditingScroll as gn } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
94
+ import { OperationLoaderModal as _n } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
95
+ import { isSkillSelectionUnsupported as vn } from "./utils/is-skill-selection-unsupported.js";
96
+ import { toConversationTransferQueueItems as yn } from "./conversation-transfer/conversation-transfer-queue.js";
97
+ export { st as ActionMenu, g as AttachmentErrorReason, _ as AttachmentType, Fe as BASE_LG_ICON_PROPS, Ie as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, kt as CHAT_SHARED_CLASS, Bt as COMPACT_MARKDOWN_CLASS_NAMES, v as CatalogEntityType, x as CodeBlockTheme, bt as ConfirmationDialog, yt as ConfirmationFooter, gt as ConfirmationIdentityCard, _t as ConfirmationIdentityRow, vt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, nt as CopyButton, rt as CopyIconButton, Vt as DEFAULT_MARKDOWN_CLASS_NAMES, Nt as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, xt as DELETE_CONFIRMATION_MAX_LISTED_NAMES, qe as DESKTOP_BREAKPOINT_PX, Je as DESKTOP_MEDIA_QUERY, Ct as DeleteConfirmationDialog, wt as DeleteConfirmationDrawer, St as DeleteConfirmationView, tt as DeploymentIcon, sn as DialFileManagerActionProfile, cn as DialFileManagerVariant, V as ENTITY_DESCRIPTION_MAX_LENGTH, H as ENTITY_INSTRUCTIONS_MAX_LENGTH, U as ENTITY_NAME_MAX_LENGTH, Te as ENTITY_TYPE_BG_COLOR, Ee as ENTITY_TYPE_COLOR, mt as EntityHeader, ft as EntityTypeLabel, pt as FeaturedChip, dn as FileDownloadStatus, y as FileExtension, fn as FileUploadFailureReason, pn as FileUploadStatus, o as FilterTab, Le as HIDDEN_FILE, et as InitialsAvatar, dt as ItemHeader, Be as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Ve as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, We as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Pt as MARKDOWN_TABLE_CSV_MIME_TYPE, Ut 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, Ye as MOBILE_MAX_WIDTH_PX, Xe as MOBILE_MEDIA_QUERY, Mt as MarkdownCodeBlock, Rt as MarkdownRenderer, Lt as MarkdownTable, Ft as MarkdownTableCopyFormat, Wt as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, lt as NewVersionAlert, ut as NotificationStack, _n as OperationLoaderModal, m as OrgUnitAction, h as OrgUnitNamespace, Ze as PHONE_MEDIA_QUERY, I as PROHIBITED_CONVERSATION_NAME_CHARS_RE, De as PROMPT_PARAM_DEFAULT_SEPARATOR, Oe as PROMPT_PARAM_PATTERN, ke as PROMPT_VARIABLE_CLASS_NAME, Re as PUBLIC_BUCKET, ct as PanelEmptyState, Ht as PlainTextRenderer, He as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Ue as RESIZABLE_TEXTAREA_CLASS_NAME, K as RESOURCE_VERSION_PATTERN, u as RequestStatus, ht as ResourceSummary, p as ResponseFormat, Ge as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, Ke as SELECT_LIST_MAX_HEIGHT_PX, q as STORED_RESOURCE_VERSION_PATTERN, d as StageStatus, f as StatusEvent, Qe as TABLET_BREAKPOINT_PX, $e as TABLET_MEDIA_QUERY, ze as TAG_INPUT_TAG_CLASS_NAME, Tt as TableHeader, Ot as TextRefinementField, Et as TextRefinementState, on as UnsavedChangesProvider, _e as base64ToBlob, Y as buildCssVars, Gt as buildInlineSegmentSource, Ae as buildPromptParamDefaults, X as canAccessAt, Z as canReadAt, Q as canRequestPublicationAt, $ as canSaveToFolderAt, ee as canWriteAt, te as canWriteIntoOrgUnitAt, ce as copyMarkdownAsRichText, le as copyToClipboard, Kt as createInlineSegmentComponents, qt as createRehypeInlineSegments, P as decodeJsonFromBase64, zt as defaultMarkdownComponents, ve as downloadTextFile, F as encodeJsonToBase64, ye as ensureDownloadFilename, W as exceedsMaxLength, it as extractInitials, je as extractPromptParams, ne as findOwningOrgUnit, me as formatCost, pe as formatFileSize, fe as formatLastUsed, he as formatPrice, ge as formatUnitPrice, Pe as generateUUID, E as getAttachmentTypeFromMime, D as getBaseMimeType, be as getFileExtensionForLanguage, ln as getParentFolderPath, L as getUtf8ByteLength, G as hasControlCharacters, O as inferMimeTypeFromPath, j as isAnnotationSelector, se as isAudioTranscriptionSupported, mn as isDownloadInProgress, un as isHiddenPath, vn as isSkillSelectionUnsupported, ie as isStatusMessage, we as isSyntaxHighlightingAllowed, hn as isUploadInProgress, de as makeOutsideInert, ue as markdownToRichTextHtml, J as mergeClasses, ae as messageAttachmentToDisplayAttachment, oe as messageAttachmentsToDisplayAttachments, k as normalizeMimeType, re as normalizeOrgUnitFolder, M as normalizePersistedHtmlTagAttachmentType, N as normalizeRawAnnotations, at as pickAvatarColor, Me as rehypePromptVariables, Ne as resolvePromptParams, jt as restrainedSyntaxTheme, R as sanitizeConversationName, It as serializeMarkdownTableRows, z as stripTrailingDots, A as stripUrlQueryAndFragment, yn as toConversationTransferQueueItems, xe as triggerAnchorDownload, Se as triggerBlobDownload, B as truncateToUtf8Bytes, Ce as tryBase64ToBytes, Yt as useAvailableHeightCap, At as useCodeCopy, Jt as useCollapsedText, Xt as useControlErrorAssociation, gn as useGridEditingScroll, Zt as useIsMobile, ot as useIsPhone, Qt as useIsTablet, $t as useIsTextClipped, en as useIsVerticallyClamped, Dt as useTextRefinement, nn as useUnsavedChanges, tn as useUnsavedChangesGuard, an as useUnsavedChangesLeaveConfirmation, rn as useUnsavedChangesLeaveGuard };
@@ -9,5 +9,33 @@ export interface OrgUnit {
9
9
  path: string;
10
10
  /** Unit folder as DIAL Core returns it: url-encoded, with a trailing slash, e.g. `public/Acme/US%20Risk/`. */
11
11
  folder: string;
12
+ /**
13
+ * The caller's actions per Core namespace in this unit, e.g.
14
+ * `{ applications: ['read', 'write'] }`. Empty when the unit is reached only
15
+ * through its parent. Decisions use this map, never role names.
16
+ */
17
+ permissions: Record<string, string[]>;
18
+ }
19
+ /** DIAL Core resource namespaces an org unit grants actions on. */
20
+ export declare enum OrgUnitNamespace {
21
+ Files = "files",
22
+ Conversations = "conversations",
23
+ Prompts = "prompts",
24
+ Applications = "applications",
25
+ Toolsets = "toolsets",
26
+ Skills = "skills",
27
+ Projects = "projects",
28
+ Publications = "publications"
29
+ }
30
+ /** Actions Core grants per namespace in a unit. */
31
+ export declare enum OrgUnitAction {
32
+ Read = "read",
33
+ Write = "write"
34
+ }
35
+ /** The resolved org-unit data a right is decided from. */
36
+ export interface OrgUnitAccess {
37
+ /** `true` for a DIAL admin, who may act anywhere. */
38
+ hasAdminAccess: boolean;
39
+ units: readonly OrgUnit[];
12
40
  }
13
41
  //# sourceMappingURL=org-unit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/models/org-unit.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,8GAA8G;IAC9G,MAAM,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/models/org-unit.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,8GAA8G;IAC9G,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACvC;AAED,mEAAmE;AACnE,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED,mDAAmD;AACnD,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,qDAAqD;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,8 @@
1
+ //#region src/models/org-unit.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.Files = "files", e.Conversations = "conversations", e.Prompts = "prompts", e.Applications = "applications", e.Toolsets = "toolsets", e.Skills = "skills", e.Projects = "projects", e.Publications = "publications", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e.Read = "read", e.Write = "write", e;
6
+ }({});
7
+ //#endregion
8
+ export { t as OrgUnitAction, e as OrgUnitNamespace };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-shared",
3
3
  "description": "Shared domain models, utilities, and UI components for AI DIAL Chat libraries",
4
- "version": "1.4.0-dev.84",
4
+ "version": "1.4.0-dev.90",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "sideEffects": [
@@ -34,7 +34,7 @@
34
34
  "react": "^19.2.8",
35
35
  "react-dom": "^19.2.8",
36
36
  "@epam/ai-dial-ui-kit": "^0.16.0",
37
- "@epam/ai-dial-react-file-manager": "^0.4.2"
37
+ "@epam/ai-dial-react-file-manager": "^0.4.3"
38
38
  },
39
39
  "dependencies": {
40
40
  "ag-grid-community": "^35.3.0",
@@ -1,4 +1,4 @@
1
- import { OrgUnit } from '../models/org-unit';
1
+ import { OrgUnitAction, OrgUnit, OrgUnitAccess, OrgUnitNamespace } from '../models/org-unit';
2
2
  /**
3
3
  * Returns a unit's Core `folder` (url-encoded, rooted at `public/`, e.g.
4
4
  * `public/Acme/US%20Risk/`) as a decoded public-relative folder with one
@@ -6,12 +6,61 @@ import { OrgUnit } from '../models/org-unit';
6
6
  * folder outside `public/`.
7
7
  */
8
8
  export declare const normalizeOrgUnitFolder: (folder: string) => string;
9
- /** The normalised folders of `units`, for repeated {@link isOrgUnitFolder} lookups. */
10
- export declare const toOrgUnitFolderSet: (units: readonly OrgUnit[]) => ReadonlySet<string>;
11
9
  /**
12
- * Whether `publicPath` — a decoded path relative to the public bucket, as the
13
- * file manager and the publish tree show it (`Acme/US Risk`) — is a unit's own
14
- * folder. A folder inside a unit is not a unit.
10
+ * The unit that owns `publicPath`: the one whose normalised folder is the
11
+ * longest prefix of the path at a segment boundary. A unit's own folder belongs
12
+ * to it; the public root, a path under no listed unit and a sibling sharing
13
+ * leading characters (`Risk2/` vs `Risk/`) have no owner. `publicPath` is the
14
+ * decoded, public-relative path a tree shows and is not decoded again. The
15
+ * units' folders are normalised once per `units` array (keep the array
16
+ * identity stable between calls).
17
+ * @param units - units as returned by DIAL Core
18
+ * @param publicPath - decoded path relative to the public bucket, e.g. `Acme/US Risk/Reports`
15
19
  */
16
- export declare const isOrgUnitFolder: (unitFolders: ReadonlySet<string>, publicPath: string) => boolean;
20
+ export declare const findOwningOrgUnit: (units: readonly OrgUnit[], publicPath: string) => OrgUnit | undefined;
21
+ /**
22
+ * Whether the caller may do `action` on `namespace` at `publicPath`. A DIAL
23
+ * admin may anywhere; otherwise only the owning unit's `permissions` decide, so
24
+ * a path under no unit, a missing namespace or an empty list is `false`. Role
25
+ * names are never consulted and `write` does not imply `read`.
26
+ * @param access - resolved org-unit data
27
+ * @param publicPath - decoded public-relative path
28
+ * @param namespace - Core namespace of the resource type
29
+ * @param action - the action asked about
30
+ */
31
+ export declare const canAccessAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace, action: OrgUnitAction) => boolean;
32
+ /** {@link canAccessAt} for the `write` action. */
33
+ export declare const canWriteAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
34
+ /**
35
+ * Whether `publicPath` is a usable save destination: `true` for an admin and
36
+ * for a path under no listed unit (the plain public folders keep today's
37
+ * save-then-request flow), otherwise the owning unit must grant `write`.
38
+ * Unlike {@link canWriteAt}, which is strict, a path outside every unit is not
39
+ * refused here.
40
+ * @param access - resolved org-unit data
41
+ * @param publicPath - decoded public-relative path
42
+ * @param namespace - Core namespace of the resource type
43
+ */
44
+ export declare const canSaveToFolderAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
45
+ /**
46
+ * Whether the caller may write straight into `publicPath`: the path lies inside
47
+ * a listed unit and that unit (or the caller's admin access) grants `write`.
48
+ * Unlike {@link canSaveToFolderAt}, a path under no unit is `false` even for a
49
+ * DIAL admin, so plain public folders keep the save-then-publish flow.
50
+ * @param access - resolved org-unit data
51
+ * @param publicPath - decoded public-relative path
52
+ * @param namespace - Core namespace of the resource type
53
+ */
54
+ export declare const canWriteIntoOrgUnitAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
55
+ /** {@link canAccessAt} for the `read` action. */
56
+ export declare const canReadAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
57
+ /**
58
+ * Whether a publication request into `publicPath` can be sent: `true` for an
59
+ * admin and for a path under no listed unit (Core's folder rules decide there,
60
+ * the client does not block), otherwise the owner must grant `read`.
61
+ * @param access - resolved org-unit data
62
+ * @param publicPath - decoded public-relative path
63
+ * @param namespace - Core namespace of the resource type
64
+ */
65
+ export declare const canRequestPublicationAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
17
66
  //# sourceMappingURL=org-unit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/utils/org-unit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAmBlD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,MAIvD,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,SAAS,OAAO,EAAE,KACxB,WAAW,CAAC,MAAM,CAKlB,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,WAAW,CAAC,MAAM,CAAC,EAChC,YAAY,MAAM,KACjB,OAGF,CAAC"}
1
+ {"version":3,"file":"org-unit.d.ts","sourceRoot":"","sources":["../../src/utils/org-unit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAmB5B;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,MAIvD,CAAC;AAsBF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,SAAS,OAAO,EAAE,EACzB,YAAY,MAAM,KACjB,OAAO,GAAG,SAYZ,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,EAC3B,QAAQ,aAAa,KACpB,OAIF,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,UAAU,GACrB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAA0E,CAAC;AAE9E;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAIF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAEwC,CAAC;AAE5C,iDAAiD;AACjD,eAAO,MAAM,SAAS,GACpB,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAAyE,CAAC;AAE7E;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAIF,CAAC"}
package/utils/org-unit.js CHANGED
@@ -1,16 +1,26 @@
1
+ import { OrgUnitAction as e } from "../models/org-unit.js";
1
2
  //#region src/utils/org-unit.ts
2
- var e = (e) => {
3
+ var t = "public", n = (e) => {
3
4
  try {
4
5
  return decodeURIComponent(e);
5
6
  } catch {
6
7
  return e;
7
8
  }
8
- }, t = (e) => e.split("/").filter((e) => e !== ""), n = (e) => e.length === 0 ? "" : `${e.join("/")}/`, r = (r) => {
9
- let [i, ...a] = t(r);
10
- return i === "public" ? n(a.map(e)) : "";
11
- }, i = (e) => new Set(e.map(({ folder: e }) => r(e)).filter((e) => e !== "")), a = (e, r) => {
12
- let i = n(t(r));
13
- return i !== "" && e.has(i);
14
- };
9
+ }, r = (e) => e.split("/").filter((e) => e !== ""), i = (e) => e.length === 0 ? "" : `${e.join("/")}/`, a = (e) => {
10
+ let [a, ...o] = r(e);
11
+ return a === t ? i(o.map(n)) : "";
12
+ }, o = /* @__PURE__ */ new WeakMap(), s = (e) => {
13
+ let t = o.get(e);
14
+ return t || (t = e.map((e) => ({
15
+ unit: e,
16
+ folder: a(e.folder)
17
+ })), o.set(e, t)), t;
18
+ }, c = (e, t) => {
19
+ let n = i(r(t));
20
+ if (n === "") return;
21
+ let a, o = 0;
22
+ for (let { unit: t, folder: r } of s(e)) r.length > o && n.startsWith(r) && (a = t, o = r.length);
23
+ return a;
24
+ }, l = (e, t, n, r) => e.hasAdminAccess ? !0 : c(e.units, t)?.permissions?.[n]?.includes(r) ?? !1, u = (t, n, r) => l(t, n, r, e.Write), d = (e, t, n) => e.hasAdminAccess || !c(e.units, t) ? !0 : u(e, t, n), f = (e, t, n) => c(e.units, t) != null && u(e, t, n), p = (t, n, r) => l(t, n, r, e.Read), m = (e, t, n) => e.hasAdminAccess || !c(e.units, t) ? !0 : p(e, t, n);
15
25
  //#endregion
16
- export { a as isOrgUnitFolder, r as normalizeOrgUnitFolder, i as toOrgUnitFolderSet };
26
+ export { l as canAccessAt, p as canReadAt, m as canRequestPublicationAt, d as canSaveToFolderAt, u as canWriteAt, f as canWriteIntoOrgUnitAt, c as findOwningOrgUnit, a as normalizeOrgUnitFolder };