@timardex/cluemart-server-shared 1.0.62 → 1.0.64

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, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, LocationType, 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, 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';
@@ -186,6 +186,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
186
186
  } & {
187
187
  __v: number;
188
188
  }>;
189
+ declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
190
+ _id: mongoose.Types.ObjectId;
191
+ } & {
192
+ __v: number;
193
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationType> & {
194
+ _id: mongoose.Types.ObjectId;
195
+ } & {
196
+ __v: number;
197
+ }>;
189
198
  declare const baseResourceFields: {
190
199
  active: {
191
200
  default: boolean;
@@ -482,15 +491,6 @@ declare const VendorInfoModel: mongoose.Model<SchemaVendorInfoType, {}, {}, {},
482
491
  __v: number;
483
492
  }, any>;
484
493
 
485
- declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
486
- _id: mongoose.Types.ObjectId;
487
- } & {
488
- __v: number;
489
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationType> & {
490
- _id: mongoose.Types.ObjectId;
491
- } & {
492
- __v: number;
493
- }>;
494
494
  type SchemaEventType = Omit<EventType, "eventInfoId" | "owner" | "adIds"> & {
495
495
  adIds?: ObjectId[];
496
496
  eventInfoId: ObjectId;
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, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, LocationType, 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, 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';
@@ -186,6 +186,15 @@ declare const dateTimeSchema: mongoose.Schema<DateTimeType, mongoose.Model<DateT
186
186
  } & {
187
187
  __v: number;
188
188
  }>;
189
+ declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
190
+ _id: mongoose.Types.ObjectId;
191
+ } & {
192
+ __v: number;
193
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationType> & {
194
+ _id: mongoose.Types.ObjectId;
195
+ } & {
196
+ __v: number;
197
+ }>;
189
198
  declare const baseResourceFields: {
190
199
  active: {
191
200
  default: boolean;
@@ -482,15 +491,6 @@ declare const VendorInfoModel: mongoose.Model<SchemaVendorInfoType, {}, {}, {},
482
491
  __v: number;
483
492
  }, any>;
484
493
 
485
- declare const locationsSchema: mongoose.Schema<LocationType, mongoose.Model<LocationType, any, any, any, mongoose.Document<unknown, any, LocationType, any, {}> & LocationType & {
486
- _id: mongoose.Types.ObjectId;
487
- } & {
488
- __v: number;
489
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, LocationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<LocationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<LocationType> & {
490
- _id: mongoose.Types.ObjectId;
491
- } & {
492
- __v: number;
493
- }>;
494
494
  type SchemaEventType = Omit<EventType, "eventInfoId" | "owner" | "adIds"> & {
495
495
  adIds?: ObjectId[];
496
496
  eventInfoId: ObjectId;
package/dist/index.mjs CHANGED
@@ -8447,6 +8447,42 @@ var LOCATION_FIELDS_FRAGMENT = gql`
8447
8447
  type
8448
8448
  }
8449
8449
  `;
8450
+ var EVENT_LIST_ITEM = gql`
8451
+ fragment EventListItemFields on EventListItemType {
8452
+ _id
8453
+ active
8454
+ claimed
8455
+ cover {
8456
+ ...ResourceImageFields
8457
+ }
8458
+ createdAt
8459
+ dateTime {
8460
+ ...EventDateTimeFields
8461
+ }
8462
+ deletedAt
8463
+ description
8464
+ eventType
8465
+ googlePlaceId
8466
+ images {
8467
+ ...ResourceImageFields
8468
+ }
8469
+ location {
8470
+ ...LocationFields
8471
+ }
8472
+ logo {
8473
+ ...ResourceImageFields
8474
+ }
8475
+ name
8476
+ rainOrShine
8477
+ rating
8478
+ region
8479
+ reviewCount
8480
+ updatedAt
8481
+ }
8482
+ ${EVENT_DATETIME_FIELDS_FRAGMENT}
8483
+ ${LOCATION_FIELDS_FRAGMENT}
8484
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
8485
+ `;
8450
8486
  var EVENT_INFO = gql`
8451
8487
  fragment EventInfoFields on EventInfoType {
8452
8488
  _id
@@ -8550,10 +8586,10 @@ var EVENT = gql`
8550
8586
  var GET_EVENTS = gql`
8551
8587
  query getEvents {
8552
8588
  events {
8553
- ...EventFields
8589
+ ...EventListItemFields
8554
8590
  }
8555
8591
  }
8556
- ${EVENT}
8592
+ ${EVENT_LIST_ITEM}
8557
8593
  `;
8558
8594
  var GET_EVENT = gql`
8559
8595
  query getEvent($_id: ID!) {
@@ -8566,26 +8602,26 @@ var GET_EVENT = gql`
8566
8602
  var GET_EVENTS_BY_REGION = gql`
8567
8603
  query getEventsByRegion($region: String!) {
8568
8604
  eventsByRegion(region: $region) {
8569
- ...EventFields
8605
+ ...EventListItemFields
8570
8606
  }
8571
8607
  }
8572
- ${EVENT}
8608
+ ${EVENT_LIST_ITEM}
8573
8609
  `;
8574
8610
  var SEARCH_EVENTS = gql`
8575
8611
  query searchEvents($search: String!, $region: String) {
8576
8612
  eventsSearch(search: $search, region: $region) {
8577
- ...EventFields
8613
+ ...EventListItemFields
8578
8614
  }
8579
8615
  }
8580
- ${EVENT}
8616
+ ${EVENT_LIST_ITEM}
8581
8617
  `;
8582
8618
  var GET_EVENTS_NEAR_ME = gql`
8583
8619
  query getEventsNearMe($latitude: Float!, $longitude: Float!, $radius: Int) {
8584
8620
  eventsNearMe(latitude: $latitude, longitude: $longitude, radius: $radius) {
8585
- ...EventFields
8621
+ ...EventListItemFields
8586
8622
  }
8587
8623
  }
8588
- ${EVENT}
8624
+ ${EVENT_LIST_ITEM}
8589
8625
  `;
8590
8626
  var GET_EVENT_INFO = gql`
8591
8627
  query getEventInfo($eventId: ID!) {
@@ -9217,36 +9253,6 @@ var SEARCH_PARTNERS = gql`
9217
9253
  }
9218
9254
  ${PARTNER}
9219
9255
  `;
9220
- var USER_ACTIVITY_EVENT_FRAGMENT = gql`
9221
- fragment UserActivityEventFields on UserActivityEventType {
9222
- _id
9223
- active
9224
- cover {
9225
- ...ResourceImageFields
9226
- }
9227
- dateTime {
9228
- ...EventDateTimeFields
9229
- }
9230
- description
9231
- eventType
9232
- location {
9233
- ...LocationFields
9234
- }
9235
- logo {
9236
- ...ResourceImageFields
9237
- }
9238
- name
9239
- rainOrShine
9240
- region
9241
- socialMedia {
9242
- ...SocialMediaFields
9243
- }
9244
- }
9245
- ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
9246
- ${LOCATION_FIELDS_FRAGMENT}
9247
- ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
9248
- ${EVENT_DATETIME_FIELDS_FRAGMENT}
9249
- `;
9250
9256
  var GET_USERS = gql`
9251
9257
  query getUsers {
9252
9258
  users {
@@ -9292,7 +9298,7 @@ var GET_USER_ACTIVITIES = gql`
9292
9298
  userActivities {
9293
9299
  favourites {
9294
9300
  events {
9295
- ...EventFields
9301
+ ...EventListItemFields
9296
9302
  }
9297
9303
  vendors {
9298
9304
  ...VendorFields
@@ -9300,24 +9306,23 @@ var GET_USER_ACTIVITIES = gql`
9300
9306
  }
9301
9307
  going {
9302
9308
  events {
9303
- ...UserActivityEventFields
9309
+ ...EventListItemFields
9304
9310
  }
9305
9311
  }
9306
9312
  interested {
9307
9313
  events {
9308
- ...UserActivityEventFields
9314
+ ...EventListItemFields
9309
9315
  }
9310
9316
  }
9311
9317
  present {
9312
9318
  events {
9313
- ...UserActivityEventFields
9319
+ ...EventListItemFields
9314
9320
  }
9315
9321
  }
9316
9322
  }
9317
9323
  }
9318
- ${EVENT}
9324
+ ${EVENT_LIST_ITEM}
9319
9325
  ${VENDOR}
9320
- ${USER_ACTIVITY_EVENT_FRAGMENT}
9321
9326
  `;
9322
9327
  var NOTIFICATION_FRAGMENT = gql`
9323
9328
  fragment NotificationFields on Notification {
@@ -9474,7 +9479,7 @@ var GET_RESOURCE_CONNECTIONS = gql`
9474
9479
  ) {
9475
9480
  resourceConnections(resourceId: $resourceId, resourceType: $resourceType) {
9476
9481
  events {
9477
- ...EventFields
9482
+ ...EventListItemFields
9478
9483
  }
9479
9484
  vendors {
9480
9485
  ...VendorFields
@@ -9482,7 +9487,7 @@ var GET_RESOURCE_CONNECTIONS = gql`
9482
9487
  }
9483
9488
  }
9484
9489
  ${VENDOR}
9485
- ${EVENT}
9490
+ ${EVENT_LIST_ITEM}
9486
9491
  `;
9487
9492
  var CREATE_RELATION_MUTATION = gql`
9488
9493
  mutation createRelation($input: RelationInputType!) {
@@ -9990,6 +9995,13 @@ var UPDATE_APP_SETTINGS_MUTATION = gql`
9990
9995
  updateAppSettings(input: $input)
9991
9996
  }
9992
9997
  `;
9998
+ var CRAWL_GOOGLE_MARKETS_MUTATION = gql`
9999
+ mutation crawlGoogleMarkets {
10000
+ crawlGoogleMarkets {
10001
+ message
10002
+ }
10003
+ }
10004
+ `;
9993
10005
  var APP_SETTINGS_FIELDS_FRAGMENT = gql`
9994
10006
  fragment AppSettingsFields on AppSettingsType {
9995
10007
  _id
@@ -10007,93 +10019,6 @@ var GET_APP_SETTINGS = gql`
10007
10019
  }
10008
10020
  ${APP_SETTINGS_FIELDS_FRAGMENT}
10009
10021
  `;
10010
- var CRAWL_GOOGLE_MARKETS_MUTATION = gql`
10011
- mutation crawlGoogleMarkets {
10012
- crawlGoogleMarkets {
10013
- message
10014
- }
10015
- }
10016
- `;
10017
- var GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT = gql`
10018
- fragment GoogleImportedMarketsFields on GoogleImportedMarketType {
10019
- _id
10020
- accessibilityOptions
10021
- address
10022
- addressComponents {
10023
- longName
10024
- shortName
10025
- types
10026
- }
10027
- allowsDogs
10028
- businessStatus
10029
- claimed
10030
- createdAt
10031
- goodForChildren
10032
- goodForGroups
10033
- googleMapsUrl
10034
- googlePlaceId
10035
- image
10036
- importedAt
10037
- liveMusic
10038
- location {
10039
- lat
10040
- lng
10041
- }
10042
- name
10043
- openingHours
10044
- parkingOptions
10045
- paymentOptions
10046
- phone
10047
- photos
10048
- rating
10049
- region
10050
- restroom
10051
- reviewCount
10052
- slug
10053
- updatedAt
10054
- website
10055
- }
10056
- `;
10057
- var GET_GOOGLE_IMPORTED_MARKETS = gql`
10058
- query getGoogleImportedMarkets {
10059
- googleImportedMarkets {
10060
- ...GoogleImportedMarketsFields
10061
- }
10062
- }
10063
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10064
- `;
10065
- var GET_GOOGLE_IMPORTED_MARKETS_BY_REGION = gql`
10066
- query getGoogleImportedMarketsByRegion($region: String!) {
10067
- googleImportedMarketsByRegion(region: $region) {
10068
- ...GoogleImportedMarketsFields
10069
- }
10070
- }
10071
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10072
- `;
10073
- var SEARCH_GOOGLE_IMPORTED_MARKETS = gql`
10074
- query searchGoogleImportedMarkets($search: String!, $region: String) {
10075
- googleImportedMarketsSearch(search: $search, region: $region) {
10076
- ...GoogleImportedMarketsFields
10077
- }
10078
- }
10079
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10080
- `;
10081
- var GET_GOOGLE_IMPORTED_MARKETS_NEAR_ME = gql`
10082
- query getGoogleImportedMarketsNearMe(
10083
- $latitude: Float!
10084
- $longitude: Float!
10085
- $radius: Int
10086
- ) {
10087
- googleImportedMarketsNearMe(
10088
- lat: $latitude
10089
- lng: $longitude
10090
- radius: $radius
10091
- ) {
10092
- ...GoogleImportedMarketsFields
10093
- }
10094
- }
10095
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10096
- `;
10097
10022
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
10098
10023
  var nzbnRegex = /^94\d{11}$/;
10099
10024
  var normalizedUrlTransform = () => create$6().trim().transform(
@@ -11099,6 +11024,29 @@ var dateTimeSchema3 = new MongooseSchema3(
11099
11024
  { _id: false }
11100
11025
  // Prevents Mongoose from creating an additional _id field for subdocuments
11101
11026
  );
11027
+ var locationsSchema = new MongooseSchema3(
11028
+ {
11029
+ city: { required: true, type: String },
11030
+ coordinates: {
11031
+ required: true,
11032
+ type: [Number]
11033
+ // [longitude, latitude]
11034
+ },
11035
+ country: { required: true, type: String },
11036
+ fullAddress: { required: true, type: String },
11037
+ latitude: { required: true, type: Number },
11038
+ longitude: { required: true, type: Number },
11039
+ region: { required: true, type: String },
11040
+ type: {
11041
+ default: "Point",
11042
+ enum: ["Point"],
11043
+ required: true,
11044
+ type: String
11045
+ }
11046
+ },
11047
+ { _id: false }
11048
+ // Prevents Mongoose from creating an additional _id field for subdocuments
11049
+ );
11102
11050
  var baseResourceFields = {
11103
11051
  active: { default: false, required: true, type: Boolean },
11104
11052
  adIds: {
@@ -11248,14 +11196,6 @@ var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
11248
11196
  // src/mongoose/GoogleImportedMarket.ts
11249
11197
  import mongoose6 from "mongoose";
11250
11198
  var MongooseSchema6 = mongoose6.Schema;
11251
- var locationSchema2 = new MongooseSchema6(
11252
- {
11253
- lat: { required: true, type: Number },
11254
- lng: { required: true, type: Number }
11255
- },
11256
- { _id: false }
11257
- // Prevents Mongoose from creating an additional _id field for subdocuments
11258
- );
11259
11199
  var addressComponentSchema = new MongooseSchema6(
11260
11200
  {
11261
11201
  longName: { required: false, type: String },
@@ -11267,11 +11207,18 @@ var addressComponentSchema = new MongooseSchema6(
11267
11207
  var schema3 = new MongooseSchema6(
11268
11208
  {
11269
11209
  accessibilityOptions: { required: false, type: Object },
11210
+ active: { default: false, required: true, type: Boolean },
11270
11211
  address: { required: true, type: String },
11271
11212
  addressComponents: { required: false, type: [addressComponentSchema] },
11272
11213
  allowsDogs: { required: false, type: Boolean },
11273
11214
  businessStatus: { required: false, type: String },
11274
11215
  claimed: { default: false, required: true, type: Boolean },
11216
+ cover: {
11217
+ required: false,
11218
+ type: ResourceImageTypeSchema
11219
+ },
11220
+ dateTime: [dateTimeSchema3],
11221
+ deletedAt: { default: null, required: false, type: Date },
11275
11222
  goodForChildren: { required: false, type: Boolean },
11276
11223
  goodForGroups: { required: false, type: Boolean },
11277
11224
  googleMapsUrl: { required: false, type: String },
@@ -11281,22 +11228,20 @@ var schema3 = new MongooseSchema6(
11281
11228
  unique: true
11282
11229
  // unique, indexed
11283
11230
  },
11284
- image: { required: false, type: String },
11285
- // photo_reference only
11231
+ images: { required: false, type: [ResourceImageTypeSchema] },
11232
+ // array of photo_reference
11286
11233
  importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
11287
11234
  liveMusic: { required: false, type: Boolean },
11288
11235
  location: {
11289
11236
  required: false,
11290
11237
  // optional because lat/lng may expire after 30 days
11291
- type: locationSchema2
11238
+ type: locationsSchema
11292
11239
  },
11293
11240
  name: { required: true, type: String },
11294
11241
  openingHours: { required: false, type: [String] },
11295
11242
  parkingOptions: { required: false, type: Object },
11296
11243
  paymentOptions: { required: false, type: Object },
11297
11244
  phone: { required: false, type: String },
11298
- photos: { required: false, type: [String] },
11299
- // array of photo_reference
11300
11245
  rating: { required: false, type: Number },
11301
11246
  region: { required: false, type: String },
11302
11247
  restroom: { required: false, type: Boolean },
@@ -11890,29 +11835,6 @@ var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorIn
11890
11835
  // src/mongoose/event/Event.ts
11891
11836
  import mongoose15 from "mongoose";
11892
11837
  var MongooseSchema15 = mongoose15.Schema;
11893
- var locationsSchema = new MongooseSchema15(
11894
- {
11895
- city: { required: true, type: String },
11896
- coordinates: {
11897
- required: true,
11898
- type: [Number]
11899
- // [longitude, latitude]
11900
- },
11901
- country: { required: true, type: String },
11902
- fullAddress: { required: true, type: String },
11903
- latitude: { required: true, type: Number },
11904
- longitude: { required: true, type: Number },
11905
- region: { required: true, type: String },
11906
- type: {
11907
- default: "Point",
11908
- enum: ["Point"],
11909
- required: true,
11910
- type: String
11911
- }
11912
- },
11913
- { _id: false }
11914
- // Prevents Mongoose from creating an additional _id field for subdocuments
11915
- );
11916
11838
  var schema11 = new MongooseSchema15(
11917
11839
  {
11918
11840
  ...baseResourceFields,