@zyacreatives/shared 1.6.1 → 1.6.3

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.
@@ -80,7 +80,17 @@ export declare const INVESTOR_VERIFICATION_DOCUMENT_TYPES: {
80
80
  readonly BUSINESS_REGISTRATION: "BUSINESS_REGISTRATION";
81
81
  readonly OTHER_CERTIFICATE: "OTHER_CERTIFICATE";
82
82
  };
83
+ export declare const LIKE_PARENT_TYPES: {
84
+ readonly PROJECT: "PROJECT";
85
+ readonly POST: "POST";
86
+ };
87
+ export declare const COMMENT_PARENT_TYPES: {
88
+ readonly PROJECT: "PROJECT";
89
+ readonly POST: "POST";
90
+ };
83
91
  export type Role = (typeof ROLES)[keyof typeof ROLES];
92
+ export type LikeParentType = (typeof LIKE_PARENT_TYPES)[keyof typeof LIKE_PARENT_TYPES];
93
+ export type CommentParentType = (typeof COMMENT_PARENT_TYPES)[keyof typeof COMMENT_PARENT_TYPES];
84
94
  export type UserStatus = (typeof USER_STATUSES)[keyof typeof USER_STATUSES];
85
95
  export type ClientType = (typeof CLIENT_TYPES)[keyof typeof CLIENT_TYPES];
