@messenger-box/property-ext-server 5.0.3-alpha.2 → 5.0.3-alpha.4

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 CHANGED
@@ -20,22 +20,25 @@ __webpack_require__.r(__webpack_exports__);
20
20
  /*!**********************************!*\
21
21
  !*** ./src/config/env-config.ts ***!
22
22
  \**********************************/
23
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24
24
 
25
+ __webpack_require__.r(__webpack_exports__);
26
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27
+ /* harmony export */ config: () => (/* binding */ config)
28
+ /* harmony export */ });
29
+ /* harmony import */ var envalid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! envalid */ "envalid");
30
+ /* harmony import */ var envalid__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(envalid__WEBPACK_IMPORTED_MODULE_0__);
25
31
 
26
- Object.defineProperty(exports, "__esModule", ({ value: true }));
27
- exports.config = void 0;
28
- const envalid_1 = __webpack_require__(/*! envalid */ "envalid");
29
32
  const env = process.APP_ENV || process.env;
30
- exports.config = (0, envalid_1.cleanEnv)(env, {
31
- NODE_ENV: (0, envalid_1.str)({ choices: ['production', 'test', 'staging', 'development'], default: 'production' }),
32
- POST_DATA_FILE_PATH: (0, envalid_1.str)({
33
+ const config = (0,envalid__WEBPACK_IMPORTED_MODULE_0__.cleanEnv)(env, {
34
+ NODE_ENV: (0,envalid__WEBPACK_IMPORTED_MODULE_0__.str)({ choices: ['production', 'test', 'staging', 'development'], default: 'production' }),
35
+ POST_DATA_FILE_PATH: (0,envalid__WEBPACK_IMPORTED_MODULE_0__.str)({
33
36
  default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/post.json',
34
37
  }),
35
- CHANNEL_DATA_FILE_PATH: (0, envalid_1.str)({
38
+ CHANNEL_DATA_FILE_PATH: (0,envalid__WEBPACK_IMPORTED_MODULE_0__.str)({
36
39
  default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/channel.json',
37
40
  }),
38
- APP_NAME: (0, envalid_1.str)({ devDefault: 'Support' }),
41
+ APP_NAME: (0,envalid__WEBPACK_IMPORTED_MODULE_0__.str)({ devDefault: 'Support' }),
39
42
  });
40
43
 
41
44
 
@@ -45,25 +48,14 @@ exports.config = (0, envalid_1.cleanEnv)(env, {
45
48
  /*!*****************************!*\
46
49
  !*** ./src/config/index.ts ***!
47
50
  \*****************************/
48
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
51
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
49
52
 
53
+ __webpack_require__.r(__webpack_exports__);
54
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
55
+ /* harmony export */ config: () => (/* reexport safe */ _env_config__WEBPACK_IMPORTED_MODULE_0__.config)
56
+ /* harmony export */ });
57
+ /* harmony import */ var _env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./env-config */ "./src/config/env-config.ts");
50
58
 
51
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
52
- if (k2 === undefined) k2 = k;
53
- var desc = Object.getOwnPropertyDescriptor(m, k);
54
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
55
- desc = { enumerable: true, get: function() { return m[k]; } };
56
- }
57
- Object.defineProperty(o, k2, desc);
58
- }) : (function(o, m, k, k2) {
59
- if (k2 === undefined) k2 = k;
60
- o[k2] = m[k];
61
- }));
62
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
63
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
64
- };
65
- Object.defineProperty(exports, "__esModule", ({ value: true }));
66
- __exportStar(__webpack_require__(/*! ./env-config */ "./src/config/env-config.ts"), exports);
67
59
 
68
60
 
69
61
  /***/ }),
