@mohasinac/appkit 2.7.35 → 2.7.37

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 (186) hide show
  1. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +1 -1
  2. package/dist/_internal/client/features/seller/print-center/InventoryLabel.d.ts +12 -0
  3. package/dist/_internal/client/features/seller/print-center/InventoryLabel.js +49 -0
  4. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.d.ts +7 -0
  5. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.js +32 -0
  6. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.d.ts +28 -0
  7. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.js +33 -0
  8. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.d.ts +12 -0
  9. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.js +30 -0
  10. package/dist/_internal/client/features/seller/print-center/PrintCenterView.d.ts +12 -0
  11. package/dist/_internal/client/features/seller/print-center/PrintCenterView.js +102 -0
  12. package/dist/_internal/client/features/seller/print-center/PrintGrid.d.ts +12 -0
  13. package/dist/_internal/client/features/seller/print-center/PrintGrid.js +13 -0
  14. package/dist/_internal/client/features/seller/print-center/StoreCard.d.ts +19 -0
  15. package/dist/_internal/client/features/seller/print-center/StoreCard.js +30 -0
  16. package/dist/_internal/client/features/seller/print-center/WebsiteCard.d.ts +11 -0
  17. package/dist/_internal/client/features/seller/print-center/WebsiteCard.js +25 -0
  18. package/dist/_internal/client/features/seller/print-center/index.d.ts +11 -0
  19. package/dist/_internal/client/features/seller/print-center/index.js +10 -0
  20. package/dist/_internal/client/features/seller/print-center/types.d.ts +20 -0
  21. package/dist/_internal/client/features/seller/print-center/types.js +20 -0
  22. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.d.ts +18 -0
  23. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.js +76 -0
  24. package/dist/_internal/server/features/auctions/og.d.ts +1 -0
  25. package/dist/_internal/server/features/auctions/og.js +2 -1
  26. package/dist/_internal/server/features/blog/og.d.ts +1 -0
  27. package/dist/_internal/server/features/blog/og.js +3 -2
  28. package/dist/_internal/server/features/brands/og.d.ts +1 -0
  29. package/dist/_internal/server/features/brands/og.js +2 -1
  30. package/dist/_internal/server/features/bundles/og.d.ts +1 -0
  31. package/dist/_internal/server/features/bundles/og.js +2 -1
  32. package/dist/_internal/server/features/categories/og.d.ts +1 -0
  33. package/dist/_internal/server/features/categories/og.js +2 -1
  34. package/dist/_internal/server/features/checkout/actions.js +13 -5
  35. package/dist/_internal/server/features/classified/og.d.ts +2 -0
  36. package/dist/_internal/server/features/classified/og.js +2 -1
  37. package/dist/_internal/server/features/digital-code/og.d.ts +2 -0
  38. package/dist/_internal/server/features/digital-code/og.js +2 -1
  39. package/dist/_internal/server/features/events/og.d.ts +1 -0
  40. package/dist/_internal/server/features/events/og.js +3 -1
  41. package/dist/_internal/server/features/live/og.d.ts +2 -0
  42. package/dist/_internal/server/features/live/og.js +2 -1
  43. package/dist/_internal/server/features/pre-orders/og.d.ts +1 -0
  44. package/dist/_internal/server/features/pre-orders/og.js +2 -1
  45. package/dist/_internal/server/features/products/og.d.ts +3 -1
  46. package/dist/_internal/server/features/products/og.js +2 -1
  47. package/dist/_internal/server/features/seo/index.d.ts +1 -1
  48. package/dist/_internal/server/features/seo/index.js +1 -1
  49. package/dist/_internal/server/features/seo/og.d.ts +8 -1
  50. package/dist/_internal/server/features/seo/og.js +28 -8
  51. package/dist/_internal/server/features/stores/og.d.ts +1 -0
  52. package/dist/_internal/server/features/stores/og.js +3 -2
  53. package/dist/_internal/server/features/sublisting-categories/og.d.ts +1 -0
  54. package/dist/_internal/server/features/sublisting-categories/og.js +2 -1
  55. package/dist/_internal/server/jobs/core/draftPrune.d.ts +2 -0
  56. package/dist/_internal/server/jobs/core/draftPrune.js +15 -0
  57. package/dist/_internal/server/jobs/core/onBidPlaced.js +1 -1
  58. package/dist/_internal/server/jobs/core/onScamReportCreate.js +18 -14
  59. package/dist/_internal/server/jobs/core/onScamReportRejected.js +10 -7
  60. package/dist/_internal/server/jobs/core/onScamReportVerified.js +10 -7
  61. package/dist/_internal/server/jobs/core/promotions.d.ts +1 -0
  62. package/dist/_internal/server/jobs/core/promotions.js +21 -6
  63. package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +18 -1
  64. package/dist/_internal/server/jobs/handlers/draftPrune.d.ts +2 -0
  65. package/dist/_internal/server/jobs/handlers/draftPrune.js +2 -0
  66. package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
  67. package/dist/_internal/server/jobs/handlers/index.js +2 -0
  68. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +15 -1
  69. package/dist/_internal/shared/actions/action-registry.js +32 -0
  70. package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
  71. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +10 -10
  72. package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
  73. package/dist/_internal/shared/features/products/schema.d.ts +8 -8
  74. package/dist/_internal/shared/features/promotions/schema.d.ts +6 -6
  75. package/dist/_internal/shared/features/reviews/schema.d.ts +2 -2
  76. package/dist/client.d.ts +13 -1
  77. package/dist/client.js +7 -1
  78. package/dist/configs/next.js +1 -0
  79. package/dist/constants/api-endpoints.d.ts +15 -0
  80. package/dist/constants/api-endpoints.js +5 -0
  81. package/dist/core/server-action.d.ts +4 -0
  82. package/dist/errors/error-codes.d.ts +18 -0
  83. package/dist/errors/error-codes.js +18 -0
  84. package/dist/errors/index.d.ts +1 -1
  85. package/dist/errors/index.js +1 -1
  86. package/dist/errors/messages.d.ts +1 -0
  87. package/dist/errors/messages.js +1 -0
  88. package/dist/features/account/components/UserSidebar.js +1 -1
  89. package/dist/features/account/schemas/index.d.ts +12 -12
  90. package/dist/features/admin/components/AdminBundlesView.js +20 -2
  91. package/dist/features/admin/components/AdminPayoutsView.js +2 -1
  92. package/dist/features/admin/components/AdminProductsView.js +13 -0
  93. package/dist/features/admin/components/AdminSidebar.js +1 -1
  94. package/dist/features/admin/components/AdminStoresView.js +43 -5
  95. package/dist/features/admin/components/AdminUsersView.js +53 -6
  96. package/dist/features/admin/schemas/firestore.d.ts +1 -1
  97. package/dist/features/auctions/actions/bid-actions.js +13 -6
  98. package/dist/features/auctions/components/PlaceBidFormClient.js +10 -2
  99. package/dist/features/auctions/repository/bid.repository.d.ts +7 -0
  100. package/dist/features/auctions/repository/bid.repository.js +16 -0
  101. package/dist/features/auctions/schemas/index.d.ts +18 -18
  102. package/dist/features/auth/schemas/index.d.ts +2 -2
  103. package/dist/features/before-after/schemas/index.d.ts +2 -2
  104. package/dist/features/blog/actions/blog-actions.d.ts +32 -32
  105. package/dist/features/blog/components/BlogPostForm.js +2 -1
  106. package/dist/features/blog/schemas/index.d.ts +38 -38
  107. package/dist/features/categories/components/CategoryForm.js +1 -0
  108. package/dist/features/categories/schemas/index.d.ts +10 -10
  109. package/dist/features/collections/schemas/index.d.ts +4 -4
  110. package/dist/features/consultation/schemas/index.d.ts +9 -9
  111. package/dist/features/corporate/schemas/index.d.ts +4 -4
  112. package/dist/features/events/schemas/index.d.ts +50 -50
  113. package/dist/features/faq/actions/faq-actions.d.ts +6 -6
  114. package/dist/features/faq/schemas/index.d.ts +8 -8
  115. package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
  116. package/dist/features/homepage/components/SectionCarousel.js +1 -8
  117. package/dist/features/layout/AppLayoutShell.js +1 -1
  118. package/dist/features/layout/AutoBreadcrumbs.js +1 -1
  119. package/dist/features/media/AvatarUpload.js +1 -1
  120. package/dist/features/media/types/index.d.ts +4 -4
  121. package/dist/features/media/upload/ImageUpload.js +18 -9
  122. package/dist/features/media/upload/MediaUploadList.js +2 -2
  123. package/dist/features/orders/schemas/firestore.d.ts +6 -0
  124. package/dist/features/orders/schemas/index.d.ts +10 -10
  125. package/dist/features/orders/types/index.d.ts +5 -0
  126. package/dist/features/payments/schemas/index.d.ts +4 -4
  127. package/dist/features/pre-orders/schemas/index.d.ts +8 -8
  128. package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
  129. package/dist/features/products/components/ProductForm.js +20 -2
  130. package/dist/features/products/repository/products.repository.d.ts +3 -1
  131. package/dist/features/products/repository/products.repository.js +12 -1
  132. package/dist/features/products/schemas/firestore.d.ts +7 -0
  133. package/dist/features/products/schemas/index.d.ts +34 -34
  134. package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
  135. package/dist/features/products/types/index.d.ts +6 -0
  136. package/dist/features/promotions/schemas/index.d.ts +14 -14
  137. package/dist/features/reviews/schemas/index.d.ts +18 -18
  138. package/dist/features/seller/actions/offer-actions.js +10 -1
  139. package/dist/features/seller/components/PhysicalLocationModal.d.ts +12 -0
  140. package/dist/features/seller/components/PhysicalLocationModal.js +30 -0
  141. package/dist/features/seller/components/PrintCenterView.d.ts +40 -0
  142. package/dist/features/seller/components/PrintCenterView.js +6 -0
  143. package/dist/features/seller/components/SellerOrdersView.js +48 -3
  144. package/dist/features/seller/components/SellerProductShell.d.ts +1 -0
  145. package/dist/features/seller/components/SellerProductShell.js +26 -4
  146. package/dist/features/seller/components/SellerProductsView.js +54 -13
  147. package/dist/features/seller/components/SellerSidebar.js +1 -1
  148. package/dist/features/seller/components/index.d.ts +1 -0
  149. package/dist/features/seller/components/index.js +1 -0
  150. package/dist/features/seller/schemas/firestore.d.ts +2 -0
  151. package/dist/features/seller/schemas/firestore.js +1 -0
  152. package/dist/features/seller/schemas/index.d.ts +22 -22
  153. package/dist/features/shell/FormShell.js +1 -1
  154. package/dist/features/shell/StepForm.d.ts +3 -1
  155. package/dist/features/shell/StepForm.js +3 -3
  156. package/dist/features/stores/schemas/index.d.ts +4 -4
  157. package/dist/index.d.ts +9 -1
  158. package/dist/index.js +6 -1
  159. package/dist/next/routing/route-map.d.ts +8 -0
  160. package/dist/next/routing/route-map.js +3 -0
  161. package/dist/seed/homepage-sections-seed-data.js +10 -10
  162. package/dist/server.d.ts +1 -1
  163. package/dist/server.js +1 -1
  164. package/dist/tailwind-utilities.css +1 -1
  165. package/dist/ui/components/FormField.js +1 -0
  166. package/dist/ui/components/RowActionMenu.js +45 -10
  167. package/dist/ui/components/SideDrawer.style.css +2 -2
  168. package/dist/ui/forms/FieldCheckbox.d.ts +13 -0
  169. package/dist/ui/forms/FieldCheckbox.js +25 -0
  170. package/dist/ui/forms/FieldInput.d.ts +11 -0
  171. package/dist/ui/forms/FieldInput.js +25 -0
  172. package/dist/ui/forms/FieldSelect.d.ts +17 -0
  173. package/dist/ui/forms/FieldSelect.js +25 -0
  174. package/dist/ui/forms/FormShell.d.ts +48 -0
  175. package/dist/ui/forms/FormShell.js +176 -0
  176. package/dist/ui/forms/FormShell.style.css +287 -0
  177. package/dist/ui/forms/index.d.ts +8 -0
  178. package/dist/ui/forms/index.js +4 -0
  179. package/dist/ui/index.d.ts +9 -0
  180. package/dist/ui/index.js +5 -0
  181. package/dist/utils/action-response.d.ts +6 -0
  182. package/dist/utils/action-response.js +22 -0
  183. package/dist/utils/index.d.ts +1 -0
  184. package/dist/utils/index.js +1 -0
  185. package/dist/validation/schemas.d.ts +10 -10
  186. package/package.json +2 -2
