@timardex/cluemart-server-shared 1.0.132 → 1.0.134
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-AMB6NVKD.mjs} +220 -100
- package/dist/chunk-AMB6NVKD.mjs.map +1 -0
- package/dist/index.cjs +226 -104
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +102 -60
- package/dist/index.d.ts +102 -60
- package/dist/index.mjs +224 -104
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +220 -98
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +102 -60
- package/dist/mongoose/index.d.ts +102 -60
- package/dist/mongoose/index.mjs +5 -1
- package/dist/service/index.cjs +218 -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/mongoose/index.cjs
CHANGED
|
@@ -1679,6 +1679,7 @@ __export(mongoose_exports, {
|
|
|
1679
1679
|
CategorySchema: () => CategorySchema,
|
|
1680
1680
|
ChatModel: () => ChatModel,
|
|
1681
1681
|
ChatReportModel: () => ChatReportModel,
|
|
1682
|
+
ContactDetailsSchema: () => ContactDetailsSchema,
|
|
1682
1683
|
EventInfoModel: () => EventInfoModel,
|
|
1683
1684
|
EventModel: () => EventModel,
|
|
1684
1685
|
GameModel: () => GameModel,
|
|
@@ -1693,6 +1694,7 @@ __export(mongoose_exports, {
|
|
|
1693
1694
|
RelationTypeSchema: () => RelationTypeSchema,
|
|
1694
1695
|
ResourceActivityModel: () => ResourceActivityModel,
|
|
1695
1696
|
ResourceImageTypeSchema: () => ResourceImageTypeSchema,
|
|
1697
|
+
SchoolModel: () => SchoolModel,
|
|
1696
1698
|
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
1697
1699
|
StallTypeSchema: () => StallTypeSchema,
|
|
1698
1700
|
UserModel: () => UserModel,
|
|
@@ -4725,10 +4727,10 @@ var Condition = class _Condition {
|
|
|
4725
4727
|
otherwise
|
|
4726
4728
|
} = config;
|
|
4727
4729
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4728
|
-
return new _Condition(refs, (values,
|
|
4730
|
+
return new _Condition(refs, (values, schema16) => {
|
|
4729
4731
|
var _branch;
|
|
4730
4732
|
let branch = check(...values) ? then : otherwise;
|
|
4731
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4733
|
+
return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
|
|
4732
4734
|
});
|
|
4733
4735
|
}
|
|
4734
4736
|
constructor(refs, builder) {
|
|
@@ -4742,13 +4744,13 @@ var Condition = class _Condition {
|
|
|
4742
4744
|
// TODO: ? operator here?
|
|
4743
4745
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4744
4746
|
));
|
|
4745
|
-
let
|
|
4746
|
-
if (
|
|
4747
|
-
|
|
4747
|
+
let schema16 = this.fn(values, base, options);
|
|
4748
|
+
if (schema16 === void 0 || // @ts-ignore this can be base
|
|
4749
|
+
schema16 === base) {
|
|
4748
4750
|
return base;
|
|
4749
4751
|
}
|
|
4750
|
-
if (!isSchema(
|
|
4751
|
-
return
|
|
4752
|
+
if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
|
|
4753
|
+
return schema16.resolve(options);
|
|
4752
4754
|
}
|
|
4753
4755
|
};
|
|
4754
4756
|
var prefixes = {
|
|
@@ -4818,7 +4820,7 @@ function createValidation(config) {
|
|
|
4818
4820
|
path = "",
|
|
4819
4821
|
options,
|
|
4820
4822
|
originalValue,
|
|
4821
|
-
schema:
|
|
4823
|
+
schema: schema16
|
|
4822
4824
|
}, panic, next) {
|
|
4823
4825
|
const {
|
|
4824
4826
|
name,
|
|
@@ -4830,8 +4832,8 @@ function createValidation(config) {
|
|
|
4830
4832
|
let {
|
|
4831
4833
|
parent,
|
|
4832
4834
|
context,
|
|
4833
|
-
abortEarly =
|
|
4834
|
-
disableStackTrace =
|
|
4835
|
+
abortEarly = schema16.spec.abortEarly,
|
|
4836
|
+
disableStackTrace = schema16.spec.disableStackTrace
|
|
4835
4837
|
} = options;
|
|
4836
4838
|
function resolve(item) {
|
|
4837
4839
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4840,9 +4842,9 @@ function createValidation(config) {
|
|
|
4840
4842
|
const nextParams = Object.assign({
|
|
4841
4843
|
value,
|
|
4842
4844
|
originalValue,
|
|
4843
|
-
label:
|
|
4845
|
+
label: schema16.spec.label,
|
|
4844
4846
|
path: overrides.path || path,
|
|
4845
|
-
spec:
|
|
4847
|
+
spec: schema16.spec,
|
|
4846
4848
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4847
4849
|
}, params, overrides.params);
|
|
4848
4850
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4860,7 +4862,7 @@ function createValidation(config) {
|
|
|
4860
4862
|
resolve,
|
|
4861
4863
|
options,
|
|
4862
4864
|
originalValue,
|
|
4863
|
-
schema:
|
|
4865
|
+
schema: schema16
|
|
4864
4866
|
};
|
|
4865
4867
|
const handleResult = (validOrError) => {
|
|
4866
4868
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4894,42 +4896,42 @@ function createValidation(config) {
|
|
|
4894
4896
|
validate.OPTIONS = config;
|
|
4895
4897
|
return validate;
|
|
4896
4898
|
}
|
|
4897
|
-
function getIn(
|
|
4899
|
+
function getIn(schema16, path, value, context = value) {
|
|
4898
4900
|
let parent, lastPart, lastPartDebug;
|
|
4899
4901
|
if (!path) return {
|
|
4900
4902
|
parent,
|
|
4901
4903
|
parentPath: path,
|
|
4902
|
-
schema:
|
|
4904
|
+
schema: schema16
|
|
4903
4905
|
};
|
|
4904
4906
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4905
4907
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4906
|
-
|
|
4908
|
+
schema16 = schema16.resolve({
|
|
4907
4909
|
context,
|
|
4908
4910
|
parent,
|
|
4909
4911
|
value
|
|
4910
4912
|
});
|
|
4911
|
-
let isTuple =
|
|
4913
|
+
let isTuple = schema16.type === "tuple";
|
|
4912
4914
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4913
|
-
if (
|
|
4915
|
+
if (schema16.innerType || isTuple) {
|
|
4914
4916
|
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]"`);
|
|
4915
4917
|
if (value && idx >= value.length) {
|
|
4916
4918
|
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. `);
|
|
4917
4919
|
}
|
|
4918
4920
|
parent = value;
|
|
4919
4921
|
value = value && value[idx];
|
|
4920
|
-
|
|
4922
|
+
schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
|
|
4921
4923
|
}
|
|
4922
4924
|
if (!isArray) {
|
|
4923
|
-
if (!
|
|
4925
|
+
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}")`);
|
|
4924
4926
|
parent = value;
|
|
4925
4927
|
value = value && value[part];
|
|
4926
|
-
|
|
4928
|
+
schema16 = schema16.fields[part];
|
|
4927
4929
|
}
|
|
4928
4930
|
lastPart = part;
|
|
4929
4931
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4930
4932
|
});
|
|
4931
4933
|
return {
|
|
4932
|
-
schema:
|
|
4934
|
+
schema: schema16,
|
|
4933
4935
|
parent,
|
|
4934
4936
|
parentPath: lastPart
|
|
4935
4937
|
};
|
|
@@ -5066,20 +5068,20 @@ var Schema = class {
|
|
|
5066
5068
|
this._mutate = before;
|
|
5067
5069
|
return result;
|
|
5068
5070
|
}
|
|
5069
|
-
concat(
|
|
5070
|
-
if (!
|
|
5071
|
-
if (
|
|
5071
|
+
concat(schema16) {
|
|
5072
|
+
if (!schema16 || schema16 === this) return this;
|
|
5073
|
+
if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
|
|
5072
5074
|
let base = this;
|
|
5073
|
-
let combined =
|
|
5075
|
+
let combined = schema16.clone();
|
|
5074
5076
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5075
5077
|
combined.spec = mergedSpec;
|
|
5076
5078
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5077
|
-
combined._whitelist = base._whitelist.merge(
|
|
5078
|
-
combined._blacklist = base._blacklist.merge(
|
|
5079
|
+
combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
|
|
5080
|
+
combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
|
|
5079
5081
|
combined.tests = base.tests;
|
|
5080
5082
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5081
5083
|
combined.withMutation((next) => {
|
|
5082
|
-
|
|
5084
|
+
schema16.tests.forEach((fn) => {
|
|
5083
5085
|
next.test(fn.OPTIONS);
|
|
5084
5086
|
});
|
|
5085
5087
|
});
|
|
@@ -5095,15 +5097,15 @@ var Schema = class {
|
|
|
5095
5097
|
return this._typeCheck(v);
|
|
5096
5098
|
}
|
|
5097
5099
|
resolve(options) {
|
|
5098
|
-
let
|
|
5099
|
-
if (
|
|
5100
|
-
let conditions =
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5100
|
+
let schema16 = this;
|
|
5101
|
+
if (schema16.conditions.length) {
|
|
5102
|
+
let conditions = schema16.conditions;
|
|
5103
|
+
schema16 = schema16.clone();
|
|
5104
|
+
schema16.conditions = [];
|
|
5105
|
+
schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
|
|
5106
|
+
schema16 = schema16.resolve(options);
|
|
5105
5107
|
}
|
|
5106
|
-
return
|
|
5108
|
+
return schema16;
|
|
5107
5109
|
}
|
|
5108
5110
|
resolveOptions(options) {
|
|
5109
5111
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5257,11 +5259,11 @@ attempted value: ${formattedValue}
|
|
|
5257
5259
|
}
|
|
5258
5260
|
validate(value, options) {
|
|
5259
5261
|
var _options$disableStack2;
|
|
5260
|
-
let
|
|
5262
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5261
5263
|
value
|
|
5262
5264
|
}));
|
|
5263
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5264
|
-
return new Promise((resolve, reject) =>
|
|
5265
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
|
|
5266
|
+
return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
|
|
5265
5267
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5266
5268
|
reject(error);
|
|
5267
5269
|
}, (errors, validated) => {
|
|
@@ -5271,12 +5273,12 @@ attempted value: ${formattedValue}
|
|
|
5271
5273
|
}
|
|
5272
5274
|
validateSync(value, options) {
|
|
5273
5275
|
var _options$disableStack3;
|
|
5274
|
-
let
|
|
5276
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5275
5277
|
value
|
|
5276
5278
|
}));
|
|
5277
5279
|
let result;
|
|
5278
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5279
|
-
|
|
5280
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
|
|
5281
|
+
schema16._validate(value, Object.assign({}, options, {
|
|
5280
5282
|
sync: true
|
|
5281
5283
|
}), (error, parsed) => {
|
|
5282
5284
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5310,8 +5312,8 @@ attempted value: ${formattedValue}
|
|
|
5310
5312
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5311
5313
|
}
|
|
5312
5314
|
getDefault(options) {
|
|
5313
|
-
let
|
|
5314
|
-
return
|
|
5315
|
+
let schema16 = this.resolve(options || {});
|
|
5316
|
+
return schema16._getDefault(options);
|
|
5315
5317
|
}
|
|
5316
5318
|
default(def) {
|
|
5317
5319
|
if (arguments.length === 0) {
|
|
@@ -5546,9 +5548,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5546
5548
|
const {
|
|
5547
5549
|
parent,
|
|
5548
5550
|
parentPath,
|
|
5549
|
-
schema:
|
|
5551
|
+
schema: schema16
|
|
5550
5552
|
} = getIn(this, path, value, options.context);
|
|
5551
|
-
return
|
|
5553
|
+
return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5552
5554
|
parent,
|
|
5553
5555
|
path
|
|
5554
5556
|
}));
|
|
@@ -5722,7 +5724,7 @@ var StringSchema = class extends Schema {
|
|
|
5722
5724
|
});
|
|
5723
5725
|
}
|
|
5724
5726
|
required(message) {
|
|
5725
|
-
return super.required(message).withMutation((
|
|
5727
|
+
return super.required(message).withMutation((schema16) => schema16.test({
|
|
5726
5728
|
message: message || mixed.required,
|
|
5727
5729
|
name: "required",
|
|
5728
5730
|
skipAbsent: true,
|
|
@@ -5730,9 +5732,9 @@ var StringSchema = class extends Schema {
|
|
|
5730
5732
|
}));
|
|
5731
5733
|
}
|
|
5732
5734
|
notRequired() {
|
|
5733
|
-
return super.notRequired().withMutation((
|
|
5734
|
-
|
|
5735
|
-
return
|
|
5735
|
+
return super.notRequired().withMutation((schema16) => {
|
|
5736
|
+
schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5737
|
+
return schema16;
|
|
5736
5738
|
});
|
|
5737
5739
|
}
|
|
5738
5740
|
length(length, message = string.length) {
|
|
@@ -6121,28 +6123,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6121
6123
|
}
|
|
6122
6124
|
return ctx.isType(parsed) ? parsed : value;
|
|
6123
6125
|
};
|
|
6124
|
-
function deepPartial(
|
|
6125
|
-
if ("fields" in
|
|
6126
|
+
function deepPartial(schema16) {
|
|
6127
|
+
if ("fields" in schema16) {
|
|
6126
6128
|
const partial = {};
|
|
6127
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6129
|
+
for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
|
|
6128
6130
|
partial[key] = deepPartial(fieldSchema);
|
|
6129
6131
|
}
|
|
6130
|
-
return
|
|
6132
|
+
return schema16.setFields(partial);
|
|
6131
6133
|
}
|
|
6132
|
-
if (
|
|
6133
|
-
const nextArray =
|
|
6134
|
+
if (schema16.type === "array") {
|
|
6135
|
+
const nextArray = schema16.optional();
|
|
6134
6136
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6135
6137
|
return nextArray;
|
|
6136
6138
|
}
|
|
6137
|
-
if (
|
|
6138
|
-
return
|
|
6139
|
-
types:
|
|
6139
|
+
if (schema16.type === "tuple") {
|
|
6140
|
+
return schema16.optional().clone({
|
|
6141
|
+
types: schema16.spec.types.map(deepPartial)
|
|
6140
6142
|
});
|
|
6141
6143
|
}
|
|
6142
|
-
if ("optional" in
|
|
6143
|
-
return
|
|
6144
|
+
if ("optional" in schema16) {
|
|
6145
|
+
return schema16.optional();
|
|
6144
6146
|
}
|
|
6145
|
-
return
|
|
6147
|
+
return schema16;
|
|
6146
6148
|
}
|
|
6147
6149
|
var deepHas = (obj, p) => {
|
|
6148
6150
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6276,8 +6278,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6276
6278
|
next._sortErrors = this._sortErrors;
|
|
6277
6279
|
return next;
|
|
6278
6280
|
}
|
|
6279
|
-
concat(
|
|
6280
|
-
let next = super.concat(
|
|
6281
|
+
concat(schema16) {
|
|
6282
|
+
let next = super.concat(schema16);
|
|
6281
6283
|
let nextFields = next.fields;
|
|
6282
6284
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6283
6285
|
const target = nextFields[field];
|
|
@@ -6285,7 +6287,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6285
6287
|
}
|
|
6286
6288
|
return next.withMutation((s) => (
|
|
6287
6289
|
// XXX: excludes here is wrong
|
|
6288
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6290
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
|
|
6289
6291
|
));
|
|
6290
6292
|
}
|
|
6291
6293
|
_getDefault(options) {
|
|
@@ -6330,8 +6332,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6330
6332
|
}
|
|
6331
6333
|
partial() {
|
|
6332
6334
|
const partial = {};
|
|
6333
|
-
for (const [key,
|
|
6334
|
-
partial[key] = "optional" in
|
|
6335
|
+
for (const [key, schema16] of Object.entries(this.fields)) {
|
|
6336
|
+
partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
|
|
6335
6337
|
}
|
|
6336
6338
|
return this.setFields(partial);
|
|
6337
6339
|
}
|
|
@@ -6529,22 +6531,22 @@ var ArraySchema = class extends Schema {
|
|
|
6529
6531
|
json() {
|
|
6530
6532
|
return this.transform(parseJson);
|
|
6531
6533
|
}
|
|
6532
|
-
concat(
|
|
6533
|
-
let next = super.concat(
|
|
6534
|
+
concat(schema16) {
|
|
6535
|
+
let next = super.concat(schema16);
|
|
6534
6536
|
next.innerType = this.innerType;
|
|
6535
|
-
if (
|
|
6537
|
+
if (schema16.innerType)
|
|
6536
6538
|
next.innerType = next.innerType ? (
|
|
6537
6539
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6538
|
-
next.innerType.concat(
|
|
6539
|
-
) :
|
|
6540
|
+
next.innerType.concat(schema16.innerType)
|
|
6541
|
+
) : schema16.innerType;
|
|
6540
6542
|
return next;
|
|
6541
6543
|
}
|
|
6542
|
-
of(
|
|
6544
|
+
of(schema16) {
|
|
6543
6545
|
let next = this.clone();
|
|
6544
|
-
if (!isSchema(
|
|
6545
|
-
next.innerType =
|
|
6546
|
+
if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
|
|
6547
|
+
next.innerType = schema16;
|
|
6546
6548
|
next.spec = Object.assign({}, next.spec, {
|
|
6547
|
-
types:
|
|
6549
|
+
types: schema16
|
|
6548
6550
|
});
|
|
6549
6551
|
return next;
|
|
6550
6552
|
}
|
|
@@ -6688,7 +6690,7 @@ var TupleSchema = class extends Schema {
|
|
|
6688
6690
|
describe(options) {
|
|
6689
6691
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6690
6692
|
const base = super.describe(options);
|
|
6691
|
-
base.innerType = next.spec.types.map((
|
|
6693
|
+
base.innerType = next.spec.types.map((schema16, index) => {
|
|
6692
6694
|
var _innerOptions;
|
|
6693
6695
|
let innerOptions = options;
|
|
6694
6696
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6697,7 +6699,7 @@ var TupleSchema = class extends Schema {
|
|
|
6697
6699
|
value: innerOptions.value[index]
|
|
6698
6700
|
});
|
|
6699
6701
|
}
|
|
6700
|
-
return
|
|
6702
|
+
return schema16.describe(innerOptions);
|
|
6701
6703
|
});
|
|
6702
6704
|
return base;
|
|
6703
6705
|
}
|
|
@@ -6714,6 +6716,7 @@ var import_react2 = __toESM(require_react(), 1);
|
|
|
6714
6716
|
var React8 = __toESM(require_react(), 1);
|
|
6715
6717
|
var import_react3 = __toESM(require_react(), 1);
|
|
6716
6718
|
var import_react4 = __toESM(require_react(), 1);
|
|
6719
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
6717
6720
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
|
|
6718
6721
|
EnumInviteStatus22["ACCEPTED"] = "Accepted";
|
|
6719
6722
|
EnumInviteStatus22["COMPLETED"] = "Completed";
|
|
@@ -8338,6 +8341,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8338
8341
|
promoCodes
|
|
8339
8342
|
refreshToken
|
|
8340
8343
|
role
|
|
8344
|
+
school
|
|
8341
8345
|
termsAgreement {
|
|
8342
8346
|
...TermsAgreementFields
|
|
8343
8347
|
}
|
|
@@ -10176,6 +10180,80 @@ var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
|
10176
10180
|
}
|
|
10177
10181
|
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10178
10182
|
`;
|
|
10183
|
+
var SCHOOL = gql`
|
|
10184
|
+
fragment SchoolFields on SchoolType {
|
|
10185
|
+
_id
|
|
10186
|
+
active
|
|
10187
|
+
contactDetails {
|
|
10188
|
+
...ContactDetailsFields
|
|
10189
|
+
}
|
|
10190
|
+
location {
|
|
10191
|
+
...LocationFields
|
|
10192
|
+
}
|
|
10193
|
+
createdAt
|
|
10194
|
+
deletedAt
|
|
10195
|
+
logo {
|
|
10196
|
+
...ResourceImageFields
|
|
10197
|
+
}
|
|
10198
|
+
name
|
|
10199
|
+
owner {
|
|
10200
|
+
...OwnerFields
|
|
10201
|
+
}
|
|
10202
|
+
overallPoints
|
|
10203
|
+
region
|
|
10204
|
+
studentCount
|
|
10205
|
+
socialMedia {
|
|
10206
|
+
...SocialMediaFields
|
|
10207
|
+
}
|
|
10208
|
+
termsAgreement {
|
|
10209
|
+
...TermsAgreementFields
|
|
10210
|
+
}
|
|
10211
|
+
updatedAt
|
|
10212
|
+
}
|
|
10213
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10214
|
+
${LOCATION_FIELDS_FRAGMENT}
|
|
10215
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
10216
|
+
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
10217
|
+
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
10218
|
+
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
10219
|
+
`;
|
|
10220
|
+
var GET_SCHOOL = gql`
|
|
10221
|
+
query getSchool($_id: ID!) {
|
|
10222
|
+
school(_id: $_id) {
|
|
10223
|
+
...SchoolFields
|
|
10224
|
+
}
|
|
10225
|
+
}
|
|
10226
|
+
${SCHOOL}
|
|
10227
|
+
`;
|
|
10228
|
+
var GET_SCHOOLS = gql`
|
|
10229
|
+
query getSchools {
|
|
10230
|
+
schools {
|
|
10231
|
+
...SchoolFields
|
|
10232
|
+
}
|
|
10233
|
+
}
|
|
10234
|
+
${SCHOOL}
|
|
10235
|
+
`;
|
|
10236
|
+
var CREATE_SCHOOL_MUTATION = gql`
|
|
10237
|
+
mutation createSchool($input: SchoolInputType!) {
|
|
10238
|
+
createSchool(input: $input) {
|
|
10239
|
+
...SchoolFields
|
|
10240
|
+
}
|
|
10241
|
+
}
|
|
10242
|
+
${SCHOOL}
|
|
10243
|
+
`;
|
|
10244
|
+
var UPDATE_SCHOOL_MUTATION = gql`
|
|
10245
|
+
mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
|
|
10246
|
+
updateSchool(_id: $_id, input: $input) {
|
|
10247
|
+
...SchoolFields
|
|
10248
|
+
}
|
|
10249
|
+
}
|
|
10250
|
+
${SCHOOL}
|
|
10251
|
+
`;
|
|
10252
|
+
var DELETE_SCHOOL_MUTATION = gql`
|
|
10253
|
+
mutation deleteSchool($_id: ID!) {
|
|
10254
|
+
deleteSchool(_id: $_id)
|
|
10255
|
+
}
|
|
10256
|
+
`;
|
|
10179
10257
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10180
10258
|
var nzbnRegex = /^94\d{11}$/;
|
|
10181
10259
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10327,7 +10405,7 @@ var socialMediaSchema = create$3({
|
|
|
10327
10405
|
is: (name) => !!name,
|
|
10328
10406
|
// If name has a value
|
|
10329
10407
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10330
|
-
otherwise: (
|
|
10408
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10331
10409
|
})
|
|
10332
10410
|
});
|
|
10333
10411
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10403,21 +10481,21 @@ var paymentInfoSchema = create$3({
|
|
|
10403
10481
|
).required("Please select a Payment method"),
|
|
10404
10482
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10405
10483
|
is: "bank_transfer",
|
|
10406
|
-
then: (
|
|
10407
|
-
otherwise: (
|
|
10484
|
+
then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
|
|
10485
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10408
10486
|
}),
|
|
10409
10487
|
accountNumber: create$6().when("paymentMethod", {
|
|
10410
10488
|
is: "bank_transfer",
|
|
10411
|
-
then: (
|
|
10489
|
+
then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
|
|
10412
10490
|
nzBankAccountRegex,
|
|
10413
10491
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10414
10492
|
).trim(),
|
|
10415
|
-
otherwise: (
|
|
10493
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10416
10494
|
}),
|
|
10417
10495
|
link: create$6().when("paymentMethod", {
|
|
10418
10496
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10419
10497
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10420
|
-
otherwise: (
|
|
10498
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10421
10499
|
})
|
|
10422
10500
|
});
|
|
10423
10501
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10567,16 +10645,16 @@ var vendorInfoSchema = create$3().shape({
|
|
|
10567
10645
|
var userSchema = create$3().shape({
|
|
10568
10646
|
active: create$7().required("Active is required"),
|
|
10569
10647
|
email: emailRequiredSchema,
|
|
10570
|
-
firstName: create$6().label("First Name").required("First name is required"),
|
|
10571
|
-
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10648
|
+
firstName: create$6().label("First Name").trim().required("First name is required"),
|
|
10649
|
+
lastName: create$6().label("Last Name").trim().required("Last name is required"),
|
|
10572
10650
|
isTester: create$7().required("Tester status is required"),
|
|
10573
10651
|
password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
10574
10652
|
preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
|
|
10575
10653
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10576
10654
|
is: (val) => !!val,
|
|
10577
10655
|
// only necessary if password typed
|
|
10578
|
-
then: (
|
|
10579
|
-
otherwise: (
|
|
10656
|
+
then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10657
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10580
10658
|
}),
|
|
10581
10659
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10582
10660
|
});
|
|
@@ -10647,7 +10725,7 @@ var adSchema = create$3().shape({
|
|
|
10647
10725
|
return endDate > now;
|
|
10648
10726
|
}).when("start", {
|
|
10649
10727
|
is: (val) => val && val.length > 0,
|
|
10650
|
-
then: (
|
|
10728
|
+
then: (schema16) => schema16.test(
|
|
10651
10729
|
"is-after-start",
|
|
10652
10730
|
"End date must be after start date",
|
|
10653
10731
|
function(value) {
|
|
@@ -10791,6 +10869,15 @@ var contactUsSchema = create$3().shape({
|
|
|
10791
10869
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10792
10870
|
message: create$6().label("Message").required("Message is required")
|
|
10793
10871
|
});
|
|
10872
|
+
var schoolSchema = create$3().shape({
|
|
10873
|
+
active: create$7().required("Active is required"),
|
|
10874
|
+
contactDetails: contactDetailsSchema,
|
|
10875
|
+
location: locationSchema,
|
|
10876
|
+
name: create$6().trim().required("Name is required"),
|
|
10877
|
+
region: create$6().trim().required("Region is required"),
|
|
10878
|
+
socialMedia: create$2().of(socialMediaSchema).nullable().default(null),
|
|
10879
|
+
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"))
|
|
10880
|
+
});
|
|
10794
10881
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
10795
10882
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
10796
10883
|
EnumActivity2["GOING"] = "GOING";
|
|
@@ -11358,27 +11445,27 @@ var baseResourceFields = {
|
|
|
11358
11445
|
required: false,
|
|
11359
11446
|
type: [associatesSchema]
|
|
11360
11447
|
},
|
|
11361
|
-
contactDetails: ContactDetailsSchema,
|
|
11448
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
11362
11449
|
cover: {
|
|
11363
11450
|
required: true,
|
|
11364
11451
|
type: ResourceImageTypeSchema
|
|
11365
11452
|
},
|
|
11366
11453
|
deletedAt: { default: null, required: false, type: Date },
|
|
11367
11454
|
description: { required: true, type: String },
|
|
11368
|
-
images: [ResourceImageTypeSchema],
|
|
11369
|
-
logo: ResourceImageTypeSchema,
|
|
11455
|
+
images: { required: false, type: [ResourceImageTypeSchema] },
|
|
11456
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
11370
11457
|
name: { required: true, type: String },
|
|
11371
11458
|
owner: {
|
|
11372
11459
|
required: false,
|
|
11373
11460
|
type: OwnerTypeSchema
|
|
11374
11461
|
},
|
|
11375
|
-
posterUsage: PosterUsageTypeSchema,
|
|
11462
|
+
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
11376
11463
|
promoCodes: { required: false, type: [String] },
|
|
11377
11464
|
rating: { required: false, type: Number },
|
|
11378
11465
|
region: { required: true, type: String },
|
|
11379
11466
|
reviewCount: { required: false, type: Number },
|
|
11380
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
11381
|
-
termsAgreement: termsAgreementSchema
|
|
11467
|
+
socialMedia: { required: false, type: [SocialMediaTypeSchema] },
|
|
11468
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
11382
11469
|
};
|
|
11383
11470
|
|
|
11384
11471
|
// src/mongoose/GoogleImportedMarket.ts
|
|
@@ -11691,6 +11778,11 @@ var schema7 = new MongooseSchema11(
|
|
|
11691
11778
|
required: true,
|
|
11692
11779
|
type: String
|
|
11693
11780
|
},
|
|
11781
|
+
school: {
|
|
11782
|
+
ref: "School",
|
|
11783
|
+
required: false,
|
|
11784
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11785
|
+
},
|
|
11694
11786
|
stripe: {
|
|
11695
11787
|
required: false,
|
|
11696
11788
|
type: stripeSchema
|
|
@@ -12081,9 +12173,9 @@ var gameDataSchemas = {
|
|
|
12081
12173
|
[EnumGameType.DAILY_CLUE]: schemaDailyClue
|
|
12082
12174
|
};
|
|
12083
12175
|
var gameDataDefinition = Object.fromEntries(
|
|
12084
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12176
|
+
Object.entries(gameDataSchemas).map(([key, schema16]) => [
|
|
12085
12177
|
key,
|
|
12086
|
-
{ default: null, required: false, type:
|
|
12178
|
+
{ default: null, required: false, type: schema16 }
|
|
12087
12179
|
])
|
|
12088
12180
|
);
|
|
12089
12181
|
var gameHistorySchema = new MongooseSchema19(
|
|
@@ -12130,6 +12222,34 @@ var schema14 = new MongooseSchema19(
|
|
|
12130
12222
|
{ timestamps: true }
|
|
12131
12223
|
);
|
|
12132
12224
|
var GameModel = import_mongoose19.default.models.Game || import_mongoose19.default.model("Game", schema14);
|
|
12225
|
+
|
|
12226
|
+
// src/mongoose/School.ts
|
|
12227
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
12228
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
12229
|
+
var schema15 = new MongooseSchema20(
|
|
12230
|
+
{
|
|
12231
|
+
active: { default: false, required: true, type: Boolean },
|
|
12232
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
12233
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12234
|
+
location: {
|
|
12235
|
+
required: true,
|
|
12236
|
+
type: locationsSchema
|
|
12237
|
+
},
|
|
12238
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
12239
|
+
name: { required: true, type: String },
|
|
12240
|
+
overallPoints: { default: 0, required: false, type: Number },
|
|
12241
|
+
owner: {
|
|
12242
|
+
required: true,
|
|
12243
|
+
type: OwnerTypeSchema
|
|
12244
|
+
},
|
|
12245
|
+
region: { required: true, type: String },
|
|
12246
|
+
socialMedia: { required: false, type: [SocialMediaTypeSchema] },
|
|
12247
|
+
studentCount: { required: true, type: Number },
|
|
12248
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
12249
|
+
},
|
|
12250
|
+
{ timestamps: true }
|
|
12251
|
+
);
|
|
12252
|
+
var SchoolModel = import_mongoose20.default.models.School || import_mongoose20.default.model("School", schema15);
|
|
12133
12253
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12134
12254
|
0 && (module.exports = {
|
|
12135
12255
|
APP_SETTINGS_ID,
|
|
@@ -12138,6 +12258,7 @@ var GameModel = import_mongoose19.default.models.Game || import_mongoose19.defau
|
|
|
12138
12258
|
CategorySchema,
|
|
12139
12259
|
ChatModel,
|
|
12140
12260
|
ChatReportModel,
|
|
12261
|
+
ContactDetailsSchema,
|
|
12141
12262
|
EventInfoModel,
|
|
12142
12263
|
EventModel,
|
|
12143
12264
|
GameModel,
|
|
@@ -12152,6 +12273,7 @@ var GameModel = import_mongoose19.default.models.Game || import_mongoose19.defau
|
|
|
12152
12273
|
RelationTypeSchema,
|
|
12153
12274
|
ResourceActivityModel,
|
|
12154
12275
|
ResourceImageTypeSchema,
|
|
12276
|
+
SchoolModel,
|
|
12155
12277
|
SocialMediaTypeSchema,
|
|
12156
12278
|
StallTypeSchema,
|
|
12157
12279
|
UserModel,
|