@timardex/cluemart-server-shared 1.0.109 → 1.0.111
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-VQOH37OR.mjs → chunk-PLU34IF2.mjs} +200 -94
- package/dist/chunk-PLU34IF2.mjs.map +1 -0
- package/dist/index.cjs +206 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.mjs +204 -98
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +200 -92
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +19 -2
- package/dist/mongoose/index.d.ts +19 -2
- package/dist/mongoose/index.mjs +5 -1
- package/dist/service/index.cjs +198 -94
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-VQOH37OR.mjs.map +0 -1
|
@@ -4656,10 +4656,10 @@ var Condition = class _Condition {
|
|
|
4656
4656
|
otherwise
|
|
4657
4657
|
} = config;
|
|
4658
4658
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4659
|
-
return new _Condition(refs, (values,
|
|
4659
|
+
return new _Condition(refs, (values, schema15) => {
|
|
4660
4660
|
var _branch;
|
|
4661
4661
|
let branch = check(...values) ? then : otherwise;
|
|
4662
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4662
|
+
return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
|
|
4663
4663
|
});
|
|
4664
4664
|
}
|
|
4665
4665
|
constructor(refs, builder) {
|
|
@@ -4673,13 +4673,13 @@ var Condition = class _Condition {
|
|
|
4673
4673
|
// TODO: ? operator here?
|
|
4674
4674
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4675
4675
|
));
|
|
4676
|
-
let
|
|
4677
|
-
if (
|
|
4678
|
-
|
|
4676
|
+
let schema15 = this.fn(values, base, options);
|
|
4677
|
+
if (schema15 === void 0 || // @ts-ignore this can be base
|
|
4678
|
+
schema15 === base) {
|
|
4679
4679
|
return base;
|
|
4680
4680
|
}
|
|
4681
|
-
if (!isSchema(
|
|
4682
|
-
return
|
|
4681
|
+
if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
|
|
4682
|
+
return schema15.resolve(options);
|
|
4683
4683
|
}
|
|
4684
4684
|
};
|
|
4685
4685
|
var prefixes = {
|
|
@@ -4749,7 +4749,7 @@ function createValidation(config) {
|
|
|
4749
4749
|
path = "",
|
|
4750
4750
|
options,
|
|
4751
4751
|
originalValue,
|
|
4752
|
-
schema:
|
|
4752
|
+
schema: schema15
|
|
4753
4753
|
}, panic, next) {
|
|
4754
4754
|
const {
|
|
4755
4755
|
name,
|
|
@@ -4761,8 +4761,8 @@ function createValidation(config) {
|
|
|
4761
4761
|
let {
|
|
4762
4762
|
parent,
|
|
4763
4763
|
context,
|
|
4764
|
-
abortEarly =
|
|
4765
|
-
disableStackTrace =
|
|
4764
|
+
abortEarly = schema15.spec.abortEarly,
|
|
4765
|
+
disableStackTrace = schema15.spec.disableStackTrace
|
|
4766
4766
|
} = options;
|
|
4767
4767
|
function resolve(item) {
|
|
4768
4768
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4771,9 +4771,9 @@ function createValidation(config) {
|
|
|
4771
4771
|
const nextParams = Object.assign({
|
|
4772
4772
|
value,
|
|
4773
4773
|
originalValue,
|
|
4774
|
-
label:
|
|
4774
|
+
label: schema15.spec.label,
|
|
4775
4775
|
path: overrides.path || path,
|
|
4776
|
-
spec:
|
|
4776
|
+
spec: schema15.spec,
|
|
4777
4777
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4778
4778
|
}, params, overrides.params);
|
|
4779
4779
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4791,7 +4791,7 @@ function createValidation(config) {
|
|
|
4791
4791
|
resolve,
|
|
4792
4792
|
options,
|
|
4793
4793
|
originalValue,
|
|
4794
|
-
schema:
|
|
4794
|
+
schema: schema15
|
|
4795
4795
|
};
|
|
4796
4796
|
const handleResult = (validOrError) => {
|
|
4797
4797
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4825,42 +4825,42 @@ function createValidation(config) {
|
|
|
4825
4825
|
validate.OPTIONS = config;
|
|
4826
4826
|
return validate;
|
|
4827
4827
|
}
|
|
4828
|
-
function getIn(
|
|
4828
|
+
function getIn(schema15, path, value, context = value) {
|
|
4829
4829
|
let parent, lastPart, lastPartDebug;
|
|
4830
4830
|
if (!path) return {
|
|
4831
4831
|
parent,
|
|
4832
4832
|
parentPath: path,
|
|
4833
|
-
schema:
|
|
4833
|
+
schema: schema15
|
|
4834
4834
|
};
|
|
4835
4835
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4836
4836
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4837
|
-
|
|
4837
|
+
schema15 = schema15.resolve({
|
|
4838
4838
|
context,
|
|
4839
4839
|
parent,
|
|
4840
4840
|
value
|
|
4841
4841
|
});
|
|
4842
|
-
let isTuple =
|
|
4842
|
+
let isTuple = schema15.type === "tuple";
|
|
4843
4843
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4844
|
-
if (
|
|
4844
|
+
if (schema15.innerType || isTuple) {
|
|
4845
4845
|
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]"`);
|
|
4846
4846
|
if (value && idx >= value.length) {
|
|
4847
4847
|
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. `);
|
|
4848
4848
|
}
|
|
4849
4849
|
parent = value;
|
|
4850
4850
|
value = value && value[idx];
|
|
4851
|
-
|
|
4851
|
+
schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
|
|
4852
4852
|
}
|
|
4853
4853
|
if (!isArray) {
|
|
4854
|
-
if (!
|
|
4854
|
+
if (!schema15.fields || !schema15.fields[part]) throw new Error(`The schema does not contain the path: ${path}. (failed at: ${lastPartDebug} which is a type: "${schema15.type}")`);
|
|
4855
4855
|
parent = value;
|
|
4856
4856
|
value = value && value[part];
|
|
4857
|
-
|
|
4857
|
+
schema15 = schema15.fields[part];
|
|
4858
4858
|
}
|
|
4859
4859
|
lastPart = part;
|
|
4860
4860
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4861
4861
|
});
|
|
4862
4862
|
return {
|
|
4863
|
-
schema:
|
|
4863
|
+
schema: schema15,
|
|
4864
4864
|
parent,
|
|
4865
4865
|
parentPath: lastPart
|
|
4866
4866
|
};
|
|
@@ -4997,20 +4997,20 @@ var Schema = class {
|
|
|
4997
4997
|
this._mutate = before;
|
|
4998
4998
|
return result;
|
|
4999
4999
|
}
|
|
5000
|
-
concat(
|
|
5001
|
-
if (!
|
|
5002
|
-
if (
|
|
5000
|
+
concat(schema15) {
|
|
5001
|
+
if (!schema15 || schema15 === this) return this;
|
|
5002
|
+
if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
|
|
5003
5003
|
let base = this;
|
|
5004
|
-
let combined =
|
|
5004
|
+
let combined = schema15.clone();
|
|
5005
5005
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5006
5006
|
combined.spec = mergedSpec;
|
|
5007
5007
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5008
|
-
combined._whitelist = base._whitelist.merge(
|
|
5009
|
-
combined._blacklist = base._blacklist.merge(
|
|
5008
|
+
combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
|
|
5009
|
+
combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
|
|
5010
5010
|
combined.tests = base.tests;
|
|
5011
5011
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5012
5012
|
combined.withMutation((next) => {
|
|
5013
|
-
|
|
5013
|
+
schema15.tests.forEach((fn) => {
|
|
5014
5014
|
next.test(fn.OPTIONS);
|
|
5015
5015
|
});
|
|
5016
5016
|
});
|
|
@@ -5026,15 +5026,15 @@ var Schema = class {
|
|
|
5026
5026
|
return this._typeCheck(v);
|
|
5027
5027
|
}
|
|
5028
5028
|
resolve(options) {
|
|
5029
|
-
let
|
|
5030
|
-
if (
|
|
5031
|
-
let conditions =
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5029
|
+
let schema15 = this;
|
|
5030
|
+
if (schema15.conditions.length) {
|
|
5031
|
+
let conditions = schema15.conditions;
|
|
5032
|
+
schema15 = schema15.clone();
|
|
5033
|
+
schema15.conditions = [];
|
|
5034
|
+
schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
|
|
5035
|
+
schema15 = schema15.resolve(options);
|
|
5036
5036
|
}
|
|
5037
|
-
return
|
|
5037
|
+
return schema15;
|
|
5038
5038
|
}
|
|
5039
5039
|
resolveOptions(options) {
|
|
5040
5040
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5188,11 +5188,11 @@ attempted value: ${formattedValue}
|
|
|
5188
5188
|
}
|
|
5189
5189
|
validate(value, options) {
|
|
5190
5190
|
var _options$disableStack2;
|
|
5191
|
-
let
|
|
5191
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5192
5192
|
value
|
|
5193
5193
|
}));
|
|
5194
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5195
|
-
return new Promise((resolve, reject) =>
|
|
5194
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
|
|
5195
|
+
return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
|
|
5196
5196
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5197
5197
|
reject(error);
|
|
5198
5198
|
}, (errors, validated) => {
|
|
@@ -5202,12 +5202,12 @@ attempted value: ${formattedValue}
|
|
|
5202
5202
|
}
|
|
5203
5203
|
validateSync(value, options) {
|
|
5204
5204
|
var _options$disableStack3;
|
|
5205
|
-
let
|
|
5205
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5206
5206
|
value
|
|
5207
5207
|
}));
|
|
5208
5208
|
let result;
|
|
5209
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5210
|
-
|
|
5209
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
|
|
5210
|
+
schema15._validate(value, Object.assign({}, options, {
|
|
5211
5211
|
sync: true
|
|
5212
5212
|
}), (error, parsed) => {
|
|
5213
5213
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5241,8 +5241,8 @@ attempted value: ${formattedValue}
|
|
|
5241
5241
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5242
5242
|
}
|
|
5243
5243
|
getDefault(options) {
|
|
5244
|
-
let
|
|
5245
|
-
return
|
|
5244
|
+
let schema15 = this.resolve(options || {});
|
|
5245
|
+
return schema15._getDefault(options);
|
|
5246
5246
|
}
|
|
5247
5247
|
default(def) {
|
|
5248
5248
|
if (arguments.length === 0) {
|
|
@@ -5477,9 +5477,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5477
5477
|
const {
|
|
5478
5478
|
parent,
|
|
5479
5479
|
parentPath,
|
|
5480
|
-
schema:
|
|
5480
|
+
schema: schema15
|
|
5481
5481
|
} = getIn(this, path, value, options.context);
|
|
5482
|
-
return
|
|
5482
|
+
return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5483
5483
|
parent,
|
|
5484
5484
|
path
|
|
5485
5485
|
}));
|
|
@@ -5653,7 +5653,7 @@ var StringSchema = class extends Schema {
|
|
|
5653
5653
|
});
|
|
5654
5654
|
}
|
|
5655
5655
|
required(message) {
|
|
5656
|
-
return super.required(message).withMutation((
|
|
5656
|
+
return super.required(message).withMutation((schema15) => schema15.test({
|
|
5657
5657
|
message: message || mixed.required,
|
|
5658
5658
|
name: "required",
|
|
5659
5659
|
skipAbsent: true,
|
|
@@ -5661,9 +5661,9 @@ var StringSchema = class extends Schema {
|
|
|
5661
5661
|
}));
|
|
5662
5662
|
}
|
|
5663
5663
|
notRequired() {
|
|
5664
|
-
return super.notRequired().withMutation((
|
|
5665
|
-
|
|
5666
|
-
return
|
|
5664
|
+
return super.notRequired().withMutation((schema15) => {
|
|
5665
|
+
schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5666
|
+
return schema15;
|
|
5667
5667
|
});
|
|
5668
5668
|
}
|
|
5669
5669
|
length(length, message = string.length) {
|
|
@@ -6052,28 +6052,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6052
6052
|
}
|
|
6053
6053
|
return ctx.isType(parsed) ? parsed : value;
|
|
6054
6054
|
};
|
|
6055
|
-
function deepPartial(
|
|
6056
|
-
if ("fields" in
|
|
6055
|
+
function deepPartial(schema15) {
|
|
6056
|
+
if ("fields" in schema15) {
|
|
6057
6057
|
const partial = {};
|
|
6058
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6058
|
+
for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
|
|
6059
6059
|
partial[key] = deepPartial(fieldSchema);
|
|
6060
6060
|
}
|
|
6061
|
-
return
|
|
6061
|
+
return schema15.setFields(partial);
|
|
6062
6062
|
}
|
|
6063
|
-
if (
|
|
6064
|
-
const nextArray =
|
|
6063
|
+
if (schema15.type === "array") {
|
|
6064
|
+
const nextArray = schema15.optional();
|
|
6065
6065
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6066
6066
|
return nextArray;
|
|
6067
6067
|
}
|
|
6068
|
-
if (
|
|
6069
|
-
return
|
|
6070
|
-
types:
|
|
6068
|
+
if (schema15.type === "tuple") {
|
|
6069
|
+
return schema15.optional().clone({
|
|
6070
|
+
types: schema15.spec.types.map(deepPartial)
|
|
6071
6071
|
});
|
|
6072
6072
|
}
|
|
6073
|
-
if ("optional" in
|
|
6074
|
-
return
|
|
6073
|
+
if ("optional" in schema15) {
|
|
6074
|
+
return schema15.optional();
|
|
6075
6075
|
}
|
|
6076
|
-
return
|
|
6076
|
+
return schema15;
|
|
6077
6077
|
}
|
|
6078
6078
|
var deepHas = (obj, p) => {
|
|
6079
6079
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6207,8 +6207,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6207
6207
|
next._sortErrors = this._sortErrors;
|
|
6208
6208
|
return next;
|
|
6209
6209
|
}
|
|
6210
|
-
concat(
|
|
6211
|
-
let next = super.concat(
|
|
6210
|
+
concat(schema15) {
|
|
6211
|
+
let next = super.concat(schema15);
|
|
6212
6212
|
let nextFields = next.fields;
|
|
6213
6213
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6214
6214
|
const target = nextFields[field];
|
|
@@ -6216,7 +6216,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6216
6216
|
}
|
|
6217
6217
|
return next.withMutation((s) => (
|
|
6218
6218
|
// XXX: excludes here is wrong
|
|
6219
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6219
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
|
|
6220
6220
|
));
|
|
6221
6221
|
}
|
|
6222
6222
|
_getDefault(options) {
|
|
@@ -6261,8 +6261,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6261
6261
|
}
|
|
6262
6262
|
partial() {
|
|
6263
6263
|
const partial = {};
|
|
6264
|
-
for (const [key,
|
|
6265
|
-
partial[key] = "optional" in
|
|
6264
|
+
for (const [key, schema15] of Object.entries(this.fields)) {
|
|
6265
|
+
partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
|
|
6266
6266
|
}
|
|
6267
6267
|
return this.setFields(partial);
|
|
6268
6268
|
}
|
|
@@ -6460,22 +6460,22 @@ var ArraySchema = class extends Schema {
|
|
|
6460
6460
|
json() {
|
|
6461
6461
|
return this.transform(parseJson);
|
|
6462
6462
|
}
|
|
6463
|
-
concat(
|
|
6464
|
-
let next = super.concat(
|
|
6463
|
+
concat(schema15) {
|
|
6464
|
+
let next = super.concat(schema15);
|
|
6465
6465
|
next.innerType = this.innerType;
|
|
6466
|
-
if (
|
|
6466
|
+
if (schema15.innerType)
|
|
6467
6467
|
next.innerType = next.innerType ? (
|
|
6468
6468
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6469
|
-
next.innerType.concat(
|
|
6470
|
-
) :
|
|
6469
|
+
next.innerType.concat(schema15.innerType)
|
|
6470
|
+
) : schema15.innerType;
|
|
6471
6471
|
return next;
|
|
6472
6472
|
}
|
|
6473
|
-
of(
|
|
6473
|
+
of(schema15) {
|
|
6474
6474
|
let next = this.clone();
|
|
6475
|
-
if (!isSchema(
|
|
6476
|
-
next.innerType =
|
|
6475
|
+
if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
|
|
6476
|
+
next.innerType = schema15;
|
|
6477
6477
|
next.spec = Object.assign({}, next.spec, {
|
|
6478
|
-
types:
|
|
6478
|
+
types: schema15
|
|
6479
6479
|
});
|
|
6480
6480
|
return next;
|
|
6481
6481
|
}
|
|
@@ -6619,7 +6619,7 @@ var TupleSchema = class extends Schema {
|
|
|
6619
6619
|
describe(options) {
|
|
6620
6620
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6621
6621
|
const base = super.describe(options);
|
|
6622
|
-
base.innerType = next.spec.types.map((
|
|
6622
|
+
base.innerType = next.spec.types.map((schema15, index) => {
|
|
6623
6623
|
var _innerOptions;
|
|
6624
6624
|
let innerOptions = options;
|
|
6625
6625
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6628,7 +6628,7 @@ var TupleSchema = class extends Schema {
|
|
|
6628
6628
|
value: innerOptions.value[index]
|
|
6629
6629
|
});
|
|
6630
6630
|
}
|
|
6631
|
-
return
|
|
6631
|
+
return schema15.describe(innerOptions);
|
|
6632
6632
|
});
|
|
6633
6633
|
return base;
|
|
6634
6634
|
}
|
|
@@ -8196,6 +8196,7 @@ var USER_ACTIVITY_FIELDS_FRAGMENT = gql`
|
|
|
8196
8196
|
fragment UserActivityFields on UserActivityType {
|
|
8197
8197
|
favourites {
|
|
8198
8198
|
events
|
|
8199
|
+
partners
|
|
8199
8200
|
vendors
|
|
8200
8201
|
}
|
|
8201
8202
|
going {
|
|
@@ -8240,12 +8241,14 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8240
8241
|
email
|
|
8241
8242
|
events
|
|
8242
8243
|
firstName
|
|
8244
|
+
games
|
|
8243
8245
|
isTester
|
|
8244
8246
|
lastName
|
|
8245
8247
|
licences {
|
|
8246
8248
|
...LicenceFields
|
|
8247
8249
|
}
|
|
8248
8250
|
partner
|
|
8251
|
+
points
|
|
8249
8252
|
platform
|
|
8250
8253
|
preferredRegion
|
|
8251
8254
|
promoCodes
|
|
@@ -9183,6 +9186,9 @@ var GET_USER_ACTIVITIES = gql`
|
|
|
9183
9186
|
events {
|
|
9184
9187
|
...EventListItemFields
|
|
9185
9188
|
}
|
|
9189
|
+
partners {
|
|
9190
|
+
...PartnerFields
|
|
9191
|
+
}
|
|
9186
9192
|
vendors {
|
|
9187
9193
|
...VendorFields
|
|
9188
9194
|
}
|
|
@@ -9206,6 +9212,7 @@ var GET_USER_ACTIVITIES = gql`
|
|
|
9206
9212
|
}
|
|
9207
9213
|
${EVENT_LIST_ITEM}
|
|
9208
9214
|
${VENDOR}
|
|
9215
|
+
${PARTNER}
|
|
9209
9216
|
`;
|
|
9210
9217
|
var GET_USER_RESOURCES = gql`
|
|
9211
9218
|
query getUserResources($userId: ID!) {
|
|
@@ -9805,6 +9812,14 @@ var DELETE_PARTNER_MUTATION = gql`
|
|
|
9805
9812
|
`;
|
|
9806
9813
|
var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
|
|
9807
9814
|
fragment PostContentDataFields on PostContentData {
|
|
9815
|
+
game {
|
|
9816
|
+
title
|
|
9817
|
+
gameType
|
|
9818
|
+
gameInfo {
|
|
9819
|
+
dailyClue
|
|
9820
|
+
}
|
|
9821
|
+
gameEndDate
|
|
9822
|
+
}
|
|
9808
9823
|
textarea {
|
|
9809
9824
|
title
|
|
9810
9825
|
data
|
|
@@ -9942,6 +9957,66 @@ var GET_APP_SETTINGS = gql`
|
|
|
9942
9957
|
}
|
|
9943
9958
|
${APP_SETTINGS_FIELDS_FRAGMENT}
|
|
9944
9959
|
`;
|
|
9960
|
+
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
|
|
9961
|
+
fragment DailyClueGameDataFields on DailyClueGameDataType {
|
|
9962
|
+
lastFoundDate
|
|
9963
|
+
streak
|
|
9964
|
+
points
|
|
9965
|
+
collectedLetters
|
|
9966
|
+
gameEndDate
|
|
9967
|
+
}
|
|
9968
|
+
`;
|
|
9969
|
+
var GAME_FIELDS_FRAGMENT = gql`
|
|
9970
|
+
fragment GameFields on GameType {
|
|
9971
|
+
_id
|
|
9972
|
+
active
|
|
9973
|
+
createdAt
|
|
9974
|
+
deletedAt
|
|
9975
|
+
gameData {
|
|
9976
|
+
dailyClue {
|
|
9977
|
+
...DailyClueGameDataFields
|
|
9978
|
+
}
|
|
9979
|
+
}
|
|
9980
|
+
updatedAt
|
|
9981
|
+
owner {
|
|
9982
|
+
...OwnerFields
|
|
9983
|
+
}
|
|
9984
|
+
}
|
|
9985
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
9986
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
9987
|
+
`;
|
|
9988
|
+
var GET_GAMES = gql`
|
|
9989
|
+
query getGames($userId: ID) {
|
|
9990
|
+
games(userId: $userId) {
|
|
9991
|
+
...GameFields
|
|
9992
|
+
}
|
|
9993
|
+
}
|
|
9994
|
+
${GAME_FIELDS_FRAGMENT}
|
|
9995
|
+
`;
|
|
9996
|
+
var GET_GAME = gql`
|
|
9997
|
+
query getGame($_id: ID!) {
|
|
9998
|
+
game(_id: $_id) {
|
|
9999
|
+
...GameFields
|
|
10000
|
+
}
|
|
10001
|
+
}
|
|
10002
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10003
|
+
`;
|
|
10004
|
+
var START_GAME_MUTATION = gql`
|
|
10005
|
+
mutation startGame($input: GameInputType!) {
|
|
10006
|
+
startGame(input: $input) {
|
|
10007
|
+
...GameFields
|
|
10008
|
+
}
|
|
10009
|
+
}
|
|
10010
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10011
|
+
`;
|
|
10012
|
+
var LEAVE_GAME_MUTATION = gql`
|
|
10013
|
+
mutation leaveGame($_id: ID!) {
|
|
10014
|
+
leaveGame(_id: $_id) {
|
|
10015
|
+
...GameFields
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
10018
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10019
|
+
`;
|
|
9945
10020
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
9946
10021
|
var nzbnRegex = /^94\d{11}$/;
|
|
9947
10022
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10093,7 +10168,7 @@ var socialMediaSchema = create$3({
|
|
|
10093
10168
|
is: (name) => !!name,
|
|
10094
10169
|
// If name has a value
|
|
10095
10170
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10096
|
-
otherwise: (
|
|
10171
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10097
10172
|
})
|
|
10098
10173
|
});
|
|
10099
10174
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10169,21 +10244,21 @@ var paymentInfoSchema = create$3({
|
|
|
10169
10244
|
).required("Please select a Payment method"),
|
|
10170
10245
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10171
10246
|
is: "bank_transfer",
|
|
10172
|
-
then: (
|
|
10173
|
-
otherwise: (
|
|
10247
|
+
then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
|
|
10248
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10174
10249
|
}),
|
|
10175
10250
|
accountNumber: create$6().when("paymentMethod", {
|
|
10176
10251
|
is: "bank_transfer",
|
|
10177
|
-
then: (
|
|
10252
|
+
then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
|
|
10178
10253
|
nzBankAccountRegex,
|
|
10179
10254
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10180
10255
|
).trim(),
|
|
10181
|
-
otherwise: (
|
|
10256
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10182
10257
|
}),
|
|
10183
10258
|
link: create$6().when("paymentMethod", {
|
|
10184
10259
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10185
10260
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10186
|
-
otherwise: (
|
|
10261
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10187
10262
|
})
|
|
10188
10263
|
});
|
|
10189
10264
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10219,8 +10294,7 @@ var vendorMenuSchema = create$3({
|
|
|
10219
10294
|
description: create$6().nullable().optional(),
|
|
10220
10295
|
name: create$6().nullable().required("Product name is required"),
|
|
10221
10296
|
price: create$5().transform((v, o3) => o3 === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
|
|
10222
|
-
priceUnit: create$6().required("Product unit is required")
|
|
10223
|
-
productGroups: create$2().of(create$6().defined()).min(1, "Product groups are required").required("Product groups are required")
|
|
10297
|
+
priceUnit: create$6().required("Product unit is required")
|
|
10224
10298
|
});
|
|
10225
10299
|
var vendorSchema = globalResourceSchema.shape({
|
|
10226
10300
|
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
@@ -10342,8 +10416,8 @@ var userSchema = create$3().shape({
|
|
|
10342
10416
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10343
10417
|
is: (val) => !!val,
|
|
10344
10418
|
// only necessary if password typed
|
|
10345
|
-
then: (
|
|
10346
|
-
otherwise: (
|
|
10419
|
+
then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10420
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10347
10421
|
}),
|
|
10348
10422
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10349
10423
|
});
|
|
@@ -10414,7 +10488,7 @@ var adSchema = create$3().shape({
|
|
|
10414
10488
|
return endDate > now;
|
|
10415
10489
|
}).when("start", {
|
|
10416
10490
|
is: (val) => val && val.length > 0,
|
|
10417
|
-
then: (
|
|
10491
|
+
then: (schema15) => schema15.test(
|
|
10418
10492
|
"is-after-start",
|
|
10419
10493
|
"End date must be after start date",
|
|
10420
10494
|
function(value) {
|
|
@@ -10445,10 +10519,11 @@ var partnerSchema = globalResourceSchema.shape({
|
|
|
10445
10519
|
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
10446
10520
|
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
10447
10521
|
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
10448
|
-
EnumPostType2["
|
|
10522
|
+
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
10449
10523
|
return EnumPostType2;
|
|
10450
10524
|
})(EnumPostType || {});
|
|
10451
10525
|
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
10526
|
+
EnumPostContentType2["GAME"] = "game";
|
|
10452
10527
|
EnumPostContentType2["IMAGE"] = "image";
|
|
10453
10528
|
EnumPostContentType2["LIST"] = "list";
|
|
10454
10529
|
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
@@ -11260,7 +11335,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
11260
11335
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
11261
11336
|
var NotificationModel = mongoose8.models.Notification || mongoose8.model("Notification", schema4);
|
|
11262
11337
|
|
|
11263
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
11338
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-VE6JFCH2.mjs
|
|
11264
11339
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
11265
11340
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
11266
11341
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -11794,6 +11869,35 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
11794
11869
|
);
|
|
11795
11870
|
var AppSettingModel = mongoose18.models.AppSetting || mongoose18.model("AppSetting", AppSettingSchema);
|
|
11796
11871
|
|
|
11872
|
+
// src/mongoose/game/Game.ts
|
|
11873
|
+
import mongoose19 from "mongoose";
|
|
11874
|
+
var MongooseSchema19 = mongoose19.Schema;
|
|
11875
|
+
var schemaDailyClue = new MongooseSchema19(
|
|
11876
|
+
{
|
|
11877
|
+
collectedLetters: { default: [], required: false, type: [String] },
|
|
11878
|
+
gameEndDate: { default: null, required: true, type: String },
|
|
11879
|
+
lastFoundDate: { default: null, required: false, type: String },
|
|
11880
|
+
points: { default: 0, required: true, type: Number },
|
|
11881
|
+
streak: { default: 0, required: true, type: Number }
|
|
11882
|
+
},
|
|
11883
|
+
{ _id: false }
|
|
11884
|
+
);
|
|
11885
|
+
var schema14 = new MongooseSchema19(
|
|
11886
|
+
{
|
|
11887
|
+
active: { default: false, required: true, type: Boolean },
|
|
11888
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
11889
|
+
gameData: {
|
|
11890
|
+
dailyClue: { default: null, required: false, type: schemaDailyClue }
|
|
11891
|
+
},
|
|
11892
|
+
owner: {
|
|
11893
|
+
required: true,
|
|
11894
|
+
type: OwnerTypeSchema
|
|
11895
|
+
}
|
|
11896
|
+
},
|
|
11897
|
+
{ timestamps: true }
|
|
11898
|
+
);
|
|
11899
|
+
var GameModel = mongoose19.models.Game || mongoose19.model("Game", schema14);
|
|
11900
|
+
|
|
11797
11901
|
export {
|
|
11798
11902
|
EnumUserLicence,
|
|
11799
11903
|
EnumAdStatus,
|
|
@@ -11807,6 +11911,7 @@ export {
|
|
|
11807
11911
|
relationDatesSchema,
|
|
11808
11912
|
RelationTypeSchema,
|
|
11809
11913
|
RelationModel,
|
|
11914
|
+
OwnerTypeSchema,
|
|
11810
11915
|
SocialMediaTypeSchema,
|
|
11811
11916
|
ResourceImageTypeSchema,
|
|
11812
11917
|
CategorySchema,
|
|
@@ -11830,7 +11935,8 @@ export {
|
|
|
11830
11935
|
PartnerModel,
|
|
11831
11936
|
PostModel,
|
|
11832
11937
|
APP_SETTINGS_ID,
|
|
11833
|
-
AppSettingModel
|
|
11938
|
+
AppSettingModel,
|
|
11939
|
+
GameModel
|
|
11834
11940
|
};
|
|
11835
11941
|
/*! Bundled license information:
|
|
11836
11942
|
|
|
@@ -11856,4 +11962,4 @@ react/cjs/react.development.js:
|
|
|
11856
11962
|
* LICENSE file in the root directory of this source tree.
|
|
11857
11963
|
*)
|
|
11858
11964
|
*/
|
|
11859
|
-
//# sourceMappingURL=chunk-
|
|
11965
|
+
//# sourceMappingURL=chunk-PLU34IF2.mjs.map
|