@zyacreatives/shared 2.0.45 → 2.0.47
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/creative.js +29 -8
- package/dist/schemas/discipline.d.ts +4 -0
- package/dist/schemas/discipline.js +5 -5
- package/dist/schemas/post.d.ts +2 -0
- package/dist/schemas/post.js +1 -0
- package/package.json +1 -1
- package/src/schemas/creative.ts +48 -9
- package/src/schemas/discipline.ts +10 -10
- package/src/schemas/post.ts +1 -0
package/dist/schemas/creative.js
CHANGED
|
@@ -15,7 +15,7 @@ exports.CreativeEntitySchema = zod_openapi_1.z
|
|
|
15
15
|
experienceLevel: zod_openapi_1.z
|
|
16
16
|
.enum(Object.values(constants_1.EXPERIENCE_LEVELS))
|
|
17
17
|
.optional()
|
|
18
|
-
.openapi({ example:
|
|
18
|
+
.openapi({ example: constants_1.EXPERIENCE_LEVELS.YEAR_0_1 }),
|
|
19
19
|
tags: zod_openapi_1.z
|
|
20
20
|
.array(zod_openapi_1.z.string())
|
|
21
21
|
.optional()
|
|
@@ -30,7 +30,10 @@ exports.CreativeEntitySchema = zod_openapi_1.z
|
|
|
30
30
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
31
31
|
updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
32
32
|
})
|
|
33
|
-
.openapi(
|
|
33
|
+
.openapi({
|
|
34
|
+
title: "CreativeEntitySchema",
|
|
35
|
+
description: "Represents a creative profile, including bio, experience level, location, disciplines, tags, and timestamps.",
|
|
36
|
+
});
|
|
34
37
|
exports.ListCreativesInputSchema = zod_openapi_1.z
|
|
35
38
|
.object({
|
|
36
39
|
query: zod_openapi_1.z.string().optional().openapi({ example: "logo designer" }),
|
|
@@ -41,7 +44,9 @@ exports.ListCreativesInputSchema = zod_openapi_1.z
|
|
|
41
44
|
experienceLevels: zod_openapi_1.z
|
|
42
45
|
.array(zod_openapi_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)))
|
|
43
46
|
.optional()
|
|
44
|
-
.openapi({
|
|
47
|
+
.openapi({
|
|
48
|
+
example: [constants_1.EXPERIENCE_LEVELS.YEAR_1_3, constants_1.EXPERIENCE_LEVELS.YEAR_5_PLUS],
|
|
49
|
+
}),
|
|
45
50
|
location: zod_openapi_1.z.string().optional().openapi({ example: "Los Angeles" }),
|
|
46
51
|
tags: zod_openapi_1.z
|
|
47
52
|
.array(zod_openapi_1.z.string())
|
|
@@ -57,31 +62,47 @@ exports.ListCreativesInputSchema = zod_openapi_1.z
|
|
|
57
62
|
.optional()
|
|
58
63
|
.openapi({ example: 20 }),
|
|
59
64
|
})
|
|
60
|
-
.openapi(
|
|
65
|
+
.openapi({
|
|
66
|
+
title: "ListCreativesInput",
|
|
67
|
+
description: "Query parameters for filtering and paginating creatives. Supports text search, discipline filtering, experience level filtering, tag filtering, location filtering, and pagination settings.",
|
|
68
|
+
});
|
|
61
69
|
exports.CreateCreativeProfileInputSchema = zod_openapi_1.z
|
|
62
70
|
.object({
|
|
63
71
|
experienceLevel: zod_openapi_1.z
|
|
64
72
|
.enum(constants_1.EXPERIENCE_LEVELS)
|
|
73
|
+
.describe("Overall experience range of the creative.")
|
|
65
74
|
.default(constants_1.EXPERIENCE_LEVELS.YEAR_0_1)
|
|
66
|
-
.openapi({
|
|
75
|
+
.openapi({
|
|
76
|
+
example: constants_1.EXPERIENCE_LEVELS.YEAR_1_3,
|
|
77
|
+
}),
|
|
67
78
|
bio: zod_openapi_1.z
|
|
68
79
|
.string()
|
|
69
80
|
.max(210)
|
|
70
81
|
.optional()
|
|
71
|
-
.
|
|
82
|
+
.describe("Short professional summary or introduction.")
|
|
83
|
+
.openapi({
|
|
84
|
+
example: "I am a freelance UI/UX designer.",
|
|
85
|
+
}),
|
|
72
86
|
location: zod_openapi_1.z
|
|
73
87
|
.string()
|
|
74
88
|
.max(100)
|
|
75
89
|
.optional()
|
|
76
|
-
.
|
|
90
|
+
.describe("Primary location where the creative works or resides.")
|
|
91
|
+
.openapi({
|
|
92
|
+
example: "Lagos, Nigeria",
|
|
93
|
+
}),
|
|
77
94
|
disciplineSlugs: zod_openapi_1.z
|
|
78
95
|
.array(zod_openapi_1.z.string())
|
|
79
96
|
.min(1, "At least one discipline is required")
|
|
80
97
|
.default([])
|
|
81
|
-
.
|
|
98
|
+
.describe("List of discipline slugs representing the creative’s fields.")
|
|
99
|
+
.openapi({
|
|
100
|
+
example: ["ui-ux", "frontend"],
|
|
101
|
+
}),
|
|
82
102
|
})
|
|
83
103
|
.openapi({
|
|
84
104
|
title: "create creative profile",
|
|
105
|
+
description: "Payload for creating a new creative profile.",
|
|
85
106
|
});
|
|
86
107
|
exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
|
|
87
108
|
.object({
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const BaseDisciplineEntitySchema: z.ZodObject<{
|
|
3
|
+
slug: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
2
6
|
export declare const DisciplineEntitySchema: z.ZodObject<{
|
|
3
7
|
slug: z.ZodString;
|
|
4
8
|
name: z.ZodString;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SlugInputSchema = exports.GetDisciplinesOutputSchema = exports.GetDisciplinesInputSchema = exports.CreateDisciplinesOutputSchema = exports.CreateDisciplinesInputSchema = exports.DisciplineUpdateOutputSchema = exports.DisciplineEntitySchema = void 0;
|
|
3
|
+
exports.SlugInputSchema = exports.GetDisciplinesOutputSchema = exports.GetDisciplinesInputSchema = exports.CreateDisciplinesOutputSchema = exports.CreateDisciplinesInputSchema = exports.DisciplineUpdateOutputSchema = exports.DisciplineEntitySchema = exports.BaseDisciplineEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
|
-
exports.
|
|
6
|
-
.object({
|
|
5
|
+
exports.BaseDisciplineEntitySchema = zod_openapi_1.z.object({
|
|
7
6
|
slug: zod_openapi_1.z.string().openapi({ example: "digital-art" }),
|
|
8
7
|
name: zod_openapi_1.z.string().openapi({ example: "Digital Art" }),
|
|
8
|
+
});
|
|
9
|
+
exports.DisciplineEntitySchema = exports.BaseDisciplineEntitySchema.extend({
|
|
9
10
|
tags: zod_openapi_1.z
|
|
10
11
|
.array(zod_openapi_1.z.string().openapi({ example: "illustration" }))
|
|
11
12
|
.optional()
|
|
12
13
|
.openapi({ example: ["illustration", "concept-art"] }),
|
|
13
|
-
})
|
|
14
|
-
.openapi({ title: "DisciplineEntity" });
|
|
14
|
+
}).openapi({ title: "DisciplineEntity" });
|
|
15
15
|
exports.DisciplineUpdateOutputSchema = zod_openapi_1.z
|
|
16
16
|
.object({
|
|
17
17
|
slug: zod_openapi_1.z.string().openapi({ example: "digital-art" }),
|
package/dist/schemas/post.d.ts
CHANGED
|
@@ -323,6 +323,7 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
323
323
|
}, z.core.$strip>;
|
|
324
324
|
score: z.ZodNumber;
|
|
325
325
|
isLiked: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
326
327
|
isBookmarked: z.ZodOptional<z.ZodBoolean>;
|
|
327
328
|
}, z.core.$strip>;
|
|
328
329
|
export declare const GetFeedInputSchema: z.ZodObject<{
|
|
@@ -386,5 +387,6 @@ export declare const GetFeedOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
386
387
|
}, z.core.$strip>;
|
|
387
388
|
score: z.ZodNumber;
|
|
388
389
|
isLiked: z.ZodOptional<z.ZodBoolean>;
|
|
390
|
+
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
389
391
|
isBookmarked: z.ZodOptional<z.ZodBoolean>;
|
|
390
392
|
}, z.core.$strip>>;
|
package/dist/schemas/post.js
CHANGED
|
@@ -155,6 +155,7 @@ exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
|
|
|
155
155
|
stats: entity_stats_1.EntityStatsSchema,
|
|
156
156
|
score: zod_openapi_1.z.number(),
|
|
157
157
|
isLiked: zod_openapi_1.z.boolean().optional(),
|
|
158
|
+
isFollowing: zod_openapi_1.z.boolean().optional(),
|
|
158
159
|
isBookmarked: zod_openapi_1.z.boolean().optional()
|
|
159
160
|
});
|
|
160
161
|
exports.GetFeedInputSchema = zod_openapi_1.z.object({
|
package/package.json
CHANGED
package/src/schemas/creative.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
2
|
import { EXPERIENCE_LEVELS, ExperienceLevel } from "../constants";
|
|
3
3
|
import { CuidSchema, ProfileIdentifierSchema } from "./common";
|
|
4
|
-
|
|
5
4
|
export const CreativeEntitySchema = z
|
|
6
5
|
.object({
|
|
7
6
|
id: z.cuid2().openapi({ example: "cre_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
7
|
+
|
|
8
8
|
userId: z.cuid2().openapi({ example: "user_abc123" }),
|
|
9
|
+
|
|
9
10
|
bio: z.string().optional().openapi({
|
|
10
11
|
example: "A multi-disciplinary designer specializing in brand identity.",
|
|
11
12
|
}),
|
|
13
|
+
|
|
12
14
|
location: z.string().optional().openapi({ example: "London, UK" }),
|
|
15
|
+
|
|
13
16
|
experienceLevel: z
|
|
14
17
|
.enum(
|
|
15
18
|
Object.values(EXPERIENCE_LEVELS) as [
|
|
@@ -18,30 +21,40 @@ export const CreativeEntitySchema = z
|
|
|
18
21
|
]
|
|
19
22
|
)
|
|
20
23
|
.optional()
|
|
21
|
-
.openapi({ example:
|
|
24
|
+
.openapi({ example: EXPERIENCE_LEVELS.YEAR_0_1 }),
|
|
25
|
+
|
|
22
26
|
tags: z
|
|
23
27
|
.array(z.string())
|
|
24
28
|
.optional()
|
|
25
29
|
.openapi({ example: ["branding", "typography", "UX"] }),
|
|
30
|
+
|
|
26
31
|
disciplines: z
|
|
27
32
|
.array(z.string())
|
|
28
33
|
.optional()
|
|
29
34
|
.openapi({ example: ["Design", "Art Direction"] }),
|
|
35
|
+
|
|
30
36
|
createdAt: z.coerce
|
|
31
37
|
.date()
|
|
32
38
|
.optional()
|
|
33
39
|
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
40
|
+
|
|
34
41
|
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
35
42
|
})
|
|
36
|
-
.openapi(
|
|
43
|
+
.openapi({
|
|
44
|
+
title: "CreativeEntitySchema",
|
|
45
|
+
description:
|
|
46
|
+
"Represents a creative profile, including bio, experience level, location, disciplines, tags, and timestamps.",
|
|
47
|
+
});
|
|
37
48
|
|
|
38
49
|
export const ListCreativesInputSchema = z
|
|
39
50
|
.object({
|
|
40
51
|
query: z.string().optional().openapi({ example: "logo designer" }),
|
|
52
|
+
|
|
41
53
|
disciplines: z
|
|
42
54
|
.array(z.string())
|
|
43
55
|
.optional()
|
|
44
56
|
.openapi({ example: ["branding", "web design"] }),
|
|
57
|
+
|
|
45
58
|
experienceLevels: z
|
|
46
59
|
.array(
|
|
47
60
|
z.enum(
|
|
@@ -52,13 +65,19 @@ export const ListCreativesInputSchema = z
|
|
|
52
65
|
)
|
|
53
66
|
)
|
|
54
67
|
.optional()
|
|
55
|
-
.openapi({
|
|
68
|
+
.openapi({
|
|
69
|
+
example: [EXPERIENCE_LEVELS.YEAR_1_3, EXPERIENCE_LEVELS.YEAR_5_PLUS],
|
|
70
|
+
}),
|
|
71
|
+
|
|
56
72
|
location: z.string().optional().openapi({ example: "Los Angeles" }),
|
|
73
|
+
|
|
57
74
|
tags: z
|
|
58
75
|
.array(z.string())
|
|
59
76
|
.optional()
|
|
60
77
|
.openapi({ example: ["Figma", "AI"] }),
|
|
78
|
+
|
|
61
79
|
page: z.number().int().min(1).default(1).optional().openapi({ example: 1 }),
|
|
80
|
+
|
|
62
81
|
perPage: z
|
|
63
82
|
.number()
|
|
64
83
|
.int()
|
|
@@ -68,32 +87,52 @@ export const ListCreativesInputSchema = z
|
|
|
68
87
|
.optional()
|
|
69
88
|
.openapi({ example: 20 }),
|
|
70
89
|
})
|
|
71
|
-
.openapi(
|
|
90
|
+
.openapi({
|
|
91
|
+
title: "ListCreativesInput",
|
|
92
|
+
description:
|
|
93
|
+
"Query parameters for filtering and paginating creatives. Supports text search, discipline filtering, experience level filtering, tag filtering, location filtering, and pagination settings.",
|
|
94
|
+
});
|
|
72
95
|
|
|
73
96
|
export const CreateCreativeProfileInputSchema = z
|
|
74
97
|
.object({
|
|
75
98
|
experienceLevel: z
|
|
76
99
|
.enum(EXPERIENCE_LEVELS)
|
|
100
|
+
.describe("Overall experience range of the creative.")
|
|
77
101
|
.default(EXPERIENCE_LEVELS.YEAR_0_1)
|
|
78
|
-
.openapi({
|
|
102
|
+
.openapi({
|
|
103
|
+
example: EXPERIENCE_LEVELS.YEAR_1_3,
|
|
104
|
+
}),
|
|
105
|
+
|
|
79
106
|
bio: z
|
|
80
107
|
.string()
|
|
81
108
|
.max(210)
|
|
82
109
|
.optional()
|
|
83
|
-
.
|
|
110
|
+
.describe("Short professional summary or introduction.")
|
|
111
|
+
.openapi({
|
|
112
|
+
example: "I am a freelance UI/UX designer.",
|
|
113
|
+
}),
|
|
114
|
+
|
|
84
115
|
location: z
|
|
85
116
|
.string()
|
|
86
117
|
.max(100)
|
|
87
118
|
.optional()
|
|
88
|
-
.
|
|
119
|
+
.describe("Primary location where the creative works or resides.")
|
|
120
|
+
.openapi({
|
|
121
|
+
example: "Lagos, Nigeria",
|
|
122
|
+
}),
|
|
123
|
+
|
|
89
124
|
disciplineSlugs: z
|
|
90
125
|
.array(z.string())
|
|
91
126
|
.min(1, "At least one discipline is required")
|
|
92
127
|
.default([])
|
|
93
|
-
.
|
|
128
|
+
.describe("List of discipline slugs representing the creative’s fields.")
|
|
129
|
+
.openapi({
|
|
130
|
+
example: ["ui-ux", "frontend"],
|
|
131
|
+
}),
|
|
94
132
|
})
|
|
95
133
|
.openapi({
|
|
96
134
|
title: "create creative profile",
|
|
135
|
+
description: "Payload for creating a new creative profile.",
|
|
97
136
|
});
|
|
98
137
|
|
|
99
138
|
export const UpdateCreativeProfileInputSchema = z
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
export const BaseDisciplineEntitySchema = z.object({
|
|
4
|
+
slug: z.string().openapi({ example: "digital-art" }),
|
|
5
|
+
name: z.string().openapi({ example: "Digital Art" }),
|
|
6
|
+
});
|
|
7
|
+
export const DisciplineEntitySchema = BaseDisciplineEntitySchema.extend({
|
|
8
|
+
tags: z
|
|
9
|
+
.array(z.string().openapi({ example: "illustration" }))
|
|
10
|
+
.optional()
|
|
11
|
+
.openapi({ example: ["illustration", "concept-art"] }),
|
|
12
|
+
}).openapi({ title: "DisciplineEntity" });
|
|
13
13
|
|
|
14
14
|
export const DisciplineUpdateOutputSchema = z
|
|
15
15
|
.object({
|
package/src/schemas/post.ts
CHANGED
|
@@ -170,6 +170,7 @@ export const FeedPostEntitySchema = PostWithFilesEntitySchema.extend({
|
|
|
170
170
|
stats: EntityStatsSchema,
|
|
171
171
|
score: z.number(),
|
|
172
172
|
isLiked: z.boolean().optional(),
|
|
173
|
+
isFollowing: z.boolean().optional(),
|
|
173
174
|
isBookmarked: z.boolean().optional()
|
|
174
175
|
});
|
|
175
176
|
|