@aeolus-fleet/common 0.28.3 → 0.29.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/dist/fleet/index.d.ts +10 -6
- package/dist/fleet/index.js +7 -5
- package/dist/fleet/index.js.map +1 -1
- package/dist/header/app-header.d.ts +27 -0
- package/dist/header/app-header.js +18 -0
- package/dist/header/app-header.js.map +1 -0
- package/dist/header/app-switcher.d.ts +20 -0
- package/dist/header/app-switcher.js +57 -0
- package/dist/header/app-switcher.js.map +1 -0
- package/dist/header/apps.d.ts +45 -0
- package/dist/header/apps.js +44 -0
- package/dist/header/apps.js.map +1 -0
- package/dist/header/atoms/avatar.d.ts +16 -0
- package/dist/header/atoms/avatar.js +44 -0
- package/dist/header/atoms/avatar.js.map +1 -0
- package/dist/header/atoms/button.d.ts +22 -0
- package/dist/header/atoms/button.js +48 -0
- package/dist/header/atoms/button.js.map +1 -0
- package/dist/header/atoms/dialog-surface.d.ts +19 -0
- package/dist/header/atoms/dialog-surface.js +32 -0
- package/dist/header/atoms/dialog-surface.js.map +1 -0
- package/dist/header/atoms/dialog.d.ts +19 -0
- package/dist/header/atoms/dialog.js +37 -0
- package/dist/header/atoms/dialog.js.map +1 -0
- package/dist/header/atoms/dropdown-menu.d.ts +21 -0
- package/dist/header/atoms/dropdown-menu.js +42 -0
- package/dist/header/atoms/dropdown-menu.js.map +1 -0
- package/dist/header/atoms/kbd.d.ts +7 -0
- package/dist/header/atoms/kbd.js +11 -0
- package/dist/header/atoms/kbd.js.map +1 -0
- package/dist/header/atoms/sheet.d.ts +23 -0
- package/dist/header/atoms/sheet.js +52 -0
- package/dist/header/atoms/sheet.js.map +1 -0
- package/dist/header/atoms/tooltip.d.ts +10 -0
- package/dist/header/atoms/tooltip.js +24 -0
- package/dist/header/atoms/tooltip.js.map +1 -0
- package/dist/header/avatar-entry.d.ts +21 -0
- package/dist/header/avatar-entry.js +6 -0
- package/dist/header/avatar-entry.js.map +1 -0
- package/dist/header/avatar-menu.d.ts +43 -0
- package/dist/header/avatar-menu.js +111 -0
- package/dist/header/avatar-menu.js.map +1 -0
- package/dist/header/class-names.d.ts +3 -0
- package/dist/header/class-names.js +29 -0
- package/dist/header/class-names.js.map +1 -0
- package/dist/header/command-palette.d.ts +42 -0
- package/dist/header/command-palette.js +76 -0
- package/dist/header/command-palette.js.map +1 -0
- package/dist/header/index.d.ts +21 -0
- package/dist/header/index.js +22 -0
- package/dist/header/index.js.map +1 -0
- package/dist/header/tokens.css +154 -0
- package/dist/schemas/account-token.d.ts +5 -1
- package/dist/schemas/account-token.js +4 -1
- package/dist/schemas/account-token.js.map +1 -1
- package/dist/schemas/apps-list.d.ts +51 -0
- package/dist/schemas/apps-list.js +21 -0
- package/dist/schemas/apps-list.js.map +1 -0
- package/dist/schemas/console.d.ts +47 -2
- package/dist/schemas/console.js +41 -4
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/delivery.d.ts +43 -1
- package/dist/schemas/delivery.js +11 -0
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +7 -8
- package/dist/schemas/fleet.js +0 -4
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +2 -1
- package/dist/schemas/guide.d.ts +3 -0
- package/dist/schemas/history.d.ts +61 -3
- package/dist/schemas/history.js +3 -0
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/installation.d.ts +9 -0
- package/dist/schemas/installation.js +7 -0
- package/dist/schemas/installation.js.map +1 -1
- package/dist/schemas/network.d.ts +13 -13
- package/dist/schemas/notice.d.ts +7 -2
- package/dist/schemas/notice.js +2 -2
- package/dist/schemas/notice.js.map +1 -1
- package/dist/schemas/statement.d.ts +1 -0
- package/package.json +44 -4
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { CornerDownLeft, LoaderCircle, Search } from 'lucide-react';
|
|
4
|
+
import { useId, useState } from 'react';
|
|
5
|
+
import { Button } from './atoms/button.js';
|
|
6
|
+
import { Dialog, DialogClose, DialogContent, DialogTitle } from './atoms/dialog.js';
|
|
7
|
+
import { dialogSurface } from './atoms/dialog-surface.js';
|
|
8
|
+
import { Kbd } from './atoms/kbd.js';
|
|
9
|
+
import { classNames } from './class-names.js';
|
|
10
|
+
/** Rows standing in while the entries load. */
|
|
11
|
+
const SKELETON_ROWS = 4;
|
|
12
|
+
function LoadingRows() {
|
|
13
|
+
return (_jsx("ul", { "aria-label": "Loading", "aria-busy": true, "data-testid": "command-palette-loading", className: "flex flex-col gap-1 p-1", children: Array.from({ length: SKELETON_ROWS }, (_, row) => `row-${String(row)}`).map((row) => (_jsxs("li", { className: "flex h-(--size-control) items-center gap-2.5 px-2.5 max-sm:h-(--size-control-touch)", children: [_jsx("span", { className: "size-5 shrink-0 animate-pulse rounded-full bg-muted motion-reduce:animate-none" }), _jsx("span", { className: "h-3 w-40 animate-pulse rounded bg-muted motion-reduce:animate-none" })] }, row))) }));
|
|
14
|
+
}
|
|
15
|
+
/** The open palette: its query, the entry the keys move to and the one opening live here, so each opening starts fresh. */
|
|
16
|
+
function PaletteBody({ groupsOf, onSelect, onOpenChange, label, emptyMessage, isLoading = false, initialQuery = '' }) {
|
|
17
|
+
const listId = useId();
|
|
18
|
+
const optionId = useId();
|
|
19
|
+
const [query, setQuery] = useState(initialQuery);
|
|
20
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
21
|
+
const [opening, setOpening] = useState(undefined);
|
|
22
|
+
const groups = groupsOf(query);
|
|
23
|
+
const entries = groups.flatMap((group) => group.entries);
|
|
24
|
+
const active = entries[Math.min(activeIndex, entries.length - 1)];
|
|
25
|
+
const idOf = (entry) => `${optionId}-${entry.key}`;
|
|
26
|
+
const choose = (entry) => {
|
|
27
|
+
if (opening !== undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (entry.href !== undefined) {
|
|
31
|
+
setOpening(entry);
|
|
32
|
+
window.location.assign(entry.href);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
onSelect(entry.key);
|
|
36
|
+
onOpenChange(false);
|
|
37
|
+
};
|
|
38
|
+
const onKeyDown = (event) => {
|
|
39
|
+
if (entries.length === 0) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
const step = event.key === 'ArrowDown' ? 1 : -1;
|
|
45
|
+
const current = active ? entries.indexOf(active) : 0;
|
|
46
|
+
setActiveIndex((current + step + entries.length) % entries.length);
|
|
47
|
+
}
|
|
48
|
+
else if (event.key === 'Enter' && active) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
choose(active);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs(_Fragment, { children: [_jsx(DialogTitle, { className: "sr-only", children: label }), _jsxs("div", { className: "flex h-12 items-center gap-2.5 border-b border-border px-4 max-sm:h-(--size-header)", children: [_jsx(Search, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 text-muted-foreground" }), _jsx("input", { role: "combobox", "aria-expanded": true, "aria-controls": listId, "aria-activedescendant": active ? idOf(active) : undefined, "aria-autocomplete": "list", "aria-label": label, autoComplete: "off", autoCapitalize: "off", spellCheck: false, placeholder: label, disabled: opening !== undefined, "data-testid": "command-palette-input", className: "h-full min-w-0 grow bg-transparent text-body text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-60 max-sm:text-body-touch", value: query, onChange: (event) => {
|
|
54
|
+
setQuery(event.target.value);
|
|
55
|
+
setActiveIndex(0);
|
|
56
|
+
}, onKeyDown: onKeyDown }), _jsx(Kbd, { children: "esc" }), _jsx(DialogClose, { render: _jsx(Button, { variant: "ghost", size: "sm", className: "sm:hidden" }), children: "Cancel" })] }), _jsxs("div", { className: "max-h-[min(60dvh,var(--spacing)*100)] overflow-y-auto p-2 max-sm:max-h-none max-sm:grow", children: [entries.length === 0 && isLoading ? _jsx(LoadingRows, {}) : null, entries.length === 0 && !isLoading ? _jsx("p", { className: "px-4 py-6 text-center text-meta text-muted-foreground", children: emptyMessage(query.trim()) }) : null, entries.length === 0 ? null : (_jsx("ul", { id: listId, role: "listbox", "aria-label": "Results", className: "flex flex-col gap-2", children: groups.map((group) => (_jsxs("li", { role: "presentation", className: "flex flex-col gap-0.5", children: [_jsx("p", { id: `${listId}-${group.key}`, className: "px-2.5 pt-1 pb-0.5 text-caption font-medium text-muted-foreground", children: group.label }), _jsx("ul", { role: "group", "aria-labelledby": `${listId}-${group.key}`, className: "flex flex-col gap-0.5", children: group.entries.map((entry) => {
|
|
57
|
+
const isActive = entry === active;
|
|
58
|
+
const isOpening = entry === opening;
|
|
59
|
+
return (_jsx("li", { id: idOf(entry), role: "option", "aria-selected": isActive, "aria-disabled": opening !== undefined && !isOpening ? true : undefined, "data-testid": "command-palette-item", "data-item-key": entry.key, className: classNames('flex h-(--size-control) cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-body text-foreground aria-disabled:opacity-60 max-sm:h-(--size-control-touch)', isActive ? 'bg-accent' : undefined), onPointerMove: () => {
|
|
60
|
+
setActiveIndex(entries.indexOf(entry));
|
|
61
|
+
}, onClick: () => {
|
|
62
|
+
choose(entry);
|
|
63
|
+
}, children: isOpening ? (_jsxs(_Fragment, { children: [_jsx(LoaderCircle, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none" }), _jsxs("span", { className: "min-w-0 truncate", children: ["Opening ", entry.name ?? ''] })] })) : (entry.content) }, entry.key));
|
|
64
|
+
}) })] }, group.key))) }))] }), _jsxs("div", { className: "flex items-center gap-3 border-t border-border px-4 py-2 text-caption text-muted-foreground max-sm:hidden", children: [_jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: "\u2191" }), _jsx(Kbd, { children: "\u2193" }), "Move"] }), _jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: _jsx(CornerDownLeft, { "aria-hidden": true, className: "size-3" }) }), "Open"] }), _jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: "esc" }), "Close"] })] })] }));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The command palette (header design, docs/design/png/CommandPalette.png):
|
|
68
|
+
* search, then the app's groups of entries, filtered as you type. Arrow keys
|
|
69
|
+
* move, Enter opens, Escape closes. Desktop: a dialog near the top, opened
|
|
70
|
+
* with ⌘K or the header's search. Phone: the search icon opens it full
|
|
71
|
+
* screen (H6). While the entries load, rows in their shape stand in.
|
|
72
|
+
*/
|
|
73
|
+
export function CommandPalette({ isOpen, onOpenChange, ...body }) {
|
|
74
|
+
return (_jsx(Dialog, { open: isOpen, onOpenChange: onOpenChange, children: _jsx(DialogContent, { size: "md", "data-testid": "command-palette", className: classNames('gap-0 p-0 sm:top-[12dvh] sm:translate-y-0', dialogSurface.phoneFullScreen, 'max-sm:flex max-sm:flex-col'), children: _jsx(PaletteBody, { onOpenChange: onOpenChange, ...body }) }) }));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=command-palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../src/header/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,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,IAAI,GAAI,GACvC,GACT,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The header every Aeolus web app shows, and the atoms it stands on (header
|
|
3
|
+
* design H2): React parts, props only, client-safe (decision 0033). Each app
|
|
4
|
+
* imports its styles from `@aeolus-fleet/common/header/tokens.css` and scans
|
|
5
|
+
* this subpath for Tailwind classes.
|
|
6
|
+
*/
|
|
7
|
+
export * from './atoms/avatar.js';
|
|
8
|
+
export * from './atoms/button.js';
|
|
9
|
+
export * from './atoms/dialog.js';
|
|
10
|
+
export * from './atoms/dialog-surface.js';
|
|
11
|
+
export * from './atoms/dropdown-menu.js';
|
|
12
|
+
export * from './atoms/kbd.js';
|
|
13
|
+
export * from './atoms/sheet.js';
|
|
14
|
+
export * from './atoms/tooltip.js';
|
|
15
|
+
export * from './class-names.js';
|
|
16
|
+
export * from './app-header.js';
|
|
17
|
+
export * from './app-switcher.js';
|
|
18
|
+
export * from './apps.js';
|
|
19
|
+
export * from './avatar-entry.js';
|
|
20
|
+
export * from './avatar-menu.js';
|
|
21
|
+
export * from './command-palette.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The header every Aeolus web app shows, and the atoms it stands on (header
|
|
3
|
+
* design H2): React parts, props only, client-safe (decision 0033). Each app
|
|
4
|
+
* imports its styles from `@aeolus-fleet/common/header/tokens.css` and scans
|
|
5
|
+
* this subpath for Tailwind classes.
|
|
6
|
+
*/
|
|
7
|
+
export * from './atoms/avatar.js';
|
|
8
|
+
export * from './atoms/button.js';
|
|
9
|
+
export * from './atoms/dialog.js';
|
|
10
|
+
export * from './atoms/dialog-surface.js';
|
|
11
|
+
export * from './atoms/dropdown-menu.js';
|
|
12
|
+
export * from './atoms/kbd.js';
|
|
13
|
+
export * from './atoms/sheet.js';
|
|
14
|
+
export * from './atoms/tooltip.js';
|
|
15
|
+
export * from './class-names.js';
|
|
16
|
+
export * from './app-header.js';
|
|
17
|
+
export * from './app-switcher.js';
|
|
18
|
+
export * from './apps.js';
|
|
19
|
+
export * from './avatar-entry.js';
|
|
20
|
+
export * from './avatar-menu.js';
|
|
21
|
+
export * from './command-palette.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/* Aeolus design tokens, exported from the Claude Design system page. Light on :root, dark on .dark. */
|
|
2
|
+
:root {
|
|
3
|
+
--background:oklch(0.99 0.002 247);
|
|
4
|
+
--card:oklch(1 0 0);
|
|
5
|
+
--popover:oklch(1 0 0);
|
|
6
|
+
--muted:oklch(0.967 0.005 247);
|
|
7
|
+
--secondary:oklch(0.955 0.007 247);
|
|
8
|
+
--accent:oklch(0.95 0.009 247);
|
|
9
|
+
--sidebar:oklch(0.976 0.004 247);
|
|
10
|
+
--highlight:oklch(0.95 0.035 250);
|
|
11
|
+
--overlay:oklch(0.2 0.02 257 / 0.42);
|
|
12
|
+
--foreground:oklch(0.22 0.02 257);
|
|
13
|
+
--muted-foreground:oklch(0.5 0.02 257);
|
|
14
|
+
--destructive-text:oklch(0.53 0.2 27);
|
|
15
|
+
--border:oklch(0.912 0.008 247);
|
|
16
|
+
--input:oklch(0.885 0.01 247);
|
|
17
|
+
--ring:oklch(0.56 0.12 257);
|
|
18
|
+
--primary:oklch(0.34 0.08 257);
|
|
19
|
+
--primary-hover:oklch(0.29 0.075 257);
|
|
20
|
+
--primary-foreground:oklch(0.985 0.003 247);
|
|
21
|
+
--destructive:oklch(0.53 0.2 27);
|
|
22
|
+
--destructive-foreground:oklch(0.99 0 0);
|
|
23
|
+
--tone-waiting-bg:oklch(0.965 0.045 85);
|
|
24
|
+
--tone-waiting-fg:oklch(0.47 0.1 62);
|
|
25
|
+
--tone-waiting-border:oklch(0.87 0.08 80);
|
|
26
|
+
--tone-active-bg:oklch(0.955 0.03 250);
|
|
27
|
+
--tone-active-fg:oklch(0.45 0.14 257);
|
|
28
|
+
--tone-active-border:oklch(0.86 0.06 252);
|
|
29
|
+
--tone-ok-bg:oklch(0.96 0.04 155);
|
|
30
|
+
--tone-ok-fg:oklch(0.44 0.1 155);
|
|
31
|
+
--tone-ok-border:oklch(0.86 0.07 155);
|
|
32
|
+
--tone-attention-bg:oklch(0.957 0.028 25);
|
|
33
|
+
--tone-attention-fg:oklch(0.5 0.19 27);
|
|
34
|
+
--tone-attention-border:oklch(0.86 0.07 25);
|
|
35
|
+
--tone-ended-bg:oklch(0.957 0.005 247);
|
|
36
|
+
--tone-ended-fg:oklch(0.47 0.015 257);
|
|
37
|
+
--tone-ended-border:oklch(0.87 0.01 247);
|
|
38
|
+
--card-foreground:var(--foreground);
|
|
39
|
+
--popover-foreground:var(--foreground);
|
|
40
|
+
--secondary-foreground:var(--foreground);
|
|
41
|
+
--accent-foreground:var(--foreground);
|
|
42
|
+
--sidebar-foreground:var(--foreground);
|
|
43
|
+
--font-sans:var(--font-geist-sans, "Geist"), ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
44
|
+
--font-mono:var(--font-geist-mono, "Geist Mono"), ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
45
|
+
--shadow-sm:0 1px 2px oklch(0.2 0.02 257 / 0.06);
|
|
46
|
+
--shadow-md:0 2px 6px oklch(0.2 0.02 257 / 0.08);
|
|
47
|
+
--shadow-lg:0 16px 40px oklch(0.2 0.02 257 / 0.16), 0 2px 8px oklch(0.2 0.02 257 / 0.08);
|
|
48
|
+
--radius:8px;
|
|
49
|
+
--radius-xs:4px;
|
|
50
|
+
--radius-sm:6px;
|
|
51
|
+
--radius-md:8px;
|
|
52
|
+
--radius-lg:10px;
|
|
53
|
+
--radius-xl:12px;
|
|
54
|
+
--radius-2xl:18px;
|
|
55
|
+
--radius-full:9999px;
|
|
56
|
+
--spacing:4px;
|
|
57
|
+
--text-micro:11px;
|
|
58
|
+
--text-micro--line-height:14px;
|
|
59
|
+
--text-caption:12px;
|
|
60
|
+
--text-caption--line-height:16px;
|
|
61
|
+
--text-meta:13px;
|
|
62
|
+
--text-meta--line-height:18px;
|
|
63
|
+
--text-body:14px;
|
|
64
|
+
--text-body--line-height:20px;
|
|
65
|
+
--text-section:15px;
|
|
66
|
+
--text-section--line-height:20px;
|
|
67
|
+
--text-body-touch:15px;
|
|
68
|
+
--text-body-touch--line-height:22px;
|
|
69
|
+
--text-input-touch:16px;
|
|
70
|
+
--text-input-touch--line-height:24px;
|
|
71
|
+
--text-heading:18px;
|
|
72
|
+
--text-heading--line-height:24px;
|
|
73
|
+
--text-heading-touch:20px;
|
|
74
|
+
--text-heading-touch--line-height:26px;
|
|
75
|
+
--text-title:22px;
|
|
76
|
+
--text-title--line-height:28px;
|
|
77
|
+
--text-title-touch:24px;
|
|
78
|
+
--text-title-touch--line-height:30px;
|
|
79
|
+
--text-metric:28px;
|
|
80
|
+
--text-metric--line-height:32px;
|
|
81
|
+
--text-id:12px;
|
|
82
|
+
--text-id--line-height:16px;
|
|
83
|
+
--text-code:13px;
|
|
84
|
+
--text-code--line-height:20px;
|
|
85
|
+
--size-control-xs:28px;
|
|
86
|
+
--size-control-sm:32px;
|
|
87
|
+
--size-control:36px;
|
|
88
|
+
--size-control-touch:44px;
|
|
89
|
+
--size-row-header:40px;
|
|
90
|
+
--size-row:48px;
|
|
91
|
+
--size-sidebar:256px;
|
|
92
|
+
--size-rail:64px;
|
|
93
|
+
--size-header:56px;
|
|
94
|
+
--size-tabbar:68px;
|
|
95
|
+
--size-dialog-sm:512px;
|
|
96
|
+
--size-dialog-md:560px;
|
|
97
|
+
--size-palette:600px;
|
|
98
|
+
--size-sheet:560px;
|
|
99
|
+
--size-toast:380px;
|
|
100
|
+
--size-icon-sm:14px;
|
|
101
|
+
--size-icon:16px;
|
|
102
|
+
--size-icon-lg:20px;
|
|
103
|
+
--size-icon-tab:22px;
|
|
104
|
+
--size-icon-xl:24px;
|
|
105
|
+
--duration-fast:150ms;
|
|
106
|
+
--duration-base:200ms;
|
|
107
|
+
--duration-slow:300ms;
|
|
108
|
+
--duration-highlight:600ms;
|
|
109
|
+
--duration-pulse:1800ms;
|
|
110
|
+
--ease-standard:cubic-bezier(0.2, 0, 0, 1);
|
|
111
|
+
--ease-exit:cubic-bezier(0.4, 0, 1, 1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dark {
|
|
115
|
+
color-scheme:dark;
|
|
116
|
+
--background:oklch(0.172 0.012 257);
|
|
117
|
+
--card:oklch(0.2 0.013 257);
|
|
118
|
+
--popover:oklch(0.215 0.013 257);
|
|
119
|
+
--muted:oklch(0.228 0.012 257);
|
|
120
|
+
--secondary:oklch(0.255 0.013 257);
|
|
121
|
+
--accent:oklch(0.26 0.014 257);
|
|
122
|
+
--sidebar:oklch(0.19 0.012 257);
|
|
123
|
+
--highlight:oklch(0.27 0.045 255);
|
|
124
|
+
--overlay:oklch(0.08 0.01 257 / 0.62);
|
|
125
|
+
--foreground:oklch(0.955 0.005 247);
|
|
126
|
+
--muted-foreground:oklch(0.72 0.016 257);
|
|
127
|
+
--destructive-text:oklch(0.7 0.16 25);
|
|
128
|
+
--border:oklch(0.29 0.014 257);
|
|
129
|
+
--input:oklch(0.34 0.015 257);
|
|
130
|
+
--ring:oklch(0.7 0.1 252);
|
|
131
|
+
--primary:oklch(0.86 0.055 250);
|
|
132
|
+
--primary-hover:oklch(0.92 0.035 250);
|
|
133
|
+
--primary-foreground:oklch(0.21 0.035 257);
|
|
134
|
+
--destructive:oklch(0.56 0.19 25);
|
|
135
|
+
--destructive-foreground:oklch(0.99 0 0);
|
|
136
|
+
--tone-waiting-bg:oklch(0.29 0.055 72);
|
|
137
|
+
--tone-waiting-fg:oklch(0.87 0.11 82);
|
|
138
|
+
--tone-waiting-border:oklch(0.41 0.075 72);
|
|
139
|
+
--tone-active-bg:oklch(0.29 0.06 257);
|
|
140
|
+
--tone-active-fg:oklch(0.85 0.08 252);
|
|
141
|
+
--tone-active-border:oklch(0.42 0.09 257);
|
|
142
|
+
--tone-ok-bg:oklch(0.29 0.05 155);
|
|
143
|
+
--tone-ok-fg:oklch(0.86 0.1 155);
|
|
144
|
+
--tone-ok-border:oklch(0.41 0.07 155);
|
|
145
|
+
--tone-attention-bg:oklch(0.3 0.07 25);
|
|
146
|
+
--tone-attention-fg:oklch(0.84 0.09 25);
|
|
147
|
+
--tone-attention-border:oklch(0.45 0.11 25);
|
|
148
|
+
--tone-ended-bg:oklch(0.255 0.01 257);
|
|
149
|
+
--tone-ended-fg:oklch(0.78 0.015 257);
|
|
150
|
+
--tone-ended-border:oklch(0.36 0.012 257);
|
|
151
|
+
--shadow-sm:0 1px 2px oklch(0 0 0 / 0.3);
|
|
152
|
+
--shadow-md:0 2px 6px oklch(0 0 0 / 0.35);
|
|
153
|
+
--shadow-lg:0 16px 40px oklch(0 0 0 / 0.55), 0 2px 8px oklch(0 0 0 / 0.3);
|
|
154
|
+
}
|
|
@@ -9,7 +9,8 @@ export type AccountId = z.infer<typeof accountIdSchema>;
|
|
|
9
9
|
* (decision 0058), read once its signature and issuer are checked: the
|
|
10
10
|
* account, its organisation, the fleet (its audience), the scopes and `group`
|
|
11
11
|
* values its groups and own rights give there, its person ship there if it
|
|
12
|
-
* has one,
|
|
12
|
+
* has one, whether it is allowed as argo there (absent is not), and when it
|
|
13
|
+
* was issued and ends. Times are JWT seconds.
|
|
13
14
|
*/
|
|
14
15
|
export declare const accountTokenClaimsSchema: z.ZodPipe<z.ZodObject<{
|
|
15
16
|
iss: z.ZodString;
|
|
@@ -19,6 +20,7 @@ export declare const accountTokenClaimsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
19
20
|
scope: z.ZodString;
|
|
20
21
|
group: z.ZodArray<z.ZodString>;
|
|
21
22
|
person_ship: z.ZodOptional<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
23
|
+
argo: z.ZodOptional<z.ZodBoolean>;
|
|
22
24
|
iat: z.ZodNumber;
|
|
23
25
|
exp: z.ZodNumber;
|
|
24
26
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -29,6 +31,7 @@ export declare const accountTokenClaimsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
29
31
|
scopes: string[];
|
|
30
32
|
groupValues: string[];
|
|
31
33
|
personShipId: `shp_${string}` | null;
|
|
34
|
+
isArgoAllowed: boolean;
|
|
32
35
|
issuedAt: Date;
|
|
33
36
|
endsAt: Date;
|
|
34
37
|
}, {
|
|
@@ -41,6 +44,7 @@ export declare const accountTokenClaimsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
41
44
|
iat: number;
|
|
42
45
|
exp: number;
|
|
43
46
|
person_ship?: `shp_${string}` | undefined;
|
|
47
|
+
argo?: boolean | undefined;
|
|
44
48
|
}>>;
|
|
45
49
|
export type AccountTokenClaims = z.infer<typeof accountTokenClaimsSchema>;
|
|
46
50
|
/** The request header whoever acts for a human presents the account's token in, beside its own crew token if it has one (decision 0058). */
|
|
@@ -11,7 +11,8 @@ const MILLISECONDS_PER_SECOND = 1000;
|
|
|
11
11
|
* (decision 0058), read once its signature and issuer are checked: the
|
|
12
12
|
* account, its organisation, the fleet (its audience), the scopes and `group`
|
|
13
13
|
* values its groups and own rights give there, its person ship there if it
|
|
14
|
-
* has one,
|
|
14
|
+
* has one, whether it is allowed as argo there (absent is not), and when it
|
|
15
|
+
* was issued and ends. Times are JWT seconds.
|
|
15
16
|
*/
|
|
16
17
|
export const accountTokenClaimsSchema = z
|
|
17
18
|
.object({
|
|
@@ -22,6 +23,7 @@ export const accountTokenClaimsSchema = z
|
|
|
22
23
|
scope: z.string(),
|
|
23
24
|
group: z.array(z.string()),
|
|
24
25
|
person_ship: idSchema('ship').optional(),
|
|
26
|
+
argo: z.boolean().optional(),
|
|
25
27
|
iat: z.number(),
|
|
26
28
|
exp: z.number(),
|
|
27
29
|
})
|
|
@@ -40,6 +42,7 @@ export const accountTokenClaimsSchema = z
|
|
|
40
42
|
scopes: parsed.data,
|
|
41
43
|
groupValues: claims.group,
|
|
42
44
|
personShipId: claims.person_ship ?? null,
|
|
45
|
+
isArgoAllowed: claims.argo ?? false,
|
|
43
46
|
issuedAt: new Date(claims.iat * MILLISECONDS_PER_SECOND),
|
|
44
47
|
endsAt: new Date(claims.exp * MILLISECONDS_PER_SECOND),
|
|
45
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-token.js","sourceRoot":"","sources":["../../src/schemas/account-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,KAAK,EAAe,CAAC;AAGjG,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC
|
|
1
|
+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,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,0CAA0C,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3G,OAAO,CAAC,CAAC,KAAK,CAAC;IACjB,CAAC;IACD,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,GAAG;QAClB,OAAO,EAAE,MAAM,CAAC,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC,GAAG;QACrB,cAAc,EAAE,MAAM,CAAC,GAAG;QAC1B,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,WAAW,EAAE,MAAM,CAAC,KAAK;QACzB,YAAY,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI;QACxC,aAAa,EAAE,MAAM,CAAC,IAAI,IAAI,KAAK;QACnC,QAAQ,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,uBAAuB,CAAC;QACxD,MAAM,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,uBAAuB,CAAC;KACvD,CAAC;AACJ,CAAC,CAAC,CAAC;AAGL,4IAA4I;AAC5I,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE3D,0HAA0H;AAC1H,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The Aeolus web apps the header switches between (H12: plugin pages are not apps yet). */
|
|
3
|
+
export declare const HEADER_APPS: readonly ["console", "gateway", "account", "admin"];
|
|
4
|
+
export declare const headerAppSchema: z.ZodEnum<{
|
|
5
|
+
console: "console";
|
|
6
|
+
gateway: "gateway";
|
|
7
|
+
account: "account";
|
|
8
|
+
admin: "admin";
|
|
9
|
+
}>;
|
|
10
|
+
export type HeaderApp = z.infer<typeof headerAppSchema>;
|
|
11
|
+
/** An app the header links to, and where: an http(s) address only, since the browser follows it. */
|
|
12
|
+
export declare const appLinkSchema: z.ZodObject<{
|
|
13
|
+
app: z.ZodEnum<{
|
|
14
|
+
console: "console";
|
|
15
|
+
gateway: "gateway";
|
|
16
|
+
account: "account";
|
|
17
|
+
admin: "admin";
|
|
18
|
+
}>;
|
|
19
|
+
url: z.ZodURL;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type AppLink = z.infer<typeof appLinkSchema>;
|
|
22
|
+
export declare const appsListSchema: z.ZodObject<{
|
|
23
|
+
account: z.ZodObject<{
|
|
24
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
apps: z.ZodArray<z.ZodObject<{
|
|
28
|
+
app: z.ZodEnum<{
|
|
29
|
+
console: "console";
|
|
30
|
+
gateway: "gateway";
|
|
31
|
+
account: "account";
|
|
32
|
+
admin: "admin";
|
|
33
|
+
}>;
|
|
34
|
+
url: z.ZodURL;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
fleets: z.ZodArray<z.ZodObject<{
|
|
37
|
+
id: z.ZodType<`flt_${string}`, unknown, z.core.$ZodTypeInternals<`flt_${string}`, unknown>>;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
argo: z.ZodBoolean;
|
|
40
|
+
apps: z.ZodArray<z.ZodObject<{
|
|
41
|
+
app: z.ZodEnum<{
|
|
42
|
+
console: "console";
|
|
43
|
+
gateway: "gateway";
|
|
44
|
+
account: "account";
|
|
45
|
+
admin: "admin";
|
|
46
|
+
}>;
|
|
47
|
+
url: z.ZodURL;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type AppsList = z.infer<typeof appsListSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from '../ids/index.js';
|
|
3
|
+
import { accountIdSchema } from './account-token.js';
|
|
4
|
+
/*
|
|
5
|
+
* The apps and fleets an account may open, as pagasae answers an Aeolus app's
|
|
6
|
+
* server at GET /api/apps (header design H1): Account always and Admin for
|
|
7
|
+
* the App admin, outside any fleet; then each fleet where the account holds
|
|
8
|
+
* any scope, with the console where it holds fleet:read and the gateway where
|
|
9
|
+
* it is on, and whether it may sign in as argo there.
|
|
10
|
+
*/
|
|
11
|
+
/** The Aeolus web apps the header switches between (H12: plugin pages are not apps yet). */
|
|
12
|
+
export const HEADER_APPS = ['console', 'gateway', 'account', 'admin'];
|
|
13
|
+
export const headerAppSchema = z.enum(HEADER_APPS);
|
|
14
|
+
/** An app the header links to, and where: an http(s) address only, since the browser follows it. */
|
|
15
|
+
export const appLinkSchema = z.object({ app: headerAppSchema, url: z.httpUrl() });
|
|
16
|
+
export const appsListSchema = z.object({
|
|
17
|
+
account: z.object({ id: accountIdSchema, email: z.string() }),
|
|
18
|
+
apps: z.array(appLinkSchema),
|
|
19
|
+
fleets: z.array(z.object({ id: idSchema('fleet'), name: z.string(), argo: z.boolean(), apps: z.array(appLinkSchema) })),
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=apps-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps-list.js","sourceRoot":"","sources":["../../src/schemas/apps-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;GAMG;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAGnD,oGAAoG;AACpG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAGlF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;CACxH,CAAC,CAAC"}
|
|
@@ -29,24 +29,34 @@ export declare const themeSchema: z.ZodEnum<{
|
|
|
29
29
|
system: "system";
|
|
30
30
|
}>;
|
|
31
31
|
export type Theme = z.infer<typeof themeSchema>;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Whose a console sign-in is: the operator's, crewing argo, a viewer's,
|
|
34
|
+
* through the viewer ship (decision 0022), or an account's, by its account
|
|
35
|
+
* token, with no lease (accounts design, F1).
|
|
36
|
+
*/
|
|
33
37
|
export declare const consoleSessionKindSchema: z.ZodEnum<{
|
|
34
38
|
operator: "operator";
|
|
35
39
|
viewer: "viewer";
|
|
40
|
+
account: "account";
|
|
36
41
|
}>;
|
|
37
42
|
/**
|
|
38
43
|
* Output of `console.session`: for another service the operator uses beside
|
|
39
44
|
* the console, which forwards the browser's session cookie and asks whether
|
|
40
45
|
* someone is signed in. The fleet, when the session expires (ISO 8601 in
|
|
41
46
|
* UTC), whose session it is, and the scopes of its ship: a viewer reads only.
|
|
47
|
+
* An account's is its account token: its id, when the token ends, and the
|
|
48
|
+
* scopes it carries.
|
|
42
49
|
*/
|
|
43
50
|
export declare const consoleSessionOutputSchema: z.ZodObject<{
|
|
44
51
|
fleetId: z.ZodType<`flt_${string}`, unknown, z.core.$ZodTypeInternals<`flt_${string}`, unknown>>;
|
|
52
|
+
fleetName: z.ZodString;
|
|
45
53
|
expiresAt: z.ZodISODateTime;
|
|
46
54
|
kind: z.ZodEnum<{
|
|
47
55
|
operator: "operator";
|
|
48
56
|
viewer: "viewer";
|
|
57
|
+
account: "account";
|
|
49
58
|
}>;
|
|
59
|
+
accountId: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "AccountId", "out">>;
|
|
50
60
|
scopes: z.ZodArray<z.ZodEnum<{
|
|
51
61
|
"messages:send": "messages:send";
|
|
52
62
|
"messages:receive": "messages:receive";
|
|
@@ -71,6 +81,10 @@ export declare const consoleSessionOutputSchema: z.ZodObject<{
|
|
|
71
81
|
"scopes:grant": "scopes:grant";
|
|
72
82
|
}>>;
|
|
73
83
|
}, z.core.$strip>;
|
|
84
|
+
/** Input of `console.presentAccountToken`: the account token pagasae gave the console's server for this fleet (decision 0058). */
|
|
85
|
+
export declare const presentAccountTokenInputSchema: z.ZodObject<{
|
|
86
|
+
token: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
74
88
|
export type ConsoleSessionOutput = z.infer<typeof consoleSessionOutputSchema>;
|
|
75
89
|
/**
|
|
76
90
|
* Output of `console.account`: the signed-in operator, their theme, and this
|
|
@@ -79,12 +93,13 @@ export type ConsoleSessionOutput = z.infer<typeof consoleSessionOutputSchema>;
|
|
|
79
93
|
*/
|
|
80
94
|
export declare const accountOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
81
95
|
kind: z.ZodLiteral<"operator">;
|
|
82
|
-
email: z.ZodString
|
|
96
|
+
email: z.ZodNullable<z.ZodString>;
|
|
83
97
|
theme: z.ZodEnum<{
|
|
84
98
|
light: "light";
|
|
85
99
|
dark: "dark";
|
|
86
100
|
system: "system";
|
|
87
101
|
}>;
|
|
102
|
+
hasPassword: z.ZodBoolean;
|
|
88
103
|
session: z.ZodObject<{
|
|
89
104
|
device: z.ZodString;
|
|
90
105
|
since: z.ZodISODateTime;
|
|
@@ -97,8 +112,23 @@ export declare const accountOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
97
112
|
since: z.ZodISODateTime;
|
|
98
113
|
accountId: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AccountId", "out">>>;
|
|
99
114
|
}, z.core.$strip>;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"account">;
|
|
117
|
+
accountId: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
100
118
|
}, z.core.$strip>], "kind">;
|
|
101
119
|
export type Account = z.infer<typeof accountOutputSchema>;
|
|
120
|
+
/**
|
|
121
|
+
* Output of `console.argoSignIn`: whether someone is signed in as argo, and
|
|
122
|
+
* the account, by its id, or none for argo's own sign-in (accounts design,
|
|
123
|
+
* F4): the console warns before an account signs in as argo and ends it.
|
|
124
|
+
*/
|
|
125
|
+
export declare const argoSignInOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
|
+
isSignedIn: z.ZodLiteral<false>;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
isSignedIn: z.ZodLiteral<true>;
|
|
129
|
+
accountId: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "AccountId", "out">>;
|
|
130
|
+
}, z.core.$strip>], "isSignedIn">;
|
|
131
|
+
export type ArgoSignInOutput = z.infer<typeof argoSignInOutputSchema>;
|
|
102
132
|
/** Input of `console.setTheme`. */
|
|
103
133
|
export declare const setThemeInputSchema: z.ZodObject<{
|
|
104
134
|
theme: z.ZodEnum<{
|
|
@@ -107,5 +137,20 @@ export declare const setThemeInputSchema: z.ZodObject<{
|
|
|
107
137
|
system: "system";
|
|
108
138
|
}>;
|
|
109
139
|
}, z.core.$strip>;
|
|
140
|
+
/**
|
|
141
|
+
* Input of `console.setLogin`: the email and new password of argo's own
|
|
142
|
+
* sign-in, on a self-hosted fleet (accounts design, A1), with the current
|
|
143
|
+
* password while argo has one. Whitespace around the email is dropped; the
|
|
144
|
+
* server checks its shape and that no other operator signs in with it. The
|
|
145
|
+
* passwords are taken exactly as typed.
|
|
146
|
+
*/
|
|
147
|
+
export declare const setLoginInputSchema: z.ZodObject<{
|
|
148
|
+
email: z.ZodString;
|
|
149
|
+
password: z.ZodString;
|
|
150
|
+
currentPassword: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
export type SetLoginInput = z.infer<typeof setLoginInputSchema>;
|
|
153
|
+
/** Output of `console.setLogin`: nothing; the OK is the answer. */
|
|
154
|
+
export declare const setLoginOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
110
155
|
/** Output of `console.setTheme`: nothing; the OK is the answer. */
|
|
111
156
|
export declare const setThemeOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
package/dist/schemas/console.js
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { scopeSchema } from '../fleet/index.js';
|
|
3
3
|
import { idSchema } from '../ids/index.js';
|
|
4
4
|
import { accountIdSchema } from './account-token.js';
|
|
5
|
-
import { EMAIL_REQUIRED, EMAIL_TOO_LONG, OPERATOR_EMAIL_MAX_LENGTH, OPERATOR_PASSWORD_MAX_LENGTH, PASSWORD_REQUIRED, PASSWORD_TOO_LONG } from '../rules/sign-in.js';
|
|
5
|
+
import { EMAIL_REQUIRED, EMAIL_TOO_LONG, OPERATOR_EMAIL_MAX_LENGTH, OPERATOR_PASSWORD_MAX_LENGTH, OPERATOR_PASSWORD_MIN_LENGTH, PASSWORD_REQUIRED, PASSWORD_TOO_LONG, PASSWORD_TOO_SHORT, } from '../rules/sign-in.js';
|
|
6
6
|
/** One @ with something on each side, and no whitespace. */
|
|
7
7
|
export const OPERATOR_EMAIL_PATTERN = /^[^\s@]+@[^\s@]+$/;
|
|
8
8
|
export { newOperatorPasswordProblem, OPERATOR_EMAIL_MAX_LENGTH, OPERATOR_PASSWORD_MAX_LENGTH } from '../rules/sign-in.js';
|
|
@@ -29,20 +29,31 @@ export const THEMES = ['light', 'dark', 'system'];
|
|
|
29
29
|
export const themeSchema = z.enum(THEMES);
|
|
30
30
|
/** ISO 8601 in UTC. */
|
|
31
31
|
const isoTime = z.iso.datetime();
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Whose a console sign-in is: the operator's, crewing argo, a viewer's,
|
|
34
|
+
* through the viewer ship (decision 0022), or an account's, by its account
|
|
35
|
+
* token, with no lease (accounts design, F1).
|
|
36
|
+
*/
|
|
37
|
+
export const consoleSessionKindSchema = z.enum(['operator', 'viewer', 'account']);
|
|
34
38
|
/**
|
|
35
39
|
* Output of `console.session`: for another service the operator uses beside
|
|
36
40
|
* the console, which forwards the browser's session cookie and asks whether
|
|
37
41
|
* someone is signed in. The fleet, when the session expires (ISO 8601 in
|
|
38
42
|
* UTC), whose session it is, and the scopes of its ship: a viewer reads only.
|
|
43
|
+
* An account's is its account token: its id, when the token ends, and the
|
|
44
|
+
* scopes it carries.
|
|
39
45
|
*/
|
|
40
46
|
export const consoleSessionOutputSchema = z.object({
|
|
41
47
|
fleetId: idSchema('fleet'),
|
|
48
|
+
/** The fleet's name, which the header's title shows (header design H8). */
|
|
49
|
+
fleetName: z.string(),
|
|
42
50
|
expiresAt: z.iso.datetime(),
|
|
43
51
|
kind: consoleSessionKindSchema,
|
|
52
|
+
accountId: accountIdSchema.optional(),
|
|
44
53
|
scopes: z.array(scopeSchema),
|
|
45
54
|
});
|
|
55
|
+
/** Input of `console.presentAccountToken`: the account token pagasae gave the console's server for this fleet (decision 0058). */
|
|
56
|
+
export const presentAccountTokenInputSchema = z.object({ token: z.string().min(1).max(16_384) });
|
|
46
57
|
/** This console session: its device, since when, and the account that signed in as argo, by its id, or none (decision 0054). */
|
|
47
58
|
const accountSessionSchema = z.object({ device: z.string(), since: isoTime, accountId: accountIdSchema.nullable().optional() });
|
|
48
59
|
/**
|
|
@@ -51,11 +62,37 @@ const accountSessionSchema = z.object({ device: z.string(), since: isoTime, acco
|
|
|
51
62
|
* session has no email and no theme (decision 0022).
|
|
52
63
|
*/
|
|
53
64
|
export const accountOutputSchema = z.discriminatedUnion('kind', [
|
|
54
|
-
|
|
65
|
+
// No email until argo sets one in Settings: fleet:init gives its own sign-in none (accounts design, A1).
|
|
66
|
+
z.object({ kind: z.literal('operator'), email: z.string().nullable(), theme: themeSchema, hasPassword: z.boolean(), session: accountSessionSchema }),
|
|
55
67
|
z.object({ kind: z.literal('viewer'), session: accountSessionSchema }),
|
|
68
|
+
// An account by its id alone: core keeps no email (decision 0058); the console asks pagasae for its name.
|
|
69
|
+
z.object({ kind: z.literal('account'), accountId: accountIdSchema }),
|
|
70
|
+
]);
|
|
71
|
+
/**
|
|
72
|
+
* Output of `console.argoSignIn`: whether someone is signed in as argo, and
|
|
73
|
+
* the account, by its id, or none for argo's own sign-in (accounts design,
|
|
74
|
+
* F4): the console warns before an account signs in as argo and ends it.
|
|
75
|
+
*/
|
|
76
|
+
export const argoSignInOutputSchema = z.discriminatedUnion('isSignedIn', [
|
|
77
|
+
z.object({ isSignedIn: z.literal(false) }),
|
|
78
|
+
z.object({ isSignedIn: z.literal(true), accountId: accountIdSchema.nullable() }),
|
|
56
79
|
]);
|
|
57
80
|
/** Input of `console.setTheme`. */
|
|
58
81
|
export const setThemeInputSchema = z.object({ theme: themeSchema });
|
|
82
|
+
/**
|
|
83
|
+
* Input of `console.setLogin`: the email and new password of argo's own
|
|
84
|
+
* sign-in, on a self-hosted fleet (accounts design, A1), with the current
|
|
85
|
+
* password while argo has one. Whitespace around the email is dropped; the
|
|
86
|
+
* server checks its shape and that no other operator signs in with it. The
|
|
87
|
+
* passwords are taken exactly as typed.
|
|
88
|
+
*/
|
|
89
|
+
export const setLoginInputSchema = z.object({
|
|
90
|
+
email: z.string().trim().min(1, EMAIL_REQUIRED).max(OPERATOR_EMAIL_MAX_LENGTH, EMAIL_TOO_LONG),
|
|
91
|
+
password: z.string().min(OPERATOR_PASSWORD_MIN_LENGTH, PASSWORD_TOO_SHORT).max(OPERATOR_PASSWORD_MAX_LENGTH, PASSWORD_TOO_LONG),
|
|
92
|
+
currentPassword: z.string().max(OPERATOR_PASSWORD_MAX_LENGTH, PASSWORD_TOO_LONG).optional(),
|
|
93
|
+
});
|
|
94
|
+
/** Output of `console.setLogin`: nothing; the OK is the answer. */
|
|
95
|
+
export const setLoginOutputSchema = z.strictObject({});
|
|
59
96
|
/** Output of `console.setTheme`: nothing; the OK is the answer. */
|
|
60
97
|
export const setThemeOutputSchema = z.strictObject({});
|
|
61
98
|
//# sourceMappingURL=console.js.map
|