@timardex/cluemart-server-shared 1.0.99 → 1.0.100

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.cjs CHANGED
@@ -1704,9 +1704,10 @@ __export(index_exports, {
1704
1704
  convertObjectIdsToStrings: () => convertObjectIdsToStrings,
1705
1705
  dateTimeSchema: () => dateTimeSchema3,
1706
1706
  express: () => import_express.default,
1707
+ findEventOrImportedMarketById: () => findEventOrImportedMarketById,
1707
1708
  locationGeoSchema: () => locationGeoSchema,
1708
1709
  locationsSchema: () => locationsSchema,
1709
- mongoose: () => import_mongoose23.default,
1710
+ mongoose: () => import_mongoose24.default,
1710
1711
  refundPolicySchema: () => refundPolicySchema,
1711
1712
  relationDatesSchema: () => relationDatesSchema,
1712
1713
  resourceRelationsSchema: () => resourceRelationsSchema,
@@ -12166,9 +12167,22 @@ function convertObjectIdsToStrings(obj) {
12166
12167
  return obj;
12167
12168
  }
12168
12169
 
12170
+ // src/service/event.ts
12171
+ async function findEventOrImportedMarketById(resourceId) {
12172
+ if (!resourceId) {
12173
+ return null;
12174
+ }
12175
+ const normalizedId = convertObjectIdsToStrings(resourceId);
12176
+ const [eventDoc, googleImportedDoc] = await Promise.all([
12177
+ EventModel.findById(normalizedId).select("_id name").lean().exec(),
12178
+ GoogleImportedMarketModel.findById(normalizedId).select("_id name").lean().exec()
12179
+ ]);
12180
+ return eventDoc ?? googleImportedDoc;
12181
+ }
12182
+
12169
12183
  // src/types/index.ts
12170
12184
  var import_express = __toESM(require("express"));
12171
- var import_mongoose23 = __toESM(require("mongoose"));
12185
+ var import_mongoose24 = __toESM(require("mongoose"));
12172
12186
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
12173
12187
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
12174
12188
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -12209,6 +12223,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
12209
12223
  convertObjectIdsToStrings,
12210
12224
  dateTimeSchema,
12211
12225
  express,
12226
+ findEventOrImportedMarketById,
12212
12227
  locationGeoSchema,
12213
12228
  locationsSchema,
12214
12229
  mongoose,