@timardex/cluemart-server-shared 1.0.145 → 1.0.147

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.
@@ -6827,6 +6827,10 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
6827
6827
  EnumSubscriptionStatus22["TRIALING"] = "trialing";
6828
6828
  return EnumSubscriptionStatus22;
6829
6829
  })(EnumSubscriptionStatus || {});
6830
+ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
6831
+ EnumGameType2["DAILY_CLUE"] = "dailyClue";
6832
+ return EnumGameType2;
6833
+ })(EnumGameType || {});
6830
6834
  var OBJECT_ID_PATH_SEGMENT = "[a-f0-9]{24}";
6831
6835
  var OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;
6832
6836
  var gameScreenIdentifierList = [
@@ -6921,17 +6925,6 @@ var gameScreenIdentifierList = [
6921
6925
  match: "/visitors"
6922
6926
  }
6923
6927
  ];
6924
- var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
6925
- EnumGameType2["DAILY_CLUE"] = "dailyClue";
6926
- return EnumGameType2;
6927
- })(EnumGameType || {});
6928
- var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus3) => {
6929
- EnumGameStatus3["GAME_COMPLETED"] = "GAME_COMPLETED";
6930
- EnumGameStatus3["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
6931
- EnumGameStatus3["GAME_LEFT"] = "GAME_LEFT";
6932
- EnumGameStatus3["GAME_STARTED"] = "GAME_STARTED";
6933
- return EnumGameStatus3;
6934
- })(EnumGameStatus || {});
6935
6928
  var dateFormat = "DD-MM-YYYY";
6936
6929
  var timeFormat = "HH:mm";
6937
6930
  dayjs.extend(customParseFormat);
@@ -6960,6 +6953,7 @@ function normalizeUrl(url) {
6960
6953
  }
6961
6954
  return url;
6962
6955
  }
6956
+ var SCHOOL_MIN_STUDENT_COUNT = 300;
6963
6957
  var packagingTypes = [
6964
6958
  "Biodegradable",
6965
6959
  "Compostable",
@@ -8622,8 +8616,8 @@ var GET_EVENTS_BY_REGION = gql`
8622
8616
  ${EVENT_LIST_ITEM}
8623
8617
  `;
8624
8618
  var SEARCH_EVENTS = gql`
8625
- query searchEvents($search: String!, $region: String) {
8626
- eventsSearch(search: $search, region: $region) {
8619
+ query searchEvents($region: String, $search: String,$tags: [String]) {
8620
+ eventsSearch(region: $region, search: $search, tags: $tags) {
8627
8621
  ...EventListItemFields
8628
8622
  }
8629
8623
  }
@@ -9929,8 +9923,8 @@ var GAME_DATE_FIELDS_FRAGMENT = gql`
9929
9923
  endDate
9930
9924
  }
9931
9925
  `;
9932
- var BASE_GAME_FIELDS_FRAGMENT = gql`
9933
- fragment BaseGameFields on BaseGameType {
9926
+ var DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT = gql`
9927
+ fragment DailyClueBaseGameFields on DailyClueBaseGameType {
9934
9928
  gameDate {
9935
9929
  ...GameDateFields
9936
9930
  }
@@ -9942,20 +9936,20 @@ var BASE_GAME_FIELDS_FRAGMENT = gql`
9942
9936
  var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
9943
9937
  fragment DailyClueGameDataFields on DailyClueGameDataType {
9944
9938
  gameFields {
9945
- ...BaseGameFields
9939
+ ...DailyClueBaseGameFields
9946
9940
  }
9947
9941
  lastFoundDate
9948
9942
  points
9949
9943
  letterInfo {
9950
9944
  collected
9951
- shuffled
9952
- todaysLetter
9945
+ solutionShuffled
9953
9946
  todaysClue
9947
+ todaysLetter
9954
9948
  todaysPlacement
9955
9949
  }
9956
9950
  streak
9957
9951
  }
9958
- ${BASE_GAME_FIELDS_FRAGMENT}
9952
+ ${DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT}
9959
9953
  `;
9960
9954
  var GAME_HISTORY_FIELDS_FRAGMENT = gql`
9961
9955
  fragment GameHistoryFields on GameHistoryType {
@@ -10043,6 +10037,14 @@ var GET_GAME_LEADERBOARD = gql`
10043
10037
  ${OWNER_FIELDS_FRAGMENT}
10044
10038
  ${GAME_HISTORY_FIELDS_FRAGMENT}
10045
10039
  `;
10040
+ var BASE_GAME_FIELDS_FRAGMENT = gql`
10041
+ fragment BaseGameFields on BaseGameType {
10042
+ dailyClue {
10043
+ ...DailyClueBaseGameFields
10044
+ }
10045
+ }
10046
+ ${DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT}
10047
+ `;
10046
10048
  var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
10047
10049
  fragment PostContentDataFields on PostContentData {
10048
10050
  game {
@@ -10095,6 +10097,7 @@ var POST_FIELDS_FRAGMENT = gql`
10095
10097
  postType
10096
10098
  resource {
10097
10099
  resourceId
10100
+ resourceRegion
10098
10101
  resourceType
10099
10102
  }
10100
10103
  tags
@@ -10835,6 +10838,7 @@ var postSchema = create$3().shape({
10835
10838
  postType: create$8().oneOf(Object.values(EnumPostType)).required(),
10836
10839
  resource: create$3({
10837
10840
  resourceId: create$6().required(),
10841
+ resourceRegion: create$6().required(),
10838
10842
  resourceType: create$8().oneOf(Object.values(EnumResourceType)).required()
10839
10843
  }).nullable().optional(),
10840
10844
  tags: create$2().of(create$6().required()).nullable().optional(),
@@ -10932,7 +10936,10 @@ var schoolSchema = create$3().shape({
10932
10936
  name: create$6().trim().required("Name is required"),
10933
10937
  region: create$6().trim().required("Region is required"),
10934
10938
  socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
10935
- studentCount: create$5().label("Student Count").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Student count must be a number").min(350, "Student count must be at least 350").required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
10939
+ studentCount: create$5().label("Student Count").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Student count must be a number").min(
10940
+ SCHOOL_MIN_STUDENT_COUNT,
10941
+ `Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
10942
+ ).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
10936
10943
  });
10937
10944
  var PKG = "@timardex/cluemart-shared";
10938
10945
  var IMAGE_EXTENSION = ".webp";
@@ -11024,6 +11031,13 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
11024
11031
  EnumActivity2["VIEW"] = "VIEW";
11025
11032
  return EnumActivity2;
11026
11033
  })(EnumActivity || {});
11034
+ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
11035
+ EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
11036
+ EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
11037
+ EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
11038
+ EnumGameStatus2["GAME_STARTED"] = "GAME_STARTED";
11039
+ return EnumGameStatus2;
11040
+ })(EnumGameStatus || {});
11027
11041
 
11028
11042
  // src/mongoose/Ad.ts
11029
11043
  import mongoose from "mongoose";
@@ -12226,6 +12240,7 @@ var schema13 = new MongooseSchema17(
12226
12240
  required: false,
12227
12241
  type: {
12228
12242
  resourceId: { required: true, type: String },
12243
+ resourceRegion: { required: true, type: String },
12229
12244
  resourceType: {
12230
12245
  enum: Object.values(EnumResourceType),
12231
12246
  required: true,
@@ -12265,6 +12280,9 @@ var AppSettingSchema = new MongooseSchema18(
12265
12280
  var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
12266
12281
 
12267
12282
  // src/mongoose/game/Game.ts
12283
+ import mongoose20 from "mongoose";
12284
+
12285
+ // src/mongoose/game/utils.ts
12268
12286
  import mongoose19 from "mongoose";
12269
12287
  var MongooseSchema19 = mongoose19.Schema;
12270
12288
  var schemaGameDate = new MongooseSchema19(
@@ -12274,7 +12292,15 @@ var schemaGameDate = new MongooseSchema19(
12274
12292
  },
12275
12293
  { _id: false }
12276
12294
  );
12277
- var schemaBaseGame = new MongooseSchema19(
12295
+ var schemaLetters = new MongooseSchema19(
12296
+ {
12297
+ collected: { required: false, type: [String] },
12298
+ solutionShuffled: { required: true, type: [String] }
12299
+ // todaysLetter and todaysPlacement is generated in the backend, so they are not required
12300
+ },
12301
+ { _id: false }
12302
+ );
12303
+ var schemaDailyClueBaseGame = new MongooseSchema19(
12278
12304
  {
12279
12305
  gameDate: { required: true, type: schemaGameDate },
12280
12306
  gameSolution: { required: true, type: String },
@@ -12286,17 +12312,9 @@ var schemaBaseGame = new MongooseSchema19(
12286
12312
  },
12287
12313
  { _id: false }
12288
12314
  );
12289
- var schemaLetters = new MongooseSchema19(
12290
- {
12291
- collected: { required: false, type: [String] },
12292
- shuffled: { required: true, type: [String] }
12293
- // todaysLetter and todaysPlacement is generated in the backend, so they are not required
12294
- },
12295
- { _id: false }
12296
- );
12297
- var schemaDailyClue = new MongooseSchema19(
12315
+ var schemaDailyClueGameData = new MongooseSchema19(
12298
12316
  {
12299
- gameFields: { required: true, type: schemaBaseGame },
12317
+ gameFields: { required: true, type: schemaDailyClueBaseGame },
12300
12318
  lastFoundDate: { default: null, required: false, type: Date },
12301
12319
  letterInfo: {
12302
12320
  required: true,
@@ -12307,8 +12325,11 @@ var schemaDailyClue = new MongooseSchema19(
12307
12325
  },
12308
12326
  { _id: false }
12309
12327
  );
12328
+
12329
+ // src/mongoose/game/Game.ts
12330
+ var MongooseSchema20 = mongoose20.Schema;
12310
12331
  var gameDataSchemas = {
12311
- [EnumGameType.DAILY_CLUE]: schemaDailyClue
12332
+ [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData
12312
12333
  };
12313
12334
  var gameDataDefinition = Object.fromEntries(
12314
12335
  Object.entries(gameDataSchemas).map(([key, schema16]) => [
@@ -12316,7 +12337,7 @@ var gameDataDefinition = Object.fromEntries(
12316
12337
  { default: null, required: false, type: schema16 }
12317
12338
  ])
12318
12339
  );
12319
- var gameHistorySchema = new MongooseSchema19(
12340
+ var gameHistorySchema = new MongooseSchema20(
12320
12341
  {
12321
12342
  createdAt: { required: true, type: Date },
12322
12343
  gameDate: { required: true, type: schemaGameDate },
@@ -12334,7 +12355,7 @@ var gameHistorySchema = new MongooseSchema19(
12334
12355
  },
12335
12356
  { _id: false }
12336
12357
  );
12337
- var gameTypeSchema = new MongooseSchema19(
12358
+ var gameTypeSchema = new MongooseSchema20(
12338
12359
  {
12339
12360
  active: { default: true, required: true, type: Boolean },
12340
12361
  gameData: gameDataDefinition,
@@ -12347,7 +12368,7 @@ var gameTypeSchema = new MongooseSchema19(
12347
12368
  },
12348
12369
  { timestamps: true }
12349
12370
  );
12350
- var schema14 = new MongooseSchema19(
12371
+ var schema14 = new MongooseSchema20(
12351
12372
  {
12352
12373
  active: { default: false, required: true, type: Boolean },
12353
12374
  deletedAt: { default: null, required: false, type: Date },
@@ -12360,12 +12381,12 @@ var schema14 = new MongooseSchema19(
12360
12381
  },
12361
12382
  { timestamps: true }
12362
12383
  );
12363
- var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
12384
+ var GameModel = mongoose20.models.Game || mongoose20.model("Game", schema14);
12364
12385
 
12365
12386
  // src/mongoose/School.ts
12366
- import mongoose20 from "mongoose";
12367
- var MongooseSchema20 = mongoose20.Schema;
12368
- var schema15 = new MongooseSchema20(
12387
+ import mongoose21 from "mongoose";
12388
+ var MongooseSchema21 = mongoose21.Schema;
12389
+ var schema15 = new MongooseSchema21(
12369
12390
  {
12370
12391
  // New schools are active by default
12371
12392
  active: { default: true, required: true, type: Boolean },
@@ -12390,7 +12411,7 @@ var schema15 = new MongooseSchema20(
12390
12411
  },
12391
12412
  { timestamps: true }
12392
12413
  );
12393
- var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
12414
+ var SchoolModel = mongoose21.models.School || mongoose21.model("School", schema15);
12394
12415
 
12395
12416
  export {
12396
12417
  EnumResourceType,
@@ -12459,4 +12480,4 @@ react/cjs/react.development.js:
12459
12480
  * LICENSE file in the root directory of this source tree.
12460
12481
  *)
12461
12482
  */
12462
- //# sourceMappingURL=chunk-ZKCRLNCH.mjs.map
12483
+ //# sourceMappingURL=chunk-4ZDEYFIM.mjs.map