@zyacreatives/shared 2.4.5 → 2.4.7
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/schemas/product.d.ts +82 -6
- package/dist/schemas/product.js +19 -5
- package/dist/schemas/user.d.ts +2 -2
- package/package.json +1 -1
- package/src/schemas/product.ts +27 -5
|
@@ -221,7 +221,7 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
|
|
|
221
221
|
id: z.ZodCUID2;
|
|
222
222
|
}, z.core.$strip>;
|
|
223
223
|
export declare const ProductEntitySchema: z.ZodObject<{
|
|
224
|
-
id: z.
|
|
224
|
+
id: z.ZodString;
|
|
225
225
|
sellerId: z.ZodCUID2;
|
|
226
226
|
sellerUsername: z.ZodString;
|
|
227
227
|
sellerName: z.ZodString;
|
|
@@ -286,7 +286,7 @@ export declare const ProductEntitySchema: z.ZodObject<{
|
|
|
286
286
|
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
287
287
|
}, z.core.$strip>;
|
|
288
288
|
export declare const ProductSearchDocumentSchema: z.ZodObject<{
|
|
289
|
-
id: z.
|
|
289
|
+
id: z.ZodString;
|
|
290
290
|
sellerId: z.ZodCUID2;
|
|
291
291
|
sellerUsername: z.ZodString;
|
|
292
292
|
sellerName: z.ZodString;
|
|
@@ -314,13 +314,17 @@ export declare const ProductSearchDocumentSchema: z.ZodObject<{
|
|
|
314
314
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
315
315
|
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
316
316
|
}, z.core.$strip>;
|
|
317
|
-
export declare const
|
|
318
|
-
queryString: z.ZodString
|
|
317
|
+
export declare const SearchProductInputSchema: z.ZodObject<{
|
|
318
|
+
queryString: z.ZodOptional<z.ZodString>;
|
|
319
319
|
cursor: z.ZodOptional<z.ZodString>;
|
|
320
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
321
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
322
|
+
category: z.ZodOptional<z.ZodString>;
|
|
323
|
+
subcategory: z.ZodOptional<z.ZodString>;
|
|
320
324
|
}, z.core.$strip>;
|
|
321
325
|
export declare const SearchProductOutputSchema: z.ZodObject<{
|
|
322
326
|
products: z.ZodArray<z.ZodObject<{
|
|
323
|
-
id: z.
|
|
327
|
+
id: z.ZodString;
|
|
324
328
|
sellerId: z.ZodCUID2;
|
|
325
329
|
sellerUsername: z.ZodString;
|
|
326
330
|
sellerName: z.ZodString;
|
|
@@ -350,10 +354,82 @@ export declare const SearchProductOutputSchema: z.ZodObject<{
|
|
|
350
354
|
}, z.core.$strip>>;
|
|
351
355
|
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
352
356
|
}, z.core.$strip>;
|
|
353
|
-
export
|
|
357
|
+
export declare const MarketplaceCategorySchema: z.ZodObject<{
|
|
358
|
+
name: z.ZodString;
|
|
359
|
+
imgUrl: z.ZodString;
|
|
360
|
+
subcategories: z.ZodArray<z.ZodString>;
|
|
361
|
+
}, z.core.$strip>;
|
|
362
|
+
export declare const GetMarketplaceInfoOutputSchema: z.ZodObject<{
|
|
363
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
364
|
+
name: z.ZodString;
|
|
365
|
+
imgUrl: z.ZodString;
|
|
366
|
+
subcategories: z.ZodArray<z.ZodString>;
|
|
367
|
+
}, z.core.$strip>>;
|
|
368
|
+
whatsHot: z.ZodArray<z.ZodObject<{
|
|
369
|
+
id: z.ZodString;
|
|
370
|
+
sellerId: z.ZodCUID2;
|
|
371
|
+
sellerUsername: z.ZodString;
|
|
372
|
+
sellerName: z.ZodString;
|
|
373
|
+
sellerImageUrl: z.ZodNullable<z.ZodString>;
|
|
374
|
+
title: z.ZodString;
|
|
375
|
+
category: z.ZodString;
|
|
376
|
+
subcategory: z.ZodNullable<z.ZodString>;
|
|
377
|
+
tags: z.ZodArray<z.ZodString>;
|
|
378
|
+
thumbnailImgUrl: z.ZodNullable<z.ZodURL>;
|
|
379
|
+
currency: z.ZodEnum<{
|
|
380
|
+
readonly USD: "USD (United States Dollar)";
|
|
381
|
+
readonly EUR: "EUR (Euro)";
|
|
382
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
383
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
384
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
385
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
386
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
387
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
388
|
+
readonly INR: "INR (Indian Rupee)";
|
|
389
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
390
|
+
}>;
|
|
391
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
392
|
+
suggestedPrice: z.ZodNullable<z.ZodNumber>;
|
|
393
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
394
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
395
|
+
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
396
|
+
}, z.core.$strip>>;
|
|
397
|
+
communityFavourites: z.ZodArray<z.ZodObject<{
|
|
398
|
+
id: z.ZodString;
|
|
399
|
+
sellerId: z.ZodCUID2;
|
|
400
|
+
sellerUsername: z.ZodString;
|
|
401
|
+
sellerName: z.ZodString;
|
|
402
|
+
sellerImageUrl: z.ZodNullable<z.ZodString>;
|
|
403
|
+
title: z.ZodString;
|
|
404
|
+
category: z.ZodString;
|
|
405
|
+
subcategory: z.ZodNullable<z.ZodString>;
|
|
406
|
+
tags: z.ZodArray<z.ZodString>;
|
|
407
|
+
thumbnailImgUrl: z.ZodNullable<z.ZodURL>;
|
|
408
|
+
currency: z.ZodEnum<{
|
|
409
|
+
readonly USD: "USD (United States Dollar)";
|
|
410
|
+
readonly EUR: "EUR (Euro)";
|
|
411
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
412
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
413
|
+
readonly CAD: "CAD (Canadian Dollar)";
|
|
414
|
+
readonly AUD: "AUD (Australian Dollar)";
|
|
415
|
+
readonly JPY: "JPY (Japanese Yen)";
|
|
416
|
+
readonly CHF: "CHF (Swiss Franc)";
|
|
417
|
+
readonly INR: "INR (Indian Rupee)";
|
|
418
|
+
readonly ZAR: "ZAR (South African Rand)";
|
|
419
|
+
}>;
|
|
420
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
421
|
+
suggestedPrice: z.ZodNullable<z.ZodNumber>;
|
|
422
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
423
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
424
|
+
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
425
|
+
}, z.core.$strip>>;
|
|
426
|
+
}, z.core.$strip>;
|
|
427
|
+
export type SearchProductInput = z.infer<typeof SearchProductInputSchema>;
|
|
354
428
|
export type SearchProductOutput = z.infer<typeof SearchProductOutputSchema>;
|
|
355
429
|
export type CoverImageInput = z.infer<typeof CoverImageInputSchema>;
|
|
356
430
|
export type DeliveryFileInput = z.infer<typeof DeliveryFileInputSchema>;
|
|
431
|
+
export type MarketplaceCategoryOutput = z.infer<typeof MarketplaceCategorySchema>;
|
|
432
|
+
export type GetMarketplaceInfoOutput = z.infer<typeof GetMarketplaceInfoOutputSchema>;
|
|
357
433
|
export type ProductCoverImageEntity = z.infer<typeof ProductCoverImageEntitySchema>;
|
|
358
434
|
export type ProductDeliveryFileEntity = z.infer<typeof ProductDeliveryFileEntitySchema>;
|
|
359
435
|
export type ProductDiscountEntity = z.infer<typeof ProductDiscountEntitySchema>;
|
package/dist/schemas/product.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchProductOutputSchema = exports.
|
|
3
|
+
exports.GetMarketplaceInfoOutputSchema = exports.MarketplaceCategorySchema = exports.SearchProductOutputSchema = exports.SearchProductInputSchema = exports.ProductSearchDocumentSchema = exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.BaseProductSchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = exports.ProductDeliveryFileEntitySchema = exports.ProductCoverImageEntitySchema = exports.DeliveryFileInputSchema = exports.CoverImageInputSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
exports.CoverImageInputSchema = zod_openapi_1.z.object({
|
|
@@ -172,7 +172,7 @@ exports.UpdateProductInputSchema = ProductCoreInputSchema.extend(exports.Product
|
|
|
172
172
|
});
|
|
173
173
|
exports.ProductEntitySchema = zod_openapi_1.z
|
|
174
174
|
.object({
|
|
175
|
-
id: zod_openapi_1.z.
|
|
175
|
+
id: zod_openapi_1.z.string(),
|
|
176
176
|
sellerId: zod_openapi_1.z.cuid2().openapi({ description: "ID of the creator/seller" }),
|
|
177
177
|
sellerUsername: zod_openapi_1.z.string(),
|
|
178
178
|
sellerName: zod_openapi_1.z.string(),
|
|
@@ -204,7 +204,7 @@ exports.ProductEntitySchema = zod_openapi_1.z
|
|
|
204
204
|
})
|
|
205
205
|
.openapi({ title: "ProductEntity" });
|
|
206
206
|
exports.ProductSearchDocumentSchema = zod_openapi_1.z.object({
|
|
207
|
-
id: zod_openapi_1.z.
|
|
207
|
+
id: zod_openapi_1.z.string(),
|
|
208
208
|
sellerId: zod_openapi_1.z.cuid2(),
|
|
209
209
|
sellerUsername: zod_openapi_1.z.string(),
|
|
210
210
|
sellerName: zod_openapi_1.z.string(),
|
|
@@ -221,15 +221,29 @@ exports.ProductSearchDocumentSchema = zod_openapi_1.z.object({
|
|
|
221
221
|
updatedAt: zod_openapi_1.z.coerce.date(),
|
|
222
222
|
deletedAt: zod_openapi_1.z.coerce.date().optional().nullable(),
|
|
223
223
|
});
|
|
224
|
-
exports.
|
|
224
|
+
exports.SearchProductInputSchema = zod_openapi_1.z.object({
|
|
225
225
|
queryString: zod_openapi_1.z
|
|
226
226
|
.string()
|
|
227
|
-
.min(1, { message: "Search string cannot be empty" })
|
|
228
227
|
.max(200, { message: "Search string cannot exceed 200 characters" })
|
|
228
|
+
.optional()
|
|
229
229
|
.openapi({ example: "typescript utility types" }),
|
|
230
230
|
cursor: zod_openapi_1.z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
|
|
231
|
+
limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).optional().default(30),
|
|
232
|
+
filters: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
233
|
+
category: zod_openapi_1.z.string().optional(),
|
|
234
|
+
subcategory: zod_openapi_1.z.string().optional(),
|
|
231
235
|
});
|
|
232
236
|
exports.SearchProductOutputSchema = zod_openapi_1.z.object({
|
|
233
237
|
products: zod_openapi_1.z.array(exports.ProductSearchDocumentSchema),
|
|
234
238
|
nextCursor: zod_openapi_1.z.string().optional().nullable(),
|
|
235
239
|
});
|
|
240
|
+
exports.MarketplaceCategorySchema = zod_openapi_1.z.object({
|
|
241
|
+
name: zod_openapi_1.z.string(),
|
|
242
|
+
imgUrl: zod_openapi_1.z.string().url(),
|
|
243
|
+
subcategories: zod_openapi_1.z.array(zod_openapi_1.z.string()),
|
|
244
|
+
});
|
|
245
|
+
exports.GetMarketplaceInfoOutputSchema = zod_openapi_1.z.object({
|
|
246
|
+
categories: zod_openapi_1.z.array(exports.MarketplaceCategorySchema),
|
|
247
|
+
whatsHot: zod_openapi_1.z.array(exports.ProductSearchDocumentSchema),
|
|
248
|
+
communityFavourites: zod_openapi_1.z.array(exports.ProductSearchDocumentSchema),
|
|
249
|
+
});
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -670,7 +670,7 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
670
670
|
export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
671
671
|
userId: z.ZodCUID2;
|
|
672
672
|
products: z.ZodArray<z.ZodObject<{
|
|
673
|
-
id: z.
|
|
673
|
+
id: z.ZodString;
|
|
674
674
|
sellerId: z.ZodCUID2;
|
|
675
675
|
sellerUsername: z.ZodString;
|
|
676
676
|
sellerName: z.ZodString;
|
|
@@ -822,7 +822,7 @@ export declare const GetUserWithProductsOutputSchema: z.ZodObject<{
|
|
|
822
822
|
products: z.ZodObject<{
|
|
823
823
|
userId: z.ZodCUID2;
|
|
824
824
|
products: z.ZodArray<z.ZodObject<{
|
|
825
|
-
id: z.
|
|
825
|
+
id: z.ZodString;
|
|
826
826
|
sellerId: z.ZodCUID2;
|
|
827
827
|
sellerUsername: z.ZodString;
|
|
828
828
|
sellerName: z.ZodString;
|
package/package.json
CHANGED
package/src/schemas/product.ts
CHANGED
|
@@ -224,7 +224,7 @@ export const UpdateProductInputSchema = ProductCoreInputSchema.extend(
|
|
|
224
224
|
|
|
225
225
|
export const ProductEntitySchema = z
|
|
226
226
|
.object({
|
|
227
|
-
id: z.
|
|
227
|
+
id: z.string(),
|
|
228
228
|
|
|
229
229
|
sellerId: z.cuid2().openapi({ description: "ID of the creator/seller" }),
|
|
230
230
|
sellerUsername: z.string(),
|
|
@@ -263,7 +263,7 @@ export const ProductEntitySchema = z
|
|
|
263
263
|
.openapi({ title: "ProductEntity" });
|
|
264
264
|
|
|
265
265
|
export const ProductSearchDocumentSchema = z.object({
|
|
266
|
-
id: z.
|
|
266
|
+
id: z.string(),
|
|
267
267
|
sellerId: z.cuid2(),
|
|
268
268
|
sellerUsername: z.string(),
|
|
269
269
|
sellerName: z.string(),
|
|
@@ -281,13 +281,17 @@ export const ProductSearchDocumentSchema = z.object({
|
|
|
281
281
|
deletedAt: z.coerce.date().optional().nullable(),
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
export const
|
|
284
|
+
export const SearchProductInputSchema = z.object({
|
|
285
285
|
queryString: z
|
|
286
286
|
.string()
|
|
287
|
-
.min(1, { message: "Search string cannot be empty" })
|
|
288
287
|
.max(200, { message: "Search string cannot exceed 200 characters" })
|
|
288
|
+
.optional()
|
|
289
289
|
.openapi({ example: "typescript utility types" }),
|
|
290
290
|
cursor: z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
|
|
291
|
+
limit: z.coerce.number().int().min(1).max(100).optional().default(30),
|
|
292
|
+
filters: z.array(z.string()).optional(),
|
|
293
|
+
category: z.string().optional(),
|
|
294
|
+
subcategory: z.string().optional(),
|
|
291
295
|
});
|
|
292
296
|
|
|
293
297
|
export const SearchProductOutputSchema = z.object({
|
|
@@ -295,12 +299,30 @@ export const SearchProductOutputSchema = z.object({
|
|
|
295
299
|
nextCursor: z.string().optional().nullable(),
|
|
296
300
|
});
|
|
297
301
|
|
|
302
|
+
export const MarketplaceCategorySchema = z.object({
|
|
303
|
+
name: z.string(),
|
|
304
|
+
imgUrl: z.string().url(),
|
|
305
|
+
subcategories: z.array(z.string()),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
export const GetMarketplaceInfoOutputSchema = z.object({
|
|
309
|
+
categories: z.array(MarketplaceCategorySchema),
|
|
310
|
+
whatsHot: z.array(ProductSearchDocumentSchema),
|
|
311
|
+
communityFavourites: z.array(ProductSearchDocumentSchema),
|
|
312
|
+
});
|
|
298
313
|
|
|
299
|
-
export type SearchProductInput = z.infer<typeof
|
|
314
|
+
export type SearchProductInput = z.infer<typeof SearchProductInputSchema>;
|
|
300
315
|
export type SearchProductOutput = z.infer<typeof SearchProductOutputSchema>;
|
|
301
316
|
export type CoverImageInput = z.infer<typeof CoverImageInputSchema>;
|
|
302
317
|
export type DeliveryFileInput = z.infer<typeof DeliveryFileInputSchema>;
|
|
303
318
|
|
|
319
|
+
export type MarketplaceCategoryOutput = z.infer<
|
|
320
|
+
typeof MarketplaceCategorySchema
|
|
321
|
+
>;
|
|
322
|
+
export type GetMarketplaceInfoOutput = z.infer<
|
|
323
|
+
typeof GetMarketplaceInfoOutputSchema
|
|
324
|
+
>;
|
|
325
|
+
|
|
304
326
|
export type ProductCoverImageEntity = z.infer<
|
|
305
327
|
typeof ProductCoverImageEntitySchema
|
|
306
328
|
>;
|