@@ -72,18 +64,21 @@ __exportStar(__webpack_require__(/*! ./env-config */ "./src/config/env-config.ts
72
64
  /*!*************************************!*\
73
65
  !*** ./src/containers/container.ts ***!
74
66
  \*************************************/
75
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
67
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
68
+
69
+ __webpack_require__.r(__webpack_exports__);
70
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
71
+ /* harmony export */ propertyContainerModule: () => (/* binding */ propertyContainerModule)
72
+ /* harmony export */ });
73
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inversify */ "inversify");
74
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_0__);
75
+ /* harmony import */ var _migrations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../migrations */ "./src/migrations/index.ts");
76
76
 
77
77
 
78
- Object.defineProperty(exports, "__esModule", ({ value: true }));
79
- exports.propertyContainerModule = void 0;
80
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
81
- const migrations_1 = __webpack_require__(/*! ../migrations */ "./src/migrations/index.ts");
82
- const propertyContainerModule = () => new inversify_1.ContainerModule((bind) => {
83
- bind('MongodbMigration').to(migrations_1.BotUserMigration).whenTargetNamed(migrations_1.BotUserMigration.name);
84
- bind('MongodbMigration').to(migrations_1.PropertyExtMessagesMigration).whenTargetNamed(migrations_1.PropertyExtMessagesMigration.name);
78
+ const propertyContainerModule = () => new inversify__WEBPACK_IMPORTED_MODULE_0__.ContainerModule((bind) => {
79
+ bind('MongodbMigration').to(_migrations__WEBPACK_IMPORTED_MODULE_1__.BotUserMigration).whenTargetNamed(_migrations__WEBPACK_IMPORTED_MODULE_1__.BotUserMigration.name);
80
+ bind('MongodbMigration').to(_migrations__WEBPACK_IMPORTED_MODULE_1__.PropertyExtMessagesMigration).whenTargetNamed(_migrations__WEBPACK_IMPORTED_MODULE_1__.PropertyExtMessagesMigration.name);
85
81
  });
86
- exports.propertyContainerModule = propertyContainerModule;
87
82
 
88
83
 
89
84
  /***/ }),
@@ -92,25 +87,14 @@ exports.propertyContainerModule = propertyContainerModule;
92
87
  /*!*********************************!*\
93
88
  !*** ./src/containers/index.ts ***!
94
89
  \*********************************/
95
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
90
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
96
91
 
92
+ __webpack_require__.r(__webpack_exports__);
93
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
94
+ /* harmony export */ propertyContainerModule: () => (/* reexport safe */ _container__WEBPACK_IMPORTED_MODULE_0__.propertyContainerModule)
95
+ /* harmony export */ });
96
+ /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./container */ "./src/containers/container.ts");
97
97
 
98
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
99
- if (k2 === undefined) k2 = k;
100
- var desc = Object.getOwnPropertyDescriptor(m, k);
101
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
102
- desc = { enumerable: true, get: function() { return m[k]; } };
103
- }
104
- Object.defineProperty(o, k2, desc);
105
- }) : (function(o, m, k, k2) {
106
- if (k2 === undefined) k2 = k;
107
- o[k2] = m[k];
108
- }));
109
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
110
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
111
- };
112
- Object.defineProperty(exports, "__esModule", ({ value: true }));
113
- __exportStar(__webpack_require__(/*! ./container */ "./src/containers/container.ts"), exports);
114
98
 
115
99
 
116
100
  /***/ }),
@@ -119,13 +103,14 @@ __exportStar(__webpack_require__(/*! ./container */ "./src/containers/container.
119
103
  /*!******************************!*\
120
104
  !*** ./src/graphql/index.ts ***!
121
105
  \******************************/
122
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
106
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
123
107
 
108
+ __webpack_require__.r(__webpack_exports__);
109
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
110
+ /* harmony export */ schema: () => (/* reexport safe */ _schema__WEBPACK_IMPORTED_MODULE_0__.schema)
111
+ /* harmony export */ });
112
+ /* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schema */ "./src/graphql/schema/index.ts");
124
113
 
