@timardex/cluemart-server-shared 1.0.132 → 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/{chunk-OBW4LAAG.mjs → chunk-JDM7WL6D.mjs} +212 -100
- package/dist/chunk-JDM7WL6D.mjs.map +1 -0
- package/dist/index.cjs +218 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +101 -60
- package/dist/index.d.ts +101 -60
- package/dist/index.mjs +216 -104
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +212 -98
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +101 -60
- package/dist/mongoose/index.d.ts +101 -60
- package/dist/mongoose/index.mjs +5 -1
- package/dist/service/index.cjs +210 -100
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-OBW4LAAG.mjs.map +0 -1
|
@@ -4656,10 +4656,10 @@ var Condition = class _Condition {
|
|
|
4656
4656
|
otherwise
|
|
4657
4657
|
} = config;
|
|
4658
4658
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4659
|
-
return new _Condition(refs, (values,
|
|
4659
|
+
return new _Condition(refs, (values, schema16) => {
|
|
4660
4660
|
var _branch;
|
|
4661
4661
|
let branch = check(...values) ? then : otherwise;
|
|
4662
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4662
|
+
return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
|
|
4663
4663
|
});
|
|
4664
4664
|
}
|
|
4665
4665
|
constructor(refs, builder) {
|
|
@@ -4673,13 +4673,13 @@ var Condition = class _Condition {
|
|
|
4673
4673
|
// TODO: ? operator here?
|
|
4674
4674
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4675
4675
|
));
|
|
4676
|
-
let
|
|
4677
|
-
if (
|
|
4678
|
-
|
|
4676
|
+
let schema16 = this.fn(values, base, options);
|
|
4677
|
+
if (schema16 === void 0 || // @ts-ignore this can be base
|
|
4678
|
+
schema16 === base) {
|
|
4679
4679
|
return base;
|
|
4680
4680
|
}
|
|
4681
|
-
if (!isSchema(
|
|
4682
|
-
return
|
|
4681
|
+
if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
|
|
4682
|
+
return schema16.resolve(options);
|
|
4683
4683
|
}
|
|
4684
4684
|
};
|
|
4685
4685
|
var prefixes = {
|
|
@@ -4749,7 +4749,7 @@ function createValidation(config) {
|
|
|
4749
4749
|
path = "",
|
|
4750
4750
|
options,
|
|
4751
4751
|
originalValue,
|
|
4752
|
-
schema:
|
|
4752
|
+
schema: schema16
|
|
4753
4753
|
}, panic, next) {
|
|
4754
4754
|
const {
|
|
4755
4755
|
name,
|
|
@@ -4761,8 +4761,8 @@ function createValidation(config) {
|
|
|
4761
4761
|
let {
|
|
4762
4762
|
parent,
|
|
4763
4763
|
context,
|
|
4764
|
-
abortEarly =
|
|
4765
|
-
disableStackTrace =
|
|
4764
|
+
abortEarly = schema16.spec.abortEarly,
|
|
4765
|
+
disableStackTrace = schema16.spec.disableStackTrace
|
|
4766
4766
|
} = options;
|
|
4767
4767
|
function resolve(item) {
|
|
4768
4768
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4771,9 +4771,9 @@ function createValidation(config) {
|
|
|
4771
4771
|
const nextParams = Object.assign({
|
|
4772
4772
|
value,
|
|
4773
4773
|
originalValue,
|
|
4774
|
-
label:
|
|
4774
|
+
label: schema16.spec.label,
|
|
4775
4775
|
path: overrides.path || path,
|
|
4776
|
-
spec:
|
|
4776
|
+
spec: schema16.spec,
|
|
4777
4777
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4778
4778
|
}, params, overrides.params);
|
|
4779
4779
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4791,7 +4791,7 @@ function createValidation(config) {
|
|
|
4791
4791
|
resolve,
|
|
4792
4792
|
options,
|
|
4793
4793
|
originalValue,
|
|
4794
|
-
schema:
|
|
4794
|
+
schema: schema16
|
|
4795
4795
|
};
|
|
4796
4796
|
const handleResult = (validOrError) => {
|
|
4797
4797
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4825,42 +4825,42 @@ function createValidation(config) {
|
|
|
4825
4825
|
validate.OPTIONS = config;
|
|
4826
4826
|
return validate;
|
|
4827
4827
|
}
|
|
4828
|
-
function getIn(
|
|
4828
|
+
function getIn(schema16, path, value, context = value) {
|
|
4829
4829
|
let parent, lastPart, lastPartDebug;
|
|
4830
4830
|
if (!path) return {
|
|
4831
4831
|
parent,
|
|
4832
4832
|
parentPath: path,
|
|
4833
|
-
schema:
|
|
4833
|
+
schema: schema16
|
|
4834
4834
|
};
|
|
4835
4835
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4836
4836
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4837
|
-
|
|
4837
|
+
schema16 = schema16.resolve({
|
|
4838
4838
|
context,
|
|
4839
4839
|
parent,
|
|
4840
4840
|
value
|
|
4841
4841
|
});
|
|
4842
|
-
let isTuple =
|
|
4842
|
+
let isTuple = schema16.type === "tuple";
|
|
4843
4843
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4844
|
-
if (
|
|
4844
|
+
if (schema16.innerType || isTuple) {
|
|
4845
4845
|
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]"`);
|
|
4846
4846
|
if (value && idx >= value.length) {
|
|
4847
4847
|
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. `);
|
|
4848
4848
|
}
|
|
4849
4849
|
parent = value;
|
|
4850
4850
|
value = value && value[idx];
|
|
4851
|
-
|
|
4851
|
+
schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
|
|
4852
4852
|
}
|
|
4853
4853
|
if (!isArray) {
|
|
4854
|
-
if (!
|
|
4854
|
+
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}")`);
|
|
4855
4855
|
parent = value;
|
|
4856
4856
|
value = value && value[part];
|
|
4857
|
-
|
|
4857
|
+
schema16 = schema16.fields[part];
|
|
4858
4858
|
}
|
|
4859
4859
|
lastPart = part;
|
|
4860
4860
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4861
4861
|
});
|
|
4862
4862
|
return {
|
|
4863
|
-
schema:
|
|
4863
|
+
schema: schema16,
|
|
4864
4864
|
parent,
|
|
4865
4865
|
parentPath: lastPart
|
|
4866
4866
|
};
|
|
@@ -4997,20 +4997,20 @@ var Schema = class {
|
|
|
4997
4997
|
this._mutate = before;
|
|
4998
4998
|
return result;
|
|
4999
4999
|
}
|
|
5000
|
-
concat(
|
|
5001
|
-
if (!
|
|
5002
|
-
if (
|
|
5000
|
+
concat(schema16) {
|
|
5001
|
+
if (!schema16 || schema16 === this) return this;
|
|
5002
|
+
if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
|
|
5003
5003
|
let base = this;
|
|
5004
|
-
let combined =
|
|
5004
|
+
let combined = schema16.clone();
|
|
5005
5005
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5006
5006
|
combined.spec = mergedSpec;
|
|
5007
5007
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5008
|
-
combined._whitelist = base._whitelist.merge(
|
|
5009
|
-
combined._blacklist = base._blacklist.merge(
|
|
5008
|
+
combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
|
|
5009
|
+
combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
|
|
5010
5010
|
combined.tests = base.tests;
|
|
5011
5011
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5012
5012
|
combined.withMutation((next) => {
|
|
5013
|
-
|
|
5013
|
+
schema16.tests.forEach((fn) => {
|
|
5014
5014
|
next.test(fn.OPTIONS);
|
|
5015
5015
|
});
|
|
5016
5016
|
});
|
|
@@ -5026,15 +5026,15 @@ var Schema = class {
|
|
|
5026
5026
|
return this._typeCheck(v);
|
|
5027
5027
|
}
|
|
5028
5028
|
resolve(options) {
|
|
5029
|
-
let
|
|
5030
|
-
if (
|
|
5031
|
-
let conditions =
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5029
|
+
let schema16 = this;
|
|
5030
|
+
if (schema16.conditions.length) {
|
|
5031
|
+
let conditions = schema16.conditions;
|
|
5032
|
+
schema16 = schema16.clone();
|
|
5033
|
+
schema16.conditions = [];
|
|
5034
|
+
schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
|
|
5035
|
+
schema16 = schema16.resolve(options);
|
|
5036
5036
|
}
|
|
5037
|
-
return
|
|
5037
|
+
return schema16;
|
|
5038
5038
|
}
|
|
5039
5039
|
resolveOptions(options) {
|
|
5040
5040
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5188,11 +5188,11 @@ attempted value: ${formattedValue}
|
|
|
5188
5188
|
}
|
|
5189
5189
|
validate(value, options) {
|
|
5190
5190
|
var _options$disableStack2;
|
|
5191
|
-
let
|
|
5191
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5192
5192
|
value
|
|
5193
5193
|
}));
|
|
5194
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5195
|
-
return new Promise((resolve, reject) =>
|
|
5194
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
|
|
5195
|
+
return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
|
|
5196
5196
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5197
5197
|
reject(error);
|
|
5198
5198
|
}, (errors, validated) => {
|
|
@@ -5202,12 +5202,12 @@ attempted value: ${formattedValue}
|
|
|
5202
5202
|
}
|
|
5203
5203
|
validateSync(value, options) {
|
|
5204
5204
|
var _options$disableStack3;
|
|
5205
|
-
let
|
|
5205
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5206
5206
|
value
|
|
5207
5207
|
}));
|
|
5208
5208
|
let result;
|
|
5209
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5210
|
-
|
|
5209
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
|
|
5210
|
+
schema16._validate(value, Object.assign({}, options, {
|
|
5211
5211
|
sync: true
|
|
5212
5212
|
}), (error, parsed) => {
|
|
5213
5213
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5241,8 +5241,8 @@ attempted value: ${formattedValue}
|
|
|
5241
5241
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5242
5242
|
}
|
|
5243
5243
|
getDefault(options) {
|
|
5244
|
-
let
|
|
5245
|
-
return
|
|
5244
|
+
let schema16 = this.resolve(options || {});
|
|
5245
|
+
return schema16._getDefault(options);
|
|
5246
5246
|
}
|
|
5247
5247
|
default(def) {
|
|
5248
5248
|
if (arguments.length === 0) {
|
|
@@ -5477,9 +5477,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5477
5477
|
const {
|
|
5478
5478
|
parent,
|
|
5479
5479
|
parentPath,
|
|
5480
|
-
schema:
|
|
5480
|
+
schema: schema16
|
|
5481
5481
|
} = getIn(this, path, value, options.context);
|
|
5482
|
-
return
|
|
5482
|
+
return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5483
5483
|
parent,
|
|
5484
5484
|
path
|
|
5485
5485
|
}));
|
|
@@ -5653,7 +5653,7 @@ var StringSchema = class extends Schema {
|
|
|
5653
5653
|
});
|
|
5654
5654
|
}
|
|
5655
5655
|
required(message) {
|
|
5656
|
-
return super.required(message).withMutation((
|
|
5656
|
+
return super.required(message).withMutation((schema16) => schema16.test({
|
|
5657
5657
|
message: message || mixed.required,
|
|
5658
5658
|
name: "required",
|
|
5659
5659
|
skipAbsent: true,
|
|
@@ -5661,9 +5661,9 @@ var StringSchema = class extends Schema {
|
|
|
5661
5661
|
}));
|
|
5662
5662
|
}
|
|
5663
5663
|
notRequired() {
|
|
5664
|
-
return super.notRequired().withMutation((
|
|
5665
|
-
|
|
5666
|
-
return
|
|
5664
|
+
return super.notRequired().withMutation((schema16) => {
|
|
5665
|
+
schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5666
|
+
return schema16;
|
|
5667
5667
|
});
|
|
5668
5668
|
}
|
|
5669
5669
|
length(length, message = string.length) {
|
|
@@ -6052,28 +6052,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6052
6052
|
}
|
|
6053
6053
|
return ctx.isType(parsed) ? parsed : value;
|
|
6054
6054
|
};
|
|
6055
|
-
function deepPartial(
|
|
6056
|
-
if ("fields" in
|
|
6055
|
+
function deepPartial(schema16) {
|
|
6056
|
+
if ("fields" in schema16) {
|
|
6057
6057
|
const partial = {};
|
|
6058
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6058
|
+
for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
|
|
6059
6059
|
partial[key] = deepPartial(fieldSchema);
|
|
6060
6060
|
}
|
|
6061
|
-
return
|
|
6061
|
+
return schema16.setFields(partial);
|
|
6062
6062
|
}
|
|
6063
|
-
if (
|
|
6064
|
-
const nextArray =
|
|
6063
|
+
if (schema16.type === "array") {
|
|
6064
|
+
const nextArray = schema16.optional();
|
|
6065
6065
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6066
6066
|
return nextArray;
|
|
6067
6067
|
}
|
|
6068
|
-
if (
|
|
6069
|
-
return
|
|
6070
|
-
types:
|
|
6068
|
+
if (schema16.type === "tuple") {
|
|
6069
|
+
return schema16.optional().clone({
|
|
6070
|
+
types: schema16.spec.types.map(deepPartial)
|
|
6071
6071
|
});
|
|
6072
6072
|
}
|
|
6073
|
-
if ("optional" in
|
|
6074
|
-
return
|
|
6073
|
+
if ("optional" in schema16) {
|
|
6074
|
+
return schema16.optional();
|
|
6075
6075
|
}
|
|
6076
|
-
return
|
|
6076
|
+
return schema16;
|
|
6077
6077
|
}
|
|
6078
6078
|
var deepHas = (obj, p) => {
|
|
6079
6079
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6207,8 +6207,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6207
6207
|
next._sortErrors = this._sortErrors;
|
|
6208
6208
|
return next;
|
|
6209
6209
|
}
|
|
6210
|
-
concat(
|
|
6211
|
-
let next = super.concat(
|
|
6210
|
+
concat(schema16) {
|
|
6211
|
+
let next = super.concat(schema16);
|
|
6212
6212
|
let nextFields = next.fields;
|
|
6213
6213
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6214
6214
|
const target = nextFields[field];
|
|
@@ -6216,7 +6216,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6216
6216
|
}
|
|
6217
6217
|
return next.withMutation((s) => (
|
|
6218
6218
|
// XXX: excludes here is wrong
|
|
6219
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6219
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
|
|
6220
6220
|
));
|
|
6221
6221
|
}
|
|
6222
6222
|
_getDefault(options) {
|
|
@@ -6261,8 +6261,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6261
6261
|
}
|
|
6262
6262
|
partial() {
|
|
6263
6263
|
const partial = {};
|
|
6264
|
-
for (const [key,
|
|
6265
|
-
partial[key] = "optional" in
|
|
6264
|
+
for (const [key, schema16] of Object.entries(this.fields)) {
|
|
6265
|
+
partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
|
|
6266
6266
|
}
|
|
6267
6267
|
return this.setFields(partial);
|
|
6268
6268
|
}
|
|
@@ -6460,22 +6460,22 @@ var ArraySchema = class extends Schema {
|
|
|
6460
6460
|
json() {
|
|
6461
6461
|
return this.transform(parseJson);
|
|
6462
6462
|
}
|
|
6463
|
-
concat(
|
|
6464
|
-
let next = super.concat(
|
|
6463
|
+
concat(schema16) {
|
|
6464
|
+
let next = super.concat(schema16);
|
|
6465
6465
|
next.innerType = this.innerType;
|
|
6466
|
-
if (
|
|
6466
|
+
if (schema16.innerType)
|
|
6467
6467
|
next.innerType = next.innerType ? (
|
|
6468
6468
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6469
|
-
next.innerType.concat(
|
|
6470
|
-
) :
|
|
6469
|
+
next.innerType.concat(schema16.innerType)
|
|
6470
|
+
) : schema16.innerType;
|
|
6471
6471
|
return next;
|
|
6472
6472
|
}
|
|
6473
|
-
of(
|
|
6473
|
+
of(schema16) {
|
|
6474
6474
|
let next = this.clone();
|
|
6475
|
-
if (!isSchema(
|
|
6476
|
-
next.innerType =
|
|
6475
|
+
if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
|
|
6476
|
+
next.innerType = schema16;
|
|
6477
6477
|
next.spec = Object.assign({}, next.spec, {
|
|
6478
|
-
types:
|
|
6478
|
+
types: schema16
|
|
6479
6479
|
});
|
|
6480
6480
|
return next;
|
|
6481
6481
|
}
|
|
@@ -6619,7 +6619,7 @@ var TupleSchema = class extends Schema {
|
|
|
6619
6619
|
describe(options) {
|
|
6620
6620
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6621
6621
|
const base = super.describe(options);
|
|
6622
|
-
base.innerType = next.spec.types.map((
|
|
6622
|
+
base.innerType = next.spec.types.map((schema16, index) => {
|
|
6623
6623
|
var _innerOptions;
|
|
6624
6624
|
let innerOptions = options;
|
|
6625
6625
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6628,7 +6628,7 @@ var TupleSchema = class extends Schema {
|
|
|
6628
6628
|
value: innerOptions.value[index]
|
|
6629
6629
|
});
|
|
6630
6630
|
}
|
|
6631
|
-
return
|
|
6631
|
+
return schema16.describe(innerOptions);
|
|
6632
6632
|
});
|
|
6633
6633
|
return base;
|
|
6634
6634
|
}
|
|
@@ -6645,6 +6645,7 @@ var import_react2 = __toESM(require_react(), 1);
|
|
|
6645
6645
|
var React8 = __toESM(require_react(), 1);
|
|
6646
6646
|
var import_react3 = __toESM(require_react(), 1);
|
|
6647
6647
|
var import_react4 = __toESM(require_react(), 1);
|
|
6648
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
6648
6649
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
|
|
6649
6650
|
EnumInviteStatus22["ACCEPTED"] = "Accepted";
|
|
6650
6651
|
EnumInviteStatus22["COMPLETED"] = "Completed";
|
|
@@ -8269,6 +8270,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8269
8270
|
promoCodes
|
|
8270
8271
|
refreshToken
|
|
8271
8272
|
role
|
|
8273
|
+
school
|
|
8272
8274
|
termsAgreement {
|
|
8273
8275
|
...TermsAgreementFields
|
|
8274
8276
|
}
|
|
@@ -10107,6 +10109,75 @@ var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
|
10107
10109
|
}
|
|
10108
10110
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10109
10111
|
`;
|
|
10112
|
+
var SCHOOL = gql`
|
|
10113
|
+
fragment SchoolFields on SchoolType {
|
|
10114
|
+
_id
|
|
10115
|
+
active
|
|
10116
|
+
contactDetails {
|
|
10117
|
+
...ContactDetailsFields
|
|
10118
|
+
}
|
|
10119
|
+
location {
|
|
10120
|
+
...LocationFields
|
|
10121
|
+
}
|
|
10122
|
+
createdAt
|
|
10123
|
+
deletedAt
|
|
10124
|
+
logo {
|
|
10125
|
+
...ResourceImageFields
|
|
10126
|
+
}
|
|
10127
|
+
name
|
|
10128
|
+
owner {
|
|
10129
|
+
...OwnerFields
|
|
10130
|
+
}
|
|
10131
|
+
region
|
|
10132
|
+
studentCount
|
|
10133
|
+
termsAgreement {
|
|
10134
|
+
...TermsAgreementFields
|
|
10135
|
+
}
|
|
10136
|
+
updatedAt
|
|
10137
|
+
}
|
|
10138
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10139
|
+
${LOCATION_FIELDS_FRAGMENT}
|
|
10140
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
10141
|
+
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
10142
|
+
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
10143
|
+
`;
|
|
10144
|
+
var GET_SCHOOL = gql`
|
|
10145
|
+
query getSchool($_id: ID!) {
|
|
10146
|
+
school(_id: $_id) {
|
|
10147
|
+
...SchoolFields
|
|
10148
|
+
}
|
|
10149
|
+
}
|
|
10150
|
+
${SCHOOL}
|
|
10151
|
+
`;
|
|
10152
|
+
var GET_SCHOOLS = gql`
|
|
10153
|
+
query getSchools {
|
|
10154
|
+
schools {
|
|
10155
|
+
...SchoolFields
|
|
10156
|
+
}
|
|
10157
|
+
}
|
|
10158
|
+
${SCHOOL}
|
|
10159
|
+
`;
|
|
10160
|
+
var CREATE_SCHOOL_MUTATION = gql`
|
|
10161
|
+
mutation createSchool($input: SchoolInputType!) {
|
|
10162
|
+
createSchool(input: $input) {
|
|
10163
|
+
...SchoolFields
|
|
10164
|
+
}
|
|
10165
|
+
}
|
|
10166
|
+
${SCHOOL}
|
|
10167
|
+
`;
|
|
10168
|
+
var UPDATE_SCHOOL_MUTATION = gql`
|
|
10169
|
+
mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
|
|
10170
|
+
updateSchool(_id: $_id, input: $input) {
|
|
10171
|
+
...SchoolFields
|
|
10172
|
+
}
|
|
10173
|
+
}
|
|
10174
|
+
${SCHOOL}
|
|
10175
|
+
`;
|
|
10176
|
+
var DELETE_SCHOOL_MUTATION = gql`
|
|
10177
|
+
mutation deleteSchool($_id: ID!) {
|
|
10178
|
+
deleteSchool(_id: $_id)
|
|
10179
|
+
}
|
|
10180
|
+
`;
|
|
10110
10181
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10111
10182
|
var nzbnRegex = /^94\d{11}$/;
|
|
10112
10183
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10258,7 +10329,7 @@ var socialMediaSchema = create$3({
|
|
|
10258
10329
|
is: (name) => !!name,
|
|
10259
10330
|
// If name has a value
|
|
10260
10331
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10261
|
-
otherwise: (
|
|
10332
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10262
10333
|
})
|
|
10263
10334
|
});
|
|
10264
10335
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10334,21 +10405,21 @@ var paymentInfoSchema = create$3({
|
|
|
10334
10405
|
).required("Please select a Payment method"),
|
|
10335
10406
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10336
10407
|
is: "bank_transfer",
|
|
10337
|
-
then: (
|
|
10338
|
-
otherwise: (
|
|
10408
|
+
then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
|
|
10409
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10339
10410
|
}),
|
|
10340
10411
|
accountNumber: create$6().when("paymentMethod", {
|
|
10341
10412
|
is: "bank_transfer",
|
|
10342
|
-
then: (
|
|
10413
|
+
then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
|
|
10343
10414
|
nzBankAccountRegex,
|
|
10344
10415
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10345
10416
|
).trim(),
|
|
10346
|
-
otherwise: (
|
|
10417
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10347
10418
|
}),
|
|
10348
10419
|
link: create$6().when("paymentMethod", {
|
|
10349
10420
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10350
10421
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10351
|
-
otherwise: (
|
|
10422
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10352
10423
|
})
|
|
10353
10424
|
});
|
|
10354
10425
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10498,16 +10569,16 @@ var vendorInfoSchema = create$3().shape({
|
|
|
10498
10569
|
var userSchema = create$3().shape({
|
|
10499
10570
|
active: create$7().required("Active is required"),
|
|
10500
10571
|
email: emailRequiredSchema,
|
|
10501
|
-
firstName: create$6().label("First Name").required("First name is required"),
|
|
10502
|
-
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10572
|
+
firstName: create$6().label("First Name").trim().required("First name is required"),
|
|
10573
|
+
lastName: create$6().label("Last Name").trim().required("Last name is required"),
|
|
10503
10574
|
isTester: create$7().required("Tester status is required"),
|
|
10504
10575
|
password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
10505
10576
|
preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
|
|
10506
10577
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10507
10578
|
is: (val) => !!val,
|
|
10508
10579
|
// only necessary if password typed
|
|
10509
|
-
then: (
|
|
10510
|
-
otherwise: (
|
|
10580
|
+
then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10581
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10511
10582
|
}),
|
|
10512
10583
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10513
10584
|
});
|
|
@@ -10578,7 +10649,7 @@ var adSchema = create$3().shape({
|
|
|
10578
10649
|
return endDate > now;
|
|
10579
10650
|
}).when("start", {
|
|
10580
10651
|
is: (val) => val && val.length > 0,
|
|
10581
|
-
then: (
|
|
10652
|
+
then: (schema16) => schema16.test(
|
|
10582
10653
|
"is-after-start",
|
|
10583
10654
|
"End date must be after start date",
|
|
10584
10655
|
function(value) {
|
|
@@ -10722,6 +10793,14 @@ var contactUsSchema = create$3().shape({
|
|
|
10722
10793
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10723
10794
|
message: create$6().label("Message").required("Message is required")
|
|
10724
10795
|
});
|
|
10796
|
+
var schoolSchema = create$3().shape({
|
|
10797
|
+
active: create$7().required("Active is required"),
|
|
10798
|
+
contactDetails: contactDetailsSchema,
|
|
10799
|
+
location: locationSchema,
|
|
10800
|
+
name: create$6().trim().required("Name is required"),
|
|
10801
|
+
region: create$6().trim().required("Region is required"),
|
|
10802
|
+
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"))
|
|
10803
|
+
});
|
|
10725
10804
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
10726
10805
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
10727
10806
|
EnumActivity2["GOING"] = "GOING";
|
|
@@ -11289,27 +11368,27 @@ var baseResourceFields = {
|
|
|
11289
11368
|
required: false,
|
|
11290
11369
|
type: [associatesSchema]
|
|
11291
11370
|
},
|
|
11292
|
-
contactDetails: ContactDetailsSchema,
|
|
11371
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
11293
11372
|
cover: {
|
|
11294
11373
|
required: true,
|
|
11295
11374
|
type: ResourceImageTypeSchema
|
|
11296
11375
|
},
|
|
11297
11376
|
deletedAt: { default: null, required: false, type: Date },
|
|
11298
11377
|
description: { required: true, type: String },
|
|
11299
|
-
images: [ResourceImageTypeSchema],
|
|
11300
|
-
logo: ResourceImageTypeSchema,
|
|
11378
|
+
images: { required: false, type: [ResourceImageTypeSchema] },
|
|
11379
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
11301
11380
|
name: { required: true, type: String },
|
|
11302
11381
|
owner: {
|
|
11303
11382
|
required: false,
|
|
11304
11383
|
type: OwnerTypeSchema
|
|
11305
11384
|
},
|
|
11306
|
-
posterUsage: PosterUsageTypeSchema,
|
|
11385
|
+
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
11307
11386
|
promoCodes: { required: false, type: [String] },
|
|
11308
11387
|
rating: { required: false, type: Number },
|
|
11309
11388
|
region: { required: true, type: String },
|
|
11310
11389
|
reviewCount: { required: false, type: Number },
|
|
11311
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
11312
|
-
termsAgreement: termsAgreementSchema
|
|
11390
|
+
socialMedia: { required: false, type: [SocialMediaTypeSchema] },
|
|
11391
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
11313
11392
|
};
|
|
11314
11393
|
|
|
11315
11394
|
// src/mongoose/GoogleImportedMarket.ts
|
|
@@ -11622,6 +11701,11 @@ var schema7 = new MongooseSchema11(
|
|
|
11622
11701
|
required: true,
|
|
11623
11702
|
type: String
|
|
11624
11703
|
},
|
|
11704
|
+
school: {
|
|
11705
|
+
ref: "School",
|
|
11706
|
+
required: false,
|
|
11707
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11708
|
+
},
|
|
11625
11709
|
stripe: {
|
|
11626
11710
|
required: false,
|
|
11627
11711
|
type: stripeSchema
|
|
@@ -12012,9 +12096,9 @@ var gameDataSchemas = {
|
|
|
12012
12096
|
[EnumGameType.DAILY_CLUE]: schemaDailyClue
|
|
12013
12097
|
};
|
|
12014
12098
|
var gameDataDefinition = Object.fromEntries(
|
|
12015
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12099
|
+
Object.entries(gameDataSchemas).map(([key, schema16]) => [
|
|
12016
12100
|
key,
|
|
12017
|
-
{ default: null, required: false, type:
|
|
12101
|
+
{ default: null, required: false, type: schema16 }
|
|
12018
12102
|
])
|
|
12019
12103
|
);
|
|
12020
12104
|
var gameHistorySchema = new MongooseSchema19(
|
|
@@ -12062,6 +12146,32 @@ var schema14 = new MongooseSchema19(
|
|
|
12062
12146
|
);
|
|
12063
12147
|
var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
|
|
12064
12148
|
|
|
12149
|
+
// src/mongoose/School.ts
|
|
12150
|
+
import mongoose20 from "mongoose";
|
|
12151
|
+
var MongooseSchema20 = mongoose20.Schema;
|
|
12152
|
+
var schema15 = new MongooseSchema20(
|
|
12153
|
+
{
|
|
12154
|
+
active: { default: false, required: true, type: Boolean },
|
|
12155
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
12156
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12157
|
+
location: {
|
|
12158
|
+
required: true,
|
|
12159
|
+
type: locationsSchema
|
|
12160
|
+
},
|
|
12161
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
12162
|
+
name: { required: true, type: String },
|
|
12163
|
+
owner: {
|
|
12164
|
+
required: true,
|
|
12165
|
+
type: OwnerTypeSchema
|
|
12166
|
+
},
|
|
12167
|
+
region: { required: true, type: String },
|
|
12168
|
+
studentCount: { required: true, type: Number },
|
|
12169
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
12170
|
+
},
|
|
12171
|
+
{ timestamps: true }
|
|
12172
|
+
);
|
|
12173
|
+
var SchoolModel = mongoose20.models.School || mongoose20.model("School", schema15);
|
|
12174
|
+
|
|
12065
12175
|
export {
|
|
12066
12176
|
EnumUserLicence,
|
|
12067
12177
|
EnumAdStatus,
|
|
@@ -12081,6 +12191,7 @@ export {
|
|
|
12081
12191
|
CategorySchema,
|
|
12082
12192
|
userLicenseSchema,
|
|
12083
12193
|
associatesSchema,
|
|
12194
|
+
ContactDetailsSchema,
|
|
12084
12195
|
termsAgreementSchema,
|
|
12085
12196
|
resourceRelationsSchema,
|
|
12086
12197
|
dateTimeSchema3 as dateTimeSchema,
|
|
@@ -12100,7 +12211,8 @@ export {
|
|
|
12100
12211
|
PostModel,
|
|
12101
12212
|
APP_SETTINGS_ID,
|
|
12102
12213
|
AppSettingModel,
|
|
12103
|
-
GameModel
|
|
12214
|
+
GameModel,
|
|
12215
|
+
SchoolModel
|
|
12104
12216
|
};
|
|
12105
12217
|
/*! Bundled license information:
|
|
12106
12218
|
|
|
@@ -12126,4 +12238,4 @@ react/cjs/react.development.js:
|
|
|
12126
12238
|
* LICENSE file in the root directory of this source tree.
|
|
12127
12239
|
*)
|
|
12128
12240
|
*/
|
|
12129
|
-
//# sourceMappingURL=chunk-
|
|
12241
|
+
//# sourceMappingURL=chunk-JDM7WL6D.mjs.map
|