@zyacreatives/shared 2.5.78 → 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.
- 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/payout-method.d.ts +9 -0
- package/dist/schemas/payout-method.js +8 -1
- package/dist/schemas/product.d.ts +4 -0
- package/dist/schemas/product.js +4 -1
- 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/payout-method.ts +18 -5
- package/src/schemas/product.ts +15 -9
- package/src/schemas/transaction.ts +61 -8
- package/src/schemas/user.ts +44 -16
|
@@ -75,6 +75,15 @@ export declare const UpdatePayoutMethodInputSchema: z.ZodObject<{
|
|
|
75
75
|
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
76
76
|
}, z.core.$strip>;
|
|
77
77
|
export type UpdatePayoutMethodInput = z.infer<typeof UpdatePayoutMethodInputSchema>;
|
|
78
|
+
export declare const GetBanksInputSchema: z.ZodObject<{
|
|
79
|
+
country: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type GetBanksInput = z.infer<typeof GetBanksInputSchema>;
|
|
82
|
+
export declare const VerifyAccountInputSchema: z.ZodObject<{
|
|
83
|
+
accountNumber: z.ZodString;
|
|
84
|
+
bankCode: z.ZodString;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type VerifyAccountInput = z.infer<typeof VerifyAccountInputSchema>;
|
|
78
87
|
/**
|
|
79
88
|
* --------------------------------
|
|
80
89
|
* OUTPUTS
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BankListOutputSchema = exports.VerifyAccountOutputSchema = exports.UpdatePayoutMethodInputSchema = exports.CreatePayoutMethodInputSchema = exports.PayoutMethodEntitySchema = void 0;
|
|
3
|
+
exports.BankListOutputSchema = exports.VerifyAccountOutputSchema = exports.VerifyAccountInputSchema = exports.GetBanksInputSchema = exports.UpdatePayoutMethodInputSchema = exports.CreatePayoutMethodInputSchema = exports.PayoutMethodEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
/**
|
|
@@ -41,6 +41,13 @@ exports.CreatePayoutMethodInputSchema = PayoutMethodShape.omit({
|
|
|
41
41
|
externalBankId: true,
|
|
42
42
|
});
|
|
43
43
|
exports.UpdatePayoutMethodInputSchema = PayoutMethodShape.partial();
|
|
44
|
+
exports.GetBanksInputSchema = zod_openapi_1.z.object({
|
|
45
|
+
country: zod_openapi_1.z.string().optional(),
|
|
46
|
+
});
|
|
47
|
+
exports.VerifyAccountInputSchema = zod_openapi_1.z.object({
|
|
48
|
+
accountNumber: zod_openapi_1.z.string().regex(/^\d{10}$/),
|
|
49
|
+
bankCode: zod_openapi_1.z.string().min(1),
|
|
50
|
+
});
|
|
44
51
|
/**
|
|
45
52
|
* --------------------------------
|
|
46
53
|
* OUTPUTS
|
|
@@ -311,6 +311,10 @@ export declare const ProductDiscountCheckInputSchema: z.ZodObject<{
|
|
|
311
311
|
productId: z.ZodCUID2;
|
|
312
312
|
}, z.core.$strip>;
|
|
313
313
|
export type ProductDiscountCheckInput = z.infer<typeof ProductDiscountCheckInputSchema>;
|
|
314
|
+
export declare const ProductIdInputSchema: z.ZodObject<{
|
|
315
|
+
productId: z.ZodCUID2;
|
|
316
|
+
}, z.core.$strip>;
|
|
317
|
+
export type ProductIdInput = z.infer<typeof ProductIdInputSchema>;
|
|
314
318
|
export declare const RevenueChartInputSchema: z.ZodObject<{
|
|
315
319
|
startDate: z.ZodOptional<z.ZodString>;
|
|
316
320
|
endDate: z.ZodOptional<z.ZodString>;
|
package/dist/schemas/product.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductPurchaseSnapshotSchema = exports.SellerDashboardStatsOutputSchema = exports.ProductRevenueChartOutputSchema = exports.RevenueChartPointSchema = exports.ProductTransactionsOutputSchema = exports.ProductTransactionItemSchema = exports.ProductStatsOutputSchema = exports.ProductDiscountCheckOutputSchema = exports.GetMarketplaceInfoOutputSchema = exports.SearchProductOutputSchema = exports.MarketplaceCategorySchema = exports.MarketplaceProductEntitySchema = exports.ProductSearchDocumentSchema = exports.RevenueChartInputSchema = exports.ProductDiscountCheckInputSchema = exports.SearchProductInputSchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductEntitySchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
|
|
3
|
+
exports.ProductPurchaseSnapshotSchema = exports.SellerDashboardStatsOutputSchema = exports.ProductRevenueChartOutputSchema = exports.RevenueChartPointSchema = exports.ProductTransactionsOutputSchema = exports.ProductTransactionItemSchema = exports.ProductStatsOutputSchema = exports.ProductDiscountCheckOutputSchema = exports.GetMarketplaceInfoOutputSchema = exports.SearchProductOutputSchema = exports.MarketplaceCategorySchema = exports.MarketplaceProductEntitySchema = exports.ProductSearchDocumentSchema = exports.RevenueChartInputSchema = exports.ProductIdInputSchema = exports.ProductDiscountCheckInputSchema = exports.SearchProductInputSchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductEntitySchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const file_1 = require("./file");
|
|
@@ -179,6 +179,9 @@ exports.ProductDiscountCheckInputSchema = zod_openapi_1.z.object({
|
|
|
179
179
|
discountCode: zod_openapi_1.z.string(),
|
|
180
180
|
productId: zod_openapi_1.z.cuid2(),
|
|
181
181
|
});
|
|
182
|
+
exports.ProductIdInputSchema = zod_openapi_1.z.object({
|
|
183
|
+
productId: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
184
|
+
});
|
|
182
185
|
exports.RevenueChartInputSchema = zod_openapi_1.z.object({
|
|
183
186
|
startDate: zod_openapi_1.z.string().optional(),
|
|
184
187
|
endDate: zod_openapi_1.z.string().optional(),
|
|
@@ -122,6 +122,7 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
122
122
|
readonly FAILED: "FAILED";
|
|
123
123
|
readonly REFUNDED: "REFUNDED";
|
|
124
124
|
}>>;
|
|
125
|
+
productId: z.ZodCUID2;
|
|
125
126
|
amount: z.ZodNumber;
|
|
126
127
|
currency: z.ZodEnum<{
|
|
127
128
|
readonly USD: "USD (United States Dollar)";
|
|
@@ -130,7 +131,6 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
130
131
|
readonly NGN: "NGN (Nigerian Naira)";
|
|
131
132
|
}>;
|
|
132
133
|
sellerId: z.ZodCUID2;
|
|
133
|
-
productId: z.ZodCUID2;
|
|
134
134
|
buyerId: z.ZodCUID2;
|
|
135
135
|
platformFee: z.ZodNumber;
|
|
136
136
|
sellerAmount: z.ZodNumber;
|
|
@@ -438,3 +438,74 @@ export declare const InitTransactionOutputSchema: z.ZodObject<{
|
|
|
438
438
|
checkoutUrl: z.ZodNullable<z.ZodURL>;
|
|
439
439
|
}, z.core.$strip>;
|
|
440
440
|
export type InitTransactionResult = z.infer<typeof InitTransactionOutputSchema>;
|
|
441
|
+
export declare const TransactionIdInputSchema: z.ZodObject<{
|
|
442
|
+
transactionId: z.ZodCUID2;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
export type TransactionIdInput = z.infer<typeof TransactionIdInputSchema>;
|
|
445
|
+
export declare const PurchaseLibraryInputSchema: z.ZodObject<{
|
|
446
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
447
|
+
pageSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
448
|
+
}, z.core.$strip>;
|
|
449
|
+
export type PurchaseLibraryInput = z.infer<typeof PurchaseLibraryInputSchema>;
|
|
450
|
+
export declare const PurchaseLibraryItemSchema: z.ZodObject<{
|
|
451
|
+
transactionId: z.ZodCUID2;
|
|
452
|
+
productId: z.ZodCUID2;
|
|
453
|
+
itemName: z.ZodString;
|
|
454
|
+
creator: z.ZodObject<{
|
|
455
|
+
id: z.ZodCUID2;
|
|
456
|
+
name: z.ZodString;
|
|
457
|
+
username: z.ZodString;
|
|
458
|
+
image: z.ZodNullable<z.ZodURL>;
|
|
459
|
+
}, z.core.$strip>;
|
|
460
|
+
fileCategory: z.ZodNullable<z.ZodString>;
|
|
461
|
+
purchaseDate: z.ZodISODateTime;
|
|
462
|
+
status: z.ZodEnum<{
|
|
463
|
+
REFUNDED: "REFUNDED";
|
|
464
|
+
PURCHASED: "PURCHASED";
|
|
465
|
+
}>;
|
|
466
|
+
currency: z.ZodEnum<{
|
|
467
|
+
readonly USD: "USD (United States Dollar)";
|
|
468
|
+
readonly EUR: "EUR (Euro)";
|
|
469
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
470
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
471
|
+
}>;
|
|
472
|
+
amount: z.ZodNumber;
|
|
473
|
+
thumbnailImgUrl: z.ZodNullable<z.ZodURL>;
|
|
474
|
+
}, z.core.$strip>;
|
|
475
|
+
export type PurchaseLibraryItem = z.infer<typeof PurchaseLibraryItemSchema>;
|
|
476
|
+
export declare const PurchaseLibraryOutputSchema: z.ZodObject<{
|
|
477
|
+
purchases: z.ZodArray<z.ZodObject<{
|
|
478
|
+
transactionId: z.ZodCUID2;
|
|
479
|
+
productId: z.ZodCUID2;
|
|
480
|
+
itemName: z.ZodString;
|
|
481
|
+
creator: z.ZodObject<{
|
|
482
|
+
id: z.ZodCUID2;
|
|
483
|
+
name: z.ZodString;
|
|
484
|
+
username: z.ZodString;
|
|
485
|
+
image: z.ZodNullable<z.ZodURL>;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
fileCategory: z.ZodNullable<z.ZodString>;
|
|
488
|
+
purchaseDate: z.ZodISODateTime;
|
|
489
|
+
status: z.ZodEnum<{
|
|
490
|
+
REFUNDED: "REFUNDED";
|
|
491
|
+
PURCHASED: "PURCHASED";
|
|
492
|
+
}>;
|
|
493
|
+
currency: z.ZodEnum<{
|
|
494
|
+
readonly USD: "USD (United States Dollar)";
|
|
495
|
+
readonly EUR: "EUR (Euro)";
|
|
496
|
+
readonly GBP: "GBP (British Pound Sterling)";
|
|
497
|
+
readonly NGN: "NGN (Nigerian Naira)";
|
|
498
|
+
}>;
|
|
499
|
+
amount: z.ZodNumber;
|
|
500
|
+
thumbnailImgUrl: z.ZodNullable<z.ZodURL>;
|
|
501
|
+
}, z.core.$strip>>;
|
|
502
|
+
pagination: z.ZodObject<{
|
|
503
|
+
page: z.ZodNumber;
|
|
504
|
+
pageSize: z.ZodNumber;
|
|
505
|
+
totalItems: z.ZodNumber;
|
|
506
|
+
totalPages: z.ZodNumber;
|
|
507
|
+
hasPreviousPage: z.ZodBoolean;
|
|
508
|
+
hasNextPage: z.ZodBoolean;
|
|
509
|
+
}, z.core.$strip>;
|
|
510
|
+
}, z.core.$strip>;
|
|
511
|
+
export type PurchaseLibraryOutput = z.infer<typeof PurchaseLibraryOutputSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InitTransactionOutputSchema = exports.TransactionEntitySchema = exports.UpdateTransactionWebhookInputSchema = exports.CreateTransactionInputSchema = exports.InitTransactionInputSchema = exports.BaseTransactionSchema = void 0;
|
|
3
|
+
exports.PurchaseLibraryOutputSchema = exports.PurchaseLibraryItemSchema = exports.PurchaseLibraryInputSchema = exports.TransactionIdInputSchema = exports.InitTransactionOutputSchema = exports.TransactionEntitySchema = exports.UpdateTransactionWebhookInputSchema = exports.CreateTransactionInputSchema = exports.InitTransactionInputSchema = exports.BaseTransactionSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const product_1 = require("./product");
|
|
@@ -89,3 +89,38 @@ exports.InitTransactionOutputSchema = zod_openapi_1.z
|
|
|
89
89
|
}),
|
|
90
90
|
})
|
|
91
91
|
.openapi({ title: "InitTransactionResult" });
|
|
92
|
+
exports.TransactionIdInputSchema = zod_openapi_1.z.object({
|
|
93
|
+
transactionId: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
94
|
+
});
|
|
95
|
+
exports.PurchaseLibraryInputSchema = zod_openapi_1.z.object({
|
|
96
|
+
page: zod_openapi_1.z.coerce.number().int().min(1).default(1),
|
|
97
|
+
pageSize: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
98
|
+
});
|
|
99
|
+
exports.PurchaseLibraryItemSchema = zod_openapi_1.z.object({
|
|
100
|
+
transactionId: zod_openapi_1.z.cuid2(),
|
|
101
|
+
productId: zod_openapi_1.z.cuid2(),
|
|
102
|
+
itemName: zod_openapi_1.z.string(),
|
|
103
|
+
creator: zod_openapi_1.z.object({
|
|
104
|
+
id: zod_openapi_1.z.cuid2(),
|
|
105
|
+
name: zod_openapi_1.z.string(),
|
|
106
|
+
username: zod_openapi_1.z.string(),
|
|
107
|
+
image: zod_openapi_1.z.url().nullable(),
|
|
108
|
+
}),
|
|
109
|
+
fileCategory: zod_openapi_1.z.string().nullable(),
|
|
110
|
+
purchaseDate: zod_openapi_1.z.iso.datetime(),
|
|
111
|
+
status: zod_openapi_1.z.enum(["PURCHASED", "REFUNDED"]),
|
|
112
|
+
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
113
|
+
amount: zod_openapi_1.z.number().int(),
|
|
114
|
+
thumbnailImgUrl: zod_openapi_1.z.url().nullable(),
|
|
115
|
+
});
|
|
116
|
+
exports.PurchaseLibraryOutputSchema = zod_openapi_1.z.object({
|
|
117
|
+
purchases: zod_openapi_1.z.array(exports.PurchaseLibraryItemSchema),
|
|
118
|
+
pagination: zod_openapi_1.z.object({
|
|
119
|
+
page: zod_openapi_1.z.number().int(),
|
|
120
|
+
pageSize: zod_openapi_1.z.number().int(),
|
|
121
|
+
totalItems: zod_openapi_1.z.number().int(),
|
|
122
|
+
totalPages: zod_openapi_1.z.number().int(),
|
|
123
|
+
hasPreviousPage: zod_openapi_1.z.boolean(),
|
|
124
|
+
hasNextPage: zod_openapi_1.z.boolean(),
|
|
125
|
+
}),
|
|
126
|
+
});
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -846,14 +846,21 @@ export type UserWithProductsEntity = z.infer<typeof UserWithProductsEntitySchema
|
|
|
846
846
|
export declare const UserAuthStatusEntitySchema: z.ZodObject<{
|
|
847
847
|
exists: z.ZodBoolean;
|
|
848
848
|
isOAuthOnly: z.ZodBoolean;
|
|
849
|
+
hasPassword: z.ZodBoolean;
|
|
850
|
+
canChangePassword: z.ZodBoolean;
|
|
851
|
+
canSetPassword: z.ZodBoolean;
|
|
849
852
|
providers: z.ZodArray<z.ZodString>;
|
|
850
853
|
}, z.core.$strip>;
|
|
854
|
+
export declare const DeactivateAccountInputSchema: z.ZodObject<{
|
|
855
|
+
password: z.ZodOptional<z.ZodString>;
|
|
856
|
+
}, z.core.$strip>;
|
|
851
857
|
export declare const UserWithJobBookmarksInputSchema: z.ZodObject<{
|
|
852
858
|
cursor: z.ZodOptional<z.ZodString>;
|
|
853
859
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
854
860
|
}, z.core.$strip>;
|
|
855
861
|
export type UserAuthStatusEntity = z.infer<typeof UserAuthStatusEntitySchema>;
|
|
856
|
-
export type
|
|
862
|
+
export type DeactivateAccountInput = z.infer<typeof DeactivateAccountInputSchema>;
|
|
863
|
+
export type UserWithJobBookmarksInput = z.infer<typeof UserWithJobBookmarksInputSchema>;
|
|
857
864
|
/**
|
|
858
865
|
* --------------------------------
|
|
859
866
|
* FOLLOW SYSTEM
|
|
@@ -967,6 +974,37 @@ export declare const SearchUsersOutputSchema: z.ZodObject<{
|
|
|
967
974
|
nextCursor: z.ZodOptional<z.ZodString>;
|
|
968
975
|
}, z.core.$strip>;
|
|
969
976
|
export type SearchUsersOutput = z.infer<typeof SearchUsersOutputSchema>;
|
|
977
|
+
export declare const MentionableUsersInputSchema: z.ZodObject<{
|
|
978
|
+
query: z.ZodDefault<z.ZodString>;
|
|
979
|
+
roles: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodEnum<{
|
|
980
|
+
CREATIVE: "CREATIVE";
|
|
981
|
+
BRAND: "BRAND";
|
|
982
|
+
INVESTOR: "INVESTOR";
|
|
983
|
+
ADMIN: "ADMIN";
|
|
984
|
+
}>>>>;
|
|
985
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
986
|
+
}, z.core.$strip>;
|
|
987
|
+
export type MentionableUsersInput = z.infer<typeof MentionableUsersInputSchema>;
|
|
988
|
+
export declare const MentionableUsersOutputSchema: z.ZodObject<{
|
|
989
|
+
users: z.ZodArray<z.ZodObject<{
|
|
990
|
+
id: z.ZodCUID2;
|
|
991
|
+
name: z.ZodDefault<z.ZodString>;
|
|
992
|
+
email: z.ZodEmail;
|
|
993
|
+
image: z.ZodDefault<z.ZodString>;
|
|
994
|
+
username: z.ZodDefault<z.ZodString>;
|
|
995
|
+
role: z.ZodEnum<{
|
|
996
|
+
CREATIVE: "CREATIVE";
|
|
997
|
+
BRAND: "BRAND";
|
|
998
|
+
INVESTOR: "INVESTOR";
|
|
999
|
+
ADMIN: "ADMIN";
|
|
1000
|
+
}>;
|
|
1001
|
+
isFollowing: z.ZodBoolean;
|
|
1002
|
+
followsYou: z.ZodBoolean;
|
|
1003
|
+
noOfFollowers: z.ZodNumber;
|
|
1004
|
+
disciplines: z.ZodArray<z.ZodString>;
|
|
1005
|
+
}, z.core.$strip>>;
|
|
1006
|
+
}, z.core.$strip>;
|
|
1007
|
+
export type MentionableUsersOutput = z.infer<typeof MentionableUsersOutputSchema>;
|
|
970
1008
|
/**
|
|
971
1009
|
* --------------------------------
|
|
972
1010
|
* ACTIVITY
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserSearchDocumentSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithJobBookmarksInputSchema = exports.UserAuthStatusEntitySchema = exports.UserWithProductsEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithPostsEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserStatsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = void 0;
|
|
3
|
+
exports.UserSearchDocumentSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.MentionableUsersOutputSchema = exports.MentionableUsersInputSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithJobBookmarksInputSchema = exports.DeactivateAccountInputSchema = exports.UserAuthStatusEntitySchema = exports.UserWithProductsEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithPostsEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserStatsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const project_1 = require("./project");
|
|
@@ -126,8 +126,14 @@ exports.UserWithProductsEntitySchema = zod_openapi_1.z.object({
|
|
|
126
126
|
exports.UserAuthStatusEntitySchema = zod_openapi_1.z.object({
|
|
127
127
|
exists: zod_openapi_1.z.boolean(),
|
|
128
128
|
isOAuthOnly: zod_openapi_1.z.boolean(),
|
|
129
|
+
hasPassword: zod_openapi_1.z.boolean(),
|
|
130
|
+
canChangePassword: zod_openapi_1.z.boolean(),
|
|
131
|
+
canSetPassword: zod_openapi_1.z.boolean(),
|
|
129
132
|
providers: zod_openapi_1.z.array(zod_openapi_1.z.string()),
|
|
130
133
|
});
|
|
134
|
+
exports.DeactivateAccountInputSchema = zod_openapi_1.z.object({
|
|
135
|
+
password: zod_openapi_1.z.string().min(1).optional(),
|
|
136
|
+
});
|
|
131
137
|
exports.UserWithJobBookmarksInputSchema = zod_openapi_1.z.object({
|
|
132
138
|
cursor: zod_openapi_1.z.string().optional(),
|
|
133
139
|
limit: zod_openapi_1.z.coerce.number().int().positive().optional(),
|
|
@@ -179,6 +185,14 @@ exports.SearchUsersOutputSchema = zod_openapi_1.z.object({
|
|
|
179
185
|
})),
|
|
180
186
|
nextCursor: zod_openapi_1.z.string().optional(),
|
|
181
187
|
});
|
|
188
|
+
exports.MentionableUsersInputSchema = zod_openapi_1.z.object({
|
|
189
|
+
query: zod_openapi_1.z.string().default(""),
|
|
190
|
+
roles: exports.SearchUsersInputSchema.shape.roles,
|
|
191
|
+
limit: zod_openapi_1.z.coerce.number().int().min(1).max(10).default(10),
|
|
192
|
+
});
|
|
193
|
+
exports.MentionableUsersOutputSchema = exports.SearchUsersOutputSchema.pick({
|
|
194
|
+
users: true,
|
|
195
|
+
});
|
|
182
196
|
/**
|
|
183
197
|
* --------------------------------
|
|
184
198
|
* ACTIVITY
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Backend OpenAPI Shared Contracts Handoff
|
|
2
|
+
|
|
3
|
+
Shared now exports the backend OpenAPI request/response contracts that were previously defined locally in backend route files. After publishing this package, update the backend dependency and replace the local schemas with top-level imports from `@zyacreatives/shared`.
|
|
4
|
+
|
|
5
|
+
## Publish Target
|
|
6
|
+
|
|
7
|
+
- Package: `@zyacreatives/shared`
|
|
8
|
+
- Current source version: `2.5.79`
|
|
9
|
+
- Import style: prefer `@zyacreatives/shared` over deep imports such as `@zyacreatives/shared/dist/schemas/comment`.
|
|
10
|
+
|
|
11
|
+
## Highest Priority Replacements
|
|
12
|
+
|
|
13
|
+
### User Purchase Library
|
|
14
|
+
|
|
15
|
+
Backend sources:
|
|
16
|
+
- `src/api/user/user.openapi.ts`
|
|
17
|
+
- `src/api/transaction/transaction.services.ts`
|
|
18
|
+
|
|
19
|
+
Shared exports:
|
|
20
|
+
- `PurchaseLibraryInputSchema`
|
|
21
|
+
- `PurchaseLibraryItemSchema`
|
|
22
|
+
- `PurchaseLibraryOutputSchema`
|
|
23
|
+
- `type PurchaseLibraryInput`
|
|
24
|
+
- `type PurchaseLibraryItem`
|
|
25
|
+
- `type PurchaseLibraryOutput`
|
|
26
|
+
|
|
27
|
+
Backend migration notes:
|
|
28
|
+
- Replace the local OpenAPI schemas in `user.openapi.ts`.
|
|
29
|
+
- Remove duplicated `PurchaseLibraryItem` / purchase result service types in `transaction.services.ts` and infer/use the shared types instead.
|
|
30
|
+
|
|
31
|
+
### Chat Reports And Chat List Query
|
|
32
|
+
|
|
33
|
+
Backend source:
|
|
34
|
+
- `src/api/chat/chat.openapi.ts`
|
|
35
|
+
|
|
36
|
+
Shared exports:
|
|
37
|
+
- `ReportChatInputSchema`
|
|
38
|
+
- `ReportChatOutputSchema`
|
|
39
|
+
- `ChatListQuerySchema`
|
|
40
|
+
- `type ReportChatInput`
|
|
41
|
+
- `type ReportChatOutput`
|
|
42
|
+
- `type ChatListQuery`
|
|
43
|
+
|
|
44
|
+
### Job Dashboard / Application Status Outputs
|
|
45
|
+
|
|
46
|
+
Backend sources:
|
|
47
|
+
- `src/api/job/job.openapi.ts`
|
|
48
|
+
- `src/entity/job.entity.ts`
|
|
49
|
+
|
|
50
|
+
Shared exports:
|
|
51
|
+
- `NormalizedJobSchema`
|
|
52
|
+
- `type NormalizedJob`
|
|
53
|
+
- `GetCreatedJobsOutputSchema`
|
|
54
|
+
- `GetApplicationStatusUpdatesCountOutputSchema`
|
|
55
|
+
- `JobApplicationIdInputSchema`
|
|
56
|
+
- `GetApplicationsForJobOutputSchema`
|
|
57
|
+
|
|
58
|
+
Backend migration notes:
|
|
59
|
+
- Use shared `NormalizedJobSchema` for OpenAPI responses.
|
|
60
|
+
- `NormalizedJobSchema` remains compatible with the existing shared job entity schemas.
|
|
61
|
+
- `JobApplicationIdInputSchema` uses `{ applicationId: string }` for the path param.
|
|
62
|
+
|
|
63
|
+
### Comment Threads And Replies
|
|
64
|
+
|
|
65
|
+
Backend sources:
|
|
66
|
+
- `src/api/comment/comment.openapi.ts`
|
|
67
|
+
- `src/api/project/project.openapi.ts`
|
|
68
|
+
|
|
69
|
+
Shared exports:
|
|
70
|
+
- `CommentThreadResponseSchema`
|
|
71
|
+
- `CommentRepliesOutputSchema`
|
|
72
|
+
- `CommentIdInputSchema`
|
|
73
|
+
- `ProjectCommentParamsSchema`
|
|
74
|
+
|
|
75
|
+
Backend migration notes:
|
|
76
|
+
- Replace deep `CommentEntitySchema` imports with top-level imports from `@zyacreatives/shared`.
|
|
77
|
+
|
|
78
|
+
### Payout Method Utility Inputs
|
|
79
|
+
|
|
80
|
+
Backend source:
|
|
81
|
+
- `src/api/payout-method/payout-method.openapi.ts`
|
|
82
|
+
|
|
83
|
+
Shared exports:
|
|
84
|
+
- `GetBanksInputSchema`
|
|
85
|
+
- `VerifyAccountInputSchema`
|
|
86
|
+
- `type GetBanksInput`
|
|
87
|
+
- `type VerifyAccountInput`
|
|
88
|
+
|
|
89
|
+
## Medium Priority Replacements
|
|
90
|
+
|
|
91
|
+
### User Auth / Mentions / Feed Preferences
|
|
92
|
+
|
|
93
|
+
Backend source:
|
|
94
|
+
- `src/api/user/user.openapi.ts`
|
|
95
|
+
|
|
96
|
+
Shared exports:
|
|
97
|
+
- `UserAuthStatusEntitySchema`
|
|
98
|
+
- `DeactivateAccountInputSchema`
|
|
99
|
+
- `MentionableUsersInputSchema`
|
|
100
|
+
- `MentionableUsersOutputSchema`
|
|
101
|
+
- `UserWithJobBookmarksInputSchema`
|
|
102
|
+
- `FeedTagsInputSchema`
|
|
103
|
+
- `FeedTagsSchema`
|
|
104
|
+
|
|
105
|
+
### Feed Variant Output
|
|
106
|
+
|
|
107
|
+
Backend source:
|
|
108
|
+
- `src/api/feed/feed.openapi.ts`
|
|
109
|
+
|
|
110
|
+
Shared export:
|
|
111
|
+
- `GetFeedWithCommentPolicyOutputSchema`
|
|
112
|
+
|
|
113
|
+
Note:
|
|
114
|
+
- If this is now the canonical feed response, consider replacing or aliasing backend usage of any older local feed output schema.
|
|
115
|
+
|
|
116
|
+
### Messages Delete And Params
|
|
117
|
+
|
|
118
|
+
Backend sources:
|
|
119
|
+
- `src/api/message/message.openapi.ts`
|
|
120
|
+
- `src/api/message/message.services.ts`
|
|
121
|
+
|
|
122
|
+
Shared exports:
|
|
123
|
+
- `ChatIdParamSchema`
|
|
124
|
+
- `MessageParamsSchema`
|
|
125
|
+
- `DeleteMessagesInputSchema`
|
|
126
|
+
- `type DeleteMessagesInput`
|
|
127
|
+
|
|
128
|
+
### Investor Signal / Shortlist Checks
|
|
129
|
+
|
|
130
|
+
Backend sources:
|
|
131
|
+
- `src/api/investor-signal/investor-signal.openapi.ts`
|
|
132
|
+
- `src/api/investor-shortlist-item/investor-shortlist-item.openapi.ts`
|
|
133
|
+
|
|
134
|
+
Shared exports:
|
|
135
|
+
- `CheckInvestorSignalOutputSchema`
|
|
136
|
+
- `CheckInvestorShortlistItemOutputSchema`
|
|
137
|
+
- `InvestorSignalIdInputSchema`
|
|
138
|
+
- `InvestorShortlistItemIdInputSchema`
|
|
139
|
+
- `DefaultApiSuccessOutputSchema`
|
|
140
|
+
|
|
141
|
+
### File Route Params And JSend URL Response
|
|
142
|
+
|
|
143
|
+
Backend source:
|
|
144
|
+
- `src/api/file/file.openapi.ts`
|
|
145
|
+
|
|
146
|
+
Shared exports:
|
|
147
|
+
- `PurchasedDownloadUrlInputSchema`
|
|
148
|
+
- `PublicFileUrlInputSchema`
|
|
149
|
+
- `PresignedUrlJSendOutputSchema`
|
|
150
|
+
|
|
151
|
+
## Low Priority / Primitive Replacements
|
|
152
|
+
|
|
153
|
+
### Entity Id Params
|
|
154
|
+
|
|
155
|
+
Backend sources:
|
|
156
|
+
- `src/api/product/product.openapi.ts`
|
|
157
|
+
- `src/api/transaction/transaction.openapi.ts`
|
|
158
|
+
- `src/api/job/job.openapi.ts`
|
|
159
|
+
- inline investor module params
|
|
160
|
+
|
|
161
|
+
Shared exports:
|
|
162
|
+
- `ProductIdInputSchema`
|
|
163
|
+
- `TransactionIdInputSchema`
|
|
164
|
+
- `JobIdSchema`
|
|
165
|
+
- `ApplicationIdInputSchema`
|
|
166
|
+
- `IdInputSchema`
|
|
167
|
+
|
|
168
|
+
### Discipline Tags Query
|
|
169
|
+
|
|
170
|
+
Backend source:
|
|
171
|
+
- `src/api/discipline/discipline.openapi.ts`
|
|
172
|
+
|
|
173
|
+
Shared exports:
|
|
174
|
+
- `GetDisciplineTagsInputSchema`
|
|
175
|
+
- `GetDisciplineTagsOutputSchema`
|
|
176
|
+
|
|
177
|
+
## Suggested Backend Migration Order
|
|
178
|
+
|
|
179
|
+
1. Update `@zyacreatives/shared` in backend `package.json` after publishing.
|
|
180
|
+
2. Replace local OpenAPI schemas listed above with top-level shared imports.
|
|
181
|
+
3. Remove duplicated service-level types where shared now exports matching types.
|
|
182
|
+
4. Replace deep shared imports with top-level `@zyacreatives/shared` imports.
|
|
183
|
+
5. Regenerate OpenAPI output.
|
|
184
|
+
6. Run backend typecheck and route/OpenAPI tests.
|
|
185
|
+
|
|
186
|
+
## Verification Completed In Shared
|
|
187
|
+
|
|
188
|
+
The shared package typechecks successfully with:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
pnpm.cmd tsc
|
|
192
|
+
```
|
|
193
|
+
|
package/package.json
CHANGED
package/src/schemas/chat.ts
CHANGED
|
@@ -72,9 +72,9 @@ export const CreateChatInputSchema = z.object({
|
|
|
72
72
|
|
|
73
73
|
export type CreateChatInput = z.infer<typeof CreateChatInputSchema>;
|
|
74
74
|
|
|
75
|
-
export const ChatIdInputSchema = z.object({
|
|
76
|
-
chatId: z.cuid2(),
|
|
77
|
-
});
|
|
75
|
+
export const ChatIdInputSchema = z.object({
|
|
76
|
+
chatId: z.cuid2(),
|
|
77
|
+
});
|
|
78
78
|
|
|
79
79
|
export type ChatIdInput = z.infer<typeof ChatIdInputSchema>;
|
|
80
80
|
|
|
@@ -118,17 +118,25 @@ export type GetMessageRequestsForUserOutput = z.infer<
|
|
|
118
118
|
typeof GetMessageRequestsForUserOutputSchema
|
|
119
119
|
>;
|
|
120
120
|
|
|
121
|
-
export const ReportChatInputSchema = z.object({
|
|
122
|
-
complaint: z.string().trim().min(10).max(1000),
|
|
123
|
-
messageId: z.cuid2().optional(),
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
export type ReportChatInput = z.infer<typeof ReportChatInputSchema
|
|
127
|
-
|
|
128
|
-
export const ReportChatOutputSchema = z.object({
|
|
129
|
-
reported: z.boolean(),
|
|
130
|
-
chatId: z.string(),
|
|
131
|
-
messageId: z.string().nullable(),
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
export type ReportChatOutput = z.infer<typeof ReportChatOutputSchema
|
|
121
|
+
export const ReportChatInputSchema = z.object({
|
|
122
|
+
complaint: z.string().trim().min(10).max(1000),
|
|
123
|
+
messageId: z.cuid2().optional(),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
export type ReportChatInput = z.infer<typeof ReportChatInputSchema>;
|
|
127
|
+
|
|
128
|
+
export const ReportChatOutputSchema = z.object({
|
|
129
|
+
reported: z.boolean(),
|
|
130
|
+
chatId: z.string(),
|
|
131
|
+
messageId: z.string().nullable(),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export type ReportChatOutput = z.infer<typeof ReportChatOutputSchema>;
|
|
135
|
+
|
|
136
|
+
export const ChatListQuerySchema = z.object({
|
|
137
|
+
cursor: z.string().optional(),
|
|
138
|
+
query: z.string().trim().max(100).optional(),
|
|
139
|
+
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
export type ChatListQuery = z.infer<typeof ChatListQuerySchema>;
|
package/src/schemas/comment.ts
CHANGED
|
@@ -59,11 +59,26 @@ export const CreateCommentInputSchema = z.object({
|
|
|
59
59
|
|
|
60
60
|
export type CreateCommentInput = z.infer<typeof CreateCommentInputSchema>;
|
|
61
61
|
|
|
62
|
-
export const DeleteCommentInputSchema = z.object({
|
|
63
|
-
commentId: z.cuid2(),
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export type DeleteCommentInput = z.infer<typeof DeleteCommentInputSchema>;
|
|
62
|
+
export const DeleteCommentInputSchema = z.object({
|
|
63
|
+
commentId: z.cuid2(),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export type DeleteCommentInput = z.infer<typeof DeleteCommentInputSchema>;
|
|
67
|
+
|
|
68
|
+
export const CommentIdInputSchema = z.object({
|
|
69
|
+
commentId: z.cuid2(),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export type CommentIdInput = z.infer<typeof CommentIdInputSchema>;
|
|
73
|
+
|
|
74
|
+
export const ProjectCommentParamsSchema = z.object({
|
|
75
|
+
projectId: z.cuid2(),
|
|
76
|
+
commentId: z.cuid2(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export type ProjectCommentParams = z.infer<
|
|
80
|
+
typeof ProjectCommentParamsSchema
|
|
81
|
+
>;
|
|
67
82
|
|
|
68
83
|
/**
|
|
69
84
|
* --------------------------------
|
|
@@ -71,6 +86,23 @@ export type DeleteCommentInput = z.infer<typeof DeleteCommentInputSchema>;
|
|
|
71
86
|
* --------------------------------
|
|
72
87
|
*/
|
|
73
88
|
|
|
74
|
-
export const CommentOutputSchema = CommentEntitySchema;
|
|
75
|
-
|
|
76
|
-
export type CommentOutput = z.infer<typeof CommentOutputSchema>;
|
|
89
|
+
export const CommentOutputSchema = CommentEntitySchema;
|
|
90
|
+
|
|
91
|
+
export type CommentOutput = z.infer<typeof CommentOutputSchema>;
|
|
92
|
+
|
|
93
|
+
export const CommentThreadResponseSchema = z.object({
|
|
94
|
+
comments: z.array(CommentEntitySchema),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export type CommentThreadResponse = z.infer<
|
|
98
|
+
typeof CommentThreadResponseSchema
|
|
99
|
+
>;
|
|
100
|
+
|
|
101
|
+
export const CommentRepliesOutputSchema = z.object({
|
|
102
|
+
replies: z.array(CommentEntitySchema),
|
|
103
|
+
nextCursor: z.string().nullable(),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export type CommentRepliesOutput = z.infer<
|
|
107
|
+
typeof CommentRepliesOutputSchema
|
|
108
|
+
>;
|
package/src/schemas/common.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import { CommentEntitySchema } from "./comment";
|
|
3
|
-
import { ActivitySchema } from "./activity";
|
|
4
|
-
import { LINK_TYPES } from "../constants";
|
|
5
|
-
|
|
6
|
-
export const CuidSchema = z.cuid2({ error: "Invalid CUID2 is written." });
|
|
1
|
+
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { CommentEntitySchema } from "./comment";
|
|
3
|
+
import { ActivitySchema } from "./activity";
|
|
4
|
+
import { LINK_TYPES } from "../constants";
|
|
5
|
+
|
|
6
|
+
export const CuidSchema = z.cuid2({ error: "Invalid CUID2 is written." });
|
|
7
|
+
|
|
8
|
+
export const IdInputSchema = z.object({
|
|
9
|
+
id: z.cuid2(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type IdInput = z.infer<typeof IdInputSchema>;
|
|
7
13
|
|
|
8
14
|
export const UserIdentifierSchema = z.object({
|
|
9
15
|
by: z.enum(["id", "username"]).optional().default("id"),
|
|
@@ -23,11 +29,12 @@ export const ProjectIdentifierSchema = z.object({
|
|
|
23
29
|
|
|
24
30
|
export type ProjectIdentifier = z.infer<typeof ProjectIdentifierSchema>;
|
|
25
31
|
|
|
26
|
-
export const DefaultApiSuccessOutputSchema = z.object({
|
|
27
|
-
status: z.literal("success"),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export type ApiSuccessOutput = z.infer<typeof DefaultApiSuccessOutputSchema>;
|
|
32
|
+
export const DefaultApiSuccessOutputSchema = z.object({
|
|
33
|
+
status: z.literal("success"),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type ApiSuccessOutput = z.infer<typeof DefaultApiSuccessOutputSchema>;
|
|
37
|
+
export type DefaultApiSuccessOutput = ApiSuccessOutput;
|
|
31
38
|
|
|
32
39
|
export const EntityCommentsOutputSchema = z.object({
|
|
33
40
|
comments: z.array(CommentEntitySchema),
|