@timardex/cluemart-shared 1.2.29 → 1.2.31
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/ad-Cv1V8lgJ.d.ts +129 -0
- package/dist/ad-IVwm5MLY.d.mts +129 -0
- package/dist/{auth-CzEdRDf1.d.ts → auth-BCxQp_CF.d.ts} +1 -1
- package/dist/{auth-Ci6Uskch.d.mts → auth-BczaOu28.d.mts} +1 -1
- package/dist/{chunk-BO3HICLR.mjs → chunk-4OLDTZXH.mjs} +3 -1
- package/dist/chunk-4OLDTZXH.mjs.map +1 -0
- package/dist/{chunk-CQ7TCXMI.mjs → chunk-O6LVIQFK.mjs} +3 -5
- package/dist/chunk-O6LVIQFK.mjs.map +1 -0
- package/dist/formFields/index.d.mts +2 -1
- package/dist/formFields/index.d.ts +2 -1
- package/dist/{global-2Jk7sRkL.d.ts → global-Bnr6l_NH.d.ts} +21 -1
- package/dist/{global-DWuTxnJ8.d.mts → global-_89-F0iL.d.mts} +21 -1
- package/dist/graphql/index.d.mts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/hooks/index.d.mts +4 -4
- package/dist/hooks/index.d.ts +4 -4
- package/dist/index.cjs +112 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +132 -2
- package/dist/index.d.ts +132 -2
- package/dist/index.mjs +98 -76
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +94 -62
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +109 -4
- package/dist/mongoose/index.d.ts +109 -4
- package/dist/mongoose/index.mjs +22 -3
- package/dist/mongoose/index.mjs.map +1 -1
- package/dist/service/index.cjs +22 -15
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +9 -2
- package/dist/service/index.d.ts +9 -2
- package/dist/service/index.mjs +19 -13
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.cjs +15 -2
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/index.mjs +5 -3
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +3 -1
- package/dist/ad-Crq-z5Wt.d.mts +0 -69
- package/dist/ad-DHetF-th.d.ts +0 -69
- package/dist/chunk-BO3HICLR.mjs.map +0 -1
- package/dist/chunk-CQ7TCXMI.mjs.map +0 -1
- package/dist/user-DbEEY7fv.d.ts +0 -64
- package/dist/user-OPY5EOqR.d.mts +0 -64
package/dist/index.mjs
CHANGED
|
@@ -5935,9 +5935,10 @@ function useAdForm(data) {
|
|
|
5935
5935
|
}
|
|
5936
5936
|
|
|
5937
5937
|
// src/mongoose/Ad.ts
|
|
5938
|
-
import
|
|
5938
|
+
import mongoose5 from "mongoose";
|
|
5939
5939
|
|
|
5940
5940
|
// src/types/global.ts
|
|
5941
|
+
import mongoose from "mongoose";
|
|
5941
5942
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
5942
5943
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
5943
5944
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -5957,14 +5958,14 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
5957
5958
|
})(EnumActivity || {});
|
|
5958
5959
|
|
|
5959
5960
|
// src/mongoose/global.ts
|
|
5960
|
-
import
|
|
5961
|
+
import mongoose4 from "mongoose";
|
|
5961
5962
|
|
|
5962
5963
|
// src/mongoose/Relation.ts
|
|
5963
|
-
import
|
|
5964
|
+
import mongoose3 from "mongoose";
|
|
5964
5965
|
|
|
5965
5966
|
// src/mongoose/event/EventInfo.ts
|
|
5966
|
-
import
|
|
5967
|
-
var MongooseSchema =
|
|
5967
|
+
import mongoose2 from "mongoose";
|
|
5968
|
+
var MongooseSchema = mongoose2.Schema;
|
|
5968
5969
|
var StallTypeSchema = new MongooseSchema(
|
|
5969
5970
|
{
|
|
5970
5971
|
electricity: {
|
|
@@ -6023,7 +6024,7 @@ var schema = new MongooseSchema(
|
|
|
6023
6024
|
eventId: {
|
|
6024
6025
|
ref: "Event",
|
|
6025
6026
|
required: false,
|
|
6026
|
-
type:
|
|
6027
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
6027
6028
|
},
|
|
6028
6029
|
packInTime: { required: true, type: Number },
|
|
6029
6030
|
paymentDueHours: { required: true, type: Number },
|
|
@@ -6032,10 +6033,13 @@ var schema = new MongooseSchema(
|
|
|
6032
6033
|
},
|
|
6033
6034
|
{ timestamps: true }
|
|
6034
6035
|
);
|
|
6035
|
-
var EventInfoModel =
|
|
6036
|
+
var EventInfoModel = mongoose2.model(
|
|
6037
|
+
"EventInfo",
|
|
6038
|
+
schema
|
|
6039
|
+
);
|
|
6036
6040
|
|
|
6037
6041
|
// src/mongoose/Relation.ts
|
|
6038
|
-
var MongooseSchema2 =
|
|
6042
|
+
var MongooseSchema2 = mongoose3.Schema;
|
|
6039
6043
|
var relationDatesSchema = new MongooseSchema2(
|
|
6040
6044
|
{
|
|
6041
6045
|
lastUpdateBy: {
|
|
@@ -6060,13 +6064,13 @@ var RelationTypeSchema = new MongooseSchema2(
|
|
|
6060
6064
|
chatId: {
|
|
6061
6065
|
ref: "Chat",
|
|
6062
6066
|
required: true,
|
|
6063
|
-
type:
|
|
6067
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6064
6068
|
},
|
|
6065
6069
|
deletedAt: { default: null, required: false, type: Date },
|
|
6066
6070
|
eventId: {
|
|
6067
6071
|
ref: "Event",
|
|
6068
6072
|
required: true,
|
|
6069
|
-
type:
|
|
6073
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6070
6074
|
},
|
|
6071
6075
|
lastUpdateBy: {
|
|
6072
6076
|
enum: Object.values(EnumResourceType),
|
|
@@ -6082,7 +6086,7 @@ var RelationTypeSchema = new MongooseSchema2(
|
|
|
6082
6086
|
vendorId: {
|
|
6083
6087
|
ref: "Vendor",
|
|
6084
6088
|
required: true,
|
|
6085
|
-
type:
|
|
6089
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6086
6090
|
}
|
|
6087
6091
|
},
|
|
6088
6092
|
{ timestamps: true }
|
|
@@ -6092,20 +6096,20 @@ RelationTypeSchema.index({
|
|
|
6092
6096
|
"relationDates.startTime": 1,
|
|
6093
6097
|
"relationDates.status": 1
|
|
6094
6098
|
});
|
|
6095
|
-
var RelationModel =
|
|
6099
|
+
var RelationModel = mongoose3.model(
|
|
6096
6100
|
"Relation",
|
|
6097
6101
|
RelationTypeSchema
|
|
6098
6102
|
);
|
|
6099
6103
|
|
|
6100
6104
|
// src/mongoose/global.ts
|
|
6101
|
-
var MongooseSchema3 =
|
|
6105
|
+
var MongooseSchema3 = mongoose4.Schema;
|
|
6102
6106
|
var OwnerTypeSchema = new MongooseSchema3(
|
|
6103
6107
|
{
|
|
6104
6108
|
email: { required: true, type: String },
|
|
6105
6109
|
userId: {
|
|
6106
6110
|
ref: "User",
|
|
6107
6111
|
required: true,
|
|
6108
|
-
type:
|
|
6112
|
+
type: mongoose4.Schema.Types.ObjectId
|
|
6109
6113
|
}
|
|
6110
6114
|
},
|
|
6111
6115
|
{ _id: false }
|
|
@@ -6215,7 +6219,7 @@ var resourceRelationsSchema = new MongooseSchema3(
|
|
|
6215
6219
|
relationId: {
|
|
6216
6220
|
ref: "Relation",
|
|
6217
6221
|
required: false,
|
|
6218
|
-
type:
|
|
6222
|
+
type: mongoose4.Schema.Types.ObjectId
|
|
6219
6223
|
}
|
|
6220
6224
|
},
|
|
6221
6225
|
{ _id: false }
|
|
@@ -6225,7 +6229,7 @@ var baseResourceFields = {
|
|
|
6225
6229
|
adIds: {
|
|
6226
6230
|
ref: "Ad",
|
|
6227
6231
|
required: false,
|
|
6228
|
-
type: [
|
|
6232
|
+
type: [mongoose4.Schema.Types.ObjectId]
|
|
6229
6233
|
},
|
|
6230
6234
|
contactDetails: ContactDetailsSchema,
|
|
6231
6235
|
cover: ResourceImageTypeSchema,
|
|
@@ -6252,7 +6256,7 @@ var baseResourceFields = {
|
|
|
6252
6256
|
};
|
|
6253
6257
|
|
|
6254
6258
|
// src/mongoose/Ad.ts
|
|
6255
|
-
var MongooseSchema4 =
|
|
6259
|
+
var MongooseSchema4 = mongoose5.Schema;
|
|
6256
6260
|
var schema2 = new MongooseSchema4(
|
|
6257
6261
|
{
|
|
6258
6262
|
active: { default: true, type: Boolean },
|
|
@@ -6310,11 +6314,11 @@ schema2.index({
|
|
|
6310
6314
|
start: 1,
|
|
6311
6315
|
status: 1
|
|
6312
6316
|
});
|
|
6313
|
-
var AdModel =
|
|
6317
|
+
var AdModel = mongoose5.model("Ad", schema2);
|
|
6314
6318
|
|
|
6315
6319
|
// src/mongoose/Chat.ts
|
|
6316
|
-
import
|
|
6317
|
-
var MongooseSchema5 =
|
|
6320
|
+
import mongoose6 from "mongoose";
|
|
6321
|
+
var MongooseSchema5 = mongoose6.Schema;
|
|
6318
6322
|
var MessageSchema = new MongooseSchema5(
|
|
6319
6323
|
{
|
|
6320
6324
|
content: { required: true, type: String },
|
|
@@ -6322,7 +6326,7 @@ var MessageSchema = new MongooseSchema5(
|
|
|
6322
6326
|
senderId: {
|
|
6323
6327
|
ref: "User",
|
|
6324
6328
|
required: true,
|
|
6325
|
-
type:
|
|
6329
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6326
6330
|
},
|
|
6327
6331
|
senderName: { required: true, type: String }
|
|
6328
6332
|
},
|
|
@@ -6335,7 +6339,7 @@ var ParticipantSchema = new MongooseSchema5(
|
|
|
6335
6339
|
userId: {
|
|
6336
6340
|
ref: "User",
|
|
6337
6341
|
required: true,
|
|
6338
|
-
type:
|
|
6342
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6339
6343
|
}
|
|
6340
6344
|
},
|
|
6341
6345
|
{ _id: false }
|
|
@@ -6357,12 +6361,12 @@ var ChatSchema = new MongooseSchema5(
|
|
|
6357
6361
|
eventId: {
|
|
6358
6362
|
ref: "Event",
|
|
6359
6363
|
required: false,
|
|
6360
|
-
type:
|
|
6364
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6361
6365
|
},
|
|
6362
6366
|
vendorId: {
|
|
6363
6367
|
ref: "Vendor",
|
|
6364
6368
|
required: false,
|
|
6365
|
-
type:
|
|
6369
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6366
6370
|
}
|
|
6367
6371
|
}
|
|
6368
6372
|
},
|
|
@@ -6370,11 +6374,11 @@ var ChatSchema = new MongooseSchema5(
|
|
|
6370
6374
|
timestamps: true
|
|
6371
6375
|
}
|
|
6372
6376
|
);
|
|
6373
|
-
var ChatModel =
|
|
6377
|
+
var ChatModel = mongoose6.model("Chat", ChatSchema);
|
|
6374
6378
|
|
|
6375
6379
|
// src/mongoose/Notification.ts
|
|
6376
|
-
import
|
|
6377
|
-
var MongooseSchema6 =
|
|
6380
|
+
import mongoose7 from "mongoose";
|
|
6381
|
+
var MongooseSchema6 = mongoose7.Schema;
|
|
6378
6382
|
var schema3 = new MongooseSchema6(
|
|
6379
6383
|
{
|
|
6380
6384
|
data: {
|
|
@@ -6398,22 +6402,21 @@ var schema3 = new MongooseSchema6(
|
|
|
6398
6402
|
userId: {
|
|
6399
6403
|
ref: "User",
|
|
6400
6404
|
required: true,
|
|
6401
|
-
type:
|
|
6405
|
+
type: mongoose7.Schema.Types.ObjectId
|
|
6402
6406
|
}
|
|
6403
6407
|
},
|
|
6404
6408
|
{ timestamps: true }
|
|
6405
6409
|
);
|
|
6406
6410
|
schema3.index({ isRead: 1, userId: 1 });
|
|
6407
6411
|
schema3.index({ createdAt: -1, userId: 1 });
|
|
6408
|
-
var NotificationModel =
|
|
6412
|
+
var NotificationModel = mongoose7.model(
|
|
6409
6413
|
"Notification",
|
|
6410
6414
|
schema3
|
|
6411
6415
|
);
|
|
6412
|
-
var Notification_default = NotificationModel;
|
|
6413
6416
|
|
|
6414
6417
|
// src/mongoose/PushToken.ts
|
|
6415
|
-
import
|
|
6416
|
-
var MongooseSchema7 =
|
|
6418
|
+
import mongoose8 from "mongoose";
|
|
6419
|
+
var MongooseSchema7 = mongoose8.Schema;
|
|
6417
6420
|
var schema4 = new MongooseSchema7(
|
|
6418
6421
|
{
|
|
6419
6422
|
platform: {
|
|
@@ -6422,16 +6425,15 @@ var schema4 = new MongooseSchema7(
|
|
|
6422
6425
|
type: String
|
|
6423
6426
|
},
|
|
6424
6427
|
token: { required: true, type: String },
|
|
6425
|
-
userId: { required: true, type:
|
|
6428
|
+
userId: { required: true, type: mongoose8.Schema.Types.ObjectId }
|
|
6426
6429
|
},
|
|
6427
6430
|
{ timestamps: true }
|
|
6428
6431
|
);
|
|
6429
|
-
var PushTokenModel =
|
|
6430
|
-
var PushToken_default = PushTokenModel;
|
|
6432
|
+
var PushTokenModel = mongoose8.model("PushToken", schema4);
|
|
6431
6433
|
|
|
6432
6434
|
// src/mongoose/ResourceActivity.ts
|
|
6433
|
-
import
|
|
6434
|
-
var MongooseSchema8 =
|
|
6435
|
+
import mongoose9 from "mongoose";
|
|
6436
|
+
var MongooseSchema8 = mongoose9.Schema;
|
|
6435
6437
|
var ActivitySchema = new MongooseSchema8(
|
|
6436
6438
|
{
|
|
6437
6439
|
activityType: {
|
|
@@ -6477,11 +6479,11 @@ var schema5 = new MongooseSchema8(
|
|
|
6477
6479
|
);
|
|
6478
6480
|
schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
6479
6481
|
schema5.index({ "views.location": "2dsphere" });
|
|
6480
|
-
var ResourceActivityModel =
|
|
6482
|
+
var ResourceActivityModel = mongoose9.model("ResourceActivity", schema5);
|
|
6481
6483
|
|
|
6482
6484
|
// src/mongoose/Testers.ts
|
|
6483
|
-
import
|
|
6484
|
-
var MongooseSchema9 =
|
|
6485
|
+
import mongoose10 from "mongoose";
|
|
6486
|
+
var MongooseSchema9 = mongoose10.Schema;
|
|
6485
6487
|
var TesterSchema = new MongooseSchema9(
|
|
6486
6488
|
{
|
|
6487
6489
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -6506,17 +6508,17 @@ var TesterSchema = new MongooseSchema9(
|
|
|
6506
6508
|
timestamps: true
|
|
6507
6509
|
}
|
|
6508
6510
|
);
|
|
6509
|
-
var TesterModel =
|
|
6511
|
+
var TesterModel = mongoose10.model("Tester", TesterSchema);
|
|
6510
6512
|
|
|
6511
6513
|
// src/mongoose/User.ts
|
|
6512
|
-
import
|
|
6513
|
-
var MongooseSchema10 =
|
|
6514
|
+
import mongoose11 from "mongoose";
|
|
6515
|
+
var MongooseSchema10 = mongoose11.Schema;
|
|
6514
6516
|
var userActivityEventSchema = new MongooseSchema10(
|
|
6515
6517
|
{
|
|
6516
6518
|
resourceId: {
|
|
6517
6519
|
ref: "Event",
|
|
6518
6520
|
required: false,
|
|
6519
|
-
type:
|
|
6521
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
6520
6522
|
},
|
|
6521
6523
|
startDate: { required: false, type: String },
|
|
6522
6524
|
startTime: { required: false, type: String }
|
|
@@ -6528,12 +6530,12 @@ var userActivityFavouritesSchema = new MongooseSchema10(
|
|
|
6528
6530
|
events: {
|
|
6529
6531
|
ref: "Event",
|
|
6530
6532
|
required: false,
|
|
6531
|
-
type: [
|
|
6533
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6532
6534
|
},
|
|
6533
6535
|
vendors: {
|
|
6534
6536
|
ref: "Vendor",
|
|
6535
6537
|
required: false,
|
|
6536
|
-
type: [
|
|
6538
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6537
6539
|
}
|
|
6538
6540
|
},
|
|
6539
6541
|
{ _id: false }
|
|
@@ -6547,7 +6549,7 @@ var schema6 = new MongooseSchema10(
|
|
|
6547
6549
|
events: {
|
|
6548
6550
|
ref: "Event",
|
|
6549
6551
|
required: false,
|
|
6550
|
-
type: [
|
|
6552
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6551
6553
|
},
|
|
6552
6554
|
firstName: { required: true, type: String },
|
|
6553
6555
|
isTester: { default: false, required: false, type: Boolean },
|
|
@@ -6600,17 +6602,17 @@ var schema6 = new MongooseSchema10(
|
|
|
6600
6602
|
vendor: {
|
|
6601
6603
|
ref: "Vendor",
|
|
6602
6604
|
required: false,
|
|
6603
|
-
type:
|
|
6605
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
6604
6606
|
}
|
|
6605
6607
|
},
|
|
6606
6608
|
{ timestamps: true }
|
|
6607
6609
|
);
|
|
6608
6610
|
schema6.index({ "partners.email": 1 });
|
|
6609
|
-
var UserModel =
|
|
6611
|
+
var UserModel = mongoose11.model("User", schema6);
|
|
6610
6612
|
|
|
6611
6613
|
// src/mongoose/VerificationToken.ts
|
|
6612
|
-
import
|
|
6613
|
-
var MongooseSchema11 =
|
|
6614
|
+
import mongoose12 from "mongoose";
|
|
6615
|
+
var MongooseSchema11 = mongoose12.Schema;
|
|
6614
6616
|
var schema7 = new MongooseSchema11(
|
|
6615
6617
|
{
|
|
6616
6618
|
createdAt: {
|
|
@@ -6626,14 +6628,14 @@ var schema7 = new MongooseSchema11(
|
|
|
6626
6628
|
},
|
|
6627
6629
|
{ timestamps: true }
|
|
6628
6630
|
);
|
|
6629
|
-
var VerificationTokenModel =
|
|
6631
|
+
var VerificationTokenModel = mongoose12.model(
|
|
6630
6632
|
"VerificationToken",
|
|
6631
6633
|
schema7
|
|
6632
6634
|
);
|
|
6633
6635
|
|
|
6634
6636
|
// src/mongoose/vendor/Vendor.ts
|
|
6635
|
-
import
|
|
6636
|
-
var MongooseSchema12 =
|
|
6637
|
+
import mongoose13 from "mongoose";
|
|
6638
|
+
var MongooseSchema12 = mongoose13.Schema;
|
|
6637
6639
|
var MenuTypeSchema = new MongooseSchema12(
|
|
6638
6640
|
{
|
|
6639
6641
|
description: { required: false, type: String },
|
|
@@ -6688,7 +6690,7 @@ var schema8 = new MongooseSchema12(
|
|
|
6688
6690
|
vendorInfoId: {
|
|
6689
6691
|
ref: "VendorInfo",
|
|
6690
6692
|
required: false,
|
|
6691
|
-
type:
|
|
6693
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
6692
6694
|
},
|
|
6693
6695
|
vendorType: {
|
|
6694
6696
|
enum: Object.values(EnumVendorType),
|
|
@@ -6703,11 +6705,11 @@ schema8.index({ description: 1 });
|
|
|
6703
6705
|
schema8.index({ region: 1 });
|
|
6704
6706
|
schema8.index({ "categories.name": 1 });
|
|
6705
6707
|
schema8.index({ "partners.email": 1 });
|
|
6706
|
-
var VendorModel =
|
|
6708
|
+
var VendorModel = mongoose13.model("Vendor", schema8);
|
|
6707
6709
|
|
|
6708
6710
|
// src/mongoose/vendor/VendorInfo.ts
|
|
6709
|
-
import
|
|
6710
|
-
var MongooseSchema13 =
|
|
6711
|
+
import mongoose14 from "mongoose";
|
|
6712
|
+
var MongooseSchema13 = mongoose14.Schema;
|
|
6711
6713
|
var AttributesSchema = new MongooseSchema13(
|
|
6712
6714
|
{
|
|
6713
6715
|
details: { required: false, type: String },
|
|
@@ -6749,19 +6751,19 @@ var schema9 = new MongooseSchema13(
|
|
|
6749
6751
|
vendorId: {
|
|
6750
6752
|
ref: "Vendor",
|
|
6751
6753
|
required: true,
|
|
6752
|
-
type:
|
|
6754
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
6753
6755
|
}
|
|
6754
6756
|
},
|
|
6755
6757
|
{ timestamps: true }
|
|
6756
6758
|
);
|
|
6757
|
-
var VendorInfoModel =
|
|
6759
|
+
var VendorInfoModel = mongoose14.model(
|
|
6758
6760
|
"VendorInfo",
|
|
6759
6761
|
schema9
|
|
6760
6762
|
);
|
|
6761
6763
|
|
|
6762
6764
|
// src/mongoose/event/Event.ts
|
|
6763
|
-
import
|
|
6764
|
-
var MongooseSchema14 =
|
|
6765
|
+
import mongoose15 from "mongoose";
|
|
6766
|
+
var MongooseSchema14 = mongoose15.Schema;
|
|
6765
6767
|
var locationsSchema = new MongooseSchema14(
|
|
6766
6768
|
{
|
|
6767
6769
|
city: { required: true, type: String },
|
|
@@ -6803,7 +6805,7 @@ var schema10 = new MongooseSchema14(
|
|
|
6803
6805
|
eventInfoId: {
|
|
6804
6806
|
ref: "EventInfo",
|
|
6805
6807
|
required: false,
|
|
6806
|
-
type:
|
|
6808
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
6807
6809
|
},
|
|
6808
6810
|
eventType: {
|
|
6809
6811
|
enum: Object.values(EnumEventType),
|
|
@@ -6827,10 +6829,10 @@ schema10.index({ region: 1 });
|
|
|
6827
6829
|
schema10.index({ location: "2dsphere" });
|
|
6828
6830
|
schema10.index({ tags: 1 });
|
|
6829
6831
|
schema10.index({ "partners.email": 1 });
|
|
6830
|
-
var EventModel =
|
|
6832
|
+
var EventModel = mongoose15.model("Event", schema10);
|
|
6831
6833
|
|
|
6832
6834
|
// src/service/database.ts
|
|
6833
|
-
import
|
|
6835
|
+
import mongoose16 from "mongoose";
|
|
6834
6836
|
|
|
6835
6837
|
// src/service/timezonePlugin.ts
|
|
6836
6838
|
import dayjs3 from "dayjs";
|
|
@@ -6852,15 +6854,21 @@ function timezonePlugin(schema11) {
|
|
|
6852
6854
|
}
|
|
6853
6855
|
|
|
6854
6856
|
// src/service/database.ts
|
|
6855
|
-
|
|
6856
|
-
var connectToDatabase = async (
|
|
6857
|
+
mongoose16.plugin(timezonePlugin);
|
|
6858
|
+
var connectToDatabase = async ({
|
|
6859
|
+
appName,
|
|
6860
|
+
dbName,
|
|
6861
|
+
dbPassword,
|
|
6862
|
+
dbUser,
|
|
6863
|
+
mongodbUri
|
|
6864
|
+
}) => {
|
|
6857
6865
|
try {
|
|
6858
|
-
const mongoUri =
|
|
6866
|
+
const mongoUri = mongodbUri ? mongodbUri : (
|
|
6859
6867
|
// Fallback to MongoDB Atlas connection string
|
|
6860
|
-
`mongodb+srv://${
|
|
6868
|
+
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
6861
6869
|
);
|
|
6862
|
-
await
|
|
6863
|
-
const connectionType =
|
|
6870
|
+
await mongoose16.connect(mongoUri);
|
|
6871
|
+
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
6864
6872
|
console.log(
|
|
6865
6873
|
`${connectionType} connected from server/src/service/database.ts`
|
|
6866
6874
|
);
|
|
@@ -6873,12 +6881,12 @@ var connectToDatabase = async () => {
|
|
|
6873
6881
|
// src/service/notificationService.ts
|
|
6874
6882
|
async function publishNotificationEvents(userId, context) {
|
|
6875
6883
|
try {
|
|
6876
|
-
const userNotifications = await
|
|
6884
|
+
const userNotifications = await NotificationModel.find({
|
|
6877
6885
|
userId
|
|
6878
6886
|
}).sort({ createdAt: -1 });
|
|
6879
6887
|
const [total, unread] = await Promise.all([
|
|
6880
|
-
|
|
6881
|
-
|
|
6888
|
+
NotificationModel.countDocuments({ userId }),
|
|
6889
|
+
NotificationModel.countDocuments({ isRead: false, userId })
|
|
6882
6890
|
]);
|
|
6883
6891
|
context.pubsub.publish("GET_NOTIFICATIONS" /* GET_NOTIFICATIONS */, {
|
|
6884
6892
|
getNotifications: userNotifications,
|
|
@@ -6906,7 +6914,7 @@ async function createNotifications(payload, context) {
|
|
|
6906
6914
|
type,
|
|
6907
6915
|
userId
|
|
6908
6916
|
}));
|
|
6909
|
-
const savedNotifications = await
|
|
6917
|
+
const savedNotifications = await NotificationModel.insertMany(notifications);
|
|
6910
6918
|
console.log(
|
|
6911
6919
|
`Created ${savedNotifications.length} notifications for ${userIds.length} users`
|
|
6912
6920
|
);
|
|
@@ -6995,7 +7003,7 @@ async function sendPushNotification({
|
|
|
6995
7003
|
title,
|
|
6996
7004
|
userIds
|
|
6997
7005
|
}) {
|
|
6998
|
-
const pushTokens = await
|
|
7006
|
+
const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });
|
|
6999
7007
|
const expoTokens = pushTokens.map((token) => token.token);
|
|
7000
7008
|
const { messages, invalidTokens } = createPushMessages({
|
|
7001
7009
|
data,
|
|
@@ -7074,7 +7082,9 @@ var fonts = {
|
|
|
7074
7082
|
}
|
|
7075
7083
|
};
|
|
7076
7084
|
export {
|
|
7085
|
+
AdModel,
|
|
7077
7086
|
CategorySchema,
|
|
7087
|
+
ChatModel,
|
|
7078
7088
|
EnumActivity,
|
|
7079
7089
|
EnumAdShowOn,
|
|
7080
7090
|
EnumAdStatus,
|
|
@@ -7096,9 +7106,15 @@ export {
|
|
|
7096
7106
|
EnumUserLicence,
|
|
7097
7107
|
EnumUserRole,
|
|
7098
7108
|
EnumVendorType,
|
|
7109
|
+
EventInfoModel,
|
|
7110
|
+
EventModel,
|
|
7099
7111
|
ImageTypeEnum,
|
|
7112
|
+
NotificationModel,
|
|
7100
7113
|
ParticipantSchema,
|
|
7114
|
+
PushTokenModel,
|
|
7115
|
+
RelationModel,
|
|
7101
7116
|
RelationTypeSchema,
|
|
7117
|
+
ResourceActivityModel,
|
|
7102
7118
|
ResourceImageTypeSchema,
|
|
7103
7119
|
SAVED_EMAIL_KEY,
|
|
7104
7120
|
SAVED_PASSWORD_KEY,
|
|
@@ -7106,7 +7122,12 @@ export {
|
|
|
7106
7122
|
SAVED_TOKEN_KEY,
|
|
7107
7123
|
SocialMediaTypeSchema,
|
|
7108
7124
|
StallTypeSchema,
|
|
7125
|
+
TesterModel,
|
|
7109
7126
|
USER_STORAGE_KEY,
|
|
7127
|
+
UserModel,
|
|
7128
|
+
VendorInfoModel,
|
|
7129
|
+
VendorModel,
|
|
7130
|
+
VerificationTokenModel,
|
|
7110
7131
|
availableCategories,
|
|
7111
7132
|
availableCityOptions,
|
|
7112
7133
|
availableRegionOptions,
|
|
@@ -7143,6 +7164,7 @@ export {
|
|
|
7143
7164
|
loginFields,
|
|
7144
7165
|
mapArrayToOptions,
|
|
7145
7166
|
mapBaseResourceTypeToFormData,
|
|
7167
|
+
mongoose,
|
|
7146
7168
|
normalizeUrl,
|
|
7147
7169
|
packagingOptions,
|
|
7148
7170
|
partnersSchema,
|