@timardex/cluemart-server-shared 1.0.77 → 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.
package/dist/index.d.mts CHANGED
@@ -59,9 +59,24 @@ interface GraphQLContext {
59
59
  response: express.Response;
60
60
  }
61
61
 
62
- type SchemaChatMessageType = Omit<ChatMessageType, "senderId"> & {
62
+ type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
63
63
  senderId: ObjectId;
64
64
  };
65
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
66
+ userId: ObjectId;
67
+ createdAt: Date;
68
+ };
69
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
70
+ userId: ObjectId;
71
+ seenAt: Date;
72
+ };
73
+ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
74
+ senderId: ObjectId;
75
+ replyToMessageId?: ObjectId | null;
76
+ replyPreview?: SchemaChatMessageReplyPreviewType | null;
77
+ likedBy?: SchemaChatMessageReactionType[];
78
+ seenBy?: SchemaChatMessageSeenType[];
79
+ };
65
80
  type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
66
81
  userId: ObjectId;
67
82
  };
@@ -605,4 +620,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
605
620
  */
606
621
  declare function updateAdStatuses(): Promise<void>;
607
622
 
608
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
623
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.d.ts CHANGED
@@ -59,9 +59,24 @@ interface GraphQLContext {
59
59
  response: express.Response;
60
60
  }
61
61
 
62
- type SchemaChatMessageType = Omit<ChatMessageType, "senderId"> & {
62
+ type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
63
63
  senderId: ObjectId;
64
64
  };
65
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
66
+ userId: ObjectId;
67
+ createdAt: Date;
68
+ };
69
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
70
+ userId: ObjectId;
71
+ seenAt: Date;
72
+ };
73
+ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
74
+ senderId: ObjectId;
75
+ replyToMessageId?: ObjectId | null;
76
+ replyPreview?: SchemaChatMessageReplyPreviewType | null;
77
+ likedBy?: SchemaChatMessageReactionType[];
78
+ seenBy?: SchemaChatMessageSeenType[];
79
+ };
65
80
  type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
66
81
  userId: ObjectId;
67
82
  };
@@ -605,4 +620,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
605
620
  */
606
621
  declare function updateAdStatuses(): Promise<void>;
607
622
 
608
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
623
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.mjs CHANGED
@@ -6849,13 +6849,25 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
6849
6849
  })(EnumRelationResource || {});
6850
6850
  var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
6851
6851
  EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_EVENT"] = "added_as_associate_event";
6852
+ EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_PARTNER"] = "added_as_associate_partner";
6852
6853
  EnumNotificationResourceType22["ADDED_AS_ASSOCIATE_VENDOR"] = "added_as_associate_vendor";
6853
6854
  EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
6855
+ EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
6854
6856
  EnumNotificationResourceType22["APPROVED_VENDOR"] = "approved_vendor";
6855
6857
  EnumNotificationResourceType22["CREATED_EVENT"] = "created_event";
6858
+ EnumNotificationResourceType22["CREATED_PARTNER"] = "created_partner";
6856
6859
  EnumNotificationResourceType22["CREATED_VENDOR"] = "created_vendor";
6860
+ EnumNotificationResourceType22["DEACTIVATED_EVENT"] = "deactivated_event";
6861
+ EnumNotificationResourceType22["DEACTIVATED_PARTNER"] = "deactivated_partner";
6862
+ EnumNotificationResourceType22["DEACTIVATED_VENDOR"] = "deactivated_vendor";
6863
+ EnumNotificationResourceType22["DECLINED_EVENT"] = "declined_event";
6864
+ EnumNotificationResourceType22["DECLINED_PARTNER"] = "declined_partner";
6865
+ EnumNotificationResourceType22["DECLINED_VENDOR"] = "declined_vendor";
6857
6866
  EnumNotificationResourceType22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
6858
6867
  EnumNotificationResourceType22["EVENT_STARTING_SOON"] = "event_starting_soon";
6868
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
6869
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_PARTNER"] = "expiration_reminder_partner";
6870
+ EnumNotificationResourceType22["EXPIRATION_REMINDER_VENDOR"] = "expiration_reminder_vendor";
6859
6871
  EnumNotificationResourceType22["NEW_CHAT_MESSAGE"] = "new_chat_message";
6860
6872
  EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
6861
6873
  EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
@@ -8378,6 +8390,7 @@ var USER_FIELDS_FRAGMENT = gql`
8378
8390
  licences {
8379
8391
  ...LicenceFields
8380
8392
  }
8393
+ partner
8381
8394
  platform
8382
8395
  preferredRegion
8383
8396
  refreshToken
@@ -9064,7 +9077,21 @@ var CHAT_MESSAGE_FIELDS_FRAGMENT = gql`
9064
9077
  _id
