@timardex/cluemart-server-shared 1.0.63 → 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,97 +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
- dateTime {
10032
- ...EventDateTimeFields
10033
- }
10034
- goodForChildren
10035
- goodForGroups
10036
- googleMapsUrl
10037
- googlePlaceId
10038
- image
10039
- importedAt
10040
- liveMusic
10041
- location {
10042
- lat
10043
- lng
10044
- }
10045
- name
10046
- openingHours
10047
- parkingOptions
10048
- paymentOptions
10049
- phone
10050
- photos
10051
- rating
10052
- region
10053
- restroom
10054
- reviewCount
10055
- slug
10056
- updatedAt
10057
- website
10058
- }
10059
- ${EVENT_DATETIME_FIELDS_FRAGMENT}
10060
- `;
10061
- var GET_GOOGLE_IMPORTED_MARKETS = gql`
10062
- query getGoogleImportedMarkets {
10063
- googleImportedMarkets {
10064
- ...GoogleImportedMarketsFields
10065
- }
10066
- }
10067
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10068
- `;
10069
- var GET_GOOGLE_IMPORTED_MARKETS_BY_REGION = gql`
10070
- query getGoogleImportedMarketsByRegion($region: String!) {
10071
- googleImportedMarketsByRegion(region: $region) {
10072
- ...GoogleImportedMarketsFields
10073
- }
10074
- }
10075
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10076
- `;
10077
- var SEARCH_GOOGLE_IMPORTED_MARKETS = gql`
10078
- query searchGoogleImportedMarkets($search: String!, $region: String) {
10079
- googleImportedMarketsSearch(search: $search, region: $region) {
10080
- ...GoogleImportedMarketsFields
10081
- }
10082
- }
10083
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10084
- `;
10085
- var GET_GOOGLE_IMPORTED_MARKETS_NEAR_ME = gql`
10086
- query getGoogleImportedMarketsNearMe(
10087
- $latitude: Float!
10088
- $longitude: Float!
10089
- $radius: Int
10090
- ) {
10091
- googleImportedMarketsNearMe(
10092
- lat: $latitude
10093
- lng: $longitude
10094
- radius: $radius
10095
- ) {
10096
- ...GoogleImportedMarketsFields
10097
- }
10098
- }
10099
- ${GOOGLE_IMPORTED_MARKETS_FIELDS_FRAGMENT}
10100
- `;
10101
10022
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
10102
10023
  var nzbnRegex = /^94\d{11}$/;
10103
10024
  var normalizedUrlTransform = () => create$6().trim().transform(
@@ -11103,6 +11024,29 @@ var dateTimeSchema3 = new MongooseSchema3(
11103
11024
  { _id: false }
11104
11025
  // Prevents Mongoose from creating an additional _id field for subdocuments
11105
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
+ );
11106
11050
  var baseResourceFields = {
11107
11051
  active: { default: false, required: true, type: Boolean },
11108
11052
  adIds: {
@@ -11252,14 +11196,6 @@ var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
11252
11196
  // src/mongoose/GoogleImportedMarket.ts
11253
11197
  import mongoose6 from "mongoose";
11254
11198
  var MongooseSchema6 = mongoose6.Schema;
11255
- var locationSchema2 = new MongooseSchema6(
11256
- {
11257
- lat: { required: true, type: Number },
11258
- lng: { required: true, type: Number }
11259
- },
11260
- { _id: false }
11261
- // Prevents Mongoose from creating an additional _id field for subdocuments
11262
- );
11263
11199
  var addressComponentSchema = new MongooseSchema6(
11264
11200
  {
11265
11201
  longName: { required: false, type: String },
@@ -11271,12 +11207,18 @@ var addressComponentSchema = new MongooseSchema6(
11271
11207
  var schema3 = new MongooseSchema6(
11272
11208
  {
11273
11209
  accessibilityOptions: { required: false, type: Object },
11210
+ active: { default: false, required: true, type: Boolean },
11274
11211
  address: { required: true, type: String },
11275
11212
  addressComponents: { required: false, type: [addressComponentSchema] },
11276
11213
  allowsDogs: { required: false, type: Boolean },
11277
11214
  businessStatus: { required: false, type: String },
11278
11215
  claimed: { default: false, required: true, type: Boolean },
11216
+ cover: {
11217
+ required: false,
11218
+ type: ResourceImageTypeSchema
11219
+ },
11279
11220
  dateTime: [dateTimeSchema3],
11221
+ deletedAt: { default: null, required: false, type: Date },
11280
11222
  goodForChildren: { required: false, type: Boolean },
11281
11223
  goodForGroups: { required: false, type: Boolean },
11282
11224
  googleMapsUrl: { required: false, type: String },
@@ -11286,22 +11228,20 @@ var schema3 = new MongooseSchema6(
11286
11228
  unique: true
11287
11229
  // unique, indexed
11288
11230
  },
11289
- image: { required: false, type: String },
11290
- // photo_reference only
11231
+ images: { required: false, type: [ResourceImageTypeSchema] },
11232
+ // array of photo_reference
11291
11233
  importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
11292
11234
  liveMusic: { required: false, type: Boolean },
11293
11235
  location: {
11294
11236
  required: false,
11295
11237
  // optional because lat/lng may expire after 30 days
11296
- type: locationSchema2
11238
+ type: locationsSchema
11297
11239
  },
11298
11240
  name: { required: true, type: String },
11299
11241
  openingHours: { required: false, type: [String] },
11300
11242
  parkingOptions: { required: false, type: Object },
11301
11243
  paymentOptions: { required: false, type: Object },
11302
11244
  phone: { required: false, type: String },
11303
- photos: { required: false, type: [String] },
11304
- // array of photo_reference
11305
11245
  rating: { required: false, type: Number },
11306
11246
  region: { required: false, type: String },
11307
11247
  restroom: { required: false, type: Boolean },
@@ -11895,29 +11835,6 @@ var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorIn
11895
11835
  // src/mongoose/event/Event.ts
11896
11836
  import mongoose15 from "mongoose";
11897
11837
  var MongooseSchema15 = mongoose15.Schema;
11898
- var locationsSchema = new MongooseSchema15(
11899
- {
11900
- city: { required: true, type: String },
11901
- coordinates: {
11902
- required: true,
11903
- type: [Number]
11904
- // [longitude, latitude]
11905
- },
11906
- country: { required: true, type: String },
11907
- fullAddress: { required: true, type: String },
11908
- latitude: { required: true, type: Number },
11909
- longitude: { required: true, type: Number },
11910
- region: { required: true, type: String },
11911
- type: {
11912
- default: "Point",
11913
- enum: ["Point"],
11914
- required: true,
11915
- type: String
11916
- }
11917
- },
11918
- { _id: false }
11919
- // Prevents Mongoose from creating an additional _id field for subdocuments
11920
- );
11921
11838
  var schema11 = new MongooseSchema15(
11922
11839
  {
11923
11840
  ...baseResourceFields,