@zyacreatives/shared 2.5.77 → 2.5.79

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.
Files changed (49) hide show
  1. package/dist/schemas/chat.d.ts +6 -0
  2. package/dist/schemas/chat.js +6 -1
  3. package/dist/schemas/comment.d.ts +72 -0
  4. package/dist/schemas/comment.js +15 -1
  5. package/dist/schemas/common.d.ts +5 -0
  6. package/dist/schemas/common.js +4 -1
  7. package/dist/schemas/discipline.d.ts +6 -0
  8. package/dist/schemas/discipline.js +5 -1
  9. package/dist/schemas/feed.d.ts +106 -0
  10. package/dist/schemas/feed.js +6 -1
  11. package/dist/schemas/file.d.ts +16 -0
  12. package/dist/schemas/file.js +12 -1
  13. package/dist/schemas/investor-shortlist.d.ts +9 -0
  14. package/dist/schemas/investor-shortlist.js +6 -1
  15. package/dist/schemas/investor-signal.d.ts +9 -0
  16. package/dist/schemas/investor-signal.js +6 -1
  17. package/dist/schemas/job-application.d.ts +41 -0
  18. package/dist/schemas/job-application.js +10 -1
  19. package/dist/schemas/job.d.ts +1 -0
  20. package/dist/schemas/message.d.ts +22 -8
  21. package/dist/schemas/message.js +14 -2
  22. package/dist/schemas/payout-method.d.ts +9 -0
  23. package/dist/schemas/payout-method.js +8 -1
  24. package/dist/schemas/post.d.ts +11 -11
  25. package/dist/schemas/post.js +1 -1
  26. package/dist/schemas/product.d.ts +4 -0
  27. package/dist/schemas/product.js +4 -1
  28. package/dist/schemas/transaction.d.ts +72 -1
  29. package/dist/schemas/transaction.js +36 -1
  30. package/dist/schemas/user.d.ts +41 -3
  31. package/dist/schemas/user.js +15 -1
  32. package/docs/backend-openapi-shared-contracts-handoff.md +193 -0
  33. package/package.json +1 -1
  34. package/src/schemas/chat.ts +25 -17
  35. package/src/schemas/comment.ts +40 -8
  36. package/src/schemas/common.ts +18 -11
  37. package/src/schemas/discipline.ts +24 -10
  38. package/src/schemas/feed.ts +18 -7
  39. package/src/schemas/file.ts +37 -13
  40. package/src/schemas/investor-shortlist.ts +30 -15
  41. package/src/schemas/investor-signal.ts +36 -21
  42. package/src/schemas/job-application.ts +34 -15
  43. package/src/schemas/job.ts +11 -9
  44. package/src/schemas/message.ts +30 -7
  45. package/src/schemas/payout-method.ts +18 -5
  46. package/src/schemas/post.ts +1 -1
  47. package/src/schemas/product.ts +15 -9
  48. package/src/schemas/transaction.ts +61 -8
  49. package/src/schemas/user.ts +44 -16
