@zyacreatives/shared 2.5.52 → 2.5.55
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/schemas/activity.d.ts +1 -0
- package/dist/schemas/auth.d.ts +2 -0
- package/dist/schemas/bookmark.d.ts +62 -7
- package/dist/schemas/bookmark.js +32 -30
- package/dist/schemas/brand.d.ts +3 -3
- package/dist/schemas/chat.d.ts +96 -52
- package/dist/schemas/chat.js +44 -18
- package/dist/schemas/comment.d.ts +65 -21
- package/dist/schemas/comment.js +48 -54
- package/dist/schemas/common.d.ts +15 -11
- package/dist/schemas/creative.d.ts +21 -21
- package/dist/schemas/creative.js +3 -3
- package/dist/schemas/discipline.d.ts +63 -12
- package/dist/schemas/discipline.js +62 -65
- package/dist/schemas/entity-stats.d.ts +35 -3
- package/dist/schemas/entity-stats.js +24 -38
- package/dist/schemas/feed.d.ts +50 -3
- package/dist/schemas/feed.js +43 -13
- package/dist/schemas/file.d.ts +65 -24
- package/dist/schemas/file.js +60 -49
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/investor-shortlist.d.ts +68 -11
- package/dist/schemas/investor-shortlist.js +46 -24
- package/dist/schemas/investor-signal.d.ts +52 -12
- package/dist/schemas/investor-signal.js +59 -39
- package/dist/schemas/investor.d.ts +3 -3
- package/dist/schemas/job-application.d.ts +291 -279
- package/dist/schemas/job-application.js +59 -95
- package/dist/schemas/job.d.ts +200 -659
- package/dist/schemas/job.js +98 -231
- package/dist/schemas/like.d.ts +3 -0
- package/dist/schemas/message.d.ts +125 -94
- package/dist/schemas/message.js +54 -55
- package/dist/schemas/notification.d.ts +99 -32
- package/dist/schemas/notification.js +46 -42
- package/dist/schemas/payout-method.d.ts +51 -31
- package/dist/schemas/payout-method.js +48 -58
- package/dist/schemas/post.d.ts +295 -204
- package/dist/schemas/post.js +148 -272
- package/dist/schemas/product.d.ts +308 -229
- package/dist/schemas/product.js +111 -94
- package/dist/schemas/project.d.ts +75 -107
- package/dist/schemas/project.js +1 -5
- package/dist/schemas/seller.d.ts +10 -10
- package/dist/schemas/user-strike.d.ts +3 -0
- package/dist/schemas/user.d.ts +128 -126
- package/dist/schemas/user.js +10 -1
- package/dist/schemas/username.d.ts +1 -0
- package/dist/schemas/view.d.ts +1 -0
- package/dist/types/activity.d.ts +1 -3
- package/dist/types/auth.d.ts +1 -4
- package/dist/types/bookmark.d.ts +1 -3
- package/dist/types/chat.d.ts +1 -11
- package/dist/types/comment.d.ts +1 -5
- package/dist/types/common.d.ts +2 -8
- package/dist/types/discipline.d.ts +1 -11
- package/dist/types/entity-stats.d.ts +1 -3
- package/dist/types/feed.d.ts +1 -5
- package/dist/types/investor-shortlist.d.ts +1 -6
- package/dist/types/investor-signal.d.ts +1 -7
- package/dist/types/like.d.ts +1 -3
- package/dist/types/message.d.ts +1 -9
- package/dist/types/notification.d.ts +1 -9
- package/dist/types/user-strike.d.ts +1 -5
- package/dist/types/username.d.ts +1 -3
- package/package.json +1 -1
- package/src/index.ts +4 -5
- package/src/schemas/activity.ts +5 -4
- package/src/schemas/auth.ts +14 -10
- package/src/schemas/bookmark.ts +48 -29
- package/src/schemas/chat.ts +79 -18
- package/src/schemas/comment.ts +63 -49
- package/src/schemas/common.ts +8 -3
- package/src/schemas/creative.ts +3 -3
- package/src/schemas/discipline.ts +103 -71
- package/src/schemas/entity-stats.ts +32 -38
- package/src/schemas/feed.ts +62 -15
- package/src/schemas/file.ts +85 -58
- package/src/schemas/index.ts +1 -0
- package/src/schemas/investor-shortlist.ts +57 -8
- package/src/schemas/investor-signal.ts +79 -27
- package/src/schemas/job-application.ts +81 -115
- package/src/schemas/job.ts +160 -301
- package/src/schemas/like.ts +5 -1
- package/src/schemas/message.ts +71 -64
- package/src/schemas/notification.ts +63 -51
- package/src/schemas/payout-method.ts +47 -63
- package/src/schemas/post.ts +211 -272
- package/src/schemas/product.ts +202 -139
- package/src/schemas/project.ts +7 -10
- package/src/schemas/user-strike.ts +7 -1
- package/src/schemas/user.ts +17 -5
- package/src/schemas/username.ts +5 -3
- package/src/schemas/view.ts +0 -50
- package/src/types/activity.ts +0 -4
- package/src/types/auth.ts +0 -5
- package/src/types/bookmark.ts +0 -4
- package/src/types/chat.ts +0 -31
- package/src/types/comment.ts +0 -12
- package/src/types/common.ts +0 -14
- package/src/types/discipline.ts +0 -32
- package/src/types/entity-stats.ts +0 -4
- package/src/types/feed.ts +0 -10
- package/src/types/index.ts +0 -16
- package/src/types/investor-shortlist.ts +0 -18
- package/src/types/investor-signal.ts +0 -26
- package/src/types/like.ts +0 -4
- package/src/types/message.ts +0 -26
- package/src/types/notification.ts +0 -34
- package/src/types/user-strike.ts +0 -10
- package/src/types/username.ts +0 -4
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
4
|
APPLICATION_STATUS,
|
|
4
5
|
ApplicationStatus,
|
|
@@ -10,9 +11,16 @@ import {
|
|
|
10
11
|
JobAvailabilityTypes,
|
|
11
12
|
JobType,
|
|
12
13
|
} from "../constants";
|
|
14
|
+
|
|
13
15
|
import { MinimalUserSchema } from "./user";
|
|
14
16
|
import { NormalizedJobSchema } from "./job";
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* --------------------------------
|
|
20
|
+
* ENUMS
|
|
21
|
+
* --------------------------------
|
|
22
|
+
*/
|
|
23
|
+
|
|
16
24
|
const ApplicationStatusSchema = z.enum(
|
|
17
25
|
Object.values(APPLICATION_STATUS) as [
|
|
18
26
|
ApplicationStatus,
|
|
@@ -31,33 +39,26 @@ const JobAvailabilitySchema = z.enum(
|
|
|
31
39
|
],
|
|
32
40
|
);
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
createdAt: z.coerce.date(),
|
|
40
|
-
applicationStatus: ApplicationStatusSchema,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export type MinimalJobApplicationEntity = z.infer<
|
|
44
|
-
typeof MinimalJobApplicationEntitySchema
|
|
45
|
-
>;
|
|
42
|
+
/**
|
|
43
|
+
* --------------------------------
|
|
44
|
+
* SHAPE
|
|
45
|
+
* --------------------------------
|
|
46
|
+
*/
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
createdAt: z.coerce.date(),
|
|
50
|
-
updatedAt: z.coerce.date(),
|
|
51
|
-
availability: z.enum(JOB_AVAILABILITY_TYPES).optional(),
|
|
52
|
-
experienceLevel: z.enum(EXPERIENCE_LEVELS).optional(),
|
|
53
|
-
jobId: z.string(),
|
|
54
|
-
applicantId: z.string(),
|
|
48
|
+
const JobApplicationShape = z.object({
|
|
49
|
+
jobId: z.cuid2(),
|
|
55
50
|
firstName: z.string().optional(),
|
|
56
51
|
lastName: z.string().optional(),
|
|
57
|
-
emailAddress: z.
|
|
52
|
+
emailAddress: z.email().optional(),
|
|
58
53
|
phoneNumber: z.string().nullable(),
|
|
59
54
|
currentRole: z.string(),
|
|
60
55
|
resumeUrl: z.url(),
|
|
56
|
+
experienceLevel: ExperienceLevelSchema.optional(),
|
|
57
|
+
availability: JobAvailabilitySchema.optional(),
|
|
58
|
+
coverLetter: z.string().nullable(),
|
|
59
|
+
receiveEmailUpdates: z.boolean(),
|
|
60
|
+
wagesAmount: z.number().nullable(),
|
|
61
|
+
|
|
61
62
|
workSampleUrls: z
|
|
62
63
|
.array(
|
|
63
64
|
z.object({
|
|
@@ -67,17 +68,18 @@ export const BaseJobApplicationEntitySchema = z.object({
|
|
|
67
68
|
}),
|
|
68
69
|
)
|
|
69
70
|
.optional(),
|
|
71
|
+
|
|
70
72
|
zyaProjects: z
|
|
71
73
|
.array(
|
|
72
74
|
z.object({
|
|
73
75
|
projectName: z.string(),
|
|
74
76
|
projectImgUrl: z.url().optional(),
|
|
75
|
-
projectId: z.
|
|
77
|
+
projectId: z.cuid2(),
|
|
76
78
|
tags: z.array(z.string()).optional(),
|
|
77
79
|
}),
|
|
78
80
|
)
|
|
79
81
|
.optional(),
|
|
80
|
-
|
|
82
|
+
|
|
81
83
|
linkUrls: z
|
|
82
84
|
.array(
|
|
83
85
|
z.object({
|
|
@@ -86,112 +88,56 @@ export const BaseJobApplicationEntitySchema = z.object({
|
|
|
86
88
|
}),
|
|
87
89
|
)
|
|
88
90
|
.optional(),
|
|
89
|
-
coverLetter: z.string().nullable(),
|
|
90
|
-
receiveEmailUpdates: z.boolean(),
|
|
91
|
-
wagesAmount: z.number().nullable(),
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
export type
|
|
95
|
-
typeof BaseJobApplicationEntitySchema
|
|
96
|
-
>;
|
|
93
|
+
export type JobApplicationShapeType = z.infer<typeof JobApplicationShape>;
|
|
97
94
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
zyaProjects: z
|
|
119
|
-
.array(
|
|
120
|
-
z.object({
|
|
121
|
-
projectName: z.string(),
|
|
122
|
-
projectImgUrl: z.url(),
|
|
123
|
-
projectId: z.cuid2(),
|
|
124
|
-
tags: z.array(z.string()).optional(),
|
|
125
|
-
}),
|
|
126
|
-
)
|
|
127
|
-
.optional(),
|
|
128
|
-
applicationStatus: ApplicationStatusSchema.default("Application Sent"),
|
|
129
|
-
applicantId: z.cuid2(),
|
|
130
|
-
linkUrls: z
|
|
131
|
-
.array(
|
|
132
|
-
z.object({ url: z.url(), isPortfolioUrl: z.boolean().default(false) }),
|
|
133
|
-
)
|
|
134
|
-
.optional(),
|
|
135
|
-
coverLetter: z.string().optional(),
|
|
136
|
-
receiveEmailUpdates: z.boolean().optional(),
|
|
137
|
-
wagesAmount: z.coerce.number().optional(),
|
|
138
|
-
availability: JobAvailabilitySchema.optional(),
|
|
139
|
-
createdAt: z.coerce
|
|
140
|
-
.date()
|
|
141
|
-
.optional()
|
|
142
|
-
.openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
143
|
-
updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
|
|
144
|
-
});
|
|
95
|
+
/**
|
|
96
|
+
* --------------------------------
|
|
97
|
+
* BASE ENTITY
|
|
98
|
+
* --------------------------------
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
export const JobApplicationEntitySchema = z
|
|
102
|
+
.object({
|
|
103
|
+
id: z.cuid2(),
|
|
104
|
+
applicantId: z.cuid2(),
|
|
105
|
+
user: MinimalUserSchema,
|
|
106
|
+
|
|
107
|
+
...JobApplicationShape.shape,
|
|
108
|
+
|
|
109
|
+
applicationStatus: ApplicationStatusSchema,
|
|
110
|
+
|
|
111
|
+
createdAt: z.iso.datetime(),
|
|
112
|
+
updatedAt: z.iso.datetime(),
|
|
113
|
+
})
|
|
114
|
+
.openapi("JobApplication");
|
|
145
115
|
|
|
146
116
|
export type JobApplicationEntity = z.infer<typeof JobApplicationEntitySchema>;
|
|
147
117
|
|
|
148
|
-
|
|
118
|
+
/**
|
|
119
|
+
* --------------------------------
|
|
120
|
+
* DERIVED ENTITIES
|
|
121
|
+
* --------------------------------
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
export const MinimalJobApplicationEntitySchema = z.object({
|
|
125
|
+
id: z.cuid2(),
|
|
149
126
|
jobId: z.cuid2(),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
emailAddress: z.email().optional(),
|
|
155
|
-
phoneNumber: z.string().optional(),
|
|
156
|
-
currentRole: z.string().optional(),
|
|
157
|
-
experienceLevel: ExperienceLevelSchema.optional(),
|
|
158
|
-
resumeUrl: z.url().optional(),
|
|
159
|
-
coverLetter: z.string().optional(),
|
|
160
|
-
availability: z.enum(JOB_AVAILABILITY_TYPES).optional(),
|
|
161
|
-
wagesAmount: z.coerce.number().optional(),
|
|
162
|
-
receiveEmailUpdates: z.boolean().optional(),
|
|
163
|
-
workSampleUrls: z
|
|
164
|
-
.array(
|
|
165
|
-
z.object({
|
|
166
|
-
url: z.url(),
|
|
167
|
-
name: z.string().optional(),
|
|
168
|
-
mimeType: z.string().optional(),
|
|
169
|
-
}),
|
|
170
|
-
)
|
|
171
|
-
.optional(),
|
|
172
|
-
linkUrls: z
|
|
173
|
-
.array(z.object({ url: z.url(), isPortfolioUrl: z.boolean() }))
|
|
174
|
-
.optional(),
|
|
175
|
-
zyaProjects: z
|
|
176
|
-
.array(
|
|
177
|
-
z.object({
|
|
178
|
-
projectName: z.string(),
|
|
179
|
-
projectId: z.cuid2(),
|
|
180
|
-
projectImgUrl: z.url(),
|
|
181
|
-
tags: z.array(z.string()).optional(),
|
|
182
|
-
}),
|
|
183
|
-
)
|
|
184
|
-
.optional(),
|
|
127
|
+
user: MinimalUserSchema,
|
|
128
|
+
coverLetter: z.string(),
|
|
129
|
+
applicationStatus: ApplicationStatusSchema,
|
|
130
|
+
createdAt: z.iso.datetime(),
|
|
185
131
|
});
|
|
186
132
|
|
|
187
|
-
export type
|
|
188
|
-
typeof
|
|
133
|
+
export type MinimalJobApplicationEntity = z.infer<
|
|
134
|
+
typeof MinimalJobApplicationEntitySchema
|
|
189
135
|
>;
|
|
190
136
|
|
|
191
137
|
export const TrackedJobApplicationEntitySchema = z.object({
|
|
192
138
|
id: z.cuid2(),
|
|
193
|
-
createdAt: z.coerce.date(),
|
|
194
139
|
applicationStatus: ApplicationStatusSchema,
|
|
140
|
+
createdAt: z.iso.datetime(),
|
|
195
141
|
job: NormalizedJobSchema,
|
|
196
142
|
});
|
|
197
143
|
|
|
@@ -199,6 +145,20 @@ export type TrackedJobApplicationEntity = z.infer<
|
|
|
199
145
|
typeof TrackedJobApplicationEntitySchema
|
|
200
146
|
>;
|
|
201
147
|
|
|
148
|
+
/**
|
|
149
|
+
* --------------------------------
|
|
150
|
+
* INPUTS
|
|
151
|
+
* --------------------------------
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
export const CreateJobApplicationInputSchema = JobApplicationShape.extend({
|
|
155
|
+
jobSections: z.array(z.enum(JOB_SECTIONS)).optional(),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export type CreateJobApplicationInput = z.infer<
|
|
159
|
+
typeof CreateJobApplicationInputSchema
|
|
160
|
+
>;
|
|
161
|
+
|
|
202
162
|
export const UpdateJobApplicationInputSchema =
|
|
203
163
|
CreateJobApplicationInputSchema.partial().extend({
|
|
204
164
|
id: z.cuid2(),
|
|
@@ -223,6 +183,12 @@ export type GetTrackedJobApplicationsInput = z.infer<
|
|
|
223
183
|
typeof GetTrackedJobApplicationsInputSchema
|
|
224
184
|
>;
|
|
225
185
|
|
|
186
|
+
/**
|
|
187
|
+
* --------------------------------
|
|
188
|
+
* OUTPUTS
|
|
189
|
+
* --------------------------------
|
|
190
|
+
*/
|
|
191
|
+
|
|
226
192
|
export const GetTrackedJobApplicationsOutputSchema = z.object({
|
|
227
193
|
applications: z.array(TrackedJobApplicationEntitySchema),
|
|
228
194
|
total: z.number(),
|