@zyacreatives/shared 1.2.3 → 1.2.5

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.
@@ -49,6 +49,7 @@ export declare const CreateBrandProfileSchema: z.ZodObject<{
49
49
  brandName: z.ZodString;
50
50
  bio: z.ZodDefault<z.ZodOptional<z.ZodString>>;
51
51
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
52
+ disciplineSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
52
53
  }, z.core.$strip>;
53
54
  export declare const UpdateBrandProfileSchema: z.ZodObject<{
54
55
  brandName: z.ZodOptional<z.ZodString>;
@@ -77,6 +77,11 @@ exports.CreateBrandProfileSchema = zod_openapi_1.z
77
77
  .optional()
78
78
  .default([])
79
79
  .openapi({ example: ["branding", "ux", "campaigns"] }),
80
+ disciplineSlugs: zod_openapi_1.z
81
+ .array(zod_openapi_1.z.string())
82
+ .min(1, "At least one discipline is required")
83
+ .default([])
84
+ .openapi({ example: ["ui-ux", "frontend"] }),
80
85
  })
81
86
  .openapi({
82
87
  title: "create brand profile",
@@ -1,21 +1,4 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- export declare const BaseCreativeEntitySchema: z.ZodObject<{
3
- id: z.ZodCUID2;
4
- userId: z.ZodCUID2;
5
- bio: z.ZodOptional<z.ZodString>;
6
- location: z.ZodOptional<z.ZodString>;
7
- experienceLevel: z.ZodOptional<z.ZodEnum<{
8
- "0-1 year": "0-1 year";
9
- "1-3 years": "1-3 years";
10
- "3-5 years": "3-5 years";
11
- "5+ years": "5+ years";
12
- }>>;
13
- tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
- disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
- user: z.ZodOptional<z.ZodAny>;
16
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
17
- updatedAt: z.ZodCoercedDate<unknown>;
18
- }, z.core.$strip>;
19
2
  export declare const CreativeEntitySchema: z.ZodObject<{
20
3
  id: z.ZodCUID2;
21
4
  userId: z.ZodCUID2;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateCreativeEndpointResponseSchema = exports.GetCreativeEndpointResponseSchema = exports.CreateCreativeEndpointResponseSchema = exports.GetCreativeQuerySchema = exports.GetCreativeParamsSchema = exports.UpdateCreativeProfileSchema = exports.CreateCreativeProfileSchema = exports.ListCreativesInputSchema = exports.CreativeWithUserEntitySchema = exports.CreativeEntitySchema = exports.BaseCreativeEntitySchema = void 0;
3
+ exports.UpdateCreativeEndpointResponseSchema = exports.GetCreativeEndpointResponseSchema = exports.CreateCreativeEndpointResponseSchema = exports.GetCreativeQuerySchema = exports.GetCreativeParamsSchema = exports.UpdateCreativeProfileSchema = exports.CreateCreativeProfileSchema = exports.ListCreativesInputSchema = exports.CreativeWithUserEntitySchema = exports.CreativeEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const common_1 = require("./common");
7
7
  const user_1 = require("./user");
8
- exports.BaseCreativeEntitySchema = zod_openapi_1.z
8
+ exports.CreativeEntitySchema = zod_openapi_1.z
9
9
  .object({
10
10
  id: zod_openapi_1.z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
11
11
  userId: zod_openapi_1.z.cuid2().openapi({ example: "user_abc123" }),
@@ -32,8 +32,7 @@ exports.BaseCreativeEntitySchema = zod_openapi_1.z
32
32
  .openapi({ example: "2025-10-13T09:00:00.000Z" }),
33
33
  updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
34
34
  })
35
- .openapi("BaseCreativeEntity");
36
- exports.CreativeEntitySchema = exports.BaseCreativeEntitySchema.openapi("CreativeEntity");
35
+ .openapi("CreativeEntitySchema");
37
36
  exports.CreativeWithUserEntitySchema = exports.CreativeEntitySchema.extend({
38
37
  user: user_1.MinimalUserSchema,
39
38
  }).openapi("CreativeWithUserEntity");
@@ -78,7 +78,7 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
78
78
  noOfViews: zod_openapi_1.z.number().int().optional().openapi({ example: 1200 }),
79
79
  })
80
80
  .openapi("ProjectSocialGraphEntity");
81
- exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.merge(exports.ProjectSocialGraphEntitySchema)
81
+ exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend(exports.ProjectSocialGraphEntitySchema.shape)
82
82
  .extend({
83
83
  projectFiles: zod_openapi_1.z
84
84
  .array(exports.ProjectFileEntitySchema)
@@ -57,7 +57,7 @@ exports.MinimalUserSchema = exports.BaseUserEntitySchema.pick({
57
57
  username: true,
58
58
  role: true,
59
59
  }).openapi("MinimalUser");
60
- exports.UserEntitySchema = exports.BaseUserEntitySchema.merge(exports.UserSocialGraphEntitySchema).openapi("UserEntity");
60
+ exports.UserEntitySchema = exports.BaseUserEntitySchema.extend(exports.UserSocialGraphEntitySchema.shape).openapi("UserEntity");
61
61
  exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
62
62
  profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional(),
63
63
  bio: zod_openapi_1.z.string().optional(),
@@ -1,10 +1,4 @@
1
- export type ProjectSocialGraphEntity = {
2
- noOfLikes?: number;
3
- noOfComments?: number;
4
- noOfBookmarks?: number;
5
- noOfViews?: number;
6
- };
7
- export type UserSocialGraphEntity = {
8
- followerCount?: number;
9
- followingCount?: number;
10
- };
1
+ import z from "zod";
2
+ import { ProjectSocialGraphEntitySchema, UserSocialGraphEntitySchema } from "../schemas";
3
+ export type ProjectSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
4
+ export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -86,6 +86,11 @@ export const CreateBrandProfileSchema = z
86
86
  .optional()
87
87
  .default([])
88
88
  .openapi({ example: ["branding", "ux", "campaigns"] }),
89
+ disciplineSlugs: z
90
+ .array(z.string())
91
+ .min(1, "At least one discipline is required")
92
+ .default([])
93
+ .openapi({ example: ["ui-ux", "frontend"] }),
89
94
  })
90
95
  .openapi({
91
96
  title: "create brand profile",
@@ -3,7 +3,7 @@ import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
3
3
  import { CuidSchema, ProfileIdentifierSchema } from "./common";
4
4
  import { MinimalUserSchema } from "./user";
5
5
 
6
- export const BaseCreativeEntitySchema = z
6
+ export const CreativeEntitySchema = z
7
7
  .object({
8
8
  id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
9
9
  userId: z.cuid2().openapi({ example: "user_abc123" }),
@@ -35,10 +35,7 @@ export const BaseCreativeEntitySchema = z
35
35
  .openapi({ example: "2025-10-13T09:00:00.000Z" }),
36
36
  updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
37
37
  })
38
- .openapi("BaseCreativeEntity");
39
-
40
- export const CreativeEntitySchema =
41
- BaseCreativeEntitySchema.openapi("CreativeEntity");
38
+ .openapi("CreativeEntitySchema");
42
39
 
43
40
  export const CreativeWithUserEntitySchema = CreativeEntitySchema.extend({
44
41
  user: MinimalUserSchema,
@@ -79,8 +79,8 @@ export const ProjectSocialGraphEntitySchema = z
79
79
  })
80
80
  .openapi("ProjectSocialGraphEntity");
81
81
 
82
- export const ProjectWithFilesEntitySchema = ProjectEntitySchema.merge(
83
- ProjectSocialGraphEntitySchema
82
+ export const ProjectWithFilesEntitySchema = ProjectEntitySchema.extend(
83
+ ProjectSocialGraphEntitySchema.shape
84
84
  )
85
85
  .extend({
86
86
  projectFiles: z
@@ -62,8 +62,8 @@ export const MinimalUserSchema = BaseUserEntitySchema.pick({
62
62
  role: true,
63
63
  }).openapi("MinimalUser");
64
64
 
65
- export const UserEntitySchema = BaseUserEntitySchema.merge(
66
- UserSocialGraphEntitySchema
65
+ export const UserEntitySchema = BaseUserEntitySchema.extend(
66
+ UserSocialGraphEntitySchema.shape
67
67
  ).openapi("UserEntity");
68
68
 
69
69
  export const UserProfileEntitySchema = UserEntitySchema.extend({
@@ -1,11 +1,10 @@
1
- export type ProjectSocialGraphEntity = {
2
- noOfLikes?: number;
3
- noOfComments?: number;
4
- noOfBookmarks?: number;
5
- noOfViews?: number;
6
- };
1
+ import z from "zod";
2
+ import {
3
+ ProjectSocialGraphEntitySchema,
4
+ UserSocialGraphEntitySchema,
5
+ } from "../schemas";
7
6
 
8
- export type UserSocialGraphEntity = {
9
- followerCount?: number;
10
- followingCount?: number;
11
- };
7
+ export type ProjectSocialGraphEntity = z.infer<
8
+ typeof ProjectSocialGraphEntitySchema
9
+ >;
10
+ export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;