@timardex/cluemart-server-shared 1.0.78 → 1.0.80

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.
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
2
+ import { AdType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-DjrJ0LKo.mjs';
5
5
  export { C as ChatModel, N as NotificationModel, P as ParticipantSchema, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-DjrJ0LKo.mjs';
@@ -111,6 +111,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
111
111
  } & {
112
112
  __v: number;
113
113
  }>;
114
+ declare const locationGeoSchema: mongoose.Schema<LocationGeoType, mongoose.Model<LocationGeoType, any, any, any, mongoose.Document<unknown, any, LocationGeoType, any, {}> & LocationGeoType & {
115
+ _id: mongoose.Types.ObjectId;
116
+ } & {
117
+ __v: number;
118
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationGeoType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationGeoType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationGeoType> & {
119
+ _id: mongoose.Types.ObjectId;
120
+ } & {
121
+ __v: number;
122
+ }>;
114
123
  declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
115
124
  _id: mongoose.Types.ObjectId;
116
125
  } & {
@@ -504,4 +513,4 @@ declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongo
504
513
  __v: number;
505
514
  }, any>;
506
515
 
507
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, EventInfoModel, EventModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
516
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, EventInfoModel, EventModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
2
+ import { AdType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-DjrJ0LKo.js';
5
5
  export { C as ChatModel, N as NotificationModel, P as ParticipantSchema, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-DjrJ0LKo.js';
@@ -111,6 +111,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
111
111
  } & {
112
112
  __v: number;
113
113
  }>;
114
+ declare const locationGeoSchema: mongoose.Schema<LocationGeoType, mongoose.Model<LocationGeoType, any, any, any, mongoose.Document<unknown, any, LocationGeoType, any, {}> & LocationGeoType & {
115
+ _id: mongoose.Types.ObjectId;
116
+ } & {
117
+ __v: number;
118
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationGeoType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationGeoType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationGeoType> & {
119
+ _id: mongoose.Types.ObjectId;
120
+ } & {
121
+ __v: number;
122
+ }>;
114
123
  declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
115
124
  _id: mongoose.Types.ObjectId;
116
125
  } & {
@@ -504,4 +513,4 @@ declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongo
504
513
  __v: number;
505
514
  }, any>;
506
515
 
507
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, EventInfoModel, EventModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
516
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, EventInfoModel, EventModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
@@ -26,12 +26,13 @@ import {
26
26
  associatesSchema,
27
27
  baseResourceFields,
28
28
  dateTimeSchema,
29
+ locationGeoSchema,
29
30
  locationsSchema,
30
31
  relationDatesSchema,
31
32
  resourceRelationsSchema,
32
33
  termsAgreementSchema,
33
34
  userLicenseSchema
34
- } from "../chunk-TPZF5OZA.mjs";
35
+ } from "../chunk-OKVJLUMS.mjs";
35
36
  import "../chunk-3QS3WKRC.mjs";
36
37
  export {
37
38
  APP_SETTINGS_ID,
@@ -61,6 +62,7 @@ export {
61
62
  associatesSchema,
62
63
  baseResourceFields,
63
64
  dateTimeSchema,
65
+ locationGeoSchema,
64
66
  locationsSchema,
65
67
  relationDatesSchema,
66
68
  resourceRelationsSchema,
@@ -8490,17 +8490,25 @@ var CONTACT_DETAILS_FIELDS_FRAGMENT = gql`
8490
8490
  mobilePhone
8491
8491
  }
8492
8492
  `;
8493
+ var LOCATION_GEO_FIELDS_FRAGMENT = gql`
8494
+ fragment LocationGeoFields on LocationGeoType {
8495
+ coordinates
8496
+ type
8497
+ }
8498
+ `;
8493
8499
  var LOCATION_FIELDS_FRAGMENT = gql`
8494
8500
  fragment LocationFields on LocationType {
8495
8501
  city
8496
- coordinates
8497
8502
  country
8498
8503
  fullAddress
8504
+ geo {
8505
+ ...LocationGeoFields
8506
+ }
8499
8507
  latitude
8500
8508
  longitude
8501
8509
  region
8502
- type
8503
8510
  }
8511
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
8504
8512
  `;
8505
8513
  var EVENT_LIST_ITEM = gql`
8506
8514
  fragment EventListItemFields on EventListItemType {
@@ -8803,14 +8811,16 @@ var GET_TESTER = gql`
8803
8811
  var VENDOR_LOCATION_FIELDS_FRAGMENT = gql`
8804
8812
  fragment VendorLocationFields on VendorLocationType {
8805
8813
  city
8806
- coordinates
8807
8814
  country
8808
8815
  fullAddress
8816
+ geo {
8817
+ ...LocationGeoFields
8818
+ }
8809
8819
  latitude
8810
8820
  longitude
8811
8821
  region
8812
- type
8813
8822
  }
8823
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
8814
8824
  `;
8815
8825
  var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
8816
8826
  fragment VendorDateTimeFields on VendorDateTimeType {
@@ -9159,6 +9169,7 @@ var CHAT_FIELDS_FRAGMENT = gql`
9159
9169
  participants {
9160
9170
  ...ChatParticipantFields
9161
9171
  }
9172
+ region
9162
9173
  updatedAt
9163
9174
  }
9164
9175
  ${CHAT_MESSAGE_FIELDS_FRAGMENT}
@@ -9180,6 +9191,14 @@ var USER_CHATS = gql`
9180
9191
  }
9181
9192
  ${CHAT_FIELDS_FRAGMENT}
9182
9193
  `;
9194
+ var GET_CHATS_BY_REGION = gql`
9195
+ query getChatsByRegion($region: String!) {
9196
+ chatsByRegion(region: $region) {
9197
+ ...ChatFields
9198
+ }
9199
+ }
9200
+ ${CHAT_FIELDS_FRAGMENT}
9201
+ `;
9183
9202
  var SEND_CHAT_MESSAGE_MUTATION = gql`
9184
9203
  mutation sendChatMessage($_id: ID!, $input: ChatMessageInputType!) {
9185
9204
  sendChatMessage(_id: $_id, input: $input) {
@@ -9203,7 +9222,10 @@ var ADD_PARTICIPANT_TO_CHAT_MUTATION = gql`
9203
9222
  `;
9204
9223
  var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = gql`
9205
9224
  mutation removeParticipantFromChat($chatId: ID!, $userId: ID!) {
9206
- removeParticipantFromChat(chatId: $chatId, userId: $userId)
9225
+ removeParticipantFromChat(chatId: $chatId, userId: $userId) {
9226
+ success
9227
+ region
9228
+ }
9207
9229
  }
9208
9230
  `;
9209
9231
  var TOGGLE_CHAT_MESSAGE_LIKE_MUTATION = gql`
@@ -9885,8 +9907,7 @@ var RESOURCE_ACTIVITY_FIELDS_FRAGMENT = gql`
9885
9907
  activity {
9886
9908
  activityType
9887
9909
  location {
9888
- type
9889
- coordinates
9910
+ ...LocationGeoFields
9890
9911
  }
9891
9912
  dateStatus
9892
9913
  startDate
@@ -9896,6 +9917,7 @@ var RESOURCE_ACTIVITY_FIELDS_FRAGMENT = gql`
9896
9917
  userId
9897
9918
  }
9898
9919
  }
9920
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
9899
9921
  `;
9900
9922
  var GET_RESOURCE_ACTIVITY = gql`
9901
9923
  query getResourceActivity(
@@ -10297,16 +10319,18 @@ var dateTimeWithPriceSchema = dateTimeSchema.shape({
10297
10319
  });
10298
10320
  var locationSchema = create$3().shape({
10299
10321
  city: create$6().label("City").required("City is required"),
10300
- coordinates: create$2().of(create$5().required("Coordinates must be numbers")).length(
10301
- 2,
10302
- "Coordinates must contain exactly two numbers (longitude, latitude)"
10303
- ).required("Coordinates are required"),
10304
10322
  country: create$6().label("Country").required("Country is required"),
10305
10323
  fullAddress: create$6().label("Address").required("Address is required"),
10324
+ geo: create$3().shape({
10325
+ coordinates: create$2().of(create$5().required("Coordinates must be numbers")).length(
10326
+ 2,
10327
+ "Coordinates must contain exactly two numbers (longitude, latitude)"
10328
+ ).required("Coordinates are required"),
10329
+ type: create$6().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
10330
+ }),
10306
10331
  latitude: create$5().label("Latitude").required("Latitude is required"),
10307
10332
  longitude: create$5().label("Longitude").required("Longitude is required"),
10308
- region: create$6().label("Region").required("Region is required"),
10309
- type: create$6().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
10333
+ region: create$6().label("Region").required("Region is required")
10310
10334
  });
10311
10335
  var passwordSchema = create$6().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
10312
10336
  var socialMediaSchema = create$3({
@@ -10785,15 +10809,16 @@ var appSettingsSchema = create$3({
10785
10809
  });
10786
10810
  var defaultLocation = {
10787
10811
  city: "",
10788
- coordinates: [0, 0],
10789
- // [longitude, latitude]
10790
10812
  country: "",
10791
10813
  fullAddress: "",
10814
+ geo: {
10815
+ coordinates: [0, 0],
10816
+ // [longitude, latitude]
10817
+ type: "Point"
10818
+ },
10792
10819
  latitude: 0,
10793
10820
  longitude: 0,
10794
- region: "",
10795
- type: "Point"
10796
- // Default type for GeoJSON
10821
+ region: ""
10797
10822
  };
10798
10823
  var globalDefaultValues = {
10799
10824
  active: false,
@@ -11377,25 +11402,27 @@ var dateTimeSchema3 = new MongooseSchema5(
11377
11402
  { _id: false }
11378
11403
  // Prevents Mongoose from creating an additional _id field for subdocuments
11379
11404
  );
11405
+ var locationGeoSchema = new MongooseSchema5(
11406
+ {
11407
+ coordinates: { required: true, type: [Number] },
11408
+ // [longitude, latitude]
11409
+ type: { default: "Point", enum: ["Point"], required: true, type: String }
11410
+ },
11411
+ { _id: false }
11412
+ // Prevents Mongoose from creating an additional _id field for subdocuments
11413
+ );
11380
11414
  var locationsSchema = new MongooseSchema5(
11381
11415
  {
11382
11416
  city: { required: true, type: String },
11383
- coordinates: {
11384
- required: true,
11385
- type: [Number]
11386
- // [longitude, latitude]
11387
- },
11388
11417
  country: { required: true, type: String },
11389
11418
  fullAddress: { required: true, type: String },
11419
+ geo: {
11420
+ required: true,
11421
+ type: locationGeoSchema
11422
+ },
11390
11423
  latitude: { required: true, type: Number },
11391
11424
  longitude: { required: true, type: Number },
11392
- region: { required: true, type: String },
11393
- type: {
11394
- default: "Point",
11395
- enum: ["Point"],
11396
- required: true,
11397
- type: String
11398
- }
11425
+ region: { required: true, type: String }
11399
11426
  },
11400
11427
  { _id: false }
11401
11428
  // Prevents Mongoose from creating an additional _id field for subdocuments
@@ -11580,7 +11607,8 @@ var ChatSchema = new MongooseSchema7(
11580
11607
  },
11581
11608
  deletedAt: { default: null, required: false, type: Date },
11582
11609
  messages: [MessageSchema],
11583
- participants: [ParticipantSchema]
11610
+ participants: [ParticipantSchema],
11611
+ region: { default: null, required: false, type: String }
11584
11612
  },
11585
11613
  {
11586
11614
  timestamps: true
@@ -11675,7 +11703,7 @@ var schema5 = new MongooseSchema8(
11675
11703
  },
11676
11704
  { timestamps: true }
11677
11705
  );
11678
- schema5.index({ location: "2dsphere" });
11706
+ schema5.index({ "location.geo": "2dsphere" });
11679
11707
  schema5.index({ name: 1 });
11680
11708
  schema5.index({ region: 1 });
11681
11709
  var GoogleImportedMarketModel = import_mongoose9.default.models.GoogleImportedMarket || import_mongoose9.default.model("GoogleImportedMarket", schema5);
@@ -11696,16 +11724,8 @@ var ActivitySchema = new MongooseSchema9(
11696
11724
  type: String
11697
11725
  },
11698
11726
  location: {
11699
- coordinates: {
11700
- required: false,
11701
- type: [Number]
11702
- },
11703
- type: {
11704
- default: "Point",
11705
- enum: ["Point"],
11706
- required: false,
11707
- type: String
11708
- }
11727
+ required: false,
11728
+ type: locationGeoSchema
11709
11729
  },
11710
11730
  startDate: { required: false, type: String },
11711
11731
  startTime: { required: false, type: String },
@@ -12087,19 +12107,8 @@ var LocationsSchema = new MongooseSchema13(
12087
12107
  },
12088
12108
  description: { required: false, type: String },
12089
12109
  location: {
12090
- city: { required: false, type: String },
12091
- coordinates: {
12092
- required: false,
12093
- type: [Number]
12094
- // [longitude, latitude]
12095
- },
12096
- country: { required: false, type: String },
12097
- fullAddress: { required: false, type: String },
12098
- latitude: { required: false, type: Number },
12099
- longitude: { required: false, type: Number },
12100
- region: { required: false, type: String },
12101
- type: { required: false, type: String }
12102
- // Mongoose GeoJSON type
12110
+ required: false,
12111
+ type: locationsSchema
12103
12112
  }
12104
12113
  },
12105
12114
  { _id: false }
@@ -12238,7 +12247,7 @@ var schema11 = new MongooseSchema15(
12238
12247
  schema11.index({ name: 1 });
12239
12248
  schema11.index({ description: 1 });
12240
12249
  schema11.index({ region: 1 });
12241
- schema11.index({ location: "2dsphere" });
12250
+ schema11.index({ "location.geo": "2dsphere" });
12242
12251
  schema11.index({ tags: 1 });
12243
12252
  schema11.index({ "associates.email": 1 });
12244
12253
  var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema11);