125
- Object.defineProperty(exports, "__esModule", ({ value: true }));
126
- exports.schema = void 0;
127
- var schema_1 = __webpack_require__(/*! ./schema */ "./src/graphql/schema/index.ts");
128
- Object.defineProperty(exports, "schema", ({ enumerable: true, get: function () { return schema_1.schema; } }));
129
114
 
130
115
 
131
116
  /***/ }),
@@ -134,36 +119,17 @@ Object.defineProperty(exports, "schema", ({ enumerable: true, get: function () {
134
119
  /*!*************************************!*\
135
120
  !*** ./src/graphql/schema/index.ts ***!
136
121
  \*************************************/
137
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
138
-
122
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
139
123
 
140
- var __importDefault = (this && this.__importDefault) || function (mod) {
141
- return (mod && mod.__esModule) ? mod : { "default": mod };
142
- };
143
- Object.defineProperty(exports, "__esModule", ({ value: true }));
144
- exports.schema = void 0;
124
+ __webpack_require__.r(__webpack_exports__);
125
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
126
+ /* harmony export */ schema: () => (/* binding */ schema)
127
+ /* harmony export */ });
128
+ /* harmony import */ var _post_graphql__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./post.graphql */ "./src/graphql/schema/post.graphql");
145
129
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
146
130
  // @ts-nocheck
147
- const post_graphql_1 = __importDefault(__webpack_require__(/*! ./post.graphql */ "./src/graphql/schema/post.graphql"));
148
- exports.schema = [post_graphql_1.default].join('/n');
149
-
150
131
 
151
- /***/ }),
152
-
153
- /***/ "./src/index.ts":
154
- /*!**********************!*\
155
- !*** ./src/index.ts ***!
156
- \**********************/
157
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
158
-
159
-
160
- var __importDefault = (this && this.__importDefault) || function (mod) {
161
- return (mod && mod.__esModule) ? mod : { "default": mod };
162
- };
163
- Object.defineProperty(exports, "__esModule", ({ value: true }));
164
- exports["default"] = void 0;
165
- var module_1 = __webpack_require__(/*! ./module */ "./src/module.ts");
166
- Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return __importDefault(module_1).default; } }));
132
+ const schema = [_post_graphql__WEBPACK_IMPORTED_MODULE_0__["default"]].join('/n');
167
133
 
168
134
 
169
135
  /***/ }),
@@ -172,24 +138,39 @@ Object.defineProperty(exports, "default", ({ enumerable: true, get: function ()
172
138
  /*!**********************************************!*\
173
139
  !*** ./src/migrations/bot-user-migration.ts ***!
174
140
  \**********************************************/
175
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
176
-
141
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
177
142
 
178
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
143
+ __webpack_require__.r(__webpack_exports__);
144
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
145
+ /* harmony export */ BotUserMigration: () => (/* binding */ BotUserMigration)
146
+ /* harmony export */ });
147
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inversify */ "inversify");
148
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_0__);
149
+ /* harmony import */ var _common_stack_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
150
+ /* harmony import */ var _common_stack_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_common_stack_core__WEBPACK_IMPORTED_MODULE_1__);
151
+ /* harmony import */ var moleculer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moleculer */ "moleculer");
152
+ /* harmony import */ var moleculer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moleculer__WEBPACK_IMPORTED_MODULE_2__);
153
+ /* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bunyan */ "bunyan");
154
+ /* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bunyan__WEBPACK_IMPORTED_MODULE_3__);
155
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config */ "./src/config/index.ts");
156
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
179
157
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
180
158
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
181
159
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
182
160
  return c > 3 && r && Object.defineProperty(target, key, r), r;
183
161
  };
184
- var __param = (this && this.__param) || function (paramIndex, decorator) {
162
+ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
163
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
164
+ };
165
+ var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
185
166
  return function (target, key) { decorator(target, key, paramIndex); }
186
167
  };
187
168
  var BotUserMigration_1;
