@kimdaegyu/babmukdang-shared 1.0.6 → 1.1.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/chunk-2GRWCRTV.js +328 -0
- package/dist/chunk-2SJCUQNN.js +40 -0
- package/dist/chunk-34EKPNPX.js +0 -0
- package/dist/chunk-35QGRA2X.js +0 -0
- package/dist/chunk-3YMV26OY.js +0 -0
- package/dist/chunk-4DAOP35P.js +74 -0
- package/dist/chunk-6NZPEF4K.js +34 -0
- package/dist/chunk-7MGHUZXI.js +25 -0
- package/dist/chunk-BVTYAILQ.js +0 -0
- package/dist/chunk-EJKRR2MZ.js +184 -0
- package/dist/chunk-F24BT6H4.js +23 -0
- package/dist/chunk-FCE6KXNO.js +30 -0
- package/dist/chunk-HRM3FQPL.js +12 -0
- package/dist/chunk-IJMADVK5.js +27 -0
- package/dist/chunk-IYCA6KHR.js +0 -0
- package/dist/chunk-JCN37ARR.js +52 -0
- package/dist/chunk-JXYRJKRV.js +0 -0
- package/dist/chunk-LCMNVWSP.js +0 -0
- package/dist/chunk-MP7TEKEI.js +72 -0
- package/dist/chunk-NCVWB52E.js +0 -0
- package/dist/chunk-NW5O4R7M.js +37 -0
- package/dist/chunk-O6DYRCFN.js +0 -0
- package/dist/chunk-PDGMGLYH.js +0 -0
- package/dist/chunk-PFSZSKD5.js +0 -0
- package/dist/chunk-TA4BB3UC.js +0 -0
- package/dist/chunk-UFVPFUMI.js +35 -0
- package/dist/chunk-UN7KYFMV.js +0 -0
- package/dist/chunk-UXA4FHST.js +19 -0
- package/dist/chunk-WNY6POLW.js +0 -0
- package/dist/chunk-YVACD5IG.js +127 -0
- package/dist/chunk-Z2UFF3MA.js +212 -0
- package/dist/chunk-ZNAAA53X.js +45 -0
- package/dist/chunk-ZSZ3ETY7.js +32 -0
- package/dist/domain/article/index.cjs +250 -0
- package/dist/domain/article/index.d.cts +1026 -0
- package/dist/domain/article/index.d.ts +1026 -0
- package/dist/domain/article/index.js +32 -0
- package/dist/domain/auth/index.cjs +135 -0
- package/dist/domain/auth/index.d.cts +73 -0
- package/dist/domain/auth/index.d.ts +73 -0
- package/dist/domain/auth/index.js +17 -0
- package/dist/domain/challenge/index.cjs +65 -0
- package/dist/domain/challenge/index.d.cts +104 -0
- package/dist/domain/challenge/index.d.ts +104 -0
- package/dist/domain/challenge/index.js +18 -0
- package/dist/domain/common/index.cjs +769 -0
- package/dist/domain/common/index.d.cts +2576 -0
- package/dist/domain/common/index.d.ts +2576 -0
- package/dist/domain/common/index.js +107 -0
- package/dist/domain/coupon/index.cjs +74 -0
- package/dist/domain/coupon/index.d.cts +38 -0
- package/dist/domain/coupon/index.d.ts +38 -0
- package/dist/domain/coupon/index.js +14 -0
- package/dist/domain/friend/index.cjs +152 -0
- package/dist/domain/friend/index.d.cts +148 -0
- package/dist/domain/friend/index.d.ts +148 -0
- package/dist/domain/friend/index.js +25 -0
- package/dist/domain/index.cjs +997 -0
- package/dist/domain/index.d.cts +17 -0
- package/dist/domain/index.d.ts +17 -0
- package/dist/domain/index.js +334 -0
- package/dist/domain/invitation/index.cjs +104 -0
- package/dist/domain/invitation/index.d.cts +67 -0
- package/dist/domain/invitation/index.d.ts +67 -0
- package/dist/domain/invitation/index.js +17 -0
- package/dist/domain/meal/index.cjs +59 -0
- package/dist/domain/meal/index.d.cts +38 -0
- package/dist/domain/meal/index.d.ts +38 -0
- package/dist/domain/meal/index.js +15 -0
- package/dist/domain/member/index.cjs +127 -0
- package/dist/domain/member/index.d.cts +225 -0
- package/dist/domain/member/index.d.ts +225 -0
- package/dist/domain/member/index.js +30 -0
- package/dist/domain/plan/index.cjs +269 -0
- package/dist/domain/plan/index.d.cts +189 -0
- package/dist/domain/plan/index.d.ts +189 -0
- package/dist/domain/plan/index.js +19 -0
- package/dist/domain/preference/index.cjs +69 -0
- package/dist/domain/preference/index.d.cts +31 -0
- package/dist/domain/preference/index.d.ts +31 -0
- package/dist/domain/preference/index.js +12 -0
- package/dist/domain/recruit/index.cjs +138 -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 +19 -0
- package/dist/domain/referral/index.cjs +78 -0
- package/dist/domain/referral/index.d.cts +51 -0
- package/dist/domain/referral/index.d.ts +51 -0
- package/dist/domain/referral/index.js +14 -0
- package/dist/domain/restaurant/index.cjs +79 -0
- package/dist/domain/restaurant/index.d.cts +85 -0
- package/dist/domain/restaurant/index.d.ts +85 -0
- package/dist/domain/restaurant/index.js +11 -0
- package/dist/domain/room/index.cjs +332 -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-B-8M90Ef.d.cts +43 -0
- package/dist/id-B-8M90Ef.d.ts +43 -0
- package/dist/index-BuInbhtG.d.cts +305 -0
- package/dist/index-CKRUOupn.d.ts +305 -0
- package/dist/index.cjs +845 -21
- package/dist/index.d.cts +113 -569
- package/dist/index.d.ts +113 -569
- package/dist/index.js +50 -30
- package/package.json +50 -39
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemberIdSchema
|
|
3
|
+
} from "./chunk-UFVPFUMI.js";
|
|
4
|
+
import {
|
|
5
|
+
ISODateTimeStringSchema
|
|
6
|
+
} from "./chunk-HRM3FQPL.js";
|
|
7
|
+
|
|
8
|
+
// src/domain/preference/schema/preference.schema.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var FoodPreferenceTypeSchema = z.enum(["LIKE", "DISLIKE", "ALLERGY"]);
|
|
11
|
+
var FoodPreferenceResponseSchema = z.object({
|
|
12
|
+
id: z.number().int().positive(),
|
|
13
|
+
memberId: MemberIdSchema,
|
|
14
|
+
foodCode: z.string(),
|
|
15
|
+
type: FoodPreferenceTypeSchema,
|
|
16
|
+
createdAt: ISODateTimeStringSchema,
|
|
17
|
+
updatedAt: ISODateTimeStringSchema
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
FoodPreferenceTypeSchema,
|
|
22
|
+
FoodPreferenceResponseSchema
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemberResponseSchema
|
|
3
|
+
} from "./chunk-MP7TEKEI.js";
|
|
4
|
+
|
|
5
|
+
// src/domain/auth/schema/auth.schema.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var TokenResponseSchema = z.object({
|
|
8
|
+
accessToken: z.string().min(1),
|
|
9
|
+
accessTokenMaxAge: z.number().int().positive()
|
|
10
|
+
});
|
|
11
|
+
var LoginRequestSchema = z.object({
|
|
12
|
+
email: z.string().email(),
|
|
13
|
+
password: z.string().min(1)
|
|
14
|
+
});
|
|
15
|
+
var SignupRequestSchema = z.object({
|
|
16
|
+
email: z.string().email(),
|
|
17
|
+
password: z.string().min(8),
|
|
18
|
+
username: z.string().min(1).max(50),
|
|
19
|
+
profileImageUrl: z.string().url().nullable().optional()
|
|
20
|
+
});
|
|
21
|
+
var SignupResponseSchema = z.object({
|
|
22
|
+
member: MemberResponseSchema
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
TokenResponseSchema,
|
|
27
|
+
LoginRequestSchema,
|
|
28
|
+
SignupRequestSchema,
|
|
29
|
+
SignupResponseSchema
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/domain/common/schema/date.schema.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var isoDateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
4
|
+
var ISODateStringSchema = z.string().regex(isoDateRegex, "Expected ISO date string in YYYY-MM-DD format");
|
|
5
|
+
var ISODateTimeStringSchema = z.string().datetime({ offset: true, message: "Expected ISO datetime string" });
|
|
6
|
+
var TimeHHmmStringSchema = z.string().regex(/^\d{2}:\d{2}$/, "Expected time string in HH:mm format");
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
ISODateStringSchema,
|
|
10
|
+
ISODateTimeStringSchema,
|
|
11
|
+
TimeHHmmStringSchema
|
|
12
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CouponIdSchema
|
|
3
|
+
} from "./chunk-UFVPFUMI.js";
|
|
4
|
+
import {
|
|
5
|
+
ISODateStringSchema
|
|
6
|
+
} from "./chunk-HRM3FQPL.js";
|
|
7
|
+
|
|
8
|
+
// src/domain/coupon/schema/coupon.schema.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var CouponTypeSchema = z.enum(["DISCOUNT", "SERVICE"]);
|
|
11
|
+
var CouponStatusSchema = z.enum(["UNUSED", "USED"]);
|
|
12
|
+
var CouponResponseSchema = z.object({
|
|
13
|
+
couponId: CouponIdSchema,
|
|
14
|
+
title: z.string(),
|
|
15
|
+
shopName: z.string(),
|
|
16
|
+
type: CouponTypeSchema,
|
|
17
|
+
condition: z.string(),
|
|
18
|
+
expiresAt: ISODateStringSchema,
|
|
19
|
+
used: z.boolean(),
|
|
20
|
+
thumbnailUrl: z.string().url()
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
CouponTypeSchema,
|
|
25
|
+
CouponStatusSchema,
|
|
26
|
+
CouponResponseSchema
|
|
27
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemberResponseSchema
|
|
3
|
+
} from "./chunk-MP7TEKEI.js";
|
|
4
|
+
import {
|
|
5
|
+
FriendRequestIdSchema,
|
|
6
|
+
MemberIdSchema
|
|
7
|
+
} from "./chunk-UFVPFUMI.js";
|
|
8
|
+
import {
|
|
9
|
+
ISODateTimeStringSchema
|
|
10
|
+
} from "./chunk-HRM3FQPL.js";
|
|
11
|
+
|
|
12
|
+
// src/domain/friend/schema/friend.schema.ts
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
var FriendMealFilterSchema = z.enum(["ALL", "HUNGRY", "NOT_HUNGRY"]);
|
|
15
|
+
var FriendRequestStatusSchema = z.enum([
|
|
16
|
+
"PENDING",
|
|
17
|
+
"ACCEPTED",
|
|
18
|
+
"REJECTED",
|
|
19
|
+
"CANCELED"
|
|
20
|
+
]);
|
|
21
|
+
var FriendMealItemResponseSchema = MemberResponseSchema.extend({
|
|
22
|
+
hungry: z.boolean(),
|
|
23
|
+
label: z.string()
|
|
24
|
+
});
|
|
25
|
+
var FriendListItemResponseSchema = MemberResponseSchema.extend({
|
|
26
|
+
friendSince: ISODateTimeStringSchema
|
|
27
|
+
});
|
|
28
|
+
var FriendBlockItemResponseSchema = MemberResponseSchema.extend({
|
|
29
|
+
blockedAt: ISODateTimeStringSchema
|
|
30
|
+
});
|
|
31
|
+
var FriendRequestMemberSchema = MemberResponseSchema;
|
|
32
|
+
var FriendRequestItemResponseSchema = z.object({
|
|
33
|
+
requestId: FriendRequestIdSchema,
|
|
34
|
+
requester: FriendRequestMemberSchema,
|
|
35
|
+
recipient: FriendRequestMemberSchema,
|
|
36
|
+
status: FriendRequestStatusSchema,
|
|
37
|
+
requestedAt: ISODateTimeStringSchema
|
|
38
|
+
});
|
|
39
|
+
var FriendActionRequestSchema = z.object({
|
|
40
|
+
memberId: MemberIdSchema
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
FriendMealFilterSchema,
|
|
45
|
+
FriendRequestStatusSchema,
|
|
46
|
+
FriendMealItemResponseSchema,
|
|
47
|
+
FriendListItemResponseSchema,
|
|
48
|
+
FriendBlockItemResponseSchema,
|
|
49
|
+
FriendRequestMemberSchema,
|
|
50
|
+
FriendRequestItemResponseSchema,
|
|
51
|
+
FriendActionRequestSchema
|
|
52
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MemberIdSchema
|
|
3
|
+
} from "./chunk-UFVPFUMI.js";
|
|
4
|
+
import {
|
|
5
|
+
ISODateTimeStringSchema
|
|
6
|
+
} from "./chunk-HRM3FQPL.js";
|
|
7
|
+
|
|
8
|
+
// src/domain/member/schema/member.schema.ts
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var MemberRoleSchema = z.enum(["USER", "ADMIN"]);
|
|
11
|
+
var MemberCoreSchema = z.object({
|
|
12
|
+
memberId: MemberIdSchema,
|
|
13
|
+
username: z.string().min(1).max(50),
|
|
14
|
+
profileImageUrl: z.string().url().nullable()
|
|
15
|
+
});
|
|
16
|
+
var MemberResponseSchema = MemberCoreSchema.pick({
|
|
17
|
+
memberId: true,
|
|
18
|
+
username: true,
|
|
19
|
+
profileImageUrl: true
|
|
20
|
+
});
|
|
21
|
+
var MemberSummaryResponseSchema = MemberCoreSchema.extend({
|
|
22
|
+
friends: z.number().int().min(0).default(0),
|
|
23
|
+
completedPlans: z.number().int().min(0).default(0),
|
|
24
|
+
uncompletedPlans: z.number().int().min(0).default(0)
|
|
25
|
+
});
|
|
26
|
+
var AuthPrincipalSchema = z.object({
|
|
27
|
+
memberId: MemberIdSchema,
|
|
28
|
+
role: MemberRoleSchema
|
|
29
|
+
});
|
|
30
|
+
var ProfilePreferenceItemSchema = z.object({
|
|
31
|
+
code: z.string(),
|
|
32
|
+
label: z.string()
|
|
33
|
+
});
|
|
34
|
+
var ProfileDetailResponseSchema = MemberCoreSchema.extend({
|
|
35
|
+
bio: z.string().nullable(),
|
|
36
|
+
planCount: z.number().int().min(0),
|
|
37
|
+
likes: z.array(ProfilePreferenceItemSchema),
|
|
38
|
+
dislikes: z.array(ProfilePreferenceItemSchema),
|
|
39
|
+
allergies: z.array(ProfilePreferenceItemSchema)
|
|
40
|
+
});
|
|
41
|
+
var UpdateProfileRequestSchema = z.object({
|
|
42
|
+
username: z.string().min(1).max(50),
|
|
43
|
+
profileImageUrl: z.string().url().nullable(),
|
|
44
|
+
bio: z.string().max(500).nullable()
|
|
45
|
+
});
|
|
46
|
+
var OnboardingPreferenceRequestSchema = z.object({
|
|
47
|
+
likedCodes: z.array(z.string()),
|
|
48
|
+
dislikedCodes: z.array(z.string()),
|
|
49
|
+
allergyCodes: z.array(z.string())
|
|
50
|
+
});
|
|
51
|
+
var OnboardingRequestSchema = UpdateProfileRequestSchema.merge(
|
|
52
|
+
OnboardingPreferenceRequestSchema
|
|
53
|
+
);
|
|
54
|
+
var PreferenceMetaResponseSchema = z.object({
|
|
55
|
+
onboardedAt: ISODateTimeStringSchema.nullable(),
|
|
56
|
+
lastUpdatedAt: ISODateTimeStringSchema.nullable(),
|
|
57
|
+
revision: z.number().int().min(0)
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
MemberRoleSchema,
|
|
62
|
+
MemberCoreSchema,
|
|
63
|
+
MemberResponseSchema,
|
|
64
|
+
MemberSummaryResponseSchema,
|
|
65
|
+
AuthPrincipalSchema,
|
|
66
|
+
ProfilePreferenceItemSchema,
|
|
67
|
+
ProfileDetailResponseSchema,
|
|
68
|
+
UpdateProfileRequestSchema,
|
|
69
|
+
OnboardingPreferenceRequestSchema,
|
|
70
|
+
OnboardingRequestSchema,
|
|
71
|
+
PreferenceMetaResponseSchema
|
|
72
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RestaurantIdSchema
|
|
3
|
+
} from "./chunk-UFVPFUMI.js";
|
|
4
|
+
|
|
5
|
+
// src/domain/restaurant/schema/restaurant.schema.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
var RestaurantSchema = z.object({
|
|
8
|
+
restaurantId: RestaurantIdSchema,
|
|
9
|
+
placeName: z.string(),
|
|
10
|
+
categoryName: z.string(),
|
|
11
|
+
categoryGroupName: z.string(),
|
|
12
|
+
distance: z.string().optional(),
|
|
13
|
+
roadAddressName: z.string(),
|
|
14
|
+
addressName: z.string(),
|
|
15
|
+
phone: z.string().nullable(),
|
|
16
|
+
placeUrl: z.string().url().nullable(),
|
|
17
|
+
lat: z.number(),
|
|
18
|
+
lng: z.number()
|
|
19
|
+
});
|
|
20
|
+
var KakaoPlaceRawSchema = z.object({
|
|
21
|
+
id: RestaurantIdSchema,
|
|
22
|
+
place_name: z.string(),
|
|
23
|
+
category_name: z.string(),
|
|
24
|
+
category_group_name: z.string(),
|
|
25
|
+
distance: z.string(),
|
|
26
|
+
road_address_name: z.string(),
|
|
27
|
+
address_name: z.string(),
|
|
28
|
+
phone: z.string(),
|
|
29
|
+
place_url: z.string().url().optional(),
|
|
30
|
+
lat: z.number(),
|
|
31
|
+
lng: z.number()
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
RestaurantSchema,
|
|
36
|
+
KakaoPlaceRawSchema
|
|
37
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/domain/common/schema/id.schema.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var PositiveIntIdSchema = z.number().int().positive();
|
|
4
|
+
var NonEmptyStringIdSchema = z.string().min(1);
|
|
5
|
+
var MemberIdSchema = PositiveIntIdSchema.brand();
|
|
6
|
+
var UserIdSchema = MemberIdSchema;
|
|
7
|
+
var ArticleIdSchema = PositiveIntIdSchema.brand();
|
|
8
|
+
var CommentIdSchema = PositiveIntIdSchema.brand();
|
|
9
|
+
var RecruitIdSchema = PositiveIntIdSchema.brand();
|
|
10
|
+
var PlanIdSchema = PositiveIntIdSchema.brand();
|
|
11
|
+
var InvitationIdSchema = PositiveIntIdSchema.brand();
|
|
12
|
+
var RoomIdSchema = NonEmptyStringIdSchema.brand();
|
|
13
|
+
var RestaurantIdSchema = NonEmptyStringIdSchema.brand();
|
|
14
|
+
var CouponIdSchema = PositiveIntIdSchema.brand();
|
|
15
|
+
var SubscriptionIdSchema = PositiveIntIdSchema.brand();
|
|
16
|
+
var FriendRequestIdSchema = PositiveIntIdSchema.brand();
|
|
17
|
+
var ReferralCodeSchema = z.string().min(4).max(64).brand();
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
PositiveIntIdSchema,
|
|
21
|
+
NonEmptyStringIdSchema,
|
|
22
|
+
MemberIdSchema,
|
|
23
|
+
UserIdSchema,
|
|
24
|
+
ArticleIdSchema,
|
|
25
|
+
CommentIdSchema,
|
|
26
|
+
RecruitIdSchema,
|
|
27
|
+
PlanIdSchema,
|
|
28
|
+
InvitationIdSchema,
|
|
29
|
+
RoomIdSchema,
|
|
30
|
+
RestaurantIdSchema,
|
|
31
|
+
CouponIdSchema,
|
|
32
|
+
SubscriptionIdSchema,
|
|
33
|
+
FriendRequestIdSchema,
|
|
34
|
+
ReferralCodeSchema
|
|
35
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
+
};
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
__export,
|
|
18
|
+
__decorateClass
|
|
19
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RestaurantSchema
|
|
3
|
+
} from "./chunk-NW5O4R7M.js";
|
|
4
|
+
import {
|
|
5
|
+
MemberResponseSchema
|
|
6
|
+
} from "./chunk-MP7TEKEI.js";
|
|
7
|
+
import {
|
|
8
|
+
ArticleIdSchema,
|
|
9
|
+
CommentIdSchema,
|
|
10
|
+
MemberIdSchema
|
|
11
|
+
} from "./chunk-UFVPFUMI.js";
|
|
12
|
+
import {
|
|
13
|
+
ISODateStringSchema,
|
|
14
|
+
ISODateTimeStringSchema
|
|
15
|
+
} from "./chunk-HRM3FQPL.js";
|
|
16
|
+
|
|
17
|
+
// src/domain/common/schema/pagination.schema.ts
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
var PageRequestSchema = z.object({
|
|
20
|
+
page: z.number().int().min(0).default(0),
|
|
21
|
+
size: z.number().int().min(1).max(100).default(20)
|
|
22
|
+
});
|
|
23
|
+
var SortObjectSchema = z.object({
|
|
24
|
+
empty: z.boolean(),
|
|
25
|
+
sorted: z.boolean(),
|
|
26
|
+
unsorted: z.boolean()
|
|
27
|
+
});
|
|
28
|
+
var PageableObjectSchema = z.object({
|
|
29
|
+
offset: z.number().int().min(0),
|
|
30
|
+
sort: SortObjectSchema,
|
|
31
|
+
paged: z.boolean(),
|
|
32
|
+
pageNumber: z.number().int().min(0),
|
|
33
|
+
pageSize: z.number().int().min(1),
|
|
34
|
+
unpaged: z.boolean()
|
|
35
|
+
});
|
|
36
|
+
var PageResponseSchema = (item) => z.object({
|
|
37
|
+
totalElements: z.number().int().min(0),
|
|
38
|
+
totalPages: z.number().int().min(0),
|
|
39
|
+
first: z.boolean(),
|
|
40
|
+
size: z.number().int().min(0),
|
|
41
|
+
content: z.array(item),
|
|
42
|
+
number: z.number().int().min(0),
|
|
43
|
+
sort: SortObjectSchema,
|
|
44
|
+
numberOfElements: z.number().int().min(0),
|
|
45
|
+
pageable: PageableObjectSchema,
|
|
46
|
+
last: z.boolean(),
|
|
47
|
+
empty: z.boolean()
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// src/domain/article/schema/article.schema.ts
|
|
51
|
+
import { z as z2 } from "zod";
|
|
52
|
+
var FoodAnalysisResultSchema = z2.object({
|
|
53
|
+
code: z2.string(),
|
|
54
|
+
label: z2.string(),
|
|
55
|
+
confidence: z2.number().min(0).max(1),
|
|
56
|
+
tsUtc: ISODateTimeStringSchema.optional()
|
|
57
|
+
});
|
|
58
|
+
var ArticlePostRequestSchema = z2.object({
|
|
59
|
+
imageUrl: z2.string().url(),
|
|
60
|
+
mealDate: ISODateStringSchema,
|
|
61
|
+
restaurant: RestaurantSchema,
|
|
62
|
+
taggedMemberIds: z2.array(MemberIdSchema).default([]),
|
|
63
|
+
foodAnalysis: FoodAnalysisResultSchema.optional()
|
|
64
|
+
});
|
|
65
|
+
var CreateArticleResponseSchema = z2.object({
|
|
66
|
+
articleId: ArticleIdSchema
|
|
67
|
+
});
|
|
68
|
+
var CommentPostRequestSchema = z2.object({
|
|
69
|
+
content: z2.string().min(1).max(500),
|
|
70
|
+
parentCommentId: CommentIdSchema.nullish()
|
|
71
|
+
});
|
|
72
|
+
var CreateCommentResponseSchema = z2.object({
|
|
73
|
+
commentId: CommentIdSchema
|
|
74
|
+
});
|
|
75
|
+
var CommentResponseSchema = z2.object({
|
|
76
|
+
commentId: CommentIdSchema,
|
|
77
|
+
author: MemberResponseSchema,
|
|
78
|
+
parentCommentId: CommentIdSchema.nullable(),
|
|
79
|
+
content: z2.string(),
|
|
80
|
+
createdAt: ISODateTimeStringSchema,
|
|
81
|
+
updatedAt: ISODateTimeStringSchema
|
|
82
|
+
});
|
|
83
|
+
var ArticleCoreSchema = z2.object({
|
|
84
|
+
articleId: ArticleIdSchema,
|
|
85
|
+
author: MemberResponseSchema,
|
|
86
|
+
imageUrl: z2.string().url(),
|
|
87
|
+
mealDate: ISODateStringSchema,
|
|
88
|
+
restaurant: RestaurantSchema,
|
|
89
|
+
createdAt: ISODateTimeStringSchema,
|
|
90
|
+
updatedAt: ISODateTimeStringSchema,
|
|
91
|
+
expiresAt: ISODateTimeStringSchema,
|
|
92
|
+
taggedMembers: z2.array(MemberResponseSchema)
|
|
93
|
+
});
|
|
94
|
+
var ArticleSummaryResponseSchema = ArticleCoreSchema.extend({
|
|
95
|
+
likeCount: z2.number().int().min(0),
|
|
96
|
+
commentCount: z2.number().int().min(0),
|
|
97
|
+
likedByMe: z2.boolean()
|
|
98
|
+
});
|
|
99
|
+
var ArticleDetailResponseSchema = ArticleSummaryResponseSchema.extend({
|
|
100
|
+
comments: z2.array(CommentResponseSchema).optional()
|
|
101
|
+
});
|
|
102
|
+
var PageArticleSummaryResponseSchema = PageResponseSchema(
|
|
103
|
+
ArticleSummaryResponseSchema
|
|
104
|
+
);
|
|
105
|
+
var PresignUploadResponseSchema = z2.object({
|
|
106
|
+
key: z2.string(),
|
|
107
|
+
putUrl: z2.string().url(),
|
|
108
|
+
cdnUrl: z2.string().url()
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
PageRequestSchema,
|
|
113
|
+
SortObjectSchema,
|
|
114
|
+
PageableObjectSchema,
|
|
115
|
+
PageResponseSchema,
|
|
116
|
+
FoodAnalysisResultSchema,
|
|
117
|
+
ArticlePostRequestSchema,
|
|
118
|
+
CreateArticleResponseSchema,
|
|
119
|
+
CommentPostRequestSchema,
|
|
120
|
+
CreateCommentResponseSchema,
|
|
121
|
+
CommentResponseSchema,
|
|
122
|
+
ArticleCoreSchema,
|
|
123
|
+
ArticleSummaryResponseSchema,
|
|
124
|
+
ArticleDetailResponseSchema,
|
|
125
|
+
PageArticleSummaryResponseSchema,
|
|
126
|
+
PresignUploadResponseSchema
|
|
127
|
+
};
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AcceptInvitationResponseSchema,
|
|
3
|
+
ApiResponseSchema,
|
|
4
|
+
ApiSuccessSchema,
|
|
5
|
+
InvitationListItemResponseSchema,
|
|
6
|
+
InvitationPostRequestSchema,
|
|
7
|
+
NoContentSchema,
|
|
8
|
+
RejectInvitationResponseSchema,
|
|
9
|
+
SendInvitationResponseSchema
|
|
10
|
+
} from "./chunk-4DAOP35P.js";
|
|
11
|
+
import {
|
|
12
|
+
MealStatusResponseSchema,
|
|
13
|
+
UpdateMealStatusRequestSchema
|
|
14
|
+
} from "./chunk-7MGHUZXI.js";
|
|
15
|
+
import {
|
|
16
|
+
CreatePlanRequestSchema,
|
|
17
|
+
PlanResponseSchema
|
|
18
|
+
} from "./chunk-ZNAAA53X.js";
|
|
19
|
+
import {
|
|
20
|
+
FoodPreferenceResponseSchema
|
|
21
|
+
} from "./chunk-F24BT6H4.js";
|
|
22
|
+
import {
|
|
23
|
+
CreateRecruitResponseSchema,
|
|
24
|
+
RecruitRequestSchema,
|
|
25
|
+
RecruitResponseSchema
|
|
26
|
+
} from "./chunk-2SJCUQNN.js";
|
|
27
|
+
import {
|
|
28
|
+
RedeemReferralRequestSchema,
|
|
29
|
+
ReferralCreateResponseSchema,
|
|
30
|
+
ReferralItemResponseSchema
|
|
31
|
+
} from "./chunk-ZSZ3ETY7.js";
|
|
32
|
+
import {
|
|
33
|
+
ArticleDetailResponseSchema,
|
|
34
|
+
ArticlePostRequestSchema,
|
|
35
|
+
CommentPostRequestSchema,
|
|
36
|
+
CreateArticleResponseSchema,
|
|
37
|
+
CreateCommentResponseSchema,
|
|
38
|
+
PageArticleSummaryResponseSchema,
|
|
39
|
+
PresignUploadResponseSchema
|
|
40
|
+
} from "./chunk-YVACD5IG.js";
|
|
41
|
+
import {
|
|
42
|
+
LoginRequestSchema,
|
|
43
|
+
SignupRequestSchema,
|
|
44
|
+
SignupResponseSchema,
|
|
45
|
+
TokenResponseSchema
|
|
46
|
+
} from "./chunk-FCE6KXNO.js";
|
|
47
|
+
import {
|
|
48
|
+
ChallengeStatusResponseSchema,
|
|
49
|
+
ClaimChallengeRewardRequestSchema,
|
|
50
|
+
ClaimChallengeRewardResponseSchema
|
|
51
|
+
} from "./chunk-6NZPEF4K.js";
|
|
52
|
+
import {
|
|
53
|
+
FriendActionRequestSchema,
|
|
54
|
+
FriendBlockItemResponseSchema,
|
|
55
|
+
FriendListItemResponseSchema,
|
|
56
|
+
FriendMealFilterSchema,
|
|
57
|
+
FriendMealItemResponseSchema,
|
|
58
|
+
FriendRequestItemResponseSchema
|
|
59
|
+
} from "./chunk-JCN37ARR.js";
|
|
60
|
+
import {
|
|
61
|
+
MemberResponseSchema,
|
|
62
|
+
MemberSummaryResponseSchema,
|
|
63
|
+
OnboardingPreferenceRequestSchema,
|
|
64
|
+
OnboardingRequestSchema,
|
|
65
|
+
PreferenceMetaResponseSchema,
|
|
66
|
+
ProfileDetailResponseSchema,
|
|
67
|
+
UpdateProfileRequestSchema
|
|
68
|
+
} from "./chunk-MP7TEKEI.js";
|
|
69
|
+
import {
|
|
70
|
+
CouponResponseSchema
|
|
71
|
+
} from "./chunk-IJMADVK5.js";
|
|
72
|
+
import {
|
|
73
|
+
ArticleIdSchema,
|
|
74
|
+
CommentIdSchema,
|
|
75
|
+
CouponIdSchema,
|
|
76
|
+
FriendRequestIdSchema,
|
|
77
|
+
InvitationIdSchema,
|
|
78
|
+
MemberIdSchema,
|
|
79
|
+
PlanIdSchema,
|
|
80
|
+
RecruitIdSchema,
|
|
81
|
+
RestaurantIdSchema,
|
|
82
|
+
RoomIdSchema
|
|
83
|
+
} from "./chunk-UFVPFUMI.js";
|
|
84
|
+
|
|
85
|
+
// src/domain/common/contracts/api.ts
|
|
86
|
+
import { z as z2 } from "zod";
|
|
87
|
+
|
|
88
|
+
// src/domain/common/contracts/endpoint.ts
|
|
89
|
+
import { z } from "zod";
|
|
90
|
+
var NoBodySchema = z.undefined();
|
|
91
|
+
var NoQuerySchema = z.undefined();
|
|
92
|
+
var NoParamsSchema = z.undefined();
|
|
93
|
+
var endpoint = (contract) => ({
|
|
94
|
+
method: contract.method,
|
|
95
|
+
path: contract.path,
|
|
96
|
+
pathParams: contract.pathParams ?? NoParamsSchema,
|
|
97
|
+
query: contract.query ?? NoQuerySchema,
|
|
98
|
+
body: contract.body ?? NoBodySchema,
|
|
99
|
+
response: contract.response
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// src/domain/common/contracts/api.ts
|
|
103
|
+
var memberIdParam = z2.object({ memberId: MemberIdSchema });
|
|
104
|
+
var articleIdParam = z2.object({ articleId: ArticleIdSchema });
|
|
105
|
+
var commentIdParam = z2.object({ commentId: CommentIdSchema });
|
|
106
|
+
var recruitIdParam = z2.object({ recruitId: RecruitIdSchema });
|
|
107
|
+
var invitationIdParam = z2.object({ invitationId: InvitationIdSchema });
|
|
108
|
+
var planIdParam = z2.object({ planId: PlanIdSchema });
|
|
109
|
+
var couponIdParam = z2.object({ couponId: CouponIdSchema });
|
|
110
|
+
var friendRequestIdParam = z2.object({ requestId: FriendRequestIdSchema });
|
|
111
|
+
var apiContract = {
|
|
112
|
+
auth: {
|
|
113
|
+
signup: endpoint({ method: "POST", path: "/auth/signup", body: SignupRequestSchema, response: SignupResponseSchema }),
|
|
114
|
+
login: endpoint({ method: "POST", path: "/auth/login", body: LoginRequestSchema, response: TokenResponseSchema }),
|
|
115
|
+
refresh: endpoint({ method: "POST", path: "/auth/refresh", response: TokenResponseSchema }),
|
|
116
|
+
logout: endpoint({ method: "POST", path: "/auth/logout", response: NoContentSchema })
|
|
117
|
+
},
|
|
118
|
+
members: {
|
|
119
|
+
me: endpoint({ method: "GET", path: "/members/me", response: MemberResponseSchema }),
|
|
120
|
+
summary: endpoint({ method: "GET", path: "/members/me/summary", response: MemberSummaryResponseSchema }),
|
|
121
|
+
detail: endpoint({ method: "GET", path: "/members/:memberId", pathParams: memberIdParam, response: ProfileDetailResponseSchema }),
|
|
122
|
+
updateProfile: endpoint({ method: "PATCH", path: "/members/me/profile", body: UpdateProfileRequestSchema, response: ProfileDetailResponseSchema }),
|
|
123
|
+
onboarding: endpoint({ method: "POST", path: "/members/me/onboarding", body: OnboardingRequestSchema, response: PreferenceMetaResponseSchema }),
|
|
124
|
+
updateOnboardingPreferences: endpoint({ method: "PATCH", path: "/members/me/preferences", body: OnboardingPreferenceRequestSchema, response: PreferenceMetaResponseSchema })
|
|
125
|
+
},
|
|
126
|
+
articles: {
|
|
127
|
+
list: endpoint({ method: "GET", path: "/articles", response: PageArticleSummaryResponseSchema }),
|
|
128
|
+
detail: endpoint({ method: "GET", path: "/articles/:articleId", pathParams: articleIdParam, response: ArticleDetailResponseSchema }),
|
|
129
|
+
create: endpoint({ method: "POST", path: "/articles", body: ArticlePostRequestSchema, response: CreateArticleResponseSchema }),
|
|
130
|
+
delete: endpoint({ method: "DELETE", path: "/articles/:articleId", pathParams: articleIdParam, response: NoContentSchema }),
|
|
131
|
+
createComment: endpoint({ method: "POST", path: "/articles/:articleId/comments", pathParams: articleIdParam, body: CommentPostRequestSchema, response: CreateCommentResponseSchema }),
|
|
132
|
+
deleteComment: endpoint({ method: "DELETE", path: "/articles/:articleId/comments/:commentId", pathParams: articleIdParam.merge(commentIdParam), response: NoContentSchema }),
|
|
133
|
+
presignArticleImage: endpoint({ method: "POST", path: "/uploads/articles/presign", response: PresignUploadResponseSchema }),
|
|
134
|
+
presignProfileImage: endpoint({ method: "POST", path: "/uploads/profiles/presign", response: PresignUploadResponseSchema })
|
|
135
|
+
},
|
|
136
|
+
recruits: {
|
|
137
|
+
list: endpoint({ method: "GET", path: "/recruits", response: z2.array(RecruitResponseSchema) }),
|
|
138
|
+
detail: endpoint({ method: "GET", path: "/recruits/:recruitId", pathParams: recruitIdParam, response: RecruitResponseSchema }),
|
|
139
|
+
create: endpoint({ method: "POST", path: "/recruits", body: RecruitRequestSchema, response: CreateRecruitResponseSchema }),
|
|
140
|
+
close: endpoint({ method: "PATCH", path: "/recruits/:recruitId/close", pathParams: recruitIdParam, response: NoContentSchema }),
|
|
141
|
+
join: endpoint({ method: "POST", path: "/recruits/:recruitId/join", pathParams: recruitIdParam, response: NoContentSchema })
|
|
142
|
+
},
|
|
143
|
+
invitations: {
|
|
144
|
+
list: endpoint({ method: "GET", path: "/invitations", response: z2.array(InvitationListItemResponseSchema) }),
|
|
145
|
+
send: endpoint({ method: "POST", path: "/invitations", body: InvitationPostRequestSchema, response: SendInvitationResponseSchema }),
|
|
146
|
+
accept: endpoint({ method: "POST", path: "/invitations/:invitationId/accept", pathParams: invitationIdParam, response: AcceptInvitationResponseSchema }),
|
|
147
|
+
reject: endpoint({ method: "POST", path: "/invitations/:invitationId/reject", pathParams: invitationIdParam, response: RejectInvitationResponseSchema })
|
|
148
|
+
},
|
|
149
|
+
plans: {
|
|
150
|
+
list: endpoint({ method: "GET", path: "/plans", response: z2.array(PlanResponseSchema) }),
|
|
151
|
+
detail: endpoint({ method: "GET", path: "/plans/:planId", pathParams: planIdParam, response: PlanResponseSchema }),
|
|
152
|
+
create: endpoint({ method: "POST", path: "/plans", body: CreatePlanRequestSchema, response: PlanResponseSchema })
|
|
153
|
+
},
|
|
154
|
+
mealStatus: {
|
|
155
|
+
get: endpoint({ method: "GET", path: "/members/me/meal-status", response: MealStatusResponseSchema }),
|
|
156
|
+
update: endpoint({ method: "PATCH", path: "/members/me/meal-status", body: UpdateMealStatusRequestSchema, response: NoContentSchema })
|
|
157
|
+
},
|
|
158
|
+
friends: {
|
|
159
|
+
list: endpoint({ method: "GET", path: "/friends", response: z2.array(FriendListItemResponseSchema) }),
|
|
160
|
+
meals: endpoint({ method: "GET", path: "/friends/meals", query: z2.object({ filter: FriendMealFilterSchema.optional() }), response: z2.array(FriendMealItemResponseSchema) }),
|
|
161
|
+
blocks: endpoint({ method: "GET", path: "/friends/blocks", response: z2.array(FriendBlockItemResponseSchema) }),
|
|
162
|
+
request: endpoint({ method: "POST", path: "/friends/requests", body: FriendActionRequestSchema, response: FriendRequestItemResponseSchema }),
|
|
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", body: FriendActionRequestSchema, response: NoContentSchema }),
|
|
166
|
+
unblock: endpoint({ method: "DELETE", path: "/friends/blocks/:memberId", pathParams: memberIdParam, response: NoContentSchema })
|
|
167
|
+
},
|
|
168
|
+
preferences: {
|
|
169
|
+
list: endpoint({ method: "GET", path: "/preferences", response: z2.array(FoodPreferenceResponseSchema) })
|
|
170
|
+
},
|
|
171
|
+
coupons: {
|
|
172
|
+
list: endpoint({ method: "GET", path: "/coupons", response: z2.array(CouponResponseSchema) }),
|
|
173
|
+
use: endpoint({ method: "PATCH", path: "/coupons/:couponId/use", pathParams: couponIdParam, response: NoContentSchema })
|
|
174
|
+
},
|
|
175
|
+
challenges: {
|
|
176
|
+
status: endpoint({ method: "GET", path: "/challenges/status", response: ChallengeStatusResponseSchema }),
|
|
177
|
+
claimReward: endpoint({ method: "POST", path: "/challenges/rewards", body: ClaimChallengeRewardRequestSchema, response: ClaimChallengeRewardResponseSchema })
|
|
178
|
+
},
|
|
179
|
+
referrals: {
|
|
180
|
+
create: endpoint({ method: "POST", path: "/referrals", response: ReferralCreateResponseSchema }),
|
|
181
|
+
list: endpoint({ method: "GET", path: "/referrals", response: z2.array(ReferralItemResponseSchema) }),
|
|
182
|
+
redeem: endpoint({ method: "POST", path: "/referrals/redeem", body: RedeemReferralRequestSchema, response: NoContentSchema })
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// src/domain/common/contracts/envelope.ts
|
|
187
|
+
var makeApiResponseSchema = ApiResponseSchema;
|
|
188
|
+
var makeApiSuccessSchema = ApiSuccessSchema;
|
|
189
|
+
|
|
190
|
+
// src/domain/common/contracts/id.ts
|
|
191
|
+
var toMemberId = (value) => MemberIdSchema.parse(value);
|
|
192
|
+
var toArticleId = (value) => ArticleIdSchema.parse(value);
|
|
193
|
+
var toRecruitId = (value) => RecruitIdSchema.parse(value);
|
|
194
|
+
var toInvitationId = (value) => InvitationIdSchema.parse(value);
|
|
195
|
+
var toRoomId = (value) => RoomIdSchema.parse(value);
|
|
196
|
+
var toRestaurantId = (value) => RestaurantIdSchema.parse(value);
|
|
197
|
+
|
|
198
|
+
export {
|
|
199
|
+
NoBodySchema,
|
|
200
|
+
NoQuerySchema,
|
|
201
|
+
NoParamsSchema,
|
|
202
|
+
endpoint,
|
|
203
|
+
apiContract,
|
|
204
|
+
makeApiResponseSchema,
|
|
205
|
+
makeApiSuccessSchema,
|
|
206
|
+
toMemberId,
|
|
207
|
+
toArticleId,
|
|
208
|
+
toRecruitId,
|
|
209
|
+
toInvitationId,
|
|
210
|
+
toRoomId,
|
|
211
|
+
toRestaurantId
|
|
212
|
+
};
|