@messenger-box/property-ext-server 0.0.1-alpha.245 → 0.0.1-alpha.250

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/property-ext-server",
3
- "version": "0.0.1-alpha.245",
3
+ "version": "0.0.1-alpha.250",
4
4
  "description": "Extension to Messenger to support property",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -39,11 +39,11 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@messenger-box/core": "0.0.1-alpha.245",
42
- "@messenger-box/platform-server": "0.0.1-alpha.245",
42
+ "@messenger-box/platform-server": "0.0.1-alpha.250",
43
43
  "@messenger-box/property-ext-core": "0.0.1-alpha.245"
44
44
  },
45
45
  "peerDependencies": {
46
- "@adminide-stack/account-api-server": "3.1.2-alpha.8",
46
+ "@adminide-stack/account-api-server": "3.1.2-alpha.14",
47
47
  "@adminide-stack/core": "*",
48
48
  "@adminide-stack/platform-server": "*",
49
49
  "@cdm-logger/core": "*",
@@ -72,5 +72,5 @@
72
72
  "typescript": {
73
73
  "definition": "lib/index.d.ts"
74
74
  },
75
- "gitHead": "f1db3750fd8ba3a00d66bc3cf3547f214a1f8edb"
75
+ "gitHead": "5858a9fdd652a2062dd86c1ddf87c30e4b64415c"
76
76
  }
