@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.
Files changed (114) 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 +21 -21
  14. package/dist/schemas/creative.js +3 -3
  15. package/dist/schemas/discipline.d.ts +63 -12
  16. package/dist/schemas/discipline.js +62 -65
  17. package/dist/schemas/entity-stats.d.ts +35 -3
  18. package/dist/schemas/entity-stats.js +24 -38
  19. package/dist/schemas/feed.d.ts +50 -3
  20. package/dist/schemas/feed.js +43 -13
  21. package/dist/schemas/file.d.ts +65 -24
  22. package/dist/schemas/file.js +60 -49
  23. package/dist/schemas/index.d.ts +1 -0
  24. package/dist/schemas/index.js +1 -0
  25. package/dist/schemas/investor-shortlist.d.ts +68 -11
  26. package/dist/schemas/investor-shortlist.js +46 -24
  27. package/dist/schemas/investor-signal.d.ts +52 -12
  28. package/dist/schemas/investor-signal.js +59 -39
  29. package/dist/schemas/investor.d.ts +3 -3
  30. package/dist/schemas/job-application.d.ts +291 -279
  31. package/dist/schemas/job-application.js +59 -95
  32. package/dist/schemas/job.d.ts +200 -659
  33. package/dist/schemas/job.js +98 -231
  34. package/dist/schemas/like.d.ts +3 -0
  35. package/dist/schemas/message.d.ts +125 -94
  36. package/dist/schemas/message.js +54 -55
  37. package/dist/schemas/notification.d.ts +99 -32
  38. package/dist/schemas/notification.js +46 -42
  39. package/dist/schemas/payout-method.d.ts +51 -31
  40. package/dist/schemas/payout-method.js +48 -58
  41. package/dist/schemas/post.d.ts +295 -204
  42. package/dist/schemas/post.js +148 -272
  43. package/dist/schemas/product.d.ts +308 -229
  44. package/dist/schemas/product.js +111 -94
  45. package/dist/schemas/project.d.ts +75 -107
  46. package/dist/schemas/project.js +1 -5
  47. package/dist/schemas/seller.d.ts +10 -10
  48. package/dist/schemas/user-strike.d.ts +3 -0
  49. package/dist/schemas/user.d.ts +128 -126
  50. package/dist/schemas/user.js +10 -1
  51. package/dist/schemas/username.d.ts +1 -0
  52. package/dist/schemas/view.d.ts +1 -0
  53. package/dist/types/activity.d.ts +1 -3
  54. package/dist/types/auth.d.ts +1 -4
  55. package/dist/types/bookmark.d.ts +1 -3
  56. package/dist/types/chat.d.ts +1 -11
  57. package/dist/types/comment.d.ts +1 -5
  58. package/dist/types/common.d.ts +2 -8
  59. package/dist/types/discipline.d.ts +1 -11
  60. package/dist/types/entity-stats.d.ts +1 -3
  61. package/dist/types/feed.d.ts +1 -5
  62. package/dist/types/investor-shortlist.d.ts +1 -6
  63. package/dist/types/investor-signal.d.ts +1 -7
  64. package/dist/types/like.d.ts +1 -3
  65. package/dist/types/message.d.ts +1 -9
  66. package/dist/types/notification.d.ts +1 -9
  67. package/dist/types/user-strike.d.ts +1 -5
  68. package/dist/types/username.d.ts +1 -3
  69. package/package.json +1 -1
  70. package/src/index.ts +4 -5
  71. package/src/schemas/activity.ts +5 -4
  72. package/src/schemas/auth.ts +14 -10
  73. package/src/schemas/bookmark.ts +48 -29
  74. package/src/schemas/chat.ts +79 -18
  75. package/src/schemas/comment.ts +63 -49
  76. package/src/schemas/common.ts +8 -3
  77. package/src/schemas/creative.ts +3 -3
  78. package/src/schemas/discipline.ts +103 -71
  79. package/src/schemas/entity-stats.ts +32 -38
  80. package/src/schemas/feed.ts +62 -15
  81. package/src/schemas/file.ts +85 -58
  82. package/src/schemas/index.ts +1 -0
  83. package/src/schemas/investor-shortlist.ts +57 -8
  84. package/src/schemas/investor-signal.ts +79 -27
  85. package/src/schemas/job-application.ts +81 -115
  86. package/src/schemas/job.ts +160 -301
  87. package/src/schemas/like.ts +5 -1
  88. package/src/schemas/message.ts +71 -64
  89. package/src/schemas/notification.ts +63 -51
  90. package/src/schemas/payout-method.ts +47 -63
  91. package/src/schemas/post.ts +211 -272
  92. package/src/schemas/product.ts +202 -139
  93. package/src/schemas/project.ts +7 -10
  94. package/src/schemas/user-strike.ts +7 -1
  95. package/src/schemas/user.ts +17 -5
  96. package/src/schemas/username.ts +5 -3
  97. package/src/schemas/view.ts +0 -50
  98. package/src/types/activity.ts +0 -4
  99. package/src/types/auth.ts +0 -5
  100. package/src/types/bookmark.ts +0 -4
  101. package/src/types/chat.ts +0 -31
  102. package/src/types/comment.ts +0 -12
  103. package/src/types/common.ts +0 -14
  104. package/src/types/discipline.ts +0 -32
  105. package/src/types/entity-stats.ts +0 -4
  106. package/src/types/feed.ts +0 -10
  107. package/src/types/index.ts +0 -16
  108. package/src/types/investor-shortlist.ts +0 -18
  109. package/src/types/investor-signal.ts +0 -26
  110. package/src/types/like.ts +0 -4
  111. package/src/types/message.ts +0 -26
  112. package/src/types/notification.ts +0 -34
  113. package/src/types/user-strike.ts +0 -10
  114. 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
+ }));