@timardex/cluemart-shared 1.2.30 → 1.2.32

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.
Files changed (44) hide show
  1. package/dist/{ad-C02AZIGy.d.ts → ad-Cv1V8lgJ.d.ts} +1 -1
  2. package/dist/{ad-CTWMmc7b.d.mts → ad-IVwm5MLY.d.mts} +1 -1
  3. package/dist/{auth-o_ns6gLk.d.ts → auth-BCxQp_CF.d.ts} +1 -1
  4. package/dist/{auth-YsJJnj12.d.mts → auth-BczaOu28.d.mts} +1 -1
  5. package/dist/{chunk-BO3HICLR.mjs → chunk-4OLDTZXH.mjs} +3 -1
  6. package/dist/chunk-4OLDTZXH.mjs.map +1 -0
  7. package/dist/{chunk-O6LVIQFK.mjs → chunk-NPHPFWQH.mjs} +3 -6
  8. package/dist/chunk-NPHPFWQH.mjs.map +1 -0
  9. package/dist/formFields/index.d.mts +2 -1
  10. package/dist/formFields/index.d.ts +2 -1
  11. package/dist/{global-4lS-fh61.d.ts → global-Bnr6l_NH.d.ts} +1 -0
  12. package/dist/{global-_ZHkOcnR.d.mts → global-_89-F0iL.d.mts} +1 -0
  13. package/dist/graphql/index.d.mts +3 -2
  14. package/dist/graphql/index.d.ts +3 -2
  15. package/dist/hooks/index.d.mts +4 -3
  16. package/dist/hooks/index.d.ts +4 -3
  17. package/dist/index.cjs +78 -84
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.mts +11 -11
  20. package/dist/index.d.ts +11 -11
  21. package/dist/index.mjs +77 -84
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/mongoose/index.cjs +65 -77
  24. package/dist/mongoose/index.cjs.map +1 -1
  25. package/dist/mongoose/index.d.mts +6 -13
  26. package/dist/mongoose/index.d.ts +6 -13
  27. package/dist/mongoose/index.mjs +13 -25
  28. package/dist/mongoose/index.mjs.map +1 -1
  29. package/dist/service/index.cjs +18 -12
  30. package/dist/service/index.cjs.map +1 -1
  31. package/dist/service/index.d.mts +9 -2
  32. package/dist/service/index.d.ts +9 -2
  33. package/dist/service/index.mjs +12 -6
  34. package/dist/service/index.mjs.map +1 -1
  35. package/dist/types/index.cjs +15 -2
  36. package/dist/types/index.cjs.map +1 -1
  37. package/dist/types/index.d.mts +5 -4
  38. package/dist/types/index.d.ts +5 -4
  39. package/dist/types/index.mjs +5 -3
  40. package/dist/utils/index.d.mts +2 -1
  41. package/dist/utils/index.d.ts +2 -1
  42. package/package.json +3 -1
  43. package/dist/chunk-BO3HICLR.mjs.map +0 -1
  44. package/dist/chunk-O6LVIQFK.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { EnumOSPlatform, EnumResourceType, EnumUserLicence, EnumUserRole } from './enums/index.js';
2
- import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-4lS-fh61.js';
2
+ import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-Bnr6l_NH.js';
3
3
 
