@nurama/types 1.4.4 → 1.4.5
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/feed-event.d.ts +31 -1
- package/package.json +1 -1
- package/src/feed-event.ts +31 -0
package/dist/feed-event.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { CursorPaginatedResult } from './pagination';
|
|
|
8
8
|
* Every card is self-contained: `data` carries everything it renders, so a
|
|
9
9
|
* page of the feed needs no further lookups.
|
|
10
10
|
*/
|
|
11
|
-
export type FeedEventKind = 'upload' | 'assetChat' | 'projectChat' | 'publish' | 'submission' | 'public' | 'member' | 'task';
|
|
11
|
+
export type FeedEventKind = 'upload' | 'assetChat' | 'projectChat' | 'taskChat' | 'publish' | 'submission' | 'public' | 'member' | 'task';
|
|
12
12
|
export type FeedVisibility = 'creator' | 'reviewer';
|
|
13
13
|
/** The slice of an asset a card draws: name, type and thumbnail files. */
|
|
14
14
|
export interface FeedEventAssetPreview {
|
|
@@ -67,6 +67,31 @@ export interface FeedEventProjectChatData {
|
|
|
67
67
|
recentMessages: FeedEventChatMessage[];
|
|
68
68
|
messageCount: number;
|
|
69
69
|
}
|
|
70
|
+
/** The task a task-chat card is about, as the card draws it. */
|
|
71
|
+
export interface FeedEventTaskPreview {
|
|
72
|
+
id: ObjectId;
|
|
73
|
+
/** The project's task number (#12), when the task has one. */
|
|
74
|
+
number: number | null;
|
|
75
|
+
subject: string;
|
|
76
|
+
status: string;
|
|
77
|
+
/** The board it's on — opening the card deep-links there (`?task=<id>`). */
|
|
78
|
+
boardId: ObjectId | null;
|
|
79
|
+
/** The board's name — current as of the page load, not when the card was written. */
|
|
80
|
+
boardName: string | null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* `data` for task-chat cards: a discussion in a board task's own chat. The
|
|
84
|
+
* same shape as an asset chat's, about a task rather than an asset.
|
|
85
|
+
*/
|
|
86
|
+
export interface FeedEventTaskChatData {
|
|
87
|
+
task: FeedEventTaskPreview;
|
|
88
|
+
chatId: ObjectId;
|
|
89
|
+
participants: PublicUser[];
|
|
90
|
+
participantCount: number;
|
|
91
|
+
/** Oldest → newest, at most five. */
|
|
92
|
+
recentMessages: FeedEventChatMessage[];
|
|
93
|
+
messageCount: number;
|
|
94
|
+
}
|
|
70
95
|
export interface FeedEventSubmissionData extends FeedEventGroupData {
|
|
71
96
|
submissionId: ObjectId;
|
|
72
97
|
subject: string | null;
|
|
@@ -127,6 +152,8 @@ interface FeedEventBase {
|
|
|
127
152
|
subjectKey: ObjectId | null;
|
|
128
153
|
actorId: ObjectId | null;
|
|
129
154
|
assetIds: ObjectId[];
|
|
155
|
+
/** Every task the card covers: a task card's rows, a task-chat card's task. */
|
|
156
|
+
taskIds: ObjectId[];
|
|
130
157
|
mediaTypes: string[];
|
|
131
158
|
searchText: string;
|
|
132
159
|
reactions: FeedEventReaction[];
|
|
@@ -151,6 +178,9 @@ export type FeedEvent = (FeedEventBase & {
|
|
|
151
178
|
}) | (FeedEventBase & {
|
|
152
179
|
kind: 'projectChat';
|
|
153
180
|
data: FeedEventProjectChatData;
|
|
181
|
+
}) | (FeedEventBase & {
|
|
182
|
+
kind: 'taskChat';
|
|
183
|
+
data: FeedEventTaskChatData;
|
|
154
184
|
}) | (FeedEventBase & {
|
|
155
185
|
kind: 'submission';
|
|
156
186
|
data: FeedEventSubmissionData;
|
package/package.json
CHANGED
package/src/feed-event.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type FeedEventKind =
|
|
|
13
13
|
| 'upload'
|
|
14
14
|
| 'assetChat'
|
|
15
15
|
| 'projectChat'
|
|
16
|
+
| 'taskChat'
|
|
16
17
|
| 'publish'
|
|
17
18
|
| 'submission'
|
|
18
19
|
| 'public'
|
|
@@ -84,6 +85,33 @@ export interface FeedEventProjectChatData {
|
|
|
84
85
|
messageCount: number;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
/** The task a task-chat card is about, as the card draws it. */
|
|
89
|
+
export interface FeedEventTaskPreview {
|
|
90
|
+
id: ObjectId;
|
|
91
|
+
/** The project's task number (#12), when the task has one. */
|
|
92
|
+
number: number | null;
|
|
93
|
+
subject: string;
|
|
94
|
+
status: string;
|
|
95
|
+
/** The board it's on — opening the card deep-links there (`?task=<id>`). */
|
|
96
|
+
boardId: ObjectId | null;
|
|
97
|
+
/** The board's name — current as of the page load, not when the card was written. */
|
|
98
|
+
boardName: string | null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* `data` for task-chat cards: a discussion in a board task's own chat. The
|
|
103
|
+
* same shape as an asset chat's, about a task rather than an asset.
|
|
104
|
+
*/
|
|
105
|
+
export interface FeedEventTaskChatData {
|
|
106
|
+
task: FeedEventTaskPreview;
|
|
107
|
+
chatId: ObjectId;
|
|
108
|
+
participants: PublicUser[];
|
|
109
|
+
participantCount: number;
|
|
110
|
+
/** Oldest → newest, at most five. */
|
|
111
|
+
recentMessages: FeedEventChatMessage[];
|
|
112
|
+
messageCount: number;
|
|
113
|
+
}
|
|
114
|
+
|
|
87
115
|
export interface FeedEventSubmissionData extends FeedEventGroupData {
|
|
88
116
|
submissionId: ObjectId;
|
|
89
117
|
subject: string | null;
|
|
@@ -142,6 +170,8 @@ interface FeedEventBase {
|
|
|
142
170
|
subjectKey: ObjectId | null;
|
|
143
171
|
actorId: ObjectId | null;
|
|
144
172
|
assetIds: ObjectId[];
|
|
173
|
+
/** Every task the card covers: a task card's rows, a task-chat card's task. */
|
|
174
|
+
taskIds: ObjectId[];
|
|
145
175
|
mediaTypes: string[];
|
|
146
176
|
searchText: string;
|
|
147
177
|
reactions: FeedEventReaction[];
|
|
@@ -162,6 +192,7 @@ export type FeedEvent =
|
|
|
162
192
|
| (FeedEventBase & { kind: 'upload' | 'publish'; data: FeedEventGroupData })
|
|
163
193
|
| (FeedEventBase & { kind: 'assetChat'; data: FeedEventAssetChatData })
|
|
164
194
|
| (FeedEventBase & { kind: 'projectChat'; data: FeedEventProjectChatData })
|
|
195
|
+
| (FeedEventBase & { kind: 'taskChat'; data: FeedEventTaskChatData })
|
|
165
196
|
| (FeedEventBase & { kind: 'submission'; data: FeedEventSubmissionData })
|
|
166
197
|
| (FeedEventBase & { kind: 'public'; data: FeedEventPublicData })
|
|
167
198
|
| (FeedEventBase & { kind: 'member'; data: FeedEventMemberData })
|