@timardex/cluemart-server-shared 1.0.210 → 1.0.212

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
@@ -5,6 +5,7 @@ export { default as mongoose } from 'mongoose';
5
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 dayjs from 'dayjs';
8
9
 
9
10
  declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
10
11
  _id: string;
@@ -711,6 +712,12 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
711
712
  */
712
713
  declare function convertObjectIdsToStrings(obj: any): any;
713
714
 
715
+ /**
716
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time
717
+ * @param dateTime The date-time object to update
718
+ * @returns A new object with updated dateStatus value
719
+ */
720
+ declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
714
721
  /**
715
722
  * Recomputes dateStatus for every dateTime slot on events and google imported markets.
716
723
  */
@@ -739,4 +746,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
739
746
  */
740
747
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
741
748
 
742
- 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, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
749
+ 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, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { default as mongoose } from 'mongoose';
5
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 dayjs from 'dayjs';
8
9
 
9
10
  declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
10
11
  _id: string;
@@ -711,6 +712,12 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
711
712
  */
712
713
  declare function convertObjectIdsToStrings(obj: any): any;
713
714
 
715
+ /**
716
+ * Updates the dateStatus field for a single DateTimeType object based on the current date/time
717
+ * @param dateTime The date-time object to update
718
+ * @returns A new object with updated dateStatus value
719
+ */
720
+ declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
714
721
  /**
715
722
  * Recomputes dateStatus for every dateTime slot on events and google imported markets.
716
723
  */
@@ -739,4 +746,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
739
746
  */
740
747
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
741
748
 
742
- 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, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
749
+ 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, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };
package/dist/index.mjs CHANGED
@@ -5145,7 +5145,7 @@ var EVENT = gql`
5145
5145
  ${RELATION_DATES_FRAGMENT}
5146
5146
  `;
5147
5147
  var GET_EVENTS = gql`
5148
- query getEvents($dateStatus: EnumEventDateStatus) {
5148
+ query getEvents($dateStatus: EventDateStatusEnumType) {
5149
5149
  events(dateStatus: $dateStatus) {
5150
5150
  ...EventListItemFields
5151
5151
  }
@@ -5172,7 +5172,7 @@ var GET_EVENTS_BY_REGION = gql`
5172
5172
  query getEventsByRegion(
5173
5173
  $region: String!
5174
5174
  $options: ResourcesByRegionOptions
5175
- $dateStatus: EnumEventDateStatus
5175
+ $dateStatus: EventDateStatusEnumType
5176
5176
  ) {
5177
5177
  eventsByRegion(
5178
5178
  region: $region
@@ -5189,7 +5189,7 @@ var SEARCH_EVENTS = gql`
5189
5189
  $region: String
5190
5190
  $search: String
5191
5191
  $tags: [String]
5192
- $dateStatus: EnumEventDateStatus
5192
+ $dateStatus: EventDateStatusEnumType
5193
5193
  ) {
5194
5194
  eventsSearch(
5195
5195
  region: $region
@@ -5207,7 +5207,7 @@ var GET_EVENTS_NEAR_ME = gql`
5207
5207
  $latitude: Float!
5208
5208
  $longitude: Float!
5209
5209
  $radius: Int
5210
- $dateStatus: EnumEventDateStatus
5210
+ $dateStatus: EventDateStatusEnumType
5211
5211
  ) {
5212
5212
  eventsNearMe(
5213
5213
  latitude: $latitude
@@ -9104,6 +9104,9 @@ function convertObjectIdsToStrings(obj) {
9104
9104
  if (obj instanceof mongoose27.Types.ObjectId) {
9105
9105
  return obj.toString();
9106
9106
  }
9107
+ if (obj instanceof Date) {
9108
+ return obj;
9109
+ }
9107
9110
  if (Array.isArray(obj)) {
9108
9111
  return obj.map(convertObjectIdsToStrings);
9109
9112
  }
@@ -9340,6 +9343,7 @@ export {
9340
9343
  updateAdStatuses,
9341
9344
  updateAllEventDateTimeStatuses,
9342
9345
  updateRelationDatesToUnavailable,
9346
+ updateSingleDateTimeStatus,
9343
9347
  updateVendorBasedOnUserLicense,
9344
9348
  userLicenseSchema
9345
9349
  };