@kimdaegyu/babmukdang-shared 0.1.1 → 1.0.0
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/index.cjs +403 -0
- package/dist/index.d.cts +843 -0
- package/dist/index.d.ts +843 -0
- package/dist/index.js +368 -0
- package/package.json +7 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
type RestaurantId = string;
|
|
2
|
+
interface KakaoRestaurantResponseDto {
|
|
3
|
+
id: RestaurantId;
|
|
4
|
+
place_name: string;
|
|
5
|
+
category_name: string;
|
|
6
|
+
category_group_name: string;
|
|
7
|
+
distance: string;
|
|
8
|
+
road_address_name: string;
|
|
9
|
+
address_name: string;
|
|
10
|
+
phone: string;
|
|
11
|
+
place_url?: string;
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface TokenResponse {
|
|
17
|
+
accessToken: string;
|
|
18
|
+
refreshToken: string;
|
|
19
|
+
accessTokenMaxAge: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 음식 카테고리 이미지 manifest 항목.
|
|
24
|
+
*
|
|
25
|
+
* `BabMukDang-Img/scripts/build-images.js`가 `public/categories.json`으로
|
|
26
|
+
* 출력하는 shape를 그대로 표현한다. 실제 산출물에는 `blurhash`가 없고
|
|
27
|
+
* `thumbhashDataURL`만 존재하므로 `blurhash`는 optional이다.
|
|
28
|
+
*
|
|
29
|
+
* - `id`: `assets/raw`의 `<8자리코드>_<이름>.jpg` 파일명에서 추출한 음식 코드.
|
|
30
|
+
* - `images.src`, `images.avifSrcset`: `/img/<id>.<hash>.<width>.avif` 상대 경로.
|
|
31
|
+
* CDN base URL은 소비측(Client)에서 prepend 한다.
|
|
32
|
+
*/
|
|
33
|
+
interface Category {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
aspectRatio: number;
|
|
37
|
+
placeholder: {
|
|
38
|
+
blurhash?: string;
|
|
39
|
+
thumbhashDataURL: string;
|
|
40
|
+
};
|
|
41
|
+
images: {
|
|
42
|
+
src: string;
|
|
43
|
+
avifSrcset: string;
|
|
44
|
+
};
|
|
45
|
+
priority?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** `id` 없이 단일 이미지 렌더링에 쓰는 manifest 항목. */
|
|
48
|
+
interface Item {
|
|
49
|
+
name: string;
|
|
50
|
+
aspectRatio: number;
|
|
51
|
+
placeholder: {
|
|
52
|
+
blurhash?: string;
|
|
53
|
+
thumbhashDataURL: string;
|
|
54
|
+
};
|
|
55
|
+
images: {
|
|
56
|
+
src: string;
|
|
57
|
+
avifSrcset: string;
|
|
58
|
+
sizes?: string;
|
|
59
|
+
};
|
|
60
|
+
priority?: boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type ISODateString = string;
|
|
64
|
+
type ISODateTimeString = string;
|
|
65
|
+
|
|
66
|
+
interface BaseResponse<T> {
|
|
67
|
+
code: number;
|
|
68
|
+
message: string;
|
|
69
|
+
data: T;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface ApiErrorResponse {
|
|
73
|
+
success: false;
|
|
74
|
+
status: number;
|
|
75
|
+
code: string;
|
|
76
|
+
message: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type UserId = string;
|
|
80
|
+
interface User {
|
|
81
|
+
userId: UserId;
|
|
82
|
+
username: string;
|
|
83
|
+
profileImageUrl: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type MenuCode = string;
|
|
87
|
+
interface Menu {
|
|
88
|
+
code: MenuCode;
|
|
89
|
+
label: string;
|
|
90
|
+
}
|
|
91
|
+
type LocationId = string;
|
|
92
|
+
interface LocationCandidate {
|
|
93
|
+
id: LocationId;
|
|
94
|
+
placeName: string;
|
|
95
|
+
lat: number;
|
|
96
|
+
lng: number;
|
|
97
|
+
address: string;
|
|
98
|
+
}
|
|
99
|
+
interface UserMenuCategory {
|
|
100
|
+
userId: string;
|
|
101
|
+
menuList: Menu[];
|
|
102
|
+
}
|
|
103
|
+
interface ChatMessage {
|
|
104
|
+
messageId: string;
|
|
105
|
+
user: User;
|
|
106
|
+
text?: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
}
|
|
109
|
+
interface FinalState {
|
|
110
|
+
location: LocationCandidate | undefined;
|
|
111
|
+
excludeMenu: Menu[] | undefined;
|
|
112
|
+
menu: Menu | undefined;
|
|
113
|
+
restaurant: KakaoRestaurantResponseDto | undefined;
|
|
114
|
+
time: string | undefined;
|
|
115
|
+
date: string | undefined;
|
|
116
|
+
}
|
|
117
|
+
interface Participant extends User {
|
|
118
|
+
ready: boolean;
|
|
119
|
+
}
|
|
120
|
+
type AnnouncementStage = "waiting" | "location" | "location-vote" | "exclude-menu" | "menu" | "restaurant" | "finish";
|
|
121
|
+
type InvitationStage = "waiting" | "date" | "time" | "location" | "location-vote" | "exclude-menu" | "menu" | "restaurant" | "finish";
|
|
122
|
+
declare const AnnouncementStageMap: Record<AnnouncementStage, number>;
|
|
123
|
+
declare const InvitationStageMap: Record<InvitationStage, number>;
|
|
124
|
+
|
|
125
|
+
interface TimePicksRequestDto {
|
|
126
|
+
times: string[];
|
|
127
|
+
}
|
|
128
|
+
interface DatePicksRequestDto {
|
|
129
|
+
dates: string[];
|
|
130
|
+
}
|
|
131
|
+
interface LocationCandidateAddRequestDto {
|
|
132
|
+
id: LocationId;
|
|
133
|
+
placeName: string;
|
|
134
|
+
lat: number;
|
|
135
|
+
lng: number;
|
|
136
|
+
address?: string;
|
|
137
|
+
}
|
|
138
|
+
interface LocationCandidateVoteRequestDto {
|
|
139
|
+
locationId: LocationId;
|
|
140
|
+
}
|
|
141
|
+
interface ExcludeMenuRequestDto {
|
|
142
|
+
menu: Menu;
|
|
143
|
+
}
|
|
144
|
+
interface MenuPickRequestDto {
|
|
145
|
+
menuCode: MenuCode;
|
|
146
|
+
}
|
|
147
|
+
interface RestaurantPickRequestDto {
|
|
148
|
+
restaurantId: RestaurantId;
|
|
149
|
+
}
|
|
150
|
+
interface ChatMessageRequestDto {
|
|
151
|
+
text: string;
|
|
152
|
+
}
|
|
153
|
+
interface ReadyStateRequestDto {
|
|
154
|
+
isReady: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface ChatMessageResponseItem extends ChatMessage {
|
|
158
|
+
}
|
|
159
|
+
interface TimePicksUpdateResponseItem {
|
|
160
|
+
userId: UserId;
|
|
161
|
+
times: string[];
|
|
162
|
+
}
|
|
163
|
+
interface DatePicksUpdateResponseItem {
|
|
164
|
+
userId: UserId;
|
|
165
|
+
dates: string[];
|
|
166
|
+
}
|
|
167
|
+
interface LocationCandidateAddUpdateResponseItem extends LocationCandidate {
|
|
168
|
+
author: UserId;
|
|
169
|
+
}
|
|
170
|
+
interface LocationCandidateVoteUpdateResponseItem {
|
|
171
|
+
locationId: LocationId;
|
|
172
|
+
votes: UserId[];
|
|
173
|
+
}
|
|
174
|
+
interface ExcludeMenuUpdateResponseItem {
|
|
175
|
+
userId: UserId;
|
|
176
|
+
exclusions: Menu[];
|
|
177
|
+
}
|
|
178
|
+
interface MenuPickUpdateResponseItem {
|
|
179
|
+
menuCode: MenuCode;
|
|
180
|
+
selectedUsers: UserId[];
|
|
181
|
+
}
|
|
182
|
+
interface RestaurantPickUpdateResponseItem {
|
|
183
|
+
restaurantId: RestaurantId;
|
|
184
|
+
selectedUsers: UserId[];
|
|
185
|
+
}
|
|
186
|
+
interface ReadyStateChangedDto {
|
|
187
|
+
readyCount: number;
|
|
188
|
+
participantCount: number;
|
|
189
|
+
}
|
|
190
|
+
type TimePicksUpdateResponseDto = TimePicksUpdateResponseItem[];
|
|
191
|
+
type DatePicksUpdateResponseDto = DatePicksUpdateResponseItem[];
|
|
192
|
+
type LocationCandidateAddUpdateResponseDto = LocationCandidateAddUpdateResponseItem[];
|
|
193
|
+
type LocationCandidateVoteUpdateResponseDto = LocationCandidateVoteUpdateResponseItem[];
|
|
194
|
+
type ExcludeMenuUpdateResponseDto = ExcludeMenuUpdateResponseItem[];
|
|
195
|
+
type MenuPickUpdateResponseDto = MenuPickUpdateResponseItem[];
|
|
196
|
+
type RestaurantPickUpdateResponseDto = RestaurantPickUpdateResponseItem[];
|
|
197
|
+
|
|
198
|
+
interface TimeInitialState extends TimePicksUpdateResponseDto {
|
|
199
|
+
}
|
|
200
|
+
interface DateInitialState extends DatePicksUpdateResponseDto {
|
|
201
|
+
}
|
|
202
|
+
interface LocationAddInitialState extends LocationCandidateAddUpdateResponseDto {
|
|
203
|
+
}
|
|
204
|
+
interface LocationVoteInitialState {
|
|
205
|
+
locations: LocationCandidateAddUpdateResponseDto;
|
|
206
|
+
votes?: LocationCandidateVoteUpdateResponseDto;
|
|
207
|
+
}
|
|
208
|
+
interface ExcludeMenuInitialState {
|
|
209
|
+
recentMenus: {
|
|
210
|
+
userId: UserId;
|
|
211
|
+
menuList: Menu[];
|
|
212
|
+
}[];
|
|
213
|
+
excludedMenuList?: ExcludeMenuUpdateResponseDto;
|
|
214
|
+
}
|
|
215
|
+
interface MenuInitialState {
|
|
216
|
+
initialMenus: Menu[];
|
|
217
|
+
menuPick?: MenuPickUpdateResponseDto;
|
|
218
|
+
}
|
|
219
|
+
interface RestaurantInitialState {
|
|
220
|
+
initialRestaurants: KakaoRestaurantResponseDto[];
|
|
221
|
+
restaurantUserList?: RestaurantPickUpdateResponseDto;
|
|
222
|
+
}
|
|
223
|
+
interface WaitingInitialState {
|
|
224
|
+
locationInitial?: string;
|
|
225
|
+
meetingAt?: string;
|
|
226
|
+
}
|
|
227
|
+
interface RoomInitialState {
|
|
228
|
+
participants: Participant[];
|
|
229
|
+
chat: ChatMessage[];
|
|
230
|
+
final: FinalState;
|
|
231
|
+
}
|
|
232
|
+
interface PhaseDataBroadcastDto {
|
|
233
|
+
phase: AnnouncementStage | InvitationStage;
|
|
234
|
+
data: WaitingInitialState | TimeInitialState | DateInitialState | LocationAddInitialState | LocationVoteInitialState | ExcludeMenuInitialState | MenuInitialState | RestaurantInitialState;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface TimeStore {
|
|
238
|
+
pickedByUser: Map<UserId, string[]>;
|
|
239
|
+
}
|
|
240
|
+
interface DateStore {
|
|
241
|
+
pickedByUser: Map<UserId, string[]>;
|
|
242
|
+
}
|
|
243
|
+
interface LocationStore {
|
|
244
|
+
candidates: Map<LocationId, LocationCandidate & {
|
|
245
|
+
author: UserId;
|
|
246
|
+
}>;
|
|
247
|
+
votes: Map<LocationId, Set<UserId>>;
|
|
248
|
+
}
|
|
249
|
+
interface ExcludeMenuStore {
|
|
250
|
+
userExclusions: Map<UserId, Map<MenuCode, Menu>>;
|
|
251
|
+
}
|
|
252
|
+
interface MenuStore {
|
|
253
|
+
availableMenus: Menu[];
|
|
254
|
+
menuPerUserSelections: Map<MenuCode, Set<UserId>>;
|
|
255
|
+
}
|
|
256
|
+
interface RestaurantStore {
|
|
257
|
+
initialRestaurants: KakaoRestaurantResponseDto[];
|
|
258
|
+
restaurantUserList: Map<UserId, RestaurantId>;
|
|
259
|
+
}
|
|
260
|
+
type RoomId = string;
|
|
261
|
+
interface RoomStore {
|
|
262
|
+
roomId: RoomId;
|
|
263
|
+
version: number;
|
|
264
|
+
updatedAt: number;
|
|
265
|
+
stage: AnnouncementStage | InvitationStage;
|
|
266
|
+
participants: Map<UserId, Participant>;
|
|
267
|
+
recentMenu: Map<UserId, Menu[]>;
|
|
268
|
+
timeout?: NodeJS.Timeout;
|
|
269
|
+
chat: ChatMessage[];
|
|
270
|
+
meetingAt?: string;
|
|
271
|
+
locationInitial?: string;
|
|
272
|
+
date?: DateStore;
|
|
273
|
+
time?: TimeStore;
|
|
274
|
+
location?: LocationStore;
|
|
275
|
+
restaurant?: RestaurantStore;
|
|
276
|
+
menu?: MenuStore;
|
|
277
|
+
excludeMenu?: ExcludeMenuStore;
|
|
278
|
+
final: FinalState;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
interface SocketClientEventMap {
|
|
282
|
+
any: [event: string, ...args: any[]];
|
|
283
|
+
"ready-state-changed": ReadyStateChangedDto;
|
|
284
|
+
"stage-changed": PhaseDataBroadcastDto;
|
|
285
|
+
"join-room": RoomInitialState;
|
|
286
|
+
"room-assigned": {
|
|
287
|
+
roomId: string;
|
|
288
|
+
};
|
|
289
|
+
"waiting-initial-state": WaitingInitialState;
|
|
290
|
+
"time-initial-state": TimeInitialState;
|
|
291
|
+
"date-initial-state": DateInitialState;
|
|
292
|
+
"location-add-initial-state": LocationAddInitialState;
|
|
293
|
+
"location-vote-initial-state": LocationVoteInitialState;
|
|
294
|
+
"exclude-menu-initial-state": ExcludeMenuInitialState;
|
|
295
|
+
"menu-initial-state": MenuInitialState;
|
|
296
|
+
"restaurant-initial-state": RestaurantInitialState;
|
|
297
|
+
"time-updated": TimePicksUpdateResponseDto;
|
|
298
|
+
"date-updated": DatePicksUpdateResponseDto;
|
|
299
|
+
"location-add-updated": LocationCandidateAddUpdateResponseDto;
|
|
300
|
+
"location-vote-updated": LocationCandidateVoteUpdateResponseDto;
|
|
301
|
+
"exclude-menu-updated": ExcludeMenuUpdateResponseDto;
|
|
302
|
+
"menu-pick-updated": MenuPickUpdateResponseDto;
|
|
303
|
+
"restaurant-pick-updated": RestaurantPickUpdateResponseDto;
|
|
304
|
+
"final-state-response": FinalState;
|
|
305
|
+
"chat-message": ChatMessageResponseItem;
|
|
306
|
+
}
|
|
307
|
+
interface InitialStateEventPayloadMap {
|
|
308
|
+
"waiting-initial-state": WaitingInitialState;
|
|
309
|
+
"time-initial-state": TimeInitialState;
|
|
310
|
+
"date-initial-state": DateInitialState;
|
|
311
|
+
"location-add-initial-state": LocationAddInitialState;
|
|
312
|
+
"location-vote-initial-state": LocationVoteInitialState;
|
|
313
|
+
"exclude-menu-initial-state": ExcludeMenuInitialState;
|
|
314
|
+
"menu-initial-state": MenuInitialState;
|
|
315
|
+
"restaurant-initial-state": RestaurantInitialState;
|
|
316
|
+
}
|
|
317
|
+
type SocketServerEventMap = {
|
|
318
|
+
"ready-state": ReadyStateRequestDto;
|
|
319
|
+
"chat-message": ChatMessageRequestDto;
|
|
320
|
+
"add-location-candidate": LocationCandidateAddRequestDto;
|
|
321
|
+
"vote-location": LocationCandidateVoteRequestDto;
|
|
322
|
+
"exclude-menu": ExcludeMenuRequestDto;
|
|
323
|
+
"pick-menu": MenuPickRequestDto;
|
|
324
|
+
"pick-restaurant": RestaurantPickRequestDto;
|
|
325
|
+
"pick-times": TimePicksRequestDto;
|
|
326
|
+
"pick-date": DatePicksRequestDto;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* socket.io `Socket<ListenEvents, EmitEvents>` 제네릭에 그대로 넣을 수 있는
|
|
330
|
+
* 함수 시그니처 이벤트 맵. 클라이언트는 서버가 보내는 이벤트를 수신(listen)하므로
|
|
331
|
+
* `SocketClientEventMap`을 ListenEvents로, 서버로 보내는 이벤트는
|
|
332
|
+
* `SocketServerEventMap`을 EmitEvents로 사용한다.
|
|
333
|
+
*
|
|
334
|
+
* `any`(onAny 디버그용 튜플)는 실제 이벤트가 아니므로 제외한다.
|
|
335
|
+
*/
|
|
336
|
+
type ServerToClientEvents = {
|
|
337
|
+
[K in keyof Omit<SocketClientEventMap, "any">]: (data: SocketClientEventMap[K]) => void;
|
|
338
|
+
};
|
|
339
|
+
type ClientToServerEvents = {
|
|
340
|
+
[K in keyof SocketServerEventMap]: (data: SocketServerEventMap[K]) => void;
|
|
341
|
+
};
|
|
342
|
+
type SocketRequestHandler<K extends keyof SocketServerEventMap> = (data: SocketServerEventMap[K]) => void;
|
|
343
|
+
type SocketRequestHandlers = {
|
|
344
|
+
[K in keyof SocketServerEventMap]?: SocketRequestHandler<K>;
|
|
345
|
+
};
|
|
346
|
+
type SocketResponseHandler<K extends keyof SocketClientEventMap> = (data: SocketClientEventMap[K]) => void;
|
|
347
|
+
type SocketResponseHandlers = {
|
|
348
|
+
[K in keyof SocketClientEventMap]?: SocketResponseHandler<K>;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
interface Onboarding {
|
|
352
|
+
likedCodes: string[];
|
|
353
|
+
dislikedCodes: string[];
|
|
354
|
+
allergyCodes: string[];
|
|
355
|
+
}
|
|
356
|
+
interface OnboardingPreferenceRequest extends Onboarding {
|
|
357
|
+
}
|
|
358
|
+
interface OnboardingPreferenceResponse extends Onboarding {
|
|
359
|
+
}
|
|
360
|
+
interface PreferenceSummaryResponse {
|
|
361
|
+
likes: Menu[];
|
|
362
|
+
dislikes: Menu[];
|
|
363
|
+
allergies: Menu[];
|
|
364
|
+
}
|
|
365
|
+
interface PreferenceMetaResponse {
|
|
366
|
+
onboardedAt: ISODateTimeString | null;
|
|
367
|
+
lastUpdatedAt: ISODateTimeString | null;
|
|
368
|
+
revision: number;
|
|
369
|
+
}
|
|
370
|
+
interface ProfileResponse {
|
|
371
|
+
member: {
|
|
372
|
+
id: number;
|
|
373
|
+
username: string;
|
|
374
|
+
profileImageUrl: string;
|
|
375
|
+
bio: string;
|
|
376
|
+
meetingCount: number;
|
|
377
|
+
createdAt: string;
|
|
378
|
+
updatedAt: string;
|
|
379
|
+
email: string;
|
|
380
|
+
age: number;
|
|
381
|
+
role: string;
|
|
382
|
+
preferredMenus: string[];
|
|
383
|
+
dislikedMenus: string[];
|
|
384
|
+
};
|
|
385
|
+
mealStatus: boolean;
|
|
386
|
+
}
|
|
387
|
+
interface ProfileDetailResponse {
|
|
388
|
+
memberId: number;
|
|
389
|
+
userName: string;
|
|
390
|
+
profileImageUrl: string;
|
|
391
|
+
bio: string;
|
|
392
|
+
meetingCount: number;
|
|
393
|
+
likes: PreferenceItem[];
|
|
394
|
+
dislikes: PreferenceItem[];
|
|
395
|
+
allergies: PreferenceItem[];
|
|
396
|
+
}
|
|
397
|
+
interface PreferenceItem {
|
|
398
|
+
code: string;
|
|
399
|
+
label: string;
|
|
400
|
+
}
|
|
401
|
+
interface UpdateProfileRequest {
|
|
402
|
+
userName: string;
|
|
403
|
+
profileImageUrl: string;
|
|
404
|
+
bio: string;
|
|
405
|
+
}
|
|
406
|
+
interface MemberSummaryResponse {
|
|
407
|
+
memberId: number;
|
|
408
|
+
username: string;
|
|
409
|
+
profileImageUrl: string;
|
|
410
|
+
friends: number;
|
|
411
|
+
completedMeetings: number;
|
|
412
|
+
uncompletedMeetings: number;
|
|
413
|
+
}
|
|
414
|
+
interface OnboardingRequest extends Onboarding, UpdateProfileRequest {
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
interface Article {
|
|
418
|
+
id: number;
|
|
419
|
+
author: User;
|
|
420
|
+
imageUrl: string;
|
|
421
|
+
mealDate: Date;
|
|
422
|
+
restaurant: KakaoRestaurantResponseDto;
|
|
423
|
+
createdAt: Date;
|
|
424
|
+
updatedAt: Date;
|
|
425
|
+
expiresAt: Date;
|
|
426
|
+
taggedMembers: User[];
|
|
427
|
+
}
|
|
428
|
+
interface ArticleSummaryResponseDto extends Article {
|
|
429
|
+
likeCount: number;
|
|
430
|
+
commentCount: number;
|
|
431
|
+
likedByMe: boolean;
|
|
432
|
+
}
|
|
433
|
+
interface PageArticleSummaryResponse {
|
|
434
|
+
totalElements: number;
|
|
435
|
+
totalPages: number;
|
|
436
|
+
first: boolean;
|
|
437
|
+
size: number;
|
|
438
|
+
content: ArticleSummaryResponseDto[];
|
|
439
|
+
number: number;
|
|
440
|
+
sort: SortObject;
|
|
441
|
+
numberOfElements: number;
|
|
442
|
+
pageable: PageableObject;
|
|
443
|
+
last: boolean;
|
|
444
|
+
empty: boolean;
|
|
445
|
+
}
|
|
446
|
+
interface SortObject {
|
|
447
|
+
empty: boolean;
|
|
448
|
+
sorted: boolean;
|
|
449
|
+
unsorted: boolean;
|
|
450
|
+
}
|
|
451
|
+
interface PageableObject {
|
|
452
|
+
offset: number;
|
|
453
|
+
sort: SortObject;
|
|
454
|
+
paged: boolean;
|
|
455
|
+
pageNumber: number;
|
|
456
|
+
pageSize: number;
|
|
457
|
+
unpaged: boolean;
|
|
458
|
+
}
|
|
459
|
+
interface ArticleDetailResponseDto {
|
|
460
|
+
id: number;
|
|
461
|
+
author: User;
|
|
462
|
+
imageUrl: string;
|
|
463
|
+
mealDate: Date;
|
|
464
|
+
restaurant: KakaoRestaurantResponseDto;
|
|
465
|
+
likeCount: number;
|
|
466
|
+
commentCount: number;
|
|
467
|
+
likedByMe: boolean;
|
|
468
|
+
createdAt: Date;
|
|
469
|
+
expiresAt: Date;
|
|
470
|
+
}
|
|
471
|
+
interface ArticlePostRequestDto {
|
|
472
|
+
imageUrl: string;
|
|
473
|
+
mealDate: ISODateString;
|
|
474
|
+
restaurant: KakaoRestaurantResponseDto;
|
|
475
|
+
taggedMembersId: number[];
|
|
476
|
+
foodAnalysis?: FoodAnalysisResultDto;
|
|
477
|
+
}
|
|
478
|
+
interface FoodAnalysisResultDto {
|
|
479
|
+
code: string;
|
|
480
|
+
label: string;
|
|
481
|
+
confidence: number;
|
|
482
|
+
tsUtc?: string;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
interface CommentResponseDto {
|
|
486
|
+
commentId: number;
|
|
487
|
+
author: User;
|
|
488
|
+
parentCommentId: number | null;
|
|
489
|
+
content: string;
|
|
490
|
+
createdAt: Date;
|
|
491
|
+
updatedAt: Date;
|
|
492
|
+
}
|
|
493
|
+
interface CommentPostRequestDto {
|
|
494
|
+
content: string;
|
|
495
|
+
parentCommentId?: number;
|
|
496
|
+
}
|
|
497
|
+
interface Comment extends CommentResponseDto {
|
|
498
|
+
replies?: CommentResponseDto[];
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
interface LikePostResponseDto {
|
|
502
|
+
liked: boolean;
|
|
503
|
+
likeCount: number;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
type UploadAndPostVars = {
|
|
507
|
+
currentUserId: string;
|
|
508
|
+
file: File;
|
|
509
|
+
buildRequest: (cdnUrl: string) => ArticlePostRequestDto;
|
|
510
|
+
};
|
|
511
|
+
type UploadAndRegisterVars = {
|
|
512
|
+
currentUserId: string;
|
|
513
|
+
file: File;
|
|
514
|
+
buildRequest: (cdnUrl: string) => {
|
|
515
|
+
imageUrl: string;
|
|
516
|
+
username: string;
|
|
517
|
+
preferences: string[];
|
|
518
|
+
cantEat: string[];
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
type RecruitStatus = "OPEN" | "CLOSED" | "EXPIRED";
|
|
523
|
+
interface Recruit {
|
|
524
|
+
targetCount: number;
|
|
525
|
+
meetingAt: ISODateTimeString;
|
|
526
|
+
location: string;
|
|
527
|
+
message: string;
|
|
528
|
+
}
|
|
529
|
+
interface RecruitRequestDto extends Recruit {
|
|
530
|
+
}
|
|
531
|
+
interface RecruitParticipantDto extends User {
|
|
532
|
+
}
|
|
533
|
+
interface RecruitResponseDto extends Recruit {
|
|
534
|
+
id: number;
|
|
535
|
+
postId: number;
|
|
536
|
+
status: RecruitStatus;
|
|
537
|
+
createdAt: ISODateTimeString;
|
|
538
|
+
expiredAt: ISODateTimeString;
|
|
539
|
+
updatedAt: ISODateTimeString;
|
|
540
|
+
author: User;
|
|
541
|
+
participants: RecruitParticipantDto[];
|
|
542
|
+
}
|
|
543
|
+
interface CreateRecruitResponseDto {
|
|
544
|
+
recruitId: number;
|
|
545
|
+
postId: number;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
interface InvitationPostRequest {
|
|
549
|
+
inviteeId: number;
|
|
550
|
+
message: string;
|
|
551
|
+
}
|
|
552
|
+
interface InvitationResponse {
|
|
553
|
+
invitationId: number;
|
|
554
|
+
inviterName: string;
|
|
555
|
+
inviterProfileImageUrl?: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
declare enum PlanStatus {
|
|
559
|
+
PLANNING = "PLANNING",
|
|
560
|
+
COMPLETED = "COMPLETED"
|
|
561
|
+
}
|
|
562
|
+
declare enum PlanType {
|
|
563
|
+
ANNOUNCEMENT = "ANNOUNCEMENT",
|
|
564
|
+
INVITATION = "INVITATION"
|
|
565
|
+
}
|
|
566
|
+
interface MeetingParticipant {
|
|
567
|
+
userId: string;
|
|
568
|
+
username: string;
|
|
569
|
+
profileImageUrl: string;
|
|
570
|
+
}
|
|
571
|
+
interface MeetingResponse {
|
|
572
|
+
id: number;
|
|
573
|
+
author: MeetingParticipant;
|
|
574
|
+
participants: MeetingParticipant[];
|
|
575
|
+
location: string;
|
|
576
|
+
meetingAt: ISODateTimeString;
|
|
577
|
+
restaurant: string;
|
|
578
|
+
isCompleted: boolean;
|
|
579
|
+
restaurantType: string;
|
|
580
|
+
status: PlanStatus;
|
|
581
|
+
type: PlanType;
|
|
582
|
+
createdAt: ISODateTimeString;
|
|
583
|
+
updatedAt: ISODateTimeString;
|
|
584
|
+
}
|
|
585
|
+
interface CreatePlanRequest {
|
|
586
|
+
meetingDate: string;
|
|
587
|
+
meetingTime: string;
|
|
588
|
+
}
|
|
589
|
+
interface PlanResponseDto {
|
|
590
|
+
id: number;
|
|
591
|
+
meetingAt: ISODateTimeString;
|
|
592
|
+
location: LocationCandidate | null;
|
|
593
|
+
restaurant: KakaoRestaurantResponseDto | null;
|
|
594
|
+
author: User | null;
|
|
595
|
+
participants: User[];
|
|
596
|
+
status: PlanStatus;
|
|
597
|
+
type: PlanType;
|
|
598
|
+
createdAt: ISODateTimeString;
|
|
599
|
+
updatedAt: ISODateTimeString;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
interface LocalNewsNoti {
|
|
603
|
+
id: number;
|
|
604
|
+
type: "school" | "restaurant" | "area";
|
|
605
|
+
title: string;
|
|
606
|
+
time: string;
|
|
607
|
+
message: string;
|
|
608
|
+
period: string;
|
|
609
|
+
imageUrl?: string;
|
|
610
|
+
}
|
|
611
|
+
interface MatchingInviteNoti {
|
|
612
|
+
id: number;
|
|
613
|
+
type: "invitation" | "announcement";
|
|
614
|
+
title: string;
|
|
615
|
+
time: string;
|
|
616
|
+
message: string;
|
|
617
|
+
period: string;
|
|
618
|
+
imageUrl: string;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
interface PerUser {
|
|
622
|
+
user_id: string;
|
|
623
|
+
excluded_codes: string[];
|
|
624
|
+
overrides_applied: string[];
|
|
625
|
+
taste_top: TasteTop[];
|
|
626
|
+
}
|
|
627
|
+
interface TasteTop {
|
|
628
|
+
code: string;
|
|
629
|
+
label: string;
|
|
630
|
+
score: number;
|
|
631
|
+
}
|
|
632
|
+
interface GroupExcluded {
|
|
633
|
+
mode: string;
|
|
634
|
+
codes: string[];
|
|
635
|
+
}
|
|
636
|
+
interface Recommendation {
|
|
637
|
+
code: string;
|
|
638
|
+
label: string;
|
|
639
|
+
group_score: number;
|
|
640
|
+
member_scores: MemberScores;
|
|
641
|
+
reasons: string[];
|
|
642
|
+
}
|
|
643
|
+
interface MemberScores {
|
|
644
|
+
[key: string]: number;
|
|
645
|
+
}
|
|
646
|
+
interface Params {
|
|
647
|
+
taste_mode: string;
|
|
648
|
+
exclude_mode: string;
|
|
649
|
+
weights: object;
|
|
650
|
+
top_k: number;
|
|
651
|
+
}
|
|
652
|
+
interface MenuRecommendationAIResponseDto {
|
|
653
|
+
group_id: string | null;
|
|
654
|
+
user_ids: string[];
|
|
655
|
+
exclude_days: number;
|
|
656
|
+
per_user: PerUser[];
|
|
657
|
+
group_excluded: GroupExcluded;
|
|
658
|
+
recommendations: Recommendation[];
|
|
659
|
+
params: Params;
|
|
660
|
+
}
|
|
661
|
+
declare const MenuRecommendationAIResponseDto: MenuRecommendationAIResponseDto;
|
|
662
|
+
|
|
663
|
+
interface Friend {
|
|
664
|
+
userId: UserId;
|
|
665
|
+
name: string;
|
|
666
|
+
lastActive: string;
|
|
667
|
+
isHungry: boolean;
|
|
668
|
+
}
|
|
669
|
+
type FriendMealFilter = "ALL" | "HUNGRY" | "NOT_HUNGRY";
|
|
670
|
+
interface FriendMealItemResponse {
|
|
671
|
+
memberId: number;
|
|
672
|
+
userName: string;
|
|
673
|
+
profileImageUrl: string;
|
|
674
|
+
hungry: boolean;
|
|
675
|
+
label: string;
|
|
676
|
+
}
|
|
677
|
+
interface FriendListItemResponse {
|
|
678
|
+
memberId: number;
|
|
679
|
+
userName: string;
|
|
680
|
+
profileImageUrl: string;
|
|
681
|
+
friendSince: string;
|
|
682
|
+
}
|
|
683
|
+
interface FriendBlockItemResponse {
|
|
684
|
+
memberId: number;
|
|
685
|
+
userName: string;
|
|
686
|
+
profileImageUrl: string;
|
|
687
|
+
blockedAt: string;
|
|
688
|
+
}
|
|
689
|
+
type FriendRequestStatus = "PENDING" | "ACCEPTED" | "REJECTED" | "CANCELED";
|
|
690
|
+
interface FriendRequestItemResponse {
|
|
691
|
+
requestId: number;
|
|
692
|
+
requester: {
|
|
693
|
+
memberId: number;
|
|
694
|
+
userName: string;
|
|
695
|
+
profileImageUrl: string;
|
|
696
|
+
};
|
|
697
|
+
recipient: {
|
|
698
|
+
memberId: number;
|
|
699
|
+
userName: string;
|
|
700
|
+
profileImageUrl: string;
|
|
701
|
+
};
|
|
702
|
+
status: FriendRequestStatus;
|
|
703
|
+
requestedAt: string;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
type FoodPreferenceType = "LIKE" | "DISLIKE" | "ALLERGY";
|
|
707
|
+
interface FoodPreferenceResponseDto {
|
|
708
|
+
id: number;
|
|
709
|
+
memberId: number;
|
|
710
|
+
foodCode: string;
|
|
711
|
+
type: FoodPreferenceType;
|
|
712
|
+
createdAt: ISODateTimeString;
|
|
713
|
+
updatedAt: ISODateTimeString;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
type MealStatus = "FED" | "FASTING";
|
|
717
|
+
type MealStatusAction = "ATE_NOW" | "SET_OFF";
|
|
718
|
+
interface UpdateMealStatusRequest {
|
|
719
|
+
action: MealStatusAction;
|
|
720
|
+
}
|
|
721
|
+
interface MealStatusResponse {
|
|
722
|
+
status: MealStatus;
|
|
723
|
+
lastMealAt: ISODateTimeString | null;
|
|
724
|
+
fastingMinutes: number;
|
|
725
|
+
fastingHours: number;
|
|
726
|
+
secondsToAutoOff: number;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
interface ReferralCreateResponse {
|
|
730
|
+
code: string;
|
|
731
|
+
link: string;
|
|
732
|
+
expiresAt: ISODateTimeString;
|
|
733
|
+
}
|
|
734
|
+
interface ReferralItemResponse {
|
|
735
|
+
code: string;
|
|
736
|
+
createdAt: ISODateTimeString;
|
|
737
|
+
expiresAt: ISODateTimeString;
|
|
738
|
+
used: boolean;
|
|
739
|
+
usedByMemberId: number | null;
|
|
740
|
+
usedByUserName: string | null;
|
|
741
|
+
}
|
|
742
|
+
interface RedeemReferralRequest {
|
|
743
|
+
code: string;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
type RewardType = "WEEK" | "MONTH";
|
|
747
|
+
interface WeekProgress {
|
|
748
|
+
days: boolean[];
|
|
749
|
+
completed: number;
|
|
750
|
+
goal: number;
|
|
751
|
+
}
|
|
752
|
+
interface MonthProgress {
|
|
753
|
+
count: number;
|
|
754
|
+
goal: number;
|
|
755
|
+
}
|
|
756
|
+
interface ChallengeStatusResponse {
|
|
757
|
+
week: WeekProgress;
|
|
758
|
+
month: MonthProgress;
|
|
759
|
+
weekRewardAvailable: boolean;
|
|
760
|
+
monthRewardAvailable: boolean;
|
|
761
|
+
}
|
|
762
|
+
interface ClaimChallengeRewardRequest {
|
|
763
|
+
type: RewardType;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
type CouponType = "DISCOUNT" | "SERVICE";
|
|
767
|
+
type CouponStatus = "UNUSED" | "USED";
|
|
768
|
+
interface CouponResponse {
|
|
769
|
+
couponId: number;
|
|
770
|
+
title: string;
|
|
771
|
+
shopName: string;
|
|
772
|
+
type: CouponType;
|
|
773
|
+
condition: string;
|
|
774
|
+
expiresAt: ISODateString;
|
|
775
|
+
used: boolean;
|
|
776
|
+
thumbnailUrl: string;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
declare class RestaurantPickRequestDtoServer implements RestaurantPickRequestDto {
|
|
780
|
+
restaurantId: RestaurantId;
|
|
781
|
+
}
|
|
782
|
+
declare class DatePicksRequestDtoServer implements DatePicksRequestDto {
|
|
783
|
+
dates: string[];
|
|
784
|
+
}
|
|
785
|
+
declare class TimePicksRequestDtoServer implements TimePicksRequestDto {
|
|
786
|
+
times: string[];
|
|
787
|
+
}
|
|
788
|
+
declare class LocationCandidateAddRequestDtoServer implements LocationCandidateAddRequestDto {
|
|
789
|
+
id: LocationId;
|
|
790
|
+
placeName: string;
|
|
791
|
+
lat: number;
|
|
792
|
+
lng: number;
|
|
793
|
+
address: string;
|
|
794
|
+
}
|
|
795
|
+
declare class LocationCandidateVoteRequestDtoServer implements LocationCandidateVoteRequestDto {
|
|
796
|
+
locationId: LocationId;
|
|
797
|
+
}
|
|
798
|
+
declare class ExcludeMenuRequestDtoServer implements ExcludeMenuRequestDto {
|
|
799
|
+
menu: Menu;
|
|
800
|
+
}
|
|
801
|
+
declare class MenuPickRequestDtoServer implements MenuPickRequestDto {
|
|
802
|
+
menuCode: MenuCode;
|
|
803
|
+
}
|
|
804
|
+
declare class ChatMessageRequestDtoServer implements ChatMessageRequestDto {
|
|
805
|
+
text: string;
|
|
806
|
+
}
|
|
807
|
+
declare class ReadyStateRequestDtoServer implements ReadyStateRequestDto {
|
|
808
|
+
isReady: boolean;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
declare class AnnouncementRequestDto {
|
|
812
|
+
announcementId: string;
|
|
813
|
+
location: string;
|
|
814
|
+
meetingAt: string;
|
|
815
|
+
participants: Participant[];
|
|
816
|
+
recentMenu: {
|
|
817
|
+
userId: string;
|
|
818
|
+
menu: Menu[];
|
|
819
|
+
}[];
|
|
820
|
+
}
|
|
821
|
+
declare class InvitationRequestDto {
|
|
822
|
+
invitationId: string;
|
|
823
|
+
participants: Participant[];
|
|
824
|
+
recentMenu: {
|
|
825
|
+
userId: string;
|
|
826
|
+
menu: Menu[];
|
|
827
|
+
}[];
|
|
828
|
+
}
|
|
829
|
+
declare class AnnouncementResultRequestDto {
|
|
830
|
+
announcementId: string;
|
|
831
|
+
location: LocationCandidate;
|
|
832
|
+
menu: Menu;
|
|
833
|
+
restaurant: KakaoRestaurantResponseDto;
|
|
834
|
+
}
|
|
835
|
+
declare class InvitationResultRequestDto {
|
|
836
|
+
invitationId: string;
|
|
837
|
+
location: LocationCandidate;
|
|
838
|
+
menu: Menu;
|
|
839
|
+
meetingAt: string;
|
|
840
|
+
restaurant: KakaoRestaurantResponseDto;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
export { AnnouncementRequestDto, AnnouncementResultRequestDto, type AnnouncementStage, AnnouncementStageMap, type ApiErrorResponse, type Article, type ArticleDetailResponseDto, type ArticlePostRequestDto, type ArticleSummaryResponseDto, type BaseResponse, type Category, type ChallengeStatusResponse, type ChatMessage, type ChatMessageRequestDto, ChatMessageRequestDtoServer, type ChatMessageResponseItem, type ClaimChallengeRewardRequest, type ClientToServerEvents, type Comment, type CommentPostRequestDto, type CommentResponseDto, type CouponResponse, type CouponStatus, type CouponType, type CreatePlanRequest, type CreateRecruitResponseDto, type DateInitialState, type DatePicksRequestDto, DatePicksRequestDtoServer, type DatePicksUpdateResponseDto, type DatePicksUpdateResponseItem, type DateStore, type ExcludeMenuInitialState, type ExcludeMenuRequestDto, ExcludeMenuRequestDtoServer, type ExcludeMenuStore, type ExcludeMenuUpdateResponseDto, type ExcludeMenuUpdateResponseItem, type FinalState, type FoodAnalysisResultDto, type FoodPreferenceResponseDto, type FoodPreferenceType, type Friend, type FriendBlockItemResponse, type FriendListItemResponse, type FriendMealFilter, type FriendMealItemResponse, type FriendRequestItemResponse, type FriendRequestStatus, type ISODateString, type ISODateTimeString, type InitialStateEventPayloadMap, type InvitationPostRequest, InvitationRequestDto, type InvitationResponse, InvitationResultRequestDto, type InvitationStage, InvitationStageMap, type Item, type KakaoRestaurantResponseDto, type LikePostResponseDto, type LocalNewsNoti, type LocationAddInitialState, type LocationCandidate, type LocationCandidateAddRequestDto, LocationCandidateAddRequestDtoServer, type LocationCandidateAddUpdateResponseDto, type LocationCandidateAddUpdateResponseItem, type LocationCandidateVoteRequestDto, LocationCandidateVoteRequestDtoServer, type LocationCandidateVoteUpdateResponseDto, type LocationCandidateVoteUpdateResponseItem, type LocationId, type LocationStore, type LocationVoteInitialState, type MatchingInviteNoti, type MealStatus, type MealStatusAction, type MealStatusResponse, type MeetingParticipant, type MeetingResponse, type MemberScores, type MemberSummaryResponse, type Menu, type MenuCode, type MenuInitialState, type MenuPickRequestDto, MenuPickRequestDtoServer, type MenuPickUpdateResponseDto, type MenuPickUpdateResponseItem, MenuRecommendationAIResponseDto, type MenuStore, type MonthProgress, type Onboarding, type OnboardingPreferenceRequest, type OnboardingPreferenceResponse, type OnboardingRequest, type PageArticleSummaryResponse, type PageableObject, type Participant, type PhaseDataBroadcastDto, type PlanResponseDto, PlanStatus, PlanType, type PreferenceItem, type PreferenceMetaResponse, type PreferenceSummaryResponse, type ProfileDetailResponse, type ProfileResponse, type ReadyStateChangedDto, type ReadyStateRequestDto, ReadyStateRequestDtoServer, type Recommendation, type Recruit, type RecruitParticipantDto, type RecruitRequestDto, type RecruitResponseDto, type RecruitStatus, type RedeemReferralRequest, type ReferralCreateResponse, type ReferralItemResponse, type RestaurantId, type RestaurantInitialState, type RestaurantPickRequestDto, RestaurantPickRequestDtoServer, type RestaurantPickUpdateResponseDto, type RestaurantPickUpdateResponseItem, type RestaurantStore, type RewardType, type RoomId, type RoomInitialState, type RoomStore, type ServerToClientEvents, type SocketClientEventMap, type SocketRequestHandlers, type SocketResponseHandlers, type SocketServerEventMap, type SortObject, type TimeInitialState, type TimePicksRequestDto, TimePicksRequestDtoServer, type TimePicksUpdateResponseDto, type TimePicksUpdateResponseItem, type TimeStore, type TokenResponse, type UpdateMealStatusRequest, type UpdateProfileRequest, type UploadAndPostVars, type UploadAndRegisterVars, type User, type UserId, type UserMenuCategory, type WaitingInitialState, type WeekProgress };
|