188
- Object.defineProperty(exports, "__esModule", ({ value: true }));
189
- exports.BotUserMigration = void 0;
190
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
191
- const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
192
- const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
169
+
170
+
171
+
172
+
173
+
193
174
  let BotUserMigration = BotUserMigration_1 = class BotUserMigration {
194
175
  constructor(broker, logger) {
195
176
  this.broker = broker;
@@ -213,7 +194,7 @@ let BotUserMigration = BotUserMigration_1 = class BotUserMigration {
213
194
  this.logger.debug(`(up) done`, user);
214
195
  }
215
196
  async down() {
216
- if (config_1.config.isDev) {
197
+ if (_config__WEBPACK_IMPORTED_MODULE_4__.config.isDev) {
217
198
  await this.broker.waitForServices('AccountUser');
218
199
  }
219
200
  this.logger.debug(`(down) Starting down migration...`);
@@ -233,11 +214,12 @@ let BotUserMigration = BotUserMigration_1 = class BotUserMigration {
233
214
  }
234
215
  };
235
216
  BotUserMigration = BotUserMigration_1 = __decorate([
236
- (0, inversify_1.injectable)(),
237
- __param(0, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
238
- __param(1, (0, inversify_1.inject)('Logger'))
217
+ (0,inversify__WEBPACK_IMPORTED_MODULE_0__.injectable)(),
218
+ __param(0, (0,inversify__WEBPACK_IMPORTED_MODULE_0__.inject)(_common_stack_core__WEBPACK_IMPORTED_MODULE_1__.CommonType.MOLECULER_BROKER)),
219
+ __param(1, (0,inversify__WEBPACK_IMPORTED_MODULE_0__.inject)('Logger')),
220
+ __metadata("design:paramtypes", [moleculer__WEBPACK_IMPORTED_MODULE_2__.ServiceBroker, Object])
239
221
  ], BotUserMigration);
240
- exports.BotUserMigration = BotUserMigration;
222
+
241
223
 
242
224
 
243
225
  /***/ }),
@@ -246,15 +228,17 @@ exports.BotUserMigration = BotUserMigration;
246
228
  /*!*********************************!*\
247
229
  !*** ./src/migrations/index.ts ***!
248
230
  \*********************************/
249
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
231
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
232
+
233
+ __webpack_require__.r(__webpack_exports__);
234
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
235
+ /* harmony export */ BotUserMigration: () => (/* reexport safe */ _bot_user_migration__WEBPACK_IMPORTED_MODULE_1__.BotUserMigration),
236
+ /* harmony export */ PropertyExtMessagesMigration: () => (/* reexport safe */ _property_ext_messages_migration__WEBPACK_IMPORTED_MODULE_0__.PropertyExtMessagesMigration)
237
+ /* harmony export */ });
238
+ /* harmony import */ var _property_ext_messages_migration__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./property-ext-messages-migration */ "./src/migrations/property-ext-messages-migration.ts");
239
+ /* harmony import */ var _bot_user_migration__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bot-user-migration */ "./src/migrations/bot-user-migration.ts");
250
240
 
251
241
 
252
- Object.defineProperty(exports, "__esModule", ({ value: true }));
253
- exports.BotUserMigration = exports.PropertyExtMessagesMigration = void 0;
254
- var property_ext_messages_migration_1 = __webpack_require__(/*! ./property-ext-messages-migration */ "./src/migrations/property-ext-messages-migration.ts");
255
- Object.defineProperty(exports, "PropertyExtMessagesMigration", ({ enumerable: true, get: function () { return property_ext_messages_migration_1.PropertyExtMessagesMigration; } }));
256
- var bot_user_migration_1 = __webpack_require__(/*! ./bot-user-migration */ "./src/migrations/bot-user-migration.ts");
257
- Object.defineProperty(exports, "BotUserMigration", ({ enumerable: true, get: function () { return bot_user_migration_1.BotUserMigration; } }));
258
242
 
