@timardex/cluemart-server-shared 1.0.303 → 1.0.304

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.
@@ -145,6 +145,10 @@ declare function updateAdStatuses(): Promise<void>;
145
145
 
146
146
  declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
147
147
 
148
+ /**
149
+ * True when `value` is a valid Mongo ObjectId string.
150
+ */
151
+ declare function isValidObjectId(value: string): boolean;
148
152
  /**
149
153
  * Recursively converts all ObjectId fields to strings in an object
150
154
  * This is needed because GraphQL expects string IDs, not ObjectIds
@@ -185,4 +189,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
185
189
  */
186
190
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
187
191
 
188
- export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
192
+ export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
@@ -145,6 +145,10 @@ declare function updateAdStatuses(): Promise<void>;
145
145
 
146
146
  declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
147
147
 
148
+ /**
149
+ * True when `value` is a valid Mongo ObjectId string.
150
+ */
151
+ declare function isValidObjectId(value: string): boolean;
148
152
  /**
149
153
  * Recursively converts all ObjectId fields to strings in an object
150
154
  * This is needed because GraphQL expects string IDs, not ObjectIds
@@ -185,4 +189,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
185
189
  */
186
190
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
187
191
 
188
- export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
192
+ export { ACTIVE_NOT_DELETED_FILTER, type AwardAffiliateVendorSubscriptionRewardsResult, type NotificationPubSub, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, connectToDatabase, convertObjectIdsToStrings, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, saveNotificationsInDb, sendPushNotifications, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense };
@@ -1754,6 +1754,9 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
1754
1754
 
1755
1755
  // src/service/objectIdToString.ts
1756
1756
  import mongoose2 from "mongoose";
1757
+ function isValidObjectId(value) {
1758
+ return mongoose2.Types.ObjectId.isValid(value);
1759
+ }
1757
1760
  function convertObjectIdsToStrings(obj) {
1758
1761
  if (obj === null || obj === void 0) {
1759
1762
  return obj;
@@ -1949,6 +1952,7 @@ export {
1949
1952
  findAffiliateByPromoCode,
1950
1953
  findEventOrImportedMarketById,
1951
1954
  getSubscriptionRewardPeriodBounds,
1955
+ isValidObjectId,
1952
1956
  mapVendorLicenceToSubscriptionRewardType,
1953
1957
  normalizeAffiliatePromoCodes,
1954
1958
  normalizePromoCode,