@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/service/index.cjs
CHANGED
|
@@ -4722,10 +4722,10 @@ var Condition = class _Condition {
|
|
|
4722
4722
|
otherwise
|
|
4723
4723
|
} = config;
|
|
4724
4724
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4725
|
-
return new _Condition(refs, (values,
|
|
4725
|
+
return new _Condition(refs, (values, schema17) => {
|
|
4726
4726
|
var _branch;
|
|
4727
4727
|
let branch = check(...values) ? then : otherwise;
|
|
4728
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4728
|
+
return (_branch = branch == null ? void 0 : branch(schema17)) != null ? _branch : schema17;
|
|
4729
4729
|
});
|
|
4730
4730
|
}
|
|
4731
4731
|
constructor(refs, builder) {
|
|
@@ -4739,13 +4739,13 @@ var Condition = class _Condition {
|
|
|
4739
4739
|
// TODO: ? operator here?
|
|
4740
4740
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4741
4741
|
));
|
|
4742
|
-
let
|
|
4743
|
-
if (
|
|
4744
|
-
|
|
4742
|
+
let schema17 = this.fn(values, base, options);
|
|
4743
|
+
if (schema17 === void 0 || // @ts-ignore this can be base
|
|
4744
|
+
schema17 === base) {
|
|
4745
4745
|
return base;
|
|
4746
4746
|
}
|
|
4747
|
-
if (!isSchema(
|
|
4748
|
-
return
|
|
4747
|
+
if (!isSchema(schema17)) throw new TypeError("conditions must return a schema object");
|
|
4748
|
+
return schema17.resolve(options);
|
|
4749
4749
|
}
|
|
4750
4750
|
};
|
|
4751
4751
|
var prefixes = {
|
|
@@ -4815,7 +4815,7 @@ function createValidation(config) {
|
|
|
4815
4815
|
path = "",
|
|
4816
4816
|
options,
|
|
4817
4817
|
originalValue,
|
|
4818
|
-
schema:
|
|
4818
|
+
schema: schema17
|
|
4819
4819
|
}, panic, next) {
|
|
4820
4820
|
const {
|
|
4821
4821
|
name,
|
|
@@ -4827,8 +4827,8 @@ function createValidation(config) {
|
|
|
4827
4827
|
let {
|
|
4828
4828
|
parent,
|
|
4829
4829
|
context,
|
|
4830
|
-
abortEarly =
|
|
4831
|
-
disableStackTrace =
|
|
4830
|
+
abortEarly = schema17.spec.abortEarly,
|
|
4831
|
+
disableStackTrace = schema17.spec.disableStackTrace
|
|
4832
4832
|
} = options;
|
|
4833
4833
|
function resolve(item) {
|
|
4834
4834
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4837,9 +4837,9 @@ function createValidation(config) {
|
|
|
4837
4837
|
const nextParams = Object.assign({
|
|
4838
4838
|
value,
|
|
4839
4839
|
originalValue,
|
|
4840
|
-
label:
|
|
4840
|
+
label: schema17.spec.label,
|
|
4841
4841
|
path: overrides.path || path,
|
|
4842
|
-
spec:
|
|
4842
|
+
spec: schema17.spec,
|
|
4843
4843
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4844
4844
|
}, params, overrides.params);
|
|
4845
4845
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4857,7 +4857,7 @@ function createValidation(config) {
|
|
|
4857
4857
|
resolve,
|
|
4858
4858
|
options,
|
|
4859
4859
|
originalValue,
|
|
4860
|
-
schema:
|
|
4860
|
+
schema: schema17
|
|
4861
4861
|
};
|
|
4862
4862
|
const handleResult = (validOrError) => {
|
|
4863
4863
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4891,42 +4891,42 @@ function createValidation(config) {
|
|
|
4891
4891
|
validate.OPTIONS = config;
|
|
4892
4892
|
return validate;
|
|
4893
4893
|
}
|
|
4894
|
-
function getIn(
|
|
4894
|
+
function getIn(schema17, path, value, context = value) {
|
|
4895
4895
|
let parent, lastPart, lastPartDebug;
|
|
4896
4896
|
if (!path) return {
|
|
4897
4897
|
parent,
|
|
4898
4898
|
parentPath: path,
|
|
4899
|
-
schema:
|
|
4899
|
+
schema: schema17
|
|
4900
4900
|
};
|
|
4901
4901
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4902
4902
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4903
|
-
|
|
4903
|
+
schema17 = schema17.resolve({
|
|
4904
4904
|
context,
|
|
4905
4905
|
parent,
|
|
4906
4906
|
value
|
|
4907
4907
|
});
|
|
4908
|
-
let isTuple =
|
|
4908
|
+
let isTuple = schema17.type === "tuple";
|
|
4909
4909
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4910
|
-
if (
|
|
4910
|
+
if (schema17.innerType || isTuple) {
|
|
4911
4911
|
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]"`);
|
|
4912
4912
|
if (value && idx >= value.length) {
|
|
4913
4913
|
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. `);
|
|
4914
4914
|
}
|
|
4915
4915
|
parent = value;
|
|
4916
4916
|
value = value && value[idx];
|
|
4917
|
-
|
|
4917
|
+
schema17 = isTuple ? schema17.spec.types[idx] : schema17.innerType;
|
|
4918
4918
|
}
|
|
4919
4919
|
if (!isArray) {
|
|
4920
|
-
if (!
|
|
4920
|
+
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}")`);
|
|
4921
4921
|
parent = value;
|
|
4922
4922
|
value = value && value[part];
|
|
4923
|
-
|
|
4923
|
+
schema17 = schema17.fields[part];
|
|
4924
4924
|
}
|
|
4925
4925
|
lastPart = part;
|
|
4926
4926
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4927
4927
|
});
|
|
4928
4928
|
return {
|
|
4929
|
-
schema:
|
|
4929
|
+
schema: schema17,
|
|
4930
4930
|
parent,
|
|
4931
4931
|
parentPath: lastPart
|
|
4932
4932
|
};
|
|
@@ -5063,20 +5063,20 @@ var Schema = class {
|
|
|
5063
5063
|
this._mutate = before;
|
|
5064
5064
|
return result;
|
|
5065
5065
|
}
|
|
5066
|
-
concat(
|
|
5067
|
-
if (!
|
|
5068
|
-
if (
|
|
5066
|
+
concat(schema17) {
|
|
5067
|
+
if (!schema17 || schema17 === this) return this;
|
|
5068
|
+
if (schema17.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema17.type}`);
|
|
5069
5069
|
let base = this;
|
|
5070
|
-
let combined =
|
|
5070
|
+
let combined = schema17.clone();
|
|
5071
5071
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5072
5072
|
combined.spec = mergedSpec;
|
|
5073
5073
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5074
|
-
combined._whitelist = base._whitelist.merge(
|
|
5075
|
-
combined._blacklist = base._blacklist.merge(
|
|
5074
|
+
combined._whitelist = base._whitelist.merge(schema17._whitelist, schema17._blacklist);
|
|
5075
|
+
combined._blacklist = base._blacklist.merge(schema17._blacklist, schema17._whitelist);
|
|
5076
5076
|
combined.tests = base.tests;
|
|
5077
5077
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5078
5078
|
combined.withMutation((next) => {
|
|
5079
|
-
|
|
5079
|
+
schema17.tests.forEach((fn) => {
|
|
5080
5080
|
next.test(fn.OPTIONS);
|
|
5081
5081
|
});
|
|
5082
5082
|
});
|
|
@@ -5092,15 +5092,15 @@ var Schema = class {
|
|
|
5092
5092
|
return this._typeCheck(v);
|
|
5093
5093
|
}
|
|
5094
5094
|
resolve(options) {
|
|
5095
|
-
let
|
|
5096
|
-
if (
|
|
5097
|
-
let conditions =
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5095
|
+
let schema17 = this;
|
|
5096
|
+
if (schema17.conditions.length) {
|
|
5097
|
+
let conditions = schema17.conditions;
|
|
5098
|
+
schema17 = schema17.clone();
|
|
5099
|
+
schema17.conditions = [];
|
|
5100
|
+
schema17 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema17);
|
|
5101
|
+
schema17 = schema17.resolve(options);
|
|
5102
5102
|
}
|
|
5103
|
-
return
|
|
5103
|
+
return schema17;
|
|
5104
5104
|
}
|
|
5105
5105
|
resolveOptions(options) {
|
|
5106
5106
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5254,11 +5254,11 @@ attempted value: ${formattedValue}
|
|
|
5254
5254
|
}
|
|
5255
5255
|
validate(value, options) {
|
|
5256
5256
|
var _options$disableStack2;
|
|
5257
|
-
let
|
|
5257
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5258
5258
|
value
|
|
5259
5259
|
}));
|
|
5260
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5261
|
-
return new Promise((resolve, reject) =>
|
|
5260
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema17.spec.disableStackTrace;
|
|
5261
|
+
return new Promise((resolve, reject) => schema17._validate(value, options, (error, parsed) => {
|
|
5262
5262
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5263
5263
|
reject(error);
|
|
5264
5264
|
}, (errors, validated) => {
|
|
@@ -5268,12 +5268,12 @@ attempted value: ${formattedValue}
|
|
|
5268
5268
|
}
|
|
5269
5269
|
validateSync(value, options) {
|
|
5270
5270
|
var _options$disableStack3;
|
|
5271
|
-
let
|
|
5271
|
+
let schema17 = this.resolve(Object.assign({}, options, {
|
|
5272
5272
|
value
|
|
5273
5273
|
}));
|
|
5274
5274
|
let result;
|
|
5275
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5276
|
-
|
|
5275
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema17.spec.disableStackTrace;
|
|
5276
|
+
schema17._validate(value, Object.assign({}, options, {
|
|
5277
5277
|
sync: true
|
|
5278
5278
|
}), (error, parsed) => {
|
|
5279
5279
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5307,8 +5307,8 @@ attempted value: ${formattedValue}
|
|
|
5307
5307
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5308
5308
|
}
|
|
5309
5309
|
getDefault(options) {
|
|
5310
|
-
let
|
|
5311
|
-
return
|
|
5310
|
+
let schema17 = this.resolve(options || {});
|
|
5311
|
+
return schema17._getDefault(options);
|
|
5312
5312
|
}
|
|
5313
5313
|
default(def) {
|
|
5314
5314
|
if (arguments.length === 0) {
|
|
@@ -5543,9 +5543,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5543
5543
|
const {
|
|
5544
5544
|
parent,
|
|
5545
5545
|
parentPath,
|
|
5546
|
-
schema:
|
|
5546
|
+
schema: schema17
|
|
5547
5547
|
} = getIn(this, path, value, options.context);
|
|
5548
|
-
return
|
|
5548
|
+
return schema17[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5549
5549
|
parent,
|
|
5550
5550
|
path
|
|
5551
5551
|
}));
|
|
@@ -5719,7 +5719,7 @@ var StringSchema = class extends Schema {
|
|
|
5719
5719
|
});
|
|
5720
5720
|
}
|
|
5721
5721
|
required(message) {
|
|
5722
|
-
return super.required(message).withMutation((
|
|
5722
|
+
return super.required(message).withMutation((schema17) => schema17.test({
|
|
5723
5723
|
message: message || mixed.required,
|
|
5724
5724
|
name: "required",
|
|
5725
5725
|
skipAbsent: true,
|
|
@@ -5727,9 +5727,9 @@ var StringSchema = class extends Schema {
|
|
|
5727
5727
|
}));
|
|
5728
5728
|
}
|
|
5729
5729
|
notRequired() {
|
|
5730
|
-
return super.notRequired().withMutation((
|
|
5731
|
-
|
|
5732
|
-
return
|
|
5730
|
+
return super.notRequired().withMutation((schema17) => {
|
|
5731
|
+
schema17.tests = schema17.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5732
|
+
return schema17;
|
|
5733
5733
|
});
|
|
5734
5734
|
}
|
|
5735
5735
|
length(length, message = string.length) {
|
|
@@ -6118,28 +6118,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6118
6118
|
}
|
|
6119
6119
|
return ctx.isType(parsed) ? parsed : value;
|
|
6120
6120
|
};
|
|
6121
|
-
function deepPartial(
|
|
6122
|
-
if ("fields" in
|
|
6121
|
+
function deepPartial(schema17) {
|
|
6122
|
+
if ("fields" in schema17) {
|
|
6123
6123
|
const partial = {};
|
|
6124
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6124
|
+
for (const [key, fieldSchema] of Object.entries(schema17.fields)) {
|
|
6125
6125
|
partial[key] = deepPartial(fieldSchema);
|
|
6126
6126
|
}
|
|
6127
|
-
return
|
|
6127
|
+
return schema17.setFields(partial);
|
|
6128
6128
|
}
|
|
6129
|
-
if (
|
|
6130
|
-
const nextArray =
|
|
6129
|
+
if (schema17.type === "array") {
|
|
6130
|
+
const nextArray = schema17.optional();
|
|
6131
6131
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6132
6132
|
return nextArray;
|
|
6133
6133
|
}
|
|
6134
|
-
if (
|
|
6135
|
-
return
|
|
6136
|
-
types:
|
|
6134
|
+
if (schema17.type === "tuple") {
|
|
6135
|
+
return schema17.optional().clone({
|
|
6136
|
+
types: schema17.spec.types.map(deepPartial)
|
|
6137
6137
|
});
|
|
6138
6138
|
}
|
|
6139
|
-
if ("optional" in
|
|
6140
|
-
return
|
|
6139
|
+
if ("optional" in schema17) {
|
|
6140
|
+
return schema17.optional();
|
|
6141
6141
|
}
|
|
6142
|
-
return
|
|
6142
|
+
return schema17;
|
|
6143
6143
|
}
|
|
6144
6144
|
var deepHas = (obj, p) => {
|
|
6145
6145
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6273,8 +6273,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6273
6273
|
next._sortErrors = this._sortErrors;
|
|
6274
6274
|
return next;
|
|
6275
6275
|
}
|
|
6276
|
-
concat(
|
|
6277
|
-
let next = super.concat(
|
|
6276
|
+
concat(schema17) {
|
|
6277
|
+
let next = super.concat(schema17);
|
|
6278
6278
|
let nextFields = next.fields;
|
|
6279
6279
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6280
6280
|
const target = nextFields[field];
|
|
@@ -6282,7 +6282,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6282
6282
|
}
|
|
6283
6283
|
return next.withMutation((s) => (
|
|
6284
6284
|
// XXX: excludes here is wrong
|
|
6285
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6285
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema17._excludedEdges])
|
|
6286
6286
|
));
|
|
6287
6287
|
}
|
|
6288
6288
|
_getDefault(options) {
|
|
@@ -6327,8 +6327,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6327
6327
|
}
|
|
6328
6328
|
partial() {
|
|
6329
6329
|
const partial = {};
|
|
6330
|
-
for (const [key,
|
|
6331
|
-
partial[key] = "optional" in
|
|
6330
|
+
for (const [key, schema17] of Object.entries(this.fields)) {
|
|
6331
|
+
partial[key] = "optional" in schema17 && schema17.optional instanceof Function ? schema17.optional() : schema17;
|
|
6332
6332
|
}
|
|
6333
6333
|
return this.setFields(partial);
|
|
6334
6334
|
}
|
|
@@ -6526,22 +6526,22 @@ var ArraySchema = class extends Schema {
|
|
|
6526
6526
|
json() {
|
|
6527
6527
|
return this.transform(parseJson);
|
|
6528
6528
|
}
|
|
6529
|
-
concat(
|
|
6530
|
-
let next = super.concat(
|
|
6529
|
+
concat(schema17) {
|
|
6530
|
+
let next = super.concat(schema17);
|
|
6531
6531
|
next.innerType = this.innerType;
|
|
6532
|
-
if (
|
|
6532
|
+
if (schema17.innerType)
|
|
6533
6533
|
next.innerType = next.innerType ? (
|
|
6534
6534
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6535
|
-
next.innerType.concat(
|
|
6536
|
-
) :
|
|
6535
|
+
next.innerType.concat(schema17.innerType)
|
|
6536
|
+
) : schema17.innerType;
|
|
6537
6537
|
return next;
|
|
6538
6538
|
}
|
|
6539
|
-
of(
|
|
6539
|
+
of(schema17) {
|
|
6540
6540
|
let next = this.clone();
|
|
6541
|
-
if (!isSchema(
|
|
6542
|
-
next.innerType =
|
|
6541
|
+
if (!isSchema(schema17)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema17));
|
|
6542
|
+
next.innerType = schema17;
|
|
6543
6543
|
next.spec = Object.assign({}, next.spec, {
|
|
6544
|
-
types:
|
|
6544
|
+
types: schema17
|
|
6545
6545
|
});
|
|
6546
6546
|
return next;
|
|
6547
6547
|
}
|
|
@@ -6685,7 +6685,7 @@ var TupleSchema = class extends Schema {
|
|
|
6685
6685
|
describe(options) {
|
|
6686
6686
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6687
6687
|
const base = super.describe(options);
|
|
6688
|
-
base.innerType = next.spec.types.map((
|
|
6688
|
+
base.innerType = next.spec.types.map((schema17, index) => {
|
|
6689
6689
|
var _innerOptions;
|
|
6690
6690
|
let innerOptions = options;
|
|
6691
6691
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6694,7 +6694,7 @@ var TupleSchema = class extends Schema {
|
|
|
6694
6694
|
value: innerOptions.value[index]
|
|
6695
6695
|
});
|
|
6696
6696
|
}
|
|
6697
|
-
return
|
|
6697
|
+
return schema17.describe(innerOptions);
|
|
6698
6698
|
});
|
|
6699
6699
|
return base;
|
|
6700
6700
|
}
|
|
@@ -8536,21 +8536,6 @@ var EVENT_LIST_ITEM = gql`
|
|
|
8536
8536
|
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
8537
8537
|
${RELATION_DATES_FRAGMENT}
|
|
8538
8538
|
`;
|
|
8539
|
-
var UNREGISTERED_VENDOR_LIST_ITEM_FIELDS_FRAGMENT = gql`
|
|
8540
|
-
fragment UnregisteredVendorListItemFields on UnregisteredVendorListItemType {
|
|
8541
|
-
_id
|
|
8542
|
-
categoryIds
|
|
8543
|
-
email
|
|
8544
|
-
invitations {
|
|
8545
|
-
dateTime {
|
|
8546
|
-
...DateTimeFields
|
|
8547
|
-
}
|
|
8548
|
-
eventId
|
|
8549
|
-
}
|
|
8550
|
-
name
|
|
8551
|
-
}
|
|
8552
|
-
${DATETIME_FIELDS_FRAGMENT}
|
|
8553
|
-
`;
|
|
8554
8539
|
var EVENT_INFO = gql`
|
|
8555
8540
|
fragment EventInfoFields on EventInfoType {
|
|
8556
8541
|
_id
|
|
@@ -8874,12 +8859,10 @@ var VENDOR_INFO = gql`
|
|
|
8874
8859
|
`;
|
|
8875
8860
|
var UNREGISTERED_VENDOR_INVITATION_FRAGMENT = gql`
|
|
8876
8861
|
fragment UnregisteredVendorInvitationFields on UnregisteredVendorInvitationType {
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
...DateTimeFields
|
|
8880
|
-
}
|
|
8881
|
-
eventId
|
|
8862
|
+
dateTime {
|
|
8863
|
+
...DateTimeFields
|
|
8882
8864
|
}
|
|
8865
|
+
inviterId
|
|
8883
8866
|
}
|
|
8884
8867
|
${DATETIME_FIELDS_FRAGMENT}
|
|
8885
8868
|
`;
|
|
@@ -10587,7 +10570,7 @@ var stallTypesSchema = create$3({
|
|
|
10587
10570
|
"",
|
|
10588
10571
|
noLeadingZeros("Stall price", { allowDecimal: true })
|
|
10589
10572
|
),
|
|
10590
|
-
stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(
|
|
10573
|
+
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"))
|
|
10591
10574
|
});
|
|
10592
10575
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
10593
10576
|
stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
|
|
@@ -10614,7 +10597,7 @@ var socialMediaSchema = create$3({
|
|
|
10614
10597
|
is: (name) => !!name,
|
|
10615
10598
|
// If name has a value
|
|
10616
10599
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10617
|
-
otherwise: (
|
|
10600
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10618
10601
|
})
|
|
10619
10602
|
});
|
|
10620
10603
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10690,21 +10673,21 @@ var paymentInfoSchema = create$3({
|
|
|
10690
10673
|
).required("Please select a Payment method"),
|
|
10691
10674
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10692
10675
|
is: "bank_transfer",
|
|
10693
|
-
then: (
|
|
10694
|
-
otherwise: (
|
|
10676
|
+
then: (schema17) => schema17.required("Account holder name is required for bank transfer").trim(),
|
|
10677
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10695
10678
|
}),
|
|
10696
10679
|
accountNumber: create$6().when("paymentMethod", {
|
|
10697
10680
|
is: "bank_transfer",
|
|
10698
|
-
then: (
|
|
10681
|
+
then: (schema17) => schema17.required("Account number is required for bank transfer").matches(
|
|
10699
10682
|
nzBankAccountRegex,
|
|
10700
10683
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10701
10684
|
).trim(),
|
|
10702
|
-
otherwise: (
|
|
10685
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10703
10686
|
}),
|
|
10704
10687
|
link: create$6().when("paymentMethod", {
|
|
10705
10688
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10706
10689
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10707
|
-
otherwise: (
|
|
10690
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10708
10691
|
})
|
|
10709
10692
|
});
|
|
10710
10693
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10753,7 +10736,9 @@ var vendorSchema = globalResourceSchema.shape({
|
|
|
10753
10736
|
});
|
|
10754
10737
|
var unregisteredVendorSchema = create$3().shape({
|
|
10755
10738
|
categoryIds: create$2().of(create$6().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
10739
|
+
dateTime: create$2().of(dateTimeSchema).min(1, "DateTime list must contain at least one item").required("DateTime is required"),
|
|
10756
10740
|
email: emailOptionalSchema,
|
|
10741
|
+
inviterId: create$6().required("Inviter ID is required"),
|
|
10757
10742
|
name: create$6().label("Stallholder Name").trim().min(3, "Name must be at least 3 characters").required("Name is required")
|
|
10758
10743
|
});
|
|
10759
10744
|
var vendorInfoSchema = create$3().shape({
|
|
@@ -10854,8 +10839,8 @@ var userSchema = create$3().shape({
|
|
|
10854
10839
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10855
10840
|
is: (val) => !!val,
|
|
10856
10841
|
// only necessary if password typed
|
|
10857
|
-
then: (
|
|
10858
|
-
otherwise: (
|
|
10842
|
+
then: (schema17) => schema17.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10843
|
+
otherwise: (schema17) => schema17.notRequired()
|
|
10859
10844
|
}),
|
|
10860
10845
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10861
10846
|
});
|
|
@@ -10926,7 +10911,7 @@ var adSchema = create$3().shape({
|
|
|
10926
10911
|
return endDate > now;
|
|
10927
10912
|
}).when("start", {
|
|
10928
10913
|
is: (val) => val && val.length > 0,
|
|
10929
|
-
then: (
|
|
10914
|
+
then: (schema17) => schema17.test(
|
|
10930
10915
|
"is-after-start",
|
|
10931
10916
|
"End date must be after start date",
|
|
10932
10917
|
function(value) {
|
|
@@ -12336,7 +12321,7 @@ var schema9 = new MongooseSchema13(
|
|
|
12336
12321
|
required: false,
|
|
12337
12322
|
type: calendarWrapperSchema
|
|
12338
12323
|
},
|
|
12339
|
-
categories: [CategorySchema],
|
|
12324
|
+
categories: { required: true, type: [CategorySchema] },
|
|
12340
12325
|
foodTruck: { required: true, type: Boolean },
|
|
12341
12326
|
products: { required: false, type: productWrapperSchema },
|
|
12342
12327
|
relations: {
|
|
@@ -12415,19 +12400,47 @@ var schema10 = new MongooseSchema14(
|
|
|
12415
12400
|
);
|
|
12416
12401
|
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema10);
|
|
12417
12402
|
|
|
12418
|
-
// src/mongoose/
|
|
12403
|
+
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
12419
12404
|
var import_mongoose16 = __toESM(require("mongoose"));
|
|
12420
12405
|
var MongooseSchema15 = import_mongoose16.default.Schema;
|
|
12406
|
+
var invitationSchema = new MongooseSchema15(
|
|
12407
|
+
{
|
|
12408
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12409
|
+
inviterId: {
|
|
12410
|
+
ref: "Event",
|
|
12411
|
+
required: true,
|
|
12412
|
+
type: String
|
|
12413
|
+
}
|
|
12414
|
+
},
|
|
12415
|
+
{ _id: false }
|
|
12416
|
+
);
|
|
12421
12417
|
var schema11 = new MongooseSchema15(
|
|
12418
|
+
{
|
|
12419
|
+
categoryIds: { required: true, type: [String] },
|
|
12420
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
12421
|
+
email: { required: true, type: String },
|
|
12422
|
+
invitations: { required: true, type: [invitationSchema] },
|
|
12423
|
+
name: { required: true, type: String }
|
|
12424
|
+
},
|
|
12425
|
+
{ timestamps: true }
|
|
12426
|
+
);
|
|
12427
|
+
schema11.index({ email: 1 }, { unique: true });
|
|
12428
|
+
schema11.index({ name: 1 });
|
|
12429
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema11);
|
|
12430
|
+
|
|
12431
|
+
// src/mongoose/event/Event.ts
|
|
12432
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
12433
|
+
var MongooseSchema16 = import_mongoose17.default.Schema;
|
|
12434
|
+
var schema12 = new MongooseSchema16(
|
|
12422
12435
|
{
|
|
12423
12436
|
...baseResourceFields,
|
|
12424
12437
|
// Importing base resource fields from global.ts
|
|
12425
12438
|
claimed: { default: true, required: false, type: Boolean },
|
|
12426
|
-
dateTime: [dateTimeSchema3],
|
|
12439
|
+
dateTime: { required: true, type: [dateTimeSchema3] },
|
|
12427
12440
|
eventInfoId: {
|
|
12428
12441
|
ref: "EventInfo",
|
|
12429
12442
|
required: false,
|
|
12430
|
-
type:
|
|
12443
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
12431
12444
|
},
|
|
12432
12445
|
eventType: {
|
|
12433
12446
|
enum: Object.values(EnumEventType),
|
|
@@ -12456,18 +12469,18 @@ var schema11 = new MongooseSchema15(
|
|
|
12456
12469
|
},
|
|
12457
12470
|
{ timestamps: true }
|
|
12458
12471
|
);
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
var EventModel =
|
|
12472
|
+
schema12.index({ name: 1 });
|
|
12473
|
+
schema12.index({ description: 1 });
|
|
12474
|
+
schema12.index({ region: 1 });
|
|
12475
|
+
schema12.index({ "location.geo": "2dsphere" });
|
|
12476
|
+
schema12.index({ tags: 1 });
|
|
12477
|
+
schema12.index({ "associates.email": 1 });
|
|
12478
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema12);
|
|
12466
12479
|
|
|
12467
12480
|
// src/mongoose/Partner.ts
|
|
12468
|
-
var
|
|
12469
|
-
var
|
|
12470
|
-
var
|
|
12481
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
12482
|
+
var MongooseSchema17 = import_mongoose18.default.Schema;
|
|
12483
|
+
var schema13 = new MongooseSchema17(
|
|
12471
12484
|
{
|
|
12472
12485
|
...baseResourceFields,
|
|
12473
12486
|
location: {
|
|
@@ -12483,19 +12496,19 @@ var schema12 = new MongooseSchema16(
|
|
|
12483
12496
|
},
|
|
12484
12497
|
{ timestamps: true }
|
|
12485
12498
|
);
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
var PartnerModel =
|
|
12499
|
+
schema13.index({ name: 1 });
|
|
12500
|
+
schema13.index({ description: 1 });
|
|
12501
|
+
schema13.index({ region: 1 });
|
|
12502
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
12503
|
+
schema13.index({ "associates.email": 1 });
|
|
12504
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema13);
|
|
12492
12505
|
|
|
12493
12506
|
// src/mongoose/Post.ts
|
|
12494
|
-
var
|
|
12495
|
-
var
|
|
12496
|
-
var contentSchema = new
|
|
12507
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
12508
|
+
var MongooseSchema18 = import_mongoose19.default.Schema;
|
|
12509
|
+
var contentSchema = new MongooseSchema18(
|
|
12497
12510
|
{
|
|
12498
|
-
contentData:
|
|
12511
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
12499
12512
|
contentOrder: { required: true, type: Number },
|
|
12500
12513
|
contentType: {
|
|
12501
12514
|
enum: Object.values(EnumPostContentType),
|
|
@@ -12505,7 +12518,7 @@ var contentSchema = new MongooseSchema17(
|
|
|
12505
12518
|
},
|
|
12506
12519
|
{ _id: false }
|
|
12507
12520
|
);
|
|
12508
|
-
var
|
|
12521
|
+
var schema14 = new MongooseSchema18(
|
|
12509
12522
|
{
|
|
12510
12523
|
active: { default: true, required: true, type: Boolean },
|
|
12511
12524
|
caption: { required: true, type: String },
|
|
@@ -12541,15 +12554,15 @@ var schema13 = new MongooseSchema17(
|
|
|
12541
12554
|
},
|
|
12542
12555
|
{ timestamps: true }
|
|
12543
12556
|
);
|
|
12544
|
-
|
|
12545
|
-
|
|
12546
|
-
var PostModel =
|
|
12557
|
+
schema14.index({ title: 1 });
|
|
12558
|
+
schema14.index({ tags: 1 });
|
|
12559
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema14);
|
|
12547
12560
|
|
|
12548
12561
|
// src/mongoose/AppSetting.ts
|
|
12549
|
-
var
|
|
12550
|
-
var
|
|
12562
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
12563
|
+
var MongooseSchema19 = import_mongoose20.default.Schema;
|
|
12551
12564
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
12552
|
-
var AppSettingSchema = new
|
|
12565
|
+
var AppSettingSchema = new MongooseSchema19(
|
|
12553
12566
|
{
|
|
12554
12567
|
activeSchoolsStudentCountTotal: {
|
|
12555
12568
|
default: 0,
|
|
@@ -12575,18 +12588,18 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
12575
12588
|
},
|
|
12576
12589
|
{ timestamps: true }
|
|
12577
12590
|
);
|
|
12578
|
-
var AppSettingModel =
|
|
12591
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
12579
12592
|
|
|
12580
12593
|
// src/mongoose/game/Game.ts
|
|
12581
|
-
var
|
|
12594
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
12582
12595
|
|
|
12583
12596
|
// src/mongoose/game/DailyClue.ts
|
|
12584
|
-
var
|
|
12597
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
12585
12598
|
|
|
12586
12599
|
// src/mongoose/game/utils.ts
|
|
12587
|
-
var
|
|
12588
|
-
var
|
|
12589
|
-
var schemaGameDate = new
|
|
12600
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12601
|
+
var MongooseSchema20 = import_mongoose21.default.Schema;
|
|
12602
|
+
var schemaGameDate = new MongooseSchema20(
|
|
12590
12603
|
{
|
|
12591
12604
|
endDate: { required: true, type: Date },
|
|
12592
12605
|
startDate: { required: true, type: Date }
|
|
@@ -12595,8 +12608,8 @@ var schemaGameDate = new MongooseSchema19(
|
|
|
12595
12608
|
);
|
|
12596
12609
|
|
|
12597
12610
|
// src/mongoose/game/DailyClue.ts
|
|
12598
|
-
var
|
|
12599
|
-
var schemaLetters = new
|
|
12611
|
+
var MongooseSchema21 = import_mongoose22.default.Schema;
|
|
12612
|
+
var schemaLetters = new MongooseSchema21(
|
|
12600
12613
|
{
|
|
12601
12614
|
collected: { required: false, type: [String] },
|
|
12602
12615
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -12604,14 +12617,14 @@ var schemaLetters = new MongooseSchema20(
|
|
|
12604
12617
|
},
|
|
12605
12618
|
{ _id: false }
|
|
12606
12619
|
);
|
|
12607
|
-
var schemaDailyClueBaseGame = new
|
|
12620
|
+
var schemaDailyClueBaseGame = new MongooseSchema21(
|
|
12608
12621
|
{
|
|
12609
12622
|
gameDate: { required: true, type: schemaGameDate },
|
|
12610
12623
|
gameSolution: { required: true, type: String }
|
|
12611
12624
|
},
|
|
12612
12625
|
{ _id: false }
|
|
12613
12626
|
);
|
|
12614
|
-
var schemaDailyClueGameData = new
|
|
12627
|
+
var schemaDailyClueGameData = new MongooseSchema21(
|
|
12615
12628
|
{
|
|
12616
12629
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
12617
12630
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -12626,9 +12639,9 @@ var schemaDailyClueGameData = new MongooseSchema20(
|
|
|
12626
12639
|
);
|
|
12627
12640
|
|
|
12628
12641
|
// src/mongoose/game/MiniQuiz.ts
|
|
12629
|
-
var
|
|
12630
|
-
var
|
|
12631
|
-
var schemaMiniQuizAnswer = new
|
|
12642
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
12643
|
+
var MongooseSchema22 = import_mongoose23.default.Schema;
|
|
12644
|
+
var schemaMiniQuizAnswer = new MongooseSchema22(
|
|
12632
12645
|
{
|
|
12633
12646
|
answer: { required: true, type: String },
|
|
12634
12647
|
answerId: { required: true, type: String },
|
|
@@ -12636,7 +12649,7 @@ var schemaMiniQuizAnswer = new MongooseSchema21(
|
|
|
12636
12649
|
},
|
|
12637
12650
|
{ _id: false }
|
|
12638
12651
|
);
|
|
12639
|
-
var schemaMiniQuizQuestion = new
|
|
12652
|
+
var schemaMiniQuizQuestion = new MongooseSchema22(
|
|
12640
12653
|
{
|
|
12641
12654
|
answers: { required: true, type: [schemaMiniQuizAnswer] },
|
|
12642
12655
|
question: { required: true, type: String },
|
|
@@ -12644,20 +12657,20 @@ var schemaMiniQuizQuestion = new MongooseSchema21(
|
|
|
12644
12657
|
},
|
|
12645
12658
|
{ _id: false }
|
|
12646
12659
|
);
|
|
12647
|
-
var schemaMiniQuizBaseGame = new
|
|
12660
|
+
var schemaMiniQuizBaseGame = new MongooseSchema22(
|
|
12648
12661
|
{
|
|
12649
12662
|
questions: { required: true, type: [schemaMiniQuizQuestion] }
|
|
12650
12663
|
},
|
|
12651
12664
|
{ _id: false }
|
|
12652
12665
|
);
|
|
12653
|
-
var schemaMiniQuizAnsweredQuestion = new
|
|
12666
|
+
var schemaMiniQuizAnsweredQuestion = new MongooseSchema22(
|
|
12654
12667
|
{
|
|
12655
12668
|
questionId: { required: true, type: String },
|
|
12656
12669
|
selectedAnswerId: { required: true, type: String }
|
|
12657
12670
|
},
|
|
12658
12671
|
{ _id: false }
|
|
12659
12672
|
);
|
|
12660
|
-
var schemaMiniQuizGameData = new
|
|
12673
|
+
var schemaMiniQuizGameData = new MongooseSchema22(
|
|
12661
12674
|
{
|
|
12662
12675
|
answeredQuestions: {
|
|
12663
12676
|
default: null,
|
|
@@ -12672,18 +12685,18 @@ var schemaMiniQuizGameData = new MongooseSchema21(
|
|
|
12672
12685
|
);
|
|
12673
12686
|
|
|
12674
12687
|
// src/mongoose/game/Game.ts
|
|
12675
|
-
var
|
|
12688
|
+
var MongooseSchema23 = import_mongoose24.default.Schema;
|
|
12676
12689
|
var gameDataSchemas = {
|
|
12677
12690
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
12678
12691
|
[EnumGameType.MINI_QUIZ]: schemaMiniQuizGameData
|
|
12679
12692
|
};
|
|
12680
12693
|
var gameDataDefinition = Object.fromEntries(
|
|
12681
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
12694
|
+
Object.entries(gameDataSchemas).map(([key, schema17]) => [
|
|
12682
12695
|
key,
|
|
12683
|
-
{ default: null, required: false, type:
|
|
12696
|
+
{ default: null, required: false, type: schema17 }
|
|
12684
12697
|
])
|
|
12685
12698
|
);
|
|
12686
|
-
var gameHistorySchema = new
|
|
12699
|
+
var gameHistorySchema = new MongooseSchema23(
|
|
12687
12700
|
{
|
|
12688
12701
|
createdAt: { required: true, type: Date },
|
|
12689
12702
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -12701,7 +12714,7 @@ var gameHistorySchema = new MongooseSchema22(
|
|
|
12701
12714
|
},
|
|
12702
12715
|
{ _id: false }
|
|
12703
12716
|
);
|
|
12704
|
-
var gameTypeSchema = new
|
|
12717
|
+
var gameTypeSchema = new MongooseSchema23(
|
|
12705
12718
|
{
|
|
12706
12719
|
active: { default: true, required: true, type: Boolean },
|
|
12707
12720
|
gameData: gameDataDefinition,
|
|
@@ -12715,7 +12728,7 @@ var gameTypeSchema = new MongooseSchema22(
|
|
|
12715
12728
|
},
|
|
12716
12729
|
{ timestamps: true }
|
|
12717
12730
|
);
|
|
12718
|
-
var
|
|
12731
|
+
var schema15 = new MongooseSchema23(
|
|
12719
12732
|
{
|
|
12720
12733
|
active: { default: false, required: true, type: Boolean },
|
|
12721
12734
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -12728,12 +12741,12 @@ var schema14 = new MongooseSchema22(
|
|
|
12728
12741
|
},
|
|
12729
12742
|
{ timestamps: true }
|
|
12730
12743
|
);
|
|
12731
|
-
var GameModel =
|
|
12744
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema15);
|
|
12732
12745
|
|
|
12733
12746
|
// src/mongoose/School.ts
|
|
12734
|
-
var
|
|
12735
|
-
var
|
|
12736
|
-
var campaignsSchema = new
|
|
12747
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
12748
|
+
var MongooseSchema24 = import_mongoose25.default.Schema;
|
|
12749
|
+
var campaignsSchema = new MongooseSchema24(
|
|
12737
12750
|
{
|
|
12738
12751
|
endDate: { required: true, type: Date },
|
|
12739
12752
|
name: { required: true, type: String },
|
|
@@ -12741,7 +12754,7 @@ var campaignsSchema = new MongooseSchema23(
|
|
|
12741
12754
|
},
|
|
12742
12755
|
{ _id: false }
|
|
12743
12756
|
);
|
|
12744
|
-
var
|
|
12757
|
+
var schema16 = new MongooseSchema24(
|
|
12745
12758
|
{
|
|
12746
12759
|
// New schools are active by default
|
|
12747
12760
|
active: { default: true, required: true, type: Boolean },
|
|
@@ -12767,7 +12780,7 @@ var schema15 = new MongooseSchema23(
|
|
|
12767
12780
|
},
|
|
12768
12781
|
{ timestamps: true }
|
|
12769
12782
|
);
|
|
12770
|
-
var SchoolModel =
|
|
12783
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema16);
|
|
12771
12784
|
|
|
12772
12785
|
// src/service/updateAdStatus.ts
|
|
12773
12786
|
async function updateAdStatuses() {
|
|
@@ -12805,9 +12818,9 @@ async function updateAdStatuses() {
|
|
|
12805
12818
|
}
|
|
12806
12819
|
|
|
12807
12820
|
// src/service/associate.ts
|
|
12808
|
-
var
|
|
12821
|
+
var import_mongoose27 = __toESM(require("mongoose"));
|
|
12809
12822
|
function normalizeObjectId(id) {
|
|
12810
|
-
return typeof id === "string" ? new
|
|
12823
|
+
return typeof id === "string" ? new import_mongoose27.default.Types.ObjectId(id) : id;
|
|
12811
12824
|
}
|
|
12812
12825
|
async function getAssociateEmailsForResource({
|
|
12813
12826
|
normalizedResourceId,
|
|
@@ -12959,12 +12972,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
12959
12972
|
}
|
|
12960
12973
|
|
|
12961
12974
|
// src/service/objectIdToString.ts
|
|
12962
|
-
var
|
|
12975
|
+
var import_mongoose30 = __toESM(require("mongoose"));
|
|
12963
12976
|
function convertObjectIdsToStrings(obj) {
|
|
12964
12977
|
if (obj === null || obj === void 0) {
|
|
12965
12978
|
return obj;
|
|
12966
12979
|
}
|
|
12967
|
-
if (obj instanceof
|
|
12980
|
+
if (obj instanceof import_mongoose30.default.Types.ObjectId) {
|
|
12968
12981
|
return obj.toString();
|
|
12969
12982
|
}
|
|
12970
12983
|
if (Array.isArray(obj)) {
|