@kimdaegyu/babmukdang-shared 1.1.0 → 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-UFVPFUMI.js → chunk-4XAGRJUM.js} +27 -1
- package/dist/chunk-5QLCZOPJ.js +34 -0
- package/dist/{chunk-2GRWCRTV.js → chunk-AATETFLU.js} +93 -109
- package/dist/chunk-ADIREWTX.js +72 -0
- package/dist/{chunk-NW5O4R7M.js → chunk-ET2Z5ZYA.js} +2 -2
- package/dist/{chunk-FCE6KXNO.js → chunk-JNJRBUKR.js} +4 -4
- package/dist/{chunk-ZNAAA53X.js → chunk-M7HH7FMO.js} +14 -19
- package/dist/{chunk-EJKRR2MZ.js → chunk-NAPCX4Q6.js} +14 -15
- package/dist/chunk-O56CI56W.js +37 -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 +137 -144
- package/dist/domain/article/index.d.cts +208 -282
- package/dist/domain/article/index.d.ts +208 -282
- package/dist/domain/article/index.js +16 -18
- package/dist/domain/auth/index.cjs +51 -45
- package/dist/domain/auth/index.d.cts +7 -8
- package/dist/domain/auth/index.d.ts +7 -8
- package/dist/domain/auth/index.js +3 -6
- package/dist/domain/common/index.cjs +410 -423
- package/dist/domain/common/index.d.cts +1224 -1111
- package/dist/domain/common/index.d.ts +1224 -1111
- package/dist/domain/common/index.js +35 -36
- package/dist/domain/friend/index.cjs +66 -70
- package/dist/domain/friend/index.d.cts +32 -63
- package/dist/domain/friend/index.d.ts +32 -63
- package/dist/domain/friend/index.js +3 -11
- package/dist/domain/index.cjs +449 -472
- package/dist/domain/index.d.cts +11 -14
- package/dist/domain/index.d.ts +11 -14
- package/dist/domain/index.js +94 -120
- package/dist/domain/invitation/index.cjs +19 -41
- package/dist/domain/invitation/index.d.cts +3 -6
- package/dist/domain/invitation/index.d.ts +3 -6
- package/dist/domain/invitation/index.js +4 -8
- package/dist/domain/meal/index.cjs +108 -13
- package/dist/domain/meal/index.d.cts +51 -23
- package/dist/domain/meal/index.d.ts +51 -23
- package/dist/domain/meal/index.js +8 -3
- package/dist/domain/member/index.cjs +63 -54
- package/dist/domain/member/index.d.cts +233 -126
- package/dist/domain/member/index.d.ts +233 -126
- package/dist/domain/member/index.js +17 -17
- package/dist/domain/plan/index.cjs +145 -136
- package/dist/domain/plan/index.d.cts +22 -33
- package/dist/domain/plan/index.d.ts +22 -33
- package/dist/domain/plan/index.js +8 -9
- package/dist/domain/{referral → promotion}/index.cjs +62 -6
- 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 +104 -61
- package/dist/domain/recruit/index.d.cts +56 -56
- package/dist/domain/recruit/index.d.ts +56 -56
- package/dist/domain/recruit/index.js +21 -11
- package/dist/domain/restaurant/index.cjs +8 -2
- package/dist/domain/restaurant/index.d.cts +1 -4
- package/dist/domain/restaurant/index.d.ts +1 -4
- package/dist/domain/restaurant/index.js +2 -3
- package/dist/domain/room/index.cjs +134 -122
- package/dist/domain/room/index.d.cts +144 -144
- package/dist/domain/room/index.d.ts +144 -144
- package/dist/domain/room/index.js +5 -5
- package/dist/{id-B-8M90Ef.d.cts → id-_a-oManb.d.cts} +16 -1
- package/dist/{id-B-8M90Ef.d.ts → id-_a-oManb.d.ts} +16 -1
- package/dist/index-CqcSqpDV.d.ts +286 -0
- package/dist/index-HEHaDbrV.d.cts +286 -0
- package/dist/index.cjs +423 -443
- package/dist/index.d.cts +27 -79
- package/dist/index.d.ts +27 -79
- package/dist/index.js +15 -38
- package/package.json +9 -4
- package/dist/chunk-2SJCUQNN.js +0 -40
- package/dist/chunk-35QGRA2X.js +0 -0
- package/dist/chunk-3YMV26OY.js +0 -0
- package/dist/chunk-4DAOP35P.js +0 -74
- package/dist/chunk-6NZPEF4K.js +0 -34
- package/dist/chunk-7MGHUZXI.js +0 -25
- package/dist/chunk-BVTYAILQ.js +0 -0
- package/dist/chunk-F24BT6H4.js +0 -23
- package/dist/chunk-IJMADVK5.js +0 -27
- package/dist/chunk-IYCA6KHR.js +0 -0
- package/dist/chunk-JCN37ARR.js +0 -52
- package/dist/chunk-JXYRJKRV.js +0 -0
- package/dist/chunk-LCMNVWSP.js +0 -0
- package/dist/chunk-MP7TEKEI.js +0 -72
- package/dist/chunk-O6DYRCFN.js +0 -0
- package/dist/chunk-PDGMGLYH.js +0 -0
- package/dist/chunk-TA4BB3UC.js +0 -0
- package/dist/chunk-UN7KYFMV.js +0 -0
- package/dist/chunk-UXA4FHST.js +0 -19
- package/dist/chunk-WNY6POLW.js +0 -0
- package/dist/chunk-YVACD5IG.js +0 -127
- package/dist/chunk-Z2UFF3MA.js +0 -212
- package/dist/chunk-ZSZ3ETY7.js +0 -32
- package/dist/domain/challenge/index.cjs +0 -65
- package/dist/domain/challenge/index.d.cts +0 -104
- package/dist/domain/challenge/index.d.ts +0 -104
- package/dist/domain/challenge/index.js +0 -18
- package/dist/domain/coupon/index.cjs +0 -74
- package/dist/domain/coupon/index.d.cts +0 -38
- package/dist/domain/coupon/index.d.ts +0 -38
- package/dist/domain/coupon/index.js +0 -14
- package/dist/domain/preference/index.cjs +0 -69
- package/dist/domain/preference/index.d.cts +0 -31
- package/dist/domain/preference/index.d.ts +0 -31
- package/dist/domain/preference/index.js +0 -12
- package/dist/domain/referral/index.d.cts +0 -51
- package/dist/domain/referral/index.d.ts +0 -51
- package/dist/domain/referral/index.js +0 -14
- package/dist/index-BuInbhtG.d.cts +0 -305
- package/dist/index-CKRUOupn.d.ts +0 -305
- /package/dist/{chunk-34EKPNPX.js → chunk-NJTV6DRT.js} +0 -0
|
@@ -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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
PresignUploadResponseSchema
|
|
11
|
+
} from "./chunk-ADIREWTX.js";
|
|
12
|
+
import {
|
|
13
|
+
ArticleIdSchema,
|
|
14
|
+
CommentIdSchema,
|
|
15
|
+
FoodSchema,
|
|
16
|
+
MemberIdSchema
|
|
17
|
+
} from "./chunk-4XAGRJUM.js";
|
|
18
|
+
|
|
19
|
+
// src/domain/article/article.schema.ts
|
|
20
|
+
import { z as z2 } from "zod";
|
|
21
|
+
|
|
22
|
+
// src/domain/common/schema/pagination.schema.ts
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
var PageQuerySchema = z.object({
|
|
25
|
+
page: z.number().int().min(0).optional().default(0),
|
|
26
|
+
size: z.number().int().min(1).max(100).optional().default(20)
|
|
27
|
+
});
|
|
28
|
+
var PageMetaSchema = z.object({
|
|
29
|
+
page: z.number().int().min(0),
|
|
30
|
+
size: z.number().int().min(1),
|
|
31
|
+
totalItems: z.number().int().min(0),
|
|
32
|
+
totalPages: z.number().int().min(0),
|
|
33
|
+
hasNext: z.boolean(),
|
|
34
|
+
hasPrevious: z.boolean()
|
|
35
|
+
});
|
|
36
|
+
var PageResponseSchema = (item) => z.object({
|
|
37
|
+
items: z.array(item),
|
|
38
|
+
meta: PageMetaSchema
|
|
39
|
+
});
|
|
40
|
+
var SortDirectionSchema = z.enum(["asc", "desc"]);
|
|
41
|
+
|
|
42
|
+
// src/domain/article/article.schema.ts
|
|
43
|
+
var ArticleSortBySchema = z2.enum(["createdAt", "likeCount", "commentCount"]);
|
|
44
|
+
var ArticleListQuerySchema = PageQuerySchema.extend({
|
|
45
|
+
sortBy: ArticleSortBySchema.optional().default("createdAt"),
|
|
46
|
+
direction: SortDirectionSchema.optional().default("desc")
|
|
47
|
+
});
|
|
48
|
+
var PresignArticleResponseSchema = PresignUploadResponseSchema.extend({});
|
|
49
|
+
var FoodAnalysisResultSchema = FoodSchema.extend({
|
|
50
|
+
confidence: z2.number().min(0).max(1),
|
|
51
|
+
tsUtc: ISODateTimeStringSchema.optional()
|
|
52
|
+
});
|
|
53
|
+
var CreateArticleRequestSchema = z2.object({
|
|
54
|
+
imageUrl: z2.string().url(),
|
|
55
|
+
mealDate: ISODateStringSchema,
|
|
56
|
+
restaurant: RestaurantSchema,
|
|
57
|
+
taggedMemberIds: z2.array(MemberIdSchema).default([]),
|
|
58
|
+
foodAnalysis: FoodAnalysisResultSchema.optional()
|
|
59
|
+
});
|
|
60
|
+
var CreateCommentRequestSchema = z2.object({
|
|
61
|
+
content: z2.string().min(1).max(500),
|
|
62
|
+
parentCommentId: CommentIdSchema.nullish()
|
|
63
|
+
});
|
|
64
|
+
var ArticleCommentSchema = z2.object({
|
|
65
|
+
commentId: CommentIdSchema,
|
|
66
|
+
author: MemberCoreSchema,
|
|
67
|
+
parentCommentId: CommentIdSchema.nullable(),
|
|
68
|
+
content: z2.string(),
|
|
69
|
+
createdAt: ISODateTimeStringSchema,
|
|
70
|
+
updatedAt: ISODateTimeStringSchema
|
|
71
|
+
});
|
|
72
|
+
var ArticleCoreSchema = z2.object({
|
|
73
|
+
articleId: ArticleIdSchema,
|
|
74
|
+
author: MemberCoreSchema,
|
|
75
|
+
imageUrl: z2.string().url(),
|
|
76
|
+
mealDate: ISODateStringSchema,
|
|
77
|
+
restaurant: RestaurantSchema,
|
|
78
|
+
createdAt: ISODateTimeStringSchema,
|
|
79
|
+
updatedAt: ISODateTimeStringSchema,
|
|
80
|
+
expiresAt: ISODateTimeStringSchema,
|
|
81
|
+
taggedMembers: z2.array(MemberCoreSchema)
|
|
82
|
+
});
|
|
83
|
+
var ArticleSummaryResponseSchema = ArticleCoreSchema.extend({
|
|
84
|
+
likeCount: z2.number().int().min(0),
|
|
85
|
+
commentCount: z2.number().int().min(0),
|
|
86
|
+
likedByMe: z2.boolean()
|
|
87
|
+
});
|
|
88
|
+
var ArticleDetailResponseSchema = ArticleSummaryResponseSchema.extend({
|
|
89
|
+
comments: z2.array(ArticleCommentSchema).optional()
|
|
90
|
+
});
|
|
91
|
+
var PageArticleSummaryResponseSchema = PageResponseSchema(ArticleSummaryResponseSchema);
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
PageQuerySchema,
|
|
95
|
+
PageMetaSchema,
|
|
96
|
+
PageResponseSchema,
|
|
97
|
+
SortDirectionSchema,
|
|
98
|
+
ArticleSortBySchema,
|
|
99
|
+
ArticleListQuerySchema,
|
|
100
|
+
PresignArticleResponseSchema,
|
|
101
|
+
FoodAnalysisResultSchema,
|
|
102
|
+
CreateArticleRequestSchema,
|
|
103
|
+
CreateCommentRequestSchema,
|
|
104
|
+
ArticleCommentSchema,
|
|
105
|
+
ArticleCoreSchema,
|
|
106
|
+
ArticleSummaryResponseSchema,
|
|
107
|
+
ArticleDetailResponseSchema,
|
|
108
|
+
PageArticleSummaryResponseSchema
|
|
109
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ISODateTimeStringSchema
|
|
3
|
+
} from "./chunk-HRM3FQPL.js";
|
|
4
|
+
import {
|
|
5
|
+
MemberCoreSchema
|
|
6
|
+
} from "./chunk-ADIREWTX.js";
|
|
7
|
+
import {
|
|
8
|
+
FriendRequestIdSchema
|
|
9
|
+
} from "./chunk-4XAGRJUM.js";
|
|
10
|
+
|
|
11
|
+
// src/domain/friend/friend.schema.ts
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
var FriendRequestStatusSchema = z.enum(["PENDING", "ACCEPTED", "REJECTED", "CANCELED"]);
|
|
14
|
+
var FriendListItemResponseSchema = MemberCoreSchema.extend({
|
|
15
|
+
friendSince: ISODateTimeStringSchema
|
|
16
|
+
});
|
|
17
|
+
var FriendBlockItemResponseSchema = MemberCoreSchema.extend({
|
|
18
|
+
blockedAt: ISODateTimeStringSchema
|
|
19
|
+
});
|
|
20
|
+
var FriendRequestMemberSchema = MemberCoreSchema;
|
|
21
|
+
var FriendRequestItemResponseSchema = z.object({
|
|
22
|
+
requestId: FriendRequestIdSchema,
|
|
23
|
+
requester: FriendRequestMemberSchema,
|
|
24
|
+
recipient: FriendRequestMemberSchema,
|
|
25
|
+
status: FriendRequestStatusSchema,
|
|
26
|
+
requestedAt: ISODateTimeStringSchema
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
FriendRequestStatusSchema,
|
|
31
|
+
FriendListItemResponseSchema,
|
|
32
|
+
FriendBlockItemResponseSchema,
|
|
33
|
+
FriendRequestMemberSchema,
|
|
34
|
+
FriendRequestItemResponseSchema
|
|
35
|
+
};
|