86
96
  export type ExperienceLevel = (typeof EXPERIENCE_LEVELS)[keyof typeof EXPERIENCE_LEVELS];
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_DISCIPLINES = exports.API_ROUTES = exports.INVESTOR_VERIFICATION_DOCUMENT_TYPES = exports.INVESTOR_VERIFICATION_DOCUMENT_STATUSES = exports.GEOGRAPHIC_FOCUS = exports.INVESTMENT_SIZES = exports.INVESTOR_TYPES = exports.ONBOARDING_PAGES = exports.EXPERIENCE_LEVELS = exports.CLIENT_TYPES = exports.USER_STATUSES = exports.ROLES = void 0;
3
+ exports.DEFAULT_DISCIPLINES = exports.API_ROUTES = exports.COMMENT_PARENT_TYPES = exports.LIKE_PARENT_TYPES = exports.INVESTOR_VERIFICATION_DOCUMENT_TYPES = exports.INVESTOR_VERIFICATION_DOCUMENT_STATUSES = exports.GEOGRAPHIC_FOCUS = exports.INVESTMENT_SIZES = exports.INVESTOR_TYPES = exports.ONBOARDING_PAGES = exports.EXPERIENCE_LEVELS = exports.CLIENT_TYPES = exports.USER_STATUSES = exports.ROLES = void 0;
4
4
  exports.ROLES = {
5
5
  CREATIVE: "CREATIVE",
6
6
  BRAND: "BRAND",
@@ -83,6 +83,11 @@ exports.INVESTOR_VERIFICATION_DOCUMENT_TYPES = {
83
83
  BUSINESS_REGISTRATION: "BUSINESS_REGISTRATION",
84
84
  OTHER_CERTIFICATE: "OTHER_CERTIFICATE",
85
85
  };
86
+ exports.LIKE_PARENT_TYPES = {
87
+ PROJECT: "PROJECT",
88
+ POST: "POST",
89
+ };
90
+ exports.COMMENT_PARENT_TYPES = exports.LIKE_PARENT_TYPES;
86
91
  exports.API_ROUTES = {
87
92
  healthCheck: "/health",
88
93
  username: {
@@ -5,9 +5,9 @@ export declare const BrandEntitySchema: z.ZodObject<{
5
5
  brandName: z.ZodString;
6
6
  bio: z.ZodOptional<z.ZodString>;
7
7
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
- disciplines: z.ZodArray<z.ZodString>;
8
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
9
9
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
10
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
10
+ updatedAt: z.ZodCoercedDate<unknown>;
11
11
  }, z.core.$strip>;
12
12
  export declare const ListBrandsInputSchema: z.ZodObject<{
13
13
  query: z.ZodOptional<z.ZodString>;
@@ -25,17 +25,22 @@ export declare const ListBrandsInputSchema: z.ZodObject<{
25
25
  }, z.core.$strip>;
26
26
  export declare const CreateBrandProfileInputSchema: z.ZodObject<{
27
27
  brandName: z.ZodString;
28
- bio: z.ZodDefault<z.ZodOptional<z.ZodString>>;
29
- tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
28
+ bio: z.ZodOptional<z.ZodString>;
29
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
30
  disciplineSlugs: z.ZodDefault<z.ZodArray<z.ZodString>>;
31
31
  }, z.core.$strip>;
32
32
  export declare const UpdateBrandProfileInputSchema: z.ZodObject<{
33
33
  brandName: z.ZodOptional<z.ZodString>;
34
34
  bio: z.ZodOptional<z.ZodString>;
35
35
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ disciplineSlugs: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
37
  }, z.core.$strip>;
37
- export declare const GetBrandParamsSchema: z.ZodObject<{
38
+ export declare const GetBrandInputSchema: z.ZodObject<{
38
39
  value: z.ZodCUID2;
40
+ by: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
41
+ id: "id";
42
+ userId: "userId";
43
+ }>>>;
39
44
  }, z.core.$strip>;
40
45
  export declare const GetBrandQuerySchema: z.ZodObject<{
41
46
  by: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
@@ -49,9 +54,9 @@ export declare const CreateBrandOutputSchema: z.ZodObject<{
49
54
  brandName: z.ZodString;
50
55
  bio: z.ZodOptional<z.ZodString>;
51
56
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
- disciplines: z.ZodArray<z.ZodString>;
57
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
58
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
54
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
59
+ updatedAt: z.ZodCoercedDate<unknown>;
55
60
  }, z.core.$strip>;
56
61
  export declare const GetBrandOutputSchema: z.ZodObject<{
57
62
  id: z.ZodCUID2;
@@ -59,9 +64,9 @@ export declare const GetBrandOutputSchema: z.ZodObject<{
59
64
  brandName: z.ZodString;
60
65
  bio: z.ZodOptional<z.ZodString>;
61
66
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
- disciplines: z.ZodArray<z.ZodString>;
67
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
68
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
64
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
69
+ updatedAt: z.ZodCoercedDate<unknown>;
65
70
  }, z.core.$strip>;
66
71
  export declare const UpdateBrandOutputSchema: z.ZodObject<{
67
72
  id: z.ZodCUID2;
@@ -69,7 +74,7 @@ export declare const UpdateBrandOutputSchema: z.ZodObject<{
69
74
  brandName: z.ZodString;
70
75
  bio: z.ZodOptional<z.ZodString>;
71
76
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
- disciplines: z.ZodArray<z.ZodString>;
77
+ disciplines: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
78
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
74
- updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
79
+ updatedAt: z.ZodCoercedDate<unknown>;
75
80
  }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.GetBrandQuerySchema = exports.GetBrandParamsSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.ListBrandsInputSchema = exports.BrandEntitySchema = void 0;
3
+ exports.UpdateBrandOutputSchema = exports.GetBrandOutputSchema = exports.CreateBrandOutputSchema = exports.GetBrandQuerySchema = exports.GetBrandInputSchema = exports.UpdateBrandProfileInputSchema = exports.CreateBrandProfileInputSchema = exports.ListBrandsInputSchema = exports.BrandEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const common_1 = require("./common");
6
6
  const constants_1 = require("../constants");
@@ -19,17 +19,15 @@ exports.BrandEntitySchema = zod_openapi_1.z
19
19
  .openapi({ example: ["technology", "saas", "startup"] }),
20
20
  disciplines: zod_openapi_1.z
21
21
  .array(zod_openapi_1.z.string())
22
+ .optional()
22
23
  .openapi({ example: ["Marketing", "Product Development"] }),
23
24
  createdAt: zod_openapi_1.z.coerce
24
25
  .date()
25
26
  .optional()
26
27
  .openapi({ example: "2025-10-13T09:00:00.000Z" }),
27
- updatedAt: zod_openapi_1.z.coerce
28
- .date()
29
- .optional()
30
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
28
+ updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
31
29
  })
32
- .openapi("BrandEntity");
30
+ .openapi("BrandEntitySchema");
33
31
  exports.ListBrandsInputSchema = zod_openapi_1.z
34
32
  .object({
35
33
  query: zod_openapi_1.z.string().optional().openapi({ example: "AI software brand" }),
@@ -41,6 +39,7 @@ exports.ListBrandsInputSchema = zod_openapi_1.z
41
39
  .array(zod_openapi_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)))
42
40
  .optional()
43
41
  .openapi({
42
+ example: ["SENIOR", "EXPERT"],
44
43
  description: "Filter based on the required experience level of partners.",
45
44
  }),
46
45
  location: zod_openapi_1.z.string().optional().openapi({ example: "San Francisco" }),
@@ -65,13 +64,16 @@ exports.CreateBrandProfileInputSchema = zod_openapi_1.z
65
64
  .string()
66
65
  .min(1, "Brand name is required")
67
66
  .openapi({ example: "Acme Creative Studio" }),
68
- bio: zod_openapi_1.z.string().max(210).optional().default("").openapi({
67
+ bio: zod_openapi_1.z
68
+ .string()
69
+ .max(210)
70
+ .optional()
71
+ .openapi({
69
72
  example: "We help brands tell their stories through design.",
70
73
  }),
71
74
  tags: zod_openapi_1.z
72
75
  .array(zod_openapi_1.z.string())
73
76
  .optional()
74
- .default([])
75
77
  .openapi({ example: ["branding", "ux", "campaigns"] }),
76
78
  disciplineSlugs: zod_openapi_1.z
77
79
  .array(zod_openapi_1.z.string())
@@ -85,19 +87,27 @@ exports.CreateBrandProfileInputSchema = zod_openapi_1.z
85
87
  exports.UpdateBrandProfileInputSchema = zod_openapi_1.z
86
88
  .object({
87
89
  brandName: zod_openapi_1.z.string().min(1).optional().openapi({ example: "Acme Studio" }),
88
- bio: zod_openapi_1.z.string().max(210).optional().openapi({
89
- example: "Updated bio for our creative agency.",
90
- }),
90
+ bio: zod_openapi_1.z
91
+ .string()
92
+ .max(210)
93
+ .optional()
94
+ .openapi({ example: "Updated bio for our creative agency." }),
91
95
  tags: zod_openapi_1.z
92
96
  .array(zod_openapi_1.z.string())
93
97
  .optional()
94
98
  .openapi({ example: ["branding", "product", "illustration"] }),
99
+ disciplineSlugs: zod_openapi_1.z
100
+ .array(zod_openapi_1.z.string())
101
+ .min(1, "At least one discipline is required")
102
+ .optional()
103
+ .openapi({ example: ["frontend", "ui-ux"] }),
95
104
  })
96
105
  .openapi({
97
106
  title: "update brand profile",
98
107
  });
99
- exports.GetBrandParamsSchema = zod_openapi_1.z.object({
100
- value: common_1.CuidSchema,
108
+ exports.GetBrandInputSchema = zod_openapi_1.z.object({
109
+ value: zod_openapi_1.z.cuid2(),
110
+ by: common_1.ProfileIdentifierSchema.shape.by,
101
111
  });
102
112
  exports.GetBrandQuerySchema = common_1.ProfileIdentifierSchema;
103
113
  exports.CreateBrandOutputSchema = exports.BrandEntitySchema;
@@ -1,11 +1,10 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { BrandEntitySchema, CreateBrandOutputSchema, CreateBrandProfileInputSchema, GetBrandOutputSchema, GetBrandParamsSchema, GetBrandQuerySchema, ListBrandsInputSchema, UpdateBrandOutputSchema, UpdateBrandProfileInputSchema } from "../schemas";
2
+ import { BrandEntitySchema, ListBrandsInputSchema, CreateBrandProfileInputSchema, UpdateBrandProfileInputSchema, GetBrandInputSchema, CreateBrandOutputSchema, GetBrandOutputSchema, UpdateBrandOutputSchema } from "../schemas/brand";
3
3
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
4
4
  export type ListBrandsInput = z.infer<typeof ListBrandsInputSchema>;
5
- export type CreateBrandInput = z.infer<typeof CreateBrandProfileInputSchema>;
6
- export type UpdateBrandInput = z.infer<typeof UpdateBrandProfileInputSchema>;
7
- export type GetBrandParams = z.infer<typeof GetBrandParamsSchema>;
8
- export type GetBrandQuery = z.infer<typeof GetBrandQuerySchema>;
5
+ export type CreateBrandProfileInput = z.infer<typeof CreateBrandProfileInputSchema>;
6
+ export type UpdateBrandProfileInput = z.infer<typeof UpdateBrandProfileInputSchema>;
7
+ export type GetBrandInput = z.infer<typeof GetBrandInputSchema>;
9
8
  export type CreateBrandOutput = z.infer<typeof CreateBrandOutputSchema>;
10
9
  export type GetBrandOutput = z.infer<typeof GetBrandOutputSchema>;
11
10
  export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -90,7 +90,18 @@ export const INVESTOR_VERIFICATION_DOCUMENT_TYPES = {
90
90
  OTHER_CERTIFICATE: "OTHER_CERTIFICATE",
91
91
  } as const;
92
92
 
93
+ export const LIKE_PARENT_TYPES = {
94
+ PROJECT: "PROJECT",
95
+ POST: "POST",
96
+ } as const;
97
+
98
+ export const COMMENT_PARENT_TYPES = LIKE_PARENT_TYPES;
99
+
93
100
  export type Role = (typeof ROLES)[keyof typeof ROLES];
101
+ export type LikeParentType =
102
+ (typeof LIKE_PARENT_TYPES)[keyof typeof LIKE_PARENT_TYPES];
103
+ export type CommentParentType =
104
+ (typeof COMMENT_PARENT_TYPES)[keyof typeof COMMENT_PARENT_TYPES];
94
105
  export type UserStatus = (typeof USER_STATUSES)[keyof typeof USER_STATUSES];
95
106
  export type ClientType = (typeof CLIENT_TYPES)[keyof typeof CLIENT_TYPES];
96
107
  export type ExperienceLevel =
@@ -253,4 +264,4 @@ export const DEFAULT_DISCIPLINES = [
253
264
  { name: "Comics / Graphic Novels", slug: "comics_graphic_novels" },
254
265
  { name: "Curation", slug: "curation" },
255
266
  { name: "Creative Entrepreneurship", slug: "creative_entrepreneurship" },
256
- ];
267
+ ];
@@ -17,17 +17,15 @@ export const BrandEntitySchema = z
17
17
  .openapi({ example: ["technology", "saas", "startup"] }),
18
18
  disciplines: z
19
19
  .array(z.string())
20
+ .optional()
20
21
  .openapi({ example: ["Marketing", "Product Development"] }),
21
22
  createdAt: z.coerce
22
23
  .date()
23
24
  .optional()
24
25
  .openapi({ example: "2025-10-13T09:00:00.000Z" }),
25
- updatedAt: z.coerce
26
- .date()
27
- .optional()
28
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
26
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
29
27
  })
30
- .openapi("BrandEntity");
28
+ .openapi("BrandEntitySchema");
31
29
 
32
30
  export const ListBrandsInputSchema = z
33
31
  .object({
@@ -47,6 +45,7 @@ export const ListBrandsInputSchema = z
47
45
  )
48
46
  .optional()
49
47
  .openapi({
48
+ example: ["SENIOR", "EXPERT"],
50
49
  description:
51
50
  "Filter based on the required experience level of partners.",
52
51
  }),
@@ -73,13 +72,16 @@ export const CreateBrandProfileInputSchema = z
73
72
  .string()
74
73
  .min(1, "Brand name is required")
75
74
  .openapi({ example: "Acme Creative Studio" }),
76
- bio: z.string().max(210).optional().default("").openapi({
77
- example: "We help brands tell their stories through design.",
78
- }),
75
+ bio: z
76
+ .string()
77
+ .max(210)
78
+ .optional()
79
+ .openapi({
80
+ example: "We help brands tell their stories through design.",
81
+ }),
79
82
  tags: z
80
83
  .array(z.string())
81
84
  .optional()
82
- .default([])
83
85
  .openapi({ example: ["branding", "ux", "campaigns"] }),
84
86
  disciplineSlugs: z
85
87
  .array(z.string())
@@ -94,20 +96,28 @@ export const CreateBrandProfileInputSchema = z
94
96
  export const UpdateBrandProfileInputSchema = z
95
97
  .object({
96
98
  brandName: z.string().min(1).optional().openapi({ example: "Acme Studio" }),
97
- bio: z.string().max(210).optional().openapi({
98
- example: "Updated bio for our creative agency.",
99
- }),
99
+ bio: z
100
+ .string()
101
+ .max(210)
102
+ .optional()
103
+ .openapi({ example: "Updated bio for our creative agency." }),
100
104
  tags: z
101
105
  .array(z.string())
102
106
  .optional()
103
107
  .openapi({ example: ["branding", "product", "illustration"] }),
108
+ disciplineSlugs: z
109
+ .array(z.string())
110
+ .min(1, "At least one discipline is required")
111
+ .optional()
112
+ .openapi({ example: ["frontend", "ui-ux"] }),
104
113
  })
105
114
  .openapi({
106
115
  title: "update brand profile",
107
116
  });
108
117
 
109
- export const GetBrandParamsSchema = z.object({
110
- value: CuidSchema,
118
+ export const GetBrandInputSchema = z.object({
119
+ value: z.cuid2(),
120
+ by: ProfileIdentifierSchema.shape.by,
111
121
  });
112
122
 
113
123
  export const GetBrandQuerySchema = ProfileIdentifierSchema;
@@ -1,35 +1,31 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import {
3
3
  BrandEntitySchema,
4
- CreateBrandOutputSchema,
4
+ ListBrandsInputSchema,
5
5
  CreateBrandProfileInputSchema,
6
+ UpdateBrandProfileInputSchema,
7
+ GetBrandInputSchema,
8
+ CreateBrandOutputSchema,
6
9
  GetBrandOutputSchema,
7
- GetBrandParamsSchema,
8
- GetBrandQuerySchema,
9
- ListBrandsInputSchema,
10
10
  UpdateBrandOutputSchema,
11
- UpdateBrandProfileInputSchema,
12
- } from "../schemas";
11
+ } from "../schemas/brand";
13
12
 
14
13
  export type BrandEntity = z.infer<typeof BrandEntitySchema>;
15
14
 
16
15
  export type ListBrandsInput = z.infer<typeof ListBrandsInputSchema>;
17
16
 
18
- export type CreateBrandInput = z.infer<typeof CreateBrandProfileInputSchema>
17
+ export type CreateBrandProfileInput = z.infer<
18
+ typeof CreateBrandProfileInputSchema
19
+ >;
19
20
 
20
- export type UpdateBrandInput = z.infer<typeof UpdateBrandProfileInputSchema>
21
- export type GetBrandParams = z.infer<typeof GetBrandParamsSchema>;
21
+ export type UpdateBrandProfileInput = z.infer<
22
+ typeof UpdateBrandProfileInputSchema
23
+ >;
22
24
 
23
- export type GetBrandQuery = z.infer<typeof GetBrandQuerySchema>;
25
+ export type GetBrandInput = z.infer<typeof GetBrandInputSchema>;
24
26
 
25
- export type CreateBrandOutput = z.infer<
26
- typeof CreateBrandOutputSchema
27
- >;
27
+ export type CreateBrandOutput = z.infer<typeof CreateBrandOutputSchema>;
28
28
 
29
- export type GetBrandOutput = z.infer<
30
- typeof GetBrandOutputSchema
31
- >;
29
+ export type GetBrandOutput = z.infer<typeof GetBrandOutputSchema>;
32
30
 
33
- export type UpdateBrandOutput = z.infer<
34
- typeof UpdateBrandOutputSchema
35
- >;
31
+ export type UpdateBrandOutput = z.infer<typeof UpdateBrandOutputSchema>;
package/src/types/user.ts CHANGED
@@ -1,6 +1,4 @@
1
- // user.types.ts
2
1
  import {
3
- UserSocialGraphEntitySchema,
4
2
  BaseUserEntitySchema,
5
3
  MinimalUserSchema,
6
4
  UserEntitySchema,