@timardex/cluemart-server-shared 1.0.58 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-2W6GLZ2Z.mjs → chunk-5JEBH7MU.mjs} +244 -193
- package/dist/chunk-5JEBH7MU.mjs.map +1 -0
- package/dist/index.cjs +249 -197
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +247 -196
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +245 -193
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +8 -2
- package/dist/mongoose/index.d.ts +8 -2
- package/dist/mongoose/index.mjs +3 -1
- package/dist/service/index.cjs +232 -182
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-2W6GLZ2Z.mjs.map +0 -1
package/dist/index.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
|
}
|
|
@@ -10216,7 +10217,7 @@ var socialMediaSchema = create$3({
|
|
|
10216
10217
|
is: (name) => !!name,
|
|
10217
10218
|
// If name has a value
|
|
10218
10219
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10219
|
-
otherwise: (
|
|
10220
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10220
10221
|
})
|
|
10221
10222
|
});
|
|
10222
10223
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10289,21 +10290,21 @@ var paymentInfoSchema = create$3({
|
|
|
10289
10290
|
paymentMethod: create$8().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
10290
10291
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10291
10292
|
is: "bank_transfer",
|
|
10292
|
-
then: (
|
|
10293
|
-
otherwise: (
|
|
10293
|
+
then: (schema14) => schema14.required("Account holder name is required for bank transfer").trim(),
|
|
10294
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10294
10295
|
}),
|
|
10295
10296
|
accountNumber: create$6().when("paymentMethod", {
|
|
10296
10297
|
is: "bank_transfer",
|
|
10297
|
-
then: (
|
|
10298
|
+
then: (schema14) => schema14.required("Account number is required for bank transfer").matches(
|
|
10298
10299
|
nzBankAccountRegex,
|
|
10299
10300
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10300
10301
|
).trim(),
|
|
10301
|
-
otherwise: (
|
|
10302
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10302
10303
|
}),
|
|
10303
10304
|
link: create$6().when("paymentMethod", {
|
|
10304
10305
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10305
10306
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10306
|
-
otherwise: (
|
|
10307
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10307
10308
|
})
|
|
10308
10309
|
});
|
|
10309
10310
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10416,8 +10417,8 @@ var userSchema = create$3().shape({
|
|
|
10416
10417
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10417
10418
|
is: (val) => !!val,
|
|
10418
10419
|
// only necessary if password typed
|
|
10419
|
-
then: (
|
|
10420
|
-
otherwise: (
|
|
10420
|
+
then: (schema14) => schema14.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10421
|
+
otherwise: (schema14) => schema14.notRequired()
|
|
10421
10422
|
}),
|
|
10422
10423
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10423
10424
|
});
|
|
@@ -10535,8 +10536,8 @@ var testerSchema = create$3().shape({
|
|
|
10535
10536
|
email: emailRequiredSchema,
|
|
10536
10537
|
event: create$3().when("resourceType", {
|
|
10537
10538
|
is: (resourceType) => resourceType === "event",
|
|
10538
|
-
otherwise: (
|
|
10539
|
-
then: (
|
|
10539
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10540
|
+
then: (schema14) => schema14.required("Event information is required").shape(testerEventSchema.fields)
|
|
10540
10541
|
}),
|
|
10541
10542
|
firstName: create$6().required("First name is required"),
|
|
10542
10543
|
lastName: create$6().required("Last name is required"),
|
|
@@ -10554,8 +10555,8 @@ var testerSchema = create$3().shape({
|
|
|
10554
10555
|
).required("Resource Type is required"),
|
|
10555
10556
|
vendor: create$3().when("resourceType", {
|
|
10556
10557
|
is: (resourceType) => resourceType === "vendor",
|
|
10557
|
-
otherwise: (
|
|
10558
|
-
then: (
|
|
10558
|
+
otherwise: (schema14) => schema14.nullable().optional(),
|
|
10559
|
+
then: (schema14) => schema14.required("Vendor information is required").shape(testerVendorSchema.fields)
|
|
10559
10560
|
})
|
|
10560
10561
|
});
|
|
10561
10562
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
@@ -10593,7 +10594,7 @@ var adSchema = create$3().shape({
|
|
|
10593
10594
|
return endDate > now;
|
|
10594
10595
|
}).when("start", {
|
|
10595
10596
|
is: (val) => val && val.length > 0,
|
|
10596
|
-
then: (
|
|
10597
|
+
then: (schema14) => schema14.test(
|
|
10597
10598
|
"is-after-start",
|
|
10598
10599
|
"End date must be after start date",
|
|
10599
10600
|
function(value) {
|
|
@@ -11208,10 +11209,60 @@ ChatSchema.index({
|
|
|
11208
11209
|
});
|
|
11209
11210
|
var ChatModel = import_mongoose5.default.models.Chat || import_mongoose5.default.model("Chat", ChatSchema);
|
|
11210
11211
|
|
|
11211
|
-
// src/mongoose/
|
|
11212
|
+
// src/mongoose/GoogleImportedMarket.ts
|
|
11212
11213
|
var import_mongoose6 = __toESM(require("mongoose"));
|
|
11213
11214
|
var MongooseSchema6 = import_mongoose6.default.Schema;
|
|
11215
|
+
var locationSchema2 = new MongooseSchema6(
|
|
11216
|
+
{
|
|
11217
|
+
lat: { required: true, type: Number },
|
|
11218
|
+
lng: { required: true, type: Number }
|
|
11219
|
+
},
|
|
11220
|
+
{ _id: false }
|
|
11221
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11222
|
+
);
|
|
11214
11223
|
var schema3 = new MongooseSchema6(
|
|
11224
|
+
{
|
|
11225
|
+
address: { required: true, type: String },
|
|
11226
|
+
businessStatus: { required: false, type: String },
|
|
11227
|
+
claimed: { default: false, required: true, type: Boolean },
|
|
11228
|
+
googleMapsUrl: { required: false, type: String },
|
|
11229
|
+
googlePlaceId: {
|
|
11230
|
+
required: true,
|
|
11231
|
+
type: String,
|
|
11232
|
+
unique: true
|
|
11233
|
+
// unique, indexed
|
|
11234
|
+
},
|
|
11235
|
+
image: { required: false, type: String },
|
|
11236
|
+
// photo_reference only
|
|
11237
|
+
importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
|
|
11238
|
+
location: {
|
|
11239
|
+
required: false,
|
|
11240
|
+
// optional because lat/lng may expire after 30 days
|
|
11241
|
+
type: locationSchema2
|
|
11242
|
+
},
|
|
11243
|
+
name: { required: true, type: String },
|
|
11244
|
+
openingHours: { required: false, type: [String] },
|
|
11245
|
+
phone: { required: false, type: String },
|
|
11246
|
+
photos: { required: false, type: [String] },
|
|
11247
|
+
// array of photo_reference
|
|
11248
|
+
rating: { required: false, type: Number },
|
|
11249
|
+
reviewCount: { required: false, type: Number },
|
|
11250
|
+
slug: { required: true, type: String },
|
|
11251
|
+
website: { required: false, type: String }
|
|
11252
|
+
},
|
|
11253
|
+
{ timestamps: true }
|
|
11254
|
+
);
|
|
11255
|
+
schema3.index({ googlePlaceId: 1 });
|
|
11256
|
+
schema3.index({ name: 1 });
|
|
11257
|
+
schema3.index({ slug: 1 });
|
|
11258
|
+
schema3.index({ address: 1 });
|
|
11259
|
+
schema3.index({ "location.lat": 1, "location.lng": 1 });
|
|
11260
|
+
var GoogleImportedMarketModel = import_mongoose6.default.models.GoogleImportedMarket || import_mongoose6.default.model("GoogleImportedMarket", schema3);
|
|
11261
|
+
|
|
11262
|
+
// src/mongoose/Notification.ts
|
|
11263
|
+
var import_mongoose7 = __toESM(require("mongoose"));
|
|
11264
|
+
var MongooseSchema7 = import_mongoose7.default.Schema;
|
|
11265
|
+
var schema4 = new MongooseSchema7(
|
|
11215
11266
|
{
|
|
11216
11267
|
data: {
|
|
11217
11268
|
resourceId: { required: true, type: String },
|
|
@@ -11234,14 +11285,14 @@ var schema3 = new MongooseSchema6(
|
|
|
11234
11285
|
userId: {
|
|
11235
11286
|
ref: "User",
|
|
11236
11287
|
required: true,
|
|
11237
|
-
type:
|
|
11288
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
11238
11289
|
}
|
|
11239
11290
|
},
|
|
11240
11291
|
{ timestamps: true }
|
|
11241
11292
|
);
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
var NotificationModel =
|
|
11293
|
+
schema4.index({ isRead: 1, userId: 1 });
|
|
11294
|
+
schema4.index({ createdAt: -1, userId: 1 });
|
|
11295
|
+
var NotificationModel = import_mongoose7.default.models.Notification || import_mongoose7.default.model("Notification", schema4);
|
|
11245
11296
|
|
|
11246
11297
|
// node_modules/@timardex/cluemart-shared/dist/chunk-OBQRGWV3.mjs
|
|
11247
11298
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
@@ -11252,9 +11303,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
11252
11303
|
})(EnumOSPlatform2 || {});
|
|
11253
11304
|
|
|
11254
11305
|
// src/mongoose/PushToken.ts
|
|
11255
|
-
var
|
|
11256
|
-
var
|
|
11257
|
-
var
|
|
11306
|
+
var import_mongoose8 = __toESM(require("mongoose"));
|
|
11307
|
+
var MongooseSchema8 = import_mongoose8.default.Schema;
|
|
11308
|
+
var schema5 = new MongooseSchema8(
|
|
11258
11309
|
{
|
|
11259
11310
|
platform: {
|
|
11260
11311
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -11262,16 +11313,16 @@ var schema4 = new MongooseSchema7(
|
|
|
11262
11313
|
type: String
|
|
11263
11314
|
},
|
|
11264
11315
|
token: { required: true, type: String },
|
|
11265
|
-
userId: { required: true, type:
|
|
11316
|
+
userId: { required: true, type: import_mongoose8.default.Schema.Types.ObjectId }
|
|
11266
11317
|
},
|
|
11267
11318
|
{ timestamps: true }
|
|
11268
11319
|
);
|
|
11269
|
-
var PushTokenModel =
|
|
11320
|
+
var PushTokenModel = import_mongoose8.default.models.PushToken || import_mongoose8.default.model("PushToken", schema5);
|
|
11270
11321
|
|
|
11271
11322
|
// src/mongoose/ResourceActivity.ts
|
|
11272
|
-
var
|
|
11273
|
-
var
|
|
11274
|
-
var ActivitySchema = new
|
|
11323
|
+
var import_mongoose9 = __toESM(require("mongoose"));
|
|
11324
|
+
var MongooseSchema9 = import_mongoose9.default.Schema;
|
|
11325
|
+
var ActivitySchema = new MongooseSchema9(
|
|
11275
11326
|
{
|
|
11276
11327
|
activityType: {
|
|
11277
11328
|
enum: Object.values(EnumActivity),
|
|
@@ -11307,7 +11358,7 @@ var ActivitySchema = new MongooseSchema8(
|
|
|
11307
11358
|
},
|
|
11308
11359
|
{ _id: false }
|
|
11309
11360
|
);
|
|
11310
|
-
var
|
|
11361
|
+
var schema6 = new MongooseSchema9(
|
|
11311
11362
|
{
|
|
11312
11363
|
activity: { default: [], type: [ActivitySchema] },
|
|
11313
11364
|
resourceId: { required: true, type: String },
|
|
@@ -11319,14 +11370,14 @@ var schema5 = new MongooseSchema8(
|
|
|
11319
11370
|
},
|
|
11320
11371
|
{ timestamps: true }
|
|
11321
11372
|
);
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
var ResourceActivityModel =
|
|
11373
|
+
schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
11374
|
+
schema6.index({ "views.location": "2dsphere" });
|
|
11375
|
+
var ResourceActivityModel = import_mongoose9.default.models.ResourceActivity || import_mongoose9.default.model("ResourceActivity", schema6);
|
|
11325
11376
|
|
|
11326
11377
|
// src/mongoose/Tester.ts
|
|
11327
|
-
var
|
|
11328
|
-
var
|
|
11329
|
-
var TesterVendorQuestionarySchema = new
|
|
11378
|
+
var import_mongoose10 = __toESM(require("mongoose"));
|
|
11379
|
+
var MongooseSchema10 = import_mongoose10.default.Schema;
|
|
11380
|
+
var TesterVendorQuestionarySchema = new MongooseSchema10(
|
|
11330
11381
|
{
|
|
11331
11382
|
appearInVideoIntroduction: {
|
|
11332
11383
|
default: false,
|
|
@@ -11353,7 +11404,7 @@ var TesterVendorQuestionarySchema = new MongooseSchema9(
|
|
|
11353
11404
|
},
|
|
11354
11405
|
{ _id: false }
|
|
11355
11406
|
);
|
|
11356
|
-
var TesterVendorSchema = new
|
|
11407
|
+
var TesterVendorSchema = new MongooseSchema10(
|
|
11357
11408
|
{
|
|
11358
11409
|
categories: { required: true, type: [CategorySchema] },
|
|
11359
11410
|
marketsAttended: {
|
|
@@ -11379,7 +11430,7 @@ var TesterVendorSchema = new MongooseSchema9(
|
|
|
11379
11430
|
},
|
|
11380
11431
|
{ _id: false }
|
|
11381
11432
|
);
|
|
11382
|
-
var TesterEventQuestionarySchema = new
|
|
11433
|
+
var TesterEventQuestionarySchema = new MongooseSchema10(
|
|
11383
11434
|
{
|
|
11384
11435
|
allowMarketingAppearance: {
|
|
11385
11436
|
default: false,
|
|
@@ -11414,7 +11465,7 @@ var TesterEventQuestionarySchema = new MongooseSchema9(
|
|
|
11414
11465
|
},
|
|
11415
11466
|
{ _id: false }
|
|
11416
11467
|
);
|
|
11417
|
-
var TesterEventsSchema = new
|
|
11468
|
+
var TesterEventsSchema = new MongooseSchema10(
|
|
11418
11469
|
{
|
|
11419
11470
|
markets: {
|
|
11420
11471
|
required: true,
|
|
@@ -11443,7 +11494,7 @@ var TesterEventsSchema = new MongooseSchema9(
|
|
|
11443
11494
|
},
|
|
11444
11495
|
{ _id: false }
|
|
11445
11496
|
);
|
|
11446
|
-
var TesterSchema = new
|
|
11497
|
+
var TesterSchema = new MongooseSchema10(
|
|
11447
11498
|
{
|
|
11448
11499
|
active: { default: false, required: true, type: Boolean },
|
|
11449
11500
|
approved: { default: false, required: true, type: Boolean },
|
|
@@ -11477,43 +11528,43 @@ var TesterSchema = new MongooseSchema9(
|
|
|
11477
11528
|
timestamps: true
|
|
11478
11529
|
}
|
|
11479
11530
|
);
|
|
11480
|
-
var TesterModel =
|
|
11531
|
+
var TesterModel = import_mongoose10.default.models.Tester || import_mongoose10.default.model("Tester", TesterSchema);
|
|
11481
11532
|
|
|
11482
11533
|
// src/mongoose/User.ts
|
|
11483
|
-
var
|
|
11484
|
-
var
|
|
11485
|
-
var userActivityEventSchema = new
|
|
11534
|
+
var import_mongoose11 = __toESM(require("mongoose"));
|
|
11535
|
+
var MongooseSchema11 = import_mongoose11.default.Schema;
|
|
11536
|
+
var userActivityEventSchema = new MongooseSchema11(
|
|
11486
11537
|
{
|
|
11487
11538
|
dateTime: dateTimeSchema3,
|
|
11488
11539
|
resourceId: {
|
|
11489
11540
|
ref: "Event",
|
|
11490
11541
|
required: false,
|
|
11491
|
-
type:
|
|
11542
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11492
11543
|
}
|
|
11493
11544
|
},
|
|
11494
11545
|
{ _id: false }
|
|
11495
11546
|
);
|
|
11496
|
-
var userActivityFavouritesSchema = new
|
|
11547
|
+
var userActivityFavouritesSchema = new MongooseSchema11(
|
|
11497
11548
|
{
|
|
11498
11549
|
events: {
|
|
11499
11550
|
ref: "Event",
|
|
11500
11551
|
required: false,
|
|
11501
|
-
type: [
|
|
11552
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11502
11553
|
},
|
|
11503
11554
|
partners: {
|
|
11504
11555
|
ref: "Partner",
|
|
11505
11556
|
required: false,
|
|
11506
|
-
type: [
|
|
11557
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11507
11558
|
},
|
|
11508
11559
|
vendors: {
|
|
11509
11560
|
ref: "Vendor",
|
|
11510
11561
|
required: false,
|
|
11511
|
-
type: [
|
|
11562
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11512
11563
|
}
|
|
11513
11564
|
},
|
|
11514
11565
|
{ _id: false }
|
|
11515
11566
|
);
|
|
11516
|
-
var stripeSchema = new
|
|
11567
|
+
var stripeSchema = new MongooseSchema11(
|
|
11517
11568
|
{
|
|
11518
11569
|
currentPlan: {
|
|
11519
11570
|
enum: Object.values(EnumUserLicence),
|
|
@@ -11544,7 +11595,7 @@ var stripeSchema = new MongooseSchema10(
|
|
|
11544
11595
|
},
|
|
11545
11596
|
{ _id: false }
|
|
11546
11597
|
);
|
|
11547
|
-
var
|
|
11598
|
+
var schema7 = new MongooseSchema11(
|
|
11548
11599
|
{
|
|
11549
11600
|
active: { default: false, required: true, type: Boolean },
|
|
11550
11601
|
associates: {
|
|
@@ -11560,7 +11611,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11560
11611
|
events: {
|
|
11561
11612
|
ref: "Event",
|
|
11562
11613
|
required: false,
|
|
11563
|
-
type: [
|
|
11614
|
+
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
11564
11615
|
},
|
|
11565
11616
|
firstName: { required: true, type: String },
|
|
11566
11617
|
isTester: { default: false, required: true, type: Boolean },
|
|
@@ -11572,7 +11623,7 @@ var schema6 = new MongooseSchema10(
|
|
|
11572
11623
|
partner: {
|
|
11573
11624
|
ref: "Partner",
|
|
11574
11625
|
required: false,
|
|
11575
|
-
type:
|
|
11626
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11576
11627
|
},
|
|
11577
11628
|
password: { required: true, type: String },
|
|
11578
11629
|
platform: {
|
|
@@ -11617,20 +11668,20 @@ var schema6 = new MongooseSchema10(
|
|
|
11617
11668
|
vendor: {
|
|
11618
11669
|
ref: "Vendor",
|
|
11619
11670
|
required: false,
|
|
11620
|
-
type:
|
|
11671
|
+
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
11621
11672
|
}
|
|
11622
11673
|
},
|
|
11623
11674
|
{ strict: false, timestamps: true }
|
|
11624
11675
|
);
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
var UserModel =
|
|
11676
|
+
schema7.index({ "associates.email": 1 });
|
|
11677
|
+
schema7.index({ "licences.expiryDate": 1 });
|
|
11678
|
+
schema7.index({ "licences.licenceType": 1 });
|
|
11679
|
+
var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema7);
|
|
11629
11680
|
|
|
11630
11681
|
// src/mongoose/VerificationToken.ts
|
|
11631
|
-
var
|
|
11632
|
-
var
|
|
11633
|
-
var
|
|
11682
|
+
var import_mongoose12 = __toESM(require("mongoose"));
|
|
11683
|
+
var MongooseSchema12 = import_mongoose12.default.Schema;
|
|
11684
|
+
var schema8 = new MongooseSchema12(
|
|
11634
11685
|
{
|
|
11635
11686
|
createdAt: {
|
|
11636
11687
|
default: Date.now,
|
|
@@ -11645,12 +11696,12 @@ var schema7 = new MongooseSchema11(
|
|
|
11645
11696
|
},
|
|
11646
11697
|
{ timestamps: true }
|
|
11647
11698
|
);
|
|
11648
|
-
var VerificationTokenModel =
|
|
11699
|
+
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema8);
|
|
11649
11700
|
|
|
11650
11701
|
// src/mongoose/vendor/Vendor.ts
|
|
11651
|
-
var
|
|
11652
|
-
var
|
|
11653
|
-
var MenuTypeSchema = new
|
|
11702
|
+
var import_mongoose13 = __toESM(require("mongoose"));
|
|
11703
|
+
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
11704
|
+
var MenuTypeSchema = new MongooseSchema13(
|
|
11654
11705
|
{
|
|
11655
11706
|
description: { required: false, type: String },
|
|
11656
11707
|
name: { required: false, type: String },
|
|
@@ -11660,7 +11711,7 @@ var MenuTypeSchema = new MongooseSchema12(
|
|
|
11660
11711
|
{ _id: false }
|
|
11661
11712
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11662
11713
|
);
|
|
11663
|
-
var LocationsSchema = new
|
|
11714
|
+
var LocationsSchema = new MongooseSchema13(
|
|
11664
11715
|
{
|
|
11665
11716
|
dateTime: {
|
|
11666
11717
|
dateStatus: {
|
|
@@ -11693,7 +11744,7 @@ var LocationsSchema = new MongooseSchema12(
|
|
|
11693
11744
|
{ _id: false }
|
|
11694
11745
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11695
11746
|
);
|
|
11696
|
-
var
|
|
11747
|
+
var schema9 = new MongooseSchema13(
|
|
11697
11748
|
{
|
|
11698
11749
|
...baseResourceFields,
|
|
11699
11750
|
// Importing base resource fields from global.ts
|
|
@@ -11715,7 +11766,7 @@ var schema8 = new MongooseSchema12(
|
|
|
11715
11766
|
vendorInfoId: {
|
|
11716
11767
|
ref: "VendorInfo",
|
|
11717
11768
|
required: false,
|
|
11718
|
-
type:
|
|
11769
|
+
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
11719
11770
|
},
|
|
11720
11771
|
vendorType: {
|
|
11721
11772
|
enum: Object.values(EnumVendorType),
|
|
@@ -11725,24 +11776,24 @@ var schema8 = new MongooseSchema12(
|
|
|
11725
11776
|
},
|
|
11726
11777
|
{ timestamps: true }
|
|
11727
11778
|
);
|
|
11728
|
-
|
|
11729
|
-
|
|
11730
|
-
|
|
11731
|
-
|
|
11732
|
-
|
|
11733
|
-
var VendorModel =
|
|
11779
|
+
schema9.index({ name: 1 });
|
|
11780
|
+
schema9.index({ description: 1 });
|
|
11781
|
+
schema9.index({ region: 1 });
|
|
11782
|
+
schema9.index({ "categories.name": 1 });
|
|
11783
|
+
schema9.index({ "associates.email": 1 });
|
|
11784
|
+
var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema9);
|
|
11734
11785
|
|
|
11735
11786
|
// src/mongoose/vendor/VendorInfo.ts
|
|
11736
|
-
var
|
|
11737
|
-
var
|
|
11738
|
-
var AttributesSchema = new
|
|
11787
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
11788
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
11789
|
+
var AttributesSchema = new MongooseSchema14(
|
|
11739
11790
|
{
|
|
11740
11791
|
details: { required: false, type: String },
|
|
11741
11792
|
isRequired: { default: false, required: true, type: Boolean }
|
|
11742
11793
|
},
|
|
11743
11794
|
{ _id: false }
|
|
11744
11795
|
);
|
|
11745
|
-
var
|
|
11796
|
+
var schema10 = new MongooseSchema14(
|
|
11746
11797
|
{
|
|
11747
11798
|
compliance: {
|
|
11748
11799
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
@@ -11776,17 +11827,17 @@ var schema9 = new MongooseSchema13(
|
|
|
11776
11827
|
vendorId: {
|
|
11777
11828
|
ref: "Vendor",
|
|
11778
11829
|
required: true,
|
|
11779
|
-
type:
|
|
11830
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
11780
11831
|
}
|
|
11781
11832
|
},
|
|
11782
11833
|
{ timestamps: true }
|
|
11783
11834
|
);
|
|
11784
|
-
var VendorInfoModel =
|
|
11835
|
+
var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema10);
|
|
11785
11836
|
|
|
11786
11837
|
// src/mongoose/event/Event.ts
|
|
11787
|
-
var
|
|
11788
|
-
var
|
|
11789
|
-
var locationsSchema = new
|
|
11838
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
11839
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
11840
|
+
var locationsSchema = new MongooseSchema15(
|
|
11790
11841
|
{
|
|
11791
11842
|
city: { required: true, type: String },
|
|
11792
11843
|
coordinates: {
|
|
@@ -11809,7 +11860,7 @@ var locationsSchema = new MongooseSchema14(
|
|
|
11809
11860
|
{ _id: false }
|
|
11810
11861
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11811
11862
|
);
|
|
11812
|
-
var
|
|
11863
|
+
var schema11 = new MongooseSchema15(
|
|
11813
11864
|
{
|
|
11814
11865
|
...baseResourceFields,
|
|
11815
11866
|
// Importing base resource fields from global.ts
|
|
@@ -11817,7 +11868,7 @@ var schema10 = new MongooseSchema14(
|
|
|
11817
11868
|
eventInfoId: {
|
|
11818
11869
|
ref: "EventInfo",
|
|
11819
11870
|
required: false,
|
|
11820
|
-
type:
|
|
11871
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
11821
11872
|
},
|
|
11822
11873
|
eventType: {
|
|
11823
11874
|
enum: Object.values(EnumEventType),
|
|
@@ -11840,18 +11891,18 @@ var schema10 = new MongooseSchema14(
|
|
|
11840
11891
|
},
|
|
11841
11892
|
{ timestamps: true }
|
|
11842
11893
|
);
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
var EventModel =
|
|
11894
|
+
schema11.index({ name: 1 });
|
|
11895
|
+
schema11.index({ description: 1 });
|
|
11896
|
+
schema11.index({ region: 1 });
|
|
11897
|
+
schema11.index({ location: "2dsphere" });
|
|
11898
|
+
schema11.index({ tags: 1 });
|
|
11899
|
+
schema11.index({ "associates.email": 1 });
|
|
11900
|
+
var EventModel = import_mongoose15.default.models.Event || import_mongoose15.default.model("Event", schema11);
|
|
11850
11901
|
|
|
11851
11902
|
// src/mongoose/Partner.ts
|
|
11852
|
-
var
|
|
11853
|
-
var
|
|
11854
|
-
var
|
|
11903
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
11904
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
11905
|
+
var schema12 = new MongooseSchema16(
|
|
11855
11906
|
{
|
|
11856
11907
|
...baseResourceFields,
|
|
11857
11908
|
location: {
|
|
@@ -11867,19 +11918,19 @@ var schema11 = new MongooseSchema15(
|
|
|
11867
11918
|
},
|
|
11868
11919
|
{ timestamps: true }
|
|
11869
11920
|
);
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
var PartnerModel =
|
|
11921
|
+
schema12.index({ name: 1 });
|
|
11922
|
+
schema12.index({ description: 1 });
|
|
11923
|
+
schema12.index({ region: 1 });
|
|
11924
|
+
schema12.index({ location: "2dsphere" });
|
|
11925
|
+
schema12.index({ "associates.email": 1 });
|
|
11926
|
+
var PartnerModel = import_mongoose16.default.models.Partner || import_mongoose16.default.model("Partner", schema12);
|
|
11876
11927
|
|
|
11877
11928
|
// src/mongoose/Post.ts
|
|
11878
|
-
var
|
|
11879
|
-
var
|
|
11880
|
-
var contentSchema = new
|
|
11929
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
11930
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
11931
|
+
var contentSchema = new MongooseSchema17(
|
|
11881
11932
|
{
|
|
11882
|
-
contentData:
|
|
11933
|
+
contentData: import_mongoose17.Schema.Types.Mixed,
|
|
11883
11934
|
contentOrder: { required: true, type: Number },
|
|
11884
11935
|
contentType: {
|
|
11885
11936
|
enum: Object.values(EnumPostContentType),
|
|
@@ -11889,7 +11940,7 @@ var contentSchema = new MongooseSchema16(
|
|
|
11889
11940
|
},
|
|
11890
11941
|
{ _id: false }
|
|
11891
11942
|
);
|
|
11892
|
-
var
|
|
11943
|
+
var schema13 = new MongooseSchema17(
|
|
11893
11944
|
{
|
|
11894
11945
|
active: { default: true, required: true, type: Boolean },
|
|
11895
11946
|
caption: { required: true, type: String },
|
|
@@ -11904,15 +11955,15 @@ var schema12 = new MongooseSchema16(
|
|
|
11904
11955
|
},
|
|
11905
11956
|
{ timestamps: true }
|
|
11906
11957
|
);
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
var PostModel =
|
|
11958
|
+
schema13.index({ title: 1 });
|
|
11959
|
+
schema13.index({ tags: 1 });
|
|
11960
|
+
var PostModel = import_mongoose17.default.models.Post || import_mongoose17.default.model("Post", schema13);
|
|
11910
11961
|
|
|
11911
11962
|
// src/mongoose/AppSetting.ts
|
|
11912
|
-
var
|
|
11913
|
-
var
|
|
11963
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
11964
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
11914
11965
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
11915
|
-
var AppSettingSchema = new
|
|
11966
|
+
var AppSettingSchema = new MongooseSchema18(
|
|
11916
11967
|
{
|
|
11917
11968
|
appVersion: { default: "1.0.1", required: true, type: String },
|
|
11918
11969
|
key: {
|
|
@@ -11927,10 +11978,10 @@ var AppSettingSchema = new MongooseSchema17(
|
|
|
11927
11978
|
},
|
|
11928
11979
|
{ timestamps: true }
|
|
11929
11980
|
);
|
|
11930
|
-
var AppSettingModel =
|
|
11981
|
+
var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mongoose18.default.model("AppSetting", AppSettingSchema);
|
|
11931
11982
|
|
|
11932
11983
|
// src/service/database.ts
|
|
11933
|
-
var
|
|
11984
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
11934
11985
|
var connectToDatabase = async ({
|
|
11935
11986
|
appName,
|
|
11936
11987
|
dbName,
|
|
@@ -11943,7 +11994,7 @@ var connectToDatabase = async ({
|
|
|
11943
11994
|
// Fallback to MongoDB Atlas connection string
|
|
11944
11995
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11945
11996
|
);
|
|
11946
|
-
await
|
|
11997
|
+
await import_mongoose19.default.connect(mongoUri);
|
|
11947
11998
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11948
11999
|
console.log(
|
|
11949
12000
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12122,7 +12173,7 @@ async function updateAdStatuses() {
|
|
|
12122
12173
|
|
|
12123
12174
|
// src/types/index.ts
|
|
12124
12175
|
var import_express = __toESM(require("express"));
|
|
12125
|
-
var
|
|
12176
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
12126
12177
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12127
12178
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12128
12179
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12140,6 +12191,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
12140
12191
|
EnumPubSubEvents,
|
|
12141
12192
|
EventInfoModel,
|
|
12142
12193
|
EventModel,
|
|
12194
|
+
GoogleImportedMarketModel,
|
|
12143
12195
|
NotificationModel,
|
|
12144
12196
|
ParticipantSchema,
|
|
12145
12197
|
PartnerModel,
|