@messenger-box/property-ext-server 0.0.1-alpha.189 → 0.0.1-alpha.192
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/config/config.d.ts +5 -0
- package/lib/config/index.d.ts +1 -0
- package/lib/containers/container.d.ts +2 -0
- package/lib/containers/index.d.ts +1 -0
- package/lib/graphql/index.d.ts +1 -0
- package/lib/graphql/schema/index.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +299 -0
- package/lib/index.js.map +1 -1
- package/lib/migration/bot-user-migration.d.ts +12 -0
- package/lib/module.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './container';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { schema } from './schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const schema: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './module';
|
package/lib/index.js
CHANGED
|
@@ -87,14 +87,313 @@ module.exports =
|
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
|
+
/***/ "./src/config/config.ts":
|
|
91
|
+
/*!******************************!*\
|
|
92
|
+
!*** ./src/config/config.ts ***!
|
|
93
|
+
\******************************/
|
|
94
|
+
/*! no static exports found */
|
|
95
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
96
|
+
|
|
97
|
+
"use strict";
|
|
98
|
+
|
|
99
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
|
+
exports.config = void 0;
|
|
101
|
+
const envalid_1 = __webpack_require__(/*! envalid */ "envalid");
|
|
102
|
+
const env = process.APP_ENV || process.env;
|
|
103
|
+
exports.config = envalid_1.cleanEnv(env, {
|
|
104
|
+
NODE_ENV: envalid_1.str({ choices: ['production', 'test', 'staging', 'development'], default: 'production' }),
|
|
105
|
+
POST_DATA_FILE_PATH: envalid_1.str({
|
|
106
|
+
default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/post.json',
|
|
107
|
+
}),
|
|
108
|
+
CHANNEL_DATA_FILE_PATH: envalid_1.str({
|
|
109
|
+
default: 'node_modules/@messenger-box/property-ext-server/lib/mock/fixtures/channel.json',
|
|
110
|
+
}),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
/***/ }),
|
|
115
|
+
|
|
116
|
+
/***/ "./src/config/index.ts":
|
|
117
|
+
/*!*****************************!*\
|
|
118
|
+
!*** ./src/config/index.ts ***!
|
|
119
|
+
\*****************************/
|
|
120
|
+
/*! no static exports found */
|
|
121
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
122
|
+
|
|
123
|
+
"use strict";
|
|
124
|
+
|
|
125
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
126
|
+
if (k2 === undefined) k2 = k;
|
|
127
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
128
|
+
}) : (function(o, m, k, k2) {
|
|
129
|
+
if (k2 === undefined) k2 = k;
|
|
130
|
+
o[k2] = m[k];
|
|
131
|
+
}));
|
|
132
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
133
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
134
|
+
};
|
|
135
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
136
|
+
__exportStar(__webpack_require__(/*! ./config */ "./src/config/config.ts"), exports);
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
/***/ }),
|
|
140
|
+
|
|
141
|
+
/***/ "./src/containers/container.ts":
|
|
142
|
+
/*!*************************************!*\
|
|
143
|
+
!*** ./src/containers/container.ts ***!
|
|
144
|
+
\*************************************/
|
|
145
|
+
/*! no static exports found */
|
|
146
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
147
|
+
|
|
148
|
+
"use strict";
|
|
149
|
+
|
|
150
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
151
|
+
exports.propertyContainerModule = void 0;
|
|
152
|
+
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
153
|
+
const bot_user_migration_1 = __webpack_require__(/*! ../migration/bot-user-migration */ "./src/migration/bot-user-migration.ts");
|
|
154
|
+
const propertyContainerModule = () => new inversify_1.ContainerModule((bind) => {
|
|
155
|
+
bind('MongodbMigration').to(bot_user_migration_1.BotUserMigration).whenTargetNamed(bot_user_migration_1.BotUserMigration.name);
|
|
156
|
+
});
|
|
157
|
+
exports.propertyContainerModule = propertyContainerModule;
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/***/ }),
|
|
161
|
+
|
|
162
|
+
/***/ "./src/containers/index.ts":
|
|
163
|
+
/*!*********************************!*\
|
|
164
|
+
!*** ./src/containers/index.ts ***!
|
|
165
|
+
\*********************************/
|
|
166
|
+
/*! no static exports found */
|
|
167
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
168
|
+
|
|
169
|
+
"use strict";
|
|
170
|
+
|
|
171
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
172
|
+
if (k2 === undefined) k2 = k;
|
|
173
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
174
|
+
}) : (function(o, m, k, k2) {
|
|
175
|
+
if (k2 === undefined) k2 = k;
|
|
176
|
+
o[k2] = m[k];
|
|
177
|
+
}));
|
|
178
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
179
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
180
|
+
};
|
|
181
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
182
|
+
__exportStar(__webpack_require__(/*! ./container */ "./src/containers/container.ts"), exports);
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
/***/ }),
|
|
186
|
+
|
|
187
|
+
/***/ "./src/graphql/index.ts":
|
|
188
|
+
/*!******************************!*\
|
|
189
|
+
!*** ./src/graphql/index.ts ***!
|
|
190
|
+
\******************************/
|
|
191
|
+
/*! no static exports found */
|
|
192
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
193
|
+
|
|
194
|
+
"use strict";
|
|
195
|
+
|
|
196
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
197
|
+
exports.schema = void 0;
|
|
198
|
+
var schema_1 = __webpack_require__(/*! ./schema */ "./src/graphql/schema/index.ts");
|
|
199
|
+
Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return schema_1.schema; } });
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
/***/ }),
|
|
203
|
+
|
|
204
|
+
/***/ "./src/graphql/schema/index.ts":
|
|
205
|
+
/*!*************************************!*\
|
|
206
|
+
!*** ./src/graphql/schema/index.ts ***!
|
|
207
|
+
\*************************************/
|
|
208
|
+
/*! no static exports found */
|
|
209
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
210
|
+
|
|
211
|
+
"use strict";
|
|
212
|
+
|
|
213
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
214
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
215
|
+
};
|
|
216
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
217
|
+
exports.schema = void 0;
|
|
218
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
219
|
+
// @ts-nocheck
|
|
220
|
+
const post_graphql_1 = __importDefault(__webpack_require__(/*! ./post.graphql */ "./src/graphql/schema/post.graphql"));
|
|
221
|
+
exports.schema = [post_graphql_1.default].join('/n');
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
/***/ }),
|
|
225
|
+
|
|
226
|
+
/***/ "./src/graphql/schema/post.graphql":
|
|
227
|
+
/*!*****************************************!*\
|
|
228
|
+
!*** ./src/graphql/schema/post.graphql ***!
|
|
229
|
+
\*****************************************/
|
|
230
|
+
/*! exports provided: default */
|
|
231
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
232
|
+
|
|
233
|
+
"use strict";
|
|
234
|
+
__webpack_require__.r(__webpack_exports__);
|
|
235
|
+
/* harmony default export */ __webpack_exports__["default"] = ("extend enum PostTypeEnum{\n ALERT\n CARD\n}\n");
|
|
236
|
+
|
|
237
|
+
/***/ }),
|
|
238
|
+
|
|
90
239
|
/***/ "./src/index.ts":
|
|
91
240
|
/*!**********************!*\
|
|
92
241
|
!*** ./src/index.ts ***!
|
|
93
242
|
\**********************/
|
|
94
243
|
/*! no static exports found */
|
|
244
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
245
|
+
|
|
246
|
+
"use strict";
|
|
247
|
+
|
|
248
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
249
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
250
|
+
};
|
|
251
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
252
|
+
exports.default = void 0;
|
|
253
|
+
var module_1 = __webpack_require__(/*! ./module */ "./src/module.ts");
|
|
254
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(module_1).default; } });
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
/***/ }),
|
|
258
|
+
|
|
259
|
+
/***/ "./src/migration/bot-user-migration.ts":
|
|
260
|
+
/*!*********************************************!*\
|
|
261
|
+
!*** ./src/migration/bot-user-migration.ts ***!
|
|
262
|
+
\*********************************************/
|
|
263
|
+
/*! no static exports found */
|
|
264
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
265
|
+
|
|
266
|
+
"use strict";
|
|
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 BotUserMigration_1;
|
|
278
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
279
|
+
exports.BotUserMigration = void 0;
|
|
280
|
+
const inversify_1 = __webpack_require__(/*! inversify */ "inversify");
|
|
281
|
+
const core_1 = __webpack_require__(/*! @common-stack/core */ "@common-stack/core");
|
|
282
|
+
const config_1 = __webpack_require__(/*! ../config */ "./src/config/index.ts");
|
|
283
|
+
let BotUserMigration = BotUserMigration_1 = class BotUserMigration {
|
|
284
|
+
constructor(broker, logger) {
|
|
285
|
+
this.broker = broker;
|
|
286
|
+
this.logger = logger;
|
|
287
|
+
this.name = 'BotUserMigration';
|
|
288
|
+
this.id = `${this.constructor.name}_20220502`;
|
|
289
|
+
this.logger = logger.child({ className: BotUserMigration_1.name });
|
|
290
|
+
}
|
|
291
|
+
async up() {
|
|
292
|
+
await this.down();
|
|
293
|
+
this.logger.debug(`(up) Starting up migration...`);
|
|
294
|
+
const user = await this.broker.call(`AccountUser.createAccount`, {
|
|
295
|
+
account: {
|
|
296
|
+
username: 'resortifi',
|
|
297
|
+
email: 'resortifi-bot@resortifi.com',
|
|
298
|
+
alias: 'resortifi',
|
|
299
|
+
emailVerified: true,
|
|
300
|
+
notificationEmail: '',
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
this.logger.debug(`(up) done`, user);
|
|
304
|
+
}
|
|
305
|
+
async down() {
|
|
306
|
+
if (config_1.config.isDev) {
|
|
307
|
+
await this.broker.waitForServices('AccountUser');
|
|
308
|
+
}
|
|
309
|
+
this.logger.debug(`(down) Starting down migration...`);
|
|
310
|
+
const user = await this.broker.call(`AccountUser.findAccountByEmail`, {
|
|
311
|
+
email: 'resortifi-bot@resortifi.com',
|
|
312
|
+
});
|
|
313
|
+
if (!user) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
this.logger.debug(`(down) User Found, dropping...`, user);
|
|
317
|
+
await this.broker.call(`AccountUser.deleteAccount`, {
|
|
318
|
+
account: {
|
|
319
|
+
id: user.id,
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
this.logger.debug(`(down) User drop done!`);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
BotUserMigration = BotUserMigration_1 = __decorate([
|
|
326
|
+
inversify_1.injectable(),
|
|
327
|
+
__param(0, inversify_1.inject(core_1.CommonType.MOLECULER_BROKER)),
|
|
328
|
+
__param(1, inversify_1.inject('Logger'))
|
|
329
|
+
], BotUserMigration);
|
|
330
|
+
exports.BotUserMigration = BotUserMigration;
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
/***/ }),
|
|
334
|
+
|
|
335
|
+
/***/ "./src/module.ts":
|
|
336
|
+
/*!***********************!*\
|
|
337
|
+
!*** ./src/module.ts ***!
|
|
338
|
+
\***********************/
|
|
339
|
+
/*! no static exports found */
|
|
340
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
341
|
+
|
|
342
|
+
"use strict";
|
|
343
|
+
|
|
344
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
345
|
+
const server_core_1 = __webpack_require__(/*! @common-stack/server-core */ "@common-stack/server-core");
|
|
346
|
+
const containers_1 = __webpack_require__(/*! ./containers */ "./src/containers/index.ts");
|
|
347
|
+
const graphql_1 = __webpack_require__(/*! ./graphql */ "./src/graphql/index.ts");
|
|
348
|
+
exports.default = new server_core_1.Feature({
|
|
349
|
+
schema: graphql_1.schema,
|
|
350
|
+
createContainerFunc: [containers_1.propertyContainerModule],
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
/***/ }),
|
|
355
|
+
|
|
356
|
+
/***/ "@common-stack/core":
|
|
357
|
+
/*!*************************************!*\
|
|
358
|
+
!*** external "@common-stack/core" ***!
|
|
359
|
+
\*************************************/
|
|
360
|
+
/*! no static exports found */
|
|
95
361
|
/***/ (function(module, exports) {
|
|
96
362
|
|
|
363
|
+
module.exports = require("@common-stack/core");
|
|
364
|
+
|
|
365
|
+
/***/ }),
|
|
366
|
+
|
|
367
|
+
/***/ "@common-stack/server-core":
|
|
368
|
+
/*!********************************************!*\
|
|
369
|
+
!*** external "@common-stack/server-core" ***!
|
|
370
|
+
\********************************************/
|
|
371
|
+
/*! no static exports found */
|
|
372
|
+
/***/ (function(module, exports) {
|
|
373
|
+
|
|
374
|
+
module.exports = require("@common-stack/server-core");
|
|
375
|
+
|
|
376
|
+
/***/ }),
|
|
377
|
+
|
|
378
|
+
/***/ "envalid":
|
|
379
|
+
/*!**************************!*\
|
|
380
|
+
!*** external "envalid" ***!
|
|
381
|
+
\**************************/
|
|
382
|
+
/*! no static exports found */
|
|
383
|
+
/***/ (function(module, exports) {
|
|
384
|
+
|
|
385
|
+
module.exports = require("envalid");
|
|
386
|
+
|
|
387
|
+
/***/ }),
|
|
388
|
+
|
|
389
|
+
/***/ "inversify":
|
|
390
|
+
/*!****************************!*\
|
|
391
|
+
!*** external "inversify" ***!
|
|
392
|
+
\****************************/
|
|
393
|
+
/*! no static exports found */
|
|
394
|
+
/***/ (function(module, exports) {
|
|
97
395
|
|
|
396
|
+
module.exports = require("inversify");
|
|
98
397
|
|
|
99
398
|
/***/ })
|
|
100
399
|
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/config/config.ts","webpack:///./src/config/index.ts","webpack:///./src/containers/container.ts","webpack:///./src/containers/index.ts","webpack:///./src/graphql/index.ts","webpack:///./src/graphql/schema/index.ts","webpack:///./src/graphql/schema/post.graphql","webpack:///./src/index.ts","webpack:///./src/migration/bot-user-migration.ts","webpack:///./src/module.ts","webpack:///external \"@common-stack/core\"","webpack:///external \"@common-stack/server-core\"","webpack:///external \"envalid\"","webpack:///external \"inversify\""],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QAC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CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,IAAI;QACN,IAAI,eAAM,CAAC,KAAK,EAAE;YACd,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAoC,gCAAgC,EAAE;YACrG,KAAK,EAAE,6BAA6B;SACvC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,EAAE;YACP,OAAO;SACV;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,EAAE;YAChD,OAAO,EAAE;gBACL,EAAE,EAAE,IAAI,CAAC,EAAE;aACd;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAChD,CAAC;CACJ;AAhDY,gBAAgB;IAD5B,sBAAU,EAAE;IAGJ,6BAAM,CAAC,iBAAU,CAAC,gBAAgB,CAAC;IAEnC,6BAAM,CAAC,QAAQ,CAAC;GAJZ,gBAAgB,CAgD5B;AAhDY,4CAAgB;;;;;;;;;;;;;;;ACR7B,wGAAoD;AACpD,0FAAuD;AACvD,iFAAmC;AAEnC,kBAAe,IAAI,qBAAO,CAAC;IACvB,MAAM,EAAN,gBAAM;IACN,mBAAmB,EAAE,CAAC,oCAAuB,CAAC;CACjD,CAAC,CAAC;;;;;;;;;;;;ACPH,+C;;;;;;;;;;;ACAA,sD;;;;;;;;;;;ACAA,oC;;;;;;;;;;;ACAA,sC","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\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 } from '../migration/bot-user-migration';\n\nexport const propertyContainerModule: (settings) => interfaces.ContainerModule = () =>\n new ContainerModule((bind: interfaces.Bind) => {\n bind('MongodbMigration').to(BotUserMigration).whenTargetNamed(BotUserMigration.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 \"extend enum PostTypeEnum{\\n ALERT\\n CARD\\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","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(\"envalid\");","module.exports = require(\"inversify\");"],"sourceRoot":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
package/lib/module.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@messenger-box/property-ext-server",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.192",
|
|
4
4
|
"description": "Extension to Messenger to support property",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"typescript": {
|
|
65
65
|
"definition": "lib/index.d.ts"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "15646216bcda0a4fbe9b33f72ca1a50ce9a6da15"
|
|
68
68
|
}
|