@timardex/cluemart-server-shared 1.0.164 → 1.0.166

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/index.mjs CHANGED
@@ -4677,10 +4677,10 @@ var Condition = class _Condition {
4677
4677
  otherwise
4678
4678
  } = config;
4679
4679
  let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
4680
- return new _Condition(refs, (values, schema16) => {
4680
+ return new _Condition(refs, (values, schema17) => {
4681
4681
  var _branch;
4682
4682
  let branch = check(...values) ? then : otherwise;
4683
- return (_branch = branch == null ? void 0 : branch(schema16)) != null ? _branch : schema16;
4683
+ return (_branch = branch == null ? void 0 : branch(schema17)) != null ? _branch : schema17;
4684
4684
  });
4685
4685
  }
4686
4686
  constructor(refs, builder) {
@@ -4694,13 +4694,13 @@ var Condition = class _Condition {
4694
4694
  // TODO: ? operator here?
4695
4695
  ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
4696
4696
  ));
4697
- let schema16 = this.fn(values, base, options);
4698
- if (schema16 === void 0 || // @ts-ignore this can be base
4699
- schema16 === base) {
4697
+ let schema17 = this.fn(values, base, options);
4698
+ if (schema17 === void 0 || // @ts-ignore this can be base
4699
+ schema17 === base) {
4700
4700
  return base;
4701
4701
  }
4702
- if (!isSchema(schema16)) throw new TypeError("conditions must return a schema object");
4703
- return schema16.resolve(options);
4702
+ if (!isSchema(schema17)) throw new TypeError("conditions must return a schema object");
4703
+ return schema17.resolve(options);
4704
4704
  }
4705
4705
  };
