@zyacreatives/shared 2.0.78 → 2.0.80
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 +158 -0
- package/dist/schemas/job.js +19 -3
- package/dist/types/job.d.ts +2 -1
- package/package.json +1 -1
- package/src/schemas/job.ts +67 -35
- package/src/types/job.ts +3 -0
package/dist/schemas/job.d.ts
CHANGED
|
@@ -690,3 +690,161 @@ export declare const NormalizedJobOutputSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
690
690
|
"Project Based": "Project Based";
|
|
691
691
|
}>>;
|
|
692
692
|
}, z.core.$strip>], "jobType">;
|
|
693
|
+
export declare const GetJobsOutputSchema: z.ZodObject<{
|
|
694
|
+
jobs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
695
|
+
title: z.ZodString;
|
|
696
|
+
brandId: z.ZodCUID2;
|
|
697
|
+
brandName: z.ZodCUID2;
|
|
698
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
699
|
+
status: z.ZodEnum<{
|
|
700
|
+
ACTIVE: "ACTIVE";
|
|
701
|
+
DELETED: "DELETED";
|
|
702
|
+
DRAFT: "DRAFT";
|
|
703
|
+
ARCHIVED: "ARCHIVED";
|
|
704
|
+
}>;
|
|
705
|
+
employmentType: z.ZodOptional<z.ZodEnum<{
|
|
706
|
+
"Full Time": "Full Time";
|
|
707
|
+
"Part Time": "Part Time";
|
|
708
|
+
Freelance: "Freelance";
|
|
709
|
+
Internship: "Internship";
|
|
710
|
+
}>>;
|
|
711
|
+
workMode: z.ZodEnum<{
|
|
712
|
+
Remote: "Remote";
|
|
713
|
+
Hybrid: "Hybrid";
|
|
714
|
+
"On Site": "On Site";
|
|
715
|
+
}>;
|
|
716
|
+
gigType: z.ZodOptional<z.ZodEnum<{
|
|
717
|
+
"One Time": "One Time";
|
|
718
|
+
Recurring: "Recurring";
|
|
719
|
+
}>>;
|
|
720
|
+
location: z.ZodEnum<{
|
|
721
|
+
Africa: "Africa";
|
|
722
|
+
Asia: "Asia";
|
|
723
|
+
Europe: "Europe";
|
|
724
|
+
"North America": "North America";
|
|
725
|
+
"South America": "South America";
|
|
726
|
+
"Middle East": "Middle East";
|
|
727
|
+
Oceania: "Oceania";
|
|
728
|
+
Global: "Global";
|
|
729
|
+
Other: "Other";
|
|
730
|
+
Remote: "Remote";
|
|
731
|
+
EMEA: "EMEA";
|
|
732
|
+
"Asia Pacific": "Asia Pacific";
|
|
733
|
+
}>;
|
|
734
|
+
jobSections: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
735
|
+
[x: string]: string;
|
|
736
|
+
}>>>;
|
|
737
|
+
createdAt: z.ZodDate;
|
|
738
|
+
updatedAt: z.ZodDate;
|
|
739
|
+
id: z.ZodCUID2;
|
|
740
|
+
jobType: z.ZodLiteral<"GIG">;
|
|
741
|
+
overview: z.ZodString;
|
|
742
|
+
deliverables: z.ZodString;
|
|
743
|
+
employeeRequirements: z.ZodOptional<z.ZodString>;
|
|
744
|
+
aboutCompany: z.ZodOptional<z.ZodString>;
|
|
745
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
746
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
747
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
748
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
749
|
+
"USD (United States Dollar)": "USD (United States Dollar)";
|
|
750
|
+
"EUR (Euro)": "EUR (Euro)";
|
|
751
|
+
"GBP (British Pound Sterling)": "GBP (British Pound Sterling)";
|
|
752
|
+
"NGN (Nigerian Naira)": "NGN (Nigerian Naira)";
|
|
753
|
+
"CAD (Canadian Dollar)": "CAD (Canadian Dollar)";
|
|
754
|
+
"AUD (Australian Dollar)": "AUD (Australian Dollar)";
|
|
755
|
+
"JPY (Japanese Yen)": "JPY (Japanese Yen)";
|
|
756
|
+
"CHF (Swiss Franc)": "CHF (Swiss Franc)";
|
|
757
|
+
"INR (Indian Rupee)": "INR (Indian Rupee)";
|
|
758
|
+
"ZAR (South African Rand)": "ZAR (South African Rand)";
|
|
759
|
+
}>>;
|
|
760
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
761
|
+
Hourly: "Hourly";
|
|
762
|
+
Daily: "Daily";
|
|
763
|
+
Weekly: "Weekly";
|
|
764
|
+
Monthly: "Monthly";
|
|
765
|
+
"Project Based": "Project Based";
|
|
766
|
+
}>>;
|
|
767
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
768
|
+
title: z.ZodString;
|
|
769
|
+
brandId: z.ZodCUID2;
|
|
770
|
+
brandName: z.ZodCUID2;
|
|
771
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
772
|
+
status: z.ZodEnum<{
|
|
773
|
+
ACTIVE: "ACTIVE";
|
|
774
|
+
DELETED: "DELETED";
|
|
775
|
+
DRAFT: "DRAFT";
|
|
776
|
+
ARCHIVED: "ARCHIVED";
|
|
777
|
+
}>;
|
|
778
|
+
employmentType: z.ZodOptional<z.ZodEnum<{
|
|
779
|
+
"Full Time": "Full Time";
|
|
780
|
+
"Part Time": "Part Time";
|
|
781
|
+
Freelance: "Freelance";
|
|
782
|
+
Internship: "Internship";
|
|
783
|
+
}>>;
|
|
784
|
+
workMode: z.ZodEnum<{
|
|
785
|
+
Remote: "Remote";
|
|
786
|
+
Hybrid: "Hybrid";
|
|
787
|
+
"On Site": "On Site";
|
|
788
|
+
}>;
|
|
789
|
+
gigType: z.ZodOptional<z.ZodEnum<{
|
|
790
|
+
"One Time": "One Time";
|
|
791
|
+
Recurring: "Recurring";
|
|
792
|
+
}>>;
|
|
793
|
+
location: z.ZodEnum<{
|
|
794
|
+
Africa: "Africa";
|
|
795
|
+
Asia: "Asia";
|
|
796
|
+
Europe: "Europe";
|
|
797
|
+
"North America": "North America";
|
|
798
|
+
"South America": "South America";
|
|
799
|
+
"Middle East": "Middle East";
|
|
800
|
+
Oceania: "Oceania";
|
|
801
|
+
Global: "Global";
|
|
802
|
+
Other: "Other";
|
|
803
|
+
Remote: "Remote";
|
|
804
|
+
EMEA: "EMEA";
|
|
805
|
+
"Asia Pacific": "Asia Pacific";
|
|
806
|
+
}>;
|
|
807
|
+
jobSections: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
808
|
+
[x: string]: string;
|
|
809
|
+
}>>>;
|
|
810
|
+
createdAt: z.ZodDate;
|
|
811
|
+
updatedAt: z.ZodDate;
|
|
812
|
+
id: z.ZodCUID2;
|
|
813
|
+
jobType: z.ZodLiteral<"ROLE">;
|
|
814
|
+
experienceLevel: z.ZodEnum<{
|
|
815
|
+
"0-1 year": "0-1 year";
|
|
816
|
+
"1-3 years": "1-3 years";
|
|
817
|
+
"3-5 years": "3-5 years";
|
|
818
|
+
"5+ years": "5+ years";
|
|
819
|
+
}>;
|
|
820
|
+
overview: z.ZodString;
|
|
821
|
+
keyResponsibilities: z.ZodString;
|
|
822
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
823
|
+
employeeRequirements: z.ZodOptional<z.ZodString>;
|
|
824
|
+
companyBenefits: z.ZodOptional<z.ZodString>;
|
|
825
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
826
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
827
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
828
|
+
"USD (United States Dollar)": "USD (United States Dollar)";
|
|
829
|
+
"EUR (Euro)": "EUR (Euro)";
|
|
830
|
+
"GBP (British Pound Sterling)": "GBP (British Pound Sterling)";
|
|
831
|
+
"NGN (Nigerian Naira)": "NGN (Nigerian Naira)";
|
|
832
|
+
"CAD (Canadian Dollar)": "CAD (Canadian Dollar)";
|
|
833
|
+
"AUD (Australian Dollar)": "AUD (Australian Dollar)";
|
|
834
|
+
"JPY (Japanese Yen)": "JPY (Japanese Yen)";
|
|
835
|
+
"CHF (Swiss Franc)": "CHF (Swiss Franc)";
|
|
836
|
+
"INR (Indian Rupee)": "INR (Indian Rupee)";
|
|
837
|
+
"ZAR (South African Rand)": "ZAR (South African Rand)";
|
|
838
|
+
}>>;
|
|
839
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
840
|
+
Hourly: "Hourly";
|
|
841
|
+
Daily: "Daily";
|
|
842
|
+
Weekly: "Weekly";
|
|
843
|
+
Monthly: "Monthly";
|
|
844
|
+
"Project Based": "Project Based";
|
|
845
|
+
}>>;
|
|
846
|
+
}, z.core.$strip>], "jobType">>;
|
|
847
|
+
noOfJobs: z.ZodNumber;
|
|
848
|
+
noOfActiveJobs: z.ZodNumber;
|
|
849
|
+
noOfArchivedJobs: z.ZodNumber;
|
|
850
|
+
}, z.core.$strip>;
|
package/dist/schemas/job.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.GetJobsOutputSchema = 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
6
|
const JobSectionEnum = zod_1.z.enum(Object.values(constants_1.JOB_SECTIONS));
|
|
@@ -156,7 +156,8 @@ exports.CreateJobInputSchema = zod_1.z
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
exports.CreateRoleJobInputSchema = zod_1.z
|
|
159
|
+
exports.CreateRoleJobInputSchema = zod_1.z
|
|
160
|
+
.object({
|
|
160
161
|
id: zod_1.z.cuid2(),
|
|
161
162
|
experienceLevel: zod_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)),
|
|
162
163
|
overview: zod_1.z.string(),
|
|
@@ -172,8 +173,13 @@ exports.CreateRoleJobInputSchema = zod_1.z.object({
|
|
|
172
173
|
wagesType: zod_1.z
|
|
173
174
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
174
175
|
.optional(),
|
|
176
|
+
})
|
|
177
|
+
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin, {
|
|
178
|
+
message: "wagesMax must be greater than wagesMin",
|
|
179
|
+
path: ["wagesMax"],
|
|
175
180
|
});
|
|
176
|
-
exports.CreateGigJobInputSchema = zod_1.z
|
|
181
|
+
exports.CreateGigJobInputSchema = zod_1.z
|
|
182
|
+
.object({
|
|
177
183
|
id: zod_1.z.cuid2(),
|
|
178
184
|
overview: zod_1.z.string(),
|
|
179
185
|
deliverables: zod_1.z.string(),
|
|
@@ -188,6 +194,10 @@ exports.CreateGigJobInputSchema = zod_1.z.object({
|
|
|
188
194
|
wagesType: zod_1.z
|
|
189
195
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
190
196
|
.optional(),
|
|
197
|
+
})
|
|
198
|
+
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin, {
|
|
199
|
+
message: "wagesMax must be greater than wagesMin",
|
|
200
|
+
path: ["wagesMax"],
|
|
191
201
|
});
|
|
192
202
|
exports.UpdateRoleJobInputSchema = exports.CreateRoleJobInputSchema.partial().required({ id: true });
|
|
193
203
|
exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial().required({ id: true });
|
|
@@ -201,3 +211,9 @@ exports.NormalizedJobOutputSchema = zod_1.z.discriminatedUnion("jobType", [
|
|
|
201
211
|
exports.JobWithGigDetailsEntitySchema,
|
|
202
212
|
exports.JobWithRoleDetailsEntitySchema,
|
|
203
213
|
]);
|
|
214
|
+
exports.GetJobsOutputSchema = zod_1.z.object({
|
|
215
|
+
jobs: zod_1.z.array(exports.NormalizedJobOutputSchema),
|
|
216
|
+
noOfJobs: zod_1.z.number(),
|
|
217
|
+
noOfActiveJobs: zod_1.z.number(),
|
|
218
|
+
noOfArchivedJobs: zod_1.z.number(),
|
|
219
|
+
});
|
package/dist/types/job.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema, JobWithGigDetailsEntitySchema, JobWithRoleDetailsEntitySchema, BaseJobEntitySchema, JobIdSchema } from "../schemas/job";
|
|
2
|
+
import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema, JobWithGigDetailsEntitySchema, JobWithRoleDetailsEntitySchema, BaseJobEntitySchema, JobIdSchema, GetJobsOutputSchema } from "../schemas/job";
|
|
3
3
|
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
4
4
|
export type JobIdInput = z.infer<typeof JobIdSchema>;
|
|
5
5
|
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
@@ -20,3 +20,4 @@ export type UpdateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
|
20
20
|
export type GetJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
21
21
|
export type JobWithGigDetailsEntity = z.infer<typeof JobWithGigDetailsEntitySchema>;
|
|
22
22
|
export type JobWithRoleDetailsEntity = z.infer<typeof JobWithRoleDetailsEntitySchema>;
|
|
23
|
+
export type GetJobsOutput = z.infer<typeof GetJobsOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/job.ts
CHANGED
|
@@ -210,42 +210,67 @@ export const CreateJobInputSchema = z
|
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
-
export const CreateRoleJobInputSchema = z
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
.
|
|
227
|
-
.optional(),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
213
|
+
export const CreateRoleJobInputSchema = z
|
|
214
|
+
.object({
|
|
215
|
+
id: z.cuid2(),
|
|
216
|
+
experienceLevel: z.enum(
|
|
217
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
218
|
+
ExperienceLevel,
|
|
219
|
+
...ExperienceLevel[]
|
|
220
|
+
]
|
|
221
|
+
),
|
|
222
|
+
overview: z.string(),
|
|
223
|
+
keyResponsibilities: z.string(),
|
|
224
|
+
requiredSkills: z.array(z.string()),
|
|
225
|
+
employeeRequirements: z.string().optional(),
|
|
226
|
+
companyBenefits: z.string().optional(),
|
|
227
|
+
wagesMin: z.number().optional(),
|
|
228
|
+
wagesMax: z.number().optional(),
|
|
229
|
+
wagesCurrency: z
|
|
230
|
+
.enum(
|
|
231
|
+
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]]
|
|
232
|
+
)
|
|
233
|
+
.optional(),
|
|
234
|
+
wagesType: z
|
|
235
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
236
|
+
.optional(),
|
|
237
|
+
})
|
|
238
|
+
.refine(
|
|
239
|
+
({ wagesMin, wagesMax }) =>
|
|
240
|
+
wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin,
|
|
241
|
+
{
|
|
242
|
+
message: "wagesMax must be greater than wagesMin",
|
|
243
|
+
path: ["wagesMax"],
|
|
244
|
+
}
|
|
245
|
+
);
|
|
232
246
|
|
|
233
|
-
export const CreateGigJobInputSchema = z
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
export const CreateGigJobInputSchema = z
|
|
248
|
+
.object({
|
|
249
|
+
id: z.cuid2(),
|
|
250
|
+
overview: z.string(),
|
|
251
|
+
deliverables: z.string(),
|
|
252
|
+
employeeRequirements: z.string().optional(),
|
|
253
|
+
aboutCompany: z.string().optional(),
|
|
254
|
+
requiredSkills: z.array(z.string()),
|
|
255
|
+
wagesMin: z.number().optional(),
|
|
256
|
+
wagesMax: z.number().optional(),
|
|
257
|
+
wagesCurrency: z
|
|
258
|
+
.enum(
|
|
259
|
+
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]]
|
|
260
|
+
)
|
|
261
|
+
.optional(),
|
|
262
|
+
wagesType: z
|
|
263
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
264
|
+
.optional(),
|
|
265
|
+
})
|
|
266
|
+
.refine(
|
|
267
|
+
({ wagesMin, wagesMax }) =>
|
|
268
|
+
wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin,
|
|
269
|
+
{
|
|
270
|
+
message: "wagesMax must be greater than wagesMin",
|
|
271
|
+
path: ["wagesMax"],
|
|
272
|
+
}
|
|
273
|
+
);
|
|
249
274
|
|
|
250
275
|
export const UpdateRoleJobInputSchema =
|
|
251
276
|
CreateRoleJobInputSchema.partial().required({ id: true });
|
|
@@ -264,3 +289,10 @@ export const NormalizedJobOutputSchema = z.discriminatedUnion("jobType", [
|
|
|
264
289
|
JobWithGigDetailsEntitySchema,
|
|
265
290
|
JobWithRoleDetailsEntitySchema,
|
|
266
291
|
]);
|
|
292
|
+
|
|
293
|
+
export const GetJobsOutputSchema = z.object({
|
|
294
|
+
jobs: z.array(NormalizedJobOutputSchema),
|
|
295
|
+
noOfJobs: z.number(),
|
|
296
|
+
noOfActiveJobs: z.number(),
|
|
297
|
+
noOfArchivedJobs: z.number(),
|
|
298
|
+
});
|
package/src/types/job.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
JobWithRoleDetailsEntitySchema,
|
|
14
14
|
BaseJobEntitySchema,
|
|
15
15
|
JobIdSchema,
|
|
16
|
+
GetJobsOutputSchema,
|
|
16
17
|
} from "../schemas/job";
|
|
17
18
|
|
|
18
19
|
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
@@ -58,3 +59,5 @@ export type JobWithGigDetailsEntity = z.infer<
|
|
|
58
59
|
export type JobWithRoleDetailsEntity = z.infer<
|
|
59
60
|
typeof JobWithRoleDetailsEntitySchema
|
|
60
61
|
>;
|
|
62
|
+
|
|
63
|
+
export type GetJobsOutput = z.infer<typeof GetJobsOutputSchema>;
|