@lemoncloud/growing-socials-api 0.24.1224 → 0.25.105
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.
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `model.ts`
|
|
3
|
+
* - model definitions per account data
|
|
4
|
+
*
|
|
5
|
+
* @author Steve <steve@lemoncloud.io>
|
|
6
|
+
* @date 2022-08-29 initial version.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (C) 2020 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
|
+
*/
|
|
10
|
+
import { CoreModel } from 'lemon-model';
|
|
11
|
+
import $LUT, { ActivityStereo, CommentStereo, FeedStereo, TagStereo, TopicStereo, UserStereo } from './types';
|
|
12
|
+
import { ShareLinkInfo } from './views';
|
|
13
|
+
/**
|
|
14
|
+
* type: `ModelType`
|
|
15
|
+
*/
|
|
16
|
+
export declare type ModelType = keyof typeof $LUT.ModelType;
|
|
17
|
+
/**
|
|
18
|
+
* type: `Model`: common model
|
|
19
|
+
*/
|
|
20
|
+
export declare type Model = CoreModel<ModelType>;
|
|
21
|
+
/**
|
|
22
|
+
* mapping of `.extra`
|
|
23
|
+
* - ONLY having string value. (indexing 유지위해서)
|
|
24
|
+
*/
|
|
25
|
+
export interface ModelExtra {
|
|
26
|
+
[key: string]: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* count of each `stereo` in child nodes
|
|
30
|
+
* - 자식글을 작성할경우, 부모에서 count를 저장함.
|
|
31
|
+
* - 검색을 최소화 하기 위해서, 정보를 저장함.
|
|
32
|
+
* - `delete`나 `hidden`시 카운트가 감소함.
|
|
33
|
+
*/
|
|
34
|
+
export interface StereoCount {
|
|
35
|
+
[key: string]: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* common `.text` content body.
|
|
39
|
+
*/
|
|
40
|
+
export interface TextContent {
|
|
41
|
+
/**
|
|
42
|
+
* encoded html style with tag
|
|
43
|
+
* example:
|
|
44
|
+
* hello <t>world</t>
|
|
45
|
+
*/
|
|
46
|
+
text?: string;
|
|
47
|
+
/**
|
|
48
|
+
* extracted tag text
|
|
49
|
+
* ex) `#some`
|
|
50
|
+
*/
|
|
51
|
+
tags?: string[];
|
|
52
|
+
/** matched id of tag-model (not in order) */
|
|
53
|
+
tagIds?: string[];
|
|
54
|
+
/** (optional) partial tag-info by tagIds */
|
|
55
|
+
tag$$?: TagHead[];
|
|
56
|
+
/**
|
|
57
|
+
* extracted social-id text
|
|
58
|
+
* ex) `@who`
|
|
59
|
+
*/
|
|
60
|
+
sids?: string[];
|
|
61
|
+
/** matched list of user-head by social-id */
|
|
62
|
+
sid$$?: UserHead[];
|
|
63
|
+
/** matched social-id (normalized, not in order, no duplicated) */
|
|
64
|
+
socialIds?: string[];
|
|
65
|
+
/** matched id of user-model by social-id (in order) */
|
|
66
|
+
userIds?: string[];
|
|
67
|
+
/** (optional) client-ip when created */
|
|
68
|
+
clientIp?: string;
|
|
69
|
+
/** (optional) user-agent when created */
|
|
70
|
+
userAgent?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* type: `UserHead`
|
|
74
|
+
* - common head of user-model.
|
|
75
|
+
*/
|
|
76
|
+
export interface UserHead {
|
|
77
|
+
/** id of user */
|
|
78
|
+
id?: string;
|
|
79
|
+
/** nick of user */
|
|
80
|
+
nick?: string;
|
|
81
|
+
/** name of user */
|
|
82
|
+
name?: string;
|
|
83
|
+
/** profile image of user */
|
|
84
|
+
image?: string;
|
|
85
|
+
/** profile link of user */
|
|
86
|
+
link?: string;
|
|
87
|
+
/**
|
|
88
|
+
* social-id (unique) by alias.
|
|
89
|
+
*/
|
|
90
|
+
socialId?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* social information
|
|
94
|
+
*/
|
|
95
|
+
export interface SnsInfo {
|
|
96
|
+
/** facebook.com */
|
|
97
|
+
facebook?: string;
|
|
98
|
+
/** instagram.com */
|
|
99
|
+
instagram?: string;
|
|
100
|
+
/** tiktok.com */
|
|
101
|
+
tiktok?: string;
|
|
102
|
+
/** xiaohongshu.com */
|
|
103
|
+
xiaohongshu?: string;
|
|
104
|
+
/** lemon8-app.com */
|
|
105
|
+
lemon8?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* super class to support activity
|
|
109
|
+
*/
|
|
110
|
+
export interface ActivitySupport {
|
|
111
|
+
/** target model-id */
|
|
112
|
+
id?: string;
|
|
113
|
+
/**
|
|
114
|
+
* total count of `like`
|
|
115
|
+
* - increased when other user has liked this target.
|
|
116
|
+
*/
|
|
117
|
+
likeCount?: number;
|
|
118
|
+
/**
|
|
119
|
+
* total count of `dislike`
|
|
120
|
+
* - increased when other user has disliked this target.
|
|
121
|
+
*/
|
|
122
|
+
dislikeCount?: number;
|
|
123
|
+
/**
|
|
124
|
+
* total count of `mark`
|
|
125
|
+
*/
|
|
126
|
+
markCount?: number;
|
|
127
|
+
/**
|
|
128
|
+
* total count of `view`
|
|
129
|
+
*/
|
|
130
|
+
viewCount?: number;
|
|
131
|
+
/**
|
|
132
|
+
* total count of `click`
|
|
133
|
+
*/
|
|
134
|
+
clickCount?: number;
|
|
135
|
+
/**
|
|
136
|
+
* total count of `block`
|
|
137
|
+
*/
|
|
138
|
+
blockCount?: number;
|
|
139
|
+
/**
|
|
140
|
+
* total count of `report`
|
|
141
|
+
*/
|
|
142
|
+
reportCount?: number;
|
|
143
|
+
/** (optional) referenced activity */
|
|
144
|
+
readonly $activity?: ActivityModel;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* type: `UserModel`
|
|
148
|
+
* - `backend-api`의 user-id와 매칭됨.
|
|
149
|
+
*/
|
|
150
|
+
export interface UserModel<E = ModelExtra> extends UserHead, Model, ActivitySupport {
|
|
151
|
+
/** := backend-api/users/<id> */
|
|
152
|
+
id?: string;
|
|
153
|
+
/** stereo type */
|
|
154
|
+
stereo?: UserStereo;
|
|
155
|
+
/** target alias value */
|
|
156
|
+
alias?: string;
|
|
157
|
+
/**
|
|
158
|
+
* nick-name
|
|
159
|
+
*/
|
|
160
|
+
nick?: string;
|
|
161
|
+
/**
|
|
162
|
+
* (optional) name of user
|
|
163
|
+
*/
|
|
164
|
+
name?: string;
|
|
165
|
+
/**
|
|
166
|
+
* (optional) profile link of user.
|
|
167
|
+
*/
|
|
168
|
+
link?: string;
|
|
169
|
+
/**
|
|
170
|
+
* user infor text content.
|
|
171
|
+
*/
|
|
172
|
+
text?: string;
|
|
173
|
+
/**
|
|
174
|
+
* badge condition. (predefined in backend-api)
|
|
175
|
+
*/
|
|
176
|
+
badge?: string;
|
|
177
|
+
/**
|
|
178
|
+
* social id (unique) by alias.
|
|
179
|
+
*/
|
|
180
|
+
socialId?: string;
|
|
181
|
+
/**
|
|
182
|
+
* (alias) the matched identity-id
|
|
183
|
+
*/
|
|
184
|
+
identityId?: string;
|
|
185
|
+
/**
|
|
186
|
+
* latest timestamp of feed.
|
|
187
|
+
*/
|
|
188
|
+
lastFeedAt?: number;
|
|
189
|
+
/**
|
|
190
|
+
* latest id of feed.
|
|
191
|
+
*/
|
|
192
|
+
lastFeedId?: string;
|
|
193
|
+
/**
|
|
194
|
+
* latest no of feed.
|
|
195
|
+
* - increased for every new feed content.
|
|
196
|
+
*/
|
|
197
|
+
lastFeedNo?: number;
|
|
198
|
+
/**
|
|
199
|
+
* (optional) flag to have access to make ad-feed.
|
|
200
|
+
*/
|
|
201
|
+
hasAdFeed?: number;
|
|
202
|
+
/**
|
|
203
|
+
* profile image of user.
|
|
204
|
+
*/
|
|
205
|
+
image?: string;
|
|
206
|
+
/**
|
|
207
|
+
* background image (or color)
|
|
208
|
+
*/
|
|
209
|
+
background?: string;
|
|
210
|
+
/**
|
|
211
|
+
* (optional) extra fields
|
|
212
|
+
* - custom extra object..
|
|
213
|
+
*/
|
|
214
|
+
extra?: E;
|
|
215
|
+
/**
|
|
216
|
+
* (optional) sns infor
|
|
217
|
+
*/
|
|
218
|
+
sns$?: SnsInfo;
|
|
219
|
+
/**
|
|
220
|
+
* (optional) count of followings
|
|
221
|
+
*/
|
|
222
|
+
followings?: number;
|
|
223
|
+
/**
|
|
224
|
+
* (optional) count of followers
|
|
225
|
+
*/
|
|
226
|
+
followers?: number;
|
|
227
|
+
/**
|
|
228
|
+
* (optional) count of ranking
|
|
229
|
+
*/
|
|
230
|
+
ranking?: number;
|
|
231
|
+
/**
|
|
232
|
+
* (optional) the matched activity.
|
|
233
|
+
*/
|
|
234
|
+
readonly $activity?: ActivityModel;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* common head of goods
|
|
238
|
+
*/
|
|
239
|
+
export interface GoodsHead {
|
|
240
|
+
/**
|
|
241
|
+
* goods-id
|
|
242
|
+
*/
|
|
243
|
+
id?: string;
|
|
244
|
+
/**
|
|
245
|
+
* 제품명
|
|
246
|
+
*/
|
|
247
|
+
name?: string;
|
|
248
|
+
nameEn?: string;
|
|
249
|
+
/**
|
|
250
|
+
* 브랜드명
|
|
251
|
+
*/
|
|
252
|
+
brand?: string;
|
|
253
|
+
brandEn?: string;
|
|
254
|
+
/**
|
|
255
|
+
* 컬러명
|
|
256
|
+
*/
|
|
257
|
+
color?: string;
|
|
258
|
+
colorEn?: string;
|
|
259
|
+
/**
|
|
260
|
+
* 대표 제품 이미지
|
|
261
|
+
*/
|
|
262
|
+
image?: string;
|
|
263
|
+
imageEn?: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* type: `FeedHead`
|
|
267
|
+
* - common head of feed-model.
|
|
268
|
+
*/
|
|
269
|
+
export interface FeedHead {
|
|
270
|
+
/** id of feed */
|
|
271
|
+
id?: string;
|
|
272
|
+
/** name of feed */
|
|
273
|
+
name?: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* type: `FeedModel`
|
|
277
|
+
* - modeling of feed
|
|
278
|
+
*/
|
|
279
|
+
export interface FeedModel extends FeedHead, Model, ActivitySupport, TextContent {
|
|
280
|
+
/** := <auto-seq> */
|
|
281
|
+
id?: string;
|
|
282
|
+
/** stereo type */
|
|
283
|
+
stereo?: FeedStereo;
|
|
284
|
+
/** (internal) target alias value */
|
|
285
|
+
alias?: string;
|
|
286
|
+
/** sequenced number of feeds in same user */
|
|
287
|
+
feedNo?: number;
|
|
288
|
+
/** sequenced number of childs of this feed */
|
|
289
|
+
childNo?: number;
|
|
290
|
+
/** (internal) no of feed/child */
|
|
291
|
+
no?: number;
|
|
292
|
+
/**
|
|
293
|
+
* (internal) 각 자식의 stereo별 카운트
|
|
294
|
+
* NOTE - `POST /feeds/<id>/child stereo` 을 통한 자동 카운트
|
|
295
|
+
* TODO - 생성/표시 +1, 삭제/숨김 -1 (다만, aggr이 정확하지 않을 수 있으니 async 업데이트 필요함!)
|
|
296
|
+
*/
|
|
297
|
+
stereo$?: StereoCount;
|
|
298
|
+
/** (optional) parent feed-id */
|
|
299
|
+
parentId?: string;
|
|
300
|
+
/** (optional) parent feed-info */
|
|
301
|
+
parent$?: FeedHead;
|
|
302
|
+
/** (optional) topic linked */
|
|
303
|
+
topicId?: string;
|
|
304
|
+
/** (optional) partial topic-info */
|
|
305
|
+
topic$?: TopicHead;
|
|
306
|
+
/** user-id of owner */
|
|
307
|
+
userId?: string;
|
|
308
|
+
/** (optional) partial user-info */
|
|
309
|
+
user$?: UserHead;
|
|
310
|
+
/** (optional) the current identity-id when created */
|
|
311
|
+
identityId?: string;
|
|
312
|
+
/** (optional) flag of ad-feed */
|
|
313
|
+
isAd?: number;
|
|
314
|
+
/**
|
|
315
|
+
* (optional) target language to be displayed
|
|
316
|
+
* @deprecated use `lang$` mapping
|
|
317
|
+
*/
|
|
318
|
+
langs?: string[];
|
|
319
|
+
/** posted images */
|
|
320
|
+
imageIds?: string[];
|
|
321
|
+
/** (optional) partial image-info */
|
|
322
|
+
image$$?: ImageHead[];
|
|
323
|
+
/** sequence number of comments */
|
|
324
|
+
commentNo?: number;
|
|
325
|
+
/** count of hidden comments */
|
|
326
|
+
commentHidden?: number;
|
|
327
|
+
/**
|
|
328
|
+
* count of post comments
|
|
329
|
+
* - total comments := commentPosted - commentHidden
|
|
330
|
+
*/
|
|
331
|
+
commentPosted?: number;
|
|
332
|
+
/**
|
|
333
|
+
* (optional) goods linked
|
|
334
|
+
*/
|
|
335
|
+
goods$?: GoodsHead;
|
|
336
|
+
/**
|
|
337
|
+
* hidden condition.
|
|
338
|
+
* - 삭제대신 이용하는것
|
|
339
|
+
* - delete 할 경우 parent/child관계가 끈어지므로, 내부적으로 절대 지우진 않음.
|
|
340
|
+
*/
|
|
341
|
+
hidden?: number;
|
|
342
|
+
/**
|
|
343
|
+
* 숨김처리 시간
|
|
344
|
+
*/
|
|
345
|
+
hiddenAt?: number;
|
|
346
|
+
/**
|
|
347
|
+
* (optional) link information
|
|
348
|
+
*/
|
|
349
|
+
link$?: ShareLinkInfo;
|
|
350
|
+
/**
|
|
351
|
+
* (optional) the single comment embedded.
|
|
352
|
+
*/
|
|
353
|
+
readonly $comment?: CommentModel;
|
|
354
|
+
/**
|
|
355
|
+
* (optional) the single feed in child.
|
|
356
|
+
*/
|
|
357
|
+
readonly $child?: FeedModel;
|
|
358
|
+
/**
|
|
359
|
+
* (optional) the matched activity.
|
|
360
|
+
*/
|
|
361
|
+
readonly $activity?: ActivityModel;
|
|
362
|
+
/**
|
|
363
|
+
* (internal) score value.
|
|
364
|
+
*/
|
|
365
|
+
readonly _score?: number;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* type: `CommentHead`
|
|
369
|
+
* - common head of comment-model.
|
|
370
|
+
*/
|
|
371
|
+
export interface CommentHead {
|
|
372
|
+
/** id of comment */
|
|
373
|
+
id?: string;
|
|
374
|
+
/** name of comment */
|
|
375
|
+
name?: string;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* type: `CommentModel`
|
|
379
|
+
* - modeling of comment in feed
|
|
380
|
+
*/
|
|
381
|
+
export interface CommentModel extends CommentHead, Model, ActivitySupport, TextContent {
|
|
382
|
+
/** := <feed-id>:<no> */
|
|
383
|
+
id?: string;
|
|
384
|
+
/** stereo type */
|
|
385
|
+
stereo?: CommentStereo;
|
|
386
|
+
/** target alias value */
|
|
387
|
+
alias?: string;
|
|
388
|
+
/** user-id of comment */
|
|
389
|
+
userId?: string;
|
|
390
|
+
/** (optional) partial user-info */
|
|
391
|
+
user$?: UserHead;
|
|
392
|
+
/** (optional) the current identity-id when created */
|
|
393
|
+
identityId?: string;
|
|
394
|
+
/** parent feed */
|
|
395
|
+
feedId?: string;
|
|
396
|
+
/** (optional) partial feed-info */
|
|
397
|
+
feed$?: FeedHead;
|
|
398
|
+
/**
|
|
399
|
+
* (optional) goods linked
|
|
400
|
+
*/
|
|
401
|
+
goods$?: GoodsHead;
|
|
402
|
+
/**
|
|
403
|
+
* internal seq-number in feed
|
|
404
|
+
*/
|
|
405
|
+
no?: number;
|
|
406
|
+
/**
|
|
407
|
+
* indent depth (0: default)
|
|
408
|
+
*/
|
|
409
|
+
depth?: number;
|
|
410
|
+
/**
|
|
411
|
+
* parent-id of comment.
|
|
412
|
+
* - 대댓글일 경우 생김
|
|
413
|
+
*/
|
|
414
|
+
parent?: string;
|
|
415
|
+
/**
|
|
416
|
+
* hidden condition.
|
|
417
|
+
* - 삭제대신 이용하는것
|
|
418
|
+
* - delete 할 경우 parent/child관계가 끈어지므로, 내부적으로 절대 지우진 않음.
|
|
419
|
+
*/
|
|
420
|
+
hidden?: number;
|
|
421
|
+
/**
|
|
422
|
+
* 숨김처리 시간
|
|
423
|
+
*/
|
|
424
|
+
hiddenAt?: number;
|
|
425
|
+
/**
|
|
426
|
+
* (optional) the matched activity.
|
|
427
|
+
*/
|
|
428
|
+
readonly $activity?: ActivityModel;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* type: `ImageHead`
|
|
432
|
+
* - common head of image-model.
|
|
433
|
+
*/
|
|
434
|
+
export interface ImageHead {
|
|
435
|
+
/** id of image */
|
|
436
|
+
id?: string;
|
|
437
|
+
/** name of image */
|
|
438
|
+
name?: string;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* type: `ImageModel`
|
|
442
|
+
* - modeling of image
|
|
443
|
+
*/
|
|
444
|
+
export interface ImageModel extends ImageHead, Model {
|
|
445
|
+
/** := <auto-seq> */
|
|
446
|
+
id?: string;
|
|
447
|
+
/**
|
|
448
|
+
* (optional) name of image
|
|
449
|
+
*/
|
|
450
|
+
name?: string;
|
|
451
|
+
/** user-id of owner */
|
|
452
|
+
userId?: string;
|
|
453
|
+
/** (optional) partial user-info */
|
|
454
|
+
user$?: UserHead;
|
|
455
|
+
/**
|
|
456
|
+
* image bucket uploaded
|
|
457
|
+
*/
|
|
458
|
+
bucket?: string;
|
|
459
|
+
/**
|
|
460
|
+
* image key uploaded
|
|
461
|
+
*/
|
|
462
|
+
key?: string;
|
|
463
|
+
/** size in pixel */
|
|
464
|
+
width?: number;
|
|
465
|
+
/** size in pixel */
|
|
466
|
+
height?: number;
|
|
467
|
+
/**
|
|
468
|
+
* Orientation of image
|
|
469
|
+
*/
|
|
470
|
+
orientation?: number;
|
|
471
|
+
/**
|
|
472
|
+
* Content-Type
|
|
473
|
+
*/
|
|
474
|
+
contentType?: string;
|
|
475
|
+
/**
|
|
476
|
+
* final url to serve
|
|
477
|
+
*/
|
|
478
|
+
url?: string;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* type: `TagHead`
|
|
482
|
+
* - common head of tag-model.
|
|
483
|
+
*/
|
|
484
|
+
export interface TagHead {
|
|
485
|
+
/** id of tag */
|
|
486
|
+
id?: string;
|
|
487
|
+
/** name of tag */
|
|
488
|
+
name?: string;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* type: `TagModel`
|
|
492
|
+
* - modeling of tag
|
|
493
|
+
*/
|
|
494
|
+
export interface TagModel extends TagHead, Model, ActivitySupport {
|
|
495
|
+
/**
|
|
496
|
+
* id := <auto-seq>
|
|
497
|
+
* - 동음 이의어등 여러가지 상황을 고려해서, name 에 대한 여러가지 ID를 가지도록함
|
|
498
|
+
* - `alias`로 대표 모델을 지정하도록함.
|
|
499
|
+
*/
|
|
500
|
+
id?: string;
|
|
501
|
+
/** stereo of tag */
|
|
502
|
+
stereo?: TagStereo;
|
|
503
|
+
/** target alias value */
|
|
504
|
+
alias?: string;
|
|
505
|
+
/**
|
|
506
|
+
* tag name
|
|
507
|
+
*/
|
|
508
|
+
name?: string;
|
|
509
|
+
/** flag of censored condition (검열대상) */
|
|
510
|
+
censored?: number;
|
|
511
|
+
/**
|
|
512
|
+
* (optional) the matched activity.
|
|
513
|
+
*/
|
|
514
|
+
readonly $activity?: ActivityModel;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* type: `TopicHead` (토픽)
|
|
518
|
+
* - common head of topic-model.
|
|
519
|
+
*/
|
|
520
|
+
export interface TopicHead {
|
|
521
|
+
/** id of topic */
|
|
522
|
+
id?: string;
|
|
523
|
+
/** name of topic */
|
|
524
|
+
name?: string;
|
|
525
|
+
/** parent-id of topic */
|
|
526
|
+
topicId?: string;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* type: `TopicModel`
|
|
530
|
+
* - modeling of topic(토픽)
|
|
531
|
+
* - 토픽(주제)에 따른 피드(글)을 올릴 수 있다.
|
|
532
|
+
* - 특정 주제에 대한 내용 당음. (1피드에 1개의 토픽 매핑됨)
|
|
533
|
+
*/
|
|
534
|
+
export interface TopicModel extends TopicHead, Model, ActivitySupport, TextContent {
|
|
535
|
+
/**
|
|
536
|
+
* id := <auto-seq>
|
|
537
|
+
*/
|
|
538
|
+
id?: string;
|
|
539
|
+
/** stereo of topic */
|
|
540
|
+
stereo?: TopicStereo;
|
|
541
|
+
/** target alias value */
|
|
542
|
+
alias?: string;
|
|
543
|
+
/**
|
|
544
|
+
* topic name
|
|
545
|
+
*/
|
|
546
|
+
name?: string;
|
|
547
|
+
/** ordering number */
|
|
548
|
+
order?: number;
|
|
549
|
+
/** flag of censored condition (검열대상) */
|
|
550
|
+
censored?: number;
|
|
551
|
+
/** parent topic to support */
|
|
552
|
+
topicId?: string;
|
|
553
|
+
/** partial parent */
|
|
554
|
+
topic$?: TopicHead;
|
|
555
|
+
/** user-id of owner */
|
|
556
|
+
userId?: string;
|
|
557
|
+
/** (optional) partial social-info */
|
|
558
|
+
social$?: UserHead;
|
|
559
|
+
/**
|
|
560
|
+
* (optional) the matched activity.
|
|
561
|
+
*/
|
|
562
|
+
readonly $activity?: ActivityModel;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* type: `ActivityHead`
|
|
566
|
+
* - common head of activity-model.
|
|
567
|
+
*/
|
|
568
|
+
export interface ActivityHead {
|
|
569
|
+
/** id of activity */
|
|
570
|
+
id?: string;
|
|
571
|
+
/** name of activity */
|
|
572
|
+
name?: string;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* type: `ActivityModel`
|
|
576
|
+
* - 사용자별 활동 정보 저장
|
|
577
|
+
* - 경주별 구매 여부, 읽기 카운트등..
|
|
578
|
+
*/
|
|
579
|
+
export interface ActivityModel extends ActivityHead, Model {
|
|
580
|
+
/**
|
|
581
|
+
* id = <stereo>:md5(<custom-key>).len(<custom-key>)
|
|
582
|
+
*/
|
|
583
|
+
id?: string;
|
|
584
|
+
/** stereo of model */
|
|
585
|
+
stereo?: ActivityStereo;
|
|
586
|
+
/** owner user-id */
|
|
587
|
+
userId?: string;
|
|
588
|
+
/** target resource-id */
|
|
589
|
+
targetId?: string;
|
|
590
|
+
/**
|
|
591
|
+
* liked count for transaction
|
|
592
|
+
* - 게시글: 좋아요 (like)
|
|
593
|
+
* - 사용자: 팔로잉 (follow)
|
|
594
|
+
*
|
|
595
|
+
* [좋아요] (0 -> 1)
|
|
596
|
+
* - 1를 증가시키고, 그 결과가 1이면 `likeCount` 증가시킴
|
|
597
|
+
* - 1를 증가시키고, 그 결과가 >1 이면, set `liked := 1` 적용
|
|
598
|
+
* 기대치) 항상 값을 `1`으로 유지시킴.
|
|
599
|
+
*
|
|
600
|
+
* [좋아요 해제] -> 좋아도 반대 (1 -> 0)
|
|
601
|
+
* - 1를 감소키고, 그 결과가 0이면 `likeCount` 감소시킴
|
|
602
|
+
* 기대치) 항상 값을 0으로 유지시킴.
|
|
603
|
+
*/
|
|
604
|
+
liked?: number;
|
|
605
|
+
/** 좋아요 설정 시간 (없으면 null) */
|
|
606
|
+
likedAt?: number;
|
|
607
|
+
/** disliked count for transaction */
|
|
608
|
+
disliked?: number;
|
|
609
|
+
/** 싫어요 설정 시간 (없으면 null) */
|
|
610
|
+
dislikedAt?: number;
|
|
611
|
+
/** 북마크: marked count for transaction */
|
|
612
|
+
marked?: number;
|
|
613
|
+
/** 북마크 설정 시간 (없으면 null) */
|
|
614
|
+
markedAt?: number;
|
|
615
|
+
/**
|
|
616
|
+
* 구독: 피드/유저의 구독 상태에 따른 여부
|
|
617
|
+
* - 피드 수신 상태를 나타낼때, 구독에 따른 피드인지 확인하기 위함
|
|
618
|
+
*/
|
|
619
|
+
subscribed?: number;
|
|
620
|
+
/**
|
|
621
|
+
* 구독시간: 구독으로 수신된 시간
|
|
622
|
+
*/
|
|
623
|
+
subscribedAt?: number;
|
|
624
|
+
/**
|
|
625
|
+
* 읽은 개수 처리
|
|
626
|
+
*/
|
|
627
|
+
viewed?: number;
|
|
628
|
+
/** 읽기한 설정 시간 (없으면 null) */
|
|
629
|
+
viewedAt?: number;
|
|
630
|
+
/** (optional) the accumulated viewMilliSecond */
|
|
631
|
+
viewMilliSecond?: number;
|
|
632
|
+
/**
|
|
633
|
+
* 클릭 개수 처리
|
|
634
|
+
*/
|
|
635
|
+
clicked?: number;
|
|
636
|
+
/** 클릭한 설정 시간 (없으면 null) */
|
|
637
|
+
clickedAt?: number;
|
|
638
|
+
/** 신고: reported count for transaction */
|
|
639
|
+
reported?: number;
|
|
640
|
+
/** 신고 시간 (if applicable) */
|
|
641
|
+
reportedAt?: number;
|
|
642
|
+
/** 신고 내용 */
|
|
643
|
+
reportedReason?: string;
|
|
644
|
+
/** 차단: blocked count for transaction */
|
|
645
|
+
blocked?: number;
|
|
646
|
+
/** 차단 시간 (if applicable) */
|
|
647
|
+
blockedAt?: number;
|
|
648
|
+
/** 차단 내용 */
|
|
649
|
+
blockedReason?: string;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* extract field names from models
|
|
653
|
+
* - only fields start with lowercase, or all upper.
|
|
654
|
+
*/
|
|
655
|
+
export declare const filterFields: (fields: string[], base?: string[]) => string[];
|
|
656
|
+
/** field names from head */
|
|
657
|
+
export declare const $HEAD: {
|
|
658
|
+
user: string[];
|
|
659
|
+
feed: string[];
|
|
660
|
+
comment: string[];
|
|
661
|
+
tag: string[];
|
|
662
|
+
topic: string[];
|
|
663
|
+
image: string[];
|
|
664
|
+
activity: string[];
|
|
665
|
+
};
|
|
666
|
+
export declare const $FIELD: {
|
|
667
|
+
user: string[];
|
|
668
|
+
feed: string[];
|
|
669
|
+
comment: string[];
|
|
670
|
+
tag: string[];
|
|
671
|
+
topic: string[];
|
|
672
|
+
image: string[];
|
|
673
|
+
activity: string[];
|
|
674
|
+
};
|