@timardex/cluemart-server-shared 1.0.58 → 1.0.60
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-EOKS26AC.mjs} +250 -193
- package/dist/chunk-EOKS26AC.mjs.map +1 -0
- package/dist/index.cjs +255 -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 +253 -196
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +251 -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 +238 -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
|
}
|
|
@@ -9990,6 +9990,13 @@ var UPDATE_APP_SETTINGS_MUTATION = gql`
|
|
|
9990
9990
|
updateAppSettings(input: $input)
|
|
9991
9991
|
}
|
|
9992
9992
|
`;
|
|
9993
|
+
var CRAWL_GOOGLE_MARKETS_MUTATION = gql`
|
|
9994
|
+
mutation crawlGoogleMarkets {
|
|
9995
|
+
crawlGoogleMarkets {
|
|
9996
|
+
message
|
|
9997
|
+
}
|
|
9998
|
+
}
|
|
9999
|
+
`;
|
|
9993
10000
|
var APP_SETTINGS_FIELDS_FRAGMENT = gql`
|
|
9994
10001
|
fragment AppSettingsFields on AppSettingsType {
|
|
9995
10002
|
_id
|
|
@@ -10166,7 +10173,7 @@ var socialMediaSchema = create$3({
|
|
|
10166
10173
|
is: (name) => !!name,
|
|
10167
10174
|
// If name has a value
|
|
10168
10175
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10169
|
-
otherwise: (
|
|
10176
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10170
10177
|
})
|
|
10171
10178
|
});
|
|
10172
10179
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10239,21 +10246,21 @@ var paymentInfoSchema = create$3({
|
|
|
10239
10246
|
paymentMethod: create$8().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
10240
10247
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10241
10248
|
is: "bank_transfer",
|
|
10242
|
-
then: (
|
|
10243
|
-
otherwise: (
|
|
10249
|
+
then: (schema14) => schema14.required("Account holder name is required for bank transfer").trim(),
|
|
10250
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10244
10251
|
}),
|
|
10245
10252
|
accountNumber: create$6().when("paymentMethod", {
|
|
10246
10253
|
is: "bank_transfer",
|
|
10247
|
-
then: (
|
|
10254
|
+
then: (schema14) => schema14.required("Account number is required for bank transfer").matches(
|
|
10248
10255
|
nzBankAccountRegex,
|
|
10249
10256
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10250
10257
|
).trim(),
|
|
10251
|
-
otherwise: (
|
|
10258
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10252
10259
|
}),
|
|
10253
10260
|
link: create$6().when("paymentMethod", {
|
|
10254
10261
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10255
10262
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10256
|
-
otherwise: (
|
|
10263
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10257
10264
|
})
|
|
10258
10265
|
});
|
|
10259
10266
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10366,8 +10373,8 @@ var userSchema = create$3().shape({
|
|
|
10366
10373
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10367
10374
|
is: (val) => !!val,
|
|
10368
10375
|
// only necessary if password typed
|
|
10369
|
-
then: (
|
|
10370
|
-
otherwise: (
|
|
10376
|
+
then: (schema14) => schema14.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10377
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10371
10378
|
}),
|
|
10372
10379
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10373
10380
|
});
|
|
@@ -10485,8 +10492,8 @@ var testerSchema = create$3().shape({
|
|
|
10485
10492
|
email: emailRequiredSchema,
|
|
10486
10493
|
event: create$3().when("resourceType", {
|
|
10487
10494
|
is: (resourceType) => resourceType === "event",
|
|
10488
|
-
otherwise: (
|
|
10489
|
-
then: (
|
|
10495
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10496
|
+
then: (schema14) => schema14.required("Event information is required").shape(testerEventSchema.fields)
|
|
10490
10497
|
}),
|
|
10491
10498
|
firstName: create$6().required("First name is required"),
|
|
10492
10499
|
lastName: create$6().required("Last name is required"),
|
|
@@ -10504,8 +10511,8 @@ var testerSchema = create$3().shape({
|
|
|
10504
10511
|
).required("Resource Type is required"),
|
|
10505
10512
|
vendor: create$3().when("resourceType", {
|
|
10506
10513
|
is: (resourceType) => resourceType === "vendor",
|
|
10507
|
-
otherwise: (
|
|
10508
|
-
then: (
|
|
10514
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10515
|
+
then: (schema14) => schema14.required("Vendor information is required").shape(testerVendorSchema.fields)
|
|
10509
10516
|
})
|
|
10510
10517
|
});
|
|
10511
10518
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
@@ -10543,7 +10550,7 @@ var adSchema = create$3().shape({
|
|
|
10543
10550
|
return endDate > now;
|
|
10544
10551
|
}).when("start", {
|
|
10545
10552
|
is: (val) => val && val.length > 0,
|
|
10546
|
-
then: (
|
|
10553
|
+
then: (schema14) => schema14.test(
|
|
10547
10554
|
"is-after-start",
|
|
10548
10555
|
"End date must be after start date",
|
|
10549
10556
|
function(value) {
|
|
@@ -11158,10 +11165,59 @@ ChatSchema.index({
|
|
|
11158
11165
|
});
|
|
11159
11166
|
var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
|
|
11160
11167
|
|
|
11161
|
-
// src/mongoose/
|
|
11168
|
+
// src/mongoose/GoogleImportedMarket.ts
|
|
11162
11169
|
import mongoose6 from "mongoose";
|
|
11163
11170
|
var MongooseSchema6 = mongoose6.Schema;
|
|
11171
|
+
var locationSchema2 = new MongooseSchema6(
|
|
11172
|
+
{
|
|
11173
|
+
lat: { required: true, type: Number },
|
|
11174
|
+
lng: { required: true, type: Number }
|
|
11175
|
+
},
|
|
11176
|
+
{ _id: false }
|
|
11177
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11178
|
+
);
|
|
11164
11179
|
var schema3 = new MongooseSchema6(
|
|
11180
|
+
{
|
|
11181
|
+
address: { required: true, type: String },
|
|
11182
|
+
businessStatus: { required: false, type: String },
|
|
11183
|
+
claimed: { default: false, required: true, type: Boolean },
|
|
11184
|
+
googleMapsUrl: { required: false, type: String },
|
|
11185
|
+
googlePlaceId: {
|
|
11186
|
+
required: true,
|
|
11187
|
+
type: String,
|
|
11188
|
+
unique: true
|
|
11189
|
+
// unique, indexed
|
|
11190
|
+
},
|
|
11191
|
+
image: { required: false, type: String },
|
|
11192
|
+
// photo_reference only
|
|
11193
|
+
importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
|
|
11194
|
+
location: {
|
|
11195
|
+
required: false,
|
|
11196
|
+
// optional because lat/lng may expire after 30 days
|
|
11197
|
+
type: locationSchema2
|
|
11198
|
+
},
|
|
11199
|
+
name: { required: true, type: String },
|
|
11200
|
+
openingHours: { required: false, type: [String] },
|
|
11201
|
+
phone: { required: false, type: String },
|
|
11202
|
+
photos: { required: false, type: [String] },
|
|
11203
|
+
// array of photo_reference
|
|
11204
|
+
rating: { required: false, type: Number },
|
|
11205
|
+
reviewCount: { required: false, type: Number },
|
|
11206
|
+
slug: { required: true, type: String },
|
|
11207
|
+
website: { required: false, type: String }
|
|
11208
|
+
},
|
|
11209
|
+
{ timestamps: true }
|
|
11210
|
+
);
|
|
11211
|
+
schema3.index({ name: 1 });
|
|
11212
|
+
schema3.index({ slug: 1 });
|
|
11213
|
+
schema3.index({ address: 1 });
|
|
11214
|
+
schema3.index({ "location.lat": 1, "location.lng": 1 });
|
|
11215
|
+
var GoogleImportedMarketModel = mongoose6.models.GoogleImportedMarket || mongoose6.model("GoogleImportedMarket", schema3);
|
|
11216
|
+
|
|
11217
|
+
// src/mongoose/Notification.ts
|
|
11218
|
+
import mongoose7 from "mongoose";
|
|
11219
|
+
var MongooseSchema7 = mongoose7.Schema;
|
|
11220
|
+
var schema4 = new MongooseSchema7(
|
|
11165
11221
|
{
|
|
11166
11222
|
data: {
|
|
11167
11223
|
resourceId: { required: true, type: String },
|
|
@@ -11184,14 +11240,14 @@ var schema3 = new MongooseSchema6(
|
|
|
11184
11240
|
userId: {
|
|
11185
11241
|
ref: "User",
|
|
11186
11242
|
required: true,
|
|
11187
|
-
type:
|
|
11243
|
+
type: mongoose7.Schema.Types.ObjectId
|
|
11188
11244
|
}
|
|
11189
11245
|
},
|
|
11190
11246
|
{ timestamps: true }
|
|
11191
11247
|
);
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
var NotificationModel =
|
|
11248
|
+
schema4.index({ isRead: 1, userId: 1 });
|
|
11249
|
+
schema4.index({ createdAt: -1, userId: 1 });
|
|
11250
|
+
var NotificationModel = mongoose7.models.Notification || mongoose7.model("Notification", schema4);
|
|
11195
11251
|
|
|
11196
11252
|
// node_modules/@timardex/cluemart-shared/dist/chunk-OBQRGWV3.mjs
|
|
11197
11253
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
@@ -11202,9 +11258,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
11202
11258
|
})(EnumOSPlatform2 || {});
|
|
11203
11259
|
|
|
11204
11260
|
// src/mongoose/PushToken.ts
|
|
11205
|
-
import
|
|
11206
|
-
var
|
|
11207
|
-
var
|
|
11261
|
+
import mongoose8 from "mongoose";
|
|
11262
|
+
var MongooseSchema8 = mongoose8.Schema;
|
|
11263
|
+
var schema5 = new MongooseSchema8(
|
|
11208
11264
|
{
|
|
11209
11265
|
platform: {
|
|
11210
11266
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -11212,16 +11268,16 @@ var schema4 = new MongooseSchema7(
|
|
|
11212
11268
|
type: String
|
|
11213
11269
|
},
|
|
11214
11270
|
token: { required: true, type: String },
|
|
11215
|
-
userId: { required: true, type:
|
|
11271
|
+
userId: { required: true, type: mongoose8.Schema.Types.ObjectId }
|
|
11216
11272
|
},
|
|
11217
11273
|
{ timestamps: true }
|
|
11218
11274
|
);
|
|
11219
|
-
var PushTokenModel =
|
|
11275
|
+
var PushTokenModel = mongoose8.models.PushToken || mongoose8.model("PushToken", schema5);
|
|
11220
11276
|
|
|
11221
11277
|
// src/mongoose/ResourceActivity.ts
|
|
11222
|
-
import
|
|
11223
|
-
var
|
|
11224
|
-
var ActivitySchema = new
|
|
11278
|
+
import mongoose9 from "mongoose";
|
|
11279
|
+
var MongooseSchema9 = mongoose9.Schema;
|
|
11280
|
+
var ActivitySchema = new MongooseSchema9(
|
|
11225
11281
|
{
|
|
11226
11282
|
activityType: {
|
|
11227
11283
|
enum: Object.values(EnumActivity),
|
|
@@ -11257,7 +11313,7 @@ var ActivitySchema = new MongooseSchema8(
|
|
|
11257
11313
|
},
|
|
11258
11314
|
{ _id: false }
|
|
11259
11315
|
);
|
|
11260
|
-
var
|
|
11316
|
+
var schema6 = new MongooseSchema9(
|
|
11261
11317
|
{
|
|
11262
11318
|
activity: { default: [], type: [ActivitySchema] },
|
|
11263
11319
|
resourceId: { required: true, type: String },
|
|
@@ -11269,14 +11325,14 @@ var schema5 = new MongooseSchema8(
|
|
|
11269
11325
|
},
|
|
11270
11326
|
{ timestamps: true }
|
|
11271
11327
|
);
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
var ResourceActivityModel =
|
|
11328
|
+
schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
11329
|
+
schema6.index({ "views.location": "2dsphere" });
|
|
11330
|
+
var ResourceActivityModel = mongoose9.models.ResourceActivity || mongoose9.model("ResourceActivity", schema6);
|
|
11275
11331
|
|
|
11276
11332
|
// src/mongoose/Tester.ts
|
|
11277
|
-
import
|
|
11278
|
-
var
|
|
11279
|
-
var TesterVendorQuestionarySchema = new
|
|
11333
|
+
import mongoose10 from "mongoose";
|
|
11334
|
+
var MongooseSchema10 = mongoose10.Schema;
|
|
11335
|
+
var TesterVendorQuestionarySchema = new MongooseSchema10(
|
|
11280
11336
|
{
|
|
11281
11337
|
appearInVideoIntroduction: {
|
|
11282
11338
|
default: false,
|
|
@@ -11303,7 +11359,7 @@ var TesterVendorQuestionarySchema = new MongooseSchema9(
|
|
|
11303
11359
|
},
|
|
11304
11360
|
{ _id: false }
|
|
11305
11361
|
);
|
|
11306
|
-
var TesterVendorSchema = new
|
|
11362
|
+
var TesterVendorSchema = new MongooseSchema10(
|
|
11307
11363
|
{
|
|
11308
11364
|
categories: { required: true, type: [CategorySchema] },
|
|
11309
11365
|
marketsAttended: {
|
|
@@ -11329,7 +11385,7 @@ var TesterVendorSchema = new MongooseSchema9(
|
|
|
11329
11385
|
},
|
|
11330
11386
|
{ _id: false }
|
|
11331
11387
|
);
|
|
11332
|
-
var TesterEventQuestionarySchema = new
|
|
11388
|
+
var TesterEventQuestionarySchema = new MongooseSchema10(
|
|
11333
11389
|
{
|
|
11334
11390
|
allowMarketingAppearance: {
|
|
11335
11391
|
default: false,
|
|
@@ -11364,7 +11420,7 @@ var TesterEventQuestionarySchema = new MongooseSchema9(
|
|
|
11364
11420
|
},
|
|
11365
11421
|
{ _id: false }
|
|
11366
11422
|
);
|
|
11367
|
-
var TesterEventsSchema = new
|
|
11423
|
+
var TesterEventsSchema = new MongooseSchema10(
|
|
11368
11424
|
{
|
|
11369
11425
|
markets: {
|
|
11370
11426
|
required: true,
|
|
@@ -11393,7 +11449,7 @@ var TesterEventsSchema = new MongooseSchema9(
|
|
|
11393
11449
|
},
|
|
11394
11450
|
{ _id: false }
|
|
11395
11451
|
);
|
|
11396
|
-
var TesterSchema = new
|
|
11452
|
+
var TesterSchema = new MongooseSchema10(
|
|
11397
11453
|
{
|
|
11398
11454
|
active: { default: false, required: true, type: Boolean },
|
|
11399
11455
|
approved: { default: false, required: true, type: Boolean },
|
|
@@ -11427,43 +11483,43 @@ var TesterSchema = new MongooseSchema9(
|
|
|
11427
11483
|
timestamps: true
|
|
11428
11484
|
}
|
|
11429
11485
|
);
|
|
11430
|
-
var TesterModel =
|
|
11486
|
+
var TesterModel = mongoose10.models.Tester || mongoose10.model("Tester", TesterSchema);
|
|
11431
11487
|
|
|
11432
11488
|
// src/mongoose/User.ts
|
|
11433
|
-
import
|
|
11434
|
-
var
|
|
11435
|
-
var userActivityEventSchema = new
|
|
11489
|
+
import mongoose11 from "mongoose";
|
|
11490
|
+
var MongooseSchema11 = mongoose11.Schema;
|
|
11491
|
+
var userActivityEventSchema = new MongooseSchema11(
|
|
11436
11492
|
{
|
|
11437
11493
|
dateTime: dateTimeSchema3,
|
|
11438
11494
|
resourceId: {
|
|
11439
11495
|
ref: "Event",
|
|
11440
11496
|
required: false,
|
|
11441
|
-
type:
|
|
11497
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11442
11498
|
}
|
|
11443
11499
|
},
|
|
11444
11500
|
{ _id: false }
|
|
11445
11501
|
);
|
|
11446
|
-
var userActivityFavouritesSchema = new
|
|
11502
|
+
var userActivityFavouritesSchema = new MongooseSchema11(
|
|
11447
11503
|
{
|
|
11448
11504
|
events: {
|
|
11449
11505
|
ref: "Event",
|
|
11450
11506
|
required: false,
|
|
11451
|
-
type: [
|
|
11507
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11452
11508
|
},
|
|
11453
11509
|
partners: {
|
|
11454
11510
|
ref: "Partner",
|
|
11455
11511
|
required: false,
|
|
11456
|
-
type: [
|
|
11512
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11457
11513
|
},
|
|
11458
11514
|
vendors: {
|
|
11459
11515
|
ref: "Vendor",
|
|
11460
11516
|
required: false,
|
|
11461
|
-
type: [
|
|
11517
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11462
11518
|
}
|
|
11463
11519
|
},
|
|
11464
11520
|
{ _id: false }
|
|
11465
11521
|
);
|
|
11466
|
-
var stripeSchema = new
|
|
11522
|
+
var stripeSchema = new MongooseSchema11(
|
|
11467
11523
|
{
|
|
11468
11524
|
currentPlan: {
|
|
11469
11525
|
enum: Object.values(EnumUserLicence),
|
|
@@ -11494,7 +11550,7 @@ var stripeSchema = new MongooseSchema10(
|
|
|
11494
11550
|
},
|
|
11495
11551
|
{ _id: false }
|
|
11496
11552
|
);
|
|
11497
|
-
var
|
|
11553
|
+
var schema7 = new MongooseSchema11(
|
|
11498
11554
|
{
|
|
11499
11555
|
active: { default: false, required: true, type: Boolean },
|
|
11500
11556
|
associates: {
|
|
@@ -11510,7 +11566,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11510
11566
|
events: {
|
|
11511
11567
|
ref: "Event",
|
|
11512
11568
|
required: false,
|
|
11513
|
-
type: [
|
|
11569
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
11514
11570
|
},
|
|
11515
11571
|
firstName: { required: true, type: String },
|
|
11516
11572
|
isTester: { default: false, required: true, type: Boolean },
|
|
@@ -11522,7 +11578,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11522
11578
|
partner: {
|
|
11523
11579
|
ref: "Partner",
|
|
11524
11580
|
required: false,
|
|
11525
|
-
type:
|
|
11581
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11526
11582
|
},
|
|
11527
11583
|
password: { required: true, type: String },
|
|
11528
11584
|
platform: {
|
|
@@ -11567,20 +11623,20 @@ var schema6 = new MongooseSchema10(
|
|
|
11567
11623
|
vendor: {
|
|
11568
11624
|
ref: "Vendor",
|
|
11569
11625
|
required: false,
|
|
11570
|
-
type:
|
|
11626
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
11571
11627
|
}
|
|
11572
11628
|
},
|
|
11573
11629
|
{ strict: false, timestamps: true }
|
|
11574
11630
|
);
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
var UserModel =
|
|
11631
|
+
schema7.index({ "associates.email": 1 });
|
|
11632
|
+
schema7.index({ "licences.expiryDate": 1 });
|
|
11633
|
+
schema7.index({ "licences.licenceType": 1 });
|
|
11634
|
+
var UserModel = mongoose11.models.User || mongoose11.model("User", schema7);
|
|
11579
11635
|
|
|
11580
11636
|
// src/mongoose/VerificationToken.ts
|
|
11581
|
-
import
|
|
11582
|
-
var
|
|
11583
|
-
var
|
|
11637
|
+
import mongoose12 from "mongoose";
|
|
11638
|
+
var MongooseSchema12 = mongoose12.Schema;
|
|
11639
|
+
var schema8 = new MongooseSchema12(
|
|
11584
11640
|
{
|
|
11585
11641
|
createdAt: {
|
|
11586
11642
|
default: Date.now,
|
|
@@ -11595,12 +11651,12 @@ var schema7 = new MongooseSchema11(
|
|
|
11595
11651
|
},
|
|
11596
11652
|
{ timestamps: true }
|
|
11597
11653
|
);
|
|
11598
|
-
var VerificationTokenModel =
|
|
11654
|
+
var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.model("VerificationToken", schema8);
|
|
11599
11655
|
|
|
11600
11656
|
// src/mongoose/vendor/Vendor.ts
|
|
11601
|
-
import
|
|
11602
|
-
var
|
|
11603
|
-
var MenuTypeSchema = new
|
|
11657
|
+
import mongoose13 from "mongoose";
|
|
11658
|
+
var MongooseSchema13 = mongoose13.Schema;
|
|
11659
|
+
var MenuTypeSchema = new MongooseSchema13(
|
|
11604
11660
|
{
|
|
11605
11661
|
description: { required: false, type: String },
|
|
11606
11662
|
name: { required: false, type: String },
|
|
@@ -11610,7 +11666,7 @@ var MenuTypeSchema = new MongooseSchema12(
|
|
|
11610
11666
|
{ _id: false }
|
|
11611
11667
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11612
11668
|
);
|
|
11613
|
-
var LocationsSchema = new
|
|
11669
|
+
var LocationsSchema = new MongooseSchema13(
|
|
11614
11670
|
{
|
|
11615
11671
|
dateTime: {
|
|
11616
11672
|
dateStatus: {
|
|
@@ -11643,7 +11699,7 @@ var LocationsSchema = new MongooseSchema12(
|
|
|
11643
11699
|
{ _id: false }
|
|
11644
11700
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11645
11701
|
);
|
|
11646
|
-
var
|
|
11702
|
+
var schema9 = new MongooseSchema13(
|
|
11647
11703
|
{
|
|
11648
11704
|
...baseResourceFields,
|
|
11649
11705
|
// Importing base resource fields from global.ts
|
|
@@ -11665,7 +11721,7 @@ var schema8 = new MongooseSchema12(
|
|
|
11665
11721
|
vendorInfoId: {
|
|
11666
11722
|
ref: "VendorInfo",
|
|
11667
11723
|
required: false,
|
|
11668
|
-
type:
|
|
11724
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
11669
11725
|
},
|
|
11670
11726
|
vendorType: {
|
|
11671
11727
|
enum: Object.values(EnumVendorType),
|
|
@@ -11675,24 +11731,24 @@ var schema8 = new MongooseSchema12(
|
|
|
11675
11731
|
},
|
|
11676
11732
|
{ timestamps: true }
|
|
11677
11733
|
);
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
var VendorModel =
|
|
11734
|
+
schema9.index({ name: 1 });
|
|
11735
|
+
schema9.index({ description: 1 });
|
|
11736
|
+
schema9.index({ region: 1 });
|
|
11737
|
+
schema9.index({ "categories.name": 1 });
|
|
11738
|
+
schema9.index({ "associates.email": 1 });
|
|
11739
|
+
var VendorModel = mongoose13.models.Vendor || mongoose13.model("Vendor", schema9);
|
|
11684
11740
|
|
|
11685
11741
|
// src/mongoose/vendor/VendorInfo.ts
|
|
11686
|
-
import
|
|
11687
|
-
var
|
|
11688
|
-
var AttributesSchema = new
|
|
11742
|
+
import mongoose14 from "mongoose";
|
|
11743
|
+
var MongooseSchema14 = mongoose14.Schema;
|
|
11744
|
+
var AttributesSchema = new MongooseSchema14(
|
|
11689
11745
|
{
|
|
11690
11746
|
details: { required: false, type: String },
|
|
11691
11747
|
isRequired: { default: false, required: true, type: Boolean }
|
|
11692
11748
|
},
|
|
11693
11749
|
{ _id: false }
|
|
11694
11750
|
);
|
|
11695
|
-
var
|
|
11751
|
+
var schema10 = new MongooseSchema14(
|
|
11696
11752
|
{
|
|
11697
11753
|
compliance: {
|
|
11698
11754
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
@@ -11726,17 +11782,17 @@ var schema9 = new MongooseSchema13(
|
|
|
11726
11782
|
vendorId: {
|
|
11727
11783
|
ref: "Vendor",
|
|
11728
11784
|
required: true,
|
|
11729
|
-
type:
|
|
11785
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
11730
11786
|
}
|
|
11731
11787
|
},
|
|
11732
11788
|
{ timestamps: true }
|
|
11733
11789
|
);
|
|
11734
|
-
var VendorInfoModel =
|
|
11790
|
+
var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorInfo", schema10);
|
|
11735
11791
|
|
|
11736
11792
|
// src/mongoose/event/Event.ts
|
|
11737
|
-
import
|
|
11738
|
-
var
|
|
11739
|
-
var locationsSchema = new
|
|
11793
|
+
import mongoose15 from "mongoose";
|
|
11794
|
+
var MongooseSchema15 = mongoose15.Schema;
|
|
11795
|
+
var locationsSchema = new MongooseSchema15(
|
|
11740
11796
|
{
|
|
11741
11797
|
city: { required: true, type: String },
|
|
11742
11798
|
coordinates: {
|
|
@@ -11759,7 +11815,7 @@ var locationsSchema = new MongooseSchema14(
|
|
|
11759
11815
|
{ _id: false }
|
|
11760
11816
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11761
11817
|
);
|
|
11762
|
-
var
|
|
11818
|
+
var schema11 = new MongooseSchema15(
|
|
11763
11819
|
{
|
|
11764
11820
|
...baseResourceFields,
|
|
11765
11821
|
// Importing base resource fields from global.ts
|
|
@@ -11767,7 +11823,7 @@ var schema10 = new MongooseSchema14(
|
|
|
11767
11823
|
eventInfoId: {
|
|
11768
11824
|
ref: "EventInfo",
|
|
11769
11825
|
required: false,
|
|
11770
|
-
type:
|
|
11826
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
11771
11827
|
},
|
|
11772
11828
|
eventType: {
|
|
11773
11829
|
enum: Object.values(EnumEventType),
|
|
@@ -11790,18 +11846,18 @@ var schema10 = new MongooseSchema14(
|
|
|
11790
11846
|
},
|
|
11791
11847
|
{ timestamps: true }
|
|
11792
11848
|
);
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
var EventModel =
|
|
11849
|
+
schema11.index({ name: 1 });
|
|
11850
|
+
schema11.index({ description: 1 });
|
|
11851
|
+
schema11.index({ region: 1 });
|
|
11852
|
+
schema11.index({ location: "2dsphere" });
|
|
11853
|
+
schema11.index({ tags: 1 });
|
|
11854
|
+
schema11.index({ "associates.email": 1 });
|
|
11855
|
+
var EventModel = mongoose15.models.Event || mongoose15.model("Event", schema11);
|
|
11800
11856
|
|
|
11801
11857
|
// src/mongoose/Partner.ts
|
|
11802
|
-
import
|
|
11803
|
-
var
|
|
11804
|
-
var
|
|
11858
|
+
import mongoose16 from "mongoose";
|
|
11859
|
+
var MongooseSchema16 = mongoose16.Schema;
|
|
11860
|
+
var schema12 = new MongooseSchema16(
|
|
11805
11861
|
{
|
|
11806
11862
|
...baseResourceFields,
|
|
11807
11863
|
location: {
|
|
@@ -11817,17 +11873,17 @@ var schema11 = new MongooseSchema15(
|
|
|
11817
11873
|
},
|
|
11818
11874
|
{ timestamps: true }
|
|
11819
11875
|
);
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
var PartnerModel =
|
|
11876
|
+
schema12.index({ name: 1 });
|
|
11877
|
+
schema12.index({ description: 1 });
|
|
11878
|
+
schema12.index({ region: 1 });
|
|
11879
|
+
schema12.index({ location: "2dsphere" });
|
|
11880
|
+
schema12.index({ "associates.email": 1 });
|
|
11881
|
+
var PartnerModel = mongoose16.models.Partner || mongoose16.model("Partner", schema12);
|
|
11826
11882
|
|
|
11827
11883
|
// src/mongoose/Post.ts
|
|
11828
|
-
import
|
|
11829
|
-
var
|
|
11830
|
-
var contentSchema = new
|
|
11884
|
+
import mongoose17, { Schema as Schema2 } from "mongoose";
|
|
11885
|
+
var MongooseSchema17 = mongoose17.Schema;
|
|
11886
|
+
var contentSchema = new MongooseSchema17(
|
|
11831
11887
|
{
|
|
11832
11888
|
contentData: Schema2.Types.Mixed,
|
|
11833
11889
|
contentOrder: { required: true, type: Number },
|
|
@@ -11839,7 +11895,7 @@ var contentSchema = new MongooseSchema16(
|
|
|
11839
11895
|
},
|
|
11840
11896
|
{ _id: false }
|
|
11841
11897
|
);
|
|
11842
|
-
var
|
|
11898
|
+
var schema13 = new MongooseSchema17(
|
|
11843
11899
|
{
|
|
11844
11900
|
active: { default: true, required: true, type: Boolean },
|
|
11845
11901
|
caption: { required: true, type: String },
|
|
@@ -11854,15 +11910,15 @@ var schema12 = new MongooseSchema16(
|
|
|
11854
11910
|
},
|
|
11855
11911
|
{ timestamps: true }
|
|
11856
11912
|
);
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
var PostModel =
|
|
11913
|
+
schema13.index({ title: 1 });
|
|
11914
|
+
schema13.index({ tags: 1 });
|
|
11915
|
+
var PostModel = mongoose17.models.Post || mongoose17.model("Post", schema13);
|
|
11860
11916
|
|
|
11861
11917
|
// src/mongoose/AppSetting.ts
|
|
11862
|
-
import
|
|
11863
|
-
var
|
|
11918
|
+
import mongoose18 from "mongoose";
|
|
11919
|
+
var MongooseSchema18 = mongoose18.Schema;
|
|
11864
11920
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
11865
|
-
var AppSettingSchema = new
|
|
11921
|
+
var AppSettingSchema = new MongooseSchema18(
|
|
11866
11922
|
{
|
|
11867
11923
|
appVersion: { default: "1.0.1", required: true, type: String },
|
|
11868
11924
|
key: {
|
|
@@ -11877,10 +11933,10 @@ var AppSettingSchema = new MongooseSchema17(
|
|
|
11877
11933
|
},
|
|
11878
11934
|
{ timestamps: true }
|
|
11879
11935
|
);
|
|
11880
|
-
var AppSettingModel =
|
|
11936
|
+
var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
|
|
11881
11937
|
|
|
11882
11938
|
// src/service/database.ts
|
|
11883
|
-
import
|
|
11939
|
+
import mongoose19 from "mongoose";
|
|
11884
11940
|
var connectToDatabase = async ({
|
|
11885
11941
|
appName,
|
|
11886
11942
|
dbName,
|
|
@@ -11893,7 +11949,7 @@ var connectToDatabase = async ({
|
|
|
11893
11949
|
// Fallback to MongoDB Atlas connection string
|
|
11894
11950
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11895
11951
|
);
|
|
11896
|
-
await
|
|
11952
|
+
await mongoose19.connect(mongoUri);
|
|
11897
11953
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11898
11954
|
console.log(
|
|
11899
11955
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12072,7 +12128,7 @@ async function updateAdStatuses() {
|
|
|
12072
12128
|
|
|
12073
12129
|
// src/types/index.ts
|
|
12074
12130
|
import express from "express";
|
|
12075
|
-
import
|
|
12131
|
+
import mongoose20 from "mongoose";
|
|
12076
12132
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12077
12133
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12078
12134
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12089,6 +12145,7 @@ export {
|
|
|
12089
12145
|
EnumPubSubEvents,
|
|
12090
12146
|
EventInfoModel,
|
|
12091
12147
|
EventModel,
|
|
12148
|
+
GoogleImportedMarketModel,
|
|
12092
12149
|
NotificationModel,
|
|
12093
12150
|
ParticipantSchema,
|
|
12094
12151
|
PartnerModel,
|
|
@@ -12111,7 +12168,7 @@ export {
|
|
|
12111
12168
|
dateTimeSchema3 as dateTimeSchema,
|
|
12112
12169
|
express,
|
|
12113
12170
|
locationsSchema,
|
|
12114
|
-
|
|
12171
|
+
mongoose20 as mongoose,
|
|
12115
12172
|
relationDatesSchema,
|
|
12116
12173
|
resourceRelationsSchema,
|
|
12117
12174
|
saveNotificationsInDb,
|