@@ -82,7 +82,7 @@ type RawContext = ContextDb & { id: ContextID } & {
82
82
notifications ?: RawNotification [ ]
83
83
}
84
84
85
- export function toMessage ( raw : RawMessage ) : Message {
85
+ export function toMessage ( raw : RawMessage ) : Message {
86
86
const lastPatch = raw . patches ?. [ 0 ]
87
87
88
88
return {
@@ -110,7 +110,7 @@ export function toMessage (raw: RawMessage): Message {
110
110
}
111
111
}
112
112
113
- export function toReaction ( raw : ReactionDb ) : Reaction {
113
+ export function toReaction ( raw : ReactionDb ) : Reaction {
114
114
return {
115
115
message : String ( raw . message_id ) as MessageID ,
116
116
reaction : raw . reaction ,
@@ -119,7 +119,7 @@ export function toReaction (raw: ReactionDb): Reaction {
119
119
}
120
120
}
121
121
122
- export function toFile ( raw : FileDb ) : File {
122
+ export function toFile ( raw : FileDb ) : File {
123
123
return {
124
124
card : raw . card_id ,
125
125
message : String ( raw . message_id ) as MessageID ,
@@ -132,7 +132,7 @@ export function toFile (raw: FileDb): File {
132
132
}
133
133
}
134
134
135
- export function toMessagesGroup ( raw : MessagesGroupDb ) : MessagesGroup {
135
+ export function toMessagesGroup ( raw : MessagesGroupDb ) : MessagesGroup {
136
136
return {
137
137
card : raw . card_id ,
138
138
blobId : raw . blob_id ,
@@ -143,7 +143,7 @@ export function toMessagesGroup (raw: MessagesGroupDb): MessagesGroup {
143
143
}
144
144
}
145
145
146
- export function toPatch ( raw : PatchDb ) : Patch {
146
+ export function toPatch ( raw : PatchDb ) : Patch {
147
147
return {
148
148
type : raw . type ,
149
149
message : String ( raw . message_id ) as MessageID ,
@@ -153,7 +153,7 @@ export function toPatch (raw: PatchDb): Patch {
153
153
}
154
154
}
155
155
156
- export function toThread ( raw : ThreadDb ) : Thread {
156
+ export function toThread ( raw : ThreadDb ) : Thread {
157
157
return {
158
158
card : raw . card_id ,
159
159
message : String ( raw . message_id ) as MessageID ,
@@ -163,7 +163,7 @@ export function toThread (raw: ThreadDb): Thread {
163
163
}
164
164
}
165
165
166
- export function toNotificationContext ( raw : RawContext ) : NotificationContext {
166
+ export function toNotificationContext ( raw : RawContext ) : NotificationContext {
167
167
const lastView = new Date ( raw . last_view )
168
168
return {
169
169
id : String ( raw . id ) as ContextID ,
@@ -177,7 +177,7 @@ export function toNotificationContext (raw: RawContext): NotificationContext {
177
177
}
178
178
}
179
179
180
- function toNotificationRaw (
180
+ function toNotificationRaw (
181
181
id : ContextID ,
182
182
card : CardID ,
183
183
lastView : Date | undefined ,
@@ -243,26 +243,26 @@ function toNotificationRaw (
243
243
}
244
244
}
245
245
246
- export function toNotification ( raw : RawNotification & { card_id : CardID , last_view ?: Date } ) : Notification {
246
+ export function toNotification ( raw : RawNotification & { card_id : CardID ; last_view ?: Date } ) : Notification {
247
247
const lastView = raw . last_view != null ? new Date ( raw . last_view ) : undefined
248
248
249
249
return toNotificationRaw ( raw . context_id , raw . card_id , lastView , raw )
250
250
}
251
251
252
- export function toCollaborator ( raw : CollaboratorDb ) : Collaborator {
252
+ export function toCollaborator ( raw : CollaboratorDb ) : Collaborator {
253
253
return {
254
254
account : raw . account ,
255
255
cardType : raw . card_type ,
256
256
card : raw . card_id
257
257
}
258
258
}
259
259
260
- export function toLabel ( raw : LabelDb ) : Label {
260
+ export function toLabel ( raw : LabelDb ) : Label {
261
261
return {
262
262
label : raw . label_id ,
263
263
card : raw . card_id ,
264
264
cardType : raw . card_type ,
265
265
account : raw . account ,
266
266
created : new Date ( raw . created )
267
267
}
268
- }
268
+ }
0 commit comments