@mgamadeus/ddd-agents 0.11.12 → 0.12.0
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 +138 -6
- package/boundary.json +5 -0
- package/dist/admin.js +13712 -0
- package/dist/admin.js.map +1 -0
- package/dist/chat.js +1627 -109
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{AgentsConversationClientContext-C4T7g_Qk.js → AgentsConversationClientContext-B_UJSLXU.js} +2 -2
- package/dist/chunks/{AgentsConversationClientContext-C4T7g_Qk.js.map → AgentsConversationClientContext-B_UJSLXU.js.map} +1 -1
- package/dist/chunks/{ConversationMarkdown-D-aP3Ssl.js → ConversationMarkdown-DlvwT3Qk.js} +5 -4
- package/dist/chunks/{ConversationMarkdown-D-aP3Ssl.js.map → ConversationMarkdown-DlvwT3Qk.js.map} +1 -1
- package/dist/chunks/{ConversationMessageInputComposerWidgets-7HNAmZE1.js → ConversationMessageInputComposerWidgets-TchR1lPj.js} +6 -6
- package/dist/chunks/{ConversationMessageInputComposerWidgets-7HNAmZE1.js.map → ConversationMessageInputComposerWidgets-TchR1lPj.js.map} +1 -1
- package/dist/chunks/{VoiceBarsIcon-FhLAcgLG.js → VoiceBarsIcon-y3mgSqbn.js} +4 -4
- package/dist/chunks/{VoiceBarsIcon-FhLAcgLG.js.map → VoiceBarsIcon-y3mgSqbn.js.map} +1 -1
- package/dist/chunks/{WebSearchResultsConversationWidget-dEq19U7k.js → WebSearchResultsConversationWidget-l9Aek_lG.js} +3 -2
- package/dist/chunks/WebSearchResultsConversationWidget-l9Aek_lG.js.map +1 -0
- package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js +759 -0
- package/dist/chunks/agents-http-trace-mappers-LWNi-3a4.js.map +1 -0
- package/dist/chunks/{browser-request-interception-ydNOzeUL.js → browser-request-interception-D678IemW.js} +2 -2
- package/dist/chunks/{browser-request-interception-ydNOzeUL.js.map → browser-request-interception-D678IemW.js.map} +1 -1
- package/dist/chunks/{canvas-reducers-BInd3xNz.js → canvas-reducers-BYArW_Ji.js} +2 -2
- package/dist/chunks/{canvas-reducers-BInd3xNz.js.map → canvas-reducers-BYArW_Ji.js.map} +1 -1
- package/dist/chunks/{canvas-title-slot-context-BI1PLnPn.js → canvas-title-slot-context-BRGnFzYP.js} +3 -3
- package/dist/chunks/{canvas-title-slot-context-BI1PLnPn.js.map → canvas-title-slot-context-BRGnFzYP.js.map} +1 -1
- package/dist/chunks/{canvasBodies-CRVh8pCw.js → canvasBodies-BjXypuHf.js} +4 -4
- package/dist/chunks/{canvasBodies-CRVh8pCw.js.map → canvasBodies-BjXypuHf.js.map} +1 -1
- package/dist/chunks/{canvasStorage-Cr3omZeI.js → canvasStorage-DSspwRMg.js} +2 -2
- package/dist/chunks/{canvasStorage-Cr3omZeI.js.map → canvasStorage-DSspwRMg.js.map} +1 -1
- package/dist/chunks/content-from-unified-diff-CovnmG2Q.js +2927 -0
- package/dist/chunks/content-from-unified-diff-CovnmG2Q.js.map +1 -0
- package/dist/chunks/{contract-C18owGKs.js → contract-886XjdID.js} +2 -2
- package/dist/chunks/{contract-C18owGKs.js.map → contract-886XjdID.js.map} +1 -1
- package/dist/chunks/{conversation-CbWEHPbL.js → conversation-B7-evdj_.js} +4 -4
- package/dist/chunks/{conversation-CbWEHPbL.js.map → conversation-B7-evdj_.js.map} +1 -1
- package/dist/chunks/{icon-names-Di6c4zLo.js → icon-names-C5PeVvkJ.js} +32 -1
- package/dist/chunks/icon-names-C5PeVvkJ.js.map +1 -0
- package/dist/chunks/{link-navigation-DRHt6g7U.js → index-DZovGMpG.js} +65 -106
- package/dist/chunks/index-DZovGMpG.js.map +1 -0
- package/dist/chunks/link-navigation-a_sRfmsj.js +49 -0
- package/dist/chunks/link-navigation-a_sRfmsj.js.map +1 -0
- package/dist/chunks/{widget-name-resolver-Dq6Ejo7d.js → widget-name-resolver-DS3zH_5W.js} +5 -4
- package/dist/chunks/{widget-name-resolver-Dq6Ejo7d.js.map → widget-name-resolver-DS3zH_5W.js.map} +1 -1
- package/dist/chunks/{withPollingChangeSubscription-ClyOABgu.js → withPollingChangeSubscription-XvCpjGmd.js} +13 -2
- package/dist/chunks/{withPollingChangeSubscription-ClyOABgu.js.map → withPollingChangeSubscription-XvCpjGmd.js.map} +1 -1
- package/dist/client-testing.js +5 -5
- package/dist/client.js +50 -231
- package/dist/client.js.map +1 -1
- package/dist/contract.js +5 -5
- package/dist/files/i18n-keys.json +18091 -1287
- package/dist/files/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.md +3 -3
- package/dist/image-render.js +7 -7
- package/dist/index.js +62 -61
- package/dist/index.js.map +1 -1
- package/dist/kit.js +2 -2
- package/dist/preview.js +7 -7
- package/dist/provider.js +57 -56
- package/dist/provider.js.map +1 -1
- package/dist/renderer.js +15 -15
- package/dist/styles.css +2962 -15
- package/dist/types/admin/blocks/CodeBlock.d.ts +28 -0
- package/dist/types/admin/blocks/DetailModal.d.ts +34 -0
- package/dist/types/admin/blocks/Disclosure.d.ts +25 -0
- package/dist/types/admin/blocks/JsonTree.d.ts +18 -0
- package/dist/types/admin/blocks/LineDiffView.d.ts +18 -0
- package/dist/types/admin/blocks/ProportionBar.d.ts +43 -0
- package/dist/types/admin/blocks/TokenFigure.d.ts +14 -0
- package/dist/types/admin/blocks/json-tree.d.ts +40 -0
- package/dist/types/admin/blocks/line-diff.d.ts +46 -0
- package/dist/types/admin/blocks/proportion-bar.d.ts +34 -0
- package/dist/types/admin/blocks/series-fill-classes.d.ts +13 -0
- package/dist/types/admin/blocks/token-figure.d.ts +8 -0
- package/dist/types/admin/connections/AgentConnectionCard.d.ts +21 -0
- package/dist/types/admin/connections/AgentConnectionDriveRootSpaces.d.ts +25 -0
- package/dist/types/admin/connections/AgentConnectionDriveScopeDialog.d.ts +20 -0
- package/dist/types/admin/connections/AgentConnectionDriveSearchFilters.d.ts +34 -0
- package/dist/types/admin/connections/AgentConnectionDrivesDrawer.d.ts +39 -0
- package/dist/types/admin/connections/AgentConnectionLevelsDrawer.d.ts +27 -0
- package/dist/types/admin/connections/AgentConnectionSharingDialog.d.ts +12 -0
- package/dist/types/admin/connections/AgentConnectionsPanel.d.ts +97 -0
- package/dist/types/admin/connections/AgentConnectionsScreen.d.ts +18 -0
- package/dist/types/admin/connections/ConnectDialogs.d.ts +22 -0
- package/dist/types/admin/connections/agent-connection-drive-scope.d.ts +112 -0
- package/dist/types/admin/connections/agent-connection-drives.d.ts +107 -0
- package/dist/types/admin/connections/agent-connection-format.d.ts +82 -0
- package/dist/types/admin/connections/agent-connection-oauth.d.ts +122 -0
- package/dist/types/admin/connections/agent-connections-api.d.ts +420 -0
- package/dist/types/admin/connections/agent-connections-context.d.ts +60 -0
- package/dist/types/admin/connections/agent-connections-types.d.ts +447 -0
- package/dist/types/admin/connections/connection-logos.d.ts +53 -0
- package/dist/types/admin/connections/connection-parts.d.ts +84 -0
- package/dist/types/admin/connections/use-agent-connect.d.ts +25 -0
- package/dist/types/admin/context/CompactionThresholdBanner.d.ts +13 -0
- package/dist/types/admin/context/ContextCompositionPanel.d.ts +27 -0
- package/dist/types/admin/context/ContextSegmentList.d.ts +20 -0
- package/dist/types/admin/context/SentPayloadPanel.d.ts +37 -0
- package/dist/types/admin/context/agent-inspect-context-api.d.ts +53 -0
- package/dist/types/admin/context/agent-inspect-context-types.d.ts +98 -0
- package/dist/types/admin/context/context-composition-grouping.d.ts +78 -0
- package/dist/types/admin/context/context-segment-families.d.ts +18 -0
- package/dist/types/admin/context/context-segment-label-texts.d.ts +19 -0
- package/dist/types/admin/context/context-segment-labels.d.ts +18 -0
- package/dist/types/admin/control-panel/AgentControlPanelScreen.d.ts +71 -0
- package/dist/types/admin/control-panel/BudgetsTab.d.ts +13 -0
- package/dist/types/admin/control-panel/SettingsTab.d.ts +22 -0
- package/dist/types/admin/control-panel/SpacesTab.d.ts +24 -0
- package/dist/types/admin/control-panel/StatisticsTab.d.ts +26 -0
- package/dist/types/admin/control-panel/TimeSeriesChartCard.d.ts +37 -0
- package/dist/types/admin/control-panel/ToolResponseSamplesDrawer.d.ts +22 -0
- package/dist/types/admin/control-panel/agent-control-panel-api.d.ts +104 -0
- package/dist/types/admin/control-panel/agent-control-panel-types.d.ts +241 -0
- package/dist/types/admin/control-panel/budget-meters.d.ts +35 -0
- package/dist/types/admin/control-panel/control-panel-statistics.d.ts +49 -0
- package/dist/types/admin/control-panel/runtime-settings-form.d.ts +44 -0
- package/dist/types/admin/control-panel/time-series-chart.d.ts +54 -0
- package/dist/types/admin/conversations/AgentConversationDetailScreen.d.ts +128 -0
- package/dist/types/admin/conversations/AgentConversationsScreen.d.ts +60 -0
- package/dist/types/admin/conversations/ContextPanel.d.ts +9 -0
- package/dist/types/admin/conversations/ConversationActions.d.ts +32 -0
- package/dist/types/admin/conversations/ConversationTurns.d.ts +56 -0
- package/dist/types/admin/conversations/DebugSwitchBar.d.ts +23 -0
- package/dist/types/admin/conversations/DelegationPanel.d.ts +6 -0
- package/dist/types/admin/conversations/ModelContextDialog.d.ts +31 -0
- package/dist/types/admin/conversations/RequestCompositionRows.d.ts +14 -0
- package/dist/types/admin/conversations/RequestsPanel.d.ts +21 -0
- package/dist/types/admin/conversations/SandboxPanel.d.ts +42 -0
- package/dist/types/admin/conversations/StepDetailDialog.d.ts +19 -0
- package/dist/types/admin/conversations/agent-inspect-api.d.ts +259 -0
- package/dist/types/admin/conversations/agent-inspect-mappers.d.ts +23 -0
- package/dist/types/admin/conversations/agent-inspect-types.d.ts +517 -0
- package/dist/types/admin/conversations/conversation-list-export.d.ts +64 -0
- package/dist/types/admin/conversations/conversation-list-filters.d.ts +59 -0
- package/dist/types/admin/conversations/debug-switches.d.ts +27 -0
- package/dist/types/admin/conversations/delegation-swimlanes.d.ts +78 -0
- package/dist/types/admin/conversations/header-facts.d.ts +23 -0
- package/dist/types/admin/conversations/inspect-format.d.ts +44 -0
- package/dist/types/admin/conversations/inspect-parts.d.ts +42 -0
- package/dist/types/admin/conversations/inspect-scope.d.ts +92 -0
- package/dist/types/admin/conversations/model-call-rows.d.ts +78 -0
- package/dist/types/admin/conversations/step-descriptions.d.ts +43 -0
- package/dist/types/admin/conversations/touched-files-tree.d.ts +47 -0
- package/dist/types/admin/conversations/turn-paging.d.ts +56 -0
- package/dist/types/admin/conversations/turn-segments.d.ts +36 -0
- package/dist/types/admin/conversations/turn-timeline.d.ts +22 -0
- package/dist/types/admin/conversations/use-query-loader.d.ts +8 -0
- package/dist/types/admin/period/AdminPeriodControl.d.ts +15 -0
- package/dist/types/admin/period/admin-period.d.ts +51 -0
- package/dist/types/admin/quality/AgentQualityEvalRunScreen.d.ts +30 -0
- package/dist/types/admin/quality/AgentQualityScreen.d.ts +38 -0
- package/dist/types/admin/quality/SaveAsEvalCaseDialog.d.ts +27 -0
- package/dist/types/admin/quality/agent-quality-api.d.ts +86 -0
- package/dist/types/admin/quality/agent-quality-format.d.ts +52 -0
- package/dist/types/admin/quality/agent-quality-types.d.ts +161 -0
- package/dist/types/admin/schedules/AgentSchedulesPanel.d.ts +43 -0
- package/dist/types/admin/schedules/agent-schedules-api.d.ts +116 -0
- package/dist/types/admin/schedules/agent-schedules-format.d.ts +25 -0
- package/dist/types/admin/schedules/agent-schedules-types.d.ts +113 -0
- package/dist/types/admin/shared/AdminHrefLink.d.ts +13 -0
- package/dist/types/admin/skills/AgentSkillCatalogScreen.d.ts +51 -0
- package/dist/types/admin/skills/SharedBlocksPanel.d.ts +14 -0
- package/dist/types/admin/skills/SkillPurposesPanel.d.ts +16 -0
- package/dist/types/admin/skills/SkillTreeRowView.d.ts +31 -0
- package/dist/types/admin/skills/ToolSchemaDrawer.d.ts +21 -0
- package/dist/types/admin/skills/agent-skill-catalog-api.d.ts +89 -0
- package/dist/types/admin/skills/agent-skill-catalog-types.d.ts +223 -0
- package/dist/types/admin/skills/skill-catalog-colors.d.ts +10 -0
- package/dist/types/admin/skills/skill-catalog-tree.d.ts +159 -0
- package/dist/types/admin/skills/skill-purpose-texts.d.ts +11 -0
- package/dist/types/admin/wire/admin-wire.d.ts +21 -0
- package/dist/types/chat/controller/AgentChatController.d.ts +22 -0
- package/dist/types/chat/controller/turn-initiators.d.ts +21 -0
- package/dist/types/chat/trace/BackgroundTasksList.d.ts +35 -0
- package/dist/types/chat/trace/ChangeSetCard.d.ts +34 -0
- package/dist/types/chat/trace/ChangedFilesPane.d.ts +33 -0
- package/dist/types/chat/trace/ChangedRecordsList.d.ts +34 -0
- package/dist/types/chat/trace/ConsentRequestCard.d.ts +23 -0
- package/dist/types/chat/trace/ContextRing.d.ts +19 -0
- package/dist/types/chat/trace/ConversationChildTrace.d.ts +18 -0
- package/dist/types/chat/trace/ConversationTurnTrace.d.ts +48 -0
- package/dist/types/chat/trace/EntityChip.d.ts +23 -0
- package/dist/types/chat/trace/FileChangesSummary.d.ts +14 -0
- package/dist/types/chat/trace/FileEditBlock.d.ts +42 -0
- package/dist/types/chat/trace/LoadedSkillsDisclosure.d.ts +16 -0
- package/dist/types/chat/trace/QueuedMessageChip.d.ts +17 -0
- package/dist/types/chat/trace/RunStatusLine.d.ts +27 -0
- package/dist/types/chat/trace/StepKindDetails.d.ts +59 -0
- package/dist/types/chat/trace/SubAgentStepGroup.d.ts +53 -0
- package/dist/types/chat/trace/TaskPlanPane.d.ts +31 -0
- package/dist/types/chat/trace/TaskPlanRow.d.ts +28 -0
- package/dist/types/chat/trace/TerminalBlock.d.ts +16 -0
- package/dist/types/chat/trace/ThinkingBlock.d.ts +19 -0
- package/dist/types/chat/trace/ToolStepDetail.d.ts +49 -0
- package/dist/types/chat/trace/ToolStepGroup.d.ts +58 -0
- package/dist/types/chat/trace/ToolStepRow.d.ts +52 -0
- package/dist/types/chat/trace/TraceViewModeSwitch.d.ts +14 -0
- package/dist/types/chat/trace/TurnMetaLine.d.ts +27 -0
- package/dist/types/chat/trace/content-from-unified-diff.d.ts +25 -0
- package/dist/types/chat/trace/conversation-trace-loader.d.ts +133 -0
- package/dist/types/chat/trace/index.d.ts +34 -0
- package/dist/types/chat/trace/parse-unified-diff.d.ts +51 -0
- package/dist/types/chat/trace/task-plan-counts.d.ts +41 -0
- package/dist/types/chat/trace/trace-collect.d.ts +91 -0
- package/dist/types/chat/trace/trace-counts.d.ts +21 -0
- package/dist/types/chat/trace/trace-format.d.ts +73 -0
- package/dist/types/chat/trace/trace-labels.d.ts +60 -0
- package/dist/types/chat/trace/trace-parts.d.ts +63 -0
- package/dist/types/chat/trace/trace-step-focus.d.ts +12 -0
- package/dist/types/chat/trace/trace-types.d.ts +370 -0
- package/dist/types/chat/trace/use-conversation-trace.d.ts +47 -0
- package/dist/types/client/AgentsConversationClient.d.ts +20 -0
- package/dist/types/client/http/agents-http-trace-mappers.d.ts +31 -0
- package/dist/types/client/http/agents-http-trace-wire.d.ts +433 -0
- package/dist/types/contract/conversation-trace.d.ts +594 -0
- package/dist/types/entries/admin.d.ts +85 -0
- package/dist/types/entries/chat.d.ts +3 -1
- package/dist/types/entries/client.d.ts +2 -0
- package/dist/types/entries/contract.d.ts +1 -0
- package/dist/types/provider/components/icon-names.d.ts +4 -2
- package/dist/types/provider/components/types.d.ts +3 -1
- package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-files.d.ts +1 -1
- package/dist/voice.js +3 -3
- package/dist/widgets.js +6 -6
- package/package.json +7 -3
- package/public-api.json +1036 -3
- package/dist/chunks/WebSearchResultsConversationWidget-dEq19U7k.js.map +0 -1
- package/dist/chunks/icon-names-Di6c4zLo.js.map +0 -1
- package/dist/chunks/link-navigation-DRHt6g7U.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type AgentConnectionsPanelProps } from "./AgentConnectionsPanel";
|
|
3
|
+
export interface AgentConnectionsScreenProps extends Omit<AgentConnectionsPanelProps, "renderFrame" | "className"> {
|
|
4
|
+
/** Default "Connections". Already translated. */
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
/** Default: one sentence on what the connections are, with the agent's name. Already translated. */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Further page actions before "Add connection". */
|
|
9
|
+
headerActions?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The page of the connections: the page header (title, description, "Add connection" as the one primary action) around
|
|
13
|
+
* `AgentConnectionsPanel`, whose parts fill the list page (the result of a provider's return and the status filters
|
|
14
|
+
* under the header, search and view toggle as the list's toolbar, the tiles or the table as its body). Every prop of
|
|
15
|
+
* the panel applies. A host mounts it on the route the provider returns to and renders it inside `<Suspense>` when its
|
|
16
|
+
* adapters read the URL.
|
|
17
|
+
*/
|
|
18
|
+
export declare const AgentConnectionsScreen: ({ title, description, headerActions, ...panel }: AgentConnectionsScreenProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ConnectDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* "Connect Google": a name, what Google is asked for (Gmail, Calendar, Contacts, Drive; all by default) and who sees
|
|
7
|
+
* the connection, all sent with the start; then Google's consent. Google returns to the host's return route with
|
|
8
|
+
* `?connected=<id>` (or `?connectError=`); the panel of the surface that started it tells the outcome.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ConnectGoogleDialog: ({ open, onOpenChange }: ConnectDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* "IMAP / SMTP" (any other mailbox): the server checks the login before it stores the connection
|
|
13
|
+
* (`POST connections/imap`, the password stored encrypted). Sharing is a second request once the connection exists
|
|
14
|
+
* (`POST connections/{id}/settings`), as the connect takes no visibility.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ConnectImapDialog: ({ open, onOpenChange }: ConnectDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* "Slack": the agent's Slack bot as a system connection of the shared space (`POST system/slack`, the system right
|
|
19
|
+
* only). The bot's token is a server secret; this only names the connection.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ConnectSlackDialog: ({ open, onOpenChange }: ConnectDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { AgentConnectionDriveItemsSearchArg, AgentConnectionDriveRoot, AgentConnectionDriveRootRuleKind, AgentConnectionDriveRootRuleResolution, AgentConnectionDriveRootsResponse, AgentConnectionLevel, AgentConnectionSummary, AgentConnectionVisibility } from "./agent-connections-types";
|
|
2
|
+
/**
|
|
3
|
+
* What the agent may see of a drive connection (the dialog "What may the agent see?") and the extended search of the
|
|
4
|
+
* picker, pure. The one typed place of both server capabilities: the rule kinds a root may be added as
|
|
5
|
+
* (`supportedRootKinds` of every drive answer) and the filters the item search applies (`supportedSearchFilters`). A
|
|
6
|
+
* capability the server does not list is shown off ("comes soon") and never sent.
|
|
7
|
+
*/
|
|
8
|
+
/** The rule kinds, in the order the dialog offers them (`AdminAgentConnectionDriveRootPostRequestDto::RULE_ROOT_KINDS`). */
|
|
9
|
+
export declare const AGENT_CONNECTION_DRIVE_RULE_KINDS: readonly AgentConnectionDriveRootRuleKind[];
|
|
10
|
+
export declare const isAgentConnectionDriveRuleKind: (value: string | null | undefined) => value is AgentConnectionDriveRootRuleKind;
|
|
11
|
+
/** Whether a root is a rule (no item) rather than one folder, shared drive or file. */
|
|
12
|
+
export declare const isAgentConnectionDriveRuleRoot: (root: Pick<AgentConnectionDriveRoot, "rootKind">) => boolean;
|
|
13
|
+
/** The name of a rule root (the server's `itemName` of a rule is the same key). */
|
|
14
|
+
export declare const AGENT_CONNECTION_DRIVE_RULE_LABEL: Readonly<Record<AgentConnectionDriveRootRuleKind, string>>;
|
|
15
|
+
/** The rule kinds a drive answer says the connection supports; absent = none. */
|
|
16
|
+
export declare const supportedAgentConnectionDriveRuleKindsOf: (response: Pick<AgentConnectionDriveRootsResponse, "supportedRootKinds"> | null | undefined) => AgentConnectionDriveRootRuleKind[];
|
|
17
|
+
/** What an active rule root covers now (`driveRootRuleResolutions` of the drive answer), `null` without an answer for it. */
|
|
18
|
+
export declare const agentConnectionDriveRuleResolutionOf: (response: Pick<AgentConnectionDriveRootsResponse, "driveRootRuleResolutions"> | null | undefined, root: Pick<AgentConnectionDriveRoot, "id">) => AgentConnectionDriveRootRuleResolution | null;
|
|
19
|
+
/** The active rule root of a kind, `null` without one (one active rule per kind and connection). */
|
|
20
|
+
export declare const findActiveAgentConnectionDriveRuleRoot: <TRoot extends Pick<AgentConnectionDriveRoot, "rootKind" | "status">>(roots: readonly TRoot[], kind: AgentConnectionDriveRootRuleKind) => TRoot | null;
|
|
21
|
+
/** The choices of the dialog: certain areas (picked next), a rule, or nothing now. */
|
|
22
|
+
export type AgentConnectionDriveScopeChoice = "AREAS" | AgentConnectionDriveRootRuleKind | "LATER";
|
|
23
|
+
export declare const AGENT_CONNECTION_DRIVE_SCOPE_CHOICES: readonly AgentConnectionDriveScopeChoice[];
|
|
24
|
+
/** The levels of the capability Files the dialog offers, lowest first (`AgentConnectionPermission::LEVELS` of a drive). */
|
|
25
|
+
export declare const AGENT_CONNECTION_DRIVE_FILES_LEVELS: readonly AgentConnectionLevel[];
|
|
26
|
+
/** The choice the dialog opens with: the active rule (the whole account first), else certain areas (the default). */
|
|
27
|
+
export declare const agentConnectionDriveScopeChoiceOf: (roots: readonly Pick<AgentConnectionDriveRoot, "rootKind" | "status">[]) => AgentConnectionDriveScopeChoice;
|
|
28
|
+
/**
|
|
29
|
+
* Why a choice cannot be taken, `null` when it can: `comingSoon` = the server does not support the rule kind for this
|
|
30
|
+
* connection yet; `onlyMe` = the whole account only while the connection is visible to its owner alone (never a
|
|
31
|
+
* system connection of the agent).
|
|
32
|
+
*/
|
|
33
|
+
export type AgentConnectionDriveScopeBlocker = "comingSoon" | "onlyMe";
|
|
34
|
+
export declare const agentConnectionDriveScopeBlockerOf: (choice: AgentConnectionDriveScopeChoice, facts: {
|
|
35
|
+
supportedRuleKinds: readonly AgentConnectionDriveRootRuleKind[];
|
|
36
|
+
visibility: AgentConnectionVisibility;
|
|
37
|
+
isAgentOwned: boolean;
|
|
38
|
+
}) => AgentConnectionDriveScopeBlocker | null;
|
|
39
|
+
/** What saving the dialog does, in this order (removals, visibility, level, rule, picker); a step is left out when nothing changes. */
|
|
40
|
+
export interface AgentConnectionDriveScopePlan {
|
|
41
|
+
/** `POST settings` with the new visibility. */
|
|
42
|
+
visibility: AgentConnectionVisibility | null;
|
|
43
|
+
/** `POST level` (or the provider's consent, when the grant does not cover it) for Files. */
|
|
44
|
+
filesLevel: AgentConnectionLevel | null;
|
|
45
|
+
/**
|
|
46
|
+
* `POST driveRoots/remove` with these rule kinds, first of all: the active rules the choice ends (certain areas end
|
|
47
|
+
* both, everything ends the narrower all shared drives, all shared drives ends everything)
|
|
48
|
+
*/
|
|
49
|
+
removeRuleKinds: AgentConnectionDriveRootRuleKind[];
|
|
50
|
+
/** `POST driveRoots` with this rule kind and no item (`releaseWay` as the connection's own roots). */
|
|
51
|
+
ruleKind: AgentConnectionDriveRootRuleKind | null;
|
|
52
|
+
/** Open the picker of "Drives and folders" afterwards. */
|
|
53
|
+
pickAreas: boolean;
|
|
54
|
+
}
|
|
55
|
+
export declare const planAgentConnectionDriveScope: (input: {
|
|
56
|
+
choice: AgentConnectionDriveScopeChoice;
|
|
57
|
+
visibility: AgentConnectionVisibility;
|
|
58
|
+
savedVisibility: AgentConnectionVisibility;
|
|
59
|
+
filesLevel: AgentConnectionLevel;
|
|
60
|
+
savedFilesLevel: AgentConnectionLevel;
|
|
61
|
+
roots: readonly Pick<AgentConnectionDriveRoot, "rootKind" | "status">[];
|
|
62
|
+
}) => AgentConnectionDriveScopePlan;
|
|
63
|
+
/** Whether the dialog opens by itself after a connect: a new connection of a drive provider that lists Files. */
|
|
64
|
+
export declare const isAgentConnectionDriveScopeAsked: (connection: Pick<AgentConnectionSummary, "levels" | "status"> | null | undefined) => boolean;
|
|
65
|
+
/** The saved level of Files of a connection; OFF when it lists none. */
|
|
66
|
+
export declare const agentConnectionFilesLevelOf: (connection: Pick<AgentConnectionSummary, "levels"> | null | undefined) => AgentConnectionLevel;
|
|
67
|
+
/** The filters of the item search (`AdminAgentConnectionDriveItemsSearchGetRequestDto::FILTERS`). */
|
|
68
|
+
export type AgentConnectionDriveSearchFilterName = "modifiedFrom" | "modifiedTo" | "createdFrom" | "createdTo" | "types" | "minSizeBytes" | "maxSizeBytes" | "inFolderId";
|
|
69
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_FILTER_NAMES: readonly AgentConnectionDriveSearchFilterName[];
|
|
70
|
+
/** The kinds `types` names (`AdminAgentConnectionDriveItemsSearchGetRequestDto::TYPES`). */
|
|
71
|
+
export type AgentConnectionDriveSearchType = "FOLDER" | "SHARED_DRIVE" | "PDF" | "DOCUMENT" | "SPREADSHEET" | "PRESENTATION" | "IMAGE" | "TEXT" | "GOOGLE_DOC" | "GOOGLE_SHEET" | "GOOGLE_SLIDES";
|
|
72
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_TYPES: readonly AgentConnectionDriveSearchType[];
|
|
73
|
+
/** The kinds the picker offers: only folders and shared drives become roots there. */
|
|
74
|
+
export declare const AGENT_CONNECTION_DRIVE_PICKER_SEARCH_TYPES: readonly AgentConnectionDriveSearchType[];
|
|
75
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_TYPE_LABEL: Readonly<Record<AgentConnectionDriveSearchType, string>>;
|
|
76
|
+
/** The filter values as the controls hold them: days `YYYY-MM-DD`, sizes in megabytes as typed, `""` = not set. */
|
|
77
|
+
export interface AgentConnectionDriveSearchFilters {
|
|
78
|
+
modifiedFrom: string;
|
|
79
|
+
modifiedTo: string;
|
|
80
|
+
createdFrom: string;
|
|
81
|
+
createdTo: string;
|
|
82
|
+
types: readonly AgentConnectionDriveSearchType[];
|
|
83
|
+
minSizeMegabytes: string;
|
|
84
|
+
maxSizeMegabytes: string;
|
|
85
|
+
/** The folder or shared drive the search stays below, `null` = everywhere. */
|
|
86
|
+
inFolderId: string | null;
|
|
87
|
+
}
|
|
88
|
+
export declare const EMPTY_AGENT_CONNECTION_DRIVE_SEARCH_FILTERS: AgentConnectionDriveSearchFilters;
|
|
89
|
+
/** The groups of controls; each is on when the server applies at least one of its filters. */
|
|
90
|
+
export type AgentConnectionDriveSearchFilterField = "modified" | "created" | "types" | "size" | "location";
|
|
91
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_FILTER_FIELDS: readonly AgentConnectionDriveSearchFilterField[];
|
|
92
|
+
/** The filters a drive answer says the search applies; absent = none. */
|
|
93
|
+
export declare const supportedAgentConnectionDriveSearchFiltersOf: (response: Pick<AgentConnectionDriveRootsResponse, "supportedSearchFilters"> | null | undefined) => AgentConnectionDriveSearchFilterName[];
|
|
94
|
+
/** The controls of the picker's search: its items are folders and shared drives, which have no size. */
|
|
95
|
+
export declare const AGENT_CONNECTION_DRIVE_PICKER_SEARCH_FILTER_FIELDS: readonly AgentConnectionDriveSearchFilterField[];
|
|
96
|
+
/**
|
|
97
|
+
* Whether the search leaves shared drives out (`AgentConnectionDriveSearchFilters::allowsSharedDrives()`): a day range, a
|
|
98
|
+
* place or a size, since the provider answers neither dates nor a parent folder for a shared drive.
|
|
99
|
+
*/
|
|
100
|
+
export declare const isAgentConnectionDriveSearchLeavingSharedDrivesOut: (args: Pick<AgentConnectionDriveItemsSearchArg, AgentConnectionDriveSearchFilterName>) => boolean;
|
|
101
|
+
export declare const isAgentConnectionDriveSearchFilterFieldSupported: (field: AgentConnectionDriveSearchFilterField, supported: readonly AgentConnectionDriveSearchFilterName[]) => boolean;
|
|
102
|
+
/** Megabytes as typed (a comma counts as the decimal point) in bytes, `null` for nothing or no number of zero or more. */
|
|
103
|
+
export declare const agentConnectionDriveSizeBytesOf: (megabytes: string) => number | null;
|
|
104
|
+
/**
|
|
105
|
+
* The request fields of the filters: only the ones the server applies and that hold a value (the route refuses the
|
|
106
|
+
* others); the kinds as the given list in their fixed order.
|
|
107
|
+
*/
|
|
108
|
+
export declare const agentConnectionDriveSearchFilterArgsOf: (filters: AgentConnectionDriveSearchFilters, supported: readonly AgentConnectionDriveSearchFilterName[]) => Pick<AgentConnectionDriveItemsSearchArg, AgentConnectionDriveSearchFilterName>;
|
|
109
|
+
/** How many groups of controls hold a value the search sends. */
|
|
110
|
+
export declare const countActiveAgentConnectionDriveSearchFilters: (filters: AgentConnectionDriveSearchFilters, supported: readonly AgentConnectionDriveSearchFilterName[]) => number;
|
|
111
|
+
/** A range whose start lies after its end (days compare as text; sizes as numbers): the control says so, the search still runs. */
|
|
112
|
+
export declare const isAgentConnectionDriveSearchRangeReversed: (from: string, to: string, kind: "day" | "size") => boolean;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { type AgentConnectionsViewer } from "./agent-connection-format";
|
|
2
|
+
import type { AgentConnectionDriveItem, AgentConnectionDriveItemsSection, AgentConnectionDriveLabel, AgentConnectionDriveReleaseRole, AgentConnectionDriveRoot, AgentConnectionDriveRootKind, AgentConnectionDriveRootRelease, AgentConnectionSummary } from "./agent-connections-types";
|
|
3
|
+
/** The translation context of the drive texts that are single words. */
|
|
4
|
+
export declare const AGENT_CONNECTION_DRIVE_CONTEXT = "agent-connection-drive";
|
|
5
|
+
/** The status of a root (`AgentConnectionDriveRoot::STATUS_*`). */
|
|
6
|
+
export declare const AGENT_CONNECTION_DRIVE_ROOT_STATUS: Readonly<Record<string, import("@mgamadeus/ddd-admin-ui/logic").StatusDefinition>>;
|
|
7
|
+
/** How a root came (`AgentConnectionDriveRoot::WAY_*`), as a short phrase; `%agentName%` = the agent's name. */
|
|
8
|
+
export declare const AGENT_CONNECTION_DRIVE_ROOT_WAY_LABEL: Readonly<Record<string, string>>;
|
|
9
|
+
/** What a root is at the provider (`AgentConnectionDriveRoot::KIND_*`); a root of unknown kind has no label. */
|
|
10
|
+
export declare const AGENT_CONNECTION_DRIVE_ROOT_KIND_LABEL: Readonly<Record<string, string>>;
|
|
11
|
+
/** The kind a drive item would have as a root: a shared drive's own item carries its drive id, a folder opens, anything else is a file. */
|
|
12
|
+
export declare const agentConnectionDriveItemKindOf: (item: Pick<AgentConnectionDriveItem, "itemId" | "kind" | "driveId">) => AgentConnectionDriveRootKind;
|
|
13
|
+
/** The tops of a drive the picker lists, in the order of its switch (`section` of `driveItems`). */
|
|
14
|
+
export declare const AGENT_CONNECTION_DRIVE_ITEMS_SECTIONS: readonly AgentConnectionDriveItemsSection[];
|
|
15
|
+
/** The name of each top as the provider's own screens call it. */
|
|
16
|
+
export declare const AGENT_CONNECTION_DRIVE_ITEMS_SECTION_LABEL: Readonly<Record<AgentConnectionDriveItemsSection, string>>;
|
|
17
|
+
/** The tops the picker offers: "Shared drives" only when the host's backend lists them. */
|
|
18
|
+
export declare const agentConnectionDriveItemsSectionsOf: (isSharedDrivesSectionAvailable: boolean) => AgentConnectionDriveItemsSection[];
|
|
19
|
+
/** Whether the picker offers an item as a root: a folder or a shared drive. A single file is not picked there (a file that is a root already stays one). */
|
|
20
|
+
export declare const isAgentConnectionDriveItemAttachable: (item: Pick<AgentConnectionDriveItem, "itemId" | "kind" | "driveId">) => boolean;
|
|
21
|
+
/** The rows of a picker listing: the folders and shared drives of a page, in its order; the files are left out. */
|
|
22
|
+
export declare const attachableAgentConnectionDriveItemsOf: <TItem extends Pick<AgentConnectionDriveItem, "itemId" | "kind" | "driveId">>(items: readonly TItem[]) => TItem[];
|
|
23
|
+
/** The groups the roots of a connection are listed in: the rules (no item) first. */
|
|
24
|
+
export type AgentConnectionDriveRootGroupKind = "RULE" | "SHARED_DRIVE" | "FOLDER" | "FILE";
|
|
25
|
+
/** The heading of each group of roots. */
|
|
26
|
+
export declare const AGENT_CONNECTION_DRIVE_ROOT_GROUP_LABEL: Readonly<Record<AgentConnectionDriveRootGroupKind, string>>;
|
|
27
|
+
export interface AgentConnectionDriveRootGroup<TRoot> {
|
|
28
|
+
kind: AgentConnectionDriveRootGroupKind;
|
|
29
|
+
roots: TRoot[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The roots of a connection by what they are at the provider: the rules first (all shared drives, the whole account),
|
|
33
|
+
* then the shared drives, the folders (a root whose kind nobody stored counts as one), then the single files; a group
|
|
34
|
+
* without roots is left out. Inside a group the roots in use come first, the ended ones (revoked, lost) after them,
|
|
35
|
+
* each in the order given.
|
|
36
|
+
*/
|
|
37
|
+
export declare const agentConnectionDriveRootGroupsOf: <TRoot extends Pick<AgentConnectionDriveRoot, "rootKind" | "status">>(roots: readonly TRoot[]) => AgentConnectionDriveRootGroup<TRoot>[];
|
|
38
|
+
/** Whether a root ended: revoked by a person or lost at the provider. It stays listed and is used by nobody. */
|
|
39
|
+
export declare const isAgentConnectionDriveRootEnded: (root: Pick<AgentConnectionDriveRoot, "status">) => boolean;
|
|
40
|
+
/** The shortest and longest name search the drive search route takes (`driveItems/search?query`). */
|
|
41
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_MIN_LENGTH = 2;
|
|
42
|
+
export declare const AGENT_CONNECTION_DRIVE_SEARCH_MAX_LENGTH = 200;
|
|
43
|
+
/** The query a typed search text sends: trimmed and cut to the route's length, `null` while it is too short to search. */
|
|
44
|
+
export declare const agentConnectionDriveSearchQueryOf: (text: string) => string | null;
|
|
45
|
+
/** The roles a release to the agent may grant, weakest first (`AgentConnectionDriveReleasesService::RELEASE_ROLES`). */
|
|
46
|
+
export declare const AGENT_CONNECTION_DRIVE_RELEASE_ROLES: readonly AgentConnectionDriveReleaseRole[];
|
|
47
|
+
/** The provider's role as people know it from its share dialog. */
|
|
48
|
+
export declare const AGENT_CONNECTION_DRIVE_ROLE_LABEL: Readonly<Record<string, string>>;
|
|
49
|
+
export declare const isAgentConnectionDriveReleaseRole: (value: string) => value is AgentConnectionDriveReleaseRole;
|
|
50
|
+
/** Whether an item of a drive listing can be opened (a folder; a shared drive is listed as one). */
|
|
51
|
+
export declare const isAgentConnectionDriveFolder: (item: Pick<AgentConnectionDriveItem, "kind">) => boolean;
|
|
52
|
+
/** Whether the provider lets the listing account share the item (a release to the agent needs it). */
|
|
53
|
+
export declare const canShareAgentConnectionDriveItem: (item: Pick<AgentConnectionDriveItem, "canShare" | "canManageMembers">) => boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether "release to the agent" is offered for an item. A folder or file: when the provider lets the account share it
|
|
56
|
+
* (`canShareAgentConnectionDriveItem`). A shared drive: the provider decides at the share, because a row of the tree
|
|
57
|
+
* never carries the drive's capability; only a search result does, and one that says the account does not manage the
|
|
58
|
+
* drive's members is refused here already.
|
|
59
|
+
*/
|
|
60
|
+
export declare const canReleaseAgentConnectionDriveItemToAgent: (item: Pick<AgentConnectionDriveItem, "itemId" | "kind" | "driveId" | "canShare" | "canManageMembers">, isSearchResult: boolean) => boolean;
|
|
61
|
+
/** The root an item already is on the connection (ACTIVE or UNASSIGNED; never an ended one), else `null`. */
|
|
62
|
+
export declare const findAgentConnectionDriveRootOfItem: (roots: readonly AgentConnectionDriveRoot[], itemId: string) => AgentConnectionDriveRoot | null;
|
|
63
|
+
/** The numeric id of a root row, `null` for a row without one. */
|
|
64
|
+
export declare const agentConnectionDriveRootIdOf: (root: Pick<AgentConnectionDriveRoot, "id">) => number | null;
|
|
65
|
+
/** What the viewer may do with one root, as the server decides it; the screens only hide what it would refuse. */
|
|
66
|
+
export interface AgentConnectionDriveRootActions {
|
|
67
|
+
/** `POST driveRoots/remove`: whoever manages the connection. */
|
|
68
|
+
canRemove: boolean;
|
|
69
|
+
/** `POST driveRoots/assign`: an unassigned share of the agent's identity, the system right. */
|
|
70
|
+
canAssign: boolean;
|
|
71
|
+
/** `POST /driveRoots/{id}/revoke`: a release to the agent, by the person who released it or the system right. */
|
|
72
|
+
canRevokeRelease: boolean;
|
|
73
|
+
/** `POST driveRoots` with the ended root's item: whoever manages the connection (a share of the agent's own account: the system right). */
|
|
74
|
+
canAttachAgain: boolean;
|
|
75
|
+
/** `POST /driveRoots/{id}/releases`: an active root, whoever manages the connection. */
|
|
76
|
+
canReleaseToSpace: boolean;
|
|
77
|
+
/** `POST /driveRoots/{id}/restrict`: an active root that still follows the connection, whoever manages it. */
|
|
78
|
+
canRestrict: boolean;
|
|
79
|
+
/** `POST /driveRoots/{id}/followConnection`: an active restricted root, whoever manages the connection. */
|
|
80
|
+
canFollowConnection: boolean;
|
|
81
|
+
}
|
|
82
|
+
export declare const agentConnectionDriveRootActionsOf: (root: AgentConnectionDriveRoot, connection: Pick<AgentConnectionSummary, "ownership" | "ownerAccountId">, viewer: AgentConnectionsViewer) => AgentConnectionDriveRootActions;
|
|
83
|
+
/** The way an ended root is attached again (`POST driveRoots`): the way it came, a picked root by default. */
|
|
84
|
+
export declare const agentConnectionDriveRootAttachWayOf: (root: Pick<AgentConnectionDriveRoot, "releaseWay">) => "PERSON_ROOT" | "PICKER" | "OWN_IDENTITY";
|
|
85
|
+
/** The numeric id of a release row, `null` for a row without one. */
|
|
86
|
+
export declare const agentConnectionDriveRootReleaseIdOf: (release: Pick<AgentConnectionDriveRootRelease, "id">) => number | null;
|
|
87
|
+
/** The active releases of one root to agent spaces, oldest first (the releases taken back are the audit). */
|
|
88
|
+
export declare const activeAgentConnectionDriveRootReleasesOf: (root: Pick<AgentConnectionDriveRoot, "id">, releases: readonly AgentConnectionDriveRootRelease[]) => AgentConnectionDriveRootRelease[];
|
|
89
|
+
/** `POST /driveRootReleases/{id}/revoke`: the person who released the root to the space, or the system right. */
|
|
90
|
+
export declare const canRevokeAgentConnectionDriveRootRelease: (release: Pick<AgentConnectionDriveRootRelease, "id" | "grantedByAccountId" | "revokedAt">, viewer: AgentConnectionsViewer) => boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Which agent spaces use an active root: `connection` = it follows the connection's sharing (every space the
|
|
93
|
+
* connection is shared with), `spaces` = only the spaces of its active releases, `none` = restricted with no space
|
|
94
|
+
* (only the owner's own use is left).
|
|
95
|
+
*/
|
|
96
|
+
export type AgentConnectionDriveRootSpaceState = "connection" | "spaces" | "none";
|
|
97
|
+
export declare const agentConnectionDriveRootSpaceStateOf: (root: Pick<AgentConnectionDriveRoot, "id" | "restrictedToAgentSpaces">, releases: readonly AgentConnectionDriveRootRelease[]) => AgentConnectionDriveRootSpaceState;
|
|
98
|
+
/** The spaces a root can still be released to: the viewer's releasable ones it is not released to yet. */
|
|
99
|
+
export declare const releasableAgentSpaceIdsOfDriveRoot: (root: Pick<AgentConnectionDriveRoot, "id">, releases: readonly AgentConnectionDriveRootRelease[], releasableAgentSpaceIds: readonly number[]) => number[];
|
|
100
|
+
/** The host's label of an agent space or account by id; `null` when the host supplied none (the screen then names the id). */
|
|
101
|
+
export declare const agentConnectionDriveLabelOf: (labels: readonly AgentConnectionDriveLabel[] | null | undefined, id: number | null | undefined) => string | null;
|
|
102
|
+
/**
|
|
103
|
+
* The agent's own drive identities an item of `source` can be released to: connected system connections of the same
|
|
104
|
+
* provider with an address and drive access, never `source` itself. Empty for a system connection (only a person's
|
|
105
|
+
* own connection releases its items, with that person's token).
|
|
106
|
+
*/
|
|
107
|
+
export declare const agentConnectionDriveReleaseTargetsOf: <TConnection extends AgentConnectionSummary>(source: AgentConnectionSummary, connections: readonly TConnection[], viewer: AgentConnectionsViewer) => TConnection[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { AgentConnectionCapability, AgentConnectionCapabilityLevel, AgentConnectionLevel, AgentConnectionSummary, AgentConnectionVisibility } from "./agent-connections-types";
|
|
2
|
+
/** The levels by power, exactly `AgentConnectionPermission::LEVELS` (each one includes everything below it). */
|
|
3
|
+
export declare const AGENT_CONNECTION_LEVELS: readonly AgentConnectionLevel[];
|
|
4
|
+
export declare const AGENT_CONNECTION_CAPABILITIES: readonly AgentConnectionCapability[];
|
|
5
|
+
/** Translation context of the level names. */
|
|
6
|
+
export declare const AGENT_CONNECTION_LEVEL_CONTEXT = "agent-connection-level";
|
|
7
|
+
/** Translation context of the capability names. */
|
|
8
|
+
export declare const AGENT_CONNECTION_CAPABILITY_CONTEXT = "agent-connection-capability";
|
|
9
|
+
/** Translation context of the level explanations; they name the agent as `%agentName%`. */
|
|
10
|
+
export declare const AGENT_CONNECTION_LEVEL_HELP_CONTEXT = "agent-connection-level-help";
|
|
11
|
+
/** What the agent may do with one capability, as a short name (English key, translated with its context). */
|
|
12
|
+
export declare const AGENT_CONNECTION_LEVEL_LABEL: Readonly<Record<AgentConnectionLevel, string>>;
|
|
13
|
+
/** The capability's name (English key, translated with its context). */
|
|
14
|
+
export declare const AGENT_CONNECTION_CAPABILITY_LABEL: Readonly<Record<AgentConnectionCapability, string>>;
|
|
15
|
+
/** What a level allows, one line under the level choice (English key, `%agentName%` = the agent's name). */
|
|
16
|
+
export declare const AGENT_CONNECTION_LEVEL_HELP: Readonly<Record<AgentConnectionLevel, string>>;
|
|
17
|
+
/** The level's text colour on a chip: read plain, "with approval" in the warning tone, "on its own" in the brand tone. */
|
|
18
|
+
export declare const agentConnectionLevelToneClass: (level: AgentConnectionLevel) => string;
|
|
19
|
+
/** The position of a level in the order by power; -1 for an unknown one. */
|
|
20
|
+
export declare const agentConnectionLevelRank: (level: AgentConnectionLevel) => number;
|
|
21
|
+
/** The capabilities a Google connect can ask for, in the order of the consent screen. */
|
|
22
|
+
export declare const GOOGLE_CONNECT_CAPABILITIES: readonly AgentConnectionCapability[];
|
|
23
|
+
/** The quick filters of the list: connected, needs the viewer, paused, disconnected. */
|
|
24
|
+
export type AgentConnectionStatusGroup = "connected" | "attention" | "paused" | "disconnected";
|
|
25
|
+
export declare const AGENT_CONNECTION_STATUS_GROUPS: readonly AgentConnectionStatusGroup[];
|
|
26
|
+
export declare const agentConnectionStatusGroupOf: (status: string | null | undefined) => AgentConnectionStatusGroup;
|
|
27
|
+
export declare const isAgentConnectionStatusGroup: (value: string) => value is AgentConnectionStatusGroup;
|
|
28
|
+
export declare const AGENT_CONNECTION_STATUS_GROUP_LABEL: Readonly<Record<AgentConnectionStatusGroup, string>>;
|
|
29
|
+
/** The translation context of a status group's label (`AGENT_CONNECTION_STATUS_GROUP_LABEL`). */
|
|
30
|
+
export declare const agentConnectionStatusGroupContextOf: (group: AgentConnectionStatusGroup) => string;
|
|
31
|
+
export declare const isAgentConnectionLevel: (value: string) => value is AgentConnectionLevel;
|
|
32
|
+
export declare const isAgentConnectionCapability: (value: string) => value is AgentConnectionCapability;
|
|
33
|
+
/**
|
|
34
|
+
* The levels of a connection from the summary's `levels` text (`"MAIL=DRAFT (draft); CALENDAR=READ (read, free/busy)"`);
|
|
35
|
+
* a part with a capability or level this web does not know is left out.
|
|
36
|
+
*/
|
|
37
|
+
export declare const parseAgentConnectionLevels: (levels: string | null | undefined) => AgentConnectionCapabilityLevel[];
|
|
38
|
+
export declare const isAgentConnectionVisibility: (value: string | null | undefined) => value is AgentConnectionVisibility;
|
|
39
|
+
/** The visibility of a connection as the dialogs start with it: `OWNER_ONLY` for anything unknown. */
|
|
40
|
+
export declare const agentConnectionVisibilityOf: (connection: Pick<AgentConnectionSummary, "visibility"> | null | undefined) => AgentConnectionVisibility;
|
|
41
|
+
/** The translation context of the visibility names. */
|
|
42
|
+
export declare const AGENT_CONNECTION_VISIBILITY_CONTEXT = "agent-connection-visibility";
|
|
43
|
+
/** The name of the visibility `OWNER_ONLY`; the name of `AGENT_SPACE` is the host's (`AgentConnectionsTexts.sharedVisibilityLabel`). */
|
|
44
|
+
export declare const AGENT_CONNECTION_OWNER_ONLY_LABEL: "Just for me";
|
|
45
|
+
/** The status of a connection (`AgentConnection::STATUS_*`); an unknown value shows as a neutral badge. */
|
|
46
|
+
export declare const AGENT_CONNECTION_STATUS: Readonly<Record<string, import("@mgamadeus/ddd-admin-ui/logic").StatusDefinition>>;
|
|
47
|
+
/** The provider's name; provider names are brands and stay untranslated. */
|
|
48
|
+
export declare const agentConnectionProviderName: (provider: string | null | undefined) => string;
|
|
49
|
+
/** The connection's shown name: its own, else the provider's. */
|
|
50
|
+
export declare const agentConnectionNameOf: (connection: Pick<AgentConnectionSummary, "name" | "provider"> | null | undefined) => string;
|
|
51
|
+
/** Who looks at the connections: the signed-in account and whether it holds the system right. */
|
|
52
|
+
export interface AgentConnectionsViewer {
|
|
53
|
+
accountId: number | string | null;
|
|
54
|
+
mayManageSystemConnections: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether the viewer may change a connection, as the server decides it (`requireManageableConnection`): the owner of
|
|
58
|
+
* an account's own connection, a holder of the system right for a connection of the agent. The screens only hide what
|
|
59
|
+
* the server would refuse.
|
|
60
|
+
*/
|
|
61
|
+
export declare const canManageAgentConnection: (connection: Pick<AgentConnectionSummary, "ownership" | "ownerAccountId">, viewer: AgentConnectionsViewer) => boolean;
|
|
62
|
+
/** Which connections a panel lists: all the account sees, or only the ones it may change. */
|
|
63
|
+
export type AgentConnectionsScope = "all" | "manageable";
|
|
64
|
+
export interface AgentConnectionsFilter {
|
|
65
|
+
scope: AgentConnectionsScope;
|
|
66
|
+
/** A status group, `""` = every status. */
|
|
67
|
+
statusGroup: AgentConnectionStatusGroup | "";
|
|
68
|
+
/** Matched against name, account and provider name, case-insensitively. */
|
|
69
|
+
searchTerm: string;
|
|
70
|
+
}
|
|
71
|
+
/** The connections of a scope (before status and search): the base of the quick filter counts. */
|
|
72
|
+
export declare const agentConnectionsOfScope: <TConnection extends AgentConnectionSummary>(connections: readonly TConnection[], scope: AgentConnectionsScope, viewer: AgentConnectionsViewer) => TConnection[];
|
|
73
|
+
/** The connections a filter keeps (client side: an account has a handful of connections). */
|
|
74
|
+
export declare const filterAgentConnections: <TConnection extends AgentConnectionSummary>(connections: readonly TConnection[], filter: AgentConnectionsFilter, viewer: AgentConnectionsViewer) => TConnection[];
|
|
75
|
+
/** How many connections each status group holds. */
|
|
76
|
+
export declare const countAgentConnectionsByStatusGroup: (connections: readonly Pick<AgentConnectionSummary, "status">[]) => Record<AgentConnectionStatusGroup, number>;
|
|
77
|
+
/** Whether a connection lists the capability FILES at a level above OFF: it can carry drive roots. */
|
|
78
|
+
export declare const hasAgentConnectionDriveAccess: (connection: Pick<AgentConnectionSummary, "levels" | "status"> | null | undefined) => boolean;
|
|
79
|
+
/** The server refused a level whose scopes the provider has not granted (409, `consent_required: CAP at LEVEL`). */
|
|
80
|
+
export declare const isAgentConnectionConsentRequiredMessage: (message: string | null | undefined) => boolean;
|
|
81
|
+
/** A port of a mail server from a form field: 1 to 5 digits, else `undefined`. */
|
|
82
|
+
export declare const agentConnectionPortOf: (value: string) => number | undefined;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { AgentConnectionCapability, AgentConnectionLevel } from "./agent-connections-types";
|
|
2
|
+
/**
|
|
3
|
+
* The way to a provider's consent page and back, pure. A connect leaves the application: the start route answers the
|
|
4
|
+
* consent URL (and sets the browser nonce cookie), the browser opens it, and the provider's callback redirects to ONE
|
|
5
|
+
* route of the host (the server's settings page path) with `?connected=<id>` or `?connectError=<reason>`. What the way
|
|
6
|
+
* back needs is stored first (`PendingAgentConnect`, this tab), with the surface that started the connect: the page of
|
|
7
|
+
* the connections, or a panel in a dialog elsewhere. Whatever is mounted on the return route reads the parameters; a
|
|
8
|
+
* panel takes them only when the pending connect is its own surface's, so the host can first reopen the dialog the
|
|
9
|
+
* connect started in (`pendingAgentConnectSurfaceOf`) and the panel in it then shows the result.
|
|
10
|
+
*/
|
|
11
|
+
/** The surface of a panel that names none: the page of the connections, where the provider's return lands. */
|
|
12
|
+
export declare const AGENT_CONNECTIONS_PAGE_SURFACE = "page";
|
|
13
|
+
/** What a started OAuth connect remembers for the way back. */
|
|
14
|
+
export interface PendingAgentConnect {
|
|
15
|
+
/** The row the start created (or, for an extension, the connection being extended). */
|
|
16
|
+
startedConnectionId: number;
|
|
17
|
+
/** The name the person typed; a consent merged into an existing connection does not use it. */
|
|
18
|
+
typedName: string;
|
|
19
|
+
/** The connection a "Reconnect" renews; the merge into it is the expected outcome. */
|
|
20
|
+
reconnectOf: number | null;
|
|
21
|
+
/** The connection whose levels an extension consent raises; `null` for a connect. */
|
|
22
|
+
extendOf: number | null;
|
|
23
|
+
/** The surface that started it (`AgentConnectionsPanelProps.surface`). */
|
|
24
|
+
surface: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const serializePendingAgentConnect: (pending: PendingAgentConnect) => string;
|
|
27
|
+
/** The stored pending connect; `null` for nothing stored or a value that cannot be read. */
|
|
28
|
+
export declare const parsePendingAgentConnect: (stored: string | null | undefined) => PendingAgentConnect | null;
|
|
29
|
+
/** The surface a stored pending connect was started on; the page for none (a return without a stored start). */
|
|
30
|
+
export declare const pendingAgentConnectSurfaceOf: (stored: string | null | undefined) => string;
|
|
31
|
+
/** What the callback appends to the return route; removed once read. */
|
|
32
|
+
export declare const AGENT_CONNECT_RETURN_PARAMETERS: readonly ["connected", "connectError"];
|
|
33
|
+
export interface AgentConnectReturnParameters {
|
|
34
|
+
connected: string | null;
|
|
35
|
+
connectError: string | null;
|
|
36
|
+
}
|
|
37
|
+
/** The return parameters of an address, `null` when it carries none. */
|
|
38
|
+
export declare const readAgentConnectReturnParameters: (parameters: Pick<URLSearchParams, "get">) => AgentConnectReturnParameters | null;
|
|
39
|
+
/** What the OAuth callback sent the browser back with. */
|
|
40
|
+
export type AgentConnectReturn =
|
|
41
|
+
/** `startedConnectionId`: the row the start created; connected but not shared when that row is connected. */
|
|
42
|
+
{
|
|
43
|
+
kind: "error";
|
|
44
|
+
reason: string;
|
|
45
|
+
startedConnectionId: number | null;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "connected";
|
|
48
|
+
connectionId: number;
|
|
49
|
+
} | {
|
|
50
|
+
kind: "renewed";
|
|
51
|
+
connectionId: number;
|
|
52
|
+
}
|
|
53
|
+
/** The consent was merged into an existing connection of the same account; the typed name was not used. */
|
|
54
|
+
| {
|
|
55
|
+
kind: "merged";
|
|
56
|
+
connectionId: number;
|
|
57
|
+
typedName: string;
|
|
58
|
+
}
|
|
59
|
+
/** More scopes for higher levels of an existing connection: granted (levels set) or partly refused at the provider. */
|
|
60
|
+
| {
|
|
61
|
+
kind: "extended";
|
|
62
|
+
connectionId: number;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "extensionRefused";
|
|
65
|
+
connectionId: number;
|
|
66
|
+
reason: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Tells the outcomes apart from the return parameters and the pending connect: an error of an extension, an error of
|
|
70
|
+
* a connect, a renewed connection ("Reconnect"), an extension, a consent merged into another row than the started
|
|
71
|
+
* one, a new connection. `null` for parameters that say nothing (a `connected` that is no id).
|
|
72
|
+
*/
|
|
73
|
+
export declare const resolveAgentConnectReturn: (parameters: AgentConnectReturnParameters, pending: PendingAgentConnect | null) => AgentConnectReturn | null;
|
|
74
|
+
/** Whether the provider's reason says the person cancelled the consent. */
|
|
75
|
+
export declare const isAgentConnectCancelledReason: (reason: string) => boolean;
|
|
76
|
+
/**
|
|
77
|
+
* How a panel leaves for a provider and finds its way back: the host's storage, address and navigation. One object
|
|
78
|
+
* for every panel of a host is fine; each panel names its own `surface`.
|
|
79
|
+
*/
|
|
80
|
+
export interface AgentConnectionsOAuthAdapter {
|
|
81
|
+
/**
|
|
82
|
+
* What the provider's return left in the address (`readAgentConnectReturnParameters` of the host's search
|
|
83
|
+
* parameters), `null` on every other address. Reactive: it changes when the address does.
|
|
84
|
+
*/
|
|
85
|
+
returnParameters: AgentConnectReturnParameters | null;
|
|
86
|
+
/** Removes the return parameters from the address and keeps the others. */
|
|
87
|
+
clearReturnParameters: () => void;
|
|
88
|
+
/** The stored pending connect of this tab (the host's storage and key), `null` = none. */
|
|
89
|
+
readPending: () => string | null;
|
|
90
|
+
/** Stores the pending connect; `null` removes it. */
|
|
91
|
+
writePending: (value: string | null) => void;
|
|
92
|
+
/** Leaves for the provider's consent page. Default: `window.location.assign`. */
|
|
93
|
+
openAuthorizationUrl?: (authorizationUrl: string) => void;
|
|
94
|
+
}
|
|
95
|
+
/** The search parameters of the deep link into the levels drawer of one connection. */
|
|
96
|
+
export declare const AGENT_CONNECTION_LEVELS_LINK_PARAMETERS: readonly ["levels", "capability", "level"];
|
|
97
|
+
/** A request to open the levels drawer of a connection, with a suggested capability and level. */
|
|
98
|
+
export interface AgentConnectionLevelsRequest {
|
|
99
|
+
connectionId: number;
|
|
100
|
+
/** The capability and level to suggest; `null` opens the drawer as it is. */
|
|
101
|
+
preset: {
|
|
102
|
+
capability: AgentConnectionCapability;
|
|
103
|
+
level: AgentConnectionLevel;
|
|
104
|
+
} | null;
|
|
105
|
+
}
|
|
106
|
+
/** The query string (without `?`) of a levels request: `levels=<id>&capability=…&level=…`. */
|
|
107
|
+
export declare const buildAgentConnectionLevelsSearch: ({ connectionId, preset }: AgentConnectionLevelsRequest) => string;
|
|
108
|
+
/** The levels request of an address, `null` without a valid `levels` id; an unknown capability or level drops the preset. */
|
|
109
|
+
export declare const readAgentConnectionLevelsRequest: (parameters: Pick<URLSearchParams, "get">) => AgentConnectionLevelsRequest | null;
|
|
110
|
+
/** The search parameters of the deep link into the drive roots of one connection. */
|
|
111
|
+
export declare const AGENT_CONNECTION_DRIVE_LINK_PARAMETERS: readonly ["connection", "driveRoot"];
|
|
112
|
+
/** The connection whose drive roots are open, and the root to scroll to and mark. */
|
|
113
|
+
export interface AgentConnectionDriveSelection {
|
|
114
|
+
connectionId: number;
|
|
115
|
+
driveRootId: number | null;
|
|
116
|
+
}
|
|
117
|
+
/** The query string (without `?`) of a drive selection: `connection=<id>[&driveRoot=<id>]`. */
|
|
118
|
+
export declare const buildAgentConnectionDriveSearch: ({ connectionId, driveRootId }: AgentConnectionDriveSelection) => string;
|
|
119
|
+
/** The drive selection of an address, `null` without a valid `connection` id. */
|
|
120
|
+
export declare const readAgentConnectionDriveSelection: (parameters: Pick<URLSearchParams, "get">) => AgentConnectionDriveSelection | null;
|
|
121
|
+
/** The DOM id of a root's row in the drive roots of a connection (the target of the deep link). */
|
|
122
|
+
export declare const agentConnectionDriveRootDomId: (connectionId: number, driveRootId: number | string) => string;
|