@zyacreatives/shared 2.0.11 → 2.0.13
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/job.d.ts +8 -14
- package/dist/schemas/job.js +15 -37
- package/package.json +1 -1
- package/src/schemas/job.ts +23 -54
package/dist/schemas/job.d.ts
CHANGED
|
@@ -125,7 +125,6 @@ export declare const GigJobEntitySchema: z.ZodObject<{
|
|
|
125
125
|
Monthly: "Monthly";
|
|
126
126
|
"Project Based": "Project Based";
|
|
127
127
|
}>>;
|
|
128
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
129
128
|
}, z.core.$strip>;
|
|
130
129
|
export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
|
|
131
130
|
title: z.ZodString;
|
|
@@ -197,7 +196,6 @@ export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
|
|
|
197
196
|
Monthly: "Monthly";
|
|
198
197
|
"Project Based": "Project Based";
|
|
199
198
|
}>>;
|
|
200
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
201
199
|
}, z.core.$strip>;
|
|
202
200
|
export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
203
201
|
id: z.ZodCUID2;
|
|
@@ -234,7 +232,6 @@ export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
|
234
232
|
Monthly: "Monthly";
|
|
235
233
|
"Project Based": "Project Based";
|
|
236
234
|
}>>;
|
|
237
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
238
235
|
}, z.core.$strip>;
|
|
239
236
|
export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
240
237
|
title: z.ZodString;
|
|
@@ -312,7 +309,6 @@ export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
|
312
309
|
Monthly: "Monthly";
|
|
313
310
|
"Project Based": "Project Based";
|
|
314
311
|
}>>;
|
|
315
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
316
312
|
}, z.core.$strip>;
|
|
317
313
|
export declare const CreateJobInputSchema: z.ZodObject<{
|
|
318
314
|
title: z.ZodString;
|
|
@@ -350,6 +346,9 @@ export declare const CreateJobInputSchema: z.ZodObject<{
|
|
|
350
346
|
EMEA: "EMEA";
|
|
351
347
|
"Asia Pacific": "Asia Pacific";
|
|
352
348
|
}>>;
|
|
349
|
+
jobSections: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
350
|
+
[x: string]: string;
|
|
351
|
+
}>>>;
|
|
353
352
|
}, z.core.$strip>;
|
|
354
353
|
export declare const CreateRoleJobInputSchema: z.ZodObject<{
|
|
355
354
|
id: z.ZodCUID2;
|
|
@@ -416,6 +415,7 @@ export declare const CreateGigJobInputSchema: z.ZodObject<{
|
|
|
416
415
|
}>>;
|
|
417
416
|
}, z.core.$strip>;
|
|
418
417
|
export declare const UpdateRoleJobInputSchema: z.ZodObject<{
|
|
418
|
+
id: z.ZodOptional<z.ZodCUID2>;
|
|
419
419
|
experienceLevel: z.ZodOptional<z.ZodEnum<{
|
|
420
420
|
"0-1 year": "0-1 year";
|
|
421
421
|
"1-3 years": "1-3 years";
|
|
@@ -448,12 +448,9 @@ export declare const UpdateRoleJobInputSchema: z.ZodObject<{
|
|
|
448
448
|
Monthly: "Monthly";
|
|
449
449
|
"Project Based": "Project Based";
|
|
450
450
|
}>>>;
|
|
451
|
-
id: z.ZodCUID2;
|
|
452
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
453
|
-
[x: string]: string;
|
|
454
|
-
}>>>;
|
|
455
451
|
}, z.core.$strip>;
|
|
456
452
|
export declare const UpdateGigJobInputSchema: z.ZodObject<{
|
|
453
|
+
id: z.ZodOptional<z.ZodCUID2>;
|
|
457
454
|
overview: z.ZodOptional<z.ZodString>;
|
|
458
455
|
deliverables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
459
456
|
employeeRequirements: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -480,10 +477,6 @@ export declare const UpdateGigJobInputSchema: z.ZodObject<{
|
|
|
480
477
|
Monthly: "Monthly";
|
|
481
478
|
"Project Based": "Project Based";
|
|
482
479
|
}>>>;
|
|
483
|
-
id: z.ZodCUID2;
|
|
484
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
485
|
-
[x: string]: string;
|
|
486
|
-
}>>>;
|
|
487
480
|
}, z.core.$strip>;
|
|
488
481
|
export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
489
482
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -521,6 +514,9 @@ export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
|
521
514
|
EMEA: "EMEA";
|
|
522
515
|
"Asia Pacific": "Asia Pacific";
|
|
523
516
|
}>>>;
|
|
517
|
+
jobSections: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
518
|
+
[x: string]: string;
|
|
519
|
+
}>>>>;
|
|
524
520
|
id: z.ZodCUID2;
|
|
525
521
|
}, z.core.$strip>;
|
|
526
522
|
export declare const NormalizedJobOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -593,7 +589,6 @@ export declare const NormalizedJobOutputSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
593
589
|
Monthly: "Monthly";
|
|
594
590
|
"Project Based": "Project Based";
|
|
595
591
|
}>>;
|
|
596
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
597
592
|
}, z.core.$strip>, z.ZodObject<{
|
|
598
593
|
title: z.ZodString;
|
|
599
594
|
brandId: z.ZodCUID2;
|
|
@@ -670,5 +665,4 @@ export declare const NormalizedJobOutputSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
670
665
|
Monthly: "Monthly";
|
|
671
666
|
"Project Based": "Project Based";
|
|
672
667
|
}>>;
|
|
673
|
-
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
674
668
|
}, z.core.$strip>], "jobType">;
|
package/dist/schemas/job.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NormalizedJobOutputSchema = exports.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.JobWithRoleDetailsEntitySchema = exports.RoleJobEntitySchema = exports.JobWithGigDetailsEntitySchema = exports.GigJobEntitySchema = exports.JobEntitySchema = exports.JobIdSchema = exports.BaseJobEntitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
const JobSectionEnum = zod_1.z.enum(Object.values(constants_1.JOB_SECTIONS));
|
|
6
7
|
exports.BaseJobEntitySchema = zod_1.z.object({
|
|
7
8
|
id: zod_1.z.cuid2(),
|
|
8
9
|
title: zod_1.z.string(),
|
|
@@ -58,9 +59,6 @@ exports.GigJobEntitySchema = zod_1.z.object({
|
|
|
58
59
|
wagesType: zod_1.z
|
|
59
60
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
60
61
|
.optional(),
|
|
61
|
-
jobSections: zod_1.z
|
|
62
|
-
.array(zod_1.z.string())
|
|
63
|
-
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
64
62
|
});
|
|
65
63
|
exports.JobWithGigDetailsEntitySchema = exports.JobEntitySchema.extend(exports.GigJobEntitySchema.shape);
|
|
66
64
|
exports.RoleJobEntitySchema = zod_1.z.object({
|
|
@@ -80,9 +78,6 @@ exports.RoleJobEntitySchema = zod_1.z.object({
|
|
|
80
78
|
wagesType: zod_1.z
|
|
81
79
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
82
80
|
.optional(),
|
|
83
|
-
jobSections: zod_1.z
|
|
84
|
-
.array(zod_1.z.string())
|
|
85
|
-
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
86
81
|
});
|
|
87
82
|
exports.JobWithRoleDetailsEntitySchema = exports.JobEntitySchema.extend(exports.RoleJobEntitySchema.shape);
|
|
88
83
|
exports.CreateJobInputSchema = zod_1.z
|
|
@@ -100,6 +95,18 @@ exports.CreateJobInputSchema = zod_1.z
|
|
|
100
95
|
location: zod_1.z
|
|
101
96
|
.enum(Object.values(constants_1.JOB_LOCATIONS))
|
|
102
97
|
.default(constants_1.JOB_LOCATIONS.REMOTE),
|
|
98
|
+
jobSections: zod_1.z
|
|
99
|
+
.array(JobSectionEnum)
|
|
100
|
+
.default([
|
|
101
|
+
constants_1.JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
102
|
+
constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
103
|
+
constants_1.JOB_SECTIONS.RESUME,
|
|
104
|
+
])
|
|
105
|
+
.refine((sections) => sections.includes(constants_1.JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
106
|
+
sections.includes(constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
107
|
+
sections.includes(constants_1.JOB_SECTIONS.RESUME), {
|
|
108
|
+
message: "jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
109
|
+
}),
|
|
103
110
|
})
|
|
104
111
|
.superRefine((data, ctx) => {
|
|
105
112
|
if (data.jobType === constants_1.JOB_TYPE.ROLE) {
|
|
@@ -168,37 +175,8 @@ exports.CreateGigJobInputSchema = zod_1.z.object({
|
|
|
168
175
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
169
176
|
.optional(),
|
|
170
177
|
});
|
|
171
|
-
|
|
172
|
-
exports.
|
|
173
|
-
id: zod_1.z.cuid2(),
|
|
174
|
-
jobSections: zod_1.z
|
|
175
|
-
.array(JobSectionEnum)
|
|
176
|
-
.default([
|
|
177
|
-
constants_1.JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
178
|
-
constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
179
|
-
constants_1.JOB_SECTIONS.RESUME,
|
|
180
|
-
])
|
|
181
|
-
.refine((sections) => sections.includes(constants_1.JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
182
|
-
sections.includes(constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
183
|
-
sections.includes(constants_1.JOB_SECTIONS.RESUME), {
|
|
184
|
-
message: "jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
185
|
-
}),
|
|
186
|
-
});
|
|
187
|
-
exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial().extend({
|
|
188
|
-
id: zod_1.z.cuid2(),
|
|
189
|
-
jobSections: zod_1.z
|
|
190
|
-
.array(JobSectionEnum)
|
|
191
|
-
.default([
|
|
192
|
-
constants_1.JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
193
|
-
constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
194
|
-
constants_1.JOB_SECTIONS.RESUME,
|
|
195
|
-
])
|
|
196
|
-
.refine((sections) => sections.includes(constants_1.JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
197
|
-
sections.includes(constants_1.JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
198
|
-
sections.includes(constants_1.JOB_SECTIONS.RESUME), {
|
|
199
|
-
message: "jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
200
|
-
}),
|
|
201
|
-
});
|
|
178
|
+
exports.UpdateRoleJobInputSchema = exports.CreateRoleJobInputSchema.partial();
|
|
179
|
+
exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial();
|
|
202
180
|
exports.UpdateJobInputSchema = exports.CreateJobInputSchema.partial().extend({
|
|
203
181
|
id: zod_1.z.cuid2(),
|
|
204
182
|
});
|
package/package.json
CHANGED
package/src/schemas/job.ts
CHANGED
|
@@ -23,6 +23,10 @@ import {
|
|
|
23
23
|
WorkMode,
|
|
24
24
|
} from "../constants";
|
|
25
25
|
|
|
26
|
+
const JobSectionEnum = z.enum(
|
|
27
|
+
Object.values(JOB_SECTIONS) as [string, ...string[]]
|
|
28
|
+
);
|
|
29
|
+
|
|
26
30
|
export const BaseJobEntitySchema = z.object({
|
|
27
31
|
id: z.cuid2(),
|
|
28
32
|
title: z.string(),
|
|
@@ -89,9 +93,6 @@ export const GigJobEntitySchema = z.object({
|
|
|
89
93
|
wagesType: z
|
|
90
94
|
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
91
95
|
.optional(),
|
|
92
|
-
jobSections: z
|
|
93
|
-
.array(z.string())
|
|
94
|
-
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
95
96
|
});
|
|
96
97
|
|
|
97
98
|
export const JobWithGigDetailsEntitySchema = JobEntitySchema.extend(
|
|
@@ -117,9 +118,6 @@ export const RoleJobEntitySchema = z.object({
|
|
|
117
118
|
wagesType: z
|
|
118
119
|
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
119
120
|
.optional(),
|
|
120
|
-
jobSections: z
|
|
121
|
-
.array(z.string())
|
|
122
|
-
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
123
121
|
});
|
|
124
122
|
|
|
125
123
|
export const JobWithRoleDetailsEntitySchema = JobEntitySchema.extend(
|
|
@@ -143,6 +141,23 @@ export const CreateJobInputSchema = z
|
|
|
143
141
|
location: z
|
|
144
142
|
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
145
143
|
.default(JOB_LOCATIONS.REMOTE),
|
|
144
|
+
jobSections: z
|
|
145
|
+
.array(JobSectionEnum)
|
|
146
|
+
.default([
|
|
147
|
+
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
148
|
+
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
149
|
+
JOB_SECTIONS.RESUME,
|
|
150
|
+
])
|
|
151
|
+
.refine(
|
|
152
|
+
(sections) =>
|
|
153
|
+
sections.includes(JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
154
|
+
sections.includes(JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
155
|
+
sections.includes(JOB_SECTIONS.RESUME),
|
|
156
|
+
{
|
|
157
|
+
message:
|
|
158
|
+
"jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
159
|
+
}
|
|
160
|
+
),
|
|
146
161
|
})
|
|
147
162
|
.superRefine((data, ctx) => {
|
|
148
163
|
if (data.jobType === JOB_TYPE.ROLE) {
|
|
@@ -217,54 +232,8 @@ export const CreateGigJobInputSchema = z.object({
|
|
|
217
232
|
.optional(),
|
|
218
233
|
});
|
|
219
234
|
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
export const UpdateRoleJobInputSchema =
|
|
225
|
-
CreateRoleJobInputSchema.partial().extend({
|
|
226
|
-
id: z.cuid2(),
|
|
227
|
-
jobSections: z
|
|
228
|
-
.array(JobSectionEnum)
|
|
229
|
-
.default([
|
|
230
|
-
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
231
|
-
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
232
|
-
JOB_SECTIONS.RESUME,
|
|
233
|
-
])
|
|
234
|
-
.refine(
|
|
235
|
-
(sections) =>
|
|
236
|
-
sections.includes(JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
237
|
-
sections.includes(JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
238
|
-
sections.includes(JOB_SECTIONS.RESUME),
|
|
239
|
-
{
|
|
240
|
-
message:
|
|
241
|
-
"jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
242
|
-
}
|
|
243
|
-
),
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial().extend(
|
|
247
|
-
{
|
|
248
|
-
id: z.cuid2(),
|
|
249
|
-
jobSections: z
|
|
250
|
-
.array(JobSectionEnum)
|
|
251
|
-
.default([
|
|
252
|
-
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
253
|
-
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
254
|
-
JOB_SECTIONS.RESUME,
|
|
255
|
-
])
|
|
256
|
-
.refine(
|
|
257
|
-
(sections) =>
|
|
258
|
-
sections.includes(JOB_SECTIONS.PERSONAL_INFORMATION) &&
|
|
259
|
-
sections.includes(JOB_SECTIONS.PROFESSIONAL_INFORMATION) &&
|
|
260
|
-
sections.includes(JOB_SECTIONS.RESUME),
|
|
261
|
-
{
|
|
262
|
-
message:
|
|
263
|
-
"jobSections must always include PERSONAL_INFORMATION, PROFESSIONAL_INFORMATION, and RESUME",
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
}
|
|
267
|
-
);
|
|
235
|
+
export const UpdateRoleJobInputSchema = CreateRoleJobInputSchema.partial();
|
|
236
|
+
export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial();
|
|
268
237
|
|
|
269
238
|
export const UpdateJobInputSchema = CreateJobInputSchema.partial().extend({
|
|
270
239
|
id: z.cuid2(),
|