@timardex/cluemart-server-shared 1.0.179 → 1.0.200

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.
@@ -52,13 +52,11 @@ interface GraphQLContext {
52
52
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
53
53
  senderId: ObjectId;
54
54
  };
55
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
56
56
  userId: ObjectId;
57
- createdAt: Date;
58
57
  };
59
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
58
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
60
59
  userId: ObjectId;
61
- seenAt: Date;
62
60
  };
63
61
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
64
62
  senderId: ObjectId;
@@ -52,13 +52,11 @@ interface GraphQLContext {
52
52
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
53
53
  senderId: ObjectId;
54
54
  };
55
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId" | "createdAt"> & {
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
56
56
  userId: ObjectId;
57
- createdAt: Date;
58
57
  };
59
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId" | "seenAt"> & {
58
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
60
59
  userId: ObjectId;
61
- seenAt: Date;
62
60
  };
63
61
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
64
62
  senderId: ObjectId;
@@ -1,6 +1,6 @@
1
1
  import { RelationDate, RelationType } from '@timardex/cluemart-shared';
2
2
  import mongoose from 'mongoose';
3
- import { O as ObjectId } from './Chat-Ctmtatmi.mjs';
3
+ import { O as ObjectId } from './Chat-DYkhie3G.js';
4
4
 
5
5
  declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
6
6
  _id: mongoose.Types.ObjectId;
@@ -11,7 +11,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
11
11
  } & {
12
12
  __v: number;
13
13
  }>;
14
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
14
+ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
15
15
  eventId: ObjectId;
16
16
  vendorId: ObjectId;
17
17
  chatId: ObjectId;
@@ -21,7 +21,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
21
21
  * It is used to define the structure of the relation type in the database.
22
22
  * The schema is used by Mongoose to create a model for the relation type.
23
23
  */
24
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
24
+ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
25
25
  eventId: ObjectId;
26
26
  vendorId: ObjectId;
27
27
  chatId: ObjectId;
@@ -34,7 +34,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
34
34
  }> & {
35
35
  __v: number;
36
36
  }>;
37
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
37
+ declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
38
38
  eventId: ObjectId;
39
39
  vendorId: ObjectId;
40
40
  chatId: ObjectId;
@@ -1,6 +1,6 @@
1
1
  import { RelationDate, RelationType } from '@timardex/cluemart-shared';
2
2
  import mongoose from 'mongoose';
3
- import { O as ObjectId } from './Chat-Ctmtatmi.js';
3
+ import { O as ObjectId } from './Chat-DYkhie3G.mjs';
4
4
 
5
5
  declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
6
6
  _id: mongoose.Types.ObjectId;
@@ -11,7 +11,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
11
11
  } & {
12
12
  __v: number;
13
13
  }>;
14
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
14
+ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
15
15
  eventId: ObjectId;
16
16
  vendorId: ObjectId;
17
17
  chatId: ObjectId;
@@ -21,7 +21,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
21
21
  * It is used to define the structure of the relation type in the database.
22
22
  * The schema is used by Mongoose to create a model for the relation type.
23
23
  */
24
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
24
+ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
25
25
  eventId: ObjectId;
26
26
  vendorId: ObjectId;
27
27
  chatId: ObjectId;
@@ -34,7 +34,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
34
34
  }> & {
35
35
  __v: number;
36
36
  }>;
37
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
37
+ declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
38
38
  eventId: ObjectId;
39
39
  vendorId: ObjectId;
40
40
  chatId: ObjectId;
@@ -7260,7 +7260,12 @@ var gameScreenIdentifierList = [
7260
7260
  match: "/events/events-near-me"
7261
7261
  },
7262
7262
  {
7263
- clue: "A collection of things worth attending.",
7263
+ clue: "Where events appear as pins on a map.",
7264
+ id: "events-map",
7265
+ match: "/events/events-map"
7266
+ },
7267
+ {
7268
+ clue: "A collection of events worth attending.",
7264
7269
  id: "events",
7265
7270
  match: "/events"
7266
7271
  },
@@ -7353,6 +7358,7 @@ function normalizeUrl(url) {
7353
7358
  }
7354
7359
  return url;
7355
7360
  }
7361
+ var CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
7356
7362
  var SCHOOL_MIN_STUDENT_COUNT = 300;
