@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.cjs
CHANGED
|
@@ -1681,6 +1681,7 @@ __export(index_exports, {
|
|
|
1681
1681
|
EnumPubSubEvents: () => EnumPubSubEvents,
|
|
1682
1682
|
EventInfoModel: () => EventInfoModel,
|
|
1683
1683
|
EventModel: () => EventModel,
|
|
1684
|
+
GoogleImportedMarketModel: () => GoogleImportedMarketModel,
|
|
1684
1685
|
NotificationModel: () => NotificationModel,
|
|
1685
1686
|
ParticipantSchema: () => ParticipantSchema,
|
|
1686
1687
|
PartnerModel: () => PartnerModel,
|
|
@@ -1703,7 +1704,7 @@ __export(index_exports, {
|
|
|
1703
1704
|
dateTimeSchema: () => dateTimeSchema3,
|
|
1704
1705
|
express: () => import_express.default,
|
|
1705
1706
|
locationsSchema: () => locationsSchema,
|
|
1706
|
-
mongoose: () =>
|
|
1707
|
+
mongoose: () => import_mongoose21.default,
|
|
1707
1708
|
relationDatesSchema: () => relationDatesSchema,
|
|
1708
1709
|
resourceRelationsSchema: () => resourceRelationsSchema,
|
|
1709
1710
|
saveNotificationsInDb: () => saveNotificationsInDb,
|
|
@@ -4727,10 +4728,10 @@ var Condition = class _Condition {
|
|
|
4727
4728
|
otherwise
|
|
4728
4729
|
} = config;
|
|
4729
4730
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4730
|
-
return new _Condition(refs, (values,
|
|
4731
|
+
return new _Condition(refs, (values, schema14) => {
|
|
4731
4732
|
var _branch;
|
|
4732
4733
|
let branch = check(...values) ? then : otherwise;
|
|
4733
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4734
|
+
return (_branch = branch == null ? void 0 : branch(schema14)) != null ? _branch : schema14;
|
|
4734
4735
|
});
|
|
4735
4736
|
}
|
|
4736
4737
|
constructor(refs, builder) {
|
|
@@ -4744,13 +4745,13 @@ var Condition = class _Condition {
|
|
|
4744
4745
|
// TODO: ? operator here?
|
|
4745
4746
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4746
4747
|
));
|
|
4747
|
-
let
|
|
4748
|
-
if (
|
|
4749
|
-
|
|
4748
|
+
let schema14 = this.fn(values, base, options);
|
|
4749
|
+
if (schema14 === void 0 || // @ts-ignore this can be base
|
|
4750
|
+
schema14 === base) {
|
|
4750
4751
|
return base;
|
|
4751
4752
|
}
|
|
4752
|
-
if (!isSchema(
|
|
4753
|
-
return
|
|
4753
|
+
if (!isSchema(schema14)) throw new TypeError("conditions must return a schema object");
|
|
4754
|
+
return schema14.resolve(options);
|
|
4754
4755
|
}
|
|
4755
4756
|
};
|
|
4756
4757
|
var prefixes = {
|
|
@@ -4820,7 +4821,7 @@ function createValidation(config) {
|
|
|
4820
4821
|
path = "",
|
|
4821
4822
|
options,
|
|
4822
4823
|
originalValue,
|
|
4823
|
-
schema:
|
|
4824
|
+
schema: schema14
|
|
4824
4825
|
}, panic, next) {
|
|
4825
4826
|
const {
|
|
4826
4827
|
name,
|
|
@@ -4832,8 +4833,8 @@ function createValidation(config) {
|
|
|
4832
4833
|
let {
|
|
4833
4834
|
parent,
|
|
4834
4835
|
context,
|
|
4835
|
-
abortEarly =
|
|
4836
|
-
disableStackTrace =
|
|
4836
|
+
abortEarly = schema14.spec.abortEarly,
|
|
4837
|
+
disableStackTrace = schema14.spec.disableStackTrace
|
|
4837
4838
|
} = options;
|
|
4838
4839
|
const resolveOptions = {
|
|
4839
4840
|
value,
|
|
@@ -4844,9 +4845,9 @@ function createValidation(config) {
|
|
|
4844
4845
|
const nextParams = resolveParams(Object.assign({
|
|
4845
4846
|
value,
|
|
4846
4847
|
originalValue,
|
|
4847
|
-
label:
|
|
4848
|
+
label: schema14.spec.label,
|
|
4848
4849
|
path: overrides.path || path,
|
|
4849
|
-
spec:
|
|
4850
|
+
spec: schema14.spec,
|
|
4850
4851
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4851
4852
|
}, params, overrides.params), resolveOptions);
|
|
4852
4853
|
const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
|
|
@@ -4865,7 +4866,7 @@ function createValidation(config) {
|
|
|
4865
4866
|
},
|
|
4866
4867
|
options,
|
|
4867
4868
|
originalValue,
|
|
4868
|
-
schema:
|
|
4869
|
+
schema: schema14
|
|
4869
4870
|
};
|
|
4870
4871
|
const handleResult = (validOrError) => {
|
|
4871
4872
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4909,42 +4910,42 @@ function resolveParams(params, options) {
|
|
|
4909
4910
|
function resolveMaybeRef(item, options) {
|
|
4910
4911
|
return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
|
|
4911
4912
|
}
|
|
4912
|
-
function getIn(
|
|
4913
|
+
function getIn(schema14, path, value, context = value) {
|
|
4913
4914
|
let parent, lastPart, lastPartDebug;
|
|
4914
4915
|
if (!path) return {
|
|
4915
4916
|
parent,
|
|
4916
4917
|
parentPath: path,
|
|
4917
|
-
schema:
|
|
4918
|
+
schema: schema14
|
|
4918
4919
|
};
|
|
4919
4920
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4920
4921
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4921
|
-
|
|
4922
|
+
schema14 = schema14.resolve({
|
|
4922
4923
|
context,
|
|
4923
4924
|
parent,
|
|
4924
4925
|
value
|
|
4925
4926
|
});
|
|
4926
|
-
let isTuple =
|
|
4927
|
+
let isTuple = schema14.type === "tuple";
|
|
4927
4928
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4928
|
-
if (
|
|
4929
|
+
if (schema14.innerType || isTuple) {
|
|
4929
4930
|
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]"`);
|
|
4930
4931
|
if (value && idx >= value.length) {
|
|
4931
4932
|
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. `);
|
|
4932
4933
|
}
|
|
4933
4934
|
parent = value;
|
|
4934
4935
|
value = value && value[idx];
|
|
4935
|
-
|
|
4936
|
+
schema14 = isTuple ? schema14.spec.types[idx] : schema14.innerType;
|
|
4936
4937
|
}
|
|
4937
4938
|
if (!isArray) {
|
|
4938
|
-
if (!
|
|
4939
|
+
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}")`);
|
|
4939
4940
|
parent = value;
|
|
4940
4941
|
value = value && value[part];
|
|
4941
|
-
|
|
4942
|
+
schema14 = schema14.fields[part];
|
|
4942
4943
|
}
|
|
4943
4944
|
lastPart = part;
|
|
4944
4945
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4945
4946
|
});
|
|
4946
4947
|
return {
|
|
4947
|
-
schema:
|
|
4948
|
+
schema: schema14,
|
|
4948
4949
|
parent,
|
|
4949
4950
|
parentPath: lastPart
|
|
4950
4951
|
};
|
|
@@ -5144,20 +5145,20 @@ var Schema = class {
|
|
|
5144
5145
|
this._mutate = before;
|
|
5145
5146
|
return result;
|
|
5146
5147
|
}
|
|
5147
|
-
concat(
|
|
5148
|
-
if (!
|
|
5149
|
-
if (
|
|
5148
|
+
concat(schema14) {
|
|
5149
|
+
if (!schema14 || schema14 === this) return this;
|
|
5150
|
+
if (schema14.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema14.type}`);
|
|
5150
5151
|
let base = this;
|
|
5151
|
-
let combined =
|
|
5152
|
+
let combined = schema14.clone();
|
|
5152
5153
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5153
5154
|
combined.spec = mergedSpec;
|
|
5154
5155
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5155
|
-
combined._whitelist = base._whitelist.merge(
|
|
5156
|
-
combined._blacklist = base._blacklist.merge(
|
|
5156
|
+
combined._whitelist = base._whitelist.merge(schema14._whitelist, schema14._blacklist);
|
|
5157
|
+
combined._blacklist = base._blacklist.merge(schema14._blacklist, schema14._whitelist);
|
|
5157
5158
|
combined.tests = base.tests;
|
|
5158
5159
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5159
5160
|
combined.withMutation((next) => {
|
|
5160
|
-
|
|
5161
|
+
schema14.tests.forEach((fn) => {
|
|
5161
5162
|
next.test(fn.OPTIONS);
|
|
5162
5163
|
});
|
|
5163
5164
|
});
|
|
@@ -5173,15 +5174,15 @@ var Schema = class {
|
|
|
5173
5174
|
return this._typeCheck(v);
|
|
5174
5175
|
}
|
|
5175
5176
|
resolve(options) {
|
|
5176
|
-
let
|
|
5177
|
-
if (
|
|
5178
|
-
let conditions =
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5177
|
+
let schema14 = this;
|
|
5178
|
+
if (schema14.conditions.length) {
|
|
5179
|
+
let conditions = schema14.conditions;
|
|
5180
|
+
schema14 = schema14.clone();
|
|
5181
|
+
schema14.conditions = [];
|
|
5182
|
+
schema14 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema14);
|
|
5183
|
+
schema14 = schema14.resolve(options);
|
|
5183
5184
|
}
|
|
5184
|
-
return
|
|
5185
|
+
return schema14;
|
|
5185
5186
|
}
|
|
5186
5187
|
resolveOptions(options) {
|
|
5187
5188
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5337,11 +5338,11 @@ attempted value: ${formattedValue}
|
|
|
5337
5338
|
}
|
|
5338
5339
|
validate(value, options) {
|
|
5339
5340
|
var _options$disableStack2;
|
|
5340
|
-
let
|
|
5341
|
+
let schema14 = this.resolve(Object.assign({}, options, {
|
|
5341
5342
|
value
|
|
5342
5343
|
}));
|
|
5343
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5344
|
-
return new Promise((resolve, reject) =>
|
|
5344
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema14.spec.disableStackTrace;
|
|
5345
|
+
return new Promise((resolve, reject) => schema14._validate(value, options, (error, parsed) => {
|
|
5345
5346
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5346
5347
|
reject(error);
|
|
5347
5348
|
}, (errors, validated) => {
|
|
@@ -5351,12 +5352,12 @@ attempted value: ${formattedValue}
|
|
|
5351
5352
|
}
|
|
5352
5353
|
validateSync(value, options) {
|
|
5353
5354
|
var _options$disableStack3;
|
|
5354
|
-
let
|
|
5355
|
+
let schema14 = this.resolve(Object.assign({}, options, {
|
|
5355
5356
|
value
|
|
5356
5357
|
}));
|
|
5357
5358
|
let result;
|
|
5358
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5359
|
-
|
|
5359
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema14.spec.disableStackTrace;
|
|
5360
|
+
schema14._validate(value, Object.assign({}, options, {
|
|
5360
5361
|
sync: true
|
|
5361
5362
|
}), (error, parsed) => {
|
|
5362
5363
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5390,8 +5391,8 @@ attempted value: ${formattedValue}
|
|
|
5390
5391
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5391
5392
|
}
|
|
5392
5393
|
getDefault(options) {
|
|
5393
|
-
let
|
|
5394
|
-
return
|
|
5394
|
+
let schema14 = this.resolve(options || {});
|
|
5395
|
+
return schema14._getDefault(options);
|
|
5395
5396
|
}
|
|
5396
5397
|
default(def) {
|
|
5397
5398
|
if (arguments.length === 0) {
|
|
@@ -5624,13 +5625,13 @@ attempted value: ${formattedValue}
|
|
|
5624
5625
|
return description;
|
|
5625
5626
|
}
|
|
5626
5627
|
get ["~standard"]() {
|
|
5627
|
-
const
|
|
5628
|
+
const schema14 = this;
|
|
5628
5629
|
const standard = {
|
|
5629
5630
|
version: 1,
|
|
5630
5631
|
vendor: "yup",
|
|
5631
5632
|
async validate(value) {
|
|
5632
5633
|
try {
|
|
5633
|
-
const result = await
|
|
5634
|
+
const result = await schema14.validate(value, {
|
|
5634
5635
|
abortEarly: false
|
|
5635
5636
|
});
|
|
5636
5637
|
return {
|
|
@@ -5654,9 +5655,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5654
5655
|
const {
|
|
5655
5656
|
parent,
|
|
5656
5657
|
parentPath,
|
|
5657
|
-
schema:
|
|
5658
|
+
schema: schema14
|
|
5658
5659
|
} = getIn(this, path, value, options.context);
|
|
5659
|
-
return
|
|
5660
|
+
return schema14[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5660
5661
|
parent,
|
|
5661
5662
|
path
|
|
5662
5663
|
}));
|
|
@@ -5830,7 +5831,7 @@ var StringSchema = class extends Schema {
|
|
|
5830
5831
|
});
|
|
5831
5832
|
}
|
|
5832
5833
|
required(message) {
|
|
5833
|
-
return super.required(message).withMutation((
|
|
5834
|
+
return super.required(message).withMutation((schema14) => schema14.test({
|
|
5834
5835
|
message: message || mixed.required,
|
|
5835
5836
|
name: "required",
|
|
5836
5837
|
skipAbsent: true,
|
|
@@ -5838,9 +5839,9 @@ var StringSchema = class extends Schema {
|
|
|
5838
5839
|
}));
|
|
5839
5840
|
}
|
|
5840
5841
|
notRequired() {
|
|
5841
|
-
return super.notRequired().withMutation((
|
|
5842
|
-
|
|
5843
|
-
return
|
|
5842
|
+
return super.notRequired().withMutation((schema14) => {
|
|
5843
|
+
schema14.tests = schema14.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5844
|
+
return schema14;
|
|
5844
5845
|
});
|
|
5845
5846
|
}
|
|
5846
5847
|
length(length, message = string.length) {
|
|
@@ -6218,7 +6219,7 @@ function sortByKeyOrder(keys) {
|
|
|
6218
6219
|
return findIndex(keys, a) - findIndex(keys, b);
|
|
6219
6220
|
};
|
|
6220
6221
|
}
|
|
6221
|
-
var parseJson = (value, _,
|
|
6222
|
+
var parseJson = (value, _, schema14) => {
|
|
6222
6223
|
if (typeof value !== "string") {
|
|
6223
6224
|
return value;
|
|
6224
6225
|
}
|
|
@@ -6227,30 +6228,30 @@ var parseJson = (value, _, schema13) => {
|
|
|
6227
6228
|
parsed = JSON.parse(value);
|
|
6228
6229
|
} catch (err) {
|
|
6229
6230
|
}
|
|
6230
|
-
return
|
|
6231
|
+
return schema14.isType(parsed) ? parsed : value;
|
|
6231
6232
|
};
|
|
6232
|
-
function deepPartial(
|
|
6233
|
-
if ("fields" in
|
|
6233
|
+
function deepPartial(schema14) {
|
|
6234
|
+
if ("fields" in schema14) {
|
|
6234
6235
|
const partial = {};
|
|
6235
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6236
|
+
for (const [key, fieldSchema] of Object.entries(schema14.fields)) {
|
|
6236
6237
|
partial[key] = deepPartial(fieldSchema);
|
|
6237
6238
|
}
|
|
6238
|
-
return
|
|
6239
|
+
return schema14.setFields(partial);
|
|
6239
6240
|
}
|
|
6240
|
-
if (
|
|
6241
|
-
const nextArray =
|
|
6241
|
+
if (schema14.type === "array") {
|
|
6242
|
+
const nextArray = schema14.optional();
|
|
6242
6243
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6243
6244
|
return nextArray;
|
|
6244
6245
|
}
|
|
6245
|
-
if (
|
|
6246
|
-
return
|
|
6247
|
-
types:
|
|
6246
|
+
if (schema14.type === "tuple") {
|
|
6247
|
+
return schema14.optional().clone({
|
|
6248
|
+
types: schema14.spec.types.map(deepPartial)
|
|
6248
6249
|
});
|
|
6249
6250
|
}
|
|
6250
|
-
if ("optional" in
|
|
6251
|
-
return
|
|
6251
|
+
if ("optional" in schema14) {
|
|
6252
|
+
return schema14.optional();
|
|
6252
6253
|
}
|
|
6253
|
-
return
|
|
6254
|
+
return schema14;
|
|
6254
6255
|
}
|
|
6255
6256
|
var deepHas = (obj, p) => {
|
|
6256
6257
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6381,8 +6382,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6381
6382
|
next._sortErrors = this._sortErrors;
|
|
6382
6383
|
return next;
|
|
6383
6384
|
}
|
|
6384
|
-
concat(
|
|
6385
|
-
let next = super.concat(
|
|
6385
|
+
concat(schema14) {
|
|
6386
|
+
let next = super.concat(schema14);
|
|
6386
6387
|
let nextFields = next.fields;
|
|
6387
6388
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6388
6389
|
const target = nextFields[field];
|
|
@@ -6390,7 +6391,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6390
6391
|
}
|
|
6391
6392
|
return next.withMutation((s2) => (
|
|
6392
6393
|
// XXX: excludes here is wrong
|
|
6393
|
-
s2.setFields(nextFields, [...this._excludedEdges, ...
|
|
6394
|
+
s2.setFields(nextFields, [...this._excludedEdges, ...schema14._excludedEdges])
|
|
6394
6395
|
));
|
|
6395
6396
|
}
|
|
6396
6397
|
_getDefault(options) {
|
|
@@ -6435,8 +6436,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6435
6436
|
}
|
|
6436
6437
|
partial() {
|
|
6437
6438
|
const partial = {};
|
|
6438
|
-
for (const [key,
|
|
6439
|
-
partial[key] = "optional" in
|
|
6439
|
+
for (const [key, schema14] of Object.entries(this.fields)) {
|
|
6440
|
+
partial[key] = "optional" in schema14 && schema14.optional instanceof Function ? schema14.optional() : schema14;
|
|
6440
6441
|
}
|
|
6441
6442
|
return this.setFields(partial);
|
|
6442
6443
|
}
|
|
@@ -6638,22 +6639,22 @@ var ArraySchema = class extends Schema {
|
|
|
6638
6639
|
json() {
|
|
6639
6640
|
return this.transform(parseJson);
|
|
6640
6641
|
}
|
|
6641
|
-
concat(
|
|
6642
|
-
let next = super.concat(
|
|
6642
|
+
concat(schema14) {
|
|
6643
|
+
let next = super.concat(schema14);
|
|
6643
6644
|
next.innerType = this.innerType;
|
|
6644
|
-
if (
|
|
6645
|
+
if (schema14.innerType)
|
|
6645
6646
|
next.innerType = next.innerType ? (
|
|
6646
6647
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6647
|
-
next.innerType.concat(
|
|
6648
|
-
) :
|
|
6648
|
+
next.innerType.concat(schema14.innerType)
|
|
6649
|
+
) : schema14.innerType;
|
|
6649
6650
|
return next;
|
|
6650
6651
|
}
|
|
6651
|
-
of(
|
|
6652
|
+
of(schema14) {
|
|
6652
6653
|
let next = this.clone();
|
|
6653
|
-
if (!isSchema(
|
|
6654
|
-
next.innerType =
|
|
6654
|
+
if (!isSchema(schema14)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema14));
|
|
6655
|
+
next.innerType = schema14;
|
|
6655
6656
|
next.spec = Object.assign({}, next.spec, {
|
|
6656
|
-
types:
|
|
6657
|
+
types: schema14
|
|
6657
6658
|
});
|
|
6658
6659
|
return next;
|
|
6659
6660
|
}
|
|
@@ -6801,7 +6802,7 @@ var TupleSchema = class extends Schema {
|
|
|
6801
6802
|
describe(options) {
|
|
6802
6803
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6803
6804
|
const base = super.describe(options);
|
|
6804
|
-
base.innerType = next.spec.types.map((
|
|
6805
|
+
base.innerType = next.spec.types.map((schema14, index) => {
|
|
6805
6806
|
var _innerOptions;
|
|
6806
6807
|
let innerOptions = options;
|
|
6807
6808
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6810,7 +6811,7 @@ var TupleSchema = class extends Schema {
|
|
|
6810
6811
|
value: innerOptions.value[index]
|
|
6811
6812
|
});
|
|
6812
6813
|
}
|
|
6813
|
-
return
|
|
6814
|
+
return schema14.describe(innerOptions);
|
|
6814
6815
|
});
|
|
6815
6816
|
return base;
|
|
6816
6817
|
}
|
|
@@ -10040,6 +10041,13 @@ var UPDATE_APP_SETTINGS_MUTATION = gql`
|
|
|
10040
10041
|
updateAppSettings(input: $input)
|
|
10041
10042
|
}
|
|
10042
10043
|
`;
|
|
10044
|
+
var CRAWL_GOOGLE_MARKETS_MUTATION = gql`
|
|
10045
|
+
mutation crawlGoogleMarkets {
|
|
10046
|
+
crawlGoogleMarkets {
|
|
10047
|
+
message
|
|
10048
|
+
}
|
|
10049
|
+
}
|
|
10050
|
+
`;
|
|
10043
10051
|
var APP_SETTINGS_FIELDS_FRAGMENT = gql`
|
|
10044
10052
|
fragment AppSettingsFields on AppSettingsType {
|
|
10045
10053
|
_id
|
|
@@ -10216,7 +10224,7 @@ var socialMediaSchema = create$3({
|
|
|
10216
10224
|
is: (name) => !!name,
|
|
10217
10225
|
// If name has a value
|
|
10218
10226
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10219
|
-
otherwise: (
|
|
10227
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10220
10228
|
})
|
|
10221
10229
|
});
|
|
10222
10230
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10289,21 +10297,21 @@ var paymentInfoSchema = create$3({
|
|
|
10289
10297
|
paymentMethod: create$8().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
10290
10298
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10291
10299
|
is: "bank_transfer",
|
|
10292
|
-
then: (
|
|
10293
|
-
otherwise: (
|
|
10300
|
+
then: (schema14) => schema14.required("Account holder name is required for bank transfer").trim(),
|
|
10301
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10294
10302
|
}),
|
|
10295
10303
|
accountNumber: create$6().when("paymentMethod", {
|
|
10296
10304
|
is: "bank_transfer",
|
|
10297
|
-
then: (
|
|
10305
|
+
then: (schema14) => schema14.required("Account number is required for bank transfer").matches(
|
|
10298
10306
|
nzBankAccountRegex,
|
|
10299
10307
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10300
10308
|
).trim(),
|
|
10301
|
-
otherwise: (
|
|
10309
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10302
10310
|
}),
|
|
10303
10311
|
link: create$6().when("paymentMethod", {
|
|
10304
10312
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10305
10313
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10306
|
-
otherwise: (
|
|
10314
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10307
10315
|
})
|
|
10308
10316
|
});
|
|
10309
10317
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10416,8 +10424,8 @@ var userSchema = create$3().shape({
|
|
|
10416
10424
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10417
10425
|
is: (val) => !!val,
|
|
10418
10426
|
// only necessary if password typed
|
|
10419
|
-
then: (
|
|
10420
|
-
otherwise: (
|
|
10427
|
+
then: (schema14) => schema14.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10428
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10421
10429
|
}),
|
|
10422
10430
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10423
10431
|
});
|
|
@@ -10535,8 +10543,8 @@ var testerSchema = create$3().shape({
|
|
|
10535
10543
|
email: emailRequiredSchema,
|
|
10536
10544
|
event: create$3().when("resourceType", {
|
|
10537
10545
|
is: (resourceType) => resourceType === "event",
|
|
10538
|
-
otherwise: (
|
|
10539
|
-
then: (
|
|
10546
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10547
|
+
then: (schema14) => schema14.required("Event information is required").shape(testerEventSchema.fields)
|
|
10540
10548
|
}),
|
|
10541
10549
|
firstName: create$6().required("First name is required"),
|
|
10542
10550
|
lastName: create$6().required("Last name is required"),
|
|
@@ -10554,8 +10562,8 @@ var testerSchema = create$3().shape({
|
|
|
10554
10562
|
).required("Resource Type is required"),
|
|
10555
10563
|
vendor: create$3().when("resourceType", {
|
|
10556
10564
|
is: (resourceType) => resourceType === "vendor",
|
|
10557
|
-
otherwise: (
|
|
10558
|
-
then: (
|
|
10565
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10566
|
+
then: (schema14) => schema14.required("Vendor information is required").shape(testerVendorSchema.fields)
|
|
10559
10567
|
})
|
|
10560
10568
|
});
|
|
10561
10569
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
@@ -10593,7 +10601,7 @@ var adSchema = create$3().shape({
|
|
|
10593
10601
|
return endDate > now;
|
|
10594
10602
|
}).when("start", {
|
|
10595
10603
|
is: (val) => val && val.length > 0,
|
|
10596
|
-
then: (
|
|
10604
|
+
then: (schema14) => schema14.test(
|
|
10597
10605
|
"is-after-start",
|
|
10598
10606
|
"End date must be after start date",
|
|
10599
10607
|
function(value) {
|
|
@@ -11208,10 +11216,59 @@ ChatSchema.index({
|
|
|
11208
11216
|
});
|
|
11209
11217
|
var ChatModel = import_mongoose5.default.models.Chat || import_mongoose5.default.model("Chat", ChatSchema);
|
|
11210
11218
|
|
|
11211
|
-
// src/mongoose/
|
|
11219
|
+
// src/mongoose/GoogleImportedMarket.ts
|
|
11212
11220
|
var import_mongoose6 = __toESM(require("mongoose"));
|
|
11213
11221
|
var MongooseSchema6 = import_mongoose6.default.Schema;
|
|
11222
|
+
var locationSchema2 = new MongooseSchema6(
|
|
11223
|
+
{
|
|
11224
|
+
lat: { required: true, type: Number },
|
|
11225
|
+
lng: { required: true, type: Number }
|
|
11226
|
+
},
|
|
11227
|
+
{ _id: false }
|
|
11228
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11229
|
+
);
|
|
11214
11230
|
var schema3 = new MongooseSchema6(
|
|
11231
|
+
{
|
|
11232
|
+
address: { required: true, type: String },
|
|
11233
|
+
businessStatus: { required: false, type: String },
|
|
11234
|
+
claimed: { default: false, required: true, type: Boolean },
|
|
11235
|
+
googleMapsUrl: { required: false, type: String },
|
|
11236
|
+
googlePlaceId: {
|
|
11237
|
+
required: true,
|
|
11238
|
+
type: String,
|
|
11239
|
+
unique: true
|
|
11240
|
+
// unique, indexed
|
|
11241
|
+
},
|
|
11242
|
+
image: { required: false, type: String },
|
|
11243
|
+
// photo_reference only
|
|
11244
|
+
importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
|
|
11245
|
+
location: {
|
|
11246
|
+
required: false,
|
|
11247
|
+
// optional because lat/lng may expire after 30 days
|
|
11248
|
+
type: locationSchema2
|
|
11249
|
+
},
|
|
11250
|
+
name: { required: true, type: String },
|
|
11251
|
+
openingHours: { required: false, type: [String] },
|
|
11252
|
+
phone: { required: false, type: String },
|
|
11253
|
+
photos: { required: false, type: [String] },
|
|
11254
|
+
// array of photo_reference
|
|
11255
|
+
rating: { required: false, type: Number },
|
|
11256
|
+
reviewCount: { required: false, type: Number },
|
|
11257
|
+
slug: { required: true, type: String },
|
|
11258
|
+
website: { required: false, type: String }
|
|
11259
|
+
},
|
|
11260
|
+
{ timestamps: true }
|
|
11261
|
+
);
|
|
11262
|
+
schema3.index({ name: 1 });
|
|
11263
|
+
schema3.index({ slug: 1 });
|
|
11264
|
+
schema3.index({ address: 1 });
|
|
11265
|
+
schema3.index({ "location.lat": 1, "location.lng": 1 });
|
|
11266
|
+
var GoogleImportedMarketModel = import_mongoose6.default.models.GoogleImportedMarket || import_mongoose6.default.model("GoogleImportedMarket", schema3);
|
|
11267
|
+
|
|
11268
|
+
// src/mongoose/Notification.ts
|
|
11269
|
+
var import_mongoose7 = __toESM(require("mongoose"));
|
|
11270
|
+
var MongooseSchema7 = import_mongoose7.default.Schema;
|
|
11271
|
+
var schema4 = new MongooseSchema7(
|
|
11215
11272
|
{
|
|
11216
11273
|
data: {
|
|
11217
11274
|
resourceId: { required: true, type: String },
|
|
@@ -11234,14 +11291,14 @@ var schema3 = new MongooseSchema6(
|
|
|
11234
11291
|
userId: {
|
|
11235
11292
|
ref: "User",
|
|
11236
11293
|
required: true,
|
|
11237
|
-
type:
|
|
11294
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
11238
11295
|
}
|
|
11239
11296
|
},
|
|
11240
11297
|
{ timestamps: true }
|
|
11241
11298
|
);
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
var NotificationModel =
|
|
11299
|
+
schema4.index({ isRead: 1, userId: 1 });
|
|
11300
|
+
schema4.index({ createdAt: -1, userId: 1 });
|
|
11301
|
+
var NotificationModel = import_mongoose7.default.models.Notification || import_mongoose7.default.model("Notification", schema4);
|
|
11245
11302
|
|
|
11246
11303
|
// node_modules/@timardex/cluemart-shared/dist/chunk-OBQRGWV3.mjs
|
|
11247
11304
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
@@ -11252,9 +11309,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
11252
11309
|
})(EnumOSPlatform2 || {});
|
|
11253
11310
|
|
|
11254
11311
|
// src/mongoose/PushToken.ts
|
|
11255
|
-
var
|
|
11256
|
-
var
|
|
11257
|
-
var
|
|
11312
|
+
var import_mongoose8 = __toESM(require("mongoose"));
|
|
11313
|
+
var MongooseSchema8 = import_mongoose8.default.Schema;
|
|
11314
|
+
var schema5 = new MongooseSchema8(
|
|
11258
11315
|
{
|
|
11259
11316
|
platform: {
|
|
11260
11317
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -11262,16 +11319,16 @@ var schema4 = new MongooseSchema7(
|
|
|
11262
11319
|
type: String
|
|
11263
11320
|
},
|
|
11264
11321
|
token: { required: true, type: String },
|
|
11265
|
-
userId: { required: true, type:
|
|
11322
|
+
userId: { required: true, type: import_mongoose8.default.Schema.Types.ObjectId }
|
|
11266
11323
|
},
|
|
11267
11324
|
{ timestamps: true }
|
|
11268
11325
|
);
|
|
11269
|
-
var PushTokenModel =
|
|
11326
|
+
var PushTokenModel = import_mongoose8.default.models.PushToken || import_mongoose8.default.model("PushToken", schema5);
|
|
11270
11327
|
|
|
11271
11328
|
// src/mongoose/ResourceActivity.ts
|
|
11272
|
-
var
|
|
11273
|
-
var
|
|
11274
|
-
var ActivitySchema = new
|
|
11329
|
+
var import_mongoose9 = __toESM(require("mongoose"));
|
|
11330
|
+
var MongooseSchema9 = import_mongoose9.default.Schema;
|
|
11331
|
+
var ActivitySchema = new MongooseSchema9(
|
|
11275
11332
|
{
|
|
11276
11333
|
activityType: {
|
|
11277
11334
|
enum: Object.values(EnumActivity),
|
|
@@ -11307,7 +11364,7 @@ var ActivitySchema = new MongooseSchema8(
|
|
|
11307
11364
|
},
|
|
11308
11365
|
{ _id: false }
|
|
11309
11366
|
);
|
|
11310
|
-
var
|
|
11367
|
+
var schema6 = new MongooseSchema9(
|
|
11311
11368
|
{
|
|
11312
11369
|
activity: { default: [], type: [ActivitySchema] },
|
|
11313
11370
|
resourceId: { required: true, type: String },
|
|
@@ -11319,14 +11376,14 @@ var schema5 = new MongooseSchema8(
|
|
|
11319
11376
|
},
|
|
11320
11377
|
{ timestamps: true }
|
|
11321
11378
|
);
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
var ResourceActivityModel =
|
|
11379
|
+
schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
11380
|
+
schema6.index({ "views.location": "2dsphere" });
|
|
11381
|
+
var ResourceActivityModel = import_mongoose9.default.models.ResourceActivity || import_mongoose9.default.model("ResourceActivity", schema6);
|
|
11325
11382
|
|
|
11326
11383
|
// src/mongoose/Tester.ts
|
|
11327
|
-
var
|
|
11328
|
-
var
|
|
11329
|
-
var TesterVendorQuestionarySchema = new
|
|
11384
|
+
var import_mongoose10 = __toESM(require("mongoose"));
|
|
11385
|
+
var MongooseSchema10 = import_mongoose10.default.Schema;
|
|
11386
|
+
var TesterVendorQuestionarySchema = new MongooseSchema10(
|
|
11330
11387
|
{
|
|
11331
11388
|
appearInVideoIntroduction: {
|
|
11332
11389
|
default: false,
|
|
@@ -11353,7 +11410,7 @@ var TesterVendorQuestionarySchema = new MongooseSchema9(
|
|
|
11353
11410
|
},
|
|
11354
11411
|
{ _id: false }
|
|
11355
11412
|
);
|
|
11356
|
-
var TesterVendorSchema = new
|
|
11413
|
+
var TesterVendorSchema = new MongooseSchema10(
|
|
11357
11414
|
{
|
|
11358
11415
|
categories: { required: true, type: [CategorySchema] },
|
|
11359
11416
|
marketsAttended: {
|
|
@@ -11379,7 +11436,7 @@ var TesterVendorSchema = new MongooseSchema9(
|
|
|
11379
11436
|
},
|
|
11380
11437
|
{ _id: false }
|
|
11381
11438
|
);
|
|
11382
|
-
var TesterEventQuestionarySchema = new
|
|
11439
|
+
var TesterEventQuestionarySchema = new MongooseSchema10(
|
|
11383
11440
|
{
|
|
11384
11441
|
allowMarketingAppearance: {
|
|
11385
11442
|
default: false,
|
|
@@ -11414,7 +11471,7 @@ var TesterEventQuestionarySchema = new MongooseSchema9(
|
|
|
11414
11471
|
},
|
|
11415
11472
|
{ _id: false }
|
|
11416
11473
|
);
|
|
11417
|
-
var TesterEventsSchema = new
|
|
11474
|
+
var TesterEventsSchema = new MongooseSchema10(
|
|
11418
11475
|
{
|
|
11419
11476
|
markets: {
|
|
11420
11477
|
required: true,
|
|
@@ -11443,7 +11500,7 @@ var TesterEventsSchema = new MongooseSchema9(
|
|
|
11443
11500
|
},
|
|
11444
11501
|
{ _id: false }
|
|
11445
11502
|
);
|
|
11446
|
-
var TesterSchema = new
|
|
11503
|
+
var TesterSchema = new MongooseSchema10(
|
|
11447
11504
|
{
|
|
11448
11505
|
active: { default: false, required: true, type: Boolean },
|
|
11449
11506
|
approved: { default: false, required: true, type: Boolean },
|
|
@@ -11477,43 +11534,43 @@ var TesterSchema = new MongooseSchema9(
|
|
|
11477
11534
|
timestamps: true
|
|
11478
11535
|
}
|
|
11479
11536
|
);
|
|
11480
|
-
var TesterModel =
|
|
11537
|
+
var TesterModel = import_mongoose10.default.models.Tester || import_mongoose10.default.model("Tester", TesterSchema);
|
|
11481
11538
|
|
|
11482
11539
|
// src/mongoose/User.ts
|
|
11483
|
-
var
|
|
11484
|
-
var
|
|
11485
|
-
var userActivityEventSchema = new
|
|
11540
|
+
var import_mongoose11 = __toESM(require("mongoose"));
|
|
11541
|
+
var MongooseSchema11 = import_mongoose11.default.Schema;
|
|
11542
|
+
var userActivityEventSchema = new MongooseSchema11(
|
|
11486
11543
|
{
|
|
11487
11544
|
dateTime: dateTimeSchema3,
|
|
11488
11545
|
resourceId: {
|
|
11489
11546
|
ref: "Event",
|
|
11490
11547
|
required: false,
|
|
11491
|
-
type:
|
|
11548
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11492
11549
|
}
|
|
11493
11550
|
},
|
|
11494
11551
|
{ _id: false }
|
|
11495
11552
|
);
|
|
11496
|
-
var userActivityFavouritesSchema = new
|
|
11553
|
+
var userActivityFavouritesSchema = new MongooseSchema11(
|
|
11497
11554
|
{
|
|
11498
11555
|
events: {
|
|
11499
11556
|
ref: "Event",
|
|
11500
11557
|
required: false,
|
|
11501
|
-
type: [
|
|
11558
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11502
11559
|
},
|
|
11503
11560
|
partners: {
|
|
11504
11561
|
ref: "Partner",
|
|
11505
11562
|
required: false,
|
|
11506
|
-
type: [
|
|
11563
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11507
11564
|
},
|
|
11508
11565
|
vendors: {
|
|
11509
11566
|
ref: "Vendor",
|
|
11510
11567
|
required: false,
|
|
11511
|
-
type: [
|
|
11568
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11512
11569
|
}
|
|
11513
11570
|
},
|
|
11514
11571
|
{ _id: false }
|
|
11515
11572
|
);
|
|
11516
|
-
var stripeSchema = new
|
|
11573
|
+
var stripeSchema = new MongooseSchema11(
|
|
11517
11574
|
{
|
|
11518
11575
|
currentPlan: {
|
|
11519
11576
|
enum: Object.values(EnumUserLicence),
|
|
@@ -11544,7 +11601,7 @@ var stripeSchema = new MongooseSchema10(
|
|
|
11544
11601
|
},
|
|
11545
11602
|
{ _id: false }
|
|
11546
11603
|
);
|
|
11547
|
-
var
|
|
11604
|
+
var schema7 = new MongooseSchema11(
|
|
11548
11605
|
{
|
|
11549
11606
|
active: { default: false, required: true, type: Boolean },
|
|
11550
11607
|
associates: {
|
|
@@ -11560,7 +11617,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11560
11617
|
events: {
|
|
11561
11618
|
ref: "Event",
|
|
11562
11619
|
required: false,
|
|
11563
|
-
type: [
|
|
11620
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11564
11621
|
},
|
|
11565
11622
|
firstName: { required: true, type: String },
|
|
11566
11623
|
isTester: { default: false, required: true, type: Boolean },
|
|
@@ -11572,7 +11629,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11572
11629
|
partner: {
|
|
11573
11630
|
ref: "Partner",
|
|
11574
11631
|
required: false,
|
|
11575
|
-
type:
|
|
11632
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11576
11633
|
},
|
|
11577
11634
|
password: { required: true, type: String },
|
|
11578
11635
|
platform: {
|
|
@@ -11617,20 +11674,20 @@ var schema6 = new MongooseSchema10(
|
|
|
11617
11674
|
vendor: {
|
|
11618
11675
|
ref: "Vendor",
|
|
11619
11676
|
required: false,
|
|
11620
|
-
type:
|
|
11677
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11621
11678
|
}
|
|
11622
11679
|
},
|
|
11623
11680
|
{ strict: false, timestamps: true }
|
|
11624
11681
|
);
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
var UserModel =
|
|
11682
|
+
schema7.index({ "associates.email": 1 });
|
|
11683
|
+
schema7.index({ "licences.expiryDate": 1 });
|
|
11684
|
+
schema7.index({ "licences.licenceType": 1 });
|
|
11685
|
+
var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema7);
|
|
11629
11686
|
|
|
11630
11687
|
// src/mongoose/VerificationToken.ts
|
|
11631
|
-
var
|
|
11632
|
-
var
|
|
11633
|
-
var
|
|
11688
|
+
var import_mongoose12 = __toESM(require("mongoose"));
|
|
11689
|
+
var MongooseSchema12 = import_mongoose12.default.Schema;
|
|
11690
|
+
var schema8 = new MongooseSchema12(
|
|
11634
11691
|
{
|
|
11635
11692
|
createdAt: {
|
|
11636
11693
|
default: Date.now,
|
|
@@ -11645,12 +11702,12 @@ var schema7 = new MongooseSchema11(
|
|
|
11645
11702
|
},
|
|
11646
11703
|
{ timestamps: true }
|
|
11647
11704
|
);
|
|
11648
|
-
var VerificationTokenModel =
|
|
11705
|
+
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
11649
11706
|
|
|
11650
11707
|
// src/mongoose/vendor/Vendor.ts
|
|
11651
|
-
var
|
|
11652
|
-
var
|
|
11653
|
-
var MenuTypeSchema = new
|
|
11708
|
+
var import_mongoose13 = __toESM(require("mongoose"));
|
|
11709
|
+
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
11710
|
+
var MenuTypeSchema = new MongooseSchema13(
|
|
11654
11711
|
{
|
|
11655
11712
|
description: { required: false, type: String },
|
|
11656
11713
|
name: { required: false, type: String },
|
|
@@ -11660,7 +11717,7 @@ var MenuTypeSchema = new MongooseSchema12(
|
|
|
11660
11717
|
{ _id: false }
|
|
11661
11718
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11662
11719
|
);
|
|
11663
|
-
var LocationsSchema = new
|
|
11720
|
+
var LocationsSchema = new MongooseSchema13(
|
|
11664
11721
|
{
|
|
11665
11722
|
dateTime: {
|
|
11666
11723
|
dateStatus: {
|
|
@@ -11693,7 +11750,7 @@ var LocationsSchema = new MongooseSchema12(
|
|
|
11693
11750
|
{ _id: false }
|
|
11694
11751
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11695
11752
|
);
|
|
11696
|
-
var
|
|
11753
|
+
var schema9 = new MongooseSchema13(
|
|
11697
11754
|
{
|
|
11698
11755
|
...baseResourceFields,
|
|
11699
11756
|
// Importing base resource fields from global.ts
|
|
@@ -11715,7 +11772,7 @@ var schema8 = new MongooseSchema12(
|
|
|
11715
11772
|
vendorInfoId: {
|
|
11716
11773
|
ref: "VendorInfo",
|
|
11717
11774
|
required: false,
|
|
11718
|
-
type:
|
|
11775
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
11719
11776
|
},
|
|
11720
11777
|
vendorType: {
|
|
11721
11778
|
enum: Object.values(EnumVendorType),
|
|
@@ -11725,24 +11782,24 @@ var schema8 = new MongooseSchema12(
|
|
|
11725
11782
|
},
|
|
11726
11783
|
{ timestamps: true }
|
|
11727
11784
|
);
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
var VendorModel =
|
|
11785
|
+
schema9.index({ name: 1 });
|
|
11786
|
+
schema9.index({ description: 1 });
|
|
11787
|
+
schema9.index({ region: 1 });
|
|
11788
|
+
schema9.index({ "categories.name": 1 });
|
|
11789
|
+
schema9.index({ "associates.email": 1 });
|
|
11790
|
+
var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema9);
|
|
11734
11791
|
|
|
11735
11792
|
// src/mongoose/vendor/VendorInfo.ts
|
|
11736
|
-
var
|
|
11737
|
-
var
|
|
11738
|
-
var AttributesSchema = new
|
|
11793
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
11794
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
11795
|
+
var AttributesSchema = new MongooseSchema14(
|
|
11739
11796
|
{
|
|
11740
11797
|
details: { required: false, type: String },
|
|
11741
11798
|
isRequired: { default: false, required: true, type: Boolean }
|
|
11742
11799
|
},
|
|
11743
11800
|
{ _id: false }
|
|
11744
11801
|
);
|
|
11745
|
-
var
|
|
11802
|
+
var schema10 = new MongooseSchema14(
|
|
11746
11803
|
{
|
|
11747
11804
|
compliance: {
|
|
11748
11805
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
@@ -11776,17 +11833,17 @@ var schema9 = new MongooseSchema13(
|
|
|
11776
11833
|
vendorId: {
|
|
11777
11834
|
ref: "Vendor",
|
|
11778
11835
|
required: true,
|
|
11779
|
-
type:
|
|
11836
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
11780
11837
|
}
|
|
11781
11838
|
},
|
|
11782
11839
|
{ timestamps: true }
|
|
11783
11840
|
);
|
|
11784
|
-
var VendorInfoModel =
|
|
11841
|
+
var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
|
|
11785
11842
|
|
|
11786
11843
|
// src/mongoose/event/Event.ts
|
|
11787
|
-
var
|
|
11788
|
-
var
|
|
11789
|
-
var locationsSchema = new
|
|
11844
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
11845
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
11846
|
+
var locationsSchema = new MongooseSchema15(
|
|
11790
11847
|
{
|
|
11791
11848
|
city: { required: true, type: String },
|
|
11792
11849
|
coordinates: {
|
|
@@ -11809,7 +11866,7 @@ var locationsSchema = new MongooseSchema14(
|
|
|
11809
11866
|
{ _id: false }
|
|
11810
11867
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11811
11868
|
);
|
|
11812
|
-
var
|
|
11869
|
+
var schema11 = new MongooseSchema15(
|
|
11813
11870
|
{
|
|
11814
11871
|
...baseResourceFields,
|
|
11815
11872
|
// Importing base resource fields from global.ts
|
|
@@ -11817,7 +11874,7 @@ var schema10 = new MongooseSchema14(
|
|
|
11817
11874
|
eventInfoId: {
|
|
11818
11875
|
ref: "EventInfo",
|
|
11819
11876
|
required: false,
|
|
11820
|
-
type:
|
|
11877
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
11821
11878
|
},
|
|
11822
11879
|
eventType: {
|
|
11823
11880
|
enum: Object.values(EnumEventType),
|
|
@@ -11840,18 +11897,18 @@ var schema10 = new MongooseSchema14(
|
|
|
11840
11897
|
},
|
|
11841
11898
|
{ timestamps: true }
|
|
11842
11899
|
);
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
var EventModel =
|
|
11900
|
+
schema11.index({ name: 1 });
|
|
11901
|
+
schema11.index({ description: 1 });
|
|
11902
|
+
schema11.index({ region: 1 });
|
|
11903
|
+
schema11.index({ location: "2dsphere" });
|
|
11904
|
+
schema11.index({ tags: 1 });
|
|
11905
|
+
schema11.index({ "associates.email": 1 });
|
|
11906
|
+
var EventModel = import_mongoose15.default.models.Event || import_mongoose15.default.model("Event", schema11);
|
|
11850
11907
|
|
|
11851
11908
|
// src/mongoose/Partner.ts
|
|
11852
|
-
var
|
|
11853
|
-
var
|
|
11854
|
-
var
|
|
11909
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
11910
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
11911
|
+
var schema12 = new MongooseSchema16(
|
|
11855
11912
|
{
|
|
11856
11913
|
...baseResourceFields,
|
|
11857
11914
|
location: {
|
|
@@ -11867,19 +11924,19 @@ var schema11 = new MongooseSchema15(
|
|
|
11867
11924
|
},
|
|
11868
11925
|
{ timestamps: true }
|
|
11869
11926
|
);
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
var PartnerModel =
|
|
11927
|
+
schema12.index({ name: 1 });
|
|
11928
|
+
schema12.index({ description: 1 });
|
|
11929
|
+
schema12.index({ region: 1 });
|
|
11930
|
+
schema12.index({ location: "2dsphere" });
|
|
11931
|
+
schema12.index({ "associates.email": 1 });
|
|
11932
|
+
var PartnerModel = import_mongoose16.default.models.Partner || import_mongoose16.default.model("Partner", schema12);
|
|
11876
11933
|
|
|
11877
11934
|
// src/mongoose/Post.ts
|
|
11878
|
-
var
|
|
11879
|
-
var
|
|
11880
|
-
var contentSchema = new
|
|
11935
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
11936
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
11937
|
+
var contentSchema = new MongooseSchema17(
|
|
11881
11938
|
{
|
|
11882
|
-
contentData:
|
|
11939
|
+
contentData: import_mongoose17.Schema.Types.Mixed,
|
|
11883
11940
|
contentOrder: { required: true, type: Number },
|
|
11884
11941
|
contentType: {
|
|
11885
11942
|
enum: Object.values(EnumPostContentType),
|
|
@@ -11889,7 +11946,7 @@ var contentSchema = new MongooseSchema16(
|
|
|
11889
11946
|
},
|
|
11890
11947
|
{ _id: false }
|
|
11891
11948
|
);
|
|
11892
|
-
var
|
|
11949
|
+
var schema13 = new MongooseSchema17(
|
|
11893
11950
|
{
|
|
11894
11951
|
active: { default: true, required: true, type: Boolean },
|
|
11895
11952
|
caption: { required: true, type: String },
|
|
@@ -11904,15 +11961,15 @@ var schema12 = new MongooseSchema16(
|
|
|
11904
11961
|
},
|
|
11905
11962
|
{ timestamps: true }
|
|
11906
11963
|
);
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
var PostModel =
|
|
11964
|
+
schema13.index({ title: 1 });
|
|
11965
|
+
schema13.index({ tags: 1 });
|
|
11966
|
+
var PostModel = import_mongoose17.default.models.Post || import_mongoose17.default.model("Post", schema13);
|
|
11910
11967
|
|
|
11911
11968
|
// src/mongoose/AppSetting.ts
|
|
11912
|
-
var
|
|
11913
|
-
var
|
|
11969
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
11970
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
11914
11971
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
11915
|
-
var AppSettingSchema = new
|
|
11972
|
+
var AppSettingSchema = new MongooseSchema18(
|
|
11916
11973
|
{
|
|
11917
11974
|
appVersion: { default: "1.0.1", required: true, type: String },
|
|
11918
11975
|
key: {
|
|
@@ -11927,10 +11984,10 @@ var AppSettingSchema = new MongooseSchema17(
|
|
|
11927
11984
|
},
|
|
11928
11985
|
{ timestamps: true }
|
|
11929
11986
|
);
|
|
11930
|
-
var AppSettingModel =
|
|
11987
|
+
var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mongoose18.default.model("AppSetting", AppSettingSchema);
|
|
11931
11988
|
|
|
11932
11989
|
// src/service/database.ts
|
|
11933
|
-
var
|
|
11990
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
11934
11991
|
var connectToDatabase = async ({
|
|
11935
11992
|
appName,
|
|
11936
11993
|
dbName,
|
|
@@ -11943,7 +12000,7 @@ var connectToDatabase = async ({
|
|
|
11943
12000
|
// Fallback to MongoDB Atlas connection string
|
|
11944
12001
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11945
12002
|
);
|
|
11946
|
-
await
|
|
12003
|
+
await import_mongoose19.default.connect(mongoUri);
|
|
11947
12004
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11948
12005
|
console.log(
|
|
11949
12006
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12122,7 +12179,7 @@ async function updateAdStatuses() {
|
|
|
12122
12179
|
|
|
12123
12180
|
// src/types/index.ts
|
|
12124
12181
|
var import_express = __toESM(require("express"));
|
|
12125
|
-
var
|
|
12182
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12126
12183
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12127
12184
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12128
12185
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12140,6 +12197,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
12140
12197
|
EnumPubSubEvents,
|
|
12141
12198
|
EventInfoModel,
|
|
12142
12199
|
EventModel,
|
|
12200
|
+
GoogleImportedMarketModel,
|
|
12143
12201
|
NotificationModel,
|
|
12144
12202
|
ParticipantSchema,
|
|
12145
12203
|
PartnerModel,
|