@crossworks/client-types 0.230.63 → 0.230.68
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/package.json +1 -1
- package/src/index.ts +40 -1
- package/src/lib/format-datetime.ts +16 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -685,11 +685,50 @@ export type TaskRow = {
|
|
|
685
685
|
priority: TaskPriority;
|
|
686
686
|
dueAt: string | null;
|
|
687
687
|
tags: string[];
|
|
688
|
+
/** Checklist inside the task ("task breakup"). Stored in `data.todos`. */
|
|
689
|
+
todos: TaskTodo[];
|
|
690
|
+
/** Fractional ordering key for the board (within-column order). Stored in
|
|
691
|
+
* `data.rank`; null on tasks never dragged — they sort after ranked ones. */
|
|
692
|
+
rank: string | null;
|
|
693
|
+
/** Comments on this task (node_comments rows). List/detail badge material. */
|
|
694
|
+
commentCount: number;
|
|
688
695
|
summary: string | null;
|
|
696
|
+
/** When the task was filed away, or null while it is live. Archived tasks are
|
|
697
|
+
* excluded from every list, count and board unless explicitly requested —
|
|
698
|
+
* it is what keeps a Done column from growing without bound. Orthogonal to
|
|
699
|
+
* `status`: an archived task keeps the status it had. */
|
|
700
|
+
archivedAt: string | null;
|
|
689
701
|
createdAt: string;
|
|
690
702
|
updatedAt: string;
|
|
691
703
|
};
|
|
692
704
|
|
|
705
|
+
/** One checklist item inside a task. Server assigns `id` on write. */
|
|
706
|
+
export type TaskTodo = {
|
|
707
|
+
id: string;
|
|
708
|
+
text: string;
|
|
709
|
+
done: boolean;
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
/** Mirrors @mantle/db `NodeCommentAuthorKind`. */
|
|
713
|
+
export type NodeCommentAuthorKind = 'owner' | 'member' | 'agent';
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* A comment on a node (tasks first; the table is node-generic). `authorName`
|
|
717
|
+
* is a display snapshot at post time; `mine` is computed server-side per
|
|
718
|
+
* viewer (an owner login sees its own comments as mine, a team member sees
|
|
719
|
+
* theirs), so clients never reconcile the two auth worlds themselves.
|
|
720
|
+
*/
|
|
721
|
+
export type NodeComment = {
|
|
722
|
+
id: string;
|
|
723
|
+
nodeId: string;
|
|
724
|
+
authorKind: NodeCommentAuthorKind;
|
|
725
|
+
authorName: string;
|
|
726
|
+
mine: boolean;
|
|
727
|
+
body: string;
|
|
728
|
+
createdAt: string;
|
|
729
|
+
editedAt: string | null;
|
|
730
|
+
};
|
|
731
|
+
|
|
693
732
|
export type JournalRow = {
|
|
694
733
|
id: string;
|
|
695
734
|
title: string;
|
|
@@ -1326,7 +1365,7 @@ export type TeamVisibleShare = {
|
|
|
1326
1365
|
|
|
1327
1366
|
/** Task lifecycle vocabulary — mirrors content's TASK_STATUSES/TASK_PRIORITIES
|
|
1328
1367
|
* consts, which are `satisfies`-checked against these unions. */
|
|
1329
|
-
export type TaskStatus = 'open' | 'done';
|
|
1368
|
+
export type TaskStatus = 'open' | 'in_progress' | 'blocked' | 'done';
|
|
1330
1369
|
export type TaskPriority = 'low' | 'normal' | 'high';
|
|
1331
1370
|
|
|
1332
1371
|
/** Mirrors @mantle/db `ForumTopicKind`. */
|
|
@@ -76,6 +76,22 @@ export function formatTime(input: Input, missing = 'never'): string {
|
|
|
76
76
|
return new Intl.DateTimeFormat(LOCALE, TIME_OPTS).format(d);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
const DAY_TIME_OPTS: Intl.DateTimeFormatOptions = {
|
|
80
|
+
day: 'numeric',
|
|
81
|
+
month: 'short',
|
|
82
|
+
hour: '2-digit',
|
|
83
|
+
minute: '2-digit',
|
|
84
|
+
hour12: false,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** '17 Aug, 10:06' — compact stamp for feed/thread rows (comments, posts)
|
|
88
|
+
* where the full numeric formatDateTime is too heavy. */
|
|
89
|
+
export function formatDayTime(input: Input, missing = 'never'): string {
|
|
90
|
+
const d = toDate(input);
|
|
91
|
+
if (!d) return missing;
|
|
92
|
+
return new Intl.DateTimeFormat(LOCALE, DAY_TIME_OPTS).format(d);
|
|
93
|
+
}
|
|
94
|
+
|
|
79
95
|
/**
|
|
80
96
|
* `YYYY-MM-DD` in the viewer's LOCAL timezone (defaults to now). Use this to
|
|
81
97
|
* compare against day-bucketed date strings — `new Date().toISOString().slice(0,10)`
|