@messenger-box/platform-server 0.0.1-alpha.205 → 0.0.1-alpha.206
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/index.js +115 -240
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/lib/mixins/base-service-mixin.d.ts +0 -3
- package/lib/mixins/index.d.ts +0 -1
package/lib/index.js
CHANGED
|
@@ -542,7 +542,7 @@ exports.channelMemberResolvers = channelMemberResolvers;
|
|
|
542
542
|
/*!******************************************!*\
|
|
543
543
|
!*** ./src/graphql/resolvers/channel.ts ***!
|
|
544
544
|
\******************************************/
|
|
545
|
-
/***/ (function(__unused_webpack_module, exports
|
|
545
|
+
/***/ (function(__unused_webpack_module, exports) {
|
|
546
546
|
|
|
547
547
|
|
|
548
548
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
@@ -558,7 +558,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
558
558
|
};
|
|
559
559
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
560
560
|
exports.channelResolvers = void 0;
|
|
561
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
562
561
|
const channelResolvers = () => ({
|
|
563
562
|
Query: {
|
|
564
563
|
channelByName(src, { name }, { channelService, userContext }) {
|
|
@@ -580,7 +579,7 @@ const channelResolvers = () => ({
|
|
|
580
579
|
criteria: {
|
|
581
580
|
id,
|
|
582
581
|
user: userContext.accountId,
|
|
583
|
-
type:
|
|
582
|
+
type: "DIRECT" /* IRoomType.DIRECT */,
|
|
584
583
|
},
|
|
585
584
|
});
|
|
586
585
|
},
|
|
@@ -589,7 +588,7 @@ const channelResolvers = () => ({
|
|
|
589
588
|
createChannel(src, { name, description }, { channelService, userContext }) {
|
|
590
589
|
const { accountId, teamId } = userContext;
|
|
591
590
|
return channelService.saveChannel({
|
|
592
|
-
type:
|
|
591
|
+
type: "CHANNEL" /* IRoomType.CHANNEL */,
|
|
593
592
|
creator: accountId,
|
|
594
593
|
title: name,
|
|
595
594
|
topic: name,
|
|
@@ -695,7 +694,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
695
694
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
696
695
|
exports.postResolvers = void 0;
|
|
697
696
|
const core_1 = __webpack_require__(/*! @adminide-stack/core */ "@adminide-stack/core");
|
|
698
|
-
const
|
|
697
|
+
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
699
698
|
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
700
699
|
const graphql_1 = __webpack_require__(/*! graphql */ "graphql");
|
|
701
700
|
const postResolvers = () => ({
|
|
@@ -774,7 +773,7 @@ const postResolvers = () => ({
|
|
|
774
773
|
skip,
|
|
775
774
|
sort: {
|
|
776
775
|
key: 'createdAt',
|
|
777
|
-
value:
|
|
776
|
+
value: store_mongo_1.ISortEnum.DESC,
|
|
778
777
|
},
|
|
779
778
|
});
|
|
780
779
|
return {
|
|
@@ -1191,9 +1190,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
1191
1190
|
var MessageNotificationTemplateMigration_1;
|
|
1192
1191
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1193
1192
|
exports.MessageNotificationTemplateMigration = void 0;
|
|
1194
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1195
1193
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
1196
|
-
const
|
|
1194
|
+
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
1197
1195
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1198
1196
|
let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_1 = class MessageNotificationTemplateMigration {
|
|
1199
1197
|
constructor(logger, db, broker, settings) {
|
|
@@ -1208,7 +1206,7 @@ let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_
|
|
|
1208
1206
|
}
|
|
1209
1207
|
async up() {
|
|
1210
1208
|
await this.down();
|
|
1211
|
-
const name =
|
|
1209
|
+
const name = "MessageNotificationServiceId" /* IMailTemplateId.MessageNotificationServiceId */;
|
|
1212
1210
|
const requestData = {
|
|
1213
1211
|
engine: 'ejs',
|
|
1214
1212
|
code: name,
|
|
@@ -1226,7 +1224,7 @@ let MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_
|
|
|
1226
1224
|
await this.broker.waitForServices('MailService');
|
|
1227
1225
|
}
|
|
1228
1226
|
try {
|
|
1229
|
-
const name =
|
|
1227
|
+
const name = "MessageNotificationServiceId" /* IMailTemplateId.MessageNotificationServiceId */;
|
|
1230
1228
|
this.logger.trace(`Trying to down ${name}`);
|
|
1231
1229
|
const droppedResponse = await this.callAction("dropTemplate" /* IMailServiceAction.dropTemplate */, { name }, "MailService" /* IMoleculerServiceName.MailService */);
|
|
1232
1230
|
if (droppedResponse) {
|
|
@@ -1248,113 +1246,13 @@ MessageNotificationTemplateMigration = MessageNotificationTemplateMigration_1 =
|
|
|
1248
1246
|
(0, inversify_1.injectable)(),
|
|
1249
1247
|
__param(0, (0, inversify_1.inject)('Logger')),
|
|
1250
1248
|
__param(1, (0, inversify_1.inject)('MongoDBConnection')),
|
|
1251
|
-
__param(2, (0, inversify_1.inject)(
|
|
1249
|
+
__param(2, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
|
|
1252
1250
|
__param(3, (0, inversify_1.inject)('Settings')),
|
|
1253
|
-
__param(3, (0, inversify_1.tagged)(
|
|
1251
|
+
__param(3, (0, inversify_1.tagged)(core_1.TaggedType.MICROSERVICE, true))
|
|
1254
1252
|
], MessageNotificationTemplateMigration);
|
|
1255
1253
|
exports.MessageNotificationTemplateMigration = MessageNotificationTemplateMigration;
|
|
1256
1254
|
|
|
1257
1255
|
|
|
1258
|
-
/***/ }),
|
|
1259
|
-
|
|
1260
|
-
/***/ "./src/mixins/base-service-mixin.ts":
|
|
1261
|
-
/*!******************************************!*\
|
|
1262
|
-
!*** ./src/mixins/base-service-mixin.ts ***!
|
|
1263
|
-
\******************************************/
|
|
1264
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1268
|
-
exports.BaseServiceMixin = void 0;
|
|
1269
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1270
|
-
const BaseServiceMixin = (service) => ({
|
|
1271
|
-
name: 'BaseServiceMixin',
|
|
1272
|
-
actions: {
|
|
1273
|
-
[core_1.IBaseServiceCommands.get]: {
|
|
1274
|
-
params: {
|
|
1275
|
-
id: 'string',
|
|
1276
|
-
},
|
|
1277
|
-
handler: async (ctx) => service.get(ctx.params.id),
|
|
1278
|
-
},
|
|
1279
|
-
[core_1.IBaseServiceCommands.count]: {
|
|
1280
|
-
params: {
|
|
1281
|
-
criteria: { type: 'object', optional: true },
|
|
1282
|
-
},
|
|
1283
|
-
handler: async (ctx) => service.count(ctx.params.criteria),
|
|
1284
|
-
},
|
|
1285
|
-
[core_1.IBaseServiceCommands.bulkCreate]: {
|
|
1286
|
-
params: {
|
|
1287
|
-
data: { type: 'array', items: 'object' },
|
|
1288
|
-
},
|
|
1289
|
-
handler: async (ctx) => service.bulkCreate(ctx.params.data),
|
|
1290
|
-
},
|
|
1291
|
-
[core_1.IBaseServiceCommands.create]: {
|
|
1292
|
-
params: {
|
|
1293
|
-
data: 'object',
|
|
1294
|
-
},
|
|
1295
|
-
handler: async (ctx) => service.create(ctx.params.data),
|
|
1296
|
-
},
|
|
1297
|
-
[core_1.IBaseServiceCommands.delete]: {
|
|
1298
|
-
params: {
|
|
1299
|
-
id: 'string',
|
|
1300
|
-
},
|
|
1301
|
-
handler: async (ctx) => service.delete(ctx.params.id),
|
|
1302
|
-
},
|
|
1303
|
-
[core_1.IBaseServiceCommands.getAll]: {
|
|
1304
|
-
params: {
|
|
1305
|
-
criteria: 'object|optional',
|
|
1306
|
-
sort: 'object|optional',
|
|
1307
|
-
skip: 'number|optional',
|
|
1308
|
-
limit: 'number|optional',
|
|
1309
|
-
selectedFields: 'string|optional',
|
|
1310
|
-
},
|
|
1311
|
-
handler: async (ctx) => service.getAll(ctx.params),
|
|
1312
|
-
},
|
|
1313
|
-
[core_1.IBaseServiceCommands.getAllWithCount]: {
|
|
1314
|
-
params: {
|
|
1315
|
-
criteria: 'object|optional',
|
|
1316
|
-
sort: 'object|optional',
|
|
1317
|
-
skip: 'number|optional',
|
|
1318
|
-
limit: 'number|optional',
|
|
1319
|
-
selectedFields: 'string|optional',
|
|
1320
|
-
},
|
|
1321
|
-
handler: async (ctx) => service.getAllWithCount(ctx.params),
|
|
1322
|
-
},
|
|
1323
|
-
[core_1.IBaseServiceCommands.insert]: {
|
|
1324
|
-
params: {
|
|
1325
|
-
data: 'object',
|
|
1326
|
-
overwrite: 'boolean|optional',
|
|
1327
|
-
},
|
|
1328
|
-
handler: async (ctx) => service.insert(ctx.params.data, ctx.params.overwrite),
|
|
1329
|
-
},
|
|
1330
|
-
[core_1.IBaseServiceCommands.update]: {
|
|
1331
|
-
params: {
|
|
1332
|
-
id: 'string',
|
|
1333
|
-
data: 'object',
|
|
1334
|
-
overwrite: 'boolean|optional',
|
|
1335
|
-
},
|
|
1336
|
-
handler: async (ctx) => service.update(ctx.params.id, ctx.params.data, ctx.params.overwrite),
|
|
1337
|
-
},
|
|
1338
|
-
},
|
|
1339
|
-
});
|
|
1340
|
-
exports.BaseServiceMixin = BaseServiceMixin;
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
/***/ }),
|
|
1344
|
-
|
|
1345
|
-
/***/ "./src/mixins/index.ts":
|
|
1346
|
-
/*!*****************************!*\
|
|
1347
|
-
!*** ./src/mixins/index.ts ***!
|
|
1348
|
-
\*****************************/
|
|
1349
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1353
|
-
exports.BaseServiceMixin = void 0;
|
|
1354
|
-
var base_service_mixin_1 = __webpack_require__(/*! ./base-service-mixin */ "./src/mixins/base-service-mixin.ts");
|
|
1355
|
-
Object.defineProperty(exports, "BaseServiceMixin", ({ enumerable: true, get: function () { return base_service_mixin_1.BaseServiceMixin; } }));
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
1256
|
/***/ }),
|
|
1359
1257
|
|
|
1360
1258
|
/***/ "./src/module.ts":
|
|
@@ -1410,117 +1308,116 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1410
1308
|
exports.ChannelMoleculerService = void 0;
|
|
1411
1309
|
const moleculer_1 = __webpack_require__(/*! moleculer */ "moleculer");
|
|
1412
1310
|
const platform_server_1 = __webpack_require__(/*! @adminide-stack/platform-server */ "@adminide-stack/platform-server");
|
|
1413
|
-
const
|
|
1311
|
+
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
1414
1312
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1415
1313
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
1416
|
-
const mixins_1 = __webpack_require__(/*! ../mixins */ "./src/mixins/index.ts");
|
|
1417
1314
|
class ChannelMoleculerService extends moleculer_1.Service {
|
|
1418
1315
|
constructor(broker, _a) {
|
|
1419
1316
|
var { container } = _a, settings = __rest(_a, ["container"]);
|
|
1420
1317
|
super(broker);
|
|
1421
|
-
const topic =
|
|
1318
|
+
const topic = "ChannelService" /* MoleculerTopics.ChannelService */;
|
|
1422
1319
|
this.channelService = container.get(constants_1.TYPES.ChannelService);
|
|
1423
1320
|
this.parseServiceSchema({
|
|
1424
1321
|
name: topic,
|
|
1425
|
-
mixins: [platform_server_1.ApolloClientMixin, (0,
|
|
1322
|
+
mixins: [platform_server_1.ApolloClientMixin, (0, store_mongo_1.BaseServiceMixin)(this.channelService)],
|
|
1426
1323
|
settings: {
|
|
1427
1324
|
apolloClient: {
|
|
1428
1325
|
serverUri: config_1.config.GRAPHQL_URL,
|
|
1429
1326
|
},
|
|
1430
1327
|
},
|
|
1431
1328
|
actions: {
|
|
1432
|
-
[
|
|
1329
|
+
["addMemberToChannel" /* ChannelServiceCommands.addMemberToChannel */]: {
|
|
1433
1330
|
handler: async (ctx) => this.channelService.addMemberToChannel(ctx.params.channelId, ctx.params.memberId),
|
|
1434
1331
|
},
|
|
1435
|
-
[
|
|
1332
|
+
["createDirectChannel" /* ChannelServiceCommands.createDirectChannel */]: {
|
|
1436
1333
|
handler: async (ctx) => this.channelService.createDirectChannel(ctx.params.data),
|
|
1437
1334
|
},
|
|
1438
|
-
[
|
|
1335
|
+
["deleteChannel" /* ChannelServiceCommands.deleteChannel */]: {
|
|
1439
1336
|
handler: async (ctx) => this.channelService.deleteChannel(ctx.params.id),
|
|
1440
1337
|
},
|
|
1441
|
-
[
|
|
1338
|
+
["hideChannel" /* ChannelServiceCommands.hideChannel */]: {
|
|
1442
1339
|
handler: async (ctx) => this.channelService.hideChannel(ctx.params.id),
|
|
1443
1340
|
},
|
|
1444
|
-
[
|
|
1341
|
+
["getChannelCounts" /* ChannelServiceCommands.getChannelCounts */]: {
|
|
1445
1342
|
handler: async (ctx) => this.channelService.getChannelCounts(ctx.params.teamId, ctx.params.userId),
|
|
1446
1343
|
},
|
|
1447
|
-
[
|
|
1344
|
+
["getByName" /* ChannelServiceCommands.getByName */]: {
|
|
1448
1345
|
handler: async (ctx) => this.channelService.getByName(ctx.params.teamId, ctx.params.name),
|
|
1449
1346
|
},
|
|
1450
|
-
[
|
|
1347
|
+
["getByNameIncludeDeleted" /* ChannelServiceCommands.getByNameIncludeDeleted */]: {
|
|
1451
1348
|
handler: async (ctx) => this.channelService.getByNameIncludeDeleted(ctx.params.teamId, ctx.params.name),
|
|
1452
1349
|
},
|
|
1453
|
-
[
|
|
1350
|
+
["getByNames" /* ChannelServiceCommands.getByNames */]: {
|
|
1454
1351
|
handler: async (ctx) => this.channelService.getByNames(ctx.params.teamId, ctx.params.names),
|
|
1455
1352
|
},
|
|
1456
|
-
[
|
|
1353
|
+
["getChannels" /* ChannelServiceCommands.getChannels */]: {
|
|
1457
1354
|
handler: async (ctx) => this.channelService.getChannels(ctx.params.teamId, ctx.params.userId, ctx.params.includeDeleted, ctx.params.lastDeleteAt),
|
|
1458
1355
|
},
|
|
1459
|
-
[
|
|
1356
|
+
["getChannelUnread" /* ChannelServiceCommands.getChannelUnread */]: {
|
|
1460
1357
|
handler: async (ctx) => this.channelService.getChannelUnread(ctx.params.channelId, ctx.params.userId),
|
|
1461
1358
|
},
|
|
1462
|
-
[
|
|
1359
|
+
["getDeleted" /* ChannelServiceCommands.getDeleted */]: {
|
|
1463
1360
|
handler: async (ctx) => this.channelService.getDeleted(ctx.params.teamId, ctx.params.offset, ctx.params.limit, ctx.params.userId),
|
|
1464
1361
|
},
|
|
1465
|
-
[
|
|
1362
|
+
["getDeletedByName" /* ChannelServiceCommands.getDeletedByName */]: {
|
|
1466
1363
|
handler: async (ctx) => this.channelService.getDeletedByName(ctx.params.teamId, ctx.params.name),
|
|
1467
1364
|
},
|
|
1468
|
-
[
|
|
1365
|
+
["saveDirectChannel" /* ChannelServiceCommands.saveDirectChannel */]: {
|
|
1469
1366
|
handler: async (ctx) => this.channelService.saveDirectChannel(ctx.params.channel),
|
|
1470
1367
|
},
|
|
1471
|
-
[
|
|
1368
|
+
["saveChannel" /* ChannelServiceCommands.saveChannel */]: {
|
|
1472
1369
|
handler: async (ctx) => this.channelService.saveChannel(ctx.params.data),
|
|
1473
1370
|
},
|
|
1474
|
-
[
|
|
1371
|
+
["invalidateChannelByName" /* ChannelServiceCommands.invalidateChannelByName */]: {
|
|
1475
1372
|
handler: async (ctx) => this.channelService.invalidateChannelByName(ctx.params.teamId, ctx.params.name),
|
|
1476
1373
|
},
|
|
1477
|
-
[
|
|
1374
|
+
["getPinnedPosts" /* ChannelServiceCommands.getPinnedPosts */]: {
|
|
1478
1375
|
handler: async (ctx) => this.channelService.getPinnedPosts(ctx.params.channelId),
|
|
1479
1376
|
},
|
|
1480
|
-
[
|
|
1377
|
+
["getFromMaster" /* ChannelServiceCommands.getFromMaster */]: {
|
|
1481
1378
|
handler: async (ctx) => this.channelService.getFromMaster(ctx.params.id),
|
|
1482
1379
|
},
|
|
1483
|
-
[
|
|
1380
|
+
["restore" /* ChannelServiceCommands.restore */]: {
|
|
1484
1381
|
handler: async (ctx) => this.channelService.restore(ctx.params.channelId, ctx.params.time),
|
|
1485
1382
|
},
|
|
1486
|
-
[
|
|
1383
|
+
["permanentDeleteByTeam" /* ChannelServiceCommands.permanentDeleteByTeam */]: {
|
|
1487
1384
|
handler: async (ctx) => this.channelService.permanentDeleteByTeam(ctx.params.teamId),
|
|
1488
1385
|
},
|
|
1489
|
-
[
|
|
1386
|
+
["permanentDelete" /* ChannelServiceCommands.permanentDelete */]: {
|
|
1490
1387
|
handler: async (ctx) => this.channelService.permanentDelete(ctx.params.channelId),
|
|
1491
1388
|
},
|
|
1492
|
-
[
|
|
1389
|
+
["permanentDeleteMembersByChannel" /* ChannelServiceCommands.permanentDeleteMembersByChannel */]: {
|
|
1493
1390
|
handler: async (ctx) => this.channelService.permanentDeleteMembersByChannel(ctx.params.channelId),
|
|
1494
1391
|
},
|
|
1495
|
-
[
|
|
1392
|
+
["getPrivateChannelsForTeam" /* ChannelServiceCommands.getPrivateChannelsForTeam */]: {
|
|
1496
1393
|
handler: async (ctx) => this.channelService.getPrivateChannelsForTeam(ctx.params.teamId, ctx.params.offset, ctx.params.limit),
|
|
1497
1394
|
},
|
|
1498
|
-
[
|
|
1395
|
+
["getPublicChannelsForTeam" /* ChannelServiceCommands.getPublicChannelsForTeam */]: {
|
|
1499
1396
|
handler: async (ctx) => this.channelService.getPublicChannelsForTeam(ctx.params.teamId, ctx.params.offset, ctx.params.limit),
|
|
1500
1397
|
},
|
|
1501
|
-
[
|
|
1398
|
+
["getPublicChannelsByIdsForTeam" /* ChannelServiceCommands.getPublicChannelsByIdsForTeam */]: {
|
|
1502
1399
|
handler: async (ctx) => this.channelService.getPublicChannelsByIdsForTeam(ctx.params.teamId, ctx.params.channelsIds),
|
|
1503
1400
|
},
|
|
1504
|
-
[
|
|
1401
|
+
["getTeamChannels" /* ChannelServiceCommands.getTeamChannels */]: {
|
|
1505
1402
|
handler: async (ctx) => this.channelService.getTeamChannels(ctx.params.teamId),
|
|
1506
1403
|
},
|
|
1507
|
-
[
|
|
1404
|
+
["saveMultipleMembers" /* ChannelServiceCommands.saveMultipleMembers */]: {
|
|
1508
1405
|
handler: async (ctx) => this.channelService.saveMultipleMembers(ctx.params.members),
|
|
1509
1406
|
},
|
|
1510
|
-
[
|
|
1407
|
+
["leaveChannel" /* ChannelServiceCommands.leaveChannel */]: {
|
|
1511
1408
|
handler: async (ctx) => this.channelService.leaveChannel(ctx.params.id),
|
|
1512
1409
|
},
|
|
1513
|
-
[
|
|
1410
|
+
["deleteChannel" /* ChannelServiceCommands.deleteChannel */]: {
|
|
1514
1411
|
handler: async (ctx) => this.channelService.deleteChannel(ctx.params.id),
|
|
1515
1412
|
},
|
|
1516
|
-
[
|
|
1413
|
+
["isMember" /* ChannelServiceCommands.isMember */]: {
|
|
1517
1414
|
params: {
|
|
1518
1415
|
id: 'string',
|
|
1519
1416
|
user: 'string',
|
|
1520
1417
|
},
|
|
1521
1418
|
handler: async ({ params }) => this.channelService.isMember(params.id, params.user),
|
|
1522
1419
|
},
|
|
1523
|
-
[
|
|
1420
|
+
["viewChannel" /* ChannelServiceCommands.viewChannel */]: {
|
|
1524
1421
|
params: {
|
|
1525
1422
|
id: 'string',
|
|
1526
1423
|
user: 'string',
|
|
@@ -1582,9 +1479,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
1582
1479
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1583
1480
|
exports.MessengerNotificationMoleculerService = void 0;
|
|
1584
1481
|
const moleculer_1 = __webpack_require__(/*! moleculer */ "moleculer");
|
|
1585
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1586
1482
|
const moleculer_cron_tasks_1 = __importDefault(__webpack_require__(/*! @skoropletov/moleculer-cron-tasks */ "@skoropletov/moleculer-cron-tasks"));
|
|
1587
|
-
const
|
|
1483
|
+
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
1588
1484
|
const platform_server_1 = __webpack_require__(/*! @adminide-stack/platform-server */ "@adminide-stack/platform-server");
|
|
1589
1485
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1590
1486
|
const enums_1 = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
|
|
@@ -1594,7 +1490,7 @@ class MessengerNotificationMoleculerService extends moleculer_1.Service {
|
|
|
1594
1490
|
super(broker);
|
|
1595
1491
|
this.container = container;
|
|
1596
1492
|
this.parseServiceSchema({
|
|
1597
|
-
name:
|
|
1493
|
+
name: "MessengerNotificationService" /* IMoleculerServiceName.MessengerNotificationService */,
|
|
1598
1494
|
dependencies: [],
|
|
1599
1495
|
settings: {
|
|
1600
1496
|
apolloClient: {
|
|
@@ -1604,11 +1500,11 @@ class MessengerNotificationMoleculerService extends moleculer_1.Service {
|
|
|
1604
1500
|
mixins: [platform_server_1.ApolloClientMixin],
|
|
1605
1501
|
async started() {
|
|
1606
1502
|
this.messengerService = this.container.get(constants_1.TYPES.MessengerNotificationService);
|
|
1607
|
-
this.cdmLogger = this.container.get(
|
|
1503
|
+
this.cdmLogger = this.container.get(core_1.CommonType.LOGGER);
|
|
1608
1504
|
this.registerCronService(this.messengerService);
|
|
1609
1505
|
},
|
|
1610
1506
|
actions: {
|
|
1611
|
-
[
|
|
1507
|
+
["sendNotificationOfUnreadMessages" /* IMessengerNotificationServiceCommands.sendNotificationOfUnreadMessages */]: {
|
|
1612
1508
|
params: {
|
|
1613
1509
|
unit: 'string',
|
|
1614
1510
|
value: 'number',
|
|
@@ -1623,11 +1519,11 @@ class MessengerNotificationMoleculerService extends moleculer_1.Service {
|
|
|
1623
1519
|
}
|
|
1624
1520
|
registerCronService(service) {
|
|
1625
1521
|
this.broker.createService({
|
|
1626
|
-
name:
|
|
1522
|
+
name: "MessengerCronJob" /* IMoleculerCronServiceName.MessengerCronJob */,
|
|
1627
1523
|
mixins: [moleculer_cron_tasks_1.default],
|
|
1628
1524
|
tasks: [
|
|
1629
1525
|
{
|
|
1630
|
-
name: `${
|
|
1526
|
+
name: `${"sendNotificationOfUnreadMessages" /* IMessengerNotificationServiceCommands.sendNotificationOfUnreadMessages */}`,
|
|
1631
1527
|
cronTime: '0 * * * *',
|
|
1632
1528
|
async callback() {
|
|
1633
1529
|
return service.sendNotificationOfUnreadMessages(enums_1.NotificationDurationUnitEnum.hours, 1);
|
|
@@ -1663,19 +1559,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
1663
1559
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1664
1560
|
exports.PostMoleculerService = void 0;
|
|
1665
1561
|
const moleculer_1 = __webpack_require__(/*! moleculer */ "moleculer");
|
|
1666
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1667
1562
|
const platform_server_1 = __webpack_require__(/*! @adminide-stack/platform-server */ "@adminide-stack/platform-server");
|
|
1563
|
+
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
1668
1564
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1669
1565
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
1670
|
-
const mixins_1 = __webpack_require__(/*! ../mixins */ "./src/mixins/index.ts");
|
|
1671
1566
|
class PostMoleculerService extends moleculer_1.Service {
|
|
1672
1567
|
constructor(broker, { container }) {
|
|
1673
1568
|
super(broker);
|
|
1674
|
-
const topic =
|
|
1569
|
+
const topic = "PostService" /* MoleculerTopics.PostService */;
|
|
1675
1570
|
this.postService = container.get(constants_1.TYPES.PostService);
|
|
1676
1571
|
this.parseServiceSchema({
|
|
1677
1572
|
name: topic,
|
|
1678
|
-
mixins: [platform_server_1.ApolloClientMixin, (0,
|
|
1573
|
+
mixins: [platform_server_1.ApolloClientMixin, (0, store_mongo_1.BaseServiceMixin)(this.postService)],
|
|
1679
1574
|
settings: {
|
|
1680
1575
|
apolloClient: {
|
|
1681
1576
|
serverUri: config_1.config.GRAPHQL_URL,
|
|
@@ -1793,20 +1688,19 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
1793
1688
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1794
1689
|
exports.PostThreadMoleculerService = void 0;
|
|
1795
1690
|
const moleculer_1 = __webpack_require__(/*! moleculer */ "moleculer");
|
|
1796
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1797
1691
|
const platform_server_1 = __webpack_require__(/*! @adminide-stack/platform-server */ "@adminide-stack/platform-server");
|
|
1692
|
+
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
1798
1693
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
1799
|
-
const mixins_1 = __webpack_require__(/*! ../mixins */ "./src/mixins/index.ts");
|
|
1800
1694
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1801
1695
|
class PostThreadMoleculerService extends moleculer_1.Service {
|
|
1802
1696
|
constructor(broker, _a) {
|
|
1803
1697
|
var { container } = _a, settings = __rest(_a, ["container"]);
|
|
1804
1698
|
super(broker);
|
|
1805
|
-
const topic =
|
|
1699
|
+
const topic = "PostThreadService" /* MoleculerTopics.PostThreadService */;
|
|
1806
1700
|
this.postThreadService = container.get(constants_1.TYPES.PostThreadService);
|
|
1807
1701
|
this.parseServiceSchema({
|
|
1808
1702
|
name: topic,
|
|
1809
|
-
mixins: [platform_server_1.ApolloClientMixin, (0,
|
|
1703
|
+
mixins: [platform_server_1.ApolloClientMixin, (0, store_mongo_1.BaseServiceMixin)(this.postThreadService)],
|
|
1810
1704
|
settings: {
|
|
1811
1705
|
apolloClient: {
|
|
1812
1706
|
serverUri: config_1.config.GRAPHQL_URL,
|
|
@@ -1831,19 +1725,18 @@ exports.PostThreadMoleculerService = PostThreadMoleculerService;
|
|
|
1831
1725
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1832
1726
|
exports.ReactionMoleculerService = void 0;
|
|
1833
1727
|
const moleculer_1 = __webpack_require__(/*! moleculer */ "moleculer");
|
|
1834
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1835
1728
|
const platform_server_1 = __webpack_require__(/*! @adminide-stack/platform-server */ "@adminide-stack/platform-server");
|
|
1729
|
+
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
1836
1730
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
1837
|
-
const mixins_1 = __webpack_require__(/*! ../mixins */ "./src/mixins/index.ts");
|
|
1838
1731
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
1839
1732
|
class ReactionMoleculerService extends moleculer_1.Service {
|
|
1840
1733
|
constructor(broker, { container }) {
|
|
1841
1734
|
super(broker);
|
|
1842
|
-
const topic =
|
|
1735
|
+
const topic = "ReactionService" /* MoleculerTopics.ReactionService */;
|
|
1843
1736
|
this.reactionService = container.get(constants_1.TYPES.ReactionService);
|
|
1844
1737
|
this.parseServiceSchema({
|
|
1845
1738
|
name: topic,
|
|
1846
|
-
mixins: [platform_server_1.ApolloClientMixin, (0,
|
|
1739
|
+
mixins: [platform_server_1.ApolloClientMixin, (0, store_mongo_1.BaseServiceMixin)(this.reactionService)],
|
|
1847
1740
|
settings: {
|
|
1848
1741
|
apolloClient: {
|
|
1849
1742
|
serverUri: config_1.config.GRAPHQL_URL,
|
|
@@ -1991,8 +1884,8 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
1991
1884
|
};
|
|
1992
1885
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1993
1886
|
exports.ChannelService = void 0;
|
|
1887
|
+
/* eslint-disable class-methods-use-this */
|
|
1994
1888
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
1995
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
1996
1889
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
1997
1890
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
1998
1891
|
let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
@@ -2020,7 +1913,7 @@ let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
|
2020
1913
|
async getCurrentChannelCountPerTeam(team) {
|
|
2021
1914
|
return this.repository.count({
|
|
2022
1915
|
team,
|
|
2023
|
-
type:
|
|
1916
|
+
type: "CHANNEL" /* IRoomType.CHANNEL */,
|
|
2024
1917
|
});
|
|
2025
1918
|
}
|
|
2026
1919
|
async createDirectChannel(data) {
|
|
@@ -2041,7 +1934,7 @@ let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
|
2041
1934
|
});
|
|
2042
1935
|
const channelPayload = {
|
|
2043
1936
|
title: sender.split('').reverse().join(''),
|
|
2044
|
-
type:
|
|
1937
|
+
type: "DIRECT" /* IRoomType.DIRECT */,
|
|
2045
1938
|
creator: sender,
|
|
2046
1939
|
members: chlMember,
|
|
2047
1940
|
displayName,
|
|
@@ -2053,7 +1946,7 @@ let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
|
2053
1946
|
if (deletedAt) {
|
|
2054
1947
|
return new Error('Deleted Channel can not be saved');
|
|
2055
1948
|
}
|
|
2056
|
-
if (type !==
|
|
1949
|
+
if (type !== "DIRECT" /* IRoomType.DIRECT */) {
|
|
2057
1950
|
return new Error('Only direct channels are allowed');
|
|
2058
1951
|
}
|
|
2059
1952
|
return this.repository.create(channel);
|
|
@@ -2084,7 +1977,7 @@ let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
|
2084
1977
|
}
|
|
2085
1978
|
async saveChannel(data) {
|
|
2086
1979
|
const { type, team, creator } = data;
|
|
2087
|
-
if (type !==
|
|
1980
|
+
if (type !== "CHANNEL" /* IRoomType.CHANNEL */) {
|
|
2088
1981
|
return new Error('Invalid Channel Type');
|
|
2089
1982
|
}
|
|
2090
1983
|
const maxChannels = await ChannelService.getMaxChannelsPerTeam(team);
|
|
@@ -2130,7 +2023,7 @@ let ChannelService = class ChannelService extends store_mongo_1.BaseService {
|
|
|
2130
2023
|
},
|
|
2131
2024
|
sort: {
|
|
2132
2025
|
key: 'CreatAt',
|
|
2133
|
-
value:
|
|
2026
|
+
value: store_mongo_1.ISortEnum.ASC,
|
|
2134
2027
|
},
|
|
2135
2028
|
});
|
|
2136
2029
|
const replyCounts = await Promise.all(posts.map((post) => this.postService.count({ rootId: post.rootId || post.id })));
|
|
@@ -2302,8 +2195,7 @@ const sub_1 = __importDefault(__webpack_require__(/*! date-fns/sub */ "date-fns/
|
|
|
2302
2195
|
const compareAsc_1 = __importDefault(__webpack_require__(/*! date-fns/compareAsc */ "date-fns/compareAsc"));
|
|
2303
2196
|
const notification_api_core_1 = __webpack_require__(/*! @messenger-box/notification-api-core */ "@messenger-box/notification-api-core");
|
|
2304
2197
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2305
|
-
const core_1 = __webpack_require__(/*! @
|
|
2306
|
-
const core_2 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2198
|
+
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2307
2199
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
2308
2200
|
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
2309
2201
|
let MessengerNotificationService = class MessengerNotificationService {
|
|
@@ -2374,7 +2266,7 @@ let MessengerNotificationService = class MessengerNotificationService {
|
|
|
2374
2266
|
request: {
|
|
2375
2267
|
topic: 'Unread Messages Notification',
|
|
2376
2268
|
to: notificationEmail || email,
|
|
2377
|
-
templateId:
|
|
2269
|
+
templateId: "MessageNotificationServiceId" /* IMailTemplateId.MessageNotificationServiceId */,
|
|
2378
2270
|
from: config_1.config.MAIL_SEND_DEFAULT_EMAIL,
|
|
2379
2271
|
subject: `You have Unread Messages in ${channels.length} chats`,
|
|
2380
2272
|
variables: {
|
|
@@ -2461,7 +2353,7 @@ MessengerNotificationService = __decorate([
|
|
|
2461
2353
|
(0, inversify_1.injectable)(),
|
|
2462
2354
|
__param(0, (0, inversify_1.inject)(constants_1.TYPES.ChannelRepository)),
|
|
2463
2355
|
__param(1, (0, inversify_1.inject)(constants_1.TYPES.PostRepository)),
|
|
2464
|
-
__param(2, (0, inversify_1.inject)(
|
|
2356
|
+
__param(2, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
|
|
2465
2357
|
__param(3, (0, inversify_1.inject)('Logger'))
|
|
2466
2358
|
], MessengerNotificationService);
|
|
2467
2359
|
exports.MessengerNotificationService = MessengerNotificationService;
|
|
@@ -2490,7 +2382,6 @@ exports.PostService = void 0;
|
|
|
2490
2382
|
/* eslint-disable no-useless-constructor */
|
|
2491
2383
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2492
2384
|
const lodash_1 = __webpack_require__(/*! lodash */ "lodash");
|
|
2493
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2494
2385
|
const file_info_core_1 = __webpack_require__(/*! @container-stack/file-info-core */ "@container-stack/file-info-core");
|
|
2495
2386
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
2496
2387
|
const constants_1 = __webpack_require__(/*! ../constants */ "./src/constants/index.ts");
|
|
@@ -2504,27 +2395,27 @@ let PostService = class PostService extends store_mongo_1.BaseService {
|
|
|
2504
2395
|
createFileUploadLink(postId, filename, userId) {
|
|
2505
2396
|
return this.fileInfoService.uploadByUrl({
|
|
2506
2397
|
filename,
|
|
2507
|
-
refType:
|
|
2398
|
+
refType: "Post" /* IFileRefType.Post */,
|
|
2508
2399
|
ref: postId,
|
|
2509
2400
|
userId,
|
|
2510
2401
|
});
|
|
2511
2402
|
}
|
|
2512
2403
|
async attachUploadedFile(postId, file, createdBy) {
|
|
2513
|
-
const { id } = await this.fileInfoService.createUploadedFile(Object.assign(Object.assign({}, file), { refType:
|
|
2404
|
+
const { id } = await this.fileInfoService.createUploadedFile(Object.assign(Object.assign({}, file), { refType: "Post" /* IFileRefType.Post */, ref: postId, createdBy }));
|
|
2514
2405
|
const fileResponse = await this.fileInfoService.get(id);
|
|
2515
2406
|
return Object.assign(Object.assign({}, fileResponse), { url: this.fileInfoService.getDefaultImage(fileResponse.url) });
|
|
2516
2407
|
}
|
|
2517
2408
|
createFilesUploadLink(postId, filenames, userId) {
|
|
2518
2409
|
return Promise.all(filenames.map((filename) => this.fileInfoService.uploadByUrl({
|
|
2519
2410
|
filename,
|
|
2520
|
-
refType:
|
|
2411
|
+
refType: "Post" /* IFileRefType.Post */,
|
|
2521
2412
|
ref: postId,
|
|
2522
2413
|
userId,
|
|
2523
2414
|
})));
|
|
2524
2415
|
}
|
|
2525
2416
|
attachUploadedFiles(postId, files, createdBy) {
|
|
2526
2417
|
return Promise.all(files.map(async (file) => {
|
|
2527
|
-
const { id } = await this.fileInfoService.createUploadedFile(Object.assign(Object.assign({}, file), { refType:
|
|
2418
|
+
const { id } = await this.fileInfoService.createUploadedFile(Object.assign(Object.assign({}, file), { refType: "Post" /* IFileRefType.Post */, ref: postId, createdBy }));
|
|
2528
2419
|
const fileResponse = await this.fileInfoService.get(id);
|
|
2529
2420
|
return Object.assign(Object.assign({}, fileResponse), { url: this.fileInfoService.getDefaultImage(fileResponse.url) });
|
|
2530
2421
|
}));
|
|
@@ -2634,103 +2525,102 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2634
2525
|
exports.ChannelProxyService = void 0;
|
|
2635
2526
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2636
2527
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2637
|
-
const core_2 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2638
2528
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
2639
2529
|
let ChannelProxyService = class ChannelProxyService extends store_mongo_1.BaseProxyService {
|
|
2640
2530
|
constructor(broker, logger) {
|
|
2641
2531
|
super(broker, logger);
|
|
2642
|
-
this.topic =
|
|
2532
|
+
this.topic = "ChannelService" /* MoleculerTopics.ChannelService */;
|
|
2643
2533
|
this.logger = logger.child({ className: 'ChannelProxyService' });
|
|
2644
2534
|
}
|
|
2645
2535
|
addMemberToChannel(channelId, memberId) {
|
|
2646
|
-
return this.callAction(
|
|
2536
|
+
return this.callAction("addMemberToChannel" /* ChannelServiceCommands.addMemberToChannel */, { channelId, memberId });
|
|
2647
2537
|
}
|
|
2648
2538
|
createDirectChannel(data) {
|
|
2649
|
-
return this.callAction(
|
|
2539
|
+
return this.callAction("createDirectChannel" /* ChannelServiceCommands.createDirectChannel */, { data });
|
|
2650
2540
|
}
|
|
2651
2541
|
deleteChannel(id) {
|
|
2652
|
-
return this.callAction(
|
|
2542
|
+
return this.callAction("deleteChannel" /* ChannelServiceCommands.deleteChannel */, { id });
|
|
2653
2543
|
}
|
|
2654
2544
|
getByName(teamId, name) {
|
|
2655
|
-
return this.callAction(
|
|
2545
|
+
return this.callAction("getByName" /* ChannelServiceCommands.getByName */, { teamId, name });
|
|
2656
2546
|
}
|
|
2657
2547
|
getByNameIncludeDeleted(teamId, name) {
|
|
2658
|
-
return this.callAction(
|
|
2548
|
+
return this.callAction("getByNameIncludeDeleted" /* ChannelServiceCommands.getByNameIncludeDeleted */, { teamId, name });
|
|
2659
2549
|
}
|
|
2660
2550
|
getByNames(teamId, names) {
|
|
2661
|
-
return this.callAction(
|
|
2551
|
+
return this.callAction("getByNames" /* ChannelServiceCommands.getByNames */, { teamId, names });
|
|
2662
2552
|
}
|
|
2663
2553
|
getChannelCounts(teamId, userId) {
|
|
2664
|
-
return this.callAction(
|
|
2554
|
+
return this.callAction("getChannelCounts" /* ChannelServiceCommands.getChannelCounts */, { teamId, userId });
|
|
2665
2555
|
}
|
|
2666
2556
|
getChannelUnread(channelId, userId) {
|
|
2667
|
-
return this.callAction(
|
|
2557
|
+
return this.callAction("getChannelUnread" /* ChannelServiceCommands.getChannelUnread */, { channelId, userId });
|
|
2668
2558
|
}
|
|
2669
2559
|
getChannels(teamId, userId, includeDeleted, lastDeleteAt) {
|
|
2670
|
-
return this.callAction(
|
|
2560
|
+
return this.callAction("getChannels" /* ChannelServiceCommands.getChannels */, { teamId, userId, includeDeleted, lastDeleteAt });
|
|
2671
2561
|
}
|
|
2672
2562
|
getDeleted(teamId, offset, limit, userId) {
|
|
2673
|
-
return this.callAction(
|
|
2563
|
+
return this.callAction("getDeleted" /* ChannelServiceCommands.getDeleted */, { teamId, offset, limit, userId });
|
|
2674
2564
|
}
|
|
2675
2565
|
getDeletedByName(teamId, name) {
|
|
2676
|
-
return this.callAction(
|
|
2566
|
+
return this.callAction("getDeletedByName" /* ChannelServiceCommands.getDeletedByName */, { teamId, name });
|
|
2677
2567
|
}
|
|
2678
2568
|
getFromMaster(id) {
|
|
2679
|
-
return this.callAction(
|
|
2569
|
+
return this.callAction("getFromMaster" /* ChannelServiceCommands.getFromMaster */, { id });
|
|
2680
2570
|
}
|
|
2681
2571
|
getMoreChannels(teamId, userId, offset, limit) {
|
|
2682
|
-
return this.callAction(
|
|
2572
|
+
return this.callAction("getMoreChannels" /* ChannelServiceCommands.getMoreChannels */, { teamId, userId, offset, limit });
|
|
2683
2573
|
}
|
|
2684
2574
|
getPinnedPosts(channelId) {
|
|
2685
|
-
return this.callAction(
|
|
2575
|
+
return this.callAction("getPinnedPosts" /* ChannelServiceCommands.getPinnedPosts */, { channelId });
|
|
2686
2576
|
}
|
|
2687
2577
|
getPrivateChannelsForTeam(teamId, offset, limit) {
|
|
2688
|
-
return this.callAction(
|
|
2578
|
+
return this.callAction("getPrivateChannelsForTeam" /* ChannelServiceCommands.getPrivateChannelsForTeam */, { teamId, offset, limit });
|
|
2689
2579
|
}
|
|
2690
2580
|
getPublicChannelsByIdsForTeam(teamId, channelsIds) {
|
|
2691
|
-
return this.callAction(
|
|
2581
|
+
return this.callAction("getPublicChannelsByIdsForTeam" /* ChannelServiceCommands.getPublicChannelsByIdsForTeam */, { teamId, channelsIds });
|
|
2692
2582
|
}
|
|
2693
2583
|
getPublicChannelsForTeam(teamId, offset, limit) {
|
|
2694
|
-
return this.callAction(
|
|
2584
|
+
return this.callAction("getPublicChannelsForTeam" /* ChannelServiceCommands.getPublicChannelsForTeam */, { teamId, offset, limit });
|
|
2695
2585
|
}
|
|
2696
2586
|
getTeamChannels(teamId) {
|
|
2697
|
-
return this.callAction(
|
|
2587
|
+
return this.callAction("getTeamChannels" /* ChannelServiceCommands.getTeamChannels */, { teamId });
|
|
2698
2588
|
}
|
|
2699
2589
|
hideChannel(id) {
|
|
2700
|
-
return this.callAction(
|
|
2590
|
+
return this.callAction("hideChannel" /* ChannelServiceCommands.hideChannel */, { id });
|
|
2701
2591
|
}
|
|
2702
2592
|
invalidateChannelByName(teamId, name) {
|
|
2703
|
-
return this.callAction(
|
|
2593
|
+
return this.callAction("invalidateChannelByName" /* ChannelServiceCommands.invalidateChannelByName */, { teamId, name });
|
|
2704
2594
|
}
|
|
2705
2595
|
leaveChannel(id) {
|
|
2706
|
-
return this.callAction(
|
|
2596
|
+
return this.callAction("leaveChannel" /* ChannelServiceCommands.leaveChannel */, { id });
|
|
2707
2597
|
}
|
|
2708
2598
|
permanentDelete(channelId) {
|
|
2709
|
-
this.callAction(
|
|
2599
|
+
this.callAction("permanentDelete" /* ChannelServiceCommands.permanentDelete */, { channelId });
|
|
2710
2600
|
}
|
|
2711
2601
|
permanentDeleteByTeam(teamId) {
|
|
2712
|
-
this.callAction(
|
|
2602
|
+
this.callAction("permanentDeleteByTeam" /* ChannelServiceCommands.permanentDeleteByTeam */, { teamId });
|
|
2713
2603
|
}
|
|
2714
2604
|
permanentDeleteMembersByChannel(channelId) {
|
|
2715
|
-
this.callAction(
|
|
2605
|
+
this.callAction("permanentDeleteMembersByChannel" /* ChannelServiceCommands.permanentDeleteMembersByChannel */, { channelId });
|
|
2716
2606
|
}
|
|
2717
2607
|
restore(channelId, time) {
|
|
2718
|
-
return this.callAction(
|
|
2608
|
+
return this.callAction("restore" /* ChannelServiceCommands.restore */, { channelId, time });
|
|
2719
2609
|
}
|
|
2720
2610
|
saveChannel(data) {
|
|
2721
|
-
return this.callAction(
|
|
2611
|
+
return this.callAction("saveChannel" /* ChannelServiceCommands.saveChannel */, { data });
|
|
2722
2612
|
}
|
|
2723
2613
|
saveDirectChannel(channel) {
|
|
2724
|
-
return this.callAction(
|
|
2614
|
+
return this.callAction("saveDirectChannel" /* ChannelServiceCommands.saveDirectChannel */, { channel });
|
|
2725
2615
|
}
|
|
2726
2616
|
saveMultipleMembers(members) {
|
|
2727
|
-
return this.callAction(
|
|
2617
|
+
return this.callAction("saveMultipleMembers" /* ChannelServiceCommands.saveMultipleMembers */, { members });
|
|
2728
2618
|
}
|
|
2729
2619
|
isMember(channelId, user) {
|
|
2730
|
-
return this.callAction(
|
|
2620
|
+
return this.callAction("isMember" /* ChannelServiceCommands.isMember */, { id: channelId, user });
|
|
2731
2621
|
}
|
|
2732
2622
|
viewChannel(id, user) {
|
|
2733
|
-
return this.callAction(
|
|
2623
|
+
return this.callAction("viewChannel" /* ChannelServiceCommands.viewChannel */, { id, user });
|
|
2734
2624
|
}
|
|
2735
2625
|
};
|
|
2736
2626
|
ChannelProxyService = __decorate([
|
|
@@ -2794,19 +2684,18 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2794
2684
|
exports.MessengerNotificationMicroservice = void 0;
|
|
2795
2685
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2796
2686
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2797
|
-
const core_2 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2798
2687
|
let MessengerNotificationMicroservice = class MessengerNotificationMicroservice {
|
|
2799
2688
|
constructor(broker, logger) {
|
|
2800
2689
|
this.broker = broker;
|
|
2801
2690
|
this.logger = logger;
|
|
2802
|
-
this.topic =
|
|
2691
|
+
this.topic = "MessengerNotificationService" /* IMoleculerTopics.MessengerNotificationService */;
|
|
2803
2692
|
this.logger = logger.child({ className: 'MessengerNotificationMicroservice' });
|
|
2804
2693
|
}
|
|
2805
2694
|
async callAction(command, params) {
|
|
2806
2695
|
return this.broker.call(`${this.topic}.${command}`, params);
|
|
2807
2696
|
}
|
|
2808
2697
|
sendNotificationOfUnreadMessages(unit, value) {
|
|
2809
|
-
return this.callAction(
|
|
2698
|
+
return this.callAction("sendNotificationOfUnreadMessages" /* IMessengerNotificationServiceCommands.sendNotificationOfUnreadMessages */, {
|
|
2810
2699
|
unit,
|
|
2811
2700
|
value,
|
|
2812
2701
|
});
|
|
@@ -2842,34 +2731,33 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2842
2731
|
exports.PostProxyService = void 0;
|
|
2843
2732
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2844
2733
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2845
|
-
const core_2 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2846
2734
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
2847
2735
|
let PostProxyService = class PostProxyService extends store_mongo_1.BaseProxyService {
|
|
2848
2736
|
constructor(broker, logger) {
|
|
2849
2737
|
super(broker, logger);
|
|
2850
|
-
this.topic =
|
|
2738
|
+
this.topic = "PostService" /* MoleculerTopics.PostService */;
|
|
2851
2739
|
this.logger = logger.child({ className: 'PostProxyService' });
|
|
2852
2740
|
}
|
|
2853
2741
|
attachUploadedFile(postId, file, createdBy) {
|
|
2854
|
-
return this.callAction(
|
|
2742
|
+
return this.callAction("attachUploadedFile" /* IPostServiceCommands.attachUploadedFile */, { file, createdBy, postId });
|
|
2855
2743
|
}
|
|
2856
2744
|
createFileUploadLink(postId, filename, userId) {
|
|
2857
|
-
return this.callAction(
|
|
2745
|
+
return this.callAction("createFileUploadLink" /* IPostServiceCommands.createFileUploadLink */, { filename, userId, postId });
|
|
2858
2746
|
}
|
|
2859
2747
|
attachUploadedFiles(postId, files, createdBy) {
|
|
2860
|
-
return this.callAction(
|
|
2748
|
+
return this.callAction("attachUploadedFiles" /* IPostServiceCommands.attachUploadedFiles */, { files, createdBy, postId });
|
|
2861
2749
|
}
|
|
2862
2750
|
createFilesUploadLink(postId, filenames, userId) {
|
|
2863
|
-
return this.callAction(
|
|
2751
|
+
return this.callAction("createFilesUploadLink" /* IPostServiceCommands.createFilesUploadLink */, { filenames, userId, postId });
|
|
2864
2752
|
}
|
|
2865
2753
|
deleteFile(url) {
|
|
2866
|
-
return this.callAction(
|
|
2754
|
+
return this.callAction("deleteFile" /* IPostServiceCommands.deleteFile */, { url });
|
|
2867
2755
|
}
|
|
2868
2756
|
readMessage(messageId, user) {
|
|
2869
|
-
return this.callAction(
|
|
2757
|
+
return this.callAction("readMessage" /* IPostServiceCommands.readMessage */, Object.assign(Object.assign({}, messageId), { user }));
|
|
2870
2758
|
}
|
|
2871
2759
|
deliverMessage(messageId, user) {
|
|
2872
|
-
return this.callAction(
|
|
2760
|
+
return this.callAction("deliverMessage" /* IPostServiceCommands.deliverMessage */, Object.assign(Object.assign({}, messageId), { user }));
|
|
2873
2761
|
}
|
|
2874
2762
|
};
|
|
2875
2763
|
PostProxyService = __decorate([
|
|
@@ -2902,12 +2790,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2902
2790
|
exports.PostThreadMicroservice = void 0;
|
|
2903
2791
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2904
2792
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2905
|
-
const core_2 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2906
2793
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
2907
2794
|
let PostThreadMicroservice = class PostThreadMicroservice extends store_mongo_1.BaseProxyService {
|
|
2908
2795
|
constructor(broker, logger) {
|
|
2909
2796
|
super(broker, logger);
|
|
2910
|
-
this.topic =
|
|
2797
|
+
this.topic = "PostThreadService" /* MoleculerTopics.PostThreadService */;
|
|
2911
2798
|
this.logger = logger.child({ className: 'PostThreadMicroservice' });
|
|
2912
2799
|
}
|
|
2913
2800
|
};
|
|
@@ -2941,12 +2828,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
2941
2828
|
exports.ReactionMicroservice = void 0;
|
|
2942
2829
|
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
2943
2830
|
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
2944
|
-
const core_2 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
2945
2831
|
const store_mongo_1 = __webpack_require__(/*! @common-stack/store-mongo */ "@common-stack/store-mongo");
|
|
2946
2832
|
let ReactionMicroservice = class ReactionMicroservice extends store_mongo_1.BaseProxyService {
|
|
2947
2833
|
constructor(broker, logger) {
|
|
2948
2834
|
super(broker, logger);
|
|
2949
|
-
this.topic =
|
|
2835
|
+
this.topic = "ReactionService" /* MoleculerTopics.ReactionService */;
|
|
2950
2836
|
this.logger = logger.child({ className: 'ReactionMicroservice' });
|
|
2951
2837
|
}
|
|
2952
2838
|
};
|
|
@@ -3033,12 +2919,11 @@ __exportStar(__webpack_require__(/*! ./repositories */ "./src/store/repositories
|
|
|
3033
2919
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3034
2920
|
exports.ChannelModelFunc = void 0;
|
|
3035
2921
|
const mongoose_1 = __webpack_require__(/*! mongoose */ "mongoose");
|
|
3036
|
-
const core_1 = __webpack_require__(/*! @messenger-box/core */ "@messenger-box/core");
|
|
3037
2922
|
const common_options_1 = __webpack_require__(/*! ./common-options */ "./src/store/models/common-options.ts");
|
|
3038
2923
|
const channelModelSchema = new mongoose_1.Schema({
|
|
3039
2924
|
type: {
|
|
3040
2925
|
type: mongoose_1.Schema.Types.String,
|
|
3041
|
-
enum: [
|
|
2926
|
+
enum: ["CHANNEL" /* IRoomType.CHANNEL */, "DIRECT" /* IRoomType.DIRECT */, "GROUP" /* IRoomType.GROUP */, "PRIVATE" /* IRoomType.PRIVATE */, "VISITOR" /* IRoomType.VISITOR */],
|
|
3042
2927
|
required: true,
|
|
3043
2928
|
},
|
|
3044
2929
|
members: [
|
|
@@ -3469,16 +3354,6 @@ module.exports = require("@container-stack/file-info-core");
|
|
|
3469
3354
|
|
|
3470
3355
|
/***/ }),
|
|
3471
3356
|
|
|
3472
|
-
/***/ "@messenger-box/core":
|
|
3473
|
-
/*!**************************************!*\
|
|
3474
|
-
!*** external "@messenger-box/core" ***!
|
|
3475
|
-
\**************************************/
|
|
3476
|
-
/***/ ((module) => {
|
|
3477
|
-
|
|
3478
|
-
module.exports = require("@messenger-box/core");
|
|
3479
|
-
|
|
3480
|
-
/***/ }),
|
|
3481
|
-
|
|
3482
3357
|
/***/ "@messenger-box/notification-api-core":
|
|
3483
3358
|
/*!*******************************************************!*\
|
|
3484
3359
|
!*** external "@messenger-box/notification-api-core" ***!
|