@zyacreatives/shared 2.5.54 → 2.5.56

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 (111) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/schemas/activity.d.ts +1 -0
  4. package/dist/schemas/auth.d.ts +2 -0
  5. package/dist/schemas/bookmark.d.ts +62 -7
  6. package/dist/schemas/bookmark.js +32 -30
  7. package/dist/schemas/brand.d.ts +3 -3
  8. package/dist/schemas/chat.d.ts +96 -52
  9. package/dist/schemas/chat.js +44 -18
  10. package/dist/schemas/comment.d.ts +65 -21
  11. package/dist/schemas/comment.js +48 -54
  12. package/dist/schemas/common.d.ts +15 -11
  13. package/dist/schemas/creative.d.ts +3 -3
  14. package/dist/schemas/discipline.d.ts +63 -12
  15. package/dist/schemas/discipline.js +62 -65
  16. package/dist/schemas/entity-stats.d.ts +35 -3
  17. package/dist/schemas/entity-stats.js +24 -38
  18. package/dist/schemas/feed.d.ts +50 -3
  19. package/dist/schemas/feed.js +43 -13
  20. package/dist/schemas/file.d.ts +65 -24
  21. package/dist/schemas/file.js +60 -49
  22. package/dist/schemas/index.d.ts +1 -0
  23. package/dist/schemas/index.js +1 -0
  24. package/dist/schemas/investor-shortlist.d.ts +68 -11
  25. package/dist/schemas/investor-shortlist.js +46 -24
  26. package/dist/schemas/investor-signal.d.ts +52 -12
  27. package/dist/schemas/investor-signal.js +59 -39
  28. package/dist/schemas/investor.d.ts +3 -3
  29. package/dist/schemas/job-application.d.ts +291 -279
  30. package/dist/schemas/job-application.js +59 -95
  31. package/dist/schemas/job.d.ts +200 -659
  32. package/dist/schemas/job.js +98 -231
  33. package/dist/schemas/like.d.ts +3 -0
  34. package/dist/schemas/message.d.ts +125 -94
  35. package/dist/schemas/message.js +54 -55
  36. package/dist/schemas/notification.d.ts +99 -32
  37. package/dist/schemas/notification.js +46 -42
  38. package/dist/schemas/payout-method.d.ts +51 -31
  39. package/dist/schemas/payout-method.js +48 -58
  40. package/dist/schemas/post.d.ts +295 -204
  41. package/dist/schemas/post.js +148 -272
  42. package/dist/schemas/product.d.ts +308 -229
  43. package/dist/schemas/product.js +111 -94
  44. package/dist/schemas/project.d.ts +512 -449
  45. package/dist/schemas/project.js +144 -102
  46. package/dist/schemas/seller.d.ts +10 -10
  47. package/dist/schemas/user-strike.d.ts +3 -0
  48. package/dist/schemas/user.d.ts +127 -136
  49. package/dist/schemas/username.d.ts +1 -0
  50. package/dist/schemas/view.d.ts +1 -0
  51. package/dist/types/activity.d.ts +1 -3
  52. package/dist/types/auth.d.ts +1 -4
  53. package/dist/types/bookmark.d.ts +1 -3
  54. package/dist/types/chat.d.ts +1 -11
  55. package/dist/types/comment.d.ts +1 -5
  56. package/dist/types/common.d.ts +2 -8
  57. package/dist/types/discipline.d.ts +1 -11
  58. package/dist/types/entity-stats.d.ts +1 -3
  59. package/dist/types/feed.d.ts +1 -5
  60. package/dist/types/investor-shortlist.d.ts +1 -6
  61. package/dist/types/investor-signal.d.ts +1 -7
  62. package/dist/types/like.d.ts +1 -3
  63. package/dist/types/message.d.ts +1 -9
  64. package/dist/types/notification.d.ts +1 -9
  65. package/dist/types/user-strike.d.ts +1 -5
  66. package/dist/types/username.d.ts +1 -3
  67. package/package.json +1 -1
  68. package/src/index.ts +4 -5
  69. package/src/schemas/activity.ts +5 -4
  70. package/src/schemas/auth.ts +14 -10
  71. package/src/schemas/bookmark.ts +48 -29
  72. package/src/schemas/chat.ts +79 -18
  73. package/src/schemas/comment.ts +63 -49
  74. package/src/schemas/common.ts +8 -3
  75. package/src/schemas/discipline.ts +103 -71
  76. package/src/schemas/entity-stats.ts +32 -38
  77. package/src/schemas/feed.ts +62 -15
  78. package/src/schemas/file.ts +85 -58
  79. package/src/schemas/index.ts +1 -0
  80. package/src/schemas/investor-shortlist.ts +57 -8
  81. package/src/schemas/investor-signal.ts +79 -27
  82. package/src/schemas/job-application.ts +81 -115
  83. package/src/schemas/job.ts +160 -301
  84. package/src/schemas/like.ts +5 -1
  85. package/src/schemas/message.ts +71 -64
  86. package/src/schemas/notification.ts +63 -51
  87. package/src/schemas/payout-method.ts +47 -63
  88. package/src/schemas/post.ts +211 -272
  89. package/src/schemas/product.ts +202 -139
  90. package/src/schemas/project.ts +265 -147
  91. package/src/schemas/user-strike.ts +7 -1
  92. package/src/schemas/user.ts +2 -6
  93. package/src/schemas/username.ts +5 -3
  94. package/src/schemas/view.ts +0 -50
  95. package/src/types/activity.ts +0 -4
  96. package/src/types/auth.ts +0 -5
  97. package/src/types/bookmark.ts +0 -4
  98. package/src/types/chat.ts +0 -31
  99. package/src/types/comment.ts +0 -12
  100. package/src/types/common.ts +0 -14
  101. package/src/types/discipline.ts +0 -32
  102. package/src/types/entity-stats.ts +0 -4
  103. package/src/types/feed.ts +0 -10
  104. package/src/types/index.ts +0 -16
  105. package/src/types/investor-shortlist.ts +0 -18
  106. package/src/types/investor-signal.ts +0 -26
  107. package/src/types/like.ts +0 -4
  108. package/src/types/message.ts +0 -26
  109. package/src/types/notification.ts +0 -34
  110. package/src/types/user-strike.ts +0 -10
  111. package/src/types/username.ts +0 -4
