@timardex/cluemart-shared 1.2.32 → 1.2.34

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 (42) hide show
  1. package/dist/{ad-Cv1V8lgJ.d.ts → ad-BZylIpez.d.ts} +1 -1
  2. package/dist/{ad-IVwm5MLY.d.mts → ad-CiYcsJB7.d.mts} +1 -1
  3. package/dist/{auth-BCxQp_CF.d.ts → auth-CmaB99NK.d.ts} +1 -1
  4. package/dist/{auth-BczaOu28.d.mts → auth-DDtMJHZw.d.mts} +1 -1
  5. package/dist/formFields/index.cjs +0 -7
  6. package/dist/formFields/index.cjs.map +1 -1
  7. package/dist/formFields/index.d.mts +1 -1
  8. package/dist/formFields/index.d.ts +1 -1
  9. package/dist/formFields/index.mjs +0 -7
  10. package/dist/formFields/index.mjs.map +1 -1
  11. package/dist/{global-Bnr6l_NH.d.ts → global-DVYSZ6LR.d.ts} +4 -4
  12. package/dist/{global-_89-F0iL.d.mts → global-ExJZRDGR.d.mts} +4 -4
  13. package/dist/graphql/index.d.mts +2 -2
  14. package/dist/graphql/index.d.ts +2 -2
  15. package/dist/hooks/index.cjs +1 -0
  16. package/dist/hooks/index.cjs.map +1 -1
  17. package/dist/hooks/index.d.mts +3 -3
  18. package/dist/hooks/index.d.ts +3 -3
  19. package/dist/hooks/index.mjs +1 -0
  20. package/dist/hooks/index.mjs.map +1 -1
  21. package/dist/index.cjs +13 -48
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.mts +6 -13
  24. package/dist/index.d.ts +6 -13
  25. package/dist/index.mjs +11 -45
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/mongoose/index.cjs.map +1 -1
  28. package/dist/mongoose/index.d.mts +3 -3
  29. package/dist/mongoose/index.d.ts +3 -3
  30. package/dist/mongoose/index.mjs +4 -4
  31. package/dist/mongoose/index.mjs.map +1 -1
  32. package/dist/service/index.cjs +17 -49
  33. package/dist/service/index.cjs.map +1 -1
  34. package/dist/service/index.d.mts +4 -11
  35. package/dist/service/index.d.ts +4 -11
  36. package/dist/service/index.mjs +10 -40
  37. package/dist/service/index.mjs.map +1 -1
  38. package/dist/types/index.d.mts +3 -3
  39. package/dist/types/index.d.ts +3 -3
  40. package/dist/utils/index.d.mts +1 -1
  41. package/dist/utils/index.d.ts +1 -1
  42. package/package.json +1 -1
@@ -2,8 +2,6 @@ import {
2
2
  NotificationModel,
3
3
  PushTokenModel
4
4
  } from "../chunk-NPHPFWQH.mjs";
5
- import "../chunk-4OLDTZXH.mjs";
6
- import "../chunk-XXZPSRMS.mjs";
7
5
  import "../chunk-NNS747QT.mjs";
8
6
 
9
7
  // src/service/database.ts
@@ -53,32 +51,8 @@ var connectToDatabase = async ({
53
51
  }
54
52
  };
55
53
 
