@timardex/cluemart-server-shared 1.0.131 → 1.0.133

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.mjs CHANGED
@@ -4677,10 +4677,10 @@ var Condition = class _Condition {
4677
4677
  otherwise
4678
4678
  } = config;
4679
4679
  let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
4680
- return new _Condition(refs, (values, schema15) => {
4680
+ return new _Condition(refs, (values, schema16) => {
4681
4681
  var _branch;
4682
4682
  let branch = check(...values) ? then : otherwise;
4683
- return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
4683
+ return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
4684
4684
  });
4685
4685
  }
4686
4686
  constructor(refs, builder) {
@@ -4694,13 +4694,13 @@ var Condition = class _Condition {
4694
4694
  // TODO: ? operator here?
4695
4695
  ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
4696
4696
  ));
4697
- let schema15 = this.fn(values, base, options);
4698
- if (schema15 === void 0 || // @ts-ignore this can be base
4699
- schema15 === base) {
4697
+ let schema16 = this.fn(values, base, options);
4698
+ if (schema16 === void 0 || // @ts-ignore this can be base
4699
+ schema16 === base) {
4700
4700
  return base;
4701
4701
  }
4702
- if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
4703
- return schema15.resolve(options);
4702
+ if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
4703
+ return schema16.resolve(options);
4704
4704
  }
4705
4705
  };
