@timardex/cluemart-server-shared 1.0.76 → 1.0.78

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.
@@ -39,6 +39,7 @@ interface SubscriptionPayload {
39
39
  };
40
40
  }
41
41
  interface GraphQLContext {
42
+ appVersion: string | null;
42
43
  user: AuthUser | null;
43
44
  pubsub: {
44
45
  publish: (eventName: EnumPubSubEvents, payload: SubscriptionPayload) => void;
@@ -48,9 +49,24 @@ interface GraphQLContext {
48
49
  response: express.Response;
49
50
  }
50
51
 
51
- type SchemaChatMessageType = Omit<ChatMessageType, "senderId"> & {
52
+ type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
52
53
  senderId: ObjectId;
53
54
  };
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
56
+ userId: ObjectId;
57
+ createdAt: Date;
58
+ };
59
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
60
+ userId: ObjectId;
61
+ seenAt: Date;
62
+ };
63
+ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
64
+ senderId: ObjectId;
65
+ replyToMessageId?: ObjectId | null;
66
+ replyPreview?: SchemaChatMessageReplyPreviewType | null;
67
+ likedBy?: SchemaChatMessageReactionType[];
68
+ seenBy?: SchemaChatMessageSeenType[];
69
+ };
54
70
  type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
55
71
  userId: ObjectId;
56
72
  };
@@ -78,4 +94,4 @@ declare const ChatModel: mongoose.Model<SchemaChatType, {}, {}, {}, mongoose.Doc
78
94
  __v: number;
79
95
  }, any>;
80
96
 
81
- export { type AuthUser as A, ChatModel as C, EnumPubSubEvents as E, type GraphQLContext as G, NotificationModel as N, type ObjectId as O, ParticipantSchema as P, type SchemaChatMessageType as S, type SchemaParticipantType as a, type SchemaChatType as b, type SchemaCreateBulkNotificationInput as c, type SchemaNotificationType as d, type SubscriptionPayload as e };
97
+ export { type AuthUser as A, ChatModel as C, EnumPubSubEvents as E, type GraphQLContext as G, NotificationModel as N, type ObjectId as O, ParticipantSchema as P, type SchemaChatMessageReplyPreviewType as S, type SchemaChatMessageReactionType as a, type SchemaChatMessageSeenType as b, type SchemaChatMessageType as c, type SchemaParticipantType as d, type SchemaChatType as e, type SchemaCreateBulkNotificationInput as f, type SchemaNotificationType as g, type SubscriptionPayload as h };
@@ -39,6 +39,7 @@ interface SubscriptionPayload {
39
39
  };
40
40
  }
41
41
  interface GraphQLContext {
42
+ appVersion: string | null;
42
43
  user: AuthUser | null;
43
44
  pubsub: {
44
45
  publish: (eventName: EnumPubSubEvents, payload: SubscriptionPayload) => void;
@@ -48,9 +49,24 @@ interface GraphQLContext {
48
49
  response: express.Response;
49
50
  }
50
51
 
51
- type SchemaChatMessageType = Omit<ChatMessageType, "senderId"> & {
52
+ type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
52
53
  senderId: ObjectId;
53
54
  };
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
56
+ userId: ObjectId;
57
+ createdAt: Date;
58
+ };
59
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
60
+ userId: ObjectId;
61
+ seenAt: Date;
62
+ };
63
+ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
64
+ senderId: ObjectId;
65
+ replyToMessageId?: ObjectId | null;
66
+ replyPreview?: SchemaChatMessageReplyPreviewType | null;
67
+ likedBy?: SchemaChatMessageReactionType[];
68
+ seenBy?: SchemaChatMessageSeenType[];
69
+ };
54
70
  type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
55
71
  userId: ObjectId;
56
72
  };
@@ -78,4 +94,4 @@ declare const ChatModel: mongoose.Model<SchemaChatType, {}, {}, {}, mongoose.Doc
78
94
  __v: number;
79
95
  }, any>;
80
96
 
