@timardex/cluemart-server-shared 1.0.164 → 1.0.166
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-W5EVEI2Y.mjs} +183 -169
- package/dist/chunk-W5EVEI2Y.mjs.map +1 -0
- package/dist/index.cjs +192 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.mjs +190 -176
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +184 -169
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +14 -2
- package/dist/mongoose/index.d.ts +14 -2
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +186 -173
- 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/index.cjs
CHANGED
|
@@ -1697,6 +1697,7 @@ __export(index_exports, {
|
|
|
1697
1697
|
SchoolModel: () => SchoolModel,
|
|
1698
1698
|
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
1699
1699
|
StallTypeSchema: () => StallTypeSchema,
|
|
1700
|
+
UnregisteredVendorModel: () => UnregisteredVendorModel,
|
|
1700
1701
|
UserModel: () => UserModel,
|
|
1701
1702
|
VendorInfoModel: () => VendorInfoModel,
|
|
1702
1703
|
VendorModel: () => VendorModel,
|
|
@@ -1710,7 +1711,7 @@ __export(index_exports, {
|
|
|
1710
1711
|
findEventOrImportedMarketById: () => findEventOrImportedMarketById,
|
|
1711
1712
|
locationGeoSchema: () => locationGeoSchema,
|
|
1712
1713
|
locationsSchema: () => locationsSchema,
|
|
1713
|
-
mongoose: () =>
|
|
1714
|
+
mongoose: () => import_mongoose32.default,
|
|
1714
1715
|
refundPolicySchema: () => refundPolicySchema,
|
|
1715
1716
|
relationDatesSchema: () => relationDatesSchema,
|
|
1716
1717
|
resourceRelationsSchema: () => resourceRelationsSchema,
|
|
@@ -4737,10 +4738,10 @@ var Condition = class _Condition {
|
|
|
4737
4738
|
otherwise
|
|
4738
4739
|
} = config;
|
|
4739
4740
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4740
|
-
return new _Condition(refs, (values,
|
|
4741
|
+
return new _Condition(refs, (values, schema17) => {
|
|
4741
4742
|
var _branch;
|
|
4742
4743
|
let branch = check(...values) ? then : otherwise;
|
|
4743
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4744
|
+
return (_branch = branch == null ? void 0 : branch(schema17)) != null ? _branch : schema17;
|
|
4744
4745
|
});
|
|
4745
4746
|
}
|
|
4746
4747
|
constructor(refs, builder) {
|
|
@@ -4754,13 +4755,13 @@ var Condition = class _Condition {
|
|
|
4754
4755
|
// TODO: ? operator here?
|
|
4755
4756
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4756
4757
|
));
|
|
4757
|
-
let
|
|
4758
|
-
if (
|
|
4759
|
-
|
|
4758
|
+
let schema17 = this.fn(values, base, options);
|
|
4759
|
+
if (schema17 === void 0 || // @ts-ignore this can be base
|
|
4760
|
+
schema17 === base) {
|
|
4760
4761
|
return base;
|
|
4761
4762
|
}
|
|
4762
|
-
if (!isSchema(
|
|
4763
|
-
return
|
|
4763
|
+
if (!isSchema(schema17)) throw new TypeError("conditions must return a schema object");
|
|
4764
|
+
return schema17.resolve(options);
|
|
4764
4765
|
}
|
|
4765
4766
|
};
|
|
4766
4767
|
var prefixes = {
|
|
@@ -4830,7 +4831,7 @@ function createValidation(config) {
|
|
|
4830
4831
|
path = "",
|
|
4831
4832
|
options,
|
|
4832
4833
|
originalValue,
|
|
4833
|
-
schema:
|
|
4834
|
+
schema: schema17
|
|
4834
4835
|
}, panic, next) {
|
|
4835
4836
|
const {
|
|
4836
4837
|
name,
|
|
@@ -4842,8 +4843,8 @@ function createValidation(config) {
|
|
|
4842
4843
|
let {
|
|
4843
4844
|
parent,
|
|
4844
4845
|
context,
|
|
4845
|
-
abortEarly =
|
|
4846
|
-
disableStackTrace =
|
|
4846
|
+
abortEarly = schema17.spec.abortEarly,
|
|
4847
|
+
disableStackTrace = schema17.spec.disableStackTrace
|
|
4847
4848
|
} = options;
|
|
4848
4849
|
function resolve(item) {
|
|
4849
4850
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4852,9 +4853,9 @@ function createValidation(config) {
|
|
|
4852
4853
|
const nextParams = Object.assign({
|
|
4853
4854
|
value,
|
|
4854
4855
|
originalValue,
|
|
4855
|
-
label:
|
|
4856
|
+
label: schema17.spec.label,
|
|
4856
4857
|
path: overrides.path || path,
|
|
4857
|
-
spec:
|
|
4858
|
+
spec: schema17.spec,
|
|
4858
4859
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4859
4860
|
}, params, overrides.params);
|
|
4860
4861
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4872,7 +4873,7 @@ function createValidation(config) {
|
|
|
4872
4873
|
resolve,
|
|
4873
4874
|
options,
|
|
4874
4875
|
originalValue,
|
|
4875
|
-
schema:
|
|
4876
|
+
schema: schema17
|
|
4876
4877
|
};
|
|
4877
4878
|
const handleResult = (validOrError) => {
|
|
4878
4879
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4906,42 +4907,42 @@ function createValidation(config) {
|
|
|
4906
4907
|
validate.OPTIONS = config;
|
|
4907
4908
|
return validate;
|
|
4908
4909
|
}
|
|
4909
|
-
function getIn(
|
|
4910
|
+
function getIn(schema17, path, value, context = value) {
|
|
4910
4911
|
let parent, lastPart, lastPartDebug;
|
|
4911
4912
|
if (!path) return {
|
|
4912
4913
|
parent,
|
|
4913
4914
|
parentPath: path,
|
|
4914
|
-
schema:
|
|
4915
|
+
schema: schema17
|
|
4915
4916
|
};
|
|
4916
4917
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4917
4918
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4918
|
-
|
|
4919
|
+
schema17 = schema17.resolve({
|
|
4919
4920
|
context,
|
|
4920
4921
|
parent,
|
|
4921
4922
|
value
|
|
4922
4923
|
});
|
|
4923
|
-
let isTuple =
|
|
4924
|
+
let isTuple = schema17.type === "tuple";
|
|
4924
4925
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4925
|
-
if (
|
|
4926
|
+
if (schema17.innerType || isTuple) {
|
|
4926
4927
|
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]"`);
|
|
4927
4928
|
if (value && idx >= value.length) {
|
|
4928
4929
|
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. `);
|
|
4929
4930
|
}
|
|
4930
4931
|
parent = value;
|
|
4931
4932
|
value = value && value[idx];
|
|
4932
|
-
|
|
4933
|
+
schema17 = isTuple ? schema17.spec.types[idx] : schema17.innerType;
|
|
4933
4934
|
}
|
|
4934
4935
|
if (!isArray) {
|
|
4935
|
-
if (!
|
|
4936
|
+
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}")`);
|
|
4936
4937
|
parent = value;
|
|
4937
4938
|
value = value && value[part];
|
|
4938
|
-
|
|
4939
|
+
schema17 = schema17.fields[part];
|
|
4939
4940
|
}
|
|
4940
4941
|
lastPart = part;
|
|
4941
4942
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4942
4943
|
});
|
|
4943
4944
|
return {
|
|
4944
|
-
schema:
|
|
4945
|
+
schema: schema17,
|
|
4945
4946
|
parent,
|
|
4946
4947
|
parentPath: lastPart
|
|
4947
4948
|
};
|
|
@@ -5078,20 +5079,20 @@ var Schema = class {
|
|
|
5078
5079
|
this._mutate = before;
|
|
5079
5080
|
return result;
|
|
5080
5081
|
}
|
|
5081
|
-
concat(
|
|
5082
|
-
if (!
|
|
5083
|
-
if (
|
|
5082
|
+
concat(schema17) {
|
|
5083
|
+
if (!schema17 || schema17 === this) return this;
|
|
5084
|
+
if (schema17.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema17.type}`);
|
|
5084
5085
|
let base = this;
|
|
5085
|
-
let combined =
|
|
5086
|
+
let combined = schema17.clone();
|
|
5086
5087
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5087
5088
|
combined.spec = mergedSpec;
|
|
5088
5089
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5089
|
-
combined._whitelist = base._whitelist.merge(
|
|
5090
|
-
combined._blacklist = base._blacklist.merge(
|
|
5090
|
+
combined._whitelist = base._whitelist.merge(schema17._whitelist, schema17._blacklist);
|
|
5091
|
+
combined._blacklist = base._blacklist.merge(schema17._blacklist, schema17._whitelist);
|
|
5091
5092
|
combined.tests = base.tests;
|
|
5092
5093
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5093
5094
|
combined.withMutation((next) => {
|
|
5094
|
-
|
|
5095
|
+
schema17.tests.forEach((fn) => {
|
|
5095
5096
|
next.test(fn.OPTIONS);
|
|
5096
5097
|
});
|
|
5097
5098
|
});
|
|
@@ -5107,15 +5108,15 @@ var Schema = class {
|
|
|
5107
5108
|
return this._typeCheck(v);
|
|
5108
5109
|
}
|
|
5109
5110
|
resolve(options) {
|
|
5110
|
-
let
|
|
5111
|
-
if (
|
|
5112
|
-
let conditions =
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5111
|
+
let schema17 = this;
|
|
5112
|
+
if (schema17.conditions.length) {
|
|
5113
|
+
let conditions = schema17.conditions;
|
|
5114
|
+
schema17 = schema17.clone();
|
|
5115
|
+
schema17.conditions = [];
|
|
5116
|
+
schema17 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema17);
|
|
5117
|
+
schema17 = schema17.resolve(options);
|
|
5117
5118
|
}
|
|
5118
|
-
return
|
|
5119
|
+
return schema17;
|
|
5119
5120
|
}
|
|
5120
5121
|
resolveOptions(options) {
|
|
5121
5122
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5269,11 +5270,11 @@ attempted value: ${formattedValue}
|
|
|
5269
5270
|
}
|
|
5270
5271
|
validate(value, options) {
|
|
5271
5272
|
var _options$disableStack2;
|
|
5272
|
-
let
|
|
5273
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5273
5274
|
value
|
|
5274
5275
|
}));
|
|
5275
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5276
|
-
return new Promise((resolve, reject) =>
|
|
5276
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema17.spec.disableStackTrace;
|
|
5277
|
+
return new Promise((resolve, reject) => schema17._validate(value, options, (error, parsed) => {
|
|
5277
5278
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5278
5279
|
reject(error);
|
|
5279
5280
|
}, (errors, validated) => {
|
|
@@ -5283,12 +5284,12 @@ attempted value: ${formattedValue}
|
|
|
5283
5284
|
}
|
|
5284
5285
|
validateSync(value, options) {
|
|
5285
5286
|
var _options$disableStack3;
|
|
5286
|
-
let
|
|
5287
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5287
5288
|
value
|
|
5288
5289
|
}));
|
|
5289
5290
|
let result;
|
|
5290
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5291
|
-
|
|
5291
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema17.spec.disableStackTrace;
|
|
5292
|
+
schema17._validate(value, Object.assign({}, options, {
|
|
5292
5293
|
sync: true
|
|
5293
5294
|
}), (error, parsed) => {
|
|
5294
5295
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5322,8 +5323,8 @@ attempted value: ${formattedValue}
|
|
|
5322
5323
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5323
5324
|
}
|
|
5324
5325
|
getDefault(options) {
|
|
5325
|
-
let
|
|
5326
|
-
return
|
|
5326
|
+
let schema17 = this.resolve(options || {});
|
|
5327
|
+
return schema17._getDefault(options);
|
|
5327
5328
|
}
|
|
5328
5329
|
default(def) {
|
|
5329
5330
|
if (arguments.length === 0) {
|
|
@@ -5558,9 +5559,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5558
5559
|
const {
|
|
5559
5560
|
parent,
|
|
5560
5561
|
parentPath,
|
|
5561
|
-
schema:
|
|
5562
|
+
schema: schema17
|
|
5562
5563
|
} = getIn(this, path, value, options.context);
|
|
5563
|
-
return
|
|
5564
|
+
return schema17[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5564
5565
|
parent,
|
|
5565
5566
|
path
|
|
5566
5567
|
}));
|
|
@@ -5734,7 +5735,7 @@ var StringSchema = class extends Schema {
|
|
|
5734
5735
|
});
|
|
5735
5736
|
}
|
|
5736
5737
|
required(message) {
|
|
5737
|
-
return super.required(message).withMutation((
|
|
5738
|
+
return super.required(message).withMutation((schema17) => schema17.test({
|
|
5738
5739
|
message: message || mixed.required,
|
|
5739
5740
|
name: "required",
|
|
5740
5741
|
skipAbsent: true,
|
|
@@ -5742,9 +5743,9 @@ var StringSchema = class extends Schema {
|
|
|
5742
5743
|
}));
|
|
5743
5744
|
}
|
|
5744
5745
|
notRequired() {
|
|
5745
|
-
return super.notRequired().withMutation((
|
|
5746
|
-
|
|
5747
|
-
return
|
|
5746
|
+
return super.notRequired().withMutation((schema17) => {
|
|
5747
|
+
schema17.tests = schema17.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5748
|
+
return schema17;
|
|
5748
5749
|
});
|
|
5749
5750
|
}
|
|
5750
5751
|
length(length, message = string.length) {
|
|
@@ -6133,28 +6134,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6133
6134
|
}
|
|
6134
6135
|
return ctx.isType(parsed) ? parsed : value;
|
|
6135
6136
|
};
|
|
6136
|
-
function deepPartial(
|
|
6137
|
-
if ("fields" in
|
|
6137
|
+
function deepPartial(schema17) {
|
|
6138
|
+
if ("fields" in schema17) {
|
|
6138
6139
|
const partial = {};
|
|
6139
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6140
|
+
for (const [key, fieldSchema] of Object.entries(schema17.fields)) {
|
|
6140
6141
|
partial[key] = deepPartial(fieldSchema);
|
|
6141
6142
|
}
|
|
6142
|
-
return
|
|
6143
|
+
return schema17.setFields(partial);
|
|
6143
6144
|
}
|
|
6144
|
-
if (
|
|
6145
|
-
const nextArray =
|
|
6145
|
+
if (schema17.type === "array") {
|
|
6146
|
+
const nextArray = schema17.optional();
|
|
6146
6147
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6147
6148
|
return nextArray;
|
|
6148
6149
|
}
|
|
6149
|
-
if (
|
|
6150
|
-
return
|
|
6151
|
-
types:
|
|
6150
|
+
if (schema17.type === "tuple") {
|
|
6151
|
+
return schema17.optional().clone({
|
|
6152
|
+
types: schema17.spec.types.map(deepPartial)
|
|
6152
6153
|
});
|
|
6153
6154
|
}
|
|
6154
|
-
if ("optional" in
|
|
6155
|
-
return
|
|
6155
|
+
if ("optional" in schema17) {
|
|
6156
|
+
return schema17.optional();
|
|
6156
6157
|
}
|
|
6157
|
-
return
|
|
6158
|
+
return schema17;
|
|
6158
6159
|
}
|
|
6159
6160
|
var deepHas = (obj, p) => {
|
|
6160
6161
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6288,8 +6289,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6288
6289
|
next._sortErrors = this._sortErrors;
|
|
6289
6290
|
return next;
|
|
6290
6291
|
}
|
|
6291
|
-
concat(
|
|
6292
|
-
let next = super.concat(
|
|
6292
|
+
concat(schema17) {
|
|
6293
|
+
let next = super.concat(schema17);
|
|
6293
6294
|
let nextFields = next.fields;
|
|
6294
6295
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6295
6296
|
const target = nextFields[field];
|
|
@@ -6297,7 +6298,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6297
6298
|
}
|
|
6298
6299
|
return next.withMutation((s) => (
|
|
6299
6300
|
// XXX: excludes here is wrong
|
|
6300
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6301
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema17._excludedEdges])
|
|
6301
6302
|
));
|
|
6302
6303
|
}
|
|
6303
6304
|
_getDefault(options) {
|
|
@@ -6342,8 +6343,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6342
6343
|
}
|
|
6343
6344
|
partial() {
|
|
6344
6345
|
const partial = {};
|
|
6345
|
-
for (const [key,
|
|
6346
|
-
partial[key] = "optional" in
|
|
6346
|
+
for (const [key, schema17] of Object.entries(this.fields)) {
|
|
6347
|
+
partial[key] = "optional" in schema17 && schema17.optional instanceof Function ? schema17.optional() : schema17;
|
|
6347
6348
|
}
|
|
6348
6349
|
return this.setFields(partial);
|
|
6349
6350
|
}
|
|
@@ -6541,22 +6542,22 @@ var ArraySchema = class extends Schema {
|
|
|
6541
6542
|
json() {
|
|
6542
6543
|
return this.transform(parseJson);
|
|
6543
6544
|
}
|
|
6544
|
-
concat(
|
|
6545
|
-
let next = super.concat(
|
|
6545
|
+
concat(schema17) {
|
|
6546
|
+
let next = super.concat(schema17);
|
|
6546
6547
|
next.innerType = this.innerType;
|
|
6547
|
-
if (
|
|
6548
|
+
if (schema17.innerType)
|
|
6548
6549
|
next.innerType = next.innerType ? (
|
|
6549
6550
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6550
|
-
next.innerType.concat(
|
|
6551
|
-
) :
|
|
6551
|
+
next.innerType.concat(schema17.innerType)
|
|
6552
|
+
) : schema17.innerType;
|
|
6552
6553
|
return next;
|
|
6553
6554
|
}
|
|
6554
|
-
of(
|
|
6555
|
+
of(schema17) {
|
|
6555
6556
|
let next = this.clone();
|
|
6556
|
-
if (!isSchema(
|
|
6557
|
-
next.innerType =
|
|
6557
|
+
if (!isSchema(schema17)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema17));
|
|
6558
|
+
next.innerType = schema17;
|
|
6558
6559
|
next.spec = Object.assign({}, next.spec, {
|
|
6559
|
-
types:
|
|
6560
|
+
types: schema17
|
|
6560
6561
|
});
|
|
6561
6562
|
return next;
|
|
6562
6563
|
}
|
|
@@ -6700,7 +6701,7 @@ var TupleSchema = class extends Schema {
|
|
|
6700
6701
|
describe(options) {
|
|
6701
6702
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6702
6703
|
const base = super.describe(options);
|
|
6703
|
-
base.innerType = next.spec.types.map((
|
|
6704
|
+
base.innerType = next.spec.types.map((schema17, index) => {
|
|
6704
6705
|
var _innerOptions;
|
|
6705
6706
|
let innerOptions = options;
|
|
6706
6707
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6709,7 +6710,7 @@ var TupleSchema = class extends Schema {
|
|
|
6709
6710
|
value: innerOptions.value[index]
|
|
6710
6711
|
});
|
|
6711
6712
|
}
|
|
6712
|
-
return
|
|
6713
|
+
return schema17.describe(innerOptions);
|
|
6713
6714
|
});
|
|
6714
6715
|
return base;
|
|
6715
6716
|
}
|
|
@@ -8551,21 +8552,6 @@ var EVENT_LIST_ITEM = gql`
|
|
|
8551
8552
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
8552
8553
|
${RELATION_DATES_FRAGMENT}
|
|
8553
8554
|
`;
|
|
8554
|
-
var UNREGISTERED_VENDOR_LIST_ITEM_FIELDS_FRAGMENT = gql`
|
|
8555
|
-
fragment UnregisteredVendorListItemFields on UnregisteredVendorListItemType {
|
|
8556
|
-
_id
|
|
8557
|
-
categoryIds
|
|
8558
|
-
email
|
|
8559
|
-
invitations {
|
|
8560
|
-
dateTime {
|
|
8561
|
-
...DateTimeFields
|
|
8562
|
-
}
|
|
8563
|
-
eventId
|
|
8564
|
-
}
|
|
8565
|
-
name
|
|
8566
|
-
}
|
|
8567
|
-
${DATETIME_FIELDS_FRAGMENT}
|
|
8568
|
-
`;
|
|
8569
8555
|
var EVENT_INFO = gql`
|
|
8570
8556
|
fragment EventInfoFields on EventInfoType {
|
|
8571
8557
|
_id
|
|
@@ -8889,12 +8875,10 @@ var VENDOR_INFO = gql`
|
|
|
8889
8875
|
`;
|
|
8890
8876
|
var UNREGISTERED_VENDOR_INVITATION_FRAGMENT = gql`
|
|
8891
8877
|
fragment UnregisteredVendorInvitationFields on UnregisteredVendorInvitationType {
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
...DateTimeFields
|
|
8895
|
-
}
|
|
8896
|
-
eventId
|
|
8878
|
+
dateTime {
|
|
8879
|
+
...DateTimeFields
|
|
8897
8880
|
}
|
|
8881
|
+
inviterId
|
|
8898
8882
|
}
|
|
8899
8883
|
${DATETIME_FIELDS_FRAGMENT}
|
|
8900
8884
|
`;
|
|
@@ -10602,7 +10586,7 @@ var stallTypesSchema = create$3({
|
|
|
10602
10586
|
"",
|
|
10603
10587
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10604
10588
|
),
|
|
10605
|
-
stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(
|
|
10589
|
+
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"))
|
|
10606
10590
|
});
|
|
10607
10591
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10608
10592
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10629,7 +10613,7 @@ var socialMediaSchema = create$3({
|
|
|
10629
10613
|
is: (name) => !!name,
|
|
10630
10614
|
// If name has a value
|
|
10631
10615
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10632
|
-
otherwise: (
|
|
10616
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10633
10617
|
})
|
|
10634
10618
|
});
|
|
10635
10619
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10705,21 +10689,21 @@ var paymentInfoSchema = create$3({
|
|
|
10705
10689
|
).required("Please select a Payment method"),
|
|
10706
10690
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10707
10691
|
is: "bank_transfer",
|
|
10708
|
-
then: (
|
|
10709
|
-
otherwise: (
|
|
10692
|
+
then: (schema17) => schema17.required("Account holder name is required for bank transfer").trim(),
|
|
10693
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10710
10694
|
}),
|
|
10711
10695
|
accountNumber: create$6().when("paymentMethod", {
|
|
10712
10696
|
is: "bank_transfer",
|
|
10713
|
-
then: (
|
|
10697
|
+
then: (schema17) => schema17.required("Account number is required for bank transfer").matches(
|
|
10714
10698
|
nzBankAccountRegex,
|
|
10715
10699
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10716
10700
|
).trim(),
|
|
10717
|
-
otherwise: (
|
|
10701
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10718
10702
|
}),
|
|
10719
10703
|
link: create$6().when("paymentMethod", {
|
|
10720
10704
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10721
10705
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10722
|
-
otherwise: (
|
|
10706
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10723
10707
|
})
|
|
10724
10708
|
});
|
|
10725
10709
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10768,7 +10752,9 @@ var vendorSchema = globalResourceSchema.shape({
|
|
|
10768
10752
|
});
|
|
10769
10753
|
var unregisteredVendorSchema = create$3().shape({
|
|
10770
10754
|
categoryIds: create$2().of(create$6().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
10755
|
+
dateTime: create$2().of(dateTimeSchema).min(1, "DateTime list must contain at least one item").required("DateTime is required"),
|
|
10771
10756
|
email: emailOptionalSchema,
|
|
10757
|
+
inviterId: create$6().required("Inviter ID is required"),
|
|
10772
10758
|
name: create$6().label("Stallholder Name").trim().min(3, "Name must be at least 3 characters").required("Name is required")
|
|
10773
10759
|
});
|
|
10774
10760
|
var vendorInfoSchema = create$3().shape({
|
|
@@ -10869,8 +10855,8 @@ var userSchema = create$3().shape({
|
|
|
10869
10855
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10870
10856
|
is: (val) => !!val,
|
|
10871
10857
|
// only necessary if password typed
|
|
10872
|
-
then: (
|
|
10873
|
-
otherwise: (
|
|
10858
|
+
then: (schema17) => schema17.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10859
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10874
10860
|
}),
|
|
10875
10861
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10876
10862
|
});
|
|
@@ -10941,7 +10927,7 @@ var adSchema = create$3().shape({
|
|
|
10941
10927
|
return endDate > now;
|
|
10942
10928
|
}).when("start", {
|
|
10943
10929
|
is: (val) => val && val.length > 0,
|
|
10944
|
-
then: (
|
|
10930
|
+
then: (schema17) => schema17.test(
|
|
10945
10931
|
"is-after-start",
|
|
10946
10932
|
"End date must be after start date",
|
|
10947
10933
|
function(value) {
|
|
@@ -12217,7 +12203,7 @@ var schema9 = new MongooseSchema13(
|
|
|
12217
12203
|
required: false,
|
|
12218
12204
|
type: calendarWrapperSchema
|
|
12219
12205
|
},
|
|
12220
|
-
categories: [CategorySchema],
|
|
12206
|
+
categories: { required: true, type: [CategorySchema] },
|
|
12221
12207
|
foodTruck: { required: true, type: Boolean },
|
|
12222
12208
|
products: { required: false, type: productWrapperSchema },
|
|
12223
12209
|
relations: {
|
|
@@ -12296,19 +12282,47 @@ var schema10 = new MongooseSchema14(
|
|
|
12296
12282
|
);
|
|
12297
12283
|
var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
|
|
12298
12284
|
|
|
12299
|
-
// src/mongoose/
|
|
12285
|
+
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
12300
12286
|
var import_mongoose15 = __toESM(require("mongoose"));
|
|
12301
12287
|
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
12288
|
+
var invitationSchema = new MongooseSchema15(
|
|
12289
|
+
{
|
|
12290
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12291
|
+
inviterId: {
|
|
12292
|
+
ref: "Event",
|
|
12293
|
+
required: true,
|
|
12294
|
+
type: String
|
|
12295
|
+
}
|
|
12296
|
+
},
|
|
12297
|
+
{ _id: false }
|
|
12298
|
+
);
|
|
12302
12299
|
var schema11 = new MongooseSchema15(
|
|
12300
|
+
{
|
|
12301
|
+
categoryIds: { required: true, type: [String] },
|
|
12302
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12303
|
+
email: { required: true, type: String },
|
|
12304
|
+
invitations: { required: true, type: [invitationSchema] },
|
|
12305
|
+
name: { required: true, type: String }
|
|
12306
|
+
},
|
|
12307
|
+
{ timestamps: true }
|
|
12308
|
+
);
|
|
12309
|
+
schema11.index({ email: 1 }, { unique: true });
|
|
12310
|
+
schema11.index({ name: 1 });
|
|
12311
|
+
var UnregisteredVendorModel = import_mongoose15.default.models.UnregisteredVendor || import_mongoose15.default.model("UnregisteredVendor", schema11);
|
|
12312
|
+
|
|
12313
|
+
// src/mongoose/event/Event.ts
|
|
12314
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
12315
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
12316
|
+
var schema12 = new MongooseSchema16(
|
|
12303
12317
|
{
|
|
12304
12318
|
...baseResourceFields,
|
|
12305
12319
|
// Importing base resource fields from global.ts
|
|
12306
12320
|
claimed: { default: true, required: false, type: Boolean },
|
|
12307
|
-
dateTime: [dateTimeSchema3],
|
|
12321
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12308
12322
|
eventInfoId: {
|
|
12309
12323
|
ref: "EventInfo",
|
|
12310
12324
|
required: false,
|
|
12311
|
-
type:
|
|
12325
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
12312
12326
|
},
|
|
12313
12327
|
eventType: {
|
|
12314
12328
|
enum: Object.values(EnumEventType),
|
|
@@ -12337,18 +12351,18 @@ var schema11 = new MongooseSchema15(
|
|
|
12337
12351
|
},
|
|
12338
12352
|
{ timestamps: true }
|
|
12339
12353
|
);
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
var EventModel =
|
|
12354
|
+
schema12.index({ name: 1 });
|
|
12355
|
+
schema12.index({ description: 1 });
|
|
12356
|
+
schema12.index({ region: 1 });
|
|
12357
|
+
schema12.index({ "location.geo": "2dsphere" });
|
|
12358
|
+
schema12.index({ tags: 1 });
|
|
12359
|
+
schema12.index({ "associates.email": 1 });
|
|
12360
|
+
var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema12);
|
|
12347
12361
|
|
|
12348
12362
|
// src/mongoose/Partner.ts
|
|
12349
|
-
var
|
|
12350
|
-
var
|
|
12351
|
-
var
|
|
12363
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
12364
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
12365
|
+
var schema13 = new MongooseSchema17(
|
|
12352
12366
|
{
|
|
12353
12367
|
...baseResourceFields,
|
|
12354
12368
|
location: {
|
|
@@ -12364,19 +12378,19 @@ var schema12 = new MongooseSchema16(
|
|
|
12364
12378
|
},
|
|
12365
12379
|
{ timestamps: true }
|
|
12366
12380
|
);
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
var PartnerModel =
|
|
12381
|
+
schema13.index({ name: 1 });
|
|
12382
|
+
schema13.index({ description: 1 });
|
|
12383
|
+
schema13.index({ region: 1 });
|
|
12384
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
12385
|
+
schema13.index({ "associates.email": 1 });
|
|
12386
|
+
var PartnerModel = import_mongoose17.default.models.Partner || import_mongoose17.default.model("Partner", schema13);
|
|
12373
12387
|
|
|
12374
12388
|
// src/mongoose/Post.ts
|
|
12375
|
-
var
|
|
12376
|
-
var
|
|
12377
|
-
var contentSchema = new
|
|
12389
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
12390
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
12391
|
+
var contentSchema = new MongooseSchema18(
|
|
12378
12392
|
{
|
|
12379
|
-
contentData:
|
|
12393
|
+
contentData: import_mongoose18.Schema.Types.Mixed,
|
|
12380
12394
|
contentOrder: { required: true, type: Number },
|
|
12381
12395
|
contentType: {
|
|
12382
12396
|
enum: Object.values(EnumPostContentType),
|
|
@@ -12386,7 +12400,7 @@ var contentSchema = new MongooseSchema17(
|
|
|
12386
12400
|
},
|
|
12387
12401
|
{ _id: false }
|
|
12388
12402
|
);
|
|
12389
|
-
var
|
|
12403
|
+
var schema14 = new MongooseSchema18(
|
|
12390
12404
|
{
|
|
12391
12405
|
active: { default: true, required: true, type: Boolean },
|
|
12392
12406
|
caption: { required: true, type: String },
|
|
@@ -12422,15 +12436,15 @@ var schema13 = new MongooseSchema17(
|
|
|
12422
12436
|
},
|
|
12423
12437
|
{ timestamps: true }
|
|
12424
12438
|
);
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
var PostModel =
|
|
12439
|
+
schema14.index({ title: 1 });
|
|
12440
|
+
schema14.index({ tags: 1 });
|
|
12441
|
+
var PostModel = import_mongoose18.default.models.Post || import_mongoose18.default.model("Post", schema14);
|
|
12428
12442
|
|
|
12429
12443
|
// src/mongoose/AppSetting.ts
|
|
12430
|
-
var
|
|
12431
|
-
var
|
|
12444
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
12445
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
12432
12446
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
12433
|
-
var AppSettingSchema = new
|
|
12447
|
+
var AppSettingSchema = new MongooseSchema19(
|
|
12434
12448
|
{
|
|
12435
12449
|
activeSchoolsStudentCountTotal: {
|
|
12436
12450
|
default: 0,
|
|
@@ -12456,18 +12470,18 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
12456
12470
|
},
|
|
12457
12471
|
{ timestamps: true }
|
|
12458
12472
|
);
|
|
12459
|
-
var AppSettingModel =
|
|
12473
|
+
var AppSettingModel = import_mongoose19.default.models.AppSetting || import_mongoose19.default.model("AppSetting", AppSettingSchema);
|
|
12460
12474
|
|
|
12461
12475
|
// src/mongoose/game/Game.ts
|
|
12462
|
-
var
|
|
12476
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
12463
12477
|
|
|
12464
12478
|
// src/mongoose/game/DailyClue.ts
|
|
12465
|
-
var
|
|
12479
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12466
12480
|
|
|
12467
12481
|
// src/mongoose/game/utils.ts
|
|
12468
|
-
var
|
|
12469
|
-
var
|
|
12470
|
-
var schemaGameDate = new
|
|
12482
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
12483
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
12484
|
+
var schemaGameDate = new MongooseSchema20(
|
|
12471
12485
|
{
|
|
12472
12486
|
endDate: { required: true, type: Date },
|
|
12473
12487
|
startDate: { required: true, type: Date }
|
|
@@ -12476,8 +12490,8 @@ var schemaGameDate = new MongooseSchema19(
|
|
|
12476
12490
|
);
|
|
12477
12491
|
|
|
12478
12492
|
// src/mongoose/game/DailyClue.ts
|
|
12479
|
-
var
|
|
12480
|
-
var schemaLetters = new
|
|
12493
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
12494
|
+
var schemaLetters = new MongooseSchema21(
|
|
12481
12495
|
{
|
|
12482
12496
|
collected: { required: false, type: [String] },
|
|
12483
12497
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -12485,14 +12499,14 @@ var schemaLetters = new MongooseSchema20(
|
|
|
12485
12499
|
},
|
|
12486
12500
|
{ _id: false }
|
|
12487
12501
|
);
|
|
12488
|
-
var schemaDailyClueBaseGame = new
|
|
12502
|
+
var schemaDailyClueBaseGame = new MongooseSchema21(
|
|
12489
12503
|
{
|
|
12490
12504
|
gameDate: { required: true, type: schemaGameDate },
|
|
12491
12505
|
gameSolution: { required: true, type: String }
|
|
12492
12506
|
},
|
|
12493
12507
|
{ _id: false }
|
|
12494
12508
|
);
|
|
12495
|
-
var schemaDailyClueGameData = new
|
|
12509
|
+
var schemaDailyClueGameData = new MongooseSchema21(
|
|
12496
12510
|
{
|
|
12497
12511
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
12498
12512
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -12507,9 +12521,9 @@ var schemaDailyClueGameData = new MongooseSchema20(
|
|
|
12507
12521
|
);
|
|
12508
12522
|
|
|
12509
12523
|
// src/mongoose/game/MiniQuiz.ts
|
|
12510
|
-
var
|
|
12511
|
-
var
|
|
12512
|
-
var schemaMiniQuizAnswer = new
|
|
12524
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
12525
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
12526
|
+
var schemaMiniQuizAnswer = new MongooseSchema22(
|
|
12513
12527
|
{
|
|
12514
12528
|
answer: { required: true, type: String },
|
|
12515
12529
|
answerId: { required: true, type: String },
|
|
@@ -12517,7 +12531,7 @@ var schemaMiniQuizAnswer = new MongooseSchema21(
|
|
|
12517
12531
|
},
|
|
12518
12532
|
{ _id: false }
|
|
12519
12533
|
);
|
|
12520
|
-
var schemaMiniQuizQuestion = new
|
|
12534
|
+
var schemaMiniQuizQuestion = new MongooseSchema22(
|
|
12521
12535
|
{
|
|
12522
12536
|
answers: { required: true, type: [schemaMiniQuizAnswer] },
|
|
12523
12537
|
question: { required: true, type: String },
|
|
@@ -12525,20 +12539,20 @@ var schemaMiniQuizQuestion = new MongooseSchema21(
|
|
|
12525
12539
|
},
|
|
12526
12540
|
{ _id: false }
|
|
12527
12541
|
);
|
|
12528
|
-
var schemaMiniQuizBaseGame = new
|
|
12542
|
+
var schemaMiniQuizBaseGame = new MongooseSchema22(
|
|
12529
12543
|
{
|
|
12530
12544
|
questions: { required: true, type: [schemaMiniQuizQuestion] }
|
|
12531
12545
|
},
|
|
12532
12546
|
{ _id: false }
|
|
12533
12547
|
);
|
|
12534
|
-
var schemaMiniQuizAnsweredQuestion = new
|
|
12548
|
+
var schemaMiniQuizAnsweredQuestion = new MongooseSchema22(
|
|
12535
12549
|
{
|
|
12536
12550
|
questionId: { required: true, type: String },
|
|
12537
12551
|
selectedAnswerId: { required: true, type: String }
|
|
12538
12552
|
},
|
|
12539
12553
|
{ _id: false }
|
|
12540
12554
|
);
|
|
12541
|
-
var schemaMiniQuizGameData = new
|
|
12555
|
+
var schemaMiniQuizGameData = new MongooseSchema22(
|
|
12542
12556
|
{
|
|
12543
12557
|
answeredQuestions: {
|
|
12544
12558
|
default: null,
|
|
@@ -12553,18 +12567,18 @@ var schemaMiniQuizGameData = new MongooseSchema21(
|
|
|
12553
12567
|
);
|
|
12554
12568
|
|
|
12555
12569
|
// src/mongoose/game/Game.ts
|
|
12556
|
-
var
|
|
12570
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
12557
12571
|
var gameDataSchemas = {
|
|
12558
12572
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
12559
12573
|
[EnumGameType.MINI_QUIZ]: schemaMiniQuizGameData
|
|
12560
12574
|
};
|
|
12561
12575
|
var gameDataDefinition = Object.fromEntries(
|
|
12562
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12576
|
+
Object.entries(gameDataSchemas).map(([key, schema17]) => [
|
|
12563
12577
|
key,
|
|
12564
|
-
{ default: null, required: false, type:
|
|
12578
|
+
{ default: null, required: false, type: schema17 }
|
|
12565
12579
|
])
|
|
12566
12580
|
);
|
|
12567
|
-
var gameHistorySchema = new
|
|
12581
|
+
var gameHistorySchema = new MongooseSchema23(
|
|
12568
12582
|
{
|
|
12569
12583
|
createdAt: { required: true, type: Date },
|
|
12570
12584
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -12582,7 +12596,7 @@ var gameHistorySchema = new MongooseSchema22(
|
|
|
12582
12596
|
},
|
|
12583
12597
|
{ _id: false }
|
|
12584
12598
|
);
|
|
12585
|
-
var gameTypeSchema = new
|
|
12599
|
+
var gameTypeSchema = new MongooseSchema23(
|
|
12586
12600
|
{
|
|
12587
12601
|
active: { default: true, required: true, type: Boolean },
|
|
12588
12602
|
gameData: gameDataDefinition,
|
|
@@ -12596,7 +12610,7 @@ var gameTypeSchema = new MongooseSchema22(
|
|
|
12596
12610
|
},
|
|
12597
12611
|
{ timestamps: true }
|
|
12598
12612
|
);
|
|
12599
|
-
var
|
|
12613
|
+
var schema15 = new MongooseSchema23(
|
|
12600
12614
|
{
|
|
12601
12615
|
active: { default: false, required: true, type: Boolean },
|
|
12602
12616
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -12609,12 +12623,12 @@ var schema14 = new MongooseSchema22(
|
|
|
12609
12623
|
},
|
|
12610
12624
|
{ timestamps: true }
|
|
12611
12625
|
);
|
|
12612
|
-
var GameModel =
|
|
12626
|
+
var GameModel = import_mongoose23.default.models.Game || import_mongoose23.default.model("Game", schema15);
|
|
12613
12627
|
|
|
12614
12628
|
// src/mongoose/School.ts
|
|
12615
|
-
var
|
|
12616
|
-
var
|
|
12617
|
-
var campaignsSchema = new
|
|
12629
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
12630
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
12631
|
+
var campaignsSchema = new MongooseSchema24(
|
|
12618
12632
|
{
|
|
12619
12633
|
endDate: { required: true, type: Date },
|
|
12620
12634
|
name: { required: true, type: String },
|
|
@@ -12622,7 +12636,7 @@ var campaignsSchema = new MongooseSchema23(
|
|
|
12622
12636
|
},
|
|
12623
12637
|
{ _id: false }
|
|
12624
12638
|
);
|
|
12625
|
-
var
|
|
12639
|
+
var schema16 = new MongooseSchema24(
|
|
12626
12640
|
{
|
|
12627
12641
|
// New schools are active by default
|
|
12628
12642
|
active: { default: true, required: true, type: Boolean },
|
|
@@ -12648,10 +12662,10 @@ var schema15 = new MongooseSchema23(
|
|
|
12648
12662
|
},
|
|
12649
12663
|
{ timestamps: true }
|
|
12650
12664
|
);
|
|
12651
|
-
var SchoolModel =
|
|
12665
|
+
var SchoolModel = import_mongoose24.default.models.School || import_mongoose24.default.model("School", schema16);
|
|
12652
12666
|
|
|
12653
12667
|
// src/service/database.ts
|
|
12654
|
-
var
|
|
12668
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
12655
12669
|
var connectToDatabase = async ({
|
|
12656
12670
|
appName,
|
|
12657
12671
|
dbName,
|
|
@@ -12664,7 +12678,7 @@ var connectToDatabase = async ({
|
|
|
12664
12678
|
// Fallback to MongoDB Atlas connection string
|
|
12665
12679
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
12666
12680
|
);
|
|
12667
|
-
await
|
|
12681
|
+
await import_mongoose25.default.connect(mongoUri);
|
|
12668
12682
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
12669
12683
|
console.log(
|
|
12670
12684
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12843,9 +12857,9 @@ async function updateAdStatuses() {
|
|
|
12843
12857
|
}
|
|
12844
12858
|
|
|
12845
12859
|
// src/service/associate.ts
|
|
12846
|
-
var
|
|
12860
|
+
var import_mongoose27 = __toESM(require("mongoose"));
|
|
12847
12861
|
function normalizeObjectId(id) {
|
|
12848
|
-
return typeof id === "string" ? new
|
|
12862
|
+
return typeof id === "string" ? new import_mongoose27.default.Types.ObjectId(id) : id;
|
|
12849
12863
|
}
|
|
12850
12864
|
async function getAssociateEmailsForResource({
|
|
12851
12865
|
normalizedResourceId,
|
|
@@ -12997,12 +13011,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
12997
13011
|
}
|
|
12998
13012
|
|
|
12999
13013
|
// src/service/objectIdToString.ts
|
|
13000
|
-
var
|
|
13014
|
+
var import_mongoose30 = __toESM(require("mongoose"));
|
|
13001
13015
|
function convertObjectIdsToStrings(obj) {
|
|
13002
13016
|
if (obj === null || obj === void 0) {
|
|
13003
13017
|
return obj;
|
|
13004
13018
|
}
|
|
13005
|
-
if (obj instanceof
|
|
13019
|
+
if (obj instanceof import_mongoose30.default.Types.ObjectId) {
|
|
13006
13020
|
return obj.toString();
|
|
13007
13021
|
}
|
|
13008
13022
|
if (Array.isArray(obj)) {
|
|
@@ -13046,7 +13060,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
|
13046
13060
|
|
|
13047
13061
|
// src/types/index.ts
|
|
13048
13062
|
var import_express = __toESM(require("express"));
|
|
13049
|
-
var
|
|
13063
|
+
var import_mongoose32 = __toESM(require("mongoose"));
|
|
13050
13064
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
13051
13065
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
13052
13066
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -13080,6 +13094,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
13080
13094
|
SchoolModel,
|
|
13081
13095
|
SocialMediaTypeSchema,
|
|
13082
13096
|
StallTypeSchema,
|
|
13097
|
+
UnregisteredVendorModel,
|
|
13083
13098
|
UserModel,
|
|
13084
13099
|
VendorInfoModel,
|
|
13085
13100
|
VendorModel,
|