@zyacreatives/shared 2.5.78 → 2.5.80
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/chat.d.ts +6 -0
- package/dist/schemas/chat.js +6 -1
- package/dist/schemas/comment.d.ts +72 -0
- package/dist/schemas/comment.js +15 -1
- package/dist/schemas/common.d.ts +5 -0
- package/dist/schemas/common.js +4 -1
- package/dist/schemas/discipline.d.ts +6 -0
- package/dist/schemas/discipline.js +5 -1
- package/dist/schemas/feed.d.ts +106 -0
- package/dist/schemas/feed.js +6 -1
- package/dist/schemas/file.d.ts +16 -0
- package/dist/schemas/file.js +12 -1
- package/dist/schemas/investor-shortlist.d.ts +9 -0
- package/dist/schemas/investor-shortlist.js +6 -1
- package/dist/schemas/investor-signal.d.ts +9 -0
- package/dist/schemas/investor-signal.js +6 -1
- package/dist/schemas/job-application.d.ts +41 -0
- package/dist/schemas/job-application.js +10 -1
- package/dist/schemas/job.d.ts +1 -0
- package/dist/schemas/message.d.ts +14 -0
- package/dist/schemas/message.js +13 -1
- package/dist/schemas/notification.d.ts +22 -0
- package/dist/schemas/notification.js +9 -0
- package/dist/schemas/payout-method.d.ts +9 -0
- package/dist/schemas/payout-method.js +8 -1
- package/dist/schemas/product.d.ts +4 -5
- package/dist/schemas/product.js +4 -6
- package/dist/schemas/transaction.d.ts +72 -1
- package/dist/schemas/transaction.js +36 -1
- package/dist/schemas/user.d.ts +39 -1
- package/dist/schemas/user.js +15 -1
- package/docs/backend-openapi-shared-contracts-handoff.md +193 -0
- package/package.json +1 -1
- package/src/schemas/chat.ts +25 -17
- package/src/schemas/comment.ts +40 -8
- package/src/schemas/common.ts +18 -11
- package/src/schemas/discipline.ts +24 -10
- package/src/schemas/feed.ts +18 -7
- package/src/schemas/file.ts +37 -13
- package/src/schemas/investor-shortlist.ts +30 -15
- package/src/schemas/investor-signal.ts +36 -21
- package/src/schemas/job-application.ts +34 -15
- package/src/schemas/job.ts +11 -9
- package/src/schemas/message.ts +29 -6
- package/src/schemas/notification.ts +13 -4
- package/src/schemas/payout-method.ts +18 -5
- package/src/schemas/product.ts +8 -6
- package/src/schemas/transaction.ts +61 -8
- package/src/schemas/user.ts +44 -16
package/src/schemas/product.ts
CHANGED
|
@@ -9,11 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import { CreateFileInputSchema, FileEntitySchema } from "./file";
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
* --------------------------------
|
|
14
|
-
* SHARED
|
|
15
|
-
* --------------------------------
|
|
16
|
-
*/
|
|
12
|
+
|
|
17
13
|
|
|
18
14
|
export const ProductDiscountEntitySchema = z.object({
|
|
19
15
|
discountType: z.enum(DISCOUNT_TYPES),
|
|
@@ -265,6 +261,12 @@ export type ProductDiscountCheckInput = z.infer<
|
|
|
265
261
|
typeof ProductDiscountCheckInputSchema
|
|
266
262
|
>;
|
|
267
263
|
|
|
264
|
+
export const ProductIdInputSchema = z.object({
|
|
265
|
+
productId: z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
export type ProductIdInput = z.infer<typeof ProductIdInputSchema>;
|
|
269
|
+
|
|
268
270
|
export const RevenueChartInputSchema = z.object({
|
|
269
271
|
startDate: z.string().optional(),
|
|
270
272
|
endDate: z.string().optional(),
|
|
@@ -445,4 +447,4 @@ export const ProductPurchaseSnapshotSchema = z.object({
|
|
|
445
447
|
|
|
446
448
|
export type ProductPurchaseSnapshot = z.infer<
|
|
447
449
|
typeof ProductPurchaseSnapshotSchema
|
|
448
|
-
>;
|
|
450
|
+
>;
|
|
@@ -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
|
+
>;
|
package/src/schemas/user.ts
CHANGED
|
@@ -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
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
* --------------------------------
|