4706
4706
  var prefixes = {
@@ -4770,7 +4770,7 @@ function createValidation(config) {
4770
4770
  path = "",
4771
4771
  options,
4772
4772
  originalValue,
4773
- schema: schema16
4773
+ schema: schema17
4774
4774
  }, panic, next) {
4775
4775
  const {
4776
4776
  name,
@@ -4782,8 +4782,8 @@ function createValidation(config) {
4782
4782
  let {
4783
4783
  parent,
4784
4784
  context,
4785
- abortEarly = schema16.spec.abortEarly,
4786
- disableStackTrace = schema16.spec.disableStackTrace
4785
+ abortEarly = schema17.spec.abortEarly,
4786
+ disableStackTrace = schema17.spec.disableStackTrace
4787
4787
  } = options;
4788
4788
  function resolve(item) {
4789
4789
  return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
@@ -4792,9 +4792,9 @@ function createValidation(config) {
4792
4792
  const nextParams = Object.assign({
4793
4793
  value,
4794
4794
  originalValue,
4795
- label: schema16.spec.label,
4795
+ label: schema17.spec.label,
4796
4796
  path: overrides.path || path,
4797
- spec: schema16.spec,
4797
+ spec: schema17.spec,
4798
4798
  disableStackTrace: overrides.disableStackTrace || disableStackTrace
4799
4799
  }, params, overrides.params);
4800
4800
  for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
@@ -4812,7 +4812,7 @@ function createValidation(config) {
4812
4812
  resolve,
4813
4813
  options,
4814
4814
  originalValue,
4815
- schema: schema16
4815
+ schema: schema17
4816
4816
  };
4817
4817
  const handleResult = (validOrError) => {
4818
4818
  if (ValidationError.isError(validOrError)) invalid(validOrError);
@@ -4846,42 +4846,42 @@ function createValidation(config) {
4846
4846
  validate.OPTIONS = config;
4847
4847
  return validate;
4848
4848
  }
4849
- function getIn(schema16, path, value, context = value) {
4849
+ function getIn(schema17, path, value, context = value) {
4850
4850
  let parent, lastPart, lastPartDebug;
4851
4851
  if (!path) return {
4852
4852
  parent,
4853
4853
  parentPath: path,
4854
- schema: schema16
4854
+ schema: schema17
4855
4855
  };
4856
4856
  (0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
4857
4857
  let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
4858
- schema16 = schema16.resolve({
4858
+ schema17 = schema17.resolve({
4859
4859
  context,
4860
4860
  parent,
4861
4861
  value
4862
4862
  });
4863
- let isTuple = schema16.type === "tuple";
4863
+ let isTuple = schema17.type === "tuple";
4864
4864
  let idx = isArray ? parseInt(part, 10) : 0;
4865
- if (schema16.innerType || isTuple) {
4865
+ if (schema17.innerType || isTuple) {
4866
4866
  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]"`);
4867
4867
  if (value && idx >= value.length) {
4868
4868
  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. `);
4869
4869
  }
4870
4870
  parent = value;
4871
4871
  value = value && value[idx];
4872
- schema16 = isTuple ? schema16.spec.types[idx] : schema16.innerType;
4872
+ schema17 = isTuple ? schema17.spec.types[idx] : schema17.innerType;
4873
4873
  }
4874
4874
  if (!isArray) {
4875
- if (!schema16.fields || !schema16.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema16.type}")`);
4875
+ if (!schema17.fields || !schema17.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema17.type}")`);
4876
4876
  parent = value;
4877
4877
  value = value && value[part];
4878
- schema16 = schema16.fields[part];
4878
+ schema17 = schema17.fields[part];
4879
4879
  }
4880
4880
  lastPart = part;
4881
4881
  lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
4882
4882
  });
4883
4883
  return {
4884
- schema: schema16,
4884
+ schema: schema17,
4885
4885
  parent,
4886
4886
  parentPath: lastPart
4887
4887
  };
@@ -5018,20 +5018,20 @@ var Schema = class {
5018
5018
  this._mutate = before;
5019
5019
  return result;
5020
5020
  }
5021
- concat(schema16) {
5022
- if (!schema16 || schema16 === this) return this;
5023
- if (schema16.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema16.type}`);
5021
+ concat(schema17) {
5022
+ if (!schema17 || schema17 === this) return this;
5023
+ if (schema17.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema17.type}`);
5024
5024
  let base = this;
5025
- let combined = schema16.clone();
5025
+ let combined = schema17.clone();
5026
5026
  const mergedSpec = Object.assign({}, base.spec, combined.spec);
5027
5027
  combined.spec = mergedSpec;
5028
5028
  combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
5029
- combined._whitelist = base._whitelist.merge(schema16._whitelist, schema16._blacklist);
5030
- combined._blacklist = base._blacklist.merge(schema16._blacklist, schema16._whitelist);
5029
+ combined._whitelist = base._whitelist.merge(schema17._whitelist, schema17._blacklist);
5030
+ combined._blacklist = base._blacklist.merge(schema17._blacklist, schema17._whitelist);
5031
5031
  combined.tests = base.tests;
5032
5032
  combined.exclusiveTests = base.exclusiveTests;
5033
5033
  combined.withMutation((next) => {
5034
- schema16.tests.forEach((fn) => {
5034
+ schema17.tests.forEach((fn) => {
5035
5035
  next.test(fn.OPTIONS);
5036
5036
  });
5037
5037
  });
@@ -5047,15 +5047,15 @@ var Schema = class {
5047
5047
  return this._typeCheck(v);
5048
5048
  }
5049
5049
  resolve(options) {
5050
- let schema16 = this;
5051
- if (schema16.conditions.length) {
5052
- let conditions = schema16.conditions;
5053
- schema16 = schema16.clone();
5054
- schema16.conditions = [];
5055
- schema16 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema16);
5056
- schema16 = schema16.resolve(options);
5050
+ let schema17 = this;
5051
+ if (schema17.conditions.length) {
5052
+ let conditions = schema17.conditions;
5053
+ schema17 = schema17.clone();
5054
+ schema17.conditions = [];
5055
+ schema17 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema17);
5056
+ schema17 = schema17.resolve(options);
5057
5057
  }
5058
- return schema16;
5058
+ return schema17;
5059
5059
  }
5060
5060
  resolveOptions(options) {
5061
5061
  var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
@@ -5209,11 +5209,11 @@ attempted value: ${formattedValue}
5209
5209
  }
5210
5210
  validate(value, options) {
5211
5211
  var _options$disableStack2;
5212
- let schema16 = this.resolve(Object.assign({}, options, {
5212
+ let schema17 = this.resolve(Object.assign({}, options, {
5213
5213
  value
5214
5214
  }));
5215
- let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema16.spec.disableStackTrace;
5216
- return new Promise((resolve, reject) => schema16._validate(value, options, (error, parsed) => {
5215
+ let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema17.spec.disableStackTrace;
5216
+ return new Promise((resolve, reject) => schema17._validate(value, options, (error, parsed) => {
5217
5217
  if (ValidationError.isError(error)) error.value = parsed;
5218
5218
  reject(error);
5219
5219
  }, (errors, validated) => {
@@ -5223,12 +5223,12 @@ attempted value: ${formattedValue}
5223
5223
  }
5224
5224
  validateSync(value, options) {
5225
5225
  var _options$disableStack3;
5226
- let schema16 = this.resolve(Object.assign({}, options, {
5226
+ let schema17 = this.resolve(Object.assign({}, options, {
5227
5227
  value
5228
5228
  }));
5229
5229
  let result;
5230
- let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema16.spec.disableStackTrace;
5231
- schema16._validate(value, Object.assign({}, options, {
5230
+ let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema17.spec.disableStackTrace;
5231
+ schema17._validate(value, Object.assign({}, options, {
5232
5232
  sync: true
5233
5233
  }), (error, parsed) => {
5234
5234
  if (ValidationError.isError(error)) error.value = parsed;
@@ -5262,8 +5262,8 @@ attempted value: ${formattedValue}
5262
5262
  return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
5263
5263
  }
5264
5264
  getDefault(options) {
5265
- let schema16 = this.resolve(options || {});
5266
- return schema16._getDefault(options);
5265
+ let schema17 = this.resolve(options || {});
5266
+ return schema17._getDefault(options);
5267
5267
  }
5268
5268
  default(def) {
5269
5269
  if (arguments.length === 0) {
@@ -5498,9 +5498,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
5498
5498
  const {
5499
5499
  parent,
5500
5500
  parentPath,
5501
- schema: schema16
5501
+ schema: schema17
5502
5502
  } = getIn(this, path, value, options.context);
5503
- return schema16[method](parent && parent[parentPath], Object.assign({}, options, {
5503
+ return schema17[method](parent && parent[parentPath], Object.assign({}, options, {
5504
5504
  parent,
5505
5505
  path
5506
5506
  }));
@@ -5674,7 +5674,7 @@ var StringSchema = class extends Schema {
5674
5674
  });
5675
5675
  }
5676
5676
  required(message) {
5677
- return super.required(message).withMutation((schema16) => schema16.test({
5677
+ return super.required(message).withMutation((schema17) => schema17.test({
5678
5678
  message: message || mixed.required,
5679
5679
  name: "required",
5680
5680
  skipAbsent: true,
@@ -5682,9 +5682,9 @@ var StringSchema = class extends Schema {
5682
5682
  }));
5683
5683
  }
5684
5684
  notRequired() {
5685
- return super.notRequired().withMutation((schema16) => {
5686
- schema16.tests = schema16.tests.filter((t) => t.OPTIONS.name !== "required");
5687
- return schema16;
5685
+ return super.notRequired().withMutation((schema17) => {
5686
+ schema17.tests = schema17.tests.filter((t) => t.OPTIONS.name !== "required");
5687
+ return schema17;
5688
5688
  });
5689
5689
  }
5690
5690
  length(length, message = string.length) {
@@ -6073,28 +6073,28 @@ var parseJson = (value, _, ctx) => {
6073
6073
  }
6074
6074
  return ctx.isType(parsed) ? parsed : value;
6075
6075
  };
6076
- function deepPartial(schema16) {
6077
- if ("fields" in schema16) {
6076
+ function deepPartial(schema17) {
6077
+ if ("fields" in schema17) {
6078
6078
  const partial = {};
6079
- for (const [key, fieldSchema] of Object.entries(schema16.fields)) {
6079
+ for (const [key, fieldSchema] of Object.entries(schema17.fields)) {
6080
6080
  partial[key] = deepPartial(fieldSchema);
6081
6081
  }
6082
- return schema16.setFields(partial);
6082
+ return schema17.setFields(partial);
6083
6083
  }
6084
- if (schema16.type === "array") {
6085
- const nextArray = schema16.optional();
6084
+ if (schema17.type === "array") {
6085
+ const nextArray = schema17.optional();
6086
6086
  if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
6087
6087
  return nextArray;
6088
6088
  }
6089
- if (schema16.type === "tuple") {
6090
- return schema16.optional().clone({
6091
- types: schema16.spec.types.map(deepPartial)
6089
+ if (schema17.type === "tuple") {
6090
+ return schema17.optional().clone({
6091
+ types: schema17.spec.types.map(deepPartial)
6092
6092
  });
6093
6093
  }
6094
- if ("optional" in schema16) {
6095
- return schema16.optional();
6094
+ if ("optional" in schema17) {
6095
+ return schema17.optional();
6096
6096
  }
6097
- return schema16;
6097
+ return schema17;
6098
6098
  }
6099
6099
  var deepHas = (obj, p) => {
6100
6100
  const path = [...(0, import_property_expr.normalizePath)(p)];
@@ -6228,8 +6228,8 @@ var ObjectSchema = class extends Schema {
6228
6228
  next._sortErrors = this._sortErrors;
6229
6229
  return next;
6230
6230
  }
6231
- concat(schema16) {
6232
- let next = super.concat(schema16);
6231
+ concat(schema17) {
6232
+ let next = super.concat(schema17);
6233
6233
  let nextFields = next.fields;
6234
6234
  for (let [field, schemaOrRef] of Object.entries(this.fields)) {
6235
6235
  const target = nextFields[field];
@@ -6237,7 +6237,7 @@ var ObjectSchema = class extends Schema {
6237
6237
  }
6238
6238
  return next.withMutation((s) => (
6239
6239
  // XXX: excludes here is wrong
6240
- s.setFields(nextFields, [...this._excludedEdges, ...schema16._excludedEdges])
6240
+ s.setFields(nextFields, [...this._excludedEdges, ...schema17._excludedEdges])
6241
6241
  ));
6242
6242
  }
6243
6243
  _getDefault(options) {
@@ -6282,8 +6282,8 @@ var ObjectSchema = class extends Schema {
6282
6282
  }
6283
6283
  partial() {
6284
6284
  const partial = {};
6285
- for (const [key, schema16] of Object.entries(this.fields)) {
6286
- partial[key] = "optional" in schema16 && schema16.optional instanceof Function ? schema16.optional() : schema16;
6285
+ for (const [key, schema17] of Object.entries(this.fields)) {
6286
+ partial[key] = "optional" in schema17 && schema17.optional instanceof Function ? schema17.optional() : schema17;
6287
6287
  }
6288
6288
  return this.setFields(partial);
6289
6289
  }
@@ -6481,22 +6481,22 @@ var ArraySchema = class extends Schema {
6481
6481
  json() {
6482
6482
  return this.transform(parseJson);
6483
6483
  }
6484
- concat(schema16) {
6485
- let next = super.concat(schema16);
6484
+ concat(schema17) {
6485
+ let next = super.concat(schema17);
6486
6486
  next.innerType = this.innerType;
6487
- if (schema16.innerType)
6487
+ if (schema17.innerType)
6488
6488
  next.innerType = next.innerType ? (
6489
6489
  // @ts-expect-error Lazy doesn't have concat and will break
6490
- next.innerType.concat(schema16.innerType)
6491
- ) : schema16.innerType;
6490
+ next.innerType.concat(schema17.innerType)
6491
+ ) : schema17.innerType;
6492
6492
  return next;
6493
6493
  }
6494
- of(schema16) {
6494
+ of(schema17) {
6495
6495
  let next = this.clone();
6496
- if (!isSchema(schema16)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema16));
6497
- next.innerType = schema16;
6496
+ if (!isSchema(schema17)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema17));
6497
+ next.innerType = schema17;
6498
6498
  next.spec = Object.assign({}, next.spec, {
6499
- types: schema16
6499
+ types: schema17
6500
6500
  });
6501
6501
  return next;
6502
6502
  }
@@ -6640,7 +6640,7 @@ var TupleSchema = class extends Schema {
6640
6640
  describe(options) {
6641
6641
  const next = (options ? this.resolve(options) : this).clone();
6642
6642
  const base = super.describe(options);
6643
- base.innerType = next.spec.types.map((schema16, index) => {
6643
+ base.innerType = next.spec.types.map((schema17, index) => {
6644
6644
  var _innerOptions;
6645
6645
  let innerOptions = options;
6646
6646
  if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
@@ -6649,7 +6649,7 @@ var TupleSchema = class extends Schema {
6649
6649
  value: innerOptions.value[index]
6650
6650
  });
6651
6651
  }
6652
- return schema16.describe(innerOptions);
6652
+ return schema17.describe(innerOptions);
6653
6653
  });
6654
6654
  return base;
6655
6655
  }
@@ -8491,21 +8491,6 @@ var EVENT_LIST_ITEM = gql`
8491
8491
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
8492
8492
  ${RELATION_DATES_FRAGMENT}
8493
8493
  `;
8494
- var UNREGISTERED_VENDOR_LIST_ITEM_FIELDS_FRAGMENT = gql`
8495
- fragment UnregisteredVendorListItemFields on UnregisteredVendorListItemType {
8496
- _id
8497
- categoryIds
8498
- email
8499
- invitations {
8500
- dateTime {
8501
- ...DateTimeFields
8502
- }
8503
- eventId
8504
- }
8505
- name
8506
- }
8507
- ${DATETIME_FIELDS_FRAGMENT}
8508
- `;
8509
8494
  var EVENT_INFO = gql`
8510
8495
  fragment EventInfoFields on EventInfoType {
8511
8496
  _id
@@ -8829,12 +8814,10 @@ var VENDOR_INFO = gql`
8829
8814
  `;
8830
8815
  var UNREGISTERED_VENDOR_INVITATION_FRAGMENT = gql`
8831
8816
  fragment UnregisteredVendorInvitationFields on UnregisteredVendorInvitationType {
8832
- invitations {
8833
- dateTime {
8834
- ...DateTimeFields
8835
- }
8836
- eventId
8817
+ dateTime {
8818
+ ...DateTimeFields
8837
8819
  }
8820
+ inviterId
8838
8821
  }
8839
8822
  ${DATETIME_FIELDS_FRAGMENT}
8840
8823
  `;
@@ -10542,7 +10525,7 @@ var stallTypesSchema = create$3({
10542
10525
  "",
10543
10526
  noLeadingZeros("Stall price", { allowDecimal: true })
10544
10527
  ),
10545
- stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(1, "Stall capacity must be at least 1").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
10528
+ stallCapacity: create$5().label("Stall Capacity").typeError("Stall capacity must be a number").min(0, "Stall capacity cannot be negative").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
10546
10529
  });
10547
10530
  var dateTimeWithPriceSchema = dateTimeSchema.shape({
10548
10531
  stallTypes: create$2().of(stallTypesSchema).min(1, "At least one stall type is required").required("Stall types are required")
@@ -10569,7 +10552,7 @@ var socialMediaSchema = create$3({
10569
10552
  is: (name) => !!name,
10570
10553
  // If name has a value
10571
10554
  then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
10572
- otherwise: (schema16) => schema16.notRequired()
10555
+ otherwise: (schema17) => schema17.notRequired()
10573
10556
  })
10574
10557
  });
10575
10558
  var globalResourceSchema = create$3().shape({
@@ -10645,21 +10628,21 @@ var paymentInfoSchema = create$3({
10645
10628
  ).required("Please select a Payment method"),
10646
10629
  accountHolderName: create$6().when("paymentMethod", {
10647
10630
  is: "bank_transfer",
10648
- then: (schema16) => schema16.required("Account holder name is required for bank transfer").trim(),
10649
- otherwise: (schema16) => schema16.notRequired()
10631
+ then: (schema17) => schema17.required("Account holder name is required for bank transfer").trim(),
10632
+ otherwise: (schema17) => schema17.notRequired()
10650
10633
  }),
10651
10634
  accountNumber: create$6().when("paymentMethod", {
10652
10635
  is: "bank_transfer",
10653
- then: (schema16) => schema16.required("Account number is required for bank transfer").matches(
10636
+ then: (schema17) => schema17.required("Account number is required for bank transfer").matches(
10654
10637
  nzBankAccountRegex,
10655
10638
  "Account number must be in format: XX-XXXX-XXXXXXX-XX"
10656
10639
  ).trim(),
10657
- otherwise: (schema16) => schema16.notRequired()
10640
+ otherwise: (schema17) => schema17.notRequired()
10658
10641
  }),
10659
10642
  link: create$6().when("paymentMethod", {
10660
10643
  is: (val) => val === "paypal" || val === "stripe",
10661
10644
  then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
10662
- otherwise: (schema16) => schema16.notRequired()
10645
+ otherwise: (schema17) => schema17.notRequired()
10663
10646
  })
10664
10647
  });
10665
10648
  var eventInfoSchema = create$3().shape({
@@ -10708,7 +10691,9 @@ var vendorSchema = globalResourceSchema.shape({
10708
10691
  });
10709
10692
  var unregisteredVendorSchema = create$3().shape({
10710
10693
  categoryIds: create$2().of(create$6().defined()).min(1, "Category list must contain at least one item").required("Categories are required"),
10694
+ dateTime: create$2().of(dateTimeSchema).min(1, "DateTime list must contain at least one item").required("DateTime is required"),
10711
10695
  email: emailOptionalSchema,
10696
+ inviterId: create$6().required("Inviter ID is required"),
10712
10697
  name: create$6().label("Stallholder Name").trim().min(3, "Name must be at least 3 characters").required("Name is required")
10713
10698
  });
10714
10699
  var vendorInfoSchema = create$3().shape({
@@ -10809,8 +10794,8 @@ var userSchema = create$3().shape({
10809
10794
  confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
10810
10795
  is: (val) => !!val,
10811
10796
  // only necessary if password typed
10812
- then: (schema16) => schema16.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10813
- otherwise: (schema16) => schema16.notRequired()
10797
+ then: (schema17) => schema17.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
10798
+ otherwise: (schema17) => schema17.notRequired()
10814
10799
  }),
10815
10800
  role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
10816
10801
  });
@@ -10881,7 +10866,7 @@ var adSchema = create$3().shape({
10881
10866
  return endDate > now;
10882
10867
  }).when("start", {
10883
10868
  is: (val) => val && val.length > 0,
10884
- then: (schema16) => schema16.test(
10869
+ then: (schema17) => schema17.test(
10885
10870
  "is-after-start",
10886
10871
  "End date must be after start date",
10887
10872
  function(value) {
@@ -12157,7 +12142,7 @@ var schema9 = new MongooseSchema13(
12157
12142
  required: false,
12158
12143
  type: calendarWrapperSchema
12159
12144
  },
12160
- categories: [CategorySchema],
12145
+ categories: { required: true, type: [CategorySchema] },
12161
12146
  foodTruck: { required: true, type: Boolean },
12162
12147
  products: { required: false, type: productWrapperSchema },
12163
12148
  relations: {
@@ -12236,19 +12221,47 @@ var schema10 = new MongooseSchema14(
12236
12221
  );
12237
12222
  var VendorInfoModel = mongoose14.models.VendorInfo || mongoose14.model("VendorInfo", schema10);
12238
12223
 
12239
- // src/mongoose/event/Event.ts
12224
+ // src/mongoose/vendor/UnregisteredVendor.ts
12240
12225
  import mongoose15 from "mongoose";
12241
12226
  var MongooseSchema15 = mongoose15.Schema;
12227
+ var invitationSchema = new MongooseSchema15(
12228
+ {
12229
+ dateTime: { required: true, type: [dateTimeSchema3] },
12230
+ inviterId: {
12231
+ ref: "Event",
12232
+ required: true,
12233
+ type: String
12234
+ }
12235
+ },
12236
+ { _id: false }
12237
+ );
12242
12238
  var schema11 = new MongooseSchema15(
12239
+ {
12240
+ categoryIds: { required: true, type: [String] },
12241
+ deletedAt: { default: null, required: false, type: Date },
12242
+ email: { required: true, type: String },
12243
+ invitations: { required: true, type: [invitationSchema] },
12244
+ name: { required: true, type: String }
12245
+ },
12246
+ { timestamps: true }
12247
+ );
12248
+ schema11.index({ email: 1 }, { unique: true });
12249
+ schema11.index({ name: 1 });
12250
+ var UnregisteredVendorModel = mongoose15.models.UnregisteredVendor || mongoose15.model("UnregisteredVendor", schema11);
12251
+
12252
+ // src/mongoose/event/Event.ts
12253
+ import mongoose16 from "mongoose";
12254
+ var MongooseSchema16 = mongoose16.Schema;
12255
+ var schema12 = new MongooseSchema16(
12243
12256
  {
12244
12257
  ...baseResourceFields,
12245
12258
  // Importing base resource fields from global.ts
12246
12259
  claimed: { default: true, required: false, type: Boolean },
12247
- dateTime: [dateTimeSchema3],
12260
+ dateTime: { required: true, type: [dateTimeSchema3] },
12248
12261
  eventInfoId: {
12249
12262
  ref: "EventInfo",
12250
12263
  required: false,
12251
- type: mongoose15.Schema.Types.ObjectId
12264
+ type: mongoose16.Schema.Types.ObjectId
12252
12265
  },
12253
12266
  eventType: {
12254
12267
  enum: Object.values(EnumEventType),
@@ -12277,18 +12290,18 @@ var schema11 = new MongooseSchema15(
12277
12290
  },
12278
12291
  { timestamps: true }
12279
12292
  );
12280
- schema11.index({ name: 1 });
12281
- schema11.index({ description: 1 });
12282
- schema11.index({ region: 1 });
12283
- schema11.index({ "location.geo": "2dsphere" });
12284
- schema11.index({ tags: 1 });
12285
- schema11.index({ "associates.email": 1 });
12286
- var EventModel = mongoose15.models.Event || mongoose15.model("Event", schema11);
12293
+ schema12.index({ name: 1 });
12294
+ schema12.index({ description: 1 });
12295
+ schema12.index({ region: 1 });
12296
+ schema12.index({ "location.geo": "2dsphere" });
12297
+ schema12.index({ tags: 1 });
12298
+ schema12.index({ "associates.email": 1 });
12299
+ var EventModel = mongoose16.models.Event || mongoose16.model("Event", schema12);
12287
12300
 
12288
12301
  // src/mongoose/Partner.ts
12289
- import mongoose16 from "mongoose";
12290
- var MongooseSchema16 = mongoose16.Schema;
12291
- var schema12 = new MongooseSchema16(
12302
+ import mongoose17 from "mongoose";
12303
+ var MongooseSchema17 = mongoose17.Schema;
12304
+ var schema13 = new MongooseSchema17(
12292
12305
  {
12293
12306
  ...baseResourceFields,
12294
12307
  location: {
@@ -12304,17 +12317,17 @@ var schema12 = new MongooseSchema16(
12304
12317
  },
12305
12318
  { timestamps: true }
12306
12319
  );
12307
- schema12.index({ name: 1 });
12308
- schema12.index({ description: 1 });
12309
- schema12.index({ region: 1 });
12310
- schema12.index({ "location.geo": "2dsphere" });
12311
- schema12.index({ "associates.email": 1 });
12312
- var PartnerModel = mongoose16.models.Partner || mongoose16.model("Partner", schema12);
12320
+ schema13.index({ name: 1 });
12321
+ schema13.index({ description: 1 });
12322
+ schema13.index({ region: 1 });
12323
+ schema13.index({ "location.geo": "2dsphere" });
12324
+ schema13.index({ "associates.email": 1 });
12325
+ var PartnerModel = mongoose17.models.Partner || mongoose17.model("Partner", schema13);
12313
12326
 
12314
12327
  // src/mongoose/Post.ts
12315
- import mongoose17, { Schema as Schema2 } from "mongoose";
12316
- var MongooseSchema17 = mongoose17.Schema;
12317
- var contentSchema = new MongooseSchema17(
12328
+ import mongoose18, { Schema as Schema2 } from "mongoose";
12329
+ var MongooseSchema18 = mongoose18.Schema;
12330
+ var contentSchema = new MongooseSchema18(
12318
12331
  {
12319
12332
  contentData: Schema2.Types.Mixed,
12320
12333
  contentOrder: { required: true, type: Number },
@@ -12326,7 +12339,7 @@ var contentSchema = new MongooseSchema17(
12326
12339
  },
12327
12340
  { _id: false }
12328
12341
  );
12329
- var schema13 = new MongooseSchema17(
12342
+ var schema14 = new MongooseSchema18(
12330
12343
  {
12331
12344
  active: { default: true, required: true, type: Boolean },
12332
12345
  caption: { required: true, type: String },
@@ -12362,15 +12375,15 @@ var schema13 = new MongooseSchema17(
12362
12375
  },
12363
12376
  { timestamps: true }
12364
12377
  );
12365
- schema13.index({ title: 1 });
12366
- schema13.index({ tags: 1 });
12367
- var PostModel = mongoose17.models.Post || mongoose17.model("Post", schema13);
12378
+ schema14.index({ title: 1 });
12379
+ schema14.index({ tags: 1 });
12380
+ var PostModel = mongoose18.models.Post || mongoose18.model("Post", schema14);
12368
12381
 
12369
12382
  // src/mongoose/AppSetting.ts
12370
- import mongoose18 from "mongoose";
12371
- var MongooseSchema18 = mongoose18.Schema;
12383
+ import mongoose19 from "mongoose";
12384
+ var MongooseSchema19 = mongoose19.Schema;
12372
12385
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
12373
- var AppSettingSchema = new MongooseSchema18(
12386
+ var AppSettingSchema = new MongooseSchema19(
12374
12387
  {
12375
12388
  activeSchoolsStudentCountTotal: {
12376
12389
  default: 0,
@@ -12396,18 +12409,18 @@ var AppSettingSchema = new MongooseSchema18(
12396
12409
  },
12397
12410
  { timestamps: true }
12398
12411
  );
12399
- var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
12412
+ var AppSettingModel = mongoose19.models.AppSetting || mongoose19.model("AppSetting", AppSettingSchema);
12400
12413
 
12401
12414
  // src/mongoose/game/Game.ts
12402
- import mongoose22 from "mongoose";
12415
+ import mongoose23 from "mongoose";
12403
12416
 
12404
12417
  // src/mongoose/game/DailyClue.ts
12405
- import mongoose20 from "mongoose";
12418
+ import mongoose21 from "mongoose";
12406
12419
 
12407
12420
  // src/mongoose/game/utils.ts
12408
- import mongoose19 from "mongoose";
12409
- var MongooseSchema19 = mongoose19.Schema;
12410
- var schemaGameDate = new MongooseSchema19(
12421
+ import mongoose20 from "mongoose";
12422
+ var MongooseSchema20 = mongoose20.Schema;
12423
+ var schemaGameDate = new MongooseSchema20(
12411
12424
  {
12412
12425
  endDate: { required: true, type: Date },
12413
12426
  startDate: { required: true, type: Date }
@@ -12416,8 +12429,8 @@ var schemaGameDate = new MongooseSchema19(
12416
12429
  );
12417
12430
 
12418
12431
  // src/mongoose/game/DailyClue.ts
12419
- var MongooseSchema20 = mongoose20.Schema;
12420
- var schemaLetters = new MongooseSchema20(
12432
+ var MongooseSchema21 = mongoose21.Schema;
12433
+ var schemaLetters = new MongooseSchema21(
12421
12434
  {
12422
12435
  collected: { required: false, type: [String] },
12423
12436
  solutionShuffled: { required: true, type: [String] }
@@ -12425,14 +12438,14 @@ var schemaLetters = new MongooseSchema20(
12425
12438
  },
12426
12439
  { _id: false }
12427
12440
  );
12428
- var schemaDailyClueBaseGame = new MongooseSchema20(
12441
+ var schemaDailyClueBaseGame = new MongooseSchema21(
12429
12442
  {
12430
12443
  gameDate: { required: true, type: schemaGameDate },
12431
12444
  gameSolution: { required: true, type: String }
12432
12445
  },
12433
12446
  { _id: false }
12434
12447
  );
12435
- var schemaDailyClueGameData = new MongooseSchema20(
12448
+ var schemaDailyClueGameData = new MongooseSchema21(
12436
12449
  {
12437
12450
  gameFields: { required: true, type: schemaDailyClueBaseGame },
12438
12451
  lastFoundDate: { default: null, required: false, type: Date },
@@ -12447,9 +12460,9 @@ var schemaDailyClueGameData = new MongooseSchema20(
12447
12460
  );
12448
12461
 
12449
12462
  // src/mongoose/game/MiniQuiz.ts
12450
- import mongoose21 from "mongoose";
12451
- var MongooseSchema21 = mongoose21.Schema;
12452
- var schemaMiniQuizAnswer = new MongooseSchema21(
12463
+ import mongoose22 from "mongoose";
12464
+ var MongooseSchema22 = mongoose22.Schema;
12465
+ var schemaMiniQuizAnswer = new MongooseSchema22(
12453
12466
  {
12454
12467
  answer: { required: true, type: String },
12455
12468
  answerId: { required: true, type: String },
@@ -12457,7 +12470,7 @@ var schemaMiniQuizAnswer = new MongooseSchema21(
12457
12470
  },
12458
12471
  { _id: false }
12459
12472
  );
12460
- var schemaMiniQuizQuestion = new MongooseSchema21(
12473
+ var schemaMiniQuizQuestion = new MongooseSchema22(
12461
12474
  {
12462
12475
  answers: { required: true, type: [schemaMiniQuizAnswer] },
12463
12476
  question: { required: true, type: String },
@@ -12465,20 +12478,20 @@ var schemaMiniQuizQuestion = new MongooseSchema21(
12465
12478
  },
12466
12479
  { _id: false }
12467
12480
  );
12468
- var schemaMiniQuizBaseGame = new MongooseSchema21(
12481
+ var schemaMiniQuizBaseGame = new MongooseSchema22(
12469
12482
  {
12470
12483
  questions: { required: true, type: [schemaMiniQuizQuestion] }
12471
12484
  },
12472
12485
  { _id: false }
12473
12486
  );
12474
- var schemaMiniQuizAnsweredQuestion = new MongooseSchema21(
12487
+ var schemaMiniQuizAnsweredQuestion = new MongooseSchema22(
12475
12488
  {
12476
12489
  questionId: { required: true, type: String },
12477
12490
  selectedAnswerId: { required: true, type: String }
12478
12491
  },
12479
12492
  { _id: false }
12480
12493
  );
12481
- var schemaMiniQuizGameData = new MongooseSchema21(
12494
+ var schemaMiniQuizGameData = new MongooseSchema22(
12482
12495
  {
12483
12496
  answeredQuestions: {
12484
12497
  default: null,
@@ -12493,18 +12506,18 @@ var schemaMiniQuizGameData = new MongooseSchema21(
12493
12506
  );
12494
12507
 
12495
12508
  // src/mongoose/game/Game.ts
12496
- var MongooseSchema22 = mongoose22.Schema;
12509
+ var MongooseSchema23 = mongoose23.Schema;
12497
12510
  var gameDataSchemas = {
12498
12511
  [EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
12499
12512
  [EnumGameType.MINI_QUIZ]: schemaMiniQuizGameData
12500
12513
  };
12501
12514
  var gameDataDefinition = Object.fromEntries(
12502
- Object.entries(gameDataSchemas).map(([key, schema16]) => [
12515
+ Object.entries(gameDataSchemas).map(([key, schema17]) => [
12503
12516
  key,
12504
- { default: null, required: false, type: schema16 }
12517
+ { default: null, required: false, type: schema17 }
12505
12518
  ])
12506
12519
  );
12507
- var gameHistorySchema = new MongooseSchema22(
12520
+ var gameHistorySchema = new MongooseSchema23(
12508
12521
  {
12509
12522
  createdAt: { required: true, type: Date },
12510
12523
  gameDate: { required: true, type: schemaGameDate },
@@ -12522,7 +12535,7 @@ var gameHistorySchema = new MongooseSchema22(
12522
12535
  },
12523
12536
  { _id: false }
12524
12537
  );
12525
- var gameTypeSchema = new MongooseSchema22(
12538
+ var gameTypeSchema = new MongooseSchema23(
12526
12539
  {
12527
12540
  active: { default: true, required: true, type: Boolean },
12528
12541
  gameData: gameDataDefinition,
@@ -12536,7 +12549,7 @@ var gameTypeSchema = new MongooseSchema22(
12536
12549
  },
12537
12550
  { timestamps: true }
12538
12551
  );
12539
- var schema14 = new MongooseSchema22(
12552
+ var schema15 = new MongooseSchema23(
12540
12553
  {
12541
12554
  active: { default: false, required: true, type: Boolean },
12542
12555
  deletedAt: { default: null, required: false, type: Date },
@@ -12549,12 +12562,12 @@ var schema14 = new MongooseSchema22(
12549
12562
  },
12550
12563
  { timestamps: true }
12551
12564
  );
12552
- var GameModel = mongoose22.models.Game || mongoose22.model("Game", schema14);
12565
+ var GameModel = mongoose23.models.Game || mongoose23.model("Game", schema15);
12553
12566
 
12554
12567
  // src/mongoose/School.ts
12555
- import mongoose23 from "mongoose";
12556
- var MongooseSchema23 = mongoose23.Schema;
12557
- var campaignsSchema = new MongooseSchema23(
12568
+ import mongoose24 from "mongoose";
12569
+ var MongooseSchema24 = mongoose24.Schema;
12570
+ var campaignsSchema = new MongooseSchema24(
12558
12571
  {
12559
12572
  endDate: { required: true, type: Date },
12560
12573
  name: { required: true, type: String },
@@ -12562,7 +12575,7 @@ var campaignsSchema = new MongooseSchema23(
12562
12575
  },
12563
12576
  { _id: false }
12564
12577
  );
12565
- var schema15 = new MongooseSchema23(
12578
+ var schema16 = new MongooseSchema24(
12566
12579
  {
12567
12580
  // New schools are active by default
12568
12581
  active: { default: true, required: true, type: Boolean },
@@ -12588,10 +12601,10 @@ var schema15 = new MongooseSchema23(
12588
12601
  },
12589
12602
  { timestamps: true }
12590
12603
  );
12591
- var SchoolModel = mongoose23.models.School || mongoose23.model("School", schema15);
12604
+ var SchoolModel = mongoose24.models.School || mongoose24.model("School", schema16);
12592
12605
 
12593
12606
  // src/service/database.ts
12594
- import mongoose24 from "mongoose";
12607
+ import mongoose25 from "mongoose";
12595
12608
  var connectToDatabase = async ({
12596
12609
  appName,
12597
12610
  dbName,
@@ -12604,7 +12617,7 @@ var connectToDatabase = async ({
12604
12617
  // Fallback to MongoDB Atlas connection string
12605
12618
  `mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
12606
12619
  );
12607
- await mongoose24.connect(mongoUri);
12620
+ await mongoose25.connect(mongoUri);
12608
12621
  const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
12609
12622
  console.log(
12610
12623
  `${connectionType} connected from server/src/service/database.ts`
@@ -12783,9 +12796,9 @@ async function updateAdStatuses() {
12783
12796
  }
12784
12797
 
12785
12798
  // src/service/associate.ts
12786
- import mongoose25 from "mongoose";
12799
+ import mongoose26 from "mongoose";
12787
12800
  function normalizeObjectId(id) {
12788
- return typeof id === "string" ? new mongoose25.Types.ObjectId(id) : id;
12801
+ return typeof id === "string" ? new mongoose26.Types.ObjectId(id) : id;
12789
12802
  }
12790
12803
  async function getAssociateEmailsForResource({
12791
12804
  normalizedResourceId,
@@ -12937,12 +12950,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
12937
12950
  }
12938
12951
 
12939
12952
  // src/service/objectIdToString.ts
12940
- import mongoose26 from "mongoose";
12953
+ import mongoose27 from "mongoose";
12941
12954
  function convertObjectIdsToStrings(obj) {
12942
12955
  if (obj === null || obj === void 0) {
12943
12956
  return obj;
12944
12957
  }
12945
- if (obj instanceof mongoose26.Types.ObjectId) {
12958
+ if (obj instanceof mongoose27.Types.ObjectId) {
12946
12959
  return obj.toString();
12947
12960
  }
12948
12961
  if (Array.isArray(obj)) {
@@ -12986,7 +12999,7 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
12986
12999
 
12987
13000
  // src/types/index.ts
12988
13001
  import express from "express";
12989
- import mongoose27 from "mongoose";
13002
+ import mongoose28 from "mongoose";
12990
13003
  var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
12991
13004
  EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
12992
13005
  EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
@@ -13019,6 +13032,7 @@ export {
13019
13032
  SchoolModel,
13020
13033
  SocialMediaTypeSchema,
13021
13034
  StallTypeSchema,
13035
+ UnregisteredVendorModel,
13022
13036
  UserModel,
13023
13037
  VendorInfoModel,
13024
13038
  VendorModel,
@@ -13032,7 +13046,7 @@ export {
13032
13046
  findEventOrImportedMarketById,
13033
13047
  locationGeoSchema,
13034
13048
  locationsSchema,
13035
- mongoose27 as mongoose,
13049
+ mongoose28 as mongoose,
13036
13050
  refundPolicySchema,
13037
13051
  relationDatesSchema,
13038
13052
  resourceRelationsSchema,