@zyacreatives/shared 1.9.6 → 1.9.8

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.
@@ -2,6 +2,9 @@ import { z } from "zod";
2
2
  export declare const JobEntitySchema: z.ZodObject<{
3
3
  id: z.ZodCUID2;
4
4
  title: z.ZodString;
5
+ brandId: z.ZodCUID2;
6
+ brandName: z.ZodCUID2;
7
+ brandImgUrl: z.ZodOptional<z.ZodCUID2>;
5
8
  jobType: z.ZodEnum<{
6
9
  [x: string]: string;
7
10
  }>;
@@ -33,6 +36,66 @@ export declare const JobEntitySchema: z.ZodObject<{
33
36
  }, z.core.$strip>;
34
37
  export declare const GigJobEntitySchema: z.ZodObject<{
35
38
  title: z.ZodString;
39
+ brandId: z.ZodCUID2;
40
+ brandName: z.ZodCUID2;
41
+ brandImgUrl: z.ZodOptional<z.ZodCUID2>;
42
+ workMode: z.ZodEnum<{
43
+ [x: string]: string;
44
+ }>;
45
+ location: z.ZodArray<z.ZodEnum<{
46
+ Africa: "Africa";
47
+ Asia: "Asia";
48
+ Europe: "Europe";
49
+ "North America": "North America";
50
+ "South America": "South America";
51
+ "Middle East": "Middle East";
52
+ Oceania: "Oceania";
53
+ Global: "Global";
54
+ Other: "Other";
55
+ Remote: "Remote";
56
+ EMEA: "EMEA";
57
+ "Asia Pacific": "Asia Pacific";
58
+ }>>;
59
+ createdAt: z.ZodDate;
60
+ updatedAt: z.ZodDate;
61
+ id: z.ZodCUID2;
62
+ jobType: z.ZodLiteral<string>;
63
+ employmentType: z.ZodNull;
64
+ gigType: z.ZodEnum<{
65
+ [x: string]: string;
66
+ }>;
67
+ overview: z.ZodString;
68
+ deliverables: z.ZodArray<z.ZodString>;
69
+ employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ aboutCompany: z.ZodOptional<z.ZodString>;
71
+ requiredSkills: z.ZodArray<z.ZodString>;
72
+ wagesMin: z.ZodOptional<z.ZodNumber>;
73
+ wagesMax: z.ZodOptional<z.ZodNumber>;
74
+ wagesCurrency: z.ZodOptional<z.ZodEnum<{
75
+ USD: "USD";
76
+ EUR: "EUR";
77
+ GBP: "GBP";
78
+ NGN: "NGN";
79
+ CAD: "CAD";
80
+ AUD: "AUD";
81
+ JPY: "JPY";
82
+ CHF: "CHF";
83
+ INR: "INR";
84
+ ZAR: "ZAR";
85
+ }>>;
86
+ wagesType: z.ZodOptional<z.ZodEnum<{
87
+ HOURLY: "HOURLY";
88
+ DAILY: "DAILY";
89
+ WEEKLY: "WEEKLY";
90
+ MONTHLY: "MONTHLY";
91
+ PROJECT_BASED: "PROJECT_BASED";
92
+ }>>;
93
+ }, z.core.$strip>;
94
+ export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
95
+ title: z.ZodString;
96
+ brandId: z.ZodCUID2;
97
+ brandName: z.ZodCUID2;
98
+ brandImgUrl: z.ZodOptional<z.ZodCUID2>;
36
99
  workMode: z.ZodEnum<{
37
100
  [x: string]: string;
38
101
  }>;
@@ -88,6 +151,72 @@ export declare const GigJobEntitySchema: z.ZodObject<{
88
151
  export declare const RoleJobEntitySchema: z.ZodObject<{
89
152
  id: z.ZodCUID2;
90
153
  title: z.ZodString;
154
+ brandId: z.ZodCUID2;
155
+ brandName: z.ZodCUID2;
156
+ brandImgUrl: z.ZodOptional<z.ZodCUID2>;
157
+ workMode: z.ZodEnum<{
158
+ [x: string]: string;
159
+ }>;
160
+ location: z.ZodArray<z.ZodEnum<{
161
+ Africa: "Africa";
162
+ Asia: "Asia";
163
+ Europe: "Europe";
164
+ "North America": "North America";
165
+ "South America": "South America";
166
+ "Middle East": "Middle East";
167
+ Oceania: "Oceania";
168
+ Global: "Global";
169
+ Other: "Other";
170
+ Remote: "Remote";
171
+ EMEA: "EMEA";
172
+ "Asia Pacific": "Asia Pacific";
173
+ }>>;
174
+ createdAt: z.ZodDate;
175
+ updatedAt: z.ZodDate;
176
+ jobType: z.ZodLiteral<string>;
177
+ gigType: z.ZodNull;
178
+ employmentType: z.ZodEnum<{
179
+ [x: string]: string;
180
+ }>;
181
+ experienceLevel: z.ZodEnum<{
182
+ "0-1 year": "0-1 year";
183
+ "1-3 years": "1-3 years";
184
+ "3-5 years": "3-5 years";
185
+ "5+ years": "5+ years";
186
+ }>;
187
+ overview: z.ZodString;
188
+ keyResponsibilities: z.ZodArray<z.ZodString>;
189
+ requiredSkills: z.ZodArray<z.ZodString>;
190
+ employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ companyBenefits: z.ZodOptional<z.ZodArray<z.ZodString>>;
192
+ wagesMin: z.ZodOptional<z.ZodNumber>;
193
+ wagesMax: z.ZodOptional<z.ZodNumber>;
194
+ wagesCurrency: z.ZodOptional<z.ZodEnum<{
195
+ USD: "USD";
196
+ EUR: "EUR";
197
+ GBP: "GBP";
198
+ NGN: "NGN";
199
+ CAD: "CAD";
200
+ AUD: "AUD";
201
+ JPY: "JPY";
202
+ CHF: "CHF";
203
+ INR: "INR";
204
+ ZAR: "ZAR";
205
+ }>>;
206
+ wagesType: z.ZodOptional<z.ZodEnum<{
207
+ HOURLY: "HOURLY";
208
+ DAILY: "DAILY";
209
+ WEEKLY: "WEEKLY";
210
+ MONTHLY: "MONTHLY";
211
+ PROJECT_BASED: "PROJECT_BASED";
212
+ }>>;
213
+ }, z.core.$strip>;
214
+ export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
215
+ id: z.ZodCUID2;
216
+ title: z.ZodString;
217
+ brandId: z.ZodCUID2;
218
+ brandName: z.ZodCUID2;
219
+ brandImgUrl: z.ZodOptional<z.ZodCUID2>;
91
220
  workMode: z.ZodEnum<{
92
221
  [x: string]: string;
93
222
  }>;
@@ -147,6 +276,7 @@ export declare const RoleJobEntitySchema: z.ZodObject<{
147
276
  }, z.core.$strip>;
148
277
  export declare const CreateJobInputSchema: z.ZodObject<{
149
278
  title: z.ZodString;
279
+ brandId: z.ZodCUID2;
150
280
  jobType: z.ZodEnum<{
151
281
  [x: string]: string;
152
282
  }>;
@@ -175,6 +305,7 @@ export declare const CreateJobInputSchema: z.ZodObject<{
175
305
  }>>>;
176
306
  }, z.core.$strip>;
177
307
  export declare const CreateRoleJobInputSchema: z.ZodObject<{
308
+ jobId: z.ZodCUID2;
178
309
  experienceLevel: z.ZodEnum<{
179
310
  "0-1 year": "0-1 year";
180
311
  "1-3 years": "1-3 years";
@@ -209,6 +340,7 @@ export declare const CreateRoleJobInputSchema: z.ZodObject<{
209
340
  }>>;
210
341
  }, z.core.$strip>;
211
342
  export declare const CreateGigJobInputSchema: z.ZodObject<{
343
+ jobId: z.ZodCUID2;
212
344
  overview: z.ZodString;
213
345
  deliverables: z.ZodArray<z.ZodString>;
214
346
  employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -237,6 +369,7 @@ export declare const CreateGigJobInputSchema: z.ZodObject<{
237
369
  }>>;
238
370
  }, z.core.$strip>;
239
371
  export declare const UpdateRoleJobInputSchema: z.ZodObject<{
372
+ jobId: z.ZodOptional<z.ZodCUID2>;
240
373
  experienceLevel: z.ZodOptional<z.ZodEnum<{
241
374
  "0-1 year": "0-1 year";
242
375
  "1-3 years": "1-3 years";
@@ -275,6 +408,7 @@ export declare const UpdateRoleJobInputSchema: z.ZodObject<{
275
408
  }>>>;
276
409
  }, z.core.$strip>;
277
410
  export declare const UpdateGigJobInputSchema: z.ZodObject<{
411
+ jobId: z.ZodOptional<z.ZodCUID2>;
278
412
  overview: z.ZodOptional<z.ZodString>;
279
413
  deliverables: z.ZodOptional<z.ZodArray<z.ZodString>>;
280
414
  employeeRequirements: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
@@ -308,6 +442,7 @@ export declare const UpdateGigJobInputSchema: z.ZodObject<{
308
442
  }, z.core.$strip>;
309
443
  export declare const UpdateJobInputSchema: z.ZodObject<{
310
444
  title: z.ZodOptional<z.ZodString>;
445
+ brandId: z.ZodOptional<z.ZodCUID2>;
311
446
  jobType: z.ZodOptional<z.ZodEnum<{
312
447
  [x: string]: string;
313
448
  }>>;
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.RoleJobEntitySchema = exports.GigJobEntitySchema = exports.JobEntitySchema = void 0;
3
+ exports.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.JobWithRoleDetailsEntitySchema = exports.RoleJobEntitySchema = exports.JobWithGigDetailsEntitySchema = exports.GigJobEntitySchema = exports.JobEntitySchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
6
  exports.JobEntitySchema = zod_1.z.object({
7
7
  id: zod_1.z.cuid2(),
8
8
  title: zod_1.z.string(),
9
+ brandId: zod_1.z.cuid2(),
10
+ brandName: zod_1.z.cuid2(),
11
+ brandImgUrl: zod_1.z.cuid2().optional(),
9
12
  jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
10
13
  employmentType: zod_1.z
11
14
  .enum(Object.values(constants_1.EMPLOYMENT_TYPE))
@@ -23,7 +26,7 @@ exports.JobEntitySchema = zod_1.z.object({
23
26
  exports.GigJobEntitySchema = exports.JobEntitySchema.extend({
24
27
  id: zod_1.z.cuid2(),
25
28
  jobType: zod_1.z.literal(constants_1.JOB_TYPE.GIG),
26
- employmentType: zod_1.z.null(), // enforce null for GIG
29
+ employmentType: zod_1.z.null(),
27
30
  gigType: zod_1.z.enum(Object.values(constants_1.GIG_TYPE)),
28
31
  overview: zod_1.z.string(),
29
32
  deliverables: zod_1.z.array(zod_1.z.string()),
@@ -39,6 +42,7 @@ exports.GigJobEntitySchema = exports.JobEntitySchema.extend({
39
42
  .enum(Object.values(constants_1.WAGE_TYPES))
40
43
  .optional(),
41
44
  });
45
+ exports.JobWithGigDetailsEntitySchema = exports.JobEntitySchema.extend(exports.GigJobEntitySchema.shape);
42
46
  exports.RoleJobEntitySchema = exports.JobEntitySchema.extend({
43
47
  jobType: zod_1.z.literal(constants_1.JOB_TYPE.ROLE),
44
48
  gigType: zod_1.z.null(), // enforce null for ROLE
@@ -58,9 +62,11 @@ exports.RoleJobEntitySchema = exports.JobEntitySchema.extend({
58
62
  .enum(Object.values(constants_1.WAGE_TYPES))
59
63
  .optional(),
60
64
  });
65
+ exports.JobWithRoleDetailsEntitySchema = exports.JobEntitySchema.extend(exports.RoleJobEntitySchema.shape);
61
66
  exports.CreateJobInputSchema = zod_1.z
62
67
  .object({
63
68
  title: zod_1.z.string(),
69
+ brandId: zod_1.z.cuid2(),
64
70
  jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
65
71
  // status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
66
72
  employmentType: zod_1.z.enum(Object.values(constants_1.EMPLOYMENT_TYPE)),
@@ -108,6 +114,7 @@ exports.CreateJobInputSchema = zod_1.z
108
114
  }
109
115
  });
110
116
  exports.CreateRoleJobInputSchema = zod_1.z.object({
117
+ jobId: zod_1.z.cuid2(),
111
118
  experienceLevel: zod_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)),
112
119
  overview: zod_1.z.string(),
113
120
  keyResponsibilities: zod_1.z.array(zod_1.z.string()),
@@ -124,6 +131,7 @@ exports.CreateRoleJobInputSchema = zod_1.z.object({
124
131
  .optional(),
125
132
  });
126
133
  exports.CreateGigJobInputSchema = zod_1.z.object({
134
+ jobId: zod_1.z.cuid2(),
127
135
  overview: zod_1.z.string(),
128
136
  deliverables: zod_1.z.array(zod_1.z.string()),
129
137
  employeeRequirements: zod_1.z.array(zod_1.z.string()).optional(),
@@ -1,8 +1,10 @@
1
1
  import { z } from "zod";
2
- import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema } from "../schemas/job";
2
+ import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema, JobWithGigDetailsEntitySchema, JobWithRoleDetailsEntitySchema } from "../schemas/job";
3
3
  export type JobEntity = z.infer<typeof JobEntitySchema>;
4
4
  export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
5
5
  export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
6
+ export type JobWithGigDetailsEntity = z.infer<typeof JobWithGigDetailsEntitySchema>;
7
+ export type JobWithRoleDetailsEntity = z.infer<typeof JobWithRoleDetailsEntitySchema>;
6
8
  export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
7
9
  export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
8
10
  export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.9.6",
3
+ "version": "1.9.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,6 +24,9 @@ import {
24
24
  export const JobEntitySchema = z.object({
25
25
  id: z.cuid2(),
26
26
  title: z.string(),
27
+ brandId: z.cuid2(),
28
+ brandName: z.cuid2(),
29
+ brandImgUrl: z.cuid2().optional(),
27
30
  jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
28
31
  employmentType: z
29
32
  .enum(
@@ -46,7 +49,7 @@ export const JobEntitySchema = z.object({
46
49
  export const GigJobEntitySchema = JobEntitySchema.extend({
47
50
  id: z.cuid2(),
48
51
  jobType: z.literal(JOB_TYPE.GIG),
49
- employmentType: z.null(), // enforce null for GIG
52
+ employmentType: z.null(),
50
53
  gigType: z.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]]),
51
54
  overview: z.string(),
52
55
  deliverables: z.array(z.string()),
@@ -63,6 +66,10 @@ export const GigJobEntitySchema = JobEntitySchema.extend({
63
66
  .optional(),
64
67
  });
65
68
 
69
+ export const JobWithGigDetailsEntitySchema = JobEntitySchema.extend(
70
+ GigJobEntitySchema.shape
71
+ );
72
+
66
73
  export const RoleJobEntitySchema = JobEntitySchema.extend({
67
74
  jobType: z.literal(JOB_TYPE.ROLE),
68
75
  gigType: z.null(), // enforce null for ROLE
@@ -87,9 +94,14 @@ export const RoleJobEntitySchema = JobEntitySchema.extend({
87
94
  .optional(),
88
95
  });
89
96
 
97
+ export const JobWithRoleDetailsEntitySchema = JobEntitySchema.extend(
98
+ RoleJobEntitySchema.shape
99
+ );
100
+
90
101
  export const CreateJobInputSchema = z
91
102
  .object({
92
103
  title: z.string(),
104
+ brandId: z.cuid2(),
93
105
  jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
94
106
  // status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
95
107
  employmentType: z.enum(
@@ -143,6 +155,7 @@ export const CreateJobInputSchema = z
143
155
  });
144
156
 
145
157
  export const CreateRoleJobInputSchema = z.object({
158
+ jobId: z.cuid2(),
146
159
  experienceLevel: z.enum(
147
160
  Object.values(EXPERIENCE_LEVELS) as [ExperienceLevel, ...ExperienceLevel[]]
148
161
  ),
@@ -162,6 +175,7 @@ export const CreateRoleJobInputSchema = z.object({
162
175
  });
163
176
 
164
177
  export const CreateGigJobInputSchema = z.object({
178
+ jobId: z.cuid2(),
165
179
  overview: z.string(),
166
180
  deliverables: z.array(z.string()),
167
181
  employeeRequirements: z.array(z.string()).optional(),
package/src/types/job.ts CHANGED
@@ -9,6 +9,8 @@ import {
9
9
  UpdateRoleJobInputSchema,
10
10
  UpdateGigJobInputSchema,
11
11
  UpdateJobInputSchema,
12
+ JobWithGigDetailsEntitySchema,
13
+ JobWithRoleDetailsEntitySchema,
12
14
  } from "../schemas/job";
13
15
 
14
16
  export type JobEntity = z.infer<typeof JobEntitySchema>;
@@ -17,6 +19,14 @@ export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
17
19
 
18
20
  export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
19
21
 
22
+ export type JobWithGigDetailsEntity = z.infer<
23
+ typeof JobWithGigDetailsEntitySchema
24
+ >;
25
+
26
+ export type JobWithRoleDetailsEntity = z.infer<
27
+ typeof JobWithRoleDetailsEntitySchema
28
+ >;
29
+
20
30
  export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
21
31
 
22
32
  export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;