259
243
 
260
244
  /***/ }),
@@ -263,25 +247,42 @@ Object.defineProperty(exports, "BotUserMigration", ({ enumerable: true, get: fun
263
247
  /*!***********************************************************!*\
264
248
  !*** ./src/migrations/property-ext-messages-migration.ts ***!
265
249
  \***********************************************************/
266
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
267
-
250
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
268
251
 
269
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
252
+ __webpack_require__.r(__webpack_exports__);
253
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
254
+ /* harmony export */ PropertyExtMessagesMigration: () => (/* binding */ PropertyExtMessagesMigration)
255
+ /* harmony export */ });
256
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! inversify */ "inversify");
257
+ /* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_0__);
258
+ /* harmony import */ var _common_stack_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
259
+ /* harmony import */ var _common_stack_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_common_stack_core__WEBPACK_IMPORTED_MODULE_1__);
260
+ /* harmony import */ var moleculer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moleculer */ "moleculer");
261
+ /* harmony import */ var moleculer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moleculer__WEBPACK_IMPORTED_MODULE_2__);
262
+ /* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bunyan */ "bunyan");
263
+ /* harmony import */ var bunyan__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bunyan__WEBPACK_IMPORTED_MODULE_3__);
264
+ /* harmony import */ var _messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @messenger-box/property-ext-core */ "@messenger-box/property-ext-core");
265
+ /* harmony import */ var _messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4__);
266
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../config */ "./src/config/index.ts");
267
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
270
268
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
271
269
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
272
270
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
273
271
  return c > 3 && r && Object.defineProperty(target, key, r), r;
274
272
  };
275
- var __param = (this && this.__param) || function (paramIndex, decorator) {
273
+ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
274
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
275
+ };
276
+ var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
276
277
  return function (target, key) { decorator(target, key, paramIndex); }
277
278
  };
278
279
  var PropertyExtMessagesMigration_1;
