@timardex/cluemart-server-shared 1.0.146 → 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",
@@ -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 {
@@ -10934,7 +10936,10 @@ var schoolSchema = create$3().shape({
10934
10936
  name: create$6().trim().required("Name is required"),
10935
10937
  region: create$6().trim().required("Region is required"),
10936
10938
  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"))
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"))
10938
10943
  });
10939
10944
  var PKG = "@timardex/cluemart-shared";
10940
10945
  var IMAGE_EXTENSION = ".webp";
@@ -11026,6 +11031,13 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
11026
11031
  EnumActivity2["VIEW"] = "VIEW";
11027
11032
  return EnumActivity2;
11028
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 || {});
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,7 +12292,15 @@ var schemaGameDate = new MongooseSchema19(
12277
12292
  },
12278
12293
  { _id: false }
12279
12294
  );
12280
- 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(
12281
12304
  {
12282
12305
  gameDate: { required: true, type: schemaGameDate },
12283
12306
  gameSolution: { required: true, type: String },
@@ -12289,17 +12312,9 @@ var schemaBaseGame = new MongooseSchema19(
12289
12312
  },
12290
12313
  { _id: false }
12291
12314
  );
12292
- var schemaLetters = new MongooseSchema19(
12315
+ var schemaDailyClueGameData = new MongooseSchema19(
12293
12316
  {
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
12297
- },
12298
- { _id: false }
12299
- );
12300
- var schemaDailyClue = new MongooseSchema19(
12301
- {
12302
- gameFields: { required: true, type: schemaBaseGame },
12317
+ gameFields: { required: true, type: schemaDailyClueBaseGame },
12303
12318
  lastFoundDate: { default: null, required: false, type: Date },
12304
12319
  letterInfo: {
12305
12320
  required: true,
@@ -12310,8 +12325,11 @@ var schemaDailyClue = new MongooseSchema19(
12310
12325
  },
12311
12326
  { _id: false }
12312
12327
  );
12328
+
12329
+ // src/mongoose/game/Game.ts
12330
+ var MongooseSchema20 = mongoose20.Schema;
12313
12331
  var gameDataSchemas = {
12314
- [EnumGameType.DAILY_CLUE]: schemaDailyClue
12332
+ [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData
12315
12333
  };
12316
12334
  var gameDataDefinition = Object.fromEntries(
12317
12335
  Object.entries(gameDataSchemas).map(([key, schema16]) => [
@@ -12319,7 +12337,7 @@ var gameDataDefinition = Object.fromEntries(
12319
12337
  { default: null, required: false, type: schema16 }
12320
12338
  ])
12321
12339
  );
12322
- var gameHistorySchema = new MongooseSchema19(
12340
+ var gameHistorySchema = new MongooseSchema20(
12323
12341
  {
12324
12342
  createdAt: { required: true, type: Date },
12325
12343
  gameDate: { required: true, type: schemaGameDate },
@@ -12337,7 +12355,7 @@ var gameHistorySchema = new MongooseSchema19(
12337
12355
  },
12338
12356
  { _id: false }
12339
12357
  );
12340
- var gameTypeSchema = new MongooseSchema19(
12358
+ var gameTypeSchema = new MongooseSchema20(
12341
12359
  {
12342
12360
  active: { default: true, required: true, type: Boolean },
12343
12361
  gameData: gameDataDefinition,
@@ -12350,7 +12368,7 @@ var gameTypeSchema = new MongooseSchema19(
12350
12368
  },
12351
12369
  { timestamps: true }
12352
12370
  );
12353
- var schema14 = new MongooseSchema19(
12371
+ var schema14 = new MongooseSchema20(
12354
12372
  {
12355
12373
  active: { default: false, required: true, type: Boolean },
12356
12374
  deletedAt: { default: null, required: false, type: Date },
@@ -12363,12 +12381,12 @@ var schema14 = new MongooseSchema19(
12363
12381
  },
12364
12382
  { timestamps: true }
12365
12383
  );
12366
- var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
12384
+ var GameModel = mongoose20.models.Game || mongoose20.model("Game", schema14);
12367
12385
 
12368
12386
  // src/mongoose/School.ts
12369
- import mongoose20 from "mongoose";
12370
- var MongooseSchema20 = mongoose20.Schema;
12371
- var schema15 = new MongooseSchema20(
12387
+ import mongoose21 from "mongoose";
12388
+ var MongooseSchema21 = mongoose21.Schema;
12389
+ var schema15 = new MongooseSchema21(
12372
12390
  {
12373
12391
  // New schools are active by default
12374
12392
  active: { default: true, required: true, type: Boolean },
@@ -12393,7 +12411,7 @@ var schema15 = new MongooseSchema20(
12393
12411
  },
12394
12412
  { timestamps: true }
12395
12413
  );
12396
- var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
12414
+ var SchoolModel = mongoose21.models.School || mongoose21.model("School", schema15);
12397
12415
 
12398
12416
  export {
12399
12417
  EnumResourceType,
@@ -12462,4 +12480,4 @@ react/cjs/react.development.js:
12462
12480
  * LICENSE file in the root directory of this source tree.
12463
12481
  *)
12464
12482
  */
12465
- //# sourceMappingURL=chunk-P6S3DJQD.mjs.map
12483
+ //# sourceMappingURL=chunk-4ZDEYFIM.mjs.map