@timardex/cluemart-server-shared 1.0.164 → 1.0.165
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-RGSAG3WZ.mjs → chunk-5F477CH2.mjs} +178 -149
- package/dist/chunk-5F477CH2.mjs.map +1 -0
- package/dist/index.cjs +187 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.mjs +185 -156
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +179 -149
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +13 -2
- package/dist/mongoose/index.d.ts +13 -2
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +181 -153
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-RGSAG3WZ.mjs.map +0 -1
package/dist/mongoose/index.cjs
CHANGED
|
@@ -1696,6 +1696,7 @@ __export(mongoose_exports, {
|
|
|
1696
1696
|
SchoolModel: () => SchoolModel,
|
|
1697
1697
|
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
1698
1698
|
StallTypeSchema: () => StallTypeSchema,
|
|
1699
|
+
UnregisteredVendorModel: () => UnregisteredVendorModel,
|
|
1699
1700
|
UserModel: () => UserModel,
|
|
1700
1701
|
VendorInfoModel: () => VendorInfoModel,
|
|
1701
1702
|
VendorModel: () => VendorModel,
|
|
@@ -4726,10 +4727,10 @@ var Condition = class _Condition {
|
|
|
4726
4727
|
otherwise
|
|
4727
4728
|
} = config;
|
|
4728
4729
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4729
|
-
return new _Condition(refs, (values,
|
|
4730
|
+
return new _Condition(refs, (values, schema17) => {
|
|
4730
4731
|
var _branch;
|
|
4731
4732
|
let branch = check(...values) ? then : otherwise;
|
|
4732
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4733
|
+
return (_branch = branch == null ? void 0 : branch(schema17)) != null ? _branch : schema17;
|
|
4733
4734
|
});
|
|
4734
4735
|
}
|
|
4735
4736
|
constructor(refs, builder) {
|
|
@@ -4743,13 +4744,13 @@ var Condition = class _Condition {
|
|
|
4743
4744
|
// TODO: ? operator here?
|
|
4744
4745
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4745
4746
|
));
|
|
4746
|
-
let
|
|
4747
|
-
if (
|
|
4748
|
-
|
|
4747
|
+
let schema17 = this.fn(values, base, options);
|
|
4748
|
+
if (schema17 === void 0 || // @ts-ignore this can be base
|
|
4749
|
+
schema17 === base) {
|
|
4749
4750
|
return base;
|
|
4750
4751
|
}
|
|
4751
|
-
if (!isSchema(
|
|
4752
|
-
return
|
|
4752
|
+
if (!isSchema(schema17)) throw new TypeError("conditions must return a schema object");
|
|
4753
|
+
return schema17.resolve(options);
|
|
4753
4754
|
}
|
|
4754
4755
|
};
|
|
4755
4756
|
var prefixes = {
|
|
@@ -4819,7 +4820,7 @@ function createValidation(config) {
|
|
|
4819
4820
|
path = "",
|
|
4820
4821
|
options,
|
|
4821
4822
|
originalValue,
|
|
4822
|
-
schema:
|
|
4823
|
+
schema: schema17
|
|
4823
4824
|
}, panic, next) {
|
|
4824
4825
|
const {
|
|
4825
4826
|
name,
|
|
@@ -4831,8 +4832,8 @@ function createValidation(config) {
|
|
|
4831
4832
|
let {
|
|
4832
4833
|
parent,
|
|
4833
4834
|
context,
|
|
4834
|
-
abortEarly =
|
|
4835
|
-
disableStackTrace =
|
|
4835
|
+
abortEarly = schema17.spec.abortEarly,
|
|
4836
|
+
disableStackTrace = schema17.spec.disableStackTrace
|
|
4836
4837
|
} = options;
|
|
4837
4838
|
function resolve(item) {
|
|
4838
4839
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4841,9 +4842,9 @@ function createValidation(config) {
|
|
|
4841
4842
|
const nextParams = Object.assign({
|
|
4842
4843
|
value,
|
|
4843
4844
|
originalValue,
|
|
4844
|
-
label:
|
|
4845
|
+
label: schema17.spec.label,
|
|
4845
4846
|
path: overrides.path || path,
|
|
4846
|
-
spec:
|
|
4847
|
+
spec: schema17.spec,
|
|
4847
4848
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4848
4849
|
}, params, overrides.params);
|
|
4849
4850
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4861,7 +4862,7 @@ function createValidation(config) {
|
|
|
4861
4862
|
resolve,
|
|
4862
4863
|
options,
|
|
4863
4864
|
originalValue,
|
|
4864
|
-
schema:
|
|
4865
|
+
schema: schema17
|
|
4865
4866
|
};
|
|
4866
4867
|
const handleResult = (validOrError) => {
|
|
4867
4868
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4895,42 +4896,42 @@ function createValidation(config) {
|
|
|
4895
4896
|
validate.OPTIONS = config;
|
|
4896
4897
|
return validate;
|
|
4897
4898
|
}
|
|
4898
|
-
function getIn(
|
|
4899
|
+
function getIn(schema17, path, value, context = value) {
|
|
4899
4900
|
let parent, lastPart, lastPartDebug;
|
|
4900
4901
|
if (!path) return {
|
|
4901
4902
|
parent,
|
|
4902
4903
|
parentPath: path,
|
|
4903
|
-
schema:
|
|
4904
|
+
schema: schema17
|
|
4904
4905
|
};
|
|
4905
4906
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4906
4907
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4907
|
-
|
|
4908
|
+
schema17 = schema17.resolve({
|
|
4908
4909
|
context,
|
|
4909
4910
|
parent,
|
|
4910
4911
|
value
|
|
4911
4912
|
});
|
|
4912
|
-
let isTuple =
|
|
4913
|
+
let isTuple = schema17.type === "tuple";
|
|
4913
4914
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4914
|
-
if (
|
|
4915
|
+
if (schema17.innerType || isTuple) {
|
|
4915
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]"`);
|
|
4916
4917
|
if (value && idx >= value.length) {
|
|
4917
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. `);
|
|
4918
4919
|
}
|
|
4919
4920
|
parent = value;
|
|
4920
4921
|
value = value && value[idx];
|
|
4921
|
-
|
|
4922
|
+
schema17 = isTuple ? schema17.spec.types[idx] : schema17.innerType;
|
|
4922
4923
|
}
|
|
4923
4924
|
if (!isArray) {
|
|
4924
|
-
if (!
|
|
4925
|
+
if (!schema17.fields || !schema17.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema17.type}")`);
|
|
4925
4926
|
parent = value;
|
|
4926
4927
|
value = value && value[part];
|
|
4927
|
-
|
|
4928
|
+
schema17 = schema17.fields[part];
|
|
4928
4929
|
}
|
|
4929
4930
|
lastPart = part;
|
|
4930
4931
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4931
4932
|
});
|
|
4932
4933
|
return {
|
|
4933
|
-
schema:
|
|
4934
|
+
schema: schema17,
|
|
4934
4935
|
parent,
|
|
4935
4936
|
parentPath: lastPart
|
|
4936
4937
|
};
|
|
@@ -5067,20 +5068,20 @@ var Schema = class {
|
|
|
5067
5068
|
this._mutate = before;
|
|
5068
5069
|
return result;
|
|
5069
5070
|
}
|
|
5070
|
-
concat(
|
|
5071
|
-
if (!
|
|
5072
|
-
if (
|
|
5071
|
+
concat(schema17) {
|
|
5072
|
+
if (!schema17 || schema17 === this) return this;
|
|
5073
|
+
if (schema17.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema17.type}`);
|
|
5073
5074
|
let base = this;
|
|
5074
|
-
let combined =
|
|
5075
|
+
let combined = schema17.clone();
|
|
5075
5076
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5076
5077
|
combined.spec = mergedSpec;
|
|
5077
5078
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5078
|
-
combined._whitelist = base._whitelist.merge(
|
|
5079
|
-
combined._blacklist = base._blacklist.merge(
|
|
5079
|
+
combined._whitelist = base._whitelist.merge(schema17._whitelist, schema17._blacklist);
|
|
5080
|
+
combined._blacklist = base._blacklist.merge(schema17._blacklist, schema17._whitelist);
|
|
5080
5081
|
combined.tests = base.tests;
|
|
5081
5082
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5082
5083
|
combined.withMutation((next) => {
|
|
5083
|
-
|
|
5084
|
+
schema17.tests.forEach((fn) => {
|
|
5084
5085
|
next.test(fn.OPTIONS);
|
|
5085
5086
|
});
|
|
5086
5087
|
});
|
|
@@ -5096,15 +5097,15 @@ var Schema = class {
|
|
|
5096
5097
|
return this._typeCheck(v);
|
|
5097
5098
|
}
|
|
5098
5099
|
resolve(options) {
|
|
5099
|
-
let
|
|
5100
|
-
if (
|
|
5101
|
-
let conditions =
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5100
|
+
let schema17 = this;
|
|
5101
|
+
if (schema17.conditions.length) {
|
|
5102
|
+
let conditions = schema17.conditions;
|
|
5103
|
+
schema17 = schema17.clone();
|
|
5104
|
+
schema17.conditions = [];
|
|
5105
|
+
schema17 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema17);
|
|
5106
|
+
schema17 = schema17.resolve(options);
|
|
5106
5107
|
}
|
|
5107
|
-
return
|
|
5108
|
+
return schema17;
|
|
5108
5109
|
}
|
|
5109
5110
|
resolveOptions(options) {
|
|
5110
5111
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5258,11 +5259,11 @@ attempted value: ${formattedValue}
|
|
|
5258
5259
|
}
|
|
5259
5260
|
validate(value, options) {
|
|
5260
5261
|
var _options$disableStack2;
|
|
5261
|
-
let
|
|
5262
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5262
5263
|
value
|
|
5263
5264
|
}));
|
|
5264
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5265
|
-
return new Promise((resolve, reject) =>
|
|
5265
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema17.spec.disableStackTrace;
|
|
5266
|
+
return new Promise((resolve, reject) => schema17._validate(value, options, (error, parsed) => {
|
|
5266
5267
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5267
5268
|
reject(error);
|
|
5268
5269
|
}, (errors, validated) => {
|
|
@@ -5272,12 +5273,12 @@ attempted value: ${formattedValue}
|
|
|
5272
5273
|
}
|
|
5273
5274
|
validateSync(value, options) {
|
|
5274
5275
|
var _options$disableStack3;
|
|
5275
|
-
let
|
|
5276
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5276
5277
|
value
|
|
5277
5278
|
}));
|
|
5278
5279
|
let result;
|
|
5279
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5280
|
-
|
|
5280
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema17.spec.disableStackTrace;
|
|
5281
|
+
schema17._validate(value, Object.assign({}, options, {
|
|
5281
5282
|
sync: true
|
|
5282
5283
|
}), (error, parsed) => {
|
|
5283
5284
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5311,8 +5312,8 @@ attempted value: ${formattedValue}
|
|
|
5311
5312
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5312
5313
|
}
|
|
5313
5314
|
getDefault(options) {
|
|
5314
|
-
let
|
|
5315
|
-
return
|
|
5315
|
+
let schema17 = this.resolve(options || {});
|
|
5316
|
+
return schema17._getDefault(options);
|
|
5316
5317
|
}
|
|
5317
5318
|
default(def) {
|
|
5318
5319
|
if (arguments.length === 0) {
|
|
@@ -5547,9 +5548,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5547
5548
|
const {
|
|
5548
5549
|
parent,
|
|
5549
5550
|
parentPath,
|
|
5550
|
-
schema:
|
|
5551
|
+
schema: schema17
|
|
5551
5552
|
} = getIn(this, path, value, options.context);
|
|
5552
|
-
return
|
|
5553
|
+
return schema17[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5553
5554
|
parent,
|
|
5554
5555
|
path
|
|
5555
5556
|
}));
|
|
@@ -5723,7 +5724,7 @@ var StringSchema = class extends Schema {
|
|
|
5723
5724
|
});
|
|
5724
5725
|
}
|
|
5725
5726
|
required(message) {
|
|
5726
|
-
return super.required(message).withMutation((
|
|
5727
|
+
return super.required(message).withMutation((schema17) => schema17.test({
|
|
5727
5728
|
message: message || mixed.required,
|
|
5728
5729
|
name: "required",
|
|
5729
5730
|
skipAbsent: true,
|
|
@@ -5731,9 +5732,9 @@ var StringSchema = class extends Schema {
|
|
|
5731
5732
|
}));
|
|
5732
5733
|
}
|
|
5733
5734
|
notRequired() {
|
|
5734
|
-
return super.notRequired().withMutation((
|
|
5735
|
-
|
|
5736
|
-
return
|
|
5735
|
+
return super.notRequired().withMutation((schema17) => {
|
|
5736
|
+
schema17.tests = schema17.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5737
|
+
return schema17;
|
|
5737
5738
|
});
|
|
5738
5739
|
}
|
|
5739
5740
|
length(length, message = string.length) {
|
|
@@ -6122,28 +6123,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6122
6123
|
}
|
|
6123
6124
|
return ctx.isType(parsed) ? parsed : value;
|
|
6124
6125
|
};
|
|
6125
|
-
function deepPartial(
|
|
6126
|
-
if ("fields" in
|
|
6126
|
+
function deepPartial(schema17) {
|
|
6127
|
+
if ("fields" in schema17) {
|
|
6127
6128
|
const partial = {};
|
|
6128
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6129
|
+
for (const [key, fieldSchema] of Object.entries(schema17.fields)) {
|
|
6129
6130
|
partial[key] = deepPartial(fieldSchema);
|
|
6130
6131
|
}
|
|
6131
|
-
return
|
|
6132
|
+
return schema17.setFields(partial);
|
|
6132
6133
|
}
|
|
6133
|
-
if (
|
|
6134
|
-
const nextArray =
|
|
6134
|
+
if (schema17.type === "array") {
|
|
6135
|
+
const nextArray = schema17.optional();
|
|
6135
6136
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6136
6137
|
return nextArray;
|
|
6137
6138
|
}
|
|
6138
|
-
if (
|
|
6139
|
-
return
|
|
6140
|
-
types:
|
|
6139
|
+
if (schema17.type === "tuple") {
|
|
6140
|
+
return schema17.optional().clone({
|
|
6141
|
+
types: schema17.spec.types.map(deepPartial)
|
|
6141
6142
|
});
|
|
6142
6143
|
}
|
|
6143
|
-
if ("optional" in
|
|
6144
|
-
return
|
|
6144
|
+
if ("optional" in schema17) {
|
|
6145
|
+
return schema17.optional();
|
|
6145
6146
|
}
|
|
6146
|
-
return
|
|
6147
|
+
return schema17;
|
|
6147
6148
|
}
|
|
6148
6149
|
var deepHas = (obj, p) => {
|
|
6149
6150
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6277,8 +6278,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6277
6278
|
next._sortErrors = this._sortErrors;
|
|
6278
6279
|
return next;
|
|
6279
6280
|
}
|
|
6280
|
-
concat(
|
|
6281
|
-
let next = super.concat(
|
|
6281
|
+
concat(schema17) {
|
|
6282
|
+
let next = super.concat(schema17);
|
|
6282
6283
|
let nextFields = next.fields;
|
|
6283
6284
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6284
6285
|
const target = nextFields[field];
|
|
@@ -6286,7 +6287,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6286
6287
|
}
|
|
6287
6288
|
return next.withMutation((s) => (
|
|
6288
6289
|
// XXX: excludes here is wrong
|
|
6289
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6290
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema17._excludedEdges])
|
|
6290
6291
|
));
|
|
6291
6292
|
}
|
|
6292
6293
|
_getDefault(options) {
|
|
@@ -6331,8 +6332,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6331
6332
|
}
|
|
6332
6333
|
partial() {
|
|
6333
6334
|
const partial = {};
|
|
6334
|
-
for (const [key,
|
|
6335
|
-
partial[key] = "optional" in
|
|
6335
|
+
for (const [key, schema17] of Object.entries(this.fields)) {
|
|
6336
|
+
partial[key] = "optional" in schema17 && schema17.optional instanceof Function ? schema17.optional() : schema17;
|
|
6336
6337
|
}
|
|
6337
6338
|
return this.setFields(partial);
|
|
6338
6339
|
}
|
|
@@ -6530,22 +6531,22 @@ var ArraySchema = class extends Schema {
|
|
|
6530
6531
|
json() {
|
|
6531
6532
|
return this.transform(parseJson);
|
|
6532
6533
|
}
|
|
6533
|
-
concat(
|
|
6534
|
-
let next = super.concat(
|
|
6534
|
+
concat(schema17) {
|
|
6535
|
+
let next = super.concat(schema17);
|
|
6535
6536
|
next.innerType = this.innerType;
|
|
6536
|
-
if (
|
|
6537
|
+
if (schema17.innerType)
|
|
6537
6538
|
next.innerType = next.innerType ? (
|
|
6538
6539
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6539
|
-
next.innerType.concat(
|
|
6540
|
-
) :
|
|
6540
|
+
next.innerType.concat(schema17.innerType)
|
|
6541
|
+
) : schema17.innerType;
|
|
6541
6542
|
return next;
|
|
6542
6543
|
}
|
|
6543
|
-
of(
|
|
6544
|
+
of(schema17) {
|
|
6544
6545
|
let next = this.clone();
|
|
6545
|
-
if (!isSchema(
|
|
6546
|
-
next.innerType =
|
|
6546
|
+
if (!isSchema(schema17)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema17));
|
|
6547
|
+
next.innerType = schema17;
|
|
6547
6548
|
next.spec = Object.assign({}, next.spec, {
|
|
6548
|
-
types:
|
|
6549
|
+
types: schema17
|
|
6549
6550
|
});
|
|
6550
6551
|
return next;
|
|
6551
6552
|
}
|
|
@@ -6689,7 +6690,7 @@ var TupleSchema = class extends Schema {
|
|
|
6689
6690
|
describe(options) {
|
|
6690
6691
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6691
6692
|
const base = super.describe(options);
|
|
6692
|
-
base.innerType = next.spec.types.map((
|
|
6693
|
+
base.innerType = next.spec.types.map((schema17, index) => {
|
|
6693
6694
|
var _innerOptions;
|
|
6694
6695
|
let innerOptions = options;
|
|
6695
6696
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6698,7 +6699,7 @@ var TupleSchema = class extends Schema {
|
|
|
6698
6699
|
value: innerOptions.value[index]
|
|
6699
6700
|
});
|
|
6700
6701
|
}
|
|
6701
|
-
return
|
|
6702
|
+
return schema17.describe(innerOptions);
|
|
6702
6703
|
});
|
|
6703
6704
|
return base;
|
|
6704
6705
|
}
|
|
@@ -10591,7 +10592,7 @@ var stallTypesSchema = create$3({
|
|
|
10591
10592
|
"",
|
|
10592
10593
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10593
10594
|
),
|
|
10594
|
-
stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(
|
|
10595
|
+
stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
|
|
10595
10596
|
});
|
|
10596
10597
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10597
10598
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10618,7 +10619,7 @@ var socialMediaSchema = create$3({
|
|
|
10618
10619
|
is: (name) => !!name,
|
|
10619
10620
|
// If name has a value
|
|
10620
10621
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10621
|
-
otherwise: (
|
|
10622
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10622
10623
|
})
|
|
10623
10624
|
});
|
|
10624
10625
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10694,21 +10695,21 @@ var paymentInfoSchema = create$3({
|
|
|
10694
10695
|
).required("Please select a Payment method"),
|
|
10695
10696
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10696
10697
|
is: "bank_transfer",
|
|
10697
|
-
then: (
|
|
10698
|
-
otherwise: (
|
|
10698
|
+
then: (schema17) => schema17.required("Account holder name is required for bank transfer").trim(),
|
|
10699
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10699
10700
|
}),
|
|
10700
10701
|
accountNumber: create$6().when("paymentMethod", {
|
|
10701
10702
|
is: "bank_transfer",
|
|
10702
|
-
then: (
|
|
10703
|
+
then: (schema17) => schema17.required("Account number is required for bank transfer").matches(
|
|
10703
10704
|
nzBankAccountRegex,
|
|
10704
10705
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10705
10706
|
).trim(),
|
|
10706
|
-
otherwise: (
|
|
10707
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10707
10708
|
}),
|
|
10708
10709
|
link: create$6().when("paymentMethod", {
|
|
10709
10710
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10710
10711
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10711
|
-
otherwise: (
|
|
10712
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10712
10713
|
})
|
|
10713
10714
|
});
|
|
10714
10715
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10858,8 +10859,8 @@ var userSchema = create$3().shape({
|
|
|
10858
10859
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10859
10860
|
is: (val) => !!val,
|
|
10860
10861
|
// only necessary if password typed
|
|
10861
|
-
then: (
|
|
10862
|
-
otherwise: (
|
|
10862
|
+
then: (schema17) => schema17.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10863
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10863
10864
|
}),
|
|
10864
10865
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10865
10866
|
});
|
|
@@ -10930,7 +10931,7 @@ var adSchema = create$3().shape({
|
|
|
10930
10931
|
return endDate > now;
|
|
10931
10932
|
}).when("start", {
|
|
10932
10933
|
is: (val) => val && val.length > 0,
|
|
10933
|
-
then: (
|
|
10934
|
+
then: (schema17) => schema17.test(
|
|
10934
10935
|
"is-after-start",
|
|
10935
10936
|
"End date must be after start date",
|
|
10936
10937
|
function(value) {
|
|
@@ -12206,7 +12207,7 @@ var schema9 = new MongooseSchema13(
|
|
|
12206
12207
|
required: false,
|
|
12207
12208
|
type: calendarWrapperSchema
|
|
12208
12209
|
},
|
|
12209
|
-
categories: [CategorySchema],
|
|
12210
|
+
categories: { required: true, type: [CategorySchema] },
|
|
12210
12211
|
foodTruck: { required: true, type: Boolean },
|
|
12211
12212
|
products: { required: false, type: productWrapperSchema },
|
|
12212
12213
|
relations: {
|
|
@@ -12285,19 +12286,47 @@ var schema10 = new MongooseSchema14(
|
|
|
12285
12286
|
);
|
|
12286
12287
|
var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
|
|
12287
12288
|
|
|
12288
|
-
// src/mongoose/
|
|
12289
|
+
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
12289
12290
|
var import_mongoose15 = __toESM(require("mongoose"));
|
|
12290
12291
|
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
12292
|
+
var invitationSchema = new MongooseSchema15(
|
|
12293
|
+
{
|
|
12294
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12295
|
+
eventId: {
|
|
12296
|
+
ref: "Event",
|
|
12297
|
+
required: true,
|
|
12298
|
+
type: String
|
|
12299
|
+
}
|
|
12300
|
+
},
|
|
12301
|
+
{ _id: false }
|
|
12302
|
+
);
|
|
12291
12303
|
var schema11 = new MongooseSchema15(
|
|
12304
|
+
{
|
|
12305
|
+
categoryIds: { required: true, type: [String] },
|
|
12306
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12307
|
+
email: { required: true, type: String },
|
|
12308
|
+
invitations: { required: true, type: [invitationSchema] },
|
|
12309
|
+
name: { required: true, type: String }
|
|
12310
|
+
},
|
|
12311
|
+
{ timestamps: true }
|
|
12312
|
+
);
|
|
12313
|
+
schema11.index({ email: 1 }, { unique: true });
|
|
12314
|
+
schema11.index({ name: 1 });
|
|
12315
|
+
var UnregisteredVendorModel = import_mongoose15.default.models.UnregisteredVendor || import_mongoose15.default.model("UnregisteredVendor", schema11);
|
|
12316
|
+
|
|
12317
|
+
// src/mongoose/event/Event.ts
|
|
12318
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
12319
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
12320
|
+
var schema12 = new MongooseSchema16(
|
|
12292
12321
|
{
|
|
12293
12322
|
...baseResourceFields,
|
|
12294
12323
|
// Importing base resource fields from global.ts
|
|
12295
12324
|
claimed: { default: true, required: false, type: Boolean },
|
|
12296
|
-
dateTime: [dateTimeSchema3],
|
|
12325
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12297
12326
|
eventInfoId: {
|
|
12298
12327
|
ref: "EventInfo",
|
|
12299
12328
|
required: false,
|
|
12300
|
-
type:
|
|
12329
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
12301
12330
|
},
|
|
12302
12331
|
eventType: {
|
|
12303
12332
|
enum: Object.values(EnumEventType),
|
|
@@ -12326,18 +12355,18 @@ var schema11 = new MongooseSchema15(
|
|
|
12326
12355
|
},
|
|
12327
12356
|
{ timestamps: true }
|
|
12328
12357
|
);
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
var EventModel =
|
|
12358
|
+
schema12.index({ name: 1 });
|
|
12359
|
+
schema12.index({ description: 1 });
|
|
12360
|
+
schema12.index({ region: 1 });
|
|
12361
|
+
schema12.index({ "location.geo": "2dsphere" });
|
|
12362
|
+
schema12.index({ tags: 1 });
|
|
12363
|
+
schema12.index({ "associates.email": 1 });
|
|
12364
|
+
var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema12);
|
|
12336
12365
|
|
|
12337
12366
|
// src/mongoose/Partner.ts
|
|
12338
|
-
var
|
|
12339
|
-
var
|
|
12340
|
-
var
|
|
12367
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
12368
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
12369
|
+
var schema13 = new MongooseSchema17(
|
|
12341
12370
|
{
|
|
12342
12371
|
...baseResourceFields,
|
|
12343
12372
|
location: {
|
|
@@ -12353,19 +12382,19 @@ var schema12 = new MongooseSchema16(
|
|
|
12353
12382
|
},
|
|
12354
12383
|
{ timestamps: true }
|
|
12355
12384
|
);
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
var PartnerModel =
|
|
12385
|
+
schema13.index({ name: 1 });
|
|
12386
|
+
schema13.index({ description: 1 });
|
|
12387
|
+
schema13.index({ region: 1 });
|
|
12388
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
12389
|
+
schema13.index({ "associates.email": 1 });
|
|
12390
|
+
var PartnerModel = import_mongoose17.default.models.Partner || import_mongoose17.default.model("Partner", schema13);
|
|
12362
12391
|
|
|
12363
12392
|
// src/mongoose/Post.ts
|
|
12364
|
-
var
|
|
12365
|
-
var
|
|
12366
|
-
var contentSchema = new
|
|
12393
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
12394
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
12395
|
+
var contentSchema = new MongooseSchema18(
|
|
12367
12396
|
{
|
|
12368
|
-
contentData:
|
|
12397
|
+
contentData: import_mongoose18.Schema.Types.Mixed,
|
|
12369
12398
|
contentOrder: { required: true, type: Number },
|
|
12370
12399
|
contentType: {
|
|
12371
12400
|
enum: Object.values(EnumPostContentType),
|
|
@@ -12375,7 +12404,7 @@ var contentSchema = new MongooseSchema17(
|
|
|
12375
12404
|
},
|
|
12376
12405
|
{ _id: false }
|
|
12377
12406
|
);
|
|
12378
|
-
var
|
|
12407
|
+
var schema14 = new MongooseSchema18(
|
|
12379
12408
|
{
|
|
12380
12409
|
active: { default: true, required: true, type: Boolean },
|
|
12381
12410
|
caption: { required: true, type: String },
|
|
@@ -12411,15 +12440,15 @@ var schema13 = new MongooseSchema17(
|
|
|
12411
12440
|
},
|
|
12412
12441
|
{ timestamps: true }
|
|
12413
12442
|
);
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
var PostModel =
|
|
12443
|
+
schema14.index({ title: 1 });
|
|
12444
|
+
schema14.index({ tags: 1 });
|
|
12445
|
+
var PostModel = import_mongoose18.default.models.Post || import_mongoose18.default.model("Post", schema14);
|
|
12417
12446
|
|
|
12418
12447
|
// src/mongoose/AppSetting.ts
|
|
12419
|
-
var
|
|
12420
|
-
var
|
|
12448
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
12449
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
12421
12450
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
12422
|
-
var AppSettingSchema = new
|
|
12451
|
+
var AppSettingSchema = new MongooseSchema19(
|
|
12423
12452
|
{
|
|
12424
12453
|
activeSchoolsStudentCountTotal: {
|
|
12425
12454
|
default: 0,
|
|
@@ -12445,18 +12474,18 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
12445
12474
|
},
|
|
12446
12475
|
{ timestamps: true }
|
|
12447
12476
|
);
|
|
12448
|
-
var AppSettingModel =
|
|
12477
|
+
var AppSettingModel = import_mongoose19.default.models.AppSetting || import_mongoose19.default.model("AppSetting", AppSettingSchema);
|
|
12449
12478
|
|
|
12450
12479
|
// src/mongoose/game/Game.ts
|
|
12451
|
-
var
|
|
12480
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
12452
12481
|
|
|
12453
12482
|
// src/mongoose/game/DailyClue.ts
|
|
12454
|
-
var
|
|
12483
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12455
12484
|
|
|
12456
12485
|
// src/mongoose/game/utils.ts
|
|
12457
|
-
var
|
|
12458
|
-
var
|
|
12459
|
-
var schemaGameDate = new
|
|
12486
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
12487
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
12488
|
+
var schemaGameDate = new MongooseSchema20(
|
|
12460
12489
|
{
|
|
12461
12490
|
endDate: { required: true, type: Date },
|
|
12462
12491
|
startDate: { required: true, type: Date }
|
|
@@ -12465,8 +12494,8 @@ var schemaGameDate = new MongooseSchema19(
|
|
|
12465
12494
|
);
|
|
12466
12495
|
|
|
12467
12496
|
// src/mongoose/game/DailyClue.ts
|
|
12468
|
-
var
|
|
12469
|
-
var schemaLetters = new
|
|
12497
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
12498
|
+
var schemaLetters = new MongooseSchema21(
|
|
12470
12499
|
{
|
|
12471
12500
|
collected: { required: false, type: [String] },
|
|
12472
12501
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -12474,14 +12503,14 @@ var schemaLetters = new MongooseSchema20(
|
|
|
12474
12503
|
},
|
|
12475
12504
|
{ _id: false }
|
|
12476
12505
|
);
|
|
12477
|
-
var schemaDailyClueBaseGame = new
|
|
12506
|
+
var schemaDailyClueBaseGame = new MongooseSchema21(
|
|
12478
12507
|
{
|
|
12479
12508
|
gameDate: { required: true, type: schemaGameDate },
|
|
12480
12509
|
gameSolution: { required: true, type: String }
|
|
12481
12510
|
},
|
|
12482
12511
|
{ _id: false }
|
|
12483
12512
|
);
|
|
12484
|
-
var schemaDailyClueGameData = new
|
|
12513
|
+
var schemaDailyClueGameData = new MongooseSchema21(
|
|
12485
12514
|
{
|
|
12486
12515
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
12487
12516
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -12496,9 +12525,9 @@ var schemaDailyClueGameData = new MongooseSchema20(
|
|
|
12496
12525
|
);
|
|
12497
12526
|
|
|
12498
12527
|
// src/mongoose/game/MiniQuiz.ts
|
|
12499
|
-
var
|
|
12500
|
-
var
|
|
12501
|
-
var schemaMiniQuizAnswer = new
|
|
12528
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
12529
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
12530
|
+
var schemaMiniQuizAnswer = new MongooseSchema22(
|
|
12502
12531
|
{
|
|
12503
12532
|
answer: { required: true, type: String },
|
|
12504
12533
|
answerId: { required: true, type: String },
|
|
@@ -12506,7 +12535,7 @@ var schemaMiniQuizAnswer = new MongooseSchema21(
|
|
|
12506
12535
|
},
|
|
12507
12536
|
{ _id: false }
|
|
12508
12537
|
);
|
|
12509
|
-
var schemaMiniQuizQuestion = new
|
|
12538
|
+
var schemaMiniQuizQuestion = new MongooseSchema22(
|
|
12510
12539
|
{
|
|
12511
12540
|
answers: { required: true, type: [schemaMiniQuizAnswer] },
|
|
12512
12541
|
question: { required: true, type: String },
|
|
@@ -12514,20 +12543,20 @@ var schemaMiniQuizQuestion = new MongooseSchema21(
|
|
|
12514
12543
|
},
|
|
12515
12544
|
{ _id: false }
|
|
12516
12545
|
);
|
|
12517
|
-
var schemaMiniQuizBaseGame = new
|
|
12546
|
+
var schemaMiniQuizBaseGame = new MongooseSchema22(
|
|
12518
12547
|
{
|
|
12519
12548
|
questions: { required: true, type: [schemaMiniQuizQuestion] }
|
|
12520
12549
|
},
|
|
12521
12550
|
{ _id: false }
|
|
12522
12551
|
);
|
|
12523
|
-
var schemaMiniQuizAnsweredQuestion = new
|
|
12552
|
+
var schemaMiniQuizAnsweredQuestion = new MongooseSchema22(
|
|
12524
12553
|
{
|
|
12525
12554
|
questionId: { required: true, type: String },
|
|
12526
12555
|
selectedAnswerId: { required: true, type: String }
|
|
12527
12556
|
},
|
|
12528
12557
|
{ _id: false }
|
|
12529
12558
|
);
|
|
12530
|
-
var schemaMiniQuizGameData = new
|
|
12559
|
+
var schemaMiniQuizGameData = new MongooseSchema22(
|
|
12531
12560
|
{
|
|
12532
12561
|
answeredQuestions: {
|
|
12533
12562
|
default: null,
|
|
@@ -12542,18 +12571,18 @@ var schemaMiniQuizGameData = new MongooseSchema21(
|
|
|
12542
12571
|
);
|
|
12543
12572
|
|
|
12544
12573
|
// src/mongoose/game/Game.ts
|
|
12545
|
-
var
|
|
12574
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
12546
12575
|
var gameDataSchemas = {
|
|
12547
12576
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
12548
12577
|
[EnumGameType.MINI_QUIZ]: schemaMiniQuizGameData
|
|
12549
12578
|
};
|
|
12550
12579
|
var gameDataDefinition = Object.fromEntries(
|
|
12551
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12580
|
+
Object.entries(gameDataSchemas).map(([key, schema17]) => [
|
|
12552
12581
|
key,
|
|
12553
|
-
{ default: null, required: false, type:
|
|
12582
|
+
{ default: null, required: false, type: schema17 }
|
|
12554
12583
|
])
|
|
12555
12584
|
);
|
|
12556
|
-
var gameHistorySchema = new
|
|
12585
|
+
var gameHistorySchema = new MongooseSchema23(
|
|
12557
12586
|
{
|
|
12558
12587
|
createdAt: { required: true, type: Date },
|
|
12559
12588
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -12571,7 +12600,7 @@ var gameHistorySchema = new MongooseSchema22(
|
|
|
12571
12600
|
},
|
|
12572
12601
|
{ _id: false }
|
|
12573
12602
|
);
|
|
12574
|
-
var gameTypeSchema = new
|
|
12603
|
+
var gameTypeSchema = new MongooseSchema23(
|
|
12575
12604
|
{
|
|
12576
12605
|
active: { default: true, required: true, type: Boolean },
|
|
12577
12606
|
gameData: gameDataDefinition,
|
|
@@ -12585,7 +12614,7 @@ var gameTypeSchema = new MongooseSchema22(
|
|
|
12585
12614
|
},
|
|
12586
12615
|
{ timestamps: true }
|
|
12587
12616
|
);
|
|
12588
|
-
var
|
|
12617
|
+
var schema15 = new MongooseSchema23(
|
|
12589
12618
|
{
|
|
12590
12619
|
active: { default: false, required: true, type: Boolean },
|
|
12591
12620
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -12598,12 +12627,12 @@ var schema14 = new MongooseSchema22(
|
|
|
12598
12627
|
},
|
|
12599
12628
|
{ timestamps: true }
|
|
12600
12629
|
);
|
|
12601
|
-
var GameModel =
|
|
12630
|
+
var GameModel = import_mongoose23.default.models.Game || import_mongoose23.default.model("Game", schema15);
|
|
12602
12631
|
|
|
12603
12632
|
// src/mongoose/School.ts
|
|
12604
|
-
var
|
|
12605
|
-
var
|
|
12606
|
-
var campaignsSchema = new
|
|
12633
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
12634
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
12635
|
+
var campaignsSchema = new MongooseSchema24(
|
|
12607
12636
|
{
|
|
12608
12637
|
endDate: { required: true, type: Date },
|
|
12609
12638
|
name: { required: true, type: String },
|
|
@@ -12611,7 +12640,7 @@ var campaignsSchema = new MongooseSchema23(
|
|
|
12611
12640
|
},
|
|
12612
12641
|
{ _id: false }
|
|
12613
12642
|
);
|
|
12614
|
-
var
|
|
12643
|
+
var schema16 = new MongooseSchema24(
|
|
12615
12644
|
{
|
|
12616
12645
|
// New schools are active by default
|
|
12617
12646
|
active: { default: true, required: true, type: Boolean },
|
|
@@ -12637,7 +12666,7 @@ var schema15 = new MongooseSchema23(
|
|
|
12637
12666
|
},
|
|
12638
12667
|
{ timestamps: true }
|
|
12639
12668
|
);
|
|
12640
|
-
var SchoolModel =
|
|
12669
|
+
var SchoolModel = import_mongoose24.default.models.School || import_mongoose24.default.model("School", schema16);
|
|
12641
12670
|
// Annotate the CommonJS export names for ESM import in node:
|
|
12642
12671
|
0 && (module.exports = {
|
|
12643
12672
|
APP_SETTINGS_ID,
|
|
@@ -12663,6 +12692,7 @@ var SchoolModel = import_mongoose23.default.models.School || import_mongoose23.d
|
|
|
12663
12692
|
SchoolModel,
|
|
12664
12693
|
SocialMediaTypeSchema,
|
|
12665
12694
|
StallTypeSchema,
|
|
12695
|
+
UnregisteredVendorModel,
|
|
12666
12696
|
UserModel,
|
|
12667
12697
|
VendorInfoModel,
|
|
12668
12698
|
VendorModel,
|