@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
package/dist/service/index.cjs
CHANGED
|
@@ -4721,10 +4721,10 @@ var Condition = class _Condition {
|
|
|
4721
4721
|
otherwise
|
|
4722
4722
|
} = config;
|
|
4723
4723
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4724
|
-
return new _Condition(refs, (values,
|
|
4724
|
+
return new _Condition(refs, (values, schema16) => {
|
|
4725
4725
|
var _branch;
|
|
4726
4726
|
let branch = check(...values) ? then : otherwise;
|
|
4727
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4727
|
+
return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
|
|
4728
4728
|
});
|
|
4729
4729
|
}
|
|
4730
4730
|
constructor(refs, builder) {
|
|
@@ -4738,13 +4738,13 @@ var Condition = class _Condition {
|
|
|
4738
4738
|
// TODO: ? operator here?
|
|
4739
4739
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4740
4740
|
));
|
|
4741
|
-
let
|
|
4742
|
-
if (
|
|
4743
|
-
|
|
4741
|
+
let schema16 = this.fn(values, base, options);
|
|
4742
|
+
if (schema16 === void 0 || // @ts-ignore this can be base
|
|
4743
|
+
schema16 === base) {
|
|
4744
4744
|
return base;
|
|
4745
4745
|
}
|
|
4746
|
-
if (!isSchema(
|
|
4747
|
-
return
|
|
4746
|
+
if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
|
|
4747
|
+
return schema16.resolve(options);
|
|
4748
4748
|
}
|
|
4749
4749
|
};
|
|
4750
4750
|
var prefixes = {
|
|
@@ -4814,7 +4814,7 @@ function createValidation(config) {
|
|
|
4814
4814
|
path = "",
|
|
4815
4815
|
options,
|
|
4816
4816
|
originalValue,
|
|
4817
|
-
schema:
|
|
4817
|
+
schema: schema16
|
|
4818
4818
|
}, panic, next) {
|
|
4819
4819
|
const {
|
|
4820
4820
|
name,
|
|
@@ -4826,8 +4826,8 @@ function createValidation(config) {
|
|
|
4826
4826
|
let {
|
|
4827
4827
|
parent,
|
|
4828
4828
|
context,
|
|
4829
|
-
abortEarly =
|
|
4830
|
-
disableStackTrace =
|
|
4829
|
+
abortEarly = schema16.spec.abortEarly,
|
|
4830
|
+
disableStackTrace = schema16.spec.disableStackTrace
|
|
4831
4831
|
} = options;
|
|
4832
4832
|
function resolve(item) {
|
|
4833
4833
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4836,9 +4836,9 @@ function createValidation(config) {
|
|
|
4836
4836
|
const nextParams = Object.assign({
|
|
4837
4837
|
value,
|
|
4838
4838
|
originalValue,
|
|
4839
|
-
label:
|
|
4839
|
+
label: schema16.spec.label,
|
|
4840
4840
|
path: overrides.path || path,
|
|
4841
|
-
spec:
|
|
4841
|
+
spec: schema16.spec,
|
|
4842
4842
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4843
4843
|
}, params, overrides.params);
|
|
4844
4844
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4856,7 +4856,7 @@ function createValidation(config) {
|
|
|
4856
4856
|
resolve,
|
|
4857
4857
|
options,
|
|
4858
4858
|
originalValue,
|
|
4859
|
-
schema:
|
|
4859
|
+
schema: schema16
|
|
4860
4860
|
};
|
|
4861
4861
|
const handleResult = (validOrError) => {
|
|
4862
4862
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4890,42 +4890,42 @@ function createValidation(config) {
|
|
|
4890
4890
|
validate.OPTIONS = config;
|
|
4891
4891
|
return validate;
|
|
4892
4892
|
}
|
|
4893
|
-
function getIn(
|
|
4893
|
+
function getIn(schema16, path, value, context = value) {
|
|
4894
4894
|
let parent, lastPart, lastPartDebug;
|
|
4895
4895
|
if (!path) return {
|
|
4896
4896
|
parent,
|
|
4897
4897
|
parentPath: path,
|
|
4898
|
-
schema:
|
|
4898
|
+
schema: schema16
|
|
4899
4899
|
};
|
|
4900
4900
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4901
4901
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4902
|
-
|
|
4902
|
+
schema16 = schema16.resolve({
|
|
4903
4903
|
context,
|
|
4904
4904
|
parent,
|
|
4905
4905
|
value
|
|
4906
4906
|
});
|
|
4907
|
-
let isTuple =
|
|
4907
|
+
let isTuple = schema16.type === "tuple";
|
|
4908
4908
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4909
|
-
if (
|
|
4909
|
+
if (schema16.innerType || isTuple) {
|
|
4910
4910
|
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]"`);
|
|
4911
4911
|
if (value && idx >= value.length) {
|
|
4912
4912
|
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. `);
|
|
4913
4913
|
}
|
|
4914
4914
|
parent = value;
|
|
4915
4915
|
value = value && value[idx];
|
|
4916
|
-
|
|
4916
|
+
schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
|
|
4917
4917
|
}
|
|
4918
4918
|
if (!isArray) {
|
|
4919
|
-
if (!
|
|
4919
|
+
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}")`);
|
|
4920
4920
|
parent = value;
|
|
4921
4921
|
value = value && value[part];
|
|
4922
|
-
|
|
4922
|
+
schema16 = schema16.fields[part];
|
|
4923
4923
|
}
|
|
4924
4924
|
lastPart = part;
|
|
4925
4925
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4926
4926
|
});
|
|
4927
4927
|
return {
|
|
4928
|
-
schema:
|
|
4928
|
+
schema: schema16,
|
|
4929
4929
|
parent,
|
|
4930
4930
|
parentPath: lastPart
|
|
4931
4931
|
};
|
|
@@ -5062,20 +5062,20 @@ var Schema = class {
|
|
|
5062
5062
|
this._mutate = before;
|
|
5063
5063
|
return result;
|
|
5064
5064
|
}
|
|
5065
|
-
concat(
|
|
5066
|
-
if (!
|
|
5067
|
-
if (
|
|
5065
|
+
concat(schema16) {
|
|
5066
|
+
if (!schema16 || schema16 === this) return this;
|
|
5067
|
+
if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
|
|
5068
5068
|
let base = this;
|
|
5069
|
-
let combined =
|
|
5069
|
+
let combined = schema16.clone();
|
|
5070
5070
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5071
5071
|
combined.spec = mergedSpec;
|
|
5072
5072
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5073
|
-
combined._whitelist = base._whitelist.merge(
|
|
5074
|
-
combined._blacklist = base._blacklist.merge(
|
|
5073
|
+
combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
|
|
5074
|
+
combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
|
|
5075
5075
|
combined.tests = base.tests;
|
|
5076
5076
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5077
5077
|
combined.withMutation((next) => {
|
|
5078
|
-
|
|
5078
|
+
schema16.tests.forEach((fn) => {
|
|
5079
5079
|
next.test(fn.OPTIONS);
|
|
5080
5080
|
});
|
|
5081
5081
|
});
|
|
@@ -5091,15 +5091,15 @@ var Schema = class {
|
|
|
5091
5091
|
return this._typeCheck(v);
|
|
5092
5092
|
}
|
|
5093
5093
|
resolve(options) {
|
|
5094
|
-
let
|
|
5095
|
-
if (
|
|
5096
|
-
let conditions =
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5094
|
+
let schema16 = this;
|
|
5095
|
+
if (schema16.conditions.length) {
|
|
5096
|
+
let conditions = schema16.conditions;
|
|
5097
|
+
schema16 = schema16.clone();
|
|
5098
|
+
schema16.conditions = [];
|
|
5099
|
+
schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
|
|
5100
|
+
schema16 = schema16.resolve(options);
|
|
5101
5101
|
}
|
|
5102
|
-
return
|
|
5102
|
+
return schema16;
|
|
5103
5103
|
}
|
|
5104
5104
|
resolveOptions(options) {
|
|
5105
5105
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5253,11 +5253,11 @@ attempted value: ${formattedValue}
|
|
|
5253
5253
|
}
|
|
5254
5254
|
validate(value, options) {
|
|
5255
5255
|
var _options$disableStack2;
|
|
5256
|
-
let
|
|
5256
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5257
5257
|
value
|
|
5258
5258
|
}));
|
|
5259
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5260
|
-
return new Promise((resolve, reject) =>
|
|
5259
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
|
|
5260
|
+
return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
|
|
5261
5261
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5262
5262
|
reject(error);
|
|
5263
5263
|
}, (errors, validated) => {
|
|
@@ -5267,12 +5267,12 @@ attempted value: ${formattedValue}
|
|
|
5267
5267
|
}
|
|
5268
5268
|
validateSync(value, options) {
|
|
5269
5269
|
var _options$disableStack3;
|
|
5270
|
-
let
|
|
5270
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5271
5271
|
value
|
|
5272
5272
|
}));
|
|
5273
5273
|
let result;
|
|
5274
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5275
|
-
|
|
5274
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
|
|
5275
|
+
schema16._validate(value, Object.assign({}, options, {
|
|
5276
5276
|
sync: true
|
|
5277
5277
|
}), (error, parsed) => {
|
|
5278
5278
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5306,8 +5306,8 @@ attempted value: ${formattedValue}
|
|
|
5306
5306
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5307
5307
|
}
|
|
5308
5308
|
getDefault(options) {
|
|
5309
|
-
let
|
|
5310
|
-
return
|
|
5309
|
+
let schema16 = this.resolve(options || {});
|
|
5310
|
+
return schema16._getDefault(options);
|
|
5311
5311
|
}
|
|
5312
5312
|
default(def) {
|
|
5313
5313
|
if (arguments.length === 0) {
|
|
@@ -5542,9 +5542,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5542
5542
|
const {
|
|
5543
5543
|
parent,
|
|
5544
5544
|
parentPath,
|
|
5545
|
-
schema:
|
|
5545
|
+
schema: schema16
|
|
5546
5546
|
} = getIn(this, path, value, options.context);
|
|
5547
|
-
return
|
|
5547
|
+
return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5548
5548
|
parent,
|
|
5549
5549
|
path
|
|
5550
5550
|
}));
|
|
@@ -5718,7 +5718,7 @@ var StringSchema = class extends Schema {
|
|
|
5718
5718
|
});
|
|
5719
5719
|
}
|
|
5720
5720
|
required(message) {
|
|
5721
|
-
return super.required(message).withMutation((
|
|
5721
|
+
return super.required(message).withMutation((schema16) => schema16.test({
|
|
5722
5722
|
message: message || mixed.required,
|
|
5723
5723
|
name: "required",
|
|
5724
5724
|
skipAbsent: true,
|
|
@@ -5726,9 +5726,9 @@ var StringSchema = class extends Schema {
|
|
|
5726
5726
|
}));
|
|
5727
5727
|
}
|
|
5728
5728
|
notRequired() {
|
|
5729
|
-
return super.notRequired().withMutation((
|
|
5730
|
-
|
|
5731
|
-
return
|
|
5729
|
+
return super.notRequired().withMutation((schema16) => {
|
|
5730
|
+
schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5731
|
+
return schema16;
|
|
5732
5732
|
});
|
|
5733
5733
|
}
|
|
5734
5734
|
length(length, message = string.length) {
|
|
@@ -6117,28 +6117,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6117
6117
|
}
|
|
6118
6118
|
return ctx.isType(parsed) ? parsed : value;
|
|
6119
6119
|
};
|
|
6120
|
-
function deepPartial(
|
|
6121
|
-
if ("fields" in
|
|
6120
|
+
function deepPartial(schema16) {
|
|
6121
|
+
if ("fields" in schema16) {
|
|
6122
6122
|
const partial = {};
|
|
6123
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6123
|
+
for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
|
|
6124
6124
|
partial[key] = deepPartial(fieldSchema);
|
|
6125
6125
|
}
|
|
6126
|
-
return
|
|
6126
|
+
return schema16.setFields(partial);
|
|
6127
6127
|
}
|
|
6128
|
-
if (
|
|
6129
|
-
const nextArray =
|
|
6128
|
+
if (schema16.type === "array") {
|
|
6129
|
+
const nextArray = schema16.optional();
|
|
6130
6130
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6131
6131
|
return nextArray;
|
|
6132
6132
|
}
|
|
6133
|
-
if (
|
|
6134
|
-
return
|
|
6135
|
-
types:
|
|
6133
|
+
if (schema16.type === "tuple") {
|
|
6134
|
+
return schema16.optional().clone({
|
|
6135
|
+
types: schema16.spec.types.map(deepPartial)
|
|
6136
6136
|
});
|
|
6137
6137
|
}
|
|
6138
|
-
if ("optional" in
|
|
6139
|
-
return
|
|
6138
|
+
if ("optional" in schema16) {
|
|
6139
|
+
return schema16.optional();
|
|
6140
6140
|
}
|
|
6141
|
-
return
|
|
6141
|
+
return schema16;
|
|
6142
6142
|
}
|
|
6143
6143
|
var deepHas = (obj, p) => {
|
|
6144
6144
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6272,8 +6272,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6272
6272
|
next._sortErrors = this._sortErrors;
|
|
6273
6273
|
return next;
|
|
6274
6274
|
}
|
|
6275
|
-
concat(
|
|
6276
|
-
let next = super.concat(
|
|
6275
|
+
concat(schema16) {
|
|
6276
|
+
let next = super.concat(schema16);
|
|
6277
6277
|
let nextFields = next.fields;
|
|
6278
6278
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6279
6279
|
const target = nextFields[field];
|
|
@@ -6281,7 +6281,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6281
6281
|
}
|
|
6282
6282
|
return next.withMutation((s) => (
|
|
6283
6283
|
// XXX: excludes here is wrong
|
|
6284
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6284
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
|
|
6285
6285
|
));
|
|
6286
6286
|
}
|
|
6287
6287
|
_getDefault(options) {
|
|
@@ -6326,8 +6326,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6326
6326
|
}
|
|
6327
6327
|
partial() {
|
|
6328
6328
|
const partial = {};
|
|
6329
|
-
for (const [key,
|
|
6330
|
-
partial[key] = "optional" in
|
|
6329
|
+
for (const [key, schema16] of Object.entries(this.fields)) {
|
|
6330
|
+
partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
|
|
6331
6331
|
}
|
|
6332
6332
|
return this.setFields(partial);
|
|
6333
6333
|
}
|
|
@@ -6525,22 +6525,22 @@ var ArraySchema = class extends Schema {
|
|
|
6525
6525
|
json() {
|
|
6526
6526
|
return this.transform(parseJson);
|
|
6527
6527
|
}
|
|
6528
|
-
concat(
|
|
6529
|
-
let next = super.concat(
|
|
6528
|
+
concat(schema16) {
|
|
6529
|
+
let next = super.concat(schema16);
|
|
6530
6530
|
next.innerType = this.innerType;
|
|
6531
|
-
if (
|
|
6531
|
+
if (schema16.innerType)
|
|
6532
6532
|
next.innerType = next.innerType ? (
|
|
6533
6533
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6534
|
-
next.innerType.concat(
|
|
6535
|
-
) :
|
|
6534
|
+
next.innerType.concat(schema16.innerType)
|
|
6535
|
+
) : schema16.innerType;
|
|
6536
6536
|
return next;
|
|
6537
6537
|
}
|
|
6538
|
-
of(
|
|
6538
|
+
of(schema16) {
|
|
6539
6539
|
let next = this.clone();
|
|
6540
|
-
if (!isSchema(
|
|
6541
|
-
next.innerType =
|
|
6540
|
+
if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
|
|
6541
|
+
next.innerType = schema16;
|
|
6542
6542
|
next.spec = Object.assign({}, next.spec, {
|
|
6543
|
-
types:
|
|
6543
|
+
types: schema16
|
|
6544
6544
|
});
|
|
6545
6545
|
return next;
|
|
6546
6546
|
}
|
|
@@ -6684,7 +6684,7 @@ var TupleSchema = class extends Schema {
|
|
|
6684
6684
|
describe(options) {
|
|
6685
6685
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6686
6686
|
const base = super.describe(options);
|
|
6687
|
-
base.innerType = next.spec.types.map((
|
|
6687
|
+
base.innerType = next.spec.types.map((schema16, index) => {
|
|
6688
6688
|
var _innerOptions;
|
|
6689
6689
|
let innerOptions = options;
|
|
6690
6690
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6693,7 +6693,7 @@ var TupleSchema = class extends Schema {
|
|
|
6693
6693
|
value: innerOptions.value[index]
|
|
6694
6694
|
});
|
|
6695
6695
|
}
|
|
6696
|
-
return
|
|
6696
|
+
return schema16.describe(innerOptions);
|
|
6697
6697
|
});
|
|
6698
6698
|
return base;
|
|
6699
6699
|
}
|
|
@@ -6710,6 +6710,7 @@ var import_react2 = __toESM(require_react(), 1);
|
|
|
6710
6710
|
var React8 = __toESM(require_react(), 1);
|
|
6711
6711
|
var import_react3 = __toESM(require_react(), 1);
|
|
6712
6712
|
var import_react4 = __toESM(require_react(), 1);
|
|
6713
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
6713
6714
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
|
|
6714
6715
|
EnumInviteStatus22["ACCEPTED"] = "Accepted";
|
|
6715
6716
|
EnumInviteStatus22["COMPLETED"] = "Completed";
|
|
@@ -8334,6 +8335,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8334
8335
|
promoCodes
|
|
8335
8336
|
refreshToken
|
|
8336
8337
|
role
|
|
8338
|
+
school
|
|
8337
8339
|
termsAgreement {
|
|
8338
8340
|
...TermsAgreementFields
|
|
8339
8341
|
}
|
|
@@ -10172,6 +10174,75 @@ var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
|
10172
10174
|
}
|
|
10173
10175
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10174
10176
|
`;
|
|
10177
|
+
var SCHOOL = gql`
|
|
10178
|
+
fragment SchoolFields on SchoolType {
|
|
10179
|
+
_id
|
|
10180
|
+
active
|
|
10181
|
+
contactDetails {
|
|
10182
|
+
...ContactDetailsFields
|
|
10183
|
+
}
|
|
10184
|
+
location {
|
|
10185
|
+
...LocationFields
|
|
10186
|
+
}
|
|
10187
|
+
createdAt
|
|
10188
|
+
deletedAt
|
|
10189
|
+
logo {
|
|
10190
|
+
...ResourceImageFields
|
|
10191
|
+
}
|
|
10192
|
+
name
|
|
10193
|
+
owner {
|
|
10194
|
+
...OwnerFields
|
|
10195
|
+
}
|
|
10196
|
+
region
|
|
10197
|
+
studentCount
|
|
10198
|
+
termsAgreement {
|
|
10199
|
+
...TermsAgreementFields
|
|
10200
|
+
}
|
|
10201
|
+
updatedAt
|
|
10202
|
+
}
|
|
10203
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10204
|
+
${LOCATION_FIELDS_FRAGMENT}
|
|
10205
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
10206
|
+
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
10207
|
+
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
10208
|
+
`;
|
|
10209
|
+
var GET_SCHOOL = gql`
|
|
10210
|
+
query getSchool($_id: ID!) {
|
|
10211
|
+
school(_id: $_id) {
|
|
10212
|
+
...SchoolFields
|
|
10213
|
+
}
|
|
10214
|
+
}
|
|
10215
|
+
${SCHOOL}
|
|
10216
|
+
`;
|
|
10217
|
+
var GET_SCHOOLS = gql`
|
|
10218
|
+
query getSchools {
|
|
10219
|
+
schools {
|
|
10220
|
+
...SchoolFields
|
|
10221
|
+
}
|
|
10222
|
+
}
|
|
10223
|
+
${SCHOOL}
|
|
10224
|
+
`;
|
|
10225
|
+
var CREATE_SCHOOL_MUTATION = gql`
|
|
10226
|
+
mutation createSchool($input: SchoolInputType!) {
|
|
10227
|
+
createSchool(input: $input) {
|
|
10228
|
+
...SchoolFields
|
|
10229
|
+
}
|
|
10230
|
+
}
|
|
10231
|
+
${SCHOOL}
|
|
10232
|
+
`;
|
|
10233
|
+
var UPDATE_SCHOOL_MUTATION = gql`
|
|
10234
|
+
mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
|
|
10235
|
+
updateSchool(_id: $_id, input: $input) {
|
|
10236
|
+
...SchoolFields
|
|
10237
|
+
}
|
|
10238
|
+
}
|
|
10239
|
+
${SCHOOL}
|
|
10240
|
+
`;
|
|
10241
|
+
var DELETE_SCHOOL_MUTATION = gql`
|
|
10242
|
+
mutation deleteSchool($_id: ID!) {
|
|
10243
|
+
deleteSchool(_id: $_id)
|
|
10244
|
+
}
|
|
10245
|
+
`;
|
|
10175
10246
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10176
10247
|
var nzbnRegex = /^94\d{11}$/;
|
|
10177
10248
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10323,7 +10394,7 @@ var socialMediaSchema = create$3({
|
|
|
10323
10394
|
is: (name) => !!name,
|
|
10324
10395
|
// If name has a value
|
|
10325
10396
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10326
|
-
otherwise: (
|
|
10397
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10327
10398
|
})
|
|
10328
10399
|
});
|
|
10329
10400
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10399,21 +10470,21 @@ var paymentInfoSchema = create$3({
|
|
|
10399
10470
|
).required("Please select a Payment method"),
|
|
10400
10471
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10401
10472
|
is: "bank_transfer",
|
|
10402
|
-
then: (
|
|
10403
|
-
otherwise: (
|
|
10473
|
+
then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
|
|
10474
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10404
10475
|
}),
|
|
10405
10476
|
accountNumber: create$6().when("paymentMethod", {
|
|
10406
10477
|
is: "bank_transfer",
|
|
10407
|
-
then: (
|
|
10478
|
+
then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
|
|
10408
10479
|
nzBankAccountRegex,
|
|
10409
10480
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10410
10481
|
).trim(),
|
|
10411
|
-
otherwise: (
|
|
10482
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10412
10483
|
}),
|
|
10413
10484
|
link: create$6().when("paymentMethod", {
|
|
10414
10485
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10415
10486
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10416
|
-
otherwise: (
|
|
10487
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10417
10488
|
})
|
|
10418
10489
|
});
|
|
10419
10490
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10563,16 +10634,16 @@ var vendorInfoSchema = create$3().shape({
|
|
|
10563
10634
|
var userSchema = create$3().shape({
|
|
10564
10635
|
active: create$7().required("Active is required"),
|
|
10565
10636
|
email: emailRequiredSchema,
|
|
10566
|
-
firstName: create$6().label("First Name").required("First name is required"),
|
|
10567
|
-
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10637
|
+
firstName: create$6().label("First Name").trim().required("First name is required"),
|
|
10638
|
+
lastName: create$6().label("Last Name").trim().required("Last name is required"),
|
|
10568
10639
|
isTester: create$7().required("Tester status is required"),
|
|
10569
10640
|
password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
10570
10641
|
preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
|
|
10571
10642
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10572
10643
|
is: (val) => !!val,
|
|
10573
10644
|
// only necessary if password typed
|
|
10574
|
-
then: (
|
|
10575
|
-
otherwise: (
|
|
10645
|
+
then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10646
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10576
10647
|
}),
|
|
10577
10648
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10578
10649
|
});
|
|
@@ -10643,7 +10714,7 @@ var adSchema = create$3().shape({
|
|
|
10643
10714
|
return endDate > now;
|
|
10644
10715
|
}).when("start", {
|
|
10645
10716
|
is: (val) => val && val.length > 0,
|
|
10646
|
-
then: (
|
|
10717
|
+
then: (schema16) => schema16.test(
|
|
10647
10718
|
"is-after-start",
|
|
10648
10719
|
"End date must be after start date",
|
|
10649
10720
|
function(value) {
|
|
@@ -10787,6 +10858,14 @@ var contactUsSchema = create$3().shape({
|
|
|
10787
10858
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10788
10859
|
message: create$6().label("Message").required("Message is required")
|
|
10789
10860
|
});
|
|
10861
|
+
var schoolSchema = create$3().shape({
|
|
10862
|
+
active: create$7().required("Active is required"),
|
|
10863
|
+
contactDetails: contactDetailsSchema,
|
|
10864
|
+
location: locationSchema,
|
|
10865
|
+
name: create$6().trim().required("Name is required"),
|
|
10866
|
+
region: create$6().trim().required("Region is required"),
|
|
10867
|
+
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"))
|
|
10868
|
+
});
|
|
10790
10869
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
10791
10870
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
10792
10871
|
EnumActivity2["GOING"] = "GOING";
|
|
@@ -11548,27 +11627,27 @@ var baseResourceFields = {
|
|
|
11548
11627
|
required: false,
|
|
11549
11628
|
type: [associatesSchema]
|
|
11550
11629
|
},
|
|
11551
|
-
contactDetails: ContactDetailsSchema,
|
|
11630
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
11552
11631
|
cover: {
|
|
11553
11632
|
required: true,
|
|
11554
11633
|
type: ResourceImageTypeSchema
|
|
11555
11634
|
},
|
|
11556
11635
|
deletedAt: { default: null, required: false, type: Date },
|
|
11557
11636
|
description: { required: true, type: String },
|
|
11558
|
-
images: [ResourceImageTypeSchema],
|
|
11559
|
-
logo: ResourceImageTypeSchema,
|
|
11637
|
+
images: { required: false, type: [ResourceImageTypeSchema] },
|
|
11638
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
11560
11639
|
name: { required: true, type: String },
|
|
11561
11640
|
owner: {
|
|
11562
11641
|
required: false,
|
|
11563
11642
|
type: OwnerTypeSchema
|
|
11564
11643
|
},
|
|
11565
|
-
posterUsage: PosterUsageTypeSchema,
|
|
11644
|
+
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
11566
11645
|
promoCodes: { required: false, type: [String] },
|
|
11567
11646
|
rating: { required: false, type: Number },
|
|
11568
11647
|
region: { required: true, type: String },
|
|
11569
11648
|
reviewCount: { required: false, type: Number },
|
|
11570
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
11571
|
-
termsAgreement: termsAgreementSchema
|
|
11649
|
+
socialMedia: { required: false, type: [SocialMediaTypeSchema] },
|
|
11650
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
11572
11651
|
};
|
|
11573
11652
|
|
|
11574
11653
|
// src/mongoose/GoogleImportedMarket.ts
|
|
@@ -11821,6 +11900,11 @@ var schema7 = new MongooseSchema11(
|
|
|
11821
11900
|
required: true,
|
|
11822
11901
|
type: String
|
|
11823
11902
|
},
|
|
11903
|
+
school: {
|
|
11904
|
+
ref: "School",
|
|
11905
|
+
required: false,
|
|
11906
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
11907
|
+
},
|
|
11824
11908
|
stripe: {
|
|
11825
11909
|
required: false,
|
|
11826
11910
|
type: stripeSchema
|
|
@@ -12211,9 +12295,9 @@ var gameDataSchemas = {
|
|
|
12211
12295
|
[EnumGameType.DAILY_CLUE]: schemaDailyClue
|
|
12212
12296
|
};
|
|
12213
12297
|
var gameDataDefinition = Object.fromEntries(
|
|
12214
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12298
|
+
Object.entries(gameDataSchemas).map(([key, schema16]) => [
|
|
12215
12299
|
key,
|
|
12216
|
-
{ default: null, required: false, type:
|
|
12300
|
+
{ default: null, required: false, type: schema16 }
|
|
12217
12301
|
])
|
|
12218
12302
|
);
|
|
12219
12303
|
var gameHistorySchema = new MongooseSchema19(
|
|
@@ -12261,6 +12345,32 @@ var schema14 = new MongooseSchema19(
|
|
|
12261
12345
|
);
|
|
12262
12346
|
var GameModel = import_mongoose20.default.models.Game || import_mongoose20.default.model("Game", schema14);
|
|
12263
12347
|
|
|
12348
|
+
// src/mongoose/School.ts
|
|
12349
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12350
|
+
var MongooseSchema20 = import_mongoose21.default.Schema;
|
|
12351
|
+
var schema15 = new MongooseSchema20(
|
|
12352
|
+
{
|
|
12353
|
+
active: { default: false, required: true, type: Boolean },
|
|
12354
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
12355
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12356
|
+
location: {
|
|
12357
|
+
required: true,
|
|
12358
|
+
type: locationsSchema
|
|
12359
|
+
},
|
|
12360
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
12361
|
+
name: { required: true, type: String },
|
|
12362
|
+
owner: {
|
|
12363
|
+
required: true,
|
|
12364
|
+
type: OwnerTypeSchema
|
|
12365
|
+
},
|
|
12366
|
+
region: { required: true, type: String },
|
|
12367
|
+
studentCount: { required: true, type: Number },
|
|
12368
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
12369
|
+
},
|
|
12370
|
+
{ timestamps: true }
|
|
12371
|
+
);
|
|
12372
|
+
var SchoolModel = import_mongoose21.default.models.School || import_mongoose21.default.model("School", schema15);
|
|
12373
|
+
|
|
12264
12374
|
// src/service/updateAdStatus.ts
|
|
12265
12375
|
async function updateAdStatuses() {
|
|
12266
12376
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -12354,12 +12464,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
12354
12464
|
}
|
|
12355
12465
|
|
|
12356
12466
|
// src/service/objectIdToString.ts
|
|
12357
|
-
var
|
|
12467
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
12358
12468
|
function convertObjectIdsToStrings(obj) {
|
|
12359
12469
|
if (obj === null || obj === void 0) {
|
|
12360
12470
|
return obj;
|
|
12361
12471
|
}
|
|
12362
|
-
if (obj instanceof
|
|
12472
|
+
if (obj instanceof import_mongoose24.default.Types.ObjectId) {
|
|
12363
12473
|
return obj.toString();
|
|
12364
12474
|
}
|
|
12365
12475
|
if (Array.isArray(obj)) {
|