@timardex/cluemart-server-shared 1.0.58 → 1.0.59
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-2W6GLZ2Z.mjs → chunk-5JEBH7MU.mjs} +244 -193
- package/dist/chunk-5JEBH7MU.mjs.map +1 -0
- package/dist/index.cjs +249 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +247 -196
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +245 -193
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +8 -2
- package/dist/mongoose/index.d.ts +8 -2
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +232 -182
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-2W6GLZ2Z.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -4677,10 +4677,10 @@ var Condition = class _Condition {
|
|
|
4677
4677
|
otherwise
|
|
4678
4678
|
} = config;
|
|
4679
4679
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4680
|
-
return new _Condition(refs, (values,
|
|
4680
|
+
return new _Condition(refs, (values, schema14) => {
|
|
4681
4681
|
var _branch;
|
|
4682
4682
|
let branch = check(...values) ? then : otherwise;
|
|
4683
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4683
|
+
return (_branch = branch == null ? void 0 : branch(schema14)) != null ? _branch : schema14;
|
|
4684
4684
|
});
|
|
4685
4685
|
}
|
|
4686
4686
|
constructor(refs, builder) {
|
|
@@ -4694,13 +4694,13 @@ var Condition = class _Condition {
|
|
|
4694
4694
|
// TODO: ? operator here?
|
|
4695
4695
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4696
4696
|
));
|
|
4697
|
-
let
|
|
4698
|
-
if (
|
|
4699
|
-
|
|
4697
|
+
let schema14 = this.fn(values, base, options);
|
|
4698
|
+
if (schema14 === void 0 || // @ts-ignore this can be base
|
|
4699
|
+
schema14 === base) {
|
|
4700
4700
|
return base;
|
|
4701
4701
|
}
|
|
4702
|
-
if (!isSchema(
|
|
4703
|
-
return
|
|
4702
|
+
if (!isSchema(schema14)) throw new TypeError("conditions must return a schema object");
|
|
4703
|
+
return schema14.resolve(options);
|
|
4704
4704
|
}
|
|
4705
4705
|
};
|
|
4706
4706
|
var prefixes = {
|
|
@@ -4770,7 +4770,7 @@ function createValidation(config) {
|
|
|
4770
4770
|
path = "",
|
|
4771
4771
|
options,
|
|
4772
4772
|
originalValue,
|
|
4773
|
-
schema:
|
|
4773
|
+
schema: schema14
|
|
4774
4774
|
}, panic, next) {
|
|
4775
4775
|
const {
|
|
4776
4776
|
name,
|
|
@@ -4782,8 +4782,8 @@ function createValidation(config) {
|
|
|
4782
4782
|
let {
|
|
4783
4783
|
parent,
|
|
4784
4784
|
context,
|
|
4785
|
-
abortEarly =
|
|
4786
|
-
disableStackTrace =
|
|
4785
|
+
abortEarly = schema14.spec.abortEarly,
|
|
4786
|
+
disableStackTrace = schema14.spec.disableStackTrace
|
|
4787
4787
|
} = options;
|
|
4788
4788
|
const resolveOptions = {
|
|
4789
4789
|
value,
|
|
@@ -4794,9 +4794,9 @@ function createValidation(config) {
|
|
|
4794
4794
|
const nextParams = resolveParams(Object.assign({
|
|
4795
4795
|
value,
|
|
4796
4796
|
originalValue,
|
|
4797
|
-
label:
|
|
4797
|
+
label: schema14.spec.label,
|
|
4798
4798
|
path: overrides.path || path,
|
|
4799
|
-
spec:
|
|
4799
|
+
spec: schema14.spec,
|
|
4800
4800
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4801
4801
|
}, params, overrides.params), resolveOptions);
|
|
4802
4802
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
@@ -4815,7 +4815,7 @@ function createValidation(config) {
|
|
|
4815
4815
|
},
|
|
4816
4816
|
options,
|
|
4817
4817
|
originalValue,
|
|
4818
|
-
schema:
|
|
4818
|
+
schema: schema14
|
|
4819
4819
|
};
|
|
4820
4820
|
const handleResult = (validOrError) => {
|
|
4821
4821
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4859,42 +4859,42 @@ function resolveParams(params, options) {
|
|
|
4859
4859
|
function resolveMaybeRef(item, options) {
|
|
4860
4860
|
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
4861
4861
|
}
|
|
4862
|
-
function getIn(
|
|
4862
|
+
function getIn(schema14, path, value, context = value) {
|
|
4863
4863
|
let parent, lastPart, lastPartDebug;
|
|
4864
4864
|
if (!path) return {
|
|
4865
4865
|
parent,
|
|
4866
4866
|
parentPath: path,
|
|
4867
|
-
schema:
|
|
4867
|
+
schema: schema14
|
|
4868
4868
|
};
|
|
4869
4869
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4870
4870
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4871
|
-
|
|
4871
|
+
schema14 = schema14.resolve({
|
|
4872
4872
|
context,
|
|
4873
4873
|
parent,
|
|
4874
4874
|
value
|
|
4875
4875
|
});
|
|
4876
|
-
let isTuple =
|
|
4876
|
+
let isTuple = schema14.type === "tuple";
|
|
4877
4877
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4878
|
-
if (
|
|
4878
|
+
if (schema14.innerType || isTuple) {
|
|
4879
4879
|
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]"`);
|
|
4880
4880
|
if (value && idx >= value.length) {
|
|
4881
4881
|
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. `);
|
|
4882
4882
|
}
|
|
4883
4883
|
parent = value;
|
|
4884
4884
|
value = value && value[idx];
|
|
4885
|
-
|
|
4885
|
+
schema14 = isTuple ? schema14.spec.types[idx] : schema14.innerType;
|
|
4886
4886
|
}
|
|
4887
4887
|
if (!isArray) {
|
|
4888
|
-
if (!
|
|
4888
|
+
if (!schema14.fields || !schema14.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema14.type}")`);
|
|
4889
4889
|
parent = value;
|
|
4890
4890
|
value = value && value[part];
|
|
4891
|
-
|
|
4891
|
+
schema14 = schema14.fields[part];
|
|
4892
4892
|
}
|
|
4893
4893
|
lastPart = part;
|
|
4894
4894
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4895
4895
|
});
|
|
4896
4896
|
return {
|
|
4897
|
-
schema:
|
|
4897
|
+
schema: schema14,
|
|
4898
4898
|
parent,
|
|
4899
4899
|
parentPath: lastPart
|
|
4900
4900
|
};
|
|
@@ -5094,20 +5094,20 @@ var Schema = class {
|
|
|
5094
5094
|
this._mutate = before;
|
|
5095
5095
|
return result;
|
|
5096
5096
|
}
|
|
5097
|
-
concat(
|
|
5098
|
-
if (!
|
|
5099
|
-
if (
|
|
5097
|
+
concat(schema14) {
|
|
5098
|
+
if (!schema14 || schema14 === this) return this;
|
|
5099
|
+
if (schema14.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema14.type}`);
|
|
5100
5100
|
let base = this;
|
|
5101
|
-
let combined =
|
|
5101
|
+
let combined = schema14.clone();
|
|
5102
5102
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5103
5103
|
combined.spec = mergedSpec;
|
|
5104
5104
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5105
|
-
combined._whitelist = base._whitelist.merge(
|
|
5106
|
-
combined._blacklist = base._blacklist.merge(
|
|
5105
|
+
combined._whitelist = base._whitelist.merge(schema14._whitelist, schema14._blacklist);
|
|
5106
|
+
combined._blacklist = base._blacklist.merge(schema14._blacklist, schema14._whitelist);
|
|
5107
5107
|
combined.tests = base.tests;
|
|
5108
5108
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5109
5109
|
combined.withMutation((next) => {
|
|
5110
|
-
|
|
5110
|
+
schema14.tests.forEach((fn) => {
|
|
5111
5111
|
next.test(fn.OPTIONS);
|
|
5112
5112
|
});
|
|
5113
5113
|
});
|
|
@@ -5123,15 +5123,15 @@ var Schema = class {
|
|
|
5123
5123
|
return this._typeCheck(v);
|
|
5124
5124
|
}
|
|
5125
5125
|
resolve(options) {
|
|
5126
|
-
let
|
|
5127
|
-
if (
|
|
5128
|
-
let conditions =
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5126
|
+
let schema14 = this;
|
|
5127
|
+
if (schema14.conditions.length) {
|
|
5128
|
+
let conditions = schema14.conditions;
|
|
5129
|
+
schema14 = schema14.clone();
|
|
5130
|
+
schema14.conditions = [];
|
|
5131
|
+
schema14 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema14);
|
|
5132
|
+
schema14 = schema14.resolve(options);
|
|
5133
5133
|
}
|
|
5134
|
-
return
|
|
5134
|
+
return schema14;
|
|
5135
5135
|
}
|
|
5136
5136
|
resolveOptions(options) {
|
|
5137
5137
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5287,11 +5287,11 @@ attempted value: ${formattedValue}
|
|
|
5287
5287
|
}
|
|
5288
5288
|
validate(value, options) {
|
|
5289
5289
|
var _options$disableStack2;
|
|
5290
|
-
let
|
|
5290
|
+
let schema14 = this.resolve(Object.assign({}, options, {
|
|
5291
5291
|
value
|
|
5292
5292
|
}));
|
|
5293
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5294
|
-
return new Promise((resolve, reject) =>
|
|
5293
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema14.spec.disableStackTrace;
|
|
5294
|
+
return new Promise((resolve, reject) => schema14._validate(value, options, (error, parsed) => {
|
|
5295
5295
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5296
5296
|
reject(error);
|
|
5297
5297
|
}, (errors, validated) => {
|
|
@@ -5301,12 +5301,12 @@ attempted value: ${formattedValue}
|
|
|
5301
5301
|
}
|
|
5302
5302
|
validateSync(value, options) {
|
|
5303
5303
|
var _options$disableStack3;
|
|
5304
|
-
let
|
|
5304
|
+
let schema14 = this.resolve(Object.assign({}, options, {
|
|
5305
5305
|
value
|
|
5306
5306
|
}));
|
|
5307
5307
|
let result;
|
|
5308
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5309
|
-
|
|
5308
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema14.spec.disableStackTrace;
|
|
5309
|
+
schema14._validate(value, Object.assign({}, options, {
|
|
5310
5310
|
sync: true
|
|
5311
5311
|
}), (error, parsed) => {
|
|
5312
5312
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5340,8 +5340,8 @@ attempted value: ${formattedValue}
|
|
|
5340
5340
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5341
5341
|
}
|
|
5342
5342
|
getDefault(options) {
|
|
5343
|
-
let
|
|
5344
|
-
return
|
|
5343
|
+
let schema14 = this.resolve(options || {});
|
|
5344
|
+
return schema14._getDefault(options);
|
|
5345
5345
|
}
|
|
5346
5346
|
default(def) {
|
|
5347
5347
|
if (arguments.length === 0) {
|
|
@@ -5574,13 +5574,13 @@ attempted value: ${formattedValue}
|
|
|
5574
5574
|
return description;
|
|
5575
5575
|
}
|
|
5576
5576
|
get ["~standard"]() {
|
|
5577
|
-
const
|
|
5577
|
+
const schema14 = this;
|
|
5578
5578
|
const standard = {
|
|
5579
5579
|
version: 1,
|
|
5580
5580
|
vendor: "yup",
|
|
5581
5581
|
async validate(value) {
|
|
5582
5582
|
try {
|
|
5583
|
-
const result = await
|
|
5583
|
+
const result = await schema14.validate(value, {
|
|
5584
5584
|
abortEarly: false
|
|
5585
5585
|
});
|
|
5586
5586
|
return {
|
|
@@ -5604,9 +5604,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5604
5604
|
const {
|
|
5605
5605
|
parent,
|
|
5606
5606
|
parentPath,
|
|
5607
|
-
schema:
|
|
5607
|
+
schema: schema14
|
|
5608
5608
|
} = getIn(this, path, value, options.context);
|
|
5609
|
-
return
|
|
5609
|
+
return schema14[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5610
5610
|
parent,
|
|
5611
5611
|
path
|
|
5612
5612
|
}));
|
|
@@ -5780,7 +5780,7 @@ var StringSchema = class extends Schema {
|
|
|
5780
5780
|
});
|
|
5781
5781
|
}
|
|
5782
5782
|
required(message) {
|
|
5783
|
-
return super.required(message).withMutation((
|
|
5783
|
+
return super.required(message).withMutation((schema14) => schema14.test({
|
|
5784
5784
|
message: message || mixed.required,
|
|
5785
5785
|
name: "required",
|
|
5786
5786
|
skipAbsent: true,
|
|
@@ -5788,9 +5788,9 @@ var StringSchema = class extends Schema {
|
|
|
5788
5788
|
}));
|
|
5789
5789
|
}
|
|
5790
5790
|
notRequired() {
|
|
5791
|
-
return super.notRequired().withMutation((
|
|
5792
|
-
|
|
5793
|
-
return
|
|
5791
|
+
return super.notRequired().withMutation((schema14) => {
|
|
5792
|
+
schema14.tests = schema14.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5793
|
+
return schema14;
|
|
5794
5794
|
});
|
|
5795
5795
|
}
|
|
5796
5796
|
length(length, message = string.length) {
|
|
@@ -6168,7 +6168,7 @@ function sortByKeyOrder(keys) {
|
|
|
6168
6168
|
return findIndex(keys, a) - findIndex(keys, b);
|
|
6169
6169
|
};
|
|
6170
6170
|
}
|
|
6171
|
-
var parseJson = (value, _,
|
|
6171
|
+
var parseJson = (value, _, schema14) => {
|
|
6172
6172
|
if (typeof value !== "string") {
|
|
6173
6173
|
return value;
|
|
6174
6174
|
}
|
|
@@ -6177,30 +6177,30 @@ var parseJson = (value, _, schema13) => {
|
|
|
6177
6177
|
parsed = JSON.parse(value);
|
|
6178
6178
|
} catch (err) {
|
|
6179
6179
|
}
|
|
6180
|
-
return
|
|
6180
|
+
return schema14.isType(parsed) ? parsed : value;
|
|
6181
6181
|
};
|
|
6182
|
-
function deepPartial(
|
|
6183
|
-
if ("fields" in
|
|
6182
|
+
function deepPartial(schema14) {
|
|
6183
|
+
if ("fields" in schema14) {
|
|
6184
6184
|
const partial = {};
|
|
6185
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6185
|
+
for (const [key, fieldSchema] of Object.entries(schema14.fields)) {
|
|
6186
6186
|
partial[key] = deepPartial(fieldSchema);
|
|
6187
6187
|
}
|
|
6188
|
-
return
|
|
6188
|
+
return schema14.setFields(partial);
|
|
6189
6189
|
}
|
|
6190
|
-
if (
|
|
6191
|
-
const nextArray =
|
|
6190
|
+
if (schema14.type === "array") {
|
|
6191
|
+
const nextArray = schema14.optional();
|
|
6192
6192
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6193
6193
|
return nextArray;
|
|
6194
6194
|
}
|
|
6195
|
-
if (
|
|
6196
|
-
return
|
|
6197
|
-
types:
|
|
6195
|
+
if (schema14.type === "tuple") {
|
|
6196
|
+
return schema14.optional().clone({
|
|
6197
|
+
types: schema14.spec.types.map(deepPartial)
|
|
6198
6198
|
});
|
|
6199
6199
|
}
|
|
6200
|
-
if ("optional" in
|
|
6201
|
-
return
|
|
6200
|
+
if ("optional" in schema14) {
|
|
6201
|
+
return schema14.optional();
|
|
6202
6202
|
}
|
|
6203
|
-
return
|
|
6203
|
+
return schema14;
|
|
6204
6204
|
}
|
|
6205
6205
|
var deepHas = (obj, p) => {
|
|
6206
6206
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6331,8 +6331,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6331
6331
|
next._sortErrors = this._sortErrors;
|
|
6332
6332
|
return next;
|
|
6333
6333
|
}
|
|
6334
|
-
concat(
|
|
6335
|
-
let next = super.concat(
|
|
6334
|
+
concat(schema14) {
|
|
6335
|
+
let next = super.concat(schema14);
|
|
6336
6336
|
let nextFields = next.fields;
|
|
6337
6337
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6338
6338
|
const target = nextFields[field];
|
|
@@ -6340,7 +6340,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6340
6340
|
}
|
|
6341
6341
|
return next.withMutation((s2) => (
|
|
6342
6342
|
// XXX: excludes here is wrong
|
|
6343
|
-
s2.setFields(nextFields, [...this._excludedEdges, ...
|
|
6343
|
+
s2.setFields(nextFields, [...this._excludedEdges, ...schema14._excludedEdges])
|
|
6344
6344
|
));
|
|
6345
6345
|
}
|
|
6346
6346
|
_getDefault(options) {
|
|
@@ -6385,8 +6385,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6385
6385
|
}
|
|
6386
6386
|
partial() {
|
|
6387
6387
|
const partial = {};
|
|
6388
|
-
for (const [key,
|
|
6389
|
-
partial[key] = "optional" in
|
|
6388
|
+
for (const [key, schema14] of Object.entries(this.fields)) {
|
|
6389
|
+
partial[key] = "optional" in schema14 && schema14.optional instanceof Function ? schema14.optional() : schema14;
|
|
6390
6390
|
}
|
|
6391
6391
|
return this.setFields(partial);
|
|
6392
6392
|
}
|
|
@@ -6588,22 +6588,22 @@ var ArraySchema = class extends Schema {
|
|
|
6588
6588
|
json() {
|
|
6589
6589
|
return this.transform(parseJson);
|
|
6590
6590
|
}
|
|
6591
|
-
concat(
|
|
6592
|
-
let next = super.concat(
|
|
6591
|
+
concat(schema14) {
|
|
6592
|
+
let next = super.concat(schema14);
|
|
6593
6593
|
next.innerType = this.innerType;
|
|
6594
|
-
if (
|
|
6594
|
+
if (schema14.innerType)
|
|
6595
6595
|
next.innerType = next.innerType ? (
|
|
6596
6596
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6597
|
-
next.innerType.concat(
|
|
6598
|
-
) :
|
|
6597
|
+
next.innerType.concat(schema14.innerType)
|
|
6598
|
+
) : schema14.innerType;
|
|
6599
6599
|
return next;
|
|
6600
6600
|
}
|
|
6601
|
-
of(
|
|
6601
|
+
of(schema14) {
|
|
6602
6602
|
let next = this.clone();
|
|
6603
|
-
if (!isSchema(
|
|
6604
|
-
next.innerType =
|
|
6603
|
+
if (!isSchema(schema14)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema14));
|
|
6604
|
+
next.innerType = schema14;
|
|
6605
6605
|
next.spec = Object.assign({}, next.spec, {
|
|
6606
|
-
types:
|
|
6606
|
+
types: schema14
|
|
6607
6607
|
});
|
|
6608
6608
|
return next;
|
|
6609
6609
|
}
|
|
@@ -6751,7 +6751,7 @@ var TupleSchema = class extends Schema {
|
|
|
6751
6751
|
describe(options) {
|
|
6752
6752
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6753
6753
|
const base = super.describe(options);
|
|
6754
|
-
base.innerType = next.spec.types.map((
|
|
6754
|
+
base.innerType = next.spec.types.map((schema14, index) => {
|
|
6755
6755
|
var _innerOptions;
|
|
6756
6756
|
let innerOptions = options;
|
|
6757
6757
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6760,7 +6760,7 @@ var TupleSchema = class extends Schema {
|
|
|
6760
6760
|
value: innerOptions.value[index]
|
|
6761
6761
|
});
|
|
6762
6762
|
}
|
|
6763
|
-
return
|
|
6763
|
+
return schema14.describe(innerOptions);
|
|
6764
6764
|
});
|
|
6765
6765
|
return base;
|
|
6766
6766
|
}
|
|
@@ -10166,7 +10166,7 @@ var socialMediaSchema = create$3({
|
|
|
10166
10166
|
is: (name) => !!name,
|
|
10167
10167
|
// If name has a value
|
|
10168
10168
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10169
|
-
otherwise: (
|
|
10169
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10170
10170
|
})
|
|
10171
10171
|
});
|
|
10172
10172
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10239,21 +10239,21 @@ var paymentInfoSchema = create$3({
|
|
|
10239
10239
|
paymentMethod: create$8().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
10240
10240
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10241
10241
|
is: "bank_transfer",
|
|
10242
|
-
then: (
|
|
10243
|
-
otherwise: (
|
|
10242
|
+
then: (schema14) => schema14.required("Account holder name is required for bank transfer").trim(),
|
|
10243
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10244
10244
|
}),
|
|
10245
10245
|
accountNumber: create$6().when("paymentMethod", {
|
|
10246
10246
|
is: "bank_transfer",
|
|
10247
|
-
then: (
|
|
10247
|
+
then: (schema14) => schema14.required("Account number is required for bank transfer").matches(
|
|
10248
10248
|
nzBankAccountRegex,
|
|
10249
10249
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10250
10250
|
).trim(),
|
|
10251
|
-
otherwise: (
|
|
10251
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10252
10252
|
}),
|
|
10253
10253
|
link: create$6().when("paymentMethod", {
|
|
10254
10254
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10255
10255
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10256
|
-
otherwise: (
|
|
10256
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10257
10257
|
})
|
|
10258
10258
|
});
|
|
10259
10259
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10366,8 +10366,8 @@ var userSchema = create$3().shape({
|
|
|
10366
10366
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10367
10367
|
is: (val) => !!val,
|
|
10368
10368
|
// only necessary if password typed
|
|
10369
|
-
then: (
|
|
10370
|
-
otherwise: (
|
|
10369
|
+
then: (schema14) => schema14.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10370
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10371
10371
|
}),
|
|
10372
10372
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10373
10373
|
});
|
|
@@ -10485,8 +10485,8 @@ var testerSchema = create$3().shape({
|
|
|
10485
10485
|
email: emailRequiredSchema,
|
|
10486
10486
|
event: create$3().when("resourceType", {
|
|
10487
10487
|
is: (resourceType) => resourceType === "event",
|
|
10488
|
-
otherwise: (
|
|
10489
|
-
then: (
|
|
10488
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10489
|
+
then: (schema14) => schema14.required("Event information is required").shape(testerEventSchema.fields)
|
|
10490
10490
|
}),
|
|
10491
10491
|
firstName: create$6().required("First name is required"),
|
|
10492
10492
|
lastName: create$6().required("Last name is required"),
|
|
@@ -10504,8 +10504,8 @@ var testerSchema = create$3().shape({
|
|
|
10504
10504
|
).required("Resource Type is required"),
|
|
10505
10505
|
vendor: create$3().when("resourceType", {
|
|
10506
10506
|
is: (resourceType) => resourceType === "vendor",
|
|
10507
|
-
otherwise: (
|
|
10508
|
-
then: (
|
|
10507
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10508
|
+
then: (schema14) => schema14.required("Vendor information is required").shape(testerVendorSchema.fields)
|
|
10509
10509
|
})
|
|
10510
10510
|
});
|
|
10511
10511
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
@@ -10543,7 +10543,7 @@ var adSchema = create$3().shape({
|
|
|
10543
10543
|
return endDate > now;
|
|
10544
10544
|
}).when("start", {
|
|
10545
10545
|
is: (val) => val && val.length > 0,
|
|
10546
|
-
then: (
|
|
10546
|
+
then: (schema14) => schema14.test(
|
|
10547
10547
|
"is-after-start",
|
|
10548
10548
|
"End date must be after start date",
|
|
10549
10549
|
function(value) {
|
|
@@ -11158,10 +11158,60 @@ ChatSchema.index({
|
|
|
11158
11158
|
});
|
|
11159
11159
|
var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
|
|
11160
11160
|
|
|
11161
|
-
// src/mongoose/
|
|
11161
|
+
// src/mongoose/GoogleImportedMarket.ts
|
|
11162
11162
|
import mongoose6 from "mongoose";
|
|
11163
11163
|
var MongooseSchema6 = mongoose6.Schema;
|
|
11164
|
+
var locationSchema2 = new MongooseSchema6(
|
|
11165
|
+
{
|
|
11166
|
+
lat: { required: true, type: Number },
|
|
11167
|
+
lng: { required: true, type: Number }
|
|
11168
|
+
},
|
|
11169
|
+
{ _id: false }
|
|
11170
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11171
|
+
);
|
|
11164
11172
|
var schema3 = new MongooseSchema6(
|
|
11173
|
+
{
|
|
11174
|
+
address: { required: true, type: String },
|
|
11175
|
+
businessStatus: { required: false, type: String },
|
|
11176
|
+
claimed: { default: false, required: true, type: Boolean },
|
|
11177
|
+
googleMapsUrl: { required: false, type: String },
|
|
11178
|
+
googlePlaceId: {
|
|
11179
|
+
required: true,
|
|
11180
|
+
type: String,
|
|
11181
|
+
unique: true
|
|
11182
|
+
// unique, indexed
|
|
11183
|
+
},
|
|
11184
|
+
image: { required: false, type: String },
|
|
11185
|
+
// photo_reference only
|
|
11186
|
+
importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
|
|
11187
|
+
location: {
|
|
11188
|
+
required: false,
|
|
11189
|
+
// optional because lat/lng may expire after 30 days
|
|
11190
|
+
type: locationSchema2
|
|
11191
|
+
},
|
|
11192
|
+
name: { required: true, type: String },
|
|
11193
|
+
openingHours: { required: false, type: [String] },
|
|
11194
|
+
phone: { required: false, type: String },
|
|
11195
|
+
photos: { required: false, type: [String] },
|
|
11196
|
+
// array of photo_reference
|
|
11197
|
+
rating: { required: false, type: Number },
|
|
11198
|
+
reviewCount: { required: false, type: Number },
|
|
11199
|
+
slug: { required: true, type: String },
|
|
11200
|
+
website: { required: false, type: String }
|
|
11201
|
+
},
|
|
11202
|
+
{ timestamps: true }
|
|
11203
|
+
);
|
|
11204
|
+
schema3.index({ googlePlaceId: 1 });
|
|
11205
|
+
schema3.index({ name: 1 });
|
|
11206
|
+
schema3.index({ slug: 1 });
|
|
11207
|
+
schema3.index({ address: 1 });
|
|
11208
|
+
schema3.index({ "location.lat": 1, "location.lng": 1 });
|
|
11209
|
+
var GoogleImportedMarketModel = mongoose6.models.GoogleImportedMarket || mongoose6.model("GoogleImportedMarket", schema3);
|
|
11210
|
+
|
|
11211
|
+
// src/mongoose/Notification.ts
|
|
11212
|
+
import mongoose7 from "mongoose";
|
|
11213
|
+
var MongooseSchema7 = mongoose7.Schema;
|
|
11214
|
+
var schema4 = new MongooseSchema7(
|
|
11165
11215
|
{
|
|
11166
11216
|
data: {
|
|
11167
11217
|
resourceId: { required: true, type: String },
|
|
@@ -11184,14 +11234,14 @@ var schema3 = new MongooseSchema6(
|
|
|
11184
11234
|
userId: {
|
|
11185
11235
|
ref: "User",
|
|
11186
11236
|
required: true,
|
|
11187
|
-
type:
|
|
11237
|
+
type: mongoose7.Schema.Types.ObjectId
|
|
11188
11238
|
}
|
|
11189
11239
|
},
|
|
11190
11240
|
{ timestamps: true }
|
|
11191
11241
|
);
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
var NotificationModel =
|
|
11242
|
+
schema4.index({ isRead: 1, userId: 1 });
|
|
11243
|
+
schema4.index({ createdAt: -1, userId: 1 });
|
|
11244
|
+
var NotificationModel = mongoose7.models.Notification || mongoose7.model("Notification", schema4);
|
|
11195
11245
|
|
|
11196
11246
|
// node_modules/@timardex/cluemart-shared/dist/chunk-OBQRGWV3.mjs
|
|
11197
11247
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
@@ -11202,9 +11252,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
11202
11252
|
})(EnumOSPlatform2 || {});
|
|
11203
11253
|
|
|
11204
11254
|
// src/mongoose/PushToken.ts
|
|
11205
|
-
import
|
|
11206
|
-
var
|
|
11207
|
-
var
|
|
11255
|
+
import mongoose8 from "mongoose";
|
|
11256
|
+
var MongooseSchema8 = mongoose8.Schema;
|
|
11257
|
+
var schema5 = new MongooseSchema8(
|
|
11208
11258
|
{
|
|
11209
11259
|
platform: {
|
|
11210
11260
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -11212,16 +11262,16 @@ var schema4 = new MongooseSchema7(
|
|
|
11212
11262
|
type: String
|
|
11213
11263
|
},
|
|
11214
11264
|
token: { required: true, type: String },
|
|
11215
|
-
userId: { required: true, type:
|
|
11265
|
+
userId: { required: true, type: mongoose8.Schema.Types.ObjectId }
|
|
11216
11266
|
},
|
|
11217
11267
|
{ timestamps: true }
|
|
11218
11268
|
);
|
|
11219
|
-
var PushTokenModel =
|
|
11269
|
+
var PushTokenModel = mongoose8.models.PushToken || mongoose8.model("PushToken", schema5);
|
|
11220
11270
|
|
|
11221
11271
|
// src/mongoose/ResourceActivity.ts
|
|
11222
|
-
import
|
|
11223
|
-
var
|
|
11224
|
-
var ActivitySchema = new
|
|
11272
|
+
import mongoose9 from "mongoose";
|
|
11273
|
+
var MongooseSchema9 = mongoose9.Schema;
|
|
11274
|
+
var ActivitySchema = new MongooseSchema9(
|
|
11225
11275
|
{
|
|
11226
11276
|
activityType: {
|
|
11227
11277
|
enum: Object.values(EnumActivity),
|
|
@@ -11257,7 +11307,7 @@ var ActivitySchema = new MongooseSchema8(
|
|
|
11257
11307
|
},
|
|
11258
11308
|
{ _id: false }
|
|
11259
11309
|
);
|
|
11260
|
-
var
|
|
11310
|
+
var schema6 = new MongooseSchema9(
|
|
11261
11311
|
{
|
|
11262
11312
|
activity: { default: [], type: [ActivitySchema] },
|
|
11263
11313
|
resourceId: { required: true, type: String },
|
|
@@ -11269,14 +11319,14 @@ var schema5 = new MongooseSchema8(
|
|
|
11269
11319
|
},
|
|
11270
11320
|
{ timestamps: true }
|
|
11271
11321
|
);
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
var ResourceActivityModel =
|
|
11322
|
+
schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
11323
|
+
schema6.index({ "views.location": "2dsphere" });
|
|
11324
|
+
var ResourceActivityModel = mongoose9.models.ResourceActivity || mongoose9.model("ResourceActivity", schema6);
|
|
11275
11325
|
|
|
11276
11326
|
// src/mongoose/Tester.ts
|
|
11277
|
-
import
|
|
11278
|
-
var
|
|
11279
|
-
var TesterVendorQuestionarySchema = new
|
|
11327
|
+
import mongoose10 from "mongoose";
|
|
11328
|
+
var MongooseSchema10 = mongoose10.Schema;
|
|
11329
|
+
var TesterVendorQuestionarySchema = new MongooseSchema10(
|
|
11280
11330
|
{
|
|
11281
11331
|
appearInVideoIntroduction: {
|
|
11282
11332
|
default: false,
|
|
@@ -11303,7 +11353,7 @@ var TesterVendorQuestionarySchema = new MongooseSchema9(
|
|
|
11303
11353
|
},
|
|
11304
11354
|
{ _id: false }
|
|
11305
11355
|
);
|
|
11306
|
-
var TesterVendorSchema = new
|
|
11356
|
+
var TesterVendorSchema = new MongooseSchema10(
|
|
11307
11357
|
{
|
|
11308
11358
|
categories: { required: true, type: [CategorySchema] },
|
|
11309
11359
|
marketsAttended: {
|
|
@@ -11329,7 +11379,7 @@ var TesterVendorSchema = new MongooseSchema9(
|
|
|
11329
11379
|
},
|
|
11330
11380
|
{ _id: false }
|
|
11331
11381
|
);
|
|
11332
|
-
var TesterEventQuestionarySchema = new
|
|
11382
|
+
var TesterEventQuestionarySchema = new MongooseSchema10(
|
|
11333
11383
|
{
|
|
11334
11384
|
allowMarketingAppearance: {
|
|
11335
11385
|
default: false,
|
|
@@ -11364,7 +11414,7 @@ var TesterEventQuestionarySchema = new MongooseSchema9(
|
|
|
11364
11414
|
},
|
|
11365
11415
|
{ _id: false }
|
|
11366
11416
|
);
|
|
11367
|
-
var TesterEventsSchema = new
|
|
11417
|
+
var TesterEventsSchema = new MongooseSchema10(
|
|
11368
11418
|
{
|
|
11369
11419
|
markets: {
|
|
11370
11420
|
required: true,
|
|
@@ -11393,7 +11443,7 @@ var TesterEventsSchema = new MongooseSchema9(
|
|
|
11393
11443
|
},
|
|
11394
11444
|
{ _id: false }
|
|
11395
11445
|
);
|
|
11396
|
-
var TesterSchema = new
|
|
11446
|
+
var TesterSchema = new MongooseSchema10(
|
|
11397
11447
|
{
|
|
11398
11448
|
active: { default: false, required: true, type: Boolean },
|
|
11399
11449
|
approved: { default: false, required: true, type: Boolean },
|
|
@@ -11427,43 +11477,43 @@ var TesterSchema = new MongooseSchema9(
|
|
|
11427
11477
|
timestamps: true
|
|
11428
11478
|
}
|
|
11429
11479
|
);
|
|
11430
|
-
var TesterModel =
|
|
11480
|
+
var TesterModel = mongoose10.models.Tester || mongoose10.model("Tester", TesterSchema);
|
|
11431
11481
|
|
|
11432
11482
|
// src/mongoose/User.ts
|
|
11433
|
-
import
|
|
11434
|
-
var
|
|
11435
|
-
var userActivityEventSchema = new
|
|
11483
|
+
import mongoose11 from "mongoose";
|
|
11484
|
+
var MongooseSchema11 = mongoose11.Schema;
|
|
11485
|
+
var userActivityEventSchema = new MongooseSchema11(
|
|
11436
11486
|
{
|
|
11437
11487
|
dateTime: dateTimeSchema3,
|
|
11438
11488
|
resourceId: {
|
|
11439
11489
|
ref: "Event",
|
|
11440
11490
|
required: false,
|
|
11441
|
-
type:
|
|
11491
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11442
11492
|
}
|
|
11443
11493
|
},
|
|
11444
11494
|
{ _id: false }
|
|
11445
11495
|
);
|
|
11446
|
-
var userActivityFavouritesSchema = new
|
|
11496
|
+
var userActivityFavouritesSchema = new MongooseSchema11(
|
|
11447
11497
|
{
|
|
11448
11498
|
events: {
|
|
11449
11499
|
ref: "Event",
|
|
11450
11500
|
required: false,
|
|
11451
|
-
type: [
|
|
11501
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11452
11502
|
},
|
|
11453
11503
|
partners: {
|
|
11454
11504
|
ref: "Partner",
|
|
11455
11505
|
required: false,
|
|
11456
|
-
type: [
|
|
11506
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11457
11507
|
},
|
|
11458
11508
|
vendors: {
|
|
11459
11509
|
ref: "Vendor",
|
|
11460
11510
|
required: false,
|
|
11461
|
-
type: [
|
|
11511
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11462
11512
|
}
|
|
11463
11513
|
},
|
|
11464
11514
|
{ _id: false }
|
|
11465
11515
|
);
|
|
11466
|
-
var stripeSchema = new
|
|
11516
|
+
var stripeSchema = new MongooseSchema11(
|
|
11467
11517
|
{
|
|
11468
11518
|
currentPlan: {
|
|
11469
11519
|
enum: Object.values(EnumUserLicence),
|
|
@@ -11494,7 +11544,7 @@ var stripeSchema = new MongooseSchema10(
|
|
|
11494
11544
|
},
|
|
11495
11545
|
{ _id: false }
|
|
11496
11546
|
);
|
|
11497
|
-
var
|
|
11547
|
+
var schema7 = new MongooseSchema11(
|
|
11498
11548
|
{
|
|
11499
11549
|
active: { default: false, required: true, type: Boolean },
|
|
11500
11550
|
associates: {
|
|
@@ -11510,7 +11560,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11510
11560
|
events: {
|
|
11511
11561
|
ref: "Event",
|
|
11512
11562
|
required: false,
|
|
11513
|
-
type: [
|
|
11563
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11514
11564
|
},
|
|
11515
11565
|
firstName: { required: true, type: String },
|
|
11516
11566
|
isTester: { default: false, required: true, type: Boolean },
|
|
@@ -11522,7 +11572,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11522
11572
|
partner: {
|
|
11523
11573
|
ref: "Partner",
|
|
11524
11574
|
required: false,
|
|
11525
|
-
type:
|
|
11575
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11526
11576
|
},
|
|
11527
11577
|
password: { required: true, type: String },
|
|
11528
11578
|
platform: {
|
|
@@ -11567,20 +11617,20 @@ var schema6 = new MongooseSchema10(
|
|
|
11567
11617
|
vendor: {
|
|
11568
11618
|
ref: "Vendor",
|
|
11569
11619
|
required: false,
|
|
11570
|
-
type:
|
|
11620
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11571
11621
|
}
|
|
11572
11622
|
},
|
|
11573
11623
|
{ strict: false, timestamps: true }
|
|
11574
11624
|
);
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
var UserModel =
|
|
11625
|
+
schema7.index({ "associates.email": 1 });
|
|
11626
|
+
schema7.index({ "licences.expiryDate": 1 });
|
|
11627
|
+
schema7.index({ "licences.licenceType": 1 });
|
|
11628
|
+
var UserModel = mongoose11.models.User || mongoose11.model("User", schema7);
|
|
11579
11629
|
|
|
11580
11630
|
// src/mongoose/VerificationToken.ts
|
|
11581
|
-
import
|
|
11582
|
-
var
|
|
11583
|
-
var
|
|
11631
|
+
import mongoose12 from "mongoose";
|
|
11632
|
+
var MongooseSchema12 = mongoose12.Schema;
|
|
11633
|
+
var schema8 = new MongooseSchema12(
|
|
11584
11634
|
{
|
|
11585
11635
|
createdAt: {
|
|
11586
11636
|
default: Date.now,
|
|
@@ -11595,12 +11645,12 @@ var schema7 = new MongooseSchema11(
|
|
|
11595
11645
|
},
|
|
11596
11646
|
{ timestamps: true }
|
|
11597
11647
|
);
|
|
11598
|
-
var VerificationTokenModel =
|
|
11648
|
+
var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
|
|
11599
11649
|
|
|
11600
11650
|
// src/mongoose/vendor/Vendor.ts
|
|
11601
|
-
import
|
|
11602
|
-
var
|
|
11603
|
-
var MenuTypeSchema = new
|
|
11651
|
+
import mongoose13 from "mongoose";
|
|
11652
|
+
var MongooseSchema13 = mongoose13.Schema;
|
|
11653
|
+
var MenuTypeSchema = new MongooseSchema13(
|
|
11604
11654
|
{
|
|
11605
11655
|
description: { required: false, type: String },
|
|
11606
11656
|
name: { required: false, type: String },
|
|
@@ -11610,7 +11660,7 @@ var MenuTypeSchema = new MongooseSchema12(
|
|
|
11610
11660
|
{ _id: false }
|
|
11611
11661
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11612
11662
|
);
|
|
11613
|
-
var LocationsSchema = new
|
|
11663
|
+
var LocationsSchema = new MongooseSchema13(
|
|
11614
11664
|
{
|
|
11615
11665
|
dateTime: {
|
|
11616
11666
|
dateStatus: {
|
|
@@ -11643,7 +11693,7 @@ var LocationsSchema = new MongooseSchema12(
|
|
|
11643
11693
|
{ _id: false }
|
|
11644
11694
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11645
11695
|
);
|
|
11646
|
-
var
|
|
11696
|
+
var schema9 = new MongooseSchema13(
|
|
11647
11697
|
{
|
|
11648
11698
|
...baseResourceFields,
|
|
11649
11699
|
// Importing base resource fields from global.ts
|
|
@@ -11665,7 +11715,7 @@ var schema8 = new MongooseSchema12(
|
|
|
11665
11715
|
vendorInfoId: {
|
|
11666
11716
|
ref: "VendorInfo",
|
|
11667
11717
|
required: false,
|
|
11668
|
-
type:
|
|
11718
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
11669
11719
|
},
|
|
11670
11720
|
vendorType: {
|
|
11671
11721
|
enum: Object.values(EnumVendorType),
|
|
@@ -11675,24 +11725,24 @@ var schema8 = new MongooseSchema12(
|
|
|
11675
11725
|
},
|
|
11676
11726
|
{ timestamps: true }
|
|
11677
11727
|
);
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
var VendorModel =
|
|
11728
|
+
schema9.index({ name: 1 });
|
|
11729
|
+
schema9.index({ description: 1 });
|
|
11730
|
+
schema9.index({ region: 1 });
|
|
11731
|
+
schema9.index({ "categories.name": 1 });
|
|
11732
|
+
schema9.index({ "associates.email": 1 });
|
|
11733
|
+
var VendorModel = mongoose13.models.Vendor || mongoose13.model("Vendor", schema9);
|
|
11684
11734
|
|
|
11685
11735
|
// src/mongoose/vendor/VendorInfo.ts
|
|
11686
|
-
import
|
|
11687
|
-
var
|
|
11688
|
-
var AttributesSchema = new
|
|
11736
|
+
import mongoose14 from "mongoose";
|
|
11737
|
+
var MongooseSchema14 = mongoose14.Schema;
|
|
11738
|
+
var AttributesSchema = new MongooseSchema14(
|
|
11689
11739
|
{
|
|
11690
11740
|
details: { required: false, type: String },
|
|
11691
11741
|
isRequired: { default: false, required: true, type: Boolean }
|
|
11692
11742
|
},
|
|
11693
11743
|
{ _id: false }
|
|
11694
11744
|
);
|
|
11695
|
-
var
|
|
11745
|
+
var schema10 = new MongooseSchema14(
|
|
11696
11746
|
{
|
|
11697
11747
|
compliance: {
|
|
11698
11748
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
@@ -11726,17 +11776,17 @@ var schema9 = new MongooseSchema13(
|
|
|
11726
11776
|
vendorId: {
|
|
11727
11777
|
ref: "Vendor",
|
|
11728
11778
|
required: true,
|
|
11729
|
-
type:
|
|
11779
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
11730
11780
|
}
|
|
11731
11781
|
},
|
|
11732
11782
|
{ timestamps: true }
|
|
11733
11783
|
);
|
|
11734
|
-
var VendorInfoModel =
|
|
11784
|
+
var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorInfo", schema10);
|
|
11735
11785
|
|
|
11736
11786
|
// src/mongoose/event/Event.ts
|
|
11737
|
-
import
|
|
11738
|
-
var
|
|
11739
|
-
var locationsSchema = new
|
|
11787
|
+
import mongoose15 from "mongoose";
|
|
11788
|
+
var MongooseSchema15 = mongoose15.Schema;
|
|
11789
|
+
var locationsSchema = new MongooseSchema15(
|
|
11740
11790
|
{
|
|
11741
11791
|
city: { required: true, type: String },
|
|
11742
11792
|
coordinates: {
|
|
@@ -11759,7 +11809,7 @@ var locationsSchema = new MongooseSchema14(
|
|
|
11759
11809
|
{ _id: false }
|
|
11760
11810
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11761
11811
|
);
|
|
11762
|
-
var
|
|
11812
|
+
var schema11 = new MongooseSchema15(
|
|
11763
11813
|
{
|
|
11764
11814
|
...baseResourceFields,
|
|
11765
11815
|
// Importing base resource fields from global.ts
|
|
@@ -11767,7 +11817,7 @@ var schema10 = new MongooseSchema14(
|
|
|
11767
11817
|
eventInfoId: {
|
|
11768
11818
|
ref: "EventInfo",
|
|
11769
11819
|
required: false,
|
|
11770
|
-
type:
|
|
11820
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
11771
11821
|
},
|
|
11772
11822
|
eventType: {
|
|
11773
11823
|
enum: Object.values(EnumEventType),
|
|
@@ -11790,18 +11840,18 @@ var schema10 = new MongooseSchema14(
|
|
|
11790
11840
|
},
|
|
11791
11841
|
{ timestamps: true }
|
|
11792
11842
|
);
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
var EventModel =
|
|
11843
|
+
schema11.index({ name: 1 });
|
|
11844
|
+
schema11.index({ description: 1 });
|
|
11845
|
+
schema11.index({ region: 1 });
|
|
11846
|
+
schema11.index({ location: "2dsphere" });
|
|
11847
|
+
schema11.index({ tags: 1 });
|
|
11848
|
+
schema11.index({ "associates.email": 1 });
|
|
11849
|
+
var EventModel = mongoose15.models.Event || mongoose15.model("Event", schema11);
|
|
11800
11850
|
|
|
11801
11851
|
// src/mongoose/Partner.ts
|
|
11802
|
-
import
|
|
11803
|
-
var
|
|
11804
|
-
var
|
|
11852
|
+
import mongoose16 from "mongoose";
|
|
11853
|
+
var MongooseSchema16 = mongoose16.Schema;
|
|
11854
|
+
var schema12 = new MongooseSchema16(
|
|
11805
11855
|
{
|
|
11806
11856
|
...baseResourceFields,
|
|
11807
11857
|
location: {
|
|
@@ -11817,17 +11867,17 @@ var schema11 = new MongooseSchema15(
|
|
|
11817
11867
|
},
|
|
11818
11868
|
{ timestamps: true }
|
|
11819
11869
|
);
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
var PartnerModel =
|
|
11870
|
+
schema12.index({ name: 1 });
|
|
11871
|
+
schema12.index({ description: 1 });
|
|
11872
|
+
schema12.index({ region: 1 });
|
|
11873
|
+
schema12.index({ location: "2dsphere" });
|
|
11874
|
+
schema12.index({ "associates.email": 1 });
|
|
11875
|
+
var PartnerModel = mongoose16.models.Partner || mongoose16.model("Partner", schema12);
|
|
11826
11876
|
|
|
11827
11877
|
// src/mongoose/Post.ts
|
|
11828
|
-
import
|
|
11829
|
-
var
|
|
11830
|
-
var contentSchema = new
|
|
11878
|
+
import mongoose17, { Schema as Schema2 } from "mongoose";
|
|
11879
|
+
var MongooseSchema17 = mongoose17.Schema;
|
|
11880
|
+
var contentSchema = new MongooseSchema17(
|
|
11831
11881
|
{
|
|
11832
11882
|
contentData: Schema2.Types.Mixed,
|
|
11833
11883
|
contentOrder: { required: true, type: Number },
|
|
@@ -11839,7 +11889,7 @@ var contentSchema = new MongooseSchema16(
|
|
|
11839
11889
|
},
|
|
11840
11890
|
{ _id: false }
|
|
11841
11891
|
);
|
|
11842
|
-
var
|
|
11892
|
+
var schema13 = new MongooseSchema17(
|
|
11843
11893
|
{
|
|
11844
11894
|
active: { default: true, required: true, type: Boolean },
|
|
11845
11895
|
caption: { required: true, type: String },
|
|
@@ -11854,15 +11904,15 @@ var schema12 = new MongooseSchema16(
|
|
|
11854
11904
|
},
|
|
11855
11905
|
{ timestamps: true }
|
|
11856
11906
|
);
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
var PostModel =
|
|
11907
|
+
schema13.index({ title: 1 });
|
|
11908
|
+
schema13.index({ tags: 1 });
|
|
11909
|
+
var PostModel = mongoose17.models.Post || mongoose17.model("Post", schema13);
|
|
11860
11910
|
|
|
11861
11911
|
// src/mongoose/AppSetting.ts
|
|
11862
|
-
import
|
|
11863
|
-
var
|
|
11912
|
+
import mongoose18 from "mongoose";
|
|
11913
|
+
var MongooseSchema18 = mongoose18.Schema;
|
|
11864
11914
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
11865
|
-
var AppSettingSchema = new
|
|
11915
|
+
var AppSettingSchema = new MongooseSchema18(
|
|
11866
11916
|
{
|
|
11867
11917
|
appVersion: { default: "1.0.1", required: true, type: String },
|
|
11868
11918
|
key: {
|
|
@@ -11877,10 +11927,10 @@ var AppSettingSchema = new MongooseSchema17(
|
|
|
11877
11927
|
},
|
|
11878
11928
|
{ timestamps: true }
|
|
11879
11929
|
);
|
|
11880
|
-
var AppSettingModel =
|
|
11930
|
+
var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
|
|
11881
11931
|
|
|
11882
11932
|
// src/service/database.ts
|
|
11883
|
-
import
|
|
11933
|
+
import mongoose19 from "mongoose";
|
|
11884
11934
|
var connectToDatabase = async ({
|
|
11885
11935
|
appName,
|
|
11886
11936
|
dbName,
|
|
@@ -11893,7 +11943,7 @@ var connectToDatabase = async ({
|
|
|
11893
11943
|
// Fallback to MongoDB Atlas connection string
|
|
11894
11944
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11895
11945
|
);
|
|
11896
|
-
await
|
|
11946
|
+
await mongoose19.connect(mongoUri);
|
|
11897
11947
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11898
11948
|
console.log(
|
|
11899
11949
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12072,7 +12122,7 @@ async function updateAdStatuses() {
|
|
|
12072
12122
|
|
|
12073
12123
|
// src/types/index.ts
|
|
12074
12124
|
import express from "express";
|
|
12075
|
-
import
|
|
12125
|
+
import mongoose20 from "mongoose";
|
|
12076
12126
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12077
12127
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12078
12128
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12089,6 +12139,7 @@ export {
|
|
|
12089
12139
|
EnumPubSubEvents,
|
|
12090
12140
|
EventInfoModel,
|
|
12091
12141
|
EventModel,
|
|
12142
|
+
GoogleImportedMarketModel,
|
|
12092
12143
|
NotificationModel,
|
|
12093
12144
|
ParticipantSchema,
|
|
12094
12145
|
PartnerModel,
|
|
@@ -12111,7 +12162,7 @@ export {
|
|
|
12111
12162
|
dateTimeSchema3 as dateTimeSchema,
|
|
12112
12163
|
express,
|
|
12113
12164
|
locationsSchema,
|
|
12114
|
-
|
|
12165
|
+
mongoose20 as mongoose,
|
|
12115
12166
|
relationDatesSchema,
|
|
12116
12167
|
resourceRelationsSchema,
|
|
12117
12168
|
saveNotificationsInDb,
|