@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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, 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, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, 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
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -202,6 +202,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
202
202
  } & {
203
203
  __v: number;
204
204
  }>;
205
+ declare const locationGeoSchema: mongoose.Schema<LocationGeoType, mongoose.Model<LocationGeoType, any, any, any, mongoose.Document<unknown, any, LocationGeoType, any, {}> & LocationGeoType & {
206
+ _id: mongoose.Types.ObjectId;
207
+ } & {
208
+ __v: number;
209
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationGeoType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationGeoType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationGeoType> & {
210
+ _id: mongoose.Types.ObjectId;
211
+ } & {
212
+ __v: number;
213
+ }>;
205
214
  declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
206
215
  _id: mongoose.Types.ObjectId;
207
216
  } & {
@@ -620,4 +629,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
620
629
  */
621
630
  declare function updateAdStatuses(): Promise<void>;
622
631
 
623
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
632
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, 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, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, 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
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -202,6 +202,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
202
202
  } & {
203
203
  __v: number;
204
204
  }>;
205
+ declare const locationGeoSchema: mongoose.Schema<LocationGeoType, mongoose.Model<LocationGeoType, any, any, any, mongoose.Document<unknown, any, LocationGeoType, any, {}> & LocationGeoType & {
206
+ _id: mongoose.Types.ObjectId;
207
+ } & {
208
+ __v: number;
209
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationGeoType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationGeoType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationGeoType> & {
210
+ _id: mongoose.Types.ObjectId;
211
+ } & {
212
+ __v: number;
213
+ }>;
205
214
  declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
206
215
  _id: mongoose.Types.ObjectId;
207
216
  } & {
@@ -620,4 +629,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
620
629
  */
621
630
  declare function updateAdStatuses(): Promise<void>;
622
631
 
623
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
632
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.mjs CHANGED
@@ -8449,17 +8449,25 @@ var CONTACT_DETAILS_FIELDS_FRAGMENT = gql`
8449
8449
  mobilePhone
8450
8450
  }
8451
8451
  `;
8452
+ var LOCATION_GEO_FIELDS_FRAGMENT = gql`
8453
+ fragment LocationGeoFields on LocationGeoType {
8454
+ coordinates
8455
+ type
8456
+ }
8457
+ `;
8452
8458
  var LOCATION_FIELDS_FRAGMENT = gql`
8453
8459
  fragment LocationFields on LocationType {
8454
8460
  city
8455
- coordinates
8456
8461
  country
8457
8462
  fullAddress
8463
+ geo {
8464
+ ...LocationGeoFields
8465
+ }
8458
8466
  latitude
8459
8467
  longitude
8460
8468
  region
8461
- type
8462
8469
  }
8470
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
8463
8471
  `;
8464
8472
  var EVENT_LIST_ITEM = gql`
8465
8473
  fragment EventListItemFields on EventListItemType {
@@ -8762,14 +8770,16 @@ var GET_TESTER = gql`
8762
8770
  var VENDOR_LOCATION_FIELDS_FRAGMENT = gql`
8763
8771
  fragment VendorLocationFields on VendorLocationType {
8764
8772
  city
8765
- coordinates
8766
8773
  country
8767
8774
  fullAddress
8775
+ geo {
8776
+ ...LocationGeoFields
8777
+ }
8768
8778
  latitude
8769
8779
  longitude
8770
8780
  region
8771
- type
8772
8781
  }
8782
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
8773
8783
  `;
8774
8784
  var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
8775
8785
  fragment VendorDateTimeFields on VendorDateTimeType {
@@ -9118,6 +9128,7 @@ var CHAT_FIELDS_FRAGMENT = gql`
9118
9128
  participants {
9119
9129
  ...ChatParticipantFields
9120
9130
  }
9131
+ region
9121
9132
  updatedAt
9122
9133
  }
9123
9134
  ${CHAT_MESSAGE_FIELDS_FRAGMENT}
@@ -9139,6 +9150,14 @@ var USER_CHATS = gql`
9139
9150
  }
9140
9151
  ${CHAT_FIELDS_FRAGMENT}
9141
9152
  `;
9153
+ var GET_CHATS_BY_REGION = gql`
9154
+ query getChatsByRegion($region: String!) {
9155
+ chatsByRegion(region: $region) {
9156
+ ...ChatFields
9157
+ }
9158
+ }
9159
+ ${CHAT_FIELDS_FRAGMENT}
9160
+ `;
9142
9161
  var SEND_CHAT_MESSAGE_MUTATION = gql`
9143
9162
  mutation sendChatMessage($_id: ID!, $input: ChatMessageInputType!) {
9144
9163
  sendChatMessage(_id: $_id, input: $input) {
@@ -9162,7 +9181,10 @@ var ADD_PARTICIPANT_TO_CHAT_MUTATION = gql`
9162
9181
  `;
9163
9182
  var REMOVE_PARTICIPANT_FROM_CHAT_MUTATION = gql`
9164
9183
  mutation removeParticipantFromChat($chatId: ID!, $userId: ID!) {
9165
- removeParticipantFromChat(chatId: $chatId, userId: $userId)
9184
+ removeParticipantFromChat(chatId: $chatId, userId: $userId) {
9185
+ success
9186
+ region
9187
+ }
9166
9188
  }
9167
9189
  `;
9168
9190
  var TOGGLE_CHAT_MESSAGE_LIKE_MUTATION = gql`
@@ -9844,8 +9866,7 @@ var RESOURCE_ACTIVITY_FIELDS_FRAGMENT = gql`
9844
9866
  activity {
9845
9867
  activityType
9846
9868
  location {
9847
- type
9848
- coordinates
9869
+ ...LocationGeoFields
9849
9870
  }
9850
9871
  dateStatus
9851
9872
  startDate
@@ -9855,6 +9876,7 @@ var RESOURCE_ACTIVITY_FIELDS_FRAGMENT = gql`
9855
9876
  userId
9856
9877
  }
9857
9878
  }
9879
+ ${LOCATION_GEO_FIELDS_FRAGMENT}
9858
9880
  `;
9859
9881
  var GET_RESOURCE_ACTIVITY = gql`
9860
9882
  query getResourceActivity(
@@ -10256,16 +10278,18 @@ var dateTimeWithPriceSchema = dateTimeSchema.shape({
10256
10278
  });
10257
10279
  var locationSchema = create$3().shape({
10258
10280
  city: create$6().label("City").required("City is required"),
10259
- coordinates: create$2().of(create$5().required("Coordinates must be numbers")).length(
10260
- 2,
10261
- "Coordinates must contain exactly two numbers (longitude, latitude)"
10262
- ).required("Coordinates are required"),
10263
10281
  country: create$6().label("Country").required("Country is required"),
10264
10282
  fullAddress: create$6().label("Address").required("Address is required"),
10283
+ geo: create$3().shape({
10284
+ coordinates: create$2().of(create$5().required("Coordinates must be numbers")).length(
10285
+ 2,
10286
+ "Coordinates must contain exactly two numbers (longitude, latitude)"
10287
+ ).required("Coordinates are required"),
10288
+ type: create$6().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
10289
+ }),
10265
10290
  latitude: create$5().label("Latitude").required("Latitude is required"),
10266
10291
  longitude: create$5().label("Longitude").required("Longitude is required"),
10267
- region: create$6().label("Region").required("Region is required"),
10268
- type: create$6().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
10292
+ region: create$6().label("Region").required("Region is required")
10269
10293
  });
10270
10294
  var passwordSchema = create$6().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
10271
10295
  var socialMediaSchema = create$3({
@@ -10744,15 +10768,16 @@ var appSettingsSchema = create$3({
10744
10768
  });
10745
10769
  var defaultLocation = {
10746
10770
  city: "",
10747
- coordinates: [0, 0],
10748
- // [longitude, latitude]
10749
10771
  country: "",
10750
10772
  fullAddress: "",
10773
+ geo: {
10774
+ coordinates: [0, 0],
10775
+ // [longitude, latitude]
10776
+ type: "Point"
10777
+ },
10751
10778
  latitude: 0,
10752
10779
  longitude: 0,
10753
- region: "",
10754
- type: "Point"
10755
- // Default type for GeoJSON
10780
+ region: ""
10756
10781
  };
10757
10782
  var globalDefaultValues = {
10758
10783
  active: false,
@@ -11142,25 +11167,27 @@ var dateTimeSchema3 = new MongooseSchema3(
11142
11167
  { _id: false }
11143
11168
  // Prevents Mongoose from creating an additional _id field for subdocuments
11144
11169
  );
11170
+ var locationGeoSchema = new MongooseSchema3(
11171
+ {
11172
+ coordinates: { required: true, type: [Number] },
11173
+ // [longitude, latitude]
11174
+ type: { default: "Point", enum: ["Point"], required: true, type: String }
11175
+ },
11176
+ { _id: false }
11177
+ // Prevents Mongoose from creating an additional _id field for subdocuments
11178
+ );
11145
11179
  var locationsSchema = new MongooseSchema3(
11146
11180
  {
11147
11181
  city: { required: true, type: String },
11148
- coordinates: {
11149
- required: true,
11150
- type: [Number]
11151
- // [longitude, latitude]
11152
- },
11153
11182
  country: { required: true, type: String },
11154
11183
  fullAddress: { required: true, type: String },
11184
+ geo: {
11185
+ required: true,
11186
+ type: locationGeoSchema
11187
+ },
11155
11188
  latitude: { required: true, type: Number },
11156
11189
  longitude: { required: true, type: Number },
11157
- region: { required: true, type: String },
11158
- type: {
11159
- default: "Point",
11160
- enum: ["Point"],
11161
- required: true,
11162
- type: String
11163
- }
11190
+ region: { required: true, type: String }
11164
11191
  },
11165
11192
  { _id: false }
11166
11193
  // Prevents Mongoose from creating an additional _id field for subdocuments
@@ -11345,7 +11372,8 @@ var ChatSchema = new MongooseSchema5(
11345
11372
  },
11346
11373
  deletedAt: { default: null, required: false, type: Date },
11347
11374
  messages: [MessageSchema],
11348
- participants: [ParticipantSchema]
11375
+ participants: [ParticipantSchema],
11376
+ region: { default: null, required: false, type: String }
11349
11377
  },
11350
11378
  {
11351
11379
  timestamps: true
@@ -11440,7 +11468,7 @@ var schema3 = new MongooseSchema6(
11440
11468
  },
11441
11469
  { timestamps: true }
11442
11470
  );
11443
- schema3.index({ location: "2dsphere" });
11471
+ schema3.index({ "location.geo": "2dsphere" });
11444
11472
  schema3.index({ name: 1 });
11445
11473
  schema3.index({ region: 1 });
11446
11474
  var GoogleImportedMarketModel = mongoose6.models.GoogleImportedMarket || mongoose6.model("GoogleImportedMarket", schema3);
@@ -11521,16 +11549,8 @@ var ActivitySchema = new MongooseSchema9(
11521
11549
  type: String
11522
11550
  },
11523
11551
  location: {
11524
- coordinates: {
11525
- required: false,
11526
- type: [Number]
11527
- },
11528
- type: {
11529
- default: "Point",
11530
- enum: ["Point"],
11531
- required: false,
11532
- type: String
11533
- }
11552
+ required: false,
11553
+ type: locationGeoSchema
11534
11554
  },
11535
11555
  startDate: { required: false, type: String },
11536
11556
  startTime: { required: false, type: String },
@@ -11912,19 +11932,8 @@ var LocationsSchema = new MongooseSchema13(
11912
11932
  },
11913
11933
  description: { required: false, type: String },
11914
11934
  location: {
11915
- city: { required: false, type: String },
11916
- coordinates: {
11917
- required: false,
11918
- type: [Number]
11919
- // [longitude, latitude]
11920
- },
11921
- country: { required: false, type: String },
11922
- fullAddress: { required: false, type: String },
11923
- latitude: { required: false, type: Number },
11924
- longitude: { required: false, type: Number },
11925
- region: { required: false, type: String },
11926
- type: { required: false, type: String }
11927
- // Mongoose GeoJSON type
11935
+ required: false,
11936
+ type: locationsSchema
11928
11937
  }
11929
11938
  },
11930
11939
  { _id: false }
@@ -12063,7 +12072,7 @@ var schema11 = new MongooseSchema15(
12063
12072
  schema11.index({ name: 1 });
12064
12073
  schema11.index({ description: 1 });
12065
12074
  schema11.index({ region: 1 });
12066
- schema11.index({ location: "2dsphere" });
12075
+ schema11.index({ "location.geo": "2dsphere" });
12067
12076
  schema11.index({ tags: 1 });
12068
12077
  schema11.index({ "associates.email": 1 });
12069
12078
  var EventModel = mongoose15.models.Event || mongoose15.model("Event", schema11);
@@ -12382,6 +12391,7 @@ export {
12382
12391
  connectToDatabase,
12383
12392
  dateTimeSchema3 as dateTimeSchema,
12384
12393
  express,
12394
+ locationGeoSchema,
12385
12395
  locationsSchema,
12386
12396
  mongoose20 as mongoose,
12387
12397
  relationDatesSchema,