279
- Object.defineProperty(exports, "__esModule", ({ value: true }));
280
- exports.PropertyExtMessagesMigration = void 0;
281
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
282
- const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
283
- const property_ext_core_1 = __webpack_require__(/*! @messenger-box/property-ext-core */ "@messenger-box/property-ext-core");
284
- const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
280
+
281
+
282
+
283
+
284
+
285
+
285
286
  let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class PropertyExtMessagesMigration {
286
287
  constructor(broker, logger) {
287
288
  this.broker = broker;
@@ -321,8 +322,8 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
321
322
  return this.broker.call(`${"ChannelService" /* IMoleculerTopics.ChannelService */}.${"create" /* IBaseServiceCommands.Create */}`, {
322
323
  data: {
323
324
  topic: 'CustomerSupportServiceChat',
324
- title: `${config_1.config.APP_NAME} SUPPORT`,
325
- description: `${config_1.config.APP_NAME} SUPPORT SERVICE`,
325
+ title: `${_config__WEBPACK_IMPORTED_MODULE_5__.config.APP_NAME} SUPPORT`,
326
+ description: `${_config__WEBPACK_IMPORTED_MODULE_5__.config.APP_NAME} SUPPORT SERVICE`,
326
327
  creator: owner.id,
327
328
  displayName: `followup-support-${owner.id}`,
328
329
  type: "SERVICE" /* IRoomType.Service */,
@@ -368,7 +369,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
368
369
  editedBy: editedBy,
369
370
  channel: channelId,
370
371
  message: 'Hello from the migrations',
371
- type: property_ext_core_1.IPostTypeEnum.Simple,
372
+ type: _messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Simple,
372
373
  files: [],
373
374
  },
374
375
  });
@@ -380,7 +381,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
380
381
  editedBy: editedBy,
381
382
  channel: channelId,
382
383
  message,
383
- type: property_ext_core_1.IPostTypeEnum.Alert,
384
+ type: _messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Alert,
384
385
  files: [],
385
386
  props: {
386
387
  ref: 'Dummy',
@@ -405,7 +406,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
405
406
  editedBy: editedBy,
406
407
  channel: channelId,
407
408
  message,
408
- type: property_ext_core_1.IPostTypeEnum.Card,
409
+ type: _messenger_box_property_ext_core__WEBPACK_IMPORTED_MODULE_4__.IPostTypeEnum.Card,
409
410
  files: [],
410
411
  props: {
411
412
  ref: 'Property',
@@ -435,7 +436,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
435
436
  });
436
437
  }
437
438
  async waitForServices() {
438
- if (config_1.config.isDev) {
439
+ if (_config__WEBPACK_IMPORTED_MODULE_5__.config.isDev) {
439
440
  await Promise.all([
440
441
  this.broker.waitForServices(`${"ChannelService" /* IMoleculerTopics.ChannelService */}`),
441
442
  this.broker.waitForServices('AccountUser'),
@@ -494,7 +495,7 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
494
495
  displayName: `${userTwo.id}:${userOne.id}`,
495
496
  },
496
497
  });
497
- if (!(channel === null || channel === void 0 ? void 0 : channel.id)) {
498
+ if (!channel?.id) {
498
499
  this.logger.debug(`(down) No Channel found, skipping channel delete!`);
499
500
  }
500
501
  else {
@@ -525,11 +526,11 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
525
526
  const [serviceUser] = serviceUsers;
526
527
  const [servicehannel] = await this.broker.call(`${"ChannelService" /* IMoleculerTopics.ChannelService */}.${"getAll" /* IBaseServiceCommands.GetAll */}`, {
527
528
  criteria: {
528
- displayName: `followup-support-${serviceUser === null || serviceUser === void 0 ? void 0 : serviceUser.id}`,
529
+ displayName: `followup-support-${serviceUser?.id}`,
529
530
  },
530
531
  });
531
532
  this.logger.debug(`servicehannel = ${JSON.stringify(servicehannel)}`);
532
- if (!(servicehannel === null || servicehannel === void 0 ? void 0 : servicehannel.id)) {
533
+ if (!servicehannel?.id) {
533
534
  this.logger.debug(`(down) No Service Channel found, skipping service channel delete!`);
534
535
  }
535
536
  else {
@@ -567,11 +568,12 @@ let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class Proper
567
568
  }
568
569
  };
569
570
  PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = __decorate([
570
- (0, inversify_1.injectable)(),
571
- __param(0, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
572
- __param(1, (0, inversify_1.inject)('Logger'))
571
+ (0,inversify__WEBPACK_IMPORTED_MODULE_0__.injectable)(),
572
+ __param(0, (0,inversify__WEBPACK_IMPORTED_MODULE_0__.inject)(_common_stack_core__WEBPACK_IMPORTED_MODULE_1__.CommonType.MOLECULER_BROKER)),
573
+ __param(1, (0,inversify__WEBPACK_IMPORTED_MODULE_0__.inject)('Logger')),
574
+ __metadata("design:paramtypes", [moleculer__WEBPACK_IMPORTED_MODULE_2__.ServiceBroker, Object])
573
575
  ], PropertyExtMessagesMigration);
574
- exports.PropertyExtMessagesMigration = PropertyExtMessagesMigration;
576
+
575
577
 
576
578
 
577
579
  /***/ }),
@@ -580,17 +582,23 @@ exports.PropertyExtMessagesMigration = PropertyExtMessagesMigration;
580
582
  /*!***********************!*\
581
583
  !*** ./src/module.ts ***!
582
584
  \***********************/
583
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
585
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
584
586
 
587
+ __webpack_require__.r(__webpack_exports__);
588
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
589
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
590
+ /* harmony export */ });
591
+ /* harmony import */ var _common_stack_server_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @common-stack/server-core */ "@common-stack/server-core");
592
+ /* harmony import */ var _common_stack_server_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_common_stack_server_core__WEBPACK_IMPORTED_MODULE_0__);
593
+ /* harmony import */ var _containers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./containers */ "./src/containers/index.ts");
594
+ /* harmony import */ var _graphql__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphql */ "./src/graphql/index.ts");
585
595
 