56
- // src/service/notificationService.ts
57
- async function publishNotificationEvents(userId, context) {
58
- try {
59
- const userNotifications = await NotificationModel.find({
60
- userId
61
- }).sort({ createdAt: -1 });
62
- const [total, unread] = await Promise.all([
63
- NotificationModel.countDocuments({ userId }),
64
- NotificationModel.countDocuments({ isRead: false, userId })
65
- ]);
66
- context.pubsub.publish("GET_NOTIFICATIONS" /* GET_NOTIFICATIONS */, {
67
- getNotifications: userNotifications,
68
- getNotificationsUserId: userId
69
- });
70
- context.pubsub.publish("GET_NOTIFICATIONS_COUNT" /* GET_NOTIFICATIONS_COUNT */, {
71
- getNotificationsCount: { total, unread, userId }
72
- });
73
- console.log(`Published notification events for user: ${String(userId)}`);
74
- } catch (error) {
75
- console.error(
76
- `Failed to publish notification events for user ${String(userId)}:`,
77
- error
78
- );
79
- }
80
- }
81
- async function createNotifications(payload, context) {
54
+ // src/service/saveNotificationsInDb.ts
55
+ async function saveNotificationsInDb(payload) {
82
56
  const { data, message, title, type, userIds } = payload;
83
57
  try {
84
58
  const notifications = userIds.map((userId) => ({
@@ -89,22 +63,18 @@ async function createNotifications(payload, context) {
89
63
  type,
90
64
  userId
91
65
  }));
92
- const savedNotifications = await NotificationModel.insertMany(notifications);
66
+ await NotificationModel.insertMany(notifications);
93
67
  console.log(
94
- `Created ${savedNotifications.length} notifications for ${userIds.length} users`
68
+ `Created ${notifications.length} notifications for ${userIds.length} users`
95
69
  );
96
- const uniqueUserIds = [...new Set(userIds)];
97
- for (const userId of uniqueUserIds) {
98
- await publishNotificationEvents(userId, context);
99
- }
100
- return savedNotifications;
70
+ return [...new Set(userIds)];
101
71
  } catch (error) {
102
72
  console.error("Failed to create notifications:", error);
103
73
  return [];
104
74
  }
105
75
  }
106
76
 
107
- // src/service/sendPushNotification.ts
77
+ // src/service/sendPushNotifications.ts
108
78
  import { Expo } from "expo-server-sdk";
109
79
  var expo = new Expo();
110
80
  function extractTokensFromMessage(message) {
@@ -172,7 +142,7 @@ async function sendChunk(chunk, chunkIndex) {
172
142
  return { failedTokens: [], successCount: 0 };
173
143
  }
174
144
  }
175
- async function sendPushNotification({
145
+ async function sendPushNotifications({
176
146
  data,
177
147
  message,
178
148
  title,
@@ -180,6 +150,7 @@ async function sendPushNotification({
180
150
  }) {
181
151
  const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });
182
152
  const expoTokens = pushTokens.map((token) => token.token);
153
+ if (!data) return;
183
154
  const { messages, invalidTokens } = createPushMessages({
184
155
  data,
185
156
  message,
@@ -213,8 +184,7 @@ async function sendPushNotification({
213
184
  }
214
185
  export {
215
186
  connectToDatabase,
216
- createNotifications,
217
- publishNotificationEvents,
218
- sendPushNotification
187
+ saveNotificationsInDb,
188
+ sendPushNotifications
219
189
  };
220
190
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/service/database.ts","../../src/service/timezonePlugin.ts","../../src/service/notificationService.ts","../../src/service/sendPushNotification.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { timezonePlugin } from \"./timezonePlugin\";\n\nmongoose.plugin(timezonePlugin); // applies to all schemas\n\n/**\n * Connect to MongoDB using Mongoose.\n * Supports both local MongoDB (via MONGODB_URI) and MongoDB Atlas (via individual env vars).\n */\nexport const connectToDatabase = async ({\n appName,\n dbName,\n dbPassword,\n dbUser,\n mongodbUri,\n}: {\n appName: string;\n dbName: string;\n dbPassword: string;\n dbUser: string;\n mongodbUri: string;\n}) => {\n try {\n // Check if MONGODB_URI is provided (for local Docker MongoDB)\n const mongoUri = mongodbUri\n ? mongodbUri\n : // Fallback to MongoDB Atlas connection string\n `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`;\n\n await mongoose.connect(mongoUri);\n\n const connectionType = mongodbUri ? \"Local MongoDB\" : \"MongoDB Atlas\";\n console.log(\n `${connectionType} connected from server/src/service/database.ts`,\n );\n } catch (err) {\n console.error(\"Error connecting to MongoDB:\", err);\n throw err; // You can throw the error if you want to stop the server in case of connection failure\n }\n};\n","import dayjs from \"dayjs\";\nimport timezone from \"dayjs/plugin/timezone\";\nimport utc from \"dayjs/plugin/utc\";\nimport { Schema } from \"mongoose\";\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nexport function timezonePlugin(schema: Schema) {\n if (!schema.get(\"timestamps\")) return;\n\n const transform = (_doc: any, ret: any) => {\n if (ret.createdAt)\n ret.createdAt = dayjs(ret.createdAt).tz(\"Pacific/Auckland\").format(); // ISO with +13:00 or +12:00 offset\n if (ret.updatedAt)\n ret.updatedAt = dayjs(ret.updatedAt).tz(\"Pacific/Auckland\").format();\n return ret;\n };\n\n schema.set(\"toJSON\", { transform });\n schema.set(\"toObject\", { transform });\n}\n","import {\n SchemaCreateBulkNotificationInput,\n SchemaNotificationType,\n NotificationModel,\n} from \"src/mongoose/Notification\";\nimport { EnumPubSubEvents, GraphQLContext, ObjectId } from \"src/types\";\n\n// Helper function to publish notification subscription events\nexport async function publishNotificationEvents(\n userId: ObjectId,\n context: GraphQLContext,\n) {\n try {\n // Get user's notifications for the subscription\n const userNotifications = await NotificationModel.find({\n userId,\n }).sort({ createdAt: -1 });\n\n // Get notification count\n const [total, unread] = await Promise.all([\n NotificationModel.countDocuments({ userId }),\n NotificationModel.countDocuments({ isRead: false, userId }),\n ]);\n\n // Publish both events\n context.pubsub.publish(EnumPubSubEvents.GET_NOTIFICATIONS, {\n getNotifications: userNotifications,\n getNotificationsUserId: userId,\n });\n\n context.pubsub.publish(EnumPubSubEvents.GET_NOTIFICATIONS_COUNT, {\n getNotificationsCount: { total, unread, userId },\n });\n\n console.log(`Published notification events for user: ${String(userId)}`);\n } catch (error) {\n console.error(\n `Failed to publish notification events for user ${String(userId)}:`,\n error,\n );\n }\n}\n\n/**\n * Create notifications in the database for multiple users\n * This is typically called when sending push notifications\n */\nexport async function createNotifications(\n payload: SchemaCreateBulkNotificationInput,\n context: GraphQLContext,\n): Promise<SchemaNotificationType[]> {\n const { data, message, title, type, userIds } = payload;\n try {\n const notifications = userIds.map((userId) => ({\n data,\n isRead: false,\n message,\n title,\n type,\n userId,\n }));\n\n // Save notifications to database\n const savedNotifications =\n await NotificationModel.insertMany(notifications);\n console.log(\n `Created ${savedNotifications.length} notifications for ${userIds.length} users`,\n );\n\n const uniqueUserIds = [...new Set(userIds)];\n for (const userId of uniqueUserIds) {\n await publishNotificationEvents(userId, context);\n }\n\n return savedNotifications;\n } catch (error) {\n console.error(\"Failed to create notifications:\", error);\n return [];\n //throw new Error(`Failed to create notifications: ${error}`);\n }\n}\n","import { Expo, ExpoPushMessage, ExpoPushTicket } from \"expo-server-sdk\";\n\nimport { PushTokenModel } from \"src/mongoose/PushToken\";\nimport { NotificationDataType, ObjectId } from \"src/types\";\n\nconst expo = new Expo();\n\n/**\n * Safely extract tokens from ExpoPushMessage handling both string and array cases\n */\nfunction extractTokensFromMessage(message: ExpoPushMessage): string[] {\n return Array.isArray(message.to) ? message.to : [message.to];\n}\n\ninterface CreatePushMessagesOptions {\n tokens: string[];\n message: string;\n title: string;\n data: NotificationDataType;\n}\n\n/**\n * Create push messages from valid tokens\n */\nfunction createPushMessages({\n tokens,\n message,\n title,\n data,\n}: CreatePushMessagesOptions): {\n messages: ExpoPushMessage[];\n invalidTokens: string[];\n} {\n const messages: ExpoPushMessage[] = [];\n const invalidTokens: string[] = [];\n\n for (const token of tokens) {\n if (!Expo.isExpoPushToken(token)) {\n invalidTokens.push(token);\n continue;\n }\n\n messages.push({\n body: message,\n data: { ...data },\n sound: \"default\",\n title,\n to: token,\n });\n }\n\n return { invalidTokens, messages };\n}\n\n/**\n * Process chunk results and extract failed tokens\n */\nfunction processChunkResults(\n tickets: ExpoPushTicket[],\n chunk: ExpoPushMessage[],\n): { successCount: number; failedTokens: string[] } {\n let successCount = 0;\n const failedTokens: string[] = [];\n\n for (const [ticketIndex, ticket] of tickets.entries()) {\n if (ticket.status === \"error\") {\n const message = chunk[ticketIndex];\n if (message) {\n const tokens = extractTokensFromMessage(message);\n if (ticket.details?.error === \"DeviceNotRegistered\") {\n failedTokens.push(...tokens);\n }\n console.log(\"Push notification error\", {\n error: ticket.details?.error,\n tokens,\n });\n }\n } else {\n successCount++;\n }\n }\n\n return { failedTokens, successCount };\n}\n\n/**\n * Send a single chunk of push notifications\n */\nasync function sendChunk(\n chunk: ExpoPushMessage[],\n chunkIndex: number,\n): Promise<{ successCount: number; failedTokens: string[] }> {\n try {\n const tickets = await expo.sendPushNotificationsAsync(chunk);\n const { successCount, failedTokens } = processChunkResults(tickets, chunk);\n\n console.log(\n `Chunk ${chunkIndex + 1}: Sent ${successCount}/${chunk.length} notifications successfully`,\n );\n\n return { failedTokens, successCount };\n } catch (error) {\n console.log(\"Error sending Expo push notification chunk\", {\n chunkIndex,\n chunkSize: chunk.length,\n error: error instanceof Error ? error.message : String(error),\n });\n return { failedTokens: [], successCount: 0 };\n }\n}\n\ninterface SendPushNotificationOptions {\n data: NotificationDataType;\n message: string;\n title: string;\n userIds: ObjectId[];\n}\n\nexport async function sendPushNotification({\n data,\n message,\n title,\n userIds,\n}: SendPushNotificationOptions) {\n const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });\n const expoTokens = pushTokens.map((token) => token.token);\n\n const { messages, invalidTokens } = createPushMessages({\n data,\n message,\n title,\n tokens: expoTokens,\n });\n\n // Log invalid tokens\n if (invalidTokens.length > 0) {\n console.log(`Found ${invalidTokens.length} invalid push tokens`);\n }\n\n if (messages.length === 0) {\n console.log(\"No valid messages to send after filtering tokens\");\n return;\n }\n\n // Send notifications in chunks\n const chunks = expo.chunkPushNotifications(messages);\n let totalSuccessCount = 0;\n const allFailedTokens: string[] = [];\n\n for (const [chunkIndex, chunk] of chunks.entries()) {\n const { successCount, failedTokens } = await sendChunk(\n chunk,\n chunkIndex + 1,\n );\n totalSuccessCount += successCount;\n allFailedTokens.push(...failedTokens);\n }\n\n // Log final results\n console.log(\n `Sent push notification to ${totalSuccessCount}/${messages.length} tokens across ${chunks.length} chunks`,\n );\n\n if (allFailedTokens.length > 0) {\n console.log(`Found ${allFailedTokens.length} failed push tokens`);\n }\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,cAAc;;;ACArB,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,OAAO,SAAS;AAGhB,MAAM,OAAO,GAAG;AAChB,MAAM,OAAO,QAAQ;AAEd,SAAS,eAAe,QAAgB;AAC7C,MAAI,CAAC,OAAO,IAAI,YAAY,EAAG;AAE/B,QAAM,YAAY,CAAC,MAAW,QAAa;AACzC,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,UAAU,EAAE,UAAU,CAAC;AAClC,SAAO,IAAI,YAAY,EAAE,UAAU,CAAC;AACtC;;;ADjBA,SAAS,OAAO,cAAc;AAMvB,IAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,MAAI;AAEF,UAAM,W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B,CAAC;AAEnC,aAAW,CAAC,YAAY,KAAK,KAAK,OAAO,QAAQ,GAAG;AAClD,UAAM,EAAE,cAAc,aAAa,IAAI,MAAM;AAAA,MAC3C;AAAA,MACA,aAAa;AAAA,IACf;AACA,yBAAqB;AACrB,oBAAgB,KAAK,GAAG,YAAY;AAAA,EACtC;AAGA,UAAQ;AAAA,IACN,6BAA6B,iBAAiB,IAAI,SAAS,MAAM,kBAAkB,OAAO,MAAM;AAAA,EAClG;AAEA,MAAI,gBAAgB,SAAS,GAAG;AAC9B,YAAQ,IAAI,SAAS,gBAAgB,MAAM,qBAAqB;AAAA,EAClE;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/service/database.ts","../../src/service/timezonePlugin.ts","../../src/service/saveNotificationsInDb.ts","../../src/service/sendPushNotifications.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { timezonePlugin } from \"./timezonePlugin\";\n\nmongoose.plugin(timezonePlugin); // applies to all schemas\n\n/**\n * Connect to MongoDB using Mongoose.\n * Supports both local MongoDB (via MONGODB_URI) and MongoDB Atlas (via individual env vars).\n */\nexport const connectToDatabase = async ({\n appName,\n dbName,\n dbPassword,\n dbUser,\n mongodbUri,\n}: {\n appName: string;\n dbName: string;\n dbPassword: string;\n dbUser: string;\n mongodbUri: string;\n}) => {\n try {\n // Check if MONGODB_URI is provided (for local Docker MongoDB)\n const mongoUri = mongodbUri\n ? mongodbUri\n : // Fallback to MongoDB Atlas connection string\n `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`;\n\n await mongoose.connect(mongoUri);\n\n const connectionType = mongodbUri ? \"Local MongoDB\" : \"MongoDB Atlas\";\n console.log(\n `${connectionType} connected from server/src/service/database.ts`,\n );\n } catch (err) {\n console.error(\"Error connecting to MongoDB:\", err);\n throw err; // You can throw the error if you want to stop the server in case of connection failure\n }\n};\n","import dayjs from \"dayjs\";\nimport timezone from \"dayjs/plugin/timezone\";\nimport utc from \"dayjs/plugin/utc\";\nimport { Schema } from \"mongoose\";\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nexport function timezonePlugin(schema: Schema) {\n if (!schema.get(\"timestamps\")) return;\n\n const transform = (_doc: any, ret: any) => {\n if (ret.createdAt)\n ret.createdAt = dayjs(ret.createdAt).tz(\"Pacific/Auckland\").format(); // ISO with +13:00 or +12:00 offset\n if (ret.updatedAt)\n ret.updatedAt = dayjs(ret.updatedAt).tz(\"Pacific/Auckland\").format();\n return ret;\n };\n\n schema.set(\"toJSON\", { transform });\n schema.set(\"toObject\", { transform });\n}\n","import {\n SchemaCreateBulkNotificationInput,\n NotificationModel,\n} from \"src/mongoose/Notification\";\nimport { ObjectId } from \"src/types\";\n\n/**\n * Create notifications in the database for multiple users\n * This is typically called when sending push notifications\n */\nexport async function saveNotificationsInDb(\n payload: SchemaCreateBulkNotificationInput,\n): Promise<ObjectId[]> {\n const { data, message, title, type, userIds } = payload;\n try {\n const notifications = userIds.map((userId) => ({\n data,\n isRead: false,\n message,\n title,\n type,\n userId,\n }));\n\n // Save notifications to database\n await NotificationModel.insertMany(notifications);\n console.log(\n `Created ${notifications.length} notifications for ${userIds.length} users`,\n );\n\n return [...new Set(userIds)];\n } catch (error) {\n console.error(\"Failed to create notifications:\", error);\n return [];\n //throw new Error(`Failed to create notifications: ${error}`);\n }\n}\n","import { Expo, ExpoPushMessage, ExpoPushTicket } from \"expo-server-sdk\";\n\nimport { SchemaCreateBulkNotificationInput } from \"src/mongoose/Notification\";\nimport { PushTokenModel } from \"src/mongoose/PushToken\";\nimport { NotificationDataType, ObjectId } from \"src/types\";\n\nconst expo = new Expo();\n\n/**\n * Safely extract tokens from ExpoPushMessage handling both string and array cases\n */\nfunction extractTokensFromMessage(message: ExpoPushMessage): string[] {\n return Array.isArray(message.to) ? message.to : [message.to];\n}\n\ninterface CreatePushMessagesOptions {\n tokens: string[];\n message: string;\n title: string;\n data: NotificationDataType;\n}\n\n/**\n * Create push messages from valid tokens\n */\nfunction createPushMessages({\n tokens,\n message,\n title,\n data,\n}: CreatePushMessagesOptions): {\n messages: ExpoPushMessage[];\n invalidTokens: string[];\n} {\n const messages: ExpoPushMessage[] = [];\n const invalidTokens: string[] = [];\n\n for (const token of tokens) {\n if (!Expo.isExpoPushToken(token)) {\n invalidTokens.push(token);\n continue;\n }\n\n messages.push({\n body: message,\n data: { ...data },\n sound: \"default\",\n title,\n to: token,\n });\n }\n\n return { invalidTokens, messages };\n}\n\n/**\n * Process chunk results and extract failed tokens\n */\nfunction processChunkResults(\n tickets: ExpoPushTicket[],\n chunk: ExpoPushMessage[],\n): { successCount: number; failedTokens: string[] } {\n let successCount = 0;\n const failedTokens: string[] = [];\n\n for (const [ticketIndex, ticket] of tickets.entries()) {\n if (ticket.status === \"error\") {\n const message = chunk[ticketIndex];\n if (message) {\n const tokens = extractTokensFromMessage(message);\n if (ticket.details?.error === \"DeviceNotRegistered\") {\n failedTokens.push(...tokens);\n }\n console.log(\"Push notification error\", {\n error: ticket.details?.error,\n tokens,\n });\n }\n } else {\n successCount++;\n }\n }\n\n return { failedTokens, successCount };\n}\n\n/**\n * Send a single chunk of push notifications\n */\nasync function sendChunk(\n chunk: ExpoPushMessage[],\n chunkIndex: number,\n): Promise<{ successCount: number; failedTokens: string[] }> {\n try {\n const tickets = await expo.sendPushNotificationsAsync(chunk);\n const { successCount, failedTokens } = processChunkResults(tickets, chunk);\n\n console.log(\n `Chunk ${chunkIndex + 1}: Sent ${successCount}/${chunk.length} notifications successfully`,\n );\n\n return { failedTokens, successCount };\n } catch (error) {\n console.log(\"Error sending Expo push notification chunk\", {\n chunkIndex,\n chunkSize: chunk.length,\n error: error instanceof Error ? error.message : String(error),\n });\n return { failedTokens: [], successCount: 0 };\n }\n}\n\nexport async function sendPushNotifications({\n data,\n message,\n title,\n userIds,\n}: SchemaCreateBulkNotificationInput) {\n const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });\n const expoTokens = pushTokens.map((token) => token.token);\n\n if (!data) return;\n\n const { messages, invalidTokens } = createPushMessages({\n data,\n message,\n title,\n tokens: expoTokens,\n });\n\n // Log invalid tokens\n if (invalidTokens.length > 0) {\n console.log(`Found ${invalidTokens.length} invalid push tokens`);\n }\n\n if (messages.length === 0) {\n console.log(\"No valid messages to send after filtering tokens\");\n return;\n }\n\n // Send notifications in chunks\n const chunks = expo.chunkPushNotifications(messages);\n let totalSuccessCount = 0;\n const allFailedTokens: string[] = [];\n\n for (const [chunkIndex, chunk] of chunks.entries()) {\n const { successCount, failedTokens } = await sendChunk(\n chunk,\n chunkIndex + 1,\n );\n totalSuccessCount += successCount;\n allFailedTokens.push(...failedTokens);\n }\n\n // Log final results\n console.log(\n `Sent push notification to ${totalSuccessCount}/${messages.length} tokens across ${chunks.length} chunks`,\n );\n\n if (allFailedTokens.length > 0) {\n console.log(`Found ${allFailedTokens.length} failed push tokens`);\n }\n}\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;;;ACArB,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,OAAO,SAAS;AAGhB,MAAM,OAAO,GAAG;AAChB,MAAM,OAAO,QAAQ;AAEd,SAAS,eAAe,QAAgB;AAC7C,MAAI,CAAC,OAAO,IAAI,YAAY,EAAG;AAE/B,QAAM,YAAY,CAAC,MAAW,QAAa;AACzC,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,UAAU,EAAE,UAAU,CAAC;AAClC,SAAO,IAAI,YAAY,EAAE,UAAU,CAAC;AACtC;;;ADjBA,SAAS,OAAO,cAAc;AAMvB,IAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,MAAI;AAEF,UA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KAAK,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC;AACzE,QAAM,aAAa,WAAW,IAAI,CAAC,UAAU,MAAM,KAAK;AAExD,MAAI,CAAC,KAAM;AAEX,QAAM,EAAE,UAAU,cAAc,IAAI,mBAAmB;AAAA,IACrD;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,CAAC;AAGD,MAAI,cAAc,SAAS,GAAG;AAC5B,YAAQ,IAAI,SAAS,cAAc,MAAM,sBAAsB;AAAA,EACjE;AAEA,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,IAAI,kDAAkD;AAC9D;AAAA,EACF;AAGA,QAAM,SAAS,KAAK,uBAAuB,QAAQ;AACnD,MAAI,oBAAoB;AACxB,QAAM,kBAA4B,CAAC;AAEnC,aAAW,CAAC,YAAY,KAAK,KAAK,OAAO,QAAQ,GAAG;AAClD,UAAM,EAAE,cAAc,aAAa,IAAI,MAAM;AAAA,MAC3C;AAAA,MACA,aAAa;AAAA,IACf;AACA,yBAAqB;AACrB,oBAAgB,KAAK,GAAG,YAAY;AAAA,EACtC;AAGA,UAAQ;AAAA,IACN,6BAA6B,iBAAiB,IAAI,SAAS,MAAM,kBAAkB,OAAO,MAAM;AAAA,EAClG;AAEA,MAAI,gBAAgB,SAAS,GAAG;AAC9B,YAAQ,IAAI,SAAS,gBAAgB,MAAM,qBAAqB;AAAA,EAClE;AACF;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import { EnumResourceType } from '../enums/index.mjs';
2
- export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-BczaOu28.mjs';
3
- export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-_89-F0iL.mjs';
4
- export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-IVwm5MLY.mjs';
2
+ export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-DDtMJHZw.mjs';
3
+ export { a3 as AuthUser, U as BaseResourceType, B as BaseResourceTypeFormData, C as Category, K as ChatMessageInput, M as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a1 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, W as DateTimeType, a6 as DateTimeWithPriceType, D as DeviceInfo, a2 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, Y as GeocodeLocation, a5 as GraphQLContext, a0 as ImageObjectType, L as LocationType, Z as MapMultiLocation, d as NotificationCount, a8 as NotificationDataType, N as NotificationType, Q as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, J as ParticipantType, P as PartnerType, a7 as PaymentInfoType, u as PosterUsageType, X as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, $ as Subcategory, _ as SubcategoryItems, a4 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-ExJZRDGR.mjs';
4
+ export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-CiYcsJB7.mjs';
5
5
  export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
6
6
  export { default as mongoose } from 'mongoose';
7
7
  import 'express';
@@ -1,7 +1,7 @@
1
1
  import { EnumResourceType } from '../enums/index.js';
2
- export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-BCxQp_CF.js';
3
- export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-Bnr6l_NH.js';
4
- export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-Cv1V8lgJ.js';
2
+ export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-CmaB99NK.js';
3
+ export { a3 as AuthUser, U as BaseResourceType, B as BaseResourceTypeFormData, C as Category, K as ChatMessageInput, M as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a1 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, W as DateTimeType, a6 as DateTimeWithPriceType, D as DeviceInfo, a2 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, Y as GeocodeLocation, a5 as GraphQLContext, a0 as ImageObjectType, L as LocationType, Z as MapMultiLocation, d as NotificationCount, a8 as NotificationDataType, N as NotificationType, Q as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, J as ParticipantType, P as PartnerType, a7 as PaymentInfoType, u as PosterUsageType, X as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, $ as Subcategory, _ as SubcategoryItems, a4 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-DVYSZ6LR.js';
4
+ export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-BZylIpez.js';
5
5
  export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
6
6
  export { default as mongoose } from 'mongoose';
7
7
  import 'express';
@@ -1,5 +1,5 @@
1
1
  import { EnumInviteStatus, EnumRegions } from '../enums/index.mjs';
2
- import { Z as Region, O as OptionItem } from '../global-_89-F0iL.mjs';
2
+ import { X as Region, O as OptionItem } from '../global-ExJZRDGR.mjs';
3
3
  import 'express';
4
4
  import 'mongoose';
5
5
  import 'react-hook-form';
@@ -1,5 +1,5 @@
1
1
  import { EnumInviteStatus, EnumRegions } from '../enums/index.js';
2
- import { Z as Region, O as OptionItem } from '../global-Bnr6l_NH.js';
2
+ import { X as Region, O as OptionItem } from '../global-DVYSZ6LR.js';
3
3
  import 'express';
4
4
  import 'mongoose';
5
5
  import 'react-hook-form';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timardex/cluemart-shared",
3
- "version": "1.2.32",
3
+ "version": "1.2.34",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",