@epam/ai-dial-chat-shared 1.4.0-dev.84 → 1.4.0-dev.89
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 +93 -92
- package/models/org-unit.d.ts +28 -0
- package/models/org-unit.d.ts.map +1 -1
- package/models/org-unit.js +8 -0
- package/package.json +2 -2
- package/utils/org-unit.d.ts +56 -7
- package/utils/org-unit.d.ts.map +1 -1
- package/utils/org-unit.js +19 -9
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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
|
|
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 };
|
package/models/org-unit.d.ts
CHANGED
|
@@ -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
|
package/models/org-unit.d.ts.map
CHANGED
|
@@ -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.
|
|
4
|
+
"version": "1.4.0-dev.89",
|
|
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.
|
|
37
|
+
"@epam/ai-dial-react-file-manager": "^0.4.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"ag-grid-community": "^35.3.0",
|
package/utils/org-unit.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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
|
|
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
|
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,KAAK,
|
|
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
|
|
3
|
+
var t = "public", n = (e) => {
|
|
3
4
|
try {
|
|
4
5
|
return decodeURIComponent(e);
|
|
5
6
|
} catch {
|
|
6
7
|
return e;
|
|
7
8
|
}
|
|
8
|
-
},
|
|
9
|
-
let [
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
let
|
|
13
|
-
return
|
|
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 {
|
|
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 };
|