@timardex/cluemart-server-shared 4.0.0 → 4.0.1
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-MVQMMXGY.mjs → chunk-J7ZINA3I.mjs} +114 -99
- package/dist/chunk-J7ZINA3I.mjs.map +1 -0
- package/dist/index.cjs +115 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.mjs +113 -98
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +115 -99
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +18 -3
- package/dist/mongoose/index.d.ts +18 -3
- package/dist/mongoose/index.mjs +5 -3
- package/dist/service/index.cjs +110 -97
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-MVQMMXGY.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -957,15 +957,15 @@ function syncSearchNameInUpdate(update) {
|
|
|
957
957
|
}
|
|
958
958
|
return null;
|
|
959
959
|
}
|
|
960
|
-
function searchNamePlugin(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
960
|
+
function searchNamePlugin(schema27) {
|
|
961
|
+
schema27.add({ searchName: { default: "", required: false, type: String } });
|
|
962
|
+
schema27.index({ searchName: 1 });
|
|
963
|
+
schema27.pre("save", function syncSearchNameOnSave(next) {
|
|
964
964
|
const doc = this;
|
|
965
965
|
doc.searchName = deriveSearchName(doc.name);
|
|
966
966
|
next();
|
|
967
967
|
});
|
|
968
|
-
|
|
968
|
+
schema27.pre("insertMany", function syncSearchNameOnInsertMany(next, docs) {
|
|
969
969
|
const list = Array.isArray(docs) ? docs : [docs];
|
|
970
970
|
for (const doc of list) {
|
|
971
971
|
if (doc && typeof doc.name === "string") {
|
|
@@ -974,7 +974,7 @@ function searchNamePlugin(schema28) {
|
|
|
974
974
|
}
|
|
975
975
|
next();
|
|
976
976
|
});
|
|
977
|
-
|
|
977
|
+
schema27.pre("bulkWrite", function syncSearchNameOnBulkWrite(next, ops) {
|
|
978
978
|
for (const op of ops) {
|
|
979
979
|
const doc = op.insertOne?.document ?? op.replaceOne?.replacement;
|
|
980
980
|
if (doc && typeof doc.name === "string") {
|
|
@@ -1000,7 +1000,7 @@ function searchNamePlugin(schema28) {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
next();
|
|
1002
1002
|
};
|
|
1003
|
-
|
|
1003
|
+
schema27.pre(
|
|
1004
1004
|
["findOneAndUpdate", "updateOne", "updateMany"],
|
|
1005
1005
|
syncSearchNameOnUpdate
|
|
1006
1006
|
);
|
|
@@ -1037,6 +1037,7 @@ var schema7 = new MongooseSchema6(
|
|
|
1037
1037
|
dateTime: [dateTimeSchema],
|
|
1038
1038
|
deletedAt: { default: null, required: false, type: Date },
|
|
1039
1039
|
description: { required: true, type: String },
|
|
1040
|
+
earliestStartDate: { default: null, required: false, type: Date },
|
|
1040
1041
|
eventId: {
|
|
1041
1042
|
ref: "Event",
|
|
1042
1043
|
required: false,
|
|
@@ -1079,6 +1080,7 @@ schema7.index({ name: 1 });
|
|
|
1079
1080
|
schema7.index({ region: 1 });
|
|
1080
1081
|
schema7.index({ deletedAt: 1 });
|
|
1081
1082
|
schema7.index({ "dateTime.dateStatus": 1 });
|
|
1083
|
+
schema7.index({ earliestStartDate: 1, _id: 1 });
|
|
1082
1084
|
schema7.index({ slug: 1 });
|
|
1083
1085
|
schema7.index({ description: "text", name: "text" });
|
|
1084
1086
|
schema7.plugin(searchNamePlugin);
|
|
@@ -1119,6 +1121,7 @@ var schema8 = new MongooseSchema7(
|
|
|
1119
1121
|
dateTime: [dateTimeSchema],
|
|
1120
1122
|
deletedAt: { default: null, required: false, type: Date },
|
|
1121
1123
|
description: { required: true, type: String },
|
|
1124
|
+
earliestStartDate: { default: null, required: false, type: Date },
|
|
1122
1125
|
eventId: {
|
|
1123
1126
|
ref: "Event",
|
|
1124
1127
|
required: false,
|
|
@@ -1173,6 +1176,7 @@ schema8.index({ name: 1 });
|
|
|
1173
1176
|
schema8.index({ region: 1 });
|
|
1174
1177
|
schema8.index({ deletedAt: 1 });
|
|
1175
1178
|
schema8.index({ "dateTime.dateStatus": 1 });
|
|
1179
|
+
schema8.index({ earliestStartDate: 1, _id: 1 });
|
|
1176
1180
|
schema8.index({ slug: 1 });
|
|
1177
1181
|
schema8.index({ reviewStatus: 1 });
|
|
1178
1182
|
schema8.index({ description: "text", name: "text" });
|
|
@@ -1181,8 +1185,9 @@ var AiImportedMarketModel = mongoose11.models.AiImportedMarket || mongoose11.mod
|
|
|
1181
1185
|
|
|
1182
1186
|
// src/mongoose/ScrapeSite.ts
|
|
1183
1187
|
import mongoose12 from "mongoose";
|
|
1188
|
+
var SCRAPE_SITES_CONFIG_KEY = "scrapeSites";
|
|
1184
1189
|
var MongooseSchema8 = mongoose12.Schema;
|
|
1185
|
-
var
|
|
1190
|
+
var scrapeSiteItemSchema = new MongooseSchema8(
|
|
1186
1191
|
{
|
|
1187
1192
|
enabled: { default: true, required: true, type: Boolean },
|
|
1188
1193
|
lastError: { required: false, type: String },
|
|
@@ -1194,9 +1199,18 @@ var schema9 = new MongooseSchema8(
|
|
|
1194
1199
|
},
|
|
1195
1200
|
{ timestamps: true }
|
|
1196
1201
|
);
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1202
|
+
var configSchema = new MongooseSchema8(
|
|
1203
|
+
{
|
|
1204
|
+
key: { required: true, type: String, unique: true },
|
|
1205
|
+
sites: {
|
|
1206
|
+
default: [],
|
|
1207
|
+
required: true,
|
|
1208
|
+
type: [scrapeSiteItemSchema]
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
{ timestamps: true }
|
|
1212
|
+
);
|
|
1213
|
+
var ScrapeSiteConfigModel = mongoose12.models.ScrapeSiteConfig || mongoose12.model("ScrapeSiteConfig", configSchema);
|
|
1200
1214
|
|
|
1201
1215
|
// src/mongoose/Notification.ts
|
|
1202
1216
|
import {
|
|
@@ -1217,7 +1231,7 @@ var notificationDataSchema = new MongooseSchema9(
|
|
|
1217
1231
|
},
|
|
1218
1232
|
{ _id: false }
|
|
1219
1233
|
);
|
|
1220
|
-
var
|
|
1234
|
+
var schema9 = new MongooseSchema9(
|
|
1221
1235
|
{
|
|
1222
1236
|
data: {
|
|
1223
1237
|
default: null,
|
|
@@ -1241,15 +1255,15 @@ var schema10 = new MongooseSchema9(
|
|
|
1241
1255
|
},
|
|
1242
1256
|
{ timestamps: true }
|
|
1243
1257
|
);
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
var NotificationModel = mongoose13.models.Notification || mongoose13.model("Notification",
|
|
1258
|
+
schema9.index({ isRead: 1, userId: 1 });
|
|
1259
|
+
schema9.index({ createdAt: -1, userId: 1 });
|
|
1260
|
+
var NotificationModel = mongoose13.models.Notification || mongoose13.model("Notification", schema9);
|
|
1247
1261
|
|
|
1248
1262
|
// src/mongoose/PushToken.ts
|
|
1249
1263
|
import { EnumOSPlatform } from "@timardex/cluemart-shared/enums";
|
|
1250
1264
|
import mongoose14 from "mongoose";
|
|
1251
1265
|
var MongooseSchema10 = mongoose14.Schema;
|
|
1252
|
-
var
|
|
1266
|
+
var schema10 = new MongooseSchema10(
|
|
1253
1267
|
{
|
|
1254
1268
|
platform: {
|
|
1255
1269
|
enum: Object.values(EnumOSPlatform),
|
|
@@ -1265,7 +1279,7 @@ var schema11 = new MongooseSchema10(
|
|
|
1265
1279
|
},
|
|
1266
1280
|
{ timestamps: true }
|
|
1267
1281
|
);
|
|
1268
|
-
var PushTokenModel = mongoose14.models.PushToken || mongoose14.model("PushToken",
|
|
1282
|
+
var PushTokenModel = mongoose14.models.PushToken || mongoose14.model("PushToken", schema10);
|
|
1269
1283
|
|
|
1270
1284
|
// src/mongoose/Relation.ts
|
|
1271
1285
|
import {
|
|
@@ -1343,7 +1357,7 @@ var refundPolicySchema = new MongooseSchema11(
|
|
|
1343
1357
|
},
|
|
1344
1358
|
{ _id: false }
|
|
1345
1359
|
);
|
|
1346
|
-
var
|
|
1360
|
+
var schema11 = new MongooseSchema11(
|
|
1347
1361
|
{
|
|
1348
1362
|
active: { default: true, type: Boolean },
|
|
1349
1363
|
applicationDeadlineHours: { required: true, type: Number },
|
|
@@ -1361,8 +1375,8 @@ var schema12 = new MongooseSchema11(
|
|
|
1361
1375
|
},
|
|
1362
1376
|
{ timestamps: true }
|
|
1363
1377
|
);
|
|
1364
|
-
|
|
1365
|
-
var EventInfoModel = mongoose15.models.EventInfo || mongoose15.model("EventInfo",
|
|
1378
|
+
schema11.index({ eventId: 1 });
|
|
1379
|
+
var EventInfoModel = mongoose15.models.EventInfo || mongoose15.model("EventInfo", schema11);
|
|
1366
1380
|
|
|
1367
1381
|
// src/mongoose/Relation.ts
|
|
1368
1382
|
var MongooseSchema12 = mongoose16.Schema;
|
|
@@ -1479,7 +1493,7 @@ var ActivitySchema = new MongooseSchema13(
|
|
|
1479
1493
|
},
|
|
1480
1494
|
{ _id: false }
|
|
1481
1495
|
);
|
|
1482
|
-
var
|
|
1496
|
+
var schema12 = new MongooseSchema13(
|
|
1483
1497
|
{
|
|
1484
1498
|
activity: { default: [], type: [ActivitySchema] },
|
|
1485
1499
|
resourceId: { required: true, type: String },
|
|
@@ -1491,9 +1505,9 @@ var schema13 = new MongooseSchema13(
|
|
|
1491
1505
|
},
|
|
1492
1506
|
{ timestamps: true }
|
|
1493
1507
|
);
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
var ResourceActivityModel = mongoose17.models.ResourceActivity || mongoose17.model("ResourceActivity",
|
|
1508
|
+
schema12.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
1509
|
+
schema12.index({ "views.location": "2dsphere" });
|
|
1510
|
+
var ResourceActivityModel = mongoose17.models.ResourceActivity || mongoose17.model("ResourceActivity", schema12);
|
|
1497
1511
|
|
|
1498
1512
|
// src/mongoose/User.ts
|
|
1499
1513
|
import {
|
|
@@ -1647,7 +1661,7 @@ var userOverallPointsSchema = new MongooseSchema14(
|
|
|
1647
1661
|
},
|
|
1648
1662
|
{ _id: false }
|
|
1649
1663
|
);
|
|
1650
|
-
var
|
|
1664
|
+
var schema13 = new MongooseSchema14(
|
|
1651
1665
|
{
|
|
1652
1666
|
active: { default: false, required: true, type: Boolean },
|
|
1653
1667
|
affiliate: {
|
|
@@ -1777,16 +1791,16 @@ var schema14 = new MongooseSchema14(
|
|
|
1777
1791
|
},
|
|
1778
1792
|
{ strict: false, timestamps: true }
|
|
1779
1793
|
);
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
var UserModel = mongoose18.models.User || mongoose18.model("User",
|
|
1794
|
+
schema13.index({ "licences.expiryDate": 1 });
|
|
1795
|
+
schema13.index({ "licences.licenceType": 1 });
|
|
1796
|
+
schema13.index({ promoCodes: 1, active: 1, deletedAt: 1 });
|
|
1797
|
+
schema13.index({ email: "text", firstName: "text", lastName: "text" });
|
|
1798
|
+
var UserModel = mongoose18.models.User || mongoose18.model("User", schema13);
|
|
1785
1799
|
|
|
1786
1800
|
// src/mongoose/VerificationToken.ts
|
|
1787
1801
|
import mongoose19 from "mongoose";
|
|
1788
1802
|
var MongooseSchema15 = mongoose19.Schema;
|
|
1789
|
-
var
|
|
1803
|
+
var schema14 = new MongooseSchema15(
|
|
1790
1804
|
{
|
|
1791
1805
|
createdAt: {
|
|
1792
1806
|
default: Date.now,
|
|
@@ -1801,7 +1815,7 @@ var schema15 = new MongooseSchema15(
|
|
|
1801
1815
|
},
|
|
1802
1816
|
{ timestamps: true }
|
|
1803
1817
|
);
|
|
1804
|
-
var VerificationTokenModel = mongoose19.models.VerificationToken || mongoose19.model("VerificationToken",
|
|
1818
|
+
var VerificationTokenModel = mongoose19.models.VerificationToken || mongoose19.model("VerificationToken", schema14);
|
|
1805
1819
|
|
|
1806
1820
|
// src/mongoose/vendor/Vendor.ts
|
|
1807
1821
|
import {
|
|
@@ -1872,7 +1886,7 @@ var downgradeSnapshotSchema = new MongooseSchema16(
|
|
|
1872
1886
|
},
|
|
1873
1887
|
{ _id: false }
|
|
1874
1888
|
);
|
|
1875
|
-
var
|
|
1889
|
+
var schema15 = new MongooseSchema16(
|
|
1876
1890
|
{
|
|
1877
1891
|
...baseResourceFields,
|
|
1878
1892
|
// Importing base resource fields from global.ts
|
|
@@ -1906,19 +1920,19 @@ var schema16 = new MongooseSchema16(
|
|
|
1906
1920
|
},
|
|
1907
1921
|
{ timestamps: true }
|
|
1908
1922
|
);
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1923
|
+
schema15.index({ name: 1 });
|
|
1924
|
+
schema15.index({ description: 1 });
|
|
1925
|
+
schema15.index({ region: 1 });
|
|
1926
|
+
schema15.index({ "categories.name": 1 });
|
|
1927
|
+
schema15.index({ slug: 1 });
|
|
1928
|
+
schema15.index({
|
|
1915
1929
|
categoriesNames: "text",
|
|
1916
1930
|
description: "text",
|
|
1917
1931
|
name: "text"
|
|
1918
1932
|
});
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
var VendorModel = mongoose20.models.Vendor || mongoose20.model("Vendor",
|
|
1933
|
+
schema15.index({ deletedAt: 1, "owner.userId": 1 });
|
|
1934
|
+
schema15.plugin(searchNamePlugin);
|
|
1935
|
+
var VendorModel = mongoose20.models.Vendor || mongoose20.model("Vendor", schema15);
|
|
1922
1936
|
|
|
1923
1937
|
// src/mongoose/vendor/VendorInfo.ts
|
|
1924
1938
|
import {
|
|
@@ -1933,7 +1947,7 @@ var AttributesSchema = new MongooseSchema17(
|
|
|
1933
1947
|
},
|
|
1934
1948
|
{ _id: false }
|
|
1935
1949
|
);
|
|
1936
|
-
var
|
|
1950
|
+
var schema16 = new MongooseSchema17(
|
|
1937
1951
|
{
|
|
1938
1952
|
active: { default: true, type: Boolean },
|
|
1939
1953
|
compliance: {
|
|
@@ -1973,8 +1987,8 @@ var schema17 = new MongooseSchema17(
|
|
|
1973
1987
|
},
|
|
1974
1988
|
{ timestamps: true }
|
|
1975
1989
|
);
|
|
1976
|
-
|
|
1977
|
-
var VendorInfoModel = mongoose21.models.VendorInfo || mongoose21.model("VendorInfo",
|
|
1990
|
+
schema16.index({ vendorId: 1 });
|
|
1991
|
+
var VendorInfoModel = mongoose21.models.VendorInfo || mongoose21.model("VendorInfo", schema16);
|
|
1978
1992
|
|
|
1979
1993
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
1980
1994
|
import mongoose22 from "mongoose";
|
|
@@ -1990,7 +2004,7 @@ var invitationSchema = new MongooseSchema18(
|
|
|
1990
2004
|
},
|
|
1991
2005
|
{ _id: false }
|
|
1992
2006
|
);
|
|
1993
|
-
var
|
|
2007
|
+
var schema17 = new MongooseSchema18(
|
|
1994
2008
|
{
|
|
1995
2009
|
active: { default: true, required: true, type: Boolean },
|
|
1996
2010
|
categoryIds: { required: true, type: [String] },
|
|
@@ -2012,15 +2026,15 @@ var schema18 = new MongooseSchema18(
|
|
|
2012
2026
|
},
|
|
2013
2027
|
{ timestamps: true }
|
|
2014
2028
|
);
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
var UnregisteredVendorModel = mongoose22.models.UnregisteredVendor || mongoose22.model("UnregisteredVendor",
|
|
2029
|
+
schema17.index({ name: 1 });
|
|
2030
|
+
schema17.index({ email: 1 });
|
|
2031
|
+
var UnregisteredVendorModel = mongoose22.models.UnregisteredVendor || mongoose22.model("UnregisteredVendor", schema17);
|
|
2018
2032
|
|
|
2019
2033
|
// src/mongoose/event/Event.ts
|
|
2020
2034
|
import { EnumEventType as EnumEventType3 } from "@timardex/cluemart-shared";
|
|
2021
2035
|
import mongoose23 from "mongoose";
|
|
2022
2036
|
var MongooseSchema19 = mongoose23.Schema;
|
|
2023
|
-
var
|
|
2037
|
+
var schema18 = new MongooseSchema19(
|
|
2024
2038
|
{
|
|
2025
2039
|
...baseResourceFields,
|
|
2026
2040
|
// Importing base resource fields from global.ts
|
|
@@ -2053,22 +2067,22 @@ var schema19 = new MongooseSchema19(
|
|
|
2053
2067
|
},
|
|
2054
2068
|
{ timestamps: true }
|
|
2055
2069
|
);
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
var EventModel = mongoose23.models.Event || mongoose23.model("Event",
|
|
2070
|
+
schema18.index({ name: 1 });
|
|
2071
|
+
schema18.index({ description: 1 });
|
|
2072
|
+
schema18.index({ region: 1 });
|
|
2073
|
+
schema18.index({ "location.geo": "2dsphere" });
|
|
2074
|
+
schema18.index({ tags: 1 });
|
|
2075
|
+
schema18.index({ deletedAt: 1 });
|
|
2076
|
+
schema18.index({ "dateTime.dateStatus": 1 });
|
|
2077
|
+
schema18.index({ slug: 1 });
|
|
2078
|
+
schema18.index({ description: "text", name: "text", tags: "text" });
|
|
2079
|
+
schema18.index({ deletedAt: 1, "owner.userId": 1 });
|
|
2080
|
+
schema18.plugin(searchNamePlugin);
|
|
2081
|
+
var EventModel = mongoose23.models.Event || mongoose23.model("Event", schema18);
|
|
2068
2082
|
|
|
2069
2083
|
// src/mongoose/event/EventDateArchive.ts
|
|
2070
2084
|
import mongoose24 from "mongoose";
|
|
2071
|
-
var
|
|
2085
|
+
var schema19 = new mongoose24.Schema(
|
|
2072
2086
|
{
|
|
2073
2087
|
dateTime: { required: true, type: [dateTimeSchema] },
|
|
2074
2088
|
eventId: {
|
|
@@ -2079,14 +2093,14 @@ var schema20 = new mongoose24.Schema(
|
|
|
2079
2093
|
},
|
|
2080
2094
|
{ timestamps: true }
|
|
2081
2095
|
);
|
|
2082
|
-
|
|
2083
|
-
var EventDateArchiveModel = mongoose24.models.EventDateArchive || mongoose24.model("EventDateArchive",
|
|
2096
|
+
schema19.index({ eventId: 1 }, { unique: true });
|
|
2097
|
+
var EventDateArchiveModel = mongoose24.models.EventDateArchive || mongoose24.model("EventDateArchive", schema19);
|
|
2084
2098
|
|
|
2085
2099
|
// src/mongoose/Partner.ts
|
|
2086
2100
|
import { EnumPartnerType } from "@timardex/cluemart-shared";
|
|
2087
2101
|
import mongoose25 from "mongoose";
|
|
2088
2102
|
var MongooseSchema20 = mongoose25.Schema;
|
|
2089
|
-
var
|
|
2103
|
+
var schema20 = new MongooseSchema20(
|
|
2090
2104
|
{
|
|
2091
2105
|
...baseResourceFields,
|
|
2092
2106
|
location: {
|
|
@@ -2102,15 +2116,15 @@ var schema21 = new MongooseSchema20(
|
|
|
2102
2116
|
},
|
|
2103
2117
|
{ timestamps: true }
|
|
2104
2118
|
);
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
var PartnerModel = mongoose25.models.Partner || mongoose25.model("Partner",
|
|
2119
|
+
schema20.index({ name: 1 });
|
|
2120
|
+
schema20.index({ description: 1 });
|
|
2121
|
+
schema20.index({ region: 1 });
|
|
2122
|
+
schema20.index({ "location.geo": "2dsphere" });
|
|
2123
|
+
schema20.index({ slug: 1 });
|
|
2124
|
+
schema20.index({ name: "text", description: "text" });
|
|
2125
|
+
schema20.index({ "owner.userId": 1, deletedAt: 1 });
|
|
2126
|
+
schema20.plugin(searchNamePlugin);
|
|
2127
|
+
var PartnerModel = mongoose25.models.Partner || mongoose25.model("Partner", schema20);
|
|
2114
2128
|
|
|
2115
2129
|
// src/mongoose/Post.ts
|
|
2116
2130
|
import {
|
|
@@ -2145,7 +2159,7 @@ var resourceSchema = new MongooseSchema21(
|
|
|
2145
2159
|
},
|
|
2146
2160
|
{ _id: false }
|
|
2147
2161
|
);
|
|
2148
|
-
var
|
|
2162
|
+
var schema21 = new MongooseSchema21(
|
|
2149
2163
|
{
|
|
2150
2164
|
active: { default: false, required: true, type: Boolean },
|
|
2151
2165
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -2176,10 +2190,10 @@ var schema22 = new MongooseSchema21(
|
|
|
2176
2190
|
},
|
|
2177
2191
|
{ timestamps: true }
|
|
2178
2192
|
);
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
var PostModel = mongoose26.models.Post || mongoose26.model("Post",
|
|
2193
|
+
schema21.index({ title: 1 });
|
|
2194
|
+
schema21.index({ tags: 1 });
|
|
2195
|
+
schema21.index({ postType: 1, slug: 1 }, { unique: true });
|
|
2196
|
+
var PostModel = mongoose26.models.Post || mongoose26.model("Post", schema21);
|
|
2183
2197
|
|
|
2184
2198
|
// src/mongoose/AppSetting.ts
|
|
2185
2199
|
import mongoose27 from "mongoose";
|
|
@@ -2238,7 +2252,7 @@ var AppSettingModel = mongoose27.models.AppSetting || mongoose27.model("AppSetti
|
|
|
2238
2252
|
// src/mongoose/AuthHandoffToken.ts
|
|
2239
2253
|
import mongoose28 from "mongoose";
|
|
2240
2254
|
var MongooseSchema23 = mongoose28.Schema;
|
|
2241
|
-
var
|
|
2255
|
+
var schema22 = new MongooseSchema23(
|
|
2242
2256
|
{
|
|
2243
2257
|
expiresAt: { required: true, type: Date },
|
|
2244
2258
|
jti: { index: true, required: true, type: String, unique: true },
|
|
@@ -2252,8 +2266,8 @@ var schema23 = new MongooseSchema23(
|
|
|
2252
2266
|
},
|
|
2253
2267
|
{ timestamps: true }
|
|
2254
2268
|
);
|
|
2255
|
-
|
|
2256
|
-
var AuthHandoffTokenModel = mongoose28.models.AuthHandoffToken || mongoose28.model("AuthHandoffToken",
|
|
2269
|
+
schema22.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
2270
|
+
var AuthHandoffTokenModel = mongoose28.models.AuthHandoffToken || mongoose28.model("AuthHandoffToken", schema22);
|
|
2257
2271
|
|
|
2258
2272
|
// src/mongoose/game/Game.ts
|
|
2259
2273
|
import {
|
|
@@ -2361,9 +2375,9 @@ var gameDataSchemas = {
|
|
|
2361
2375
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
2362
2376
|
};
|
|
2363
2377
|
var gameDataDefinition = Object.fromEntries(
|
|
2364
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
2378
|
+
Object.entries(gameDataSchemas).map(([key, schema27]) => [
|
|
2365
2379
|
key,
|
|
2366
|
-
{ default: null, required: false, type:
|
|
2380
|
+
{ default: null, required: false, type: schema27 }
|
|
2367
2381
|
])
|
|
2368
2382
|
);
|
|
2369
2383
|
var gameHistorySchema = new MongooseSchema27(
|
|
@@ -2404,7 +2418,7 @@ var gameTypeSchema = new MongooseSchema27(
|
|
|
2404
2418
|
},
|
|
2405
2419
|
{ timestamps: true }
|
|
2406
2420
|
);
|
|
2407
|
-
var
|
|
2421
|
+
var schema23 = new MongooseSchema27(
|
|
2408
2422
|
{
|
|
2409
2423
|
active: { default: false, required: true, type: Boolean },
|
|
2410
2424
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -2417,7 +2431,7 @@ var schema24 = new MongooseSchema27(
|
|
|
2417
2431
|
},
|
|
2418
2432
|
{ timestamps: true }
|
|
2419
2433
|
);
|
|
2420
|
-
var GameModel = mongoose32.models.Game || mongoose32.model("Game",
|
|
2434
|
+
var GameModel = mongoose32.models.Game || mongoose32.model("Game", schema23);
|
|
2421
2435
|
|
|
2422
2436
|
// src/mongoose/School.ts
|
|
2423
2437
|
import mongoose33 from "mongoose";
|
|
@@ -2430,7 +2444,7 @@ var campaignsSchema = new MongooseSchema28(
|
|
|
2430
2444
|
},
|
|
2431
2445
|
{ _id: false }
|
|
2432
2446
|
);
|
|
2433
|
-
var
|
|
2447
|
+
var schema24 = new MongooseSchema28(
|
|
2434
2448
|
{
|
|
2435
2449
|
// New schools are active by default
|
|
2436
2450
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -2457,14 +2471,14 @@ var schema25 = new MongooseSchema28(
|
|
|
2457
2471
|
},
|
|
2458
2472
|
{ timestamps: true }
|
|
2459
2473
|
);
|
|
2460
|
-
|
|
2474
|
+
schema24.index(
|
|
2461
2475
|
{ schoolCode: 1 },
|
|
2462
2476
|
{
|
|
2463
2477
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
2464
2478
|
unique: true
|
|
2465
2479
|
}
|
|
2466
2480
|
);
|
|
2467
|
-
var SchoolModel = mongoose33.models.School || mongoose33.model("School",
|
|
2481
|
+
var SchoolModel = mongoose33.models.School || mongoose33.model("School", schema24);
|
|
2468
2482
|
|
|
2469
2483
|
// src/mongoose/Affiliate.ts
|
|
2470
2484
|
import {
|
|
@@ -2557,7 +2571,7 @@ var redeemHistorySchema = new MongooseSchema29(
|
|
|
2557
2571
|
},
|
|
2558
2572
|
{ _id: false }
|
|
2559
2573
|
);
|
|
2560
|
-
var
|
|
2574
|
+
var schema25 = new MongooseSchema29(
|
|
2561
2575
|
{
|
|
2562
2576
|
active: { default: false, required: true, type: Boolean },
|
|
2563
2577
|
affiliateBonusRewards: {
|
|
@@ -2587,14 +2601,14 @@ var schema26 = new MongooseSchema29(
|
|
|
2587
2601
|
},
|
|
2588
2602
|
{ timestamps: true }
|
|
2589
2603
|
);
|
|
2590
|
-
|
|
2604
|
+
schema25.index(
|
|
2591
2605
|
{ affiliateCode: 1 },
|
|
2592
2606
|
{
|
|
2593
2607
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
2594
2608
|
unique: true
|
|
2595
2609
|
}
|
|
2596
2610
|
);
|
|
2597
|
-
var AffiliateModel = mongoose34.models.Affiliate || mongoose34.model("Affiliate",
|
|
2611
|
+
var AffiliateModel = mongoose34.models.Affiliate || mongoose34.model("Affiliate", schema25);
|
|
2598
2612
|
|
|
2599
2613
|
// src/mongoose/Coupon.ts
|
|
2600
2614
|
import {
|
|
@@ -2689,7 +2703,7 @@ var couponDataSchema = new MongooseSchema30(
|
|
|
2689
2703
|
},
|
|
2690
2704
|
{ timestamps: true }
|
|
2691
2705
|
);
|
|
2692
|
-
var
|
|
2706
|
+
var schema26 = new MongooseSchema30(
|
|
2693
2707
|
{
|
|
2694
2708
|
active: { default: true, required: true, type: Boolean },
|
|
2695
2709
|
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
@@ -2701,9 +2715,9 @@ var schema27 = new MongooseSchema30(
|
|
|
2701
2715
|
},
|
|
2702
2716
|
{ timestamps: true }
|
|
2703
2717
|
);
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
var CouponModel = mongoose35.models.Coupon || mongoose35.model("Coupon",
|
|
2718
|
+
schema26.index({ active: 1, deletedAt: 1, "owner.userId": 1 });
|
|
2719
|
+
schema26.index({ "couponData.participantUsers.userId": 1 });
|
|
2720
|
+
var CouponModel = mongoose35.models.Coupon || mongoose35.model("Coupon", schema26);
|
|
2707
2721
|
|
|
2708
2722
|
// src/mongoose/Impersonation.ts
|
|
2709
2723
|
import { EnumResourceType as EnumResourceType8 } from "@timardex/cluemart-shared";
|
|
@@ -5032,9 +5046,10 @@ export {
|
|
|
5032
5046
|
RelationTypeSchema,
|
|
5033
5047
|
ResourceActivityModel,
|
|
5034
5048
|
ResourceImageTypeSchema,
|
|
5049
|
+
SCRAPE_SITES_CONFIG_KEY,
|
|
5035
5050
|
SUBSCRIPTION_REWARD_TIMEZONE,
|
|
5036
5051
|
SchoolModel,
|
|
5037
|
-
|
|
5052
|
+
ScrapeSiteConfigModel,
|
|
5038
5053
|
SocialMediaTypeSchema,
|
|
5039
5054
|
StallTypeSchema,
|
|
5040
5055
|
UnregisteredVendorModel,
|