@timardex/cluemart-server-shared 1.0.110 → 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-7RUK3JKI.mjs → chunk-PLU34IF2.mjs} +193 -91
- package/dist/chunk-PLU34IF2.mjs.map +1 -0
- package/dist/index.cjs +199 -95
- 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 +197 -95
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +193 -89
- 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 +191 -91
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-7RUK3JKI.mjs.map +0 -1
package/dist/mongoose/index.cjs
CHANGED
|
@@ -1681,8 +1681,10 @@ __export(mongoose_exports, {
|
|
|
1681
1681
|
ChatReportModel: () => ChatReportModel,
|
|
1682
1682
|
EventInfoModel: () => EventInfoModel,
|
|
1683
1683
|
EventModel: () => EventModel,
|
|
1684
|
+
GameModel: () => GameModel,
|
|
1684
1685
|
GoogleImportedMarketModel: () => GoogleImportedMarketModel,
|
|
1685
1686
|
NotificationModel: () => NotificationModel,
|
|
1687
|
+
OwnerTypeSchema: () => OwnerTypeSchema,
|
|
1686
1688
|
ParticipantSchema: () => ParticipantSchema,
|
|
1687
1689
|
PartnerModel: () => PartnerModel,
|
|
1688
1690
|
PostModel: () => PostModel,
|
|
@@ -4723,10 +4725,10 @@ var Condition = class _Condition {
|
|
|
4723
4725
|
otherwise
|
|
4724
4726
|
} = config;
|
|
4725
4727
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4726
|
-
return new _Condition(refs, (values,
|
|
4728
|
+
return new _Condition(refs, (values, schema15) => {
|
|
4727
4729
|
var _branch;
|
|
4728
4730
|
let branch = check(...values) ? then : otherwise;
|
|
4729
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4731
|
+
return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
|
|
4730
4732
|
});
|
|
4731
4733
|
}
|
|
4732
4734
|
constructor(refs, builder) {
|
|
@@ -4740,13 +4742,13 @@ var Condition = class _Condition {
|
|
|
4740
4742
|
// TODO: ? operator here?
|
|
4741
4743
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4742
4744
|
));
|
|
4743
|
-
let
|
|
4744
|
-
if (
|
|
4745
|
-
|
|
4745
|
+
let schema15 = this.fn(values, base, options);
|
|
4746
|
+
if (schema15 === void 0 || // @ts-ignore this can be base
|
|
4747
|
+
schema15 === base) {
|
|
4746
4748
|
return base;
|
|
4747
4749
|
}
|
|
4748
|
-
if (!isSchema(
|
|
4749
|
-
return
|
|
4750
|
+
if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
|
|
4751
|
+
return schema15.resolve(options);
|
|
4750
4752
|
}
|
|
4751
4753
|
};
|
|
4752
4754
|
var prefixes = {
|
|
@@ -4816,7 +4818,7 @@ function createValidation(config) {
|
|
|
4816
4818
|
path = "",
|
|
4817
4819
|
options,
|
|
4818
4820
|
originalValue,
|
|
4819
|
-
schema:
|
|
4821
|
+
schema: schema15
|
|
4820
4822
|
}, panic, next) {
|
|
4821
4823
|
const {
|
|
4822
4824
|
name,
|
|
@@ -4828,8 +4830,8 @@ function createValidation(config) {
|
|
|
4828
4830
|
let {
|
|
4829
4831
|
parent,
|
|
4830
4832
|
context,
|
|
4831
|
-
abortEarly =
|
|
4832
|
-
disableStackTrace =
|
|
4833
|
+
abortEarly = schema15.spec.abortEarly,
|
|
4834
|
+
disableStackTrace = schema15.spec.disableStackTrace
|
|
4833
4835
|
} = options;
|
|
4834
4836
|
function resolve(item) {
|
|
4835
4837
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4838,9 +4840,9 @@ function createValidation(config) {
|
|
|
4838
4840
|
const nextParams = Object.assign({
|
|
4839
4841
|
value,
|
|
4840
4842
|
originalValue,
|
|
4841
|
-
label:
|
|
4843
|
+
label: schema15.spec.label,
|
|
4842
4844
|
path: overrides.path || path,
|
|
4843
|
-
spec:
|
|
4845
|
+
spec: schema15.spec,
|
|
4844
4846
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4845
4847
|
}, params, overrides.params);
|
|
4846
4848
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4858,7 +4860,7 @@ function createValidation(config) {
|
|
|
4858
4860
|
resolve,
|
|
4859
4861
|
options,
|
|
4860
4862
|
originalValue,
|
|
4861
|
-
schema:
|
|
4863
|
+
schema: schema15
|
|
4862
4864
|
};
|
|
4863
4865
|
const handleResult = (validOrError) => {
|
|
4864
4866
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4892,42 +4894,42 @@ function createValidation(config) {
|
|
|
4892
4894
|
validate.OPTIONS = config;
|
|
4893
4895
|
return validate;
|
|
4894
4896
|
}
|
|
4895
|
-
function getIn(
|
|
4897
|
+
function getIn(schema15, path, value, context = value) {
|
|
4896
4898
|
let parent, lastPart, lastPartDebug;
|
|
4897
4899
|
if (!path) return {
|
|
4898
4900
|
parent,
|
|
4899
4901
|
parentPath: path,
|
|
4900
|
-
schema:
|
|
4902
|
+
schema: schema15
|
|
4901
4903
|
};
|
|
4902
4904
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4903
4905
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4904
|
-
|
|
4906
|
+
schema15 = schema15.resolve({
|
|
4905
4907
|
context,
|
|
4906
4908
|
parent,
|
|
4907
4909
|
value
|
|
4908
4910
|
});
|
|
4909
|
-
let isTuple =
|
|
4911
|
+
let isTuple = schema15.type === "tuple";
|
|
4910
4912
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4911
|
-
if (
|
|
4913
|
+
if (schema15.innerType || isTuple) {
|
|
4912
4914
|
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]"`);
|
|
4913
4915
|
if (value && idx >= value.length) {
|
|
4914
4916
|
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. `);
|
|
4915
4917
|
}
|
|
4916
4918
|
parent = value;
|
|
4917
4919
|
value = value && value[idx];
|
|
4918
|
-
|
|
4920
|
+
schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
|
|
4919
4921
|
}
|
|
4920
4922
|
if (!isArray) {
|
|
4921
|
-
if (!
|
|
4923
|
+
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}")`);
|
|
4922
4924
|
parent = value;
|
|
4923
4925
|
value = value && value[part];
|
|
4924
|
-
|
|
4926
|
+
schema15 = schema15.fields[part];
|
|
4925
4927
|
}
|
|
4926
4928
|
lastPart = part;
|
|
4927
4929
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4928
4930
|
});
|
|
4929
4931
|
return {
|
|
4930
|
-
schema:
|
|
4932
|
+
schema: schema15,
|
|
4931
4933
|
parent,
|
|
4932
4934
|
parentPath: lastPart
|
|
4933
4935
|
};
|
|
@@ -5064,20 +5066,20 @@ var Schema = class {
|
|
|
5064
5066
|
this._mutate = before;
|
|
5065
5067
|
return result;
|
|
5066
5068
|
}
|
|
5067
|
-
concat(
|
|
5068
|
-
if (!
|
|
5069
|
-
if (
|
|
5069
|
+
concat(schema15) {
|
|
5070
|
+
if (!schema15 || schema15 === this) return this;
|
|
5071
|
+
if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
|
|
5070
5072
|
let base = this;
|
|
5071
|
-
let combined =
|
|
5073
|
+
let combined = schema15.clone();
|
|
5072
5074
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5073
5075
|
combined.spec = mergedSpec;
|
|
5074
5076
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5075
|
-
combined._whitelist = base._whitelist.merge(
|
|
5076
|
-
combined._blacklist = base._blacklist.merge(
|
|
5077
|
+
combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
|
|
5078
|
+
combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
|
|
5077
5079
|
combined.tests = base.tests;
|
|
5078
5080
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5079
5081
|
combined.withMutation((next) => {
|
|
5080
|
-
|
|
5082
|
+
schema15.tests.forEach((fn) => {
|
|
5081
5083
|
next.test(fn.OPTIONS);
|
|
5082
5084
|
});
|
|
5083
5085
|
});
|
|
@@ -5093,15 +5095,15 @@ var Schema = class {
|
|
|
5093
5095
|
return this._typeCheck(v);
|
|
5094
5096
|
}
|
|
5095
5097
|
resolve(options) {
|
|
5096
|
-
let
|
|
5097
|
-
if (
|
|
5098
|
-
let conditions =
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5098
|
+
let schema15 = this;
|
|
5099
|
+
if (schema15.conditions.length) {
|
|
5100
|
+
let conditions = schema15.conditions;
|
|
5101
|
+
schema15 = schema15.clone();
|
|
5102
|
+
schema15.conditions = [];
|
|
5103
|
+
schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
|
|
5104
|
+
schema15 = schema15.resolve(options);
|
|
5103
5105
|
}
|
|
5104
|
-
return
|
|
5106
|
+
return schema15;
|
|
5105
5107
|
}
|
|
5106
5108
|
resolveOptions(options) {
|
|
5107
5109
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5255,11 +5257,11 @@ attempted value: ${formattedValue}
|
|
|
5255
5257
|
}
|
|
5256
5258
|
validate(value, options) {
|
|
5257
5259
|
var _options$disableStack2;
|
|
5258
|
-
let
|
|
5260
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5259
5261
|
value
|
|
5260
5262
|
}));
|
|
5261
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5262
|
-
return new Promise((resolve, reject) =>
|
|
5263
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
|
|
5264
|
+
return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
|
|
5263
5265
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5264
5266
|
reject(error);
|
|
5265
5267
|
}, (errors, validated) => {
|
|
@@ -5269,12 +5271,12 @@ attempted value: ${formattedValue}
|
|
|
5269
5271
|
}
|
|
5270
5272
|
validateSync(value, options) {
|
|
5271
5273
|
var _options$disableStack3;
|
|
5272
|
-
let
|
|
5274
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5273
5275
|
value
|
|
5274
5276
|
}));
|
|
5275
5277
|
let result;
|
|
5276
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5277
|
-
|
|
5278
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
|
|
5279
|
+
schema15._validate(value, Object.assign({}, options, {
|
|
5278
5280
|
sync: true
|
|
5279
5281
|
}), (error, parsed) => {
|
|
5280
5282
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5308,8 +5310,8 @@ attempted value: ${formattedValue}
|
|
|
5308
5310
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5309
5311
|
}
|
|
5310
5312
|
getDefault(options) {
|
|
5311
|
-
let
|
|
5312
|
-
return
|
|
5313
|
+
let schema15 = this.resolve(options || {});
|
|
5314
|
+
return schema15._getDefault(options);
|
|
5313
5315
|
}
|
|
5314
5316
|
default(def) {
|
|
5315
5317
|
if (arguments.length === 0) {
|
|
@@ -5544,9 +5546,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5544
5546
|
const {
|
|
5545
5547
|
parent,
|
|
5546
5548
|
parentPath,
|
|
5547
|
-
schema:
|
|
5549
|
+
schema: schema15
|
|
5548
5550
|
} = getIn(this, path, value, options.context);
|
|
5549
|
-
return
|
|
5551
|
+
return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5550
5552
|
parent,
|
|
5551
5553
|
path
|
|
5552
5554
|
}));
|
|
@@ -5720,7 +5722,7 @@ var StringSchema = class extends Schema {
|
|
|
5720
5722
|
});
|
|
5721
5723
|
}
|
|
5722
5724
|
required(message) {
|
|
5723
|
-
return super.required(message).withMutation((
|
|
5725
|
+
return super.required(message).withMutation((schema15) => schema15.test({
|
|
5724
5726
|
message: message || mixed.required,
|
|
5725
5727
|
name: "required",
|
|
5726
5728
|
skipAbsent: true,
|
|
@@ -5728,9 +5730,9 @@ var StringSchema = class extends Schema {
|
|
|
5728
5730
|
}));
|
|
5729
5731
|
}
|
|
5730
5732
|
notRequired() {
|
|
5731
|
-
return super.notRequired().withMutation((
|
|
5732
|
-
|
|
5733
|
-
return
|
|
5733
|
+
return super.notRequired().withMutation((schema15) => {
|
|
5734
|
+
schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5735
|
+
return schema15;
|
|
5734
5736
|
});
|
|
5735
5737
|
}
|
|
5736
5738
|
length(length, message = string.length) {
|
|
@@ -6119,28 +6121,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6119
6121
|
}
|
|
6120
6122
|
return ctx.isType(parsed) ? parsed : value;
|
|
6121
6123
|
};
|
|
6122
|
-
function deepPartial(
|
|
6123
|
-
if ("fields" in
|
|
6124
|
+
function deepPartial(schema15) {
|
|
6125
|
+
if ("fields" in schema15) {
|
|
6124
6126
|
const partial = {};
|
|
6125
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6127
|
+
for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
|
|
6126
6128
|
partial[key] = deepPartial(fieldSchema);
|
|
6127
6129
|
}
|
|
6128
|
-
return
|
|
6130
|
+
return schema15.setFields(partial);
|
|
6129
6131
|
}
|
|
6130
|
-
if (
|
|
6131
|
-
const nextArray =
|
|
6132
|
+
if (schema15.type === "array") {
|
|
6133
|
+
const nextArray = schema15.optional();
|
|
6132
6134
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6133
6135
|
return nextArray;
|
|
6134
6136
|
}
|
|
6135
|
-
if (
|
|
6136
|
-
return
|
|
6137
|
-
types:
|
|
6137
|
+
if (schema15.type === "tuple") {
|
|
6138
|
+
return schema15.optional().clone({
|
|
6139
|
+
types: schema15.spec.types.map(deepPartial)
|
|
6138
6140
|
});
|
|
6139
6141
|
}
|
|
6140
|
-
if ("optional" in
|
|
6141
|
-
return
|
|
6142
|
+
if ("optional" in schema15) {
|
|
6143
|
+
return schema15.optional();
|
|
6142
6144
|
}
|
|
6143
|
-
return
|
|
6145
|
+
return schema15;
|
|
6144
6146
|
}
|
|
6145
6147
|
var deepHas = (obj, p) => {
|
|
6146
6148
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6274,8 +6276,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6274
6276
|
next._sortErrors = this._sortErrors;
|
|
6275
6277
|
return next;
|
|
6276
6278
|
}
|
|
6277
|
-
concat(
|
|
6278
|
-
let next = super.concat(
|
|
6279
|
+
concat(schema15) {
|
|
6280
|
+
let next = super.concat(schema15);
|
|
6279
6281
|
let nextFields = next.fields;
|
|
6280
6282
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6281
6283
|
const target = nextFields[field];
|
|
@@ -6283,7 +6285,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6283
6285
|
}
|
|
6284
6286
|
return next.withMutation((s) => (
|
|
6285
6287
|
// XXX: excludes here is wrong
|
|
6286
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6288
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
|
|
6287
6289
|
));
|
|
6288
6290
|
}
|
|
6289
6291
|
_getDefault(options) {
|
|
@@ -6328,8 +6330,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6328
6330
|
}
|
|
6329
6331
|
partial() {
|
|
6330
6332
|
const partial = {};
|
|
6331
|
-
for (const [key,
|
|
6332
|
-
partial[key] = "optional" in
|
|
6333
|
+
for (const [key, schema15] of Object.entries(this.fields)) {
|
|
6334
|
+
partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
|
|
6333
6335
|
}
|
|
6334
6336
|
return this.setFields(partial);
|
|
6335
6337
|
}
|
|
@@ -6527,22 +6529,22 @@ var ArraySchema = class extends Schema {
|
|
|
6527
6529
|
json() {
|
|
6528
6530
|
return this.transform(parseJson);
|
|
6529
6531
|
}
|
|
6530
|
-
concat(
|
|
6531
|
-
let next = super.concat(
|
|
6532
|
+
concat(schema15) {
|
|
6533
|
+
let next = super.concat(schema15);
|
|
6532
6534
|
next.innerType = this.innerType;
|
|
6533
|
-
if (
|
|
6535
|
+
if (schema15.innerType)
|
|
6534
6536
|
next.innerType = next.innerType ? (
|
|
6535
6537
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6536
|
-
next.innerType.concat(
|
|
6537
|
-
) :
|
|
6538
|
+
next.innerType.concat(schema15.innerType)
|
|
6539
|
+
) : schema15.innerType;
|
|
6538
6540
|
return next;
|
|
6539
6541
|
}
|
|
6540
|
-
of(
|
|
6542
|
+
of(schema15) {
|
|
6541
6543
|
let next = this.clone();
|
|
6542
|
-
if (!isSchema(
|
|
6543
|
-
next.innerType =
|
|
6544
|
+
if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
|
|
6545
|
+
next.innerType = schema15;
|
|
6544
6546
|
next.spec = Object.assign({}, next.spec, {
|
|
6545
|
-
types:
|
|
6547
|
+
types: schema15
|
|
6546
6548
|
});
|
|
6547
6549
|
return next;
|
|
6548
6550
|
}
|
|
@@ -6686,7 +6688,7 @@ var TupleSchema = class extends Schema {
|
|
|
6686
6688
|
describe(options) {
|
|
6687
6689
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6688
6690
|
const base = super.describe(options);
|
|
6689
|
-
base.innerType = next.spec.types.map((
|
|
6691
|
+
base.innerType = next.spec.types.map((schema15, index) => {
|
|
6690
6692
|
var _innerOptions;
|
|
6691
6693
|
let innerOptions = options;
|
|
6692
6694
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6695,7 +6697,7 @@ var TupleSchema = class extends Schema {
|
|
|
6695
6697
|
value: innerOptions.value[index]
|
|
6696
6698
|
});
|
|
6697
6699
|
}
|
|
6698
|
-
return
|
|
6700
|
+
return schema15.describe(innerOptions);
|
|
6699
6701
|
});
|
|
6700
6702
|
return base;
|
|
6701
6703
|
}
|
|
@@ -8308,12 +8310,14 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8308
8310
|
email
|
|
8309
8311
|
events
|
|
8310
8312
|
firstName
|
|
8313
|
+
games
|
|
8311
8314
|
isTester
|
|
8312
8315
|
lastName
|
|
8313
8316
|
licences {
|
|
8314
8317
|
...LicenceFields
|
|
8315
8318
|
}
|
|
8316
8319
|
partner
|
|
8320
|
+
points
|
|
8317
8321
|
platform
|
|
8318
8322
|
preferredRegion
|
|
8319
8323
|
promoCodes
|
|
@@ -9877,6 +9881,14 @@ var DELETE_PARTNER_MUTATION = gql`
|
|
|
9877
9881
|
`;
|
|
9878
9882
|
var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
|
|
9879
9883
|
fragment PostContentDataFields on PostContentData {
|
|
9884
|
+
game {
|
|
9885
|
+
title
|
|
9886
|
+
gameType
|
|
9887
|
+
gameInfo {
|
|
9888
|
+
dailyClue
|
|
9889
|
+
}
|
|
9890
|
+
gameEndDate
|
|
9891
|
+
}
|
|
9880
9892
|
textarea {
|
|
9881
9893
|
title
|
|
9882
9894
|
data
|
|
@@ -10014,6 +10026,66 @@ var GET_APP_SETTINGS = gql`
|
|
|
10014
10026
|
}
|
|
10015
10027
|
${APP_SETTINGS_FIELDS_FRAGMENT}
|
|
10016
10028
|
`;
|
|
10029
|
+
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
|
|
10030
|
+
fragment DailyClueGameDataFields on DailyClueGameDataType {
|
|
10031
|
+
lastFoundDate
|
|
10032
|
+
streak
|
|
10033
|
+
points
|
|
10034
|
+
collectedLetters
|
|
10035
|
+
gameEndDate
|
|
10036
|
+
}
|
|
10037
|
+
`;
|
|
10038
|
+
var GAME_FIELDS_FRAGMENT = gql`
|
|
10039
|
+
fragment GameFields on GameType {
|
|
10040
|
+
_id
|
|
10041
|
+
active
|
|
10042
|
+
createdAt
|
|
10043
|
+
deletedAt
|
|
10044
|
+
gameData {
|
|
10045
|
+
dailyClue {
|
|
10046
|
+
...DailyClueGameDataFields
|
|
10047
|
+
}
|
|
10048
|
+
}
|
|
10049
|
+
updatedAt
|
|
10050
|
+
owner {
|
|
10051
|
+
...OwnerFields
|
|
10052
|
+
}
|
|
10053
|
+
}
|
|
10054
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
10055
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10056
|
+
`;
|
|
10057
|
+
var GET_GAMES = gql`
|
|
10058
|
+
query getGames($userId: ID) {
|
|
10059
|
+
games(userId: $userId) {
|
|
10060
|
+
...GameFields
|
|
10061
|
+
}
|
|
10062
|
+
}
|
|
10063
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10064
|
+
`;
|
|
10065
|
+
var GET_GAME = gql`
|
|
10066
|
+
query getGame($_id: ID!) {
|
|
10067
|
+
game(_id: $_id) {
|
|
10068
|
+
...GameFields
|
|
10069
|
+
}
|
|
10070
|
+
}
|
|
10071
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10072
|
+
`;
|
|
10073
|
+
var START_GAME_MUTATION = gql`
|
|
10074
|
+
mutation startGame($input: GameInputType!) {
|
|
10075
|
+
startGame(input: $input) {
|
|
10076
|
+
...GameFields
|
|
10077
|
+
}
|
|
10078
|
+
}
|
|
10079
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10080
|
+
`;
|
|
10081
|
+
var LEAVE_GAME_MUTATION = gql`
|
|
10082
|
+
mutation leaveGame($_id: ID!) {
|
|
10083
|
+
leaveGame(_id: $_id) {
|
|
10084
|
+
...GameFields
|
|
10085
|
+
}
|
|
10086
|
+
}
|
|
10087
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10088
|
+
`;
|
|
10017
10089
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10018
10090
|
var nzbnRegex = /^94\d{11}$/;
|
|
10019
10091
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10165,7 +10237,7 @@ var socialMediaSchema = create$3({
|
|
|
10165
10237
|
is: (name) => !!name,
|
|
10166
10238
|
// If name has a value
|
|
10167
10239
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10168
|
-
otherwise: (
|
|
10240
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10169
10241
|
})
|
|
10170
10242
|
});
|
|
10171
10243
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10241,21 +10313,21 @@ var paymentInfoSchema = create$3({
|
|
|
10241
10313
|
).required("Please select a Payment method"),
|
|
10242
10314
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10243
10315
|
is: "bank_transfer",
|
|
10244
|
-
then: (
|
|
10245
|
-
otherwise: (
|
|
10316
|
+
then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
|
|
10317
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10246
10318
|
}),
|
|
10247
10319
|
accountNumber: create$6().when("paymentMethod", {
|
|
10248
10320
|
is: "bank_transfer",
|
|
10249
|
-
then: (
|
|
10321
|
+
then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
|
|
10250
10322
|
nzBankAccountRegex,
|
|
10251
10323
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10252
10324
|
).trim(),
|
|
10253
|
-
otherwise: (
|
|
10325
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10254
10326
|
}),
|
|
10255
10327
|
link: create$6().when("paymentMethod", {
|
|
10256
10328
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10257
10329
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10258
|
-
otherwise: (
|
|
10330
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10259
10331
|
})
|
|
10260
10332
|
});
|
|
10261
10333
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10413,8 +10485,8 @@ var userSchema = create$3().shape({
|
|
|
10413
10485
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10414
10486
|
is: (val) => !!val,
|
|
10415
10487
|
// only necessary if password typed
|
|
10416
|
-
then: (
|
|
10417
|
-
otherwise: (
|
|
10488
|
+
then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10489
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10418
10490
|
}),
|
|
10419
10491
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10420
10492
|
});
|
|
@@ -10485,7 +10557,7 @@ var adSchema = create$3().shape({
|
|
|
10485
10557
|
return endDate > now;
|
|
10486
10558
|
}).when("start", {
|
|
10487
10559
|
is: (val) => val && val.length > 0,
|
|
10488
|
-
then: (
|
|
10560
|
+
then: (schema15) => schema15.test(
|
|
10489
10561
|
"is-after-start",
|
|
10490
10562
|
"End date must be after start date",
|
|
10491
10563
|
function(value) {
|
|
@@ -10520,6 +10592,7 @@ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
|
10520
10592
|
return EnumPostType2;
|
|
10521
10593
|
})(EnumPostType || {});
|
|
10522
10594
|
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
10595
|
+
EnumPostContentType2["GAME"] = "game";
|
|
10523
10596
|
EnumPostContentType2["IMAGE"] = "image";
|
|
10524
10597
|
EnumPostContentType2["LIST"] = "list";
|
|
10525
10598
|
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
@@ -11331,7 +11404,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
11331
11404
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
11332
11405
|
var NotificationModel = import_mongoose8.default.models.Notification || import_mongoose8.default.model("Notification", schema4);
|
|
11333
11406
|
|
|
11334
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
11407
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-VE6JFCH2.mjs
|
|
11335
11408
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
11336
11409
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
11337
11410
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -11864,6 +11937,35 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
11864
11937
|
{ timestamps: true }
|
|
11865
11938
|
);
|
|
11866
11939
|
var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mongoose18.default.model("AppSetting", AppSettingSchema);
|
|
11940
|
+
|
|
11941
|
+
// src/mongoose/game/Game.ts
|
|
11942
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
11943
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
11944
|
+
var schemaDailyClue = new MongooseSchema19(
|
|
11945
|
+
{
|
|
11946
|
+
collectedLetters: { default: [], required: false, type: [String] },
|
|
11947
|
+
gameEndDate: { default: null, required: true, type: String },
|
|
11948
|
+
lastFoundDate: { default: null, required: false, type: String },
|
|
11949
|
+
points: { default: 0, required: true, type: Number },
|
|
11950
|
+
streak: { default: 0, required: true, type: Number }
|
|
11951
|
+
},
|
|
11952
|
+
{ _id: false }
|
|
11953
|
+
);
|
|
11954
|
+
var schema14 = new MongooseSchema19(
|
|
11955
|
+
{
|
|
11956
|
+
active: { default: false, required: true, type: Boolean },
|
|
11957
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
11958
|
+
gameData: {
|
|
11959
|
+
dailyClue: { default: null, required: false, type: schemaDailyClue }
|
|
11960
|
+
},
|
|
11961
|
+
owner: {
|
|
11962
|
+
required: true,
|
|
11963
|
+
type: OwnerTypeSchema
|
|
11964
|
+
}
|
|
11965
|
+
},
|
|
11966
|
+
{ timestamps: true }
|
|
11967
|
+
);
|
|
11968
|
+
var GameModel = import_mongoose19.default.models.Game || import_mongoose19.default.model("Game", schema14);
|
|
11867
11969
|
// Annotate the CommonJS export names for ESM import in node:
|
|
11868
11970
|
0 && (module.exports = {
|
|
11869
11971
|
APP_SETTINGS_ID,
|
|
@@ -11874,8 +11976,10 @@ var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mong
|
|
|
11874
11976
|
ChatReportModel,
|
|
11875
11977
|
EventInfoModel,
|
|
11876
11978
|
EventModel,
|
|
11979
|
+
GameModel,
|
|
11877
11980
|
GoogleImportedMarketModel,
|
|
11878
11981
|
NotificationModel,
|
|
11982
|
+
OwnerTypeSchema,
|
|
11879
11983
|
ParticipantSchema,
|
|
11880
11984
|
PartnerModel,
|
|
11881
11985
|
PostModel,
|