4
4
  interface TestersFormData {
5
5
  categories?: Category[] | null;
@@ -1,5 +1,5 @@
1
1
  import { EnumOSPlatform, EnumResourceType, EnumUserLicence, EnumUserRole } from './enums/index.mjs';
2
- import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-_ZHkOcnR.mjs';
2
+ import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-_89-F0iL.mjs';
3
3
 
4
4
  interface TestersFormData {
5
5
  categories?: Category[] | null;
@@ -1,4 +1,4 @@
1
- import { a3 as CreateFormData, T as TermsAgreement } from './global-4lS-fh61.js';
1
+ import { a3 as CreateFormData, T as TermsAgreement } from './global-Bnr6l_NH.js';
2
2
  import { EnumOSPlatform } from './enums/index.js';
3
3
 
4
4
  type ContactUsFormData = {
@@ -1,4 +1,4 @@
1
- import { a3 as CreateFormData, T as TermsAgreement } from './global-_ZHkOcnR.mjs';
1
+ import { a3 as CreateFormData, T as TermsAgreement } from './global-_89-F0iL.mjs';
2
2
  import { EnumOSPlatform } from './enums/index.mjs';
3
3
 
4
4
  type ContactUsFormData = {
@@ -1,4 +1,5 @@
1
1
  // src/types/global.ts
2
+ import mongoose from "mongoose";
2
3
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
3
4
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
4
5
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -18,7 +19,8 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
18
19
  })(EnumActivity || {});
19
20
 
20
21
  export {
22
+ mongoose,
21
23
  EnumPubSubEvents,
22
24
  EnumActivity
23
25
  };
24
- //# sourceMappingURL=chunk-BO3HICLR.mjs.map
26
+ //# sourceMappingURL=chunk-4OLDTZXH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/global.ts","../src/types/resourceActivities.ts"],"sourcesContent":["import { Request } from \"express\";\nimport mongoose from \"mongoose\";\nimport {\n Control,\n FieldErrors,\n FieldValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport { SchemaChatType } from \"src/mongoose/Chat\";\nimport { SchemaNotificationType } from \"src/mongoose/Notification\";\n\nimport { EnumResourceType, EnumSocialMedia, EnumUserLicence } from \"../enums\";\n\nimport { EventType } from \"./event\";\nimport { NotificationCount } from \"./notification\";\nimport { RelationDate } from \"./relation\";\nimport { VendorType } from \"./vendor\";\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type PartnerType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: EnumUserLicence;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n contactDetails?: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n partners?: PartnerType[] | null;\n promoCodes?: string[] | null;\n region: string;\n socialMedia?: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\" | \"owner\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: string;\n deletedAt: string | null;\n owner: OwnerType;\n posterUsage?: PosterUsageType | null;\n relations:\n | {\n relationId: string | null;\n relationDates: RelationDate[] | null;\n }[]\n | null;\n updatedAt: string;\n};\n\nexport type LocationType = {\n city: string;\n coordinates: number[]; // [longitude, latitude]\n country: string;\n fullAddress: string;\n latitude: number;\n longitude: number;\n region: string;\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type DateTimeType = {\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type MapMultiLocation = {\n dateTime: DateTimeType | null;\n location: LocationType | null;\n resourceId?: string;\n resourceName?: string;\n resourceType?: EnumResourceType;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: { errors: FieldErrors<T> };\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n}\n\nexport type ObjectId = mongoose.Schema.Types.ObjectId;\n\nexport enum EnumPubSubEvents {\n GET_CHAT_MESSAGE = \"GET_CHAT_MESSAGE\",\n GET_NOTIFICATIONS = \"GET_NOTIFICATIONS\",\n GET_NOTIFICATIONS_COUNT = \"GET_NOTIFICATIONS_COUNT\",\n USER_TYPING = \"USER_TYPING\",\n}\n\nexport interface AuthUser {\n email: string;\n role: string;\n userId: ObjectId;\n}\n\nexport interface SubscriptionPayload {\n getChatMessage?: SchemaChatType;\n userTyping?: SchemaChatType; // NOT USED\n getNotifications?: SchemaNotificationType[];\n // Used only for filtering; not part of the GraphQL schema output\n getNotificationsUserId?: ObjectId;\n getNotificationsCount?: NotificationCount & { userId: ObjectId };\n}\n\nexport interface GraphQLContext {\n user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: Request;\n response: Response;\n}\n\nexport { mongoose };\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":";AACA,OAAO,cAAc;AA6Nd,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,sBAAmB;AACnB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,6BAA0B;AAC1B,EAAAA,kBAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;AC5NL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,UAAO;AALG,SAAAA;AAAA,GAAA;","names":["EnumPubSubEvents","EnumActivity"]}
@@ -37,10 +37,7 @@ var schema = new MongooseSchema(
37
37
  );
38
38
  schema.index({ isRead: 1, userId: 1 });
39
39
  schema.index({ createdAt: -1, userId: 1 });
40
- var NotificationModel = mongoose.model(
41
- "Notification",
42
- schema
43
- );
40
+ var NotificationModel = mongoose.models.Notification || mongoose.model("Notification", schema);
44
41
 
45
42
  // src/mongoose/PushToken.ts
46
43
  import mongoose2 from "mongoose";
@@ -57,10 +54,10 @@ var schema2 = new MongooseSchema2(
57
54
  },
58
55
  { timestamps: true }
59
56
  );
60
- var PushTokenModel = mongoose2.model("PushToken", schema2);
57
+ var PushTokenModel = mongoose2.models.PushToken || mongoose2.model("PushToken", schema2);
61
58
 
62
59
  export {
63
60
  NotificationModel,
64
61
  PushTokenModel
65
62
  };
66
- //# sourceMappingURL=chunk-O6LVIQFK.mjs.map
63
+ //# sourceMappingURL=chunk-NPHPFWQH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/mongoose/Notification.ts","../src/mongoose/PushToken.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { EnumNotificationResourceType, EnumNotificationType } from \"src/enums\";\nimport {\n CreateBulkNotificationInput,\n NotificationType,\n ObjectId,\n} from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\nexport type SchemaCreateBulkNotificationInput = Omit<\n CreateBulkNotificationInput,\n \"userIds\"\n> & {\n userIds: ObjectId[];\n};\n\nexport type SchemaNotificationType = Omit<NotificationType, \"userId\"> & {\n userId: ObjectId;\n};\n/**\n * Schema for storing in-app notifications\n * Each notification is tied to a specific user and can be marked as read/unread\n */\nconst schema = new MongooseSchema<SchemaNotificationType>(\n {\n data: {\n resourceId: { required: true, type: String },\n resourceName: { required: true, type: String },\n resourceType: {\n enum: Object.values(EnumNotificationResourceType),\n required: true,\n type: String,\n },\n },\n isRead: { default: false, index: true, required: true, type: Boolean },\n message: { required: true, type: String },\n title: { required: true, type: String },\n type: {\n default: EnumNotificationType.SYSTEM,\n enum: Object.values(EnumNotificationType),\n required: true,\n type: String,\n },\n userId: {\n ref: \"User\",\n required: true,\n type: mongoose.Schema.Types.ObjectId,\n },\n },\n { timestamps: true },\n);\n\n// Compound index for efficient queries\nschema.index({ isRead: 1, userId: 1 });\nschema.index({ createdAt: -1, userId: 1 });\n\nexport const NotificationModel =\n (mongoose.models.Notification as mongoose.Model<SchemaNotificationType>) ||\n mongoose.model<SchemaNotificationType>(\"Notification\", schema);\n","import mongoose from \"mongoose\";\n\nimport { EnumOSPlatform } from \"src/enums\";\nimport { ObjectId } from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\ntype PushTokenType = {\n _id: string;\n createdAt: Date;\n platform: EnumOSPlatform;\n token: string;\n updatedAt: Date;\n userId: string;\n};\n\nexport type SchemaPushTokenType = Omit<PushTokenType, \"userId\"> & {\n userId: ObjectId;\n};\n\n/**\n * This is the schema for the push token type.\n * It is used to define the structure of the push token type in the database.\n * The schema is used by Mongoose to create a model for the push token type.\n */\nconst schema = new MongooseSchema<SchemaPushTokenType>(\n {\n platform: {\n enum: Object.values(EnumOSPlatform),\n required: true,\n type: String,\n },\n token: { required: true, type: String },\n userId: { required: true, type: mongoose.Schema.Types.ObjectId },\n },\n { timestamps: true },\n);\n\nexport const PushTokenModel =\n (mongoose.models.PushToken as mongoose.Model<SchemaPushTokenType>) ||\n mongoose.model<SchemaPushTokenType>(\"PushToken\", schema);\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;AASrB,IAAM,iBAAiB,SAAS;AAgBhC,IAAM,SAAS,IAAI;AAAA,EACjB;AAAA,IACE,MAAM;AAAA,MACJ,YAAY,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC3C,cAAc,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC7C,cAAc;AAAA,QACZ,MAAM,OAAO,OAAO,4BAA4B;AAAA,QAChD,UAAU;AAAA,QACV,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,QAAQ,EAAE,SAAS,OAAO,OAAO,MAAM,UAAU,MAAM,MAAM,QAAQ;AAAA,IACrE,SAAS,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACxC,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,MAAM;AAAA,MACJ;AAAA,MACA,MAAM,OAAO,OAAO,oBAAoB;AAAA,MACxC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,KAAK;AAAA,MACL,UAAU;AAAA,MACV,MAAM,SAAS,OAAO,MAAM;AAAA,IAC9B;AAAA,EACF;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAGA,OAAO,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;AACrC,OAAO,MAAM,EAAE,WAAW,IAAI,QAAQ,EAAE,CAAC;AAElC,IAAM,oBACV,SAAS,OAAO,gBACjB,SAAS,MAA8B,gBAAgB,MAAM;;;AC5D/D,OAAOA,eAAc;AAKrB,IAAMC,kBAAiBC,UAAS;AAoBhC,IAAMC,UAAS,IAAIF;AAAA,EACjB;AAAA,IACE,UAAU;AAAA,MACR,MAAM,OAAO,OAAO,cAAc;AAAA,MAClC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,QAAQ,EAAE,UAAU,MAAM,MAAMC,UAAS,OAAO,MAAM,SAAS;AAAA,EACjE;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAEO,IAAM,iBACVA,UAAS,OAAO,aACjBA,UAAS,MAA2B,aAAaC,OAAM;","names":["mongoose","MongooseSchema","mongoose","schema"]}
@@ -1,4 +1,5 @@
1
- import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-_ZHkOcnR.mjs';
1
+ import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-_89-F0iL.mjs';
2
+ import 'express';
2
3
  import 'mongoose';
3
4
  import 'react-hook-form';
4
5
  import '../enums/index.mjs';
@@ -1,4 +1,5 @@
1
- import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-4lS-fh61.js';
1
+ import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-Bnr6l_NH.js';
2
+ import 'express';
2
3
  import 'mongoose';
3
4
  import 'react-hook-form';
4
5
  import '../enums/index.js';
@@ -1,3 +1,4 @@
1
+ import { Request } from 'express';
1
2
  import mongoose from 'mongoose';
2
3
  import { FieldValues, Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
3
4
  import { EnumChatType, EnumEventType, EnumPaymentMethod, EnumInviteStatus, EnumResourceType, EnumRelationResource, EnumVendorType, EnumFoodFlavor, EnumNotificationType, EnumNotificationResourceType, EnumUserLicence, EnumSocialMedia } from './enums/index.js';
@@ -1,3 +1,4 @@
1
+ import { Request } from 'express';
1
2
  import mongoose from 'mongoose';
2
3
  import { FieldValues, Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
3
4
  import { EnumChatType, EnumEventType, EnumPaymentMethod, EnumInviteStatus, EnumResourceType, EnumRelationResource, EnumVendorType, EnumFoodFlavor, EnumNotificationType, EnumNotificationResourceType, EnumUserLicence, EnumSocialMedia } from './enums/index.mjs';
@@ -1,8 +1,9 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
- import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-_ZHkOcnR.mjs';
2
+ import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-_89-F0iL.mjs';
3
3
  import { EnumResourceType } from '../enums/index.mjs';
4
- import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-CTWMmc7b.mjs';
4
+ import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-IVwm5MLY.mjs';
5
5
  import { R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
6
+ import 'express';
6
7
  import 'mongoose';
7
8
  import 'react-hook-form';
8
9
 
@@ -1,8 +1,9 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
- import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-4lS-fh61.js';
2
+ import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-Bnr6l_NH.js';
3
3
  import { EnumResourceType } from '../enums/index.js';
4
- import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-C02AZIGy.js';
4
+ import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-Cv1V8lgJ.js';
5
5
  import { R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
6
+ import 'express';
6
7
  import 'mongoose';
7
8
  import 'react-hook-form';
8
9
 
@@ -1,6 +1,7 @@
1
- import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-_ZHkOcnR.mjs';
2
- import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-CTWMmc7b.mjs';
3
- import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-YsJJnj12.mjs';
1
+ import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-_89-F0iL.mjs';
2
+ import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-IVwm5MLY.mjs';
3
+ import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-BczaOu28.mjs';
4
+ import 'express';
4
5
  import 'mongoose';
5
6
  import 'react-hook-form';
6
7
  import '../enums/index.mjs';
@@ -1,6 +1,7 @@
1
- import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-4lS-fh61.js';
2
- import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-C02AZIGy.js';
3
- import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-o_ns6gLk.js';
1
+ import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-Bnr6l_NH.js';
2
+ import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-Cv1V8lgJ.js';
3
+ import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-BCxQp_CF.js';
4
+ import 'express';
4
5
  import 'mongoose';
5
6
  import 'react-hook-form';
6
7
  import '../enums/index.js';
package/dist/index.cjs CHANGED
@@ -112,6 +112,7 @@ __export(index_exports, {
112
112
  loginFields: () => loginFields,
113
113
  mapArrayToOptions: () => mapArrayToOptions,
114
114
  mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
115
+ mongoose: () => import_mongoose.default,
115
116
  normalizeUrl: () => normalizeUrl,
116
117
  packagingOptions: () => packagingOptions,
117
118
  partnersSchema: () => partnersSchema,
@@ -6194,9 +6195,10 @@ function useAdForm(data) {
6194
6195
  }
6195
6196
 
6196
6197
  // src/mongoose/Ad.ts
6197
- var import_mongoose4 = __toESM(require("mongoose"));
6198
+ var import_mongoose5 = __toESM(require("mongoose"));
6198
6199
 
6199
6200
  // src/types/global.ts
6201
+ var import_mongoose = __toESM(require("mongoose"));
6200
6202
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
6201
6203
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
6202
6204
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -6216,14 +6218,14 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
6216
6218
  })(EnumActivity || {});
6217
6219
 
6218
6220
  // src/mongoose/global.ts
6219
- var import_mongoose3 = __toESM(require("mongoose"));
6221
+ var import_mongoose4 = __toESM(require("mongoose"));
6220
6222
 
6221
6223
  // src/mongoose/Relation.ts
6222
- var import_mongoose2 = __toESM(require("mongoose"));
6224
+ var import_mongoose3 = __toESM(require("mongoose"));
6223
6225
 
6224
6226
  // src/mongoose/event/EventInfo.ts
6225
- var import_mongoose = __toESM(require("mongoose"));
6226
- var MongooseSchema = import_mongoose.default.Schema;
6227
+ var import_mongoose2 = __toESM(require("mongoose"));
6228
+ var MongooseSchema = import_mongoose2.default.Schema;
6227
6229
  var StallTypeSchema = new MongooseSchema(
6228
6230
  {
6229
6231
  electricity: {
@@ -6282,7 +6284,7 @@ var schema = new MongooseSchema(
6282
6284
  eventId: {
6283
6285
  ref: "Event",
6284
6286
  required: false,
6285
- type: import_mongoose.default.Schema.Types.ObjectId
6287
+ type: import_mongoose2.default.Schema.Types.ObjectId
6286
6288
  },
6287
6289
  packInTime: { required: true, type: Number },
6288
6290
  paymentDueHours: { required: true, type: Number },
@@ -6291,13 +6293,10 @@ var schema = new MongooseSchema(
6291
6293
  },
6292
6294
  { timestamps: true }
6293
6295
  );
6294
- var EventInfoModel = import_mongoose.default.model(
6295
- "EventInfo",
6296
- schema
6297
- );
6296
+ var EventInfoModel = import_mongoose2.default.models.EventInfo || import_mongoose2.default.model("EventInfo", schema);
6298
6297
 
6299
6298
  // src/mongoose/Relation.ts
6300
- var MongooseSchema2 = import_mongoose2.default.Schema;
6299
+ var MongooseSchema2 = import_mongoose3.default.Schema;
6301
6300
  var relationDatesSchema = new MongooseSchema2(
6302
6301
  {
6303
6302
  lastUpdateBy: {
@@ -6322,13 +6321,13 @@ var RelationTypeSchema = new MongooseSchema2(
6322
6321
  chatId: {
6323
6322
  ref: "Chat",
6324
6323
  required: true,
6325
- type: import_mongoose2.default.Schema.Types.ObjectId
6324
+ type: import_mongoose3.default.Schema.Types.ObjectId
6326
6325
  },
6327
6326
  deletedAt: { default: null, required: false, type: Date },
6328
6327
  eventId: {
6329
6328
  ref: "Event",
6330
6329
  required: true,
6331
- type: import_mongoose2.default.Schema.Types.ObjectId
6330
+ type: import_mongoose3.default.Schema.Types.ObjectId
6332
6331
  },
6333
6332
  lastUpdateBy: {
6334
6333
  enum: Object.values(EnumResourceType),
@@ -6344,7 +6343,7 @@ var RelationTypeSchema = new MongooseSchema2(
6344
6343
  vendorId: {
6345
6344
  ref: "Vendor",
6346
6345
  required: true,
6347
- type: import_mongoose2.default.Schema.Types.ObjectId
6346
+ type: import_mongoose3.default.Schema.Types.ObjectId
6348
6347
  }
6349
6348
  },
6350
6349
  { timestamps: true }
@@ -6354,20 +6353,17 @@ RelationTypeSchema.index({
6354
6353
  "relationDates.startTime": 1,
6355
6354
  "relationDates.status": 1
6356
6355
  });
6357
- var RelationModel = import_mongoose2.default.model(
6358
- "Relation",
6359
- RelationTypeSchema
6360
- );
6356
+ var RelationModel = import_mongoose3.default.models.Relation || import_mongoose3.default.model("Relation", RelationTypeSchema);
6361
6357
 
6362
6358
  // src/mongoose/global.ts
6363
- var MongooseSchema3 = import_mongoose3.default.Schema;
6359
+ var MongooseSchema3 = import_mongoose4.default.Schema;
6364
6360
  var OwnerTypeSchema = new MongooseSchema3(
6365
6361
  {
6366
6362
  email: { required: true, type: String },
6367
6363
  userId: {
6368
6364
  ref: "User",
6369
6365
  required: true,
6370
- type: import_mongoose3.default.Schema.Types.ObjectId
6366
+ type: import_mongoose4.default.Schema.Types.ObjectId
6371
6367
  }
6372
6368
  },
6373
6369
  { _id: false }
@@ -6477,7 +6473,7 @@ var resourceRelationsSchema = new MongooseSchema3(
6477
6473
  relationId: {
6478
6474
  ref: "Relation",
6479
6475
  required: false,
6480
- type: import_mongoose3.default.Schema.Types.ObjectId
6476
+ type: import_mongoose4.default.Schema.Types.ObjectId
6481
6477
  }
6482
6478
  },
6483
6479
  { _id: false }
@@ -6487,7 +6483,7 @@ var baseResourceFields = {
6487
6483
  adIds: {
6488
6484
  ref: "Ad",
6489
6485
  required: false,
6490
- type: [import_mongoose3.default.Schema.Types.ObjectId]
6486
+ type: [import_mongoose4.default.Schema.Types.ObjectId]
6491
6487
  },
6492
6488
  contactDetails: ContactDetailsSchema,
6493
6489
  cover: ResourceImageTypeSchema,
@@ -6514,7 +6510,7 @@ var baseResourceFields = {
6514
6510
  };
6515
6511
 
6516
6512
  // src/mongoose/Ad.ts
6517
- var MongooseSchema4 = import_mongoose4.default.Schema;
6513
+ var MongooseSchema4 = import_mongoose5.default.Schema;
6518
6514
  var schema2 = new MongooseSchema4(
6519
6515
  {
6520
6516
  active: { default: true, type: Boolean },
@@ -6572,11 +6568,11 @@ schema2.index({
6572
6568
  start: 1,
6573
6569
  status: 1
6574
6570
  });
6575
- var AdModel = import_mongoose4.default.model("Ad", schema2);
6571
+ var AdModel = import_mongoose5.default.models.Ad || import_mongoose5.default.model("Ad", schema2);
6576
6572
 
6577
6573
  // src/mongoose/Chat.ts
6578
- var import_mongoose5 = __toESM(require("mongoose"));
6579
- var MongooseSchema5 = import_mongoose5.default.Schema;
6574
+ var import_mongoose6 = __toESM(require("mongoose"));
6575
+ var MongooseSchema5 = import_mongoose6.default.Schema;
6580
6576
  var MessageSchema = new MongooseSchema5(
6581
6577
  {
6582
6578
  content: { required: true, type: String },
@@ -6584,7 +6580,7 @@ var MessageSchema = new MongooseSchema5(
6584
6580
  senderId: {
6585
6581
  ref: "User",
6586
6582
  required: true,
6587
- type: import_mongoose5.default.Schema.Types.ObjectId
6583
+ type: import_mongoose6.default.Schema.Types.ObjectId
6588
6584
  },
6589
6585
  senderName: { required: true, type: String }
6590
6586
  },
@@ -6597,7 +6593,7 @@ var ParticipantSchema = new MongooseSchema5(
6597
6593
  userId: {
6598
6594
  ref: "User",
6599
6595
  required: true,
6600
- type: import_mongoose5.default.Schema.Types.ObjectId
6596
+ type: import_mongoose6.default.Schema.Types.ObjectId
6601
6597
  }
6602
6598
  },
6603
6599
  { _id: false }
@@ -6619,12 +6615,12 @@ var ChatSchema = new MongooseSchema5(
6619
6615
  eventId: {
6620
6616
  ref: "Event",
6621
6617
  required: false,
6622
- type: import_mongoose5.default.Schema.Types.ObjectId
6618
+ type: import_mongoose6.default.Schema.Types.ObjectId
6623
6619
  },
6624
6620
  vendorId: {
6625
6621
  ref: "Vendor",
6626
6622
  required: false,
6627
- type: import_mongoose5.default.Schema.Types.ObjectId
6623
+ type: import_mongoose6.default.Schema.Types.ObjectId
6628
6624
  }
6629
6625
  }
6630
6626
  },
@@ -6632,11 +6628,11 @@ var ChatSchema = new MongooseSchema5(
6632
6628
  timestamps: true
6633
6629
  }
6634
6630
  );
6635
- var ChatModel = import_mongoose5.default.model("Chat", ChatSchema);
6631
+ var ChatModel = import_mongoose6.default.models.Chat || import_mongoose6.default.model("Chat", ChatSchema);
6636
6632
 
6637
6633
  // src/mongoose/Notification.ts
6638
- var import_mongoose6 = __toESM(require("mongoose"));
6639
- var MongooseSchema6 = import_mongoose6.default.Schema;
6634
+ var import_mongoose7 = __toESM(require("mongoose"));
6635
+ var MongooseSchema6 = import_mongoose7.default.Schema;
6640
6636
  var schema3 = new MongooseSchema6(
6641
6637
  {
6642
6638
  data: {
@@ -6660,21 +6656,18 @@ var schema3 = new MongooseSchema6(
6660
6656
  userId: {
6661
6657
  ref: "User",
6662
6658
  required: true,
6663
- type: import_mongoose6.default.Schema.Types.ObjectId
6659
+ type: import_mongoose7.default.Schema.Types.ObjectId
6664
6660
  }
6665
6661
  },
6666
6662
  { timestamps: true }
6667
6663
  );
6668
6664
  schema3.index({ isRead: 1, userId: 1 });
6669
6665
  schema3.index({ createdAt: -1, userId: 1 });
6670
- var NotificationModel = import_mongoose6.default.model(
6671
- "Notification",
6672
- schema3
6673
- );
6666
+ var NotificationModel = import_mongoose7.default.models.Notification || import_mongoose7.default.model("Notification", schema3);
6674
6667
 
6675
6668
  // src/mongoose/PushToken.ts
6676
- var import_mongoose7 = __toESM(require("mongoose"));
6677
- var MongooseSchema7 = import_mongoose7.default.Schema;
6669
+ var import_mongoose8 = __toESM(require("mongoose"));
6670
+ var MongooseSchema7 = import_mongoose8.default.Schema;
6678
6671
  var schema4 = new MongooseSchema7(
6679
6672
  {
6680
6673
  platform: {
@@ -6683,15 +6676,15 @@ var schema4 = new MongooseSchema7(
6683
6676
  type: String
6684
6677
  },
6685
6678
  token: { required: true, type: String },
6686
- userId: { required: true, type: import_mongoose7.default.Schema.Types.ObjectId }
6679
+ userId: { required: true, type: import_mongoose8.default.Schema.Types.ObjectId }
6687
6680
  },
6688
6681
  { timestamps: true }
6689
6682
  );
6690
- var PushTokenModel = import_mongoose7.default.model("PushToken", schema4);
6683
+ var PushTokenModel = import_mongoose8.default.models.PushToken || import_mongoose8.default.model("PushToken", schema4);
6691
6684
 
6692
6685
  // src/mongoose/ResourceActivity.ts
6693
- var import_mongoose8 = __toESM(require("mongoose"));
6694
- var MongooseSchema8 = import_mongoose8.default.Schema;
6686
+ var import_mongoose9 = __toESM(require("mongoose"));
6687
+ var MongooseSchema8 = import_mongoose9.default.Schema;
6695
6688
  var ActivitySchema = new MongooseSchema8(
6696
6689
  {
6697
6690
  activityType: {
@@ -6737,11 +6730,11 @@ var schema5 = new MongooseSchema8(
6737
6730
  );
6738
6731
  schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
6739
6732
  schema5.index({ "views.location": "2dsphere" });
6740
- var ResourceActivityModel = import_mongoose8.default.model("ResourceActivity", schema5);
6733
+ var ResourceActivityModel = import_mongoose9.default.models.ResourceActivity || import_mongoose9.default.model("ResourceActivity", schema5);
6741
6734
 
6742
6735
  // src/mongoose/Testers.ts
6743
- var import_mongoose9 = __toESM(require("mongoose"));
6744
- var MongooseSchema9 = import_mongoose9.default.Schema;
6736
+ var import_mongoose10 = __toESM(require("mongoose"));
6737
+ var MongooseSchema9 = import_mongoose10.default.Schema;
6745
6738
  var TesterSchema = new MongooseSchema9(
6746
6739
  {
6747
6740
  active: { default: false, required: true, type: Boolean },
@@ -6766,17 +6759,17 @@ var TesterSchema = new MongooseSchema9(
6766
6759
  timestamps: true
6767
6760
  }
6768
6761
  );
6769
- var TesterModel = import_mongoose9.default.model("Tester", TesterSchema);
6762
+ var TesterModel = import_mongoose10.default.models.Tester || import_mongoose10.default.model("Tester", TesterSchema);
6770
6763
 
6771
6764
  // src/mongoose/User.ts
6772
- var import_mongoose10 = __toESM(require("mongoose"));
6773
- var MongooseSchema10 = import_mongoose10.default.Schema;
6765
+ var import_mongoose11 = __toESM(require("mongoose"));
6766
+ var MongooseSchema10 = import_mongoose11.default.Schema;
6774
6767
  var userActivityEventSchema = new MongooseSchema10(
6775
6768
  {
6776
6769
  resourceId: {
6777
6770
  ref: "Event",
6778
6771
  required: false,
6779
- type: import_mongoose10.default.Schema.Types.ObjectId
6772
+ type: import_mongoose11.default.Schema.Types.ObjectId
6780
6773
  },
6781
6774
  startDate: { required: false, type: String },
6782
6775
  startTime: { required: false, type: String }
@@ -6788,12 +6781,12 @@ var userActivityFavouritesSchema = new MongooseSchema10(
6788
6781
  events: {
6789
6782
  ref: "Event",
6790
6783
  required: false,
6791
- type: [import_mongoose10.default.Schema.Types.ObjectId]
6784
+ type: [import_mongoose11.default.Schema.Types.ObjectId]
6792
6785
  },
6793
6786
  vendors: {
6794
6787
  ref: "Vendor",
6795
6788
  required: false,
6796
- type: [import_mongoose10.default.Schema.Types.ObjectId]
6789
+ type: [import_mongoose11.default.Schema.Types.ObjectId]
6797
6790
  }
6798
6791
  },
6799
6792
  { _id: false }
@@ -6807,7 +6800,7 @@ var schema6 = new MongooseSchema10(
6807
6800
  events: {
6808
6801
  ref: "Event",
6809
6802
  required: false,
6810
- type: [import_mongoose10.default.Schema.Types.ObjectId]
6803
+ type: [import_mongoose11.default.Schema.Types.ObjectId]
6811
6804
  },
6812
6805
  firstName: { required: true, type: String },
6813
6806
  isTester: { default: false, required: false, type: Boolean },
@@ -6860,17 +6853,17 @@ var schema6 = new MongooseSchema10(
6860
6853
  vendor: {
6861
6854
  ref: "Vendor",
6862
6855
  required: false,
6863
- type: import_mongoose10.default.Schema.Types.ObjectId
6856
+ type: import_mongoose11.default.Schema.Types.ObjectId
6864
6857
  }
6865
6858
  },
6866
6859
  { timestamps: true }
6867
6860
  );
6868
6861
  schema6.index({ "partners.email": 1 });
6869
- var UserModel = import_mongoose10.default.model("User", schema6);
6862
+ var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema6);
6870
6863
 
6871
6864
  // src/mongoose/VerificationToken.ts
6872
- var import_mongoose11 = __toESM(require("mongoose"));
6873
- var MongooseSchema11 = import_mongoose11.default.Schema;
6865
+ var import_mongoose12 = __toESM(require("mongoose"));
6866
+ var MongooseSchema11 = import_mongoose12.default.Schema;
6874
6867
  var schema7 = new MongooseSchema11(
6875
6868
  {
6876
6869
  createdAt: {
@@ -6886,14 +6879,11 @@ var schema7 = new MongooseSchema11(
6886
6879
  },
6887
6880
  { timestamps: true }
6888
6881
  );
6889
- var VerificationTokenModel = import_mongoose11.default.model(
6890
- "VerificationToken",
6891
- schema7
6892
- );
6882
+ var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema7);
6893
6883
 
6894
6884
  // src/mongoose/vendor/Vendor.ts
6895
- var import_mongoose12 = __toESM(require("mongoose"));
6896
- var MongooseSchema12 = import_mongoose12.default.Schema;
6885
+ var import_mongoose13 = __toESM(require("mongoose"));
6886
+ var MongooseSchema12 = import_mongoose13.default.Schema;
6897
6887
  var MenuTypeSchema = new MongooseSchema12(
6898
6888
  {
6899
6889
  description: { required: false, type: String },
@@ -6948,7 +6938,7 @@ var schema8 = new MongooseSchema12(
6948
6938
  vendorInfoId: {
6949
6939
  ref: "VendorInfo",
6950
6940
  required: false,
6951
- type: import_mongoose12.default.Schema.Types.ObjectId
6941
+ type: import_mongoose13.default.Schema.Types.ObjectId
6952
6942
  },
6953
6943
  vendorType: {
6954
6944
  enum: Object.values(EnumVendorType),
@@ -6963,11 +6953,11 @@ schema8.index({ description: 1 });
6963
6953
  schema8.index({ region: 1 });
6964
6954
  schema8.index({ "categories.name": 1 });
6965
6955
  schema8.index({ "partners.email": 1 });
6966
- var VendorModel = import_mongoose12.default.model("Vendor", schema8);
6956
+ var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema8);
6967
6957
 
6968
6958
  // src/mongoose/vendor/VendorInfo.ts
6969
- var import_mongoose13 = __toESM(require("mongoose"));
6970
- var MongooseSchema13 = import_mongoose13.default.Schema;
6959
+ var import_mongoose14 = __toESM(require("mongoose"));
6960
+ var MongooseSchema13 = import_mongoose14.default.Schema;
6971
6961
  var AttributesSchema = new MongooseSchema13(
6972
6962
  {
6973
6963
  details: { required: false, type: String },
@@ -7009,19 +6999,16 @@ var schema9 = new MongooseSchema13(
7009
6999
  vendorId: {
7010
7000
  ref: "Vendor",
7011
7001
  required: true,
7012
- type: import_mongoose13.default.Schema.Types.ObjectId
7002
+ type: import_mongoose14.default.Schema.Types.ObjectId
7013
7003
  }
7014
7004
  },
7015
7005
  { timestamps: true }
7016
7006
  );
7017
- var VendorInfoModel = import_mongoose13.default.model(
7018
- "VendorInfo",
7019
- schema9
7020
- );
7007
+ var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema9);
7021
7008
 
7022
7009
  // src/mongoose/event/Event.ts
7023
- var import_mongoose14 = __toESM(require("mongoose"));
7024
- var MongooseSchema14 = import_mongoose14.default.Schema;
7010
+ var import_mongoose15 = __toESM(require("mongoose"));
7011
+ var MongooseSchema14 = import_mongoose15.default.Schema;
7025
7012
  var locationsSchema = new MongooseSchema14(
7026
7013
  {
7027
7014
  city: { required: true, type: String },
@@ -7063,7 +7050,7 @@ var schema10 = new MongooseSchema14(
7063
7050
  eventInfoId: {
7064
7051
  ref: "EventInfo",
7065
7052
  required: false,
7066
- type: import_mongoose14.default.Schema.Types.ObjectId
7053
+ type: import_mongoose15.default.Schema.Types.ObjectId
7067
7054
  },
7068
7055
  eventType: {
7069
7056
  enum: Object.values(EnumEventType),
@@ -7087,10 +7074,10 @@ schema10.index({ region: 1 });
7087
7074
  schema10.index({ location: "2dsphere" });
7088
7075
  schema10.index({ tags: 1 });
7089
7076
  schema10.index({ "partners.email": 1 });
7090
- var EventModel = import_mongoose14.default.model("Event", schema10);
7077
+ var EventModel = import_mongoose15.default.models.Event || import_mongoose15.default.model("Event", schema10);
7091
7078
 
7092
7079
  // src/service/database.ts
7093
- var import_mongoose15 = __toESM(require("mongoose"));
7080
+ var import_mongoose16 = __toESM(require("mongoose"));
7094
7081
 
7095
7082
  // src/service/timezonePlugin.ts
7096
7083
  var import_dayjs3 = __toESM(require("dayjs"));
@@ -7112,15 +7099,21 @@ function timezonePlugin(schema11) {
7112
7099
  }
7113
7100
 
7114
7101
  // src/service/database.ts
7115
- import_mongoose15.default.plugin(timezonePlugin);
7116
- var connectToDatabase = async () => {
7102
+ import_mongoose16.default.plugin(timezonePlugin);
7103
+ var connectToDatabase = async ({
7104
+ appName,
7105
+ dbName,
7106
+ dbPassword,
7107
+ dbUser,
7108
+ mongodbUri
7109
+ }) => {
7117
7110
  try {
7118
- const mongoUri = process.env.MONGODB_URI ? process.env.MONGODB_URI : (
7111
+ const mongoUri = mongodbUri ? mongodbUri : (
7119
7112
  // Fallback to MongoDB Atlas connection string
7120
- `mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_NAME}.mongodb.net/?retryWrites=true&w=majority&appName=${process.env.APP_NAME}`
7113
+ `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
7121
7114
  );
7122
- await import_mongoose15.default.connect(mongoUri);
7123
- const connectionType = process.env.MONGODB_URI ? "Local MongoDB" : "MongoDB Atlas";
7115
+ await import_mongoose16.default.connect(mongoUri);
7116
+ const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
7124
7117
  console.log(
7125
7118
  `${connectionType} connected from server/src/service/database.ts`
7126
7119
  );
@@ -7417,6 +7410,7 @@ var fonts = {
7417
7410
  loginFields,
7418
7411
  mapArrayToOptions,
7419
7412
  mapBaseResourceTypeToFormData,
7413
+ mongoose,
7420
7414
  normalizeUrl,
7421
7415
  packagingOptions,
7422
7416
  partnersSchema,