@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.
@@ -4718,10 +4718,10 @@ var Condition = class _Condition {
4718
4718
  otherwise
4719
4719
  } = config;
4720
4720
  let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
4721
- return new _Condition(refs, (values, schema13) => {
4721
+ return new _Condition(refs, (values, schema14) => {
4722
4722
  var _branch;
4723
4723
  let branch = check(...values) ? then : otherwise;
4724
- return (_branch = branch == null ? void 0 : branch(schema13)) != null ? _branch : schema13;
4724
+ return (_branch = branch == null ? void 0 : branch(schema14)) != null ? _branch : schema14;
4725
4725
  });
4726
4726
  }
4727
4727
  constructor(refs, builder) {
@@ -4735,13 +4735,13 @@ var Condition = class _Condition {
4735
4735
  // TODO: ? operator here?
4736
4736
  ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
4737
4737
  ));
4738
- let schema13 = this.fn(values, base, options);
4739
- if (schema13 === void 0 || // @ts-ignore this can be base
4740
- schema13 === base) {
4738
+ let schema14 = this.fn(values, base, options);
4739
+ if (schema14 === void 0 || // @ts-ignore this can be base
4740
+ schema14 === base) {
4741
4741
  return base;
4742
4742
  }
4743
- if (!isSchema(schema13)) throw new TypeError("conditions must return a schema object");
4744
- return schema13.resolve(options);
4743
+ if (!isSchema(schema14)) throw new TypeError("conditions must return a schema object");
4744
+ return schema14.resolve(options);
4745
4745
  }
4746
4746
  };