@@ -1,21 +1,24 @@
1
- import { notificationRepository, userRepository } from "../../../../repositories";
1
+ import { userRepository } from "../../../../repositories";
2
+ import { sendNotification } from "../../../../features/admin/actions/notification-actions";
2
3
  import { SCAM_TYPE_LABELS } from "../../../../features/scams/constants/scam-types";
3
4
  export async function handleScamReportCreate(input, ctx) {
4
5
  const { scammerId, report } = input;
5
6
  const { reportedBy, displayNames, scamType, scamPlatform, amountLost } = report;
6
7
  const name = displayNames?.[0] ?? "Unknown";
7
- // 1. Notify the reporter
8
+ // 1. Notify the reporter (multi-channel: respects user notification prefs)
8
9
  if (reportedBy) {
9
10
  try {
10
- await notificationRepository.create({
11
+ const reporter = await userRepository.findById(reportedBy);
12
+ await sendNotification({
11
13
  userId: reportedBy,
12
14
  type: "account_action",
15
+ priority: "normal",
13
16
  title: "Scam report submitted",
14
- body: `Your report for "${name}" has been received. Our team will review it within 48 hours.`,
15
- isRead: false,
16
- entityId: scammerId,
17
- entityType: "scammer",
18
- createdAt: new Date(),
17
+ message: `Your report for "${name}" has been received. Our team will review it within 48 hours.`,
18
+ relatedId: scammerId,
19
+ relatedType: "scammer",
20
+ userEmail: reporter?.email ?? undefined,
21
+ userPhone: reporter?.phoneNumber ?? undefined,
19
22
  });
20
23
  }
21
24
  catch (err) {
@@ -32,15 +35,16 @@ export async function handleScamReportCreate(input, ctx) {
32
35
  const scamTypeLabel = scamType ? (SCAM_TYPE_LABELS[scamType] ?? scamType) : "Unknown";
33
36
  const amountStr = amountLost ? ` ₹${(amountLost / 100).toLocaleString("en-IN")}` : "";
34
37
  const platformStr = scamPlatform ? ` via ${scamPlatform}` : "";
35
- await Promise.all(result.items.map((employee) => notificationRepository.create({
38
+ await Promise.all(result.items.filter((e) => !!e.id).map((employee) => sendNotification({
36
39
  userId: employee.id,
37
40
  type: "account_action",
41
+ priority: "normal",
38
42
  title: "New scam report submitted",
39
- body: `A report was submitted for "${name}" — ${scamTypeLabel}${platformStr}.${amountStr}`,
40
- isRead: false,
41
- entityId: scammerId,
42
- entityType: "scammer",
43
- createdAt: new Date(),
43
+ message: `A report was submitted for "${name}" — ${scamTypeLabel}${platformStr}.${amountStr}`,
44
+ relatedId: scammerId,
45
+ relatedType: "scammer",
46
+ userEmail: employee.email ?? undefined,
47
+ userPhone: employee.phoneNumber ?? undefined,
44
48
  }).catch((err) => ctx.logger.error("Failed to notify employee (non-fatal)", err, { scammerId, employeeId: employee.id }))));
45
49
  }
46
50
  catch (err) {
@@ -1,4 +1,5 @@
1
- import { notificationRepository } from "../../../../repositories";
1
+ import { userRepository } from "../../../../repositories";
2
+ import { sendNotification } from "../../../../features/admin/actions/notification-actions";
2
3
  export async function handleScamReportRejected(input, ctx) {
3
4
  const { scammerId, report } = input;
4
5
  const { reportedBy, displayNames, prevStatus, nextStatus } = report;
@@ -10,15 +11,17 @@ export async function handleScamReportRejected(input, ctx) {
10
11
  return;
11
12
  const name = displayNames?.[0] ?? "Unknown";
12
13
  try {
13
- await notificationRepository.create({
14
+ const reporter = await userRepository.findById(reportedBy);
15
+ await sendNotification({
14
16
  userId: reportedBy,
15
17
  type: "account_action",
18
+ priority: "normal",
16
19
  title: "Scam report not verified",
17
- body: `Your report for "${name}" could not be verified with the evidence provided. You may submit a new report with additional evidence.`,
18
- isRead: false,
19
- entityId: scammerId,
20
- entityType: "scammer",
21
- createdAt: new Date(),
20
+ message: `Your report for "${name}" could not be verified with the evidence provided. You may submit a new report with additional evidence.`,
21
+ relatedId: scammerId,
22
+ relatedType: "scammer",
23
+ userEmail: reporter?.email ?? undefined,
24
+ userPhone: reporter?.phoneNumber ?? undefined,
22
25
  });
23
26
  }
24
27
  catch (err) {
@@ -1,4 +1,5 @@
1
- import { notificationRepository } from "../../../../repositories";
1
+ import { userRepository } from "../../../../repositories";
2
+ import { sendNotification } from "../../../../features/admin/actions/notification-actions";
2
3
  export async function handleScamReportVerified(input, ctx) {
3
4
  const { scammerId, report } = input;
4
5
  const { reportedBy, displayNames, prevStatus, nextStatus } = report;
@@ -10,15 +11,17 @@ export async function handleScamReportVerified(input, ctx) {
10
11
  return;
11
12
  const name = displayNames?.[0] ?? "Unknown";
12
13
  try {
13
- await notificationRepository.create({
14
+ const reporter = await userRepository.findById(reportedBy);
15
+ await sendNotification({
14
16
  userId: reportedBy,
15
17
  type: "account_action",
18
+ priority: "normal",
16
19
  title: "Your scam report was verified",
17
- body: `The report for "${name}" has been verified and published to the Scam Registry. Thank you for helping protect the community.`,
18
- isRead: false,
19
- entityId: scammerId,
20
- entityType: "scammer",
21
- createdAt: new Date(),
20
+ message: `The report for "${name}" has been verified and published to the Scam Registry. Thank you for helping protect the community.`,
21
+ relatedId: scammerId,
22
+ relatedType: "scammer",
23
+ userEmail: reporter?.email ?? undefined,
24
+ userPhone: reporter?.phoneNumber ?? undefined,
22
25
  });
23
26
  }
24
27
  catch (err) {
@@ -3,6 +3,7 @@ export interface PromotionsCallableResult {
3
3
  promotedProducts: unknown[];
4
4
  featuredProducts: unknown[];
5
5
  activeCoupons: unknown[];
6
+ partial?: boolean;
6
7
  }
7
8
  /**
8
9
  * Promotions data — promoted + featured products and active coupons.
@@ -9,7 +9,7 @@ export async function runPromotions(_input, ctx) {
9
9
  ctx.logger.info("Promotions data requested");
10
10
  const now = new Date();
11
11
  const nowIso = now.toISOString();
12
- const [promotedResult, featuredResult, activeCouponsResult] = await Promise.all([
12
+ const [promotedSettled, featuredSettled, couponsSettled] = await Promise.allSettled([
13
13
  productRepository.list({
14
14
  filters: `status==${ProductStatusValues.PUBLISHED},isPromoted==true`,
15
15
  sorts: "-createdAt",
@@ -29,15 +29,30 @@ export async function runPromotions(_input, ctx) {
29
29
  pageSize: "50",
30
30
  }),
31
31
  ]);
32
- const activeCoupons = activeCouponsResult.items.filter((c) => !c.validity?.startDate || new Date(c.validity.startDate) <= now);
32
+ const partial = promotedSettled.status === "rejected" ||
33
+ featuredSettled.status === "rejected" ||
34
+ couponsSettled.status === "rejected";
35
+ if (partial) {
36
+ ctx.logger.warn("Promotions partial load — some queries failed", {
37
+ promoted: promotedSettled.status,
38
+ featured: featuredSettled.status,
39
+ coupons: couponsSettled.status,
40
+ });
41
+ }
42
+ const promotedItems = promotedSettled.status === "fulfilled" ? promotedSettled.value.items : [];
43
+ const featuredItems = featuredSettled.status === "fulfilled" ? featuredSettled.value.items : [];
44
+ const couponsItems = couponsSettled.status === "fulfilled" ? couponsSettled.value.items : [];
45
+ const activeCoupons = couponsItems.filter((c) => !c.validity?.startDate || new Date(c.validity.startDate) <= now);
33
46
  ctx.logger.info("Promotions loaded", {
34
- promoted: promotedResult.items.length,
35
- featured: featuredResult.items.length,
47
+ promoted: promotedItems.length,
48
+ featured: featuredItems.length,
36
49
  coupons: activeCoupons.length,
50
+ partial,
37
51
  });
38
52
  return {
39
- promotedProducts: promotedResult.items,
40
- featuredProducts: featuredResult.items,
53
+ promotedProducts: promotedItems,
54
+ featuredProducts: featuredItems,
41
55
  activeCoupons,
56
+ ...(partial && { partial: true }),
42
57
  };
43
58
  }
@@ -1,2 +1,19 @@
1
1
  import { runAssignSpinPrize, } from "../core/assignSpinPrize";
2
- export const assignSpinPrizeHandler = runAssignSpinPrize;
2
+ function httpError(message, status) {
3
+ const err = new Error(message);
4
+ err.httpStatus = status;
5
+ return err;
6
+ }
7
+ export const assignSpinPrizeHandler = async (input, ctx) => {
8
+ const result = await runAssignSpinPrize(input, ctx);
9
+ if (result.reason === "event_not_found") {
10
+ throw httpError("Event not found", 404);
11
+ }
12
+ if (result.reason === "entry_not_found") {
13
+ throw httpError("No event entry found for this user", 404);
14
+ }
15
+ if (result.reason === "no_prizes_configured") {
16
+ throw httpError("No spin prizes configured for this event", 422);
17
+ }
18
+ return result;
19
+ };
@@ -0,0 +1,2 @@
1
+ import type { ScheduleHandler } from "../runtime/types";
2
+ export declare const draftPruneHandler: ScheduleHandler;
@@ -0,0 +1,2 @@
1
+ import { runDraftPrune } from "../core/draftPrune";
2
+ export const draftPruneHandler = runDraftPrune;
@@ -46,3 +46,4 @@ export { onSupportTicketUpdateHandler } from "./onSupportTicketUpdate";
46
46
  export { onUserBanChangeHandler } from "./onUserBanChange";
47
47
  export { onScamReportCreateHandler } from "./onScamReportCreate";
48
48
  export { onScamReportUpdateHandler } from "./onScamReportUpdate";
49
+ export { draftPruneHandler } from "./draftPrune";
@@ -53,3 +53,5 @@ export { onUserBanChangeHandler } from "./onUserBanChange";
53
53
  // SCAM8 — scam report notifications
54
54
  export { onScamReportCreateHandler } from "./onScamReportCreate";
55
55
  export { onScamReportUpdateHandler } from "./onScamReportUpdate";
56
+ // SB-UNI-Y-1 — 30-day draft prune
57
+ export { draftPruneHandler } from "./draftPrune";
@@ -1,2 +1,16 @@
1
1
  import { runTriggerEventRaffle, } from "../core/triggerEventRaffle";
2
- export const triggerEventRaffleHandler = runTriggerEventRaffle;
2
+ function httpError(message, status) {
3
+ const err = new Error(message);
4
+ err.httpStatus = status;
5
+ return err;
6
+ }
7
+ export const triggerEventRaffleHandler = async (input, ctx) => {
8
+ const result = await runTriggerEventRaffle(input, ctx);
9
+ if (result.reason === "event_not_found") {
10
+ throw httpError("Event not found", 404);
11
+ }
12
+ if (result.reason === "no_eligible_entries") {
13
+ throw httpError("No eligible entries for raffle", 422);
14
+ }
15
+ return result;
16
+ };
@@ -305,6 +305,38 @@ export const ACTIONS = {
305
305
  kind: "primary",
306
306
  permissions: ["seller", "admin"],
307
307
  },
308
+ "print-labels": {
309
+ id: "store.print-labels",
310
+ label: "Print Labels",
311
+ ariaLabel: "Print inventory labels for selected products",
312
+ description: "Open the print page for inventory labels for the selected products.",
313
+ kind: "secondary",
314
+ permissions: ["seller", "admin"],
315
+ },
316
+ "set-location": {
317
+ id: "store.set-location",
318
+ label: "Set Location",
319
+ ariaLabel: "Set physical storage location for selected items",
320
+ description: "Assign zone, shelf, and bin for the selected inventory items.",
321
+ kind: "ghost",
322
+ permissions: ["seller", "admin"],
323
+ },
324
+ "print-packing-slips": {
325
+ id: "store.print-packing-slips",
326
+ label: "Print Packing Slips",
327
+ ariaLabel: "Print packing slips for selected orders",
328
+ description: "Open the print page for packing slip labels for the selected orders.",
329
+ kind: "secondary",
330
+ permissions: ["seller", "admin"],
331
+ },
332
+ "open-print-center": {
333
+ id: "store.open-print-center",
334
+ label: "Print Center",
335
+ ariaLabel: "Open the Print & Label Center",
336
+ description: "Open the Print & Label Center for this store.",
337
+ kind: "ghost",
338
+ permissions: ["seller", "admin"],
339
+ },
308
340
  },
309
341
  BLOG: {},
310
342
  EVENT: {
@@ -14,11 +14,11 @@ export declare const blogPostInputSchema: z.ZodObject<{
14
14
  metaDescription: z.ZodOptional<z.ZodString>;
15
15
  }, "strip", z.ZodTypeAny, {
16
16
  status: "draft" | "published";
17
- title: string;
18
- content: string;
19
17
  category: string;
18
+ title: string;
20
19
  slug: string;
21
20
  tags: string[];
21
+ content: string;
22
22
  isFeatured: boolean;
23
23
  youtubeId?: string | undefined;
24
24
  coverImage?: string | undefined;
@@ -26,10 +26,10 @@ export declare const blogPostInputSchema: z.ZodObject<{
26
26
  metaTitle?: string | undefined;
27
27
  metaDescription?: string | undefined;
28
28
  }, {
29
- title: string;
30
- content: string;
31
29
  category: string;
30
+ title: string;
32
31
  slug: string;
32
+ content: string;
33
33
  status?: "draft" | "published" | undefined;
34
34
  youtubeId?: string | undefined;
35
35
  tags?: string[] | undefined;
@@ -54,11 +54,11 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
54
54
  metaDescription: z.ZodOptional<z.ZodOptional<z.ZodString>>;
55
55
  }, "slug">, "strip", z.ZodTypeAny, {
56
56
  status?: "draft" | "published" | undefined;
57
- title?: string | undefined;
58
- content?: string | undefined;
59
57
  youtubeId?: string | undefined;
60
58
  category?: string | undefined;
59
+ title?: string | undefined;
61
60
  tags?: string[] | undefined;
61
+ content?: string | undefined;
62
62
  isFeatured?: boolean | undefined;
63
63
  coverImage?: string | undefined;
64
64
  excerpt?: string | undefined;
@@ -66,11 +66,11 @@ export declare const blogPostUpdateSchema: z.ZodObject<Omit<{
66
66
  metaDescription?: string | undefined;
67
67
  }, {
68
68
  status?: "draft" | "published" | undefined;
69
- title?: string | undefined;
70
- content?: string | undefined;
71
69
  youtubeId?: string | undefined;
72
70
  category?: string | undefined;
71
+ title?: string | undefined;
73
72
  tags?: string[] | undefined;
73
+ content?: string | undefined;
74
74
  isFeatured?: boolean | undefined;
75
75
  coverImage?: string | undefined;
76
76
  excerpt?: string | undefined;
@@ -39,23 +39,23 @@ export declare const bundleQueryRuleSchema: z.ZodDiscriminatedUnion<"type", [z.Z
39
39
  orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
40
40
  limit: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
+ type: "dynamic";
42
43
  filter: {
43
44
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
44
45
  brandSlug?: string | undefined;
45
46
  tags?: string[] | undefined;
46
47
  categorySlug?: string | undefined;
47
48
  };
48
- type: "dynamic";
49
49
  limit: number;
50
50
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
51
51
  }, {
52
+ type: "dynamic";
52
53
  filter: {
53
54
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
54
55
  brandSlug?: string | undefined;
55
56
  tags?: string[] | undefined;
56
57
  categorySlug?: string | undefined;
57
58
  };
58
- type: "dynamic";
59
59
  limit: number;
60
60
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
61
61
  }>]>;
@@ -113,23 +113,23 @@ export declare const bundleCreateSchema: z.ZodObject<{
113
113
  orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
114
114
  limit: z.ZodNumber;
115
115
  }, "strip", z.ZodTypeAny, {
116
+ type: "dynamic";
116
117
  filter: {
117
118
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
118
119
  brandSlug?: string | undefined;
119
120
  tags?: string[] | undefined;
120
121
  categorySlug?: string | undefined;
121
122
  };
122
- type: "dynamic";
123
123
  limit: number;
124
124
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
125
125
  }, {
126
+ type: "dynamic";
126
127
  filter: {
127
128
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
128
129
  brandSlug?: string | undefined;
129
130
  tags?: string[] | undefined;
130
131
  categorySlug?: string | undefined;
131
132
  };
132
- type: "dynamic";
133
133
  limit: number;
134
134
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
135
135
  }>]>;
@@ -168,13 +168,13 @@ export declare const bundleCreateSchema: z.ZodObject<{
168
168
  type: "static";
169
169
  productIds: string[];
170
170
  } | {
171
+ type: "dynamic";
171
172
  filter: {
172
173
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
173
174
  brandSlug?: string | undefined;
174
175
  tags?: string[] | undefined;
175
176
  categorySlug?: string | undefined;
176
177
  };
177
- type: "dynamic";
178
178
  limit: number;
179
179
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
180
180
  };
@@ -199,13 +199,13 @@ export declare const bundleCreateSchema: z.ZodObject<{
199
199
  type: "static";
200
200
  productIds: string[];
201
201
  } | {
202
+ type: "dynamic";
202
203
  filter: {
203
204
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
204
205
  brandSlug?: string | undefined;
205
206
  tags?: string[] | undefined;
206
207
  categorySlug?: string | undefined;
207
208
  };
208
- type: "dynamic";
209
209
  limit: number;
210
210
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
211
211
  };
@@ -258,23 +258,23 @@ export declare const bundleUpdateSchema: z.ZodObject<{
258
258
  orderBy: z.ZodOptional<z.ZodEnum<["price-asc", "price-desc", "createdAt-desc"]>>;
259
259
  limit: z.ZodNumber;
260
260
  }, "strip", z.ZodTypeAny, {
261
+ type: "dynamic";
261
262
  filter: {
262
263
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
263
264
  brandSlug?: string | undefined;
264
265
  tags?: string[] | undefined;
265
266
  categorySlug?: string | undefined;
266
267
  };
267
- type: "dynamic";
268
268
  limit: number;
269
269
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
270
270
  }, {
271
+ type: "dynamic";
271
272
  filter: {
272
273
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
273
274
  brandSlug?: string | undefined;
274
275
  tags?: string[] | undefined;
275
276
  categorySlug?: string | undefined;
276
277
  };
277
- type: "dynamic";
278
278
  limit: number;
279
279
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
280
280
  }>]>>;
@@ -319,13 +319,13 @@ export declare const bundleUpdateSchema: z.ZodObject<{
319
319
  type: "static";
320
320
  productIds: string[];
321
321
  } | {
322
+ type: "dynamic";
322
323
  filter: {
323
324
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
324
325
  brandSlug?: string | undefined;
325
326
  tags?: string[] | undefined;
326
327
  categorySlug?: string | undefined;
327
328
  };
328
- type: "dynamic";
329
329
  limit: number;
330
330
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
331
331
  } | undefined;
@@ -349,13 +349,13 @@ export declare const bundleUpdateSchema: z.ZodObject<{
349
349
  type: "static";
350
350
  productIds: string[];
351
351
  } | {
352
+ type: "dynamic";
352
353
  filter: {
353
354
  listingType?: "standard" | "pre-order" | "prize-draw" | undefined;
354
355
  brandSlug?: string | undefined;
355
356
  tags?: string[] | undefined;
356
357
  categorySlug?: string | undefined;
357
358
  };
358
- type: "dynamic";
359
359
  limit: number;
360
360
  orderBy?: "price-asc" | "price-desc" | "createdAt-desc" | undefined;
361
361
  } | undefined;
@@ -27,17 +27,17 @@ export declare const createOrderSchema: z.ZodObject<{
27
27
  phone: string;
28
28
  state: string;
29
29
  city: string;
30
- pincode: string;
31
- fullName: string;
32
30
  addressLine1: string;
31
+ fullName: string;
32
+ pincode: string;
33
33
  addressLine2?: string | undefined;
34
34
  }, {
35
35
  phone: string;
36
36
  state: string;
37
37
  city: string;
38
- pincode: string;
39
- fullName: string;
40
38
  addressLine1: string;
39
+ fullName: string;
40
+ pincode: string;
41
41
  country?: string | undefined;
42
42
  addressLine2?: string | undefined;
43
43
  }>;
@@ -55,9 +55,9 @@ export declare const createOrderSchema: z.ZodObject<{
55
55
  phone: string;
56
56
  state: string;
57
57
  city: string;
58
- pincode: string;
59
- fullName: string;
60
58
  addressLine1: string;
59
+ fullName: string;
60
+ pincode: string;
61
61
  addressLine2?: string | undefined;
62
62
  };
63
63
  couponCode?: string | undefined;
@@ -72,9 +72,9 @@ export declare const createOrderSchema: z.ZodObject<{
72
72
  phone: string;
73
73
  state: string;
74
74
  city: string;
75
- pincode: string;
76
- fullName: string;
77
75
  addressLine1: string;
76
+ fullName: string;
77
+ pincode: string;
78
78
  country?: string | undefined;
79
79
  addressLine2?: string | undefined;
80
80
  };
@@ -25,8 +25,8 @@ export declare const productInputSchema: z.ZodObject<{
25
25
  features: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  currency: string;
28
- title: string;
29
28
  category: string;
29
+ title: string;
30
30
  price: number;
31
31
  stockQuantity: number;
32
32
  availableQuantity: number;
@@ -48,8 +48,8 @@ export declare const productInputSchema: z.ZodObject<{
48
48
  allowOffers?: boolean | undefined;
49
49
  minOfferPercent?: number | undefined;
50
50
  }, {
51
- title: string;
52
51
  category: string;
52
+ title: string;
53
53
  price: number;
54
54
  mainImage: string;
55
55
  currency?: string | undefined;
@@ -98,8 +98,8 @@ export declare const productUpdateSchema: z.ZodObject<{
98
98
  features: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
99
99
  }, "strip", z.ZodTypeAny, {
100
100
  currency?: string | undefined;
101
- title?: string | undefined;
102
101
  category?: string | undefined;
102
+ title?: string | undefined;
103
103
  description?: string | undefined;
104
104
  seoTitle?: string | undefined;
105
105
  seoDescription?: string | undefined;
@@ -122,8 +122,8 @@ export declare const productUpdateSchema: z.ZodObject<{
122
122
  minOfferPercent?: number | undefined;
123
123
  }, {
124
124
  currency?: string | undefined;
125
- title?: string | undefined;
126
125
  category?: string | undefined;
126
+ title?: string | undefined;
127
127
  description?: string | undefined;
128
128
  seoTitle?: string | undefined;
129
129
  seoDescription?: string | undefined;
@@ -181,9 +181,9 @@ export declare const auctionInputSchema: z.ZodObject<{
181
181
  auctionShippingPaidBy: z.ZodOptional<z.ZodEnum<["seller", "winner"]>>;
182
182
  }, "strip", z.ZodTypeAny, {
183
183
  currency: string;
184
- title: string;
185
184
  category: string;
186
185
  listingType: "auction";
186
+ title: string;
187
187
  price: number;
188
188
  stockQuantity: number;
189
189
  availableQuantity: number;
@@ -213,9 +213,9 @@ export declare const auctionInputSchema: z.ZodObject<{
213
213
  allowOffers?: boolean | undefined;
214
214
  minOfferPercent?: number | undefined;
215
215
  }, {
216
- title: string;
217
216
  category: string;
218
217
  listingType: "auction";
218
+ title: string;
219
219
  price: number;
220
220
  mainImage: string;
221
221
  auctionEndDate: string;
@@ -279,9 +279,9 @@ export declare const preOrderInputSchema: z.ZodObject<{
279
279
  preOrderCancellable: z.ZodDefault<z.ZodBoolean>;
280
280
  }, "strip", z.ZodTypeAny, {
281
281
  currency: string;
282
- title: string;
283
282
  category: string;
284
283
  listingType: "pre-order";
284
+ title: string;
285
285
  price: number;
286
286
  stockQuantity: number;
287
287
  availableQuantity: number;
@@ -308,9 +308,9 @@ export declare const preOrderInputSchema: z.ZodObject<{
308
308
  allowOffers?: boolean | undefined;
309
309
  minOfferPercent?: number | undefined;
310
310
  }, {
311
- title: string;
312
311
  category: string;
313
312
  listingType: "pre-order";
313
+ title: string;
314
314
  price: number;
315
315
  mainImage: string;
316
316
  preOrderDeliveryDate: string;
@@ -77,10 +77,10 @@ export declare const createCouponSchema: z.ZodObject<{
77
77
  applicableCategories?: string[] | undefined;
78
78
  }>>;
79
79
  }, "strip", z.ZodTypeAny, {
80
- code: string;
81
80
  type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
82
- scope: "seller" | "admin";
81
+ code: string;
83
82
  name: string;
83
+ scope: "seller" | "admin";
84
84
  discount: {
85
85
  value: number;
86
86
  minPurchase: number;
@@ -103,10 +103,10 @@ export declare const createCouponSchema: z.ZodObject<{
103
103
  applicableCategories?: string[] | undefined;
104
104
  } | undefined;
105
105
  }, {
106
- code: string;
107
106
  type: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y";
108
- scope: "seller" | "admin";
107
+ code: string;
109
108
  name: string;
109
+ scope: "seller" | "admin";
110
110
  discount: {
111
111
  value: number;
112
112
  maxDiscount?: number | undefined;
@@ -189,8 +189,8 @@ export declare const updateCouponSchema: z.ZodObject<Omit<{
189
189
  }>>>;
190
190
  }, "code">, "strip", z.ZodTypeAny, {
191
191
  type?: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y" | undefined;
192
- scope?: "seller" | "admin" | undefined;
193
192
  name?: string | undefined;
193
+ scope?: "seller" | "admin" | undefined;
194
194
  sellerId?: string | undefined;
195
195
  discount?: {
196
196
  value: number;
@@ -214,8 +214,8 @@ export declare const updateCouponSchema: z.ZodObject<Omit<{
214
214
  } | undefined;
215
215
  }, {
216
216
  type?: "fixed" | "percentage" | "free_shipping" | "buy_x_get_y" | undefined;
217
- scope?: "seller" | "admin" | undefined;
218
217
  name?: string | undefined;
218
+ scope?: "seller" | "admin" | undefined;
219
219
  sellerId?: string | undefined;
220
220
  discount?: {
221
221
  value: number;
@@ -10,8 +10,8 @@ export declare const createReviewSchema: z.ZodObject<{
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  storeId: string;
12
12
  title: string;
13
- body: string;
14
13
  images: string[];
14
+ body: string;
15
15
  productId: string;
16
16
  rating: number;
17
17
  orderId?: string | undefined;
@@ -21,8 +21,8 @@ export declare const createReviewSchema: z.ZodObject<{
21
21
  body: string;
22
22
  productId: string;
23
23
  rating: number;
24
- orderId?: string | undefined;
25
24
  images?: string[] | undefined;
25
+ orderId?: string | undefined;
26
26
  }>;
27
27
  export declare const replyToReviewSchema: z.ZodObject<{
28
28
  reviewId: z.ZodString;