@timardex/cluemart-shared 1.2.30 → 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-C02AZIGy.d.ts → ad-Cv1V8lgJ.d.ts} +1 -1
- package/dist/{ad-CTWMmc7b.d.mts → ad-IVwm5MLY.d.mts} +1 -1
- package/dist/{auth-o_ns6gLk.d.ts → auth-BCxQp_CF.d.ts} +1 -1
- package/dist/{auth-YsJJnj12.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/formFields/index.d.mts +2 -1
- package/dist/formFields/index.d.ts +2 -1
- package/dist/{global-4lS-fh61.d.ts → global-Bnr6l_NH.d.ts} +1 -0
- package/dist/{global-_ZHkOcnR.d.mts → global-_89-F0iL.d.mts} +1 -0
- package/dist/graphql/index.d.mts +3 -2
- package/dist/graphql/index.d.ts +3 -2
- package/dist/hooks/index.d.mts +4 -3
- package/dist/hooks/index.d.ts +4 -3
- package/dist/index.cjs +78 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.mjs +77 -69
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +65 -62
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +4 -3
- package/dist/mongoose/index.d.ts +4 -3
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +17 -8
- 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 +11 -5
- 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 -4
- package/dist/types/index.d.ts +5 -4
- 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/chunk-BO3HICLR.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
1
2
|
import mongoose from 'mongoose';
|
|
3
|
+
export { default as mongoose } from 'mongoose';
|
|
2
4
|
import { FieldValues, Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
3
5
|
import * as _apollo_client from '@apollo/client';
|
|
4
6
|
|
|
@@ -1893,7 +1895,13 @@ declare const EventInfoModel: mongoose.Model<SchemaEventInfoType, {}, {}, {}, mo
|
|
|
1893
1895
|
* Connect to MongoDB using Mongoose.
|
|
1894
1896
|
* Supports both local MongoDB (via MONGODB_URI) and MongoDB Atlas (via individual env vars).
|
|
1895
1897
|
*/
|
|
1896
|
-
declare const connectToDatabase: (
|
|
1898
|
+
declare const connectToDatabase: ({ appName, dbName, dbPassword, dbUser, mongodbUri, }: {
|
|
1899
|
+
appName: string;
|
|
1900
|
+
dbName: string;
|
|
1901
|
+
dbPassword: string;
|
|
1902
|
+
dbUser: string;
|
|
1903
|
+
mongodbUri: string;
|
|
1904
|
+
}) => Promise<void>;
|
|
1897
1905
|
|
|
1898
1906
|
declare function publishNotificationEvents(userId: ObjectId, context: GraphQLContext): Promise<void>;
|
|
1899
1907
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Request } from 'express';
|
|
1
2
|
import mongoose from 'mongoose';
|
|
3
|
+
export { default as mongoose } from 'mongoose';
|
|
2
4
|
import { FieldValues, Control, FieldErrors, UseFormHandleSubmit, UseFormReset, UseFormSetValue, UseFormWatch } from 'react-hook-form';
|
|
3
5
|
import * as _apollo_client from '@apollo/client';
|
|
4
6
|
|
|
@@ -1893,7 +1895,13 @@ declare const EventInfoModel: mongoose.Model<SchemaEventInfoType, {}, {}, {}, mo
|
|
|
1893
1895
|
* Connect to MongoDB using Mongoose.
|
|
1894
1896
|
* Supports both local MongoDB (via MONGODB_URI) and MongoDB Atlas (via individual env vars).
|
|
1895
1897
|
*/
|
|
1896
|
-
declare const connectToDatabase: (
|
|
1898
|
+
declare const connectToDatabase: ({ appName, dbName, dbPassword, dbUser, mongodbUri, }: {
|
|
1899
|
+
appName: string;
|
|
1900
|
+
dbName: string;
|
|
1901
|
+
dbPassword: string;
|
|
1902
|
+
dbUser: string;
|
|
1903
|
+
mongodbUri: string;
|
|
1904
|
+
}) => Promise<void>;
|
|
1897
1905
|
|
|
1898
1906
|
declare function publishNotificationEvents(userId: ObjectId, context: GraphQLContext): Promise<void>;
|
|
1899
1907
|
/**
|
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,13 +6033,13 @@ var schema = new MongooseSchema(
|
|
|
6032
6033
|
},
|
|
6033
6034
|
{ timestamps: true }
|
|
6034
6035
|
);
|
|
6035
|
-
var EventInfoModel =
|
|
6036
|
+
var EventInfoModel = mongoose2.model(
|
|
6036
6037
|
"EventInfo",
|
|
6037
6038
|
schema
|
|
6038
6039
|
);
|
|
6039
6040
|
|
|
6040
6041
|
// src/mongoose/Relation.ts
|
|
6041
|
-
var MongooseSchema2 =
|
|
6042
|
+
var MongooseSchema2 = mongoose3.Schema;
|
|
6042
6043
|
var relationDatesSchema = new MongooseSchema2(
|
|
6043
6044
|
{
|
|
6044
6045
|
lastUpdateBy: {
|
|
@@ -6063,13 +6064,13 @@ var RelationTypeSchema = new MongooseSchema2(
|
|
|
6063
6064
|
chatId: {
|
|
6064
6065
|
ref: "Chat",
|
|
6065
6066
|
required: true,
|
|
6066
|
-
type:
|
|
6067
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6067
6068
|
},
|
|
6068
6069
|
deletedAt: { default: null, required: false, type: Date },
|
|
6069
6070
|
eventId: {
|
|
6070
6071
|
ref: "Event",
|
|
6071
6072
|
required: true,
|
|
6072
|
-
type:
|
|
6073
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6073
6074
|
},
|
|
6074
6075
|
lastUpdateBy: {
|
|
6075
6076
|
enum: Object.values(EnumResourceType),
|
|
@@ -6085,7 +6086,7 @@ var RelationTypeSchema = new MongooseSchema2(
|
|
|
6085
6086
|
vendorId: {
|
|
6086
6087
|
ref: "Vendor",
|
|
6087
6088
|
required: true,
|
|
6088
|
-
type:
|
|
6089
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
6089
6090
|
}
|
|
6090
6091
|
},
|
|
6091
6092
|
{ timestamps: true }
|
|
@@ -6095,20 +6096,20 @@ RelationTypeSchema.index({
|
|
|
6095
6096
|
"relationDates.startTime": 1,
|
|
6096
6097
|
"relationDates.status": 1
|
|
6097
6098
|
});
|
|
6098
|
-
var RelationModel =
|
|
6099
|
+
var RelationModel = mongoose3.model(
|
|
6099
6100
|
"Relation",
|
|
6100
6101
|
RelationTypeSchema
|
|
6101
6102
|
);
|
|
6102
6103
|
|
|
6103
6104
|
// src/mongoose/global.ts
|
|
6104
|
-
var MongooseSchema3 =
|
|
6105
|
+
var MongooseSchema3 = mongoose4.Schema;
|
|
6105
6106
|
var OwnerTypeSchema = new MongooseSchema3(
|
|
6106
6107
|
{
|
|
6107
6108
|
email: { required: true, type: String },
|
|
6108
6109
|
userId: {
|
|
6109
6110
|
ref: "User",
|
|
6110
6111
|
required: true,
|
|
6111
|
-
type:
|
|
6112
|
+
type: mongoose4.Schema.Types.ObjectId
|
|
6112
6113
|
}
|
|
6113
6114
|
},
|
|
6114
6115
|
{ _id: false }
|
|
@@ -6218,7 +6219,7 @@ var resourceRelationsSchema = new MongooseSchema3(
|
|
|
6218
6219
|
relationId: {
|
|
6219
6220
|
ref: "Relation",
|
|
6220
6221
|
required: false,
|
|
6221
|
-
type:
|
|
6222
|
+
type: mongoose4.Schema.Types.ObjectId
|
|
6222
6223
|
}
|
|
6223
6224
|
},
|
|
6224
6225
|
{ _id: false }
|
|
@@ -6228,7 +6229,7 @@ var baseResourceFields = {
|
|
|
6228
6229
|
adIds: {
|
|
6229
6230
|
ref: "Ad",
|
|
6230
6231
|
required: false,
|
|
6231
|
-
type: [
|
|
6232
|
+
type: [mongoose4.Schema.Types.ObjectId]
|
|
6232
6233
|
},
|
|
6233
6234
|
contactDetails: ContactDetailsSchema,
|
|
6234
6235
|
cover: ResourceImageTypeSchema,
|
|
@@ -6255,7 +6256,7 @@ var baseResourceFields = {
|
|
|
6255
6256
|
};
|
|
6256
6257
|
|
|
6257
6258
|
// src/mongoose/Ad.ts
|
|
6258
|
-
var MongooseSchema4 =
|
|
6259
|
+
var MongooseSchema4 = mongoose5.Schema;
|
|
6259
6260
|
var schema2 = new MongooseSchema4(
|
|
6260
6261
|
{
|
|
6261
6262
|
active: { default: true, type: Boolean },
|
|
@@ -6313,11 +6314,11 @@ schema2.index({
|
|
|
6313
6314
|
start: 1,
|
|
6314
6315
|
status: 1
|
|
6315
6316
|
});
|
|
6316
|
-
var AdModel =
|
|
6317
|
+
var AdModel = mongoose5.model("Ad", schema2);
|
|
6317
6318
|
|
|
6318
6319
|
// src/mongoose/Chat.ts
|
|
6319
|
-
import
|
|
6320
|
-
var MongooseSchema5 =
|
|
6320
|
+
import mongoose6 from "mongoose";
|
|
6321
|
+
var MongooseSchema5 = mongoose6.Schema;
|
|
6321
6322
|
var MessageSchema = new MongooseSchema5(
|
|
6322
6323
|
{
|
|
6323
6324
|
content: { required: true, type: String },
|
|
@@ -6325,7 +6326,7 @@ var MessageSchema = new MongooseSchema5(
|
|
|
6325
6326
|
senderId: {
|
|
6326
6327
|
ref: "User",
|
|
6327
6328
|
required: true,
|
|
6328
|
-
type:
|
|
6329
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6329
6330
|
},
|
|
6330
6331
|
senderName: { required: true, type: String }
|
|
6331
6332
|
},
|
|
@@ -6338,7 +6339,7 @@ var ParticipantSchema = new MongooseSchema5(
|
|
|
6338
6339
|
userId: {
|
|
6339
6340
|
ref: "User",
|
|
6340
6341
|
required: true,
|
|
6341
|
-
type:
|
|
6342
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6342
6343
|
}
|
|
6343
6344
|
},
|
|
6344
6345
|
{ _id: false }
|
|
@@ -6360,12 +6361,12 @@ var ChatSchema = new MongooseSchema5(
|
|
|
6360
6361
|
eventId: {
|
|
6361
6362
|
ref: "Event",
|
|
6362
6363
|
required: false,
|
|
6363
|
-
type:
|
|
6364
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6364
6365
|
},
|
|
6365
6366
|
vendorId: {
|
|
6366
6367
|
ref: "Vendor",
|
|
6367
6368
|
required: false,
|
|
6368
|
-
type:
|
|
6369
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
6369
6370
|
}
|
|
6370
6371
|
}
|
|
6371
6372
|
},
|
|
@@ -6373,11 +6374,11 @@ var ChatSchema = new MongooseSchema5(
|
|
|
6373
6374
|
timestamps: true
|
|
6374
6375
|
}
|
|
6375
6376
|
);
|
|
6376
|
-
var ChatModel =
|
|
6377
|
+
var ChatModel = mongoose6.model("Chat", ChatSchema);
|
|
6377
6378
|
|
|
6378
6379
|
// src/mongoose/Notification.ts
|
|
6379
|
-
import
|
|
6380
|
-
var MongooseSchema6 =
|
|
6380
|
+
import mongoose7 from "mongoose";
|
|
6381
|
+
var MongooseSchema6 = mongoose7.Schema;
|
|
6381
6382
|
var schema3 = new MongooseSchema6(
|
|
6382
6383
|
{
|
|
6383
6384
|
data: {
|
|
@@ -6401,21 +6402,21 @@ var schema3 = new MongooseSchema6(
|
|
|
6401
6402
|
userId: {
|
|
6402
6403
|
ref: "User",
|
|
6403
6404
|
required: true,
|
|
6404
|
-
type:
|
|
6405
|
+
type: mongoose7.Schema.Types.ObjectId
|
|
6405
6406
|
}
|
|
6406
6407
|
},
|
|
6407
6408
|
{ timestamps: true }
|
|
6408
6409
|
);
|
|
6409
6410
|
schema3.index({ isRead: 1, userId: 1 });
|
|
6410
6411
|
schema3.index({ createdAt: -1, userId: 1 });
|
|
6411
|
-
var NotificationModel =
|
|
6412
|
+
var NotificationModel = mongoose7.model(
|
|
6412
6413
|
"Notification",
|
|
6413
6414
|
schema3
|
|
6414
6415
|
);
|
|
6415
6416
|
|
|
6416
6417
|
// src/mongoose/PushToken.ts
|
|
6417
|
-
import
|
|
6418
|
-
var MongooseSchema7 =
|
|
6418
|
+
import mongoose8 from "mongoose";
|
|
6419
|
+
var MongooseSchema7 = mongoose8.Schema;
|
|
6419
6420
|
var schema4 = new MongooseSchema7(
|
|
6420
6421
|
{
|
|
6421
6422
|
platform: {
|
|
@@ -6424,15 +6425,15 @@ var schema4 = new MongooseSchema7(
|
|
|
6424
6425
|
type: String
|
|
6425
6426
|
},
|
|
6426
6427
|
token: { required: true, type: String },
|
|
6427
|
-
userId: { required: true, type:
|
|
6428
|
+
userId: { required: true, type: mongoose8.Schema.Types.ObjectId }
|
|
6428
6429
|
},
|
|
6429
6430
|
{ timestamps: true }
|
|
6430
6431
|
);
|
|
6431
|
-
var PushTokenModel =
|
|
6432
|
+
var PushTokenModel = mongoose8.model("PushToken", schema4);
|
|
6432
6433
|
|
|
6433
6434
|
// src/mongoose/ResourceActivity.ts
|
|
6434
|
-
import
|
|
6435
|
-
var MongooseSchema8 =
|
|
6435
|
+
import mongoose9 from "mongoose";
|
|
6436
|
+
var MongooseSchema8 = mongoose9.Schema;
|
|
6436
6437
|
var ActivitySchema = new MongooseSchema8(
|
|
6437
6438
|
{
|
|
6438
6439
|
activityType: {
|
|
@@ -6478,11 +6479,11 @@ var schema5 = new MongooseSchema8(
|
|
|
6478
6479
|
);
|
|
6479
6480
|
schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
6480
6481
|
schema5.index({ "views.location": "2dsphere" });
|
|
6481
|
-
var ResourceActivityModel =
|
|
6482
|
+
var ResourceActivityModel = mongoose9.model("ResourceActivity", schema5);
|
|
6482
6483
|
|
|
6483
6484
|
// src/mongoose/Testers.ts
|
|
6484
|
-
import
|
|
6485
|
-
var MongooseSchema9 =
|
|
6485
|
+
import mongoose10 from "mongoose";
|
|
6486
|
+
var MongooseSchema9 = mongoose10.Schema;
|
|
6486
6487
|
var TesterSchema = new MongooseSchema9(
|
|
6487
6488
|
{
|
|
6488
6489
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -6507,17 +6508,17 @@ var TesterSchema = new MongooseSchema9(
|
|
|
6507
6508
|
timestamps: true
|
|
6508
6509
|
}
|
|
6509
6510
|
);
|
|
6510
|
-
var TesterModel =
|
|
6511
|
+
var TesterModel = mongoose10.model("Tester", TesterSchema);
|
|
6511
6512
|
|
|
6512
6513
|
// src/mongoose/User.ts
|
|
6513
|
-
import
|
|
6514
|
-
var MongooseSchema10 =
|
|
6514
|
+
import mongoose11 from "mongoose";
|
|
6515
|
+
var MongooseSchema10 = mongoose11.Schema;
|
|
6515
6516
|
var userActivityEventSchema = new MongooseSchema10(
|
|
6516
6517
|
{
|
|
6517
6518
|
resourceId: {
|
|
6518
6519
|
ref: "Event",
|
|
6519
6520
|
required: false,
|
|
6520
|
-
type:
|
|
6521
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
6521
6522
|
},
|
|
6522
6523
|
startDate: { required: false, type: String },
|
|
6523
6524
|
startTime: { required: false, type: String }
|
|
@@ -6529,12 +6530,12 @@ var userActivityFavouritesSchema = new MongooseSchema10(
|
|
|
6529
6530
|
events: {
|
|
6530
6531
|
ref: "Event",
|
|
6531
6532
|
required: false,
|
|
6532
|
-
type: [
|
|
6533
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6533
6534
|
},
|
|
6534
6535
|
vendors: {
|
|
6535
6536
|
ref: "Vendor",
|
|
6536
6537
|
required: false,
|
|
6537
|
-
type: [
|
|
6538
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6538
6539
|
}
|
|
6539
6540
|
},
|
|
6540
6541
|
{ _id: false }
|
|
@@ -6548,7 +6549,7 @@ var schema6 = new MongooseSchema10(
|
|
|
6548
6549
|
events: {
|
|
6549
6550
|
ref: "Event",
|
|
6550
6551
|
required: false,
|
|
6551
|
-
type: [
|
|
6552
|
+
type: [mongoose11.Schema.Types.ObjectId]
|
|
6552
6553
|
},
|
|
6553
6554
|
firstName: { required: true, type: String },
|
|
6554
6555
|
isTester: { default: false, required: false, type: Boolean },
|
|
@@ -6601,17 +6602,17 @@ var schema6 = new MongooseSchema10(
|
|
|
6601
6602
|
vendor: {
|
|
6602
6603
|
ref: "Vendor",
|
|
6603
6604
|
required: false,
|
|
6604
|
-
type:
|
|
6605
|
+
type: mongoose11.Schema.Types.ObjectId
|
|
6605
6606
|
}
|
|
6606
6607
|
},
|
|
6607
6608
|
{ timestamps: true }
|
|
6608
6609
|
);
|
|
6609
6610
|
schema6.index({ "partners.email": 1 });
|
|
6610
|
-
var UserModel =
|
|
6611
|
+
var UserModel = mongoose11.model("User", schema6);
|
|
6611
6612
|
|
|
6612
6613
|
// src/mongoose/VerificationToken.ts
|
|
6613
|
-
import
|
|
6614
|
-
var MongooseSchema11 =
|
|
6614
|
+
import mongoose12 from "mongoose";
|
|
6615
|
+
var MongooseSchema11 = mongoose12.Schema;
|
|
6615
6616
|
var schema7 = new MongooseSchema11(
|
|
6616
6617
|
{
|
|
6617
6618
|
createdAt: {
|
|
@@ -6627,14 +6628,14 @@ var schema7 = new MongooseSchema11(
|
|
|
6627
6628
|
},
|
|
6628
6629
|
{ timestamps: true }
|
|
6629
6630
|
);
|
|
6630
|
-
var VerificationTokenModel =
|
|
6631
|
+
var VerificationTokenModel = mongoose12.model(
|
|
6631
6632
|
"VerificationToken",
|
|
6632
6633
|
schema7
|
|
6633
6634
|
);
|
|
6634
6635
|
|
|
6635
6636
|
// src/mongoose/vendor/Vendor.ts
|
|
6636
|
-
import
|
|
6637
|
-
var MongooseSchema12 =
|
|
6637
|
+
import mongoose13 from "mongoose";
|
|
6638
|
+
var MongooseSchema12 = mongoose13.Schema;
|
|
6638
6639
|
var MenuTypeSchema = new MongooseSchema12(
|
|
6639
6640
|
{
|
|
6640
6641
|
description: { required: false, type: String },
|
|
@@ -6689,7 +6690,7 @@ var schema8 = new MongooseSchema12(
|
|
|
6689
6690
|
vendorInfoId: {
|
|
6690
6691
|
ref: "VendorInfo",
|
|
6691
6692
|
required: false,
|
|
6692
|
-
type:
|
|
6693
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
6693
6694
|
},
|
|
6694
6695
|
vendorType: {
|
|
6695
6696
|
enum: Object.values(EnumVendorType),
|
|
@@ -6704,11 +6705,11 @@ schema8.index({ description: 1 });
|
|
|
6704
6705
|
schema8.index({ region: 1 });
|
|
6705
6706
|
schema8.index({ "categories.name": 1 });
|
|
6706
6707
|
schema8.index({ "partners.email": 1 });
|
|
6707
|
-
var VendorModel =
|
|
6708
|
+
var VendorModel = mongoose13.model("Vendor", schema8);
|
|
6708
6709
|
|
|
6709
6710
|
// src/mongoose/vendor/VendorInfo.ts
|
|
6710
|
-
import
|
|
6711
|
-
var MongooseSchema13 =
|
|
6711
|
+
import mongoose14 from "mongoose";
|
|
6712
|
+
var MongooseSchema13 = mongoose14.Schema;
|
|
6712
6713
|
var AttributesSchema = new MongooseSchema13(
|
|
6713
6714
|
{
|
|
6714
6715
|
details: { required: false, type: String },
|
|
@@ -6750,19 +6751,19 @@ var schema9 = new MongooseSchema13(
|
|
|
6750
6751
|
vendorId: {
|
|
6751
6752
|
ref: "Vendor",
|
|
6752
6753
|
required: true,
|
|
6753
|
-
type:
|
|
6754
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
6754
6755
|
}
|
|
6755
6756
|
},
|
|
6756
6757
|
{ timestamps: true }
|
|
6757
6758
|
);
|
|
6758
|
-
var VendorInfoModel =
|
|
6759
|
+
var VendorInfoModel = mongoose14.model(
|
|
6759
6760
|
"VendorInfo",
|
|
6760
6761
|
schema9
|
|
6761
6762
|
);
|
|
6762
6763
|
|
|
6763
6764
|
// src/mongoose/event/Event.ts
|
|
6764
|
-
import
|
|
6765
|
-
var MongooseSchema14 =
|
|
6765
|
+
import mongoose15 from "mongoose";
|
|
6766
|
+
var MongooseSchema14 = mongoose15.Schema;
|
|
6766
6767
|
var locationsSchema = new MongooseSchema14(
|
|
6767
6768
|
{
|
|
6768
6769
|
city: { required: true, type: String },
|
|
@@ -6804,7 +6805,7 @@ var schema10 = new MongooseSchema14(
|
|
|
6804
6805
|
eventInfoId: {
|
|
6805
6806
|
ref: "EventInfo",
|
|
6806
6807
|
required: false,
|
|
6807
|
-
type:
|
|
6808
|
+
type: mongoose15.Schema.Types.ObjectId
|
|
6808
6809
|
},
|
|
6809
6810
|
eventType: {
|
|
6810
6811
|
enum: Object.values(EnumEventType),
|
|
@@ -6828,10 +6829,10 @@ schema10.index({ region: 1 });
|
|
|
6828
6829
|
schema10.index({ location: "2dsphere" });
|
|
6829
6830
|
schema10.index({ tags: 1 });
|
|
6830
6831
|
schema10.index({ "partners.email": 1 });
|
|
6831
|
-
var EventModel =
|
|
6832
|
+
var EventModel = mongoose15.model("Event", schema10);
|
|
6832
6833
|
|
|
6833
6834
|
// src/service/database.ts
|
|
6834
|
-
import
|
|
6835
|
+
import mongoose16 from "mongoose";
|
|
6835
6836
|
|
|
6836
6837
|
// src/service/timezonePlugin.ts
|
|
6837
6838
|
import dayjs3 from "dayjs";
|
|
@@ -6853,15 +6854,21 @@ function timezonePlugin(schema11) {
|
|
|
6853
6854
|
}
|
|
6854
6855
|
|
|
6855
6856
|
// src/service/database.ts
|
|
6856
|
-
|
|
6857
|
-
var connectToDatabase = async (
|
|
6857
|
+
mongoose16.plugin(timezonePlugin);
|
|
6858
|
+
var connectToDatabase = async ({
|
|
6859
|
+
appName,
|
|
6860
|
+
dbName,
|
|
6861
|
+
dbPassword,
|
|
6862
|
+
dbUser,
|
|
6863
|
+
mongodbUri
|
|
6864
|
+
}) => {
|
|
6858
6865
|
try {
|
|
6859
|
-
const mongoUri =
|
|
6866
|
+
const mongoUri = mongodbUri ? mongodbUri : (
|
|
6860
6867
|
// Fallback to MongoDB Atlas connection string
|
|
6861
|
-
`mongodb+srv://${
|
|
6868
|
+
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
6862
6869
|
);
|
|
6863
|
-
await
|
|
6864
|
-
const connectionType =
|
|
6870
|
+
await mongoose16.connect(mongoUri);
|
|
6871
|
+
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
6865
6872
|
console.log(
|
|
6866
6873
|
`${connectionType} connected from server/src/service/database.ts`
|
|
6867
6874
|
);
|
|
@@ -7157,6 +7164,7 @@ export {
|
|
|
7157
7164
|
loginFields,
|
|
7158
7165
|
mapArrayToOptions,
|
|
7159
7166
|
mapBaseResourceTypeToFormData,
|
|
7167
|
+
mongoose,
|
|
7160
7168
|
normalizeUrl,
|
|
7161
7169
|
packagingOptions,
|
|
7162
7170
|
partnersSchema,
|