@zyacreatives/shared 2.0.44 → 2.0.46
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/message.d.ts +6 -0
- package/dist/schemas/message.js +2 -1
- package/dist/schemas/post.d.ts +2 -0
- package/dist/schemas/post.js +1 -0
- package/dist/types/message.d.ts +2 -1
- package/package.json +1 -1
- package/src/schemas/creative.ts +48 -9
- package/src/schemas/message.ts +2 -0
- package/src/schemas/post.ts +1 -0
- package/src/types/message.ts +3 -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({
|
|
@@ -128,3 +128,9 @@ export declare const CreateMessageOutputSchema: z.ZodObject<{
|
|
|
128
128
|
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
129
129
|
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
130
130
|
}, z.core.$strip>;
|
|
131
|
+
export declare const GetMessagesOutputSchema: z.ZodArray<z.ZodObject<{
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
messageId: z.ZodString;
|
|
134
|
+
fileId: z.ZodString;
|
|
135
|
+
order: z.ZodNumber;
|
|
136
|
+
}, z.core.$strip>>;
|
package/dist/schemas/message.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateMessageOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = void 0;
|
|
3
|
+
exports.GetMessagesOutputSchema = exports.CreateMessageOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const file_1 = require("./file");
|
|
@@ -102,3 +102,4 @@ exports.CreateMessageInputSchema = zod_openapi_1.z.object({
|
|
|
102
102
|
}),
|
|
103
103
|
});
|
|
104
104
|
exports.CreateMessageOutputSchema = exports.MessageEntitySchema;
|
|
105
|
+
exports.GetMessagesOutputSchema = zod_openapi_1.z.array(exports.MessageFileEntitySchema);
|
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/dist/types/message.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CreateMessageInputSchema, CreateMessageOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
|
|
2
|
+
import { CreateMessageInputSchema, CreateMessageOutputSchema, GetMessagesOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
|
|
3
3
|
export type MessageEntity = z.infer<typeof MessageEntitySchema>;
|
|
4
4
|
export type MessageFileEntity = z.infer<typeof MessageFileEntitySchema>;
|
|
5
5
|
export type MessageWithFilesEntity = z.infer<typeof MessageWithFilesEntitySchema>;
|
|
6
6
|
export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
7
7
|
export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
|
|
8
|
+
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
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
|
package/src/schemas/message.ts
CHANGED
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
|
|
package/src/types/message.ts
CHANGED
|
@@ -2,6 +2,7 @@ import z from "zod";
|
|
|
2
2
|
import {
|
|
3
3
|
CreateMessageInputSchema,
|
|
4
4
|
CreateMessageOutputSchema,
|
|
5
|
+
GetMessagesOutputSchema,
|
|
5
6
|
MessageEntitySchema,
|
|
6
7
|
MessageFileEntitySchema,
|
|
7
8
|
MessageWithFilesEntitySchema,
|
|
@@ -18,3 +19,5 @@ export type MessageWithFilesEntity = z.infer<
|
|
|
18
19
|
export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
19
20
|
|
|
20
21
|
export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
|
|
22
|
+
|
|
23
|
+
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|