@wrenautomation/aerie 0.4.2 → 0.4.4
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/bin.js +73 -73
- package/dist/bin.js.map +4 -4
- package/dist/core/address.d.ts +21 -0
- package/dist/core/address.js +103 -0
- package/dist/core/address.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/rows.d.ts +17 -0
- package/dist/core/rows.js +34 -0
- package/dist/core/rows.js.map +1 -0
- package/dist/core/task.d.ts +5 -0
- package/dist/core/task.js +45 -0
- package/dist/core/task.js.map +1 -1
- package/dist/http.d.ts +4 -2
- package/dist/http.js +5 -2
- package/dist/http.js.map +1 -1
- package/dist/peers-coord.js +98 -80
- package/dist/peers-coord.js.map +4 -4
- package/drizzle/0007_live_notify.sql +40 -0
- package/drizzle/meta/0007_snapshot.json +1520 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Filter, type Sort } from "./filter.js";
|
|
2
|
+
export declare const VIEW_LAYOUTS: readonly ["list", "board", "columns"];
|
|
3
|
+
export type ViewLayout = (typeof VIEW_LAYOUTS)[number];
|
|
4
|
+
/** what the page shows; `text` goes to the search route, never to `matches` (a list row has no long text) */
|
|
5
|
+
export interface AddressView {
|
|
6
|
+
filter: Filter;
|
|
7
|
+
sort: Sort[];
|
|
8
|
+
group?: string;
|
|
9
|
+
layout: ViewLayout;
|
|
10
|
+
text?: string;
|
|
11
|
+
}
|
|
12
|
+
/** the address keys a view owns; the page's own keys (`task`) stay outside */
|
|
13
|
+
export declare const VIEW_KEYS: readonly ["area", "sub", "status", "priority", "type", "milestone", "label", "assignee", "holder", "who", "role", "parent", "open", "q", "sort", "group", "layout"];
|
|
14
|
+
interface Query {
|
|
15
|
+
get(k: string): string | null;
|
|
16
|
+
getAll(k: string): string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function viewOfAddress(q: Query): AddressView;
|
|
19
|
+
/** the view as address pairs, in `VIEW_KEYS` order; defaults (list layout, subtree on) leave no key; the first sort only */
|
|
20
|
+
export declare function addressOfView(v: AddressView): [string, string][];
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { GROUP_KEYS } from "./fields.js";
|
|
2
|
+
import { SORT_FIELDS } from "./filter.js";
|
|
3
|
+
export const VIEW_LAYOUTS = ["list", "board", "columns"];
|
|
4
|
+
const ROLES = ["owner", "manager", "doer", "watcher"];
|
|
5
|
+
/** the address keys a view owns; the page's own keys (`task`) stay outside */
|
|
6
|
+
export const VIEW_KEYS = [
|
|
7
|
+
"area",
|
|
8
|
+
"sub",
|
|
9
|
+
"status",
|
|
10
|
+
"priority",
|
|
11
|
+
"type",
|
|
12
|
+
"milestone",
|
|
13
|
+
"label",
|
|
14
|
+
"assignee",
|
|
15
|
+
"holder",
|
|
16
|
+
"who",
|
|
17
|
+
"role",
|
|
18
|
+
"parent",
|
|
19
|
+
"open",
|
|
20
|
+
"q",
|
|
21
|
+
"sort",
|
|
22
|
+
"group",
|
|
23
|
+
"layout",
|
|
24
|
+
];
|
|
25
|
+
const list = (q, k) => q.getAll(k).filter(Boolean);
|
|
26
|
+
export function viewOfAddress(q) {
|
|
27
|
+
const f = {};
|
|
28
|
+
for (const k of ["area", "status", "priority", "type", "milestone", "label"]) {
|
|
29
|
+
const v = list(q, k);
|
|
30
|
+
if (v.length)
|
|
31
|
+
f[k] = v;
|
|
32
|
+
}
|
|
33
|
+
if (f.area && q.get("sub") === "0")
|
|
34
|
+
f.subtree = false;
|
|
35
|
+
for (const k of ["assignee", "holder", "parent"]) {
|
|
36
|
+
const v = q.get(k);
|
|
37
|
+
if (v)
|
|
38
|
+
f[k] = v;
|
|
39
|
+
}
|
|
40
|
+
const who = q.get("who");
|
|
41
|
+
if (who) {
|
|
42
|
+
const roles = list(q, "role").filter((r) => ROLES.includes(r));
|
|
43
|
+
f.role = roles.length ? { actor: who, roles } : { actor: who };
|
|
44
|
+
}
|
|
45
|
+
if (q.get("open") === "1")
|
|
46
|
+
f.openChecks = true;
|
|
47
|
+
// one field, `-` = desc: wren's router keeps `sort` only as `^-?[\w.]+$`
|
|
48
|
+
const raw = q.get("sort") ?? "";
|
|
49
|
+
const field = raw.replace(/^-/, "");
|
|
50
|
+
const sort = SORT_FIELDS.includes(field)
|
|
51
|
+
? [{ field: field, dir: raw.startsWith("-") ? "desc" : "asc" }]
|
|
52
|
+
: [];
|
|
53
|
+
const group = q.get("group");
|
|
54
|
+
const layout = q.get("layout");
|
|
55
|
+
const text = q.get("q")?.trim();
|
|
56
|
+
return {
|
|
57
|
+
filter: f,
|
|
58
|
+
sort,
|
|
59
|
+
...(group && GROUP_KEYS.includes(group) ? { group } : {}),
|
|
60
|
+
layout: VIEW_LAYOUTS.includes(layout) ? layout : "list",
|
|
61
|
+
...(text ? { text } : {}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** the view as address pairs, in `VIEW_KEYS` order; defaults (list layout, subtree on) leave no key; the first sort only */
|
|
65
|
+
export function addressOfView(v) {
|
|
66
|
+
const f = v.filter;
|
|
67
|
+
const out = [];
|
|
68
|
+
const many = (k, vs) => {
|
|
69
|
+
for (const x of vs ?? [])
|
|
70
|
+
out.push([k, x]);
|
|
71
|
+
};
|
|
72
|
+
many("area", f.area);
|
|
73
|
+
if (f.area?.length && f.subtree === false)
|
|
74
|
+
out.push(["sub", "0"]);
|
|
75
|
+
many("status", f.status);
|
|
76
|
+
many("priority", f.priority);
|
|
77
|
+
many("type", f.type);
|
|
78
|
+
many("milestone", f.milestone);
|
|
79
|
+
many("label", f.label);
|
|
80
|
+
if (f.assignee)
|
|
81
|
+
out.push(["assignee", f.assignee]);
|
|
82
|
+
if (f.holder)
|
|
83
|
+
out.push(["holder", f.holder]);
|
|
84
|
+
if (f.role) {
|
|
85
|
+
out.push(["who", f.role.actor]);
|
|
86
|
+
many("role", f.role.roles);
|
|
87
|
+
}
|
|
88
|
+
if (f.parent)
|
|
89
|
+
out.push(["parent", f.parent]);
|
|
90
|
+
if (f.openChecks)
|
|
91
|
+
out.push(["open", "1"]);
|
|
92
|
+
if (v.text)
|
|
93
|
+
out.push(["q", v.text]);
|
|
94
|
+
const first = v.sort[0];
|
|
95
|
+
if (first)
|
|
96
|
+
out.push(["sort", `${first.dir === "desc" ? "-" : ""}${first.field}`]);
|
|
97
|
+
if (v.group)
|
|
98
|
+
out.push(["group", v.group]);
|
|
99
|
+
if (v.layout !== "list")
|
|
100
|
+
out.push(["layout", v.layout]);
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/core/address.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAe,WAAW,EAA6B,MAAM,aAAa,CAAC;AAElF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAElE,MAAM,KAAK,GAAwB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAW3E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM;IACN,KAAK;IACL,QAAQ;IACR,UAAU;IACV,MAAM;IACN,WAAW;IACX,OAAO;IACP,UAAU;IACV,QAAQ;IACR,KAAK;IACL,MAAM;IACN,QAAQ;IACR,MAAM;IACN,GAAG;IACH,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC;AAOX,MAAM,IAAI,GAAG,CAAC,CAAQ,EAAE,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAElE,MAAM,UAA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IAC7C,IAAI,CAAC,CAAC,UAAU;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,CAAC,IAAI;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,KAAK;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAClF,IAAI,CAAC,CAAC,KAAK;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Pure rules. Zero imports outside this folder: peers vendors it (generated, pinned, drift test). */
|
|
2
|
+
export * from "./address.js";
|
|
2
3
|
export * from "./area.js";
|
|
3
4
|
export * from "./edit.js";
|
|
4
5
|
export * from "./fields.js";
|
|
5
6
|
export * from "./filter.js";
|
|
7
|
+
export * from "./rows.js";
|
|
6
8
|
export * from "./task.js";
|
package/dist/core/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** Pure rules. Zero imports outside this folder: peers vendors it (generated, pinned, drift test). */
|
|
2
|
+
export * from "./address.js";
|
|
2
3
|
export * from "./area.js";
|
|
3
4
|
export * from "./edit.js";
|
|
4
5
|
export * from "./fields.js";
|
|
5
6
|
export * from "./filter.js";
|
|
7
|
+
export * from "./rows.js";
|
|
6
8
|
export * from "./task.js";
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live rows (D16): a host loads every row once and filters in memory (`matches`); a push reads only the rows
|
|
3
|
+
* written since the newest one it holds, then merges them by id. `updatedAt` is the writer's clock (CLI, Lambda),
|
|
4
|
+
* so the read reaches back `SKEW_MS` past it; the merge is idempotent.
|
|
5
|
+
*/
|
|
6
|
+
import type { TaskView } from "./filter.js";
|
|
7
|
+
export declare const SKEW_MS = 60000;
|
|
8
|
+
/** `updatedAfter` for the next read; undefined: read all */
|
|
9
|
+
export declare function changedSince(rows: readonly Pick<TaskView, "updatedAt" | "createdAt">[], skewMs?: number): string | undefined;
|
|
10
|
+
/** `delta` over `before` by id; `changed`: ids new or at a newer version (a row's wash) */
|
|
11
|
+
export declare function mergeRows<T extends {
|
|
12
|
+
id: string;
|
|
13
|
+
version: number;
|
|
14
|
+
}>(before: readonly T[], delta: readonly T[]): {
|
|
15
|
+
rows: T[];
|
|
16
|
+
changed: string[];
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const SKEW_MS = 60_000;
|
|
2
|
+
/** `updatedAfter` for the next read; undefined: read all */
|
|
3
|
+
export function changedSince(rows, skewMs = SKEW_MS) {
|
|
4
|
+
let newest = "";
|
|
5
|
+
for (const r of rows) {
|
|
6
|
+
const at = r.updatedAt ?? r.createdAt;
|
|
7
|
+
if (at > newest)
|
|
8
|
+
newest = at;
|
|
9
|
+
}
|
|
10
|
+
if (!newest)
|
|
11
|
+
return undefined;
|
|
12
|
+
const t = Date.parse(newest);
|
|
13
|
+
return Number.isNaN(t) ? undefined : new Date(t - skewMs).toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
14
|
+
}
|
|
15
|
+
/** `delta` over `before` by id; `changed`: ids new or at a newer version (a row's wash) */
|
|
16
|
+
export function mergeRows(before, delta) {
|
|
17
|
+
const at = new Map(before.map((r, i) => [r.id, i]));
|
|
18
|
+
const rows = [...before];
|
|
19
|
+
const changed = [];
|
|
20
|
+
for (const r of delta) {
|
|
21
|
+
const i = at.get(r.id);
|
|
22
|
+
if (i === undefined) {
|
|
23
|
+
at.set(r.id, rows.length);
|
|
24
|
+
rows.push(r);
|
|
25
|
+
changed.push(r.id);
|
|
26
|
+
}
|
|
27
|
+
else if (r.version > rows[i].version) {
|
|
28
|
+
rows[i] = r;
|
|
29
|
+
changed.push(r.id);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return { rows, changed };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/core/rows.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAE9B,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAC1B,IAA0D,EAC1D,MAAM,GAAG,OAAO;IAEhB,IAAI,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ACrB,CAAC;aAAM,IAAI,CAAC,CAAC,OAAO,GAAI,IAAI,CAAC,CAAC,CAAO,CAAC,OAAO,EAAE,CAAC;YAC9C,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC3B,CAAC"}
|
package/dist/core/task.d.ts
CHANGED
|
@@ -46,5 +46,10 @@ export declare const STATUSES: readonly ["To Do", "In Progress", "Needs Human In
|
|
|
46
46
|
export declare const PRIORITIES: readonly ["high", "medium", "low"];
|
|
47
47
|
/** Instant to ISO, second precision; `YYYY-MM-DD HH:MM` (old Backlog.md) reads as UTC. */
|
|
48
48
|
export declare function instant(v: unknown): string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* The description's first sentence, whole: what a list row and a board card show under the title (no clamp).
|
|
51
|
+
* Skips headings and blank lines; a list's first item counts; markdown emphasis and code ticks drop.
|
|
52
|
+
*/
|
|
53
|
+
export declare function summaryOf(description: string | undefined): string | undefined;
|
|
49
54
|
/** Two tasks mean the same: what the mirror compares before it writes. */
|
|
50
55
|
export declare function sameTask(a: Task, b: Task): boolean;
|
package/dist/core/task.js
CHANGED
|
@@ -21,6 +21,51 @@ export function instant(v) {
|
|
|
21
21
|
throw new Error(`not a date: ${s}`);
|
|
22
22
|
return d.toISOString().replace(/\.\d{3}Z$/, "Z");
|
|
23
23
|
}
|
|
24
|
+
const SHORT = 40;
|
|
25
|
+
/** words whose period never ends a sentence */
|
|
26
|
+
const ABBREV = /(?:^|[\s(])(?:e\.g|i\.e|etc|vs|cf|approx|no|incl|Mr|Ms|Dr|St)\.$/i;
|
|
27
|
+
/**
|
|
28
|
+
* The description's first sentence, whole: what a list row and a board card show under the title (no clamp).
|
|
29
|
+
* Skips headings and blank lines; a list's first item counts; markdown emphasis and code ticks drop.
|
|
30
|
+
*/
|
|
31
|
+
export function summaryOf(description) {
|
|
32
|
+
if (!description)
|
|
33
|
+
return undefined;
|
|
34
|
+
const para = [];
|
|
35
|
+
for (const raw of description.split("\n")) {
|
|
36
|
+
const line = raw.trim();
|
|
37
|
+
if (!line || /^#{1,6}\s/.test(line) || /^(```|<!--|---$|\|)/.test(line)) {
|
|
38
|
+
if (para.length)
|
|
39
|
+
break;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const item = /^(?:[-*+]|\d+[.)])\s+(?:\[[ xX]\]\s+)?(.*)$/.exec(line);
|
|
43
|
+
if (item) {
|
|
44
|
+
if (para.length)
|
|
45
|
+
break;
|
|
46
|
+
para.push(item[1] ?? "");
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
para.push(line);
|
|
50
|
+
}
|
|
51
|
+
const text = para
|
|
52
|
+
.join(" ")
|
|
53
|
+
.replace(/\*\*|__|`/g, "")
|
|
54
|
+
.replace(/\[([^\]]*)\]\([^)]*\)/g, "$1")
|
|
55
|
+
.replace(/\s+/g, " ")
|
|
56
|
+
.trim();
|
|
57
|
+
if (!text)
|
|
58
|
+
return undefined;
|
|
59
|
+
// a sentence ends at . ! ? before a space and a capital, a digit or an opening mark
|
|
60
|
+
const end = /[.!?](?=\s+["'([A-Z0-9])/g;
|
|
61
|
+
for (let m = end.exec(text); m; m = end.exec(text)) {
|
|
62
|
+
const head = text.slice(0, m.index + 1);
|
|
63
|
+
// "William 11-04." says nothing alone: a summary runs to a sentence end past SHORT
|
|
64
|
+
if (head.length >= SHORT && !ABBREV.test(head))
|
|
65
|
+
return head;
|
|
66
|
+
}
|
|
67
|
+
return text;
|
|
68
|
+
}
|
|
24
69
|
/** Two tasks mean the same: what the mirror compares before it writes. */
|
|
25
70
|
export function sameTask(a, b) {
|
|
26
71
|
return canonical(a) === canonical(b);
|
package/dist/core/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../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AACd,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,QAAQ,CAAC,CAAO,EAAE,CAAO;IACvC,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,mFAAmF;AACnF,SAAS,SAAS,CAAC,CAAO;IACxB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IACjD,MAAM,MAAM,GAAG,CAAC,CAAU,EAAW,EAAE,CACrC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACd,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;YAC1B,CAAC,CAAC,MAAM,CAAC,WAAW,CAChB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;iBACd,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;iBAClC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CACnC;YACH,CAAC,CAAC,CAAC,CAAC;IACV,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/http.d.ts
CHANGED
|
@@ -11,8 +11,10 @@ export * from "./routes.js";
|
|
|
11
11
|
/** A task as the board and list show it: the long text fields stay on the server (`task` reads them). */
|
|
12
12
|
export type TaskRow = Omit<TaskRecord, "description" | "plan" | "notes" | "finalSummary" | "comments" | "extra" | "stray"> & {
|
|
13
13
|
comments: number;
|
|
14
|
+
/** the description's first sentence, whole (`summaryOf`): the row's second line */
|
|
15
|
+
summary?: string;
|
|
14
16
|
};
|
|
15
|
-
export declare const rowOf: ({ description
|
|
17
|
+
export declare const rowOf: ({ description, plan: _p, notes: _n, finalSummary: _f, extra: _e, stray: _s, comments, ...t }: TaskRecord) => TaskRow;
|
|
16
18
|
/** Every route's input shape; a host merges its own fields (viewer, signature) beside them. */
|
|
17
19
|
export declare const AERIE_INPUTS: {
|
|
18
20
|
readonly board: {};
|
|
@@ -265,8 +267,8 @@ export declare const AERIE_INPUTS: {
|
|
|
265
267
|
}, z.core.$strict>>;
|
|
266
268
|
readonly groupBy: z.ZodOptional<z.ZodString>;
|
|
267
269
|
readonly layout: z.ZodEnum<{
|
|
268
|
-
board: "board";
|
|
269
270
|
list: "list";
|
|
271
|
+
board: "board";
|
|
270
272
|
columns: "columns";
|
|
271
273
|
}>;
|
|
272
274
|
readonly columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/dist/http.js
CHANGED
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* Validation happens here once; the host never repeats it.
|
|
5
5
|
*/
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { STATUSES } from "./core/index.js";
|
|
7
|
+
import { STATUSES, summaryOf } from "./core/index.js";
|
|
8
8
|
import { AerieError } from "./db.js";
|
|
9
9
|
import { TASK_WRITES } from "./routes.js";
|
|
10
10
|
import { AREA_ROLES, LAYOUTS } from "./schema.js";
|
|
11
11
|
import { rank } from "./search.js";
|
|
12
12
|
export * from "./routes.js";
|
|
13
|
-
export const rowOf = ({ description
|
|
13
|
+
export const rowOf = ({ description, plan: _p, notes: _n, finalSummary: _f, extra: _e, stray: _s, comments, ...t }) => {
|
|
14
|
+
const summary = summaryOf(description);
|
|
15
|
+
return { ...t, comments: comments.length, ...(summary ? { summary } : {}) };
|
|
16
|
+
};
|
|
14
17
|
const ID = z.string().trim().min(1).max(64);
|
|
15
18
|
const TEXT = z.string().max(20_000);
|
|
16
19
|
const LIST = z.array(z.string().max(200)).max(200);
|
package/dist/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAmB,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,cAAc,aAAa,CAAC;AAY5B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,WAAW,EACX,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,EAAE,EACT,YAAY,EAAE,EAAE,EAChB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,EAAE,EACT,QAAQ,EACR,GAAG,CAAC,EACO,EAAW,EAAE;IACxB,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AA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
|
|
8789
|
-
// src/core/edit.ts
|
|
8790
|
-
function checks(cs, e, what) {
|
|
8791
|
-
if (!e) return cs;
|
|
8792
|
-
let out = cs.map((c) => ({ ...c }));
|
|
8793
|
-
const at3 = (n) => {
|
|
8794
|
-
const c = out[n - 1];
|
|
8795
|
-
if (!c) throw new Error(`${what} #${n} does not exist (has ${out.length})`);
|
|
8796
|
-
return c;
|
|
8797
|
-
};
|
|
8798
|
-
if (e.clear) out = [];
|
|
8799
|
-
if (e.replace) {
|
|
8800
|
-
const was = new Map(out.map((c) => [c.text.trim(), c.done]));
|
|
8801
|
-
out = e.replace.map((text2) => ({ text: text2.trim(), done: was.get(text2.trim()) ?? false }));
|
|
8802
|
-
}
|
|
8803
|
-
for (const n of e.check ?? []) at3(n).done = true;
|
|
8804
|
-
for (const n of e.uncheck ?? []) at3(n).done = false;
|
|
8805
|
-
if (e.remove?.length) {
|
|
8806
|
-
for (const n of e.remove) at3(n);
|
|
8807
|
-
const drop = new Set(e.remove);
|
|
8808
|
-
out = out.filter((_, i) => !drop.has(i + 1));
|
|
8809
|
-
}
|
|
8810
|
-
for (const text2 of e.add ?? []) out.push({ text: text2.trim(), done: false });
|
|
8811
|
-
return out;
|
|
8812
|
-
}
|
|
8813
|
-
function applyEdit(t, e, now) {
|
|
8814
|
-
const n = { ...t, extra: { ...t.extra } };
|
|
8815
|
-
const set = (k, v) => {
|
|
8816
|
-
if (v === void 0) return;
|
|
8817
|
-
if (v === null || v === "") delete n[k];
|
|
8818
|
-
else n[k] = v;
|
|
8819
|
-
};
|
|
8820
|
-
if (e.title !== void 0) {
|
|
8821
|
-
if (!e.title.trim()) throw new Error("title is empty");
|
|
8822
|
-
n.title = e.title.trim();
|
|
8823
|
-
}
|
|
8824
|
-
set("description", e.description);
|
|
8825
|
-
if (e.status !== void 0) {
|
|
8826
|
-
if (e.status !== t.status && e.status === "Done") n.closedAt = now;
|
|
8827
|
-
if (e.status !== "Done") delete n.closedAt;
|
|
8828
|
-
n.status = e.status;
|
|
8829
|
-
}
|
|
8830
|
-
set("priority", e.priority);
|
|
8831
|
-
set("type", e.type);
|
|
8832
|
-
set("milestone", e.milestone);
|
|
8833
|
-
set("ordinal", e.ordinal);
|
|
8834
|
-
set("parentId", e.parentId);
|
|
8835
|
-
if (e.assignees) n.assignees = uniq(e.assignees.map((a) => a.trim()).filter(Boolean));
|
|
8836
|
-
if (e.labels) n.labels = uniq(e.labels);
|
|
8837
|
-
if (e.removeLabels) n.labels = n.labels.filter((l) => !e.removeLabels?.includes(l));
|
|
8838
|
-
if (e.addLabels) n.labels = uniq([...n.labels, ...e.addLabels]);
|
|
8839
|
-
if (e.clearDeps) n.dependencies = [];
|
|
8840
|
-
if (e.addDeps) n.dependencies = uniq([...n.dependencies, ...e.addDeps]);
|
|
8841
|
-
if (e.references) n.references = uniq(e.references);
|
|
8842
|
-
n.ac = checks(n.ac, e.ac, "AC");
|
|
8843
|
-
n.dod = checks(n.dod, e.dod, "DoD");
|
|
8844
|
-
set("plan", e.plan);
|
|
8845
|
-
set("plan", append(n.plan, e.appendPlan));
|
|
8846
|
-
set("notes", e.notes);
|
|
8847
|
-
set("notes", append(n.notes, e.appendNotes));
|
|
8848
|
-
if (e.clearFinalSummary) delete n.finalSummary;
|
|
8849
|
-
set("finalSummary", e.finalSummary);
|
|
8850
|
-
set("finalSummary", append(n.finalSummary, e.appendFinalSummary));
|
|
8851
|
-
if (e.comments?.length)
|
|
8852
|
-
n.comments = [...n.comments, ...e.comments.map((c) => ({ ...c, created: now }))];
|
|
8853
|
-
n.updatedAt = now;
|
|
8854
|
-
return n;
|
|
8855
|
-
}
|
|
8856
|
-
var PARA, append, uniq;
|
|
8857
|
-
var init_edit = __esm({
|
|
8858
|
-
"src/core/edit.ts"() {
|
|
8859
|
-
"use strict";
|
|
8860
|
-
PARA = "\n\n";
|
|
8861
|
-
append = (base, more) => more?.length ? [base, ...more].filter((x) => x?.trim()).join(PARA) : base;
|
|
8862
|
-
uniq = (xs) => [...new Set(xs)];
|
|
8863
|
-
}
|
|
8864
|
-
});
|
|
8865
|
-
|
|
8866
8789
|
// src/core/filter.ts
|
|
8867
8790
|
function matches(t, f, ctx = {}) {
|
|
8868
8791
|
const any = (want, v) => !want?.length || v !== void 0 && want.includes(v);
|
|
@@ -8968,7 +8891,7 @@ var init_task = __esm({
|
|
|
8968
8891
|
});
|
|
8969
8892
|
|
|
8970
8893
|
// src/core/fields.ts
|
|
8971
|
-
var one,
|
|
8894
|
+
var one, checks, FIELDS, GROUP_KEYS;
|
|
8972
8895
|
var init_fields = __esm({
|
|
8973
8896
|
"src/core/fields.ts"() {
|
|
8974
8897
|
"use strict";
|
|
@@ -8976,7 +8899,7 @@ var init_fields = __esm({
|
|
|
8976
8899
|
init_filter();
|
|
8977
8900
|
init_task();
|
|
8978
8901
|
one = (v) => v ? [v] : [];
|
|
8979
|
-
|
|
8902
|
+
checks = (t) => {
|
|
8980
8903
|
const all = [...t.ac, ...t.dod];
|
|
8981
8904
|
return all.length ? [`${all.filter((c) => c.done).length}/${all.length}`] : [];
|
|
8982
8905
|
};
|
|
@@ -9020,7 +8943,7 @@ var init_fields = __esm({
|
|
|
9020
8943
|
},
|
|
9021
8944
|
{ key: "parent", label: "Parent", kind: "id", values: (t) => one(t.parentId), group: true },
|
|
9022
8945
|
{ key: "type", label: "Type", kind: "text", values: (t) => one(t.type), group: true },
|
|
9023
|
-
{ key: "checks", label: "Checks", kind: "progress", values:
|
|
8946
|
+
{ key: "checks", label: "Checks", kind: "progress", values: checks },
|
|
9024
8947
|
{
|
|
9025
8948
|
key: "createdAt",
|
|
9026
8949
|
label: "Created",
|
|
@@ -9047,14 +8970,109 @@ var init_fields = __esm({
|
|
|
9047
8970
|
}
|
|
9048
8971
|
});
|
|
9049
8972
|
|
|
8973
|
+
// src/core/address.ts
|
|
8974
|
+
var init_address = __esm({
|
|
8975
|
+
"src/core/address.ts"() {
|
|
8976
|
+
"use strict";
|
|
8977
|
+
init_fields();
|
|
8978
|
+
init_filter();
|
|
8979
|
+
}
|
|
8980
|
+
});
|
|
8981
|
+
|
|
8982
|
+
// src/core/edit.ts
|
|
8983
|
+
function checks2(cs, e, what) {
|
|
8984
|
+
if (!e) return cs;
|
|
8985
|
+
let out = cs.map((c) => ({ ...c }));
|
|
8986
|
+
const at3 = (n) => {
|
|
8987
|
+
const c = out[n - 1];
|
|
8988
|
+
if (!c) throw new Error(`${what} #${n} does not exist (has ${out.length})`);
|
|
8989
|
+
return c;
|
|
8990
|
+
};
|
|
8991
|
+
if (e.clear) out = [];
|
|
8992
|
+
if (e.replace) {
|
|
8993
|
+
const was = new Map(out.map((c) => [c.text.trim(), c.done]));
|
|
8994
|
+
out = e.replace.map((text2) => ({ text: text2.trim(), done: was.get(text2.trim()) ?? false }));
|
|
8995
|
+
}
|
|
8996
|
+
for (const n of e.check ?? []) at3(n).done = true;
|
|
8997
|
+
for (const n of e.uncheck ?? []) at3(n).done = false;
|
|
8998
|
+
if (e.remove?.length) {
|
|
8999
|
+
for (const n of e.remove) at3(n);
|
|
9000
|
+
const drop = new Set(e.remove);
|
|
9001
|
+
out = out.filter((_, i) => !drop.has(i + 1));
|
|
9002
|
+
}
|
|
9003
|
+
for (const text2 of e.add ?? []) out.push({ text: text2.trim(), done: false });
|
|
9004
|
+
return out;
|
|
9005
|
+
}
|
|
9006
|
+
function applyEdit(t, e, now) {
|
|
9007
|
+
const n = { ...t, extra: { ...t.extra } };
|
|
9008
|
+
const set = (k, v) => {
|
|
9009
|
+
if (v === void 0) return;
|
|
9010
|
+
if (v === null || v === "") delete n[k];
|
|
9011
|
+
else n[k] = v;
|
|
9012
|
+
};
|
|
9013
|
+
if (e.title !== void 0) {
|
|
9014
|
+
if (!e.title.trim()) throw new Error("title is empty");
|
|
9015
|
+
n.title = e.title.trim();
|
|
9016
|
+
}
|
|
9017
|
+
set("description", e.description);
|
|
9018
|
+
if (e.status !== void 0) {
|
|
9019
|
+
if (e.status !== t.status && e.status === "Done") n.closedAt = now;
|
|
9020
|
+
if (e.status !== "Done") delete n.closedAt;
|
|
9021
|
+
n.status = e.status;
|
|
9022
|
+
}
|
|
9023
|
+
set("priority", e.priority);
|
|
9024
|
+
set("type", e.type);
|
|
9025
|
+
set("milestone", e.milestone);
|
|
9026
|
+
set("ordinal", e.ordinal);
|
|
9027
|
+
set("parentId", e.parentId);
|
|
9028
|
+
if (e.assignees) n.assignees = uniq(e.assignees.map((a) => a.trim()).filter(Boolean));
|
|
9029
|
+
if (e.labels) n.labels = uniq(e.labels);
|
|
9030
|
+
if (e.removeLabels) n.labels = n.labels.filter((l) => !e.removeLabels?.includes(l));
|
|
9031
|
+
if (e.addLabels) n.labels = uniq([...n.labels, ...e.addLabels]);
|
|
9032
|
+
if (e.clearDeps) n.dependencies = [];
|
|
9033
|
+
if (e.addDeps) n.dependencies = uniq([...n.dependencies, ...e.addDeps]);
|
|
9034
|
+
if (e.references) n.references = uniq(e.references);
|
|
9035
|
+
n.ac = checks2(n.ac, e.ac, "AC");
|
|
9036
|
+
n.dod = checks2(n.dod, e.dod, "DoD");
|
|
9037
|
+
set("plan", e.plan);
|
|
9038
|
+
set("plan", append(n.plan, e.appendPlan));
|
|
9039
|
+
set("notes", e.notes);
|
|
9040
|
+
set("notes", append(n.notes, e.appendNotes));
|
|
9041
|
+
if (e.clearFinalSummary) delete n.finalSummary;
|
|
9042
|
+
set("finalSummary", e.finalSummary);
|
|
9043
|
+
set("finalSummary", append(n.finalSummary, e.appendFinalSummary));
|
|
9044
|
+
if (e.comments?.length)
|
|
9045
|
+
n.comments = [...n.comments, ...e.comments.map((c) => ({ ...c, created: now }))];
|
|
9046
|
+
n.updatedAt = now;
|
|
9047
|
+
return n;
|
|
9048
|
+
}
|
|
9049
|
+
var PARA, append, uniq;
|
|
9050
|
+
var init_edit = __esm({
|
|
9051
|
+
"src/core/edit.ts"() {
|
|
9052
|
+
"use strict";
|
|
9053
|
+
PARA = "\n\n";
|
|
9054
|
+
append = (base, more) => more?.length ? [base, ...more].filter((x) => x?.trim()).join(PARA) : base;
|
|
9055
|
+
uniq = (xs) => [...new Set(xs)];
|
|
9056
|
+
}
|
|
9057
|
+
});
|
|
9058
|
+
|
|
9059
|
+
// src/core/rows.ts
|
|
9060
|
+
var init_rows = __esm({
|
|
9061
|
+
"src/core/rows.ts"() {
|
|
9062
|
+
"use strict";
|
|
9063
|
+
}
|
|
9064
|
+
});
|
|
9065
|
+
|
|
9050
9066
|
// src/core/index.ts
|
|
9051
9067
|
var init_core2 = __esm({
|
|
9052
9068
|
"src/core/index.ts"() {
|
|
9053
9069
|
"use strict";
|
|
9070
|
+
init_address();
|
|
9054
9071
|
init_area();
|
|
9055
9072
|
init_edit();
|
|
9056
9073
|
init_fields();
|
|
9057
9074
|
init_filter();
|
|
9075
|
+
init_rows();
|
|
9058
9076
|
init_task();
|
|
9059
9077
|
}
|
|
9060
9078
|
});
|