7357
7363
  var packagingTypes = [
7358
7364
  "Biodegradable",
@@ -8758,7 +8764,6 @@ var USER_FIELDS_FRAGMENT = gql`
8758
8764
  platform
8759
8765
  preferredRegion
8760
8766
  promoCodes
8761
- refreshToken
8762
8767
  role
8763
8768
  school
8764
8769
  termsAgreement {
@@ -9008,7 +9013,10 @@ var GET_EVENT_BY_PLACE_ID = gql`
9008
9013
  ${EVENT_LIST_ITEM}
9009
9014
  `;
9010
9015
  var GET_EVENTS_BY_REGION = gql`
9011
- query getEventsByRegion($region: String!, $options: EventsByRegionOptions) {
9016
+ query getEventsByRegion(
9017
+ $region: String!
9018
+ $options: ResourcesByRegionOptions
9019
+ ) {
9012
9020
  eventsByRegion(region: $region, options: $options) {
9013
9021
  ...EventListItemFields
9014
9022
  }
@@ -9016,7 +9024,7 @@ var GET_EVENTS_BY_REGION = gql`
9016
9024
  ${EVENT_LIST_ITEM}
9017
9025
  `;
9018
9026
  var SEARCH_EVENTS = gql`
9019
- query searchEvents($region: String, $search: String,$tags: [String]) {
9027
+ query searchEvents($region: String, $search: String, $tags: [String]) {
9020
9028
  eventsSearch(region: $region, search: $search, tags: $tags) {
9021
9029
  ...EventListItemFields
9022
9030
  }
@@ -9240,8 +9248,11 @@ var GET_VENDOR = gql`
9240
9248
  ${VENDOR}
9241
9249
  `;
9242
9250
  var GET_VENDORS_BY_REGION = gql`
9243
- query getVendorsByRegion($region: String!) {
9244
- vendorsByRegion(region: $region) {
9251
+ query getVendorsByRegion(
9252
+ $region: String!
9253
+ $options: ResourcesByRegionOptions
9254
+ ) {
9255
+ vendorsByRegion(region: $region, options: $options) {
9245
9256
  ...VendorFields
9246
9257
  }
9247
9258
  }
@@ -9637,8 +9648,11 @@ var GET_PARTNER = gql`
9637
9648
  ${PARTNER}
9638
9649
  `;
9639
9650
  var GET_PARTNERS_BY_REGION = gql`
9640
- query getPartnersByRegion($region: String!) {
9641
- partnersByRegion(region: $region) {
9651
+ query getPartnersByRegion(
9652
+ $region: String!
9653
+ $options: ResourcesByRegionOptions
9654
+ ) {
9655
+ partnersByRegion(region: $region, options: $options) {
9642
9656
  ...PartnerFields
9643
9657
  }
9644
9658
  }
@@ -10857,7 +10871,7 @@ var emailOptionalSchema = create$6().nullable().notRequired().transform(
10857
10871
  (value) => !value || create$6().email().isValidSync(value)
10858
10872
  ).label("Email");
10859
10873
  var mobileRegex = /^02\d{7,9}$/;
10860
- var landlineRegex = /^(0(3|4|6|7|9)[0-9]{7})$/;
10874
+ var landlineRegex = /^0[34679]\d{7}$/;
10861
10875
  var mobilePhoneSchema = create$6().label("Mobile Phone").nullable().notRequired().test(
10862
10876
  "mobile-phone",
10863
10877
  "Mobile must start with 02 and be 9\u201311 digits",
@@ -11242,12 +11256,12 @@ var validateVerificationTokenSchema = create$3().shape({
11242
11256
  email: emailRequiredSchema,
11243
11257
  verificationToken: create$6().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
11244
11258
  });
11245
- var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn3) => {
11246
- EnumAdShowOn3["EVENTS_PAGE"] = "Events_page";
11247
- EnumAdShowOn3["FRONT_PAGE"] = "Front_page";
11248
- EnumAdShowOn3["PARTNERS_PAGE"] = "Partners_page";
11249
- EnumAdShowOn3["VENDORS_PAGE"] = "Vendors_page";
11250
- return EnumAdShowOn3;
11259
+ var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
11260
+ EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
11261
+ EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
11262
+ EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
11263
+ EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
11264
+ return EnumAdShowOn2;
11251
11265
  })(EnumAdShowOn || {});
11252
11266
  var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
11253
11267
  EnumAdStatus2["ACTIVE"] = "Active";
@@ -11266,15 +11280,15 @@ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
11266
11280
  return EnumAdStyle2;
11267
11281
  })(EnumAdStyle || {});
11268
11282
  var adResourceSchema = create$3({
11269
- adDescription: create$6().nullable().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
11270
- adImage: create$6().nullable().required("Ad image is required"),
11271
- adStyle: create$8().nullable().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
11272
- adTitle: create$6().nullable().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
11273
- adType: create$8().nullable().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
11274
- resourceId: create$6().nullable().required("Resource ID is required"),
11275
- resourceName: create$6().nullable().required("Resource name is required"),
11276
- resourceRegion: create$6().nullable().required("Resource region is required"),
11277
- resourceType: create$8().nullable().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
11283
+ adDescription: create$6().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
11284
+ adImage: create$6().required("Ad image is required"),
11285
+ adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
11286
+ adTitle: create$6().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
11287
+ adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
11288
+ resourceId: create$6().required("Resource ID is required"),
11289
+ resourceName: create$6().required("Resource name is required"),
11290
+ resourceRegion: create$6().required("Resource region is required"),
11291
+ resourceType: create$8().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
11278
11292
  });
11279
11293
  var adSchema = create$3().shape({
11280
11294
  active: create$7().required("Active status is required"),
@@ -11304,7 +11318,8 @@ var adSchema = create$3().shape({
11304
11318
  if (!value) return false;
11305
11319
  return value > /* @__PURE__ */ new Date();
11306
11320
  }),
11307
- otherwise: () => create$4().nullable().notRequired()
11321
+ // Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
11322
+ otherwise: () => create$4().notRequired()
11308
11323
  }),
11309
11324
  targetRegion: create$2().of(create$6().required()).min(1, "At least one target region is required").required("Target region is required")
11310
11325
  });
@@ -11432,6 +11447,31 @@ var contactUsSchema = create$3().shape({
11432
11447
  lastName: create$6().label("Last Name").required("Last name is required"),
11433
11448
  message: create$6().label("Message").required("Message is required")
11434
11449
  });
11450
+ var defaultValues8 = {
11451
+ active: true,
11452
+ // Use a future default so yup "future date" rules pass on first submit.
11453
+ end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
11454
+ resource: {
11455
+ adDescription: "",
11456
+ adImage: "",
11457
+ adStyle: "Bloom",
11458
+ adTitle: "",
11459
+ adType: "Sponsored",
11460
+ resourceId: "",
11461
+ resourceName: "",
11462
+ resourceRegion: "",
11463
+ resourceType: "event"
11464
+ /* EVENT */
11465
+ },
11466
+ showOn: [
11467
+ "Front_page"
11468
+ /* FRONT_PAGE */
11469
+ ],
11470
+ // `start` is only required (and must be future) when status !== ACTIVE.
11471
+ start: void 0,
11472
+ status: "Active",
11473
+ targetRegion: []
11474
+ };
11435
11475
  var schoolSchema = create$3().shape({
11436
11476
  active: create$7().required("Active is required"),
11437
11477
  contactDetails: contactDetailsSchema,
@@ -11493,8 +11533,9 @@ var badgeFiles = Object.fromEntries(
11493
11533
  var logoIds = [
11494
11534
  "googleMaps-logo-dark",
11495
11535
  "googleMaps-logo-light",
11496
- "logo",
11497
- "logo-atr"
11536
+ "logo-atr",
11537
+ "logo-dark",
11538
+ "logo"
11498
11539
  ];
11499
11540
  var logoFiles = Object.fromEntries(
11500
11541
  logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
@@ -11502,6 +11543,7 @@ var logoFiles = Object.fromEntries(
11502
11543
  var otherImagesIds = [
11503
11544
  "banner-horizontal",
11504
11545
  "banner-vertical",
11546
+ "gazebo-top",
11505
11547
  "qr-code",
11506
11548
  "store-android",
11507
11549
  "store-ios"
@@ -11529,7 +11571,7 @@ var otherImages = Object.fromEntries(
11529
11571
  );
11530
11572
  var RELATION_SHARE_INVITATION = "invitation";
11531
11573
  var RELATION_SHARE_APPLICATION = "application";
11532
- var SHARE_SITE_URL = "https://cluemart.co.nz";
11574
+ var SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;
11533
11575
  var SHARE_CALENDAR_ICON = "\u{1F4C5}";
11534
11576
  var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
11535
11577
  var SHARE_CHECKMARK_ICON = "\u2705";
@@ -11869,6 +11911,7 @@ var refundPolicySchema = new MongooseSchema4(
11869
11911
  );
11870
11912
  var schema2 = new MongooseSchema4(
11871
11913
  {
11914
+ active: { default: true, type: Boolean },
11872
11915
  applicationDeadlineHours: { required: true, type: Number },
11873
11916
  dateTime: { required: true, type: [dateTimeSchema2] },
11874
11917
  eventId: {
@@ -12310,7 +12353,11 @@ var schema5 = new MongooseSchema9(
12310
12353
  type: String
12311
12354
  },
12312
12355
  token: { required: true, type: String },
12313
- userId: { required: true, type: mongoose9.Schema.Types.ObjectId }
12356
+ userId: {
12357
+ ref: "User",
12358
+ required: true,
12359
+ type: mongoose9.Schema.Types.ObjectId
12360
+ }
12314
12361
  },
12315
12362
  { timestamps: true }
12316
12363
  );
@@ -12653,6 +12700,7 @@ var AttributesSchema = new MongooseSchema14(
12653
12700
  );
12654
12701
  var schema10 = new MongooseSchema14(
12655
12702
  {
12703
+ active: { default: true, type: Boolean },
12656
12704
  compliance: {
12657
12705
  foodBeverageLicense: { default: false, required: false, type: Boolean },
12658
12706
  liabilityInsurance: { default: false, required: false, type: Boolean }
@@ -13151,4 +13199,4 @@ react/cjs/react.development.js:
13151
13199
  * LICENSE file in the root directory of this source tree.
13152
13200
  *)
13153
13201
  */
13154
- //# sourceMappingURL=chunk-QHPLDTUG.mjs.map
13202
+ //# sourceMappingURL=chunk-MBUS572I.mjs.map