@timardex/cluemart-server-shared 1.0.131 → 1.0.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6WUH4RWX.mjs → chunk-JDM7WL6D.mjs} +277 -131
- package/dist/chunk-JDM7WL6D.mjs.map +1 -0
- package/dist/index.cjs +283 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +102 -61
- package/dist/index.d.ts +102 -61
- package/dist/index.mjs +281 -135
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +277 -129
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +102 -61
- package/dist/mongoose/index.d.ts +102 -61
- package/dist/mongoose/index.mjs +5 -1
- package/dist/service/index.cjs +275 -131
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-6WUH4RWX.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1679,6 +1679,7 @@ __export(index_exports, {
|
|
|
1679
1679
|
CategorySchema: () => CategorySchema,
|
|
1680
1680
|
ChatModel: () => ChatModel,
|
|
1681
1681
|
ChatReportModel: () => ChatReportModel,
|
|
1682
|
+
ContactDetailsSchema: () => ContactDetailsSchema,
|
|
1682
1683
|
EnumPubSubEvents: () => EnumPubSubEvents,
|
|
1683
1684
|
EventInfoModel: () => EventInfoModel,
|
|
1684
1685
|
EventModel: () => EventModel,
|
|
@@ -1694,6 +1695,7 @@ __export(index_exports, {
|
|
|
1694
1695
|
RelationTypeSchema: () => RelationTypeSchema,
|
|
1695
1696
|
ResourceActivityModel: () => ResourceActivityModel,
|
|
1696
1697
|
ResourceImageTypeSchema: () => ResourceImageTypeSchema,
|
|
1698
|
+
SchoolModel: () => SchoolModel,
|
|
1697
1699
|
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
1698
1700
|
StallTypeSchema: () => StallTypeSchema,
|
|
1699
1701
|
UserModel: () => UserModel,
|
|
@@ -1709,7 +1711,7 @@ __export(index_exports, {
|
|
|
1709
1711
|
findEventOrImportedMarketById: () => findEventOrImportedMarketById,
|
|
1710
1712
|
locationGeoSchema: () => locationGeoSchema,
|
|
1711
1713
|
locationsSchema: () => locationsSchema,
|
|
1712
|
-
mongoose: () =>
|
|
1714
|
+
mongoose: () => import_mongoose26.default,
|
|
1713
1715
|
refundPolicySchema: () => refundPolicySchema,
|
|
1714
1716
|
relationDatesSchema: () => relationDatesSchema,
|
|
1715
1717
|
resourceRelationsSchema: () => resourceRelationsSchema,
|
|
@@ -4735,10 +4737,10 @@ var Condition = class _Condition {
|
|
|
4735
4737
|
otherwise
|
|
4736
4738
|
} = config;
|
|
4737
4739
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4738
|
-
return new _Condition(refs, (values,
|
|
4740
|
+
return new _Condition(refs, (values, schema16) => {
|
|
4739
4741
|
var _branch;
|
|
4740
4742
|
let branch = check(...values) ? then : otherwise;
|
|
4741
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4743
|
+
return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
|
|
4742
4744
|
});
|
|
4743
4745
|
}
|
|
4744
4746
|
constructor(refs, builder) {
|
|
@@ -4752,13 +4754,13 @@ var Condition = class _Condition {
|
|
|
4752
4754
|
// TODO: ? operator here?
|
|
4753
4755
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4754
4756
|
));
|
|
4755
|
-
let
|
|
4756
|
-
if (
|
|
4757
|
-
|
|
4757
|
+
let schema16 = this.fn(values, base, options);
|
|
4758
|
+
if (schema16 === void 0 || // @ts-ignore this can be base
|
|
4759
|
+
schema16 === base) {
|
|
4758
4760
|
return base;
|
|
4759
4761
|
}
|
|
4760
|
-
if (!isSchema(
|
|
4761
|
-
return
|
|
4762
|
+
if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
|
|
4763
|
+
return schema16.resolve(options);
|
|
4762
4764
|
}
|
|
4763
4765
|
};
|
|
4764
4766
|
var prefixes = {
|
|
@@ -4828,7 +4830,7 @@ function createValidation(config) {
|
|
|
4828
4830
|
path = "",
|
|
4829
4831
|
options,
|
|
4830
4832
|
originalValue,
|
|
4831
|
-
schema:
|
|
4833
|
+
schema: schema16
|
|
4832
4834
|
}, panic, next) {
|
|
4833
4835
|
const {
|
|
4834
4836
|
name,
|
|
@@ -4840,8 +4842,8 @@ function createValidation(config) {
|
|
|
4840
4842
|
let {
|
|
4841
4843
|
parent,
|
|
4842
4844
|
context,
|
|
4843
|
-
abortEarly =
|
|
4844
|
-
disableStackTrace =
|
|
4845
|
+
abortEarly = schema16.spec.abortEarly,
|
|
4846
|
+
disableStackTrace = schema16.spec.disableStackTrace
|
|
4845
4847
|
} = options;
|
|
4846
4848
|
function resolve(item) {
|
|
4847
4849
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4850,9 +4852,9 @@ function createValidation(config) {
|
|
|
4850
4852
|
const nextParams = Object.assign({
|
|
4851
4853
|
value,
|
|
4852
4854
|
originalValue,
|
|
4853
|
-
label:
|
|
4855
|
+
label: schema16.spec.label,
|
|
4854
4856
|
path: overrides.path || path,
|
|
4855
|
-
spec:
|
|
4857
|
+
spec: schema16.spec,
|
|
4856
4858
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4857
4859
|
}, params, overrides.params);
|
|
4858
4860
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4870,7 +4872,7 @@ function createValidation(config) {
|
|
|
4870
4872
|
resolve,
|
|
4871
4873
|
options,
|
|
4872
4874
|
originalValue,
|
|
4873
|
-
schema:
|
|
4875
|
+
schema: schema16
|
|
4874
4876
|
};
|
|
4875
4877
|
const handleResult = (validOrError) => {
|
|
4876
4878
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4904,42 +4906,42 @@ function createValidation(config) {
|
|
|
4904
4906
|
validate.OPTIONS = config;
|
|
4905
4907
|
return validate;
|
|
4906
4908
|
}
|
|
4907
|
-
function getIn(
|
|
4909
|
+
function getIn(schema16, path, value, context = value) {
|
|
4908
4910
|
let parent, lastPart, lastPartDebug;
|
|
4909
4911
|
if (!path) return {
|
|
4910
4912
|
parent,
|
|
4911
4913
|
parentPath: path,
|
|
4912
|
-
schema:
|
|
4914
|
+
schema: schema16
|
|
4913
4915
|
};
|
|
4914
4916
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4915
4917
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4916
|
-
|
|
4918
|
+
schema16 = schema16.resolve({
|
|
4917
4919
|
context,
|
|
4918
4920
|
parent,
|
|
4919
4921
|
value
|
|
4920
4922
|
});
|
|
4921
|
-
let isTuple =
|
|
4923
|
+
let isTuple = schema16.type === "tuple";
|
|
4922
4924
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4923
|
-
if (
|
|
4925
|
+
if (schema16.innerType || isTuple) {
|
|
4924
4926
|
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]"`);
|
|
4925
4927
|
if (value && idx >= value.length) {
|
|
4926
4928
|
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. `);
|
|
4927
4929
|
}
|
|
4928
4930
|
parent = value;
|
|
4929
4931
|
value = value && value[idx];
|
|
4930
|
-
|
|
4932
|
+
schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
|
|
4931
4933
|
}
|
|
4932
4934
|
if (!isArray) {
|
|
4933
|
-
if (!
|
|
4935
|
+
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}")`);
|
|
4934
4936
|
parent = value;
|
|
4935
4937
|
value = value && value[part];
|
|
4936
|
-
|
|
4938
|
+
schema16 = schema16.fields[part];
|
|
4937
4939
|
}
|
|
4938
4940
|
lastPart = part;
|
|
4939
4941
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4940
4942
|
});
|
|
4941
4943
|
return {
|
|
4942
|
-
schema:
|
|
4944
|
+
schema: schema16,
|
|
4943
4945
|
parent,
|
|
4944
4946
|
parentPath: lastPart
|
|
4945
4947
|
};
|
|
@@ -5076,20 +5078,20 @@ var Schema = class {
|
|
|
5076
5078
|
this._mutate = before;
|
|
5077
5079
|
return result;
|
|
5078
5080
|
}
|
|
5079
|
-
concat(
|
|
5080
|
-
if (!
|
|
5081
|
-
if (
|
|
5081
|
+
concat(schema16) {
|
|
5082
|
+
if (!schema16 || schema16 === this) return this;
|
|
5083
|
+
if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
|
|
5082
5084
|
let base = this;
|
|
5083
|
-
let combined =
|
|
5085
|
+
let combined = schema16.clone();
|
|
5084
5086
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5085
5087
|
combined.spec = mergedSpec;
|
|
5086
5088
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5087
|
-
combined._whitelist = base._whitelist.merge(
|
|
5088
|
-
combined._blacklist = base._blacklist.merge(
|
|
5089
|
+
combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
|
|
5090
|
+
combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
|
|
5089
5091
|
combined.tests = base.tests;
|
|
5090
5092
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5091
5093
|
combined.withMutation((next) => {
|
|
5092
|
-
|
|
5094
|
+
schema16.tests.forEach((fn) => {
|
|
5093
5095
|
next.test(fn.OPTIONS);
|
|
5094
5096
|
});
|
|
5095
5097
|
});
|
|
@@ -5105,15 +5107,15 @@ var Schema = class {
|
|
|
5105
5107
|
return this._typeCheck(v);
|
|
5106
5108
|
}
|
|
5107
5109
|
resolve(options) {
|
|
5108
|
-
let
|
|
5109
|
-
if (
|
|
5110
|
-
let conditions =
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5110
|
+
let schema16 = this;
|
|
5111
|
+
if (schema16.conditions.length) {
|
|
5112
|
+
let conditions = schema16.conditions;
|
|
5113
|
+
schema16 = schema16.clone();
|
|
5114
|
+
schema16.conditions = [];
|
|
5115
|
+
schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
|
|
5116
|
+
schema16 = schema16.resolve(options);
|
|
5115
5117
|
}
|
|
5116
|
-
return
|
|
5118
|
+
return schema16;
|
|
5117
5119
|
}
|
|
5118
5120
|
resolveOptions(options) {
|
|
5119
5121
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5267,11 +5269,11 @@ attempted value: ${formattedValue}
|
|
|
5267
5269
|
}
|
|
5268
5270
|
validate(value, options) {
|
|
5269
5271
|
var _options$disableStack2;
|
|
5270
|
-
let
|
|
5272
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5271
5273
|
value
|
|
5272
5274
|
}));
|
|
5273
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5274
|
-
return new Promise((resolve, reject) =>
|
|
5275
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
|
|
5276
|
+
return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
|
|
5275
5277
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5276
5278
|
reject(error);
|
|
5277
5279
|
}, (errors, validated) => {
|
|
@@ -5281,12 +5283,12 @@ attempted value: ${formattedValue}
|
|
|
5281
5283
|
}
|
|
5282
5284
|
validateSync(value, options) {
|
|
5283
5285
|
var _options$disableStack3;
|
|
5284
|
-
let
|
|
5286
|
+
let schema16 = this.resolve(Object.assign({}, options, {
|
|
5285
5287
|
value
|
|
5286
5288
|
}));
|
|
5287
5289
|
let result;
|
|
5288
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5289
|
-
|
|
5290
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
|
|
5291
|
+
schema16._validate(value, Object.assign({}, options, {
|
|
5290
5292
|
sync: true
|
|
5291
5293
|
}), (error, parsed) => {
|
|
5292
5294
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5320,8 +5322,8 @@ attempted value: ${formattedValue}
|
|
|
5320
5322
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5321
5323
|
}
|
|
5322
5324
|
getDefault(options) {
|
|
5323
|
-
let
|
|
5324
|
-
return
|
|
5325
|
+
let schema16 = this.resolve(options || {});
|
|
5326
|
+
return schema16._getDefault(options);
|
|
5325
5327
|
}
|
|
5326
5328
|
default(def) {
|
|
5327
5329
|
if (arguments.length === 0) {
|
|
@@ -5556,9 +5558,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5556
5558
|
const {
|
|
5557
5559
|
parent,
|
|
5558
5560
|
parentPath,
|
|
5559
|
-
schema:
|
|
5561
|
+
schema: schema16
|
|
5560
5562
|
} = getIn(this, path, value, options.context);
|
|
5561
|
-
return
|
|
5563
|
+
return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5562
5564
|
parent,
|
|
5563
5565
|
path
|
|
5564
5566
|
}));
|
|
@@ -5732,7 +5734,7 @@ var StringSchema = class extends Schema {
|
|
|
5732
5734
|
});
|
|
5733
5735
|
}
|
|
5734
5736
|
required(message) {
|
|
5735
|
-
return super.required(message).withMutation((
|
|
5737
|
+
return super.required(message).withMutation((schema16) => schema16.test({
|
|
5736
5738
|
message: message || mixed.required,
|
|
5737
5739
|
name: "required",
|
|
5738
5740
|
skipAbsent: true,
|
|
@@ -5740,9 +5742,9 @@ var StringSchema = class extends Schema {
|
|
|
5740
5742
|
}));
|
|
5741
5743
|
}
|
|
5742
5744
|
notRequired() {
|
|
5743
|
-
return super.notRequired().withMutation((
|
|
5744
|
-
|
|
5745
|
-
return
|
|
5745
|
+
return super.notRequired().withMutation((schema16) => {
|
|
5746
|
+
schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5747
|
+
return schema16;
|
|
5746
5748
|
});
|
|
5747
5749
|
}
|
|
5748
5750
|
length(length, message = string.length) {
|
|
@@ -6131,28 +6133,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6131
6133
|
}
|
|
6132
6134
|
return ctx.isType(parsed) ? parsed : value;
|
|
6133
6135
|
};
|
|
6134
|
-
function deepPartial(
|
|
6135
|
-
if ("fields" in
|
|
6136
|
+
function deepPartial(schema16) {
|
|
6137
|
+
if ("fields" in schema16) {
|
|
6136
6138
|
const partial = {};
|
|
6137
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6139
|
+
for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
|
|
6138
6140
|
partial[key] = deepPartial(fieldSchema);
|
|
6139
6141
|
}
|
|
6140
|
-
return
|
|
6142
|
+
return schema16.setFields(partial);
|
|
6141
6143
|
}
|
|
6142
|
-
if (
|
|
6143
|
-
const nextArray =
|
|
6144
|
+
if (schema16.type === "array") {
|
|
6145
|
+
const nextArray = schema16.optional();
|
|
6144
6146
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6145
6147
|
return nextArray;
|
|
6146
6148
|
}
|
|
6147
|
-
if (
|
|
6148
|
-
return
|
|
6149
|
-
types:
|
|
6149
|
+
if (schema16.type === "tuple") {
|
|
6150
|
+
return schema16.optional().clone({
|
|
6151
|
+
types: schema16.spec.types.map(deepPartial)
|
|
6150
6152
|
});
|
|
6151
6153
|
}
|
|
6152
|
-
if ("optional" in
|
|
6153
|
-
return
|
|
6154
|
+
if ("optional" in schema16) {
|
|
6155
|
+
return schema16.optional();
|
|
6154
6156
|
}
|
|
6155
|
-
return
|
|
6157
|
+
return schema16;
|
|
6156
6158
|
}
|
|
6157
6159
|
var deepHas = (obj, p) => {
|
|
6158
6160
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6286,8 +6288,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6286
6288
|
next._sortErrors = this._sortErrors;
|
|
6287
6289
|
return next;
|
|
6288
6290
|
}
|
|
6289
|
-
concat(
|
|
6290
|
-
let next = super.concat(
|
|
6291
|
+
concat(schema16) {
|
|
6292
|
+
let next = super.concat(schema16);
|
|
6291
6293
|
let nextFields = next.fields;
|
|
6292
6294
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6293
6295
|
const target = nextFields[field];
|
|
@@ -6295,7 +6297,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6295
6297
|
}
|
|
6296
6298
|
return next.withMutation((s) => (
|
|
6297
6299
|
// XXX: excludes here is wrong
|
|
6298
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6300
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
|
|
6299
6301
|
));
|
|
6300
6302
|
}
|
|
6301
6303
|
_getDefault(options) {
|
|
@@ -6340,8 +6342,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6340
6342
|
}
|
|
6341
6343
|
partial() {
|
|
6342
6344
|
const partial = {};
|
|
6343
|
-
for (const [key,
|
|
6344
|
-
partial[key] = "optional" in
|
|
6345
|
+
for (const [key, schema16] of Object.entries(this.fields)) {
|
|
6346
|
+
partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
|
|
6345
6347
|
}
|
|
6346
6348
|
return this.setFields(partial);
|
|
6347
6349
|
}
|
|
@@ -6539,22 +6541,22 @@ var ArraySchema = class extends Schema {
|
|
|
6539
6541
|
json() {
|
|
6540
6542
|
return this.transform(parseJson);
|
|
6541
6543
|
}
|
|
6542
|
-
concat(
|
|
6543
|
-
let next = super.concat(
|
|
6544
|
+
concat(schema16) {
|
|
6545
|
+
let next = super.concat(schema16);
|
|
6544
6546
|
next.innerType = this.innerType;
|
|
6545
|
-
if (
|
|
6547
|
+
if (schema16.innerType)
|
|
6546
6548
|
next.innerType = next.innerType ? (
|
|
6547
6549
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6548
|
-
next.innerType.concat(
|
|
6549
|
-
) :
|
|
6550
|
+
next.innerType.concat(schema16.innerType)
|
|
6551
|
+
) : schema16.innerType;
|
|
6550
6552
|
return next;
|
|
6551
6553
|
}
|
|
6552
|
-
of(
|
|
6554
|
+
of(schema16) {
|
|
6553
6555
|
let next = this.clone();
|
|
6554
|
-
if (!isSchema(
|
|
6555
|
-
next.innerType =
|
|
6556
|
+
if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
|
|
6557
|
+
next.innerType = schema16;
|
|
6556
6558
|
next.spec = Object.assign({}, next.spec, {
|
|
6557
|
-
types:
|
|
6559
|
+
types: schema16
|
|
6558
6560
|
});
|
|
6559
6561
|
return next;
|
|
6560
6562
|
}
|
|
@@ -6698,7 +6700,7 @@ var TupleSchema = class extends Schema {
|
|
|
6698
6700
|
describe(options) {
|
|
6699
6701
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6700
6702
|
const base = super.describe(options);
|
|
6701
|
-
base.innerType = next.spec.types.map((
|
|
6703
|
+
base.innerType = next.spec.types.map((schema16, index) => {
|
|
6702
6704
|
var _innerOptions;
|
|
6703
6705
|
let innerOptions = options;
|
|
6704
6706
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6707,7 +6709,7 @@ var TupleSchema = class extends Schema {
|
|
|
6707
6709
|
value: innerOptions.value[index]
|
|
6708
6710
|
});
|
|
6709
6711
|
}
|
|
6710
|
-
return
|
|
6712
|
+
return schema16.describe(innerOptions);
|
|
6711
6713
|
});
|
|
6712
6714
|
return base;
|
|
6713
6715
|
}
|
|
@@ -6724,6 +6726,7 @@ var import_react2 = __toESM(require_react(), 1);
|
|
|
6724
6726
|
var React8 = __toESM(require_react(), 1);
|
|
6725
6727
|
var import_react3 = __toESM(require_react(), 1);
|
|
6726
6728
|
var import_react4 = __toESM(require_react(), 1);
|
|
6729
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
6727
6730
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus22) => {
|
|
6728
6731
|
EnumInviteStatus22["ACCEPTED"] = "Accepted";
|
|
6729
6732
|
EnumInviteStatus22["COMPLETED"] = "Completed";
|
|
@@ -6813,9 +6816,13 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
6813
6816
|
EnumNotificationResourceType22["DEACTIVATED_EVENT"] = "deactivated_event";
|
|
6814
6817
|
EnumNotificationResourceType22["DEACTIVATED_PARTNER"] = "deactivated_partner";
|
|
6815
6818
|
EnumNotificationResourceType22["DEACTIVATED_VENDOR"] = "deactivated_vendor";
|
|
6819
|
+
EnumNotificationResourceType22["DOWNGRADED_EVENT"] = "downgraded_event";
|
|
6820
|
+
EnumNotificationResourceType22["DOWNGRADED_PARTNER"] = "downgraded_partner";
|
|
6821
|
+
EnumNotificationResourceType22["DOWNGRADED_VENDOR"] = "downgraded_vendor";
|
|
6816
6822
|
EnumNotificationResourceType22["DECLINED_EVENT"] = "declined_event";
|
|
6817
6823
|
EnumNotificationResourceType22["DECLINED_PARTNER"] = "declined_partner";
|
|
6818
6824
|
EnumNotificationResourceType22["DECLINED_VENDOR"] = "declined_vendor";
|
|
6825
|
+
EnumNotificationResourceType22["DAILY_CLUE_LETTER_AVAILABLE"] = "daily_clue_letter_available";
|
|
6819
6826
|
EnumNotificationResourceType22["EVENT_INVITE_VENDOR"] = "event_invite_vendor";
|
|
6820
6827
|
EnumNotificationResourceType22["EVENT_STARTING_SOON"] = "event_starting_soon";
|
|
6821
6828
|
EnumNotificationResourceType22["EXPIRATION_REMINDER_EVENT"] = "expiration_reminder_event";
|
|
@@ -6827,11 +6834,11 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
6827
6834
|
return EnumNotificationResourceType22;
|
|
6828
6835
|
})(EnumNotificationResourceType || {});
|
|
6829
6836
|
var EnumNotificationType = /* @__PURE__ */ ((EnumNotificationType22) => {
|
|
6837
|
+
EnumNotificationType22["CHAT"] = "chat";
|
|
6830
6838
|
EnumNotificationType22["EVENT"] = "event";
|
|
6831
|
-
EnumNotificationType22["VENDOR"] = "vendor";
|
|
6832
6839
|
EnumNotificationType22["RELATION"] = "relation";
|
|
6833
|
-
EnumNotificationType22["CHAT"] = "chat";
|
|
6834
6840
|
EnumNotificationType22["SYSTEM"] = "system";
|
|
6841
|
+
EnumNotificationType22["VENDOR"] = "vendor";
|
|
6835
6842
|
return EnumNotificationType22;
|
|
6836
6843
|
})(EnumNotificationType || {});
|
|
6837
6844
|
var EnumRegions = /* @__PURE__ */ ((EnumRegions22) => {
|
|
@@ -6899,6 +6906,17 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
|
|
|
6899
6906
|
EnumSubscriptionStatus22["TRIALING"] = "trialing";
|
|
6900
6907
|
return EnumSubscriptionStatus22;
|
|
6901
6908
|
})(EnumSubscriptionStatus || {});
|
|
6909
|
+
var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
|
|
6910
|
+
EnumGameType2["DAILY_CLUE"] = "dailyClue";
|
|
6911
|
+
return EnumGameType2;
|
|
6912
|
+
})(EnumGameType || {});
|
|
6913
|
+
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus3) => {
|
|
6914
|
+
EnumGameStatus3["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
6915
|
+
EnumGameStatus3["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
|
|
6916
|
+
EnumGameStatus3["GAME_LEFT"] = "GAME_LEFT";
|
|
6917
|
+
EnumGameStatus3["GAME_STARTED"] = "GAME_STARTED";
|
|
6918
|
+
return EnumGameStatus3;
|
|
6919
|
+
})(EnumGameStatus || {});
|
|
6902
6920
|
var dateFormat = "DD-MM-YYYY";
|
|
6903
6921
|
var timeFormat = "HH:mm";
|
|
6904
6922
|
import_dayjs.default.extend(import_customParseFormat.default);
|
|
@@ -8333,6 +8351,7 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8333
8351
|
promoCodes
|
|
8334
8352
|
refreshToken
|
|
8335
8353
|
role
|
|
8354
|
+
school
|
|
8336
8355
|
termsAgreement {
|
|
8337
8356
|
...TermsAgreementFields
|
|
8338
8357
|
}
|
|
@@ -9934,46 +9953,63 @@ var GAME_HISTORY_FIELDS_FRAGMENT = gql`
|
|
|
9934
9953
|
}
|
|
9935
9954
|
${GAME_DATE_FIELDS_FRAGMENT}
|
|
9936
9955
|
`;
|
|
9956
|
+
var GAME_DATA_FIELDS_FRAGMENT = gql`
|
|
9957
|
+
fragment GameDataFields on GameDataType {
|
|
9958
|
+
dailyClue {
|
|
9959
|
+
...DailyClueGameDataFields
|
|
9960
|
+
}
|
|
9961
|
+
}
|
|
9962
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
9963
|
+
`;
|
|
9937
9964
|
var GAME_FIELDS_FRAGMENT = gql`
|
|
9938
9965
|
fragment GameFields on GameType {
|
|
9939
|
-
_id
|
|
9940
9966
|
active
|
|
9941
9967
|
createdAt
|
|
9942
|
-
deletedAt
|
|
9943
9968
|
gameData {
|
|
9944
|
-
|
|
9945
|
-
...DailyClueGameDataFields
|
|
9946
|
-
}
|
|
9969
|
+
...GameDataFields
|
|
9947
9970
|
}
|
|
9948
9971
|
gameHistory {
|
|
9949
9972
|
...GameHistoryFields
|
|
9950
9973
|
}
|
|
9974
|
+
gameType
|
|
9951
9975
|
updatedAt
|
|
9976
|
+
}
|
|
9977
|
+
${GAME_DATA_FIELDS_FRAGMENT}
|
|
9978
|
+
${GAME_HISTORY_FIELDS_FRAGMENT}
|
|
9979
|
+
`;
|
|
9980
|
+
var GAME_DOC_FIELDS_FRAGMENT = gql`
|
|
9981
|
+
fragment GameDocFields on GameDocType {
|
|
9982
|
+
_id
|
|
9983
|
+
active
|
|
9984
|
+
createdAt
|
|
9985
|
+
deletedAt
|
|
9986
|
+
games {
|
|
9987
|
+
...GameFields
|
|
9988
|
+
}
|
|
9952
9989
|
owner {
|
|
9953
9990
|
...OwnerFields
|
|
9954
9991
|
}
|
|
9955
9992
|
points
|
|
9993
|
+
updatedAt
|
|
9956
9994
|
}
|
|
9957
|
-
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
9958
9995
|
${OWNER_FIELDS_FRAGMENT}
|
|
9959
|
-
${
|
|
9960
|
-
${GAME_HISTORY_FIELDS_FRAGMENT}
|
|
9996
|
+
${GAME_FIELDS_FRAGMENT}
|
|
9961
9997
|
`;
|
|
9962
9998
|
var GET_GAMES = gql`
|
|
9963
9999
|
query getGames {
|
|
9964
10000
|
games {
|
|
9965
|
-
...
|
|
10001
|
+
...GameDocFields
|
|
9966
10002
|
}
|
|
9967
10003
|
}
|
|
9968
|
-
${
|
|
10004
|
+
${GAME_DOC_FIELDS_FRAGMENT}
|
|
9969
10005
|
`;
|
|
9970
10006
|
var GET_GAME = gql`
|
|
9971
10007
|
query getGame($_id: ID!) {
|
|
9972
10008
|
game(_id: $_id) {
|
|
9973
|
-
...
|
|
10009
|
+
...GameDocFields
|
|
9974
10010
|
}
|
|
9975
10011
|
}
|
|
9976
|
-
${
|
|
10012
|
+
${GAME_DOC_FIELDS_FRAGMENT}
|
|
9977
10013
|
`;
|
|
9978
10014
|
var GET_GAME_LEADERBOARD = gql`
|
|
9979
10015
|
query getGameLeaderboard {
|
|
@@ -10136,10 +10172,10 @@ var GET_APP_SETTINGS = gql`
|
|
|
10136
10172
|
var START_GAME_MUTATION = gql`
|
|
10137
10173
|
mutation startGame($input: BaseGameInputType!) {
|
|
10138
10174
|
startGame(input: $input) {
|
|
10139
|
-
...
|
|
10175
|
+
...GameDocFields
|
|
10140
10176
|
}
|
|
10141
10177
|
}
|
|
10142
|
-
${
|
|
10178
|
+
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10143
10179
|
`;
|
|
10144
10180
|
var LEAVE_GAME_MUTATION = gql`
|
|
10145
10181
|
mutation leaveGame($_id: ID!, $gameType: GameTypeEnumType!) {
|
|
@@ -10149,10 +10185,79 @@ var LEAVE_GAME_MUTATION = gql`
|
|
|
10149
10185
|
var UPDATE_DAILY_CLUE_MUTATION = gql`
|
|
10150
10186
|
mutation updateDailyClueGame($_id: ID!, $foundLetter: String!) {
|
|
10151
10187
|
updateDailyClueGame(_id: $_id, foundLetter: $foundLetter) {
|
|
10152
|
-
...
|
|
10188
|
+
...GameDocFields
|
|
10153
10189
|
}
|
|
10154
10190
|
}
|
|
10155
|
-
${
|
|
10191
|
+
${GAME_DOC_FIELDS_FRAGMENT}
|
|
10192
|
+
`;
|
|
10193
|
+
var SCHOOL = gql`
|
|
10194
|
+
fragment SchoolFields on SchoolType {
|
|
10195
|
+
_id
|
|
10196
|
+
active
|
|
10197
|
+
contactDetails {
|
|
10198
|
+
...ContactDetailsFields
|
|
10199
|
+
}
|
|
10200
|
+
location {
|
|
10201
|
+
...LocationFields
|
|
10202
|
+
}
|
|
10203
|
+
createdAt
|
|
10204
|
+
deletedAt
|
|
10205
|
+
logo {
|
|
10206
|
+
...ResourceImageFields
|
|
10207
|
+
}
|
|
10208
|
+
name
|
|
10209
|
+
owner {
|
|
10210
|
+
...OwnerFields
|
|
10211
|
+
}
|
|
10212
|
+
region
|
|
10213
|
+
studentCount
|
|
10214
|
+
termsAgreement {
|
|
10215
|
+
...TermsAgreementFields
|
|
10216
|
+
}
|
|
10217
|
+
updatedAt
|
|
10218
|
+
}
|
|
10219
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10220
|
+
${LOCATION_FIELDS_FRAGMENT}
|
|
10221
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
10222
|
+
${CONTACT_DETAILS_FIELDS_FRAGMENT}
|
|
10223
|
+
${TERMS_AGREEMENT_FIELDS_FRAGMENT}
|
|
10224
|
+
`;
|
|
10225
|
+
var GET_SCHOOL = gql`
|
|
10226
|
+
query getSchool($_id: ID!) {
|
|
10227
|
+
school(_id: $_id) {
|
|
10228
|
+
...SchoolFields
|
|
10229
|
+
}
|
|
10230
|
+
}
|
|
10231
|
+
${SCHOOL}
|
|
10232
|
+
`;
|
|
10233
|
+
var GET_SCHOOLS = gql`
|
|
10234
|
+
query getSchools {
|
|
10235
|
+
schools {
|
|
10236
|
+
...SchoolFields
|
|
10237
|
+
}
|
|
10238
|
+
}
|
|
10239
|
+
${SCHOOL}
|
|
10240
|
+
`;
|
|
10241
|
+
var CREATE_SCHOOL_MUTATION = gql`
|
|
10242
|
+
mutation createSchool($input: SchoolInputType!) {
|
|
10243
|
+
createSchool(input: $input) {
|
|
10244
|
+
...SchoolFields
|
|
10245
|
+
}
|
|
10246
|
+
}
|
|
10247
|
+
${SCHOOL}
|
|
10248
|
+
`;
|
|
10249
|
+
var UPDATE_SCHOOL_MUTATION = gql`
|
|
10250
|
+
mutation updateSchool($_id: ID!, $input: SchoolInputType!) {
|
|
10251
|
+
updateSchool(_id: $_id, input: $input) {
|
|
10252
|
+
...SchoolFields
|
|
10253
|
+
}
|
|
10254
|
+
}
|
|
10255
|
+
${SCHOOL}
|
|
10256
|
+
`;
|
|
10257
|
+
var DELETE_SCHOOL_MUTATION = gql`
|
|
10258
|
+
mutation deleteSchool($_id: ID!) {
|
|
10259
|
+
deleteSchool(_id: $_id)
|
|
10260
|
+
}
|
|
10156
10261
|
`;
|
|
10157
10262
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10158
10263
|
var nzbnRegex = /^94\d{11}$/;
|
|
@@ -10305,7 +10410,7 @@ var socialMediaSchema = create$3({
|
|
|
10305
10410
|
is: (name) => !!name,
|
|
10306
10411
|
// If name has a value
|
|
10307
10412
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10308
|
-
otherwise: (
|
|
10413
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10309
10414
|
})
|
|
10310
10415
|
});
|
|
10311
10416
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10381,21 +10486,21 @@ var paymentInfoSchema = create$3({
|
|
|
10381
10486
|
).required("Please select a Payment method"),
|
|
10382
10487
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10383
10488
|
is: "bank_transfer",
|
|
10384
|
-
then: (
|
|
10385
|
-
otherwise: (
|
|
10489
|
+
then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
|
|
10490
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10386
10491
|
}),
|
|
10387
10492
|
accountNumber: create$6().when("paymentMethod", {
|
|
10388
10493
|
is: "bank_transfer",
|
|
10389
|
-
then: (
|
|
10494
|
+
then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
|
|
10390
10495
|
nzBankAccountRegex,
|
|
10391
10496
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10392
10497
|
).trim(),
|
|
10393
|
-
otherwise: (
|
|
10498
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10394
10499
|
}),
|
|
10395
10500
|
link: create$6().when("paymentMethod", {
|
|
10396
10501
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10397
10502
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10398
|
-
otherwise: (
|
|
10503
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10399
10504
|
})
|
|
10400
10505
|
});
|
|
10401
10506
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10545,16 +10650,16 @@ var vendorInfoSchema = create$3().shape({
|
|
|
10545
10650
|
var userSchema = create$3().shape({
|
|
10546
10651
|
active: create$7().required("Active is required"),
|
|
10547
10652
|
email: emailRequiredSchema,
|
|
10548
|
-
firstName: create$6().label("First Name").required("First name is required"),
|
|
10549
|
-
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10653
|
+
firstName: create$6().label("First Name").trim().required("First name is required"),
|
|
10654
|
+
lastName: create$6().label("Last Name").trim().required("Last name is required"),
|
|
10550
10655
|
isTester: create$7().required("Tester status is required"),
|
|
10551
10656
|
password: create$6().nullable().trim().label("Password").min(8, "Password must be at least 8 characters long").notRequired(),
|
|
10552
10657
|
preferredRegion: create$6().label("Preferred Region").required("Preferred region is required"),
|
|
10553
10658
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10554
10659
|
is: (val) => !!val,
|
|
10555
10660
|
// only necessary if password typed
|
|
10556
|
-
then: (
|
|
10557
|
-
otherwise: (
|
|
10661
|
+
then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10662
|
+
otherwise: (schema16) => schema16.notRequired()
|
|
10558
10663
|
}),
|
|
10559
10664
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10560
10665
|
});
|
|
@@ -10625,7 +10730,7 @@ var adSchema = create$3().shape({
|
|
|
10625
10730
|
return endDate > now;
|
|
10626
10731
|
}).when("start", {
|
|
10627
10732
|
is: (val) => val && val.length > 0,
|
|
10628
|
-
then: (
|
|
10733
|
+
then: (schema16) => schema16.test(
|
|
10629
10734
|
"is-after-start",
|
|
10630
10735
|
"End date must be after start date",
|
|
10631
10736
|
function(value) {
|
|
@@ -10769,6 +10874,14 @@ var contactUsSchema = create$3().shape({
|
|
|
10769
10874
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
10770
10875
|
message: create$6().label("Message").required("Message is required")
|
|
10771
10876
|
});
|
|
10877
|
+
var schoolSchema = create$3().shape({
|
|
10878
|
+
active: create$7().required("Active is required"),
|
|
10879
|
+
contactDetails: contactDetailsSchema,
|
|
10880
|
+
location: locationSchema,
|
|
10881
|
+
name: create$6().trim().required("Name is required"),
|
|
10882
|
+
region: create$6().trim().required("Region is required"),
|
|
10883
|
+
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"))
|
|
10884
|
+
});
|
|
10772
10885
|
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
10773
10886
|
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
10774
10887
|
EnumActivity2["GOING"] = "GOING";
|
|
@@ -10777,16 +10890,6 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
10777
10890
|
EnumActivity2["VIEW"] = "VIEW";
|
|
10778
10891
|
return EnumActivity2;
|
|
10779
10892
|
})(EnumActivity || {});
|
|
10780
|
-
var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
|
|
10781
|
-
EnumGameType2["DAILY_CLUE"] = "dailyClue";
|
|
10782
|
-
return EnumGameType2;
|
|
10783
|
-
})(EnumGameType || {});
|
|
10784
|
-
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
|
|
10785
|
-
EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
10786
|
-
EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
|
|
10787
|
-
EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
|
|
10788
|
-
return EnumGameStatus2;
|
|
10789
|
-
})(EnumGameStatus || {});
|
|
10790
10893
|
|
|
10791
10894
|
// src/mongoose/Ad.ts
|
|
10792
10895
|
var import_mongoose = __toESM(require("mongoose"));
|
|
@@ -11346,27 +11449,27 @@ var baseResourceFields = {
|
|
|
11346
11449
|
required: false,
|
|
11347
11450
|
type: [associatesSchema]
|
|
11348
11451
|
},
|
|
11349
|
-
contactDetails: ContactDetailsSchema,
|
|
11452
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
11350
11453
|
cover: {
|
|
11351
11454
|
required: true,
|
|
11352
11455
|
type: ResourceImageTypeSchema
|
|
11353
11456
|
},
|
|
11354
11457
|
deletedAt: { default: null, required: false, type: Date },
|
|
11355
11458
|
description: { required: true, type: String },
|
|
11356
|
-
images: [ResourceImageTypeSchema],
|
|
11357
|
-
logo: ResourceImageTypeSchema,
|
|
11459
|
+
images: { required: false, type: [ResourceImageTypeSchema] },
|
|
11460
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
11358
11461
|
name: { required: true, type: String },
|
|
11359
11462
|
owner: {
|
|
11360
11463
|
required: false,
|
|
11361
11464
|
type: OwnerTypeSchema
|
|
11362
11465
|
},
|
|
11363
|
-
posterUsage: PosterUsageTypeSchema,
|
|
11466
|
+
posterUsage: { required: false, type: PosterUsageTypeSchema },
|
|
11364
11467
|
promoCodes: { required: false, type: [String] },
|
|
11365
11468
|
rating: { required: false, type: Number },
|
|
11366
11469
|
region: { required: true, type: String },
|
|
11367
11470
|
reviewCount: { required: false, type: Number },
|
|
11368
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
11369
|
-
termsAgreement: termsAgreementSchema
|
|
11471
|
+
socialMedia: { required: false, type: [SocialMediaTypeSchema] },
|
|
11472
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
11370
11473
|
};
|
|
11371
11474
|
|
|
11372
11475
|
// src/mongoose/GoogleImportedMarket.ts
|
|
@@ -11482,7 +11585,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
11482
11585
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
11483
11586
|
var NotificationModel = import_mongoose8.default.models.Notification || import_mongoose8.default.model("Notification", schema4);
|
|
11484
11587
|
|
|
11485
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
11588
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-534WN2SR.mjs
|
|
11486
11589
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
11487
11590
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
11488
11591
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -11679,6 +11782,11 @@ var schema7 = new MongooseSchema11(
|
|
|
11679
11782
|
required: true,
|
|
11680
11783
|
type: String
|
|
11681
11784
|
},
|
|
11785
|
+
school: {
|
|
11786
|
+
ref: "School",
|
|
11787
|
+
required: false,
|
|
11788
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11789
|
+
},
|
|
11682
11790
|
stripe: {
|
|
11683
11791
|
required: false,
|
|
11684
11792
|
type: stripeSchema
|
|
@@ -12069,9 +12177,9 @@ var gameDataSchemas = {
|
|
|
12069
12177
|
[EnumGameType.DAILY_CLUE]: schemaDailyClue
|
|
12070
12178
|
};
|
|
12071
12179
|
var gameDataDefinition = Object.fromEntries(
|
|
12072
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12180
|
+
Object.entries(gameDataSchemas).map(([key, schema16]) => [
|
|
12073
12181
|
key,
|
|
12074
|
-
{ default: null, required: false, type:
|
|
12182
|
+
{ default: null, required: false, type: schema16 }
|
|
12075
12183
|
])
|
|
12076
12184
|
);
|
|
12077
12185
|
var gameHistorySchema = new MongooseSchema19(
|
|
@@ -12091,12 +12199,24 @@ var gameHistorySchema = new MongooseSchema19(
|
|
|
12091
12199
|
},
|
|
12092
12200
|
{ _id: false }
|
|
12093
12201
|
);
|
|
12202
|
+
var gameTypeSchema = new MongooseSchema19(
|
|
12203
|
+
{
|
|
12204
|
+
active: { default: true, required: true, type: Boolean },
|
|
12205
|
+
gameData: gameDataDefinition,
|
|
12206
|
+
gameHistory: { default: [], required: true, type: [gameHistorySchema] },
|
|
12207
|
+
gameType: {
|
|
12208
|
+
enum: Object.values(EnumGameType),
|
|
12209
|
+
required: true,
|
|
12210
|
+
type: String
|
|
12211
|
+
}
|
|
12212
|
+
},
|
|
12213
|
+
{ _id: false, timestamps: true }
|
|
12214
|
+
);
|
|
12094
12215
|
var schema14 = new MongooseSchema19(
|
|
12095
12216
|
{
|
|
12096
12217
|
active: { default: false, required: true, type: Boolean },
|
|
12097
12218
|
deletedAt: { default: null, required: false, type: Date },
|
|
12098
|
-
|
|
12099
|
-
gameHistory: { default: [], required: true, type: [gameHistorySchema] },
|
|
12219
|
+
games: { default: [], required: false, type: [gameTypeSchema] },
|
|
12100
12220
|
owner: {
|
|
12101
12221
|
required: true,
|
|
12102
12222
|
type: OwnerTypeSchema
|
|
@@ -12107,8 +12227,34 @@ var schema14 = new MongooseSchema19(
|
|
|
12107
12227
|
);
|
|
12108
12228
|
var GameModel = import_mongoose19.default.models.Game || import_mongoose19.default.model("Game", schema14);
|
|
12109
12229
|
|
|
12110
|
-
// src/
|
|
12230
|
+
// src/mongoose/School.ts
|
|
12111
12231
|
var import_mongoose20 = __toESM(require("mongoose"));
|
|
12232
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
12233
|
+
var schema15 = new MongooseSchema20(
|
|
12234
|
+
{
|
|
12235
|
+
active: { default: false, required: true, type: Boolean },
|
|
12236
|
+
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
12237
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12238
|
+
location: {
|
|
12239
|
+
required: true,
|
|
12240
|
+
type: locationsSchema
|
|
12241
|
+
},
|
|
12242
|
+
logo: { required: false, type: ResourceImageTypeSchema },
|
|
12243
|
+
name: { required: true, type: String },
|
|
12244
|
+
owner: {
|
|
12245
|
+
required: true,
|
|
12246
|
+
type: OwnerTypeSchema
|
|
12247
|
+
},
|
|
12248
|
+
region: { required: true, type: String },
|
|
12249
|
+
studentCount: { required: true, type: Number },
|
|
12250
|
+
termsAgreement: { required: true, type: termsAgreementSchema }
|
|
12251
|
+
},
|
|
12252
|
+
{ timestamps: true }
|
|
12253
|
+
);
|
|
12254
|
+
var SchoolModel = import_mongoose20.default.models.School || import_mongoose20.default.model("School", schema15);
|
|
12255
|
+
|
|
12256
|
+
// src/service/database.ts
|
|
12257
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12112
12258
|
var connectToDatabase = async ({
|
|
12113
12259
|
appName,
|
|
12114
12260
|
dbName,
|
|
@@ -12121,7 +12267,7 @@ var connectToDatabase = async ({
|
|
|
12121
12267
|
// Fallback to MongoDB Atlas connection string
|
|
12122
12268
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
12123
12269
|
);
|
|
12124
|
-
await
|
|
12270
|
+
await import_mongoose21.default.connect(mongoUri);
|
|
12125
12271
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
12126
12272
|
console.log(
|
|
12127
12273
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12357,12 +12503,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
12357
12503
|
}
|
|
12358
12504
|
|
|
12359
12505
|
// src/service/objectIdToString.ts
|
|
12360
|
-
var
|
|
12506
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
12361
12507
|
function convertObjectIdsToStrings(obj) {
|
|
12362
12508
|
if (obj === null || obj === void 0) {
|
|
12363
12509
|
return obj;
|
|
12364
12510
|
}
|
|
12365
|
-
if (obj instanceof
|
|
12511
|
+
if (obj instanceof import_mongoose24.default.Types.ObjectId) {
|
|
12366
12512
|
return obj.toString();
|
|
12367
12513
|
}
|
|
12368
12514
|
if (Array.isArray(obj)) {
|
|
@@ -12393,7 +12539,7 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
12393
12539
|
|
|
12394
12540
|
// src/types/index.ts
|
|
12395
12541
|
var import_express = __toESM(require("express"));
|
|
12396
|
-
var
|
|
12542
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
12397
12543
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12398
12544
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12399
12545
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12409,6 +12555,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
12409
12555
|
CategorySchema,
|
|
12410
12556
|
ChatModel,
|
|
12411
12557
|
ChatReportModel,
|
|
12558
|
+
ContactDetailsSchema,
|
|
12412
12559
|
EnumPubSubEvents,
|
|
12413
12560
|
EventInfoModel,
|
|
12414
12561
|
EventModel,
|
|
@@ -12424,6 +12571,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
12424
12571
|
RelationTypeSchema,
|
|
12425
12572
|
ResourceActivityModel,
|
|
12426
12573
|
ResourceImageTypeSchema,
|
|
12574
|
+
SchoolModel,
|
|
12427
12575
|
SocialMediaTypeSchema,
|
|
12428
12576
|
StallTypeSchema,
|
|
12429
12577
|
UserModel,
|