@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/index.cjs
CHANGED
|
@@ -1682,8 +1682,10 @@ __export(index_exports, {
|
|
|
1682
1682
|
EnumPubSubEvents: () => EnumPubSubEvents,
|
|
1683
1683
|
EventInfoModel: () => EventInfoModel,
|
|
1684
1684
|
EventModel: () => EventModel,
|
|
1685
|
+
GameModel: () => GameModel,
|
|
1685
1686
|
GoogleImportedMarketModel: () => GoogleImportedMarketModel,
|
|
1686
1687
|
NotificationModel: () => NotificationModel,
|
|
1688
|
+
OwnerTypeSchema: () => OwnerTypeSchema,
|
|
1687
1689
|
ParticipantSchema: () => ParticipantSchema,
|
|
1688
1690
|
PartnerModel: () => PartnerModel,
|
|
1689
1691
|
PostModel: () => PostModel,
|
|
@@ -1707,7 +1709,7 @@ __export(index_exports, {
|
|
|
1707
1709
|
findEventOrImportedMarketById: () => findEventOrImportedMarketById,
|
|
1708
1710
|
locationGeoSchema: () => locationGeoSchema,
|
|
1709
1711
|
locationsSchema: () => locationsSchema,
|
|
1710
|
-
mongoose: () =>
|
|
1712
|
+
mongoose: () => import_mongoose25.default,
|
|
1711
1713
|
refundPolicySchema: () => refundPolicySchema,
|
|
1712
1714
|
relationDatesSchema: () => relationDatesSchema,
|
|
1713
1715
|
resourceRelationsSchema: () => resourceRelationsSchema,
|
|
@@ -4733,10 +4735,10 @@ var Condition = class _Condition {
|
|
|
4733
4735
|
otherwise
|
|
4734
4736
|
} = config;
|
|
4735
4737
|
let check = typeof is === "function" ? is : (...values) => values.every((value) => value === is);
|
|
4736
|
-
return new _Condition(refs, (values,
|
|
4738
|
+
return new _Condition(refs, (values, schema15) => {
|
|
4737
4739
|
var _branch;
|
|
4738
4740
|
let branch = check(...values) ? then : otherwise;
|
|
4739
|
-
return (_branch = branch == null ? void 0 : branch(
|
|
4741
|
+
return (_branch = branch == null ? void 0 : branch(schema15)) != null ? _branch : schema15;
|
|
4740
4742
|
});
|
|
4741
4743
|
}
|
|
4742
4744
|
constructor(refs, builder) {
|
|
@@ -4750,13 +4752,13 @@ var Condition = class _Condition {
|
|
|
4750
4752
|
// TODO: ? operator here?
|
|
4751
4753
|
ref.getValue(options == null ? void 0 : options.value, options == null ? void 0 : options.parent, options == null ? void 0 : options.context)
|
|
4752
4754
|
));
|
|
4753
|
-
let
|
|
4754
|
-
if (
|
|
4755
|
-
|
|
4755
|
+
let schema15 = this.fn(values, base, options);
|
|
4756
|
+
if (schema15 === void 0 || // @ts-ignore this can be base
|
|
4757
|
+
schema15 === base) {
|
|
4756
4758
|
return base;
|
|
4757
4759
|
}
|
|
4758
|
-
if (!isSchema(
|
|
4759
|
-
return
|
|
4760
|
+
if (!isSchema(schema15)) throw new TypeError("conditions must return a schema object");
|
|
4761
|
+
return schema15.resolve(options);
|
|
4760
4762
|
}
|
|
4761
4763
|
};
|
|
4762
4764
|
var prefixes = {
|
|
@@ -4826,7 +4828,7 @@ function createValidation(config) {
|
|
|
4826
4828
|
path = "",
|
|
4827
4829
|
options,
|
|
4828
4830
|
originalValue,
|
|
4829
|
-
schema:
|
|
4831
|
+
schema: schema15
|
|
4830
4832
|
}, panic, next) {
|
|
4831
4833
|
const {
|
|
4832
4834
|
name,
|
|
@@ -4838,8 +4840,8 @@ function createValidation(config) {
|
|
|
4838
4840
|
let {
|
|
4839
4841
|
parent,
|
|
4840
4842
|
context,
|
|
4841
|
-
abortEarly =
|
|
4842
|
-
disableStackTrace =
|
|
4843
|
+
abortEarly = schema15.spec.abortEarly,
|
|
4844
|
+
disableStackTrace = schema15.spec.disableStackTrace
|
|
4843
4845
|
} = options;
|
|
4844
4846
|
function resolve(item) {
|
|
4845
4847
|
return Reference.isRef(item) ? item.getValue(value, parent, context) : item;
|
|
@@ -4848,9 +4850,9 @@ function createValidation(config) {
|
|
|
4848
4850
|
const nextParams = Object.assign({
|
|
4849
4851
|
value,
|
|
4850
4852
|
originalValue,
|
|
4851
|
-
label:
|
|
4853
|
+
label: schema15.spec.label,
|
|
4852
4854
|
path: overrides.path || path,
|
|
4853
|
-
spec:
|
|
4855
|
+
spec: schema15.spec,
|
|
4854
4856
|
disableStackTrace: overrides.disableStackTrace || disableStackTrace
|
|
4855
4857
|
}, params, overrides.params);
|
|
4856
4858
|
for (const key of Object.keys(nextParams)) nextParams[key] = resolve(nextParams[key]);
|
|
@@ -4868,7 +4870,7 @@ function createValidation(config) {
|
|
|
4868
4870
|
resolve,
|
|
4869
4871
|
options,
|
|
4870
4872
|
originalValue,
|
|
4871
|
-
schema:
|
|
4873
|
+
schema: schema15
|
|
4872
4874
|
};
|
|
4873
4875
|
const handleResult = (validOrError) => {
|
|
4874
4876
|
if (ValidationError.isError(validOrError)) invalid(validOrError);
|
|
@@ -4902,42 +4904,42 @@ function createValidation(config) {
|
|
|
4902
4904
|
validate.OPTIONS = config;
|
|
4903
4905
|
return validate;
|
|
4904
4906
|
}
|
|
4905
|
-
function getIn(
|
|
4907
|
+
function getIn(schema15, path, value, context = value) {
|
|
4906
4908
|
let parent, lastPart, lastPartDebug;
|
|
4907
4909
|
if (!path) return {
|
|
4908
4910
|
parent,
|
|
4909
4911
|
parentPath: path,
|
|
4910
|
-
schema:
|
|
4912
|
+
schema: schema15
|
|
4911
4913
|
};
|
|
4912
4914
|
(0, import_property_expr.forEach)(path, (_part, isBracket, isArray) => {
|
|
4913
4915
|
let part = isBracket ? _part.slice(1, _part.length - 1) : _part;
|
|
4914
|
-
|
|
4916
|
+
schema15 = schema15.resolve({
|
|
4915
4917
|
context,
|
|
4916
4918
|
parent,
|
|
4917
4919
|
value
|
|
4918
4920
|
});
|
|
4919
|
-
let isTuple =
|
|
4921
|
+
let isTuple = schema15.type === "tuple";
|
|
4920
4922
|
let idx = isArray ? parseInt(part, 10) : 0;
|
|
4921
|
-
if (
|
|
4923
|
+
if (schema15.innerType || isTuple) {
|
|
4922
4924
|
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]"`);
|
|
4923
4925
|
if (value && idx >= value.length) {
|
|
4924
4926
|
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. `);
|
|
4925
4927
|
}
|
|
4926
4928
|
parent = value;
|
|
4927
4929
|
value = value && value[idx];
|
|
4928
|
-
|
|
4930
|
+
schema15 = isTuple ? schema15.spec.types[idx] : schema15.innerType;
|
|
4929
4931
|
}
|
|
4930
4932
|
if (!isArray) {
|
|
4931
|
-
if (!
|
|
4933
|
+
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}")`);
|
|
4932
4934
|
parent = value;
|
|
4933
4935
|
value = value && value[part];
|
|
4934
|
-
|
|
4936
|
+
schema15 = schema15.fields[part];
|
|
4935
4937
|
}
|
|
4936
4938
|
lastPart = part;
|
|
4937
4939
|
lastPartDebug = isBracket ? "[" + _part + "]" : "." + _part;
|
|
4938
4940
|
});
|
|
4939
4941
|
return {
|
|
4940
|
-
schema:
|
|
4942
|
+
schema: schema15,
|
|
4941
4943
|
parent,
|
|
4942
4944
|
parentPath: lastPart
|
|
4943
4945
|
};
|
|
@@ -5074,20 +5076,20 @@ var Schema = class {
|
|
|
5074
5076
|
this._mutate = before;
|
|
5075
5077
|
return result;
|
|
5076
5078
|
}
|
|
5077
|
-
concat(
|
|
5078
|
-
if (!
|
|
5079
|
-
if (
|
|
5079
|
+
concat(schema15) {
|
|
5080
|
+
if (!schema15 || schema15 === this) return this;
|
|
5081
|
+
if (schema15.type !== this.type && this.type !== "mixed") throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${schema15.type}`);
|
|
5080
5082
|
let base = this;
|
|
5081
|
-
let combined =
|
|
5083
|
+
let combined = schema15.clone();
|
|
5082
5084
|
const mergedSpec = Object.assign({}, base.spec, combined.spec);
|
|
5083
5085
|
combined.spec = mergedSpec;
|
|
5084
5086
|
combined.internalTests = Object.assign({}, base.internalTests, combined.internalTests);
|
|
5085
|
-
combined._whitelist = base._whitelist.merge(
|
|
5086
|
-
combined._blacklist = base._blacklist.merge(
|
|
5087
|
+
combined._whitelist = base._whitelist.merge(schema15._whitelist, schema15._blacklist);
|
|
5088
|
+
combined._blacklist = base._blacklist.merge(schema15._blacklist, schema15._whitelist);
|
|
5087
5089
|
combined.tests = base.tests;
|
|
5088
5090
|
combined.exclusiveTests = base.exclusiveTests;
|
|
5089
5091
|
combined.withMutation((next) => {
|
|
5090
|
-
|
|
5092
|
+
schema15.tests.forEach((fn) => {
|
|
5091
5093
|
next.test(fn.OPTIONS);
|
|
5092
5094
|
});
|
|
5093
5095
|
});
|
|
@@ -5103,15 +5105,15 @@ var Schema = class {
|
|
|
5103
5105
|
return this._typeCheck(v);
|
|
5104
5106
|
}
|
|
5105
5107
|
resolve(options) {
|
|
5106
|
-
let
|
|
5107
|
-
if (
|
|
5108
|
-
let conditions =
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5108
|
+
let schema15 = this;
|
|
5109
|
+
if (schema15.conditions.length) {
|
|
5110
|
+
let conditions = schema15.conditions;
|
|
5111
|
+
schema15 = schema15.clone();
|
|
5112
|
+
schema15.conditions = [];
|
|
5113
|
+
schema15 = conditions.reduce((prevSchema, condition) => condition.resolve(prevSchema, options), schema15);
|
|
5114
|
+
schema15 = schema15.resolve(options);
|
|
5113
5115
|
}
|
|
5114
|
-
return
|
|
5116
|
+
return schema15;
|
|
5115
5117
|
}
|
|
5116
5118
|
resolveOptions(options) {
|
|
5117
5119
|
var _options$strict, _options$abortEarly, _options$recursive, _options$disableStack;
|
|
@@ -5265,11 +5267,11 @@ attempted value: ${formattedValue}
|
|
|
5265
5267
|
}
|
|
5266
5268
|
validate(value, options) {
|
|
5267
5269
|
var _options$disableStack2;
|
|
5268
|
-
let
|
|
5270
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5269
5271
|
value
|
|
5270
5272
|
}));
|
|
5271
|
-
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 :
|
|
5272
|
-
return new Promise((resolve, reject) =>
|
|
5273
|
+
let disableStackTrace = (_options$disableStack2 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack2 : schema15.spec.disableStackTrace;
|
|
5274
|
+
return new Promise((resolve, reject) => schema15._validate(value, options, (error, parsed) => {
|
|
5273
5275
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
5274
5276
|
reject(error);
|
|
5275
5277
|
}, (errors, validated) => {
|
|
@@ -5279,12 +5281,12 @@ attempted value: ${formattedValue}
|
|
|
5279
5281
|
}
|
|
5280
5282
|
validateSync(value, options) {
|
|
5281
5283
|
var _options$disableStack3;
|
|
5282
|
-
let
|
|
5284
|
+
let schema15 = this.resolve(Object.assign({}, options, {
|
|
5283
5285
|
value
|
|
5284
5286
|
}));
|
|
5285
5287
|
let result;
|
|
5286
|
-
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 :
|
|
5287
|
-
|
|
5288
|
+
let disableStackTrace = (_options$disableStack3 = options == null ? void 0 : options.disableStackTrace) != null ? _options$disableStack3 : schema15.spec.disableStackTrace;
|
|
5289
|
+
schema15._validate(value, Object.assign({}, options, {
|
|
5288
5290
|
sync: true
|
|
5289
5291
|
}), (error, parsed) => {
|
|
5290
5292
|
if (ValidationError.isError(error)) error.value = parsed;
|
|
@@ -5318,8 +5320,8 @@ attempted value: ${formattedValue}
|
|
|
5318
5320
|
return typeof defaultValue === "function" ? defaultValue.call(this, options) : clone(defaultValue);
|
|
5319
5321
|
}
|
|
5320
5322
|
getDefault(options) {
|
|
5321
|
-
let
|
|
5322
|
-
return
|
|
5323
|
+
let schema15 = this.resolve(options || {});
|
|
5324
|
+
return schema15._getDefault(options);
|
|
5323
5325
|
}
|
|
5324
5326
|
default(def) {
|
|
5325
5327
|
if (arguments.length === 0) {
|
|
@@ -5554,9 +5556,9 @@ for (const method of ["validate", "validateSync"]) Schema.prototype[`${method}At
|
|
|
5554
5556
|
const {
|
|
5555
5557
|
parent,
|
|
5556
5558
|
parentPath,
|
|
5557
|
-
schema:
|
|
5559
|
+
schema: schema15
|
|
5558
5560
|
} = getIn(this, path, value, options.context);
|
|
5559
|
-
return
|
|
5561
|
+
return schema15[method](parent && parent[parentPath], Object.assign({}, options, {
|
|
5560
5562
|
parent,
|
|
5561
5563
|
path
|
|
5562
5564
|
}));
|
|
@@ -5730,7 +5732,7 @@ var StringSchema = class extends Schema {
|
|
|
5730
5732
|
});
|
|
5731
5733
|
}
|
|
5732
5734
|
required(message) {
|
|
5733
|
-
return super.required(message).withMutation((
|
|
5735
|
+
return super.required(message).withMutation((schema15) => schema15.test({
|
|
5734
5736
|
message: message || mixed.required,
|
|
5735
5737
|
name: "required",
|
|
5736
5738
|
skipAbsent: true,
|
|
@@ -5738,9 +5740,9 @@ var StringSchema = class extends Schema {
|
|
|
5738
5740
|
}));
|
|
5739
5741
|
}
|
|
5740
5742
|
notRequired() {
|
|
5741
|
-
return super.notRequired().withMutation((
|
|
5742
|
-
|
|
5743
|
-
return
|
|
5743
|
+
return super.notRequired().withMutation((schema15) => {
|
|
5744
|
+
schema15.tests = schema15.tests.filter((t) => t.OPTIONS.name !== "required");
|
|
5745
|
+
return schema15;
|
|
5744
5746
|
});
|
|
5745
5747
|
}
|
|
5746
5748
|
length(length, message = string.length) {
|
|
@@ -6129,28 +6131,28 @@ var parseJson = (value, _, ctx) => {
|
|
|
6129
6131
|
}
|
|
6130
6132
|
return ctx.isType(parsed) ? parsed : value;
|
|
6131
6133
|
};
|
|
6132
|
-
function deepPartial(
|
|
6133
|
-
if ("fields" in
|
|
6134
|
+
function deepPartial(schema15) {
|
|
6135
|
+
if ("fields" in schema15) {
|
|
6134
6136
|
const partial = {};
|
|
6135
|
-
for (const [key, fieldSchema] of Object.entries(
|
|
6137
|
+
for (const [key, fieldSchema] of Object.entries(schema15.fields)) {
|
|
6136
6138
|
partial[key] = deepPartial(fieldSchema);
|
|
6137
6139
|
}
|
|
6138
|
-
return
|
|
6140
|
+
return schema15.setFields(partial);
|
|
6139
6141
|
}
|
|
6140
|
-
if (
|
|
6141
|
-
const nextArray =
|
|
6142
|
+
if (schema15.type === "array") {
|
|
6143
|
+
const nextArray = schema15.optional();
|
|
6142
6144
|
if (nextArray.innerType) nextArray.innerType = deepPartial(nextArray.innerType);
|
|
6143
6145
|
return nextArray;
|
|
6144
6146
|
}
|
|
6145
|
-
if (
|
|
6146
|
-
return
|
|
6147
|
-
types:
|
|
6147
|
+
if (schema15.type === "tuple") {
|
|
6148
|
+
return schema15.optional().clone({
|
|
6149
|
+
types: schema15.spec.types.map(deepPartial)
|
|
6148
6150
|
});
|
|
6149
6151
|
}
|
|
6150
|
-
if ("optional" in
|
|
6151
|
-
return
|
|
6152
|
+
if ("optional" in schema15) {
|
|
6153
|
+
return schema15.optional();
|
|
6152
6154
|
}
|
|
6153
|
-
return
|
|
6155
|
+
return schema15;
|
|
6154
6156
|
}
|
|
6155
6157
|
var deepHas = (obj, p) => {
|
|
6156
6158
|
const path = [...(0, import_property_expr.normalizePath)(p)];
|
|
@@ -6284,8 +6286,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6284
6286
|
next._sortErrors = this._sortErrors;
|
|
6285
6287
|
return next;
|
|
6286
6288
|
}
|
|
6287
|
-
concat(
|
|
6288
|
-
let next = super.concat(
|
|
6289
|
+
concat(schema15) {
|
|
6290
|
+
let next = super.concat(schema15);
|
|
6289
6291
|
let nextFields = next.fields;
|
|
6290
6292
|
for (let [field, schemaOrRef] of Object.entries(this.fields)) {
|
|
6291
6293
|
const target = nextFields[field];
|
|
@@ -6293,7 +6295,7 @@ var ObjectSchema = class extends Schema {
|
|
|
6293
6295
|
}
|
|
6294
6296
|
return next.withMutation((s) => (
|
|
6295
6297
|
// XXX: excludes here is wrong
|
|
6296
|
-
s.setFields(nextFields, [...this._excludedEdges, ...
|
|
6298
|
+
s.setFields(nextFields, [...this._excludedEdges, ...schema15._excludedEdges])
|
|
6297
6299
|
));
|
|
6298
6300
|
}
|
|
6299
6301
|
_getDefault(options) {
|
|
@@ -6338,8 +6340,8 @@ var ObjectSchema = class extends Schema {
|
|
|
6338
6340
|
}
|
|
6339
6341
|
partial() {
|
|
6340
6342
|
const partial = {};
|
|
6341
|
-
for (const [key,
|
|
6342
|
-
partial[key] = "optional" in
|
|
6343
|
+
for (const [key, schema15] of Object.entries(this.fields)) {
|
|
6344
|
+
partial[key] = "optional" in schema15 && schema15.optional instanceof Function ? schema15.optional() : schema15;
|
|
6343
6345
|
}
|
|
6344
6346
|
return this.setFields(partial);
|
|
6345
6347
|
}
|
|
@@ -6537,22 +6539,22 @@ var ArraySchema = class extends Schema {
|
|
|
6537
6539
|
json() {
|
|
6538
6540
|
return this.transform(parseJson);
|
|
6539
6541
|
}
|
|
6540
|
-
concat(
|
|
6541
|
-
let next = super.concat(
|
|
6542
|
+
concat(schema15) {
|
|
6543
|
+
let next = super.concat(schema15);
|
|
6542
6544
|
next.innerType = this.innerType;
|
|
6543
|
-
if (
|
|
6545
|
+
if (schema15.innerType)
|
|
6544
6546
|
next.innerType = next.innerType ? (
|
|
6545
6547
|
// @ts-expect-error Lazy doesn't have concat and will break
|
|
6546
|
-
next.innerType.concat(
|
|
6547
|
-
) :
|
|
6548
|
+
next.innerType.concat(schema15.innerType)
|
|
6549
|
+
) : schema15.innerType;
|
|
6548
6550
|
return next;
|
|
6549
6551
|
}
|
|
6550
|
-
of(
|
|
6552
|
+
of(schema15) {
|
|
6551
6553
|
let next = this.clone();
|
|
6552
|
-
if (!isSchema(
|
|
6553
|
-
next.innerType =
|
|
6554
|
+
if (!isSchema(schema15)) throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: " + printValue(schema15));
|
|
6555
|
+
next.innerType = schema15;
|
|
6554
6556
|
next.spec = Object.assign({}, next.spec, {
|
|
6555
|
-
types:
|
|
6557
|
+
types: schema15
|
|
6556
6558
|
});
|
|
6557
6559
|
return next;
|
|
6558
6560
|
}
|
|
@@ -6696,7 +6698,7 @@ var TupleSchema = class extends Schema {
|
|
|
6696
6698
|
describe(options) {
|
|
6697
6699
|
const next = (options ? this.resolve(options) : this).clone();
|
|
6698
6700
|
const base = super.describe(options);
|
|
6699
|
-
base.innerType = next.spec.types.map((
|
|
6701
|
+
base.innerType = next.spec.types.map((schema15, index) => {
|
|
6700
6702
|
var _innerOptions;
|
|
6701
6703
|
let innerOptions = options;
|
|
6702
6704
|
if ((_innerOptions = innerOptions) != null && _innerOptions.value) {
|
|
@@ -6705,7 +6707,7 @@ var TupleSchema = class extends Schema {
|
|
|
6705
6707
|
value: innerOptions.value[index]
|
|
6706
6708
|
});
|
|
6707
6709
|
}
|
|
6708
|
-
return
|
|
6710
|
+
return schema15.describe(innerOptions);
|
|
6709
6711
|
});
|
|
6710
6712
|
return base;
|
|
6711
6713
|
}
|
|
@@ -8318,12 +8320,14 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8318
8320
|
email
|
|
8319
8321
|
events
|
|
8320
8322
|
firstName
|
|
8323
|
+
games
|
|
8321
8324
|
isTester
|
|
8322
8325
|
lastName
|
|
8323
8326
|
licences {
|
|
8324
8327
|
...LicenceFields
|
|
8325
8328
|
}
|
|
8326
8329
|
partner
|
|
8330
|
+
points
|
|
8327
8331
|
platform
|
|
8328
8332
|
preferredRegion
|
|
8329
8333
|
promoCodes
|
|
@@ -9887,6 +9891,14 @@ var DELETE_PARTNER_MUTATION = gql`
|
|
|
9887
9891
|
`;
|
|
9888
9892
|
var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
|
|
9889
9893
|
fragment PostContentDataFields on PostContentData {
|
|
9894
|
+
game {
|
|
9895
|
+
title
|
|
9896
|
+
gameType
|
|
9897
|
+
gameInfo {
|
|
9898
|
+
dailyClue
|
|
9899
|
+
}
|
|
9900
|
+
gameEndDate
|
|
9901
|
+
}
|
|
9890
9902
|
textarea {
|
|
9891
9903
|
title
|
|
9892
9904
|
data
|
|
@@ -10024,6 +10036,66 @@ var GET_APP_SETTINGS = gql`
|
|
|
10024
10036
|
}
|
|
10025
10037
|
${APP_SETTINGS_FIELDS_FRAGMENT}
|
|
10026
10038
|
`;
|
|
10039
|
+
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
|
|
10040
|
+
fragment DailyClueGameDataFields on DailyClueGameDataType {
|
|
10041
|
+
lastFoundDate
|
|
10042
|
+
streak
|
|
10043
|
+
points
|
|
10044
|
+
collectedLetters
|
|
10045
|
+
gameEndDate
|
|
10046
|
+
}
|
|
10047
|
+
`;
|
|
10048
|
+
var GAME_FIELDS_FRAGMENT = gql`
|
|
10049
|
+
fragment GameFields on GameType {
|
|
10050
|
+
_id
|
|
10051
|
+
active
|
|
10052
|
+
createdAt
|
|
10053
|
+
deletedAt
|
|
10054
|
+
gameData {
|
|
10055
|
+
dailyClue {
|
|
10056
|
+
...DailyClueGameDataFields
|
|
10057
|
+
}
|
|
10058
|
+
}
|
|
10059
|
+
updatedAt
|
|
10060
|
+
owner {
|
|
10061
|
+
...OwnerFields
|
|
10062
|
+
}
|
|
10063
|
+
}
|
|
10064
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
10065
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
10066
|
+
`;
|
|
10067
|
+
var GET_GAMES = gql`
|
|
10068
|
+
query getGames($userId: ID) {
|
|
10069
|
+
games(userId: $userId) {
|
|
10070
|
+
...GameFields
|
|
10071
|
+
}
|
|
10072
|
+
}
|
|
10073
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10074
|
+
`;
|
|
10075
|
+
var GET_GAME = gql`
|
|
10076
|
+
query getGame($_id: ID!) {
|
|
10077
|
+
game(_id: $_id) {
|
|
10078
|
+
...GameFields
|
|
10079
|
+
}
|
|
10080
|
+
}
|
|
10081
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10082
|
+
`;
|
|
10083
|
+
var START_GAME_MUTATION = gql`
|
|
10084
|
+
mutation startGame($input: GameInputType!) {
|
|
10085
|
+
startGame(input: $input) {
|
|
10086
|
+
...GameFields
|
|
10087
|
+
}
|
|
10088
|
+
}
|
|
10089
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10090
|
+
`;
|
|
10091
|
+
var LEAVE_GAME_MUTATION = gql`
|
|
10092
|
+
mutation leaveGame($_id: ID!) {
|
|
10093
|
+
leaveGame(_id: $_id) {
|
|
10094
|
+
...GameFields
|
|
10095
|
+
}
|
|
10096
|
+
}
|
|
10097
|
+
${GAME_FIELDS_FRAGMENT}
|
|
10098
|
+
`;
|
|
10027
10099
|
var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
10028
10100
|
var nzbnRegex = /^94\d{11}$/;
|
|
10029
10101
|
var normalizedUrlTransform = () => create$6().trim().transform(
|
|
@@ -10175,7 +10247,7 @@ var socialMediaSchema = create$3({
|
|
|
10175
10247
|
is: (name) => !!name,
|
|
10176
10248
|
// If name has a value
|
|
10177
10249
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
10178
|
-
otherwise: (
|
|
10250
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10179
10251
|
})
|
|
10180
10252
|
});
|
|
10181
10253
|
var globalResourceSchema = create$3().shape({
|
|
@@ -10251,21 +10323,21 @@ var paymentInfoSchema = create$3({
|
|
|
10251
10323
|
).required("Please select a Payment method"),
|
|
10252
10324
|
accountHolderName: create$6().when("paymentMethod", {
|
|
10253
10325
|
is: "bank_transfer",
|
|
10254
|
-
then: (
|
|
10255
|
-
otherwise: (
|
|
10326
|
+
then: (schema15) => schema15.required("Account holder name is required for bank transfer").trim(),
|
|
10327
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10256
10328
|
}),
|
|
10257
10329
|
accountNumber: create$6().when("paymentMethod", {
|
|
10258
10330
|
is: "bank_transfer",
|
|
10259
|
-
then: (
|
|
10331
|
+
then: (schema15) => schema15.required("Account number is required for bank transfer").matches(
|
|
10260
10332
|
nzBankAccountRegex,
|
|
10261
10333
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
10262
10334
|
).trim(),
|
|
10263
|
-
otherwise: (
|
|
10335
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10264
10336
|
}),
|
|
10265
10337
|
link: create$6().when("paymentMethod", {
|
|
10266
10338
|
is: (val) => val === "paypal" || val === "stripe",
|
|
10267
10339
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
10268
|
-
otherwise: (
|
|
10340
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10269
10341
|
})
|
|
10270
10342
|
});
|
|
10271
10343
|
var eventInfoSchema = create$3().shape({
|
|
@@ -10423,8 +10495,8 @@ var userSchema = create$3().shape({
|
|
|
10423
10495
|
confirmPassword: create$6().nullable().trim().label("Confirm Password").when("password", {
|
|
10424
10496
|
is: (val) => !!val,
|
|
10425
10497
|
// only necessary if password typed
|
|
10426
|
-
then: (
|
|
10427
|
-
otherwise: (
|
|
10498
|
+
then: (schema15) => schema15.required("Confirm Password is required").oneOf([create$9("password")], "Passwords must match"),
|
|
10499
|
+
otherwise: (schema15) => schema15.notRequired()
|
|
10428
10500
|
}),
|
|
10429
10501
|
role: create$8().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
10430
10502
|
});
|
|
@@ -10495,7 +10567,7 @@ var adSchema = create$3().shape({
|
|
|
10495
10567
|
return endDate > now;
|
|
10496
10568
|
}).when("start", {
|
|
10497
10569
|
is: (val) => val && val.length > 0,
|
|
10498
|
-
then: (
|
|
10570
|
+
then: (schema15) => schema15.test(
|
|
10499
10571
|
"is-after-start",
|
|
10500
10572
|
"End date must be after start date",
|
|
10501
10573
|
function(value) {
|
|
@@ -10530,6 +10602,7 @@ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
|
10530
10602
|
return EnumPostType2;
|
|
10531
10603
|
})(EnumPostType || {});
|
|
10532
10604
|
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
10605
|
+
EnumPostContentType2["GAME"] = "game";
|
|
10533
10606
|
EnumPostContentType2["IMAGE"] = "image";
|
|
10534
10607
|
EnumPostContentType2["LIST"] = "list";
|
|
10535
10608
|
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
@@ -11341,7 +11414,7 @@ schema4.index({ isRead: 1, userId: 1 });
|
|
|
11341
11414
|
schema4.index({ createdAt: -1, userId: 1 });
|
|
11342
11415
|
var NotificationModel = import_mongoose8.default.models.Notification || import_mongoose8.default.model("Notification", schema4);
|
|
11343
11416
|
|
|
11344
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
11417
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-VE6JFCH2.mjs
|
|
11345
11418
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
11346
11419
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
11347
11420
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -11875,8 +11948,37 @@ var AppSettingSchema = new MongooseSchema18(
|
|
|
11875
11948
|
);
|
|
11876
11949
|
var AppSettingModel = import_mongoose18.default.models.AppSetting || import_mongoose18.default.model("AppSetting", AppSettingSchema);
|
|
11877
11950
|
|
|
11878
|
-
// src/
|
|
11951
|
+
// src/mongoose/game/Game.ts
|
|
11879
11952
|
var import_mongoose19 = __toESM(require("mongoose"));
|
|
11953
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
11954
|
+
var schemaDailyClue = new MongooseSchema19(
|
|
11955
|
+
{
|
|
11956
|
+
collectedLetters: { default: [], required: false, type: [String] },
|
|
11957
|
+
gameEndDate: { default: null, required: true, type: String },
|
|
11958
|
+
lastFoundDate: { default: null, required: false, type: String },
|
|
11959
|
+
points: { default: 0, required: true, type: Number },
|
|
11960
|
+
streak: { default: 0, required: true, type: Number }
|
|
11961
|
+
},
|
|
11962
|
+
{ _id: false }
|
|
11963
|
+
);
|
|
11964
|
+
var schema14 = new MongooseSchema19(
|
|
11965
|
+
{
|
|
11966
|
+
active: { default: false, required: true, type: Boolean },
|
|
11967
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
11968
|
+
gameData: {
|
|
11969
|
+
dailyClue: { default: null, required: false, type: schemaDailyClue }
|
|
11970
|
+
},
|
|
11971
|
+
owner: {
|
|
11972
|
+
required: true,
|
|
11973
|
+
type: OwnerTypeSchema
|
|
11974
|
+
}
|
|
11975
|
+
},
|
|
11976
|
+
{ timestamps: true }
|
|
11977
|
+
);
|
|
11978
|
+
var GameModel = import_mongoose19.default.models.Game || import_mongoose19.default.model("Game", schema14);
|
|
11979
|
+
|
|
11980
|
+
// src/service/database.ts
|
|
11981
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
11880
11982
|
var connectToDatabase = async ({
|
|
11881
11983
|
appName,
|
|
11882
11984
|
dbName,
|
|
@@ -11889,7 +11991,7 @@ var connectToDatabase = async ({
|
|
|
11889
11991
|
// Fallback to MongoDB Atlas connection string
|
|
11890
11992
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11891
11993
|
);
|
|
11892
|
-
await
|
|
11994
|
+
await import_mongoose20.default.connect(mongoUri);
|
|
11893
11995
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11894
11996
|
console.log(
|
|
11895
11997
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -12125,12 +12227,12 @@ async function updateVendorBasedOnUserLicense(userId, licenceObject) {
|
|
|
12125
12227
|
}
|
|
12126
12228
|
|
|
12127
12229
|
// src/service/objectIdToString.ts
|
|
12128
|
-
var
|
|
12230
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
12129
12231
|
function convertObjectIdsToStrings(obj) {
|
|
12130
12232
|
if (obj === null || obj === void 0) {
|
|
12131
12233
|
return obj;
|
|
12132
12234
|
}
|
|
12133
|
-
if (obj instanceof
|
|
12235
|
+
if (obj instanceof import_mongoose23.default.Types.ObjectId) {
|
|
12134
12236
|
return obj.toString();
|
|
12135
12237
|
}
|
|
12136
12238
|
if (Array.isArray(obj)) {
|
|
@@ -12161,7 +12263,7 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
12161
12263
|
|
|
12162
12264
|
// src/types/index.ts
|
|
12163
12265
|
var import_express = __toESM(require("express"));
|
|
12164
|
-
var
|
|
12266
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
12165
12267
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
12166
12268
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
12167
12269
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -12180,8 +12282,10 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
|
12180
12282
|
EnumPubSubEvents,
|
|
12181
12283
|
EventInfoModel,
|
|
12182
12284
|
EventModel,
|
|
12285
|
+
GameModel,
|
|
12183
12286
|
GoogleImportedMarketModel,
|
|
12184
12287
|
NotificationModel,
|
|
12288
|
+
OwnerTypeSchema,
|
|
12185
12289
|
ParticipantSchema,
|
|
12186
12290
|
PartnerModel,
|
|
12187
12291
|
PostModel,
|