@@ -1,36 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationCountOutputSchema = exports.MarkReadInputSchema = exports.ListNotificationsOutputSchema = exports.ListNotificationsInputSchema = exports.NotificationDetailsEntitySchema = exports.MinimalNotificationEntitySchema = exports.NotificationEntitySchema = void 0;
3
+ exports.NotificationCountOutputSchema = exports.ListNotificationsOutputSchema = exports.MarkReadInputSchema = exports.ListNotificationsInputSchema = exports.NotificationDetailsEntitySchema = exports.NotificationEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const user_1 = require("./user");
7
+ /**
8
+ * --------------------------------
9
+ * SHAPE
10
+ * --------------------------------
11
+ */
12
+ const NotificationShape = zod_openapi_1.z.object({
13
+ actorId: zod_openapi_1.z.cuid2(),
14
+ recipientId: zod_openapi_1.z.cuid2(),
15
+ type: zod_openapi_1.z.enum(constants_1.NOTIFICATION_TYPES),
16
+ entityId: zod_openapi_1.z.cuid2().optional(),
17
+ parentId: zod_openapi_1.z.cuid2().nullable().optional(),
18
+ parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).nullable().optional(),
19
+ rootId: zod_openapi_1.z.cuid2(),
20
+ rootType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
21
+ });
22
+ /**
23
+ * --------------------------------
24
+ * ENTITY
25
+ * --------------------------------
26
+ */
7
27
  exports.NotificationEntitySchema = zod_openapi_1.z
