@shophost/rest-api 2.0.26 → 2.0.28
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/README.md +3 -3
- package/package.json +1 -1
- package/prisma.config.ts +1 -1
- package/scripts/shophost-rest-api.mjs +6 -9
- package/src/app.js +2 -1
- package/src/app.js.map +1 -1
- package/src/core/lib/prisma.d.ts +26 -26
- package/src/features/access/access.handler.d.ts +2 -0
- package/src/features/access/access.handler.js +83 -0
- package/src/features/access/access.handler.js.map +1 -0
- package/src/features/access/access.route.d.ts +11 -0
- package/src/features/access/access.route.js +203 -0
- package/src/features/access/access.route.js.map +1 -0
- package/src/features/access/access.schema.d.ts +47 -0
- package/src/features/access/access.schema.js +108 -0
- package/src/features/access/access.schema.js.map +1 -0
- package/src/features/access/access.service.d.ts +111 -0
- package/src/features/access/access.service.js +273 -0
- package/src/features/access/access.service.js.map +1 -0
- package/src/features/cart/cart.schema.d.ts +3 -3
- package/src/features/cart/cart.service.d.ts +2 -2
- package/src/features/index.d.ts +1 -0
- package/src/features/index.js +1 -0
- package/src/features/index.js.map +1 -1
- package/src/features/order/recipient.schema.d.ts +2 -2
- package/src/features/organization/organization.schema.d.ts +2 -2
- package/src/features/product/product-modifier.schema.d.ts +1 -1
- package/src/features/product/product.schema.d.ts +3 -3
- package/src/features/product/product.service.d.ts +4 -4
- package/src/features/product-category/product-category.schema.d.ts +14 -14
- package/src/features/product-category/product-category.service.d.ts +2 -2
- package/src/schemas/index.d.ts +1 -0
- package/src/schemas/index.js +1 -0
- package/src/schemas/index.js.map +1 -1
- package/src/test/integration/test-helpers.d.ts +41 -41
- package/src/test/integration/test-helpers.js +2 -2
- package/src/test/integration/test-helpers.js.map +1 -1
- package/src/test/setup-test-env.js +3 -3
- package/src/test/setup-test-env.js.map +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { z } from "@hono/zod-openapi";
|
|
3
|
+
import { HttpException } from "../../core/exceptions/http-exception";
|
|
4
|
+
import { PaginationMetaSchema } from "../../schemas";
|
|
5
|
+
import { InvitationSchema, MemberSchema, UserInvitationSchema, } from "./access.schema";
|
|
6
|
+
class AccessService {
|
|
7
|
+
constructor(prisma) {
|
|
8
|
+
this.prisma = prisma;
|
|
9
|
+
}
|
|
10
|
+
getMembers(organizationId, query) {
|
|
11
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const { page = 1, limit = 10, search } = query;
|
|
13
|
+
const [list, meta] = yield this.prisma.member
|
|
14
|
+
.paginate({
|
|
15
|
+
orderBy: { createdAt: "desc" },
|
|
16
|
+
where: Object.assign({ organizationId }, (search && {
|
|
17
|
+
user: {
|
|
18
|
+
OR: [
|
|
19
|
+
{ firstname: { contains: search, mode: "insensitive" } },
|
|
20
|
+
{ lastname: { contains: search, mode: "insensitive" } },
|
|
21
|
+
{ email: { contains: search, mode: "insensitive" } },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
})),
|
|
25
|
+
include: {
|
|
26
|
+
user: {
|
|
27
|
+
select: {
|
|
28
|
+
id: true,
|
|
29
|
+
firstname: true,
|
|
30
|
+
lastname: true,
|
|
31
|
+
email: true,
|
|
32
|
+
image: true,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
.withPages({ page, limit });
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
meta: PaginationMetaSchema,
|
|
41
|
+
list: z.array(MemberSchema),
|
|
42
|
+
})
|
|
43
|
+
.parse({ meta, list });
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getMember(organizationId, memberId) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const member = yield this.prisma.member.findUnique({
|
|
49
|
+
where: { id: memberId, organizationId },
|
|
50
|
+
include: {
|
|
51
|
+
user: {
|
|
52
|
+
select: {
|
|
53
|
+
id: true,
|
|
54
|
+
firstname: true,
|
|
55
|
+
lastname: true,
|
|
56
|
+
email: true,
|
|
57
|
+
image: true,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
if (!member) {
|
|
63
|
+
throw new HttpException(404, "Member not found");
|
|
64
|
+
}
|
|
65
|
+
return MemberSchema.parse(member);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
updateMemberRole(organizationId, memberId, currentUserId, body) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const member = yield this.prisma.member.findUnique({
|
|
71
|
+
where: { id: memberId, organizationId },
|
|
72
|
+
include: { user: { select: { id: true, firstname: true, lastname: true, email: true, image: true } } },
|
|
73
|
+
});
|
|
74
|
+
if (!member) {
|
|
75
|
+
throw new HttpException(404, "Member not found");
|
|
76
|
+
}
|
|
77
|
+
// Prevent demotion of the last owner
|
|
78
|
+
if (member.role === "owner" && body.role !== "owner") {
|
|
79
|
+
const ownerCount = yield this.prisma.member.count({
|
|
80
|
+
where: { organizationId, role: "owner" },
|
|
81
|
+
});
|
|
82
|
+
if (ownerCount <= 1) {
|
|
83
|
+
throw new HttpException(400, "Cannot change the role of the last owner. Promote another member to owner first.");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const updated = yield this.prisma.member.update({
|
|
87
|
+
where: { id: memberId, organizationId },
|
|
88
|
+
data: { role: body.role },
|
|
89
|
+
include: {
|
|
90
|
+
user: {
|
|
91
|
+
select: {
|
|
92
|
+
id: true,
|
|
93
|
+
firstname: true,
|
|
94
|
+
lastname: true,
|
|
95
|
+
email: true,
|
|
96
|
+
image: true,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
return MemberSchema.parse(updated);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
deleteMember(organizationId, memberId, currentUserId) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const member = yield this.prisma.member.findUnique({
|
|
107
|
+
where: { id: memberId, organizationId },
|
|
108
|
+
});
|
|
109
|
+
if (!member) {
|
|
110
|
+
throw new HttpException(404, "Member not found");
|
|
111
|
+
}
|
|
112
|
+
// Prevent self-removal
|
|
113
|
+
if (member.userId === currentUserId) {
|
|
114
|
+
throw new HttpException(400, "You cannot remove yourself from the organization");
|
|
115
|
+
}
|
|
116
|
+
// Prevent removal of the last owner
|
|
117
|
+
if (member.role === "owner") {
|
|
118
|
+
const ownerCount = yield this.prisma.member.count({
|
|
119
|
+
where: { organizationId, role: "owner" },
|
|
120
|
+
});
|
|
121
|
+
if (ownerCount <= 1) {
|
|
122
|
+
throw new HttpException(400, "Cannot remove the last owner. Transfer ownership first.");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
yield this.prisma.member.delete({
|
|
126
|
+
where: { id: memberId, organizationId },
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
createInvitation(organizationId, inviterId, body) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
// Check for duplicate active invitation
|
|
133
|
+
const existing = yield this.prisma.invitation.findFirst({
|
|
134
|
+
where: {
|
|
135
|
+
organizationId,
|
|
136
|
+
email: body.email,
|
|
137
|
+
status: "pending",
|
|
138
|
+
expiresAt: { gt: new Date() },
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
if (existing) {
|
|
142
|
+
throw new HttpException(400, "An active invitation already exists for this email address");
|
|
143
|
+
}
|
|
144
|
+
// Check if user is already a member
|
|
145
|
+
const existingMember = yield this.prisma.member.findFirst({
|
|
146
|
+
where: {
|
|
147
|
+
organizationId,
|
|
148
|
+
user: { email: body.email },
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
if (existingMember) {
|
|
152
|
+
throw new HttpException(400, "This user is already a member of the organization");
|
|
153
|
+
}
|
|
154
|
+
const invitation = yield this.prisma.invitation.create({
|
|
155
|
+
data: {
|
|
156
|
+
id: crypto.randomUUID(),
|
|
157
|
+
organizationId,
|
|
158
|
+
email: body.email,
|
|
159
|
+
role: body.role,
|
|
160
|
+
status: "pending",
|
|
161
|
+
inviterId,
|
|
162
|
+
expiresAt: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 7 days
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
return InvitationSchema.parse(invitation);
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
getInvitations(organizationId) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
const invitations = yield this.prisma.invitation.findMany({
|
|
171
|
+
where: {
|
|
172
|
+
organizationId,
|
|
173
|
+
status: "pending",
|
|
174
|
+
},
|
|
175
|
+
orderBy: { expiresAt: "desc" },
|
|
176
|
+
});
|
|
177
|
+
return z.array(InvitationSchema).parse(invitations);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
deleteInvitation(organizationId, invitationId) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const invitation = yield this.prisma.invitation.findUnique({
|
|
183
|
+
where: { id: invitationId, organizationId },
|
|
184
|
+
});
|
|
185
|
+
if (!invitation) {
|
|
186
|
+
throw new HttpException(404, "Invitation not found");
|
|
187
|
+
}
|
|
188
|
+
if (invitation.status !== "pending") {
|
|
189
|
+
throw new HttpException(400, "Only pending invitations can be revoked");
|
|
190
|
+
}
|
|
191
|
+
yield this.prisma.invitation.delete({
|
|
192
|
+
where: { id: invitationId },
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
getUserInvitations(email) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
const invitations = yield this.prisma.invitation.findMany({
|
|
199
|
+
where: {
|
|
200
|
+
email,
|
|
201
|
+
status: "pending",
|
|
202
|
+
expiresAt: { gt: new Date() },
|
|
203
|
+
},
|
|
204
|
+
include: {
|
|
205
|
+
organization: {
|
|
206
|
+
select: { id: true, name: true },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
orderBy: { expiresAt: "desc" },
|
|
210
|
+
});
|
|
211
|
+
return z.array(UserInvitationSchema).parse(invitations);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
acceptInvitation(invitationId, userId) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
var _a;
|
|
217
|
+
const invitation = yield this.prisma.invitation.findUnique({
|
|
218
|
+
where: { id: invitationId },
|
|
219
|
+
});
|
|
220
|
+
if (!invitation) {
|
|
221
|
+
throw new HttpException(404, "Invitation not found");
|
|
222
|
+
}
|
|
223
|
+
if (invitation.status !== "pending") {
|
|
224
|
+
throw new HttpException(400, "Invitation is no longer pending");
|
|
225
|
+
}
|
|
226
|
+
if (invitation.expiresAt < new Date()) {
|
|
227
|
+
throw new HttpException(400, "Invitation has expired");
|
|
228
|
+
}
|
|
229
|
+
const user = yield this.prisma.user.findUnique({
|
|
230
|
+
where: { id: userId },
|
|
231
|
+
});
|
|
232
|
+
if (!user || user.email !== invitation.email) {
|
|
233
|
+
throw new HttpException(400, "Invitation does not belong to this user");
|
|
234
|
+
}
|
|
235
|
+
const existingMember = yield this.prisma.member.findFirst({
|
|
236
|
+
where: {
|
|
237
|
+
organizationId: invitation.organizationId,
|
|
238
|
+
userId,
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
if (existingMember) {
|
|
242
|
+
throw new HttpException(400, "You are already a member of this organization");
|
|
243
|
+
}
|
|
244
|
+
const [member] = yield this.prisma.$transaction([
|
|
245
|
+
this.prisma.member.create({
|
|
246
|
+
data: {
|
|
247
|
+
organizationId: invitation.organizationId,
|
|
248
|
+
userId,
|
|
249
|
+
role: (_a = invitation.role) !== null && _a !== void 0 ? _a : "member",
|
|
250
|
+
},
|
|
251
|
+
include: {
|
|
252
|
+
user: {
|
|
253
|
+
select: {
|
|
254
|
+
id: true,
|
|
255
|
+
firstname: true,
|
|
256
|
+
lastname: true,
|
|
257
|
+
email: true,
|
|
258
|
+
image: true,
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
}),
|
|
263
|
+
this.prisma.invitation.update({
|
|
264
|
+
where: { id: invitationId },
|
|
265
|
+
data: { status: "accepted" },
|
|
266
|
+
}),
|
|
267
|
+
]);
|
|
268
|
+
return MemberSchema.parse(member);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export { AccessService };
|
|
273
|
+
//# sourceMappingURL=access.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.service.js","sourceRoot":"","sources":["../../../../../../packages/rest-api/src/features/access/access.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAEL,gBAAgB,EAChB,YAAY,EAEZ,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,aAAa;IACjB,YAA6B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAE5C,UAAU,CACrB,cAAsB,EACtB,KAAyD;;YAEzD,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;YAE/C,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM;iBAC1C,QAAQ,CAAC;gBACR,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;gBAC9B,KAAK,kBACH,cAAc,IACX,CAAC,MAAM,IAAI;oBACZ,IAAI,EAAE;wBACJ,EAAE,EAAE;4BACF,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI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E,UAAU,CAAC,cAAc;oBACzC,MAAM;iBACP;aACF,CAAC,CAAC;YAEH,IAAI,cAAc,EAAE,CAAC;gBACnB,MAAM,IAAI,aAAa,CAAC,GAAG,EAAE,+CAA+C,CAAC,CAAC;YAChF,CAAC;YAED,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;gBAC9C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;oBACxB,IAAI,EAAE;wBACJ,cAAc,EAAE,UAAU,CAAC,cAAc;wBACzC,MAAM;wBACN,IAAI,EAAE,MAAA,UAAU,CAAC,IAAI,mCAAI,QAAQ;qBAClC;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE;4BACJ,MAAM,EAAE;gCACN,EAAE,EAAE,IAAI;gCACR,SAAS,EAAE,IAAI;gCACf,QAAQ,EAAE,IAAI;gCACd,KAAK,EAAE,IAAI;gCACX,KAAK,EAAE,IAAI;6BACZ;yBACF;qBACF;iBACF,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;oBAC5B,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE;oBAC3B,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;iBAC7B,CAAC;aACH,CAAC,CAAC;YAEH,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;KAAA;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
2
|
export declare const CartProductsMappingSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
3
|
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
5
4
|
title: z.ZodDefault<z.ZodString>;
|
|
6
|
-
|
|
5
|
+
id: z.ZodString;
|
|
7
6
|
createdAt: z.ZodDate;
|
|
7
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
8
8
|
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
9
9
|
sku: z.ZodOptional<z.ZodString>;
|
|
10
10
|
basePrice: z.ZodCoercedNumber<unknown>;
|
|
@@ -18,6 +18,7 @@ export declare const CartProductsMappingSchema: z.ZodRecord<z.ZodString, z.ZodOb
|
|
|
18
18
|
filename: z.ZodString;
|
|
19
19
|
}, z.core.$strip>>>;
|
|
20
20
|
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
21
|
+
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
21
22
|
id: z.ZodString;
|
|
22
23
|
defaultLocale: z.ZodOptional<z.ZodEnum<{
|
|
23
24
|
id: "id";
|
|
@@ -134,7 +135,6 @@ export declare const CartProductsMappingSchema: z.ZodRecord<z.ZodString, z.ZodOb
|
|
|
134
135
|
ji: "ji";
|
|
135
136
|
zu: "zu";
|
|
136
137
|
}>>;
|
|
137
|
-
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
138
138
|
selectMin: z.ZodCoercedNumber<unknown>;
|
|
139
139
|
selectMax: z.ZodCoercedNumber<unknown>;
|
|
140
140
|
modifiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -17,16 +17,16 @@ declare class CartService {
|
|
|
17
17
|
}): Promise<{
|
|
18
18
|
invalidProductIds: string[];
|
|
19
19
|
products: Record<string, {
|
|
20
|
-
id: string;
|
|
21
20
|
description: string | null;
|
|
22
21
|
title: string;
|
|
22
|
+
id: string;
|
|
23
23
|
createdAt: Date;
|
|
24
24
|
basePrice: number;
|
|
25
25
|
discountedBasePrice: number | null;
|
|
26
26
|
currency: string;
|
|
27
27
|
modifierGroups: {
|
|
28
|
-
id: string;
|
|
29
28
|
title: string | null;
|
|
29
|
+
id: string;
|
|
30
30
|
selectMin: number;
|
|
31
31
|
selectMax: number;
|
|
32
32
|
defaultLocale?: "id" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "hr" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "is" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ml" | "ms" | "mt" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "th" | "tr" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu" | undefined;
|
package/src/features/index.d.ts
CHANGED
package/src/features/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/rest-api/src/features/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,E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MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -22,8 +22,8 @@ export declare const RecipientSchema: z.ZodObject<{
|
|
|
22
22
|
updatedAt: z.ZodDate;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
export declare const CreateRecipientSchema: z.ZodObject<{
|
|
25
|
-
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
25
|
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
27
|
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
28
|
address: z.ZodObject<{
|
|
29
29
|
addressLineOne: z.ZodString;
|
|
@@ -36,8 +36,8 @@ export declare const CreateRecipientSchema: z.ZodObject<{
|
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
38
|
export declare const UpdateCustomerSchema: z.ZodObject<{
|
|
39
|
-
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
40
39
|
firstname: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
40
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
41
41
|
phone: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
42
42
|
address: z.ZodOptional<z.ZodObject<{
|
|
43
43
|
addressLineOne: z.ZodString;
|
|
@@ -327,8 +327,8 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
327
327
|
}, z.core.$strip>>>;
|
|
328
328
|
}, z.core.$strip>;
|
|
329
329
|
export declare const CreateOrganizationSchema: z.ZodObject<{
|
|
330
|
-
name: z.ZodString;
|
|
331
330
|
email: z.ZodOptional<z.ZodString>;
|
|
331
|
+
name: z.ZodString;
|
|
332
332
|
phone: z.ZodString;
|
|
333
333
|
logoFile: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
334
334
|
id: z.ZodString;
|
|
@@ -349,8 +349,8 @@ export declare const CreateOrganizationSchema: z.ZodObject<{
|
|
|
349
349
|
}, z.core.$strip>;
|
|
350
350
|
}, z.core.$strip>;
|
|
351
351
|
export declare const UpdateOrganizationSchema: z.ZodObject<{
|
|
352
|
-
name: z.ZodOptional<z.ZodString>;
|
|
353
352
|
email: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
353
|
+
name: z.ZodOptional<z.ZodString>;
|
|
354
354
|
phone: z.ZodOptional<z.ZodString>;
|
|
355
355
|
logoFile: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
356
356
|
id: z.ZodString;
|
|
@@ -250,6 +250,7 @@ export declare const ModifierGroupSchema: z.ZodObject<{
|
|
|
250
250
|
}, z.core.$strip>>;
|
|
251
251
|
}, z.core.$strip>;
|
|
252
252
|
export declare const LocalizedModifierGroupSchema: z.ZodObject<{
|
|
253
|
+
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
253
254
|
id: z.ZodString;
|
|
254
255
|
defaultLocale: z.ZodOptional<z.ZodEnum<{
|
|
255
256
|
id: "id";
|
|
@@ -366,7 +367,6 @@ export declare const LocalizedModifierGroupSchema: z.ZodObject<{
|
|
|
366
367
|
ji: "ji";
|
|
367
368
|
zu: "zu";
|
|
368
369
|
}>>;
|
|
369
|
-
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
370
370
|
selectMin: z.ZodCoercedNumber<unknown>;
|
|
371
371
|
selectMax: z.ZodCoercedNumber<unknown>;
|
|
372
372
|
modifiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -400,11 +400,11 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
400
400
|
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
401
401
|
}, z.core.$strip>;
|
|
402
402
|
export declare const LocalizedProductSchema: z.ZodObject<{
|
|
403
|
-
id: z.ZodString;
|
|
404
403
|
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
405
404
|
title: z.ZodDefault<z.ZodString>;
|
|
406
|
-
|
|
405
|
+
id: z.ZodString;
|
|
407
406
|
createdAt: z.ZodDate;
|
|
407
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
408
408
|
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
409
409
|
sku: z.ZodOptional<z.ZodString>;
|
|
410
410
|
basePrice: z.ZodCoercedNumber<unknown>;
|
|
@@ -418,6 +418,7 @@ export declare const LocalizedProductSchema: z.ZodObject<{
|
|
|
418
418
|
filename: z.ZodString;
|
|
419
419
|
}, z.core.$strip>>>;
|
|
420
420
|
modifierGroups: z.ZodArray<z.ZodObject<{
|
|
421
|
+
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
421
422
|
id: z.ZodString;
|
|
422
423
|
defaultLocale: z.ZodOptional<z.ZodEnum<{
|
|
423
424
|
id: "id";
|
|
@@ -534,7 +535,6 @@ export declare const LocalizedProductSchema: z.ZodObject<{
|
|
|
534
535
|
ji: "ji";
|
|
535
536
|
zu: "zu";
|
|
536
537
|
}>>;
|
|
537
|
-
title: z.ZodNullable<z.ZodDefault<z.ZodString>>;
|
|
538
538
|
selectMin: z.ZodCoercedNumber<unknown>;
|
|
539
539
|
selectMax: z.ZodCoercedNumber<unknown>;
|
|
540
540
|
modifiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -77,16 +77,16 @@ declare class ProductService {
|
|
|
77
77
|
locale?: string | null;
|
|
78
78
|
published?: boolean;
|
|
79
79
|
}): Promise<{
|
|
80
|
-
id: string;
|
|
81
80
|
description: string | null;
|
|
82
81
|
title: string;
|
|
82
|
+
id: string;
|
|
83
83
|
createdAt: Date;
|
|
84
84
|
basePrice: number;
|
|
85
85
|
discountedBasePrice: number | null;
|
|
86
86
|
currency: string;
|
|
87
87
|
modifierGroups: {
|
|
88
|
-
id: string;
|
|
89
88
|
title: string | null;
|
|
89
|
+
id: string;
|
|
90
90
|
selectMin: number;
|
|
91
91
|
selectMax: number;
|
|
92
92
|
defaultLocale?: "id" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "hr" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "is" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ml" | "ms" | "mt" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "th" | "tr" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu" | undefined;
|
|
@@ -258,16 +258,16 @@ declare class ProductService {
|
|
|
258
258
|
totalCount: number;
|
|
259
259
|
};
|
|
260
260
|
list: {
|
|
261
|
-
id: string;
|
|
262
261
|
description: string | null;
|
|
263
262
|
title: string;
|
|
263
|
+
id: string;
|
|
264
264
|
createdAt: Date;
|
|
265
265
|
basePrice: number;
|
|
266
266
|
discountedBasePrice: number | null;
|
|
267
267
|
currency: string;
|
|
268
268
|
modifierGroups: {
|
|
269
|
-
id: string;
|
|
270
269
|
title: string | null;
|
|
270
|
+
id: string;
|
|
271
271
|
selectMin: number;
|
|
272
272
|
selectMax: number;
|
|
273
273
|
defaultLocale?: "id" | "af" | "sq" | "ar_dz" | "ar_bh" | "ar_eg" | "ar_iq" | "ar_jo" | "ar_kw" | "ar_lb" | "ar_ly" | "ar_ma" | "ar_om" | "ar_qa" | "ar_sa" | "ar_sy" | "ar_tn" | "ar_ae" | "ar_ye" | "eu" | "be" | "bg" | "ca" | "zh_hk" | "zh_cn" | "zh_sg" | "zh_tw" | "hr" | "cs" | "da" | "nl_be" | "nl" | "en" | "en_au" | "en_bz" | "en_ca" | "en_ie" | "en_jm" | "en_nz" | "en_za" | "en_tt" | "en_gb" | "en_us" | "et" | "fo" | "fa" | "fi" | "fr_be" | "fr_ca" | "fr_lu" | "fr" | "fr_ch" | "gd" | "de_at" | "de_li" | "de_lu" | "de" | "de_ch" | "el" | "he" | "hi" | "hu" | "is" | "ga" | "it" | "it_ch" | "ja" | "ko" | "ku" | "lv" | "lt" | "mk" | "ml" | "ms" | "mt" | "no" | "nb" | "nn" | "pl" | "pt_br" | "pt" | "pa" | "rm" | "ro" | "ro_md" | "ru" | "ru_md" | "sr" | "sk" | "sl" | "sb" | "es_ar" | "es_bo" | "es_cl" | "es_co" | "es_cr" | "es_do" | "es_ec" | "es_sv" | "es_gt" | "es_hn" | "es_mx" | "es" | "sv" | "sv_fi" | "th" | "tr" | "uk" | "ur" | "vi" | "cy" | "ji" | "zu" | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const ProductCategorySchema: z.ZodObject<{
|
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
export declare const LocalizedProductCategorySchema: z.ZodObject<{
|
|
21
21
|
id: z.ZodString;
|
|
22
|
-
|
|
22
|
+
createdAt: z.ZodDate;
|
|
23
23
|
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
24
24
|
id: z.ZodString;
|
|
25
25
|
url: z.ZodString;
|
|
@@ -27,18 +27,12 @@ export declare const LocalizedProductCategorySchema: z.ZodObject<{
|
|
|
27
27
|
size: z.ZodNumber;
|
|
28
28
|
filename: z.ZodString;
|
|
29
29
|
}, z.core.$strip>>>;
|
|
30
|
-
|
|
30
|
+
slug: z.ZodString;
|
|
31
31
|
publishedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
32
32
|
title: z.ZodDefault<z.ZodString>;
|
|
33
33
|
description: z.ZodDefault<z.ZodString>;
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
export declare const CreateProductCategorySchema: z.ZodObject<{
|
|
36
|
-
translations: z.ZodArray<z.ZodObject<{
|
|
37
|
-
locale: z.ZodString;
|
|
38
|
-
title: z.ZodDefault<z.ZodString>;
|
|
39
|
-
description: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
40
|
-
}, z.core.$strip>>;
|
|
41
|
-
slug: z.ZodString;
|
|
42
36
|
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
43
37
|
id: z.ZodString;
|
|
44
38
|
url: z.ZodString;
|
|
@@ -46,16 +40,16 @@ export declare const CreateProductCategorySchema: z.ZodObject<{
|
|
|
46
40
|
size: z.ZodNumber;
|
|
47
41
|
filename: z.ZodString;
|
|
48
42
|
}, z.core.$strip>>>;
|
|
43
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
44
|
+
locale: z.ZodString;
|
|
45
|
+
title: z.ZodDefault<z.ZodString>;
|
|
46
|
+
description: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
slug: z.ZodString;
|
|
49
49
|
defaultLocale: z.ZodString;
|
|
50
50
|
imageId: z.ZodOptional<z.ZodString>;
|
|
51
51
|
}, z.core.$strip>;
|
|
52
52
|
export declare const UpdateProductCategorySchema: z.ZodObject<{
|
|
53
|
-
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
54
|
-
locale: z.ZodString;
|
|
55
|
-
title: z.ZodDefault<z.ZodString>;
|
|
56
|
-
description: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
57
|
-
}, z.core.$strip>>>;
|
|
58
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
59
53
|
image: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
60
54
|
id: z.ZodString;
|
|
61
55
|
url: z.ZodString;
|
|
@@ -63,6 +57,12 @@ export declare const UpdateProductCategorySchema: z.ZodObject<{
|
|
|
63
57
|
size: z.ZodNumber;
|
|
64
58
|
filename: z.ZodString;
|
|
65
59
|
}, z.core.$strip>>>>;
|
|
60
|
+
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
locale: z.ZodString;
|
|
62
|
+
title: z.ZodDefault<z.ZodString>;
|
|
63
|
+
description: z.ZodOptional<z.ZodDefault<z.ZodNullable<z.ZodString>>>;
|
|
64
|
+
}, z.core.$strip>>>;
|
|
65
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
66
66
|
defaultLocale: z.ZodOptional<z.ZodString>;
|
|
67
67
|
imageId: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
68
68
|
}, z.core.$strip>;
|
|
@@ -54,8 +54,8 @@ declare class ProductCategoryService {
|
|
|
54
54
|
publishedAt?: Date | null | undefined;
|
|
55
55
|
} | {
|
|
56
56
|
id: string;
|
|
57
|
-
slug: string;
|
|
58
57
|
createdAt: Date;
|
|
58
|
+
slug: string;
|
|
59
59
|
title: string;
|
|
60
60
|
description: string;
|
|
61
61
|
image?: {
|
|
@@ -116,8 +116,8 @@ declare class ProductCategoryService {
|
|
|
116
116
|
};
|
|
117
117
|
list: {
|
|
118
118
|
id: string;
|
|
119
|
-
slug: string;
|
|
120
119
|
createdAt: Date;
|
|
120
|
+
slug: string;
|
|
121
121
|
title: string;
|
|
122
122
|
description: string;
|
|
123
123
|
image?: {
|
package/src/schemas/index.d.ts
CHANGED
package/src/schemas/index.js
CHANGED
package/src/schemas/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/rest-api/src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,iBAAiB,CAAC;AAChC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/rest-api/src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCA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