@zyacreatives/shared 2.5.23 → 2.5.24
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/project.d.ts +2 -2
- package/dist/schemas/project.js +37 -9
- package/package.json +1 -1
- package/src/schemas/project.ts +36 -10
|
@@ -184,7 +184,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
|
|
|
184
184
|
title: z.ZodOptional<z.ZodString>;
|
|
185
185
|
description: z.ZodOptional<z.ZodString>;
|
|
186
186
|
overview: z.ZodOptional<z.ZodString>;
|
|
187
|
-
url: z.ZodOptional<z.ZodUnion<[z.
|
|
187
|
+
url: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
|
|
188
188
|
imagePlaceholderUrl: z.ZodOptional<z.ZodURL>;
|
|
189
189
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
190
190
|
projectCreatorType: z.ZodOptional<z.ZodEnum<{
|
|
@@ -193,7 +193,7 @@ export declare const UpdateProjectInputSchema: z.ZodObject<{
|
|
|
193
193
|
readonly INVESTOR: "INVESTOR";
|
|
194
194
|
readonly ADMIN: "ADMIN";
|
|
195
195
|
}>>;
|
|
196
|
-
clientId: z.ZodOptional<z.
|
|
196
|
+
clientId: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>, z.ZodOptional<z.ZodString>>;
|
|
197
197
|
clientType: z.ZodOptional<z.ZodEnum<{
|
|
198
198
|
readonly CREATIVE: "CREATIVE";
|
|
199
199
|
readonly BRAND: "BRAND";
|
package/dist/schemas/project.js
CHANGED
|
@@ -72,23 +72,51 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
72
72
|
.object({
|
|
73
73
|
id: zod_openapi_1.z.cuid2(),
|
|
74
74
|
title: zod_openapi_1.z.string().optional(),
|
|
75
|
-
description: zod_openapi_1.z
|
|
75
|
+
description: zod_openapi_1.z
|
|
76
|
+
.string()
|
|
77
|
+
.min(10, "Add a bit more detail to your description.")
|
|
78
|
+
.optional(),
|
|
76
79
|
overview: zod_openapi_1.z.string().optional(),
|
|
77
|
-
url: zod_openapi_1.z
|
|
80
|
+
url: zod_openapi_1.z
|
|
81
|
+
.string()
|
|
82
|
+
.transform((val) => {
|
|
83
|
+
if (!val)
|
|
84
|
+
return val;
|
|
85
|
+
if (val.startsWith("http://") || val.startsWith("https://"))
|
|
86
|
+
return val;
|
|
87
|
+
return `https://${val}`;
|
|
88
|
+
})
|
|
89
|
+
.pipe(zod_openapi_1.z.string().url("Check your link.").or(zod_openapi_1.z.literal("")))
|
|
90
|
+
.optional(),
|
|
78
91
|
imagePlaceholderUrl: zod_openapi_1.z.url().optional(),
|
|
79
92
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
|
|
80
93
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).optional(),
|
|
81
|
-
clientId: zod_openapi_1.z
|
|
94
|
+
clientId: zod_openapi_1.z
|
|
95
|
+
.string()
|
|
96
|
+
.transform((val) => (val === "" ? undefined : val))
|
|
97
|
+
.pipe(zod_openapi_1.z.string().cuid2().optional()),
|
|
82
98
|
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
|
|
83
99
|
clientName: zod_openapi_1.z.string().optional(),
|
|
84
100
|
isFeatured: zod_openapi_1.z.boolean().optional(),
|
|
85
101
|
status: zod_openapi_1.z.enum(constants_1.PROJECT_STATUS).optional(),
|
|
86
|
-
problemBeingSolved: zod_openapi_1.z
|
|
87
|
-
|
|
102
|
+
problemBeingSolved: zod_openapi_1.z
|
|
103
|
+
.string()
|
|
104
|
+
.min(20, "Describe the problem you're solving.")
|
|
105
|
+
.max(600)
|
|
106
|
+
.optional(),
|
|
107
|
+
whoItsFor: zod_openapi_1.z
|
|
108
|
+
.string()
|
|
109
|
+
.min(5, "Tell us who this is for.")
|
|
110
|
+
.max(600)
|
|
111
|
+
.optional(),
|
|
88
112
|
ventureStage: zod_openapi_1.z.enum(constants_1.VENTURE_STAGES).optional(),
|
|
89
113
|
capitalLookingToRaise: zod_openapi_1.z.number().optional(),
|
|
90
114
|
capitalLookingToRaiseCurrency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY).optional(),
|
|
91
|
-
currentTraction: zod_openapi_1.z
|
|
115
|
+
currentTraction: zod_openapi_1.z
|
|
116
|
+
.string()
|
|
117
|
+
.min(10, "Share your current traction.")
|
|
118
|
+
.max(600)
|
|
119
|
+
.optional(),
|
|
92
120
|
isOpenToInvestment: zod_openapi_1.z.boolean().default(false),
|
|
93
121
|
startDate: zod_openapi_1.z.coerce.date().optional(),
|
|
94
122
|
endDate: zod_openapi_1.z.coerce.date().optional(),
|
|
@@ -101,14 +129,14 @@ exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
|
101
129
|
ctx.addIssue({
|
|
102
130
|
path: ["startDate"],
|
|
103
131
|
code: "custom",
|
|
104
|
-
message: "Start date cannot be in the future",
|
|
132
|
+
message: "Start date cannot be in the future.",
|
|
105
133
|
});
|
|
106
134
|
}
|
|
107
135
|
if (startDate && endDate && startDate > endDate) {
|
|
108
136
|
ctx.addIssue({
|
|
109
|
-
path: ["
|
|
137
|
+
path: ["endDate"],
|
|
110
138
|
code: "custom",
|
|
111
|
-
message: "
|
|
139
|
+
message: "End date must follow the start date.",
|
|
112
140
|
});
|
|
113
141
|
}
|
|
114
142
|
})
|
package/package.json
CHANGED
package/src/schemas/project.ts
CHANGED
|
@@ -92,23 +92,49 @@ export const UpdateProjectInputSchema = z
|
|
|
92
92
|
.object({
|
|
93
93
|
id: z.cuid2(),
|
|
94
94
|
title: z.string().optional(),
|
|
95
|
-
description: z
|
|
95
|
+
description: z
|
|
96
|
+
.string()
|
|
97
|
+
.min(10, "Add a bit more detail to your description.")
|
|
98
|
+
.optional(),
|
|
96
99
|
overview: z.string().optional(),
|
|
97
|
-
url: z
|
|
100
|
+
url: z
|
|
101
|
+
.string()
|
|
102
|
+
.transform((val) => {
|
|
103
|
+
if (!val) return val;
|
|
104
|
+
if (val.startsWith("http://") || val.startsWith("https://")) return val;
|
|
105
|
+
return `https://${val}`;
|
|
106
|
+
})
|
|
107
|
+
.pipe(z.string().url("Check your link.").or(z.literal("")))
|
|
108
|
+
.optional(),
|
|
98
109
|
imagePlaceholderUrl: z.url().optional(),
|
|
99
110
|
tags: z.array(z.string()).optional(),
|
|
100
111
|
projectCreatorType: z.enum(ROLES).optional(),
|
|
101
|
-
clientId: z
|
|
112
|
+
clientId: z
|
|
113
|
+
.string()
|
|
114
|
+
.transform((val) => (val === "" ? undefined : val))
|
|
115
|
+
.pipe(z.string().cuid2().optional()),
|
|
102
116
|
clientType: z.enum(CLIENT_TYPES).optional(),
|
|
103
117
|
clientName: z.string().optional(),
|
|
104
118
|
isFeatured: z.boolean().optional(),
|
|
105
119
|
status: z.enum(PROJECT_STATUS).optional(),
|
|
106
|
-
problemBeingSolved: z
|
|
107
|
-
|
|
120
|
+
problemBeingSolved: z
|
|
121
|
+
.string()
|
|
122
|
+
.min(20, "Describe the problem you're solving.")
|
|
123
|
+
.max(600)
|
|
124
|
+
.optional(),
|
|
125
|
+
whoItsFor: z
|
|
126
|
+
.string()
|
|
127
|
+
.min(5, "Tell us who this is for.")
|
|
128
|
+
.max(600)
|
|
129
|
+
.optional(),
|
|
108
130
|
ventureStage: z.enum(VENTURE_STAGES).optional(),
|
|
109
131
|
capitalLookingToRaise: z.number().optional(),
|
|
110
132
|
capitalLookingToRaiseCurrency: z.enum(WAGES_CURRENCY).optional(),
|
|
111
|
-
currentTraction: z
|
|
133
|
+
currentTraction: z
|
|
134
|
+
.string()
|
|
135
|
+
.min(10, "Share your current traction.")
|
|
136
|
+
.max(600)
|
|
137
|
+
.optional(),
|
|
112
138
|
isOpenToInvestment: z.boolean().default(false),
|
|
113
139
|
startDate: z.coerce.date().optional(),
|
|
114
140
|
endDate: z.coerce.date().optional(),
|
|
@@ -121,19 +147,19 @@ export const UpdateProjectInputSchema = z
|
|
|
121
147
|
ctx.addIssue({
|
|
122
148
|
path: ["startDate"],
|
|
123
149
|
code: "custom",
|
|
124
|
-
message: "Start date cannot be in the future",
|
|
150
|
+
message: "Start date cannot be in the future.",
|
|
125
151
|
});
|
|
126
152
|
}
|
|
127
153
|
if (startDate && endDate && startDate > endDate) {
|
|
128
154
|
ctx.addIssue({
|
|
129
|
-
path: ["
|
|
155
|
+
path: ["endDate"],
|
|
130
156
|
code: "custom",
|
|
131
|
-
message: "
|
|
157
|
+
message: "End date must follow the start date.",
|
|
132
158
|
});
|
|
133
159
|
}
|
|
134
160
|
})
|
|
135
161
|
.openapi("UpdateProjectInput");
|
|
136
|
-
|
|
162
|
+
|
|
137
163
|
export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;
|
|
138
164
|
|
|
139
165
|
export const CommentOnProjectInputSchema = CommentEntitySchema;
|