@timardex/cluemart-server-shared 1.0.178 → 1.0.200

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
@@ -1,11 +1,10 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
- import { NotificationCount } from '@timardex/cluemart-shared/types';
5
+ import { NotificationCount, DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
6
6
  import express from 'express';
7
7
  export { default as express } from 'express';
8
- import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
9
8
 
10
9
  declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
11
10
  _id: string;
@@ -62,13 +61,11 @@ interface GraphQLContext {
62
61
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
63
62
  senderId: ObjectId;
64
63
  };
65
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
64
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
66
65
  userId: ObjectId;
67
- createdAt: Date;
68
66
  };
69
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
67
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
70
68
  userId: ObjectId;
71
- seenAt: Date;
72
69
  };
73
70
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
74
71
  senderId: ObjectId;
@@ -411,14 +408,6 @@ declare const GoogleImportedMarketModel: mongoose.Model<SchemaGoogleImportedMark
411
408
  __v: number;
412
409
  }, any>;
413
410
 
414
- type PushTokenType = {
415
- _id: string;
416
- createdAt: Date;
417
- platform: EnumOSPlatform;
418
- token: string;
419
- updatedAt: Date;
420
- userId: string;
421
- };
422
411
  type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
423
412
  userId: ObjectId;
424
413
  };
@@ -439,7 +428,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
439
428
  } & {
440
429
  __v: number;
441
430
  }>;
442
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
431
+ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
443
432
  eventId: ObjectId;
444
433
  vendorId: ObjectId;
445
434
  chatId: ObjectId;
@@ -449,7 +438,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
449
438
  * It is used to define the structure of the relation type in the database.
450
439
  * The schema is used by Mongoose to create a model for the relation type.
451
440
  */
452
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
441
+ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
453
442
  eventId: ObjectId;
454
443
  vendorId: ObjectId;
455
444
  chatId: ObjectId;
@@ -462,7 +451,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
462
451
  }> & {
463
452
  __v: number;
464
453
  }>;
465
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
454
+ declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
466
455
  eventId: ObjectId;
467
456
  vendorId: ObjectId;
468
457
  chatId: ObjectId;
@@ -722,10 +711,7 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
722
711
  */
723
712
  declare function convertObjectIdsToStrings(obj: any): any;
724
713
 
725
- type EventOrMarket = {
726
- _id: ObjectId | string;
727
- name: string;
728
- } | null;
714
+ type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
729
715
  /**
730
716
  * This function attempts to find an Event or a Google Imported Market by the given resource ID.
731
717
  * It first normalizes the resource ID to a string format, then performs parallel queries to both collections.
@@ -736,10 +722,16 @@ type EventOrMarket = {
736
722
  */
737
723
  declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
738
724
 
725
+ type EventDateSlot = Pick<DateTimeType$1, "startDate" | "startTime">;
726
+ /**
727
+ * Returns true when at least one startDate/startTime slot from the previous
728
+ * schedule is absent from the next schedule (i.e. a date was removed).
729
+ */
730
+ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | undefined, nextDateTime: EventDateSlot[] | undefined): boolean;
739
731
  /**
740
732
  * Helper: Update relationDates based on event's dateTime
741
733
  * Marks dates as UNAVAILABLE if they no longer exist in the event's dateTime.
742
734
  */
743
735
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
744
736
 
745
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
737
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, didRemoveAnyEventDates, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
- import { NotificationCount } from '@timardex/cluemart-shared/types';
5
+ import { NotificationCount, DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
6
6
  import express from 'express';
7
7
  export { default as express } from 'express';
8
- import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
9
8
 
10
9
  declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
11
10
  _id: string;
@@ -62,13 +61,11 @@ interface GraphQLContext {
62
61
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
63
62
  senderId: ObjectId;
64
63
  };
65
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
64
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
66
65
  userId: ObjectId;
67
- createdAt: Date;
68
66
  };
69
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
67
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
70
68
  userId: ObjectId;
71
- seenAt: Date;
72
69
  };
73
70
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
74
71
  senderId: ObjectId;
@@ -411,14 +408,6 @@ declare const GoogleImportedMarketModel: mongoose.Model<SchemaGoogleImportedMark
411
408
  __v: number;
412
409
  }, any>;
413
410
 
414
- type PushTokenType = {
415
- _id: string;
416
- createdAt: Date;
417
- platform: EnumOSPlatform;
418
- token: string;
419
- updatedAt: Date;
420
- userId: string;
421
- };
422
411
  type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
423
412
  userId: ObjectId;
424
413
  };
@@ -439,7 +428,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
439
428
  } & {
440
429
  __v: number;
441
430
  }>;
442
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
431
+ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
443
432
  eventId: ObjectId;
444
433
  vendorId: ObjectId;
445
434
  chatId: ObjectId;
@@ -449,7 +438,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
449
438
  * It is used to define the structure of the relation type in the database.
450
439
  * The schema is used by Mongoose to create a model for the relation type.
451
440
  */
452
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
441
+ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
453
442
  eventId: ObjectId;
454
443
  vendorId: ObjectId;
455
444
  chatId: ObjectId;
@@ -462,7 +451,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
462
451
  }> & {
463
452
  __v: number;
464
453
  }>;
465
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
454
+ declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
466
455
  eventId: ObjectId;
467
456
  vendorId: ObjectId;
468
457
  chatId: ObjectId;
@@ -722,10 +711,7 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
722
711
  */
723
712
  declare function convertObjectIdsToStrings(obj: any): any;
724
713
 
725
- type EventOrMarket = {
726
- _id: ObjectId | string;
727
- name: string;
728
- } | null;
714
+ type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
729
715
  /**
730
716
  * This function attempts to find an Event or a Google Imported Market by the given resource ID.
731
717
  * It first normalizes the resource ID to a string format, then performs parallel queries to both collections.
@@ -736,10 +722,16 @@ type EventOrMarket = {
736
722
  */
737
723
  declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
738
724
 
725
+ type EventDateSlot = Pick<DateTimeType$1, "startDate" | "startTime">;
726
+ /**
727
+ * Returns true when at least one startDate/startTime slot from the previous
728
+ * schedule is absent from the next schedule (i.e. a date was removed).
729
+ */
730
+ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | undefined, nextDateTime: EventDateSlot[] | undefined): boolean;
739
731
  /**
740
732
  * Helper: Update relationDates based on event's dateTime
741
733
  * Marks dates as UNAVAILABLE if they no longer exist in the event's dateTime.
742
734
  */
743
735
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
744
736
 
745
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
737
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, didRemoveAnyEventDates, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };