@timardex/cluemart-server-shared 1.0.146 → 1.0.148

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.
@@ -6921,17 +6921,6 @@ var gameScreenIdentifierList = [
6921
6921
  match: "/visitors"
6922
6922
  }
6923
6923
  ];
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
6924
  var dateFormat = "DD-MM-YYYY";
6936
6925
  var timeFormat = "HH:mm";
6937
6926
  dayjs.extend(customParseFormat);
@@ -6960,6 +6949,7 @@ function normalizeUrl(url) {
6960
6949
  }
6961
6950
  return url;
6962
6951
  }
6952
+ var SCHOOL_MIN_STUDENT_COUNT = 300;
6963
6953
  var packagingTypes = [
6964
6954
  "Biodegradable",
6965
6955
  "Compostable",
@@ -9929,33 +9919,32 @@ var GAME_DATE_FIELDS_FRAGMENT = gql`
9929
9919
  endDate
9930
9920
  }
9931
9921
  `;
9932
- var BASE_GAME_FIELDS_FRAGMENT = gql`
9933
- fragment BaseGameFields on BaseGameType {
9922
+ var DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT = gql`
9923
+ fragment DailyClueBaseGameFields on DailyClueBaseGameType {
9934
9924
  gameDate {
9935
9925
  ...GameDateFields
9936
9926
  }
9937
9927
  gameSolution
9938
- gameType
9939
9928
  }
9940
9929
  ${GAME_DATE_FIELDS_FRAGMENT}
9941
9930
  `;
9942
9931
  var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
9943
9932
  fragment DailyClueGameDataFields on DailyClueGameDataType {
9944
9933
  gameFields {
9945
- ...BaseGameFields
9934
+ ...DailyClueBaseGameFields
9946
9935
  }
9947
9936
  lastFoundDate
9948
9937
  points
9949
9938
  letterInfo {
9950
9939
  collected
9951
- shuffled
9952
- todaysLetter
9940
+ solutionShuffled
9953
9941
  todaysClue
9942
+ todaysLetter
9954
9943
  todaysPlacement
9955
9944
  }
9956
9945
  streak
9957
9946
  }
9958
- ${BASE_GAME_FIELDS_FRAGMENT}
9947
+ ${DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT}
9959
9948
  `;
9960
9949
  var GAME_HISTORY_FIELDS_FRAGMENT = gql`
9961
9950
  fragment GameHistoryFields on GameHistoryType {
@@ -10043,6 +10032,15 @@ var GET_GAME_LEADERBOARD = gql`
10043
10032
  ${OWNER_FIELDS_FRAGMENT}
10044
10033
  ${GAME_HISTORY_FIELDS_FRAGMENT}
10045
10034
  `;
10035
+ var BASE_GAME_FIELDS_FRAGMENT = gql`
10036
+ fragment BaseGameFields on BaseGameType {
10037
+ gameType
10038
+ dailyClue {
10039
+ ...DailyClueBaseGameFields
10040
+ }
10041
+ }
10042
+ ${DAILY_CLUE_BASE_GAME_FIELDS_FRAGMENT}
10043
+ `;
10046
10044
  var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
10047
10045
  fragment PostContentDataFields on PostContentData {
10048
10046
  game {
@@ -10934,7 +10932,10 @@ var schoolSchema = create$3().shape({
10934
10932
  name: create$6().trim().required("Name is required"),
10935
10933
  region: create$6().trim().required("Region is required"),
10936
10934
  socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
10937
- 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"))
10935
+ studentCount: create$5().label("Student Count").nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Student count must be a number").min(
10936
+ SCHOOL_MIN_STUDENT_COUNT,
10937
+ `Student count must be at least ${SCHOOL_MIN_STUDENT_COUNT}`
10938
+ ).required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
10938
10939
  });
10939
10940
  var PKG = "@timardex/cluemart-shared";
10940
10941
  var IMAGE_EXTENSION = ".webp";
@@ -11026,6 +11027,17 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
11026
11027
  EnumActivity2["VIEW"] = "VIEW";
11027
11028
  return EnumActivity2;
11028
11029
  })(EnumActivity || {});
11030
+ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
11031
+ EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
11032
+ EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
11033
+ EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
11034
+ EnumGameStatus2["GAME_STARTED"] = "GAME_STARTED";
11035
+ return EnumGameStatus2;
11036
+ })(EnumGameStatus || {});
11037
+ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
11038
+ EnumGameType2["DAILY_CLUE"] = "dailyClue";
11039
+ return EnumGameType2;
11040
+ })(EnumGameType || {});
11029
11041
 
11030
11042
  // src/mongoose/Ad.ts
11031
11043
  import mongoose from "mongoose";
@@ -12268,6 +12280,9 @@ var AppSettingSchema = new MongooseSchema18(
12268
12280
  var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
12269
12281
 
12270
12282
  // src/mongoose/game/Game.ts
12283
+ import mongoose20 from "mongoose";
12284
+
12285
+ // src/mongoose/game/utils.ts
12271
12286
  import mongoose19 from "mongoose";
12272
12287
  var MongooseSchema19 = mongoose19.Schema;
12273
12288
  var schemaGameDate = new MongooseSchema19(
@@ -12277,29 +12292,24 @@ var schemaGameDate = new MongooseSchema19(
12277
12292
  },
12278
12293
  { _id: false }
12279
12294
  );
12280
- var schemaBaseGame = new MongooseSchema19(
12295
+ var schemaLetters = new MongooseSchema19(
12281
12296
  {
12282
- gameDate: { required: true, type: schemaGameDate },
12283
- gameSolution: { required: true, type: String },
12284
- gameType: {
12285
- enum: Object.values(EnumGameType),
12286
- required: false,
12287
- type: String
12288
- }
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
12289
12300
  },
12290
12301
  { _id: false }
12291
12302
  );
12292
- var schemaLetters = new MongooseSchema19(
12303
+ var schemaDailyClueBaseGame = new MongooseSchema19(
12293
12304
  {
12294
- collected: { required: false, type: [String] },
12295
- shuffled: { required: true, type: [String] }
12296
- // todaysLetter and todaysPlacement is generated in the backend, so they are not required
12305
+ gameDate: { required: true, type: schemaGameDate },
12306
+ gameSolution: { required: true, type: String }
12297
12307
  },
12298
12308
  { _id: false }
12299
12309
  );
12300
- var schemaDailyClue = new MongooseSchema19(
12310
+ var schemaDailyClueGameData = new MongooseSchema19(
12301
12311
  {
12302
- gameFields: { required: true, type: schemaBaseGame },
12312
+ gameFields: { required: true, type: schemaDailyClueBaseGame },
12303
12313
  lastFoundDate: { default: null, required: false, type: Date },
12304
12314
  letterInfo: {
12305
12315
  required: true,
@@ -12310,8 +12320,11 @@ var schemaDailyClue = new MongooseSchema19(
12310
12320
  },
12311
12321
  { _id: false }
12312
12322
  );
12323
+
12324
+ // src/mongoose/game/Game.ts
12325
+ var MongooseSchema20 = mongoose20.Schema;
12313
12326
  var gameDataSchemas = {
12314
- [EnumGameType.DAILY_CLUE]: schemaDailyClue
12327
+ [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData
12315
12328
  };
12316
12329
  var gameDataDefinition = Object.fromEntries(
12317
12330
  Object.entries(gameDataSchemas).map(([key, schema16]) => [
@@ -12319,7 +12332,7 @@ var gameDataDefinition = Object.fromEntries(
12319
12332
  { default: null, required: false, type: schema16 }
12320
12333
  ])
12321
12334
  );
12322
- var gameHistorySchema = new MongooseSchema19(
12335
+ var gameHistorySchema = new MongooseSchema20(
12323
12336
  {
12324
12337
  createdAt: { required: true, type: Date },
12325
12338
  gameDate: { required: true, type: schemaGameDate },
@@ -12337,7 +12350,7 @@ var gameHistorySchema = new MongooseSchema19(
12337
12350
  },
12338
12351
  { _id: false }
12339
12352
  );
12340
- var gameTypeSchema = new MongooseSchema19(
12353
+ var gameTypeSchema = new MongooseSchema20(
12341
12354
  {
12342
12355
  active: { default: true, required: true, type: Boolean },
12343
12356
  gameData: gameDataDefinition,
@@ -12350,7 +12363,7 @@ var gameTypeSchema = new MongooseSchema19(
12350
12363
  },
12351
12364
  { timestamps: true }
12352
12365
  );
12353
- var schema14 = new MongooseSchema19(
12366
+ var schema14 = new MongooseSchema20(
12354
12367
  {
12355
12368
  active: { default: false, required: true, type: Boolean },
12356
12369
  deletedAt: { default: null, required: false, type: Date },
@@ -12363,12 +12376,12 @@ var schema14 = new MongooseSchema19(
12363
12376
  },
12364
12377
  { timestamps: true }
12365
12378
  );
12366
- var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
12379
+ var GameModel = mongoose20.models.Game || mongoose20.model("Game", schema14);
12367
12380
 
12368
12381
  // src/mongoose/School.ts
12369
- import mongoose20 from "mongoose";
12370
- var MongooseSchema20 = mongoose20.Schema;
12371
- var schema15 = new MongooseSchema20(
12382
+ import mongoose21 from "mongoose";
12383
+ var MongooseSchema21 = mongoose21.Schema;
12384
+ var schema15 = new MongooseSchema21(
12372
12385
  {
12373
12386
  // New schools are active by default
12374
12387
  active: { default: true, required: true, type: Boolean },
@@ -12393,7 +12406,7 @@ var schema15 = new MongooseSchema20(
12393
12406
  },
12394
12407
  { timestamps: true }
12395
12408
  );
12396
- var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
12409
+ var SchoolModel = mongoose21.models.School || mongoose21.model("School", schema15);
12397
12410
 
12398
12411
  export {
12399
12412
  EnumResourceType,
@@ -12462,4 +12475,4 @@ react/cjs/react.development.js:
12462
12475
  * LICENSE file in the root directory of this source tree.
12463
12476
  *)
12464
12477
  */
12465
- //# sourceMappingURL=chunk-P6S3DJQD.mjs.map
12478
+ //# sourceMappingURL=chunk-XT6SQI4D.mjs.map