586
- Object.defineProperty(exports, "__esModule", ({ value: true }));
587
- const server_core_1 = __webpack_require__(/*! @common-stack/server-core */ "@common-stack/server-core");
588
- const containers_1 = __webpack_require__(/*! ./containers */ "./src/containers/index.ts");
589
- const graphql_1 = __webpack_require__(/*! ./graphql */ "./src/graphql/index.ts");
590
- exports["default"] = new server_core_1.Feature({
591
- schema: graphql_1.schema,
592
- createContainerFunc: [containers_1.propertyContainerModule],
593
- });
596
+
597
+
598
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new _common_stack_server_core__WEBPACK_IMPORTED_MODULE_0__.Feature({
599
+ schema: _graphql__WEBPACK_IMPORTED_MODULE_2__.schema,
600
+ createContainerFunc: [_containers__WEBPACK_IMPORTED_MODULE_1__.propertyContainerModule],
601
+ }));
594
602
 
595
603
 
596
604
  /***/ }),
@@ -625,6 +633,16 @@ module.exports = require("@messenger-box/property-ext-core");
625
633
 
626
634
  /***/ }),
627
635
 
636
+ /***/ "bunyan":
637
+ /*!*************************!*\
638
+ !*** external "bunyan" ***!
639
+ \*************************/
640
+ /***/ ((module) => {
641
+
642
+ module.exports = require("bunyan");
643
+
644
+ /***/ }),
645
+
628
646
  /***/ "envalid":
629
647
  /*!**************************!*\
630
648
  !*** external "envalid" ***!
@@ -643,6 +661,16 @@ module.exports = require("envalid");
643
661
 
644
662
  module.exports = require("inversify");
645
663
 
664
+ /***/ }),
665
+
666
+ /***/ "moleculer":
667
+ /*!****************************!*\
668
+ !*** external "moleculer" ***!
669
+ \****************************/
670
+ /***/ ((module) => {
671
+
672
+ module.exports = require("moleculer");
673
+
646
674
  /***/ })
647
675
 
648
676
  /******/ });
@@ -665,13 +693,25 @@ module.exports = require("inversify");
665
693
  /******/ };
666
694
  /******/
667
695
  /******/ // Execute the module function
668
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
696
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
669
697
  /******/
670
698
  /******/ // Return the exports of the module
671
699
  /******/ return module.exports;
672
700
  /******/ }
673
701
  /******/
674
702
  /************************************************************************/
703
+ /******/ /* webpack/runtime/compat get default export */
704
+ /******/ (() => {
705
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
706
+ /******/ __webpack_require__.n = (module) => {
707
+ /******/ var getter = module && module.__esModule ?
708
+ /******/ () => (module['default']) :
709
+ /******/ () => (module);
710
+ /******/ __webpack_require__.d(getter, { a: getter });
711
+ /******/ return getter;
712
+ /******/ };
713
+ /******/ })();
714
+ /******/
675
715
  /******/ /* webpack/runtime/define property getters */
676
716
  /******/ (() => {
677
717
  /******/ // define getter functions for harmony exports
@@ -701,13 +741,22 @@ module.exports = require("inversify");
701
741
  /******/ })();
702
742
  /******/
703
743
  /************************************************************************/
