@messenger-box/platform-server 10.0.3-alpha.50 → 10.0.3-alpha.54
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/lib/containers/containers.js.map +1 -1
- package/lib/graphql/resolvers/channel-member.d.ts +2 -1
- package/lib/graphql/resolvers/channel-member.js +13 -3
- package/lib/graphql/resolvers/channel-member.js.map +1 -1
- package/lib/graphql/resolvers/channel.d.ts +2 -1
- package/lib/graphql/resolvers/channel.js +260 -126
- package/lib/graphql/resolvers/channel.js.map +1 -1
- package/lib/graphql/resolvers/extended-token-account.d.ts +2 -1
- package/lib/graphql/resolvers/extended-token-account.js +90 -23
- package/lib/graphql/resolvers/extended-token-account.js.map +1 -1
- package/lib/graphql/resolvers/post-thread.js +285 -179
- package/lib/graphql/resolvers/post-thread.js.map +1 -1
- package/lib/graphql/resolvers/post.js +669 -242
- package/lib/graphql/resolvers/post.js.map +1 -1
- package/lib/graphql/resolvers/reaction.d.ts +2 -1
- package/lib/graphql/resolvers/reaction.js +96 -14
- package/lib/graphql/resolvers/reaction.js.map +1 -1
- package/lib/graphql/schema/channel.graphql +331 -39
- package/lib/graphql/schema/channel.graphql.js +1 -1
- package/lib/graphql/schema/post-thread.graphql +157 -21
- package/lib/graphql/schema/post-thread.graphql.js +1 -1
- package/lib/graphql/schema/post.graphql +265 -40
- package/lib/graphql/schema/post.graphql.js +1 -1
- package/lib/graphql/schema/reaction.graphql +71 -13
- package/lib/graphql/schema/reaction.graphql.js +1 -1
- package/lib/graphql/schema/users.graphql +76 -13
- package/lib/graphql/schema/users.graphql.js +1 -1
- package/lib/plugins/channel-moleculer-service.d.ts +21 -1
- package/lib/plugins/channel-moleculer-service.js +417 -115
- package/lib/plugins/channel-moleculer-service.js.map +1 -1
- package/lib/plugins/extended-token-account-moleculer-service.d.ts +25 -1
- package/lib/plugins/extended-token-account-moleculer-service.js +348 -22
- package/lib/plugins/extended-token-account-moleculer-service.js.map +1 -1
- package/lib/plugins/messenger-notification-moleculer-service.d.ts +26 -3
- package/lib/plugins/messenger-notification-moleculer-service.js +403 -57
- package/lib/plugins/messenger-notification-moleculer-service.js.map +1 -1
- package/lib/plugins/post-moleculer-service.d.ts +84 -20
- package/lib/plugins/post-moleculer-service.js +891 -259
- package/lib/plugins/post-moleculer-service.js.map +1 -1
- package/lib/plugins/post-thread-moleculer-service.d.ts +33 -1
- package/lib/plugins/post-thread-moleculer-service.js +320 -13
- package/lib/plugins/post-thread-moleculer-service.js.map +1 -1
- package/lib/services/channel-service.d.ts +185 -33
- package/lib/services/channel-service.js +767 -282
- package/lib/services/channel-service.js.map +1 -1
- package/lib/services/extended-token-account-service.d.ts +127 -14
- package/lib/services/extended-token-account-service.js +459 -52
- package/lib/services/extended-token-account-service.js.map +1 -1
- package/lib/services/messenger-notification-service.d.ts +106 -13
- package/lib/services/messenger-notification-service.js +824 -442
- package/lib/services/messenger-notification-service.js.map +1 -1
- package/lib/services/post-service.d.ts +176 -16
- package/lib/services/post-service.js +553 -119
- package/lib/services/post-service.js.map +1 -1
- package/lib/services/post-thread-service.d.ts +114 -6
- package/lib/services/post-thread-service.js +397 -18
- package/lib/services/post-thread-service.js.map +1 -1
- package/lib/services/proxy-services/channel-microservice.d.ts +4 -3
- package/lib/services/proxy-services/channel-microservice.js +12 -9
- package/lib/services/proxy-services/channel-microservice.js.map +1 -1
- package/lib/services/proxy-services/messenger-notification-microservice.d.ts +128 -8
- package/lib/services/proxy-services/messenger-notification-microservice.js +324 -29
- package/lib/services/proxy-services/messenger-notification-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-microservice.d.ts +186 -13
- package/lib/services/proxy-services/post-microservice.js +543 -59
- package/lib/services/proxy-services/post-microservice.js.map +1 -1
- package/lib/services/proxy-services/post-thread-microservice.d.ts +134 -4
- package/lib/services/proxy-services/post-thread-microservice.js +387 -10
- package/lib/services/proxy-services/post-thread-microservice.js.map +1 -1
- package/lib/services/proxy-services/reaction-microservice.d.ts +161 -3
- package/lib/services/proxy-services/reaction-microservice.js +474 -2
- package/lib/services/proxy-services/reaction-microservice.js.map +1 -1
- package/lib/services/reaction-service.d.ts +124 -4
- package/lib/services/reaction-service.js +415 -3
- package/lib/services/reaction-service.js.map +1 -1
- package/lib/store/models/channel.d.ts +2 -3
- package/lib/store/models/channel.js +169 -71
- package/lib/store/models/channel.js.map +1 -1
- package/lib/store/models/post-thread.d.ts +3 -3
- package/lib/store/models/post-thread.js +96 -14
- package/lib/store/models/post-thread.js.map +1 -1
- package/lib/store/models/post.d.ts +2 -3
- package/lib/store/models/post.js +85 -18
- package/lib/store/models/post.js.map +1 -1
- package/lib/store/models/reaction.d.ts +2 -3
- package/lib/store/models/reaction.js +67 -8
- package/lib/store/models/reaction.js.map +1 -1
- package/lib/store/repositories/channel-repository.d.ts +6 -6
- package/lib/store/repositories/channel-repository.js +5 -2
- package/lib/store/repositories/channel-repository.js.map +1 -1
- package/lib/store/repositories/post-repository.d.ts +6 -6
- package/lib/store/repositories/post-repository.js +5 -2
- package/lib/store/repositories/post-repository.js.map +1 -1
- package/lib/store/repositories/post-thread-repository.d.ts +6 -6
- package/lib/store/repositories/post-thread-repository.js +5 -2
- package/lib/store/repositories/post-thread-repository.js.map +1 -1
- package/lib/store/repositories/reaction-repository.d.ts +6 -6
- package/lib/store/repositories/reaction-repository.js +5 -2
- package/lib/store/repositories/reaction-repository.js.map +1 -1
- package/lib/templates/repositories/ChannelRepository.ts.template +3 -3
- package/lib/templates/repositories/PostRepository.ts.template +3 -3
- package/lib/templates/repositories/PostThreadRepository.ts.template +3 -3
- package/lib/templates/repositories/ReactionRepository.ts.template +3 -4
- package/lib/templates/services/ChannelService.ts.template +277 -38
- package/lib/templates/services/ExtendedTokenAccountService.ts.template +93 -8
- package/lib/templates/services/PostService.ts.template +182 -20
- package/lib/templates/services/PostThreadService.ts.template +100 -5
- package/lib/templates/services/ReactionService.ts.template +129 -2
- package/package.json +3 -3
- package/lib/store/models/common-options.js +0 -20
- package/lib/store/models/common-options.js.map +0 -1
|
@@ -1,38 +1,48 @@
|
|
|
1
|
-
import {Schema}from'mongoose';import {RoomType}from'common/server';
|
|
1
|
+
import {Schema}from'mongoose';import {DB_COLL_NAMES,RoomType}from'common/server';const ChannelSchema = new Schema({
|
|
2
2
|
type: {
|
|
3
3
|
type: Schema.Types.String,
|
|
4
|
-
enum:
|
|
5
|
-
required: true
|
|
4
|
+
enum: Object.values(RoomType),
|
|
5
|
+
required: true,
|
|
6
|
+
index: true
|
|
6
7
|
},
|
|
7
8
|
orgName: {
|
|
8
9
|
type: Schema.Types.String,
|
|
9
10
|
required: function () {
|
|
10
11
|
return ![RoomType.Direct, RoomType.Public, RoomType.Service].includes(this.type);
|
|
11
|
-
}
|
|
12
|
+
},
|
|
13
|
+
index: true
|
|
12
14
|
},
|
|
13
15
|
members: {
|
|
14
|
-
type: [
|
|
16
|
+
type: [{
|
|
15
17
|
user: {
|
|
16
18
|
type: Schema.Types.ObjectId,
|
|
17
|
-
ref:
|
|
19
|
+
ref: DB_COLL_NAMES.Accounts,
|
|
20
|
+
required: true,
|
|
21
|
+
index: true
|
|
18
22
|
},
|
|
19
23
|
roles: {
|
|
20
|
-
type: Schema.Types.String
|
|
24
|
+
type: Schema.Types.String,
|
|
25
|
+
default: 'member'
|
|
21
26
|
},
|
|
22
27
|
msgCount: {
|
|
23
|
-
type: Schema.Types.Number
|
|
28
|
+
type: Schema.Types.Number,
|
|
29
|
+
default: 0
|
|
24
30
|
},
|
|
25
31
|
mentionCount: {
|
|
26
|
-
type: Schema.Types.Number
|
|
32
|
+
type: Schema.Types.Number,
|
|
33
|
+
default: 0
|
|
27
34
|
},
|
|
28
35
|
mentionCountRoot: {
|
|
29
|
-
type: Schema.Types.Number
|
|
36
|
+
type: Schema.Types.Number,
|
|
37
|
+
default: 0
|
|
30
38
|
},
|
|
31
39
|
msgCountRoot: {
|
|
32
|
-
type: Schema.Types.Number
|
|
40
|
+
type: Schema.Types.Number,
|
|
41
|
+
default: 0
|
|
33
42
|
},
|
|
34
43
|
notifyProps: {
|
|
35
|
-
type: Schema.Types.Mixed
|
|
44
|
+
type: Schema.Types.Mixed,
|
|
45
|
+
default: {}
|
|
36
46
|
},
|
|
37
47
|
explicitRoles: {
|
|
38
48
|
type: Schema.Types.String
|
|
@@ -41,16 +51,25 @@ import {Schema}from'mongoose';import {RoomType}from'common/server';import {commo
|
|
|
41
51
|
type: Schema.Types.String
|
|
42
52
|
},
|
|
43
53
|
lastViewedAt: {
|
|
44
|
-
type: Schema.Types.Date
|
|
54
|
+
type: Schema.Types.Date,
|
|
55
|
+
default: Date.now
|
|
56
|
+
},
|
|
57
|
+
createdAt: {
|
|
58
|
+
type: Schema.Types.Date,
|
|
59
|
+
default: Date.now
|
|
60
|
+
},
|
|
61
|
+
updatedAt: {
|
|
62
|
+
type: Schema.Types.Date,
|
|
63
|
+
default: Date.now
|
|
45
64
|
},
|
|
46
65
|
deletedAt: {
|
|
47
66
|
type: Schema.Types.Date
|
|
48
67
|
}
|
|
49
|
-
}
|
|
68
|
+
}],
|
|
50
69
|
required: true,
|
|
51
70
|
validate: {
|
|
52
|
-
message: 'Channel
|
|
53
|
-
validator: async function (members
|
|
71
|
+
message: 'Channel validation failed',
|
|
72
|
+
validator: async function (members) {
|
|
54
73
|
// Extract the IDs of the users in the members array
|
|
55
74
|
const userIds = members.map(member => member.user.toString());
|
|
56
75
|
// Check if there are any duplicate user IDs
|
|
@@ -58,76 +77,155 @@ import {Schema}from'mongoose';import {RoomType}from'common/server';import {commo
|
|
|
58
77
|
if (uniqueUserIds.length !== userIds.length) {
|
|
59
78
|
return false;
|
|
60
79
|
}
|
|
61
|
-
|
|
80
|
+
// For non-direct channels, allow any number of members
|
|
81
|
+
if (this.type !== RoomType.Direct) {
|
|
62
82
|
return true;
|
|
63
83
|
}
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const filter = {
|
|
68
|
-
type: RoomType.Direct,
|
|
69
|
-
orgName: orgName,
|
|
70
|
-
'members.user': {
|
|
71
|
-
$all: members.map(m => m.user)
|
|
72
|
-
},
|
|
73
|
-
members: {
|
|
74
|
-
$size: 1
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
const directChannels = await this.constructor.findOne(filter);
|
|
78
|
-
if (directChannels && Object.keys(directChannels).length > 0) return false;
|
|
79
|
-
} else {
|
|
80
|
-
const filter = {
|
|
81
|
-
type: RoomType.Direct,
|
|
82
|
-
orgName: orgName,
|
|
83
|
-
'members.user': {
|
|
84
|
-
$all: members.map(m => m.user)
|
|
85
|
-
},
|
|
86
|
-
members: {
|
|
87
|
-
$size: 2
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const directChannels = await this.constructor.findOne(filter);
|
|
91
|
-
return !directChannels;
|
|
84
|
+
// Direct channel validation
|
|
85
|
+
if (members?.length > 2) {
|
|
86
|
+
return false; // Direct channels can't have more than 2 members
|
|
92
87
|
}
|
|
88
|
+
const orgName = this.orgName;
|
|
89
|
+
const expectedSize = members.length;
|
|
90
|
+
// Check if a direct channel with the same members already exists
|
|
91
|
+
const filter = {
|
|
92
|
+
type: RoomType.Direct,
|
|
93
|
+
orgName: orgName,
|
|
94
|
+
'members.user': {
|
|
95
|
+
$all: members.map(m => m.user)
|
|
96
|
+
},
|
|
97
|
+
members: {
|
|
98
|
+
$size: expectedSize
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const ChannelModel = this.constructor;
|
|
102
|
+
const existingChannel = await ChannelModel.findOne(filter);
|
|
103
|
+
return !existingChannel;
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
},
|
|
96
|
-
deletedAt: {
|
|
97
|
-
type: Schema.Types.Date
|
|
98
|
-
},
|
|
99
|
-
lastPostAt: {
|
|
100
|
-
type: Schema.Types.Date
|
|
101
|
-
},
|
|
102
|
-
totalMsgCount: {
|
|
103
|
-
type: Schema.Types.Number
|
|
104
|
-
},
|
|
105
|
-
totalMsgCountRoot: {
|
|
106
|
-
type: Schema.Types.Number
|
|
107
|
-
},
|
|
108
107
|
team: {
|
|
109
108
|
type: Schema.Types.ObjectId,
|
|
110
|
-
ref:
|
|
109
|
+
ref: DB_COLL_NAMES.Teams,
|
|
110
|
+
index: true
|
|
111
|
+
},
|
|
112
|
+
creator: {
|
|
113
|
+
type: Schema.Types.ObjectId,
|
|
114
|
+
ref: DB_COLL_NAMES.Accounts,
|
|
115
|
+
required: true,
|
|
116
|
+
index: true
|
|
111
117
|
},
|
|
112
118
|
title: {
|
|
113
|
-
type: Schema.Types.String
|
|
119
|
+
type: Schema.Types.String,
|
|
120
|
+
trim: true,
|
|
121
|
+
index: true
|
|
114
122
|
},
|
|
115
123
|
displayName: {
|
|
116
|
-
type: Schema.Types.String
|
|
124
|
+
type: Schema.Types.String,
|
|
125
|
+
trim: true,
|
|
126
|
+
index: true
|
|
117
127
|
},
|
|
118
128
|
description: {
|
|
119
|
-
type: Schema.Types.String
|
|
120
|
-
|
|
121
|
-
props: {
|
|
122
|
-
type: Schema.Types.Mixed
|
|
129
|
+
type: Schema.Types.String,
|
|
130
|
+
trim: true
|
|
123
131
|
},
|
|
124
132
|
purpose: {
|
|
125
|
-
type: Schema.Types.String
|
|
133
|
+
type: Schema.Types.String,
|
|
134
|
+
trim: true
|
|
126
135
|
},
|
|
127
|
-
|
|
128
|
-
type: Schema.Types.
|
|
129
|
-
|
|
136
|
+
topic: {
|
|
137
|
+
type: Schema.Types.String,
|
|
138
|
+
trim: true
|
|
139
|
+
},
|
|
140
|
+
lastPostAt: {
|
|
141
|
+
type: Schema.Types.Date,
|
|
142
|
+
index: true
|
|
143
|
+
},
|
|
144
|
+
totalMsgCount: {
|
|
145
|
+
type: Schema.Types.Number,
|
|
146
|
+
default: 0,
|
|
147
|
+
min: 0
|
|
148
|
+
},
|
|
149
|
+
totalMsgCountRoot: {
|
|
150
|
+
type: Schema.Types.Number,
|
|
151
|
+
default: 0,
|
|
152
|
+
min: 0
|
|
153
|
+
},
|
|
154
|
+
createdAt: {
|
|
155
|
+
type: Schema.Types.Date,
|
|
156
|
+
default: Date.now,
|
|
157
|
+
index: true
|
|
158
|
+
},
|
|
159
|
+
updatedAt: {
|
|
160
|
+
type: Schema.Types.Date,
|
|
161
|
+
default: Date.now
|
|
162
|
+
},
|
|
163
|
+
deletedAt: {
|
|
164
|
+
type: Schema.Types.Date,
|
|
165
|
+
index: true
|
|
166
|
+
}
|
|
167
|
+
}, {
|
|
168
|
+
timestamps: true,
|
|
169
|
+
collection: 'channels',
|
|
170
|
+
toJSON: {
|
|
171
|
+
virtuals: true
|
|
172
|
+
},
|
|
173
|
+
toObject: {
|
|
174
|
+
virtuals: true
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
// Virtual fields
|
|
178
|
+
ChannelSchema.virtual('id').get(function () {
|
|
179
|
+
return this._id.toHexString();
|
|
180
|
+
});
|
|
181
|
+
// Add compound indexes for better query performance
|
|
182
|
+
ChannelSchema.index({
|
|
183
|
+
orgName: 1,
|
|
184
|
+
type: 1
|
|
185
|
+
});
|
|
186
|
+
ChannelSchema.index({
|
|
187
|
+
orgName: 1,
|
|
188
|
+
'members.user': 1
|
|
189
|
+
});
|
|
190
|
+
ChannelSchema.index({
|
|
191
|
+
type: 1,
|
|
192
|
+
deletedAt: 1
|
|
193
|
+
});
|
|
194
|
+
ChannelSchema.index({
|
|
195
|
+
team: 1,
|
|
196
|
+
type: 1
|
|
197
|
+
});
|
|
198
|
+
ChannelSchema.index({
|
|
199
|
+
creator: 1,
|
|
200
|
+
createdAt: -1
|
|
201
|
+
});
|
|
202
|
+
ChannelSchema.index({
|
|
203
|
+
lastPostAt: -1
|
|
204
|
+
});
|
|
205
|
+
// For direct channels, ensure uniqueness
|
|
206
|
+
ChannelSchema.index({
|
|
207
|
+
type: 1,
|
|
208
|
+
orgName: 1,
|
|
209
|
+
'members.user': 1
|
|
210
|
+
}, {
|
|
211
|
+
unique: true,
|
|
212
|
+
partialFilterExpression: {
|
|
213
|
+
type: RoomType.Direct,
|
|
214
|
+
deletedAt: {
|
|
215
|
+
$exists: false
|
|
216
|
+
}
|
|
130
217
|
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
218
|
+
});
|
|
219
|
+
// Pre-save middleware to update timestamps
|
|
220
|
+
ChannelSchema.pre('save', function (next) {
|
|
221
|
+
this.updatedAt = new Date();
|
|
222
|
+
next();
|
|
223
|
+
});
|
|
224
|
+
// Pre-update middleware
|
|
225
|
+
ChannelSchema.pre(['updateOne', 'findOneAndUpdate'], function (next) {
|
|
226
|
+
this.set({
|
|
227
|
+
updatedAt: new Date()
|
|
228
|
+
});
|
|
229
|
+
next();
|
|
230
|
+
});
|
|
231
|
+
const ChannelModelFunc = db => db.model('channels', ChannelSchema);export{ChannelModelFunc};//# sourceMappingURL=channel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sources":["../../../src/store/models/channel.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel.js","sources":["../../../src/store/models/channel.ts"],"sourcesContent":[null],"names":[],"mappings":"iFAGA,MAAM,aAAa,GAAG,IAAI,MAAM,CAC5B;AACI,EAAA,IAAA,EAAI;AACA,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,MAAY;AACzB,IAAA,IAAA,EAAA,MAAY,CAAA,MAAO,CAAA;AACnB,IAAA,QAAA,EAAA,IAAU;AACV,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,OAAA,EAAO;AACH,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,MAAY;AACzB,IAAA,QAAA,EAAA,YAAU;aACC,CAAA,CAAA,QAAU,CAAA,MAAC,UAAQ,CAAA,MAAS,EAAM,gBAAW,CAAA,CAAA,QAAS,CAAA,IAAA,CAAQ,IAAK,CAAA;;AAE9E,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,OAAA,EAAO;AACH,IAAA,IAAA,EAAA,CAAA;AAC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EAAA,MAAA,CAAA,KAAA,CAAA,IAAA;AAEH,IAAwB,OAAA,EAAA,IAAA,CAAA;AACxB,GAAa;WACD,EAAC;AACT,IAAA,IAAI,EAAE,MAAC,CAAA,KAAA,CAAA,IAAA;AACX,IAAG,KAAA,EAAA;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type IThreadsModel =
|
|
1
|
+
import { Model, Connection } from 'mongoose';
|
|
2
|
+
import { IPostThreadModel } from 'common/server';
|
|
3
|
+
export type IThreadsModel = IPostThreadModel;
|
|
4
4
|
export type PostThreadModelType = Model<IThreadsModel>;
|
|
5
5
|
export declare const PostThreadModelFunc: (db: Connection) => PostThreadModelType;
|
|
@@ -1,37 +1,119 @@
|
|
|
1
|
-
import {Schema}from'mongoose';import {
|
|
1
|
+
import {Schema}from'mongoose';import {DB_COLL_NAMES}from'common/server';const postThreadModelSchema = new Schema({
|
|
2
2
|
post: {
|
|
3
3
|
type: Schema.Types.ObjectId,
|
|
4
|
-
ref: 'posts'
|
|
4
|
+
ref: 'posts',
|
|
5
|
+
required: true,
|
|
6
|
+
index: true
|
|
5
7
|
},
|
|
6
8
|
channel: {
|
|
7
9
|
type: Schema.Types.ObjectId,
|
|
8
|
-
ref: 'channels'
|
|
10
|
+
ref: 'channels',
|
|
11
|
+
required: true,
|
|
12
|
+
index: true
|
|
9
13
|
},
|
|
10
14
|
replyCount: {
|
|
11
|
-
type: Schema.Types.Number
|
|
15
|
+
type: Schema.Types.Number,
|
|
16
|
+
default: 0,
|
|
17
|
+
min: 0
|
|
12
18
|
},
|
|
13
19
|
lastReplyAt: {
|
|
14
|
-
type: Schema.Types.Date
|
|
20
|
+
type: Schema.Types.Date,
|
|
21
|
+
index: true
|
|
15
22
|
},
|
|
16
23
|
participants: {
|
|
17
|
-
type: [
|
|
24
|
+
type: [{
|
|
18
25
|
user: {
|
|
19
26
|
type: Schema.Types.ObjectId,
|
|
20
|
-
ref:
|
|
27
|
+
ref: DB_COLL_NAMES.Accounts,
|
|
28
|
+
required: true,
|
|
29
|
+
index: true
|
|
21
30
|
},
|
|
22
31
|
roles: {
|
|
23
|
-
type: Schema.Types.String
|
|
32
|
+
type: Schema.Types.String,
|
|
33
|
+
default: 'participant'
|
|
24
34
|
},
|
|
25
35
|
orgName: {
|
|
26
|
-
type: Schema.Types.String
|
|
36
|
+
type: Schema.Types.String,
|
|
37
|
+
trim: true
|
|
38
|
+
},
|
|
39
|
+
createdAt: {
|
|
40
|
+
type: Schema.Types.Date,
|
|
41
|
+
default: Date.now
|
|
42
|
+
},
|
|
43
|
+
updatedAt: {
|
|
44
|
+
type: Schema.Types.Date,
|
|
45
|
+
default: Date.now
|
|
27
46
|
},
|
|
28
47
|
deletedAt: {
|
|
29
48
|
type: Schema.Types.Date
|
|
30
49
|
}
|
|
31
|
-
},
|
|
50
|
+
}],
|
|
51
|
+
validate: {
|
|
52
|
+
message: 'Participants validation failed',
|
|
53
|
+
validator: function (participants) {
|
|
54
|
+
// Extract the IDs of the users in the participants array
|
|
55
|
+
const userIds = participants.map(participant => participant.user.toString());
|
|
56
|
+
// Check if there are any duplicate user IDs
|
|
57
|
+
const uniqueUserIds = [...new Set(userIds)];
|
|
58
|
+
return uniqueUserIds.length === userIds.length;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
createdAt: {
|
|
63
|
+
type: Schema.Types.Date,
|
|
64
|
+
default: Date.now,
|
|
65
|
+
index: true
|
|
66
|
+
},
|
|
67
|
+
updatedAt: {
|
|
68
|
+
type: Schema.Types.Date,
|
|
69
|
+
default: Date.now
|
|
70
|
+
},
|
|
71
|
+
deletedAt: {
|
|
72
|
+
type: Schema.Types.Date,
|
|
73
|
+
index: true
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
timestamps: true,
|
|
77
|
+
collection: 'post-threads',
|
|
78
|
+
toJSON: {
|
|
79
|
+
virtuals: true
|
|
80
|
+
},
|
|
81
|
+
toObject: {
|
|
82
|
+
virtuals: true
|
|
32
83
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
84
|
+
});
|
|
85
|
+
// Virtual fields
|
|
86
|
+
postThreadModelSchema.virtual('id').get(function () {
|
|
87
|
+
return this._id.toHexString();
|
|
88
|
+
});
|
|
89
|
+
// Add compound indexes for better query performance
|
|
90
|
+
postThreadModelSchema.index({
|
|
91
|
+
post: 1,
|
|
92
|
+
channel: 1
|
|
93
|
+
});
|
|
94
|
+
postThreadModelSchema.index({
|
|
95
|
+
channel: 1,
|
|
96
|
+
lastReplyAt: -1
|
|
97
|
+
});
|
|
98
|
+
postThreadModelSchema.index({
|
|
99
|
+
'participants.user': 1
|
|
100
|
+
});
|
|
101
|
+
postThreadModelSchema.index({
|
|
102
|
+
createdAt: -1
|
|
103
|
+
});
|
|
104
|
+
postThreadModelSchema.index({
|
|
105
|
+
deletedAt: 1
|
|
106
|
+
});
|
|
107
|
+
// Pre-save middleware to update timestamps
|
|
108
|
+
postThreadModelSchema.pre('save', function (next) {
|
|
109
|
+
this.updatedAt = new Date();
|
|
110
|
+
next();
|
|
111
|
+
});
|
|
112
|
+
// Pre-update middleware
|
|
113
|
+
postThreadModelSchema.pre(['updateOne', 'findOneAndUpdate'], function (next) {
|
|
114
|
+
this.set({
|
|
115
|
+
updatedAt: new Date()
|
|
116
|
+
});
|
|
117
|
+
next();
|
|
118
|
+
});
|
|
37
119
|
const PostThreadModelFunc = db => db.model('post-threads', postThreadModelSchema);export{PostThreadModelFunc};//# sourceMappingURL=post-thread.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-thread.js","sources":["../../../src/store/models/post-thread.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post-thread.js","sources":["../../../src/store/models/post-thread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AAC;AAC5B,EAAqB,IAAA,EAAA,CAAA;AACrB,EAAqB,OAAA,EAAA;AAErB,CAA2C,CAAA;AAC3C,qBAAqB,CAAC,KAAU,CAAA;AAC3B,EAAA,OAAa,EAAS,CAAA;AACvB,EAAA,WAAO,EAAA;AACX,CAAC,CAAC;AAEF,qBAAwB,CAAA,KAAA,CAAA;AACxB,EAAqB,mBAAA,EAAI;;AAErB,qBAAO,CAAA,KAAA,CAAA;AACX,EAAE,SAAC,EAAA;AAGH,CAAA,CAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type IPostModel = Document<IPost>;
|
|
1
|
+
import { Model, Connection } from 'mongoose';
|
|
2
|
+
import { IPostModel } from 'common/server';
|
|
4
3
|
export type PostModelType = Model<IPostModel>;
|
|
5
4
|
export declare const PostModelFunc: (db: Connection) => PostModelType;
|
package/lib/store/models/post.js
CHANGED
|
@@ -1,58 +1,125 @@
|
|
|
1
|
-
import {Schema}from'mongoose';import {
|
|
1
|
+
import {Schema}from'mongoose';import {DB_COLL_NAMES}from'common/server';// export type IPostModel = Document<IPost>;
|
|
2
|
+
const postModelSchema = new Schema({
|
|
2
3
|
createdAt: {
|
|
3
|
-
type: Schema.Types.Date
|
|
4
|
+
type: Schema.Types.Date,
|
|
5
|
+
default: Date.now,
|
|
6
|
+
index: true
|
|
4
7
|
},
|
|
5
8
|
editedAt: {
|
|
6
|
-
type: Schema.Types.Date
|
|
9
|
+
type: Schema.Types.Date,
|
|
10
|
+
index: true
|
|
7
11
|
},
|
|
8
12
|
deletedAt: {
|
|
9
|
-
type: Schema.Types.Date
|
|
13
|
+
type: Schema.Types.Date,
|
|
14
|
+
index: true
|
|
10
15
|
},
|
|
11
16
|
editedBy: {
|
|
12
17
|
type: Schema.Types.ObjectId,
|
|
13
|
-
ref:
|
|
18
|
+
ref: DB_COLL_NAMES.Accounts,
|
|
19
|
+
index: true
|
|
14
20
|
},
|
|
15
21
|
deletedBy: {
|
|
16
22
|
type: Schema.Types.ObjectId,
|
|
17
|
-
ref:
|
|
23
|
+
ref: DB_COLL_NAMES.Accounts,
|
|
24
|
+
index: true
|
|
18
25
|
},
|
|
19
26
|
channel: {
|
|
20
27
|
type: Schema.Types.ObjectId,
|
|
21
|
-
ref: 'channels'
|
|
28
|
+
ref: 'channels',
|
|
29
|
+
required: true,
|
|
30
|
+
index: true
|
|
22
31
|
},
|
|
23
32
|
rootId: {
|
|
24
|
-
type: Schema.Types.String
|
|
33
|
+
type: Schema.Types.String,
|
|
34
|
+
index: true
|
|
25
35
|
},
|
|
26
36
|
parentId: {
|
|
27
|
-
type: Schema.Types.String
|
|
37
|
+
type: Schema.Types.String,
|
|
38
|
+
index: true
|
|
28
39
|
},
|
|
29
40
|
originalId: {
|
|
30
|
-
type: Schema.Types.String
|
|
41
|
+
type: Schema.Types.String,
|
|
42
|
+
index: true
|
|
31
43
|
},
|
|
32
44
|
message: {
|
|
33
|
-
type: Schema.Types.String
|
|
45
|
+
type: Schema.Types.String,
|
|
46
|
+
required: true
|
|
34
47
|
},
|
|
35
48
|
type: {
|
|
36
|
-
type: Schema.Types.String
|
|
49
|
+
type: Schema.Types.String,
|
|
50
|
+
default: 'message',
|
|
51
|
+
index: true
|
|
37
52
|
},
|
|
38
53
|
props: {
|
|
39
54
|
type: Schema.Types.Mixed
|
|
40
55
|
},
|
|
41
|
-
|
|
56
|
+
hashTags: {
|
|
42
57
|
type: Schema.Types.Mixed
|
|
43
58
|
},
|
|
44
59
|
filenames: {
|
|
45
60
|
type: Schema.Types.Mixed
|
|
46
61
|
},
|
|
47
|
-
fields: {
|
|
62
|
+
fields: [{
|
|
48
63
|
type: Schema.Types.String
|
|
49
|
-
},
|
|
64
|
+
}],
|
|
50
65
|
files: [{
|
|
51
66
|
type: Schema.Types.ObjectId
|
|
52
67
|
}],
|
|
53
68
|
hasReactions: {
|
|
54
|
-
type: Schema.Types.Boolean
|
|
69
|
+
type: Schema.Types.Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
updatedAt: {
|
|
73
|
+
type: Schema.Types.Date,
|
|
74
|
+
default: Date.now
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
timestamps: true,
|
|
78
|
+
collection: 'posts',
|
|
79
|
+
toJSON: {
|
|
80
|
+
virtuals: true
|
|
81
|
+
},
|
|
82
|
+
toObject: {
|
|
83
|
+
virtuals: true
|
|
55
84
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
85
|
+
});
|
|
86
|
+
// Virtual fields
|
|
87
|
+
postModelSchema.virtual('id').get(function () {
|
|
88
|
+
return this._id.toHexString();
|
|
89
|
+
});
|
|
90
|
+
// Add compound indexes for better query performance
|
|
91
|
+
postModelSchema.index({
|
|
92
|
+
channel: 1,
|
|
93
|
+
createdAt: -1
|
|
94
|
+
});
|
|
95
|
+
postModelSchema.index({
|
|
96
|
+
channel: 1,
|
|
97
|
+
type: 1
|
|
98
|
+
});
|
|
99
|
+
postModelSchema.index({
|
|
100
|
+
rootId: 1,
|
|
101
|
+
createdAt: -1
|
|
102
|
+
});
|
|
103
|
+
postModelSchema.index({
|
|
104
|
+
parentId: 1,
|
|
105
|
+
createdAt: -1
|
|
106
|
+
});
|
|
107
|
+
postModelSchema.index({
|
|
108
|
+
createdAt: -1
|
|
109
|
+
});
|
|
110
|
+
postModelSchema.index({
|
|
111
|
+
deletedAt: 1
|
|
112
|
+
});
|
|
113
|
+
// Pre-save middleware to update timestamps
|
|
114
|
+
postModelSchema.pre('save', function (next) {
|
|
115
|
+
this.updatedAt = new Date();
|
|
116
|
+
next();
|
|
117
|
+
});
|
|
118
|
+
// Pre-update middleware
|
|
119
|
+
postModelSchema.pre(['updateOne', 'findOneAndUpdate'], function (next) {
|
|
120
|
+
this.set({
|
|
121
|
+
updatedAt: new Date()
|
|
122
|
+
});
|
|
123
|
+
next();
|
|
124
|
+
});
|
|
58
125
|
const PostModelFunc = db => db.model('posts', postModelSchema);export{PostModelFunc};//# sourceMappingURL=post.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sources":["../../../src/store/models/post.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.js","sources":["../../../src/store/models/post.ts"],"sourcesContent":[null],"names":[],"mappings":"wEAGA;AAEA,MAAM,eAAe,GAAG,IAAI,MAAM,CAC9B;AACI,EAAA,SAAA,EAAS;AACL,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,IAAM;WACZ,EAAA,IAAE,CAAI,GAAA;AACb,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,QAAA,EAAQ;AACJ,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,IAAM;AACnB,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,SAAA,EAAS;AACL,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,IAAM;AACnB,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,QAAA,EAAQ;AACJ,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,QAAc;SACxB,aAAe,CAAA,QAAS;AAC3B,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,SAAA,EAAS;AACL,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,QAAc;SACxB,aAAe,CAAA,QAAS;AAC3B,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,OAAA,EAAO;AACH,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,QAAc;AAC3B,IAAA,GAAA,EAAA,UAAe;AACf,IAAA,QAAA,EAAA,IAAU;AACV,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,MAAA,EAAM;AACF,IAAA,IAAA,EAAA,MAAM,CAAA,KAAO,CAAA,MAAY;AACzB,IAAA,KAAA,EAAA;AACH,GAAA;AACD,EAAA,QAAA,EAAQ;AACJ,IAAA,IAA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AACD;AACJ,eAAG,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,GAAA,CAAA,YAAA;AAEH,EAAwB,OAAA,IAAA,CAAA,GAAA,CAAA,WAAA,EAAA;AACxB,CAAe,CAAA;;AAEX,eAAO,CAAA,KAAA,CAAA;AACX,EAAE,OAAC,EAAA,CAAA;AAGH,EAAA,SAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type IReactionModel = Document<IReaction>;
|
|
1
|
+
import { Model, Connection } from 'mongoose';
|
|
2
|
+
import { IReactionModel } from 'common/server';
|
|
4
3
|
export type ReactionModelType = Model<IReactionModel>;
|
|
5
4
|
export declare const ReactionModelFunc: (db: Connection) => ReactionModelType;
|