8
28
  .object({
9
- id: zod_openapi_1.z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
10
- recipientId: zod_openapi_1.z.cuid2().openapi({ example: "user_recipient_123" }),
11
- actorId: zod_openapi_1.z.cuid2().openapi({ example: "user_actor_456" }),
12
- type: zod_openapi_1.z.enum(constants_1.NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
13
- entityId: zod_openapi_1.z.cuid2().optional().openapi({ example: "entity_789" }),
14
- parentId: zod_openapi_1.z
15
- .cuid2()
16
- .optional()
17
- .nullable()
18
- .openapi({ example: "parent_456" }),
19
- parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).optional().nullable(),
20
- rootId: zod_openapi_1.z.cuid2().openapi({ example: "root_123" }),
21
- rootType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
22
- isRead: zod_openapi_1.z.boolean().default(false).openapi({ example: false }),
23
- createdAt: zod_openapi_1.z.coerce
24
- .date()
25
- .openapi({ example: "2026-01-05T09:00:00.000Z" }),
26
- deletedAt: zod_openapi_1.z.coerce.date().optional().nullable(),
27
- })
28
- .openapi("NotificationEntity");
29
- exports.MinimalNotificationEntitySchema = zod_openapi_1.z.object({
30
29
  id: zod_openapi_1.z.cuid2(),
31
- recipientId: zod_openapi_1.z.cuid2(),
32
- actorId: zod_openapi_1.z.cuid2(),
33
- });
30
+ ...NotificationShape.shape,
31
+ isRead: zod_openapi_1.z.boolean().default(false),
32
+ createdAt: zod_openapi_1.z.iso.datetime(),
33
+ deletedAt: zod_openapi_1.z.iso.datetime().optional(),
34
+ })
35
+ .openapi("Notification");
34
36
  exports.NotificationDetailsEntitySchema = exports.NotificationEntitySchema.extend({
35
37
  actor: user_1.MinimalUserSchema,
36
38
  recipient: user_1.MinimalUserSchema,
@@ -39,27 +41,29 @@ exports.NotificationDetailsEntitySchema = exports.NotificationEntitySchema.exten
39
41
  itemImgUrl: zod_openapi_1.z.string().optional(),
40
42
  itemStatus: zod_openapi_1.z.string().optional(),
41
43
  });
