@cofondateurauchomage/libs 1.1.128 → 1.1.130
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/build/api.validate.js +16 -10
- package/package.json +1 -1
package/build/api.validate.js
CHANGED
|
@@ -6,12 +6,18 @@ const zod_1 = require("zod");
|
|
|
6
6
|
const const_1 = require("./const");
|
|
7
7
|
const regex_1 = require("./regex");
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
|
+
const withNeverMind = (a) => [...a, 'never_mind'];
|
|
9
10
|
const zSkill = zod_1.z.enum(const_1.SKILLS);
|
|
10
11
|
const zProjectStatus = zod_1.z.enum(const_1.PROJECT_STATUS);
|
|
12
|
+
const zProjectStatusWithNeverMind = zod_1.z.enum(withNeverMind(const_1.PROJECT_STATUS));
|
|
11
13
|
const zAmbition = zod_1.z.enum(const_1.AMBITIONS);
|
|
14
|
+
const zAmbitionWithNeverMind = zod_1.z.enum(withNeverMind(const_1.AMBITIONS));
|
|
12
15
|
const zProductType = zod_1.z.enum(const_1.PRODUCT_TYPES);
|
|
16
|
+
const zProductTypeWithNeverMind = zod_1.z.enum(withNeverMind(const_1.PRODUCT_TYPES));
|
|
13
17
|
const zIndustry = zod_1.z.enum(const_1.INDUSTRIES);
|
|
18
|
+
const zIndustryWithNeverMind = zod_1.z.enum(withNeverMind(const_1.INDUSTRIES));
|
|
14
19
|
const zAvailability = zod_1.z.enum(const_1.AVAILABILITY);
|
|
20
|
+
const zAvailabilityWithNeverMind = zod_1.z.enum(withNeverMind(const_1.AVAILABILITY));
|
|
15
21
|
const zVisibility = zod_1.z.enum(const_1.VISIBILITIES);
|
|
16
22
|
const zName = zod_1.z.string().regex(regex_1.RGX.Name.regex);
|
|
17
23
|
const zStrMax50 = zod_1.z.string().max(50);
|
|
@@ -46,7 +52,7 @@ const projectBody = {
|
|
|
46
52
|
industries: zod_1.z.array(zIndustry).optional(),
|
|
47
53
|
skills: zSkillsRequired,
|
|
48
54
|
yearsOfExperience: zod_1.z.number().min(0).max(100).optional(),
|
|
49
|
-
availability:
|
|
55
|
+
availability: zAvailabilityWithNeverMind.optional(),
|
|
50
56
|
city: zName,
|
|
51
57
|
invest: zod_1.z.number().min(0).max(1_000_000).optional(),
|
|
52
58
|
partner: zStrMax1000.optional(),
|
|
@@ -64,10 +70,10 @@ const userBody = {
|
|
|
64
70
|
partner: zStrMax1000.optional(),
|
|
65
71
|
business: zStrMax1000.optional(),
|
|
66
72
|
bestStrength: zStrMax1000.optional(),
|
|
67
|
-
projectStatus: zod_1.z.array(
|
|
68
|
-
ambitions: zod_1.z.array(
|
|
69
|
-
productTypes: zod_1.z.array(
|
|
70
|
-
industries: zod_1.z.array(
|
|
73
|
+
projectStatus: zod_1.z.array(zProjectStatusWithNeverMind).optional(),
|
|
74
|
+
ambitions: zod_1.z.array(zAmbitionWithNeverMind).optional(),
|
|
75
|
+
productTypes: zod_1.z.array(zProductTypeWithNeverMind).optional(),
|
|
76
|
+
industries: zod_1.z.array(zIndustryWithNeverMind).optional(),
|
|
71
77
|
photo: zod_1.z.string().optional(),
|
|
72
78
|
};
|
|
73
79
|
function throwFromZodError(error) {
|
|
@@ -142,12 +148,12 @@ const schemasForAllRoutes = {
|
|
|
142
148
|
status: zProjectStatus.optional(),
|
|
143
149
|
status_detail: zStrMax1000.optional(),
|
|
144
150
|
turnover: zod_1.z.number().min(0).optional(),
|
|
145
|
-
ambitions: zod_1.z.array(
|
|
146
|
-
productTypes: zod_1.z.array(
|
|
147
|
-
industries: zod_1.z.array(
|
|
151
|
+
ambitions: zod_1.z.array(zAmbitionWithNeverMind).optional(),
|
|
152
|
+
productTypes: zod_1.z.array(zProductTypeWithNeverMind).optional(),
|
|
153
|
+
industries: zod_1.z.array(zIndustryWithNeverMind).optional(),
|
|
148
154
|
skills: zSkillsOptional,
|
|
149
155
|
yearsOfExperience: zod_1.z.number().min(0).max(100).optional(),
|
|
150
|
-
availability:
|
|
156
|
+
availability: zAvailabilityWithNeverMind.optional(),
|
|
151
157
|
city: zName.optional(),
|
|
152
158
|
invest: zod_1.z.number().min(0).max(1_000_000).optional(),
|
|
153
159
|
partner: zStrMax1000.optional(),
|
|
@@ -156,7 +162,7 @@ const schemasForAllRoutes = {
|
|
|
156
162
|
motivations: zStrMax1000.optional(),
|
|
157
163
|
business: zStrMax1000.optional(),
|
|
158
164
|
bestStrength: zStrMax1000.optional(),
|
|
159
|
-
projectStatus: zod_1.z.array(
|
|
165
|
+
projectStatus: zod_1.z.array(zProjectStatusWithNeverMind).optional(),
|
|
160
166
|
email: zod_1.z.string(),
|
|
161
167
|
tel: zTel.optional(),
|
|
162
168
|
linkedin: zLinkedin.optional(),
|