@timardex/cluemart-shared 1.2.29 → 1.2.30
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 +129 -0
- package/dist/ad-CTWMmc7b.d.mts +129 -0
- package/dist/{auth-Ci6Uskch.d.mts → auth-YsJJnj12.d.mts} +1 -1
- package/dist/{auth-CzEdRDf1.d.ts → auth-o_ns6gLk.d.ts} +1 -1
- package/dist/{chunk-CQ7TCXMI.mjs → chunk-O6LVIQFK.mjs} +3 -5
- package/dist/chunk-O6LVIQFK.mjs.map +1 -0
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/{global-2Jk7sRkL.d.ts → global-4lS-fh61.d.ts} +20 -1
- package/dist/{global-DWuTxnJ8.d.mts → global-_ZHkOcnR.d.mts} +20 -1
- package/dist/graphql/index.d.mts +2 -3
- package/dist/graphql/index.d.ts +2 -3
- package/dist/hooks/index.d.mts +3 -4
- package/dist/hooks/index.d.ts +3 -4
- package/dist/index.cjs +35 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +123 -1
- package/dist/index.d.ts +123 -1
- package/dist/index.mjs +22 -8
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +30 -1
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +108 -4
- package/dist/mongoose/index.d.ts +108 -4
- package/dist/mongoose/index.mjs +21 -2
- package/dist/mongoose/index.mjs.map +1 -1
- package/dist/service/index.cjs +5 -7
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +1 -1
- package/dist/service/index.d.ts +1 -1
- package/dist/service/index.mjs +8 -8
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +3 -4
- package/dist/types/index.d.ts +3 -4
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/ad-Crq-z5Wt.d.mts +0 -69
- package/dist/ad-DHetF-th.d.ts +0 -69
- package/dist/chunk-CQ7TCXMI.mjs.map +0 -1
- package/dist/user-DbEEY7fv.d.ts +0 -64
- package/dist/user-OPY5EOqR.d.mts +0 -64
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { EnumOSPlatform, EnumResourceType, EnumUserLicence, EnumUserRole } from './enums/index.js';
|
|
2
|
+
import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-4lS-fh61.js';
|
|
3
|
+
|
|
4
|
+
interface TestersFormData {
|
|
5
|
+
categories?: Category[] | null;
|
|
6
|
+
companyName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
firstName: string;
|
|
9
|
+
lastName: string;
|
|
10
|
+
osType: EnumOSPlatform;
|
|
11
|
+
region: string;
|
|
12
|
+
resourceType: EnumResourceType;
|
|
13
|
+
}
|
|
14
|
+
type CreateTestersFormData = CreateFormData<TestersFormData>;
|
|
15
|
+
interface TesterType extends TestersFormData {
|
|
16
|
+
_id: string;
|
|
17
|
+
active: boolean;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type UserFormData = {
|
|
23
|
+
_id?: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
avatar?: ResourceImageType | null;
|
|
26
|
+
avatarUpload?: ResourceImageType | null;
|
|
27
|
+
confirmPassword: string;
|
|
28
|
+
email: string;
|
|
29
|
+
firstName: string;
|
|
30
|
+
lastName: string;
|
|
31
|
+
password: string;
|
|
32
|
+
platform?: EnumOSPlatform;
|
|
33
|
+
preferredRegion: string;
|
|
34
|
+
role: EnumUserRole;
|
|
35
|
+
termsAgreement?: TermsAgreement | null;
|
|
36
|
+
};
|
|
37
|
+
type CreateUserFormData = CreateFormData<UserFormData>;
|
|
38
|
+
type UserActivityEvent = {
|
|
39
|
+
resourceId: string;
|
|
40
|
+
startDate: string;
|
|
41
|
+
startTime: string;
|
|
42
|
+
};
|
|
43
|
+
type UserActivity = {
|
|
44
|
+
favourites: {
|
|
45
|
+
events: string[];
|
|
46
|
+
vendors: string[];
|
|
47
|
+
};
|
|
48
|
+
going: {
|
|
49
|
+
events: UserActivityEvent[];
|
|
50
|
+
};
|
|
51
|
+
interested: {
|
|
52
|
+
events: UserActivityEvent[];
|
|
53
|
+
};
|
|
54
|
+
present: {
|
|
55
|
+
events: UserActivityEvent[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
interface UserType {
|
|
59
|
+
_id: string;
|
|
60
|
+
active: boolean;
|
|
61
|
+
avatar: ResourceImageType | null;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
deletedAt: string | null;
|
|
64
|
+
email: string;
|
|
65
|
+
events: string[] | null;
|
|
66
|
+
firstName: string;
|
|
67
|
+
isTester: boolean;
|
|
68
|
+
lastName: string;
|
|
69
|
+
licences: EnumUserLicence[] | null;
|
|
70
|
+
partners?: PartnerType[] | null;
|
|
71
|
+
password: string;
|
|
72
|
+
platform: EnumOSPlatform | null;
|
|
73
|
+
preferredRegion: string;
|
|
74
|
+
refreshToken: string | null;
|
|
75
|
+
role: EnumUserRole;
|
|
76
|
+
termsAgreement?: TermsAgreement | null;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
userActivity: UserActivity | null;
|
|
79
|
+
vendor: string | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare enum EnumAdShowOn {
|
|
83
|
+
FRONT_PAGE = "Front_page",
|
|
84
|
+
EVENTS_PAGE = "Events_page",
|
|
85
|
+
VENDORS_PAGE = "Vendors_page"
|
|
86
|
+
}
|
|
87
|
+
declare enum EnumAdStatus {
|
|
88
|
+
ACTIVE = "Active",
|
|
89
|
+
PAUSED = "Paused",
|
|
90
|
+
EXPIRED = "Expired"
|
|
91
|
+
}
|
|
92
|
+
declare enum EnumAdType {
|
|
93
|
+
SPONSORED = "Sponsored",
|
|
94
|
+
FREE = "Free"
|
|
95
|
+
}
|
|
96
|
+
declare enum EnumAdStyle {
|
|
97
|
+
BLOOM = "Bloom",
|
|
98
|
+
RISE = "Rise"
|
|
99
|
+
}
|
|
100
|
+
interface AdFormData {
|
|
101
|
+
active: boolean;
|
|
102
|
+
adStyle: EnumAdStyle;
|
|
103
|
+
adType: EnumAdType;
|
|
104
|
+
clui?: string | null;
|
|
105
|
+
end: Date;
|
|
106
|
+
resourceCover: string;
|
|
107
|
+
resourceDescription: string;
|
|
108
|
+
resourceId: string;
|
|
109
|
+
resourceLogo?: string | null;
|
|
110
|
+
resourceName: string;
|
|
111
|
+
resourceRegion: string;
|
|
112
|
+
resourceType: EnumResourceType;
|
|
113
|
+
showOn: EnumAdShowOn;
|
|
114
|
+
socialMedia?: SocialMediaType[] | null;
|
|
115
|
+
start?: Date;
|
|
116
|
+
status: EnumAdStatus;
|
|
117
|
+
targetRegion?: string | null;
|
|
118
|
+
}
|
|
119
|
+
type CreateAdFormData = CreateFormData<AdFormData>;
|
|
120
|
+
interface AdType extends AdFormData {
|
|
121
|
+
_id: string;
|
|
122
|
+
clicks?: number;
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
impressions?: number;
|
|
125
|
+
start: Date;
|
|
126
|
+
updatedAt: Date;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { type AdType as A, type CreateUserFormData as C, EnumAdStatus as E, type TesterType as T, type UserType as U, type UserFormData as a, type TestersFormData as b, type CreateTestersFormData as c, type AdFormData as d, type CreateAdFormData as e, type UserActivityEvent as f, type UserActivity as g, EnumAdShowOn as h, EnumAdType as i, EnumAdStyle as j };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { EnumOSPlatform, EnumResourceType, EnumUserLicence, EnumUserRole } from './enums/index.mjs';
|
|
2
|
+
import { C as Category, a3 as CreateFormData, s as ResourceImageType, P as PartnerType, T as TermsAgreement, r as SocialMediaType } from './global-_ZHkOcnR.mjs';
|
|
3
|
+
|
|
4
|
+
interface TestersFormData {
|
|
5
|
+
categories?: Category[] | null;
|
|
6
|
+
companyName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
firstName: string;
|
|
9
|
+
lastName: string;
|
|
10
|
+
osType: EnumOSPlatform;
|
|
11
|
+
region: string;
|
|
12
|
+
resourceType: EnumResourceType;
|
|
13
|
+
}
|
|
14
|
+
type CreateTestersFormData = CreateFormData<TestersFormData>;
|
|
15
|
+
interface TesterType extends TestersFormData {
|
|
16
|
+
_id: string;
|
|
17
|
+
active: boolean;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type UserFormData = {
|
|
23
|
+
_id?: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
avatar?: ResourceImageType | null;
|
|
26
|
+
avatarUpload?: ResourceImageType | null;
|
|
27
|
+
confirmPassword: string;
|
|
28
|
+
email: string;
|
|
29
|
+
firstName: string;
|
|
30
|
+
lastName: string;
|
|
31
|
+
password: string;
|
|
32
|
+
platform?: EnumOSPlatform;
|
|
33
|
+
preferredRegion: string;
|
|
34
|
+
role: EnumUserRole;
|
|
35
|
+
termsAgreement?: TermsAgreement | null;
|
|
36
|
+
};
|
|
37
|
+
type CreateUserFormData = CreateFormData<UserFormData>;
|
|
38
|
+
type UserActivityEvent = {
|
|
39
|
+
resourceId: string;
|
|
40
|
+
startDate: string;
|
|
41
|
+
startTime: string;
|
|
42
|
+
};
|
|
43
|
+
type UserActivity = {
|
|
44
|
+
favourites: {
|
|
45
|
+
events: string[];
|
|
46
|
+
vendors: string[];
|
|
47
|
+
};
|
|
48
|
+
going: {
|
|
49
|
+
events: UserActivityEvent[];
|
|
50
|
+
};
|
|
51
|
+
interested: {
|
|
52
|
+
events: UserActivityEvent[];
|
|
53
|
+
};
|
|
54
|
+
present: {
|
|
55
|
+
events: UserActivityEvent[];
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
interface UserType {
|
|
59
|
+
_id: string;
|
|
60
|
+
active: boolean;
|
|
61
|
+
avatar: ResourceImageType | null;
|
|
62
|
+
createdAt: string;
|
|
63
|
+
deletedAt: string | null;
|
|
64
|
+
email: string;
|
|
65
|
+
events: string[] | null;
|
|
66
|
+
firstName: string;
|
|
67
|
+
isTester: boolean;
|
|
68
|
+
lastName: string;
|
|
69
|
+
licences: EnumUserLicence[] | null;
|
|
70
|
+
partners?: PartnerType[] | null;
|
|
71
|
+
password: string;
|
|
72
|
+
platform: EnumOSPlatform | null;
|
|
73
|
+
preferredRegion: string;
|
|
74
|
+
refreshToken: string | null;
|
|
75
|
+
role: EnumUserRole;
|
|
76
|
+
termsAgreement?: TermsAgreement | null;
|
|
77
|
+
updatedAt: string;
|
|
78
|
+
userActivity: UserActivity | null;
|
|
79
|
+
vendor: string | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare enum EnumAdShowOn {
|
|
83
|
+
FRONT_PAGE = "Front_page",
|
|
84
|
+
EVENTS_PAGE = "Events_page",
|
|
85
|
+
VENDORS_PAGE = "Vendors_page"
|
|
86
|
+
}
|
|
87
|
+
declare enum EnumAdStatus {
|
|
88
|
+
ACTIVE = "Active",
|
|
89
|
+
PAUSED = "Paused",
|
|
90
|
+
EXPIRED = "Expired"
|
|
91
|
+
}
|
|
92
|
+
declare enum EnumAdType {
|
|
93
|
+
SPONSORED = "Sponsored",
|
|
94
|
+
FREE = "Free"
|
|
95
|
+
}
|
|
96
|
+
declare enum EnumAdStyle {
|
|
97
|
+
BLOOM = "Bloom",
|
|
98
|
+
RISE = "Rise"
|
|
99
|
+
}
|
|
100
|
+
interface AdFormData {
|
|
101
|
+
active: boolean;
|
|
102
|
+
adStyle: EnumAdStyle;
|
|
103
|
+
adType: EnumAdType;
|
|
104
|
+
clui?: string | null;
|
|
105
|
+
end: Date;
|
|
106
|
+
resourceCover: string;
|
|
107
|
+
resourceDescription: string;
|
|
108
|
+
resourceId: string;
|
|
109
|
+
resourceLogo?: string | null;
|
|
110
|
+
resourceName: string;
|
|
111
|
+
resourceRegion: string;
|
|
112
|
+
resourceType: EnumResourceType;
|
|
113
|
+
showOn: EnumAdShowOn;
|
|
114
|
+
socialMedia?: SocialMediaType[] | null;
|
|
115
|
+
start?: Date;
|
|
116
|
+
status: EnumAdStatus;
|
|
117
|
+
targetRegion?: string | null;
|
|
118
|
+
}
|
|
119
|
+
type CreateAdFormData = CreateFormData<AdFormData>;
|
|
120
|
+
interface AdType extends AdFormData {
|
|
121
|
+
_id: string;
|
|
122
|
+
clicks?: number;
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
impressions?: number;
|
|
125
|
+
start: Date;
|
|
126
|
+
updatedAt: Date;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { type AdType as A, type CreateUserFormData as C, EnumAdStatus as E, type TesterType as T, type UserType as U, type UserFormData as a, type TestersFormData as b, type CreateTestersFormData as c, type AdFormData as d, type CreateAdFormData as e, type UserActivityEvent as f, type UserActivity as g, EnumAdShowOn as h, EnumAdType as i, EnumAdStyle as j };
|
|
@@ -41,7 +41,6 @@ var NotificationModel = mongoose.model(
|
|
|
41
41
|
"Notification",
|
|
42
42
|
schema
|
|
43
43
|
);
|
|
44
|
-
var Notification_default = NotificationModel;
|
|
45
44
|
|
|
46
45
|
// src/mongoose/PushToken.ts
|
|
47
46
|
import mongoose2 from "mongoose";
|
|
@@ -59,10 +58,9 @@ var schema2 = new MongooseSchema2(
|
|
|
59
58
|
{ timestamps: true }
|
|
60
59
|
);
|
|
61
60
|
var PushTokenModel = mongoose2.model("PushToken", schema2);
|
|
62
|
-
var PushToken_default = PushTokenModel;
|
|
63
61
|
|
|
64
62
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
NotificationModel,
|
|
64
|
+
PushTokenModel
|
|
67
65
|
};
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-O6LVIQFK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mongoose/Notification.ts","../src/mongoose/PushToken.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { EnumNotificationResourceType, EnumNotificationType } from \"src/enums\";\nimport {\n CreateBulkNotificationInput,\n NotificationType,\n ObjectId,\n} from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\nexport type SchemaCreateBulkNotificationInput = Omit<\n CreateBulkNotificationInput,\n \"userIds\"\n> & {\n userIds: ObjectId[];\n};\n\nexport type SchemaNotificationType = Omit<NotificationType, \"userId\"> & {\n userId: ObjectId;\n};\n/**\n * Schema for storing in-app notifications\n * Each notification is tied to a specific user and can be marked as read/unread\n */\nconst schema = new MongooseSchema<SchemaNotificationType>(\n {\n data: {\n resourceId: { required: true, type: String },\n resourceName: { required: true, type: String },\n resourceType: {\n enum: Object.values(EnumNotificationResourceType),\n required: true,\n type: String,\n },\n },\n isRead: { default: false, index: true, required: true, type: Boolean },\n message: { required: true, type: String },\n title: { required: true, type: String },\n type: {\n default: EnumNotificationType.SYSTEM,\n enum: Object.values(EnumNotificationType),\n required: true,\n type: String,\n },\n userId: {\n ref: \"User\",\n required: true,\n type: mongoose.Schema.Types.ObjectId,\n },\n },\n { timestamps: true },\n);\n\n// Compound index for efficient queries\nschema.index({ isRead: 1, userId: 1 });\nschema.index({ createdAt: -1, userId: 1 });\n\nexport const NotificationModel = mongoose.model<SchemaNotificationType>(\n \"Notification\",\n schema,\n);\n","import mongoose from \"mongoose\";\n\nimport { EnumOSPlatform } from \"src/enums\";\nimport { ObjectId } from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\ntype PushTokenType = {\n _id: string;\n createdAt: Date;\n platform: EnumOSPlatform;\n token: string;\n updatedAt: Date;\n userId: string;\n};\n\nexport type SchemaPushTokenType = Omit<PushTokenType, \"userId\"> & {\n userId: ObjectId;\n};\n\n/**\n * This is the schema for the push token type.\n * It is used to define the structure of the push token type in the database.\n * The schema is used by Mongoose to create a model for the push token type.\n */\nconst schema = new MongooseSchema<SchemaPushTokenType>(\n {\n platform: {\n enum: Object.values(EnumOSPlatform),\n required: true,\n type: String,\n },\n token: { required: true, type: String },\n userId: { required: true, type: mongoose.Schema.Types.ObjectId },\n },\n { timestamps: true },\n);\n\nexport const PushTokenModel = mongoose.model<SchemaPushTokenType>(\"PushToken\", schema);\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;AASrB,IAAM,iBAAiB,SAAS;AAgBhC,IAAM,SAAS,IAAI;AAAA,EACjB;AAAA,IACE,MAAM;AAAA,MACJ,YAAY,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC3C,cAAc,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC7C,cAAc;AAAA,QACZ,MAAM,OAAO,OAAO,4BAA4B;AAAA,QAChD,UAAU;AAAA,QACV,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,QAAQ,EAAE,SAAS,OAAO,OAAO,MAAM,UAAU,MAAM,MAAM,QAAQ;AAAA,IACrE,SAAS,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACxC,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,MAAM;AAAA,MACJ;AAAA,MACA,MAAM,OAAO,OAAO,oBAAoB;AAAA,MACxC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,KAAK;AAAA,MACL,UAAU;AAAA,MACV,MAAM,SAAS,OAAO,MAAM;AAAA,IAC9B;AAAA,EACF;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAGA,OAAO,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;AACrC,OAAO,MAAM,EAAE,WAAW,IAAI,QAAQ,EAAE,CAAC;AAElC,IAAM,oBAAoB,SAAS;AAAA,EACxC;AAAA,EACA;AACF;;;AC7DA,OAAOA,eAAc;AAKrB,IAAMC,kBAAiBC,UAAS;AAoBhC,IAAMC,UAAS,IAAIF;AAAA,EACjB;AAAA,IACE,UAAU;AAAA,MACR,MAAM,OAAO,OAAO,cAAc;AAAA,MAClC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,QAAQ,EAAE,UAAU,MAAM,MAAMC,UAAS,OAAO,MAAM,SAAS;AAAA,EACjE;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAEO,IAAM,iBAAiBA,UAAS,MAA2B,aAAaC,OAAM;","names":["mongoose","MongooseSchema","mongoose","schema"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-_ZHkOcnR.mjs';
|
|
2
2
|
import 'mongoose';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
import '../enums/index.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-
|
|
1
|
+
import { F as FormField, a as FormDateField, O as OptionItem, R as Requirement, S as StallType, C as Category } from '../global-4lS-fh61.js';
|
|
2
2
|
import 'mongoose';
|
|
3
3
|
import 'react-hook-form';
|
|
4
4
|
import '../enums/index.js';
|
|
@@ -205,6 +205,13 @@ type SchemaCreateBulkNotificationInput = Omit<CreateBulkNotificationInput, "user
|
|
|
205
205
|
type SchemaNotificationType = Omit<NotificationType, "userId"> & {
|
|
206
206
|
userId: ObjectId;
|
|
207
207
|
};
|
|
208
|
+
declare const NotificationModel: mongoose.Model<SchemaNotificationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaNotificationType, {}, {}> & Omit<NotificationType, "userId"> & {
|
|
209
|
+
userId: ObjectId;
|
|
210
|
+
} & Required<{
|
|
211
|
+
_id: string;
|
|
212
|
+
}> & {
|
|
213
|
+
__v: number;
|
|
214
|
+
}, any>;
|
|
208
215
|
|
|
209
216
|
interface NotificationDataType {
|
|
210
217
|
resourceId: string;
|
|
@@ -259,6 +266,18 @@ declare const ParticipantSchema: mongoose.Schema<SchemaParticipantType, mongoose
|
|
|
259
266
|
} & {
|
|
260
267
|
__v: number;
|
|
261
268
|
}>;
|
|
269
|
+
declare const ChatModel: mongoose.Model<SchemaChatType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaChatType, {}, {}> & Omit<ChatType, "messages" | "participants" | "resourceInfo"> & {
|
|
270
|
+
participants: SchemaParticipantType[];
|
|
271
|
+
messages: SchemaChatMessageType[];
|
|
272
|
+
resourceInfo: {
|
|
273
|
+
eventId: ObjectId;
|
|
274
|
+
vendorId: ObjectId;
|
|
275
|
+
} | null;
|
|
276
|
+
} & Required<{
|
|
277
|
+
_id: string;
|
|
278
|
+
}> & {
|
|
279
|
+
__v: number;
|
|
280
|
+
}, any>;
|
|
262
281
|
|
|
263
282
|
type Nullable<T> = {
|
|
264
283
|
[K in keyof T]: T[K] | null | undefined;
|
|
@@ -455,4 +474,4 @@ interface GraphQLContext {
|
|
|
455
474
|
response: Response;
|
|
456
475
|
}
|
|
457
476
|
|
|
458
|
-
export { type
|
|
477
|
+
export { type MapMultiLocation as $, ChatModel as A, type BaseResourceTypeFormData as B, type Category as C, type DeviceInfo as D, type EventType as E, type FormField as F, type SchemaCreateBulkNotificationInput as G, type SchemaNotificationType as H, NotificationModel as I, type GraphQLContext as J, type NotificationDataType as K, type LocationType as L, type ParticipantType as M, type NotificationType as N, type OptionItem as O, type PartnerType as P, type ChatMessageInput as Q, type Requirement as R, type StallType as S, type TermsAgreement as T, type ChatMessageType as U, type VendorType as V, type Nullable as W, type BaseResourceType as X, type DateTimeType as Y, type Region as Z, type GeocodeLocation as _, type FormDateField as a, type SubcategoryItems as a0, type Subcategory as a1, type ImageObjectType as a2, type CreateFormData as a3, EnumPubSubEvents as a4, type AuthUser as a5, type SubscriptionPayload as a6, type DateTimeWithPriceType as a7, type PaymentInfoType as a8, type CreateBulkNotificationInput as a9, type VendorLocation as aa, type VendorMenuType as ab, type VendorAttributes as ac, type ChatType as b, type EventInfoType as c, type NotificationCount as d, type RelationType as e, type ResourceConnectionsType as f, type VendorInfoType as g, type VendorFormData as h, type CreateVendorFormData as i, type VendorInfoFormData as j, type CreateVendorInfoFormData as k, type EventFormData as l, type CreateEventFormData as m, type EventInfoFormData as n, type CreateEventInfoFormData as o, type OwnerType as p, type ObjectId as q, type SocialMediaType as r, type ResourceImageType as s, type ResourceContactDetailsType as t, type PosterUsageType as u, type RelationDate as v, type SchemaChatMessageType as w, type SchemaParticipantType as x, type SchemaChatType as y, ParticipantSchema as z };
|
|
@@ -205,6 +205,13 @@ type SchemaCreateBulkNotificationInput = Omit<CreateBulkNotificationInput, "user
|
|
|
205
205
|
type SchemaNotificationType = Omit<NotificationType, "userId"> & {
|
|
206
206
|
userId: ObjectId;
|
|
207
207
|
};
|
|
208
|
+
declare const NotificationModel: mongoose.Model<SchemaNotificationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaNotificationType, {}, {}> & Omit<NotificationType, "userId"> & {
|
|
209
|
+
userId: ObjectId;
|
|
210
|
+
} & Required<{
|
|
211
|
+
_id: string;
|
|
212
|
+
}> & {
|
|
213
|
+
__v: number;
|
|
214
|
+
}, any>;
|
|
208
215
|
|
|
209
216
|
interface NotificationDataType {
|
|
210
217
|
resourceId: string;
|
|
@@ -259,6 +266,18 @@ declare const ParticipantSchema: mongoose.Schema<SchemaParticipantType, mongoose
|
|
|
259
266
|
} & {
|
|
260
267
|
__v: number;
|
|
261
268
|
}>;
|
|
269
|
+
declare const ChatModel: mongoose.Model<SchemaChatType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaChatType, {}, {}> & Omit<ChatType, "messages" | "participants" | "resourceInfo"> & {
|
|
270
|
+
participants: SchemaParticipantType[];
|
|
271
|
+
messages: SchemaChatMessageType[];
|
|
272
|
+
resourceInfo: {
|
|
273
|
+
eventId: ObjectId;
|
|
274
|
+
vendorId: ObjectId;
|
|
275
|
+
} | null;
|
|
276
|
+
} & Required<{
|
|
277
|
+
_id: string;
|
|
278
|
+
}> & {
|
|
279
|
+
__v: number;
|
|
280
|
+
}, any>;
|
|
262
281
|
|
|
263
282
|
type Nullable<T> = {
|
|
264
283
|
[K in keyof T]: T[K] | null | undefined;
|
|
@@ -455,4 +474,4 @@ interface GraphQLContext {
|
|
|
455
474
|
response: Response;
|
|
456
475
|
}
|
|
457
476
|
|
|
458
|
-
export { type
|
|
477
|
+
export { type MapMultiLocation as $, ChatModel as A, type BaseResourceTypeFormData as B, type Category as C, type DeviceInfo as D, type EventType as E, type FormField as F, type SchemaCreateBulkNotificationInput as G, type SchemaNotificationType as H, NotificationModel as I, type GraphQLContext as J, type NotificationDataType as K, type LocationType as L, type ParticipantType as M, type NotificationType as N, type OptionItem as O, type PartnerType as P, type ChatMessageInput as Q, type Requirement as R, type StallType as S, type TermsAgreement as T, type ChatMessageType as U, type VendorType as V, type Nullable as W, type BaseResourceType as X, type DateTimeType as Y, type Region as Z, type GeocodeLocation as _, type FormDateField as a, type SubcategoryItems as a0, type Subcategory as a1, type ImageObjectType as a2, type CreateFormData as a3, EnumPubSubEvents as a4, type AuthUser as a5, type SubscriptionPayload as a6, type DateTimeWithPriceType as a7, type PaymentInfoType as a8, type CreateBulkNotificationInput as a9, type VendorLocation as aa, type VendorMenuType as ab, type VendorAttributes as ac, type ChatType as b, type EventInfoType as c, type NotificationCount as d, type RelationType as e, type ResourceConnectionsType as f, type VendorInfoType as g, type VendorFormData as h, type CreateVendorFormData as i, type VendorInfoFormData as j, type CreateVendorInfoFormData as k, type EventFormData as l, type CreateEventFormData as m, type EventInfoFormData as n, type CreateEventInfoFormData as o, type OwnerType as p, type ObjectId as q, type SocialMediaType as r, type ResourceImageType as s, type ResourceContactDetailsType as t, type PosterUsageType as u, type RelationDate as v, type SchemaChatMessageType as w, type SchemaParticipantType as x, type SchemaChatType as y, ParticipantSchema as z };
|
package/dist/graphql/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
|
-
import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-
|
|
2
|
+
import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-_ZHkOcnR.mjs';
|
|
3
3
|
import { EnumResourceType } from '../enums/index.mjs';
|
|
4
|
-
import { T as TesterType, A as AdType, E as EnumAdStatus } from '../ad-
|
|
5
|
-
import { U as UserType } from '../user-OPY5EOqR.mjs';
|
|
4
|
+
import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-CTWMmc7b.mjs';
|
|
6
5
|
import { R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
|
|
7
6
|
import 'mongoose';
|
|
8
7
|
import 'react-hook-form';
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as _apollo_client from '@apollo/client';
|
|
2
|
-
import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-
|
|
2
|
+
import { b as ChatType, E as EventType, c as EventInfoType, N as NotificationType, d as NotificationCount, e as RelationType, f as ResourceConnectionsType, V as VendorType, g as VendorInfoType } from '../global-4lS-fh61.js';
|
|
3
3
|
import { EnumResourceType } from '../enums/index.js';
|
|
4
|
-
import { T as TesterType, A as AdType, E as EnumAdStatus } from '../ad-
|
|
5
|
-
import { U as UserType } from '../user-DbEEY7fv.js';
|
|
4
|
+
import { T as TesterType, U as UserType, A as AdType, E as EnumAdStatus } from '../ad-C02AZIGy.js';
|
|
6
5
|
import { R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
|
|
7
6
|
import 'mongoose';
|
|
8
7
|
import 'react-hook-form';
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-
|
|
2
|
-
import { a as UserFormData, C as CreateUserFormData } from '../
|
|
3
|
-
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-
|
|
4
|
-
import { a as TestersFormData, C as CreateTestersFormData, b as AdFormData, c as CreateAdFormData } from '../ad-Crq-z5Wt.mjs';
|
|
1
|
+
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-_ZHkOcnR.mjs';
|
|
2
|
+
import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-CTWMmc7b.mjs';
|
|
3
|
+
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-YsJJnj12.mjs';
|
|
5
4
|
import 'mongoose';
|
|
6
5
|
import 'react-hook-form';
|
|
7
6
|
import '../enums/index.mjs';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-
|
|
2
|
-
import { a as UserFormData, C as CreateUserFormData } from '../
|
|
3
|
-
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-
|
|
4
|
-
import { a as TestersFormData, C as CreateTestersFormData, b as AdFormData, c as CreateAdFormData } from '../ad-DHetF-th.js';
|
|
1
|
+
import { L as LocationType, h as VendorFormData, i as CreateVendorFormData, j as VendorInfoFormData, k as CreateVendorInfoFormData, l as EventFormData, m as CreateEventFormData, n as EventInfoFormData, o as CreateEventInfoFormData, B as BaseResourceTypeFormData } from '../global-4lS-fh61.js';
|
|
2
|
+
import { a as UserFormData, C as CreateUserFormData, b as TestersFormData, c as CreateTestersFormData, d as AdFormData, e as CreateAdFormData } from '../ad-C02AZIGy.js';
|
|
3
|
+
import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-o_ns6gLk.js';
|
|
5
4
|
import 'mongoose';
|
|
6
5
|
import 'react-hook-form';
|
|
7
6
|
import '../enums/index.js';
|
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,9 @@ 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,
|
|
33
34
|
CategorySchema: () => CategorySchema,
|
|
35
|
+
ChatModel: () => ChatModel,
|
|
34
36
|
EnumActivity: () => EnumActivity,
|
|
35
37
|
EnumAdShowOn: () => EnumAdShowOn,
|
|
36
38
|
EnumAdStatus: () => EnumAdStatus,
|
|
@@ -52,9 +54,15 @@ __export(index_exports, {
|
|
|
52
54
|
EnumUserLicence: () => EnumUserLicence,
|
|
53
55
|
EnumUserRole: () => EnumUserRole,
|
|
54
56
|
EnumVendorType: () => EnumVendorType,
|
|
57
|
+
EventInfoModel: () => EventInfoModel,
|
|
58
|
+
EventModel: () => EventModel,
|
|
55
59
|
ImageTypeEnum: () => ImageTypeEnum,
|
|
60
|
+
NotificationModel: () => NotificationModel,
|
|
56
61
|
ParticipantSchema: () => ParticipantSchema,
|
|
62
|
+
PushTokenModel: () => PushTokenModel,
|
|
63
|
+
RelationModel: () => RelationModel,
|
|
57
64
|
RelationTypeSchema: () => RelationTypeSchema,
|
|
65
|
+
ResourceActivityModel: () => ResourceActivityModel,
|
|
58
66
|
ResourceImageTypeSchema: () => ResourceImageTypeSchema,
|
|
59
67
|
SAVED_EMAIL_KEY: () => SAVED_EMAIL_KEY,
|
|
60
68
|
SAVED_PASSWORD_KEY: () => SAVED_PASSWORD_KEY,
|
|
@@ -62,7 +70,12 @@ __export(index_exports, {
|
|
|
62
70
|
SAVED_TOKEN_KEY: () => SAVED_TOKEN_KEY,
|
|
63
71
|
SocialMediaTypeSchema: () => SocialMediaTypeSchema,
|
|
64
72
|
StallTypeSchema: () => StallTypeSchema,
|
|
73
|
+
TesterModel: () => TesterModel,
|
|
65
74
|
USER_STORAGE_KEY: () => USER_STORAGE_KEY,
|
|
75
|
+
UserModel: () => UserModel,
|
|
76
|
+
VendorInfoModel: () => VendorInfoModel,
|
|
77
|
+
VendorModel: () => VendorModel,
|
|
78
|
+
VerificationTokenModel: () => VerificationTokenModel,
|
|
66
79
|
availableCategories: () => availableCategories,
|
|
67
80
|
availableCityOptions: () => availableCityOptions,
|
|
68
81
|
availableRegionOptions: () => availableRegionOptions,
|
|
@@ -6278,7 +6291,10 @@ var schema = new MongooseSchema(
|
|
|
6278
6291
|
},
|
|
6279
6292
|
{ timestamps: true }
|
|
6280
6293
|
);
|
|
6281
|
-
var EventInfoModel = import_mongoose.default.model(
|
|
6294
|
+
var EventInfoModel = import_mongoose.default.model(
|
|
6295
|
+
"EventInfo",
|
|
6296
|
+
schema
|
|
6297
|
+
);
|
|
6282
6298
|
|
|
6283
6299
|
// src/mongoose/Relation.ts
|
|
6284
6300
|
var MongooseSchema2 = import_mongoose2.default.Schema;
|
|
@@ -6655,7 +6671,6 @@ var NotificationModel = import_mongoose6.default.model(
|
|
|
6655
6671
|
"Notification",
|
|
6656
6672
|
schema3
|
|
6657
6673
|
);
|
|
6658
|
-
var Notification_default = NotificationModel;
|
|
6659
6674
|
|
|
6660
6675
|
// src/mongoose/PushToken.ts
|
|
6661
6676
|
var import_mongoose7 = __toESM(require("mongoose"));
|
|
@@ -6673,7 +6688,6 @@ var schema4 = new MongooseSchema7(
|
|
|
6673
6688
|
{ timestamps: true }
|
|
6674
6689
|
);
|
|
6675
6690
|
var PushTokenModel = import_mongoose7.default.model("PushToken", schema4);
|
|
6676
|
-
var PushToken_default = PushTokenModel;
|
|
6677
6691
|
|
|
6678
6692
|
// src/mongoose/ResourceActivity.ts
|
|
6679
6693
|
var import_mongoose8 = __toESM(require("mongoose"));
|
|
@@ -7119,12 +7133,12 @@ var connectToDatabase = async () => {
|
|
|
7119
7133
|
// src/service/notificationService.ts
|
|
7120
7134
|
async function publishNotificationEvents(userId, context) {
|
|
7121
7135
|
try {
|
|
7122
|
-
const userNotifications = await
|
|
7136
|
+
const userNotifications = await NotificationModel.find({
|
|
7123
7137
|
userId
|
|
7124
7138
|
}).sort({ createdAt: -1 });
|
|
7125
7139
|
const [total, unread] = await Promise.all([
|
|
7126
|
-
|
|
7127
|
-
|
|
7140
|
+
NotificationModel.countDocuments({ userId }),
|
|
7141
|
+
NotificationModel.countDocuments({ isRead: false, userId })
|
|
7128
7142
|
]);
|
|
7129
7143
|
context.pubsub.publish("GET_NOTIFICATIONS" /* GET_NOTIFICATIONS */, {
|
|
7130
7144
|
getNotifications: userNotifications,
|
|
@@ -7152,7 +7166,7 @@ async function createNotifications(payload, context) {
|
|
|
7152
7166
|
type,
|
|
7153
7167
|
userId
|
|
7154
7168
|
}));
|
|
7155
|
-
const savedNotifications = await
|
|
7169
|
+
const savedNotifications = await NotificationModel.insertMany(notifications);
|
|
7156
7170
|
console.log(
|
|
7157
7171
|
`Created ${savedNotifications.length} notifications for ${userIds.length} users`
|
|
7158
7172
|
);
|
|
@@ -7241,7 +7255,7 @@ async function sendPushNotification({
|
|
|
7241
7255
|
title,
|
|
7242
7256
|
userIds
|
|
7243
7257
|
}) {
|
|
7244
|
-
const pushTokens = await
|
|
7258
|
+
const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });
|
|
7245
7259
|
const expoTokens = pushTokens.map((token) => token.token);
|
|
7246
7260
|
const { messages, invalidTokens } = createPushMessages({
|
|
7247
7261
|
data,
|
|
@@ -7321,7 +7335,9 @@ var fonts = {
|
|
|
7321
7335
|
};
|
|
7322
7336
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7323
7337
|
0 && (module.exports = {
|
|
7338
|
+
AdModel,
|
|
7324
7339
|
CategorySchema,
|
|
7340
|
+
ChatModel,
|
|
7325
7341
|
EnumActivity,
|
|
7326
7342
|
EnumAdShowOn,
|
|
7327
7343
|
EnumAdStatus,
|
|
@@ -7343,9 +7359,15 @@ var fonts = {
|
|
|
7343
7359
|
EnumUserLicence,
|
|
7344
7360
|
EnumUserRole,
|
|
7345
7361
|
EnumVendorType,
|
|
7362
|
+
EventInfoModel,
|
|
7363
|
+
EventModel,
|
|
7346
7364
|
ImageTypeEnum,
|
|
7365
|
+
NotificationModel,
|
|
7347
7366
|
ParticipantSchema,
|
|
7367
|
+
PushTokenModel,
|
|
7368
|
+
RelationModel,
|
|
7348
7369
|
RelationTypeSchema,
|
|
7370
|
+
ResourceActivityModel,
|
|
7349
7371
|
ResourceImageTypeSchema,
|
|
7350
7372
|
SAVED_EMAIL_KEY,
|
|
7351
7373
|
SAVED_PASSWORD_KEY,
|
|
@@ -7353,7 +7375,12 @@ var fonts = {
|
|
|
7353
7375
|
SAVED_TOKEN_KEY,
|
|
7354
7376
|
SocialMediaTypeSchema,
|
|
7355
7377
|
StallTypeSchema,
|
|
7378
|
+
TesterModel,
|
|
7356
7379
|
USER_STORAGE_KEY,
|
|
7380
|
+
UserModel,
|
|
7381
|
+
VendorInfoModel,
|
|
7382
|
+
VendorModel,
|
|
7383
|
+
VerificationTokenModel,
|
|
7357
7384
|
availableCategories,
|
|
7358
7385
|
availableCityOptions,
|
|
7359
7386
|
availableRegionOptions,
|