42
- exports.ListNotificationsInputSchema = zod_openapi_1.z
43
- .object({
44
- type: zod_openapi_1.z
45
- .enum(constants_1.NOTIFICATION_TYPES)
46
- .openapi({ example: "LIKE" })
47
- .optional(),
44
+ /**
45
+ * --------------------------------
46
+ * INPUTS
47
+ * --------------------------------
48
+ */
49
+ exports.ListNotificationsInputSchema = zod_openapi_1.z.object({
50
+ type: zod_openapi_1.z.enum(constants_1.NOTIFICATION_TYPES).optional(),
48
51
  cursor: zod_openapi_1.z.string().optional(),
49
- unreadOnly: zod_openapi_1.z
50
- .preprocess((val) => val === "true" || val === true, zod_openapi_1.z.boolean())
51
- .optional()
52
- .default(false),
53
- })
54
- .openapi("ListNotificationsInput");
55
- exports.ListNotificationsOutputSchema = zod_openapi_1.z.object({
56
- notifications: zod_openapi_1.z.array(exports.NotificationDetailsEntitySchema),
57
- nextCursor: zod_openapi_1.z.string().optional().nullable(),
58
- unreadCount: zod_openapi_1.z.number().int().openapi({ example: 5 }),
52
+ unreadOnly: zod_openapi_1.z.boolean().optional().default(false),
59
53
  });
60
54
  exports.MarkReadInputSchema = zod_openapi_1.z.object({
61
55
  notificationIds: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()).min(1),
62
56
  });
57
+ /**
58
+ * --------------------------------
59
+ * OUTPUTS
60
+ * --------------------------------
61
+ */
62
+ exports.ListNotificationsOutputSchema = zod_openapi_1.z.object({
63
+ notifications: zod_openapi_1.z.array(exports.NotificationDetailsEntitySchema),
64
+ nextCursor: zod_openapi_1.z.string().optional(),
65
+ unreadCount: zod_openapi_1.z.int(),
66
+ });
63
67
  exports.NotificationCountOutputSchema = zod_openapi_1.z.object({
64
- unreadCount: zod_openapi_1.z.number().int().openapi({ example: 12 }),
68
+ unreadCount: zod_openapi_1.z.int(),
65
69
  });
@@ -1,28 +1,55 @@
1
- import z from "zod";
2
- export declare const PayoutMethodEntitySchema: z.ZodObject<{
3
- id: z.ZodCUID2;
4
- sellerId: z.ZodCUID2;
1
+ import { z } from "@hono/zod-openapi";
2
+ /**
3
+ * --------------------------------
4
+ * SHAPE
5
+ * --------------------------------
6
+ */
7
+ declare const PayoutMethodShape: z.ZodObject<{
5
8
  provider: z.ZodEnum<{
6
9
  readonly PAYSTACK: "PAYSTACK";
7
10
  readonly STRIPE: "STRIPE";
8
11
  readonly NONE: "NONE";
9
12
  }>;
10
- currency: z.ZodString;
11
13
  bankName: z.ZodString;
12
14
  accountLast4: z.ZodString;
13
15
  accountName: z.ZodString;
14
16
  externalBankId: z.ZodNullable<z.ZodString>;
15
17
  isDefault: z.ZodBoolean;
16
- status: z.ZodDefault<z.ZodEnum<{
18
+ }, z.core.$strip>;
19
+ export type PayoutMethodShapeType = z.infer<typeof PayoutMethodShape>;
20
+ /**
21
+ * --------------------------------
22
+ * ENTITY
23
+ * --------------------------------
24
+ */
25
+ export declare const PayoutMethodEntitySchema: z.ZodObject<{
26
+ status: z.ZodEnum<{
17
27
  readonly VERIFIED: "VERIFIED";
18
28
  readonly PENDING: "PENDING";
19
29
  readonly REJECTED: "REJECTED";
20
- }>>;
21
- createdAt: z.ZodCoercedDate<unknown>;
22
- updatedAt: z.ZodCoercedDate<unknown>;
30
+ }>;
31
+ createdAt: z.ZodISODateTime;
32
+ updatedAt: z.ZodISODateTime;
33
+ provider: z.ZodEnum<{
34
+ readonly PAYSTACK: "PAYSTACK";
35
+ readonly STRIPE: "STRIPE";
36
+ readonly NONE: "NONE";
37
+ }>;
38
+ bankName: z.ZodString;
39
+ accountLast4: z.ZodString;
40
+ accountName: z.ZodString;
41
+ externalBankId: z.ZodNullable<z.ZodString>;
42
+ isDefault: z.ZodBoolean;
43
+ id: z.ZodCUID2;
44
+ sellerId: z.ZodCUID2;
45
+ currency: z.ZodString;
23
46
  }, z.core.$strip>;
24
- export type PayoutMethodEntity = z.infer<typeof PayoutMethodEntitySchema>;
25
- export declare const CreatePayoutMethodEntitySchema: z.ZodObject<{
47
+ /**
48
+ * --------------------------------
49
+ * INPUTS
50
+ * --------------------------------
51
+ */
52
+ export declare const CreatePayoutMethodInputSchema: z.ZodObject<{
26
53
  provider: z.ZodEnum<{
27
54
  readonly PAYSTACK: "PAYSTACK";
28
55
  readonly STRIPE: "STRIPE";
@@ -33,35 +60,28 @@ export declare const CreatePayoutMethodEntitySchema: z.ZodObject<{
33
60
  accountName: z.ZodString;
34
61
  isDefault: z.ZodBoolean;
35
62
  }, z.core.$strip>;
36
- export type CreatePayoutMethodInput = z.infer<typeof CreatePayoutMethodEntitySchema>;
37
- export declare const UpdatePayoutMethodEntitySchema: z.ZodObject<{
63
+ export declare const UpdatePayoutMethodInputSchema: z.ZodObject<{
64
+ provider: z.ZodOptional<z.ZodEnum<{
65
+ readonly PAYSTACK: "PAYSTACK";
66
+ readonly STRIPE: "STRIPE";
67
+ readonly NONE: "NONE";
68
+ }>>;
38
69
  bankName: z.ZodOptional<z.ZodString>;
39
70
  accountLast4: z.ZodOptional<z.ZodString>;
40
71
  accountName: z.ZodOptional<z.ZodString>;
41
- isDefault: z.ZodOptional<z.ZodBoolean>;
42
- status: z.ZodOptional<z.ZodEnum<{
43
- readonly VERIFIED: "VERIFIED";
44
- readonly PENDING: "PENDING";
45
- readonly REJECTED: "REJECTED";
46
- }>>;
47
72
  externalBankId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
+ isDefault: z.ZodOptional<z.ZodBoolean>;
48
74
  }, z.core.$strip>;
49
- export type UpdatePayoutMethodInput = z.infer<typeof UpdatePayoutMethodEntitySchema>;
50
- export declare const GetBanksInputSchema: z.ZodObject<{
51
- country: z.ZodDefault<z.ZodString>;
52
- }, z.core.$strip>;
53
- export type GetBanksInput = z.infer<typeof GetBanksInputSchema>;
54
- export declare const VerifyAccountInputSchema: z.ZodObject<{
55
- accountNumber: z.ZodString;
56
- bankCode: z.ZodString;
57
- }, z.core.$strip>;
58
- export type VerifyAccountInput = z.infer<typeof VerifyAccountInputSchema>;
75
+ /**
76
+ * --------------------------------
77
+ * OUTPUTS
78
+ * --------------------------------
79
+ */
59
80
  export declare const VerifyAccountOutputSchema: z.ZodObject<{
60
81
  accountName: z.ZodString;
61
82
  }, z.core.$strip>;
62
- export type VerifyAccountOutput = z.infer<typeof VerifyAccountOutputSchema>;
63
83
  export declare const BankListOutputSchema: z.ZodArray<z.ZodObject<{
64
84
  name: z.ZodString;
65
85
  code: z.ZodString;
66
86
  }, z.core.$strip>>;
67
- export type BankListOutput = z.infer<typeof BankListOutputSchema>;
87
+ export {};
@@ -1,65 +1,55 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BankListOutputSchema = exports.VerifyAccountOutputSchema = exports.VerifyAccountInputSchema = exports.GetBanksInputSchema = exports.UpdatePayoutMethodEntitySchema = exports.CreatePayoutMethodEntitySchema = exports.PayoutMethodEntitySchema = void 0;
7
- const zod_1 = __importDefault(require("zod"));
3
+ exports.BankListOutputSchema = exports.VerifyAccountOutputSchema = exports.UpdatePayoutMethodInputSchema = exports.CreatePayoutMethodInputSchema = exports.PayoutMethodEntitySchema = void 0;
4
+ const zod_openapi_1 = require("@hono/zod-openapi");
8
5
  const constants_1 = require("../constants");
9
- exports.PayoutMethodEntitySchema = zod_1.default.object({
10
- id: zod_1.default.cuid2(),
11
- sellerId: zod_1.default.cuid2(),
12
- provider: zod_1.default.enum(constants_1.GATEWAY_PROVIDER),
13
- currency: zod_1.default.string(),
14
- bankName: zod_1.default.string(),
15
- accountLast4: zod_1.default.string(),
16
- accountName: zod_1.default.string(),
17
- externalBankId: zod_1.default.string().nullable(),
18
- isDefault: zod_1.default.boolean(),
19
- status: zod_1.default.enum(constants_1.PAYMENT_METHOD_STATUS).default(constants_1.PAYMENT_METHOD_STATUS.PENDING),
20
- createdAt: zod_1.default.coerce.date(),
21
- updatedAt: zod_1.default.coerce.date(),
6
+ /**
7
+ * --------------------------------
8
+ * SHAPE
9
+ * --------------------------------
10
+ */
11
+ const PayoutMethodShape = zod_openapi_1.z.object({
12
+ provider: zod_openapi_1.z.enum(constants_1.GATEWAY_PROVIDER),
13
+ bankName: zod_openapi_1.z.string(),
14
+ accountLast4: zod_openapi_1.z.string(),
15
+ accountName: zod_openapi_1.z.string(),
16
+ externalBankId: zod_openapi_1.z.string().nullable(),
17
+ isDefault: zod_openapi_1.z.boolean(),
22
18
  });
23
- exports.CreatePayoutMethodEntitySchema = zod_1.default.object({
24
- provider: zod_1.default.enum(constants_1.GATEWAY_PROVIDER),
25
- bankName: zod_1.default.string(),
26
- accountLast4: zod_1.default.string(),
27
- accountName: zod_1.default.string(),
28
- isDefault: zod_1.default.boolean(),
29
- });
30
- exports.UpdatePayoutMethodEntitySchema = zod_1.default
19
+ /**
20
+ * --------------------------------
21
+ * ENTITY
22
+ * --------------------------------
23
+ */
24
+ exports.PayoutMethodEntitySchema = zod_openapi_1.z
31
25
  .object({
32
- bankName: zod_1.default.string(),
33
- accountLast4: zod_1.default.string(),
34
- accountName: zod_1.default.string(),
35
- isDefault: zod_1.default.boolean(),
36
- status: zod_1.default.enum(constants_1.PAYMENT_METHOD_STATUS),
37
- externalBankId: zod_1.default.string().nullable(),
26
+ id: zod_openapi_1.z.cuid2(),
27
+ sellerId: zod_openapi_1.z.cuid2(),
28
+ currency: zod_openapi_1.z.string(),
29
+ ...PayoutMethodShape.shape,
30
+ status: zod_openapi_1.z.enum(constants_1.PAYMENT_METHOD_STATUS),
31
+ createdAt: zod_openapi_1.z.iso.datetime(),
32
+ updatedAt: zod_openapi_1.z.iso.datetime(),
38
33
  })
39
- .partial();
40
- exports.GetBanksInputSchema = zod_1.default.object({
41
- country: zod_1.default
42
- .string()
43
- .default("nigeria")
44
- .openapi({
45
- param: { in: "query", name: "country" },
46
- example: "nigeria",
47
- }),
34
+ .openapi("PayoutMethod");
35
+ /**
36
+ * --------------------------------
37
+ * INPUTS
38
+ * --------------------------------
39
+ */
40
+ exports.CreatePayoutMethodInputSchema = PayoutMethodShape.omit({
41
+ externalBankId: true,
48
42
  });
49
- exports.VerifyAccountInputSchema = zod_1.default
50
- .object({
51
- accountNumber: zod_1.default.string().length(10, "Account number must be 10 digits"),
52
- bankCode: zod_1.default.string().min(1, "Bank code is required"),
53
- })
54
- .openapi("VerifyAccountInput");
55
- exports.VerifyAccountOutputSchema = zod_1.default
56
- .object({
57
- accountName: zod_1.default.string(),
58
- })
59
- .openapi("VerifyAccountOutput");
60
- exports.BankListOutputSchema = zod_1.default
61
- .array(zod_1.default.object({
62
- name: zod_1.default.string(),
63
- code: zod_1.default.string(),
64
- }))
65
- .openapi("BankListOutput");
43
+ exports.UpdatePayoutMethodInputSchema = PayoutMethodShape.partial();
44
+ /**
45
+ * --------------------------------
46
+ * OUTPUTS
47
+ * --------------------------------
48
+ */
49
+ exports.VerifyAccountOutputSchema = zod_openapi_1.z.object({
50
+ accountName: zod_openapi_1.z.string(),
51
+ });
52
+ exports.BankListOutputSchema = zod_openapi_1.z.array(zod_openapi_1.z.object({
53
+ name: zod_openapi_1.z.string(),
54
+ code: zod_openapi_1.z.string(),
55
+ }));