81
- export { type AuthUser as A, ChatModel as C, EnumPubSubEvents as E, type GraphQLContext as G, NotificationModel as N, type ObjectId as O, ParticipantSchema as P, type SchemaChatMessageType as S, type SchemaParticipantType as a, type SchemaChatType as b, type SchemaCreateBulkNotificationInput as c, type SchemaNotificationType as d, type SubscriptionPayload as e };
97
+ export { type AuthUser as A, ChatModel as C, EnumPubSubEvents as E, type GraphQLContext as G, NotificationModel as N, type ObjectId as O, ParticipantSchema as P, type SchemaChatMessageReplyPreviewType as S, type SchemaChatMessageReactionType as a, type SchemaChatMessageSeenType as b, type SchemaChatMessageType as c, type SchemaParticipantType as d, type SchemaChatType as e, type SchemaCreateBulkNotificationInput as f, type SchemaNotificationType as g, type SubscriptionPayload as h };
@@ -6828,13 +6828,25 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
6828
6828
  })(EnumRelationResource || {});
6829
6829
  var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
6830
6830
  EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_EVENT"] = "added_as_associate_event";
6831
+ EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_PARTNER"] = "added_as_associate_partner";
6831
6832
  EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_VENDOR"] = "added_as_associate_vendor";
6832
6833
  EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
6834
+ EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
6833
6835
  EnumNotificationResourceType22["APPROVED_VENDOR"] = "approved_vendor";
6834
6836
  EnumNotificationResourceType22["CREATED_EVENT"] = "created_event";
6837
+ EnumNotificationResourceType22["CREATED_PARTNER"] = "created_partner";
6835
6838
  EnumNotificationResourceType22["CREATED_VENDOR"] = "created_vendor";
6839
+ EnumNotificationResourceType22["DEACTIVATED_EVENT"] = "deactivated_event";
6840
+ EnumNotificationResourceType22["DEACTIVATED_PARTNER"] = "deactivated_partner";
6841
+ EnumNotificationResourceType22["DEACTIVATED_VENDOR"] = "deactivated_vendor";
6842
+ EnumNotificationResourceType22["DECLINED_EVENT"] = "declined_event";
6843
+ EnumNotificationResourceType22["DECLINED_PARTNER"] = "declined_partner";
6844
+ EnumNotificationResourceType22["DECLINED_VENDOR"] = "declined_vendor";
6836
6845
  EnumNotificationResourceType22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
6837
6846
  EnumNotificationResourceType22["EVENT_STARTING_SOON"] = "event_starting_soon";
6847
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
6848
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_PARTNER"] = "expiration_reminder_partner";
6849
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_VENDOR"] = "expiration_reminder_vendor";
6838
6850
  EnumNotificationResourceType22["NEW_CHAT_MESSAGE"] = "new_chat_message";
6839
6851
  EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
6840
6852
  EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
@@ -8357,6 +8369,7 @@ var USER_FIELDS_FRAGMENT = gql`
8357
8369
  licences {
8358
8370
  ...LicenceFields
8359
8371
  }
8372
+ partner
8360
8373
  platform
8361
8374
  preferredRegion
8362
8375
  refreshToken
@@ -9043,7 +9056,21 @@ var CHAT_MESSAGE_FIELDS_FRAGMENT = gql`
9043
9056
  _id
9044
9057
  content
9045
9058
  createdAt
9059
+ replyToMessageId
9060
+ replyPreview {
9061
+ senderId
9062
+ senderName
9063
+ contentPreview
9064
+ }
9065
+ likedBy {
9066
+ userId
9067
+ createdAt
9068
+ }
9046
9069
  senderId
9070
+ seenBy {
9071
+ userId
9072
+ seenAt
9073
+ }
9047
9074
  updatedAt
9048
9075
  }
9049
9076
  `;
@@ -9117,6 +9144,22 @@ var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = gql`
9117
9144
  removeParticipantFromChat(chatId: $chatId, userId: $userId)
9118
9145
  }
9119
9146
  `;
9147
+ var TOGGLE_CHAT_MESSAGE_LIKE_MUTATION = gql`
9148
+ mutation toggleChatMessageLike($chatId: ID!, $messageId: ID!) {
9149
+ toggleChatMessageLike(chatId: $chatId, messageId: $messageId) {
9150
+ ...ChatFields
9151
+ }
9152
+ }
9153
+ ${CHAT_FIELDS_FRAGMENT}
9154
+ `;
9155
+ var MARK_CHAT_MESSAGES_SEEN_MUTATION = gql`
9156
+ mutation markChatMessagesSeen($chatId: ID!, $messageIds: [ID!]!) {
9157
+ markChatMessagesSeen(chatId: $chatId, messageIds: $messageIds) {
9158
+ ...ChatFields
9159
+ }
9160
+ }
9161
+ ${CHAT_FIELDS_FRAGMENT}
9162
+ `;
9120
9163
  var GET_CHAT_MESSAGE = gql`
