@epam/ai-dial-chat-shared 1.4.0-dev.126 → 1.4.0-dev.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +80 -80
- package/package.json +1 -1
- package/utils/org-unit.d.ts +10 -1
- package/utils/org-unit.d.ts.map +1 -1
- package/utils/org-unit.js +16 -16
package/index.js
CHANGED
|
@@ -16,83 +16,83 @@ 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,
|
|
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 { useIsMobile as
|
|
83
|
-
import { useIsTablet as
|
|
84
|
-
import { useIsTextClipped as
|
|
85
|
-
import { useIsVerticallyClamped as
|
|
86
|
-
import { useUnsavedChangesGuard as
|
|
87
|
-
import { useUnsavedChanges as
|
|
88
|
-
import { useUnsavedChangesLeaveGuard as
|
|
89
|
-
import { useUnsavedChangesLeaveConfirmation as
|
|
90
|
-
import { UnsavedChangesProvider as
|
|
91
|
-
import { DialFileManagerActionProfile as
|
|
92
|
-
import { getParentFolderPath as
|
|
93
|
-
import { FileDownloadStatus as
|
|
94
|
-
import { useGridEditingScroll as
|
|
95
|
-
import { OperationLoaderModal as
|
|
96
|
-
import { isSkillSelectionUnsupported as
|
|
97
|
-
import { toConversationTransferQueueItems as
|
|
98
|
-
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, normalizeOrgUnitFolder as ie } from "./utils/org-unit.js";
|
|
20
|
+
import { isStatusMessage as ae } from "./utils/message.js";
|
|
21
|
+
import { messageAttachmentToDisplayAttachment as oe, messageAttachmentsToDisplayAttachments as se } from "./utils/message-attachment-to-display.js";
|
|
22
|
+
import { isAudioTranscriptionSupported as ce } from "./utils/is-audio-transcription-supported.js";
|
|
23
|
+
import { copyToClipboard as le } from "./utils/copy-to-clipboard.js";
|
|
24
|
+
import { copyMarkdownAsRichText as ue, markdownToRichTextHtml as de } from "./utils/markdown-rich-text.js";
|
|
25
|
+
import { makeOutsideInert as fe } from "./utils/dom.js";
|
|
26
|
+
import { formatLastUsed as pe } from "./utils/format-last-used.js";
|
|
27
|
+
import { formatFileSize as me } from "./utils/format-file-size.js";
|
|
28
|
+
import { formatCost as he, formatPrice as ge, formatUnitPrice as _e } from "./utils/format-price.js";
|
|
29
|
+
import { base64ToBlob as ve, downloadTextFile as ye, ensureDownloadFilename as be, getFileExtensionForLanguage as xe, triggerAnchorDownload as Se, triggerBlobDownload as Ce, tryBase64ToBytes as we } from "./utils/file-download.js";
|
|
30
|
+
import { isSyntaxHighlightingAllowed as Te } from "./utils/syntax-highlighting.js";
|
|
31
|
+
import { ENTITY_TYPE_BG_COLOR as Ee, ENTITY_TYPE_COLOR as De } from "./constants/entity-colors.js";
|
|
32
|
+
import { PROMPT_PARAM_DEFAULT_SEPARATOR as Oe, PROMPT_PARAM_PATTERN as ke, PROMPT_VARIABLE_CLASS_NAME as Ae, buildPromptParamDefaults as je, extractPromptParams as Me, rehypePromptVariables as Ne, resolvePromptParams as Pe } from "./utils/prompt-variables.js";
|
|
33
|
+
import { generateUUID as Fe } from "./utils/generate-uuid.js";
|
|
34
|
+
import { BASE_LG_ICON_PROPS as Ie, BASE_MD_ICON_PROPS as Le } from "./constants/icon.js";
|
|
35
|
+
import { HIDDEN_FILE as Re, PUBLIC_BUCKET as ze } from "./constants/dial.js";
|
|
36
|
+
import { TAG_INPUT_TAG_CLASS_NAME as Be } from "./constants/tag-input.js";
|
|
37
|
+
import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as Ve, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as He, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as Ue, RESIZABLE_TEXTAREA_CLASS_NAME as We } from "./constants/resizable-fields.js";
|
|
38
|
+
import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as Ge } from "./constants/markdown-editor.js";
|
|
39
|
+
import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as Ke, SELECT_LIST_MAX_HEIGHT_PX as qe } from "./constants/select-list.js";
|
|
40
|
+
import { DESKTOP_BREAKPOINT_PX as Je, DESKTOP_MEDIA_QUERY as Ye, MOBILE_MAX_WIDTH_PX as Xe, MOBILE_MEDIA_QUERY as Ze, PHONE_MEDIA_QUERY as Qe, TABLET_BREAKPOINT_PX as $e, TABLET_MEDIA_QUERY as et } from "./constants/breakpoint.js";
|
|
41
|
+
import { InitialsAvatar as tt } from "./components/InitialsAvatar/InitialsAvatar.js";
|
|
42
|
+
import { DeploymentIcon as nt } from "./components/DeploymentIcon/DeploymentIcon.js";
|
|
43
|
+
import { CopyButton as rt, CopyIconButton as it } from "./components/CopyButton/CopyButton.js";
|
|
44
|
+
import { extractInitials as at } from "./utils/initials.js";
|
|
45
|
+
import { pickAvatarColor as ot } from "./utils/avatar-color.js";
|
|
46
|
+
import { useIsPhone as st } from "./hooks/useIsPhone.js";
|
|
47
|
+
import { ActionMenu as ct } from "./components/ActionMenu/ActionMenu.js";
|
|
48
|
+
import { PanelEmptyState as lt } from "./components/PanelEmptyState/PanelEmptyState.js";
|
|
49
|
+
import { NewVersionAlert as ut } from "./components/NewVersionAlert/NewVersionAlert.js";
|
|
50
|
+
import { NotificationStack as dt } from "./components/NotificationStack/NotificationStack.js";
|
|
51
|
+
import { ItemHeader as ft } from "./components/ItemHeader/ItemHeader.js";
|
|
52
|
+
import { EntityTypeLabel as pt } from "./components/EntityTypeLabel/EntityTypeLabel.js";
|
|
53
|
+
import { FeaturedChip as mt } from "./components/FeaturedChip/FeaturedChip.js";
|
|
54
|
+
import { EntityHeader as ht } from "./components/EntityHeader/EntityHeader.js";
|
|
55
|
+
import { ResourceSummary as gt } from "./components/ResourceSummary/ResourceSummary.js";
|
|
56
|
+
import { ConfirmationIdentityCard as _t } from "./components/ConfirmationIdentityCard/ConfirmationIdentityCard.js";
|
|
57
|
+
import { ConfirmationIdentityRow as vt } from "./components/ConfirmationIdentityRow/ConfirmationIdentityRow.js";
|
|
58
|
+
import { ConfirmationView as yt } from "./components/ConfirmationView/ConfirmationView.js";
|
|
59
|
+
import { ConfirmationFooter as bt } from "./components/ConfirmationView/ConfirmationFooter.js";
|
|
60
|
+
import { ConfirmationDialog as xt } from "./components/ConfirmationDialog/ConfirmationDialog.js";
|
|
61
|
+
import { DELETE_CONFIRMATION_MAX_LISTED_NAMES as St, DeleteConfirmationView as Ct } from "./components/DeleteConfirmationView/DeleteConfirmationView.js";
|
|
62
|
+
import { DeleteConfirmationDialog as wt } from "./components/DeleteConfirmationDialog/DeleteConfirmationDialog.js";
|
|
63
|
+
import { DeleteConfirmationDrawer as Tt } from "./components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js";
|
|
64
|
+
import { TableHeader as Et } from "./components/MarkdownRenderer/Table/TableHeader.js";
|
|
65
|
+
import { TextRefinementState as Dt, useTextRefinement as Ot } from "./hooks/useTextRefinement.js";
|
|
66
|
+
import { TextRefinementField as kt } from "./components/TextRefinementField/TextRefinementField.js";
|
|
67
|
+
import { CHAT_SHARED_CLASS as At } from "./constants/public-class-names.js";
|
|
68
|
+
import { useCodeCopy as jt } from "./hooks/useCodeCopy.js";
|
|
69
|
+
import { restrainedSyntaxTheme as Mt } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
70
|
+
import { MarkdownCodeBlock as Nt } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
71
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Pt, MARKDOWN_TABLE_CSV_MIME_TYPE as Ft, MarkdownTableCopyFormat as It, serializeMarkdownTableRows as Lt } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
72
|
+
import { MarkdownTable as Rt } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
73
|
+
import { MarkdownRenderer as zt, defaultMarkdownComponents as Bt } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
74
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as Vt, DEFAULT_MARKDOWN_CLASS_NAMES as Ht } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
75
|
+
import { PlainTextRenderer as Ut } from "./components/MarkdownRenderer/PlainTextRenderer.js";
|
|
76
|
+
import { MDMessageViewer as Wt } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
77
|
+
import { MarkdownWithPlaceholders as Gt } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
78
|
+
import { buildInlineSegmentSource as Kt, createInlineSegmentComponents as qt, createRehypeInlineSegments as Jt } from "./utils/inline-segments.js";
|
|
79
|
+
import { useCollapsedText as Yt } from "./hooks/useCollapsedText.js";
|
|
80
|
+
import { useAvailableHeightCap as Xt } from "./hooks/useAvailableHeightCap.js";
|
|
81
|
+
import { useControlErrorAssociation as Zt } from "./hooks/useControlErrorAssociation.js";
|
|
82
|
+
import { useIsMobile as Qt } from "./hooks/useIsMobile.js";
|
|
83
|
+
import { useIsTablet as $t } from "./hooks/useIsTablet.js";
|
|
84
|
+
import { useIsTextClipped as en } from "./hooks/useIsTextClipped.js";
|
|
85
|
+
import { useIsVerticallyClamped as tn } from "./hooks/useIsVerticallyClamped.js";
|
|
86
|
+
import { useUnsavedChangesGuard as nn } from "./hooks/useUnsavedChangesGuard.js";
|
|
87
|
+
import { useUnsavedChanges as rn } from "./components/UnsavedChangesProvider/unsaved-changes-context.js";
|
|
88
|
+
import { useUnsavedChangesLeaveGuard as an } from "./hooks/useUnsavedChangesLeaveGuard.js";
|
|
89
|
+
import { useUnsavedChangesLeaveConfirmation as on } from "./hooks/useUnsavedChangesLeaveConfirmation.js";
|
|
90
|
+
import { UnsavedChangesProvider as sn } from "./components/UnsavedChangesProvider/UnsavedChangesProvider.js";
|
|
91
|
+
import { DialFileManagerActionProfile as cn, DialFileManagerVariant as ln } from "./file-manager/file-manager-variant.js";
|
|
92
|
+
import { getParentFolderPath as un, isHiddenPath as dn } from "./file-manager/path.js";
|
|
93
|
+
import { FileDownloadStatus as fn, FileUploadFailureReason as pn, FileUploadStatus as mn, isDownloadInProgress as hn, isUploadInProgress as gn } from "./file-manager/upload-batch.js";
|
|
94
|
+
import { useGridEditingScroll as _n } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
|
|
95
|
+
import { OperationLoaderModal as vn } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
96
|
+
import { isSkillSelectionUnsupported as yn } from "./utils/is-skill-selection-unsupported.js";
|
|
97
|
+
import { toConversationTransferQueueItems as bn } from "./conversation-transfer/conversation-transfer-queue.js";
|
|
98
|
+
export { ct as ActionMenu, g as AttachmentErrorReason, _ as AttachmentType, Ie as BASE_LG_ICON_PROPS, Le as BASE_MD_ICON_PROPS, s as BackgroundGenerationStatus, At as CHAT_SHARED_CLASS, Vt as COMPACT_MARKDOWN_CLASS_NAMES, v as CatalogEntityType, x as CodeBlockTheme, xt as ConfirmationDialog, bt as ConfirmationFooter, _t as ConfirmationIdentityCard, vt as ConfirmationIdentityRow, yt as ConfirmationView, a as ConversationKind, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, rt as CopyButton, it as CopyIconButton, Ht as DEFAULT_MARKDOWN_CLASS_NAMES, Pt as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, St as DELETE_CONFIRMATION_MAX_LISTED_NAMES, Je as DESKTOP_BREAKPOINT_PX, Ye as DESKTOP_MEDIA_QUERY, wt as DeleteConfirmationDialog, Tt as DeleteConfirmationDrawer, Ct as DeleteConfirmationView, nt as DeploymentIcon, cn as DialFileManagerActionProfile, ln as DialFileManagerVariant, V as ENTITY_DESCRIPTION_MAX_LENGTH, H as ENTITY_INSTRUCTIONS_MAX_LENGTH, U as ENTITY_NAME_MAX_LENGTH, Ee as ENTITY_TYPE_BG_COLOR, De as ENTITY_TYPE_COLOR, ht as EntityHeader, pt as EntityTypeLabel, mt as FeaturedChip, fn as FileDownloadStatus, y as FileExtension, pn as FileUploadFailureReason, mn as FileUploadStatus, o as FilterTab, Re as HIDDEN_FILE, tt as InitialsAvatar, ft as ItemHeader, Ve as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, He as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Ge as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Ft as MARKDOWN_TABLE_CSV_MIME_TYPE, Wt 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, Xe as MOBILE_MAX_WIDTH_PX, Ze as MOBILE_MEDIA_QUERY, Nt as MarkdownCodeBlock, zt as MarkdownRenderer, Rt as MarkdownTable, It as MarkdownTableCopyFormat, Gt as MarkdownWithPlaceholders, c as MessageRating, l as MessageRole, ut as NewVersionAlert, dt as NotificationStack, vn as OperationLoaderModal, m as OrgUnitAction, h as OrgUnitNamespace, Qe as PHONE_MEDIA_QUERY, I as PROHIBITED_CONVERSATION_NAME_CHARS_RE, Oe as PROMPT_PARAM_DEFAULT_SEPARATOR, ke as PROMPT_PARAM_PATTERN, Ae as PROMPT_VARIABLE_CLASS_NAME, ze as PUBLIC_BUCKET, lt as PanelEmptyState, Ut as PlainTextRenderer, Ue as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, We as RESIZABLE_TEXTAREA_CLASS_NAME, K as RESOURCE_VERSION_PATTERN, u as RequestStatus, gt as ResourceSummary, p as ResponseFormat, Ke as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, qe as SELECT_LIST_MAX_HEIGHT_PX, q as STORED_RESOURCE_VERSION_PATTERN, d as StageStatus, f as StatusEvent, $e as TABLET_BREAKPOINT_PX, et as TABLET_MEDIA_QUERY, Be as TAG_INPUT_TAG_CLASS_NAME, Et as TableHeader, kt as TextRefinementField, Dt as TextRefinementState, sn as UnsavedChangesProvider, ve as base64ToBlob, Y as buildCssVars, Kt as buildInlineSegmentSource, je as buildPromptParamDefaults, X as canAccessAt, Z as canApprovePublicationsAt, Q as canReadAt, $ as canRequestPublicationAt, ee as canSaveToFolderAt, te as canWriteAt, ne as canWriteIntoOrgUnitAt, ue as copyMarkdownAsRichText, le as copyToClipboard, qt as createInlineSegmentComponents, Jt as createRehypeInlineSegments, P as decodeJsonFromBase64, Bt as defaultMarkdownComponents, ye as downloadTextFile, F as encodeJsonToBase64, be as ensureDownloadFilename, W as exceedsMaxLength, at as extractInitials, Me as extractPromptParams, re as findOwningOrgUnit, he as formatCost, me as formatFileSize, pe as formatLastUsed, ge as formatPrice, _e as formatUnitPrice, Fe as generateUUID, E as getAttachmentTypeFromMime, D as getBaseMimeType, xe as getFileExtensionForLanguage, un as getParentFolderPath, L as getUtf8ByteLength, G as hasControlCharacters, O as inferMimeTypeFromPath, j as isAnnotationSelector, ce as isAudioTranscriptionSupported, hn as isDownloadInProgress, dn as isHiddenPath, yn as isSkillSelectionUnsupported, ae as isStatusMessage, Te as isSyntaxHighlightingAllowed, gn as isUploadInProgress, fe as makeOutsideInert, de as markdownToRichTextHtml, J as mergeClasses, oe as messageAttachmentToDisplayAttachment, se as messageAttachmentsToDisplayAttachments, k as normalizeMimeType, ie as normalizeOrgUnitFolder, M as normalizePersistedHtmlTagAttachmentType, N as normalizeRawAnnotations, ot as pickAvatarColor, Ne as rehypePromptVariables, Pe as resolvePromptParams, Mt as restrainedSyntaxTheme, R as sanitizeConversationName, Lt as serializeMarkdownTableRows, z as stripTrailingDots, A as stripUrlQueryAndFragment, bn as toConversationTransferQueueItems, Se as triggerAnchorDownload, Ce as triggerBlobDownload, B as truncateToUtf8Bytes, we as tryBase64ToBytes, Xt as useAvailableHeightCap, jt as useCodeCopy, Yt as useCollapsedText, Zt as useControlErrorAssociation, _n as useGridEditingScroll, Qt as useIsMobile, st as useIsPhone, $t as useIsTablet, en as useIsTextClipped, tn as useIsVerticallyClamped, Ot as useTextRefinement, rn as useUnsavedChanges, nn as useUnsavedChangesGuard, on as useUnsavedChangesLeaveConfirmation, an as useUnsavedChangesLeaveGuard };
|
package/package.json
CHANGED
package/utils/org-unit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrgUnitAction, OrgUnit, OrgUnitAccess
|
|
1
|
+
import { OrgUnitAction, OrgUnitNamespace, OrgUnit, OrgUnitAccess } 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
|
|
@@ -54,6 +54,15 @@ export declare const canSaveToFolderAt: (access: OrgUnitAccess, publicPath: stri
|
|
|
54
54
|
export declare const canWriteIntoOrgUnitAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
|
|
55
55
|
/** {@link canAccessAt} for the `read` action. */
|
|
56
56
|
export declare const canReadAt: (access: OrgUnitAccess, publicPath: string, namespace: OrgUnitNamespace) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the caller may approve a publication into `publicPath`: a DIAL
|
|
59
|
+
* admin, or the owning unit grants both `read` and `write` on the
|
|
60
|
+
* `publications` namespace (a parent unit's grants do not extend to a child
|
|
61
|
+
* unit). A path under no listed unit is `false` for a non-admin.
|
|
62
|
+
* @param access - resolved org-unit data
|
|
63
|
+
* @param publicPath - decoded public-relative path
|
|
64
|
+
*/
|
|
65
|
+
export declare const canApprovePublicationsAt: (access: OrgUnitAccess, publicPath: string) => boolean;
|
|
57
66
|
/**
|
|
58
67
|
* Whether a publication request into `publicPath` can be sent: `true` for an
|
|
59
68
|
* admin and for a path under no listed unit (Core's folder rules decide there,
|
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,KAAK,OAAO,EACZ,KAAK,aAAa,
|
|
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,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,wBAAwB,GACnC,QAAQ,aAAa,EACrB,YAAY,MAAM,KACjB,OAE4D,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,EACrB,YAAY,MAAM,EAClB,WAAW,gBAAgB,KAC1B,OAIF,CAAC"}
|
package/utils/org-unit.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { OrgUnitAction as e } from "../models/org-unit.js";
|
|
1
|
+
import { OrgUnitAction as e, OrgUnitNamespace as t } from "../models/org-unit.js";
|
|
2
2
|
//#region src/utils/org-unit.ts
|
|
3
|
-
var
|
|
3
|
+
var n = "public", r = (e) => {
|
|
4
4
|
try {
|
|
5
5
|
return decodeURIComponent(e);
|
|
6
6
|
} catch {
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
},
|
|
10
|
-
let [
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
let t =
|
|
9
|
+
}, i = (e) => e.split("/").filter((e) => e !== ""), a = (e) => e.length === 0 ? "" : `${e.join("/")}/`, o = (e) => {
|
|
10
|
+
let [t, ...o] = i(e);
|
|
11
|
+
return t === n ? a(o.map(r)) : "";
|
|
12
|
+
}, s = /* @__PURE__ */ new WeakMap(), c = (e) => {
|
|
13
|
+
let t = s.get(e);
|
|
14
14
|
return t || (t = e.map((e) => ({
|
|
15
15
|
unit: e,
|
|
16
|
-
folder:
|
|
17
|
-
})),
|
|
18
|
-
},
|
|
19
|
-
let n = i(
|
|
16
|
+
folder: o(e.folder)
|
|
17
|
+
})), s.set(e, t)), t;
|
|
18
|
+
}, l = (e, t) => {
|
|
19
|
+
let n = a(i(t));
|
|
20
20
|
if (n === "") return;
|
|
21
|
-
let
|
|
22
|
-
for (let { unit: t, folder:
|
|
23
|
-
return
|
|
24
|
-
},
|
|
21
|
+
let r, o = 0;
|
|
22
|
+
for (let { unit: t, folder: i } of c(e)) i.length > o && n.startsWith(i) && (r = t, o = i.length);
|
|
23
|
+
return r;
|
|
24
|
+
}, u = (e, t, n, r) => e.hasAdminAccess ? !0 : l(e.units, t)?.permissions?.[n]?.includes(r) ?? !1, d = (t, n, r) => u(t, n, r, e.Write), f = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : d(e, t, n), p = (e, t, n) => l(e.units, t) != null && d(e, t, n), m = (t, n, r) => u(t, n, r, e.Read), h = (e, n) => m(e, n, t.Publications) && d(e, n, t.Publications), g = (e, t, n) => e.hasAdminAccess || !l(e.units, t) ? !0 : m(e, t, n);
|
|
25
25
|
//#endregion
|
|
26
|
-
export {
|
|
26
|
+
export { u as canAccessAt, h as canApprovePublicationsAt, m as canReadAt, g as canRequestPublicationAt, f as canSaveToFolderAt, d as canWriteAt, p as canWriteIntoOrgUnitAt, l as findOwningOrgUnit, o as normalizeOrgUnitFolder };
|