@zyacreatives/shared 2.1.10 → 2.1.12
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/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/schemas/bookmark.d.ts +3 -0
- package/dist/schemas/comment.d.ts +2 -0
- package/dist/schemas/creative.d.ts +5 -5
- package/dist/schemas/creative.js +2 -2
- package/dist/schemas/entity-stats.d.ts +1 -0
- package/dist/schemas/job.d.ts +20 -2
- package/dist/schemas/job.js +22 -33
- package/dist/schemas/like.d.ts +3 -0
- package/dist/schemas/message.d.ts +3 -0
- package/dist/schemas/post.d.ts +14 -0
- package/dist/schemas/project.d.ts +4 -0
- package/dist/schemas/user-strike.d.ts +3 -0
- package/dist/schemas/user.d.ts +8 -2
- package/dist/schemas/view.d.ts +1 -0
- package/package.json +1 -1
- package/src/constants.ts +1 -0
- package/src/schemas/creative.ts +2 -2
- package/src/schemas/job.ts +61 -62
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -6,6 +6,7 @@ export declare const BookmarkEntitySchema: z.ZodObject<{
|
|
|
6
6
|
parentId: z.ZodCUID2;
|
|
7
7
|
parentType: z.ZodEnum<{
|
|
8
8
|
readonly PROJECT: "PROJECT";
|
|
9
|
+
readonly JOB: "JOB";
|
|
9
10
|
readonly POST: "POST";
|
|
10
11
|
}>;
|
|
11
12
|
}, z.core.$strip>;
|
|
@@ -13,6 +14,7 @@ export declare const BookmarkInputSchema: z.ZodObject<{
|
|
|
13
14
|
parentId: z.ZodString;
|
|
14
15
|
parentType: z.ZodEnum<{
|
|
15
16
|
readonly PROJECT: "PROJECT";
|
|
17
|
+
readonly JOB: "JOB";
|
|
16
18
|
readonly POST: "POST";
|
|
17
19
|
}>;
|
|
18
20
|
userId: z.ZodString;
|
|
@@ -24,6 +26,7 @@ export declare const BookmarkOutputSchema: z.ZodObject<{
|
|
|
24
26
|
parentId: z.ZodCUID2;
|
|
25
27
|
parentType: z.ZodEnum<{
|
|
26
28
|
readonly PROJECT: "PROJECT";
|
|
29
|
+
readonly JOB: "JOB";
|
|
27
30
|
readonly POST: "POST";
|
|
28
31
|
}>;
|
|
29
32
|
}, z.core.$strip>;
|
|
@@ -5,6 +5,7 @@ export declare const CommentEntitySchema: z.ZodObject<{
|
|
|
5
5
|
parentId: z.ZodCUID2;
|
|
6
6
|
parentType: z.ZodEnum<{
|
|
7
7
|
readonly PROJECT: "PROJECT";
|
|
8
|
+
readonly JOB: "JOB";
|
|
8
9
|
readonly POST: "POST";
|
|
9
10
|
}>;
|
|
10
11
|
content: z.ZodString;
|
|
@@ -29,6 +30,7 @@ export declare const CommentOutputSchema: z.ZodObject<{
|
|
|
29
30
|
parentId: z.ZodCUID2;
|
|
30
31
|
parentType: z.ZodEnum<{
|
|
31
32
|
readonly PROJECT: "PROJECT";
|
|
33
|
+
readonly JOB: "JOB";
|
|
32
34
|
readonly POST: "POST";
|
|
33
35
|
}>;
|
|
34
36
|
content: z.ZodString;
|
|
@@ -52,7 +52,7 @@ export declare const CreativeEntitySchema: z.ZodObject<{
|
|
|
52
52
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
53
|
title: z.ZodString;
|
|
54
54
|
link: z.ZodOptional<z.ZodString>;
|
|
55
|
-
year: z.ZodOptional<z.
|
|
55
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
56
56
|
}, z.core.$strip>>>;
|
|
57
57
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
58
58
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -116,7 +116,7 @@ export declare const UpdateCreativeProfileInputSchema: z.ZodObject<{
|
|
|
116
116
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
117
|
title: z.ZodString;
|
|
118
118
|
link: z.ZodOptional<z.ZodString>;
|
|
119
|
-
year: z.ZodOptional<z.
|
|
119
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
120
120
|
}, z.core.$strip>>>;
|
|
121
121
|
}, z.core.$strip>;
|
|
122
122
|
export declare const GetCreativeInputSchema: z.ZodObject<{
|
|
@@ -168,7 +168,7 @@ export declare const CreateCreativeOutputSchema: z.ZodObject<{
|
|
|
168
168
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
169
169
|
title: z.ZodString;
|
|
170
170
|
link: z.ZodOptional<z.ZodString>;
|
|
171
|
-
year: z.ZodOptional<z.
|
|
171
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
172
172
|
}, z.core.$strip>>>;
|
|
173
173
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
174
174
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -209,7 +209,7 @@ export declare const GetCreativeOutputSchema: z.ZodObject<{
|
|
|
209
209
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
210
210
|
title: z.ZodString;
|
|
211
211
|
link: z.ZodOptional<z.ZodString>;
|
|
212
|
-
year: z.ZodOptional<z.
|
|
212
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
213
213
|
}, z.core.$strip>>>;
|
|
214
214
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
215
215
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -250,7 +250,7 @@ export declare const UpdateCreativeOutputSchema: z.ZodObject<{
|
|
|
250
250
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
251
251
|
title: z.ZodString;
|
|
252
252
|
link: z.ZodOptional<z.ZodString>;
|
|
253
|
-
year: z.ZodOptional<z.
|
|
253
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
254
254
|
}, z.core.$strip>>>;
|
|
255
255
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
256
256
|
updatedAt: z.ZodCoercedDate<unknown>;
|
package/dist/schemas/creative.js
CHANGED
|
@@ -79,7 +79,7 @@ exports.CreativeEntitySchema = zod_openapi_1.z
|
|
|
79
79
|
.object({
|
|
80
80
|
title: zod_openapi_1.z.string(),
|
|
81
81
|
link: zod_openapi_1.z.string().optional(),
|
|
82
|
-
year: zod_openapi_1.z.number().int().optional(),
|
|
82
|
+
year: zod_openapi_1.z.coerce.number().int().optional(),
|
|
83
83
|
})
|
|
84
84
|
.array()
|
|
85
85
|
.optional(),
|
|
@@ -209,7 +209,7 @@ exports.UpdateCreativeProfileInputSchema = zod_openapi_1.z
|
|
|
209
209
|
.object({
|
|
210
210
|
title: zod_openapi_1.z.string(),
|
|
211
211
|
link: zod_openapi_1.z.string().optional(),
|
|
212
|
-
year: zod_openapi_1.z.number().int().optional(),
|
|
212
|
+
year: zod_openapi_1.z.coerce.number().int().optional(),
|
|
213
213
|
})
|
|
214
214
|
.array()
|
|
215
215
|
.optional(),
|
package/dist/schemas/job.d.ts
CHANGED
|
@@ -322,7 +322,7 @@ export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
|
322
322
|
"Project Based": "Project Based";
|
|
323
323
|
}>>;
|
|
324
324
|
}, z.core.$strip>;
|
|
325
|
-
export declare const CreateJobInputSchema: z.ZodObject<{
|
|
325
|
+
export declare const CreateJobInputSchema: z.ZodPipe<z.ZodObject<{
|
|
326
326
|
title: z.ZodString;
|
|
327
327
|
brandId: z.ZodCUID2;
|
|
328
328
|
jobType: z.ZodEnum<{
|
|
@@ -361,7 +361,25 @@ export declare const CreateJobInputSchema: z.ZodObject<{
|
|
|
361
361
|
jobSections: z.ZodArray<z.ZodEnum<{
|
|
362
362
|
[x: string]: string;
|
|
363
363
|
}>>;
|
|
364
|
-
}, z.core.$strip
|
|
364
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
365
|
+
title: string;
|
|
366
|
+
brandId: string;
|
|
367
|
+
jobType: "GIG" | "ROLE";
|
|
368
|
+
workMode: "Remote" | "Hybrid" | "On Site";
|
|
369
|
+
location: "Africa" | "Asia" | "Europe" | "North America" | "South America" | "Middle East" | "Oceania" | "Global" | "Other" | "Remote" | "EMEA" | "Asia Pacific";
|
|
370
|
+
jobSections: string[];
|
|
371
|
+
employmentType?: "Full Time" | "Part Time" | "Freelance" | "Internship" | undefined;
|
|
372
|
+
gigType?: "One Time" | "Recurring" | undefined;
|
|
373
|
+
}, {
|
|
374
|
+
title: string;
|
|
375
|
+
brandId: string;
|
|
376
|
+
jobType: "GIG" | "ROLE";
|
|
377
|
+
workMode: "Remote" | "Hybrid" | "On Site";
|
|
378
|
+
location: "Africa" | "Asia" | "Europe" | "North America" | "South America" | "Middle East" | "Oceania" | "Global" | "Other" | "Remote" | "EMEA" | "Asia Pacific";
|
|
379
|
+
jobSections: string[];
|
|
380
|
+
employmentType?: "Full Time" | "Part Time" | "Freelance" | "Internship" | undefined;
|
|
381
|
+
gigType?: "One Time" | "Recurring" | undefined;
|
|
382
|
+
}>>;
|
|
365
383
|
export declare const CreateRoleJobInputSchema: z.ZodObject<{
|
|
366
384
|
id: z.ZodCUID2;
|
|
367
385
|
experienceLevel: z.ZodEnum<{
|
package/dist/schemas/job.js
CHANGED
|
@@ -94,8 +94,7 @@ exports.RoleJobEntitySchema = zod_1.z.object({
|
|
|
94
94
|
.optional(),
|
|
95
95
|
});
|
|
96
96
|
exports.JobWithRoleDetailsEntitySchema = exports.JobEntitySchema.extend(exports.RoleJobEntitySchema.shape);
|
|
97
|
-
|
|
98
|
-
.object({
|
|
97
|
+
const CreateJobInputBaseSchema = zod_1.z.object({
|
|
99
98
|
title: zod_1.z.string(),
|
|
100
99
|
brandId: zod_1.z.cuid2(),
|
|
101
100
|
jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
|
|
@@ -116,40 +115,30 @@ exports.CreateJobInputSchema = zod_1.z
|
|
|
116
115
|
sections.includes(constants_1.JOB_SECTIONS.RESUME), {
|
|
117
116
|
message: "jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
118
117
|
}),
|
|
119
|
-
})
|
|
120
|
-
|
|
118
|
+
});
|
|
119
|
+
exports.CreateJobInputSchema = CreateJobInputBaseSchema.superRefine((data, ctx) => {
|
|
120
|
+
if (data.jobType === constants_1.JOB_TYPE.ROLE && !data.employmentType) {
|
|
121
|
+
ctx.addIssue({
|
|
122
|
+
path: ["employmentType"],
|
|
123
|
+
code: "custom",
|
|
124
|
+
message: "employmentType is required for ROLE jobs",
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (data.jobType === constants_1.JOB_TYPE.GIG && !data.gigType) {
|
|
128
|
+
ctx.addIssue({
|
|
129
|
+
path: ["gigType"],
|
|
130
|
+
code: "custom",
|
|
131
|
+
message: "gigType is required for GIG jobs",
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}).transform((data) => {
|
|
121
135
|
if (data.jobType === constants_1.JOB_TYPE.ROLE) {
|
|
122
|
-
|
|
123
|
-
ctx.addIssue({
|
|
124
|
-
path: ["gigType"],
|
|
125
|
-
code: "custom",
|
|
126
|
-
message: "gigType must be null/undefined for PROJECT jobs",
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (!data.employmentType) {
|
|
130
|
-
ctx.addIssue({
|
|
131
|
-
path: ["employmentType"],
|
|
132
|
-
code: "custom",
|
|
133
|
-
message: "employmentType is required for PROJECT jobs",
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
+
return { ...data, gigType: undefined };
|
|
136
137
|
}
|
|
137
138
|
if (data.jobType === constants_1.JOB_TYPE.GIG) {
|
|
138
|
-
|
|
139
|
-
ctx.addIssue({
|
|
140
|
-
path: ["gigType"],
|
|
141
|
-
code: "custom",
|
|
142
|
-
message: "gigType is required for GIG jobs",
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
if (data.employmentType !== undefined) {
|
|
146
|
-
ctx.addIssue({
|
|
147
|
-
path: ["employmentType"],
|
|
148
|
-
code: "custom",
|
|
149
|
-
message: "employmentType must be null/undefined for GIG jobs",
|
|
150
|
-
});
|
|
151
|
-
}
|
|
139
|
+
return { ...data, employmentType: undefined };
|
|
152
140
|
}
|
|
141
|
+
return data;
|
|
153
142
|
});
|
|
154
143
|
exports.CreateRoleJobInputSchema = zod_1.z
|
|
155
144
|
.object({
|
|
@@ -196,7 +185,7 @@ exports.CreateGigJobInputSchema = zod_1.z
|
|
|
196
185
|
});
|
|
197
186
|
exports.UpdateRoleJobInputSchema = exports.CreateRoleJobInputSchema.partial().required({ id: true });
|
|
198
187
|
exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial().required({ id: true });
|
|
199
|
-
exports.UpdateJobInputSchema =
|
|
188
|
+
exports.UpdateJobInputSchema = CreateJobInputBaseSchema.partial().extend({
|
|
200
189
|
id: zod_1.z.cuid2(),
|
|
201
190
|
status: zod_1.z
|
|
202
191
|
.enum(Object.values(constants_1.JOB_STATUS))
|
package/dist/schemas/like.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const LikeEntitySchema: z.ZodObject<{
|
|
|
6
6
|
parentId: z.ZodCUID2;
|
|
7
7
|
parentType: z.ZodEnum<{
|
|
8
8
|
readonly PROJECT: "PROJECT";
|
|
9
|
+
readonly JOB: "JOB";
|
|
9
10
|
readonly POST: "POST";
|
|
10
11
|
}>;
|
|
11
12
|
}, z.core.$strip>;
|
|
@@ -13,6 +14,7 @@ export declare const LikeInputSchema: z.ZodObject<{
|
|
|
13
14
|
parentId: z.ZodString;
|
|
14
15
|
parentType: z.ZodEnum<{
|
|
15
16
|
readonly PROJECT: "PROJECT";
|
|
17
|
+
readonly JOB: "JOB";
|
|
16
18
|
readonly POST: "POST";
|
|
17
19
|
}>;
|
|
18
20
|
userId: z.ZodString;
|
|
@@ -24,6 +26,7 @@ export declare const LikeOutputSchema: z.ZodObject<{
|
|
|
24
26
|
parentId: z.ZodCUID2;
|
|
25
27
|
parentType: z.ZodEnum<{
|
|
26
28
|
readonly PROJECT: "PROJECT";
|
|
29
|
+
readonly JOB: "JOB";
|
|
27
30
|
readonly POST: "POST";
|
|
28
31
|
}>;
|
|
29
32
|
}, z.core.$strip>;
|
|
@@ -4,6 +4,7 @@ export declare const MessageEntitySchema: z.ZodObject<{
|
|
|
4
4
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
5
5
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
6
6
|
readonly PROJECT: "PROJECT";
|
|
7
|
+
readonly JOB: "JOB";
|
|
7
8
|
readonly POST: "POST";
|
|
8
9
|
}>>;
|
|
9
10
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
@@ -40,6 +41,7 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
|
40
41
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
41
42
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
42
43
|
readonly PROJECT: "PROJECT";
|
|
44
|
+
readonly JOB: "JOB";
|
|
43
45
|
readonly POST: "POST";
|
|
44
46
|
}>>;
|
|
45
47
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
@@ -103,6 +105,7 @@ export declare const CreateMessageOutputSchema: z.ZodObject<{
|
|
|
103
105
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
104
106
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
105
107
|
readonly PROJECT: "PROJECT";
|
|
108
|
+
readonly JOB: "JOB";
|
|
106
109
|
readonly POST: "POST";
|
|
107
110
|
}>>;
|
|
108
111
|
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
package/dist/schemas/post.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare const PostEntitySchema: z.ZodObject<{
|
|
|
4
4
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
5
5
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
6
6
|
readonly PROJECT: "PROJECT";
|
|
7
|
+
readonly JOB: "JOB";
|
|
7
8
|
readonly POST: "POST";
|
|
8
9
|
}>>;
|
|
9
10
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -53,6 +54,7 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
|
|
|
53
54
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
54
55
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
55
56
|
readonly PROJECT: "PROJECT";
|
|
57
|
+
readonly JOB: "JOB";
|
|
56
58
|
readonly POST: "POST";
|
|
57
59
|
}>>;
|
|
58
60
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -103,6 +105,7 @@ export declare const CreatePostInputSchema: z.ZodObject<{
|
|
|
103
105
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
104
106
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
105
107
|
readonly PROJECT: "PROJECT";
|
|
108
|
+
readonly JOB: "JOB";
|
|
106
109
|
readonly POST: "POST";
|
|
107
110
|
}>>;
|
|
108
111
|
content: z.ZodOptional<z.ZodString>;
|
|
@@ -143,6 +146,7 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
|
143
146
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
144
147
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
145
148
|
readonly PROJECT: "PROJECT";
|
|
149
|
+
readonly JOB: "JOB";
|
|
146
150
|
readonly POST: "POST";
|
|
147
151
|
}>>;
|
|
148
152
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -186,6 +190,7 @@ export declare const GetPostOutputSchema: z.ZodObject<{
|
|
|
186
190
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
187
191
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
188
192
|
readonly PROJECT: "PROJECT";
|
|
193
|
+
readonly JOB: "JOB";
|
|
189
194
|
readonly POST: "POST";
|
|
190
195
|
}>>;
|
|
191
196
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -250,6 +255,7 @@ export declare const PostWithLikesEntitySchema: z.ZodObject<{
|
|
|
250
255
|
parentId: z.ZodCUID2;
|
|
251
256
|
parentType: z.ZodEnum<{
|
|
252
257
|
readonly PROJECT: "PROJECT";
|
|
258
|
+
readonly JOB: "JOB";
|
|
253
259
|
readonly POST: "POST";
|
|
254
260
|
}>;
|
|
255
261
|
}, z.core.$strip>>;
|
|
@@ -264,6 +270,7 @@ export declare const PostWithCommentsEntitySchema: z.ZodObject<{
|
|
|
264
270
|
parentId: z.ZodCUID2;
|
|
265
271
|
parentType: z.ZodEnum<{
|
|
266
272
|
readonly PROJECT: "PROJECT";
|
|
273
|
+
readonly JOB: "JOB";
|
|
267
274
|
readonly POST: "POST";
|
|
268
275
|
}>;
|
|
269
276
|
content: z.ZodString;
|
|
@@ -286,6 +293,7 @@ export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
|
|
|
286
293
|
parentId: z.ZodCUID2;
|
|
287
294
|
parentType: z.ZodEnum<{
|
|
288
295
|
readonly PROJECT: "PROJECT";
|
|
296
|
+
readonly JOB: "JOB";
|
|
289
297
|
readonly POST: "POST";
|
|
290
298
|
}>;
|
|
291
299
|
}, z.core.$strip>>;
|
|
@@ -304,6 +312,7 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
304
312
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
305
313
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
306
314
|
readonly PROJECT: "PROJECT";
|
|
315
|
+
readonly JOB: "JOB";
|
|
307
316
|
readonly POST: "POST";
|
|
308
317
|
}>>;
|
|
309
318
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -354,6 +363,7 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
354
363
|
parentId: z.ZodCUID2;
|
|
355
364
|
parentType: z.ZodEnum<{
|
|
356
365
|
readonly PROJECT: "PROJECT";
|
|
366
|
+
readonly JOB: "JOB";
|
|
357
367
|
readonly POST: "POST";
|
|
358
368
|
}>;
|
|
359
369
|
likesCount: z.ZodNumber;
|
|
@@ -376,6 +386,7 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
376
386
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
377
387
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
378
388
|
readonly PROJECT: "PROJECT";
|
|
389
|
+
readonly JOB: "JOB";
|
|
379
390
|
readonly POST: "POST";
|
|
380
391
|
}>>;
|
|
381
392
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -426,6 +437,7 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
426
437
|
parentId: z.ZodCUID2;
|
|
427
438
|
parentType: z.ZodEnum<{
|
|
428
439
|
readonly PROJECT: "PROJECT";
|
|
440
|
+
readonly JOB: "JOB";
|
|
429
441
|
readonly POST: "POST";
|
|
430
442
|
}>;
|
|
431
443
|
likesCount: z.ZodNumber;
|
|
@@ -450,6 +462,7 @@ export declare const SearchPostOutputSchema: z.ZodObject<{
|
|
|
450
462
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
451
463
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
452
464
|
readonly PROJECT: "PROJECT";
|
|
465
|
+
readonly JOB: "JOB";
|
|
453
466
|
readonly POST: "POST";
|
|
454
467
|
}>>;
|
|
455
468
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -500,6 +513,7 @@ export declare const SearchPostOutputSchema: z.ZodObject<{
|
|
|
500
513
|
parentId: z.ZodCUID2;
|
|
501
514
|
parentType: z.ZodEnum<{
|
|
502
515
|
readonly PROJECT: "PROJECT";
|
|
516
|
+
readonly JOB: "JOB";
|
|
503
517
|
readonly POST: "POST";
|
|
504
518
|
}>;
|
|
505
519
|
likesCount: z.ZodNumber;
|
|
@@ -345,6 +345,7 @@ export declare const ProjectWithProjectViewsEntitySchema: z.ZodObject<{
|
|
|
345
345
|
parentId: z.ZodCUID2;
|
|
346
346
|
parentType: z.ZodEnum<{
|
|
347
347
|
readonly PROJECT: "PROJECT";
|
|
348
|
+
readonly JOB: "JOB";
|
|
348
349
|
readonly POST: "POST";
|
|
349
350
|
}>;
|
|
350
351
|
sessionId: z.ZodNullable<z.ZodString>;
|
|
@@ -366,6 +367,7 @@ export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
|
|
|
366
367
|
parentId: z.ZodCUID2;
|
|
367
368
|
parentType: z.ZodEnum<{
|
|
368
369
|
readonly PROJECT: "PROJECT";
|
|
370
|
+
readonly JOB: "JOB";
|
|
369
371
|
readonly POST: "POST";
|
|
370
372
|
}>;
|
|
371
373
|
content: z.ZodString;
|
|
@@ -392,6 +394,7 @@ export declare const ProjectWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
392
394
|
parentId: z.ZodCUID2;
|
|
393
395
|
parentType: z.ZodEnum<{
|
|
394
396
|
readonly PROJECT: "PROJECT";
|
|
397
|
+
readonly JOB: "JOB";
|
|
395
398
|
readonly POST: "POST";
|
|
396
399
|
}>;
|
|
397
400
|
}, z.core.$strip>>;
|
|
@@ -411,6 +414,7 @@ export declare const ProjectWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
411
414
|
parentId: z.ZodCUID2;
|
|
412
415
|
parentType: z.ZodEnum<{
|
|
413
416
|
readonly PROJECT: "PROJECT";
|
|
417
|
+
readonly JOB: "JOB";
|
|
414
418
|
readonly POST: "POST";
|
|
415
419
|
}>;
|
|
416
420
|
}, z.core.$strip>>;
|
|
@@ -7,6 +7,7 @@ export declare const UserStrikeEntitySchema: z.ZodObject<{
|
|
|
7
7
|
parentId: z.ZodCUID2;
|
|
8
8
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
readonly PROJECT: "PROJECT";
|
|
10
|
+
readonly JOB: "JOB";
|
|
10
11
|
readonly POST: "POST";
|
|
11
12
|
}>>;
|
|
12
13
|
lastReason: z.ZodOptional<z.ZodString>;
|
|
@@ -18,6 +19,7 @@ export declare const UpsertUserStrikeInputSchema: z.ZodObject<{
|
|
|
18
19
|
parentId: z.ZodCUID2;
|
|
19
20
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
20
21
|
readonly PROJECT: "PROJECT";
|
|
22
|
+
readonly JOB: "JOB";
|
|
21
23
|
readonly POST: "POST";
|
|
22
24
|
}>>;
|
|
23
25
|
}, z.core.$strip>;
|
|
@@ -29,6 +31,7 @@ export declare const UpsertUserStrikeOutputSchema: z.ZodObject<{
|
|
|
29
31
|
parentId: z.ZodCUID2;
|
|
30
32
|
parentType: z.ZodOptional<z.ZodEnum<{
|
|
31
33
|
readonly PROJECT: "PROJECT";
|
|
34
|
+
readonly JOB: "JOB";
|
|
32
35
|
readonly POST: "POST";
|
|
33
36
|
}>>;
|
|
34
37
|
lastReason: z.ZodOptional<z.ZodString>;
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -158,7 +158,7 @@ export declare const UserProfileEntitySchema: z.ZodObject<{
|
|
|
158
158
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
159
159
|
title: z.ZodString;
|
|
160
160
|
link: z.ZodOptional<z.ZodString>;
|
|
161
|
-
year: z.ZodOptional<z.
|
|
161
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
162
162
|
}, z.core.$strip>>>;
|
|
163
163
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
164
164
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -252,6 +252,7 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
252
252
|
parentId: z.ZodCUID2;
|
|
253
253
|
parentType: z.ZodEnum<{
|
|
254
254
|
readonly PROJECT: "PROJECT";
|
|
255
|
+
readonly JOB: "JOB";
|
|
255
256
|
readonly POST: "POST";
|
|
256
257
|
}>;
|
|
257
258
|
project: z.ZodObject<{
|
|
@@ -274,6 +275,7 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
274
275
|
parentId: z.ZodCUID2;
|
|
275
276
|
parentType: z.ZodEnum<{
|
|
276
277
|
readonly PROJECT: "PROJECT";
|
|
278
|
+
readonly JOB: "JOB";
|
|
277
279
|
readonly POST: "POST";
|
|
278
280
|
}>;
|
|
279
281
|
project: z.ZodObject<{
|
|
@@ -354,6 +356,7 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
354
356
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
355
357
|
parentType: z.ZodDefault<z.ZodEnum<{
|
|
356
358
|
readonly PROJECT: "PROJECT";
|
|
359
|
+
readonly JOB: "JOB";
|
|
357
360
|
readonly POST: "POST";
|
|
358
361
|
}>>;
|
|
359
362
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -597,7 +600,7 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
597
600
|
achievements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
598
601
|
title: z.ZodString;
|
|
599
602
|
link: z.ZodOptional<z.ZodString>;
|
|
600
|
-
year: z.ZodOptional<z.
|
|
603
|
+
year: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
601
604
|
}, z.core.$strip>>>;
|
|
602
605
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
603
606
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -691,6 +694,7 @@ export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.Zod
|
|
|
691
694
|
parentId: z.ZodCUID2;
|
|
692
695
|
parentType: z.ZodEnum<{
|
|
693
696
|
readonly PROJECT: "PROJECT";
|
|
697
|
+
readonly JOB: "JOB";
|
|
694
698
|
readonly POST: "POST";
|
|
695
699
|
}>;
|
|
696
700
|
project: z.ZodObject<{
|
|
@@ -765,6 +769,7 @@ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObje
|
|
|
765
769
|
parentId: z.ZodCUID2;
|
|
766
770
|
parentType: z.ZodEnum<{
|
|
767
771
|
readonly PROJECT: "PROJECT";
|
|
772
|
+
readonly JOB: "JOB";
|
|
768
773
|
readonly POST: "POST";
|
|
769
774
|
}>;
|
|
770
775
|
project: z.ZodObject<{
|
|
@@ -791,6 +796,7 @@ export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
791
796
|
parentId: z.ZodString;
|
|
792
797
|
parentType: z.ZodEnum<{
|
|
793
798
|
PROJECT: "PROJECT";
|
|
799
|
+
JOB: "JOB";
|
|
794
800
|
POST: "POST";
|
|
795
801
|
}>;
|
|
796
802
|
}, z.core.$strip>>;
|
package/dist/schemas/view.d.ts
CHANGED
package/package.json
CHANGED
package/src/constants.ts
CHANGED
package/src/schemas/creative.ts
CHANGED
|
@@ -90,7 +90,7 @@ export const CreativeEntitySchema = z
|
|
|
90
90
|
.object({
|
|
91
91
|
title: z.string(),
|
|
92
92
|
link: z.string().optional(),
|
|
93
|
-
year: z.number().int().optional(),
|
|
93
|
+
year: z.coerce.number().int().optional(),
|
|
94
94
|
})
|
|
95
95
|
.array()
|
|
96
96
|
.optional(),
|
|
@@ -241,7 +241,7 @@ export const UpdateCreativeProfileInputSchema = z
|
|
|
241
241
|
.object({
|
|
242
242
|
title: z.string(),
|
|
243
243
|
link: z.string().optional(),
|
|
244
|
-
year: z.number().int().optional(),
|
|
244
|
+
year: z.coerce.number().int().optional(),
|
|
245
245
|
})
|
|
246
246
|
.array()
|
|
247
247
|
.optional(),
|
package/src/schemas/job.ts
CHANGED
|
@@ -139,71 +139,70 @@ export const JobWithRoleDetailsEntitySchema = JobEntitySchema.extend(
|
|
|
139
139
|
RoleJobEntitySchema.shape
|
|
140
140
|
);
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (data.jobType === JOB_TYPE.ROLE) {
|
|
174
|
-
if (data.gigType !== undefined) {
|
|
175
|
-
ctx.addIssue({
|
|
176
|
-
path: ["gigType"],
|
|
177
|
-
code: "custom",
|
|
178
|
-
message: "gigType must be null/undefined for PROJECT jobs",
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
if (!data.employmentType) {
|
|
182
|
-
ctx.addIssue({
|
|
183
|
-
path: ["employmentType"],
|
|
184
|
-
code: "custom",
|
|
185
|
-
message: "employmentType is required for PROJECT jobs",
|
|
186
|
-
});
|
|
142
|
+
const CreateJobInputBaseSchema = z.object({
|
|
143
|
+
title: z.string(),
|
|
144
|
+
brandId: z.cuid2(),
|
|
145
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
146
|
+
|
|
147
|
+
employmentType: z
|
|
148
|
+
.enum(
|
|
149
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]]
|
|
150
|
+
)
|
|
151
|
+
.optional(),
|
|
152
|
+
|
|
153
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
154
|
+
|
|
155
|
+
gigType: z
|
|
156
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
157
|
+
.optional(),
|
|
158
|
+
|
|
159
|
+
location: z
|
|
160
|
+
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
161
|
+
.default(JOB_LOCATIONS.REMOTE),
|
|
162
|
+
|
|
163
|
+
jobSections: z
|
|
164
|
+
.array(JobSectionEnum)
|
|
165
|
+
.refine(
|
|
166
|
+
(sections) =>
|
|
167
|
+
sections.includes(JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
168
|
+
sections.includes(JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
169
|
+
sections.includes(JOB_SECTIONS.RESUME),
|
|
170
|
+
{
|
|
171
|
+
message:
|
|
172
|
+
"jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
187
173
|
}
|
|
174
|
+
),
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
export const CreateJobInputSchema = CreateJobInputBaseSchema.superRefine(
|
|
178
|
+
(data, ctx) => {
|
|
179
|
+
if (data.jobType === JOB_TYPE.ROLE && !data.employmentType) {
|
|
180
|
+
ctx.addIssue({
|
|
181
|
+
path: ["employmentType"],
|
|
182
|
+
code: "custom",
|
|
183
|
+
message: "employmentType is required for ROLE jobs",
|
|
184
|
+
});
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
if (data.jobType === JOB_TYPE.GIG) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
if (data.employmentType !== undefined) {
|
|
199
|
-
ctx.addIssue({
|
|
200
|
-
path: ["employmentType"],
|
|
201
|
-
code: "custom",
|
|
202
|
-
message: "employmentType must be null/undefined for GIG jobs",
|
|
203
|
-
});
|
|
204
|
-
}
|
|
187
|
+
if (data.jobType === JOB_TYPE.GIG && !data.gigType) {
|
|
188
|
+
ctx.addIssue({
|
|
189
|
+
path: ["gigType"],
|
|
190
|
+
code: "custom",
|
|
191
|
+
message: "gigType is required for GIG jobs",
|
|
192
|
+
});
|
|
205
193
|
}
|
|
206
|
-
}
|
|
194
|
+
}
|
|
195
|
+
).transform((data) => {
|
|
196
|
+
if (data.jobType === JOB_TYPE.ROLE) {
|
|
197
|
+
return { ...data, gigType: undefined };
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (data.jobType === JOB_TYPE.GIG) {
|
|
201
|
+
return { ...data, employmentType: undefined };
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return data;
|
|
205
|
+
});
|
|
207
206
|
|
|
208
207
|
export const CreateRoleJobInputSchema = z
|
|
209
208
|
.object({
|
|
@@ -273,7 +272,7 @@ export const UpdateRoleJobInputSchema =
|
|
|
273
272
|
export const UpdateGigJobInputSchema =
|
|
274
273
|
CreateGigJobInputSchema.partial().required({ id: true });
|
|
275
274
|
|
|
276
|
-
export const UpdateJobInputSchema =
|
|
275
|
+
export const UpdateJobInputSchema = CreateJobInputBaseSchema.partial().extend({
|
|
277
276
|
id: z.cuid2(),
|
|
278
277
|
status: z
|
|
279
278
|
.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]])
|