9121
9164
  subscription {
9122
9165
  getChatMessage {
@@ -11199,9 +11242,54 @@ var AdModel = mongoose4.models.Ad || mongoose4.model("Ad", schema2);
11199
11242
  // src/mongoose/Chat.ts
11200
11243
  import mongoose5 from "mongoose";
11201
11244
  var MongooseSchema5 = mongoose5.Schema;
11245
+ var MessageReplyPreviewSchema = new MongooseSchema5(
11246
+ {
11247
+ contentPreview: { required: true, type: String },
11248
+ senderId: {
11249
+ ref: "User",
11250
+ required: true,
11251
+ type: mongoose5.Schema.Types.ObjectId
11252
+ },
11253
+ senderName: { required: true, type: String }
11254
+ },
11255
+ { _id: false }
11256
+ );
11257
+ var MessageReactionSchema = new MongooseSchema5(
11258
+ {
11259
+ createdAt: { required: true, type: Date },
11260
+ userId: {
11261
+ ref: "User",
11262
+ required: true,
11263
+ type: mongoose5.Schema.Types.ObjectId
11264
+ }
11265
+ },
11266
+ { _id: false }
11267
+ );
11268
+ var MessageSeenSchema = new MongooseSchema5(
11269
+ {
11270
+ seenAt: { required: true, type: Date },
11271
+ userId: {
11272
+ ref: "User",
11273
+ required: true,
11274
+ type: mongoose5.Schema.Types.ObjectId
11275
+ }
11276
+ },
11277
+ { _id: false }
11278
+ );
11202
11279
  var MessageSchema = new MongooseSchema5(
11203
11280
  {
11204
11281
  content: { required: true, type: String },
11282
+ likedBy: { default: [], required: false, type: [MessageReactionSchema] },
11283
+ replyPreview: {
11284
+ required: false,
11285
+ type: MessageReplyPreviewSchema
11286
+ },
11287
+ replyToMessageId: {
11288
+ ref: "Chat.messages",
11289
+ required: false,
11290
+ type: mongoose5.Schema.Types.ObjectId
11291
+ },
11292
+ seenBy: { default: [], required: false, type: [MessageSeenSchema] },
11205
11293
  senderId: {
11206
11294
  ref: "User",
11207
11295
  required: true,
@@ -11371,7 +11459,7 @@ schema4.index({ isRead: 1, userId: 1 });
11371
11459
  schema4.index({ createdAt: -1, userId: 1 });
11372
11460
  var NotificationModel = mongoose7.models.Notification || mongoose7.model("Notification", schema4);
11373
11461
 
11374
- // node_modules/@timardex/cluemart-shared/dist/chunk-FLDXD65Z.mjs
11462
+ // node_modules/@timardex/cluemart-shared/dist/chunk-R5HMLIJS.mjs
11375
11463
  var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
11376
11464
  EnumOSPlatform22["ANDROID"] = "android";
11377
11465
  EnumOSPlatform22["IOS"] = "ios";
@@ -11918,7 +12006,7 @@ var schema11 = new MongooseSchema15(
11918
12006
  {
11919
12007
  ...baseResourceFields,
11920
12008
  // Importing base resource fields from global.ts
11921
- claimed: { default: true, required: true, type: Boolean },
12009
+ claimed: { default: true, required: false, type: Boolean },
11922
12010
  dateTime: [dateTimeSchema3],
11923
12011
  eventInfoId: {
11924
12012
  ref: "EventInfo",
@@ -12100,4 +12188,4 @@ react/cjs/react.development.js:
12100
12188
  * LICENSE file in the root directory of this source tree.
12101
12189
  *)
12102
12190
  */
12103
- //# sourceMappingURL=chunk-AS6CKE7P.mjs.map
12191
+ //# sourceMappingURL=chunk-TPZF5OZA.mjs.map