@zyacreatives/shared 2.4.3 → 2.4.4

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.
@@ -285,6 +285,35 @@ export declare const ProductEntitySchema: z.ZodObject<{
285
285
  updatedAt: z.ZodCoercedDate<unknown>;
286
286
  deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
287
287
  }, z.core.$strip>;
288
+ export declare const ProductSearchDocumentSchema: z.ZodObject<{
289
+ id: z.ZodCUID2;
290
+ sellerId: z.ZodCUID2;
291
+ sellerUsername: z.ZodString;
292
+ sellerName: z.ZodString;
293
+ sellerImageUrl: z.ZodNullable<z.ZodString>;
294
+ title: z.ZodString;
295
+ category: z.ZodString;
296
+ subcategory: z.ZodNullable<z.ZodString>;
297
+ tags: z.ZodArray<z.ZodString>;
298
+ thumbnailImgUrl: z.ZodNullable<z.ZodString>;
299
+ currency: z.ZodEnum<{
300
+ readonly USD: "USD (United States Dollar)";
301
+ readonly EUR: "EUR (Euro)";
302
+ readonly GBP: "GBP (British Pound Sterling)";
303
+ readonly NGN: "NGN (Nigerian Naira)";
304
+ readonly CAD: "CAD (Canadian Dollar)";
305
+ readonly AUD: "AUD (Australian Dollar)";
306
+ readonly JPY: "JPY (Japanese Yen)";
307
+ readonly CHF: "CHF (Swiss Franc)";
308
+ readonly INR: "INR (Indian Rupee)";
309
+ readonly ZAR: "ZAR (South African Rand)";
310
+ }>;
311
+ price: z.ZodNullable<z.ZodNumber>;
312
+ suggestedPrice: z.ZodNullable<z.ZodNumber>;
313
+ createdAt: z.ZodCoercedDate<unknown>;
314
+ updatedAt: z.ZodCoercedDate<unknown>;
315
+ deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
316
+ }, z.core.$strip>;
288
317
  export type CoverImageInput = z.infer<typeof CoverImageInputSchema>;
289
318
  export type DeliveryFileInput = z.infer<typeof DeliveryFileInputSchema>;
290
319
  export type ProductCoverImageEntity = z.infer<typeof ProductCoverImageEntitySchema>;
@@ -295,3 +324,4 @@ export type ProductServiceAndComplianceInputEntity = z.infer<typeof ProductServi
295
324
  export type UpdateProductInputEntity = z.infer<typeof UpdateProductInputSchema>;
296
325
  export type ProductEntity = z.infer<typeof ProductEntitySchema>;
297
326
  export type BaseProductEntity = z.infer<typeof BaseProductSchema>;
327
+ export type ProductSearchDocument = z.infer<typeof ProductSearchDocumentSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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({
@@ -201,3 +201,21 @@ exports.ProductEntitySchema = zod_openapi_1.z
201
201
  deletedAt: zod_openapi_1.z.coerce.date().optional().nullable(),
202
202
  })
203
203
  .openapi({ title: "ProductEntity" });
204
+ exports.ProductSearchDocumentSchema = zod_openapi_1.z.object({
205
+ id: zod_openapi_1.z.cuid2(),
206
+ sellerId: zod_openapi_1.z.cuid2(),
207
+ sellerUsername: zod_openapi_1.z.string(),
208
+ sellerName: zod_openapi_1.z.string(),
209
+ sellerImageUrl: zod_openapi_1.z.string().url().nullable(),
210
+ title: zod_openapi_1.z.string(),
211
+ category: zod_openapi_1.z.string(),
212
+ subcategory: zod_openapi_1.z.string().nullable(),
213
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.string()),
214
+ thumbnailImgUrl: zod_openapi_1.z.string().url().nullable(),
215
+ currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
216
+ price: zod_openapi_1.z.number().nullable(),
217
+ suggestedPrice: zod_openapi_1.z.number().nullable(),
218
+ createdAt: zod_openapi_1.z.coerce.date(),
219
+ updatedAt: zod_openapi_1.z.coerce.date(),
220
+ deletedAt: zod_openapi_1.z.coerce.date().optional().nullable(),
221
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -260,7 +260,24 @@ export const ProductEntitySchema = z
260
260
  })
261
261
  .openapi({ title: "ProductEntity" });
262
262
 
263
- // --- Type Exports ---
263
+ export const ProductSearchDocumentSchema = z.object({
264
+ id: z.cuid2(),
265
+ sellerId: z.cuid2(),
266
+ sellerUsername: z.string(),
267
+ sellerName: z.string(),
268
+ sellerImageUrl: z.string().url().nullable(),
269
+ title: z.string(),
270
+ category: z.string(),
271
+ subcategory: z.string().nullable(),
272
+ tags: z.array(z.string()),
273
+ thumbnailImgUrl: z.string().url().nullable(),
274
+ currency: z.enum(WAGES_CURRENCY),
275
+ price: z.number().nullable(),
276
+ suggestedPrice: z.number().nullable(),
277
+ createdAt: z.coerce.date(),
278
+ updatedAt: z.coerce.date(),
279
+ deletedAt: z.coerce.date().optional().nullable(),
280
+ });
264
281
 
265
282
  export type CoverImageInput = z.infer<typeof CoverImageInputSchema>;
266
283
  export type DeliveryFileInput = z.infer<typeof DeliveryFileInputSchema>;
@@ -281,3 +298,4 @@ export type UpdateProductInputEntity = z.infer<typeof UpdateProductInputSchema>;
281
298
  export type ProductEntity = z.infer<typeof ProductEntitySchema>;
282
299
 
283
300
  export type BaseProductEntity = z.infer<typeof BaseProductSchema>;
301
+ export type ProductSearchDocument = z.infer<typeof ProductSearchDocumentSchema>;