704
- /******/
705
- /******/ // startup
706
- /******/ // Load entry module and return exports
707
- /******/ // This entry module is referenced by other modules so it can't be inlined
708
- /******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
709
- /******/ module.exports = __webpack_exports__;
710
- /******/
744
+ var __webpack_exports__ = {};
745
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
746
+ (() => {
747
+ /*!**********************!*\
748
+ !*** ./src/index.ts ***!
749
+ \**********************/
750
+ __webpack_require__.r(__webpack_exports__);
751
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
752
+ /* harmony export */ "default": () => (/* reexport safe */ _module__WEBPACK_IMPORTED_MODULE_0__["default"])
753
+ /* harmony export */ });
754
+ /* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module */ "./src/module.ts");
755
+
756
+
757
+ })();
758
+
759
+ module.exports = __webpack_exports__;
711
760
  /******/ })()
712
761
  ;
713
762
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,0BAA0B,wBAAwB,GAAG;;;;;;;;;;;;;ACApE,gEAA8C;AAG9C,MAAM,GAAG,GAAI,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;AAEvC,cAAM,GAAG,sBAAQ,EAAC,GAAG,EAAE;IAChC,QAAQ,EAAE,iBAAG,EAAC,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IACnG,mBAAmB,EAAE,iBAAG,EAAC;QACrB,OAAO,EAAE,6EAA6E;KACzF,CAAC;IACF,sBAAsB,EAAE,iBAAG,EAAC;QACxB,OAAO,EAAE,gFAAgF;KAC5F,CAAC;IACF,QAAQ,EAAE,iBAAG,EAAC,EAAE,UAAU,E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CAsUxC;AAtUY,oEAA4B;;;;;;;;;;;;;ACVzC,wGAAoD;AACpD,0FAAuD;AACvD,iFAAmC;AAEnC,qBAAe,IAAI,qBAAO,CAAC;IACvB,MAAM,EAAN,gBAAM;IACN,mBAAmB,EAAE,CAAC,oCAAuB,CAAC;CACjD,CAAC,CAAC;;;;;;;;;;;ACPH;;;;;;;;;;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,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","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/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 \"envalid\"","webpack://@messenger-box/property-ext-server/external commonjs \"inversify\"","webpack://@messenger-box/property-ext-server/webpack/bootstrap","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/webpack/before-startup","webpack://@messenger-box/property-ext-server/webpack/startup","webpack://@messenger-box/property-ext-server/webpack/after-startup"],"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","export { default } from './module';\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(\"envalid\");","module.exports = require(\"inversify\");","// 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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\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};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./src/index.ts\");\n",""],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;AAAA,iEAAe,0BAA0B,wBAAwB,GAAG;;;;;;;;;;;;;;;;ACAtB;AAG9C,MAAM,GAAG,GAAI,OAAe,CAAC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;IACL,CAAC;CACJ;AAtUY,4BAA4B;IADxC,qDAAU,EAAE;IAGJ,4DAAM,CAAC,0DAAU,CAAC,gBAAgB,CAAC;IAEnC,4DAAM,CAAC,QAAQ,CAAC;qCADQ,oDAAa;GAHjC,4BAA4B,CAsUxC;AAtUwC;;;;;;;;;;;;;;;;;;;ACVW;AACG;AACpB;AAEnC,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":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/property-ext-server",
3
- "version": "5.0.3-alpha.2",
3
+ "version": "5.0.3-alpha.4",
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": "5.0.3-alpha.1",
42
- "@messenger-box/platform-server": "5.0.3-alpha.2",
43
- "@messenger-box/property-ext-core": "5.0.3-alpha.0"
41
+ "@messenger-box/core": "5.0.3-alpha.3",
42
+ "@messenger-box/platform-server": "5.0.3-alpha.4",
43
+ "@messenger-box/property-ext-core": "5.0.3-alpha.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@adminide-stack/account-api-server": "3.1.2-alpha.109",
@@ -72,5 +72,5 @@
72
72
  "typescript": {
73
73
  "definition": "lib/index.d.ts"
74
74
  },
75
- "gitHead": "97d49f16be378d53db480999fbc59e8939e4a208"
75
+ "gitHead": "c077bc779180e58dcd5a99b27bf7ae95127a7e03"
76
76
  }