@zyacreatives/shared 2.4.5 → 2.4.6

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.
@@ -314,9 +314,13 @@ 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 SearchProductInpuSchema: z.ZodObject<{
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<{
@@ -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 type SearchProductInput = z.infer<typeof SearchProductInpuSchema>;
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.ZodCUID2;
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.ZodCUID2;
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>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchProductOutputSchema = exports.SearchProductInpuSchema = 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;
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({
@@ -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.SearchProductInpuSchema = zod_openapi_1.z.object({
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.4.5",
3
+ "version": "2.4.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -281,13 +281,17 @@ export const ProductSearchDocumentSchema = z.object({
281
281
  deletedAt: z.coerce.date().optional().nullable(),
282
282
  });
283
283
 
284
- export const SearchProductInpuSchema = z.object({
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 SearchProductInpuSchema>;
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
  >;