4706
4706
  var prefixes = {
@@ -4770,7 +4770,7 @@ function createValidation(config) {
4770
4770
  path = "",
4771
4771
  options,
4772
4772
  originalValue,
4773
- schema: schema15
4773
+ schema: schema16
4774
4774
  }, panic, next) {
4775
4775
  const {
4776
4776
  name,
@@ -4782,8 +4782,8 @@ function createValidation(config) {
4782
4782
  let {
4783
4783
  parent,
4784
4784
  context,
4785
- abortEarly = schema15.spec.abortEarly,
4786
- disableStackTrace = schema15.spec.disableStackTrace
4785
+ abortEarly = schema16.spec.abortEarly,
4786
+ disableStackTrace = schema16.spec.disableStackTrace
4787
4787
  } = options;
4788
4788
  function resolve(item) {
4789
4789
  return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
@@ -4792,9 +4792,9 @@ function createValidation(config) {
4792
4792
  const nextParams = Object.assign({
4793
4793
  value,
4794
4794
  originalValue,
4795
- label: schema15.spec.label,
4795
+ label: schema16.spec.label,
4796
4796
  path: overrides.path || path,
4797
- spec: schema15.spec,
4797
+ spec: schema16.spec,
4798
4798
  disableStackTrace: overrides.disableStackTrace || disableStackTrace
4799
4799
  }, params, overrides.params);
4800
4800
  for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
@@ -4812,7 +4812,7 @@ function createValidation(config) {
4812
4812
  resolve,
4813
4813
  options,
4814
4814
  originalValue,
4815
- schema: schema15
4815
+ schema: schema16
4816
4816
  };
4817
4817
  const handleResult = (validOrError) => {
4818
4818
  if (ValidationError.isError(validOrError)) invalid(validOrError);
@@ -4846,42 +4846,42 @@ function createValidation(config) {
4846
4846
  validate.OPTIONS = config;
4847
4847
  return validate;
4848
4848
  }
4849
- function getIn(schema15, path, value, context = value) {
4849
+ function getIn(schema16, path, value, context = value) {
4850
4850
  let parent, lastPart, lastPartDebug;
4851
4851
  if (!path) return {
4852
4852
  parent,
4853
4853
  parentPath: path,
4854
- schema: schema15
4854
+ schema: schema16
4855
4855
  };
4856
4856
  (0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
4857
4857
  let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
4858
- schema15 = schema15.resolve({
4858
+ schema16 = schema16.resolve({
4859
4859
  context,
4860
4860
  parent,
4861
4861
  value
4862
4862
  });
4863
- let isTuple = schema15.type === "tuple";
4863
+ let isTuple = schema16.type === "tuple";
4864
4864
  let idx = isArray ? parseInt(part, 10) : 0;
4865
- if (schema15.innerType || isTuple) {
4865
+ if (schema16.innerType || isTuple) {
4866
4866
  if (isTuple && !isArray) throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${lastPartDebug}" must contain an index to the tuple element, e.g. "${lastPartDebug}[0]"`);
4867
4867
  if (value && idx >= value.length) {
4868
4868
  throw new Error(`Yup.reach cannot resolve an array item at index: ${_part}, in the path: ${path}. because there is no value at that index. `);
4869
4869
  }
4870
4870
  parent = value;
4871
4871
  value = value && value[idx];
4872
- schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
4872
+ schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
4873
4873
  }
4874
4874
  if (!isArray) {
4875
- if (!schema15.fields || !schema15.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema15.type}")`);
4875
+ if (!schema16.fields || !schema16.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema16.type}")`);
4876
4876
  parent = value;
4877
4877
  value = value && value[part];
4878
- schema15 = schema15.fields[part];
4878
+ schema16 = schema16.fields[part];
4879
4879
  }
4880
4880
  lastPart = part;
4881
4881
  lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
4882
4882
  });
4883
4883
  return {
4884
- schema: schema15,
4884
+ schema: schema16,
4885
4885
  parent,
4886
4886
  parentPath: lastPart
4887
4887
  };
@@ -5018,20 +5018,20 @@ var Schema = class {
5018
5018
  this._mutate = before;
5019
5019
  return result;
5020
5020
  }
5021
- concat(schema15) {
5022
- if (!schema15 || schema15 === this) return this;
5023
- if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
5021
+ concat(schema16) {
5022
+ if (!schema16 || schema16 === this) return this;
5023
+ if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
5024
5024
  let base = this;
5025
- let combined = schema15.clone();
5025
+ let combined = schema16.clone();
5026
5026
  const mergedSpec = Object.assign({}, base.spec, combined.spec);
5027
5027
  combined.spec = mergedSpec;
5028
5028
  combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
5029
- combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
5030
- combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
5029
+ combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
5030
+ combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
5031
5031
  combined.tests = base.tests;
5032
5032
  combined.exclusiveTests = base.exclusiveTests;
5033
5033
  combined.withMutation((next) => {
5034
- schema15.tests.forEach((fn) => {
5034
+ schema16.tests.forEach((fn) => {
5035
5035
  next.test(fn.OPTIONS);
5036
5036
  });
5037
5037
  });
@@ -5047,15 +5047,15 @@ var Schema = class {
5047
5047
  return this._typeCheck(v);
5048
5048
  }
5049
5049
  resolve(options) {
5050
- let schema15 = this;
5051
- if (schema15.conditions.length) {
5052
- let conditions = schema15.conditions;
5053
- schema15 = schema15.clone();
5054
- schema15.conditions = [];
5055
- schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
5056
- schema15 = schema15.resolve(options);
5050
+ let schema16 = this;
5051
+ if (schema16.conditions.length) {
5052
+ let conditions = schema16.conditions;
5053
+ schema16 = schema16.clone();
5054
+ schema16.conditions = [];
5055
+ schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
5056
+ schema16 = schema16.resolve(options);
5057
5057
  }
5058
- return schema15;
5058
+ return schema16;
5059
5059
  }
5060
5060
  resolveOptions(options) {
5061
5061
  var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
@@ -5209,11 +5209,11 @@ attempted value: ${formattedValue}
5209
5209
  }
5210
5210
  validate(value, options) {
5211
5211
  var _options$disableStack2;
5212
- let schema15 = this.resolve(Object.assign({}, options, {
5212
+ let schema16 = this.resolve(Object.assign({}, options, {
5213
5213
  value
5214
5214
  }));
5215
- let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
5216
- return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
5215
+ let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
5216
+ return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
5217
5217
  if (ValidationError.isError(error)) error.value = parsed;
5218
5218
  reject(error);
5219
5219
  }, (errors, validated) => {
@@ -5223,12 +5223,12 @@ attempted value: ${formattedValue}
5223
5223
  }
5224
5224
  validateSync(value, options) {
5225
5225
  var _options$disableStack3;
5226
- let schema15 = this.resolve(Object.assign({}, options, {
5226
+ let schema16 = this.resolve(Object.assign({}, options, {
5227
5227
  value
5228
5228
  }));
5229
5229
  let result;
5230
- let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
5231
- schema15._validate(value, Object.assign({}, options, {
5230
+ let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
5231
+ schema16._validate(value, Object.assign({}, options, {
5232
5232
  sync: true
5233
5233
  }), (error, parsed) => {
5234
5234
  if (ValidationError.isError(error)) error.value = parsed;
@@ -5262,8 +5262,8 @@ attempted value: ${formattedValue}
5262
5262
  return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
5263
5263
  }
5264
5264
  getDefault(options) {
5265
- let schema15 = this.resolve(options || {});
5266
- return schema15._getDefault(options);
5265
+ let schema16 = this.resolve(options || {});
5266
+ return schema16._getDefault(options);
5267
5267
  }
5268
5268
  default(def) {
5269
5269
  if (arguments.length === 0) {
@@ -5498,9 +5498,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
5498
5498
  const {
5499
5499
  parent,
5500
5500
  parentPath,
5501
- schema: schema15
5501
+ schema: schema16
5502
5502
  } = getIn(this, path, value, options.context);
5503
- return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
5503
+ return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
5504
5504
  parent,
5505
5505
  path
5506
5506
  }));
@@ -5674,7 +5674,7 @@ var StringSchema = class extends Schema {
5674
5674
  });
5675
5675
  }
5676
5676
  required(message) {
5677
- return super.required(message).withMutation((schema15) => schema15.test({
5677
+ return super.required(message).withMutation((schema16) => schema16.test({
5678
5678
  message: message || mixed.required,
5679
5679
  name: "required",
5680
5680
  skipAbsent: true,
@@ -5682,9 +5682,9 @@ var StringSchema = class extends Schema {
5682
5682
  }));
5683
5683
  }
5684
5684
  notRequired() {
5685
- return super.notRequired().withMutation((schema15) => {
5686
- schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
5687
- return schema15;
5685
+ return super.notRequired().withMutation((schema16) => {
5686
+ schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
5687
+ return schema16;
5688
5688
  });
5689
5689
  }
5690
5690
  length(length, message = string.length) {
@@ -6073,28 +6073,28 @@ var parseJson = (value, _, ctx) => {
6073
6073
  }
6074
6074
  return ctx.isType(parsed) ? parsed : value;
6075
6075
  };
6076
- function deepPartial(schema15) {
6077
- if ("fields" in schema15) {
6076
+ function deepPartial(schema16) {
6077
+ if ("fields" in schema16) {
6078
6078
  const partial = {};
6079
- for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
6079
+ for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
6080
6080
  partial[key] = deepPartial(fieldSchema);
6081
6081
  }
6082
- return schema15.setFields(partial);
6082
+ return schema16.setFields(partial);
6083
6083
  }
6084
- if (schema15.type === "array") {
6085
- const nextArray = schema15.optional();
6084
+ if (schema16.type === "array") {
6085
+ const nextArray = schema16.optional();
6086
6086
  if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
6087
6087
  return nextArray;
6088
6088
  }
6089
- if (schema15.type === "tuple") {
6090
- return schema15.optional().clone({
6091
- types: schema15.spec.types.map(deepPartial)
6089
+ if (schema16.type === "tuple") {
6090
+ return schema16.optional().clone({
6091
+ types: schema16.spec.types.map(deepPartial)
6092
6092
  });
6093
6093
  }
6094
- if ("optional" in schema15) {
6095
- return schema15.optional();
6094
+ if ("optional" in schema16) {
6095
+ return schema16.optional();
6096
6096
  }
6097
- return schema15;
6097
+ return schema16;
6098
6098
  }
6099
6099
  var deepHas = (obj, p) => {
6100
6100
  const path = [...(0, import_property_expr.normalizePath)(p)];
@@ -6228,8 +6228,8 @@ var ObjectSchema = class extends Schema {
6228
6228
  next._sortErrors = this._sortErrors;
6229
6229
  return next;
6230
6230
  }
6231
- concat(schema15) {
6232
- let next = super.concat(schema15);
6231
+ concat(schema16) {
6232
+ let next = super.concat(schema16);
6233
6233
  let nextFields = next.fields;
6234
6234
  for (let [field, schemaOrRef] of Object.entries(this.fields)) {
6235
6235
  const target = nextFields[field];
@@ -6237,7 +6237,7 @@ var ObjectSchema = class extends Schema {
6237
6237
  }
6238
6238
  return next.withMutation((s) => (
6239
6239
  // XXX: excludes here is wrong
6240
- s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
6240
+ s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
6241
6241
  ));
6242
6242
  }
6243
6243
  _getDefault(options) {
@@ -6282,8 +6282,8 @@ var ObjectSchema = class extends Schema {
6282
6282
  }
6283
6283
  partial() {
6284
6284
  const partial = {};
6285
- for (const [key, schema15] of Object.entries(this.fields)) {
6286
- partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
6285
+ for (const [key, schema16] of Object.entries(this.fields)) {
6286
+ partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
6287
6287
  }
6288
6288
  return this.setFields(partial);
6289
6289
  }
@@ -6481,22 +6481,22 @@ var ArraySchema = class extends Schema {
6481
6481
  json() {
6482
6482
  return this.transform(parseJson);
6483
6483
  }
6484
- concat(schema15) {
6485
- let next = super.concat(schema15);
6484
+ concat(schema16) {
6485
+ let next = super.concat(schema16);
6486
6486
  next.innerType = this.innerType;
6487
- if (schema15.innerType)
6487
+ if (schema16.innerType)
6488
6488
  next.innerType = next.innerType ? (
6489
6489
  // @ts-expect-error Lazy doesn't have concat and will break
6490
- next.innerType.concat(schema15.innerType)
6491
- ) : schema15.innerType;
6490
+ next.innerType.concat(schema16.innerType)
6491
+ ) : schema16.innerType;
6492
6492
  return next;
6493
6493
  }
6494
- of(schema15) {
6494
+ of(schema16) {
6495
6495
  let next = this.clone();
6496
- if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
6497
- next.innerType = schema15;
6496
+ if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
6497
+ next.innerType = schema16;
6498
6498
  next.spec = Object.assign({}, next.spec, {
6499
- types: schema15
6499
+ types: schema16
6500
6500
  });
6501
6501
  return next;
6502
6502
  }
@@ -6640,7 +6640,7 @@ var TupleSchema = class extends Schema {
6640
6640
  describe(options) {
6641
6641
  const next = (options ? this.resolve(options) : this).clone();
6642
6642
  const base = super.describe(options);
6643
- base.innerType = next.spec.types.map((schema15, index) => {
6643
+ base.innerType = next.spec.types.map((schema16, index) => {
6644
6644
  var _innerOptions;
6645
6645
  let innerOptions = options;
6646
6646
  if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
@@ -6649,7 +6649,7 @@ var TupleSchema = class extends Schema {
6649
6649
  value: innerOptions.value[index]
6650
6650
  });
6651
6651
  }
6652
- return schema15.describe(innerOptions);
6652
+ return schema16.describe(innerOptions);
6653
6653
  });
6654
6654
  return base;
6655
6655
  }
@@ -6666,6 +6666,7 @@ var import_react2 = __toESM(require_react(), 1);
6666
6666
  var React8 = __toESM(require_react(), 1);
6667
6667
  var import_react3 = __toESM(require_react(), 1);
6668
6668
  var import_react4 = __toESM(require_react(), 1);
6669
+ var import_react5 = __toESM(require_react(), 1);
6669
6670
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
6670
6671
  EnumInviteStatus22["ACCEPTED"] = "Accepted";
6671
6672
  EnumInviteStatus22["COMPLETED"] = "Completed";
@@ -6755,9 +6756,13 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
6755
6756
  EnumNotificationResourceType22["DEACTIVATED_EVENT"] = "deactivated_event";
6756
6757
  EnumNotificationResourceType22["DEACTIVATED_PARTNER"] = "deactivated_partner";
6757
6758
  EnumNotificationResourceType22["DEACTIVATED_VENDOR"] = "deactivated_vendor";
6759
+ EnumNotificationResourceType22["DOWNGRADED_EVENT"] = "downgraded_event";
6760
+ EnumNotificationResourceType22["DOWNGRADED_PARTNER"] = "downgraded_partner";
6761
+ EnumNotificationResourceType22["DOWNGRADED_VENDOR"] = "downgraded_vendor";
6758
6762
  EnumNotificationResourceType22["DECLINED_EVENT"] = "declined_event";
6759
6763
  EnumNotificationResourceType22["DECLINED_PARTNER"] = "declined_partner";
6760
6764
  EnumNotificationResourceType22["DECLINED_VENDOR"] = "declined_vendor";
6765
+ EnumNotificationResourceType22["DAILY_CLUE_LETTER_AVAILABLE"] = "daily_clue_letter_available";
6761
6766
  EnumNotificationResourceType22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
6762
6767
  EnumNotificationResourceType22["EVENT_STARTING_SOON"] = "event_starting_soon";
6763
6768
  EnumNotificationResourceType22["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
@@ -6769,11 +6774,11 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
6769
6774
  return EnumNotificationResourceType22;
6770
6775
  })(EnumNotificationResourceType || {});
6771
6776
  var EnumNotificationType = /* @__PURE__ */ ((EnumNotificationType22) => {
6777
+ EnumNotificationType22["CHAT"] = "chat";
6772
6778
  EnumNotificationType22["EVENT"] = "event";
6773
- EnumNotificationType22["VENDOR"] = "vendor";
6774
6779
  EnumNotificationType22["RELATION"] = "relation";
6775
- EnumNotificationType22["CHAT"] = "chat";
6776
6780
  EnumNotificationType22["SYSTEM"] = "system";
6781
+ EnumNotificationType22["VENDOR"] = "vendor";
6777
6782
  return EnumNotificationType22;
6778
6783
  })(EnumNotificationType || {});
6779
6784
  var EnumRegions = /* @__PURE__ */ ((EnumRegions22) => {
@@ -6841,6 +6846,17 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
6841
6846
  EnumSubscriptionStatus22["TRIALING"] = "trialing";
6842
6847
  return EnumSubscriptionStatus22;
6843
6848
  })(EnumSubscriptionStatus || {});
6849
+ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
6850
+ EnumGameType2["DAILY_CLUE"] = "dailyClue";
6851
+ return EnumGameType2;
6852
+ })(EnumGameType || {});
6853
+ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus3) => {
6854
+ EnumGameStatus3["GAME_COMPLETED"] = "GAME_COMPLETED";
6855
+ EnumGameStatus3["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
6856
+ EnumGameStatus3["GAME_LEFT"] = "GAME_LEFT";
6857
+ EnumGameStatus3["GAME_STARTED"] = "GAME_STARTED";
6858
+ return EnumGameStatus3;
6859
+ })(EnumGameStatus || {});
6844
6860
  var dateFormat = "DD-MM-YYYY";
6845
6861
  var timeFormat = "HH:mm";
6846
6862
  dayjs.extend(customParseFormat);
@@ -8275,6 +8291,7 @@ var USER_FIELDS_FRAGMENT = gql`
8275
8291
  promoCodes
8276
8292
  refreshToken
8277
8293
  role
8294
+ school
8278
8295
  termsAgreement {
8279
8296
  ...TermsAgreementFields
8280
8297
  }
@@ -9876,46 +9893,63 @@ var GAME_HISTORY_FIELDS_FRAGMENT = gql`
9876
9893
  }
9877
9894
  ${GAME_DATE_FIELDS_FRAGMENT}
9878
9895
  `;
9896
+ var GAME_DATA_FIELDS_FRAGMENT = gql`
9897
+ fragment GameDataFields on GameDataType {
9898
+ dailyClue {
9899
+ ...DailyClueGameDataFields
9900
+ }
9901
+ }
9902
+ ${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
9903
+ `;
9879
9904
  var GAME_FIELDS_FRAGMENT = gql`
9880
9905
  fragment GameFields on GameType {
9881
- _id
9882
9906
  active
9883
9907
  createdAt
9884
- deletedAt
9885
9908
  gameData {
9886
- dailyClue {
9887
- ...DailyClueGameDataFields
9888
- }
9909
+ ...GameDataFields
9889
9910
  }
9890
9911
  gameHistory {
9891
9912
  ...GameHistoryFields
9892
9913
  }
9914
+ gameType
9893
9915
  updatedAt
9916
+ }
9917
+ ${GAME_DATA_FIELDS_FRAGMENT}
9918
+ ${GAME_HISTORY_FIELDS_FRAGMENT}
9919
+ `;
9920
+ var GAME_DOC_FIELDS_FRAGMENT = gql`
9921
+ fragment GameDocFields on GameDocType {
9922
+ _id
9923
+ active
9924
+ createdAt
9925
+ deletedAt
9926
+ games {
9927
+ ...GameFields
9928
+ }
9894
9929
  owner {
9895
9930
  ...OwnerFields
9896
9931
  }
9897
9932
  points
9933
+ updatedAt
9898
9934
  }
9899
- ${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
9900
9935
  ${OWNER_FIELDS_FRAGMENT}
9901
- ${GAME_DATE_FIELDS_FRAGMENT}
9902
- ${GAME_HISTORY_FIELDS_FRAGMENT}
9936
+ ${GAME_FIELDS_FRAGMENT}
9903
9937
  `;
9904
9938
  var GET_GAMES = gql`
9905
9939
  query getGames {
9906
9940
  games {
9907
- ...GameFields
9941
+ ...GameDocFields
9908
9942
  }
9909
9943
  }
9910
- ${GAME_FIELDS_FRAGMENT}
9944
+ ${GAME_DOC_FIELDS_FRAGMENT}
9911
9945
  `;
9912
9946
  var GET_GAME = gql`
9913
9947
  query getGame($_id: ID!) {
9914
9948
  game(_id: $_id) {
9915
- ...GameFields
9949
+ ...GameDocFields
9916
9950
  }
9917
9951
  }
9918
- ${GAME_FIELDS_FRAGMENT}
9952
+ ${GAME_DOC_FIELDS_FRAGMENT}
9919
9953
  `;
9920
9954
  var GET_GAME_LEADERBOARD = gql`
9921
9955
  query getGameLeaderboard {
@@ -10078,10 +10112,10 @@ var GET_APP_SETTINGS = gql`
10078
10112
  var START_GAME_MUTATION = gql`
10079
10113
  mutation startGame($input: BaseGameInputType!) {
10080
10114
  startGame(input: $input) {
10081
- ...GameFields
10115
+ ...GameDocFields
10082
10116
  }
10083
10117
  }
10084
- ${GAME_FIELDS_FRAGMENT}
10118
+ ${GAME_DOC_FIELDS_FRAGMENT}
10085
10119
  `;
10086
10120
  var LEAVE_GAME_MUTATION = gql`
10087
10121
  mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
@@ -10091,10 +10125,79 @@ var LEAVE_GAME_MUTATION = gql`
10091
10125
  var UPDATE_DAILY_CLUE_MUTATION = gql`
10092
10126
  mutation updateDailyClueGame($_id: ID!, $foundLetter: String!) {
10093
10127
  updateDailyClueGame(_id: $_id, foundLetter: $foundLetter) {
10094
- ...GameFields
10128
+ ...GameDocFields
10095
10129
  }
10096
10130
  }
10097
- ${GAME_FIELDS_FRAGMENT}
10131
+ ${GAME_DOC_FIELDS_FRAGMENT}
10132
+ `;
10133
+ var SCHOOL = gql`
10134
+ fragment SchoolFields on SchoolType {
10135
+ _id
10136
+ active
10137
+ contactDetails {
10138
+ ...ContactDetailsFields
10139
+ }
10140
+ location {
10141
+ ...LocationFields
10142
+ }
10143
+ createdAt
10144
+ deletedAt
10145
+ logo {
10146
+ ...ResourceImageFields
10147
+ }
10148
+ name
10149
+ owner {
10150
+ ...OwnerFields
10151
+ }
10152
+ region
10153
+ studentCount
10154
+ termsAgreement {
10155
+ ...TermsAgreementFields
10156
+ }
10157
+ updatedAt
10158
+ }
10159
+ ${OWNER_FIELDS_FRAGMENT}
10160
+ ${LOCATION_FIELDS_FRAGMENT}
10161
+ ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
10162
+ ${CONTACT_DETAILS_FIELDS_FRAGMENT}
10163
+ ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
10164
+ `;
10165
+ var GET_SCHOOL = gql`
10166
+ query getSchool($_id: ID!) {
10167
+ school(_id: $_id) {
10168
+ ...SchoolFields
10169
+ }
10170
+ }
10171
+ ${SCHOOL}
10172
+ `;
10173
+ var GET_SCHOOLS = gql`
10174
+ query getSchools {
10175
+ schools {
10176
+ ...SchoolFields
10177
+ }
10178
+ }
10179
+ ${SCHOOL}
10180
+ `;
10181
+ var CREATE_SCHOOL_MUTATION = gql`
10182
+ mutation createSchool($input: SchoolInputType!) {
10183
+ createSchool(input: $input) {
10184
+ ...SchoolFields
10185
+ }
10186
+ }
10187
+ ${SCHOOL}
10188
+ `;
10189
+ var UPDATE_SCHOOL_MUTATION = gql`
10190
+ mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
10191
+ updateSchool(_id: $_id, input: $input) {
10192
+ ...SchoolFields
10193
+ }
10194
+ }
10195
+ ${SCHOOL}
10196
+ `;
10197
+ var DELETE_SCHOOL_MUTATION = gql`
10198
+ mutation deleteSchool($_id: ID!) {
10199
+ deleteSchool(_id: $_id)
10200
+ }
10098
10201
  `;
10099
10202
  var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
10100
10203
  var nzbnRegex = /^94\d{11}$/;
@@ -10247,7 +10350,7 @@ var socialMediaSchema = create$3({
10247
10350
  is: (name) => !!name,
10248
10351
  // If name has a value
10249
10352
  then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
10250
- otherwise: (schema15) => schema15.notRequired()
10353
+ otherwise: (schema16) => schema16.notRequired()
10251
10354
  })
10252
10355
  });
10253
10356
  var globalResourceSchema = create$3().shape({
@@ -10323,21 +10426,21 @@ var paymentInfoSchema = create$3({
10323
10426
  ).required("Please select a Payment method"),
10324
10427
  accountHolderName: create$6().when("paymentMethod", {
10325
10428
  is: "bank_transfer",
10326
- then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
10327
- otherwise: (schema15) => schema15.notRequired()
10429
+ then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
10430
+ otherwise: (schema16) => schema16.notRequired()
10328
10431
  }),
10329
10432
  accountNumber: create$6().when("paymentMethod", {
10330
10433
  is: "bank_transfer",
10331
- then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
10434
+ then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
10332
10435
  nzBankAccountRegex,
10333
10436
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
10334
10437
  ).trim(),
10335
- otherwise: (schema15) => schema15.notRequired()
10438
+ otherwise: (schema16) => schema16.notRequired()
10336
10439
  }),
10337
10440
  link: create$6().when("paymentMethod", {
10338
10441
  is: (val) => val === "paypal" || val === "stripe",
10339
10442
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
10340
- otherwise: (schema15) => schema15.notRequired()
10443
+ otherwise: (schema16) => schema16.notRequired()
10341
10444
  })
10342
10445
  });
10343
10446
  var eventInfoSchema = create$3().shape({
@@ -10487,16 +10590,16 @@ var vendorInfoSchema = create$3().shape({
10487
10590
  var userSchema = create$3().shape({
10488
10591
  active: create$7().required("Active is required"),
10489
10592
  email: emailRequiredSchema,
10490
- firstName: create$6().label("First Name").required("First name is required"),
10491
- lastName: create$6().label("Last Name").required("Last name is required"),
10593
+ firstName: create$6().label("First Name").trim().required("First name is required"),
10594
+ lastName: create$6().label("Last Name").trim().required("Last name is required"),
10492
10595
  isTester: create$7().required("Tester status is required"),
10493
10596
  password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
10494
10597
  preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
10495
10598
  confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
10496
10599
  is: (val) => !!val,
10497
10600
  // only necessary if password typed
10498
- then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10499
- otherwise: (schema15) => schema15.notRequired()
10601
+ then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10602
+ otherwise: (schema16) => schema16.notRequired()
10500
10603
  }),
10501
10604
  role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
10502
10605
  });
@@ -10567,7 +10670,7 @@ var adSchema = create$3().shape({
10567
10670
  return endDate > now;
10568
10671
  }).when("start", {
10569
10672
  is: (val) => val && val.length > 0,
10570
- then: (schema15) => schema15.test(
10673
+ then: (schema16) => schema16.test(
10571
10674
  "is-after-start",
10572
10675
  "End date must be after start date",
10573
10676
  function(value) {
@@ -10711,6 +10814,14 @@ var contactUsSchema = create$3().shape({
10711
10814
  lastName: create$6().label("Last Name").required("Last name is required"),
10712
10815
  message: create$6().label("Message").required("Message is required")
10713
10816
  });
10817
+ var schoolSchema = create$3().shape({
10818
+ active: create$7().required("Active is required"),
10819
+ contactDetails: contactDetailsSchema,
10820
+ location: locationSchema,
10821
+ name: create$6().trim().required("Name is required"),
10822
+ region: create$6().trim().required("Region is required"),
10823
+ studentCount: create$5().label("Student Count").min(0, "Student count cannot be negative").required("Student count is required").test("no-leading-zeros", "", noLeadingZeros("Student Count"))
10824
+ });
10714
10825
  var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
10715
10826
  EnumActivity2["FAVORITE"] = "FAVORITE";
10716
10827
  EnumActivity2["GOING"] = "GOING";
@@ -10719,16 +10830,6 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
10719
10830
  EnumActivity2["VIEW"] = "VIEW";
10720
10831
  return EnumActivity2;
10721
10832
  })(EnumActivity || {});
10722
- var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
10723
- EnumGameType2["DAILY_CLUE"] = "dailyClue";
10724
- return EnumGameType2;
10725
- })(EnumGameType || {});
10726
- var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
10727
- EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
10728
- EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
10729
- EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
10730
- return EnumGameStatus2;
10731
- })(EnumGameStatus || {});
10732
10833
 
10733
10834
  // src/mongoose/Ad.ts
10734
10835
  import mongoose from "mongoose";
@@ -11288,27 +11389,27 @@ var baseResourceFields = {
11288
11389
  required: false,
11289
11390
  type: [associatesSchema]
11290
11391
  },
11291
- contactDetails: ContactDetailsSchema,
11392
+ contactDetails: { required: false, type: ContactDetailsSchema },
11292
11393
  cover: {
11293
11394
  required: true,
11294
11395
  type: ResourceImageTypeSchema
11295
11396
  },
11296
11397
  deletedAt: { default: null, required: false, type: Date },
11297
11398
  description: { required: true, type: String },
11298
- images: [ResourceImageTypeSchema],
11299
- logo: ResourceImageTypeSchema,
11399
+ images: { required: false, type: [ResourceImageTypeSchema] },
11400
+ logo: { required: false, type: ResourceImageTypeSchema },
11300
11401
  name: { required: true, type: String },
11301
11402
  owner: {
11302
11403
  required: false,
11303
11404
  type: OwnerTypeSchema
11304
11405
  },
11305
- posterUsage: PosterUsageTypeSchema,
11406
+ posterUsage: { required: false, type: PosterUsageTypeSchema },
11306
11407
  promoCodes: { required: false, type: [String] },
11307
11408
  rating: { required: false, type: Number },
11308
11409
  region: { required: true, type: String },
11309
11410
  reviewCount: { required: false, type: Number },
11310
- socialMedia: [SocialMediaTypeSchema],
11311
- termsAgreement: termsAgreementSchema
11411
+ socialMedia: { required: false, type: [SocialMediaTypeSchema] },
11412
+ termsAgreement: { required: true, type: termsAgreementSchema }
11312
11413
  };
11313
11414
 
11314
11415
  // src/mongoose/GoogleImportedMarket.ts
@@ -11424,7 +11525,7 @@ schema4.index({ isRead: 1, userId: 1 });
11424
11525
  schema4.index({ createdAt: -1, userId: 1 });
11425
11526
  var NotificationModel = mongoose8.models.Notification || mongoose8.model("Notification", schema4);
11426
11527
 
11427
- // node_modules/@timardex/cluemart-shared/dist/chunk-USQKKCIA.mjs
11528
+ // node_modules/@timardex/cluemart-shared/dist/chunk-534WN2SR.mjs
11428
11529
  var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
11429
11530
  EnumOSPlatform22["ANDROID"] = "android";
11430
11531
  EnumOSPlatform22["IOS"] = "ios";
@@ -11621,6 +11722,11 @@ var schema7 = new MongooseSchema11(
11621
11722
  required: true,
11622
11723
  type: String
11623
11724
  },
11725
+ school: {
11726
+ ref: "School",
11727
+ required: false,
11728
+ type: mongoose11.Schema.Types.ObjectId
11729
+ },
11624
11730
  stripe: {
11625
11731
  required: false,
11626
11732
  type: stripeSchema
@@ -12011,9 +12117,9 @@ var gameDataSchemas = {
12011
12117
  [EnumGameType.DAILY_CLUE]: schemaDailyClue
12012
12118
  };
12013
12119
  var gameDataDefinition = Object.fromEntries(
12014
- Object.entries(gameDataSchemas).map(([key, schema15]) => [
12120
+ Object.entries(gameDataSchemas).map(([key, schema16]) => [
12015
12121
  key,
12016
- { default: null, required: false, type: schema15 }
12122
+ { default: null, required: false, type: schema16 }
12017
12123
  ])
12018
12124
  );
12019
12125
  var gameHistorySchema = new MongooseSchema19(
@@ -12033,12 +12139,24 @@ var gameHistorySchema = new MongooseSchema19(
12033
12139
  },
12034
12140
  { _id: false }
12035
12141
  );
12142
+ var gameTypeSchema = new MongooseSchema19(
12143
+ {
12144
+ active: { default: true, required: true, type: Boolean },
12145
+ gameData: gameDataDefinition,
12146
+ gameHistory: { default: [], required: true, type: [gameHistorySchema] },
12147
+ gameType: {
12148
+ enum: Object.values(EnumGameType),
12149
+ required: true,
12150
+ type: String
12151
+ }
12152
+ },
12153
+ { _id: false, timestamps: true }
12154
+ );
12036
12155
  var schema14 = new MongooseSchema19(
12037
12156
  {
12038
12157
  active: { default: false, required: true, type: Boolean },
12039
12158
  deletedAt: { default: null, required: false, type: Date },
12040
- gameData: gameDataDefinition,
12041
- gameHistory: { default: [], required: true, type: [gameHistorySchema] },
12159
+ games: { default: [], required: false, type: [gameTypeSchema] },
12042
12160
  owner: {
12043
12161
  required: true,
12044
12162
  type: OwnerTypeSchema
@@ -12049,8 +12167,34 @@ var schema14 = new MongooseSchema19(
12049
12167
  );
12050
12168
  var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
12051
12169
 
12052
- // src/service/database.ts
12170
+ // src/mongoose/School.ts
12053
12171
  import mongoose20 from "mongoose";
12172
+ var MongooseSchema20 = mongoose20.Schema;
12173
+ var schema15 = new MongooseSchema20(
12174
+ {
12175
+ active: { default: false, required: true, type: Boolean },
12176
+ contactDetails: { required: false, type: ContactDetailsSchema },
12177
+ deletedAt: { default: null, required: false, type: Date },
12178
+ location: {
12179
+ required: true,
12180
+ type: locationsSchema
12181
+ },
12182
+ logo: { required: false, type: ResourceImageTypeSchema },
12183
+ name: { required: true, type: String },
12184
+ owner: {
12185
+ required: true,
12186
+ type: OwnerTypeSchema
12187
+ },
12188
+ region: { required: true, type: String },
12189
+ studentCount: { required: true, type: Number },
12190
+ termsAgreement: { required: true, type: termsAgreementSchema }
12191
+ },
12192
+ { timestamps: true }
12193
+ );
12194
+ var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
12195
+
12196
+ // src/service/database.ts
12197
+ import mongoose21 from "mongoose";
12054
12198
  var connectToDatabase = async ({
12055
12199
  appName,
12056
12200
  dbName,
@@ -12063,7 +12207,7 @@ var connectToDatabase = async ({
12063
12207
  // Fallback to MongoDB Atlas connection string
12064
12208
  `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
12065
12209
  );
12066
- await mongoose20.connect(mongoUri);
12210
+ await mongoose21.connect(mongoUri);
12067
12211
  const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
12068
12212
  console.log(
12069
12213
  `${connectionType} connected from server/src/service/database.ts`
@@ -12299,12 +12443,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
12299
12443
  }
12300
12444
 
12301
12445
  // src/service/objectIdToString.ts
12302
- import mongoose21 from "mongoose";
12446
+ import mongoose22 from "mongoose";
12303
12447
  function convertObjectIdsToStrings(obj) {
12304
12448
  if (obj === null || obj === void 0) {
12305
12449
  return obj;
12306
12450
  }
12307
- if (obj instanceof mongoose21.Types.ObjectId) {
12451
+ if (obj instanceof mongoose22.Types.ObjectId) {
12308
12452
  return obj.toString();
12309
12453
  }
12310
12454
  if (Array.isArray(obj)) {
@@ -12335,7 +12479,7 @@ async function findEventOrImportedMarketById(resourceId) {
12335
12479
 
12336
12480
  // src/types/index.ts
12337
12481
  import express from "express";
12338
- import mongoose22 from "mongoose";
12482
+ import mongoose23 from "mongoose";
12339
12483
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
12340
12484
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
12341
12485
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -12350,6 +12494,7 @@ export {
12350
12494
  CategorySchema,
12351
12495
  ChatModel,
12352
12496
  ChatReportModel,
12497
+ ContactDetailsSchema,
12353
12498
  EnumPubSubEvents,
12354
12499
  EventInfoModel,
12355
12500
  EventModel,
@@ -12365,6 +12510,7 @@ export {
12365
12510
  RelationTypeSchema,
12366
12511
  ResourceActivityModel,
12367
12512
  ResourceImageTypeSchema,
12513
+ SchoolModel,
12368
12514
  SocialMediaTypeSchema,
12369
12515
  StallTypeSchema,
12370
12516
  UserModel,
@@ -12380,7 +12526,7 @@ export {
12380
12526
  findEventOrImportedMarketById,
12381
12527
  locationGeoSchema,
12382
12528
  locationsSchema,
12383
- mongoose22 as mongoose,
12529
+ mongoose23 as mongoose,
12384
12530
  refundPolicySchema,
12385
12531
  relationDatesSchema,
12386
12532
  resourceRelationsSchema,