4747
4747
  var prefixes = {
@@ -4811,7 +4811,7 @@ function createValidation(config) {
4811
4811
  path = "",
4812
4812
  options,
4813
4813
  originalValue,
4814
- schema: schema13
4814
+ schema: schema14
4815
4815
  }, panic, next) {
4816
4816
  const {
4817
4817
  name,
@@ -4823,8 +4823,8 @@ function createValidation(config) {
4823
4823
  let {
4824
4824
  parent,
4825
4825
  context,
4826
- abortEarly = schema13.spec.abortEarly,
4827
- disableStackTrace = schema13.spec.disableStackTrace
4826
+ abortEarly = schema14.spec.abortEarly,
4827
+ disableStackTrace = schema14.spec.disableStackTrace
4828
4828
  } = options;
4829
4829
  const resolveOptions = {
4830
4830
  value,
@@ -4835,9 +4835,9 @@ function createValidation(config) {
4835
4835
  const nextParams = resolveParams(Object.assign({
4836
4836
  value,
4837
4837
  originalValue,
4838
- label: schema13.spec.label,
4838
+ label: schema14.spec.label,
4839
4839
  path: overrides.path || path,
4840
- spec: schema13.spec,
4840
+ spec: schema14.spec,
4841
4841
  disableStackTrace: overrides.disableStackTrace || disableStackTrace
4842
4842
  }, params, overrides.params), resolveOptions);
4843
4843
  const error = new ValidationError(ValidationError.formatError(overrides.message || message, nextParams), value, nextParams.path, overrides.type || name, nextParams.disableStackTrace);
@@ -4856,7 +4856,7 @@ function createValidation(config) {
4856
4856
  },
4857
4857
  options,
4858
4858
  originalValue,
4859
- schema: schema13
4859
+ schema: schema14
4860
4860
  };
4861
4861
  const handleResult = (validOrError) => {
4862
4862
  if (ValidationError.isError(validOrError)) invalid(validOrError);
@@ -4900,42 +4900,42 @@ function resolveParams(params, options) {
4900
4900
  function resolveMaybeRef(item, options) {
4901
4901
  return Reference.isRef(item) ? item.getValue(options.value, options.parent, options.context) : item;
4902
4902
  }
4903
- function getIn(schema13, path, value, context = value) {
4903
+ function getIn(schema14, path, value, context = value) {
4904
4904
  let parent, lastPart, lastPartDebug;
4905
4905
  if (!path) return {
4906
4906
  parent,
4907
4907
  parentPath: path,
4908
- schema: schema13
4908
+ schema: schema14
4909
4909
  };
4910
4910
  (0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
4911
4911
  let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
4912
- schema13 = schema13.resolve({
4912
+ schema14 = schema14.resolve({
4913
4913
  context,
4914
4914
  parent,
4915
4915
  value
4916
4916
  });
4917
- let isTuple = schema13.type === "tuple";
4917
+ let isTuple = schema14.type === "tuple";
4918
4918
  let idx = isArray ? parseInt(part, 10) : 0;
4919
- if (schema13.innerType || isTuple) {
4919
+ if (schema14.innerType || isTuple) {
4920
4920
  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]"`);
4921
4921
  if (value && idx >= value.length) {
4922
4922
  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. `);
4923
4923
  }
4924
4924
  parent = value;
4925
4925
  value = value && value[idx];
4926
- schema13 = isTuple ? schema13.spec.types[idx] : schema13.innerType;
4926
+ schema14 = isTuple ? schema14.spec.types[idx] : schema14.innerType;
4927
4927
  }
4928
4928
  if (!isArray) {
4929
- if (!schema13.fields || !schema13.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema13.type}")`);
4929
+ 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}")`);
4930
4930
  parent = value;
4931
4931
  value = value && value[part];
4932
- schema13 = schema13.fields[part];
4932
+ schema14 = schema14.fields[part];
4933
4933
  }
4934
4934
  lastPart = part;
4935
4935
  lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
4936
4936
  });
4937
4937
  return {
4938
- schema: schema13,
4938
+ schema: schema14,
4939
4939
  parent,
4940
4940
  parentPath: lastPart
4941
4941
  };
@@ -5135,20 +5135,20 @@ var Schema = class {
5135
5135
  this._mutate = before;
5136
5136
  return result;
5137
5137
  }
5138
- concat(schema13) {
5139
- if (!schema13 || schema13 === this) return this;
5140
- if (schema13.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema13.type}`);
5138
+ concat(schema14) {
5139
+ if (!schema14 || schema14 === this) return this;
5140
+ if (schema14.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema14.type}`);
5141
5141
  let base = this;
5142
- let combined = schema13.clone();
5142
+ let combined = schema14.clone();
5143
5143
  const mergedSpec = Object.assign({}, base.spec, combined.spec);
5144
5144
  combined.spec = mergedSpec;
5145
5145
  combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
5146
- combined._whitelist = base._whitelist.merge(schema13._whitelist, schema13._blacklist);
5147
- combined._blacklist = base._blacklist.merge(schema13._blacklist, schema13._whitelist);
5146
+ combined._whitelist = base._whitelist.merge(schema14._whitelist, schema14._blacklist);
5147
+ combined._blacklist = base._blacklist.merge(schema14._blacklist, schema14._whitelist);
5148
5148
  combined.tests = base.tests;
5149
5149
  combined.exclusiveTests = base.exclusiveTests;
5150
5150
  combined.withMutation((next) => {
5151
- schema13.tests.forEach((fn) => {
5151
+ schema14.tests.forEach((fn) => {
5152
5152
  next.test(fn.OPTIONS);
5153
5153
  });
5154
5154
  });
@@ -5164,15 +5164,15 @@ var Schema = class {
5164
5164
  return this._typeCheck(v);
5165
5165
  }
5166
5166
  resolve(options) {
5167
- let schema13 = this;
5168
- if (schema13.conditions.length) {
5169
- let conditions = schema13.conditions;
5170
- schema13 = schema13.clone();
5171
- schema13.conditions = [];
5172
- schema13 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema13);
5173
- schema13 = schema13.resolve(options);
5167
+ let schema14 = this;
5168
+ if (schema14.conditions.length) {
5169
+ let conditions = schema14.conditions;
5170
+ schema14 = schema14.clone();
5171
+ schema14.conditions = [];
5172
+ schema14 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema14);
5173
+ schema14 = schema14.resolve(options);
5174
5174
  }
5175
- return schema13;
5175
+ return schema14;
5176
5176
  }
5177
5177
  resolveOptions(options) {
5178
5178
  var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
@@ -5328,11 +5328,11 @@ attempted value: ${formattedValue}
5328
5328
  }
5329
5329
  validate(value, options) {
5330
5330
  var _options$disableStack2;
5331
- let schema13 = this.resolve(Object.assign({}, options, {
5331
+ let schema14 = this.resolve(Object.assign({}, options, {
5332
5332
  value
5333
5333
  }));
5334
- let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema13.spec.disableStackTrace;
5335
- return new Promise((resolve, reject) => schema13._validate(value, options, (error, parsed) => {
5334
+ let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema14.spec.disableStackTrace;
5335
+ return new Promise((resolve, reject) => schema14._validate(value, options, (error, parsed) => {
5336
5336
  if (ValidationError.isError(error)) error.value = parsed;
5337
5337
  reject(error);
5338
5338
  }, (errors, validated) => {
@@ -5342,12 +5342,12 @@ attempted value: ${formattedValue}
5342
5342
  }
5343
5343
  validateSync(value, options) {
5344
5344
  var _options$disableStack3;
5345
- let schema13 = this.resolve(Object.assign({}, options, {
5345
+ let schema14 = this.resolve(Object.assign({}, options, {
5346
5346
  value
5347
5347
  }));
5348
5348
  let result;
5349
- let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema13.spec.disableStackTrace;
5350
- schema13._validate(value, Object.assign({}, options, {
5349
+ let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema14.spec.disableStackTrace;
5350
+ schema14._validate(value, Object.assign({}, options, {
5351
5351
  sync: true
5352
5352
  }), (error, parsed) => {
5353
5353
  if (ValidationError.isError(error)) error.value = parsed;
@@ -5381,8 +5381,8 @@ attempted value: ${formattedValue}
5381
5381
  return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
5382
5382
  }
5383
5383
  getDefault(options) {
5384
- let schema13 = this.resolve(options || {});
5385
- return schema13._getDefault(options);
5384
+ let schema14 = this.resolve(options || {});
5385
+ return schema14._getDefault(options);
5386
5386
  }
5387
5387
  default(def) {
5388
5388
  if (arguments.length === 0) {
@@ -5615,13 +5615,13 @@ attempted value: ${formattedValue}
5615
5615
  return description;
5616
5616
  }
5617
5617
  get ["~standard"]() {
5618
- const schema13 = this;
5618
+ const schema14 = this;
5619
5619
  const standard = {
5620
5620
  version: 1,
5621
5621
  vendor: "yup",
5622
5622
  async validate(value) {
5623
5623
  try {
5624
- const result = await schema13.validate(value, {
5624
+ const result = await schema14.validate(value, {
5625
5625
  abortEarly: false
5626
5626
  });
5627
5627
  return {
@@ -5645,9 +5645,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
5645
5645
  const {
5646
5646
  parent,
5647
5647
  parentPath,
5648
- schema: schema13
5648
+ schema: schema14
5649
5649
  } = getIn(this, path, value, options.context);
5650
- return schema13[method](parent && parent[parentPath], Object.assign({}, options, {
5650
+ return schema14[method](parent && parent[parentPath], Object.assign({}, options, {
5651
5651
  parent,
5652
5652
  path
5653
5653
  }));
@@ -5821,7 +5821,7 @@ var StringSchema = class extends Schema {
5821
5821
  });
5822
5822
  }
5823
5823
  required(message) {
5824
- return super.required(message).withMutation((schema13) => schema13.test({
5824
+ return super.required(message).withMutation((schema14) => schema14.test({
5825
5825
  message: message || mixed.required,
5826
5826
  name: "required",
5827
5827
  skipAbsent: true,
@@ -5829,9 +5829,9 @@ var StringSchema = class extends Schema {
5829
5829
  }));
5830
5830
  }
5831
5831
  notRequired() {
5832
- return super.notRequired().withMutation((schema13) => {
5833
- schema13.tests = schema13.tests.filter((t) => t.OPTIONS.name !== "required");
5834
- return schema13;
5832
+ return super.notRequired().withMutation((schema14) => {
5833
+ schema14.tests = schema14.tests.filter((t) => t.OPTIONS.name !== "required");
5834
+ return schema14;
5835
5835
  });
5836
5836
  }
5837
5837
  length(length, message = string.length) {
@@ -6209,7 +6209,7 @@ function sortByKeyOrder(keys) {
6209
6209
  return findIndex(keys, a) - findIndex(keys, b);
6210
6210
  };
6211
6211
  }
6212
- var parseJson = (value, _, schema13) => {
6212
+ var parseJson = (value, _, schema14) => {
6213
6213
  if (typeof value !== "string") {
6214
6214
  return value;
6215
6215
  }
@@ -6218,30 +6218,30 @@ var parseJson = (value, _, schema13) => {
6218
6218
  parsed = JSON.parse(value);
6219
6219
  } catch (err) {
6220
6220
  }
6221
- return schema13.isType(parsed) ? parsed : value;
6221
+ return schema14.isType(parsed) ? parsed : value;
6222
6222
  };
6223
- function deepPartial(schema13) {
6224
- if ("fields" in schema13) {
6223
+ function deepPartial(schema14) {
6224
+ if ("fields" in schema14) {
6225
6225
  const partial = {};
6226
- for (const [key, fieldSchema] of Object.entries(schema13.fields)) {
6226
+ for (const [key, fieldSchema] of Object.entries(schema14.fields)) {
6227
6227
  partial[key] = deepPartial(fieldSchema);
6228
6228
  }
6229
- return schema13.setFields(partial);
6229
+ return schema14.setFields(partial);
6230
6230
  }
6231
- if (schema13.type === "array") {
6232
- const nextArray = schema13.optional();
6231
+ if (schema14.type === "array") {
6232
+ const nextArray = schema14.optional();
6233
6233
  if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
6234
6234
  return nextArray;
6235
6235
  }
6236
- if (schema13.type === "tuple") {
6237
- return schema13.optional().clone({
6238
- types: schema13.spec.types.map(deepPartial)
6236
+ if (schema14.type === "tuple") {
6237
+ return schema14.optional().clone({
6238
+ types: schema14.spec.types.map(deepPartial)
6239
6239
  });
6240
6240
  }
6241
- if ("optional" in schema13) {
6242
- return schema13.optional();
6241
+ if ("optional" in schema14) {
6242
+ return schema14.optional();
6243
6243
  }
6244
- return schema13;
6244
+ return schema14;
6245
6245
  }
6246
6246
  var deepHas = (obj, p) => {
6247
6247
  const path = [...(0, import_property_expr.normalizePath)(p)];
@@ -6372,8 +6372,8 @@ var ObjectSchema = class extends Schema {
6372
6372
  next._sortErrors = this._sortErrors;
6373
6373
  return next;
6374
6374
  }
6375
- concat(schema13) {
6376
- let next = super.concat(schema13);
6375
+ concat(schema14) {
6376
+ let next = super.concat(schema14);
6377
6377
  let nextFields = next.fields;
6378
6378
  for (let [field, schemaOrRef] of Object.entries(this.fields)) {
6379
6379
  const target = nextFields[field];
@@ -6381,7 +6381,7 @@ var ObjectSchema = class extends Schema {
6381
6381
  }
6382
6382
  return next.withMutation((s2) => (
6383
6383
  // XXX: excludes here is wrong
6384
- s2.setFields(nextFields, [...this._excludedEdges, ...schema13._excludedEdges])
6384
+ s2.setFields(nextFields, [...this._excludedEdges, ...schema14._excludedEdges])
6385
6385
  ));
6386
6386
  }
6387
6387
  _getDefault(options) {
@@ -6426,8 +6426,8 @@ var ObjectSchema = class extends Schema {
6426
6426
  }
6427
6427
  partial() {
6428
6428
  const partial = {};
6429
- for (const [key, schema13] of Object.entries(this.fields)) {
6430
- partial[key] = "optional" in schema13 && schema13.optional instanceof Function ? schema13.optional() : schema13;
6429
+ for (const [key, schema14] of Object.entries(this.fields)) {
6430
+ partial[key] = "optional" in schema14 && schema14.optional instanceof Function ? schema14.optional() : schema14;
6431
6431
  }
6432
6432
  return this.setFields(partial);
6433
6433
  }
@@ -6629,22 +6629,22 @@ var ArraySchema = class extends Schema {
6629
6629
  json() {
6630
6630
  return this.transform(parseJson);
6631
6631
  }
6632
- concat(schema13) {
6633
- let next = super.concat(schema13);
6632
+ concat(schema14) {
6633
+ let next = super.concat(schema14);
6634
6634
  next.innerType = this.innerType;
6635
- if (schema13.innerType)
6635
+ if (schema14.innerType)
6636
6636
  next.innerType = next.innerType ? (
6637
6637
  // @ts-expect-error Lazy doesn't have concat and will break
6638
- next.innerType.concat(schema13.innerType)
6639
- ) : schema13.innerType;
6638
+ next.innerType.concat(schema14.innerType)
6639
+ ) : schema14.innerType;
6640
6640
  return next;
6641
6641
  }
6642
- of(schema13) {
6642
+ of(schema14) {
6643
6643
  let next = this.clone();
6644
- if (!isSchema(schema13)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema13));
6645
- next.innerType = schema13;
6644
+ if (!isSchema(schema14)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema14));
6645
+ next.innerType = schema14;
6646
6646
  next.spec = Object.assign({}, next.spec, {
6647
- types: schema13
6647
+ types: schema14
6648
6648
  });
6649
6649
  return next;
6650
6650
  }
@@ -6792,7 +6792,7 @@ var TupleSchema = class extends Schema {
6792
6792
  describe(options) {
6793
6793
  const next = (options ? this.resolve(options) : this).clone();
6794
6794
  const base = super.describe(options);
6795
- base.innerType = next.spec.types.map((schema13, index) => {
6795
+ base.innerType = next.spec.types.map((schema14, index) => {
6796
6796
  var _innerOptions;
6797
6797
  let innerOptions = options;
6798
6798
  if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
@@ -6801,7 +6801,7 @@ var TupleSchema = class extends Schema {
6801
6801
  value: innerOptions.value[index]
6802
6802
  });
6803
6803
  }
6804
- return schema13.describe(innerOptions);
6804
+ return schema14.describe(innerOptions);
6805
6805
  });
6806
6806
  return base;
6807
6807
  }
@@ -10207,7 +10207,7 @@ var socialMediaSchema = create$3({
10207
10207
  is: (name) => !!name,
10208
10208
  // If name has a value
10209
10209
  then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
10210
- otherwise: (schema13) => schema13.notRequired()
10210
+ otherwise: (schema14) => schema14.notRequired()
10211
10211
  })
10212
10212
  });
10213
10213
  var globalResourceSchema = create$3().shape({
@@ -10280,21 +10280,21 @@ var paymentInfoSchema = create$3({
10280
10280
  paymentMethod: create$8().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
10281
10281
  accountHolderName: create$6().when("paymentMethod", {
10282
10282
  is: "bank_transfer",
10283
- then: (schema13) => schema13.required("Account holder name is required for bank transfer").trim(),
10284
- otherwise: (schema13) => schema13.notRequired()
10283
+ then: (schema14) => schema14.required("Account holder name is required for bank transfer").trim(),
10284
+ otherwise: (schema14) => schema14.notRequired()
10285
10285
  }),
10286
10286
  accountNumber: create$6().when("paymentMethod", {
10287
10287
  is: "bank_transfer",
10288
- then: (schema13) => schema13.required("Account number is required for bank transfer").matches(
10288
+ then: (schema14) => schema14.required("Account number is required for bank transfer").matches(
10289
10289
  nzBankAccountRegex,
10290
10290
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
10291
10291
  ).trim(),
10292
- otherwise: (schema13) => schema13.notRequired()
10292
+ otherwise: (schema14) => schema14.notRequired()
10293
10293
  }),
10294
10294
  link: create$6().when("paymentMethod", {
10295
10295
  is: (val) => val === "paypal" || val === "stripe",
10296
10296
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
10297
- otherwise: (schema13) => schema13.notRequired()
10297
+ otherwise: (schema14) => schema14.notRequired()
10298
10298
  })
10299
10299
  });
10300
10300
  var eventInfoSchema = create$3().shape({
@@ -10407,8 +10407,8 @@ var userSchema = create$3().shape({
10407
10407
  confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
10408
10408
  is: (val) => !!val,
10409
10409
  // only necessary if password typed
10410
- then: (schema13) => schema13.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10411
- otherwise: (schema13) => schema13.notRequired()
10410
+ then: (schema14) => schema14.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10411
+ otherwise: (schema14) => schema14.notRequired()
10412
10412
  }),
10413
10413
  role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
10414
10414
  });
@@ -10526,8 +10526,8 @@ var testerSchema = create$3().shape({
10526
10526
  email: emailRequiredSchema,
10527
10527
  event: create$3().when("resourceType", {
10528
10528
  is: (resourceType) => resourceType === "event",
10529
- otherwise: (schema13) => schema13.nullable().optional(),
10530
- then: (schema13) => schema13.required("Event information is required").shape(testerEventSchema.fields)
10529
+ otherwise: (schema14) => schema14.nullable().optional(),
10530
+ then: (schema14) => schema14.required("Event information is required").shape(testerEventSchema.fields)
10531
10531
  }),
10532
10532
  firstName: create$6().required("First name is required"),
10533
10533
  lastName: create$6().required("Last name is required"),
@@ -10545,8 +10545,8 @@ var testerSchema = create$3().shape({
10545
10545
  ).required("Resource Type is required"),
10546
10546
  vendor: create$3().when("resourceType", {
10547
10547
  is: (resourceType) => resourceType === "vendor",
10548
- otherwise: (schema13) => schema13.nullable().optional(),
10549
- then: (schema13) => schema13.required("Vendor information is required").shape(testerVendorSchema.fields)
10548
+ otherwise: (schema14) => schema14.nullable().optional(),
10549
+ then: (schema14) => schema14.required("Vendor information is required").shape(testerVendorSchema.fields)
10550
10550
  })
10551
10551
  });
10552
10552
  var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
@@ -10584,7 +10584,7 @@ var adSchema = create$3().shape({
10584
10584
  return endDate > now;
10585
10585
  }).when("start", {
10586
10586
  is: (val) => val && val.length > 0,
10587
- then: (schema13) => schema13.test(
10587
+ then: (schema14) => schema14.test(
10588
10588
  "is-after-start",
10589
10589
  "End date must be after start date",
10590
10590
  function(value) {
@@ -11393,10 +11393,60 @@ ChatSchema.index({
11393
11393
  });
11394
11394
  var ChatModel = import_mongoose8.default.models.Chat || import_mongoose8.default.model("Chat", ChatSchema);
11395
11395
 
11396
- // src/mongoose/ResourceActivity.ts
11396
+ // src/mongoose/GoogleImportedMarket.ts
11397
11397
  var import_mongoose9 = __toESM(require("mongoose"));
11398
11398
  var MongooseSchema8 = import_mongoose9.default.Schema;
11399
- var ActivitySchema = new MongooseSchema8(
11399
+ var locationSchema2 = new MongooseSchema8(
11400
+ {
11401
+ lat: { required: true, type: Number },
11402
+ lng: { required: true, type: Number }
11403
+ },
11404
+ { _id: false }
11405
+ // Prevents Mongoose from creating an additional _id field for subdocuments
11406
+ );
11407
+ var schema5 = new MongooseSchema8(
11408
+ {
11409
+ address: { required: true, type: String },
11410
+ businessStatus: { required: false, type: String },
11411
+ claimed: { default: false, required: true, type: Boolean },
11412
+ googleMapsUrl: { required: false, type: String },
11413
+ googlePlaceId: {
11414
+ required: true,
11415
+ type: String,
11416
+ unique: true
11417
+ // unique, indexed
11418
+ },
11419
+ image: { required: false, type: String },
11420
+ // photo_reference only
11421
+ importedAt: { default: () => /* @__PURE__ */ new Date(), required: true, type: Date },
11422
+ location: {
11423
+ required: false,
11424
+ // optional because lat/lng may expire after 30 days
11425
+ type: locationSchema2
11426
+ },
11427
+ name: { required: true, type: String },
11428
+ openingHours: { required: false, type: [String] },
11429
+ phone: { required: false, type: String },
11430
+ photos: { required: false, type: [String] },
11431
+ // array of photo_reference
11432
+ rating: { required: false, type: Number },
11433
+ reviewCount: { required: false, type: Number },
11434
+ slug: { required: true, type: String },
11435
+ website: { required: false, type: String }
11436
+ },
11437
+ { timestamps: true }
11438
+ );
11439
+ schema5.index({ googlePlaceId: 1 });
11440
+ schema5.index({ name: 1 });
11441
+ schema5.index({ slug: 1 });
11442
+ schema5.index({ address: 1 });
11443
+ schema5.index({ "location.lat": 1, "location.lng": 1 });
11444
+ var GoogleImportedMarketModel = import_mongoose9.default.models.GoogleImportedMarket || import_mongoose9.default.model("GoogleImportedMarket", schema5);
11445
+
11446
+ // src/mongoose/ResourceActivity.ts
11447
+ var import_mongoose10 = __toESM(require("mongoose"));
11448
+ var MongooseSchema9 = import_mongoose10.default.Schema;
11449
+ var ActivitySchema = new MongooseSchema9(
11400
11450
  {
11401
11451
  activityType: {
11402
11452
  enum: Object.values(EnumActivity),
@@ -11432,7 +11482,7 @@ var ActivitySchema = new MongooseSchema8(
11432
11482
  },
11433
11483
  { _id: false }
11434
11484
  );
11435
- var schema5 = new MongooseSchema8(
11485
+ var schema6 = new MongooseSchema9(
11436
11486
  {
11437
11487
  activity: { default: [], type: [ActivitySchema] },
11438
11488
  resourceId: { required: true, type: String },
@@ -11444,14 +11494,14 @@ var schema5 = new MongooseSchema8(
11444
11494
  },
11445
11495
  { timestamps: true }
11446
11496
  );
11447
- schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
11448
- schema5.index({ "views.location": "2dsphere" });
11449
- var ResourceActivityModel = import_mongoose9.default.models.ResourceActivity || import_mongoose9.default.model("ResourceActivity", schema5);
11497
+ schema6.index({ resourceId: 1, resourceType: 1 }, { unique: true });
11498
+ schema6.index({ "views.location": "2dsphere" });
11499
+ var ResourceActivityModel = import_mongoose10.default.models.ResourceActivity || import_mongoose10.default.model("ResourceActivity", schema6);
11450
11500
 
11451
11501
  // src/mongoose/Tester.ts
11452
- var import_mongoose10 = __toESM(require("mongoose"));
11453
- var MongooseSchema9 = import_mongoose10.default.Schema;
11454
- var TesterVendorQuestionarySchema = new MongooseSchema9(
11502
+ var import_mongoose11 = __toESM(require("mongoose"));
11503
+ var MongooseSchema10 = import_mongoose11.default.Schema;
11504
+ var TesterVendorQuestionarySchema = new MongooseSchema10(
11455
11505
  {
11456
11506
  appearInVideoIntroduction: {
11457
11507
  default: false,
@@ -11478,7 +11528,7 @@ var TesterVendorQuestionarySchema = new MongooseSchema9(
11478
11528
  },
11479
11529
  { _id: false }
11480
11530
  );
11481
- var TesterVendorSchema = new MongooseSchema9(
11531
+ var TesterVendorSchema = new MongooseSchema10(
11482
11532
  {
11483
11533
  categories: { required: true, type: [CategorySchema] },
11484
11534
  marketsAttended: {
@@ -11504,7 +11554,7 @@ var TesterVendorSchema = new MongooseSchema9(
11504
11554
  },
11505
11555
  { _id: false }
11506
11556
  );
11507
- var TesterEventQuestionarySchema = new MongooseSchema9(
11557
+ var TesterEventQuestionarySchema = new MongooseSchema10(
11508
11558
  {
11509
11559
  allowMarketingAppearance: {
11510
11560
  default: false,
@@ -11539,7 +11589,7 @@ var TesterEventQuestionarySchema = new MongooseSchema9(
11539
11589
  },
11540
11590
  { _id: false }
11541
11591
  );
11542
- var TesterEventsSchema = new MongooseSchema9(
11592
+ var TesterEventsSchema = new MongooseSchema10(
11543
11593
  {
11544
11594
  markets: {
11545
11595
  required: true,
@@ -11568,7 +11618,7 @@ var TesterEventsSchema = new MongooseSchema9(
11568
11618
  },
11569
11619
  { _id: false }
11570
11620
  );
11571
- var TesterSchema = new MongooseSchema9(
11621
+ var TesterSchema = new MongooseSchema10(
11572
11622
  {
11573
11623
  active: { default: false, required: true, type: Boolean },
11574
11624
  approved: { default: false, required: true, type: Boolean },
@@ -11602,43 +11652,43 @@ var TesterSchema = new MongooseSchema9(
11602
11652
  timestamps: true
11603
11653
  }
11604
11654
  );
11605
- var TesterModel = import_mongoose10.default.models.Tester || import_mongoose10.default.model("Tester", TesterSchema);
11655
+ var TesterModel = import_mongoose11.default.models.Tester || import_mongoose11.default.model("Tester", TesterSchema);
11606
11656
 
11607
11657
  // src/mongoose/User.ts
11608
- var import_mongoose11 = __toESM(require("mongoose"));
11609
- var MongooseSchema10 = import_mongoose11.default.Schema;
11610
- var userActivityEventSchema = new MongooseSchema10(
11658
+ var import_mongoose12 = __toESM(require("mongoose"));
11659
+ var MongooseSchema11 = import_mongoose12.default.Schema;
11660
+ var userActivityEventSchema = new MongooseSchema11(
11611
11661
  {
11612
11662
  dateTime: dateTimeSchema3,
11613
11663
  resourceId: {
11614
11664
  ref: "Event",
11615
11665
  required: false,
11616
- type: import_mongoose11.default.Schema.Types.ObjectId
11666
+ type: import_mongoose12.default.Schema.Types.ObjectId
11617
11667
  }
11618
11668
  },
11619
11669
  { _id: false }
11620
11670
  );
11621
- var userActivityFavouritesSchema = new MongooseSchema10(
11671
+ var userActivityFavouritesSchema = new MongooseSchema11(
11622
11672
  {
11623
11673
  events: {
11624
11674
  ref: "Event",
11625
11675
  required: false,
11626
- type: [import_mongoose11.default.Schema.Types.ObjectId]
11676
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
11627
11677
  },
11628
11678
  partners: {
11629
11679
  ref: "Partner",
11630
11680
  required: false,
11631
- type: [import_mongoose11.default.Schema.Types.ObjectId]
11681
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
11632
11682
  },
11633
11683
  vendors: {
11634
11684
  ref: "Vendor",
11635
11685
  required: false,
11636
- type: [import_mongoose11.default.Schema.Types.ObjectId]
11686
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
11637
11687
  }
11638
11688
  },
11639
11689
  { _id: false }
11640
11690
  );
11641
- var stripeSchema = new MongooseSchema10(
11691
+ var stripeSchema = new MongooseSchema11(
11642
11692
  {
11643
11693
  currentPlan: {
11644
11694
  enum: Object.values(EnumUserLicence),
@@ -11669,7 +11719,7 @@ var stripeSchema = new MongooseSchema10(
11669
11719
  },
11670
11720
  { _id: false }
11671
11721
  );
11672
- var schema6 = new MongooseSchema10(
11722
+ var schema7 = new MongooseSchema11(
11673
11723
  {
11674
11724
  active: { default: false, required: true, type: Boolean },
11675
11725
  associates: {
@@ -11685,7 +11735,7 @@ var schema6 = new MongooseSchema10(
11685
11735
  events: {
11686
11736
  ref: "Event",
11687
11737
  required: false,
11688
- type: [import_mongoose11.default.Schema.Types.ObjectId]
11738
+ type: [import_mongoose12.default.Schema.Types.ObjectId]
11689
11739
  },
11690
11740
  firstName: { required: true, type: String },
11691
11741
  isTester: { default: false, required: true, type: Boolean },
@@ -11697,7 +11747,7 @@ var schema6 = new MongooseSchema10(
11697
11747
  partner: {
11698
11748
  ref: "Partner",
11699
11749
  required: false,
11700
- type: import_mongoose11.default.Schema.Types.ObjectId
11750
+ type: import_mongoose12.default.Schema.Types.ObjectId
11701
11751
  },
11702
11752
  password: { required: true, type: String },
11703
11753
  platform: {
@@ -11742,20 +11792,20 @@ var schema6 = new MongooseSchema10(
11742
11792
  vendor: {
11743
11793
  ref: "Vendor",
11744
11794
  required: false,
11745
- type: import_mongoose11.default.Schema.Types.ObjectId
11795
+ type: import_mongoose12.default.Schema.Types.ObjectId
11746
11796
  }
11747
11797
  },
11748
11798
  { strict: false, timestamps: true }
11749
11799
  );
11750
- schema6.index({ "associates.email": 1 });
11751
- schema6.index({ "licences.expiryDate": 1 });
11752
- schema6.index({ "licences.licenceType": 1 });
11753
- var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema6);
11800
+ schema7.index({ "associates.email": 1 });
11801
+ schema7.index({ "licences.expiryDate": 1 });
11802
+ schema7.index({ "licences.licenceType": 1 });
11803
+ var UserModel = import_mongoose12.default.models.User || import_mongoose12.default.model("User", schema7);
11754
11804
 
11755
11805
  // src/mongoose/VerificationToken.ts
11756
- var import_mongoose12 = __toESM(require("mongoose"));
11757
- var MongooseSchema11 = import_mongoose12.default.Schema;
11758
- var schema7 = new MongooseSchema11(
11806
+ var import_mongoose13 = __toESM(require("mongoose"));
11807
+ var MongooseSchema12 = import_mongoose13.default.Schema;
11808
+ var schema8 = new MongooseSchema12(
11759
11809
  {
11760
11810
  createdAt: {
11761
11811
  default: Date.now,
@@ -11770,12 +11820,12 @@ var schema7 = new MongooseSchema11(
11770
11820
  },
11771
11821
  { timestamps: true }
11772
11822
  );
11773
- var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema7);
11823
+ var VerificationTokenModel = import_mongoose13.default.models.VerificationToken || import_mongoose13.default.model("VerificationToken", schema8);
11774
11824
 
11775
11825
  // src/mongoose/vendor/Vendor.ts
11776
- var import_mongoose13 = __toESM(require("mongoose"));
11777
- var MongooseSchema12 = import_mongoose13.default.Schema;
11778
- var MenuTypeSchema = new MongooseSchema12(
11826
+ var import_mongoose14 = __toESM(require("mongoose"));
11827
+ var MongooseSchema13 = import_mongoose14.default.Schema;
11828
+ var MenuTypeSchema = new MongooseSchema13(
11779
11829
  {
11780
11830
  description: { required: false, type: String },
11781
11831
  name: { required: false, type: String },
@@ -11785,7 +11835,7 @@ var MenuTypeSchema = new MongooseSchema12(
11785
11835
  { _id: false }
11786
11836
  // Prevents Mongoose from creating an additional _id field for subdocuments
11787
11837
  );
11788
- var LocationsSchema = new MongooseSchema12(
11838
+ var LocationsSchema = new MongooseSchema13(
11789
11839
  {
11790
11840
  dateTime: {
11791
11841
  dateStatus: {
@@ -11818,7 +11868,7 @@ var LocationsSchema = new MongooseSchema12(
11818
11868
  { _id: false }
11819
11869
  // Prevents Mongoose from creating an additional _id field for subdocuments
11820
11870
  );
11821
- var schema8 = new MongooseSchema12(
11871
+ var schema9 = new MongooseSchema13(
11822
11872
  {
11823
11873
  ...baseResourceFields,
11824
11874
  // Importing base resource fields from global.ts
@@ -11840,7 +11890,7 @@ var schema8 = new MongooseSchema12(
11840
11890
  vendorInfoId: {
11841
11891
  ref: "VendorInfo",
11842
11892
  required: false,
11843
- type: import_mongoose13.default.Schema.Types.ObjectId
11893
+ type: import_mongoose14.default.Schema.Types.ObjectId
11844
11894
  },
11845
11895
  vendorType: {
11846
11896
  enum: Object.values(EnumVendorType),
@@ -11850,24 +11900,24 @@ var schema8 = new MongooseSchema12(
11850
11900
  },
11851
11901
  { timestamps: true }
11852
11902
  );
11853
- schema8.index({ name: 1 });
11854
- schema8.index({ description: 1 });
11855
- schema8.index({ region: 1 });
11856
- schema8.index({ "categories.name": 1 });
11857
- schema8.index({ "associates.email": 1 });
11858
- var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema8);
11903
+ schema9.index({ name: 1 });
11904
+ schema9.index({ description: 1 });
11905
+ schema9.index({ region: 1 });
11906
+ schema9.index({ "categories.name": 1 });
11907
+ schema9.index({ "associates.email": 1 });
11908
+ var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema9);
11859
11909
 
11860
11910
  // src/mongoose/vendor/VendorInfo.ts
11861
- var import_mongoose14 = __toESM(require("mongoose"));
11862
- var MongooseSchema13 = import_mongoose14.default.Schema;
11863
- var AttributesSchema = new MongooseSchema13(
11911
+ var import_mongoose15 = __toESM(require("mongoose"));
11912
+ var MongooseSchema14 = import_mongoose15.default.Schema;
11913
+ var AttributesSchema = new MongooseSchema14(
11864
11914
  {
11865
11915
  details: { required: false, type: String },
11866
11916
  isRequired: { default: false, required: true, type: Boolean }
11867
11917
  },
11868
11918
  { _id: false }
11869
11919
  );
11870
- var schema9 = new MongooseSchema13(
11920
+ var schema10 = new MongooseSchema14(
11871
11921
  {
11872
11922
  compliance: {
11873
11923
  foodBeverageLicense: { default: false, required: false, type: Boolean },
@@ -11901,17 +11951,17 @@ var schema9 = new MongooseSchema13(
11901
11951
  vendorId: {
11902
11952
  ref: "Vendor",
11903
11953
  required: true,
11904
- type: import_mongoose14.default.Schema.Types.ObjectId
11954
+ type: import_mongoose15.default.Schema.Types.ObjectId
11905
11955
  }
11906
11956
  },
11907
11957
  { timestamps: true }
11908
11958
  );
11909
- var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema9);
11959
+ var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema10);
11910
11960
 
11911
11961
  // src/mongoose/event/Event.ts
11912
- var import_mongoose15 = __toESM(require("mongoose"));
11913
- var MongooseSchema14 = import_mongoose15.default.Schema;
11914
- var locationsSchema = new MongooseSchema14(
11962
+ var import_mongoose16 = __toESM(require("mongoose"));
11963
+ var MongooseSchema15 = import_mongoose16.default.Schema;
11964
+ var locationsSchema = new MongooseSchema15(
11915
11965
  {
11916
11966
  city: { required: true, type: String },
11917
11967
  coordinates: {
@@ -11934,7 +11984,7 @@ var locationsSchema = new MongooseSchema14(
11934
11984
  { _id: false }
11935
11985
  // Prevents Mongoose from creating an additional _id field for subdocuments
11936
11986
  );
11937
- var schema10 = new MongooseSchema14(
11987
+ var schema11 = new MongooseSchema15(
11938
11988
  {
11939
11989
  ...baseResourceFields,
11940
11990
  // Importing base resource fields from global.ts
@@ -11942,7 +11992,7 @@ var schema10 = new MongooseSchema14(
11942
11992
  eventInfoId: {
11943
11993
  ref: "EventInfo",
11944
11994
  required: false,
11945
- type: import_mongoose15.default.Schema.Types.ObjectId
11995
+ type: import_mongoose16.default.Schema.Types.ObjectId
11946
11996
  },
11947
11997
  eventType: {
11948
11998
  enum: Object.values(EnumEventType),
@@ -11965,18 +12015,18 @@ var schema10 = new MongooseSchema14(
11965
12015
  },
11966
12016
  { timestamps: true }
11967
12017
  );
11968
- schema10.index({ name: 1 });
11969
- schema10.index({ description: 1 });
11970
- schema10.index({ region: 1 });
11971
- schema10.index({ location: "2dsphere" });
11972
- schema10.index({ tags: 1 });
11973
- schema10.index({ "associates.email": 1 });
11974
- var EventModel = import_mongoose15.default.models.Event || import_mongoose15.default.model("Event", schema10);
12018
+ schema11.index({ name: 1 });
12019
+ schema11.index({ description: 1 });
12020
+ schema11.index({ region: 1 });
12021
+ schema11.index({ location: "2dsphere" });
12022
+ schema11.index({ tags: 1 });
12023
+ schema11.index({ "associates.email": 1 });
12024
+ var EventModel = import_mongoose16.default.models.Event || import_mongoose16.default.model("Event", schema11);
11975
12025
 
11976
12026
  // src/mongoose/Partner.ts
11977
- var import_mongoose16 = __toESM(require("mongoose"));
11978
- var MongooseSchema15 = import_mongoose16.default.Schema;
11979
- var schema11 = new MongooseSchema15(
12027
+ var import_mongoose17 = __toESM(require("mongoose"));
12028
+ var MongooseSchema16 = import_mongoose17.default.Schema;
12029
+ var schema12 = new MongooseSchema16(
11980
12030
  {
11981
12031
  ...baseResourceFields,
11982
12032
  location: {
@@ -11992,19 +12042,19 @@ var schema11 = new MongooseSchema15(
11992
12042
  },
11993
12043
  { timestamps: true }
11994
12044
  );
11995
- schema11.index({ name: 1 });
11996
- schema11.index({ description: 1 });
11997
- schema11.index({ region: 1 });
11998
- schema11.index({ location: "2dsphere" });
11999
- schema11.index({ "associates.email": 1 });
12000
- var PartnerModel = import_mongoose16.default.models.Partner || import_mongoose16.default.model("Partner", schema11);
12045
+ schema12.index({ name: 1 });
12046
+ schema12.index({ description: 1 });
12047
+ schema12.index({ region: 1 });
12048
+ schema12.index({ location: "2dsphere" });
12049
+ schema12.index({ "associates.email": 1 });
12050
+ var PartnerModel = import_mongoose17.default.models.Partner || import_mongoose17.default.model("Partner", schema12);
12001
12051
 
12002
12052
  // src/mongoose/Post.ts
12003
- var import_mongoose17 = __toESM(require("mongoose"));
12004
- var MongooseSchema16 = import_mongoose17.default.Schema;
12005
- var contentSchema = new MongooseSchema16(
12053
+ var import_mongoose18 = __toESM(require("mongoose"));
12054
+ var MongooseSchema17 = import_mongoose18.default.Schema;
12055
+ var contentSchema = new MongooseSchema17(
12006
12056
  {
12007
- contentData: import_mongoose17.Schema.Types.Mixed,
12057
+ contentData: import_mongoose18.Schema.Types.Mixed,
12008
12058
  contentOrder: { required: true, type: Number },
12009
12059
  contentType: {
12010
12060
  enum: Object.values(EnumPostContentType),
@@ -12014,7 +12064,7 @@ var contentSchema = new MongooseSchema16(
12014
12064
  },
12015
12065
  { _id: false }
12016
12066
  );
12017
- var schema12 = new MongooseSchema16(
12067
+ var schema13 = new MongooseSchema17(
12018
12068
  {
12019
12069
  active: { default: true, required: true, type: Boolean },
12020
12070
  caption: { required: true, type: String },
@@ -12029,15 +12079,15 @@ var schema12 = new MongooseSchema16(
12029
12079
  },
12030
12080
  { timestamps: true }
12031
12081
  );
12032
- schema12.index({ title: 1 });
12033
- schema12.index({ tags: 1 });
12034
- var PostModel = import_mongoose17.default.models.Post || import_mongoose17.default.model("Post", schema12);
12082
+ schema13.index({ title: 1 });
12083
+ schema13.index({ tags: 1 });
12084
+ var PostModel = import_mongoose18.default.models.Post || import_mongoose18.default.model("Post", schema13);
12035
12085
 
12036
12086
  // src/mongoose/AppSetting.ts
12037
- var import_mongoose18 = __toESM(require("mongoose"));
12038
- var MongooseSchema17 = import_mongoose18.default.Schema;
12087
+ var import_mongoose19 = __toESM(require("mongoose"));
12088
+ var MongooseSchema18 = import_mongoose19.default.Schema;
12039
12089
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
12040
- var AppSettingSchema = new MongooseSchema17(
12090
+ var AppSettingSchema = new MongooseSchema18(
12041
12091
  {
12042
12092
  appVersion: { default: "1.0.1", required: true, type: String },
12043
12093
  key: {
@@ -12052,7 +12102,7 @@ var AppSettingSchema = new MongooseSchema17(
12052
12102
  },
12053
12103
  { timestamps: true }
12054
12104
  );
12055
- var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mongoose18.default.model("AppSetting", AppSettingSchema);
12105
+ var AppSettingModel = import_mongoose19.default.models.AppSetting || import_mongoose19.default.model("AppSetting", AppSettingSchema);
12056
12106
 
12057
12107
  // src/service/updateAdStatus.ts
12058
12108
  async function updateAdStatuses() {