@timardex/cluemart-shared 1.4.3 → 1.4.5

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.
@@ -13,7 +13,7 @@ import {
13
13
  dateFormat,
14
14
  normalizeUrl,
15
15
  timeFormat
16
- } from "../chunk-XPBNTPFC.mjs";
16
+ } from "../chunk-NMVEGOMG.mjs";
17
17
  import {
18
18
  EnumEventDateStatus,
19
19
  EnumEventType,
@@ -26,7 +26,7 @@ import {
26
26
  EnumUserLicence,
27
27
  EnumUserRole,
28
28
  EnumVendorType
29
- } from "../chunk-LAGFDF56.mjs";
29
+ } from "../chunk-R5HMLIJS.mjs";
30
30
 
31
31
  // src/hooks/useLocationSearch.ts
32
32
  var handleApiError = (error, message) => {
package/dist/index.cjs CHANGED
@@ -220,6 +220,7 @@ __export(index_exports, {
220
220
  useLoginForm: () => useLoginForm,
221
221
  useLogout: () => useLogout,
222
222
  useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
223
+ useMarkChatMessagesSeen: () => useMarkChatMessagesSeen,
223
224
  useMarkNotificationRead: () => useMarkNotificationRead,
224
225
  usePartnerForm: () => usePartnerForm,
225
226
  usePostForm: () => usePostForm,
@@ -241,6 +242,7 @@ __export(index_exports, {
241
242
  useSelectPackage: () => useSelectPackage,
242
243
  useSendChatMessage: () => useSendChatMessage,
243
244
  useTesterForm: () => useTesterForm,
245
+ useToggleChatMessageLike: () => useToggleChatMessageLike,
244
246
  useUpdateAd: () => useUpdateAd,
245
247
  useUpdateAppSettings: () => useUpdateAppSettings,
246
248
  useUpdateEvent: () => useUpdateEvent,
@@ -396,16 +398,19 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
396
398
  EnumNotificationResourceType2["APPROVED_PARTNER"] = "approved_partner";
397
399
  EnumNotificationResourceType2["APPROVED_VENDOR"] = "approved_vendor";
398
400
  EnumNotificationResourceType2["CREATED_EVENT"] = "created_event";
399
- EnumNotificationResourceType2["CREATED_VENDOR"] = "created_vendor";
400
401
  EnumNotificationResourceType2["CREATED_PARTNER"] = "created_partner";
401
- EnumNotificationResourceType2["DECLINED_EVENT"] = "declined_event";
402
- EnumNotificationResourceType2["DECLINED_PARTNER"] = "declined_partner";
403
- EnumNotificationResourceType2["DECLINED_VENDOR"] = "declined_vendor";
402
+ EnumNotificationResourceType2["CREATED_VENDOR"] = "created_vendor";
404
403
  EnumNotificationResourceType2["DEACTIVATED_EVENT"] = "deactivated_event";
405
404
  EnumNotificationResourceType2["DEACTIVATED_PARTNER"] = "deactivated_partner";
406
405
  EnumNotificationResourceType2["DEACTIVATED_VENDOR"] = "deactivated_vendor";
406
+ EnumNotificationResourceType2["DECLINED_EVENT"] = "declined_event";
407
+ EnumNotificationResourceType2["DECLINED_PARTNER"] = "declined_partner";
408
+ EnumNotificationResourceType2["DECLINED_VENDOR"] = "declined_vendor";
407
409
  EnumNotificationResourceType2["EVENT_INVITE_VENDOR"] = "event_invite_vendor" /* EVENT_INVITE_VENDOR */;
408
410
  EnumNotificationResourceType2["EVENT_STARTING_SOON"] = "event_starting_soon";
411
+ EnumNotificationResourceType2["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
412
+ EnumNotificationResourceType2["EXPIRATION_REMINDER_PARTNER"] = "expiration_reminder_partner";
413
+ EnumNotificationResourceType2["EXPIRATION_REMINDER_VENDOR"] = "expiration_reminder_vendor";
409
414
  EnumNotificationResourceType2["NEW_CHAT_MESSAGE"] = "new_chat_message";
410
415
  EnumNotificationResourceType2["SYSTEM_ALERT"] = "system_alert";
411
416
  EnumNotificationResourceType2["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event" /* VENDOR_APPLICATION_TO_EVENT */;
@@ -3489,7 +3494,21 @@ var CHAT_MESSAGE_FIELDS_FRAGMENT = import_client9.gql`
3489
3494
  _id
3490
3495
  content
3491
3496
  createdAt
3497
+ replyToMessageId
3498
+ replyPreview {
3499
+ senderId
3500
+ senderName
3501
+ contentPreview
3502
+ }
3503
+ likedBy {
3504
+ userId
3505
+ createdAt
3506
+ }
3492
3507
  senderId
3508
+ seenBy {
3509
+ userId
3510
+ seenAt
3511
+ }
3493
3512
  updatedAt
3494
3513
  }
3495
3514
  `;
@@ -3565,6 +3584,22 @@ var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = import_client10.gql`
3565
3584
  removeParticipantFromChat(chatId: $chatId, userId: $userId)
3566
3585
  }
3567
3586
  `;
3587
+ var TOGGLE_CHAT_MESSAGE_LIKE_MUTATION = import_client10.gql`
3588
+ mutation toggleChatMessageLike($chatId: ID!, $messageId: ID!) {
3589
+ toggleChatMessageLike(chatId: $chatId, messageId: $messageId) {
3590
+ ...ChatFields
3591
+ }
3592
+ }
3593
+ ${CHAT_FIELDS_FRAGMENT}
3594
+ `;
3595
+ var MARK_CHAT_MESSAGES_SEEN_MUTATION = import_client10.gql`
3596
+ mutation markChatMessagesSeen($chatId: ID!, $messageIds: [ID!]!) {
3597
+ markChatMessagesSeen(chatId: $chatId, messageIds: $messageIds) {
3598
+ ...ChatFields
3599
+ }
3600
+ }
3601
+ ${CHAT_FIELDS_FRAGMENT}
3602
+ `;
3568
3603
 
3569
3604
  // src/graphql/hooks/chat/hooksMutation.ts
3570
3605
  var useSendChatMessage = () => {
@@ -3617,6 +3652,36 @@ var useRemoveParticipantFromChat = () => {
3617
3652
  );
3618
3653
  return { error, loading, removeParticipantFromChat };
3619
3654
  };
3655
+ var useToggleChatMessageLike = () => {
3656
+ const [toggleChatMessageLike, { loading, error }] = (0, import_client11.useMutation)(TOGGLE_CHAT_MESSAGE_LIKE_MUTATION, {
3657
+ awaitRefetchQueries: true,
3658
+ refetchQueries: (mutationResult) => {
3659
+ const chatId = mutationResult?.data?.toggleChatMessageLike?._id;
3660
+ return [
3661
+ {
3662
+ query: CHAT,
3663
+ variables: { _id: chatId }
3664
+ }
3665
+ ];
3666
+ }
3667
+ });
3668
+ return { error, loading, toggleChatMessageLike };
3669
+ };
3670
+ var useMarkChatMessagesSeen = () => {
3671
+ const [markChatMessagesSeen, { loading, error }] = (0, import_client11.useMutation)(MARK_CHAT_MESSAGES_SEEN_MUTATION, {
3672
+ awaitRefetchQueries: true,
3673
+ refetchQueries: (mutationResult) => {
3674
+ const chatId = mutationResult?.data?.markChatMessagesSeen?._id;
3675
+ return [
3676
+ {
3677
+ query: CHAT,
3678
+ variables: { _id: chatId }
3679
+ }
3680
+ ];
3681
+ }
3682
+ });
3683
+ return { error, loading, markChatMessagesSeen };
3684
+ };
3620
3685
 
3621
3686
  // src/graphql/hooks/chat/hooksQuery.ts
3622
3687
  var import_client13 = require("@apollo/client");
@@ -8095,6 +8160,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8095
8160
  useLoginForm,
8096
8161
  useLogout,
8097
8162
  useMarkAllNotificationsRead,
8163
+ useMarkChatMessagesSeen,
8098
8164
  useMarkNotificationRead,
8099
8165
  usePartnerForm,
8100
8166
  usePostForm,
@@ -8116,6 +8182,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
8116
8182
  useSelectPackage,
8117
8183
  useSendChatMessage,
8118
8184
  useTesterForm,
8185
+ useToggleChatMessageLike,
8119
8186
  useUpdateAd,
8120
8187
  useUpdateAppSettings,
8121
8188
  useUpdateEvent,