@messenger-box/property-ext-server 9.0.4-alpha.8 → 10.0.2-alpha.0
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 +37 -33
- package/lib/index.js.map +1 -1
- package/package.json +8 -8
package/lib/index.js
CHANGED
|
@@ -263,8 +263,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
263
263
|
/* harmony import */ var moleculer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moleculer__WEBPACK_IMPORTED_MODULE_2__);
|
|
264
264
|
/* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bunyan */ "bunyan");
|
|
265
265
|
/* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bunyan__WEBPACK_IMPORTED_MODULE_3__);
|
|
266
|
-
/* harmony import */ var
|
|
267
|
-
/* harmony import */ var
|
|
266
|
+
/* harmony import */ var common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! common */ "common");
|
|
267
|
+
/* harmony import */ var common__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(common__WEBPACK_IMPORTED_MODULE_4__);
|
|
268
268
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
269
269
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
270
270
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -323,14 +323,14 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
323
323
|
return Promise.all([userOne, userTwo]);
|
|
324
324
|
}
|
|
325
325
|
createServiceChannel(owner) {
|
|
326
|
-
return this.broker.call(`${
|
|
326
|
+
return this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Create}`, {
|
|
327
327
|
data: {
|
|
328
328
|
topic: 'CustomerSupportServiceChat',
|
|
329
329
|
title: `${_config__WEBPACK_IMPORTED_MODULE_5__.config.APP_NAME} SUPPORT`,
|
|
330
330
|
description: `${_config__WEBPACK_IMPORTED_MODULE_5__.config.APP_NAME} SUPPORT SERVICE`,
|
|
331
331
|
creator: owner.id,
|
|
332
332
|
displayName: `followup-support-${owner.id}`,
|
|
333
|
-
type:
|
|
333
|
+
type: common__WEBPACK_IMPORTED_MODULE_4__.IRoomType.Service,
|
|
334
334
|
members: [
|
|
335
335
|
{
|
|
336
336
|
id: undefined,
|
|
@@ -343,13 +343,13 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
createChannel(owner, guest) {
|
|
346
|
-
return this.broker.call(`${
|
|
346
|
+
return this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Create}`, {
|
|
347
347
|
data: {
|
|
348
348
|
topic: 'Fixtures',
|
|
349
349
|
title: `${owner.alias}:${guest.alias}`,
|
|
350
350
|
creator: guest.id,
|
|
351
351
|
displayName: `${owner.id}:${guest.id}`,
|
|
352
|
-
type:
|
|
352
|
+
type: common__WEBPACK_IMPORTED_MODULE_4__.IRoomType.Direct,
|
|
353
353
|
members: [
|
|
354
354
|
{
|
|
355
355
|
id: undefined,
|
|
@@ -368,24 +368,24 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
370
|
async createSimpleMessage(channelId, editedBy) {
|
|
371
|
-
return this.broker.call(`${
|
|
371
|
+
return this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Create}`, {
|
|
372
372
|
data: {
|
|
373
373
|
editedBy: editedBy,
|
|
374
374
|
channel: channelId,
|
|
375
375
|
message: 'Hello from the migrations',
|
|
376
|
-
type:
|
|
376
|
+
type: common__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Simple,
|
|
377
377
|
files: [],
|
|
378
378
|
},
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
async createAlertMessage(channelId, editedBy) {
|
|
382
382
|
const message = 'This is a dummy alert!';
|
|
383
|
-
return this.broker.call(`${
|
|
383
|
+
return this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Create}`, {
|
|
384
384
|
data: {
|
|
385
385
|
editedBy: editedBy,
|
|
386
386
|
channel: channelId,
|
|
387
387
|
message,
|
|
388
|
-
type:
|
|
388
|
+
type: common__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Alert,
|
|
389
389
|
files: [],
|
|
390
390
|
props: {
|
|
391
391
|
ref: 'Dummy',
|
|
@@ -405,12 +405,12 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
405
405
|
}
|
|
406
406
|
async createCardMessage(channelId, editedBy) {
|
|
407
407
|
const message = 'Inquiry for fixture property';
|
|
408
|
-
return this.broker.call(`${
|
|
408
|
+
return this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Create}`, {
|
|
409
409
|
data: {
|
|
410
410
|
editedBy: editedBy,
|
|
411
411
|
channel: channelId,
|
|
412
412
|
message,
|
|
413
|
-
type:
|
|
413
|
+
type: common__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Card,
|
|
414
414
|
files: [],
|
|
415
415
|
props: {
|
|
416
416
|
ref: 'Property',
|
|
@@ -442,10 +442,10 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
442
442
|
async waitForServices() {
|
|
443
443
|
if (_config__WEBPACK_IMPORTED_MODULE_5__.config.isDev) {
|
|
444
444
|
await Promise.all([
|
|
445
|
-
this.broker.waitForServices(`${
|
|
445
|
+
this.broker.waitForServices(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}`),
|
|
446
446
|
this.broker.waitForServices('AccountUser'),
|
|
447
|
-
this.broker.waitForServices(`${
|
|
448
|
-
this.broker.waitForServices(`${
|
|
447
|
+
this.broker.waitForServices(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}`),
|
|
448
|
+
this.broker.waitForServices(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostThreadService}`),
|
|
449
449
|
]);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
@@ -494,7 +494,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
496
|
const [userOne, userTwo] = users;
|
|
497
|
-
const [channel] = await this.broker.call(`${
|
|
497
|
+
const [channel] = await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.GetAll}`, {
|
|
498
498
|
criteria: {
|
|
499
499
|
displayName: `${userTwo.id}:${userOne.id}`,
|
|
500
500
|
},
|
|
@@ -503,15 +503,15 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
503
503
|
this.logger.debug(`(down) No Channel found, skipping channel delete!`);
|
|
504
504
|
}
|
|
505
505
|
else {
|
|
506
|
-
const posts = await this.broker.call(`${
|
|
506
|
+
const posts = await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.getAll`, {
|
|
507
507
|
criteria: {
|
|
508
508
|
channel: channel.id,
|
|
509
509
|
},
|
|
510
510
|
});
|
|
511
|
-
await Promise.all(posts.map(({ id }) => this.broker.call(`${
|
|
511
|
+
await Promise.all(posts.map(({ id }) => this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.delete`, {
|
|
512
512
|
id,
|
|
513
513
|
})));
|
|
514
|
-
await this.broker.call(`${
|
|
514
|
+
await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Delete}`, {
|
|
515
515
|
id: channel.id,
|
|
516
516
|
});
|
|
517
517
|
}
|
|
@@ -528,7 +528,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
530
|
const [serviceUser] = serviceUsers;
|
|
531
|
-
const [servicehannel] = await this.broker.call(`${
|
|
531
|
+
const [servicehannel] = await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.GetAll}`, {
|
|
532
532
|
criteria: {
|
|
533
533
|
displayName: `followup-support-${serviceUser?.id}`,
|
|
534
534
|
},
|
|
@@ -538,23 +538,23 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
|
|
|
538
538
|
this.logger.debug(`(down) No Service Channel found, skipping service channel delete!`);
|
|
539
539
|
}
|
|
540
540
|
else {
|
|
541
|
-
const posts = await this.broker.call(`${
|
|
541
|
+
const posts = await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.getAll`, {
|
|
542
542
|
criteria: {
|
|
543
543
|
channel: servicehannel.id,
|
|
544
544
|
},
|
|
545
545
|
});
|
|
546
|
-
await Promise.all(posts.map(({ id }) => this.broker.call(`${
|
|
546
|
+
await Promise.all(posts.map(({ id }) => this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostService}.delete`, {
|
|
547
547
|
id,
|
|
548
548
|
})));
|
|
549
|
-
const postsThreads = await this.broker.call(`${
|
|
549
|
+
const postsThreads = await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostThreadService}.getAll`, {
|
|
550
550
|
criteria: {
|
|
551
551
|
channel: servicehannel.id,
|
|
552
552
|
},
|
|
553
553
|
});
|
|
554
|
-
await Promise.all(postsThreads.map(({ id }) => this.broker.call(`${
|
|
554
|
+
await Promise.all(postsThreads.map(({ id }) => this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.PostThreadService}.delete`, {
|
|
555
555
|
id,
|
|
556
556
|
})));
|
|
557
|
-
await this.broker.call(`${
|
|
557
|
+
await this.broker.call(`${common__WEBPACK_IMPORTED_MODULE_4__.IMoleculerTopics.ChannelService}.${common__WEBPACK_IMPORTED_MODULE_4__.IBaseServiceCommands.Delete}`, {
|
|
558
558
|
id: servicehannel.id,
|
|
559
559
|
});
|
|
560
560
|
}
|
|
@@ -627,23 +627,23 @@ module.exports = require("@common-stack/server-core");
|
|
|
627
627
|
|
|
628
628
|
/***/ }),
|
|
629
629
|
|
|
630
|
-
/***/ "
|
|
631
|
-
|
|
632
|
-
!*** external "
|
|
633
|
-
|
|
630
|
+
/***/ "bunyan":
|
|
631
|
+
/*!*************************!*\
|
|
632
|
+
!*** external "bunyan" ***!
|
|
633
|
+
\*************************/
|
|
634
634
|
/***/ ((module) => {
|
|
635
635
|
|
|
636
|
-
module.exports = require("
|
|
636
|
+
module.exports = require("bunyan");
|
|
637
637
|
|
|
638
638
|
/***/ }),
|
|
639
639
|
|
|
640
|
-
/***/ "
|
|
640
|
+
/***/ "common":
|
|
641
641
|
/*!*************************!*\
|
|
642
|
-
!*** external "
|
|
642
|
+
!*** external "common" ***!
|
|
643
643
|
\*************************/
|
|
644
644
|
/***/ ((module) => {
|
|
645
645
|
|
|
646
|
-
module.exports = require("
|
|
646
|
+
module.exports = require("common");
|
|
647
647
|
|
|
648
648
|
/***/ }),
|
|
649
649
|
|
|
@@ -746,6 +746,8 @@ module.exports = require("moleculer");
|
|
|
746
746
|
/******/
|
|
747
747
|
/************************************************************************/
|
|
748
748
|
var __webpack_exports__ = {};
|
|
749
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
750
|
+
(() => {
|
|
749
751
|
/*!**********************!*\
|
|
750
752
|
!*** ./src/index.ts ***!
|
|
751
753
|
\**********************/
|
|
@@ -756,6 +758,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
756
758
|
/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module */ "./src/module.ts");
|
|
757
759
|
|
|
758
760
|
|
|
761
|
+
})();
|
|
762
|
+
|
|
759
763
|
module.exports = __webpack_exports__;
|
|
760
764
|
/******/ })()
|
|
761
765
|
;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,0BAA0B,wBAAwB,GAAG;;;;;;;;;;;;;;;;ACAtB;AAG9C,MAAM,GAAG,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;AAE7C,MAAM,MAAM,GAAG,iDAAQ,CAAC,GAAG,EAAE;IAChC,QAAQ,EAAE,4CAAG,CAAC,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACnG,mBAAmB,EAAE,4CAAG,CAAC;QACrB,OAAO,EAAE,6EAA6E;KACzF,CAAC;IACF,sBAAsB,EAAE,4CAAG,CAAC;QACxB,OAAO,EAAE,gFAAgF;KAC5F,CAAC;IACF,QAAQ,EAAE,4CAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC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C,iEAAe,IAAI,8DAAO,CAAC;IACvB,MAAM;IACN,mBAAmB,EAAE,CAAC,gEAAuB,CAAC;CACjD,CAAC,EAAC;;;;;;;;;;;ACPH;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;ACNmC","sources":["webpack://@messenger-box/property-ext-server/./src/graphql/schema/post.graphql","webpack://@messenger-box/property-ext-server/./src/config/env-config.ts","webpack://@messenger-box/property-ext-server/./src/config/index.ts","webpack://@messenger-box/property-ext-server/./src/containers/container.ts","webpack://@messenger-box/property-ext-server/./src/containers/index.ts","webpack://@messenger-box/property-ext-server/./src/graphql/index.ts","webpack://@messenger-box/property-ext-server/./src/graphql/schema/index.ts","webpack://@messenger-box/property-ext-server/./src/migrations/bot-user-migration.ts","webpack://@messenger-box/property-ext-server/./src/migrations/index.ts","webpack://@messenger-box/property-ext-server/./src/migrations/property-ext-messages-migration.ts","webpack://@messenger-box/property-ext-server/./src/module.ts","webpack://@messenger-box/property-ext-server/external commonjs \"@common-stack/core\"","webpack://@messenger-box/property-ext-server/external commonjs \"@common-stack/server-core\"","webpack://@messenger-box/property-ext-server/external commonjs \"@messenger-box/property-ext-core\"","webpack://@messenger-box/property-ext-server/external commonjs \"bunyan\"","webpack://@messenger-box/property-ext-server/external commonjs \"envalid\"","webpack://@messenger-box/property-ext-server/external commonjs \"inversify\"","webpack://@messenger-box/property-ext-server/external commonjs \"moleculer\"","webpack://@messenger-box/property-ext-server/webpack/bootstrap","webpack://@messenger-box/property-ext-server/webpack/runtime/compat get default export","webpack://@messenger-box/property-ext-server/webpack/runtime/define property getters","webpack://@messenger-box/property-ext-server/webpack/runtime/hasOwnProperty shorthand","webpack://@messenger-box/property-ext-server/webpack/runtime/make namespace object","webpack://@messenger-box/property-ext-server/./src/index.ts"],"sourcesContent":["export default \"extend enum PostTypeEnum{\\n ALERT\\n CARD\\n}\\n\";","import { str, cleanEnv, json } from 'envalid';\nimport { IntegrationConnections, Integrations } from '@adminide-stack/core';\n\nconst env = (process as any).APP_ENV || process.env;\n\nexport const config = cleanEnv(env, {\n NODE_ENV: str({ choices: ['production', 'test', 'staging', 'development'], default: 'production' }),\n POST_DATA_FILE_PATH: str({\n default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/post.json',\n }),\n CHANNEL_DATA_FILE_PATH: str({\n default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/channel.json',\n }),\n APP_NAME: str({ devDefault: 'Support' }),\n});\n","export * from './env-config';\n","import { ContainerModule, interfaces } from 'inversify';\nimport { BotUserMigration, PropertyExtMessagesMigration } from '../migrations';\n\nexport const propertyContainerModule: (settings) => interfaces.ContainerModule = () =>\n new ContainerModule((bind: interfaces.Bind) => {\n bind('MongodbMigration').to(BotUserMigration).whenTargetNamed(BotUserMigration.name);\n bind('MongodbMigration').to(PropertyExtMessagesMigration).whenTargetNamed(PropertyExtMessagesMigration.name);\n });\n","export * from './container';\n","export { schema } from './schema';\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport post from './post.graphql';\n\nexport const schema = [post].join('/n');\n","import { inject, injectable } from 'inversify';\nimport { CommonType } from '@common-stack/core';\nimport { ServiceBroker } from 'moleculer';\nimport { IDatabaseMigration } from '@adminide-stack/core';\nimport * as Logger from 'bunyan';\nimport { config } from '../config';\n\n@injectable()\nexport class BotUserMigration implements IDatabaseMigration {\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n private logger: Logger,\n ) {\n this.logger = logger.child({ className: BotUserMigration.name });\n }\n\n protected name = 'BotUserMigration';\n\n id = `${this.constructor.name}_20220502`;\n\n async up(): Promise<void> {\n await this.down();\n this.logger.debug(`(up) Starting up migration...`);\n const user = await this.broker.call(`AccountUser.createAccount`, {\n account: {\n username: 'resortifi',\n email: 'resortifi-bot@resortifi.com',\n alias: 'resortifi',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n this.logger.debug(`(up) done`, user);\n }\n\n async down(): Promise<void> {\n if (config.isDev) {\n await this.broker.waitForServices('AccountUser');\n }\n this.logger.debug(`(down) Starting down migration...`);\n const user = await this.broker.call<{ id: string }, { email: string }>(`AccountUser.findAccountByEmail`, {\n email: 'resortifi-bot@resortifi.com',\n });\n if (!user) {\n return;\n }\n this.logger.debug(`(down) User Found, dropping...`, user);\n await this.broker.call(`AccountUser.deleteAccount`, {\n account: {\n id: user.id,\n },\n });\n this.logger.debug(`(down) User drop done!`);\n }\n}\n","export { PropertyExtMessagesMigration } from './property-ext-messages-migration';\nexport { BotUserMigration } from './bot-user-migration';\n","import { inject, injectable } from 'inversify';\nimport { IDatabaseMigration, IUserAccount } from '@adminide-stack/core';\nimport { CommonType } from '@common-stack/core';\nimport { ServiceBroker } from 'moleculer';\nimport * as Logger from 'bunyan';\nimport { IChannel, IPost, IPostThread, IPostTypeEnum } from '@messenger-box/property-ext-core';\nimport { IBaseServiceCommands, IMoleculerTopics, IRoomType } from '@messenger-box/core';\nimport { config } from '../config';\n\n@injectable()\nexport class PropertyExtMessagesMigration implements IDatabaseMigration {\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n private logger: Logger,\n ) {\n this.logger = logger.child({ className: PropertyExtMessagesMigration.name });\n }\n\n protected name = this.constructor.name;\n\n id = `${this.name}_20231006`;\n\n private async createUsers(): Promise<[IUserAccount, IUserAccount]> {\n const userOne = this.broker.call<IUserAccount, unknown>(`AccountUser.createAccount`, {\n account: {\n username: 'propertyAutomatedUser',\n email: 'property-automated-user@resortifi.com',\n alias: 'auth0|62df21f9e8116e9fce8207cf', // This need to match with auth0 id. Otherwise manually updatein the DB\n familyName: 'property-fixure',\n givenName: 'user1',\n picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n const userTwo = this.broker.call<IUserAccount, unknown>(`AccountUser.createAccount`, {\n account: {\n username: 'propertyAutomatedUser2',\n email: 'property-automated-user2@resortifi.com',\n alias: 'auth0|62df22109b1f5f6077c1f57e', // This need to match with auth0 id. Otherwise manually updatein the DB\n familyName: 'property-fixure',\n givenName: 'user2',\n picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n return Promise.all([userOne, userTwo]);\n }\n\n private createServiceChannel(owner: IUserAccount): Promise<IChannel> {\n return this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Create}`, {\n data: {\n topic: 'CustomerSupportServiceChat',\n title: `${config.APP_NAME} SUPPORT`,\n description: `${config.APP_NAME} SUPPORT SERVICE`,\n creator: owner.id as never,\n displayName: `followup-support-${owner.id}`,\n type: IRoomType.Service,\n members: [\n {\n id: undefined,\n schemeAdmin: false,\n roles: 'OWNER',\n user: owner.id as never,\n },\n ],\n },\n });\n }\n\n private createChannel(owner: IUserAccount, guest: IUserAccount): Promise<IChannel> {\n return this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Create}`, {\n data: {\n topic: 'Fixtures',\n title: `${owner.alias}:${guest.alias}`,\n creator: guest.id as never,\n displayName: `${owner.id}:${guest.id}`,\n type: IRoomType.Direct,\n members: [\n {\n id: undefined,\n schemeAdmin: false,\n roles: 'OWNER',\n user: owner.id as never,\n },\n {\n id: undefined,\n schemeAdmin: true,\n roles: 'GUEST',\n user: guest.id as never,\n },\n ],\n },\n });\n }\n\n private async createSimpleMessage(channelId: string, editedBy: string) {\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message: 'Hello from the migrations',\n type: IPostTypeEnum.Simple as never,\n files: [],\n },\n });\n }\n\n private async createAlertMessage(channelId: string, editedBy: string) {\n const message = 'This is a dummy alert!';\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message,\n type: IPostTypeEnum.Alert as never,\n files: [],\n props: {\n ref: 'Dummy',\n refId: 'some-ref',\n attachment: {\n title: message,\n isTitleHtml: false,\n icon: 'InfoIcon',\n callToAction: {\n title: 'View',\n link: `/some-route/some-id`,\n },\n },\n },\n },\n });\n }\n\n private async createCardMessage(channelId: string, editedBy: string) {\n const message = 'Inquiry for fixture property';\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message,\n type: IPostTypeEnum.Card as never,\n files: [],\n props: {\n ref: 'Property',\n refId: 'some-property-id',\n attachment: {\n image: 'https://placehold.co/300',\n title: message,\n isTitleHtml: false,\n description:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis interdum leo augue, non posuere sapien ullamcorper ac. Aliquam vitae ornare libero, ac vulputate elit. Aenean interdum, mi a viverra maximus, leo nibh maximus augue, vel ultrices leo ante et ex. Maecenas vel mi auctor, egestas tellus nec, placerat odio. Curabitur eget tortor sed ligula pharetra varius. Aliquam sit amet lacus ligula. Etiam vitae magna eros.',\n isDescriptionHtml: false,\n callToAction: {\n title: 'View',\n // Should come from frontend\n link: `/property/some-id`,\n },\n property: {\n price: 10,\n priceType: 'Hourly',\n type: 'Hotel',\n totalStar: 5,\n maxPeople: 500,\n totalReview: 450,\n },\n },\n },\n },\n });\n }\n\n private async waitForServices() {\n if (config.isDev) {\n await Promise.all([\n this.broker.waitForServices(`${IMoleculerTopics.ChannelService}`),\n this.broker.waitForServices('AccountUser'),\n this.broker.waitForServices(`${IMoleculerTopics.PostService}`),\n this.broker.waitForServices(`${IMoleculerTopics.PostThreadService}`),\n ]);\n }\n }\n\n async up(): Promise<void> {\n await this.down();\n await this.waitForServices();\n // await this.down();\n this.logger.debug(`(up) Starting up migration...`);\n const users = await this.createUsers();\n if (!users) {\n return;\n }\n this.logger.debug('(up) users created...');\n const channel = await this.createChannel(users[0], users[1]);\n if (!channel) {\n return;\n }\n this.logger.debug('(up) channel created...');\n\n await Promise.all([\n this.createSimpleMessage(channel.id, users[0].id),\n this.createAlertMessage(channel.id, users[0].id),\n this.createCardMessage(channel.id, users[0].id),\n ]);\n this.logger.debug('(up) messages created...');\n\n const serviceChannel = await this.createServiceChannel(users[1]);\n if (!serviceChannel) {\n return;\n }\n this.logger.debug('(up) service channel created...');\n }\n\n async down(): Promise<void> {\n this.logger.debug(`(down) Starting down migration...`);\n await this.waitForServices();\n try {\n const users = await this.broker.call<IUserAccount[], unknown>('AccountUser.getAll', {\n options: {\n criteria: {\n email: {\n $in: ['property-automated-user@resortifi.com', 'property-automated-user2@resortifi.com'],\n },\n },\n },\n });\n\n if (!users.length) {\n this.logger.debug(`(down) No Users found, skipping migrations!`);\n return;\n }\n\n const [userOne, userTwo] = users;\n\n const [channel] = await this.broker.call<any, any>(\n `${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.GetAll}`,\n {\n criteria: {\n displayName: `${userTwo.id}:${userOne.id}`,\n },\n },\n );\n if (!channel?.id) {\n this.logger.debug(`(down) No Channel found, skipping channel delete!`);\n } else {\n const posts = await this.broker.call<IPost[], unknown>(`${IMoleculerTopics.PostService}.getAll`, {\n criteria: {\n channel: channel.id,\n },\n });\n await Promise.all(\n posts.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostService}.delete`, {\n id,\n }),\n ),\n );\n await this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Delete}`, {\n id: channel.id,\n });\n }\n /////////////////////////....Service Channel....//////////////////////////////////\n const serviceUsers = await this.broker.call<IUserAccount[], unknown>('AccountUser.getAll', {\n options: {\n criteria: {\n email: 'property-automated-user2@resortifi.com',\n },\n },\n });\n\n if (!serviceUsers.length) {\n this.logger.debug(`(down) No service Users found, skipping migrations!`);\n return;\n }\n const [serviceUser] = serviceUsers;\n const [servicehannel] = await this.broker.call<any, any>(\n `${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.GetAll}`,\n {\n criteria: {\n displayName: `followup-support-${serviceUser?.id}`,\n },\n },\n );\n this.logger.debug(`servicehannel = ${JSON.stringify(servicehannel)}`);\n if (!servicehannel?.id) {\n this.logger.debug(`(down) No Service Channel found, skipping service channel delete!`);\n } else {\n const posts = await this.broker.call<IPost[], unknown>(`${IMoleculerTopics.PostService}.getAll`, {\n criteria: {\n channel: servicehannel.id,\n },\n });\n await Promise.all(\n posts.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostService}.delete`, {\n id,\n }),\n ),\n );\n const postsThreads = await this.broker.call<IPostThread[], unknown>(\n `${IMoleculerTopics.PostThreadService}.getAll`,\n {\n criteria: {\n channel: servicehannel.id,\n },\n },\n );\n await Promise.all(\n postsThreads.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostThreadService}.delete`, {\n id,\n }),\n ),\n );\n await this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Delete}`, {\n id: servicehannel.id,\n });\n }\n /////////////////////////....Service Channel.... end//////////////////////////////////\n await Promise.all(\n users.map(({ id }) =>\n this.broker.call(`AccountUser.deleteAccount`, {\n account: {\n id,\n },\n }),\n ),\n );\n this.logger.debug(`(down) Successful`);\n } catch (e) {\n this.logger.error(e.message, e.stack);\n }\n }\n}\n","import { Feature } from '@common-stack/server-core';\nimport { propertyContainerModule } from './containers';\nimport { schema } from './graphql';\n\nexport default new Feature({\n schema,\n createContainerFunc: [propertyContainerModule],\n});\n","module.exports = require(\"@common-stack/core\");","module.exports = require(\"@common-stack/server-core\");","module.exports = require(\"@messenger-box/property-ext-core\");","module.exports = require(\"bunyan\");","module.exports = require(\"envalid\");","module.exports = require(\"inversify\");","module.exports = require(\"moleculer\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { default } from './module';\n"],"names":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";;;;;;;;;;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A;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNmC","sources":["webpack://@messenger-box/property-ext-server/./src/graphql/schema/post.graphql","webpack://@messenger-box/property-ext-server/./src/config/env-config.ts","webpack://@messenger-box/property-ext-server/./src/config/index.ts","webpack://@messenger-box/property-ext-server/./src/containers/container.ts","webpack://@messenger-box/property-ext-server/./src/containers/index.ts","webpack://@messenger-box/property-ext-server/./src/graphql/index.ts","webpack://@messenger-box/property-ext-server/./src/graphql/schema/index.ts","webpack://@messenger-box/property-ext-server/./src/migrations/bot-user-migration.ts","webpack://@messenger-box/property-ext-server/./src/migrations/index.ts","webpack://@messenger-box/property-ext-server/./src/migrations/property-ext-messages-migration.ts","webpack://@messenger-box/property-ext-server/./src/module.ts","webpack://@messenger-box/property-ext-server/external commonjs \"@common-stack/core\"","webpack://@messenger-box/property-ext-server/external commonjs \"@common-stack/server-core\"","webpack://@messenger-box/property-ext-server/external commonjs \"bunyan\"","webpack://@messenger-box/property-ext-server/external commonjs \"common\"","webpack://@messenger-box/property-ext-server/external commonjs \"envalid\"","webpack://@messenger-box/property-ext-server/external commonjs \"inversify\"","webpack://@messenger-box/property-ext-server/external commonjs \"moleculer\"","webpack://@messenger-box/property-ext-server/webpack/bootstrap","webpack://@messenger-box/property-ext-server/webpack/runtime/compat get default export","webpack://@messenger-box/property-ext-server/webpack/runtime/define property getters","webpack://@messenger-box/property-ext-server/webpack/runtime/hasOwnProperty shorthand","webpack://@messenger-box/property-ext-server/webpack/runtime/make namespace object","webpack://@messenger-box/property-ext-server/./src/index.ts"],"sourcesContent":["export default \"extend enum PostTypeEnum{\\n ALERT\\n CARD\\n}\\n\";","import { str, cleanEnv, json } from 'envalid';\nimport { IntegrationConnections, Integrations } from '@adminide-stack/core';\n\nconst env = (process as any).APP_ENV || process.env;\n\nexport const config = cleanEnv(env, {\n NODE_ENV: str({ choices: ['production', 'test', 'staging', 'development'], default: 'production' }),\n POST_DATA_FILE_PATH: str({\n default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/post.json',\n }),\n CHANNEL_DATA_FILE_PATH: str({\n default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/channel.json',\n }),\n APP_NAME: str({ devDefault: 'Support' }),\n});\n","export * from './env-config';\n","import { ContainerModule, interfaces } from 'inversify';\nimport { BotUserMigration, PropertyExtMessagesMigration } from '../migrations';\n\nexport const propertyContainerModule: (settings) => interfaces.ContainerModule = () =>\n new ContainerModule((bind: interfaces.Bind) => {\n bind('MongodbMigration').to(BotUserMigration).whenTargetNamed(BotUserMigration.name);\n bind('MongodbMigration').to(PropertyExtMessagesMigration).whenTargetNamed(PropertyExtMessagesMigration.name);\n });\n","export * from './container';\n","export { schema } from './schema';\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport post from './post.graphql';\n\nexport const schema = [post].join('/n');\n","import { inject, injectable } from 'inversify';\nimport { CommonType } from '@common-stack/core';\nimport { ServiceBroker } from 'moleculer';\nimport { IDatabaseMigration } from '@adminide-stack/core';\nimport * as Logger from 'bunyan';\nimport { config } from '../config';\n\n@injectable()\nexport class BotUserMigration implements IDatabaseMigration {\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n private logger: Logger,\n ) {\n this.logger = logger.child({ className: BotUserMigration.name });\n }\n\n protected name = 'BotUserMigration';\n\n id = `${this.constructor.name}_20220502`;\n\n async up(): Promise<void> {\n await this.down();\n this.logger.debug(`(up) Starting up migration...`);\n const user = await this.broker.call(`AccountUser.createAccount`, {\n account: {\n username: 'resortifi',\n email: 'resortifi-bot@resortifi.com',\n alias: 'resortifi',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n this.logger.debug(`(up) done`, user);\n }\n\n async down(): Promise<void> {\n if (config.isDev) {\n await this.broker.waitForServices('AccountUser');\n }\n this.logger.debug(`(down) Starting down migration...`);\n const user = await this.broker.call<{ id: string }, { email: string }>(`AccountUser.findAccountByEmail`, {\n email: 'resortifi-bot@resortifi.com',\n });\n if (!user) {\n return;\n }\n this.logger.debug(`(down) User Found, dropping...`, user);\n await this.broker.call(`AccountUser.deleteAccount`, {\n account: {\n id: user.id,\n },\n });\n this.logger.debug(`(down) User drop done!`);\n }\n}\n","export { PropertyExtMessagesMigration } from './property-ext-messages-migration';\nexport { BotUserMigration } from './bot-user-migration';\n","import { inject, injectable } from 'inversify';\nimport { IDatabaseMigration } from '@adminide-stack/core';\nimport { IUserAccount } from 'common';\nimport { CommonType } from '@common-stack/core';\nimport { ServiceBroker } from 'moleculer';\nimport * as Logger from 'bunyan';\nimport { IBaseServiceCommands, IMoleculerTopics, IRoomType, IChannel, IPost, IPostThread, IPostTypeEnum } from 'common';\nimport { config } from '../config';\n\n@injectable()\nexport class PropertyExtMessagesMigration implements IDatabaseMigration {\n constructor(\n @inject(CommonType.MOLECULER_BROKER)\n private readonly broker: ServiceBroker,\n @inject('Logger')\n private logger: Logger,\n ) {\n this.logger = logger.child({ className: PropertyExtMessagesMigration.name });\n }\n\n protected name = this.constructor.name;\n\n id = `${this.name}_20231006`;\n\n private async createUsers(): Promise<[IUserAccount, IUserAccount]> {\n const userOne = this.broker.call<IUserAccount, unknown>(`AccountUser.createAccount`, {\n account: {\n username: 'propertyAutomatedUser',\n email: 'property-automated-user@resortifi.com',\n alias: 'auth0|62df21f9e8116e9fce8207cf', // This need to match with auth0 id. Otherwise manually updatein the DB\n familyName: 'property-fixure',\n givenName: 'user1',\n picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n const userTwo = this.broker.call<IUserAccount, unknown>(`AccountUser.createAccount`, {\n account: {\n username: 'propertyAutomatedUser2',\n email: 'property-automated-user2@resortifi.com',\n alias: 'auth0|62df22109b1f5f6077c1f57e', // This need to match with auth0 id. Otherwise manually updatein the DB\n familyName: 'property-fixure',\n givenName: 'user2',\n picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',\n emailVerified: true,\n notificationEmail: '',\n },\n });\n return Promise.all([userOne, userTwo]);\n }\n\n private createServiceChannel(owner: IUserAccount): Promise<IChannel> {\n return this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Create}`, {\n data: {\n topic: 'CustomerSupportServiceChat',\n title: `${config.APP_NAME} SUPPORT`,\n description: `${config.APP_NAME} SUPPORT SERVICE`,\n creator: owner.id as never,\n displayName: `followup-support-${owner.id}`,\n type: IRoomType.Service,\n members: [\n {\n id: undefined,\n schemeAdmin: false,\n roles: 'OWNER',\n user: owner.id as never,\n },\n ],\n },\n });\n }\n\n private createChannel(owner: IUserAccount, guest: IUserAccount): Promise<IChannel> {\n return this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Create}`, {\n data: {\n topic: 'Fixtures',\n title: `${owner.alias}:${guest.alias}`,\n creator: guest.id as never,\n displayName: `${owner.id}:${guest.id}`,\n type: IRoomType.Direct,\n members: [\n {\n id: undefined,\n schemeAdmin: false,\n roles: 'OWNER',\n user: owner.id as never,\n },\n {\n id: undefined,\n schemeAdmin: true,\n roles: 'GUEST',\n user: guest.id as never,\n },\n ],\n },\n });\n }\n\n private async createSimpleMessage(channelId: string, editedBy: string) {\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message: 'Hello from the migrations',\n type: IPostTypeEnum.Simple as never,\n files: [],\n },\n });\n }\n\n private async createAlertMessage(channelId: string, editedBy: string) {\n const message = 'This is a dummy alert!';\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message,\n type: IPostTypeEnum.Alert as never,\n files: [],\n props: {\n ref: 'Dummy',\n refId: 'some-ref',\n attachment: {\n title: message,\n isTitleHtml: false,\n icon: 'InfoIcon',\n callToAction: {\n title: 'View',\n link: `/some-route/some-id`,\n },\n },\n },\n },\n });\n }\n\n private async createCardMessage(channelId: string, editedBy: string) {\n const message = 'Inquiry for fixture property';\n return this.broker.call(`${IMoleculerTopics.PostService}.${IBaseServiceCommands.Create}`, {\n data: {\n editedBy: editedBy as never,\n channel: channelId as never,\n message,\n type: IPostTypeEnum.Card as never,\n files: [],\n props: {\n ref: 'Property',\n refId: 'some-property-id',\n attachment: {\n image: 'https://placehold.co/300',\n title: message,\n isTitleHtml: false,\n description:\n 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis interdum leo augue, non posuere sapien ullamcorper ac. Aliquam vitae ornare libero, ac vulputate elit. Aenean interdum, mi a viverra maximus, leo nibh maximus augue, vel ultrices leo ante et ex. Maecenas vel mi auctor, egestas tellus nec, placerat odio. Curabitur eget tortor sed ligula pharetra varius. Aliquam sit amet lacus ligula. Etiam vitae magna eros.',\n isDescriptionHtml: false,\n callToAction: {\n title: 'View',\n // Should come from frontend\n link: `/property/some-id`,\n },\n property: {\n price: 10,\n priceType: 'Hourly',\n type: 'Hotel',\n totalStar: 5,\n maxPeople: 500,\n totalReview: 450,\n },\n },\n },\n },\n });\n }\n\n private async waitForServices() {\n if (config.isDev) {\n await Promise.all([\n this.broker.waitForServices(`${IMoleculerTopics.ChannelService}`),\n this.broker.waitForServices('AccountUser'),\n this.broker.waitForServices(`${IMoleculerTopics.PostService}`),\n this.broker.waitForServices(`${IMoleculerTopics.PostThreadService}`),\n ]);\n }\n }\n\n async up(): Promise<void> {\n await this.down();\n await this.waitForServices();\n // await this.down();\n this.logger.debug(`(up) Starting up migration...`);\n const users = await this.createUsers();\n if (!users) {\n return;\n }\n this.logger.debug('(up) users created...');\n const channel = await this.createChannel(users[0], users[1]);\n if (!channel) {\n return;\n }\n this.logger.debug('(up) channel created...');\n\n await Promise.all([\n this.createSimpleMessage(channel.id, users[0].id),\n this.createAlertMessage(channel.id, users[0].id),\n this.createCardMessage(channel.id, users[0].id),\n ]);\n this.logger.debug('(up) messages created...');\n\n const serviceChannel = await this.createServiceChannel(users[1]);\n if (!serviceChannel) {\n return;\n }\n this.logger.debug('(up) service channel created...');\n }\n\n async down(): Promise<void> {\n this.logger.debug(`(down) Starting down migration...`);\n await this.waitForServices();\n try {\n const users = await this.broker.call<IUserAccount[], unknown>('AccountUser.getAll', {\n options: {\n criteria: {\n email: {\n $in: ['property-automated-user@resortifi.com', 'property-automated-user2@resortifi.com'],\n },\n },\n },\n });\n\n if (!users.length) {\n this.logger.debug(`(down) No Users found, skipping migrations!`);\n return;\n }\n\n const [userOne, userTwo] = users;\n\n const [channel] = await this.broker.call<any, any>(\n `${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.GetAll}`,\n {\n criteria: {\n displayName: `${userTwo.id}:${userOne.id}`,\n },\n },\n );\n if (!channel?.id) {\n this.logger.debug(`(down) No Channel found, skipping channel delete!`);\n } else {\n const posts = await this.broker.call<IPost[], unknown>(`${IMoleculerTopics.PostService}.getAll`, {\n criteria: {\n channel: channel.id,\n },\n });\n await Promise.all(\n posts.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostService}.delete`, {\n id,\n }),\n ),\n );\n await this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Delete}`, {\n id: channel.id,\n });\n }\n /////////////////////////....Service Channel....//////////////////////////////////\n const serviceUsers = await this.broker.call<IUserAccount[], unknown>('AccountUser.getAll', {\n options: {\n criteria: {\n email: 'property-automated-user2@resortifi.com',\n },\n },\n });\n\n if (!serviceUsers.length) {\n this.logger.debug(`(down) No service Users found, skipping migrations!`);\n return;\n }\n const [serviceUser] = serviceUsers;\n const [servicehannel] = await this.broker.call<any, any>(\n `${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.GetAll}`,\n {\n criteria: {\n displayName: `followup-support-${serviceUser?.id}`,\n },\n },\n );\n this.logger.debug(`servicehannel = ${JSON.stringify(servicehannel)}`);\n if (!servicehannel?.id) {\n this.logger.debug(`(down) No Service Channel found, skipping service channel delete!`);\n } else {\n const posts = await this.broker.call<IPost[], unknown>(`${IMoleculerTopics.PostService}.getAll`, {\n criteria: {\n channel: servicehannel.id,\n },\n });\n await Promise.all(\n posts.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostService}.delete`, {\n id,\n }),\n ),\n );\n const postsThreads = await this.broker.call<IPostThread[], unknown>(\n `${IMoleculerTopics.PostThreadService}.getAll`,\n {\n criteria: {\n channel: servicehannel.id,\n },\n },\n );\n await Promise.all(\n postsThreads.map(({ id }) =>\n this.broker.call(`${IMoleculerTopics.PostThreadService}.delete`, {\n id,\n }),\n ),\n );\n await this.broker.call(`${IMoleculerTopics.ChannelService}.${IBaseServiceCommands.Delete}`, {\n id: servicehannel.id,\n });\n }\n /////////////////////////....Service Channel.... end//////////////////////////////////\n await Promise.all(\n users.map(({ id }) =>\n this.broker.call(`AccountUser.deleteAccount`, {\n account: {\n id,\n },\n }),\n ),\n );\n this.logger.debug(`(down) Successful`);\n } catch (e) {\n this.logger.error(e.message, e.stack);\n }\n }\n}\n","import { Feature } from '@common-stack/server-core';\nimport { propertyContainerModule } from './containers';\nimport { schema } from './graphql';\n\nexport default new Feature({\n schema,\n createContainerFunc: [propertyContainerModule],\n});\n","module.exports = require(\"@common-stack/core\");","module.exports = require(\"@common-stack/server-core\");","module.exports = require(\"bunyan\");","module.exports = require(\"common\");","module.exports = require(\"envalid\");","module.exports = require(\"inversify\");","module.exports = require(\"moleculer\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { default } from './module';\n"],"names":[],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/property-ext-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.2-alpha.0",
|
|
4
4
|
"description": "Extension to Messenger to support property",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@messenger-box/core": "
|
|
42
|
-
"@messenger-box/platform-server": "
|
|
43
|
-
"@messenger-box/property-ext-core": "9.0.4-alpha.
|
|
41
|
+
"@messenger-box/core": "10.0.2-alpha.0",
|
|
42
|
+
"@messenger-box/platform-server": "10.0.2-alpha.0",
|
|
43
|
+
"@messenger-box/property-ext-core": "9.0.4-alpha.22"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@adminide-stack/account-api-server": "*",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"@common-stack/server-core": "*",
|
|
53
53
|
"@common-stack/store-mongo": "*",
|
|
54
54
|
"@container-stack/file-info-core": "*",
|
|
55
|
-
"@messenger-box/core": "
|
|
56
|
-
"@messenger-box/notification-api-core": "
|
|
57
|
-
"@messenger-box/platform-server": "
|
|
55
|
+
"@messenger-box/core": "10.0.1-alpha.0",
|
|
56
|
+
"@messenger-box/notification-api-core": "10.0.1-alpha.0",
|
|
57
|
+
"@messenger-box/platform-server": "10.0.1-alpha.0",
|
|
58
58
|
"@vscode-alt/monaco-editor": "*",
|
|
59
59
|
"bunyan": "*",
|
|
60
60
|
"graphql": "*",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"typescript": {
|
|
73
73
|
"definition": "lib/index.d.ts"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "40aed609fa47796ae4496413978f4bb53b6b458d"
|
|
76
76
|
}
|