@@ -1,5 +0,0 @@
1
- export declare const config: Readonly<{
2
- NODE_ENV: string;
3
- POST_DATA_FILE_PATH: string;
4
- CHANNEL_DATA_FILE_PATH: string;
5
- } & import("envalid").CleanedEnvAccessors>;
@@ -1 +0,0 @@
1
- export * from './config';
@@ -1,2 +0,0 @@
1
- import { interfaces } from 'inversify';
2
- export declare const propertyContainerModule: (settings: any) => interfaces.ContainerModule;
@@ -1 +0,0 @@
1
- export * from './container';
@@ -1 +0,0 @@
1
- export { schema } from './schema';
@@ -1 +0,0 @@
1
- export declare const schema: string;
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default } from './module';
package/lib/index.js DELETED
@@ -1,630 +0,0 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ var __webpack_modules__ = ({
4
-
5
- /***/ "./src/graphql/schema/post.graphql":
6
- /*!*****************************************!*\
7
- !*** ./src/graphql/schema/post.graphql ***!
8
- \*****************************************/
9
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
-
11
- __webpack_require__.r(__webpack_exports__);
12
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
14
- /* harmony export */ });
15
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("extend enum PostTypeEnum{\n ALERT\n CARD\n}\n");
16
-
17
- /***/ }),
18
-
19
- /***/ "./src/config/config.ts":
20
- /*!******************************!*\
21
- !*** ./src/config/config.ts ***!
22
- \******************************/
23
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24
-
25
-
26
- Object.defineProperty(exports, "__esModule", ({ value: true }));
27
- exports.config = void 0;
28
- const envalid_1 = __webpack_require__(/*! envalid */ "envalid");
29
- 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
- default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/post.json',
34
- }),
35
- CHANNEL_DATA_FILE_PATH: (0, envalid_1.str)({
36
- default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/channel.json',
37
- }),
38
- });
39
-
40
-
41
- /***/ }),
42
-
43
- /***/ "./src/config/index.ts":
44
- /*!*****************************!*\
45
- !*** ./src/config/index.ts ***!
46
- \*****************************/
47
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
48
-
49
-
50
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
51
- if (k2 === undefined) k2 = k;
52
- var desc = Object.getOwnPropertyDescriptor(m, k);
53
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
54
- desc = { enumerable: true, get: function() { return m[k]; } };
55
- }
56
- Object.defineProperty(o, k2, desc);
57
- }) : (function(o, m, k, k2) {
58
- if (k2 === undefined) k2 = k;
59
- o[k2] = m[k];
60
- }));
61
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
62
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
63
- };
64
- Object.defineProperty(exports, "__esModule", ({ value: true }));
65
- __exportStar(__webpack_require__(/*! ./config */ "./src/config/config.ts"), exports);
66
-
67
-
68
- /***/ }),
69
-
70
- /***/ "./src/containers/container.ts":
71
- /*!*************************************!*\
72
- !*** ./src/containers/container.ts ***!
73
- \*************************************/
74
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
75
-
76
-
77
- Object.defineProperty(exports, "__esModule", ({ value: true }));
78
- exports.propertyContainerModule = void 0;
79
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
80
- const migrations_1 = __webpack_require__(/*! ../migrations */ "./src/migrations/index.ts");
81
- const propertyContainerModule = () => new inversify_1.ContainerModule((bind) => {
82
- bind('MongodbMigration').to(migrations_1.BotUserMigration).whenTargetNamed(migrations_1.BotUserMigration.name);
83
- bind('MongodbMigration').to(migrations_1.PropertyExtMessagesMigration).whenTargetNamed(migrations_1.PropertyExtMessagesMigration.name);
84
- });
85
- exports.propertyContainerModule = propertyContainerModule;
86
-
87
-
88
- /***/ }),
89
-
90
- /***/ "./src/containers/index.ts":
91
- /*!*********************************!*\
92
- !*** ./src/containers/index.ts ***!
93
- \*********************************/
94
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
95
-
96
-
97
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
98
- if (k2 === undefined) k2 = k;
99
- var desc = Object.getOwnPropertyDescriptor(m, k);
100
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
101
- desc = { enumerable: true, get: function() { return m[k]; } };
102
- }
103
- Object.defineProperty(o, k2, desc);
104
- }) : (function(o, m, k, k2) {
105
- if (k2 === undefined) k2 = k;
106
- o[k2] = m[k];
107
- }));
108
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
109
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
110
- };
111
- Object.defineProperty(exports, "__esModule", ({ value: true }));
112
- __exportStar(__webpack_require__(/*! ./container */ "./src/containers/container.ts"), exports);
113
-
114
-
115
- /***/ }),
116
-
117
- /***/ "./src/graphql/index.ts":
118
- /*!******************************!*\
119
- !*** ./src/graphql/index.ts ***!
120
- \******************************/
121
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
122
-
123
-
124
- Object.defineProperty(exports, "__esModule", ({ value: true }));
125
- exports.schema = void 0;
126
- var schema_1 = __webpack_require__(/*! ./schema */ "./src/graphql/schema/index.ts");
127
- Object.defineProperty(exports, "schema", ({ enumerable: true, get: function () { return schema_1.schema; } }));
128
-
129
-
130
- /***/ }),
131
-
132
- /***/ "./src/graphql/schema/index.ts":
133
- /*!*************************************!*\
134
- !*** ./src/graphql/schema/index.ts ***!
135
- \*************************************/
136
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
137
-
138
-
139
- var __importDefault = (this && this.__importDefault) || function (mod) {
140
- return (mod && mod.__esModule) ? mod : { "default": mod };
141
- };
142
- Object.defineProperty(exports, "__esModule", ({ value: true }));
143
- exports.schema = void 0;
144
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
145
- // @ts-nocheck
146
- const post_graphql_1 = __importDefault(__webpack_require__(/*! ./post.graphql */ "./src/graphql/schema/post.graphql"));
147
- exports.schema = [post_graphql_1.default].join('/n');
148
-
149
-
150
- /***/ }),
151
-
152
- /***/ "./src/index.ts":
153
- /*!**********************!*\
154
- !*** ./src/index.ts ***!
155
- \**********************/
156
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
157
-
158
-
159
- var __importDefault = (this && this.__importDefault) || function (mod) {
160
- return (mod && mod.__esModule) ? mod : { "default": mod };
161
- };
162
- Object.defineProperty(exports, "__esModule", ({ value: true }));
163
- exports["default"] = void 0;
164
- var module_1 = __webpack_require__(/*! ./module */ "./src/module.ts");
165
- Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return __importDefault(module_1).default; } }));
166
-
167
-
168
- /***/ }),
169
-
170
- /***/ "./src/migrations/bot-user-migration.ts":
171
- /*!**********************************************!*\
172
- !*** ./src/migrations/bot-user-migration.ts ***!
173
- \**********************************************/
174
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
175
-
176
-
177
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
178
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
179
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
180
- 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;
181
- return c > 3 && r && Object.defineProperty(target, key, r), r;
182
- };
183
- var __param = (this && this.__param) || function (paramIndex, decorator) {
184
- return function (target, key) { decorator(target, key, paramIndex); }
185
- };
186
- var BotUserMigration_1;
187
- Object.defineProperty(exports, "__esModule", ({ value: true }));
188
- exports.BotUserMigration = void 0;
189
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
190
- const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
191
- const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
192
- let BotUserMigration = BotUserMigration_1 = class BotUserMigration {
193
- constructor(broker, logger) {
194
- this.broker = broker;
195
- this.logger = logger;
196
- this.name = 'BotUserMigration';
197
- this.id = `${this.constructor.name}_20220502`;
198
- this.logger = logger.child({ className: BotUserMigration_1.name });
199
- }
200
- async up() {
201
- await this.down();
202
- this.logger.debug(`(up) Starting up migration...`);
203
- const user = await this.broker.call(`AccountUser.createAccount`, {
204
- account: {
205
- username: 'resortifi',
206
- email: 'resortifi-bot@resortifi.com',
207
- alias: 'resortifi',
208
- emailVerified: true,
209
- notificationEmail: '',
210
- },
211
- });
212
- this.logger.debug(`(up) done`, user);
213
- }
214
- async down() {
215
- if (config_1.config.isDev) {
216
- await this.broker.waitForServices('AccountUser');
217
- }
218
- this.logger.debug(`(down) Starting down migration...`);
219
- const user = await this.broker.call(`AccountUser.findAccountByEmail`, {
220
- email: 'resortifi-bot@resortifi.com',
221
- });
222
- if (!user) {
223
- return;
224
- }
225
- this.logger.debug(`(down) User Found, dropping...`, user);
226
- await this.broker.call(`AccountUser.deleteAccount`, {
227
- account: {
228
- id: user.id,
229
- },
230
- });
231
- this.logger.debug(`(down) User drop done!`);
232
- }
233
- };
234
- BotUserMigration = BotUserMigration_1 = __decorate([
235
- (0, inversify_1.injectable)(),
236
- __param(0, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
237
- __param(1, (0, inversify_1.inject)('Logger'))
238
- ], BotUserMigration);
239
- exports.BotUserMigration = BotUserMigration;
240
-
241
-
242
- /***/ }),
243
-
244
- /***/ "./src/migrations/index.ts":
245
- /*!*********************************!*\
246
- !*** ./src/migrations/index.ts ***!
247
- \*********************************/
248
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
249
-
250
-
251
- Object.defineProperty(exports, "__esModule", ({ value: true }));
252
- exports.BotUserMigration = exports.PropertyExtMessagesMigration = void 0;
253
- var property_ext_messages_migration_1 = __webpack_require__(/*! ./property-ext-messages-migration */ "./src/migrations/property-ext-messages-migration.ts");
254
- Object.defineProperty(exports, "PropertyExtMessagesMigration", ({ enumerable: true, get: function () { return property_ext_messages_migration_1.PropertyExtMessagesMigration; } }));
255
- var bot_user_migration_1 = __webpack_require__(/*! ./bot-user-migration */ "./src/migrations/bot-user-migration.ts");
256
- Object.defineProperty(exports, "BotUserMigration", ({ enumerable: true, get: function () { return bot_user_migration_1.BotUserMigration; } }));
257
-
258
-
259
- /***/ }),
260
-
261
- /***/ "./src/migrations/property-ext-messages-migration.ts":
262
- /*!***********************************************************!*\
263
- !*** ./src/migrations/property-ext-messages-migration.ts ***!
264
- \***********************************************************/
265
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
266
-
267
-
268
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
269
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
270
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
271
- 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;
272
- return c > 3 && r && Object.defineProperty(target, key, r), r;
273
- };
274
- var __param = (this && this.__param) || function (paramIndex, decorator) {
275
- return function (target, key) { decorator(target, key, paramIndex); }
276
- };
277
- var PropertyExtMessagesMigration_1;
278
- Object.defineProperty(exports, "__esModule", ({ value: true }));
279
- exports.PropertyExtMessagesMigration = void 0;
280
- const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
281
- const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
282
- const property_ext_core_1 = __webpack_require__(/*! @messenger-box/property-ext-core */ "@messenger-box/property-ext-core");
283
- const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
284
- let PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = class PropertyExtMessagesMigration {
285
- constructor(broker, logger) {
286
- this.broker = broker;
287
- this.logger = logger;
288
- this.name = this.constructor.name;
289
- this.id = `${this.name}_20220814`;
290
- this.logger = logger.child({ className: PropertyExtMessagesMigration_1.name });
291
- }
292
- async createUsers() {
293
- const userOne = this.broker.call(`AccountUser.createAccount`, {
294
- account: {
295
- username: 'propertyAutomatedUser',
296
- email: 'property-automated-user@resortifi.com',
297
- alias: 'auth0|62df21f9e8116e9fce8207cf',
298
- familyName: 'property-fixure',
299
- givenName: 'user1',
300
- picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',
301
- emailVerified: true,
302
- notificationEmail: '',
303
- },
304
- });
305
- const userTwo = this.broker.call(`AccountUser.createAccount`, {
306
- account: {
307
- username: 'propertyAutomatedUser2',
308
- email: 'property-automated-user2@resortifi.com',
309
- alias: 'auth0|62df22109b1f5f6077c1f57e',
310
- familyName: 'property-fixure',
311
- givenName: 'user2',
312
- picture: 'https://lh3.googleusercontent.com/a/AATXAJxMARAgr96npkZGf4R2uGbahBP4tLh5SRbS9bVq=s96-c',
313
- emailVerified: true,
314
- notificationEmail: '',
315
- },
316
- });
317
- return Promise.all([userOne, userTwo]);
318
- }
319
- createChannel(owner, guest) {
320
- return this.broker.call(`${"ChannelService" /* IMoleculerTopics.ChannelService */}.${"create" /* IBaseServiceCommands.Create */}`, {
321
- data: {
322
- topic: 'Fixtures',
323
- title: `${owner.alias}:${guest.alias}`,
324
- creator: guest.id,
325
- displayName: `${owner.id}:${guest.id}`,
326
- type: "DIRECT" /* IRoomType.Direct */,
327
- members: [
328
- {
329
- id: undefined,
330
- schemeAdmin: false,
331
- roles: 'OWNER',
332
- user: owner.id,
333
- },
334
- {
335
- id: undefined,
336
- schemeAdmin: true,
337
- roles: 'GUEST',
338
- user: guest.id,
339
- },
340
- ],
341
- },
342
- });
343
- }
344
- async createSimpleMessage(channelId, editedBy) {
345
- return this.broker.call(`${"PostService" /* IMoleculerTopics.PostService */}.${"create" /* IBaseServiceCommands.Create */}`, {
346
- data: {
347
- editedBy: editedBy,
348
- channel: channelId,
349
- message: 'Hello from the migrations',
350
- type: property_ext_core_1.IPostTypeEnum.Simple,
351
- files: [],
352
- },
353
- });
354
- }
355
- async createAlertMessage(channelId, editedBy) {
356
- const message = 'This is a dummy alert!';
357
- return this.broker.call(`${"PostService" /* IMoleculerTopics.PostService */}.${"create" /* IBaseServiceCommands.Create */}`, {
358
- data: {
359
- editedBy: editedBy,
360
- channel: channelId,
361
- message,
362
- type: property_ext_core_1.IPostTypeEnum.Alert,
363
- files: [],
364
- props: {
365
- ref: 'Dummy',
366
- refId: 'some-ref',
367
- attachment: {
368
- title: message,
369
- isTitleHtml: false,
370
- icon: 'InfoIcon',
371
- callToAction: {
372
- title: 'View',
373
- link: `/some-route/some-id`,
374
- },
375
- },
376
- },
377
- },
378
- });
379
- }
380
- async createCardMessage(channelId, editedBy) {
381
- const message = 'Inquiry for fixture property';
382
- return this.broker.call(`${"PostService" /* IMoleculerTopics.PostService */}.${"create" /* IBaseServiceCommands.Create */}`, {
383
- data: {
384
- editedBy: editedBy,
385
- channel: channelId,
386
- message,
387
- type: property_ext_core_1.IPostTypeEnum.Card,
388
- files: [],
389
- props: {
390
- ref: 'Property',
391
- refId: 'some-property-id',
392
- attachment: {
393
- image: 'https://placehold.co/300',
394
- title: message,
395
- isTitleHtml: false,
396
- description: '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.',
397
- isDescriptionHtml: false,
398
- callToAction: {
399
- title: 'View',
400
- // Should come from frontend
401
- link: `/property/some-id`,
402
- },
403
- property: {
404
- price: 10,
405
- priceType: 'Hourly',
406
- type: 'Hotel',
407
- totalStar: 5,
408
- maxPeople: 500,
409
- totalReview: 450,
410
- },
411
- },
412
- },
413
- },
414
- });
415
- }
416
- async waitForServices() {
417
- if (config_1.config.isDev) {
418
- await Promise.all([
419
- this.broker.waitForServices(`${"ChannelService" /* IMoleculerTopics.ChannelService */}`),
420
- this.broker.waitForServices('AccountUser'),
421
- this.broker.waitForServices(`${"PostService" /* IMoleculerTopics.PostService */}`),
422
- ]);
423
- }
424
- }
425
- async up() {
426
- await this.waitForServices();
427
- await this.down();
428
- this.logger.debug(`(up) Starting up migration...`);
429
- const users = await this.createUsers();
430
- this.logger.debug('(up) users created...');
431
- const channel = await this.createChannel(users[0], users[1]);
432
- if (!channel) {
433
- return;
434
- }
435
- this.logger.debug('(up) channel created...');
436
- await Promise.all([
437
- this.createSimpleMessage(channel.id, users[0].id),
438
- this.createAlertMessage(channel.id, users[0].id),
439
- this.createCardMessage(channel.id, users[0].id),
440
- ]);
441
- this.logger.debug('(up) messages created...');
442
- }
443
- async down() {
444
- this.logger.debug(`(down) Starting down migration...`);
445
- const users = await this.broker.call('AccountUser.getAll', {
446
- options: {
447
- criteria: {
448
- email: { $in: ['property-automated-user@resortifi.com', 'property-automated-user2@resortifi.com'] },
449
- },
450
- },
451
- });
452
- if (!users.length) {
453
- this.logger.debug(`(down) No Users found, skipping migrations!`);
454
- return;
455
- }
456
- const [userOne, userTwo] = users;
457
- const [channel] = await this.broker.call(`${"ChannelService" /* IMoleculerTopics.ChannelService */}.${"getAll" /* IBaseServiceCommands.GetAll */}`, {
458
- criteria: {
459
- displayName: `${userTwo.id}:${userOne.id}`,
460
- },
461
- });
462
- if (!(channel === null || channel === void 0 ? void 0 : channel.id)) {
463
- this.logger.debug(`(down) No Channel found, skipping channel delete!`);
464
- }
465
- else {
466
- const posts = await this.broker.call(`${"PostService" /* IMoleculerTopics.PostService */}.getAll`, {
467
- criteria: {
468
- channel: channel.id,
469
- },
470
- });
471
- await Promise.all(posts.map(({ id }) => this.broker.call(`${"PostService" /* IMoleculerTopics.PostService */}.delete`, {
472
- id,
473
- })));
474
- await this.broker.call(`${"ChannelService" /* IMoleculerTopics.ChannelService */}.${"delete" /* IBaseServiceCommands.Delete */}`, {
475
- id: channel.id,
476
- });
477
- }
478
- await Promise.all(users.map(({ id }) => this.broker.call(`AccountUser.deleteAccount`, {
479
- account: {
480
- id,
481
- },
482
- })));
483
- this.logger.debug(`(down) Successful`);
484
- }
485
- };
486
- PropertyExtMessagesMigration = PropertyExtMessagesMigration_1 = __decorate([
487
- (0, inversify_1.injectable)(),
488
- __param(0, (0, inversify_1.inject)(core_1.CommonType.MOLECULER_BROKER)),
489
- __param(1, (0, inversify_1.inject)('Logger'))
490
- ], PropertyExtMessagesMigration);
491
- exports.PropertyExtMessagesMigration = PropertyExtMessagesMigration;
492
-
493
-
494
- /***/ }),
495
-
496
- /***/ "./src/module.ts":
497
- /*!***********************!*\
498
- !*** ./src/module.ts ***!
499
- \***********************/
500
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
501
-
502
-
503
- Object.defineProperty(exports, "__esModule", ({ value: true }));
504
- const server_core_1 = __webpack_require__(/*! @common-stack/server-core */ "@common-stack/server-core");
505
- const containers_1 = __webpack_require__(/*! ./containers */ "./src/containers/index.ts");
506
- const graphql_1 = __webpack_require__(/*! ./graphql */ "./src/graphql/index.ts");
507
- exports["default"] = new server_core_1.Feature({
508
- schema: graphql_1.schema,
509
- createContainerFunc: [containers_1.propertyContainerModule],
510
- });
511
-
512
-
513
- /***/ }),
514
-
515
- /***/ "@common-stack/core":
516
- /*!*************************************!*\
517
- !*** external "@common-stack/core" ***!
518
- \*************************************/
519
- /***/ ((module) => {
520
-
521
- module.exports = require("@common-stack/core");
522
-
523
- /***/ }),
524
-
525
- /***/ "@common-stack/server-core":
526
- /*!********************************************!*\
527
- !*** external "@common-stack/server-core" ***!
528
- \********************************************/
529
- /***/ ((module) => {
530
-
531
- module.exports = require("@common-stack/server-core");
532
-
533
- /***/ }),
534
-
535
- /***/ "@messenger-box/property-ext-core":
536
- /*!***************************************************!*\
537
- !*** external "@messenger-box/property-ext-core" ***!
538
- \***************************************************/
539
- /***/ ((module) => {
540
-
541
- module.exports = require("@messenger-box/property-ext-core");
542
-
543
- /***/ }),
544
-
545
- /***/ "envalid":
546
- /*!**************************!*\
547
- !*** external "envalid" ***!
548
- \**************************/
549
- /***/ ((module) => {
550
-
551
- module.exports = require("envalid");
552
-
553
- /***/ }),
554
-
555
- /***/ "inversify":
556
- /*!****************************!*\
557
- !*** external "inversify" ***!
558
- \****************************/
559
- /***/ ((module) => {
560
-
561
- module.exports = require("inversify");
562
-
563
- /***/ })
564
-
565
- /******/ });
566
- /************************************************************************/
567
- /******/ // The module cache
568
- /******/ var __webpack_module_cache__ = {};
569
- /******/
570
- /******/ // The require function
571
- /******/ function __webpack_require__(moduleId) {
572
- /******/ // Check if module is in cache
573
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
574
- /******/ if (cachedModule !== undefined) {
575
- /******/ return cachedModule.exports;
576
- /******/ }
577
- /******/ // Create a new module (and put it into the cache)
578
- /******/ var module = __webpack_module_cache__[moduleId] = {
579
- /******/ // no module.id needed
580
- /******/ // no module.loaded needed
581
- /******/ exports: {}
582
- /******/ };
583
- /******/
584
- /******/ // Execute the module function
585
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
586
- /******/
587
- /******/ // Return the exports of the module
588
- /******/ return module.exports;
589
- /******/ }
590
- /******/
591
- /************************************************************************/
592
- /******/ /* webpack/runtime/define property getters */
593
- /******/ (() => {
594
- /******/ // define getter functions for harmony exports
595
- /******/ __webpack_require__.d = (exports, definition) => {
596
- /******/ for(var key in definition) {
597
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
598
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
599
- /******/ }
600
- /******/ }
601
- /******/ };
602
- /******/ })();
603
- /******/
604
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
605
- /******/ (() => {
606
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
607
- /******/ })();
608
- /******/
609
- /******/ /* webpack/runtime/make namespace object */
610
- /******/ (() => {
611
- /******/ // define __esModule on exports
612
- /******/ __webpack_require__.r = (exports) => {
613
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
614
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
615
- /******/ }
616
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
617
- /******/ };
618
- /******/ })();
619
- /******/
620
- /************************************************************************/
621
- /******/
622
- /******/ // startup
623
- /******/ // Load entry module and return exports
624
- /******/ // This entry module is referenced by other modules so it can't be inlined
625
- /******/ var __webpack_exports__ = __webpack_require__("./src/index.ts");
626
- /******/ module.exports = __webpack_exports__;
627
- /******/
628
- /******/ })()
629
- ;
630
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
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;CACL,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACbH,qFAAyB;;;;;;;;;;;;;;ACAzB,sEAAwD;AACxD,2FAA+E;AAExE,MAAM,uBAAuB,GAA6C,GAAG,EAAE,CAClF,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IAC1C,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,6BAAgB,CAAC,CAAC,eAA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2B,EAAE,EAAE;gBACxF,EAAE,EAAE,OAAO,CAAC,EAAE;aACjB,CAAC,CAAC;SACN;QACD,MAAM,OAAO,CAAC,GAAG,CACb,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;YAC1C,OAAO,EAAE;gBACL,EAAE;aACL;SACJ,CAAC,CACL,CACJ,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC3C,CAAC;CACJ;AAjOY,4BAA4B;IADxC,0BAAU,GAAE;IAGJ,iCAAM,EAAC,iBAAU,CAAC,gBAAgB,CAAC;IAEnC,iCAAM,EAAC,QAAQ,CAAC;GAJZ,4BAA4B,CAiOxC;AAjOY,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/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});\n","export * from './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, 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}_20220814`;\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 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 ]);\n }\n }\n\n async up(): Promise<void> {\n await this.waitForServices();\n await this.down();\n this.logger.debug(`(up) Starting up migration...`);\n const users = await this.createUsers();\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 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\n async down(): Promise<void> {\n this.logger.debug(`(down) Starting down migration...`);\n const users = await this.broker.call<IUserAccount[], unknown>('AccountUser.getAll', {\n options: {\n criteria: {\n email: { $in: ['property-automated-user@resortifi.com', 'property-automated-user2@resortifi.com'] },\n },\n },\n });\n if (!users.length) {\n this.logger.debug(`(down) No Users found, skipping migrations!`);\n return;\n }\n const [userOne, userTwo] = users;\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 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 }\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,12 +0,0 @@
1
- import { ServiceBroker } from 'moleculer';
2
- import { IDatabaseMigration } from '@adminide-stack/core';
3
- import * as Logger from 'bunyan';
4
- export declare class BotUserMigration implements IDatabaseMigration {
5
- private readonly broker;
6
- private logger;
7
- constructor(broker: ServiceBroker, logger: Logger);
8
- protected name: string;
9
- id: string;
10
- up(): Promise<void>;
11
- down(): Promise<void>;
12
- }
@@ -1,2 +0,0 @@
1
- export { PropertyExtMessagesMigration } from './property-ext-messages-migration';
2
- export { BotUserMigration } from './bot-user-migration';
@@ -1,18 +0,0 @@
1
- import { IDatabaseMigration } from '@adminide-stack/core';
2
- import { ServiceBroker } from 'moleculer';
3
- import * as Logger from 'bunyan';
4
- export declare class PropertyExtMessagesMigration implements IDatabaseMigration {
5
- private readonly broker;
6
- private logger;
7
- constructor(broker: ServiceBroker, logger: Logger);
8
- protected name: string;
9
- id: string;
10
- private createUsers;
11
- private createChannel;
12
- private createSimpleMessage;
13
- private createAlertMessage;
14
- private createCardMessage;
15
- private waitForServices;
16
- up(): Promise<void>;
17
- down(): Promise<void>;
18
- }
package/lib/module.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { Feature } from '@common-stack/server-core';
2
- declare const _default: Feature<import("@common-stack/server-core").ConfigurationScope>;
3
- export default _default;