@@ -249,14 +249,16 @@ export const GetJobsOutputSchema = z.object({
249
249
 
250
250
  export type GetJobsOutput = z.infer<typeof GetJobsOutputSchema>;
251
251
 
252
- export const GetCreatedJobsOutputSchema = z.object({
253
- jobs: z.array(NormalizedJobSchema),
254
- noOfJobs: z.number(),
255
- noOfArchivedJobs: z.number(),
256
- noOfActiveJobs: z.number(),
257
- });
258
-
259
- export type GetCreatedJobsOutput = z.infer<typeof GetCreatedJobsOutputSchema>;
252
+ export const GetCreatedJobsOutputSchema = z.object({
253
+ jobs: z.array(NormalizedJobSchema),
254
+ noOfJobs: z.number(),
255
+ noOfArchivedJobs: z.number(),
256
+ noOfActiveJobs: z.number(),
257
+ });
258
+
259
+ export type GetCreatedJobsOutput = z.infer<typeof GetCreatedJobsOutputSchema>;
260
+
261
+ export type NormalizedJob = z.infer<typeof NormalizedJobSchema>;
260
262
 
261
263
  /**
262
264
  * --------------------------------
@@ -289,4 +291,4 @@ export const JobSearchDocumentSchema = z
289
291
  })
290
292
  .openapi("JobSearchDocument");
291
293
 
292
- export type JobSearchDocument = z.infer<typeof JobSearchDocumentSchema>;
294
+ export type JobSearchDocument = z.infer<typeof JobSearchDocumentSchema>;
@@ -23,7 +23,7 @@ const MessageShape = z.object({
23
23
  url: z.url(),
24
24
  title: z.string().optional(),
25
25
  description: z.string().optional(),
26
- image: z.url().optional(),
26
+ image: z.string().optional(),
27
27
  })
28
28
  .optional(),
29
29
  });
@@ -99,12 +99,35 @@ export const CreateMessageInputSchema = MessageShape.extend({
99
99
 
100
100
  export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
101
101
 
102
- export const EditMessageInputSchema = z.object({
103
- messageId: z.cuid2(),
104
- content: z.string().optional(),
105
- });
106
-
107
- export type EditMessageInput = z.infer<typeof EditMessageInputSchema>;
102
+ export const EditMessageInputSchema = z.object({
103
+ messageId: z.cuid2(),
104
+ content: z.string().optional(),
105
+ });
106
+
107
+ export type EditMessageInput = z.infer<typeof EditMessageInputSchema>;
108
+
109
+ export const ChatIdParamSchema = z.object({
110
+ chatId: z.cuid2().openapi({ param: { name: "chatId", in: "path" } }),
111
+ });
112
+
113
+ export type ChatIdParam = z.infer<typeof ChatIdParamSchema>;
114
+
115
+ export const MessageParamsSchema = ChatIdParamSchema.extend({
116
+ messageId: z
117
+ .cuid2()
118
+ .openapi({ param: { name: "messageId", in: "path" } }),
119
+ });
120
+
121
+ export type MessageParams = z.infer<typeof MessageParamsSchema>;
122
+
123
+ export const DeleteMessagesInputSchema = z.object({
124
+ messageIds: z.array(z.cuid2()).min(1),
125
+ deleteForEveryone: z.boolean().default(false),
126
+ });
127
+
128
+ export type DeleteMessagesInput = z.infer<
129
+ typeof DeleteMessagesInputSchema
130
+ >;
108
131
 
109
132
  /**
110
133
  * --------------------------------
@@ -53,11 +53,24 @@ export type CreatePayoutMethodInput = z.infer<
53
53
  typeof CreatePayoutMethodInputSchema
54
54
  >;
55
55
 
56
- export const UpdatePayoutMethodInputSchema = PayoutMethodShape.partial();
57
-
58
- export type UpdatePayoutMethodInput = z.infer<
59
- typeof UpdatePayoutMethodInputSchema
60
- >;
56
+ export const UpdatePayoutMethodInputSchema = PayoutMethodShape.partial();
57
+
58
+ export type UpdatePayoutMethodInput = z.infer<
59
+ typeof UpdatePayoutMethodInputSchema
60
+ >;
61
+
62
+ export const GetBanksInputSchema = z.object({
63
+ country: z.string().optional(),
64
+ });
65
+
66
+ export type GetBanksInput = z.infer<typeof GetBanksInputSchema>;
67
+
68
+ export const VerifyAccountInputSchema = z.object({
69
+ accountNumber: z.string().regex(/^\d{10}$/),
70
+ bankCode: z.string().min(1),
71
+ });
72
+
73
+ export type VerifyAccountInput = z.infer<typeof VerifyAccountInputSchema>;
61
74
 
62
75
  /**
63
76
  * --------------------------------
@@ -20,7 +20,7 @@ export const LinkMetaSchema = z.object({
20
20
  url: z.url(),
21
21
  title: z.string().optional(),
22
22
  description: z.string().optional(),
23
- image: z.url().optional(),
23
+ image: z.string().optional(),
24
24
  });
25
25
 
26
26
  export type LinkMeta = z.infer<typeof LinkMetaSchema>;
@@ -256,14 +256,20 @@ export const SearchProductInputSchema = z.object({
256
256
 
257
257
  export type SearchProductInput = z.infer<typeof SearchProductInputSchema>;
258
258
 
259
- export const ProductDiscountCheckInputSchema = z.object({
260
- discountCode: z.string(),
261
- productId: z.cuid2(),
262
- });
263
-
264
- export type ProductDiscountCheckInput = z.infer<
265
- typeof ProductDiscountCheckInputSchema
266
- >;
259
+ export const ProductDiscountCheckInputSchema = z.object({
260
+ discountCode: z.string(),
261
+ productId: z.cuid2(),
262
+ });
263
+
264
+ export type ProductDiscountCheckInput = z.infer<
265
+ typeof ProductDiscountCheckInputSchema
266
+ >;
267
+
268
+ export const ProductIdInputSchema = z.object({
269
+ productId: z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
270
+ });
271
+
272
+ export type ProductIdInput = z.infer<typeof ProductIdInputSchema>;
267
273
 
268
274
  export const RevenueChartInputSchema = z.object({
269
275
  startDate: z.string().optional(),
@@ -445,4 +451,4 @@ export const ProductPurchaseSnapshotSchema = z.object({
445
451
 
446
452
  export type ProductPurchaseSnapshot = z.infer<
447
453
  typeof ProductPurchaseSnapshotSchema
448
- >;
454
+ >;
@@ -120,15 +120,68 @@ export type TransactionEntity = z.infer<typeof TransactionEntitySchema>;
120
120
  * --------------------------------
121
121
  */
122
122
 
123
- export const InitTransactionOutputSchema = z
124
- .object({
125
- transaction: TransactionEntitySchema,
126
- checkoutUrl: z.url().nullable().openapi({
127
- description: "The Stripe/Paystack checkout URL to redirect the user to",
123
+ export const InitTransactionOutputSchema = z
124
+ .object({
125
+ transaction: TransactionEntitySchema,
126
+ checkoutUrl: z.url().nullable().openapi({
127
+ description: "The Stripe/Paystack checkout URL to redirect the user to",
128
128
  }),
129
129
  })
130
130
  .openapi({ title: "InitTransactionResult" });
131
131
 
132
- export type InitTransactionResult = z.infer<
133
- typeof InitTransactionOutputSchema
134
- >;
132
+ export type InitTransactionResult = z.infer<
133
+ typeof InitTransactionOutputSchema
134
+ >;
135
+
136
+ export const TransactionIdInputSchema = z.object({
137
+ transactionId: z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
138
+ });
139
+
140
+ export type TransactionIdInput = z.infer<typeof TransactionIdInputSchema>;
141
+
142
+ export const PurchaseLibraryInputSchema = z.object({
143
+ page: z.coerce.number().int().min(1).default(1),
144
+ pageSize: z.coerce.number().int().min(1).max(100).default(20),
145
+ });
146
+
147
+ export type PurchaseLibraryInput = z.infer<
148
+ typeof PurchaseLibraryInputSchema
149
+ >;
150
+
151
+ export const PurchaseLibraryItemSchema = z.object({
152
+ transactionId: z.cuid2(),
153
+ productId: z.cuid2(),
154
+ itemName: z.string(),
155
+ creator: z.object({
156
+ id: z.cuid2(),
157
+ name: z.string(),
158
+ username: z.string(),
159
+ image: z.url().nullable(),
160
+ }),
161
+ fileCategory: z.string().nullable(),
162
+ purchaseDate: z.iso.datetime(),
163
+ status: z.enum(["PURCHASED", "REFUNDED"]),
164
+ currency: z.enum(WAGES_CURRENCY),
165
+ amount: z.number().int(),
166
+ thumbnailImgUrl: z.url().nullable(),
167
+ });
168
+
169
+ export type PurchaseLibraryItem = z.infer<
170
+ typeof PurchaseLibraryItemSchema
171
+ >;
172
+
173
+ export const PurchaseLibraryOutputSchema = z.object({
174
+ purchases: z.array(PurchaseLibraryItemSchema),
175
+ pagination: z.object({
176
+ page: z.number().int(),
177
+ pageSize: z.number().int(),
178
+ totalItems: z.number().int(),
179
+ totalPages: z.number().int(),
180
+ hasPreviousPage: z.boolean(),
181
+ hasNextPage: z.boolean(),
182
+ }),
183
+ });
184
+
185
+ export type PurchaseLibraryOutput = z.infer<
186
+ typeof PurchaseLibraryOutputSchema
187
+ >;
@@ -199,21 +199,31 @@ export type UserWithProductsEntity = z.infer<
199
199
  typeof UserWithProductsEntitySchema
200
200
  >;
201
201
 
202
- export const UserAuthStatusEntitySchema = z.object({
203
- exists: z.boolean(),
204
- isOAuthOnly: z.boolean(),
205
- providers: z.array(z.string()),
206
- });
207
-
208
- export const UserWithJobBookmarksInputSchema = z.object({
209
- cursor: z.string().optional(),
210
- limit: z.coerce.number().int().positive().optional(),
211
- });
212
-
213
- export type UserAuthStatusEntity = z.infer<typeof UserAuthStatusEntitySchema>;
214
- export type UserWithJobBookmarksInput = z.infer<
215
- typeof UserWithJobBookmarksEntitySchema
216
- >;
202
+ export const UserAuthStatusEntitySchema = z.object({
203
+ exists: z.boolean(),
204
+ isOAuthOnly: z.boolean(),
205
+ hasPassword: z.boolean(),
206
+ canChangePassword: z.boolean(),
207
+ canSetPassword: z.boolean(),
208
+ providers: z.array(z.string()),
209
+ });
210
+
211
+ export const DeactivateAccountInputSchema = z.object({
212
+ password: z.string().min(1).optional(),
213
+ });
214
+
215
+ export const UserWithJobBookmarksInputSchema = z.object({
216
+ cursor: z.string().optional(),
217
+ limit: z.coerce.number().int().positive().optional(),
218
+ });
219
+
220
+ export type UserAuthStatusEntity = z.infer<typeof UserAuthStatusEntitySchema>;
221
+ export type DeactivateAccountInput = z.infer<
222
+ typeof DeactivateAccountInputSchema
223
+ >;
224
+ export type UserWithJobBookmarksInput = z.infer<
225
+ typeof UserWithJobBookmarksInputSchema
226
+ >;
217
227
 
218
228
  /**
219
229
  * --------------------------------
@@ -283,7 +293,25 @@ export const SearchUsersOutputSchema = z.object({
283
293
  ),
284
294
  nextCursor: z.string().optional(),
285
295
  });
286
- export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
296
+ export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
297
+
298
+ export const MentionableUsersInputSchema = z.object({
299
+ query: z.string().default(""),
300
+ roles: SearchUsersInputSchema.shape.roles,
301
+ limit: z.coerce.number().int().min(1).max(10).default(10),
302
+ });
303
+
304
+ export type MentionableUsersInput = z.infer<
305
+ typeof MentionableUsersInputSchema
306
+ >;
307
+
308
+ export const MentionableUsersOutputSchema = SearchUsersOutputSchema.pick({
309
+ users: true,
310
+ });
311
+
312
+ export type MentionableUsersOutput = z.infer<
313
+ typeof MentionableUsersOutputSchema
314
+ >;
287
315
 
288
316
  /**
289
317
  * --------------------------------