@timardex/cluemart-shared 1.2.35 → 1.2.37
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-CWAaH5Ql.d.mts → ad-Bv5fLkN0.d.mts} +1 -1
- package/dist/{ad-D60cy5L4.d.ts → ad-DDPNpx02.d.ts} +1 -1
- package/dist/{auth-BslKse3L.d.mts → auth-BVGs-5Vm.d.mts} +1 -1
- package/dist/{auth-Ch9Nt77g.d.ts → auth-BhUIvvZ2.d.ts} +1 -1
- package/dist/formFields/index.d.mts +1 -3
- package/dist/formFields/index.d.ts +1 -3
- package/dist/{global-DvxKMAQD.d.ts → global-BA84KF8J.d.ts} +2 -148
- package/dist/{global-j9FEfVZs.d.mts → global-BEqzo5Z2.d.mts} +2 -148
- package/dist/graphql/index.d.mts +3 -5
- package/dist/graphql/index.d.ts +3 -5
- package/dist/hooks/index.d.mts +3 -5
- package/dist/hooks/index.d.ts +3 -5
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +17 -1013
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +311 -819
- package/dist/index.d.ts +311 -819
- package/dist/index.mjs +17 -986
- package/dist/index.mjs.map +1 -1
- package/dist/resourceActivities-0CdofGJp.d.mts +96 -0
- package/dist/resourceActivities-BjgH9TFc.d.ts +96 -0
- package/dist/types/index.cjs +2 -26
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +4 -6
- package/dist/types/index.d.ts +4 -6
- package/dist/types/index.mjs +11 -8
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +1 -3
- package/dist/utils/index.d.ts +1 -3
- package/package.json +1 -4
- package/dist/chunk-4OLDTZXH.mjs +0 -26
- package/dist/chunk-4OLDTZXH.mjs.map +0 -1
- package/dist/chunk-WWL2Q5DN.mjs +0 -44
- package/dist/chunk-WWL2Q5DN.mjs.map +0 -1
- package/dist/mongoose/index.cjs +0 -1085
- package/dist/mongoose/index.cjs.map +0 -1
- package/dist/mongoose/index.d.mts +0 -415
- package/dist/mongoose/index.d.ts +0 -415
- package/dist/mongoose/index.mjs +0 -878
- package/dist/mongoose/index.mjs.map +0 -1
- package/dist/resourceActivities-B4roVKtQ.d.ts +0 -34
- package/dist/resourceActivities-BIjtlOGp.d.mts +0 -34
- package/dist/service/index.cjs +0 -172
- package/dist/service/index.cjs.map +0 -1
- package/dist/service/index.d.mts +0 -25
- package/dist/service/index.d.ts +0 -25
- package/dist/service/index.mjs +0 -79
- package/dist/service/index.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -30,9 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
AdModel: () => AdModel,
|
|
34
|
-
CategorySchema: () => CategorySchema,
|
|
35
|
-
ChatModel: () => ChatModel,
|
|
36
33
|
EnumActivity: () => EnumActivity,
|
|
37
34
|
EnumAdShowOn: () => EnumAdShowOn,
|
|
38
35
|
EnumAdStatus: () => EnumAdStatus,
|
|
@@ -46,7 +43,6 @@ __export(index_exports, {
|
|
|
46
43
|
EnumNotificationType: () => EnumNotificationType,
|
|
47
44
|
EnumOSPlatform: () => EnumOSPlatform,
|
|
48
45
|
EnumPaymentMethod: () => EnumPaymentMethod,
|
|
49
|
-
EnumPubSubEvents: () => EnumPubSubEvents,
|
|
50
46
|
EnumRegions: () => EnumRegions,
|
|
51
47
|
EnumRelationResource: () => EnumRelationResource,
|
|
52
48
|
EnumResourceType: () => EnumResourceType,
|
|
@@ -54,38 +50,20 @@ __export(index_exports, {
|
|
|
54
50
|
EnumUserLicence: () => EnumUserLicence,
|
|
55
51
|
EnumUserRole: () => EnumUserRole,
|
|
56
52
|
EnumVendorType: () => EnumVendorType,
|
|
57
|
-
EventInfoModel: () => EventInfoModel,
|
|
58
|
-
EventModel: () => EventModel,
|
|
59
53
|
ImageTypeEnum: () => ImageTypeEnum,
|
|
60
|
-
NotificationModel: () => NotificationModel,
|
|
61
|
-
ParticipantSchema: () => ParticipantSchema,
|
|
62
|
-
PushTokenModel: () => PushTokenModel,
|
|
63
|
-
RelationModel: () => RelationModel,
|
|
64
|
-
RelationTypeSchema: () => RelationTypeSchema,
|
|
65
|
-
ResourceActivityModel: () => ResourceActivityModel,
|
|
66
|
-
ResourceImageTypeSchema: () => ResourceImageTypeSchema,
|
|
67
54
|
SAVED_EMAIL_KEY: () => SAVED_EMAIL_KEY,
|
|
68
55
|
SAVED_PASSWORD_KEY: () => SAVED_PASSWORD_KEY,
|
|
69
56
|
SAVED_REFRESH_TOKEN_KEY: () => SAVED_REFRESH_TOKEN_KEY,
|
|
70
57
|
SAVED_TOKEN_KEY: () => SAVED_TOKEN_KEY,
|
|
71
|
-
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
72
|
-
StallTypeSchema: () => StallTypeSchema,
|
|
73
|
-
TesterModel: () => TesterModel,
|
|
74
58
|
USER_STORAGE_KEY: () => USER_STORAGE_KEY,
|
|
75
|
-
UserModel: () => UserModel,
|
|
76
|
-
VendorInfoModel: () => VendorInfoModel,
|
|
77
|
-
VendorModel: () => VendorModel,
|
|
78
|
-
VerificationTokenModel: () => VerificationTokenModel,
|
|
79
59
|
availableCategories: () => availableCategories,
|
|
80
60
|
availableCityOptions: () => availableCityOptions,
|
|
81
61
|
availableRegionOptions: () => availableRegionOptions,
|
|
82
62
|
availableRegionTypes: () => availableRegionTypes,
|
|
83
63
|
availableTagTypes: () => availableTagTypes,
|
|
84
|
-
baseResourceFields: () => baseResourceFields,
|
|
85
64
|
capitalizeFirstLetter: () => capitalizeFirstLetter,
|
|
86
65
|
categoryColors: () => categoryColors,
|
|
87
66
|
companyContactFields: () => companyContactFields,
|
|
88
|
-
connectToDatabase: () => connectToDatabase,
|
|
89
67
|
contactUsFields: () => contactUsFields,
|
|
90
68
|
darkColors: () => darkColors,
|
|
91
69
|
dateFormat: () => dateFormat,
|
|
@@ -111,27 +89,22 @@ __export(index_exports, {
|
|
|
111
89
|
loginFields: () => loginFields,
|
|
112
90
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
113
91
|
mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
|
|
114
|
-
mongoose: () => import_mongoose.default,
|
|
115
92
|
normalizeUrl: () => normalizeUrl,
|
|
116
93
|
packagingOptions: () => packagingOptions,
|
|
117
|
-
partnersSchema: () => partnersSchema,
|
|
118
94
|
paymentMethodOptions: () => paymentMethodOptions,
|
|
119
95
|
producedIngOptions: () => producedIngOptions,
|
|
120
96
|
productLabelGroups: () => productLabelGroups,
|
|
121
97
|
profileFields: () => profileFields,
|
|
122
98
|
registerFields: () => registerFields,
|
|
123
|
-
relationDatesSchema: () => relationDatesSchema,
|
|
124
99
|
removeTypename: () => removeTypename,
|
|
125
100
|
requestPasswordResetFields: () => requestPasswordResetFields,
|
|
126
101
|
requirementsOptions: () => requirementsOptions,
|
|
127
102
|
resetPasswordFields: () => resetPasswordFields,
|
|
128
|
-
saveNotificationsInDb: () => saveNotificationsInDb,
|
|
129
103
|
socialMediaFields: () => socialMediaFields,
|
|
130
104
|
sortDatesChronologically: () => sortDatesChronologically,
|
|
131
105
|
stallTypeOptions: () => stallTypeOptions,
|
|
132
106
|
statusOptions: () => statusOptions,
|
|
133
107
|
tagOptions: () => tagOptions,
|
|
134
|
-
termsAgreementSchema: () => termsAgreementSchema,
|
|
135
108
|
testersFields: () => testersFields,
|
|
136
109
|
timeFormat: () => timeFormat,
|
|
137
110
|
truncateText: () => truncateText,
|
|
@@ -4949,7 +4922,7 @@ var socialMediaSchema = yup.object({
|
|
|
4949
4922
|
is: (name) => !!name,
|
|
4950
4923
|
// If name has a value
|
|
4951
4924
|
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
4952
|
-
otherwise: (
|
|
4925
|
+
otherwise: (schema) => schema.notRequired()
|
|
4953
4926
|
})
|
|
4954
4927
|
});
|
|
4955
4928
|
var globalResourceSchema = yup.object().shape({
|
|
@@ -5022,21 +4995,21 @@ var paymentInfoSchema = yup2.object({
|
|
|
5022
4995
|
paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
5023
4996
|
accountHolderName: yup2.string().when("paymentMethod", {
|
|
5024
4997
|
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
5025
|
-
then: (
|
|
5026
|
-
otherwise: (
|
|
4998
|
+
then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
|
|
4999
|
+
otherwise: (schema) => schema.notRequired()
|
|
5027
5000
|
}),
|
|
5028
5001
|
accountNumber: yup2.string().when("paymentMethod", {
|
|
5029
5002
|
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
5030
|
-
then: (
|
|
5003
|
+
then: (schema) => schema.required("Account number is required for bank transfer").matches(
|
|
5031
5004
|
nzBankAccountRegex,
|
|
5032
5005
|
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
5033
5006
|
).trim(),
|
|
5034
|
-
otherwise: (
|
|
5007
|
+
otherwise: (schema) => schema.notRequired()
|
|
5035
5008
|
}),
|
|
5036
5009
|
link: yup2.string().when("paymentMethod", {
|
|
5037
5010
|
is: (val) => val !== "bank_transfer" /* BANK_TRANSFER */,
|
|
5038
5011
|
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
5039
|
-
otherwise: (
|
|
5012
|
+
otherwise: (schema) => schema.notRequired()
|
|
5040
5013
|
})
|
|
5041
5014
|
});
|
|
5042
5015
|
var eventInfoSchema = yup2.object().shape({
|
|
@@ -5216,7 +5189,7 @@ var adSchema = yup7.object().shape({
|
|
|
5216
5189
|
return endDate > now;
|
|
5217
5190
|
}).when("start", {
|
|
5218
5191
|
is: (val) => val && val.length > 0,
|
|
5219
|
-
then: (
|
|
5192
|
+
then: (schema) => schema.test(
|
|
5220
5193
|
"is-after-start",
|
|
5221
5194
|
"End date must be after start date",
|
|
5222
5195
|
function(value) {
|
|
@@ -6186,958 +6159,6 @@ function useAdForm(data) {
|
|
|
6186
6159
|
};
|
|
6187
6160
|
}
|
|
6188
6161
|
|
|
6189
|
-
// src/mongoose/Ad.ts
|
|
6190
|
-
var import_mongoose5 = __toESM(require("mongoose"));
|
|
6191
|
-
|
|
6192
|
-
// src/types/global.ts
|
|
6193
|
-
var import_mongoose = __toESM(require("mongoose"));
|
|
6194
|
-
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
6195
|
-
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
6196
|
-
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
6197
|
-
EnumPubSubEvents2["GET_NOTIFICATIONS_COUNT"] = "GET_NOTIFICATIONS_COUNT";
|
|
6198
|
-
EnumPubSubEvents2["USER_TYPING"] = "USER_TYPING";
|
|
6199
|
-
return EnumPubSubEvents2;
|
|
6200
|
-
})(EnumPubSubEvents || {});
|
|
6201
|
-
|
|
6202
|
-
// src/types/resourceActivities.ts
|
|
6203
|
-
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
6204
|
-
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
6205
|
-
EnumActivity2["GOING"] = "GOING";
|
|
6206
|
-
EnumActivity2["INTERESTED"] = "INTERESTED";
|
|
6207
|
-
EnumActivity2["PRESENT"] = "PRESENT";
|
|
6208
|
-
EnumActivity2["VIEW"] = "VIEW";
|
|
6209
|
-
return EnumActivity2;
|
|
6210
|
-
})(EnumActivity || {});
|
|
6211
|
-
|
|
6212
|
-
// src/mongoose/global.ts
|
|
6213
|
-
var import_mongoose4 = __toESM(require("mongoose"));
|
|
6214
|
-
|
|
6215
|
-
// src/mongoose/Relation.ts
|
|
6216
|
-
var import_mongoose3 = __toESM(require("mongoose"));
|
|
6217
|
-
|
|
6218
|
-
// src/mongoose/event/EventInfo.ts
|
|
6219
|
-
var import_mongoose2 = __toESM(require("mongoose"));
|
|
6220
|
-
var MongooseSchema = import_mongoose2.default.Schema;
|
|
6221
|
-
var StallTypeSchema = new MongooseSchema(
|
|
6222
|
-
{
|
|
6223
|
-
electricity: {
|
|
6224
|
-
price: { required: false, type: Number },
|
|
6225
|
-
selected: { required: false, type: Boolean }
|
|
6226
|
-
},
|
|
6227
|
-
label: { required: false, type: String },
|
|
6228
|
-
price: { required: false, type: Number },
|
|
6229
|
-
stallCapacity: { required: false, type: Number }
|
|
6230
|
-
},
|
|
6231
|
-
{
|
|
6232
|
-
_id: false
|
|
6233
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6234
|
-
}
|
|
6235
|
-
);
|
|
6236
|
-
var dateTimeSchema2 = new MongooseSchema(
|
|
6237
|
-
{
|
|
6238
|
-
endDate: { required: true, type: String },
|
|
6239
|
-
endTime: { required: true, type: String },
|
|
6240
|
-
stallTypes: [StallTypeSchema],
|
|
6241
|
-
startDate: { required: true, type: String },
|
|
6242
|
-
startTime: { required: true, type: String }
|
|
6243
|
-
},
|
|
6244
|
-
{ _id: false }
|
|
6245
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6246
|
-
);
|
|
6247
|
-
var paymentInfoSchema2 = new MongooseSchema(
|
|
6248
|
-
{
|
|
6249
|
-
accountHolderName: { required: false, type: String },
|
|
6250
|
-
accountNumber: { required: false, type: String },
|
|
6251
|
-
link: { required: false, type: String },
|
|
6252
|
-
paymentMethod: {
|
|
6253
|
-
enum: Object.values(EnumPaymentMethod),
|
|
6254
|
-
required: true,
|
|
6255
|
-
type: String
|
|
6256
|
-
}
|
|
6257
|
-
},
|
|
6258
|
-
{ _id: false }
|
|
6259
|
-
// Prevents Mongoose from creating an additional _id field
|
|
6260
|
-
);
|
|
6261
|
-
var requirementsSchema = new MongooseSchema(
|
|
6262
|
-
{
|
|
6263
|
-
category: { required: true, type: String },
|
|
6264
|
-
label: { required: true, type: String },
|
|
6265
|
-
value: { required: true, type: Boolean }
|
|
6266
|
-
},
|
|
6267
|
-
{
|
|
6268
|
-
_id: false
|
|
6269
|
-
// Prevents Mongoose from creating an additional _id field for
|
|
6270
|
-
}
|
|
6271
|
-
);
|
|
6272
|
-
var schema = new MongooseSchema(
|
|
6273
|
-
{
|
|
6274
|
-
applicationDeadlineHours: { required: true, type: Number },
|
|
6275
|
-
dateTime: [dateTimeSchema2],
|
|
6276
|
-
eventId: {
|
|
6277
|
-
ref: "Event",
|
|
6278
|
-
required: false,
|
|
6279
|
-
type: import_mongoose2.default.Schema.Types.ObjectId
|
|
6280
|
-
},
|
|
6281
|
-
packInTime: { required: true, type: Number },
|
|
6282
|
-
paymentDueHours: { required: true, type: Number },
|
|
6283
|
-
paymentInfo: [paymentInfoSchema2],
|
|
6284
|
-
requirements: [requirementsSchema]
|
|
6285
|
-
},
|
|
6286
|
-
{ timestamps: true }
|
|
6287
|
-
);
|
|
6288
|
-
var EventInfoModel = import_mongoose2.default.models.EventInfo || import_mongoose2.default.model("EventInfo", schema);
|
|
6289
|
-
|
|
6290
|
-
// src/mongoose/Relation.ts
|
|
6291
|
-
var MongooseSchema2 = import_mongoose3.default.Schema;
|
|
6292
|
-
var relationDatesSchema = new MongooseSchema2(
|
|
6293
|
-
{
|
|
6294
|
-
lastUpdateBy: {
|
|
6295
|
-
resourceId: { required: false, type: String },
|
|
6296
|
-
userEmail: { required: false, type: String }
|
|
6297
|
-
},
|
|
6298
|
-
paymentReference: { required: false, type: String },
|
|
6299
|
-
stallType: StallTypeSchema,
|
|
6300
|
-
startDate: { required: false, type: String },
|
|
6301
|
-
startTime: { required: false, type: String },
|
|
6302
|
-
status: {
|
|
6303
|
-
enum: Object.values(EnumInviteStatus),
|
|
6304
|
-
required: false,
|
|
6305
|
-
type: String
|
|
6306
|
-
}
|
|
6307
|
-
},
|
|
6308
|
-
{ _id: false }
|
|
6309
|
-
);
|
|
6310
|
-
var RelationTypeSchema = new MongooseSchema2(
|
|
6311
|
-
{
|
|
6312
|
-
active: { default: true, required: true, type: Boolean },
|
|
6313
|
-
chatId: {
|
|
6314
|
-
ref: "Chat",
|
|
6315
|
-
required: true,
|
|
6316
|
-
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
6317
|
-
},
|
|
6318
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
6319
|
-
eventId: {
|
|
6320
|
-
ref: "Event",
|
|
6321
|
-
required: true,
|
|
6322
|
-
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
6323
|
-
},
|
|
6324
|
-
lastUpdateBy: {
|
|
6325
|
-
enum: Object.values(EnumResourceType),
|
|
6326
|
-
required: true,
|
|
6327
|
-
type: String
|
|
6328
|
-
},
|
|
6329
|
-
relationDates: [relationDatesSchema],
|
|
6330
|
-
relationType: {
|
|
6331
|
-
enum: Object.values(EnumRelationResource),
|
|
6332
|
-
required: true,
|
|
6333
|
-
type: String
|
|
6334
|
-
},
|
|
6335
|
-
vendorId: {
|
|
6336
|
-
ref: "Vendor",
|
|
6337
|
-
required: true,
|
|
6338
|
-
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
6339
|
-
}
|
|
6340
|
-
},
|
|
6341
|
-
{ timestamps: true }
|
|
6342
|
-
);
|
|
6343
|
-
RelationTypeSchema.index({
|
|
6344
|
-
"relationDates.startDate": 1,
|
|
6345
|
-
"relationDates.startTime": 1,
|
|
6346
|
-
"relationDates.status": 1
|
|
6347
|
-
});
|
|
6348
|
-
var RelationModel = import_mongoose3.default.models.Relation || import_mongoose3.default.model("Relation", RelationTypeSchema);
|
|
6349
|
-
|
|
6350
|
-
// src/mongoose/global.ts
|
|
6351
|
-
var MongooseSchema3 = import_mongoose4.default.Schema;
|
|
6352
|
-
var OwnerTypeSchema = new MongooseSchema3(
|
|
6353
|
-
{
|
|
6354
|
-
email: { required: true, type: String },
|
|
6355
|
-
userId: {
|
|
6356
|
-
ref: "User",
|
|
6357
|
-
required: true,
|
|
6358
|
-
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
6359
|
-
}
|
|
6360
|
-
},
|
|
6361
|
-
{ _id: false }
|
|
6362
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6363
|
-
);
|
|
6364
|
-
var SocialMediaTypeSchema = new MongooseSchema3(
|
|
6365
|
-
{
|
|
6366
|
-
link: { required: true, type: String },
|
|
6367
|
-
name: { required: true, type: String }
|
|
6368
|
-
},
|
|
6369
|
-
{ _id: false }
|
|
6370
|
-
// Prevents Mongoose from creating an additional _id field
|
|
6371
|
-
);
|
|
6372
|
-
var ResourceImageTypeSchema = new MongooseSchema3(
|
|
6373
|
-
{
|
|
6374
|
-
source: { required: false, type: String },
|
|
6375
|
-
title: { required: false, type: String }
|
|
6376
|
-
},
|
|
6377
|
-
{ _id: false }
|
|
6378
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6379
|
-
);
|
|
6380
|
-
var SubCategorySchema = new MongooseSchema3(
|
|
6381
|
-
{
|
|
6382
|
-
id: { required: false, type: String },
|
|
6383
|
-
items: [
|
|
6384
|
-
{
|
|
6385
|
-
id: { required: false, type: String },
|
|
6386
|
-
name: { required: false, type: String }
|
|
6387
|
-
}
|
|
6388
|
-
],
|
|
6389
|
-
name: { required: false, type: String }
|
|
6390
|
-
},
|
|
6391
|
-
{ _id: false }
|
|
6392
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6393
|
-
);
|
|
6394
|
-
var CategorySchema = new MongooseSchema3(
|
|
6395
|
-
{
|
|
6396
|
-
id: { required: true, type: String },
|
|
6397
|
-
name: { required: true, type: String },
|
|
6398
|
-
subcategories: [SubCategorySchema]
|
|
6399
|
-
},
|
|
6400
|
-
{ _id: false }
|
|
6401
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6402
|
-
);
|
|
6403
|
-
var PosterUsageTypeSchema = new MongooseSchema3(
|
|
6404
|
-
{
|
|
6405
|
-
count: { default: 0, required: false, type: Number },
|
|
6406
|
-
month: { required: false, type: String }
|
|
6407
|
-
},
|
|
6408
|
-
{ _id: false }
|
|
6409
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6410
|
-
);
|
|
6411
|
-
var partnersSchema = new MongooseSchema3(
|
|
6412
|
-
{
|
|
6413
|
-
email: { required: false, type: String },
|
|
6414
|
-
licence: {
|
|
6415
|
-
enum: Object.values(EnumUserLicence),
|
|
6416
|
-
required: false,
|
|
6417
|
-
type: String
|
|
6418
|
-
},
|
|
6419
|
-
resourceId: {
|
|
6420
|
-
required: false,
|
|
6421
|
-
type: String
|
|
6422
|
-
},
|
|
6423
|
-
resourceType: {
|
|
6424
|
-
enum: Object.values(EnumResourceType),
|
|
6425
|
-
required: false,
|
|
6426
|
-
type: String
|
|
6427
|
-
}
|
|
6428
|
-
},
|
|
6429
|
-
{ _id: false }
|
|
6430
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6431
|
-
);
|
|
6432
|
-
var ContactDetailsSchema = new MongooseSchema3(
|
|
6433
|
-
{
|
|
6434
|
-
email: { required: false, type: String },
|
|
6435
|
-
landlinePhone: { required: false, type: String },
|
|
6436
|
-
mobilePhone: { required: false, type: String }
|
|
6437
|
-
},
|
|
6438
|
-
{ _id: false }
|
|
6439
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6440
|
-
);
|
|
6441
|
-
var termsAgreementSchema = new MongooseSchema3(
|
|
6442
|
-
{
|
|
6443
|
-
appBuildNumber: { required: true, type: String },
|
|
6444
|
-
appId: { required: true, type: String },
|
|
6445
|
-
appVersion: { required: true, type: String },
|
|
6446
|
-
brand: { required: true, type: String },
|
|
6447
|
-
deviceName: { required: true, type: String },
|
|
6448
|
-
installationId: { required: true, type: String },
|
|
6449
|
-
manufacturer: { required: true, type: String },
|
|
6450
|
-
modelName: { required: true, type: String },
|
|
6451
|
-
osName: { required: true, type: String },
|
|
6452
|
-
osVersion: { required: true, type: String },
|
|
6453
|
-
termVersion: { required: true, type: String },
|
|
6454
|
-
timestamp: { required: true, type: String }
|
|
6455
|
-
},
|
|
6456
|
-
{ _id: false }
|
|
6457
|
-
);
|
|
6458
|
-
var resourceRelationsSchema = new MongooseSchema3(
|
|
6459
|
-
{
|
|
6460
|
-
relationDates: {
|
|
6461
|
-
default: [],
|
|
6462
|
-
required: false,
|
|
6463
|
-
type: [relationDatesSchema]
|
|
6464
|
-
},
|
|
6465
|
-
relationId: {
|
|
6466
|
-
ref: "Relation",
|
|
6467
|
-
required: false,
|
|
6468
|
-
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
6469
|
-
}
|
|
6470
|
-
},
|
|
6471
|
-
{ _id: false }
|
|
6472
|
-
);
|
|
6473
|
-
var baseResourceFields = {
|
|
6474
|
-
active: { default: false, required: true, type: Boolean },
|
|
6475
|
-
adIds: {
|
|
6476
|
-
ref: "Ad",
|
|
6477
|
-
required: false,
|
|
6478
|
-
type: [import_mongoose4.default.Schema.Types.ObjectId]
|
|
6479
|
-
},
|
|
6480
|
-
contactDetails: ContactDetailsSchema,
|
|
6481
|
-
cover: ResourceImageTypeSchema,
|
|
6482
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
6483
|
-
description: { required: true, type: String },
|
|
6484
|
-
images: [ResourceImageTypeSchema],
|
|
6485
|
-
logo: ResourceImageTypeSchema,
|
|
6486
|
-
name: { required: true, type: String },
|
|
6487
|
-
owner: OwnerTypeSchema,
|
|
6488
|
-
partners: {
|
|
6489
|
-
required: false,
|
|
6490
|
-
type: [partnersSchema]
|
|
6491
|
-
},
|
|
6492
|
-
posterUsage: PosterUsageTypeSchema,
|
|
6493
|
-
promoCodes: { required: false, type: [String] },
|
|
6494
|
-
region: { required: true, type: String },
|
|
6495
|
-
relations: {
|
|
6496
|
-
default: [],
|
|
6497
|
-
required: false,
|
|
6498
|
-
type: [resourceRelationsSchema]
|
|
6499
|
-
},
|
|
6500
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
6501
|
-
termsAgreement: termsAgreementSchema
|
|
6502
|
-
};
|
|
6503
|
-
|
|
6504
|
-
// src/mongoose/Ad.ts
|
|
6505
|
-
var MongooseSchema4 = import_mongoose5.default.Schema;
|
|
6506
|
-
var schema2 = new MongooseSchema4(
|
|
6507
|
-
{
|
|
6508
|
-
active: { default: true, type: Boolean },
|
|
6509
|
-
adStyle: {
|
|
6510
|
-
default: "Bloom" /* BLOOM */,
|
|
6511
|
-
enum: Object.values(EnumAdStyle),
|
|
6512
|
-
required: true,
|
|
6513
|
-
type: String
|
|
6514
|
-
},
|
|
6515
|
-
adType: {
|
|
6516
|
-
default: "Sponsored" /* SPONSORED */,
|
|
6517
|
-
enum: Object.values(EnumAdType),
|
|
6518
|
-
required: true,
|
|
6519
|
-
type: String
|
|
6520
|
-
},
|
|
6521
|
-
// TODO: similar to ViewSchema
|
|
6522
|
-
clicks: { default: 0, required: true, type: Number },
|
|
6523
|
-
clui: { required: false, type: String },
|
|
6524
|
-
end: { required: true, type: Date },
|
|
6525
|
-
// TODO: similar to ViewSchema
|
|
6526
|
-
impressions: { default: 0, required: true, type: Number },
|
|
6527
|
-
resourceCover: { required: true, type: String },
|
|
6528
|
-
resourceDescription: { required: true, type: String },
|
|
6529
|
-
resourceId: { required: true, type: String },
|
|
6530
|
-
resourceLogo: { required: false, type: String },
|
|
6531
|
-
resourceName: { required: true, type: String },
|
|
6532
|
-
resourceRegion: { required: true, type: String },
|
|
6533
|
-
resourceType: {
|
|
6534
|
-
enum: Object.values(EnumResourceType),
|
|
6535
|
-
required: true,
|
|
6536
|
-
type: String
|
|
6537
|
-
},
|
|
6538
|
-
showOn: {
|
|
6539
|
-
default: "Front_page" /* FRONT_PAGE */,
|
|
6540
|
-
enum: Object.values(EnumAdShowOn),
|
|
6541
|
-
required: true,
|
|
6542
|
-
type: String
|
|
6543
|
-
},
|
|
6544
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
6545
|
-
start: { required: true, type: Date },
|
|
6546
|
-
status: {
|
|
6547
|
-
default: "Active" /* ACTIVE */,
|
|
6548
|
-
enum: Object.values(EnumAdStatus),
|
|
6549
|
-
required: true,
|
|
6550
|
-
type: String
|
|
6551
|
-
},
|
|
6552
|
-
targetRegion: { required: false, type: String }
|
|
6553
|
-
},
|
|
6554
|
-
{
|
|
6555
|
-
timestamps: true
|
|
6556
|
-
}
|
|
6557
|
-
);
|
|
6558
|
-
schema2.index({
|
|
6559
|
-
end: 1,
|
|
6560
|
-
start: 1,
|
|
6561
|
-
status: 1
|
|
6562
|
-
});
|
|
6563
|
-
var AdModel = import_mongoose5.default.models.Ad || import_mongoose5.default.model("Ad", schema2);
|
|
6564
|
-
|
|
6565
|
-
// src/mongoose/Chat.ts
|
|
6566
|
-
var import_mongoose6 = __toESM(require("mongoose"));
|
|
6567
|
-
var MongooseSchema5 = import_mongoose6.default.Schema;
|
|
6568
|
-
var MessageSchema = new MongooseSchema5(
|
|
6569
|
-
{
|
|
6570
|
-
content: { required: true, type: String },
|
|
6571
|
-
senderAvatar: { required: false, type: String },
|
|
6572
|
-
senderId: {
|
|
6573
|
-
ref: "User",
|
|
6574
|
-
required: true,
|
|
6575
|
-
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
6576
|
-
},
|
|
6577
|
-
senderName: { required: true, type: String }
|
|
6578
|
-
},
|
|
6579
|
-
{ timestamps: true }
|
|
6580
|
-
);
|
|
6581
|
-
var ParticipantSchema = new MongooseSchema5(
|
|
6582
|
-
{
|
|
6583
|
-
active: { default: true, required: true, type: Boolean },
|
|
6584
|
-
email: { required: true, type: String },
|
|
6585
|
-
userId: {
|
|
6586
|
-
ref: "User",
|
|
6587
|
-
required: true,
|
|
6588
|
-
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
6589
|
-
}
|
|
6590
|
-
},
|
|
6591
|
-
{ _id: false }
|
|
6592
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6593
|
-
);
|
|
6594
|
-
var ChatSchema = new MongooseSchema5(
|
|
6595
|
-
{
|
|
6596
|
-
active: { default: true, required: true, type: Boolean },
|
|
6597
|
-
chatName: { required: true, type: String },
|
|
6598
|
-
chatType: {
|
|
6599
|
-
enum: Object.values(EnumChatType),
|
|
6600
|
-
required: true,
|
|
6601
|
-
type: String
|
|
6602
|
-
},
|
|
6603
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
6604
|
-
messages: [MessageSchema],
|
|
6605
|
-
participants: [ParticipantSchema],
|
|
6606
|
-
resourceInfo: {
|
|
6607
|
-
eventId: {
|
|
6608
|
-
ref: "Event",
|
|
6609
|
-
required: false,
|
|
6610
|
-
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
6611
|
-
},
|
|
6612
|
-
vendorId: {
|
|
6613
|
-
ref: "Vendor",
|
|
6614
|
-
required: false,
|
|
6615
|
-
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
6616
|
-
}
|
|
6617
|
-
}
|
|
6618
|
-
},
|
|
6619
|
-
{
|
|
6620
|
-
timestamps: true
|
|
6621
|
-
}
|
|
6622
|
-
);
|
|
6623
|
-
var ChatModel = import_mongoose6.default.models.Chat || import_mongoose6.default.model("Chat", ChatSchema);
|
|
6624
|
-
|
|
6625
|
-
// src/mongoose/Notification.ts
|
|
6626
|
-
var import_mongoose7 = __toESM(require("mongoose"));
|
|
6627
|
-
var MongooseSchema6 = import_mongoose7.default.Schema;
|
|
6628
|
-
var schema3 = new MongooseSchema6(
|
|
6629
|
-
{
|
|
6630
|
-
data: {
|
|
6631
|
-
resourceId: { required: true, type: String },
|
|
6632
|
-
resourceName: { required: true, type: String },
|
|
6633
|
-
resourceType: {
|
|
6634
|
-
enum: Object.values(EnumNotificationResourceType),
|
|
6635
|
-
required: true,
|
|
6636
|
-
type: String
|
|
6637
|
-
}
|
|
6638
|
-
},
|
|
6639
|
-
isRead: { default: false, index: true, required: true, type: Boolean },
|
|
6640
|
-
message: { required: true, type: String },
|
|
6641
|
-
title: { required: true, type: String },
|
|
6642
|
-
type: {
|
|
6643
|
-
default: "system" /* SYSTEM */,
|
|
6644
|
-
enum: Object.values(EnumNotificationType),
|
|
6645
|
-
required: true,
|
|
6646
|
-
type: String
|
|
6647
|
-
},
|
|
6648
|
-
userId: {
|
|
6649
|
-
ref: "User",
|
|
6650
|
-
required: true,
|
|
6651
|
-
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
6652
|
-
}
|
|
6653
|
-
},
|
|
6654
|
-
{ timestamps: true }
|
|
6655
|
-
);
|
|
6656
|
-
schema3.index({ isRead: 1, userId: 1 });
|
|
6657
|
-
schema3.index({ createdAt: -1, userId: 1 });
|
|
6658
|
-
var NotificationModel = import_mongoose7.default.models.Notification || import_mongoose7.default.model("Notification", schema3);
|
|
6659
|
-
|
|
6660
|
-
// src/mongoose/PushToken.ts
|
|
6661
|
-
var import_mongoose8 = __toESM(require("mongoose"));
|
|
6662
|
-
var MongooseSchema7 = import_mongoose8.default.Schema;
|
|
6663
|
-
var schema4 = new MongooseSchema7(
|
|
6664
|
-
{
|
|
6665
|
-
platform: {
|
|
6666
|
-
enum: Object.values(EnumOSPlatform),
|
|
6667
|
-
required: true,
|
|
6668
|
-
type: String
|
|
6669
|
-
},
|
|
6670
|
-
token: { required: true, type: String },
|
|
6671
|
-
userId: { required: true, type: import_mongoose8.default.Schema.Types.ObjectId }
|
|
6672
|
-
},
|
|
6673
|
-
{ timestamps: true }
|
|
6674
|
-
);
|
|
6675
|
-
var PushTokenModel = import_mongoose8.default.models.PushToken || import_mongoose8.default.model("PushToken", schema4);
|
|
6676
|
-
|
|
6677
|
-
// src/mongoose/ResourceActivity.ts
|
|
6678
|
-
var import_mongoose9 = __toESM(require("mongoose"));
|
|
6679
|
-
var MongooseSchema8 = import_mongoose9.default.Schema;
|
|
6680
|
-
var ActivitySchema = new MongooseSchema8(
|
|
6681
|
-
{
|
|
6682
|
-
activityType: {
|
|
6683
|
-
enum: Object.values(EnumActivity),
|
|
6684
|
-
required: true,
|
|
6685
|
-
type: String
|
|
6686
|
-
},
|
|
6687
|
-
location: {
|
|
6688
|
-
coordinates: {
|
|
6689
|
-
required: false,
|
|
6690
|
-
type: [Number]
|
|
6691
|
-
},
|
|
6692
|
-
type: {
|
|
6693
|
-
default: "Point",
|
|
6694
|
-
enum: ["Point"],
|
|
6695
|
-
required: false,
|
|
6696
|
-
type: String
|
|
6697
|
-
}
|
|
6698
|
-
},
|
|
6699
|
-
startDate: { required: false, type: String },
|
|
6700
|
-
startTime: { required: false, type: String },
|
|
6701
|
-
timestamp: { default: Date.now, type: Date },
|
|
6702
|
-
userAgent: {
|
|
6703
|
-
enum: Object.values(EnumOSPlatform),
|
|
6704
|
-
required: true,
|
|
6705
|
-
type: String
|
|
6706
|
-
},
|
|
6707
|
-
userId: { required: false, type: String }
|
|
6708
|
-
},
|
|
6709
|
-
{ _id: false }
|
|
6710
|
-
);
|
|
6711
|
-
var schema5 = new MongooseSchema8(
|
|
6712
|
-
{
|
|
6713
|
-
activity: { default: [], type: [ActivitySchema] },
|
|
6714
|
-
resourceId: { required: true, type: String },
|
|
6715
|
-
resourceType: {
|
|
6716
|
-
enum: Object.values(EnumResourceType),
|
|
6717
|
-
required: true,
|
|
6718
|
-
type: String
|
|
6719
|
-
}
|
|
6720
|
-
},
|
|
6721
|
-
{ timestamps: true }
|
|
6722
|
-
);
|
|
6723
|
-
schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
6724
|
-
schema5.index({ "views.location": "2dsphere" });
|
|
6725
|
-
var ResourceActivityModel = import_mongoose9.default.models.ResourceActivity || import_mongoose9.default.model("ResourceActivity", schema5);
|
|
6726
|
-
|
|
6727
|
-
// src/mongoose/Testers.ts
|
|
6728
|
-
var import_mongoose10 = __toESM(require("mongoose"));
|
|
6729
|
-
var MongooseSchema9 = import_mongoose10.default.Schema;
|
|
6730
|
-
var TesterSchema = new MongooseSchema9(
|
|
6731
|
-
{
|
|
6732
|
-
active: { default: false, required: true, type: Boolean },
|
|
6733
|
-
categories: [CategorySchema],
|
|
6734
|
-
companyName: { required: true, type: String },
|
|
6735
|
-
email: { required: true, type: String },
|
|
6736
|
-
firstName: { required: true, type: String },
|
|
6737
|
-
lastName: { required: true, type: String },
|
|
6738
|
-
osType: {
|
|
6739
|
-
enum: Object.values(EnumOSPlatform),
|
|
6740
|
-
required: true,
|
|
6741
|
-
type: String
|
|
6742
|
-
},
|
|
6743
|
-
region: { required: true, type: String },
|
|
6744
|
-
resourceType: {
|
|
6745
|
-
enum: Object.values(EnumResourceType),
|
|
6746
|
-
required: true,
|
|
6747
|
-
type: String
|
|
6748
|
-
}
|
|
6749
|
-
},
|
|
6750
|
-
{
|
|
6751
|
-
timestamps: true
|
|
6752
|
-
}
|
|
6753
|
-
);
|
|
6754
|
-
var TesterModel = import_mongoose10.default.models.Tester || import_mongoose10.default.model("Tester", TesterSchema);
|
|
6755
|
-
|
|
6756
|
-
// src/mongoose/User.ts
|
|
6757
|
-
var import_mongoose11 = __toESM(require("mongoose"));
|
|
6758
|
-
var MongooseSchema10 = import_mongoose11.default.Schema;
|
|
6759
|
-
var userActivityEventSchema = new MongooseSchema10(
|
|
6760
|
-
{
|
|
6761
|
-
resourceId: {
|
|
6762
|
-
ref: "Event",
|
|
6763
|
-
required: false,
|
|
6764
|
-
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
6765
|
-
},
|
|
6766
|
-
startDate: { required: false, type: String },
|
|
6767
|
-
startTime: { required: false, type: String }
|
|
6768
|
-
},
|
|
6769
|
-
{ _id: false }
|
|
6770
|
-
);
|
|
6771
|
-
var userActivityFavouritesSchema = new MongooseSchema10(
|
|
6772
|
-
{
|
|
6773
|
-
events: {
|
|
6774
|
-
ref: "Event",
|
|
6775
|
-
required: false,
|
|
6776
|
-
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
6777
|
-
},
|
|
6778
|
-
vendors: {
|
|
6779
|
-
ref: "Vendor",
|
|
6780
|
-
required: false,
|
|
6781
|
-
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
6782
|
-
}
|
|
6783
|
-
},
|
|
6784
|
-
{ _id: false }
|
|
6785
|
-
);
|
|
6786
|
-
var schema6 = new MongooseSchema10(
|
|
6787
|
-
{
|
|
6788
|
-
active: { default: false, required: true, type: Boolean },
|
|
6789
|
-
avatar: ResourceImageTypeSchema,
|
|
6790
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
6791
|
-
email: { required: true, type: String },
|
|
6792
|
-
events: {
|
|
6793
|
-
ref: "Event",
|
|
6794
|
-
required: false,
|
|
6795
|
-
type: [import_mongoose11.default.Schema.Types.ObjectId]
|
|
6796
|
-
},
|
|
6797
|
-
firstName: { required: true, type: String },
|
|
6798
|
-
isTester: { default: false, required: false, type: Boolean },
|
|
6799
|
-
lastName: { required: true, type: String },
|
|
6800
|
-
licences: {
|
|
6801
|
-
enum: Object.values(EnumUserLicence),
|
|
6802
|
-
required: false,
|
|
6803
|
-
type: [String]
|
|
6804
|
-
},
|
|
6805
|
-
partners: {
|
|
6806
|
-
required: false,
|
|
6807
|
-
type: [partnersSchema]
|
|
6808
|
-
},
|
|
6809
|
-
password: { required: true, type: String },
|
|
6810
|
-
platform: {
|
|
6811
|
-
enum: Object.values(EnumOSPlatform),
|
|
6812
|
-
required: false,
|
|
6813
|
-
type: String
|
|
6814
|
-
},
|
|
6815
|
-
preferredRegion: {
|
|
6816
|
-
required: true,
|
|
6817
|
-
type: String
|
|
6818
|
-
},
|
|
6819
|
-
refreshToken: {
|
|
6820
|
-
required: false,
|
|
6821
|
-
type: String
|
|
6822
|
-
},
|
|
6823
|
-
role: {
|
|
6824
|
-
default: "customer" /* CUSTOMER */,
|
|
6825
|
-
enum: Object.values(EnumUserRole),
|
|
6826
|
-
required: true,
|
|
6827
|
-
type: String
|
|
6828
|
-
},
|
|
6829
|
-
termsAgreement: termsAgreementSchema,
|
|
6830
|
-
userActivity: {
|
|
6831
|
-
favourites: {
|
|
6832
|
-
default: () => ({ events: [], vendors: [] }),
|
|
6833
|
-
type: userActivityFavouritesSchema
|
|
6834
|
-
},
|
|
6835
|
-
going: {
|
|
6836
|
-
events: [userActivityEventSchema]
|
|
6837
|
-
},
|
|
6838
|
-
interested: {
|
|
6839
|
-
events: [userActivityEventSchema]
|
|
6840
|
-
},
|
|
6841
|
-
present: {
|
|
6842
|
-
events: [userActivityEventSchema]
|
|
6843
|
-
}
|
|
6844
|
-
},
|
|
6845
|
-
vendor: {
|
|
6846
|
-
ref: "Vendor",
|
|
6847
|
-
required: false,
|
|
6848
|
-
type: import_mongoose11.default.Schema.Types.ObjectId
|
|
6849
|
-
}
|
|
6850
|
-
},
|
|
6851
|
-
{ timestamps: true }
|
|
6852
|
-
);
|
|
6853
|
-
schema6.index({ "partners.email": 1 });
|
|
6854
|
-
var UserModel = import_mongoose11.default.models.User || import_mongoose11.default.model("User", schema6);
|
|
6855
|
-
|
|
6856
|
-
// src/mongoose/VerificationToken.ts
|
|
6857
|
-
var import_mongoose12 = __toESM(require("mongoose"));
|
|
6858
|
-
var MongooseSchema11 = import_mongoose12.default.Schema;
|
|
6859
|
-
var schema7 = new MongooseSchema11(
|
|
6860
|
-
{
|
|
6861
|
-
createdAt: {
|
|
6862
|
-
default: Date.now,
|
|
6863
|
-
expires: 24 * 60 * 60,
|
|
6864
|
-
// 24 hours in seconds (MongoDB TTL expects seconds)
|
|
6865
|
-
required: true,
|
|
6866
|
-
type: Date
|
|
6867
|
-
},
|
|
6868
|
-
// Token expires after 1 day
|
|
6869
|
-
email: { required: true, type: String },
|
|
6870
|
-
verificationToken: { required: true, type: String }
|
|
6871
|
-
},
|
|
6872
|
-
{ timestamps: true }
|
|
6873
|
-
);
|
|
6874
|
-
var VerificationTokenModel = import_mongoose12.default.models.VerificationToken || import_mongoose12.default.model("VerificationToken", schema7);
|
|
6875
|
-
|
|
6876
|
-
// src/mongoose/vendor/Vendor.ts
|
|
6877
|
-
var import_mongoose13 = __toESM(require("mongoose"));
|
|
6878
|
-
var MongooseSchema12 = import_mongoose13.default.Schema;
|
|
6879
|
-
var MenuTypeSchema = new MongooseSchema12(
|
|
6880
|
-
{
|
|
6881
|
-
description: { required: false, type: String },
|
|
6882
|
-
name: { required: false, type: String },
|
|
6883
|
-
price: { required: false, type: Number },
|
|
6884
|
-
productGroups: { required: false, type: [String] }
|
|
6885
|
-
},
|
|
6886
|
-
{ _id: false }
|
|
6887
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6888
|
-
);
|
|
6889
|
-
var LocationsSchema = new MongooseSchema12(
|
|
6890
|
-
{
|
|
6891
|
-
dateTime: {
|
|
6892
|
-
endDate: { required: false, type: String },
|
|
6893
|
-
endTime: { required: false, type: String },
|
|
6894
|
-
startDate: { required: false, type: String },
|
|
6895
|
-
startTime: { required: false, type: String }
|
|
6896
|
-
},
|
|
6897
|
-
description: { required: false, type: String },
|
|
6898
|
-
location: {
|
|
6899
|
-
city: { required: false, type: String },
|
|
6900
|
-
coordinates: {
|
|
6901
|
-
required: false,
|
|
6902
|
-
type: [Number]
|
|
6903
|
-
// [longitude, latitude]
|
|
6904
|
-
},
|
|
6905
|
-
country: { required: false, type: String },
|
|
6906
|
-
fullAddress: { required: false, type: String },
|
|
6907
|
-
latitude: { required: false, type: Number },
|
|
6908
|
-
longitude: { required: false, type: Number },
|
|
6909
|
-
region: { required: false, type: String },
|
|
6910
|
-
type: { required: false, type: String }
|
|
6911
|
-
// Mongoose GeoJSON type
|
|
6912
|
-
}
|
|
6913
|
-
},
|
|
6914
|
-
{ _id: false }
|
|
6915
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
6916
|
-
);
|
|
6917
|
-
var schema8 = new MongooseSchema12(
|
|
6918
|
-
{
|
|
6919
|
-
...baseResourceFields,
|
|
6920
|
-
// Importing base resource fields from global.ts
|
|
6921
|
-
availability: {
|
|
6922
|
-
corporate: { default: false, required: false, type: Boolean },
|
|
6923
|
-
private: { default: false, required: false, type: Boolean },
|
|
6924
|
-
school: { default: false, required: false, type: Boolean }
|
|
6925
|
-
},
|
|
6926
|
-
categories: [CategorySchema],
|
|
6927
|
-
locations: [LocationsSchema],
|
|
6928
|
-
multiLocation: { required: true, type: Boolean },
|
|
6929
|
-
products: [MenuTypeSchema],
|
|
6930
|
-
vendorInfoId: {
|
|
6931
|
-
ref: "VendorInfo",
|
|
6932
|
-
required: false,
|
|
6933
|
-
type: import_mongoose13.default.Schema.Types.ObjectId
|
|
6934
|
-
},
|
|
6935
|
-
vendorType: {
|
|
6936
|
-
enum: Object.values(EnumVendorType),
|
|
6937
|
-
required: true,
|
|
6938
|
-
type: String
|
|
6939
|
-
}
|
|
6940
|
-
},
|
|
6941
|
-
{ timestamps: true }
|
|
6942
|
-
);
|
|
6943
|
-
schema8.index({ name: 1 });
|
|
6944
|
-
schema8.index({ description: 1 });
|
|
6945
|
-
schema8.index({ region: 1 });
|
|
6946
|
-
schema8.index({ "categories.name": 1 });
|
|
6947
|
-
schema8.index({ "partners.email": 1 });
|
|
6948
|
-
var VendorModel = import_mongoose13.default.models.Vendor || import_mongoose13.default.model("Vendor", schema8);
|
|
6949
|
-
|
|
6950
|
-
// src/mongoose/vendor/VendorInfo.ts
|
|
6951
|
-
var import_mongoose14 = __toESM(require("mongoose"));
|
|
6952
|
-
var MongooseSchema13 = import_mongoose14.default.Schema;
|
|
6953
|
-
var AttributesSchema = new MongooseSchema13(
|
|
6954
|
-
{
|
|
6955
|
-
details: { required: false, type: String },
|
|
6956
|
-
isRequired: { default: false, required: true, type: Boolean }
|
|
6957
|
-
},
|
|
6958
|
-
{ _id: false }
|
|
6959
|
-
);
|
|
6960
|
-
var schema9 = new MongooseSchema13(
|
|
6961
|
-
{
|
|
6962
|
-
compliance: {
|
|
6963
|
-
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
6964
|
-
liabilityInsurance: { default: false, required: false, type: Boolean }
|
|
6965
|
-
},
|
|
6966
|
-
documents: [ResourceImageTypeSchema],
|
|
6967
|
-
product: {
|
|
6968
|
-
foodFlavors: {
|
|
6969
|
-
enum: Object.values(EnumFoodFlavor),
|
|
6970
|
-
required: true,
|
|
6971
|
-
type: [String]
|
|
6972
|
-
},
|
|
6973
|
-
packaging: { required: true, type: [String] },
|
|
6974
|
-
priceRange: {
|
|
6975
|
-
max: { required: true, type: Number },
|
|
6976
|
-
min: { required: true, type: Number }
|
|
6977
|
-
},
|
|
6978
|
-
producedIn: { required: true, type: [String] }
|
|
6979
|
-
},
|
|
6980
|
-
requirements: {
|
|
6981
|
-
electricity: AttributesSchema,
|
|
6982
|
-
gazebo: AttributesSchema,
|
|
6983
|
-
table: AttributesSchema
|
|
6984
|
-
},
|
|
6985
|
-
stallInfo: {
|
|
6986
|
-
size: {
|
|
6987
|
-
depth: { required: true, type: Number },
|
|
6988
|
-
width: { required: true, type: Number }
|
|
6989
|
-
}
|
|
6990
|
-
},
|
|
6991
|
-
vendorId: {
|
|
6992
|
-
ref: "Vendor",
|
|
6993
|
-
required: true,
|
|
6994
|
-
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
6995
|
-
}
|
|
6996
|
-
},
|
|
6997
|
-
{ timestamps: true }
|
|
6998
|
-
);
|
|
6999
|
-
var VendorInfoModel = import_mongoose14.default.models.VendorInfo || import_mongoose14.default.model("VendorInfo", schema9);
|
|
7000
|
-
|
|
7001
|
-
// src/mongoose/event/Event.ts
|
|
7002
|
-
var import_mongoose15 = __toESM(require("mongoose"));
|
|
7003
|
-
var MongooseSchema14 = import_mongoose15.default.Schema;
|
|
7004
|
-
var locationsSchema = new MongooseSchema14(
|
|
7005
|
-
{
|
|
7006
|
-
city: { required: true, type: String },
|
|
7007
|
-
coordinates: {
|
|
7008
|
-
required: true,
|
|
7009
|
-
type: [Number]
|
|
7010
|
-
// [longitude, latitude]
|
|
7011
|
-
},
|
|
7012
|
-
country: { required: true, type: String },
|
|
7013
|
-
fullAddress: { required: true, type: String },
|
|
7014
|
-
latitude: { required: true, type: Number },
|
|
7015
|
-
longitude: { required: true, type: Number },
|
|
7016
|
-
region: { required: true, type: String },
|
|
7017
|
-
type: {
|
|
7018
|
-
default: "Point",
|
|
7019
|
-
enum: ["Point"],
|
|
7020
|
-
required: true,
|
|
7021
|
-
type: String
|
|
7022
|
-
}
|
|
7023
|
-
},
|
|
7024
|
-
{ _id: false }
|
|
7025
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
7026
|
-
);
|
|
7027
|
-
var dateTimeSchema3 = new MongooseSchema14(
|
|
7028
|
-
{
|
|
7029
|
-
endDate: { required: true, type: String },
|
|
7030
|
-
endTime: { required: true, type: String },
|
|
7031
|
-
startDate: { required: true, type: String },
|
|
7032
|
-
startTime: { required: true, type: String }
|
|
7033
|
-
},
|
|
7034
|
-
{ _id: false }
|
|
7035
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
7036
|
-
);
|
|
7037
|
-
var schema10 = new MongooseSchema14(
|
|
7038
|
-
{
|
|
7039
|
-
...baseResourceFields,
|
|
7040
|
-
// Importing base resource fields from global.ts
|
|
7041
|
-
dateTime: [dateTimeSchema3],
|
|
7042
|
-
eventInfoId: {
|
|
7043
|
-
ref: "EventInfo",
|
|
7044
|
-
required: false,
|
|
7045
|
-
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
7046
|
-
},
|
|
7047
|
-
eventType: {
|
|
7048
|
-
enum: Object.values(EnumEventType),
|
|
7049
|
-
required: true,
|
|
7050
|
-
type: String
|
|
7051
|
-
},
|
|
7052
|
-
location: {
|
|
7053
|
-
required: true,
|
|
7054
|
-
type: locationsSchema
|
|
7055
|
-
},
|
|
7056
|
-
nzbn: { required: true, type: String },
|
|
7057
|
-
provider: { required: false, type: String },
|
|
7058
|
-
rainOrShine: { required: true, type: Boolean },
|
|
7059
|
-
tags: { required: true, type: [String] }
|
|
7060
|
-
},
|
|
7061
|
-
{ timestamps: true }
|
|
7062
|
-
);
|
|
7063
|
-
schema10.index({ name: 1 });
|
|
7064
|
-
schema10.index({ description: 1 });
|
|
7065
|
-
schema10.index({ region: 1 });
|
|
7066
|
-
schema10.index({ location: "2dsphere" });
|
|
7067
|
-
schema10.index({ tags: 1 });
|
|
7068
|
-
schema10.index({ "partners.email": 1 });
|
|
7069
|
-
var EventModel = import_mongoose15.default.models.Event || import_mongoose15.default.model("Event", schema10);
|
|
7070
|
-
|
|
7071
|
-
// src/service/database.ts
|
|
7072
|
-
var import_mongoose16 = __toESM(require("mongoose"));
|
|
7073
|
-
|
|
7074
|
-
// src/service/timezonePlugin.ts
|
|
7075
|
-
var import_dayjs3 = __toESM(require("dayjs"));
|
|
7076
|
-
var import_timezone2 = __toESM(require("dayjs/plugin/timezone"));
|
|
7077
|
-
var import_utc2 = __toESM(require("dayjs/plugin/utc"));
|
|
7078
|
-
import_dayjs3.default.extend(import_utc2.default);
|
|
7079
|
-
import_dayjs3.default.extend(import_timezone2.default);
|
|
7080
|
-
function timezonePlugin(schema11) {
|
|
7081
|
-
if (!schema11.get("timestamps")) return;
|
|
7082
|
-
const transform = (_doc, ret) => {
|
|
7083
|
-
if (ret.createdAt)
|
|
7084
|
-
ret.createdAt = (0, import_dayjs3.default)(ret.createdAt).tz("Pacific/Auckland").format();
|
|
7085
|
-
if (ret.updatedAt)
|
|
7086
|
-
ret.updatedAt = (0, import_dayjs3.default)(ret.updatedAt).tz("Pacific/Auckland").format();
|
|
7087
|
-
return ret;
|
|
7088
|
-
};
|
|
7089
|
-
schema11.set("toJSON", { transform });
|
|
7090
|
-
schema11.set("toObject", { transform });
|
|
7091
|
-
}
|
|
7092
|
-
|
|
7093
|
-
// src/service/database.ts
|
|
7094
|
-
import_mongoose16.default.plugin(timezonePlugin);
|
|
7095
|
-
var connectToDatabase = async ({
|
|
7096
|
-
appName,
|
|
7097
|
-
dbName,
|
|
7098
|
-
dbPassword,
|
|
7099
|
-
dbUser,
|
|
7100
|
-
mongodbUri
|
|
7101
|
-
}) => {
|
|
7102
|
-
try {
|
|
7103
|
-
const mongoUri = mongodbUri ? mongodbUri : (
|
|
7104
|
-
// Fallback to MongoDB Atlas connection string
|
|
7105
|
-
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
7106
|
-
);
|
|
7107
|
-
await import_mongoose16.default.connect(mongoUri);
|
|
7108
|
-
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
7109
|
-
console.log(
|
|
7110
|
-
`${connectionType} connected from server/src/service/database.ts`
|
|
7111
|
-
);
|
|
7112
|
-
} catch (err) {
|
|
7113
|
-
console.error("Error connecting to MongoDB:", err);
|
|
7114
|
-
throw err;
|
|
7115
|
-
}
|
|
7116
|
-
};
|
|
7117
|
-
|
|
7118
|
-
// src/service/saveNotificationsInDb.ts
|
|
7119
|
-
async function saveNotificationsInDb(payload) {
|
|
7120
|
-
const { data, message, title, type, userIds } = payload;
|
|
7121
|
-
try {
|
|
7122
|
-
const notifications = userIds.map((userId) => ({
|
|
7123
|
-
data,
|
|
7124
|
-
isRead: false,
|
|
7125
|
-
message,
|
|
7126
|
-
title,
|
|
7127
|
-
type,
|
|
7128
|
-
userId
|
|
7129
|
-
}));
|
|
7130
|
-
await NotificationModel.insertMany(notifications);
|
|
7131
|
-
console.log(
|
|
7132
|
-
`Created ${notifications.length} notifications for ${userIds.length} users`
|
|
7133
|
-
);
|
|
7134
|
-
return [...new Set(userIds)];
|
|
7135
|
-
} catch (error) {
|
|
7136
|
-
console.error("Failed to create notifications:", error);
|
|
7137
|
-
return [];
|
|
7138
|
-
}
|
|
7139
|
-
}
|
|
7140
|
-
|
|
7141
6162
|
// src/storage/index.ts
|
|
7142
6163
|
var SAVED_PASSWORD_KEY = "savedPassword";
|
|
7143
6164
|
var SAVED_EMAIL_KEY = "savedEmail";
|
|
@@ -7182,11 +6203,18 @@ var fonts = {
|
|
|
7182
6203
|
fontWeight: "400"
|
|
7183
6204
|
}
|
|
7184
6205
|
};
|
|
6206
|
+
|
|
6207
|
+
// src/types/resourceActivities.ts
|
|
6208
|
+
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
6209
|
+
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
6210
|
+
EnumActivity2["GOING"] = "GOING";
|
|
6211
|
+
EnumActivity2["INTERESTED"] = "INTERESTED";
|
|
6212
|
+
EnumActivity2["PRESENT"] = "PRESENT";
|
|
6213
|
+
EnumActivity2["VIEW"] = "VIEW";
|
|
6214
|
+
return EnumActivity2;
|
|
6215
|
+
})(EnumActivity || {});
|
|
7185
6216
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7186
6217
|
0 && (module.exports = {
|
|
7187
|
-
AdModel,
|
|
7188
|
-
CategorySchema,
|
|
7189
|
-
ChatModel,
|
|
7190
6218
|
EnumActivity,
|
|
7191
6219
|
EnumAdShowOn,
|
|
7192
6220
|
EnumAdStatus,
|
|
@@ -7200,7 +6228,6 @@ var fonts = {
|
|
|
7200
6228
|
EnumNotificationType,
|
|
7201
6229
|
EnumOSPlatform,
|
|
7202
6230
|
EnumPaymentMethod,
|
|
7203
|
-
EnumPubSubEvents,
|
|
7204
6231
|
EnumRegions,
|
|
7205
6232
|
EnumRelationResource,
|
|
7206
6233
|
EnumResourceType,
|
|
@@ -7208,38 +6235,20 @@ var fonts = {
|
|
|
7208
6235
|
EnumUserLicence,
|
|
7209
6236
|
EnumUserRole,
|
|
7210
6237
|
EnumVendorType,
|
|
7211
|
-
EventInfoModel,
|
|
7212
|
-
EventModel,
|
|
7213
6238
|
ImageTypeEnum,
|
|
7214
|
-
NotificationModel,
|
|
7215
|
-
ParticipantSchema,
|
|
7216
|
-
PushTokenModel,
|
|
7217
|
-
RelationModel,
|
|
7218
|
-
RelationTypeSchema,
|
|
7219
|
-
ResourceActivityModel,
|
|
7220
|
-
ResourceImageTypeSchema,
|
|
7221
6239
|
SAVED_EMAIL_KEY,
|
|
7222
6240
|
SAVED_PASSWORD_KEY,
|
|
7223
6241
|
SAVED_REFRESH_TOKEN_KEY,
|
|
7224
6242
|
SAVED_TOKEN_KEY,
|
|
7225
|
-
SocialMediaTypeSchema,
|
|
7226
|
-
StallTypeSchema,
|
|
7227
|
-
TesterModel,
|
|
7228
6243
|
USER_STORAGE_KEY,
|
|
7229
|
-
UserModel,
|
|
7230
|
-
VendorInfoModel,
|
|
7231
|
-
VendorModel,
|
|
7232
|
-
VerificationTokenModel,
|
|
7233
6244
|
availableCategories,
|
|
7234
6245
|
availableCityOptions,
|
|
7235
6246
|
availableRegionOptions,
|
|
7236
6247
|
availableRegionTypes,
|
|
7237
6248
|
availableTagTypes,
|
|
7238
|
-
baseResourceFields,
|
|
7239
6249
|
capitalizeFirstLetter,
|
|
7240
6250
|
categoryColors,
|
|
7241
6251
|
companyContactFields,
|
|
7242
|
-
connectToDatabase,
|
|
7243
6252
|
contactUsFields,
|
|
7244
6253
|
darkColors,
|
|
7245
6254
|
dateFormat,
|
|
@@ -7265,27 +6274,22 @@ var fonts = {
|
|
|
7265
6274
|
loginFields,
|
|
7266
6275
|
mapArrayToOptions,
|
|
7267
6276
|
mapBaseResourceTypeToFormData,
|
|
7268
|
-
mongoose,
|
|
7269
6277
|
normalizeUrl,
|
|
7270
6278
|
packagingOptions,
|
|
7271
|
-
partnersSchema,
|
|
7272
6279
|
paymentMethodOptions,
|
|
7273
6280
|
producedIngOptions,
|
|
7274
6281
|
productLabelGroups,
|
|
7275
6282
|
profileFields,
|
|
7276
6283
|
registerFields,
|
|
7277
|
-
relationDatesSchema,
|
|
7278
6284
|
removeTypename,
|
|
7279
6285
|
requestPasswordResetFields,
|
|
7280
6286
|
requirementsOptions,
|
|
7281
6287
|
resetPasswordFields,
|
|
7282
|
-
saveNotificationsInDb,
|
|
7283
6288
|
socialMediaFields,
|
|
7284
6289
|
sortDatesChronologically,
|
|
7285
6290
|
stallTypeOptions,
|
|
7286
6291
|
statusOptions,
|
|
7287
6292
|
tagOptions,
|
|
7288
|
-
termsAgreementSchema,
|
|
7289
6293
|
testersFields,
|
|
7290
6294
|
timeFormat,
|
|
7291
6295
|
truncateText,
|