@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.
- package/dist/schemas/brand.d.ts +1 -0
- package/dist/schemas/brand.js +5 -0
- package/dist/schemas/creative.d.ts +0 -17
- package/dist/schemas/creative.js +3 -4
- package/dist/schemas/project.js +1 -1
- package/dist/schemas/user.js +1 -1
- package/dist/types/common.d.ts +4 -10
- package/package.json +1 -1
- package/src/schemas/brand.ts +5 -0
- package/src/schemas/creative.ts +2 -5
- package/src/schemas/project.ts +2 -2
- package/src/schemas/user.ts +2 -2
- package/src/types/common.ts +9 -10
package/dist/schemas/brand.d.ts
CHANGED
|
@@ -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>;
|
package/dist/schemas/brand.js
CHANGED
|
@@ -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;
|
package/dist/schemas/creative.js
CHANGED
|
@@ -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 =
|
|
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.
|
|
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("
|
|
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");
|
package/dist/schemas/project.js
CHANGED
|
@@ -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.
|
|
81
|
+
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend(exports.ProjectSocialGraphEntitySchema.shape)
|
|
82
82
|
.extend({
|
|
83
83
|
projectFiles: zod_openapi_1.z
|
|
84
84
|
.array(exports.ProjectFileEntitySchema)
|
package/dist/schemas/user.js
CHANGED
|
@@ -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.
|
|
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(),
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
package/src/schemas/brand.ts
CHANGED
|
@@ -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",
|
package/src/schemas/creative.ts
CHANGED
|
@@ -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
|
|
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("
|
|
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,
|
package/src/schemas/project.ts
CHANGED
|
@@ -79,8 +79,8 @@ export const ProjectSocialGraphEntitySchema = z
|
|
|
79
79
|
})
|
|
80
80
|
.openapi("ProjectSocialGraphEntity");
|
|
81
81
|
|
|
82
|
-
export const ProjectWithFilesEntitySchema = ProjectEntitySchema.
|
|
83
|
-
ProjectSocialGraphEntitySchema
|
|
82
|
+
export const ProjectWithFilesEntitySchema = ProjectEntitySchema.extend(
|
|
83
|
+
ProjectSocialGraphEntitySchema.shape
|
|
84
84
|
)
|
|
85
85
|
.extend({
|
|
86
86
|
projectFiles: z
|
package/src/schemas/user.ts
CHANGED
|
@@ -62,8 +62,8 @@ export const MinimalUserSchema = BaseUserEntitySchema.pick({
|
|
|
62
62
|
role: true,
|
|
63
63
|
}).openapi("MinimalUser");
|
|
64
64
|
|
|
65
|
-
export const UserEntitySchema = BaseUserEntitySchema.
|
|
66
|
-
UserSocialGraphEntitySchema
|
|
65
|
+
export const UserEntitySchema = BaseUserEntitySchema.extend(
|
|
66
|
+
UserSocialGraphEntitySchema.shape
|
|
67
67
|
).openapi("UserEntity");
|
|
68
68
|
|
|
69
69
|
export const UserProfileEntitySchema = UserEntitySchema.extend({
|
package/src/types/common.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
ProjectSocialGraphEntitySchema,
|
|
4
|
+
UserSocialGraphEntitySchema,
|
|
5
|
+
} from "../schemas";
|
|
7
6
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type ProjectSocialGraphEntity = z.infer<
|
|
8
|
+
typeof ProjectSocialGraphEntitySchema
|
|
9
|
+
>;
|
|
10
|
+
export type UserSocialGraphEntity = z.infer<typeof UserSocialGraphEntitySchema>;
|