9065
9078
  content
9066
9079
  createdAt
9080
+ replyToMessageId
9081
+ replyPreview {
9082
+ senderId
9083
+ senderName
9084
+ contentPreview
9085
+ }
9086
+ likedBy {
9087
+ userId
9088
+ createdAt
9089
+ }
9067
9090
  senderId
9091
+ seenBy {
9092
+ userId
9093
+ seenAt
9094
+ }
9068
9095
  updatedAt
9069
9096
  }
9070
9097
  `;
@@ -9138,6 +9165,22 @@ var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = gql`
9138
9165
  removeParticipantFromChat(chatId: $chatId, userId: $userId)
9139
9166
  }
9140
9167
  `;
9168
+ var TOGGLE_CHAT_MESSAGE_LIKE_MUTATION = gql`
9169
+ mutation toggleChatMessageLike($chatId: ID!, $messageId: ID!) {
9170
+ toggleChatMessageLike(chatId: $chatId, messageId: $messageId) {
9171
+ ...ChatFields
9172
+ }
9173
+ }
9174
+ ${CHAT_FIELDS_FRAGMENT}
9175
+ `;
9176
+ var MARK_CHAT_MESSAGES_SEEN_MUTATION = gql`
9177
+ mutation markChatMessagesSeen($chatId: ID!, $messageIds: [ID!]!) {
9178
+ markChatMessagesSeen(chatId: $chatId, messageIds: $messageIds) {
9179
+ ...ChatFields
9180
+ }
9181
+ }
9182
+ ${CHAT_FIELDS_FRAGMENT}
9183
+ `;
9141
9184
  var GET_CHAT_MESSAGE = gql`
9142
9185
  subscription {
9143
9186
  getChatMessage {
@@ -11220,9 +11263,54 @@ var AdModel = mongoose4.models.Ad || mongoose4.model("Ad", schema2);
11220
11263
  // src/mongoose/Chat.ts
11221
11264
  import mongoose5 from "mongoose";
11222
11265
  var MongooseSchema5 = mongoose5.Schema;
11266
+ var MessageReplyPreviewSchema = new MongooseSchema5(
11267
+ {
11268
+ contentPreview: { required: true, type: String },
11269
+ senderId: {
11270
+ ref: "User",
11271
+ required: true,
11272
+ type: mongoose5.Schema.Types.ObjectId
11273
+ },
11274
+ senderName: { required: true, type: String }
11275
+ },
11276
+ { _id: false }
11277
+ );
11278
+ var MessageReactionSchema = new MongooseSchema5(
11279
+ {
11280
+ createdAt: { required: true, type: Date },
11281
+ userId: {
11282
+ ref: "User",
11283
+ required: true,
11284
+ type: mongoose5.Schema.Types.ObjectId
11285
+ }
11286
+ },
11287
+ { _id: false }
11288
+ );
11289
+ var MessageSeenSchema = new MongooseSchema5(
11290
+ {
11291
+ seenAt: { required: true, type: Date },
11292
+ userId: {
11293
+ ref: "User",
11294
+ required: true,
11295
+ type: mongoose5.Schema.Types.ObjectId
11296
+ }
11297
+ },
11298
+ { _id: false }
11299
+ );
11223
11300
  var MessageSchema = new MongooseSchema5(
11224
11301
  {
11225
11302
  content: { required: true, type: String },
11303
+ likedBy: { default: [], required: false, type: [MessageReactionSchema] },
11304
+ replyPreview: {
11305
+ required: false,
11306
+ type: MessageReplyPreviewSchema
11307
+ },
11308
+ replyToMessageId: {
11309
+ ref: "Chat.messages",
11310
+ required: false,
11311
+ type: mongoose5.Schema.Types.ObjectId
11312
+ },
11313
+ seenBy: { default: [], required: false, type: [MessageSeenSchema] },
11226
11314
  senderId: {
11227
11315
  ref: "User",
11228
11316
  required: true,
@@ -11392,7 +11480,7 @@ schema4.index({ isRead: 1, userId: 1 });
11392
11480
  schema4.index({ createdAt: -1, userId: 1 });
11393
11481
  var NotificationModel = mongoose7.models.Notification || mongoose7.model("Notification", schema4);
11394
11482
 
11395
- // node_modules/@timardex/cluemart-shared/dist/chunk-FLDXD65Z.mjs
11483
+ // node_modules/@timardex/cluemart-shared/dist/chunk-R5HMLIJS.mjs
11396
11484
  var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
11397
11485
  EnumOSPlatform22["ANDROID"] = "android";
11398
11486
  EnumOSPlatform22["IOS"] = "ios";