@kimdaegyu/babmukdang-shared 1.0.7 → 1.1.1
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/chunk-4XAGRJUM.js +61 -0
- package/dist/chunk-5QLCZOPJ.js +34 -0
- package/dist/chunk-AATETFLU.js +312 -0
- package/dist/chunk-ADIREWTX.js +72 -0
- package/dist/chunk-ET2Z5ZYA.js +37 -0
- package/dist/chunk-HRM3FQPL.js +12 -0
- package/dist/chunk-JNJRBUKR.js +30 -0
- package/dist/chunk-M7HH7FMO.js +40 -0
- package/dist/chunk-NAPCX4Q6.js +183 -0
- package/dist/chunk-NCVWB52E.js +0 -0
- package/dist/chunk-NJTV6DRT.js +0 -0
- package/dist/chunk-O56CI56W.js +37 -0
- package/dist/chunk-PFSZSKD5.js +0 -0
- package/dist/chunk-RHQHBUO4.js +78 -0
- package/dist/chunk-XTBVYY5B.js +286 -0
- package/dist/chunk-XWTMYXPO.js +109 -0
- package/dist/chunk-YJ7RUOEJ.js +35 -0
- package/dist/domain/article/index.cjs +243 -0
- package/dist/domain/article/index.d.cts +952 -0
- package/dist/domain/article/index.d.ts +952 -0
- package/dist/domain/article/index.js +30 -0
- package/dist/domain/auth/index.cjs +141 -0
- package/dist/domain/auth/index.d.cts +72 -0
- package/dist/domain/auth/index.d.ts +72 -0
- package/dist/domain/auth/index.js +14 -0
- package/dist/domain/common/index.cjs +756 -0
- package/dist/domain/common/index.d.cts +2689 -0
- package/dist/domain/common/index.d.ts +2689 -0
- package/dist/domain/common/index.js +106 -0
- package/dist/domain/friend/index.cjs +148 -0
- package/dist/domain/friend/index.d.cts +117 -0
- package/dist/domain/friend/index.d.ts +117 -0
- package/dist/domain/friend/index.js +17 -0
- package/dist/domain/index.cjs +974 -0
- package/dist/domain/index.d.cts +14 -0
- package/dist/domain/index.d.ts +14 -0
- package/dist/domain/index.js +308 -0
- package/dist/domain/invitation/index.cjs +82 -0
- package/dist/domain/invitation/index.d.cts +64 -0
- package/dist/domain/invitation/index.d.ts +64 -0
- package/dist/domain/invitation/index.js +13 -0
- package/dist/domain/meal/index.cjs +154 -0
- package/dist/domain/meal/index.d.cts +66 -0
- package/dist/domain/meal/index.d.ts +66 -0
- package/dist/domain/meal/index.js +20 -0
- package/dist/domain/member/index.cjs +136 -0
- package/dist/domain/member/index.d.cts +332 -0
- package/dist/domain/member/index.d.ts +332 -0
- package/dist/domain/member/index.js +30 -0
- package/dist/domain/plan/index.cjs +278 -0
- package/dist/domain/plan/index.d.cts +178 -0
- package/dist/domain/plan/index.d.ts +178 -0
- package/dist/domain/plan/index.js +18 -0
- package/dist/domain/promotion/index.cjs +134 -0
- package/dist/domain/promotion/index.d.cts +114 -0
- package/dist/domain/promotion/index.d.ts +114 -0
- package/dist/domain/promotion/index.js +24 -0
- package/dist/domain/recruit/index.cjs +181 -0
- package/dist/domain/recruit/index.d.cts +130 -0
- package/dist/domain/recruit/index.d.ts +130 -0
- package/dist/domain/recruit/index.js +29 -0
- package/dist/domain/restaurant/index.cjs +85 -0
- package/dist/domain/restaurant/index.d.cts +82 -0
- package/dist/domain/restaurant/index.d.ts +82 -0
- package/dist/domain/restaurant/index.js +10 -0
- package/dist/domain/room/index.cjs +344 -0
- package/dist/domain/room/index.d.cts +1482 -0
- package/dist/domain/room/index.d.ts +1482 -0
- package/dist/domain/room/index.js +74 -0
- package/dist/id-_a-oManb.d.cts +58 -0
- package/dist/id-_a-oManb.d.ts +58 -0
- package/dist/index-CqcSqpDV.d.ts +286 -0
- package/dist/index-HEHaDbrV.d.cts +286 -0
- package/dist/index.cjs +825 -21
- package/dist/index.d.cts +108 -616
- package/dist/index.d.ts +108 -616
- package/dist/index.js +33 -36
- package/package.json +55 -39
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RestaurantSchema
|
|
3
|
+
} from "./chunk-ET2Z5ZYA.js";
|
|
4
|
+
import {
|
|
5
|
+
ISODateStringSchema,
|
|
6
|
+
ISODateTimeStringSchema
|
|
7
|
+
} from "./chunk-HRM3FQPL.js";
|
|
8
|
+
import {
|
|
9
|
+
MemberCoreSchema
|
|
10
|
+
} from "./chunk-ADIREWTX.js";
|
|
11
|
+
import {
|
|
12
|
+
FoodCodeSchema,
|
|
13
|
+
FoodSchema,
|
|
14
|
+
MemberIdSchema,
|
|
15
|
+
RestaurantIdSchema,
|
|
16
|
+
RoomIdSchema
|
|
17
|
+
} from "./chunk-4XAGRJUM.js";
|
|
18
|
+
|
|
19
|
+
// src/domain/room/schema/room.schema.ts
|
|
20
|
+
import { z } from "zod";
|
|
21
|
+
var MenuCodeSchema = FoodCodeSchema;
|
|
22
|
+
var LocationIdSchema = z.string().min(1).brand();
|
|
23
|
+
var MenuSchema = FoodSchema.extend({});
|
|
24
|
+
var LocationCandidateSchema = z.object({
|
|
25
|
+
locationId: LocationIdSchema,
|
|
26
|
+
placeName: z.string(),
|
|
27
|
+
lat: z.number(),
|
|
28
|
+
lng: z.number(),
|
|
29
|
+
address: z.string()
|
|
30
|
+
});
|
|
31
|
+
var ParticipantSchema = MemberCoreSchema.extend({
|
|
32
|
+
ready: z.boolean()
|
|
33
|
+
});
|
|
34
|
+
var RecruitRoomStageSchema = z.enum([
|
|
35
|
+
"waiting",
|
|
36
|
+
"location",
|
|
37
|
+
"location-vote",
|
|
38
|
+
"exclude-menu",
|
|
39
|
+
"menu",
|
|
40
|
+
"restaurant",
|
|
41
|
+
"finish"
|
|
42
|
+
]);
|
|
43
|
+
var InvitationRoomStageSchema = z.enum([
|
|
44
|
+
"waiting",
|
|
45
|
+
"date",
|
|
46
|
+
"time",
|
|
47
|
+
"location",
|
|
48
|
+
"location-vote",
|
|
49
|
+
"exclude-menu",
|
|
50
|
+
"menu",
|
|
51
|
+
"restaurant",
|
|
52
|
+
"finish"
|
|
53
|
+
]);
|
|
54
|
+
var ReadyStateRequestSchema = z.object({
|
|
55
|
+
isReady: z.boolean()
|
|
56
|
+
});
|
|
57
|
+
var ChatMessageRequestSchema = z.object({
|
|
58
|
+
message: z.string().min(1).max(500)
|
|
59
|
+
});
|
|
60
|
+
var AddLocationCandidateRequestSchema = LocationCandidateSchema;
|
|
61
|
+
var VoteLocationRequestSchema = z.object({ locationId: LocationIdSchema });
|
|
62
|
+
var ExcludeMenuRequestSchema = z.object({ menu: MenuSchema });
|
|
63
|
+
var PickMenuRequestSchema = z.object({ menuCode: MenuCodeSchema });
|
|
64
|
+
var PickRestaurantRequestSchema = z.object({ restaurantId: RestaurantIdSchema });
|
|
65
|
+
var PickTimesRequestSchema = z.object({ times: z.array(z.string().min(1)).min(1) });
|
|
66
|
+
var PickDateRequestSchema = z.object({ dates: z.array(ISODateStringSchema).min(1) });
|
|
67
|
+
var RoomAssignedResponseSchema = z.object({
|
|
68
|
+
roomId: RoomIdSchema
|
|
69
|
+
});
|
|
70
|
+
var RoomSocketErrorSchema = z.object({
|
|
71
|
+
code: z.string(),
|
|
72
|
+
message: z.string()
|
|
73
|
+
});
|
|
74
|
+
var ChatMessageResponseSchema = z.object({
|
|
75
|
+
messageId: z.string(),
|
|
76
|
+
user: MemberCoreSchema,
|
|
77
|
+
message: z.string(),
|
|
78
|
+
createdAt: ISODateTimeStringSchema
|
|
79
|
+
});
|
|
80
|
+
var ReadyStateChangedSchema = z.object({
|
|
81
|
+
readyCount: z.number().int().min(0),
|
|
82
|
+
participantCount: z.number().int().min(0)
|
|
83
|
+
});
|
|
84
|
+
var FinalStateSchema = z.object({
|
|
85
|
+
location: LocationCandidateSchema.optional(),
|
|
86
|
+
excludeMenu: z.array(MenuSchema).optional(),
|
|
87
|
+
menu: MenuSchema.optional(),
|
|
88
|
+
restaurant: RestaurantSchema.optional(),
|
|
89
|
+
time: z.string().optional(),
|
|
90
|
+
date: ISODateStringSchema.optional()
|
|
91
|
+
});
|
|
92
|
+
var RoomInitialStateSchema = z.object({
|
|
93
|
+
participants: z.array(ParticipantSchema),
|
|
94
|
+
chat: z.array(ChatMessageResponseSchema),
|
|
95
|
+
final: FinalStateSchema
|
|
96
|
+
});
|
|
97
|
+
var PhaseDataBroadcastSchema = z.object({
|
|
98
|
+
phase: z.union([RecruitRoomStageSchema, InvitationRoomStageSchema]),
|
|
99
|
+
data: z.unknown()
|
|
100
|
+
});
|
|
101
|
+
var TimePicksUpdateResponseSchema = z.array(
|
|
102
|
+
z.object({ memberId: MemberIdSchema, times: z.array(z.string()) })
|
|
103
|
+
);
|
|
104
|
+
var DatePicksUpdateResponseSchema = z.array(
|
|
105
|
+
z.object({ memberId: MemberIdSchema, dates: z.array(ISODateStringSchema) })
|
|
106
|
+
);
|
|
107
|
+
var LocationCandidateAddUpdateResponseSchema = z.array(
|
|
108
|
+
LocationCandidateSchema.extend({ authorMemberId: MemberIdSchema })
|
|
109
|
+
);
|
|
110
|
+
var LocationCandidateVoteUpdateResponseSchema = z.array(
|
|
111
|
+
z.object({ locationId: LocationIdSchema, votes: z.array(MemberIdSchema) })
|
|
112
|
+
);
|
|
113
|
+
var ExcludeMenuUpdateResponseSchema = z.array(
|
|
114
|
+
z.object({ memberId: MemberIdSchema, exclusions: z.array(MenuSchema) })
|
|
115
|
+
);
|
|
116
|
+
var MenuPickUpdateResponseSchema = z.array(
|
|
117
|
+
z.object({ menuCode: MenuCodeSchema, selectedMembers: z.array(MemberIdSchema) })
|
|
118
|
+
);
|
|
119
|
+
var RestaurantPickUpdateResponseSchema = z.array(
|
|
120
|
+
z.object({ restaurantId: RestaurantIdSchema, selectedMembers: z.array(MemberIdSchema) })
|
|
121
|
+
);
|
|
122
|
+
var RoomSocketClientEventSchemas = {
|
|
123
|
+
"ready-state": ReadyStateRequestSchema,
|
|
124
|
+
"chat-message": ChatMessageRequestSchema,
|
|
125
|
+
"add-location-candidate": AddLocationCandidateRequestSchema,
|
|
126
|
+
"vote-location": VoteLocationRequestSchema,
|
|
127
|
+
"exclude-menu": ExcludeMenuRequestSchema,
|
|
128
|
+
"pick-menu": PickMenuRequestSchema,
|
|
129
|
+
"pick-restaurant": PickRestaurantRequestSchema,
|
|
130
|
+
"pick-times": PickTimesRequestSchema,
|
|
131
|
+
"pick-date": PickDateRequestSchema
|
|
132
|
+
};
|
|
133
|
+
var RoomSocketServerEventSchemas = {
|
|
134
|
+
"room-assigned": RoomAssignedResponseSchema,
|
|
135
|
+
"stage-changed": PhaseDataBroadcastSchema,
|
|
136
|
+
"chat-message": ChatMessageResponseSchema,
|
|
137
|
+
"room-error": RoomSocketErrorSchema,
|
|
138
|
+
"ready-state-changed": ReadyStateChangedSchema,
|
|
139
|
+
"join-room": RoomInitialStateSchema,
|
|
140
|
+
"time-updated": TimePicksUpdateResponseSchema,
|
|
141
|
+
"date-updated": DatePicksUpdateResponseSchema,
|
|
142
|
+
"location-add-updated": LocationCandidateAddUpdateResponseSchema,
|
|
143
|
+
"location-vote-updated": LocationCandidateVoteUpdateResponseSchema,
|
|
144
|
+
"exclude-menu-updated": ExcludeMenuUpdateResponseSchema,
|
|
145
|
+
"menu-pick-updated": MenuPickUpdateResponseSchema,
|
|
146
|
+
"restaurant-pick-updated": RestaurantPickUpdateResponseSchema,
|
|
147
|
+
"final-state-response": FinalStateSchema
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export {
|
|
151
|
+
MenuCodeSchema,
|
|
152
|
+
LocationIdSchema,
|
|
153
|
+
MenuSchema,
|
|
154
|
+
LocationCandidateSchema,
|
|
155
|
+
ParticipantSchema,
|
|
156
|
+
RecruitRoomStageSchema,
|
|
157
|
+
InvitationRoomStageSchema,
|
|
158
|
+
ReadyStateRequestSchema,
|
|
159
|
+
ChatMessageRequestSchema,
|
|
160
|
+
AddLocationCandidateRequestSchema,
|
|
161
|
+
VoteLocationRequestSchema,
|
|
162
|
+
ExcludeMenuRequestSchema,
|
|
163
|
+
PickMenuRequestSchema,
|
|
164
|
+
PickRestaurantRequestSchema,
|
|
165
|
+
PickTimesRequestSchema,
|
|
166
|
+
PickDateRequestSchema,
|
|
167
|
+
RoomAssignedResponseSchema,
|
|
168
|
+
RoomSocketErrorSchema,
|
|
169
|
+
ChatMessageResponseSchema,
|
|
170
|
+
ReadyStateChangedSchema,
|
|
171
|
+
FinalStateSchema,
|
|
172
|
+
RoomInitialStateSchema,
|
|
173
|
+
PhaseDataBroadcastSchema,
|
|
174
|
+
TimePicksUpdateResponseSchema,
|
|
175
|
+
DatePicksUpdateResponseSchema,
|
|
176
|
+
LocationCandidateAddUpdateResponseSchema,
|
|
177
|
+
LocationCandidateVoteUpdateResponseSchema,
|
|
178
|
+
ExcludeMenuUpdateResponseSchema,
|
|
179
|
+
MenuPickUpdateResponseSchema,
|
|
180
|
+
RestaurantPickUpdateResponseSchema,
|
|
181
|
+
RoomSocketClientEventSchemas,
|
|
182
|
+
RoomSocketServerEventSchemas
|
|
183
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ISODateStringSchema
|
|
3
|
+
} from "./chunk-HRM3FQPL.js";
|
|
4
|
+
import {
|
|
5
|
+
MemberCoreSchema
|
|
6
|
+
} from "./chunk-ADIREWTX.js";
|
|
7
|
+
|
|
8
|
+
// src/domain/meal/meal.schema.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var MealStatusResponseSchema = z.object({
|
|
11
|
+
hungry: z.boolean(),
|
|
12
|
+
label: z.string(),
|
|
13
|
+
updatedAt: ISODateStringSchema,
|
|
14
|
+
secondsToAutoOff: z.number().int().min(0)
|
|
15
|
+
});
|
|
16
|
+
var MealStatusActionSchema = z.enum(["ARTICLE_UPLOAD", "SET_MANNUALY"]);
|
|
17
|
+
var UpdateMealStatusRequestSchema = z.object({
|
|
18
|
+
action: MealStatusActionSchema.optional().default("SET_MANNUALY")
|
|
19
|
+
});
|
|
20
|
+
var MealStatusSchema = z.enum(["ALL", "HUNGRY", "NOT_HUNGRY"]);
|
|
21
|
+
var FriendMealQuerySchema = z.object({
|
|
22
|
+
status: MealStatusSchema.optional().default("ALL")
|
|
23
|
+
});
|
|
24
|
+
var FriendMealItemResponseSchema = MemberCoreSchema.extend({
|
|
25
|
+
hungry: z.boolean(),
|
|
26
|
+
label: z.string(),
|
|
27
|
+
updatedAt: ISODateStringSchema
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
MealStatusResponseSchema,
|
|
32
|
+
MealStatusActionSchema,
|
|
33
|
+
UpdateMealStatusRequestSchema,
|
|
34
|
+
MealStatusSchema,
|
|
35
|
+
FriendMealQuerySchema,
|
|
36
|
+
FriendMealItemResponseSchema
|
|
37
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ISODateStringSchema,
|
|
3
|
+
ISODateTimeStringSchema
|
|
4
|
+
} from "./chunk-HRM3FQPL.js";
|
|
5
|
+
import {
|
|
6
|
+
CouponIdSchema,
|
|
7
|
+
MemberIdSchema,
|
|
8
|
+
ReferralCodeSchema
|
|
9
|
+
} from "./chunk-4XAGRJUM.js";
|
|
10
|
+
|
|
11
|
+
// src/domain/promotion/referral.schema.ts
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
var ReferralCreateResponseSchema = z.object({
|
|
14
|
+
code: ReferralCodeSchema,
|
|
15
|
+
link: z.string().url(),
|
|
16
|
+
expiresAt: ISODateTimeStringSchema
|
|
17
|
+
});
|
|
18
|
+
var ReferralItemResponseSchema = z.object({
|
|
19
|
+
code: ReferralCodeSchema,
|
|
20
|
+
createdAt: ISODateTimeStringSchema,
|
|
21
|
+
expiresAt: ISODateTimeStringSchema,
|
|
22
|
+
used: z.boolean(),
|
|
23
|
+
usedByMemberId: MemberIdSchema.nullable(),
|
|
24
|
+
usedByUsername: z.string().nullable()
|
|
25
|
+
});
|
|
26
|
+
var RedeemReferralRequestSchema = z.object({
|
|
27
|
+
code: ReferralCodeSchema
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// src/domain/promotion/coupon.schema.ts
|
|
31
|
+
import { z as z2 } from "zod";
|
|
32
|
+
var CouponTypeSchema = z2.enum(["DISCOUNT", "SERVICE"]);
|
|
33
|
+
var CouponStatusSchema = z2.enum(["UNUSED", "USED"]);
|
|
34
|
+
var CouponResponseSchema = z2.object({
|
|
35
|
+
couponId: CouponIdSchema,
|
|
36
|
+
title: z2.string(),
|
|
37
|
+
shopName: z2.string(),
|
|
38
|
+
type: CouponTypeSchema,
|
|
39
|
+
condition: z2.string(),
|
|
40
|
+
expiresAt: ISODateStringSchema,
|
|
41
|
+
used: z2.boolean(),
|
|
42
|
+
thumbnailUrl: z2.string().url()
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// src/domain/promotion/challenge.schema.ts
|
|
46
|
+
import { z as z3 } from "zod";
|
|
47
|
+
var RewardTypeSchema = z3.enum(["WEEK", "MONTH"]);
|
|
48
|
+
var WeekProgressSchema = z3.object({
|
|
49
|
+
days: z3.array(z3.boolean()),
|
|
50
|
+
completed: z3.number().int().min(0),
|
|
51
|
+
goal: z3.number().int().positive()
|
|
52
|
+
});
|
|
53
|
+
var MonthProgressSchema = z3.object({
|
|
54
|
+
count: z3.number().int().min(0),
|
|
55
|
+
goal: z3.number().int().positive()
|
|
56
|
+
});
|
|
57
|
+
var ChallengeStatusResponseSchema = z3.object({
|
|
58
|
+
count: z3.number().int().min(0)
|
|
59
|
+
});
|
|
60
|
+
var ClaimChallengeRewardRequestSchema = z3.object({
|
|
61
|
+
type: RewardTypeSchema
|
|
62
|
+
});
|
|
63
|
+
var ClaimChallengeRewardResponseSchema = z3.object({
|
|
64
|
+
rewardType: RewardTypeSchema,
|
|
65
|
+
claimed: z3.boolean()
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
ChallengeStatusResponseSchema,
|
|
70
|
+
ClaimChallengeRewardRequestSchema,
|
|
71
|
+
ClaimChallengeRewardResponseSchema,
|
|
72
|
+
ReferralCreateResponseSchema,
|
|
73
|
+
ReferralItemResponseSchema,
|
|
74
|
+
RedeemReferralRequestSchema,
|
|
75
|
+
CouponTypeSchema,
|
|
76
|
+
CouponStatusSchema,
|
|
77
|
+
CouponResponseSchema
|
|
78
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PlanListQuerySchema,
|
|
3
|
+
PlanResponseSchema
|
|
4
|
+
} from "./chunk-M7HH7FMO.js";
|
|
5
|
+
import {
|
|
6
|
+
ChallengeStatusResponseSchema,
|
|
7
|
+
ClaimChallengeRewardRequestSchema,
|
|
8
|
+
CouponResponseSchema,
|
|
9
|
+
RedeemReferralRequestSchema,
|
|
10
|
+
ReferralCreateResponseSchema,
|
|
11
|
+
ReferralItemResponseSchema
|
|
12
|
+
} from "./chunk-RHQHBUO4.js";
|
|
13
|
+
import {
|
|
14
|
+
ArticleDetailResponseSchema,
|
|
15
|
+
ArticleListQuerySchema,
|
|
16
|
+
CreateArticleRequestSchema,
|
|
17
|
+
CreateCommentRequestSchema,
|
|
18
|
+
PageArticleSummaryResponseSchema,
|
|
19
|
+
PageQuerySchema,
|
|
20
|
+
PresignArticleResponseSchema,
|
|
21
|
+
SortDirectionSchema
|
|
22
|
+
} from "./chunk-XWTMYXPO.js";
|
|
23
|
+
import {
|
|
24
|
+
LoginRequestSchema,
|
|
25
|
+
SignupRequestSchema,
|
|
26
|
+
SignupResponseSchema,
|
|
27
|
+
TokenResponseSchema
|
|
28
|
+
} from "./chunk-JNJRBUKR.js";
|
|
29
|
+
import {
|
|
30
|
+
FriendBlockItemResponseSchema,
|
|
31
|
+
FriendListItemResponseSchema,
|
|
32
|
+
FriendRequestItemResponseSchema
|
|
33
|
+
} from "./chunk-YJ7RUOEJ.js";
|
|
34
|
+
import {
|
|
35
|
+
AcceptInvitationResponseSchema,
|
|
36
|
+
CreateInvitationRequestSchema,
|
|
37
|
+
InvitationListItemResponseSchema,
|
|
38
|
+
SendInvitationResponseSchema
|
|
39
|
+
} from "./chunk-5QLCZOPJ.js";
|
|
40
|
+
import {
|
|
41
|
+
FriendMealItemResponseSchema,
|
|
42
|
+
FriendMealQuerySchema,
|
|
43
|
+
MealStatusResponseSchema,
|
|
44
|
+
UpdateMealStatusRequestSchema
|
|
45
|
+
} from "./chunk-O56CI56W.js";
|
|
46
|
+
import {
|
|
47
|
+
ISODateTimeStringSchema
|
|
48
|
+
} from "./chunk-HRM3FQPL.js";
|
|
49
|
+
import {
|
|
50
|
+
CreateProfileRequestSchema,
|
|
51
|
+
MemberCoreSchema,
|
|
52
|
+
MemberResponseSchema,
|
|
53
|
+
MemberSearchQuerySchema,
|
|
54
|
+
MemberSerachResponseSchema,
|
|
55
|
+
PresignProfileResponseSchema,
|
|
56
|
+
ProfileDetailResponseSchema,
|
|
57
|
+
UpdatePreferenceRequestSchema,
|
|
58
|
+
UpdateProfileRequestSchema
|
|
59
|
+
} from "./chunk-ADIREWTX.js";
|
|
60
|
+
import {
|
|
61
|
+
ArticleIdSchema,
|
|
62
|
+
CommentIdSchema,
|
|
63
|
+
CouponIdSchema,
|
|
64
|
+
FriendRequestIdSchema,
|
|
65
|
+
InvitationIdSchema,
|
|
66
|
+
MemberIdSchema,
|
|
67
|
+
PlanIdSchema,
|
|
68
|
+
RecruitIdSchema,
|
|
69
|
+
RestaurantIdSchema,
|
|
70
|
+
RoomIdSchema,
|
|
71
|
+
SubscriptionIdSchema
|
|
72
|
+
} from "./chunk-4XAGRJUM.js";
|
|
73
|
+
|
|
74
|
+
// src/domain/recruit/recruit.schema.ts
|
|
75
|
+
import { z as z4 } from "zod";
|
|
76
|
+
|
|
77
|
+
// src/domain/common/contracts/api.ts
|
|
78
|
+
import { z as z2 } from "zod";
|
|
79
|
+
|
|
80
|
+
// src/domain/common/contracts/endpoint.ts
|
|
81
|
+
import { z } from "zod";
|
|
82
|
+
var NoBodySchema = z.undefined();
|
|
83
|
+
var NoQuerySchema = z.undefined();
|
|
84
|
+
var NoParamsSchema = z.undefined();
|
|
85
|
+
var endpoint = (contract) => ({
|
|
86
|
+
method: contract.method,
|
|
87
|
+
path: contract.path,
|
|
88
|
+
pathParams: contract.pathParams ?? NoParamsSchema,
|
|
89
|
+
query: contract.query ?? NoQuerySchema,
|
|
90
|
+
body: contract.body ?? NoBodySchema,
|
|
91
|
+
response: contract.response
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// src/domain/common/contracts/api.ts
|
|
95
|
+
var memberIdParam = z2.object({ memberId: MemberIdSchema });
|
|
96
|
+
var authorIdParam = z2.object({ memberId: MemberIdSchema });
|
|
97
|
+
var articleIdParam = z2.object({ articleId: ArticleIdSchema });
|
|
98
|
+
var commentIdParam = z2.object({ commentId: CommentIdSchema });
|
|
99
|
+
var recruitIdParam = z2.object({ recruitId: RecruitIdSchema });
|
|
100
|
+
var invitationIdParam = z2.object({ invitationId: InvitationIdSchema });
|
|
101
|
+
var planIdParam = z2.object({ planId: PlanIdSchema });
|
|
102
|
+
var couponIdParam = z2.object({ couponId: CouponIdSchema });
|
|
103
|
+
var friendRequestIdParam = z2.object({ requestId: FriendRequestIdSchema });
|
|
104
|
+
var apiContract = {
|
|
105
|
+
auth: {
|
|
106
|
+
signup: endpoint({ method: "POST", path: "/auth/signup", body: SignupRequestSchema, response: SignupResponseSchema }),
|
|
107
|
+
login: endpoint({ method: "POST", path: "/auth/login", body: LoginRequestSchema, response: TokenResponseSchema }),
|
|
108
|
+
refresh: endpoint({ method: "POST", path: "/auth/refresh", response: TokenResponseSchema }),
|
|
109
|
+
logout: endpoint({ method: "POST", path: "/auth/logout", response: NoContentSchema })
|
|
110
|
+
// test: endpoint({method: "GET", path: "/auth/test", response: TokenResponseSchema}) TODO: Dev에서만 작동하도록 백엔드에서 수정해야함
|
|
111
|
+
},
|
|
112
|
+
members: {
|
|
113
|
+
me: endpoint({ method: "GET", path: "/members/me", response: MemberResponseSchema }),
|
|
114
|
+
myProfile: endpoint({ method: "GET", path: "/members/me/detail", response: ProfileDetailResponseSchema }),
|
|
115
|
+
search: endpoint({ method: "GET", path: "/members/search", query: MemberSearchQuerySchema, response: MemberSerachResponseSchema }),
|
|
116
|
+
memberProfile: endpoint({ method: "GET", path: "/members/:memberId", pathParams: memberIdParam, response: ProfileDetailResponseSchema }),
|
|
117
|
+
presignProfileImage: endpoint({ method: "POST", path: "/uploads/presign-profile", response: PresignProfileResponseSchema }),
|
|
118
|
+
createProfile: endpoint({ method: "POST", path: "/members/onboarding", body: CreateProfileRequestSchema, response: NoContentSchema }),
|
|
119
|
+
updateProfile: endpoint({ method: "PATCH", path: "/members/me/profile", body: UpdateProfileRequestSchema, response: NoContentSchema }),
|
|
120
|
+
updatePreferences: endpoint({ method: "PATCH", path: "/members/me/preferences", body: UpdatePreferenceRequestSchema, response: NoContentSchema })
|
|
121
|
+
},
|
|
122
|
+
mealStatus: {
|
|
123
|
+
my: endpoint({ method: "GET", path: "/meal-status", response: MealStatusResponseSchema }),
|
|
124
|
+
updateMealStatus: endpoint({ method: "PATCH", path: "/meal-status", body: UpdateMealStatusRequestSchema, response: NoContentSchema }),
|
|
125
|
+
friendMealStatus: endpoint({ method: "GET", path: "/meal-status/friend", query: FriendMealQuerySchema, response: z2.array(FriendMealItemResponseSchema) })
|
|
126
|
+
},
|
|
127
|
+
articles: {
|
|
128
|
+
list: endpoint({ method: "GET", path: "/articles/home", query: ArticleListQuerySchema, response: PageArticleSummaryResponseSchema }),
|
|
129
|
+
byAuthor: endpoint({ method: "GET", path: "/articles/by-author/:authorId", pathParams: authorIdParam, response: PageArticleSummaryResponseSchema }),
|
|
130
|
+
my: endpoint({ method: "GET", path: "/articles/my", response: PageArticleSummaryResponseSchema }),
|
|
131
|
+
detail: endpoint({ method: "GET", path: "/articles/:articleId", pathParams: articleIdParam, response: ArticleDetailResponseSchema }),
|
|
132
|
+
create: endpoint({ method: "POST", path: "/articles", body: CreateArticleRequestSchema, response: NoContentSchema }),
|
|
133
|
+
createComment: endpoint({ method: "POST", path: "/articles/:articleId/comments", pathParams: articleIdParam, body: CreateCommentRequestSchema, response: NoContentSchema }),
|
|
134
|
+
presignArticleImage: endpoint({ method: "POST", path: "/uploads/presign-article", response: PresignArticleResponseSchema }),
|
|
135
|
+
delete: endpoint({ method: "DELETE", path: "/articles/:articleId", pathParams: articleIdParam, response: NoContentSchema }),
|
|
136
|
+
deleteComment: endpoint({ method: "DELETE", path: "/articles/:articleId/comments/:commentId", pathParams: articleIdParam.merge(commentIdParam), response: NoContentSchema })
|
|
137
|
+
// TODO: 게시물 수정 기능
|
|
138
|
+
},
|
|
139
|
+
recruits: {
|
|
140
|
+
list: endpoint({ method: "GET", path: "/recruits", query: RecruitListQuerySchema, response: RecruitListResponseSchema }),
|
|
141
|
+
create: endpoint({ method: "POST", path: "/recruits", body: CreateRecruitRequestSchema, response: CreateRecruitResponseSchema }),
|
|
142
|
+
join: endpoint({ method: "POST", path: "/recruits/:recruitId/join", pathParams: recruitIdParam, response: NoContentSchema }),
|
|
143
|
+
close: endpoint({ method: "PATCH", path: "/recruits/:recruitId/close", pathParams: recruitIdParam, response: NoContentSchema })
|
|
144
|
+
},
|
|
145
|
+
invitations: {
|
|
146
|
+
list: endpoint({ method: "GET", path: "/invitations", response: z2.array(InvitationListItemResponseSchema) }),
|
|
147
|
+
// TODO: Invitation Response 정하기 detail: endpoint({ method: "GET", path: "/invitations/:invitationId", pathParams: invitationIdParam, response: InvitationItemDetailResponseSchema }),
|
|
148
|
+
send: endpoint({ method: "POST", path: "/invitations", body: CreateInvitationRequestSchema, response: SendInvitationResponseSchema }),
|
|
149
|
+
accept: endpoint({ method: "POST", path: "/invitations/:invitationId/accept", pathParams: invitationIdParam, response: AcceptInvitationResponseSchema }),
|
|
150
|
+
reject: endpoint({ method: "POST", path: "/invitations/:invitationId/reject", pathParams: invitationIdParam, response: NoContentSchema })
|
|
151
|
+
},
|
|
152
|
+
plans: {
|
|
153
|
+
list: endpoint({ method: "GET", path: "/plans", query: PlanListQuerySchema, response: z2.array(PlanResponseSchema) }),
|
|
154
|
+
detail: endpoint({ method: "GET", path: "/plans/:planId", pathParams: planIdParam, response: PlanResponseSchema }),
|
|
155
|
+
cancel: endpoint({ method: "PATCH", path: "/plans/:planId/cancel", pathParams: planIdParam, response: NoContentSchema })
|
|
156
|
+
},
|
|
157
|
+
friends: {
|
|
158
|
+
list: endpoint({ method: "GET", path: "/friends", response: z2.array(FriendListItemResponseSchema) }),
|
|
159
|
+
blockList: endpoint({ method: "GET", path: "/friends/blocks", response: z2.array(FriendBlockItemResponseSchema) }),
|
|
160
|
+
incomingRequest: endpoint({ method: "GET", path: "/friends/requests/incoming", response: z2.array(FriendRequestItemResponseSchema) }),
|
|
161
|
+
outgoingRequest: endpoint({ method: "GET", path: "/friends/requests/outgoint", response: z2.array(FriendRequestItemResponseSchema) }),
|
|
162
|
+
sendRequest: endpoint({ method: "POST", path: "/friends/requests/:memberId", pathParams: friendRequestIdParam, response: NoContentSchema }),
|
|
163
|
+
acceptRequest: endpoint({ method: "POST", path: "/friends/requests/:requestId/accept", pathParams: friendRequestIdParam, response: NoContentSchema }),
|
|
164
|
+
rejectRequest: endpoint({ method: "POST", path: "/friends/requests/:requestId/reject", pathParams: friendRequestIdParam, response: NoContentSchema }),
|
|
165
|
+
block: endpoint({ method: "POST", path: "/friends/blocks/:memberId", pathParams: memberIdParam, response: NoContentSchema }),
|
|
166
|
+
cancelRequest: endpoint({ method: "DELETE", path: "/friends/requests/:requestId", pathParams: friendRequestIdParam, response: NoContentSchema }),
|
|
167
|
+
unblock: endpoint({ method: "DELETE", path: "/friends/blocks/:memberId", pathParams: memberIdParam, response: NoContentSchema }),
|
|
168
|
+
unfriend: endpoint({ method: "DELETE", path: "/friends/:memberId", pathParams: memberIdParam, response: NoContentSchema })
|
|
169
|
+
},
|
|
170
|
+
coupons: {
|
|
171
|
+
list: endpoint({ method: "GET", path: "/coupons", response: z2.array(CouponResponseSchema) }),
|
|
172
|
+
use: endpoint({ method: "PATCH", path: "/coupons/:couponId/use", pathParams: couponIdParam, response: NoContentSchema })
|
|
173
|
+
},
|
|
174
|
+
challenges: {
|
|
175
|
+
status: endpoint({ method: "GET", path: "/challenges/status", response: ChallengeStatusResponseSchema }),
|
|
176
|
+
claimReward: endpoint({ method: "POST", path: "/challenges/rewards", body: ClaimChallengeRewardRequestSchema, response: NoContentSchema })
|
|
177
|
+
},
|
|
178
|
+
referrals: {
|
|
179
|
+
list: endpoint({ method: "GET", path: "/referrals", response: z2.array(ReferralItemResponseSchema) }),
|
|
180
|
+
create: endpoint({ method: "POST", path: "/referrals", response: ReferralCreateResponseSchema }),
|
|
181
|
+
redeem: endpoint({ method: "POST", path: "/referrals/redeem", body: RedeemReferralRequestSchema, response: NoContentSchema })
|
|
182
|
+
},
|
|
183
|
+
room: {
|
|
184
|
+
//TODO: 방 입장 기능
|
|
185
|
+
},
|
|
186
|
+
health: {
|
|
187
|
+
healthCheck: endpoint({ method: "GET", path: "/", response: z2.string() })
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/domain/common/schema/envelope.schema.ts
|
|
192
|
+
import { z as z3 } from "zod";
|
|
193
|
+
var NoContentSchema = z3.null();
|
|
194
|
+
var ApiSuccessSchema = (data) => z3.object({
|
|
195
|
+
success: z3.literal(true),
|
|
196
|
+
code: z3.number().int(),
|
|
197
|
+
message: z3.string(),
|
|
198
|
+
data
|
|
199
|
+
});
|
|
200
|
+
var ApiFailureSchema = z3.object({
|
|
201
|
+
success: z3.literal(false),
|
|
202
|
+
status: z3.number().int(),
|
|
203
|
+
code: z3.string(),
|
|
204
|
+
message: z3.string()
|
|
205
|
+
});
|
|
206
|
+
var ApiResponseSchema = (data) => z3.union([ApiSuccessSchema(data), ApiFailureSchema]);
|
|
207
|
+
var CreatedEntityIdResponseSchema = z3.discriminatedUnion("entity", [
|
|
208
|
+
z3.object({ entity: z3.literal("article"), id: ArticleIdSchema }),
|
|
209
|
+
z3.object({ entity: z3.literal("comment"), id: CommentIdSchema }),
|
|
210
|
+
z3.object({ entity: z3.literal("recruit"), id: RecruitIdSchema }),
|
|
211
|
+
z3.object({ entity: z3.literal("invitation"), id: InvitationIdSchema }),
|
|
212
|
+
z3.object({ entity: z3.literal("subscription"), id: SubscriptionIdSchema }),
|
|
213
|
+
z3.object({ entity: z3.literal("coupon"), id: CouponIdSchema }),
|
|
214
|
+
z3.object({ entity: z3.literal("plan"), id: PlanIdSchema })
|
|
215
|
+
]);
|
|
216
|
+
|
|
217
|
+
// src/domain/common/contracts/envelope.ts
|
|
218
|
+
var makeApiResponseSchema = ApiResponseSchema;
|
|
219
|
+
var makeApiSuccessSchema = ApiSuccessSchema;
|
|
220
|
+
|
|
221
|
+
// src/domain/common/contracts/id.ts
|
|
222
|
+
var toMemberId = (value) => MemberIdSchema.parse(value);
|
|
223
|
+
var toArticleId = (value) => ArticleIdSchema.parse(value);
|
|
224
|
+
var toRecruitId = (value) => RecruitIdSchema.parse(value);
|
|
225
|
+
var toInvitationId = (value) => InvitationIdSchema.parse(value);
|
|
226
|
+
var toRoomId = (value) => RoomIdSchema.parse(value);
|
|
227
|
+
var toRestaurantId = (value) => RestaurantIdSchema.parse(value);
|
|
228
|
+
|
|
229
|
+
// src/domain/recruit/recruit.schema.ts
|
|
230
|
+
var RecruitStatusSchema = z4.enum(["OPEN", "CLOSED", "EXPIRED"]);
|
|
231
|
+
var RecruitParticipantSchema = MemberCoreSchema.extend({});
|
|
232
|
+
var RecruitSortBySchema = z4.enum(["createdAt", "deadline", "participantCount"]);
|
|
233
|
+
var RecruitListQuerySchema = PageQuerySchema.extend({
|
|
234
|
+
sortBy: RecruitSortBySchema.default("createdAt"),
|
|
235
|
+
direction: SortDirectionSchema.default("desc")
|
|
236
|
+
});
|
|
237
|
+
var RecruitResponseSchema = z4.object({
|
|
238
|
+
targetCount: z4.number().int().min(2),
|
|
239
|
+
meetingAt: ISODateTimeStringSchema,
|
|
240
|
+
location: z4.string().min(1),
|
|
241
|
+
message: z4.string().max(500),
|
|
242
|
+
recruitId: RecruitIdSchema,
|
|
243
|
+
status: RecruitStatusSchema,
|
|
244
|
+
createdAt: ISODateTimeStringSchema,
|
|
245
|
+
expiredAt: ISODateTimeStringSchema,
|
|
246
|
+
updatedAt: ISODateTimeStringSchema,
|
|
247
|
+
author: MemberCoreSchema,
|
|
248
|
+
participants: z4.array(RecruitParticipantSchema)
|
|
249
|
+
});
|
|
250
|
+
var RecruitListResponseSchema = z4.array(RecruitResponseSchema);
|
|
251
|
+
var CreateRecruitRequestSchema = z4.object({
|
|
252
|
+
targetCount: z4.number().int().min(2),
|
|
253
|
+
meetingAt: ISODateTimeStringSchema,
|
|
254
|
+
location: z4.string().min(1),
|
|
255
|
+
message: z4.string().max(500)
|
|
256
|
+
});
|
|
257
|
+
var CreateRecruitResponseSchema = z4.object({
|
|
258
|
+
recruitId: RecruitIdSchema
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
export {
|
|
262
|
+
RecruitStatusSchema,
|
|
263
|
+
RecruitSortBySchema,
|
|
264
|
+
RecruitListQuerySchema,
|
|
265
|
+
RecruitListResponseSchema,
|
|
266
|
+
CreateRecruitRequestSchema,
|
|
267
|
+
CreateRecruitResponseSchema,
|
|
268
|
+
NoBodySchema,
|
|
269
|
+
NoQuerySchema,
|
|
270
|
+
NoParamsSchema,
|
|
271
|
+
endpoint,
|
|
272
|
+
apiContract,
|
|
273
|
+
NoContentSchema,
|
|
274
|
+
ApiSuccessSchema,
|
|
275
|
+
ApiFailureSchema,
|
|
276
|
+
ApiResponseSchema,
|
|
277
|
+
CreatedEntityIdResponseSchema,
|
|
278
|
+
makeApiResponseSchema,
|
|
279
|
+
makeApiSuccessSchema,
|
|
280
|
+
toMemberId,
|
|
281
|
+
toArticleId,
|
|
282
|
+
toRecruitId,
|
|
283
|
+
toInvitationId,
|
|
284
|
+
toRoomId,
|
|
285
|
+
toRestaurantId
|
|
286
|
+
};
|