@memberjunction/ng-conversations 6.1.4 → 6.2.0-edge.1
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/README.md +36 -3
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts +19 -3
- package/dist/lib/components/active-tasks/active-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js +39 -7
- package/dist/lib/components/active-tasks/active-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts +74 -6
- package/dist/lib/components/agent/active-agent-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/agent/active-agent-indicator.component.js +111 -21
- package/dist/lib/components/agent/active-agent-indicator.component.js.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.d.ts +31 -5
- package/dist/lib/components/agent/agent-process-panel.component.d.ts.map +1 -1
- package/dist/lib/components/agent/agent-process-panel.component.js +71 -15
- package/dist/lib/components/agent/agent-process-panel.component.js.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts +65 -9
- package/dist/lib/components/artifact/artifact-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/artifact/artifact-share-modal.component.js +169 -57
- package/dist/lib/components/artifact/artifact-share-modal.component.js.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.d.ts +77 -11
- package/dist/lib/components/attachment/image-viewer.component.d.ts.map +1 -1
- package/dist/lib/components/attachment/image-viewer.component.js +181 -47
- package/dist/lib/components/attachment/image-viewer.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +129 -19
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +350 -116
- package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts +60 -8
- package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/artifact-create-modal.component.js +130 -46
- package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts +63 -3
- package/dist/lib/components/collection/collection-artifact-card.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-artifact-card.component.js +113 -19
- package/dist/lib/components/collection/collection-artifact-card.component.js.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.d.ts +54 -8
- package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-form-modal.component.js +130 -46
- package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.d.ts +70 -10
- package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-share-modal.component.js +175 -53
- package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.d.ts +89 -9
- package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-tree.component.js +220 -70
- package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
- package/dist/lib/components/collection/collection-view.component.d.ts +89 -11
- package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collection-view.component.js +154 -40
- package/dist/lib/components/collection/collection-view.component.js.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.d.ts +390 -38
- package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/collection/collections-full-view.component.js +951 -367
- package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.d.ts +213 -18
- package/dist/lib/components/composer/ai-composer.component.d.ts.map +1 -1
- package/dist/lib/components/composer/ai-composer.component.js +388 -44
- package/dist/lib/components/composer/ai-composer.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts +12 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-agent-picker.component.js +26 -4
- package/dist/lib/components/conversation/conversation-agent-picker.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +1090 -123
- package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-chat-area.component.js +2407 -731
- package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts +139 -19
- package/dist/lib/components/conversation/conversation-empty-state.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-empty-state.component.js +296 -59
- package/dist/lib/components/conversation/conversation-empty-state.component.js.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.d.ts +579 -78
- package/dist/lib/components/conversation/conversation-list.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/conversation-list.component.js +2322 -823
- package/dist/lib/components/conversation/conversation-list.component.js.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts +40 -4
- package/dist/lib/components/conversation/pinned-messages-panel.component.d.ts.map +1 -1
- package/dist/lib/components/conversation/pinned-messages-panel.component.js +72 -14
- package/dist/lib/components/conversation/pinned-messages-panel.component.js.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.d.ts +57 -11
- package/dist/lib/components/dialogs/input-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/input-dialog.component.js +128 -16
- package/dist/lib/components/dialogs/input-dialog.component.js.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts +68 -10
- package/dist/lib/components/dialogs/rating-dialog.component.d.ts.map +1 -1
- package/dist/lib/components/dialogs/rating-dialog.component.js +151 -27
- package/dist/lib/components/dialogs/rating-dialog.component.js.map +1 -1
- package/dist/lib/components/export/export-modal.component.d.ts +84 -10
- package/dist/lib/components/export/export-modal.component.d.ts.map +1 -1
- package/dist/lib/components/export/export-modal.component.js +173 -49
- package/dist/lib/components/export/export-modal.component.js.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts +29 -3
- package/dist/lib/components/global-tasks/global-tasks-panel.component.d.ts.map +1 -1
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js +58 -12
- package/dist/lib/components/global-tasks/global-tasks-panel.component.js.map +1 -1
- package/dist/lib/components/library/library-full-view.component.d.ts +57 -8
- package/dist/lib/components/library/library-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/library/library-full-view.component.js +119 -35
- package/dist/lib/components/library/library-full-view.component.js.map +1 -1
- package/dist/lib/components/members/members-modal.component.d.ts +76 -10
- package/dist/lib/components/members/members-modal.component.d.ts.map +1 -1
- package/dist/lib/components/members/members-modal.component.js +164 -50
- package/dist/lib/components/members/members-modal.component.js.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.d.ts +37 -5
- package/dist/lib/components/message/actionable-commands.component.d.ts.map +1 -1
- package/dist/lib/components/message/actionable-commands.component.js +82 -16
- package/dist/lib/components/message/actionable-commands.component.js.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.d.ts +46 -10
- package/dist/lib/components/message/conversation-message-rating.component.d.ts.map +1 -1
- package/dist/lib/components/message/conversation-message-rating.component.js +120 -36
- package/dist/lib/components/message/conversation-message-rating.component.js.map +1 -1
- package/dist/lib/components/message/message-input.component.d.ts +549 -74
- package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-input.component.js +1250 -421
- package/dist/lib/components/message/message-input.component.js.map +1 -1
- package/dist/lib/components/message/message-item.component.d.ts +411 -29
- package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-item.component.js +896 -222
- package/dist/lib/components/message/message-item.component.js.map +1 -1
- package/dist/lib/components/message/message-list.component.d.ts +288 -29
- package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
- package/dist/lib/components/message/message-list.component.js +561 -123
- package/dist/lib/components/message/message-list.component.js.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts +64 -5
- package/dist/lib/components/navigation/conversation-navigation.component.d.ts.map +1 -1
- package/dist/lib/components/navigation/conversation-navigation.component.js +101 -11
- package/dist/lib/components/navigation/conversation-navigation.component.js.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.d.ts +6 -2
- package/dist/lib/components/notification/activity-indicator.component.d.ts.map +1 -1
- package/dist/lib/components/notification/activity-indicator.component.js +13 -3
- package/dist/lib/components/notification/activity-indicator.component.js.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.d.ts +15 -3
- package/dist/lib/components/notification/notification-badge.component.d.ts.map +1 -1
- package/dist/lib/components/notification/notification-badge.component.js +36 -8
- package/dist/lib/components/notification/notification-badge.component.js.map +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.d.ts +1 -1
- package/dist/lib/components/overlay/chat-overlay.component.js +4 -4
- package/dist/lib/components/overlay/chat-overlay.component.js.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.d.ts +93 -11
- package/dist/lib/components/project/project-form-modal.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-form-modal.component.js +348 -87
- package/dist/lib/components/project/project-form-modal.component.js.map +1 -1
- package/dist/lib/components/project/project-selector.component.d.ts +78 -8
- package/dist/lib/components/project/project-selector.component.d.ts.map +1 -1
- package/dist/lib/components/project/project-selector.component.js +177 -46
- package/dist/lib/components/project/project-selector.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/channel-onboarding-panel.component.js.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js +1 -1
- package/dist/lib/components/realtime/channels/client-context-channel.js.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js +3 -0
- package/dist/lib/components/realtime/channels/realtime-channel-pane.component.js.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts +2 -1
- package/dist/lib/components/realtime/media/media-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/media/media-channel.js +1 -1
- package/dist/lib/components/realtime/media/media-channel.js.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
- package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-agent-banner.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts +3 -1
- package/dist/lib/components/realtime/realtime-composer.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-composer.component.js +26 -8
- package/dist/lib/components/realtime/realtime-composer.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-delegation-card.component.js +2 -2
- package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-session-overlay.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-overlay.component.js +19 -19
- package/dist/lib/components/realtime/realtime-session-overlay.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.d.ts +2 -3
- package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-state.js +3 -2
- package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts +17 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-thread.component.js +122 -45
- package/dist/lib/components/realtime/realtime-session-thread.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts +47 -31
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js +138 -124
- package/dist/lib/components/realtime/realtime-session-timeline-card.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js +4 -4
- package/dist/lib/components/realtime/realtime-surface-tabs.component.js.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts +2 -2
- package/dist/lib/components/realtime/realtime-surface-tabs.model.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js +3 -3
- package/dist/lib/components/realtime/realtime-surface-tabs.model.js.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.d.ts +13 -11
- package/dist/lib/components/realtime/realtime-ui-config.d.ts.map +1 -1
- package/dist/lib/components/realtime/realtime-ui-config.js +29 -25
- package/dist/lib/components/realtime/realtime-ui-config.js.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +1 -1
- package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +4 -2
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +7 -3
- package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
- package/dist/lib/components/search/search-panel.component.d.ts +133 -22
- package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
- package/dist/lib/components/search/search-panel.component.js +312 -83
- package/dist/lib/components/search/search-panel.component.js.map +1 -1
- package/dist/lib/components/share/share-modal.component.d.ts +69 -9
- package/dist/lib/components/share/share-modal.component.d.ts.map +1 -1
- package/dist/lib/components/share/share-modal.component.js +139 -31
- package/dist/lib/components/share/share-modal.component.js.map +1 -1
- package/dist/lib/components/shared/user-picker.component.d.ts +48 -8
- package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -1
- package/dist/lib/components/shared/user-picker.component.js +110 -30
- package/dist/lib/components/shared/user-picker.component.js.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts +114 -11
- package/dist/lib/components/sidebar/conversation-sidebar.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/conversation-sidebar.component.js +199 -21
- package/dist/lib/components/sidebar/conversation-sidebar.component.js.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts +20 -1
- package/dist/lib/components/sidebar/routines-section.component.d.ts.map +1 -1
- package/dist/lib/components/sidebar/routines-section.component.js +25 -5
- package/dist/lib/components/sidebar/routines-section.component.js.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.d.ts +19 -0
- package/dist/lib/components/slots/slot-interfaces.d.ts.map +1 -1
- package/dist/lib/components/slots/slot-interfaces.js.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.d.ts +95 -13
- package/dist/lib/components/task/tasks-full-view.component.d.ts.map +1 -1
- package/dist/lib/components/task/tasks-full-view.component.js +223 -75
- package/dist/lib/components/task/tasks-full-view.component.js.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.d.ts +46 -6
- package/dist/lib/components/tasks/task-widget.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/task-widget.component.js +100 -16
- package/dist/lib/components/tasks/task-widget.component.js.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +64 -7
- package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
- package/dist/lib/components/tasks/tasks-dropdown.component.js +127 -27
- package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.d.ts +66 -8
- package/dist/lib/components/thread/thread-panel.component.d.ts.map +1 -1
- package/dist/lib/components/thread/thread-panel.component.js +146 -36
- package/dist/lib/components/thread/thread-panel.component.js.map +1 -1
- package/dist/lib/components/toast/toast.component.d.ts +11 -1
- package/dist/lib/components/toast/toast.component.d.ts.map +1 -1
- package/dist/lib/components/toast/toast.component.js +25 -5
- package/dist/lib/components/toast/toast.component.js.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts +385 -42
- package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
- package/dist/lib/components/workspace/conversation-workspace.component.js +887 -291
- package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts +8 -0
- package/dist/lib/composer-plugins/base-conversation-mention.provider.d.ts.map +1 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js +8 -1
- package/dist/lib/composer-plugins/base-conversation-mention.provider.js.map +1 -1
- package/dist/lib/conversations.module.d.ts.map +1 -1
- package/dist/lib/conversations.module.js.map +1 -1
- package/dist/lib/directives/chat-slot.directive.d.ts +5 -1
- package/dist/lib/directives/chat-slot.directive.d.ts.map +1 -1
- package/dist/lib/directives/chat-slot.directive.js.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts +9 -1
- package/dist/lib/directives/search-shortcut.directive.d.ts.map +1 -1
- package/dist/lib/directives/search-shortcut.directive.js +14 -4
- package/dist/lib/directives/search-shortcut.directive.js.map +1 -1
- package/dist/lib/events/chat-events.d.ts +34 -7
- package/dist/lib/events/chat-events.d.ts.map +1 -1
- package/dist/lib/events/chat-events.js +37 -7
- package/dist/lib/events/chat-events.js.map +1 -1
- package/dist/lib/models/agent-turn.model.d.ts +103 -0
- package/dist/lib/models/agent-turn.model.d.ts.map +1 -0
- package/dist/lib/models/agent-turn.model.js +12 -0
- package/dist/lib/models/agent-turn.model.js.map +1 -0
- package/dist/lib/models/collection-view.model.js.map +1 -1
- package/dist/lib/models/conversation-state.model.d.ts +8 -0
- package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
- package/dist/lib/models/conversation-state.model.js.map +1 -1
- package/dist/lib/models/lazy-artifact-info.d.ts +44 -12
- package/dist/lib/models/lazy-artifact-info.d.ts.map +1 -1
- package/dist/lib/models/lazy-artifact-info.js +98 -34
- package/dist/lib/models/lazy-artifact-info.js.map +1 -1
- package/dist/lib/services/active-tasks.service.d.ts +30 -4
- package/dist/lib/services/active-tasks.service.d.ts.map +1 -1
- package/dist/lib/services/active-tasks.service.js +71 -19
- package/dist/lib/services/active-tasks.service.js.map +1 -1
- package/dist/lib/services/agent-state.service.d.ts +17 -1
- package/dist/lib/services/agent-state.service.d.ts.map +1 -1
- package/dist/lib/services/agent-state.service.js +48 -16
- package/dist/lib/services/agent-state.service.js.map +1 -1
- package/dist/lib/services/artifact-permission.service.d.ts +39 -0
- package/dist/lib/services/artifact-permission.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-permission.service.js +152 -17
- package/dist/lib/services/artifact-permission.service.js.map +1 -1
- package/dist/lib/services/artifact-state.service.d.ts +58 -5
- package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
- package/dist/lib/services/artifact-state.service.js +135 -35
- package/dist/lib/services/artifact-state.service.js.map +1 -1
- package/dist/lib/services/browser-realtime-media-host.d.ts +24 -0
- package/dist/lib/services/browser-realtime-media-host.d.ts.map +1 -0
- package/dist/lib/services/browser-realtime-media-host.js +95 -0
- package/dist/lib/services/browser-realtime-media-host.js.map +1 -0
- package/dist/lib/services/collection-permission.service.d.ts +28 -0
- package/dist/lib/services/collection-permission.service.d.ts.map +1 -1
- package/dist/lib/services/collection-permission.service.js +88 -32
- package/dist/lib/services/collection-permission.service.js.map +1 -1
- package/dist/lib/services/collection-state.service.d.ts +11 -1
- package/dist/lib/services/collection-state.service.d.ts.map +1 -1
- package/dist/lib/services/collection-state.service.js +25 -5
- package/dist/lib/services/collection-state.service.js.map +1 -1
- package/dist/lib/services/conversation-agent.service.d.ts +26 -4
- package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-agent.service.js +57 -18
- package/dist/lib/services/conversation-agent.service.js.map +1 -1
- package/dist/lib/services/conversation-attachment.service.d.ts +41 -2
- package/dist/lib/services/conversation-attachment.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-attachment.service.js +80 -13
- package/dist/lib/services/conversation-attachment.service.js.map +1 -1
- package/dist/lib/services/conversation-streaming.service.d.ts +22 -0
- package/dist/lib/services/conversation-streaming.service.d.ts.map +1 -1
- package/dist/lib/services/conversation-streaming.service.js +50 -10
- package/dist/lib/services/conversation-streaming.service.js.map +1 -1
- package/dist/lib/services/data-cache.service.d.ts +31 -0
- package/dist/lib/services/data-cache.service.d.ts.map +1 -1
- package/dist/lib/services/data-cache.service.js +71 -15
- package/dist/lib/services/data-cache.service.js.map +1 -1
- package/dist/lib/services/dialog.service.d.ts +13 -0
- package/dist/lib/services/dialog.service.d.ts.map +1 -1
- package/dist/lib/services/dialog.service.js +25 -5
- package/dist/lib/services/dialog.service.js.map +1 -1
- package/dist/lib/services/export.service.d.ts +2 -0
- package/dist/lib/services/export.service.d.ts.map +1 -1
- package/dist/lib/services/export.service.js +5 -1
- package/dist/lib/services/export.service.js.map +1 -1
- package/dist/lib/services/graphql-attachment-blob-store.d.ts +44 -0
- package/dist/lib/services/graphql-attachment-blob-store.d.ts.map +1 -0
- package/dist/lib/services/graphql-attachment-blob-store.js +113 -0
- package/dist/lib/services/graphql-attachment-blob-store.js.map +1 -0
- package/dist/lib/services/mention-autocomplete.service.d.ts +17 -141
- package/dist/lib/services/mention-autocomplete.service.d.ts.map +1 -1
- package/dist/lib/services/mention-autocomplete.service.js +15 -460
- package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
- package/dist/lib/services/mention-parser.service.d.ts +10 -0
- package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
- package/dist/lib/services/mention-parser.service.js +25 -5
- package/dist/lib/services/mention-parser.service.js.map +1 -1
- package/dist/lib/services/notification.service.d.ts +54 -6
- package/dist/lib/services/notification.service.d.ts.map +1 -1
- package/dist/lib/services/notification.service.js +123 -27
- package/dist/lib/services/notification.service.js.map +1 -1
- package/dist/lib/services/realtime-audio-recorder.d.ts +4 -4
- package/dist/lib/services/realtime-audio-recorder.js +12 -12
- package/dist/lib/services/realtime-audio-recorder.js.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.d.ts +4 -0
- package/dist/lib/services/realtime-pcm-wav.d.ts.map +1 -1
- package/dist/lib/services/realtime-pcm-wav.js +10 -2
- package/dist/lib/services/realtime-pcm-wav.js.map +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts +1 -1
- package/dist/lib/services/realtime-session-review.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session-review.service.js +1 -1
- package/dist/lib/services/realtime-session-review.service.js.map +1 -1
- package/dist/lib/services/realtime-session.service.d.ts +16 -1150
- package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
- package/dist/lib/services/realtime-session.service.js +28 -2430
- package/dist/lib/services/realtime-session.service.js.map +1 -1
- package/dist/lib/services/search.service.d.ts +42 -9
- package/dist/lib/services/search.service.d.ts.map +1 -1
- package/dist/lib/services/search.service.js +103 -23
- package/dist/lib/services/search.service.js.map +1 -1
- package/dist/lib/services/toast.service.d.ts +19 -1
- package/dist/lib/services/toast.service.d.ts.map +1 -1
- package/dist/lib/services/toast.service.js +45 -9
- package/dist/lib/services/toast.service.js.map +1 -1
- package/dist/lib/services/ui-command-handler.service.d.ts +16 -2
- package/dist/lib/services/ui-command-handler.service.d.ts.map +1 -1
- package/dist/lib/services/ui-command-handler.service.js +36 -8
- package/dist/lib/services/ui-command-handler.service.js.map +1 -1
- package/dist/lib/utils/agent-artifact-summary.d.ts +2 -2
- package/dist/lib/utils/agent-artifact-summary.js +3 -3
- package/dist/lib/utils/agent-artifact-summary.js.map +1 -1
- package/dist/lib/utils/agent-turn-routing.d.ts +69 -0
- package/dist/lib/utils/agent-turn-routing.d.ts.map +1 -0
- package/dist/lib/utils/agent-turn-routing.js +96 -0
- package/dist/lib/utils/agent-turn-routing.js.map +1 -0
- package/dist/lib/utils/artifact-panel-action.d.ts +15 -4
- package/dist/lib/utils/artifact-panel-action.d.ts.map +1 -1
- package/dist/lib/utils/artifact-panel-action.js +10 -2
- package/dist/lib/utils/artifact-panel-action.js.map +1 -1
- package/dist/lib/utils/distinct-artifacts.d.ts +2 -0
- package/dist/lib/utils/distinct-artifacts.d.ts.map +1 -1
- package/dist/lib/utils/distinct-artifacts.js +5 -1
- package/dist/lib/utils/distinct-artifacts.js.map +1 -1
- package/dist/lib/utils/plan-mode-preference.d.ts +2 -2
- package/dist/lib/utils/plan-mode-preference.js +6 -6
- package/dist/lib/utils/plan-mode-preference.js.map +1 -1
- package/dist/lib/utils/realtime-session-timeline.d.ts +8 -79
- package/dist/lib/utils/realtime-session-timeline.d.ts.map +1 -1
- package/dist/lib/utils/realtime-session-timeline.js +8 -89
- package/dist/lib/utils/realtime-session-timeline.js.map +1 -1
- package/dist/public-api.d.ts +5 -2
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +9 -2
- package/dist/public-api.js.map +1 -1
- package/package.json +33 -32
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +0 -384
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +0 -1
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +0 -231
- package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +0 -1
- package/dist/lib/services/delegation-result-parser.d.ts +0 -50
- package/dist/lib/services/delegation-result-parser.d.ts.map +0 -1
- package/dist/lib/services/delegation-result-parser.js +0 -60
- package/dist/lib/services/delegation-result-parser.js.map +0 -1
- package/dist/lib/services/narration-template.d.ts +0 -42
- package/dist/lib/services/narration-template.d.ts.map +0 -1
- package/dist/lib/services/narration-template.js +0 -73
- package/dist/lib/services/narration-template.js.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.d.ts +0 -13
- package/dist/lib/services/skill-picker-narrowing.d.ts.map +0 -1
- package/dist/lib/services/skill-picker-narrowing.js +0 -13
- package/dist/lib/services/skill-picker-narrowing.js.map +0 -1
|
@@ -15,7 +15,7 @@ export class CollectionPermissionService {
|
|
|
15
15
|
/**
|
|
16
16
|
* Load all permissions for a collection
|
|
17
17
|
*/
|
|
18
|
-
async
|
|
18
|
+
async LoadPermissions(collectionId, currentUser) {
|
|
19
19
|
const rv = RunView.FromMetadataProvider(this.Provider);
|
|
20
20
|
const result = await rv.RunView({
|
|
21
21
|
EntityName: 'MJ: Collection Permissions',
|
|
@@ -28,10 +28,14 @@ export class CollectionPermissionService {
|
|
|
28
28
|
}
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
31
|
+
/** @deprecated Use {@link LoadPermissions}. */
|
|
32
|
+
async loadPermissions(collectionId, currentUser) {
|
|
33
|
+
return this.LoadPermissions(collectionId, currentUser);
|
|
34
|
+
}
|
|
31
35
|
/**
|
|
32
36
|
* Check if user has permission for a collection
|
|
33
37
|
*/
|
|
34
|
-
async
|
|
38
|
+
async CheckPermission(collectionId, userId, currentUser) {
|
|
35
39
|
const rv = RunView.FromMetadataProvider(this.Provider);
|
|
36
40
|
const result = await rv.RunView({
|
|
37
41
|
EntityName: 'MJ: Collection Permissions',
|
|
@@ -44,10 +48,14 @@ export class CollectionPermissionService {
|
|
|
44
48
|
}
|
|
45
49
|
return null;
|
|
46
50
|
}
|
|
51
|
+
/** @deprecated Use {@link CheckPermission}. */
|
|
52
|
+
async checkPermission(collectionId, userId, currentUser) {
|
|
53
|
+
return this.CheckPermission(collectionId, userId, currentUser);
|
|
54
|
+
}
|
|
47
55
|
/**
|
|
48
56
|
* Check permissions for multiple collections at once (efficient bulk loading)
|
|
49
57
|
*/
|
|
50
|
-
async
|
|
58
|
+
async CheckBulkPermissions(collectionIds, userId, currentUser) {
|
|
51
59
|
const resultMap = new Map();
|
|
52
60
|
if (collectionIds.length === 0) {
|
|
53
61
|
return resultMap;
|
|
@@ -68,10 +76,14 @@ export class CollectionPermissionService {
|
|
|
68
76
|
}
|
|
69
77
|
return resultMap;
|
|
70
78
|
}
|
|
79
|
+
/** @deprecated Use {@link CheckBulkPermissions}. */
|
|
80
|
+
async checkBulkPermissions(collectionIds, userId, currentUser) {
|
|
81
|
+
return this.CheckBulkPermissions(collectionIds, userId, currentUser);
|
|
82
|
+
}
|
|
71
83
|
/**
|
|
72
84
|
* Grant permission to a user
|
|
73
85
|
*/
|
|
74
|
-
async
|
|
86
|
+
async GrantPermission(collectionId, userId, permissions, sharedByUserId, currentUser) {
|
|
75
87
|
const md = this.Provider;
|
|
76
88
|
const permission = await md.GetEntityObject('MJ: Collection Permissions', currentUser);
|
|
77
89
|
permission.CollectionID = collectionId;
|
|
@@ -87,15 +99,23 @@ export class CollectionPermissionService {
|
|
|
87
99
|
}
|
|
88
100
|
return permission;
|
|
89
101
|
}
|
|
102
|
+
/** @deprecated Use {@link GrantPermission}. */
|
|
103
|
+
async grantPermission(collectionId, userId, permissions, sharedByUserId, currentUser) {
|
|
104
|
+
return this.GrantPermission(collectionId, userId, permissions, sharedByUserId, currentUser);
|
|
105
|
+
}
|
|
90
106
|
/**
|
|
91
107
|
* Grant permission and cascade to all child collections
|
|
92
108
|
*/
|
|
93
|
-
async
|
|
109
|
+
async GrantPermissionCascade(collectionId, userId, permissions, sharedByUserId, currentUser) {
|
|
94
110
|
// Grant permission on current collection
|
|
95
|
-
await this.
|
|
111
|
+
await this.GrantPermission(collectionId, userId, permissions, sharedByUserId, currentUser);
|
|
96
112
|
// Grant permissions on all child collections recursively
|
|
97
113
|
await this.grantChildPermissions(collectionId, userId, permissions, sharedByUserId, currentUser);
|
|
98
114
|
}
|
|
115
|
+
/** @deprecated Use {@link GrantPermissionCascade}. */
|
|
116
|
+
async grantPermissionCascade(collectionId, userId, permissions, sharedByUserId, currentUser) {
|
|
117
|
+
return this.GrantPermissionCascade(collectionId, userId, permissions, sharedByUserId, currentUser);
|
|
118
|
+
}
|
|
99
119
|
/**
|
|
100
120
|
* Recursively grant permissions on all child collections
|
|
101
121
|
*/
|
|
@@ -109,14 +129,14 @@ export class CollectionPermissionService {
|
|
|
109
129
|
if (childrenResult.Success && childrenResult.Results) {
|
|
110
130
|
for (const child of childrenResult.Results) {
|
|
111
131
|
// Check if permission already exists
|
|
112
|
-
const existing = await this.
|
|
132
|
+
const existing = await this.CheckPermission(child.ID, userId, currentUser);
|
|
113
133
|
if (existing) {
|
|
114
134
|
// Permission exists, update it instead
|
|
115
|
-
await this.
|
|
135
|
+
await this.UpdatePermission(existing.id, permissions, currentUser);
|
|
116
136
|
}
|
|
117
137
|
else {
|
|
118
138
|
// Grant new permission
|
|
119
|
-
await this.
|
|
139
|
+
await this.GrantPermission(child.ID, userId, permissions, sharedByUserId, currentUser);
|
|
120
140
|
}
|
|
121
141
|
// Recursively grant to grandchildren
|
|
122
142
|
await this.grantChildPermissions(child.ID, userId, permissions, sharedByUserId, currentUser);
|
|
@@ -126,7 +146,7 @@ export class CollectionPermissionService {
|
|
|
126
146
|
/**
|
|
127
147
|
* Update existing permission
|
|
128
148
|
*/
|
|
129
|
-
async
|
|
149
|
+
async UpdatePermission(permissionId, permissions, currentUser) {
|
|
130
150
|
const md = this.Provider;
|
|
131
151
|
const permission = await md.GetEntityObject('MJ: Collection Permissions', currentUser);
|
|
132
152
|
await permission.Load(permissionId);
|
|
@@ -136,18 +156,26 @@ export class CollectionPermissionService {
|
|
|
136
156
|
permission.CanDelete = permissions.canDelete;
|
|
137
157
|
return await permission.Save();
|
|
138
158
|
}
|
|
159
|
+
/** @deprecated Use {@link UpdatePermission}. */
|
|
160
|
+
async updatePermission(permissionId, permissions, currentUser) {
|
|
161
|
+
return this.UpdatePermission(permissionId, permissions, currentUser);
|
|
162
|
+
}
|
|
139
163
|
/**
|
|
140
164
|
* Update permission and cascade to all child collections
|
|
141
165
|
*/
|
|
142
|
-
async
|
|
166
|
+
async UpdatePermissionCascade(collectionId, userId, permissions, currentUser) {
|
|
143
167
|
// Update permission on current collection
|
|
144
|
-
const permission = await this.
|
|
168
|
+
const permission = await this.CheckPermission(collectionId, userId, currentUser);
|
|
145
169
|
if (permission) {
|
|
146
|
-
await this.
|
|
170
|
+
await this.UpdatePermission(permission.id, permissions, currentUser);
|
|
147
171
|
}
|
|
148
172
|
// Get all child collections and update recursively
|
|
149
173
|
await this.updateChildPermissions(collectionId, userId, permissions, currentUser);
|
|
150
174
|
}
|
|
175
|
+
/** @deprecated Use {@link UpdatePermissionCascade}. */
|
|
176
|
+
async updatePermissionCascade(collectionId, userId, permissions, currentUser) {
|
|
177
|
+
return this.UpdatePermissionCascade(collectionId, userId, permissions, currentUser);
|
|
178
|
+
}
|
|
151
179
|
/**
|
|
152
180
|
* Recursively update permissions on all child collections
|
|
153
181
|
*/
|
|
@@ -161,9 +189,9 @@ export class CollectionPermissionService {
|
|
|
161
189
|
if (childrenResult.Success && childrenResult.Results) {
|
|
162
190
|
for (const child of childrenResult.Results) {
|
|
163
191
|
// Update permission if it exists for this user on the child collection
|
|
164
|
-
const childPermission = await this.
|
|
192
|
+
const childPermission = await this.CheckPermission(child.ID, userId, currentUser);
|
|
165
193
|
if (childPermission) {
|
|
166
|
-
await this.
|
|
194
|
+
await this.UpdatePermission(childPermission.id, permissions, currentUser);
|
|
167
195
|
}
|
|
168
196
|
// Recursively update grandchildren
|
|
169
197
|
await this.updateChildPermissions(child.ID, userId, permissions, currentUser);
|
|
@@ -173,24 +201,32 @@ export class CollectionPermissionService {
|
|
|
173
201
|
/**
|
|
174
202
|
* Revoke permission
|
|
175
203
|
*/
|
|
176
|
-
async
|
|
204
|
+
async RevokePermission(permissionId, currentUser) {
|
|
177
205
|
const md = this.Provider;
|
|
178
206
|
const permission = await md.GetEntityObject('MJ: Collection Permissions', currentUser);
|
|
179
207
|
await permission.Load(permissionId);
|
|
180
208
|
return await permission.Delete();
|
|
181
209
|
}
|
|
210
|
+
/** @deprecated Use {@link RevokePermission}. */
|
|
211
|
+
async revokePermission(permissionId, currentUser) {
|
|
212
|
+
return this.RevokePermission(permissionId, currentUser);
|
|
213
|
+
}
|
|
182
214
|
/**
|
|
183
215
|
* Revoke permission and cascade to all child collections
|
|
184
216
|
*/
|
|
185
|
-
async
|
|
217
|
+
async RevokePermissionCascade(collectionId, userId, currentUser) {
|
|
186
218
|
// Revoke permission on current collection
|
|
187
|
-
const permission = await this.
|
|
219
|
+
const permission = await this.CheckPermission(collectionId, userId, currentUser);
|
|
188
220
|
if (permission) {
|
|
189
|
-
await this.
|
|
221
|
+
await this.RevokePermission(permission.id, currentUser);
|
|
190
222
|
}
|
|
191
223
|
// Revoke permissions on all child collections recursively
|
|
192
224
|
await this.revokeChildPermissions(collectionId, userId, currentUser);
|
|
193
225
|
}
|
|
226
|
+
/** @deprecated Use {@link RevokePermissionCascade}. */
|
|
227
|
+
async revokePermissionCascade(collectionId, userId, currentUser) {
|
|
228
|
+
return this.RevokePermissionCascade(collectionId, userId, currentUser);
|
|
229
|
+
}
|
|
194
230
|
/**
|
|
195
231
|
* Recursively revoke permissions on all child collections
|
|
196
232
|
*/
|
|
@@ -204,9 +240,9 @@ export class CollectionPermissionService {
|
|
|
204
240
|
if (childrenResult.Success && childrenResult.Results) {
|
|
205
241
|
for (const child of childrenResult.Results) {
|
|
206
242
|
// Revoke permission if it exists for this user on the child collection
|
|
207
|
-
const childPermission = await this.
|
|
243
|
+
const childPermission = await this.CheckPermission(child.ID, userId, currentUser);
|
|
208
244
|
if (childPermission) {
|
|
209
|
-
await this.
|
|
245
|
+
await this.RevokePermission(childPermission.id, currentUser);
|
|
210
246
|
}
|
|
211
247
|
// Recursively revoke from grandchildren
|
|
212
248
|
await this.revokeChildPermissions(child.ID, userId, currentUser);
|
|
@@ -216,7 +252,7 @@ export class CollectionPermissionService {
|
|
|
216
252
|
/**
|
|
217
253
|
* Validate that requested permissions don't exceed granter's permissions
|
|
218
254
|
*/
|
|
219
|
-
|
|
255
|
+
ValidatePermissions(requested, granter, isOwner) {
|
|
220
256
|
if (isOwner)
|
|
221
257
|
return true; // Owner can grant anything
|
|
222
258
|
// Can't grant permissions you don't have
|
|
@@ -228,10 +264,14 @@ export class CollectionPermissionService {
|
|
|
228
264
|
return false;
|
|
229
265
|
return true;
|
|
230
266
|
}
|
|
267
|
+
/** @deprecated Use {@link ValidatePermissions}. */
|
|
268
|
+
validatePermissions(requested, granter, isOwner) {
|
|
269
|
+
return this.ValidatePermissions(requested, granter, isOwner);
|
|
270
|
+
}
|
|
231
271
|
/**
|
|
232
272
|
* Get available permissions for a user to grant based on their own permissions
|
|
233
273
|
*/
|
|
234
|
-
|
|
274
|
+
GetAvailablePermissions(userPermissions, isOwner) {
|
|
235
275
|
if (isOwner) {
|
|
236
276
|
return ['Read', 'Share', 'Edit', 'Delete'];
|
|
237
277
|
}
|
|
@@ -244,20 +284,24 @@ export class CollectionPermissionService {
|
|
|
244
284
|
available.push('Delete');
|
|
245
285
|
return available;
|
|
246
286
|
}
|
|
287
|
+
/** @deprecated Use {@link GetAvailablePermissions}. */
|
|
288
|
+
getAvailablePermissions(userPermissions, isOwner) {
|
|
289
|
+
return this.GetAvailablePermissions(userPermissions, isOwner);
|
|
290
|
+
}
|
|
247
291
|
/**
|
|
248
292
|
* Copy all permissions from parent collection to child collection
|
|
249
293
|
*/
|
|
250
|
-
async
|
|
251
|
-
const parentPermissions = await this.
|
|
294
|
+
async CopyParentPermissions(parentCollectionId, childCollectionId, currentUser) {
|
|
295
|
+
const parentPermissions = await this.LoadPermissions(parentCollectionId, currentUser);
|
|
252
296
|
for (const perm of parentPermissions) {
|
|
253
297
|
// Check if permission already exists for this user on the child collection
|
|
254
|
-
const existing = await this.
|
|
298
|
+
const existing = await this.CheckPermission(childCollectionId, perm.userId, currentUser);
|
|
255
299
|
if (existing) {
|
|
256
300
|
// Permission already exists (e.g., owner permission), skip to avoid duplicate
|
|
257
301
|
console.log(`Skipping duplicate permission for user ${perm.userId} on collection ${childCollectionId}`);
|
|
258
302
|
continue;
|
|
259
303
|
}
|
|
260
|
-
await this.
|
|
304
|
+
await this.GrantPermission(childCollectionId, perm.userId, {
|
|
261
305
|
canRead: perm.canRead,
|
|
262
306
|
canShare: perm.canShare,
|
|
263
307
|
canEdit: perm.canEdit,
|
|
@@ -265,20 +309,28 @@ export class CollectionPermissionService {
|
|
|
265
309
|
}, perm.sharedByUserId || currentUser.ID, currentUser);
|
|
266
310
|
}
|
|
267
311
|
}
|
|
312
|
+
/** @deprecated Use {@link CopyParentPermissions}. */
|
|
313
|
+
async copyParentPermissions(parentCollectionId, childCollectionId, currentUser) {
|
|
314
|
+
return this.CopyParentPermissions(parentCollectionId, childCollectionId, currentUser);
|
|
315
|
+
}
|
|
268
316
|
/**
|
|
269
317
|
* Delete all permissions for a collection
|
|
270
318
|
*/
|
|
271
|
-
async
|
|
272
|
-
const permissions = await this.
|
|
319
|
+
async DeleteAllPermissions(collectionId, currentUser) {
|
|
320
|
+
const permissions = await this.LoadPermissions(collectionId, currentUser);
|
|
273
321
|
for (const perm of permissions) {
|
|
274
|
-
await this.
|
|
322
|
+
await this.RevokePermission(perm.id, currentUser);
|
|
275
323
|
}
|
|
276
324
|
}
|
|
325
|
+
/** @deprecated Use {@link DeleteAllPermissions}. */
|
|
326
|
+
async deleteAllPermissions(collectionId, currentUser) {
|
|
327
|
+
return this.DeleteAllPermissions(collectionId, currentUser);
|
|
328
|
+
}
|
|
277
329
|
/**
|
|
278
330
|
* Create owner permission record (all permissions enabled)
|
|
279
331
|
*/
|
|
280
|
-
async
|
|
281
|
-
await this.
|
|
332
|
+
async CreateOwnerPermission(collectionId, ownerId, currentUser) {
|
|
333
|
+
await this.GrantPermission(collectionId, ownerId, {
|
|
282
334
|
canRead: true,
|
|
283
335
|
canShare: true,
|
|
284
336
|
canEdit: true,
|
|
@@ -286,6 +338,10 @@ export class CollectionPermissionService {
|
|
|
286
338
|
}, ownerId, // Owner grants to themselves
|
|
287
339
|
currentUser);
|
|
288
340
|
}
|
|
341
|
+
/** @deprecated Use {@link CreateOwnerPermission}. */
|
|
342
|
+
async createOwnerPermission(collectionId, ownerId, currentUser) {
|
|
343
|
+
return this.CreateOwnerPermission(collectionId, ownerId, currentUser);
|
|
344
|
+
}
|
|
289
345
|
mapToPermission(entity) {
|
|
290
346
|
return {
|
|
291
347
|
id: entity.ID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-permission.service.js","sourceRoot":"","sources":["../../../src/lib/services/collection-permission.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAY,OAAO,EAAE,QAAQ,EAAqB,MAAM,sBAAsB,CAAC;;AA2BtF,MAAM,OAAO,2BAA2B;IAC5B,SAAS,GAA6B,IAAI,CAAC;IAEnD;;OAEG;IACH,IAAW,QAAQ,CAAC,KAA+B;QAC/C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CAAC,YAAoB,EAAE,WAAqB;QAC7D,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAA+B;YAC1D,UAAU,EAAE,4BAA4B;YACxC,WAAW,EAAE,iBAAiB,YAAY,GAAG;YAC7C,OAAO,EAAE,oBAAoB;Y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AAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI;SAClB,EACD,OAAO,EAAE,6BAA6B;QACtC,WAAW,CACd,CAAC;IACN,CAAC;IAEO,eAAe,CAAC,MAAoC;QACxD,OAAO;YACH,EAAE,EAAE,MAAM,CAAC,EAAE;YACb,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,QAAQ,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI;YAC7C,gBAAgB,EAAE,MAAM,CAAC,YAAY,IAAI,IAAI;YAC7C,QAAQ,EAAE,MAAM,CAAC,cAAc;SAClC,CAAC;IACN,CAAC;qHAraQ,2BAA2B;gEAA3B,2BAA2B,WAA3B,2BAA2B,mBAFxB,MAAM;;iFAET,2BAA2B;cAHvC,UAAU;eAAC;gBACR,UAAU,EAAE,MAAM;aACrB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { UserInfo, RunView, Metadata, IMetadataProvider } from '@memberjunction/core';\nimport { MJCollectionPermissionEntity } from '@memberjunction/core-entities';\n\nexport interface CollectionPermission {\n id: string;\n collectionId: string;\n userId: string;\n userName: string;\n canRead: boolean;\n canShare: boolean;\n canEdit: boolean;\n canDelete: boolean;\n sharedByUserId: string | null;\n sharedByUserName: string | null;\n sharedAt: Date;\n}\n\nexport interface PermissionSet {\n canRead: boolean;\n canShare: boolean;\n canEdit: boolean;\n canDelete: boolean;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollectionPermissionService {\n private _provider: IMetadataProvider | null = null;\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all permissions for a collection\n */\n async loadPermissions(collectionId: string, currentUser: UserInfo): Promise<CollectionPermission[]> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `CollectionID='${collectionId}'`,\n OrderBy: '__mj_CreatedAt ASC',\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results) {\n return result.Results.map(p => this.mapToPermission(p));\n }\n return [];\n }\n\n /**\n * Check if user has permission for a collection\n */\n async checkPermission(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<CollectionPermission | null> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `CollectionID='${collectionId}' AND UserID='${userId}'`,\n MaxRows: 1,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n return this.mapToPermission(result.Results[0]);\n }\n return null;\n }\n\n /**\n * Check permissions for multiple collections at once (efficient bulk loading)\n */\n async checkBulkPermissions(\n collectionIds: string[],\n userId: string,\n currentUser: UserInfo\n ): Promise<Map<string, CollectionPermission>> {\n const resultMap = new Map<string, CollectionPermission>();\n\n if (collectionIds.length === 0) {\n return resultMap;\n }\n\n // Build filter for all collection IDs\n const collectionFilter = collectionIds.map(id => `CollectionID='${id}'`).join(' OR ');\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `(${collectionFilter}) AND UserID='${userId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results) {\n for (const entity of result.Results) {\n const permission = this.mapToPermission(entity);\n resultMap.set(entity.CollectionID, permission);\n }\n }\n\n return resultMap;\n }\n\n /**\n * Grant permission to a user\n */\n async grantPermission(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<MJCollectionPermissionEntity> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n permission.CollectionID = collectionId;\n permission.UserID = userId;\n permission.CanRead = permissions.canRead;\n permission.CanShare = permissions.canShare;\n permission.CanEdit = permissions.canEdit;\n permission.CanDelete = permissions.canDelete;\n permission.SharedByUserID = sharedByUserId;\n\n const saved = await permission.Save();\n if (!saved) {\n throw new Error(permission.LatestResult?.Message || 'Failed to grant permission');\n }\n\n return permission;\n }\n\n /**\n * Grant permission and cascade to all child collections\n */\n async grantPermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<void> {\n // Grant permission on current collection\n await this.grantPermission(collectionId, userId, permissions, sharedByUserId, currentUser);\n\n // Grant permissions on all child collections recursively\n await this.grantChildPermissions(collectionId, userId, permissions, sharedByUserId, currentUser);\n }\n\n /**\n * Recursively grant permissions on all child collections\n */\n private async grantChildPermissions(\n parentCollectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Check if permission already exists\n const existing = await this.checkPermission(child.ID, userId, currentUser);\n\n if (existing) {\n // Permission exists, update it instead\n await this.updatePermission(existing.id, permissions, currentUser);\n } else {\n // Grant new permission\n await this.grantPermission(child.ID, userId, permissions, sharedByUserId, currentUser);\n }\n\n // Recursively grant to grandchildren\n await this.grantChildPermissions(child.ID, userId, permissions, sharedByUserId, currentUser);\n }\n }\n }\n\n /**\n * Update existing permission\n */\n async updatePermission(\n permissionId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<boolean> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n await permission.Load(permissionId);\n permission.CanRead = permissions.canRead;\n permission.CanShare = permissions.canShare;\n permission.CanEdit = permissions.canEdit;\n permission.CanDelete = permissions.canDelete;\n\n return await permission.Save();\n }\n\n /**\n * Update permission and cascade to all child collections\n */\n async updatePermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<void> {\n // Update permission on current collection\n const permission = await this.checkPermission(collectionId, userId, currentUser);\n if (permission) {\n await this.updatePermission(permission.id, permissions, currentUser);\n }\n\n // Get all child collections and update recursively\n await this.updateChildPermissions(collectionId, userId, permissions, currentUser);\n }\n\n /**\n * Recursively update permissions on all child collections\n */\n private async updateChildPermissions(\n parentCollectionId: string,\n userId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Update permission if it exists for this user on the child collection\n const childPermission = await this.checkPermission(child.ID, userId, currentUser);\n if (childPermission) {\n await this.updatePermission(childPermission.id, permissions, currentUser);\n }\n\n // Recursively update grandchildren\n await this.updateChildPermissions(child.ID, userId, permissions, currentUser);\n }\n }\n }\n\n /**\n * Revoke permission\n */\n async revokePermission(permissionId: string, currentUser: UserInfo): Promise<boolean> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n await permission.Load(permissionId);\n return await permission.Delete();\n }\n\n /**\n * Revoke permission and cascade to all child collections\n */\n async revokePermissionCascade(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<void> {\n // Revoke permission on current collection\n const permission = await this.checkPermission(collectionId, userId, currentUser);\n if (permission) {\n await this.revokePermission(permission.id, currentUser);\n }\n\n // Revoke permissions on all child collections recursively\n await this.revokeChildPermissions(collectionId, userId, currentUser);\n }\n\n /**\n * Recursively revoke permissions on all child collections\n */\n private async revokeChildPermissions(\n parentCollectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Revoke permission if it exists for this user on the child collection\n const childPermission = await this.checkPermission(child.ID, userId, currentUser);\n if (childPermission) {\n await this.revokePermission(childPermission.id, currentUser);\n }\n\n // Recursively revoke from grandchildren\n await this.revokeChildPermissions(child.ID, userId, currentUser);\n }\n }\n }\n\n /**\n * Validate that requested permissions don't exceed granter's permissions\n */\n validatePermissions(\n requested: PermissionSet,\n granter: PermissionSet,\n isOwner: boolean\n ): boolean {\n if (isOwner) return true; // Owner can grant anything\n\n // Can't grant permissions you don't have\n if (requested.canShare && !granter.canShare) return false;\n if (requested.canEdit && !granter.canEdit) return false;\n if (requested.canDelete && !granter.canDelete) return false;\n\n return true;\n }\n\n /**\n * Get available permissions for a user to grant based on their own permissions\n */\n getAvailablePermissions(userPermissions: PermissionSet, isOwner: boolean): string[] {\n if (isOwner) {\n return ['Read', 'Share', 'Edit', 'Delete'];\n }\n\n const available = ['Read']; // Always have read\n if (userPermissions.canShare) available.push('Share');\n if (userPermissions.canEdit) available.push('Edit');\n if (userPermissions.canDelete) available.push('Delete');\n\n return available;\n }\n\n /**\n * Copy all permissions from parent collection to child collection\n */\n async copyParentPermissions(\n parentCollectionId: string,\n childCollectionId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const parentPermissions = await this.loadPermissions(parentCollectionId, currentUser);\n\n for (const perm of parentPermissions) {\n // Check if permission already exists for this user on the child collection\n const existing = await this.checkPermission(childCollectionId, perm.userId, currentUser);\n\n if (existing) {\n // Permission already exists (e.g., owner permission), skip to avoid duplicate\n console.log(`Skipping duplicate permission for user ${perm.userId} on collection ${childCollectionId}`);\n continue;\n }\n\n await this.grantPermission(\n childCollectionId,\n perm.userId,\n {\n canRead: perm.canRead,\n canShare: perm.canShare,\n canEdit: perm.canEdit,\n canDelete: perm.canDelete\n },\n perm.sharedByUserId || currentUser.ID,\n currentUser\n );\n }\n }\n\n /**\n * Delete all permissions for a collection\n */\n async deleteAllPermissions(collectionId: string, currentUser: UserInfo): Promise<void> {\n const permissions = await this.loadPermissions(collectionId, currentUser);\n\n for (const perm of permissions) {\n await this.revokePermission(perm.id, currentUser);\n }\n }\n\n /**\n * Create owner permission record (all permissions enabled)\n */\n async createOwnerPermission(\n collectionId: string,\n ownerId: string,\n currentUser: UserInfo\n ): Promise<void> {\n await this.grantPermission(\n collectionId,\n ownerId,\n {\n canRead: true,\n canShare: true,\n canEdit: true,\n canDelete: true\n },\n ownerId, // Owner grants to themselves\n currentUser\n );\n }\n\n private mapToPermission(entity: MJCollectionPermissionEntity): CollectionPermission {\n return {\n id: entity.ID,\n collectionId: entity.CollectionID,\n userId: entity.UserID,\n userName: entity.User || '',\n canRead: entity.CanRead,\n canShare: entity.CanShare,\n canEdit: entity.CanEdit,\n canDelete: entity.CanDelete,\n sharedByUserId: entity.SharedByUserID || null,\n sharedByUserName: entity.SharedByUser || null,\n sharedAt: entity.__mj_CreatedAt\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collection-permission.service.js","sourceRoot":"","sources":["../../../src/lib/services/collection-permission.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,E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gEAA3B,2BAA2B,WAA3B,2BAA2B,mBAFxB,MAAM;;iFAET,2BAA2B;cAHvC,UAAU;eAAC;gBACR,UAAU,EAAE,MAAM;aACrB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { UserInfo, RunView, Metadata, IMetadataProvider } from '@memberjunction/core';\nimport { MJCollectionPermissionEntity } from '@memberjunction/core-entities';\n\nexport interface CollectionPermission {\n id: string;\n collectionId: string;\n userId: string;\n userName: string;\n canRead: boolean;\n canShare: boolean;\n canEdit: boolean;\n canDelete: boolean;\n sharedByUserId: string | null;\n sharedByUserName: string | null;\n sharedAt: Date;\n}\n\nexport interface PermissionSet {\n canRead: boolean;\n canShare: boolean;\n canEdit: boolean;\n canDelete: boolean;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class CollectionPermissionService {\n private _provider: IMetadataProvider | null = null;\n\n /**\n * Set the metadata provider this service should use. When unset, falls back to Metadata.Provider.\n */\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Load all permissions for a collection\n */\n async LoadPermissions(collectionId: string, currentUser: UserInfo): Promise<CollectionPermission[]> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `CollectionID='${collectionId}'`,\n OrderBy: '__mj_CreatedAt ASC',\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results) {\n return result.Results.map(p => this.mapToPermission(p));\n }\n return [];\n }\n\n /** @deprecated Use {@link LoadPermissions}. */\n async loadPermissions(collectionId: string, currentUser: UserInfo): Promise<CollectionPermission[]> {\n return this.LoadPermissions(collectionId, currentUser);\n }\n\n /**\n * Check if user has permission for a collection\n */\n async CheckPermission(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<CollectionPermission | null> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `CollectionID='${collectionId}' AND UserID='${userId}'`,\n MaxRows: 1,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results && result.Results.length > 0) {\n return this.mapToPermission(result.Results[0]);\n }\n return null;\n }\n\n /** @deprecated Use {@link CheckPermission}. */\n async checkPermission(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<CollectionPermission | null> {\n return this.CheckPermission(collectionId, userId, currentUser);\n }\n\n /**\n * Check permissions for multiple collections at once (efficient bulk loading)\n */\n async CheckBulkPermissions(\n collectionIds: string[],\n userId: string,\n currentUser: UserInfo\n ): Promise<Map<string, CollectionPermission>> {\n const resultMap = new Map<string, CollectionPermission>();\n\n if (collectionIds.length === 0) {\n return resultMap;\n }\n\n // Build filter for all collection IDs\n const collectionFilter = collectionIds.map(id => `CollectionID='${id}'`).join(' OR ');\n const rv = RunView.FromMetadataProvider(this.Provider);\n const result = await rv.RunView<MJCollectionPermissionEntity>({\n EntityName: 'MJ: Collection Permissions',\n ExtraFilter: `(${collectionFilter}) AND UserID='${userId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (result.Success && result.Results) {\n for (const entity of result.Results) {\n const permission = this.mapToPermission(entity);\n resultMap.set(entity.CollectionID, permission);\n }\n }\n\n return resultMap;\n }\n\n /** @deprecated Use {@link CheckBulkPermissions}. */\n async checkBulkPermissions(\n collectionIds: string[],\n userId: string,\n currentUser: UserInfo\n ): Promise<Map<string, CollectionPermission>> {\n return this.CheckBulkPermissions(collectionIds, userId, currentUser);\n }\n\n /**\n * Grant permission to a user\n */\n async GrantPermission(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<MJCollectionPermissionEntity> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n permission.CollectionID = collectionId;\n permission.UserID = userId;\n permission.CanRead = permissions.canRead;\n permission.CanShare = permissions.canShare;\n permission.CanEdit = permissions.canEdit;\n permission.CanDelete = permissions.canDelete;\n permission.SharedByUserID = sharedByUserId;\n\n const saved = await permission.Save();\n if (!saved) {\n throw new Error(permission.LatestResult?.Message || 'Failed to grant permission');\n }\n\n return permission;\n }\n\n /** @deprecated Use {@link GrantPermission}. */\n async grantPermission(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<MJCollectionPermissionEntity> {\n return this.GrantPermission(collectionId, userId, permissions, sharedByUserId, currentUser);\n }\n\n /**\n * Grant permission and cascade to all child collections\n */\n async GrantPermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<void> {\n // Grant permission on current collection\n await this.GrantPermission(collectionId, userId, permissions, sharedByUserId, currentUser);\n\n // Grant permissions on all child collections recursively\n await this.grantChildPermissions(collectionId, userId, permissions, sharedByUserId, currentUser);\n }\n\n /** @deprecated Use {@link GrantPermissionCascade}. */\n async grantPermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<void> {\n return this.GrantPermissionCascade(collectionId, userId, permissions, sharedByUserId, currentUser);\n }\n\n /**\n * Recursively grant permissions on all child collections\n */\n private async grantChildPermissions(\n parentCollectionId: string,\n userId: string,\n permissions: PermissionSet,\n sharedByUserId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Check if permission already exists\n const existing = await this.CheckPermission(child.ID, userId, currentUser);\n\n if (existing) {\n // Permission exists, update it instead\n await this.UpdatePermission(existing.id, permissions, currentUser);\n } else {\n // Grant new permission\n await this.GrantPermission(child.ID, userId, permissions, sharedByUserId, currentUser);\n }\n\n // Recursively grant to grandchildren\n await this.grantChildPermissions(child.ID, userId, permissions, sharedByUserId, currentUser);\n }\n }\n }\n\n /**\n * Update existing permission\n */\n async UpdatePermission(\n permissionId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<boolean> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n await permission.Load(permissionId);\n permission.CanRead = permissions.canRead;\n permission.CanShare = permissions.canShare;\n permission.CanEdit = permissions.canEdit;\n permission.CanDelete = permissions.canDelete;\n\n return await permission.Save();\n }\n\n /** @deprecated Use {@link UpdatePermission}. */\n async updatePermission(\n permissionId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<boolean> {\n return this.UpdatePermission(permissionId, permissions, currentUser);\n }\n\n /**\n * Update permission and cascade to all child collections\n */\n async UpdatePermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<void> {\n // Update permission on current collection\n const permission = await this.CheckPermission(collectionId, userId, currentUser);\n if (permission) {\n await this.UpdatePermission(permission.id, permissions, currentUser);\n }\n\n // Get all child collections and update recursively\n await this.updateChildPermissions(collectionId, userId, permissions, currentUser);\n }\n\n /** @deprecated Use {@link UpdatePermissionCascade}. */\n async updatePermissionCascade(\n collectionId: string,\n userId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<void> {\n return this.UpdatePermissionCascade(collectionId, userId, permissions, currentUser);\n }\n\n /**\n * Recursively update permissions on all child collections\n */\n private async updateChildPermissions(\n parentCollectionId: string,\n userId: string,\n permissions: PermissionSet,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Update permission if it exists for this user on the child collection\n const childPermission = await this.CheckPermission(child.ID, userId, currentUser);\n if (childPermission) {\n await this.UpdatePermission(childPermission.id, permissions, currentUser);\n }\n\n // Recursively update grandchildren\n await this.updateChildPermissions(child.ID, userId, permissions, currentUser);\n }\n }\n }\n\n /**\n * Revoke permission\n */\n async RevokePermission(permissionId: string, currentUser: UserInfo): Promise<boolean> {\n const md = this.Provider;\n const permission = await md.GetEntityObject<MJCollectionPermissionEntity>(\n 'MJ: Collection Permissions',\n currentUser\n );\n\n await permission.Load(permissionId);\n return await permission.Delete();\n }\n\n /** @deprecated Use {@link RevokePermission}. */\n async revokePermission(permissionId: string, currentUser: UserInfo): Promise<boolean> {\n return this.RevokePermission(permissionId, currentUser);\n }\n\n /**\n * Revoke permission and cascade to all child collections\n */\n async RevokePermissionCascade(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<void> {\n // Revoke permission on current collection\n const permission = await this.CheckPermission(collectionId, userId, currentUser);\n if (permission) {\n await this.RevokePermission(permission.id, currentUser);\n }\n\n // Revoke permissions on all child collections recursively\n await this.revokeChildPermissions(collectionId, userId, currentUser);\n }\n\n /** @deprecated Use {@link RevokePermissionCascade}. */\n async revokePermissionCascade(\n collectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<void> {\n return this.RevokePermissionCascade(collectionId, userId, currentUser);\n }\n\n /**\n * Recursively revoke permissions on all child collections\n */\n private async revokeChildPermissions(\n parentCollectionId: string,\n userId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const rv = RunView.FromMetadataProvider(this.Provider);\n const childrenResult = await rv.RunView({\n EntityName: 'MJ: Collections',\n ExtraFilter: `ParentID='${parentCollectionId}'`,\n ResultType: 'entity_object'\n }, currentUser);\n\n if (childrenResult.Success && childrenResult.Results) {\n for (const child of childrenResult.Results) {\n // Revoke permission if it exists for this user on the child collection\n const childPermission = await this.CheckPermission(child.ID, userId, currentUser);\n if (childPermission) {\n await this.RevokePermission(childPermission.id, currentUser);\n }\n\n // Recursively revoke from grandchildren\n await this.revokeChildPermissions(child.ID, userId, currentUser);\n }\n }\n }\n\n /**\n * Validate that requested permissions don't exceed granter's permissions\n */\n ValidatePermissions(\n requested: PermissionSet,\n granter: PermissionSet,\n isOwner: boolean\n ): boolean {\n if (isOwner) return true; // Owner can grant anything\n\n // Can't grant permissions you don't have\n if (requested.canShare && !granter.canShare) return false;\n if (requested.canEdit && !granter.canEdit) return false;\n if (requested.canDelete && !granter.canDelete) return false;\n\n return true;\n }\n\n /** @deprecated Use {@link ValidatePermissions}. */\n validatePermissions(\n requested: PermissionSet,\n granter: PermissionSet,\n isOwner: boolean\n ): boolean {\n return this.ValidatePermissions(requested, granter, isOwner);\n }\n\n /**\n * Get available permissions for a user to grant based on their own permissions\n */\n GetAvailablePermissions(userPermissions: PermissionSet, isOwner: boolean): string[] {\n if (isOwner) {\n return ['Read', 'Share', 'Edit', 'Delete'];\n }\n\n const available = ['Read']; // Always have read\n if (userPermissions.canShare) available.push('Share');\n if (userPermissions.canEdit) available.push('Edit');\n if (userPermissions.canDelete) available.push('Delete');\n\n return available;\n }\n\n /** @deprecated Use {@link GetAvailablePermissions}. */\n getAvailablePermissions(userPermissions: PermissionSet, isOwner: boolean): string[] {\n return this.GetAvailablePermissions(userPermissions, isOwner);\n }\n\n /**\n * Copy all permissions from parent collection to child collection\n */\n async CopyParentPermissions(\n parentCollectionId: string,\n childCollectionId: string,\n currentUser: UserInfo\n ): Promise<void> {\n const parentPermissions = await this.LoadPermissions(parentCollectionId, currentUser);\n\n for (const perm of parentPermissions) {\n // Check if permission already exists for this user on the child collection\n const existing = await this.CheckPermission(childCollectionId, perm.userId, currentUser);\n\n if (existing) {\n // Permission already exists (e.g., owner permission), skip to avoid duplicate\n console.log(`Skipping duplicate permission for user ${perm.userId} on collection ${childCollectionId}`);\n continue;\n }\n\n await this.GrantPermission(\n childCollectionId,\n perm.userId,\n {\n canRead: perm.canRead,\n canShare: perm.canShare,\n canEdit: perm.canEdit,\n canDelete: perm.canDelete\n },\n perm.sharedByUserId || currentUser.ID,\n currentUser\n );\n }\n }\n\n /** @deprecated Use {@link CopyParentPermissions}. */\n async copyParentPermissions(\n parentCollectionId: string,\n childCollectionId: string,\n currentUser: UserInfo\n ): Promise<void> {\n return this.CopyParentPermissions(parentCollectionId, childCollectionId, currentUser);\n }\n\n /**\n * Delete all permissions for a collection\n */\n async DeleteAllPermissions(collectionId: string, currentUser: UserInfo): Promise<void> {\n const permissions = await this.LoadPermissions(collectionId, currentUser);\n\n for (const perm of permissions) {\n await this.RevokePermission(perm.id, currentUser);\n }\n }\n\n /** @deprecated Use {@link DeleteAllPermissions}. */\n async deleteAllPermissions(collectionId: string, currentUser: UserInfo): Promise<void> {\n return this.DeleteAllPermissions(collectionId, currentUser);\n }\n\n /**\n * Create owner permission record (all permissions enabled)\n */\n async CreateOwnerPermission(\n collectionId: string,\n ownerId: string,\n currentUser: UserInfo\n ): Promise<void> {\n await this.GrantPermission(\n collectionId,\n ownerId,\n {\n canRead: true,\n canShare: true,\n canEdit: true,\n canDelete: true\n },\n ownerId, // Owner grants to themselves\n currentUser\n );\n }\n\n /** @deprecated Use {@link CreateOwnerPermission}. */\n async createOwnerPermission(\n collectionId: string,\n ownerId: string,\n currentUser: UserInfo\n ): Promise<void> {\n return this.CreateOwnerPermission(collectionId, ownerId, currentUser);\n }\n\n private mapToPermission(entity: MJCollectionPermissionEntity): CollectionPermission {\n return {\n id: entity.ID,\n collectionId: entity.CollectionID,\n userId: entity.UserID,\n userName: entity.User || '',\n canRead: entity.CanRead,\n canShare: entity.CanShare,\n canEdit: entity.CanEdit,\n canDelete: entity.CanDelete,\n sharedByUserId: entity.SharedByUserID || null,\n sharedByUserName: entity.SharedByUser || null,\n sharedAt: entity.__mj_CreatedAt\n };\n }\n}\n"]}
|
|
@@ -9,24 +9,34 @@ export declare class CollectionStateService {
|
|
|
9
9
|
/**
|
|
10
10
|
* Observable of the active collection ID
|
|
11
11
|
*/
|
|
12
|
-
readonly
|
|
12
|
+
readonly ActiveCollectionId$: Observable<string | null>;
|
|
13
|
+
/** @deprecated Use {@link ActiveCollectionId$}. */
|
|
14
|
+
get activeCollectionId$(): Observable<string | null>;
|
|
13
15
|
/**
|
|
14
16
|
* Gets the currently active collection ID (synchronous)
|
|
15
17
|
*/
|
|
18
|
+
get ActiveCollectionId(): string | null;
|
|
19
|
+
/** @deprecated Use {@link ActiveCollectionId}. */
|
|
16
20
|
get activeCollectionId(): string | null;
|
|
17
21
|
constructor();
|
|
18
22
|
/**
|
|
19
23
|
* Sets the active collection
|
|
20
24
|
* @param id The collection ID to activate (or null to clear)
|
|
21
25
|
*/
|
|
26
|
+
SetActiveCollection(id: string | null): void;
|
|
27
|
+
/** @deprecated Use {@link SetActiveCollection}. */
|
|
22
28
|
setActiveCollection(id: string | null): void;
|
|
23
29
|
/**
|
|
24
30
|
* Clears the active collection
|
|
25
31
|
*/
|
|
32
|
+
ClearActiveCollection(): void;
|
|
33
|
+
/** @deprecated Use {@link ClearActiveCollection}. */
|
|
26
34
|
clearActiveCollection(): void;
|
|
27
35
|
/**
|
|
28
36
|
* Gets the currently active collection ID
|
|
29
37
|
*/
|
|
38
|
+
GetActiveCollectionId(): string | null;
|
|
39
|
+
/** @deprecated Use {@link GetActiveCollectionId}. */
|
|
30
40
|
getActiveCollectionId(): string | null;
|
|
31
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<CollectionStateService, never>;
|
|
32
42
|
static ɵprov: i0.ɵɵInjectableDeclaration<CollectionStateService>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-state.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/collection-state.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;;AAEnD;;;GAGG;AACH,qBAGa,sBAAsB;IACjC,OAAO,CAAC,oBAAoB,CAA4C;IAExE;;OAEG;IACH,SAAgB,mBAAmB,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAA4C;IAE1G;;OAEG;IACH,IAAW,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAE7C;;IAID;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK5C;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAI7B;;OAEG;IACH,qBAAqB,IAAI,MAAM,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"collection-state.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/collection-state.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;;AAEnD;;;GAGG;AACH,qBAGa,sBAAsB;IACjC,OAAO,CAAC,oBAAoB,CAA4C;IAExE;;OAEG;IACH,SAAgB,mBAAmB,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAA4C;IAE1G,mDAAmD;IACnD,IAAW,mBAAmB,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAE1D;IAED;;OAEG;IACH,IAAW,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAE7C;IAED,kDAAkD;IAClD,IAAW,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAE7C;;IAID;;;OAGG;IACH,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK5C,mDAAmD;IACnD,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI5C;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAI7B,qDAAqD;IACrD,qBAAqB,IAAI,IAAI;IAI7B;;OAEG;IACH,qBAAqB,IAAI,MAAM,GAAG,IAAI;IAItC,qDAAqD;IACrD,qBAAqB,IAAI,MAAM,GAAG,IAAI;yCA7D3B,sBAAsB;6CAAtB,sBAAsB;CAgElC"}
|
|
@@ -10,34 +10,54 @@ export class CollectionStateService {
|
|
|
10
10
|
/**
|
|
11
11
|
* Observable of the active collection ID
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
ActiveCollectionId$ = this._activeCollectionId$.asObservable();
|
|
14
|
+
/** @deprecated Use {@link ActiveCollectionId$}. */
|
|
15
|
+
get activeCollectionId$() {
|
|
16
|
+
return this.ActiveCollectionId$;
|
|
17
|
+
}
|
|
14
18
|
/**
|
|
15
19
|
* Gets the currently active collection ID (synchronous)
|
|
16
20
|
*/
|
|
17
|
-
get
|
|
21
|
+
get ActiveCollectionId() {
|
|
18
22
|
return this._activeCollectionId$.value;
|
|
19
23
|
}
|
|
24
|
+
/** @deprecated Use {@link ActiveCollectionId}. */
|
|
25
|
+
get activeCollectionId() {
|
|
26
|
+
return this.ActiveCollectionId;
|
|
27
|
+
}
|
|
20
28
|
constructor() { }
|
|
21
29
|
/**
|
|
22
30
|
* Sets the active collection
|
|
23
31
|
* @param id The collection ID to activate (or null to clear)
|
|
24
32
|
*/
|
|
25
|
-
|
|
33
|
+
SetActiveCollection(id) {
|
|
26
34
|
console.log('📁 Setting active collection:', id);
|
|
27
35
|
this._activeCollectionId$.next(id);
|
|
28
36
|
}
|
|
37
|
+
/** @deprecated Use {@link SetActiveCollection}. */
|
|
38
|
+
setActiveCollection(id) {
|
|
39
|
+
return this.SetActiveCollection(id);
|
|
40
|
+
}
|
|
29
41
|
/**
|
|
30
42
|
* Clears the active collection
|
|
31
43
|
*/
|
|
32
|
-
|
|
44
|
+
ClearActiveCollection() {
|
|
33
45
|
this._activeCollectionId$.next(null);
|
|
34
46
|
}
|
|
47
|
+
/** @deprecated Use {@link ClearActiveCollection}. */
|
|
48
|
+
clearActiveCollection() {
|
|
49
|
+
return this.ClearActiveCollection();
|
|
50
|
+
}
|
|
35
51
|
/**
|
|
36
52
|
* Gets the currently active collection ID
|
|
37
53
|
*/
|
|
38
|
-
|
|
54
|
+
GetActiveCollectionId() {
|
|
39
55
|
return this._activeCollectionId$.value;
|
|
40
56
|
}
|
|
57
|
+
/** @deprecated Use {@link GetActiveCollectionId}. */
|
|
58
|
+
getActiveCollectionId() {
|
|
59
|
+
return this.GetActiveCollectionId();
|
|
60
|
+
}
|
|
41
61
|
static ɵfac = function CollectionStateService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CollectionStateService)(); };
|
|
42
62
|
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CollectionStateService, factory: CollectionStateService.ɵfac, providedIn: 'root' });
|
|
43
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/collection-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,MAAM,MAAM,CAAC;;AAEnD;;;GAGG;AAIH,MAAM,OAAO,sBAAsB;IACzB,oBAAoB,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;IAExE;;OAEG;IACa,mBAAmB,GAA8B,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;IAE1G;;OAEG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,gBAAe,CAAC;IAEhB;;;OAGG;IACH,mBAAmB,CAAC,EAAiB;QACnC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,qBAAqB;QACnB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,qBAAqB;QACnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACzC,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-state.service.js","sourceRoot":"","sources":["../../../src/lib/services/collection-state.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAc,MAAM,MAAM,CAAC;;AAEnD;;;GAGG;AAIH,MAAM,OAAO,sBAAsB;IACzB,oBAAoB,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;IAExE;;OAEG;IACa,mBAAmB,GAA8B,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE,CAAC;IAE1G,mDAAmD;IACnD,IAAW,mBAAmB;QAC5B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,kDAAkD;IAClD,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED,gBAAe,CAAC;IAEhB;;;OAGG;IACH,mBAAmB,CAAC,EAAiB;QACnC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,mDAAmD;IACnD,mBAAmB,CAAC,EAAiB;QACnC,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,qBAAqB;QACnB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,qDAAqD;IACrD,qBAAqB;QACnB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,qBAAqB;QACnB,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACzC,CAAC;IAED,qDAAqD;IACrD,qBAAqB;QACnB,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;gHA/DU,sBAAsB;gEAAtB,sBAAsB,WAAtB,sBAAsB,mBAFrB,MAAM;;iFAEP,sBAAsB;cAHlC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * State management service for collections\n * Tracks active collection for deep linking support\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CollectionStateService {\n private _activeCollectionId$ = new BehaviorSubject<string | null>(null);\n\n /**\n * Observable of the active collection ID\n */\n public readonly ActiveCollectionId$: Observable<string | null> = this._activeCollectionId$.asObservable();\n\n /** @deprecated Use {@link ActiveCollectionId$}. */\n public get activeCollectionId$(): Observable<string | null> {\n return this.ActiveCollectionId$;\n }\n\n /**\n * Gets the currently active collection ID (synchronous)\n */\n public get ActiveCollectionId(): string | null {\n return this._activeCollectionId$.value;\n }\n\n /** @deprecated Use {@link ActiveCollectionId}. */\n public get activeCollectionId(): string | null {\n return this.ActiveCollectionId;\n }\n\n constructor() {}\n\n /**\n * Sets the active collection\n * @param id The collection ID to activate (or null to clear)\n */\n SetActiveCollection(id: string | null): void {\n console.log('📁 Setting active collection:', id);\n this._activeCollectionId$.next(id);\n }\n\n /** @deprecated Use {@link SetActiveCollection}. */\n setActiveCollection(id: string | null): void {\n return this.SetActiveCollection(id);\n }\n\n /**\n * Clears the active collection\n */\n ClearActiveCollection(): void {\n this._activeCollectionId$.next(null);\n }\n\n /** @deprecated Use {@link ClearActiveCollection}. */\n clearActiveCollection(): void {\n return this.ClearActiveCollection();\n }\n\n /**\n * Gets the currently active collection ID\n */\n GetActiveCollectionId(): string | null {\n return this._activeCollectionId$.value;\n }\n\n /** @deprecated Use {@link GetActiveCollectionId}. */\n getActiveCollectionId(): string | null {\n return this.GetActiveCollectionId();\n }\n}\n"]}
|
|
@@ -74,7 +74,9 @@ export declare class ConversationAgentService {
|
|
|
74
74
|
private _conversationManagerAgent;
|
|
75
75
|
private _sessionIds;
|
|
76
76
|
/** Observable indicating if the ambient agent is currently processing — delegated to the runtime's AgentRunner. */
|
|
77
|
-
readonly
|
|
77
|
+
readonly IsProcessing$: Observable<boolean>;
|
|
78
|
+
/** @deprecated Use {@link IsProcessing$}. */
|
|
79
|
+
get isProcessing$(): Observable<boolean>;
|
|
78
80
|
private _provider;
|
|
79
81
|
constructor(_bootstrap: ConversationsRuntimeBootstrap, mentionParser: MentionParserService, agentClientService: AgentClientService);
|
|
80
82
|
/**
|
|
@@ -100,6 +102,8 @@ export declare class ConversationAgentService {
|
|
|
100
102
|
* preserve that shape (returning null on failure rather than throwing)
|
|
101
103
|
* so the call sites don't need to change.
|
|
102
104
|
*/
|
|
105
|
+
GetConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null>;
|
|
106
|
+
/** @deprecated Use {@link GetConversationManagerAgent}. */
|
|
103
107
|
getConversationManagerAgent(): Promise<MJAIAgentEntityExtended | null>;
|
|
104
108
|
/**
|
|
105
109
|
* Synchronous read of the cached conversation-manager-agent name. Returns
|
|
@@ -123,7 +127,13 @@ export declare class ConversationAgentService {
|
|
|
123
127
|
* documented as "kept for backwards compatibility but not used" in the
|
|
124
128
|
* original).
|
|
125
129
|
*/
|
|
126
|
-
|
|
130
|
+
ProcessMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], conversationDetailId: string, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[],
|
|
131
|
+
/** The agents the conversation manager may delegate to. Null or omitted allows every agent. */
|
|
132
|
+
allowedAgentIDs?: readonly string[] | null,
|
|
133
|
+
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
134
|
+
agentHistoryFrom?: Date | null): Promise<ExecuteAgentResult | null>;
|
|
135
|
+
/** @deprecated Use {@link ProcessMessage}. */
|
|
136
|
+
processMessage(conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], conversationDetailId: string, onProgress?: AgentExecutionProgressCallback, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[], allowedAgentIDs?: readonly string[] | null, agentHistoryFrom?: Date | null): Promise<ExecuteAgentResult | null>;
|
|
127
137
|
/**
|
|
128
138
|
* Configuration preset an agent was pinned to by a previous `@mention` in this conversation.
|
|
129
139
|
*
|
|
@@ -145,6 +155,8 @@ export declare class ConversationAgentService {
|
|
|
145
155
|
/**
|
|
146
156
|
* Clear the session for a conversation (useful when starting a new topic)
|
|
147
157
|
*/
|
|
158
|
+
ClearSession(conversationId: string): void;
|
|
159
|
+
/** @deprecated Use {@link ClearSession}. */
|
|
148
160
|
clearSession(conversationId: string): void;
|
|
149
161
|
/**
|
|
150
162
|
* Surfaces a warning toast when the user requested skills (via /skill mentions) that the
|
|
@@ -160,7 +172,11 @@ export declare class ConversationAgentService {
|
|
|
160
172
|
* Stays on the Angular shim because it directly uses AgentClientService.
|
|
161
173
|
* Could move to the runtime in a follow-up if needed.
|
|
162
174
|
*/
|
|
163
|
-
|
|
175
|
+
InvokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string, conversationDetailId: string, payload?: Record<string, unknown> | null, onProgress?: AgentExecutionProgressCallback, sourceArtifactId?: string, sourceArtifactVersionId?: string, agentConfigurationPresetId?: string, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[],
|
|
176
|
+
/** The first moment of the conversation the run may read. Null or omitted reads all of it. */
|
|
177
|
+
agentHistoryFrom?: Date | null): Promise<ExecuteAgentResult | null>;
|
|
178
|
+
/** @deprecated Use {@link InvokeSubAgent}. */
|
|
179
|
+
invokeSubAgent(agentName: string, conversationId: string, message: MJConversationDetailEntity, conversationHistory: MJConversationDetailEntity[], reasoning: string, conversationDetailId: string, payload?: Record<string, unknown> | null, onProgress?: AgentExecutionProgressCallback, sourceArtifactId?: string, sourceArtifactVersionId?: string, agentConfigurationPresetId?: string, appContext?: Record<string, unknown> | null, planMode?: boolean, requestedSkillIDs?: string[], agentHistoryFrom?: Date | null): Promise<ExecuteAgentResult | null>;
|
|
164
180
|
/**
|
|
165
181
|
* Check if user's latest message should continue with the previous agent or route through Sage.
|
|
166
182
|
* Uses fast inference (<500ms) to determine intent and avoid unnecessary Sage overhead.
|
|
@@ -168,6 +184,8 @@ export declare class ConversationAgentService {
|
|
|
168
184
|
* Stays on the Angular shim because it directly uses GraphQLAIClient.
|
|
169
185
|
* Could move to the runtime in a follow-up.
|
|
170
186
|
*/
|
|
187
|
+
CheckAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[]): Promise<IntentCheckResult>;
|
|
188
|
+
/** @deprecated Use {@link CheckAgentContinuityIntent}. */
|
|
171
189
|
checkAgentContinuityIntent(conversationId: string, agentId: string, latestMessage: string, conversationHistory: MJConversationDetailEntity[]): Promise<IntentCheckResult>;
|
|
172
190
|
/**
|
|
173
191
|
* Every artifact this agent produced in this conversation, newest version first — resolved
|
|
@@ -203,8 +221,12 @@ export declare class ConversationAgentService {
|
|
|
203
221
|
*
|
|
204
222
|
* One round trip. The subquery walks details -> Output junctions, and versions carry
|
|
205
223
|
* `__mj_CreatedAt`, so "newest" is expressible without joining back for `Sequence`.
|
|
224
|
+
*
|
|
225
|
+
* @param historyFrom The chat's history floor. When set, only artifacts on replies written at
|
|
226
|
+
* or after it count: a run that may not read earlier messages must not pick up their work
|
|
227
|
+
* as its payload either.
|
|
206
228
|
*/
|
|
207
|
-
FindLatestAgentOutputVersion(conversationId: string, agentId: string): Promise<AgentPayloadSource | null>;
|
|
229
|
+
FindLatestAgentOutputVersion(conversationId: string, agentId: string, historyFrom?: Date | null): Promise<AgentPayloadSource | null>;
|
|
208
230
|
/**
|
|
209
231
|
* `ArtifactVersion.ID IN (...)` for every OUTPUT artifact an agent produced in one
|
|
210
232
|
* conversation. Shared by {@link FindLatestAgentOutputVersion} and
|